From d60fbfa314db5416cb1025a74979aae3ab22c4a4 Mon Sep 17 00:00:00 2001 From: Prappo Date: Thu, 2 May 2024 21:33:22 +0600 Subject: [PATCH 01/11] Sync from Pro --- includes/core/admin/class-notice-manager.php | 13 +- includes/core/admin/functions/notices.php | 114 +- includes/core/assets/css/admin/settings.scss | 5 + includes/core/assets/css/simpay-admin.min.css | 2 +- ...dmin-dashboard-widget-report-css.asset.php | 2 +- ...ay-admin-dashboard-widget-report.asset.php | 2 +- .../simpay-admin-dashboard-widget-report.js | 2 +- ...admin-form-template-explorer-css.asset.php | 2 +- ...pay-admin-form-template-explorer.asset.php | 2 +- .../simpay-admin-form-template-explorer.js | 8 +- .../js/dist/simpay-admin-help-css.asset.php | 2 +- .../js/dist/simpay-admin-help.asset.php | 2 +- .../core/assets/js/dist/simpay-admin-help.js | 4 +- .../simpay-admin-notifications-css.asset.php | 2 +- .../dist/simpay-admin-notifications.asset.php | 2 +- .../js/dist/simpay-admin-notifications.js | 4 +- ...-admin-page-activity-reports-css.asset.php | 2 +- ...mpay-admin-page-activity-reports.asset.php | 2 +- .../simpay-admin-page-activity-reports.js | 6 +- ...mpay-admin-page-setup-wizard-css.asset.php | 2 +- .../simpay-admin-page-setup-wizard.asset.php | 2 +- .../js/dist/simpay-admin-page-setup-wizard.js | 2 +- includes/core/assets/js/dist/simpay-admin.js | 2 +- .../js/dist/simpay-block-button.asset.php | 2 +- .../assets/js/dist/simpay-block-button.js | 2 +- .../simpay-block-payment-form-css.asset.php | 2 +- .../dist/simpay-block-payment-form.asset.php | 2 +- .../js/dist/simpay-block-payment-form.js | 2 +- .../src/admin/help/components/panel/panel.js | 3 +- .../help/components/panel/search-control.js | 67 - includes/core/assets/js/src/admin/index.js | 3 +- .../card-latest-payments/payment.js | 99 +- .../template-explorer/search-control.js | 67 - .../payment-form/template-explorer/sidebar.js | 7 +- includes/core/bootstrap/compatibility.php | 6 +- includes/core/forms/functions.php | 2 +- .../payment-confirmation-template-tags.php | 63 +- includes/core/settings/register-emails.php | 5 + languages/stripe.pot | 169 +- package-lock.json | 2964 ++++++++++------- package.json | 2 +- readme.txt | 2 +- .../PaymentProcessingConfirmationEmail.php | 90 + .../PaymentProcessingNotificationEmail.php | 107 + .../PaymentRefundedConfirmationEmail.php | 105 + .../SubscriptionCancellationConfirmation.php | 99 + .../SubscriptionCancellationNotification.php | 116 + src/Emails/EmailServiceProvider.php | 46 +- src/Emails/EmailSubscriber.php | 180 + src/NotificationInbox/Database/Query.php | 0 src/NotificationInbox/Database/Schema.php | 0 src/NotificationInbox/Database/Table.php | 0 src/Plugin.php | 71 +- .../Internal/Payment/PaymentUpdateRoute.php | 456 +++ .../Payment/ProPaymentCreateRoute.php | 384 +++ .../Internal/Payment/TaxCalculationRoute.php | 385 +++ .../Payment/UpdatePaymentMethodRoute.php | 179 + .../Internal/Payment/ValidateCouponRoute.php | 148 + .../Internal/Report/LatestPaymentsReport.php | 35 +- src/Transaction/Database/Query.php | 0 src/Transaction/Database/Schema.php | 10 + src/Transaction/Database/Table.php | 20 +- src/Transaction/TransactionObserver.php | 64 +- stripe-checkout.php | 9 +- vendor/autoload.php | 2 +- vendor/composer/autoload_psr4.php | 7 + vendor/composer/autoload_real.php | 10 +- vendor/composer/autoload_static.php | 58 +- vendor/composer/installed.json | 42 +- vendor/composer/installed.php | 16 +- 70 files changed, 4763 insertions(+), 1531 deletions(-) delete mode 100644 includes/core/assets/js/src/admin/help/components/panel/search-control.js delete mode 100644 includes/core/assets/js/src/admin/payment-form/template-explorer/search-control.js create mode 100644 src/Emails/Email/PaymentProcessingConfirmationEmail.php create mode 100644 src/Emails/Email/PaymentProcessingNotificationEmail.php create mode 100644 src/Emails/Email/PaymentRefundedConfirmationEmail.php create mode 100644 src/Emails/Email/SubscriptionCancellationConfirmation.php create mode 100644 src/Emails/Email/SubscriptionCancellationNotification.php mode change 100755 => 100644 src/NotificationInbox/Database/Query.php mode change 100755 => 100644 src/NotificationInbox/Database/Schema.php mode change 100755 => 100644 src/NotificationInbox/Database/Table.php create mode 100644 src/RestApi/Internal/Payment/PaymentUpdateRoute.php create mode 100644 src/RestApi/Internal/Payment/ProPaymentCreateRoute.php create mode 100644 src/RestApi/Internal/Payment/TaxCalculationRoute.php create mode 100644 src/RestApi/Internal/Payment/UpdatePaymentMethodRoute.php create mode 100644 src/RestApi/Internal/Payment/ValidateCouponRoute.php mode change 100755 => 100644 src/Transaction/Database/Query.php mode change 100755 => 100644 src/Transaction/Database/Schema.php mode change 100755 => 100644 src/Transaction/Database/Table.php diff --git a/includes/core/admin/class-notice-manager.php b/includes/core/admin/class-notice-manager.php index 1d5ad6b4..fbb63508 100644 --- a/includes/core/admin/class-notice-manager.php +++ b/includes/core/admin/class-notice-manager.php @@ -44,22 +44,22 @@ class Notice_Manager { */ public function __construct() { self::$core_notices = array( - 'rest_api_error' => array( + 'rest_api_error' => array( 'dismissible' => false, 'type' => 'error', 'callback' => 'SimplePay\Core\Admin\Notices\no_rest_api', ), - 'ssl_error' => array( + 'ssl_error' => array( 'dismissible' => false, 'type' => 'error', 'callback' => 'SimplePay\Core\Admin\Notices\no_ssl', ), - 'php_version_56' => array( + 'php_version_72' => array( 'dismissible' => false, 'type' => 'error', - 'callback' => 'SimplePay\Core\Admin\Notices\php_version_56', + 'callback' => 'SimplePay\Core\Admin\Notices\php_version_72', ), - 'stripe_connect' => array( + 'stripe_connect' => array( 'dismissible' => true, 'type' => 'info', 'callback' => 'SimplePay\Core\Admin\Notices\stripe_connect', @@ -217,7 +217,7 @@ public static function ajax_dismiss_notice() { return wp_send_json_error(); } - $lifespan = isset( $_POST['lifespan'] ) + $lifespan = isset( $_POST['lifespan'] ) ? sanitize_text_field( $_POST['lifespan'] ) : ''; @@ -240,7 +240,6 @@ public static function link_dismiss_notice() { ? sanitize_text_field( $_GET['simpay_dismiss_notice_nonce'] ) : false; - if ( ! current_user_can( 'manage_options' ) ) { return; } diff --git a/includes/core/admin/functions/notices.php b/includes/core/admin/functions/notices.php index 8ff564f2..4893087f 100644 --- a/includes/core/admin/functions/notices.php +++ b/includes/core/admin/functions/notices.php @@ -115,8 +115,8 @@ function stripe_connect() { * * @return string */ -function php_version_56() { - $future_required_version = 5.6; +function php_version_72() { + $future_required_version = 7.2; if ( ! version_compare( PHP_VERSION, $future_required_version, '<' ) ) { return false; @@ -129,80 +129,80 @@ function php_version_56() {

-' . $future_required_version . '', + '' . PHP_VERSION . '', + '', + '' + ) + ), + array( + 'code' => true, + 'a' => array( + 'href' => true, + 'target' => true, + 'rel' => true, ), - '' . $future_required_version . '', - '' . PHP_VERSION . '', - '', - '' ) - ), - array( - 'code' => true, - 'a' => array( - 'href' => true, - 'target' => true, - 'rel' => true, - ), - ) -); -?> + ); + ?>

-7.0, 7.1, or 7.2. On a normal WordPress site, switching to PHP %1$s should never cause issues. We would however actually recommend you switch to PHP 7.1 or higher to receive the full speed and security benefits provided to more modern and fully supported versions of PHP. However, some plugins may not be fully compatible with PHP 7.x, so more testing may be required.', - 'stripe' + __( + 'In order to be compatible with future versions of WP Simple Pay, you should update your PHP version to %1$s, 7.4, or 8.0. On a normal WordPress site, switching to PHP %1$s should never cause issues. We would however actually recommend you switch to PHP 8.0 or higher to receive the full speed and security benefits provided to more modern and fully supported versions of PHP. However, some plugins may not be fully compatible with PHP 8.x, so more testing may be required.', + 'stripe' + ), + '' . $future_required_version . '' ), - '' . $future_required_version . '' - ), - array( - 'code' => true, + array( + 'code' => true, + ) ) - ) -); -?> + ); + ?>

-', - '' - ), - array( - 'a' => array( - 'href' => true, - 'target' => true, - 'rel' => true, + __( + 'Many web hosts can give you instructions on how/where to upgrade your version of PHP through their control panel, or may even be able to do it for you. If you need to change hosts, please see %1$sour hosting recommendations%2$s.', + 'stripe' + ), + '', + '' ), + array( + 'a' => array( + 'href' => true, + 'target' => true, + 'rel' => true, + ), + ) ) - ) -); -?> + ); + ?> h2:not(.nav-tab-wrapper){clip:rect(1px, 1px, 1px, 1px);height:1px;overflow:hidden;position:absolute !important;width:1px}.simpay-settings .form-table td fieldset+p,.simpay-settings .form-table td label+p,.simpay-settings .form-table td select+p,.simpay-settings .form-table td input+p{color:#666;font-style:italic}.simpay-settings .simpay-settings-subsections__subsection{display:flex;align-items:center}.simpay-settings .simpay-settings-subsections__subsection .simpay-settings-bubble{margin-left:5px}.simpay-settings .simpay-settings-visual-toggles{margin:30px 0 0;display:flex}.simpay-settings .simpay-settings-visual-toggles input[type=radio]{display:none}.simpay-settings .simpay-settings-visual-toggles__toggle{-webkit-user-select:none;-moz-user-select:none;user-select:none;min-width:180px;margin:0 30px 0 0 !important;position:relative;display:block;background-color:#fff;border-radius:4px;border:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04)}.simpay-settings .simpay-settings-visual-toggles__toggle:hover{border:1px solid #999;box-shadow:0 1px 2px rgba(0,0,0,.1)}.simpay-settings .simpay-settings-visual-toggles input[type=radio]:checked+.simpay-settings-visual-toggles__toggle{border-color:#007cba;border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px #007cba;box-shadow:0 0 0 1px var(--wp-admin-theme-color)}.simpay-settings .simpay-settings-visual-toggles__toggle-recommended,.simpay-settings .simpay-settings-visual-toggles__toggle-not-recommended{text-align:center;font-size:12px;text-transform:uppercase;font-weight:bold;margin:0;padding:5px 0;display:block;border-top-right-radius:4px;border-top-left-radius:4px}.simpay-settings .simpay-settings-visual-toggles__toggle-recommended{color:#0f8569;background:#f4f9f7}.simpay-settings .simpay-settings-visual-toggles__toggle-not-recommended{color:#b91c1b;background:#fef2f2}.simpay-settings .simpay-settings-visual-toggles__toggle-icon{margin:20px auto 15px;padding:0 15px;display:block}.simpay-settings .simpay-settings-visual-toggles__toggle-label{line-height:1.5;text-align:center;font-size:16px;font-weight:500;margin:15px;display:block}.simpay-settings .simpay-settings-visual-toggles__toggle-label small{color:#666;font-weight:normal;font-size:13px;line-height:1;display:block;margin:4px 0}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type .simpay-settings-visual-toggles__toggle{min-height:160px}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type .simpay-settings-visual-toggles__toggle-icon{width:80px;height:80px}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type input[type=radio].simpay-settings-captcha-type--is-recommended:checked+.simpay-settings-visual-toggles__toggle{border-color:#0f8569;box-shadow:0 0 0 1px #0f8569}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type input[type=radio].simpay-settings-captcha-type--is-not-recommended:checked+.simpay-settings-visual-toggles__toggle{border-color:#b91c1b;box-shadow:0 0 0 1px #b91c1b}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type label[for=simpay-settings-captcha-type-cloudflare-turnstile] .simpay-settings-visual-toggles__toggle-icon{width:120px}.simpay-settings-general-recaptcha-no_captcha_warning th,.simpay-settings-general-recaptcha-no_captcha_warning td,.simpay-settings-hcaptcha_secret_key th,.simpay-settings-hcaptcha_secret_key td,.simpay-settings-cloudflare_turnstile_secret_key th,.simpay-settings-cloudflare_turnstile_secret_key td,.simpay-settings-recaptcha_score_threshold th,.simpay-settings-recaptcha_score_threshold td{padding-bottom:50px !important}.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-summary-report,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-payment-confirmation,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-payment-notification,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-upcoming-invoice,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-manage-subscriptions,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-invoice-confirmation{display:none}.simpay-settings .simpay-settings-subsection-emails-tools{margin-left:auto}.simpay-admin-charts-period-over-period{position:relative;padding-bottom:12px}.simpay-admin-charts-period-over-period *{box-sizing:border-box}.simpay-admin-charts-period-over-period__tooltip{position:absolute;background:#fff;border:1px solid #c3c3c3;box-shadow:0 2px 6px rgba(0,0,0,.05);border-radius:2px;padding:10px 14px;display:flex;flex-direction:column;z-Index:10000;min-width:175px}.simpay-admin-charts-period-over-period__tooltip-data{white-space:nowrap;margin-bottom:8px;display:grid;grid-template-columns:1fr auto;grid-auto-rows:auto;-moz-column-gap:16px;column-gap:16px}.simpay-admin-charts-period-over-period__tooltip-data:last-child{margin-bottom:0}.simpay-admin-charts-period-over-period__tooltip-data[data-dataset="1"]{opacity:.65}.simpay-admin-charts-period-over-period__tooltip-data em{font-style:normal;text-align:right}.simpay-admin-charts-period-over-period__tooltip-delta{font-size:12px;margin:0 -14px -10px;padding:8px 14px;border-top:1px solid #eee;background:#fdfdfd;border-radius:2px;display:flex;align-items:center;justify-content:center}.simpay-admin-charts-period-over-period__tooltip-delta .simpay-admin-charts-badge{margin-right:4px}.simpay-admin-charts-period-over-period__tooltip-delta strong.is-positive{color:#006908}.simpay-admin-charts-period-over-period__tooltip-delta strong.is-negative{color:#b3093c}.simpay-admin-charts-badge{color:#2f2f2f;font-size:12px;font-weight:500;font-style:normal;line-height:1;padding:3px 6px;display:inline-flex;align-items:center;background:#f0f0f0;border-radius:100px}.simpay-admin-charts-badge.is-positive{color:#006908;background-color:#d7f7c2}.simpay-admin-charts-badge.is-negative{color:#b3093c;background-color:#ffe7f2}.simpay-admin-charts-badge__icon{width:15px;height:15px}.simpay-admin-charts-no-data{position:absolute;top:0;left:0;display:flex;justify-content:center;align-items:center;background:rgba(255,255,255,.5);z-index:2}.simpay-admin-charts-no-data>div{text-align:center;padding:24px;background:#fff;border:1px solid #c3c3c3;box-shadow:0 2px 6px rgba(0,0,0,.1);border-radius:2px;max-width:60%}.simpay-admin-charts-no-data strong{font-size:15px;margin-bottom:8px;display:block}.button.button-large.simpay-button-large{font-size:14px;line-height:30px;padding:4px 12px}.simpay-copy-hidden-input{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}.fixed .column-livemode{width:15%;text-align:right}@media screen and (max-width: 782px){.fixed .column-livemode{text-align:left}}.fixed .column-livemode .simpay-badge{margin-top:3px}.fixed .column-shortcode{width:25%}.fixed .column-shortcode .simpay-shortcode{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}.post-type-simple-pay .misc-pub-curtime,.post-type-simple-pay .misc-pub-visibility{display:none}.simpay-metabox-title{border:1px solid #eee}.simpay-shortcode-section{border-top:1px solid #ddd;border-width:1px 0;padding-top:15px;padding-bottom:15px;position:relative}.simpay-shortcode-section label{display:block;margin-bottom:6px}.simpay-shortcode-section label .dashicons{color:#8c8f94;margin-right:3px}.simpay-shortcode-section .simpay-copy-button{line-height:normal;position:absolute;right:20px;bottom:20px;border:0;background:none;box-shadow:none;padding:0}.simpay-shortcode-section .simpay-copy-button:hover{border:0;background:none;box-shadow:none}.simpay-shortcode-section .simpay-copy-button .dashicons{color:#3c434a}.simpay-shortcode{width:100%;padding:8px;line-height:1;margin:0;height:32px;resize:none}.simpay-badge{color:#3f3f46;text-align:center;line-height:1;padding:5px 7px;border-radius:3px;background:#e4e4e7;border:0;box-shadow:none;display:inline-flex;align-items:center}button.simpay-badge{cursor:pointer}button.simpay-badge:hover{background:#d4d4d8}.simpay-badge__icon{opacity:.8;margin:2px 5px 0 0}.simpay-badge--green{color:#0e6245;background:#cbf4c9}.simpay-badge--yellow{color:#983705;background:#f8e5b9}.simpay-stripe-account-info{display:flex;align-items:center;margin-bottom:8px;position:relative}.simpay-stripe-account-info .spinner{float:none;margin-top:0;margin-left:0}.simple-pay_page_simpay_settings .simpay-settings-upgrade,.post-type-simple-pay .simpay-settings-upgrade{margin-top:20px;padding:1px;position:relative;background:#fff;border-radius:4px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.2),0 5px 10px rgba(0,0,0,.1);max-width:677px}.simple-pay_page_simpay_settings .simpay-settings-upgrade__inner,.post-type-simple-pay .simpay-settings-upgrade__inner{text-align:center;margin:0;padding:30px}.simple-pay_page_simpay_settings .simpay-settings-upgrade h3,.post-type-simple-pay .simpay-settings-upgrade h3{line-height:1.5;font-size:22px;margin:0 0 1.5rem}.simple-pay_page_simpay_settings .simpay-settings-upgrade ul,.post-type-simple-pay .simpay-settings-upgrade ul{margin:1.5rem 0 calc(1.5rem - 6px);display:flex;flex-wrap:wrap;justify-content:center}@media screen and (min-width: 782px){.simple-pay_page_simpay_settings .simpay-settings-upgrade ul,.post-type-simple-pay .simpay-settings-upgrade ul{margin-left:4rem;margin-right:4rem}}.simple-pay_page_simpay_settings .simpay-settings-upgrade li,.post-type-simple-pay .simpay-settings-upgrade li{font-size:15px;margin:6px 0;width:100%}.simple-pay_page_simpay_settings .simpay-settings-upgrade li a,.post-type-simple-pay .simpay-settings-upgrade li a{color:#3c434a;text-decoration:none}.simple-pay_page_simpay_settings .simpay-settings-upgrade li a:hover,.post-type-simple-pay .simpay-settings-upgrade li a:hover{color:var(--wp-admin-theme-color);text-decoration:underline}@media screen and (min-width: 782px){.simple-pay_page_simpay_settings .simpay-settings-upgrade li,.post-type-simple-pay .simpay-settings-upgrade li{text-align:left;width:50%}}.simple-pay_page_simpay_settings .simpay-settings-upgrade .button.button-large,.post-type-simple-pay .simpay-settings-upgrade .button.button-large{font-size:17px;line-height:30px;padding:10px 20px}.simple-pay_page_simpay_settings .simpay-settings-upgrade small,.post-type-simple-pay .simpay-settings-upgrade small{color:#666;margin:15px 0 0;display:block}.simple-pay_page_simpay_settings .simpay-settings-upgrade .dashicons-yes,.post-type-simple-pay .simpay-settings-upgrade .dashicons-yes{color:#428bca}.simple-pay_page_simpay_settings .simpay-settings-upgrade .button-link,.post-type-simple-pay .simpay-settings-upgrade .button-link{position:absolute;top:0;right:0;font-size:20px;color:#666;font-weight:bold;text-decoration:none;margin-left:5px;padding:6px 10px;z-index:2}.simple-pay_page_simpay_settings .simpay-settings-upgrade .button-link:hover,.simple-pay_page_simpay_settings .simpay-settings-upgrade .button-link:active,.simple-pay_page_simpay_settings .simpay-settings-upgrade .button-link:focus,.post-type-simple-pay .simpay-settings-upgrade .button-link:hover,.post-type-simple-pay .simpay-settings-upgrade .button-link:active,.post-type-simple-pay .simpay-settings-upgrade .button-link:focus{color:#666;text-decoration:none}.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext{text-align:center;margin:0;padding:30px 20px 20px;background-color:#fcf9e8;border:1px solid #edeac9;border-width:1px 0 0;position:relative;border-radius:0;border-bottom-left-radius:4px;border-bottom-right-radius:4px}@media screen and (min-width: 782px){.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext{padding-left:4rem;padding-right:4rem}}.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext svg,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext svg{background:#00a32a;fill:#fff;border-radius:50%;border:4px solid #fff;box-shadow:0 0 0 1px #edeac9;width:28px;height:28px;position:absolute;top:-18px;left:50%;margin-left:-18px}.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext u,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext u{text-decoration:none;font-weight:bold;color:#00a32a}.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext a,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext a{font-weight:normal;display:inline-block}#simpay-payment-form-settings table{width:100%;border-collapse:collapse}#simpay-payment-form-settings ::-webkit-input-placeholder{color:#9ba1a9}#simpay-payment-form-settings ::-moz-placeholder{color:#9ba1a9;opacity:1}#simpay-payment-form-settings :-ms-input-placeholder{color:#9ba1a9}#simpay-payment-form-settings .inside{margin:0;padding:0}#simpay-payment-form-settings .simpay-panel-field .toolbar{margin-bottom:-4px}#simpay-payment-form-settings .simpay-panel-field .toolbar .simpay-field-select{margin:0 0 4px;width:auto;max-width:70%}#simpay-payment-form-settings .simpay-tabs{margin:0;padding:0;list-style:none;background:#fafafa;border-right:1px solid #ccd0d4;line-height:1em;position:relative;flex:0 0 25%}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-tabs{flex-basis:100%;flex-grow:1;border-right:0}}#simpay-payment-form-settings .simpay-tabs li{margin:0;padding:0}#simpay-payment-form-settings .simpay-tabs li:first-child{margin-top:12px}#simpay-payment-form-settings .simpay-tabs li:last-child{margin-bottom:20px}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-tabs li:last-child{margin-bottom:0}}#simpay-payment-form-settings .simpay-tabs li.active{margin-left:-1px;box-shadow:0 1px 1px rgba(0,0,0,.04);position:relative}#simpay-payment-form-settings .simpay-tabs li.active:focus:after{display:none}#simpay-payment-form-settings .simpay-tabs li.active:before,#simpay-payment-form-settings .simpay-tabs li.active:after{content:"";width:calc(100% + 1px);height:1px;background:#ccd0d4;position:absolute;top:0;left:0;right:0;z-index:2}#simpay-payment-form-settings .simpay-tabs li.active:after{top:auto;bottom:0}#simpay-payment-form-settings .simpay-tabs li.active a{font-weight:bold;background-color:#fff;position:relative;margin-right:-1px}#simpay-payment-form-settings .simpay-tabs li.active a:before{content:"";position:absolute;top:0;left:0;bottom:0;width:4px;height:100%;background:currentColor;z-index:3}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-tabs li.active a{margin-right:0}}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item{display:flex;align-items:center;line-height:20px;margin:0;padding:8px 10px 8px 14px;text-decoration:none;transition:all .05s ease-in-out}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item svg,#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item .dashicons{margin-right:6px}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item{padding:18px}}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item:focus{outline:0;position:relative;z-index:3;box-shadow:inset 0 0 0 1px currentColor,0 0 0 1px currentColor}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item[href="#purchase-restrictions-settings-panel"],#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item[href="#payment-page-settings-panel"]{margin-bottom:20px;position:relative}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item[href="#purchase-restrictions-settings-panel"]:after,#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item[href="#payment-page-settings-panel"]:after{content:"";position:absolute;left:14px;right:14px;bottom:-10px;width:calc(100% - 28px);height:1px;background:#eaeaea}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item span>span{color:#f18500;font-size:12px;font-weight:600;margin:0 0 0 5px;display:inline-block}#simpay-payment-form-settings .simpay-tabs li:not(.active) .simpay-tab-item{color:inherit}#simpay-payment-form-settings .simpay-panels-wrap{background:#fff;display:flex}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-panels-wrap{flex-direction:column}}#simpay-payment-form-settings .simpay-panels{flex:0 0 75%;display:flex}@media screen and (min-width: 1400px){#simpay-payment-form-settings .simpay-panels{flex-basis:75%}}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-panels{flex-basis:100%}}#simpay-payment-form-settings .simpay-panel,#simpay-payment-form-settings .simpay-panel-section{width:100%}#simpay-payment-form-settings .simpay-panel>table,#simpay-payment-form-settings .simpay-panel>table>tr,#simpay-payment-form-settings .simpay-panel>table>tbody,#simpay-payment-form-settings .simpay-panel>table>tbody>tr,#simpay-payment-form-settings .simpay-panel>table>thead,#simpay-payment-form-settings .simpay-panel>table>thead>tr{display:block;width:100%}#simpay-payment-form-settings .simpay-panel>table:last-child>tbody:last-child>tr:last-child>td{border-bottom:0}#simpay-payment-form-settings .simpay-panel-field--requires-upgrade{position:relative}#simpay-payment-form-settings .simpay-panel-field--requires-upgrade td>div{margin-right:80px}#simpay-payment-form-settings .simpay-panel-field--requires-upgrade td>div .button-small{position:absolute;top:calc(50% - 13px);right:18px}#simpay-payment-form-settings .simpay-panel-field,#simpay-payment-form-settings .simpay-panel-field>td,#simpay-payment-form-settings .simpay-panel-field>th{text-align:left;display:block}#simpay-payment-form-settings .simpay-panel-field>td,#simpay-payment-form-settings .simpay-panel-field>th{width:calc(100% - 36px);margin-left:18px;margin-right:18px}#simpay-payment-form-settings .simpay-panel-field th{font-weight:bold;padding-top:18px;padding-bottom:5px}#simpay-payment-form-settings .simpay-panel-field td{border-bottom:1px solid #ddd;padding-bottom:18px}#simpay-payment-form-settings .simpay-panel-field p.description{margin-top:4px}#simpay-payment-form-settings .simpay-panel-field p.description:last-of-type{margin-bottom:0}#simpay-payment-form-settings .simpay-panel-field .simpay-panel-field__nested{margin-top:18px}#simpay-payment-form-settings .simpay-panel-field .simpay-panel-field__nested label{font-weight:bold;display:block;margin-bottom:4px}#simpay-payment-form-settings .simpay-panel-field .simpay-field-select,#simpay-payment-form-settings .simpay-panel-field .simpay-field-text{min-width:75%;max-width:100%}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-panel-field .simpay-field-select,#simpay-payment-form-settings .simpay-panel-field .simpay-field-text{min-width:0;width:100%}}#simpay-payment-form-settings .simpay-panel-field .simpay-field-textarea{width:100%;max-width:100%}#simpay-payment-form-settings .simpay-panel-field .notice:last-of-type{margin-bottom:0}#simpay-payment-form-settings .simpay-panel-field .error,#simpay-payment-form-settings .simpay-panel-field .simpay-important{color:#a94442;font-weight:normal}#simpay-payment-form-settings .simpay-panel-field .simpay-image-preview-wrap{position:relative;margin-top:12px}#simpay-payment-form-settings .simpay-panel-field .simpay-image-preview-wrap .simpay-remove-image-preview{position:absolute;top:-15px;left:-15px;cursor:pointer;background-color:#fff}#simpay-payment-form-settings .simpay-panel-field .simpay-image-preview-wrap .simpay-remove-image-preview::before{font-size:22px;line-height:26px}#simpay-payment-form-settings .simpay-panel-field .simpay-image-preview-wrap .simpay-image-preview{max-height:128px;max-width:128px;border:1px solid #ddd}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box{background-color:#f4f4f4;border:1px solid #e5e5e5;padding:18px;margin-top:18px;position:relative}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box__dismiss{color:inherit;text-decoration:none;position:absolute;top:8px;right:8px}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box__dismiss .dashicons-dismiss{font-size:16px;width:16px;height:16px}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box h3{font-size:18px;font-weight:600;margin:0;padding:0}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box p{font-size:14px}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box p:last-child{margin-bottom:0}#simpay-payment-form-settings .simpay-metabox-content{margin-bottom:-1px;background-color:#f5f5f5;border:1px solid #c3c4c7;border-width:1px 0;box-shadow:0 1px 1px rgba(0,0,0,.04);position:relative}#simpay-payment-form-settings .simpay-show-if,#simpay-payment-form-settings .simpay-panel-hidden{display:none}#simpay-payment-form-settings .simpay-payment-methods{border:1px solid #ccd0d4;border-radius:4px;box-shadow:0 1px 1px rgba(0,0,0,.04)}#simpay-payment-form-settings .simpay-panel-field-payment-method{display:block;border-top:1px solid #ccd0d4;padding:7px;box-sizing:border-box}#simpay-payment-form-settings .simpay-panel-field-payment-method:first-child{border-top:0;border-top-left-radius:4px;border-top-right-radius:4px}#simpay-payment-form-settings .simpay-panel-field-payment-method__enable{display:flex;align-items:center}#simpay-payment-form-settings .simpay-panel-field-payment-method__enable input[type=checkbox]{margin-top:0;margin-right:8px}#simpay-payment-form-settings .simpay-panel-field-payment-method__help{text-decoration:none}#simpay-payment-form-settings .simpay-panel-field-payment-method__help .dashicons{font-size:18px;width:18px;height:18px}#simpay-payment-form-settings .simpay-panel-field-payment-method__restrictions,#simpay-payment-form-settings .simpay-panel-field-payment-method__restrictions-ach{margin-left:72px}#simpay-payment-form-settings .simpay-panel-field-payment-method__icon{border-radius:3px;overflow:hidden;margin:0 8px 0 5px;width:30px;height:30px;flex-shrink:0}#simpay-payment-form-settings .simpay-panel-field-payment-method__icon svg{width:30px;height:30px}#simpay-payment-form-settings .simpay-panel-field-payment-method__configure{display:flex;align-items:center;justify-content:center}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metaboxes:not(.is-empty),#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metaboxes:not(.is-empty){border:1px solid #ccd0d4;box-shadow:0 1px 1px rgba(0,0,0,.04);border-radius:4px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-handlediv,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-handlediv{display:none;float:right;width:36px;height:36px;margin:0;padding:0;border:0;background:none;cursor:pointer;display:block}#simpay-global-settings .simpay-metaboxes-wrapper .postbox.closed .simpay-handlediv .toggle-indicator:before,#simpay-form-settings .simpay-metaboxes-wrapper .postbox.closed .simpay-handlediv .toggle-indicator:before{content:""}#simpay-global-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv:focus,#simpay-form-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv:focus{outline:0}#simpay-global-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv:focus .toggle-indicator:before,#simpay-form-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv:focus .toggle-indicator:before{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}#simpay-global-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv .toggle-indicator:before,#simpay-form-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv .toggle-indicator:before{margin-top:4px;width:20px;border-radius:50%;text-indent:-1px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox{background:#fff;border:1px solid #ccd0d4;margin:0 -1px -1px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .hndle,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .hndle{border:0}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox select,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox select{font-weight:400}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox:first-of-type,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox:first-of-type{margin-top:-1px;border-top-left-radius:4px;border-top-right-radius:4px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox:last-of-type,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox:last-of-type{margin-bottom:-1px;border-bottom-left-radius:4px;border-bottom-right-radius:4px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox:last-of-type .simpay-metabox-content,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox:last-of-type .simpay-metabox-content{border-bottom-left-radius:4px;border-bottom-right-radius:4px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2{cursor:pointer;display:flex;align-items:center;padding:10px 0 10px 12px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .simpay-field-type,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .simpay-field-type{font-size:90%;color:gray;font-weight:normal;text-decoration:none;margin-left:10px}@media screen and (max-width: 782px){#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .simpay-field-type,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .simpay-field-type{display:none}}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .dashicons-handle,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .dashicons-handle{cursor:move}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 strong,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 strong{font-size:95%;margin-left:8px;display:flex;align-items:center;flex-grow:1}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 svg,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 svg{border-radius:3px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 select,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 select{font-family:sans-serif;max-width:20%;margin:.25em .25em .25em 0}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2.fixed,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2.fixed{cursor:pointer !important}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .dashicons-menu,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .dashicons-menu{cursor:move}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions{padding:9px 18px;justify-content:space-between;display:flex;align-items:center}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id{display:flex;align-items:center}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id input,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id input{margin:0 2px 0 5px;width:50px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id a,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id a{text-decoration:none}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .button-link.simpay-remove-field-link,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .button-link.simpay-remove-field-link{color:#a00}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .button-link.simpay-remove-field-link:hover,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .button-link.simpay-remove-field-link:hover{color:#dc3232}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox table,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox table{border-spacing:0;width:100%}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox table.simpay-inner-table,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox table.simpay-inner-table{border:none;padding:0 1em}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox table tr td,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox table tr td{border-bottom-color:#ccd0d4}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-remove-plan,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-remove-plan{color:#a00}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-custom-field-payment-button .dashicons-menu,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-custom-field-payment-button .dashicons-menu{visibility:hidden}#simpay-global-settings .sortable-placeholder,#simpay-form-settings .sortable-placeholder{margin:5px;display:block;min-height:36px}#simpay-global-settings .chosen-container,#simpay-form-settings .chosen-container{min-width:20em;max-width:30em}#simpay-global-settings .simpay-field.simpay-small-text,#simpay-form-settings .simpay-field.simpay-small-text{width:7em}#simpay-global-settings .simpay-field.simpay-medium-text,#simpay-form-settings .simpay-field.simpay-medium-text{width:15em}#simpay-global-settings .simpay-field-radios ul,#simpay-form-settings .simpay-field-radios ul{margin:0}#simpay-global-settings .simpay-field-radios>i,#simpay-form-settings .simpay-field-radios>i{margin-left:5px;vertical-align:middle}#simpay-global-settings ul.simpay-field-radios-inline,#simpay-form-settings ul.simpay-field-radios-inline{margin:0 0 -10px}#simpay-global-settings ul.simpay-field-radios-inline li,#simpay-form-settings ul.simpay-field-radios-inline li{display:inline-block;margin:0 10px 10px 0}#simpay-global-settings ul.simpay-field-radios-inline li:last-child,#simpay-form-settings ul.simpay-field-radios-inline li:last-child{margin-right:0}#simpay-global-settings .simpay-currency-field,#simpay-form-settings .simpay-currency-field{display:flex;align-items:center}>#simpay-global-settings .simpay-currency-field:focus,>#simpay-form-settings .simpay-currency-field:focus{position:relative;z-index:5}#simpay-global-settings .simpay-currency-symbol,#simpay-form-settings .simpay-currency-symbol{margin:0;padding-left:8px;padding-right:8px;line-height:28px;font-size:14px}@media screen and (max-width: 782px){#simpay-global-settings .simpay-currency-symbol,#simpay-form-settings .simpay-currency-symbol{line-height:38px}}#simpay-global-settings .simpay-currency-symbol-left,#simpay-form-settings .simpay-currency-symbol-left{border-top-left-radius:4px;border-bottom-left-radius:4px}#simpay-global-settings .simpay-currency-symbol-right,#simpay-form-settings .simpay-currency-symbol-right{border-top-right-radius:4px;border-bottom-right-radius:4px}#simpay-global-settings div.simpay-currency-symbol,#simpay-form-settings div.simpay-currency-symbol{border-color:#7e8993;border-style:solid;background-color:#fff}#simpay-global-settings select.simpay-currency-symbol,#simpay-form-settings select.simpay-currency-symbol{padding-right:25px}#simpay-global-settings .simpay-currency-symbol-left,#simpay-form-settings .simpay-currency-symbol-left{border-width:1px 0 1px 1px}#simpay-global-settings .simpay-currency-symbol-left+.simpay-field-amount,#simpay-form-settings .simpay-currency-symbol-left+.simpay-field-amount{border-radius:0 4px 4px 0}#simpay-global-settings .simpay-currency-symbol-right,#simpay-form-settings .simpay-currency-symbol-right{border-width:1px 1px 1px 0}#simpay-global-settings .simpay-field-amount,#simpay-form-settings .simpay-field-amount{margin:0;padding-left:8px;padding-right:8px;font-size:14px;width:6em;position:relative;z-index:2;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px}#simpay-global-settings .simpay-error,#simpay-form-settings .simpay-error{color:red}#simpay-global-settings .simpay-docs-link-wrap,#simpay-form-settings .simpay-docs-link-wrap{position:absolute;right:0;bottom:0;color:#666;font-size:13px;font-style:italic;padding:15px 18px}#simpay-global-settings .simpay-docs-link-wrap a .dashicons-editor-help,#simpay-form-settings .simpay-docs-link-wrap a .dashicons-editor-help{color:#666;text-decoration:none;width:17px;height:17px;font-size:17px;padding-left:4px}#simpay-global-settings .simpay-docs-icon,#simpay-form-settings .simpay-docs-icon{color:#666}#simpay-global-settings .simpay-docs-icon,#simpay-global-settings .simpay-docs-icon .dashicons-editor-help,#simpay-form-settings .simpay-docs-icon,#simpay-form-settings .simpay-docs-icon .dashicons-editor-help{text-decoration:none;width:17px;height:17px;font-size:17px}.button.button-primary.simpay-upgrade-btn{background-color:#428bca;border:1px solid #428bca;color:#fff;display:inline-block}.button.button-primary.simpay-upgrade-btn:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px #2d6ca2}.button.button-primary.simpay-upgrade-btn:hover{background-color:#037ad0;border:1px solid #428bca}.simpay-upgrade-btn-subtext{color:#3c434a;font-size:14px;line-height:1.5;text-align:center;margin:40px 0 0;padding:30px 35px 20px;background-color:#fcf9e8;border:3px solid #ebe29a;border-radius:4px;position:relative}.simpay-upgrade-btn-subtext svg{background:#00a32a;fill:#fff;border-radius:50%;border:3px solid #ebe29a;width:28px;height:28px;position:absolute;top:-14px;left:50%;margin-left:-14px}.simpay-upgrade-btn-subtext u{text-decoration:none;font-weight:bold;color:#00a32a}.simpay-upgrade-btn-subtext a{text-decoration:none;display:block;margin-top:6px;font-weight:bold}.post-type-simple-pay #post-body-content{display:none}.simpay-card{margin:0 0 20px;padding:30px;background:#fff;border:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04)}.simpay-card,.simpay-card p{line-height:1.5;font-size:16px}.simpay-card h3{line-height:1.6;font-size:18px;margin:0 0 20px;color:#23282c}.simpay-card p{margin:0 0 20px}.simpay-card p:last-child,.simpay-card ul:last-child{margin-bottom:0}.simpay-card figure{float:right;margin:0 0 30px 30px;max-width:400px}.simpay-card figure iframe,.simpay-card figure img{max-width:100%}.simpay-card figure figcaption{text-align:center}@media screen and (max-width: 782px){.simpay-card figure{margin:0 0 30px;max-width:100%;float:none}}.simpay-doc-suggestions{width:100%;display:flex;flex-wrap:wrap;padding:0}.simpay-doc-suggestion{text-align:center;display:flex;flex-direction:column;justify-content:center;align-items:center;flex:0 1 33.333%;padding:30px;border-right:1px solid #c3c4c7;box-sizing:border-box}.simpay-doc-suggestion:nth-child(3n){border-right:0}@media screen and (max-width: 782px){.simpay-doc-suggestion{flex:0 1 100%;border-bottom:1px solid #c3c4c7;border-right:0}.simpay-doc-suggestion:last-child{border-bottom:0}}.simpay-doc-suggestion h3{font-size:20px;margin-bottom:10px}.simpay-doc-suggestion p{font-size:15px}.simpay-doc-suggestion .dashicons{font-size:40px;width:40px;height:40px;display:block;margin-bottom:10px}.simpay-doc-suggestion .button-large{font-size:16px}.simpay-addons{display:flex;flex-wrap:wrap;justify-content:space-between;margin:20px 0}.simpay-addon{background:#fff;border:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04);margin-bottom:20px;display:flex;flex-direction:column;flex-basis:calc(33% - 10px);box-sizing:border-box}@media screen and (max-width: 782px){.simpay-addon{flex-basis:100%}}.simpay-addon img{float:left;max-width:75px}.simpay-addon h5{margin:0 0 10px 100px;font-size:16px}.simpay-addon__details{padding:20px;flex:1 0 auto}.simpay-addon__actions{display:flex;align-items:center;justify-content:space-between;flex:0 1 auto;background-color:#f7f7f7;border-top:1px solid #ddd;margin-top:auto;padding:20px;position:relative}.simpay-addon__actions .msg{text-align:center;justify-content:center;display:flex;align-items:center;position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;background-color:#f7f7f7;z-index:3}.simpay-addon .error,.simpay-addon .status-label.status-installed{color:#d63638}.simpay-addon .success,.simpay-addon .status-label.status-active{color:#00a32a}.simpay-addon .addon-desc{margin:0 0 0 100px}.form-table td .simpay-stripe-connect-help{margin:15px 0;display:flex;align-items:center}.form-table td .simpay-stripe-connect-help .dashicons{margin-right:4px}.simpay-currency-field{display:flex;align-items:center}>.simpay-currency-field:focus{position:relative;z-index:5}.simpay-currency-symbol{margin:0;padding-left:8px;padding-right:8px;line-height:28px;font-size:14px}@media screen and (max-width: 782px){.simpay-currency-symbol{line-height:38px}}.simpay-currency-symbol-left{border-top-left-radius:4px;border-bottom-left-radius:4px}.simpay-currency-symbol-right{border-top-right-radius:4px;border-bottom-right-radius:4px}div.simpay-currency-symbol{border-color:#7e8993;border-style:solid;background-color:#fff}select.simpay-currency-symbol{padding-right:25px}.simpay-currency-symbol-left{border-width:1px 0 1px 1px}.simpay-currency-symbol-left+.simpay-field-amount{border-radius:0 4px 4px 0}.simpay-currency-symbol-right{border-width:1px 1px 1px 0}.simpay-field-amount{margin:0;padding-left:8px;padding-right:8px;font-size:14px;width:6em;position:relative;z-index:2;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px}.simpay-template-explorer-open .show-settings{display:none !important}.simpay-branding-bar{margin:0 -20px;padding:14px 22px;background:#fff;border-bottom:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04);width:calc(100% + 20px);display:flex;justify-content:space-between;box-sizing:border-box}.site-health .simpay-branding-bar{display:none}.simpay-branding-bar__title{display:flex;align-items:center;margin:8px 0}.simpay-branding-bar__logo{width:200px}.simpay-branding-bar__divider{color:#dadbdf;font-size:23px;font-weight:400;margin:0 15px}.simpay-branding-bar__actions{display:flex;align-items:center}.simpay-branding-bar__actions>div{margin-left:10px;min-width:40px}.simpay-branding-bar__actions-button{color:#000;cursor:pointer;padding:10px;width:40px;height:40px;background-color:#f3f4f5;border-radius:50%;border:0;box-shadow:none;position:relative;transition:background-color .2s ease;box-sizing:border-box;display:block}.simpay-branding-bar__actions-button:hover{background-color:#e5e5e5}.simpay-branding-bar__actions-button:active,.simpay-branding-bar__actions-button:focus{box-shadow:0 0 0 2px var(--wp-admin-theme-color)}.simpay-branding-bar__actions-button-count{font-weight:600;font-size:10px;line-height:16px;color:#fff;margin:0;background-color:#df2a4a;border-radius:100%;width:16px;height:16px;position:absolute;top:-8px;left:50%;margin-left:-8px}.simpay-branding-bar .wp-heading-inline{font-size:23px;font-weight:400;margin:0}.simpay-branding-bar .page-title-action{font-weight:600;font-size:13px;line-height:normal;cursor:pointer;text-shadow:none;text-decoration:none;margin-left:10px;padding:4px 8px;border:1px solid currentColor;border-radius:2px;background:#f6f7f7}.simpay-landing-zone{text-align:center;max-width:700px;margin:40px auto}.simpay-landing-zone__title{font-size:26px;font-weight:600;margin:0 0 1.5rem;padding:0}.simpay-landing-zone__subtitle{font-size:17px;color:#666;margin:.25rem 0}.simpay-landing-zone__subtitle strong{color:#444}.simpay-landing-zone section{margin:2rem 0}.simpay-landing-zone__empty-state-graphic img{width:425px}.simpay-landing-zone__screenshot>*{vertical-align:middle}.simpay-landing-zone__screenshot-img{display:inline-block;position:relative;width:315px;padding:5px;background-color:#fff;box-shadow:0px 2px 5px 0px rgba(0,0,0,.05);border-radius:3px}.simpay-landing-zone__screenshot-img img{max-width:100%;display:block}.simpay-landing-zone__screenshot-img .hover{position:absolute;opacity:0;height:calc(100% - 10px);width:calc(100% - 10px);top:0;left:0;border:5px solid #fff;background-color:rgba(0,0,0,.15);background-image:url(data:image/svg+xml;base64,PHN2ZyBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjojZmZmZmZmMDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCIgaGVpZ2h0PSIxMDAiPjxwYXRoIGQ9Ik01MCAwYzI3LjYxNCAwIDUwIDIyLjM4NiA1MCA1MHMtMjIuMzg2IDUwLTUwIDUwUzAgNzcuNjE0IDAgNTAgMjIuMzg2IDAgNTAgMHoiIGZpbGw9IiMxNjg1YjciLz48cGF0aCBkPSJNNzMuMDIzIDY3LjA2N2wtOS4zNDQtOS4zNDRhMi4yNDcgMi4yNDcgMCAwMC0xLjU5My0uNjU2aC0xLjUyOGExOS4zOTkgMTkuMzk5IDAgMDA0LjEyNC0xMS45OTZjMC0xMC43Ny04LjcyNS0xOS40OTUtMTkuNDk0LTE5LjQ5NS0xMC43NjggMC0xOS40OTQgOC43MjYtMTkuNDk0IDE5LjQ5NSAwIDEwLjc2OCA4LjcyNiAxOS40OTMgMTkuNDk0IDE5LjQ5M2ExOS40IDE5LjQgMCAwMDExLjk5Ny00LjEyM3YxLjUyN2MwIC42LjIzNCAxLjE3Mi42NTUgMS41OTRsOS4zNDQgOS4zNDRhMi4yNCAyLjI0IDAgMDAzLjE3OCAwbDIuNjUyLTIuNjUzYTIuMjYgMi4yNiAwIDAwLjAxLTMuMTg2em0tMjcuODM1LTEwYy02LjYyNiAwLTExLjk5Ni01LjM2MS0xMS45OTYtMTEuOTk2IDAtNi42MjcgNS4zNi0xMS45OTcgMTEuOTk2LTExLjk5NyA2LjYyNiAwIDExLjk5NyA1LjM2MSAxMS45OTcgMTEuOTk3IDAgNi42MjYtNS4zNjEgMTEuOTk2LTExLjk5NyAxMS45OTZ6IiBmaWxsPSIjZmZmIi8+PC9zdmc+);background-repeat:no-repeat;background-position:center;background-size:50px;transition:all .3s}.simpay-landing-zone__screenshot-img:hover .hover{opacity:1;transition:all .3s}.simpay-landing-zone__screenshot ul{text-align:left;display:inline-block;margin:0 0 0 30px;list-style-type:none;max-width:calc(100% - 350px)}@media screen and (max-width: 782px){.simpay-landing-zone__screenshot ul{text-align:center;margin:30px auto;max-width:100%;display:block}}.simpay-landing-zone__screenshot li{margin:16px 0;padding:0;font-size:15px;color:#777;position:relative}.simpay-landing-zone__screenshot li:before{content:"";background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEzLjc3NjIgNi40NTYwNUw4LjcyMDMyIDEuNDAwMDVDOC41NzU5OSAxLjI1NTcyIDguMzgzNjQgMS4xNzY1IDguMTc4NTMgMS4xNzY1QzcuOTczMiAxLjE3NjUgNy43ODA5NiAxLjI1NTg0IDcuNjM2NjQgMS40MDAwNUw3LjE3NzYgMS44NTkyQzcuMDMzMzkgMi4wMDMyOSA2Ljk1Mzk1IDIuMTk1NzYgNi45NTM5NSAyLjQwMDk4QzYuOTUzOTUgMi42MDYwOCA3LjAzMzM5IDIuODA1MDQgNy4xNzc2IDIuOTQ5MTRMMTAuMTI3MSA1LjkwNTE2SDAuNzU2MzM0QzAuMzMzODM0IDUuOTA1MTYgMCA2LjIzNTkyIDAgNi42NTg1NFY3LjMwNzY1QzAgNy43MzAyNyAwLjMzMzgzNCA4LjA5NDM4IDAuNzU2MzM0IDguMDk0MzhIMTAuMTYwNkw3LjE3NzcyIDExLjA2NjlDNy4wMzM1MSAxMS4yMTEyIDYuOTU0MDYgMTEuMzk4NSA2Ljk1NDA2IDExLjYwMzdDNi45NTQwNiAxMS44MDg3IDcuMDMzNTEgMTEuOTk4NiA3LjE3NzcyIDEyLjE0MjhMNy42MzY3NSAxMi42MDA1QzcuNzgxMDcgMTIuNzQ0OCA3Ljk3MzMyIDEyLjgyMzUgOC4xNzg2NSAxMi44MjM1QzguMzgzNzUgMTIuODIzNSA4LjU3NjExIDEyLjc0MzggOC43MjA0MyAxMi41OTk1TDEzLjc3NjMgNy41NDM2QzEzLjkyMSA3LjM5ODgyIDE0LjAwMDUgNy4yMDU1NiAxNCA3LjAwMDExQzE0LjAwMDQgNi43OTM5OCAxMy45MjEgNi42MDA2IDEzLjc3NjIgNi40NTYwNVY2LjQ1NjA1WiIgZmlsbD0iIzQyOEJDQSIvPgo8L3N2Zz4K);background-position:center;background-repeat:no-repeat;background-size:14px;width:14px;height:14px;display:inline-block;margin:-3px 5px 0 0;vertical-align:middle}.simpay-landing-zone .button.button-large{font-size:17px;line-height:30px;padding:10px 20px}.simpay-landing-zone__purchased{display:block;margin:15px 0 0}.simpay-upgrade-modal,.simpay-upgrade-upe-modal{padding:0 !important}.simpay-upgrade-modal *,.simpay-upgrade-upe-modal *{box-sizing:border-box}.simpay-upgrade-modal__content,.simpay-upgrade-upe-modal__content{text-align:center;display:flex;flex-direction:column;align-items:center;padding:16px 32px 32px}.simpay-upgrade-modal__content>.dashicons,.simpay-upgrade-upe-modal__content>.dashicons{color:#333;font-size:48px;width:48px;height:48px}.simpay-upgrade-modal__title,.simpay-upgrade-upe-modal__title{font-size:22px;line-height:1.5;display:block;margin:12px 0 0}.simpay-upgrade-modal__description,.simpay-upgrade-upe-modal__description{color:#777;font-size:16px;margin:16px 0 24px}.simpay-upgrade-modal__description strong,.simpay-upgrade-upe-modal__description strong{color:#333}.simpay-upgrade-modal__discount,.simpay-upgrade-upe-modal__discount{font-size:15px;text-align:center;margin:32px -32px -32px;padding:24px 40px;background-color:#fcf9e8;position:relative}.simpay-upgrade-modal__discount svg,.simpay-upgrade-upe-modal__discount svg{background:#00a32a;fill:#fff;border-radius:50%;border:4px solid #fff;width:32px;height:32px;position:absolute;top:-16px;left:50%;margin-left:-16px}.simpay-upgrade-modal__discount u,.simpay-upgrade-upe-modal__discount u{text-decoration:none;font-weight:bold;color:#00a32a}.simpay-upgrade-modal .button-large,.simpay-upgrade-upe-modal .button-large{font-size:16px;font-weight:bold;margin:0 0 15px;padding:8px 30px !important;height:auto}.simpay-teaser-float{margin:50px;position:relative}.simpay-teaser-float__card{text-align:center;padding:30px;background:#fff;border-radius:4px;box-shadow:0 0 30px 15px rgba(0,0,0,.18);position:relative;z-index:2}#poststuff .simpay-teaser-float h2,.simpay-teaser-float h2{font-size:24px;font-weight:600;margin:0;padding:0}.simpay-teaser-float p{font-size:15px;line-height:1.35;color:#666}.simpay-teaser-float p strong{color:#444}.simpay-teaser-float ul{text-align:left;display:inline-block;margin:-10px 0 20px;list-style-type:none}.simpay-teaser-float li{margin:16px 0;padding:0 0 0 24px;font-size:15px;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEzLjc3NjIgNi40NTYwNUw4LjcyMDMyIDEuNDAwMDVDOC41NzU5OSAxLjI1NTcyIDguMzgzNjQgMS4xNzY1IDguMTc4NTMgMS4xNzY1QzcuOTczMiAxLjE3NjUgNy43ODA5NiAxLjI1NTg0IDcuNjM2NjQgMS40MDAwNUw3LjE3NzYgMS44NTkyQzcuMDMzMzkgMi4wMDMyOSA2Ljk1Mzk1IDIuMTk1NzYgNi45NTM5NSAyLjQwMDk4QzYuOTUzOTUgMi42MDYwOCA3LjAzMzM5IDIuODA1MDQgNy4xNzc2IDIuOTQ5MTRMMTAuMTI3MSA1LjkwNTE2SDAuNzU2MzM0QzAuMzMzODM0IDUuOTA1MTYgMCA2LjIzNTkyIDAgNi42NTg1NFY3LjMwNzY1QzAgNy43MzAyNyAwLjMzMzgzNCA4LjA5NDM4IDAuNzU2MzM0IDguMDk0MzhIMTAuMTYwNkw3LjE3NzcyIDExLjA2NjlDNy4wMzM1MSAxMS4yMTEyIDYuOTU0MDYgMTEuMzk4NSA2Ljk1NDA2IDExLjYwMzdDNi45NTQwNiAxMS44MDg3IDcuMDMzNTEgMTEuOTk4NiA3LjE3NzcyIDEyLjE0MjhMNy42MzY3NSAxMi42MDA1QzcuNzgxMDcgMTIuNzQ0OCA3Ljk3MzMyIDEyLjgyMzUgOC4xNzg2NSAxMi44MjM1QzguMzgzNzUgMTIuODIzNSA4LjU3NjExIDEyLjc0MzggOC43MjA0MyAxMi41OTk1TDEzLjc3NjMgNy41NDM2QzEzLjkyMSA3LjM5ODgyIDE0LjAwMDUgNy4yMDU1NiAxNCA3LjAwMDExQzE0LjAwMDQgNi43OTM5OCAxMy45MjEgNi42MDA2IDEzLjc3NjIgNi40NTYwNVY2LjQ1NjA1WiIgZmlsbD0iIzQyOEJDQSIvPgo8L3N2Zz4K);background-position:left 3px;background-repeat:no-repeat;background-size:14px;color:#777}.simpay-teaser-float .button.button-large{font-size:17px;line-height:30px;padding:10px 20px}.simpay-teaser-float .simpay-notice-dismiss{position:absolute;top:0;right:0;font-size:20px;color:#666;font-weight:bold;text-decoration:none;margin-left:5px;padding:6px 10px;z-index:2}.simpay-teaser-float .simpay-notice-dismiss:hover,.simpay-teaser-float .simpay-notice-dismiss:active,.simpay-teaser-float .simpay-notice-dismiss:focus{color:#666;text-decoration:none}.simpay-teaser-float:after,.simpay-teaser-float:before{opacity:.75;z-index:0;content:"";position:absolute;left:-30px;right:-30px;top:-35px;width:calc(100% + 60px);height:170px;background-image:linear-gradient(#ddd, #ddd),linear-gradient(#eee, #eee),linear-gradient(#ddd, #ddd),linear-gradient(#eee, #eee);background-repeat:no-repeat;background-size:100% 20px,100% 40px,100% 20px,100% 40px;background-position:0 0,0 30px,0 100px,0 130px}.simpay-teaser-float:before{top:170px}.simpay-teaser-float .simpay-upgrade-btn-subtext{margin:24px -30px -30px;padding:32px 40px;border-bottom-left-radius:2px;border-bottom-right-radius:2px;border:0}.simpay-teaser-float .simpay-upgrade-btn-subtext svg{border-color:#fff}.simpay-teaser-float--inline{margin:40px 30px 30px}.simpay-teaser-float--inline .simpay-teaser-float__card{padding:30px;box-shadow:0 0 12px 6px rgba(0,0,0,.16)}#poststuff .simpay-teaser-float--inline h2,.simpay-teaser-float--inline h2{font-size:20px}.simpay-teaser-float--inline p{font-size:15px;margin:.75rem 0}.simpay-teaser-float--inline .button.button-large{font-size:15px;line-height:24px;margin:1rem 0;padding:8px 14px;display:inline-block}.simpay-teaser-float--inline:before,.simpay-teaser-float--inline:after{opacity:.6}.simpay-teaser-float--inline:before{display:none}.simpay-teaser-float--inline:after{top:15px}.simpay-form-settings-notice{font-weight:normal;color:#1d2327;position:relative;margin:18px 18px 0;padding:14px;border-radius:4px;background:#f5f5ff}.simpay-form-settings-notice a{color:#635aff}.simpay-form-settings-notice .simpay-external-link .dashicons-external{margin:1px 0 0 2px}.simpay-form-settings-notice strong{font-size:14px}.simpay-form-settings-notice p{margin:5px 0 0 23px}.simpay-form-settings-notice .simpay-notice-dismiss{font-size:20px;color:#b0b0f0;font-weight:bold;line-height:1;position:absolute;top:0;right:5px;text-decoration:none;padding:0 5px;z-index:2}.simpay-form-settings-notice .simpay-notice-dismiss:hover,.simpay-form-settings-notice .simpay-notice-dismiss:active,.simpay-form-settings-notice .simpay-notice-dismiss:focus{color:#9191ef;text-decoration:none;background:none}.simpay-settings .simpay-form-settings-notice{border:2px solid #645aff;box-shadow:0 1px 1px rgba(0,0,0,.04)}.post-type-simple-pay .lity{z-index:999999999;padding:20px}.post-type-simple-pay .lity-close{margin:10px}.post-type-simple-pay .lity-content{max-width:80vw;max-height:80vh}.post-type-simple-pay .lity-content img{max-height:80vh !important;max-width:80vw !important}#wpsp-api-keys-row-hide{display:none}.post-type-simple-pay #post-preview:not(.simpay-preview-button){display:none}.simpay-license-field-wrapper{margin:20px 0}#simpay-settings-license-key-license-key{margin:0}#simpay-settings-license-key-license-key[readonly]{background:#fff}.simpay-license-message__loading,.simpay-license-field{display:flex;align-items:center}.wp-core-ui .button.simpay-license-button.button-primary,.wp-core-ui .button.simpay-license-button.button-secondary{font-size:1rem;line-height:1;margin:0 8px;padding:13px}.simpay-license-message{font-size:15px;margin-top:8px}.simpay-license-message--valid{color:#15803d}.simpay-license-message--invalid{color:#b91c1c}.simpay-recaptcha-payment-form-feedback .dashicons{margin-top:-1px;display:inline-block}.simpay-recaptcha-payment-form-feedback .dashicons-update-alt{animation:rotation 2s infinite linear}.simpay-form-builder-inset-settings{margin:3px 0 0 24px}fieldset.simpay-form-builder-inset-settings>*:not(legend){margin:5px 0 8px}.simpay-form-builder-inset-settings>*:last-child{margin-bottom:0}.simpay-form-builder-inventory-control{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;padding:6px 8px;box-shadow:0 0 0 rgba(0,0,0,0);transition:box-shadow .1s linear;border-radius:2px;border:1px solid #757575;font-size:16px;line-height:normal;margin:0;padding:0;width:auto;display:inline-flex;align-items:center}@media(prefers-reduced-motion: reduce){.simpay-form-builder-inventory-control{transition-duration:0s;transition-delay:0s}}@media(min-width: 600px){.simpay-form-builder-inventory-control{font-size:13px;line-height:normal}}.simpay-form-builder-inventory-control:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid rgba(0,0,0,0)}.simpay-form-builder-inventory-control::-webkit-input-placeholder{color:rgba(30,30,30,.62)}.simpay-form-builder-inventory-control::-moz-placeholder{opacity:1;color:rgba(30,30,30,.62)}.simpay-form-builder-inventory-control:-ms-input-placeholder{color:rgba(30,30,30,.62)}.simpay-form-builder-inventory-control:focus-within{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid rgba(0,0,0,0)}.simpay-form-builder-inventory-control input[type=number]{border:0;box-shadow:none;background:none;border-radius:0;width:75px}.simpay-form-builder-inventory-control input[type=number]:focus{border:0;box-shadow:none;outline:0}.simpay-form-builder-inventory-control+label{margin-left:8px}.simpay-form-builder-inventory-control__initial{color:#757575;font-size:16px;line-height:normal;padding-right:8px}@media(min-width: 600px){.simpay-form-builder-inventory-control__initial{font-size:13px;line-height:normal}}.simpay-form-builder-inventory-control__initial:before{content:"/";display:inline-block;vertical-align:top;margin-top:-1px}.simpay-form-builder-purchase-restrictions__restriction-item{display:flex;align-items:center;margin-top:8px;margin-bottom:8px}.simpay-form-builder-purchase-restrictions__restriction-item label{margin-left:8px}.simpay-form-builder-purchase-restrictions__restriction-item-datetime{display:flex;align-items:center}.simpay-form-builder-purchase-restrictions__restriction-item-datetime>*{margin-right:10px}.simpay-form-builder-purchase-restrictions__restriction-item-datetime span{color:#757575}.simpay-form-builder-fee-recovery__amounts{display:flex;align-items:center;margin-top:5px}.simpay-form-builder-fee-recovery ::-webkit-input-placeholder{color:#b7bec7}.simpay-form-builder-fee-recovery ::-moz-placeholder{color:#b7bec7;opacity:1}.simpay-form-builder-fee-recovery :-ms-input-placeholder{color:#b7bec7}.simpay-form-builder-fee-recovery>*{margin-right:8px}.simpay-form-builder-fee-percent-control{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;padding:6px 8px;box-shadow:0 0 0 rgba(0,0,0,0);transition:box-shadow .1s linear;border-radius:2px;border:1px solid #757575;font-size:16px;line-height:normal;margin:0;padding:0;width:auto;display:inline-flex;align-items:center}@media(prefers-reduced-motion: reduce){.simpay-form-builder-fee-percent-control{transition-duration:0s;transition-delay:0s}}@media(min-width: 600px){.simpay-form-builder-fee-percent-control{font-size:13px;line-height:normal}}.simpay-form-builder-fee-percent-control:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid rgba(0,0,0,0)}.simpay-form-builder-fee-percent-control::-webkit-input-placeholder{color:rgba(30,30,30,.62)}.simpay-form-builder-fee-percent-control::-moz-placeholder{opacity:1;color:rgba(30,30,30,.62)}.simpay-form-builder-fee-percent-control:-ms-input-placeholder{color:rgba(30,30,30,.62)}.simpay-form-builder-fee-percent-control:focus-within{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid rgba(0,0,0,0)}.simpay-form-builder-fee-percent-control input[type=number]{border:0;box-shadow:none;background:none;border-radius:0;width:75px}.simpay-form-builder-fee-percent-control input[type=number]:focus{border:0;box-shadow:none;outline:0}.simpay-form-builder-fee-percent-control+label{margin-left:8px}.simpay-form-builder-fee-percent-control__suffix{color:#757575;font-size:16px;line-height:normal;padding-right:8px}@media(min-width: 600px){.simpay-form-builder-fee-percent-control__suffix{font-size:13px;line-height:normal}}.simpay-form-builder-automations__cta{margin:24px 0 6px;text-align:center}.simpay-form-builder-automator{padding:16px 4px 26px !important}.simpay-form-builder-automator,.simpay-form-builder-automator *{box-sizing:border-box}.simpay-form-builder-automator input[type=search]{font-size:15px;padding:2px 8px}.simpay-form-builder-automator__integrations{display:grid;grid-template-columns:repeat(4, minmax(0, 1fr));grid-column-gap:16px;grid-row-gap:16px;margin:18px -18px 0;padding:0 18px 10px;width:calc(100% + 36px);max-height:400px;overflow-y:scroll}.simpay-form-builder-automator__integrations-integration{color:initial;text-align:center;text-decoration:none;background:#fff;border:1px solid #eee;border-radius:4px;box-shadow:0 1px 3px 0 rgba(0,0,0,.03);transition:all ease-in .15s}.simpay-form-builder-automator__integrations-integration img{display:block;margin:16px auto;height:50px}.simpay-form-builder-automator__integrations-integration span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:8px 16px;display:block;border-top:1px solid #eee}.simpay-form-builder-automator__integrations-integration:hover{cursor:pointer;border-color:#ddd;box-shadow:0 2px 4px 0 rgba(0,0,0,.06)}body.site-health #wpbody-content,body.post-type-simple-pay #wpbody-content{padding-bottom:200px}#wpfooter .simpay-footer-promotion{text-align:center;font-weight:400;font-size:13px;line-height:16px;color:#787c82;padding:20px 0 30px 0;margin-bottom:20px}#wpfooter .simpay-footer-promotion p{font-weight:600}#wpfooter .simpay-footer-promotion-links,#wpfooter .simpay-footer-promotion-social{display:flex;justify-content:center;align-items:center}#wpfooter .simpay-footer-promotion-links{margin:9px 0 0}#wpfooter .simpay-footer-promotion-links span{color:#c3c4c7;padding:0 7px}#wpfooter .simpay-footer-promotion-social{margin:10px 0 0 0;gap:10px}#wpfooter .simpay-footer-promotion-social li{margin-bottom:0}#wpfooter .simpay-footer-promotion-social li:hover path{fill:#50575e}#wpfooter .simpay-footer-promotion-social a{display:block;height:16px}.simpay-settings-is_upe td{background:#fff;border:1px solid #c3c4c7;border-left-width:4px;border-left-color:#2271b1;box-shadow:0 1px 1px rgba(0,0,0,.04);padding:12px 18px} +.simpay-settings-subsections{display:flex;align-items:center;box-shadow:inset 0 -1px 0 0 #ccc}.simpay-settings-subsections__subsection{font-weight:500;text-decoration:none;padding:15px;display:flex;align-items:center}.simpay-settings-subsections__subsection .dashicons{width:18px;height:18px;font-size:18px;margin-right:4px}.simpay-settings-subsections__subsection.is-active{box-shadow:inset 0 -4px 0 0 currentColor;position:relative;z-index:1}.simpay-settings-subsections__subsection:not(.is-active){color:#23282d}.simpay-settings form>h2:not(.nav-tab-wrapper){clip:rect(1px, 1px, 1px, 1px);height:1px;overflow:hidden;position:absolute !important;width:1px}.simpay-settings .form-table td fieldset+p,.simpay-settings .form-table td label+p,.simpay-settings .form-table td select+p,.simpay-settings .form-table td input+p{color:#666;font-style:italic}.simpay-settings .simpay-settings-subsections__subsection{display:flex;align-items:center}.simpay-settings .simpay-settings-subsections__subsection .simpay-settings-bubble{margin-left:5px}.simpay-settings .simpay-settings-visual-toggles{margin:30px 0 0;display:flex}.simpay-settings .simpay-settings-visual-toggles input[type=radio]{display:none}.simpay-settings .simpay-settings-visual-toggles__toggle{-webkit-user-select:none;-moz-user-select:none;user-select:none;min-width:180px;margin:0 30px 0 0 !important;position:relative;display:block;background-color:#fff;border-radius:4px;border:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04)}.simpay-settings .simpay-settings-visual-toggles__toggle:hover{border:1px solid #999;box-shadow:0 1px 2px rgba(0,0,0,.1)}.simpay-settings .simpay-settings-visual-toggles input[type=radio]:checked+.simpay-settings-visual-toggles__toggle{border-color:#007cba;border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px #007cba;box-shadow:0 0 0 1px var(--wp-admin-theme-color)}.simpay-settings .simpay-settings-visual-toggles__toggle-recommended,.simpay-settings .simpay-settings-visual-toggles__toggle-not-recommended{text-align:center;font-size:12px;text-transform:uppercase;font-weight:bold;margin:0;padding:5px 0;display:block;border-top-right-radius:4px;border-top-left-radius:4px}.simpay-settings .simpay-settings-visual-toggles__toggle-recommended{color:#0f8569;background:#f4f9f7}.simpay-settings .simpay-settings-visual-toggles__toggle-not-recommended{color:#b91c1b;background:#fef2f2}.simpay-settings .simpay-settings-visual-toggles__toggle-icon{margin:20px auto 15px;padding:0 15px;display:block}.simpay-settings .simpay-settings-visual-toggles__toggle-label{line-height:1.5;text-align:center;font-size:16px;font-weight:500;margin:15px;display:block}.simpay-settings .simpay-settings-visual-toggles__toggle-label small{color:#666;font-weight:normal;font-size:13px;line-height:1;display:block;margin:4px 0}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type .simpay-settings-visual-toggles__toggle{min-height:160px}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type .simpay-settings-visual-toggles__toggle-icon{width:80px;height:80px}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type input[type=radio].simpay-settings-captcha-type--is-recommended:checked+.simpay-settings-visual-toggles__toggle{border-color:#0f8569;box-shadow:0 0 0 1px #0f8569}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type input[type=radio].simpay-settings-captcha-type--is-not-recommended:checked+.simpay-settings-visual-toggles__toggle{border-color:#b91c1b;box-shadow:0 0 0 1px #b91c1b}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type label[for=simpay-settings-captcha-type-cloudflare-turnstile] .simpay-settings-visual-toggles__toggle-icon{width:120px}.simpay-settings-general-recaptcha-no_captcha_warning th,.simpay-settings-general-recaptcha-no_captcha_warning td,.simpay-settings-hcaptcha_secret_key th,.simpay-settings-hcaptcha_secret_key td,.simpay-settings-cloudflare_turnstile_secret_key th,.simpay-settings-cloudflare_turnstile_secret_key td,.simpay-settings-recaptcha_score_threshold th,.simpay-settings-recaptcha_score_threshold td{padding-bottom:50px !important}.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-summary-report,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-payment-confirmation,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-payment-notification,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-upcoming-invoice,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-manage-subscriptions,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-payment-processing-confirmation,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-payment-processing-notification,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-payment-refunded-confirmation,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-subscription-cancel-confirmation,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-subscription-cancel-notification,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-invoice-confirmation{display:none}.simpay-settings .simpay-settings-subsection-emails-tools{margin-left:auto}.simpay-admin-charts-period-over-period{position:relative;padding-bottom:12px}.simpay-admin-charts-period-over-period *{box-sizing:border-box}.simpay-admin-charts-period-over-period__tooltip{position:absolute;background:#fff;border:1px solid #c3c3c3;box-shadow:0 2px 6px rgba(0,0,0,.05);border-radius:2px;padding:10px 14px;display:flex;flex-direction:column;z-Index:10000;min-width:175px}.simpay-admin-charts-period-over-period__tooltip-data{white-space:nowrap;margin-bottom:8px;display:grid;grid-template-columns:1fr auto;grid-auto-rows:auto;-moz-column-gap:16px;column-gap:16px}.simpay-admin-charts-period-over-period__tooltip-data:last-child{margin-bottom:0}.simpay-admin-charts-period-over-period__tooltip-data[data-dataset="1"]{opacity:.65}.simpay-admin-charts-period-over-period__tooltip-data em{font-style:normal;text-align:right}.simpay-admin-charts-period-over-period__tooltip-delta{font-size:12px;margin:0 -14px -10px;padding:8px 14px;border-top:1px solid #eee;background:#fdfdfd;border-radius:2px;display:flex;align-items:center;justify-content:center}.simpay-admin-charts-period-over-period__tooltip-delta .simpay-admin-charts-badge{margin-right:4px}.simpay-admin-charts-period-over-period__tooltip-delta strong.is-positive{color:#006908}.simpay-admin-charts-period-over-period__tooltip-delta strong.is-negative{color:#b3093c}.simpay-admin-charts-badge{color:#2f2f2f;font-size:12px;font-weight:500;font-style:normal;line-height:1;padding:3px 6px;display:inline-flex;align-items:center;background:#f0f0f0;border-radius:100px}.simpay-admin-charts-badge.is-positive{color:#006908;background-color:#d7f7c2}.simpay-admin-charts-badge.is-negative{color:#b3093c;background-color:#ffe7f2}.simpay-admin-charts-badge__icon{width:15px;height:15px}.simpay-admin-charts-no-data{position:absolute;top:0;left:0;display:flex;justify-content:center;align-items:center;background:rgba(255,255,255,.5);z-index:2}.simpay-admin-charts-no-data>div{text-align:center;padding:24px;background:#fff;border:1px solid #c3c3c3;box-shadow:0 2px 6px rgba(0,0,0,.1);border-radius:2px;max-width:60%}.simpay-admin-charts-no-data strong{font-size:15px;margin-bottom:8px;display:block}.button.button-large.simpay-button-large{font-size:14px;line-height:30px;padding:4px 12px}.simpay-copy-hidden-input{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}.fixed .column-livemode{width:15%;text-align:right}@media screen and (max-width: 782px){.fixed .column-livemode{text-align:left}}.fixed .column-livemode .simpay-badge{margin-top:3px}.fixed .column-shortcode{width:25%}.fixed .column-shortcode .simpay-shortcode{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}.post-type-simple-pay .misc-pub-curtime,.post-type-simple-pay .misc-pub-visibility{display:none}.simpay-metabox-title{border:1px solid #eee}.simpay-shortcode-section{border-top:1px solid #ddd;border-width:1px 0;padding-top:15px;padding-bottom:15px;position:relative}.simpay-shortcode-section label{display:block;margin-bottom:6px}.simpay-shortcode-section label .dashicons{color:#8c8f94;margin-right:3px}.simpay-shortcode-section .simpay-copy-button{line-height:normal;position:absolute;right:20px;bottom:20px;border:0;background:none;box-shadow:none;padding:0}.simpay-shortcode-section .simpay-copy-button:hover{border:0;background:none;box-shadow:none}.simpay-shortcode-section .simpay-copy-button .dashicons{color:#3c434a}.simpay-shortcode{width:100%;padding:8px;line-height:1;margin:0;height:32px;resize:none}.simpay-badge{color:#3f3f46;text-align:center;line-height:1;padding:5px 7px;border-radius:3px;background:#e4e4e7;border:0;box-shadow:none;display:inline-flex;align-items:center}button.simpay-badge{cursor:pointer}button.simpay-badge:hover{background:#d4d4d8}.simpay-badge__icon{opacity:.8;margin:2px 5px 0 0}.simpay-badge--green{color:#0e6245;background:#cbf4c9}.simpay-badge--yellow{color:#983705;background:#f8e5b9}.simpay-stripe-account-info{display:flex;align-items:center;margin-bottom:8px;position:relative}.simpay-stripe-account-info .spinner{float:none;margin-top:0;margin-left:0}.simple-pay_page_simpay_settings .simpay-settings-upgrade,.post-type-simple-pay .simpay-settings-upgrade{margin-top:20px;padding:1px;position:relative;background:#fff;border-radius:4px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.2),0 5px 10px rgba(0,0,0,.1);max-width:677px}.simple-pay_page_simpay_settings .simpay-settings-upgrade__inner,.post-type-simple-pay .simpay-settings-upgrade__inner{text-align:center;margin:0;padding:30px}.simple-pay_page_simpay_settings .simpay-settings-upgrade h3,.post-type-simple-pay .simpay-settings-upgrade h3{line-height:1.5;font-size:22px;margin:0 0 1.5rem}.simple-pay_page_simpay_settings .simpay-settings-upgrade ul,.post-type-simple-pay .simpay-settings-upgrade ul{margin:1.5rem 0 calc(1.5rem - 6px);display:flex;flex-wrap:wrap;justify-content:center}@media screen and (min-width: 782px){.simple-pay_page_simpay_settings .simpay-settings-upgrade ul,.post-type-simple-pay .simpay-settings-upgrade ul{margin-left:4rem;margin-right:4rem}}.simple-pay_page_simpay_settings .simpay-settings-upgrade li,.post-type-simple-pay .simpay-settings-upgrade li{font-size:15px;margin:6px 0;width:100%}.simple-pay_page_simpay_settings .simpay-settings-upgrade li a,.post-type-simple-pay .simpay-settings-upgrade li a{color:#3c434a;text-decoration:none}.simple-pay_page_simpay_settings .simpay-settings-upgrade li a:hover,.post-type-simple-pay .simpay-settings-upgrade li a:hover{color:var(--wp-admin-theme-color);text-decoration:underline}@media screen and (min-width: 782px){.simple-pay_page_simpay_settings .simpay-settings-upgrade li,.post-type-simple-pay .simpay-settings-upgrade li{text-align:left;width:50%}}.simple-pay_page_simpay_settings .simpay-settings-upgrade .button.button-large,.post-type-simple-pay .simpay-settings-upgrade .button.button-large{font-size:17px;line-height:30px;padding:10px 20px}.simple-pay_page_simpay_settings .simpay-settings-upgrade small,.post-type-simple-pay .simpay-settings-upgrade small{color:#666;margin:15px 0 0;display:block}.simple-pay_page_simpay_settings .simpay-settings-upgrade .dashicons-yes,.post-type-simple-pay .simpay-settings-upgrade .dashicons-yes{color:#428bca}.simple-pay_page_simpay_settings .simpay-settings-upgrade .button-link,.post-type-simple-pay .simpay-settings-upgrade .button-link{position:absolute;top:0;right:0;font-size:20px;color:#666;font-weight:bold;text-decoration:none;margin-left:5px;padding:6px 10px;z-index:2}.simple-pay_page_simpay_settings .simpay-settings-upgrade .button-link:hover,.simple-pay_page_simpay_settings .simpay-settings-upgrade .button-link:active,.simple-pay_page_simpay_settings .simpay-settings-upgrade .button-link:focus,.post-type-simple-pay .simpay-settings-upgrade .button-link:hover,.post-type-simple-pay .simpay-settings-upgrade .button-link:active,.post-type-simple-pay .simpay-settings-upgrade .button-link:focus{color:#666;text-decoration:none}.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext{text-align:center;margin:0;padding:30px 20px 20px;background-color:#fcf9e8;border:1px solid #edeac9;border-width:1px 0 0;position:relative;border-radius:0;border-bottom-left-radius:4px;border-bottom-right-radius:4px}@media screen and (min-width: 782px){.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext{padding-left:4rem;padding-right:4rem}}.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext svg,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext svg{background:#00a32a;fill:#fff;border-radius:50%;border:4px solid #fff;box-shadow:0 0 0 1px #edeac9;width:28px;height:28px;position:absolute;top:-18px;left:50%;margin-left:-18px}.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext u,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext u{text-decoration:none;font-weight:bold;color:#00a32a}.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext a,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext a{font-weight:normal;display:inline-block}#simpay-payment-form-settings table{width:100%;border-collapse:collapse}#simpay-payment-form-settings ::-webkit-input-placeholder{color:#9ba1a9}#simpay-payment-form-settings ::-moz-placeholder{color:#9ba1a9;opacity:1}#simpay-payment-form-settings :-ms-input-placeholder{color:#9ba1a9}#simpay-payment-form-settings .inside{margin:0;padding:0}#simpay-payment-form-settings .simpay-panel-field .toolbar{margin-bottom:-4px}#simpay-payment-form-settings .simpay-panel-field .toolbar .simpay-field-select{margin:0 0 4px;width:auto;max-width:70%}#simpay-payment-form-settings .simpay-tabs{margin:0;padding:0;list-style:none;background:#fafafa;border-right:1px solid #ccd0d4;line-height:1em;position:relative;flex:0 0 25%}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-tabs{flex-basis:100%;flex-grow:1;border-right:0}}#simpay-payment-form-settings .simpay-tabs li{margin:0;padding:0}#simpay-payment-form-settings .simpay-tabs li:first-child{margin-top:12px}#simpay-payment-form-settings .simpay-tabs li:last-child{margin-bottom:20px}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-tabs li:last-child{margin-bottom:0}}#simpay-payment-form-settings .simpay-tabs li.active{margin-left:-1px;box-shadow:0 1px 1px rgba(0,0,0,.04);position:relative}#simpay-payment-form-settings .simpay-tabs li.active:focus:after{display:none}#simpay-payment-form-settings .simpay-tabs li.active:before,#simpay-payment-form-settings .simpay-tabs li.active:after{content:"";width:calc(100% + 1px);height:1px;background:#ccd0d4;position:absolute;top:0;left:0;right:0;z-index:2}#simpay-payment-form-settings .simpay-tabs li.active:after{top:auto;bottom:0}#simpay-payment-form-settings .simpay-tabs li.active a{font-weight:bold;background-color:#fff;position:relative;margin-right:-1px}#simpay-payment-form-settings .simpay-tabs li.active a:before{content:"";position:absolute;top:0;left:0;bottom:0;width:4px;height:100%;background:currentColor;z-index:3}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-tabs li.active a{margin-right:0}}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item{display:flex;align-items:center;line-height:20px;margin:0;padding:8px 10px 8px 14px;text-decoration:none;transition:all .05s ease-in-out}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item svg,#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item .dashicons{margin-right:6px}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item{padding:18px}}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item:focus{outline:0;position:relative;z-index:3;box-shadow:inset 0 0 0 1px currentColor,0 0 0 1px currentColor}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item[href="#purchase-restrictions-settings-panel"],#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item[href="#payment-page-settings-panel"]{margin-bottom:20px;position:relative}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item[href="#purchase-restrictions-settings-panel"]:after,#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item[href="#payment-page-settings-panel"]:after{content:"";position:absolute;left:14px;right:14px;bottom:-10px;width:calc(100% - 28px);height:1px;background:#eaeaea}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item span>span{color:#f18500;font-size:12px;font-weight:600;margin:0 0 0 5px;display:inline-block}#simpay-payment-form-settings .simpay-tabs li:not(.active) .simpay-tab-item{color:inherit}#simpay-payment-form-settings .simpay-panels-wrap{background:#fff;display:flex}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-panels-wrap{flex-direction:column}}#simpay-payment-form-settings .simpay-panels{flex:0 0 75%;display:flex}@media screen and (min-width: 1400px){#simpay-payment-form-settings .simpay-panels{flex-basis:75%}}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-panels{flex-basis:100%}}#simpay-payment-form-settings .simpay-panel,#simpay-payment-form-settings .simpay-panel-section{width:100%}#simpay-payment-form-settings .simpay-panel>table,#simpay-payment-form-settings .simpay-panel>table>tr,#simpay-payment-form-settings .simpay-panel>table>tbody,#simpay-payment-form-settings .simpay-panel>table>tbody>tr,#simpay-payment-form-settings .simpay-panel>table>thead,#simpay-payment-form-settings .simpay-panel>table>thead>tr{display:block;width:100%}#simpay-payment-form-settings .simpay-panel>table:last-child>tbody:last-child>tr:last-child>td{border-bottom:0}#simpay-payment-form-settings .simpay-panel-field--requires-upgrade{position:relative}#simpay-payment-form-settings .simpay-panel-field--requires-upgrade td>div{margin-right:80px}#simpay-payment-form-settings .simpay-panel-field--requires-upgrade td>div .button-small{position:absolute;top:calc(50% - 13px);right:18px}#simpay-payment-form-settings .simpay-panel-field,#simpay-payment-form-settings .simpay-panel-field>td,#simpay-payment-form-settings .simpay-panel-field>th{text-align:left;display:block}#simpay-payment-form-settings .simpay-panel-field>td,#simpay-payment-form-settings .simpay-panel-field>th{width:calc(100% - 36px);margin-left:18px;margin-right:18px}#simpay-payment-form-settings .simpay-panel-field th{font-weight:bold;padding-top:18px;padding-bottom:5px}#simpay-payment-form-settings .simpay-panel-field td{border-bottom:1px solid #ddd;padding-bottom:18px}#simpay-payment-form-settings .simpay-panel-field p.description{margin-top:4px}#simpay-payment-form-settings .simpay-panel-field p.description:last-of-type{margin-bottom:0}#simpay-payment-form-settings .simpay-panel-field .simpay-panel-field__nested{margin-top:18px}#simpay-payment-form-settings .simpay-panel-field .simpay-panel-field__nested label{font-weight:bold;display:block;margin-bottom:4px}#simpay-payment-form-settings .simpay-panel-field .simpay-field-select,#simpay-payment-form-settings .simpay-panel-field .simpay-field-text{min-width:75%;max-width:100%}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-panel-field .simpay-field-select,#simpay-payment-form-settings .simpay-panel-field .simpay-field-text{min-width:0;width:100%}}#simpay-payment-form-settings .simpay-panel-field .simpay-field-textarea{width:100%;max-width:100%}#simpay-payment-form-settings .simpay-panel-field .notice:last-of-type{margin-bottom:0}#simpay-payment-form-settings .simpay-panel-field .error,#simpay-payment-form-settings .simpay-panel-field .simpay-important{color:#a94442;font-weight:normal}#simpay-payment-form-settings .simpay-panel-field .simpay-image-preview-wrap{position:relative;margin-top:12px}#simpay-payment-form-settings .simpay-panel-field .simpay-image-preview-wrap .simpay-remove-image-preview{position:absolute;top:-15px;left:-15px;cursor:pointer;background-color:#fff}#simpay-payment-form-settings .simpay-panel-field .simpay-image-preview-wrap .simpay-remove-image-preview::before{font-size:22px;line-height:26px}#simpay-payment-form-settings .simpay-panel-field .simpay-image-preview-wrap .simpay-image-preview{max-height:128px;max-width:128px;border:1px solid #ddd}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box{background-color:#f4f4f4;border:1px solid #e5e5e5;padding:18px;margin-top:18px;position:relative}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box__dismiss{color:inherit;text-decoration:none;position:absolute;top:8px;right:8px}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box__dismiss .dashicons-dismiss{font-size:16px;width:16px;height:16px}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box h3{font-size:18px;font-weight:600;margin:0;padding:0}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box p{font-size:14px}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box p:last-child{margin-bottom:0}#simpay-payment-form-settings .simpay-metabox-content{margin-bottom:-1px;background-color:#f5f5f5;border:1px solid #c3c4c7;border-width:1px 0;box-shadow:0 1px 1px rgba(0,0,0,.04);position:relative}#simpay-payment-form-settings .simpay-show-if,#simpay-payment-form-settings .simpay-panel-hidden{display:none}#simpay-payment-form-settings .simpay-payment-methods{border:1px solid #ccd0d4;border-radius:4px;box-shadow:0 1px 1px rgba(0,0,0,.04)}#simpay-payment-form-settings .simpay-panel-field-payment-method{display:block;border-top:1px solid #ccd0d4;padding:7px;box-sizing:border-box}#simpay-payment-form-settings .simpay-panel-field-payment-method:first-child{border-top:0;border-top-left-radius:4px;border-top-right-radius:4px}#simpay-payment-form-settings .simpay-panel-field-payment-method__enable{display:flex;align-items:center}#simpay-payment-form-settings .simpay-panel-field-payment-method__enable input[type=checkbox]{margin-top:0;margin-right:8px}#simpay-payment-form-settings .simpay-panel-field-payment-method__help{text-decoration:none}#simpay-payment-form-settings .simpay-panel-field-payment-method__help .dashicons{font-size:18px;width:18px;height:18px}#simpay-payment-form-settings .simpay-panel-field-payment-method__restrictions,#simpay-payment-form-settings .simpay-panel-field-payment-method__restrictions-ach{margin-left:72px}#simpay-payment-form-settings .simpay-panel-field-payment-method__icon{border-radius:3px;overflow:hidden;margin:0 8px 0 5px;width:30px;height:30px;flex-shrink:0}#simpay-payment-form-settings .simpay-panel-field-payment-method__icon svg{width:30px;height:30px}#simpay-payment-form-settings .simpay-panel-field-payment-method__configure{display:flex;align-items:center;justify-content:center}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metaboxes:not(.is-empty),#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metaboxes:not(.is-empty){border:1px solid #ccd0d4;box-shadow:0 1px 1px rgba(0,0,0,.04);border-radius:4px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-handlediv,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-handlediv{display:none;float:right;width:36px;height:36px;margin:0;padding:0;border:0;background:none;cursor:pointer;display:block}#simpay-global-settings .simpay-metaboxes-wrapper .postbox.closed .simpay-handlediv .toggle-indicator:before,#simpay-form-settings .simpay-metaboxes-wrapper .postbox.closed .simpay-handlediv .toggle-indicator:before{content:""}#simpay-global-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv:focus,#simpay-form-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv:focus{outline:0}#simpay-global-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv:focus .toggle-indicator:before,#simpay-form-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv:focus .toggle-indicator:before{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}#simpay-global-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv .toggle-indicator:before,#simpay-form-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv .toggle-indicator:before{margin-top:4px;width:20px;border-radius:50%;text-indent:-1px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox{background:#fff;border:1px solid #ccd0d4;margin:0 -1px -1px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .hndle,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .hndle{border:0}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox select,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox select{font-weight:400}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox:first-of-type,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox:first-of-type{margin-top:-1px;border-top-left-radius:4px;border-top-right-radius:4px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox:last-of-type,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox:last-of-type{margin-bottom:-1px;border-bottom-left-radius:4px;border-bottom-right-radius:4px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox:last-of-type .simpay-metabox-content,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox:last-of-type .simpay-metabox-content{border-bottom-left-radius:4px;border-bottom-right-radius:4px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2{cursor:pointer;display:flex;align-items:center;padding:10px 0 10px 12px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .simpay-field-type,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .simpay-field-type{font-size:90%;color:gray;font-weight:normal;text-decoration:none;margin-left:10px}@media screen and (max-width: 782px){#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .simpay-field-type,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .simpay-field-type{display:none}}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .dashicons-handle,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .dashicons-handle{cursor:move}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 strong,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 strong{font-size:95%;margin-left:8px;display:flex;align-items:center;flex-grow:1}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 svg,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 svg{border-radius:3px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 select,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 select{font-family:sans-serif;max-width:20%;margin:.25em .25em .25em 0}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2.fixed,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2.fixed{cursor:pointer !important}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .dashicons-menu,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .dashicons-menu{cursor:move}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions{padding:9px 18px;justify-content:space-between;display:flex;align-items:center}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id{display:flex;align-items:center}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id input,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id input{margin:0 2px 0 5px;width:50px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id a,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id a{text-decoration:none}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .button-link.simpay-remove-field-link,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .button-link.simpay-remove-field-link{color:#a00}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .button-link.simpay-remove-field-link:hover,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .button-link.simpay-remove-field-link:hover{color:#dc3232}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox table,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox table{border-spacing:0;width:100%}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox table.simpay-inner-table,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox table.simpay-inner-table{border:none;padding:0 1em}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox table tr td,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox table tr td{border-bottom-color:#ccd0d4}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-remove-plan,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-remove-plan{color:#a00}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-custom-field-payment-button .dashicons-menu,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-custom-field-payment-button .dashicons-menu{visibility:hidden}#simpay-global-settings .sortable-placeholder,#simpay-form-settings .sortable-placeholder{margin:5px;display:block;min-height:36px}#simpay-global-settings .chosen-container,#simpay-form-settings .chosen-container{min-width:20em;max-width:30em}#simpay-global-settings .simpay-field.simpay-small-text,#simpay-form-settings .simpay-field.simpay-small-text{width:7em}#simpay-global-settings .simpay-field.simpay-medium-text,#simpay-form-settings .simpay-field.simpay-medium-text{width:15em}#simpay-global-settings .simpay-field-radios ul,#simpay-form-settings .simpay-field-radios ul{margin:0}#simpay-global-settings .simpay-field-radios>i,#simpay-form-settings .simpay-field-radios>i{margin-left:5px;vertical-align:middle}#simpay-global-settings ul.simpay-field-radios-inline,#simpay-form-settings ul.simpay-field-radios-inline{margin:0 0 -10px}#simpay-global-settings ul.simpay-field-radios-inline li,#simpay-form-settings ul.simpay-field-radios-inline li{display:inline-block;margin:0 10px 10px 0}#simpay-global-settings ul.simpay-field-radios-inline li:last-child,#simpay-form-settings ul.simpay-field-radios-inline li:last-child{margin-right:0}#simpay-global-settings .simpay-currency-field,#simpay-form-settings .simpay-currency-field{display:flex;align-items:center}>#simpay-global-settings .simpay-currency-field:focus,>#simpay-form-settings .simpay-currency-field:focus{position:relative;z-index:5}#simpay-global-settings .simpay-currency-symbol,#simpay-form-settings .simpay-currency-symbol{margin:0;padding-left:8px;padding-right:8px;line-height:28px;font-size:14px}@media screen and (max-width: 782px){#simpay-global-settings .simpay-currency-symbol,#simpay-form-settings .simpay-currency-symbol{line-height:38px}}#simpay-global-settings .simpay-currency-symbol-left,#simpay-form-settings .simpay-currency-symbol-left{border-top-left-radius:4px;border-bottom-left-radius:4px}#simpay-global-settings .simpay-currency-symbol-right,#simpay-form-settings .simpay-currency-symbol-right{border-top-right-radius:4px;border-bottom-right-radius:4px}#simpay-global-settings div.simpay-currency-symbol,#simpay-form-settings div.simpay-currency-symbol{border-color:#7e8993;border-style:solid;background-color:#fff}#simpay-global-settings select.simpay-currency-symbol,#simpay-form-settings select.simpay-currency-symbol{padding-right:25px}#simpay-global-settings .simpay-currency-symbol-left,#simpay-form-settings .simpay-currency-symbol-left{border-width:1px 0 1px 1px}#simpay-global-settings .simpay-currency-symbol-left+.simpay-field-amount,#simpay-form-settings .simpay-currency-symbol-left+.simpay-field-amount{border-radius:0 4px 4px 0}#simpay-global-settings .simpay-currency-symbol-right,#simpay-form-settings .simpay-currency-symbol-right{border-width:1px 1px 1px 0}#simpay-global-settings .simpay-field-amount,#simpay-form-settings .simpay-field-amount{margin:0;padding-left:8px;padding-right:8px;font-size:14px;width:6em;position:relative;z-index:2;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px}#simpay-global-settings .simpay-error,#simpay-form-settings .simpay-error{color:red}#simpay-global-settings .simpay-docs-link-wrap,#simpay-form-settings .simpay-docs-link-wrap{position:absolute;right:0;bottom:0;color:#666;font-size:13px;font-style:italic;padding:15px 18px}#simpay-global-settings .simpay-docs-link-wrap a .dashicons-editor-help,#simpay-form-settings .simpay-docs-link-wrap a .dashicons-editor-help{color:#666;text-decoration:none;width:17px;height:17px;font-size:17px;padding-left:4px}#simpay-global-settings .simpay-docs-icon,#simpay-form-settings .simpay-docs-icon{color:#666}#simpay-global-settings .simpay-docs-icon,#simpay-global-settings .simpay-docs-icon .dashicons-editor-help,#simpay-form-settings .simpay-docs-icon,#simpay-form-settings .simpay-docs-icon .dashicons-editor-help{text-decoration:none;width:17px;height:17px;font-size:17px}.button.button-primary.simpay-upgrade-btn{background-color:#428bca;border:1px solid #428bca;color:#fff;display:inline-block}.button.button-primary.simpay-upgrade-btn:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px #2d6ca2}.button.button-primary.simpay-upgrade-btn:hover{background-color:#037ad0;border:1px solid #428bca}.simpay-upgrade-btn-subtext{color:#3c434a;font-size:14px;line-height:1.5;text-align:center;margin:40px 0 0;padding:30px 35px 20px;background-color:#fcf9e8;border:3px solid #ebe29a;border-radius:4px;position:relative}.simpay-upgrade-btn-subtext svg{background:#00a32a;fill:#fff;border-radius:50%;border:3px solid #ebe29a;width:28px;height:28px;position:absolute;top:-14px;left:50%;margin-left:-14px}.simpay-upgrade-btn-subtext u{text-decoration:none;font-weight:bold;color:#00a32a}.simpay-upgrade-btn-subtext a{text-decoration:none;display:block;margin-top:6px;font-weight:bold}.post-type-simple-pay #post-body-content{display:none}.simpay-card{margin:0 0 20px;padding:30px;background:#fff;border:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04)}.simpay-card,.simpay-card p{line-height:1.5;font-size:16px}.simpay-card h3{line-height:1.6;font-size:18px;margin:0 0 20px;color:#23282c}.simpay-card p{margin:0 0 20px}.simpay-card p:last-child,.simpay-card ul:last-child{margin-bottom:0}.simpay-card figure{float:right;margin:0 0 30px 30px;max-width:400px}.simpay-card figure iframe,.simpay-card figure img{max-width:100%}.simpay-card figure figcaption{text-align:center}@media screen and (max-width: 782px){.simpay-card figure{margin:0 0 30px;max-width:100%;float:none}}.simpay-doc-suggestions{width:100%;display:flex;flex-wrap:wrap;padding:0}.simpay-doc-suggestion{text-align:center;display:flex;flex-direction:column;justify-content:center;align-items:center;flex:0 1 33.333%;padding:30px;border-right:1px solid #c3c4c7;box-sizing:border-box}.simpay-doc-suggestion:nth-child(3n){border-right:0}@media screen and (max-width: 782px){.simpay-doc-suggestion{flex:0 1 100%;border-bottom:1px solid #c3c4c7;border-right:0}.simpay-doc-suggestion:last-child{border-bottom:0}}.simpay-doc-suggestion h3{font-size:20px;margin-bottom:10px}.simpay-doc-suggestion p{font-size:15px}.simpay-doc-suggestion .dashicons{font-size:40px;width:40px;height:40px;display:block;margin-bottom:10px}.simpay-doc-suggestion .button-large{font-size:16px}.simpay-addons{display:flex;flex-wrap:wrap;justify-content:space-between;margin:20px 0}.simpay-addon{background:#fff;border:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04);margin-bottom:20px;display:flex;flex-direction:column;flex-basis:calc(33% - 10px);box-sizing:border-box}@media screen and (max-width: 782px){.simpay-addon{flex-basis:100%}}.simpay-addon img{float:left;max-width:75px}.simpay-addon h5{margin:0 0 10px 100px;font-size:16px}.simpay-addon__details{padding:20px;flex:1 0 auto}.simpay-addon__actions{display:flex;align-items:center;justify-content:space-between;flex:0 1 auto;background-color:#f7f7f7;border-top:1px solid #ddd;margin-top:auto;padding:20px;position:relative}.simpay-addon__actions .msg{text-align:center;justify-content:center;display:flex;align-items:center;position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;background-color:#f7f7f7;z-index:3}.simpay-addon .error,.simpay-addon .status-label.status-installed{color:#d63638}.simpay-addon .success,.simpay-addon .status-label.status-active{color:#00a32a}.simpay-addon .addon-desc{margin:0 0 0 100px}.form-table td .simpay-stripe-connect-help{margin:15px 0;display:flex;align-items:center}.form-table td .simpay-stripe-connect-help .dashicons{margin-right:4px}.simpay-currency-field{display:flex;align-items:center}>.simpay-currency-field:focus{position:relative;z-index:5}.simpay-currency-symbol{margin:0;padding-left:8px;padding-right:8px;line-height:28px;font-size:14px}@media screen and (max-width: 782px){.simpay-currency-symbol{line-height:38px}}.simpay-currency-symbol-left{border-top-left-radius:4px;border-bottom-left-radius:4px}.simpay-currency-symbol-right{border-top-right-radius:4px;border-bottom-right-radius:4px}div.simpay-currency-symbol{border-color:#7e8993;border-style:solid;background-color:#fff}select.simpay-currency-symbol{padding-right:25px}.simpay-currency-symbol-left{border-width:1px 0 1px 1px}.simpay-currency-symbol-left+.simpay-field-amount{border-radius:0 4px 4px 0}.simpay-currency-symbol-right{border-width:1px 1px 1px 0}.simpay-field-amount{margin:0;padding-left:8px;padding-right:8px;font-size:14px;width:6em;position:relative;z-index:2;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px}.simpay-template-explorer-open .show-settings{display:none !important}.simpay-branding-bar{margin:0 -20px;padding:14px 22px;background:#fff;border-bottom:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04);width:calc(100% + 20px);display:flex;justify-content:space-between;box-sizing:border-box}.site-health .simpay-branding-bar{display:none}.simpay-branding-bar__title{display:flex;align-items:center;margin:8px 0}.simpay-branding-bar__logo{width:200px}.simpay-branding-bar__divider{color:#dadbdf;font-size:23px;font-weight:400;margin:0 15px}.simpay-branding-bar__actions{display:flex;align-items:center}.simpay-branding-bar__actions>div{margin-left:10px;min-width:40px}.simpay-branding-bar__actions-button{color:#000;cursor:pointer;padding:10px;width:40px;height:40px;background-color:#f3f4f5;border-radius:50%;border:0;box-shadow:none;position:relative;transition:background-color .2s ease;box-sizing:border-box;display:block}.simpay-branding-bar__actions-button:hover{background-color:#e5e5e5}.simpay-branding-bar__actions-button:active,.simpay-branding-bar__actions-button:focus{box-shadow:0 0 0 2px var(--wp-admin-theme-color)}.simpay-branding-bar__actions-button-count{font-weight:600;font-size:10px;line-height:16px;color:#fff;margin:0;background-color:#df2a4a;border-radius:100%;width:16px;height:16px;position:absolute;top:-8px;left:50%;margin-left:-8px}.simpay-branding-bar .wp-heading-inline{font-size:23px;font-weight:400;margin:0}.simpay-branding-bar .page-title-action{font-weight:600;font-size:13px;line-height:normal;cursor:pointer;text-shadow:none;text-decoration:none;margin-left:10px;padding:4px 8px;border:1px solid currentColor;border-radius:2px;background:#f6f7f7}.simpay-landing-zone{text-align:center;max-width:700px;margin:40px auto}.simpay-landing-zone__title{font-size:26px;font-weight:600;margin:0 0 1.5rem;padding:0}.simpay-landing-zone__subtitle{font-size:17px;color:#666;margin:.25rem 0}.simpay-landing-zone__subtitle strong{color:#444}.simpay-landing-zone section{margin:2rem 0}.simpay-landing-zone__empty-state-graphic img{width:425px}.simpay-landing-zone__screenshot>*{vertical-align:middle}.simpay-landing-zone__screenshot-img{display:inline-block;position:relative;width:315px;padding:5px;background-color:#fff;box-shadow:0px 2px 5px 0px rgba(0,0,0,.05);border-radius:3px}.simpay-landing-zone__screenshot-img img{max-width:100%;display:block}.simpay-landing-zone__screenshot-img .hover{position:absolute;opacity:0;height:calc(100% - 10px);width:calc(100% - 10px);top:0;left:0;border:5px solid #fff;background-color:rgba(0,0,0,.15);background-image:url(data:image/svg+xml;base64,PHN2ZyBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjojZmZmZmZmMDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCIgaGVpZ2h0PSIxMDAiPjxwYXRoIGQ9Ik01MCAwYzI3LjYxNCAwIDUwIDIyLjM4NiA1MCA1MHMtMjIuMzg2IDUwLTUwIDUwUzAgNzcuNjE0IDAgNTAgMjIuMzg2IDAgNTAgMHoiIGZpbGw9IiMxNjg1YjciLz48cGF0aCBkPSJNNzMuMDIzIDY3LjA2N2wtOS4zNDQtOS4zNDRhMi4yNDcgMi4yNDcgMCAwMC0xLjU5My0uNjU2aC0xLjUyOGExOS4zOTkgMTkuMzk5IDAgMDA0LjEyNC0xMS45OTZjMC0xMC43Ny04LjcyNS0xOS40OTUtMTkuNDk0LTE5LjQ5NS0xMC43NjggMC0xOS40OTQgOC43MjYtMTkuNDk0IDE5LjQ5NSAwIDEwLjc2OCA4LjcyNiAxOS40OTMgMTkuNDk0IDE5LjQ5M2ExOS40IDE5LjQgMCAwMDExLjk5Ny00LjEyM3YxLjUyN2MwIC42LjIzNCAxLjE3Mi42NTUgMS41OTRsOS4zNDQgOS4zNDRhMi4yNCAyLjI0IDAgMDAzLjE3OCAwbDIuNjUyLTIuNjUzYTIuMjYgMi4yNiAwIDAwLjAxLTMuMTg2em0tMjcuODM1LTEwYy02LjYyNiAwLTExLjk5Ni01LjM2MS0xMS45OTYtMTEuOTk2IDAtNi42MjcgNS4zNi0xMS45OTcgMTEuOTk2LTExLjk5NyA2LjYyNiAwIDExLjk5NyA1LjM2MSAxMS45OTcgMTEuOTk3IDAgNi42MjYtNS4zNjEgMTEuOTk2LTExLjk5NyAxMS45OTZ6IiBmaWxsPSIjZmZmIi8+PC9zdmc+);background-repeat:no-repeat;background-position:center;background-size:50px;transition:all .3s}.simpay-landing-zone__screenshot-img:hover .hover{opacity:1;transition:all .3s}.simpay-landing-zone__screenshot ul{text-align:left;display:inline-block;margin:0 0 0 30px;list-style-type:none;max-width:calc(100% - 350px)}@media screen and (max-width: 782px){.simpay-landing-zone__screenshot ul{text-align:center;margin:30px auto;max-width:100%;display:block}}.simpay-landing-zone__screenshot li{margin:16px 0;padding:0;font-size:15px;color:#777;position:relative}.simpay-landing-zone__screenshot li:before{content:"";background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEzLjc3NjIgNi40NTYwNUw4LjcyMDMyIDEuNDAwMDVDOC41NzU5OSAxLjI1NTcyIDguMzgzNjQgMS4xNzY1IDguMTc4NTMgMS4xNzY1QzcuOTczMiAxLjE3NjUgNy43ODA5NiAxLjI1NTg0IDcuNjM2NjQgMS40MDAwNUw3LjE3NzYgMS44NTkyQzcuMDMzMzkgMi4wMDMyOSA2Ljk1Mzk1IDIuMTk1NzYgNi45NTM5NSAyLjQwMDk4QzYuOTUzOTUgMi42MDYwOCA3LjAzMzM5IDIuODA1MDQgNy4xNzc2IDIuOTQ5MTRMMTAuMTI3MSA1LjkwNTE2SDAuNzU2MzM0QzAuMzMzODM0IDUuOTA1MTYgMCA2LjIzNTkyIDAgNi42NTg1NFY3LjMwNzY1QzAgNy43MzAyNyAwLjMzMzgzNCA4LjA5NDM4IDAuNzU2MzM0IDguMDk0MzhIMTAuMTYwNkw3LjE3NzcyIDExLjA2NjlDNy4wMzM1MSAxMS4yMTEyIDYuOTU0MDYgMTEuMzk4NSA2Ljk1NDA2IDExLjYwMzdDNi45NTQwNiAxMS44MDg3IDcuMDMzNTEgMTEuOTk4NiA3LjE3NzcyIDEyLjE0MjhMNy42MzY3NSAxMi42MDA1QzcuNzgxMDcgMTIuNzQ0OCA3Ljk3MzMyIDEyLjgyMzUgOC4xNzg2NSAxMi44MjM1QzguMzgzNzUgMTIuODIzNSA4LjU3NjExIDEyLjc0MzggOC43MjA0MyAxMi41OTk1TDEzLjc3NjMgNy41NDM2QzEzLjkyMSA3LjM5ODgyIDE0LjAwMDUgNy4yMDU1NiAxNCA3LjAwMDExQzE0LjAwMDQgNi43OTM5OCAxMy45MjEgNi42MDA2IDEzLjc3NjIgNi40NTYwNVY2LjQ1NjA1WiIgZmlsbD0iIzQyOEJDQSIvPgo8L3N2Zz4K);background-position:center;background-repeat:no-repeat;background-size:14px;width:14px;height:14px;display:inline-block;margin:-3px 5px 0 0;vertical-align:middle}.simpay-landing-zone .button.button-large{font-size:17px;line-height:30px;padding:10px 20px}.simpay-landing-zone__purchased{display:block;margin:15px 0 0}.simpay-upgrade-modal,.simpay-upgrade-upe-modal{padding:0 !important}.simpay-upgrade-modal *,.simpay-upgrade-upe-modal *{box-sizing:border-box}.simpay-upgrade-modal__content,.simpay-upgrade-upe-modal__content{text-align:center;display:flex;flex-direction:column;align-items:center;padding:16px 32px 32px}.simpay-upgrade-modal__content>.dashicons,.simpay-upgrade-upe-modal__content>.dashicons{color:#333;font-size:48px;width:48px;height:48px}.simpay-upgrade-modal__title,.simpay-upgrade-upe-modal__title{font-size:22px;line-height:1.5;display:block;margin:12px 0 0}.simpay-upgrade-modal__description,.simpay-upgrade-upe-modal__description{color:#777;font-size:16px;margin:16px 0 24px}.simpay-upgrade-modal__description strong,.simpay-upgrade-upe-modal__description strong{color:#333}.simpay-upgrade-modal__discount,.simpay-upgrade-upe-modal__discount{font-size:15px;text-align:center;margin:32px -32px -32px;padding:24px 40px;background-color:#fcf9e8;position:relative}.simpay-upgrade-modal__discount svg,.simpay-upgrade-upe-modal__discount svg{background:#00a32a;fill:#fff;border-radius:50%;border:4px solid #fff;width:32px;height:32px;position:absolute;top:-16px;left:50%;margin-left:-16px}.simpay-upgrade-modal__discount u,.simpay-upgrade-upe-modal__discount u{text-decoration:none;font-weight:bold;color:#00a32a}.simpay-upgrade-modal .button-large,.simpay-upgrade-upe-modal .button-large{font-size:16px;font-weight:bold;margin:0 0 15px;padding:8px 30px !important;height:auto}.simpay-teaser-float{margin:50px;position:relative}.simpay-teaser-float__card{text-align:center;padding:30px;background:#fff;border-radius:4px;box-shadow:0 0 30px 15px rgba(0,0,0,.18);position:relative;z-index:2}#poststuff .simpay-teaser-float h2,.simpay-teaser-float h2{font-size:24px;font-weight:600;margin:0;padding:0}.simpay-teaser-float p{font-size:15px;line-height:1.35;color:#666}.simpay-teaser-float p strong{color:#444}.simpay-teaser-float ul{text-align:left;display:inline-block;margin:-10px 0 20px;list-style-type:none}.simpay-teaser-float li{margin:16px 0;padding:0 0 0 24px;font-size:15px;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEzLjc3NjIgNi40NTYwNUw4LjcyMDMyIDEuNDAwMDVDOC41NzU5OSAxLjI1NTcyIDguMzgzNjQgMS4xNzY1IDguMTc4NTMgMS4xNzY1QzcuOTczMiAxLjE3NjUgNy43ODA5NiAxLjI1NTg0IDcuNjM2NjQgMS40MDAwNUw3LjE3NzYgMS44NTkyQzcuMDMzMzkgMi4wMDMyOSA2Ljk1Mzk1IDIuMTk1NzYgNi45NTM5NSAyLjQwMDk4QzYuOTUzOTUgMi42MDYwOCA3LjAzMzM5IDIuODA1MDQgNy4xNzc2IDIuOTQ5MTRMMTAuMTI3MSA1LjkwNTE2SDAuNzU2MzM0QzAuMzMzODM0IDUuOTA1MTYgMCA2LjIzNTkyIDAgNi42NTg1NFY3LjMwNzY1QzAgNy43MzAyNyAwLjMzMzgzNCA4LjA5NDM4IDAuNzU2MzM0IDguMDk0MzhIMTAuMTYwNkw3LjE3NzcyIDExLjA2NjlDNy4wMzM1MSAxMS4yMTEyIDYuOTU0MDYgMTEuMzk4NSA2Ljk1NDA2IDExLjYwMzdDNi45NTQwNiAxMS44MDg3IDcuMDMzNTEgMTEuOTk4NiA3LjE3NzcyIDEyLjE0MjhMNy42MzY3NSAxMi42MDA1QzcuNzgxMDcgMTIuNzQ0OCA3Ljk3MzMyIDEyLjgyMzUgOC4xNzg2NSAxMi44MjM1QzguMzgzNzUgMTIuODIzNSA4LjU3NjExIDEyLjc0MzggOC43MjA0MyAxMi41OTk1TDEzLjc3NjMgNy41NDM2QzEzLjkyMSA3LjM5ODgyIDE0LjAwMDUgNy4yMDU1NiAxNCA3LjAwMDExQzE0LjAwMDQgNi43OTM5OCAxMy45MjEgNi42MDA2IDEzLjc3NjIgNi40NTYwNVY2LjQ1NjA1WiIgZmlsbD0iIzQyOEJDQSIvPgo8L3N2Zz4K);background-position:left 3px;background-repeat:no-repeat;background-size:14px;color:#777}.simpay-teaser-float .button.button-large{font-size:17px;line-height:30px;padding:10px 20px}.simpay-teaser-float .simpay-notice-dismiss{position:absolute;top:0;right:0;font-size:20px;color:#666;font-weight:bold;text-decoration:none;margin-left:5px;padding:6px 10px;z-index:2}.simpay-teaser-float .simpay-notice-dismiss:hover,.simpay-teaser-float .simpay-notice-dismiss:active,.simpay-teaser-float .simpay-notice-dismiss:focus{color:#666;text-decoration:none}.simpay-teaser-float:after,.simpay-teaser-float:before{opacity:.75;z-index:0;content:"";position:absolute;left:-30px;right:-30px;top:-35px;width:calc(100% + 60px);height:170px;background-image:linear-gradient(#ddd, #ddd),linear-gradient(#eee, #eee),linear-gradient(#ddd, #ddd),linear-gradient(#eee, #eee);background-repeat:no-repeat;background-size:100% 20px,100% 40px,100% 20px,100% 40px;background-position:0 0,0 30px,0 100px,0 130px}.simpay-teaser-float:before{top:170px}.simpay-teaser-float .simpay-upgrade-btn-subtext{margin:24px -30px -30px;padding:32px 40px;border-bottom-left-radius:2px;border-bottom-right-radius:2px;border:0}.simpay-teaser-float .simpay-upgrade-btn-subtext svg{border-color:#fff}.simpay-teaser-float--inline{margin:40px 30px 30px}.simpay-teaser-float--inline .simpay-teaser-float__card{padding:30px;box-shadow:0 0 12px 6px rgba(0,0,0,.16)}#poststuff .simpay-teaser-float--inline h2,.simpay-teaser-float--inline h2{font-size:20px}.simpay-teaser-float--inline p{font-size:15px;margin:.75rem 0}.simpay-teaser-float--inline .button.button-large{font-size:15px;line-height:24px;margin:1rem 0;padding:8px 14px;display:inline-block}.simpay-teaser-float--inline:before,.simpay-teaser-float--inline:after{opacity:.6}.simpay-teaser-float--inline:before{display:none}.simpay-teaser-float--inline:after{top:15px}.simpay-form-settings-notice{font-weight:normal;color:#1d2327;position:relative;margin:18px 18px 0;padding:14px;border-radius:4px;background:#f5f5ff}.simpay-form-settings-notice a{color:#635aff}.simpay-form-settings-notice .simpay-external-link .dashicons-external{margin:1px 0 0 2px}.simpay-form-settings-notice strong{font-size:14px}.simpay-form-settings-notice p{margin:5px 0 0 23px}.simpay-form-settings-notice .simpay-notice-dismiss{font-size:20px;color:#b0b0f0;font-weight:bold;line-height:1;position:absolute;top:0;right:5px;text-decoration:none;padding:0 5px;z-index:2}.simpay-form-settings-notice .simpay-notice-dismiss:hover,.simpay-form-settings-notice .simpay-notice-dismiss:active,.simpay-form-settings-notice .simpay-notice-dismiss:focus{color:#9191ef;text-decoration:none;background:none}.simpay-settings .simpay-form-settings-notice{border:2px solid #645aff;box-shadow:0 1px 1px rgba(0,0,0,.04)}.post-type-simple-pay .lity{z-index:999999999;padding:20px}.post-type-simple-pay .lity-close{margin:10px}.post-type-simple-pay .lity-content{max-width:80vw;max-height:80vh}.post-type-simple-pay .lity-content img{max-height:80vh !important;max-width:80vw !important}#wpsp-api-keys-row-hide{display:none}.post-type-simple-pay #post-preview:not(.simpay-preview-button){display:none}.simpay-license-field-wrapper{margin:20px 0}#simpay-settings-license-key-license-key{margin:0}#simpay-settings-license-key-license-key[readonly]{background:#fff}.simpay-license-message__loading,.simpay-license-field{display:flex;align-items:center}.wp-core-ui .button.simpay-license-button.button-primary,.wp-core-ui .button.simpay-license-button.button-secondary{font-size:1rem;line-height:1;margin:0 8px;padding:13px}.simpay-license-message{font-size:15px;margin-top:8px}.simpay-license-message--valid{color:#15803d}.simpay-license-message--invalid{color:#b91c1c}.simpay-recaptcha-payment-form-feedback .dashicons{margin-top:-1px;display:inline-block}.simpay-recaptcha-payment-form-feedback .dashicons-update-alt{animation:rotation 2s infinite linear}.simpay-form-builder-inset-settings{margin:3px 0 0 24px}fieldset.simpay-form-builder-inset-settings>*:not(legend){margin:5px 0 8px}.simpay-form-builder-inset-settings>*:last-child{margin-bottom:0}.simpay-form-builder-inventory-control{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;padding:6px 8px;box-shadow:0 0 0 rgba(0,0,0,0);transition:box-shadow .1s linear;border-radius:2px;border:1px solid #757575;font-size:16px;line-height:normal;margin:0;padding:0;width:auto;display:inline-flex;align-items:center}@media(prefers-reduced-motion: reduce){.simpay-form-builder-inventory-control{transition-duration:0s;transition-delay:0s}}@media(min-width: 600px){.simpay-form-builder-inventory-control{font-size:13px;line-height:normal}}.simpay-form-builder-inventory-control:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid rgba(0,0,0,0)}.simpay-form-builder-inventory-control::-webkit-input-placeholder{color:rgba(30,30,30,.62)}.simpay-form-builder-inventory-control::-moz-placeholder{opacity:1;color:rgba(30,30,30,.62)}.simpay-form-builder-inventory-control:-ms-input-placeholder{color:rgba(30,30,30,.62)}.simpay-form-builder-inventory-control:focus-within{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid rgba(0,0,0,0)}.simpay-form-builder-inventory-control input[type=number]{border:0;box-shadow:none;background:none;border-radius:0;width:75px}.simpay-form-builder-inventory-control input[type=number]:focus{border:0;box-shadow:none;outline:0}.simpay-form-builder-inventory-control+label{margin-left:8px}.simpay-form-builder-inventory-control__initial{color:#757575;font-size:16px;line-height:normal;padding-right:8px}@media(min-width: 600px){.simpay-form-builder-inventory-control__initial{font-size:13px;line-height:normal}}.simpay-form-builder-inventory-control__initial:before{content:"/";display:inline-block;vertical-align:top;margin-top:-1px}.simpay-form-builder-purchase-restrictions__restriction-item{display:flex;align-items:center;margin-top:8px;margin-bottom:8px}.simpay-form-builder-purchase-restrictions__restriction-item label{margin-left:8px}.simpay-form-builder-purchase-restrictions__restriction-item-datetime{display:flex;align-items:center}.simpay-form-builder-purchase-restrictions__restriction-item-datetime>*{margin-right:10px}.simpay-form-builder-purchase-restrictions__restriction-item-datetime span{color:#757575}.simpay-form-builder-fee-recovery__amounts{display:flex;align-items:center;margin-top:5px}.simpay-form-builder-fee-recovery ::-webkit-input-placeholder{color:#b7bec7}.simpay-form-builder-fee-recovery ::-moz-placeholder{color:#b7bec7;opacity:1}.simpay-form-builder-fee-recovery :-ms-input-placeholder{color:#b7bec7}.simpay-form-builder-fee-recovery>*{margin-right:8px}.simpay-form-builder-fee-percent-control{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;padding:6px 8px;box-shadow:0 0 0 rgba(0,0,0,0);transition:box-shadow .1s linear;border-radius:2px;border:1px solid #757575;font-size:16px;line-height:normal;margin:0;padding:0;width:auto;display:inline-flex;align-items:center}@media(prefers-reduced-motion: reduce){.simpay-form-builder-fee-percent-control{transition-duration:0s;transition-delay:0s}}@media(min-width: 600px){.simpay-form-builder-fee-percent-control{font-size:13px;line-height:normal}}.simpay-form-builder-fee-percent-control:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid rgba(0,0,0,0)}.simpay-form-builder-fee-percent-control::-webkit-input-placeholder{color:rgba(30,30,30,.62)}.simpay-form-builder-fee-percent-control::-moz-placeholder{opacity:1;color:rgba(30,30,30,.62)}.simpay-form-builder-fee-percent-control:-ms-input-placeholder{color:rgba(30,30,30,.62)}.simpay-form-builder-fee-percent-control:focus-within{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid rgba(0,0,0,0)}.simpay-form-builder-fee-percent-control input[type=number]{border:0;box-shadow:none;background:none;border-radius:0;width:75px}.simpay-form-builder-fee-percent-control input[type=number]:focus{border:0;box-shadow:none;outline:0}.simpay-form-builder-fee-percent-control+label{margin-left:8px}.simpay-form-builder-fee-percent-control__suffix{color:#757575;font-size:16px;line-height:normal;padding-right:8px}@media(min-width: 600px){.simpay-form-builder-fee-percent-control__suffix{font-size:13px;line-height:normal}}.simpay-form-builder-automations__cta{margin:24px 0 6px;text-align:center}.simpay-form-builder-automator{padding:16px 4px 26px !important}.simpay-form-builder-automator,.simpay-form-builder-automator *{box-sizing:border-box}.simpay-form-builder-automator input[type=search]{font-size:15px;padding:2px 8px}.simpay-form-builder-automator__integrations{display:grid;grid-template-columns:repeat(4, minmax(0, 1fr));grid-column-gap:16px;grid-row-gap:16px;margin:18px -18px 0;padding:0 18px 10px;width:calc(100% + 36px);max-height:400px;overflow-y:scroll}.simpay-form-builder-automator__integrations-integration{color:initial;text-align:center;text-decoration:none;background:#fff;border:1px solid #eee;border-radius:4px;box-shadow:0 1px 3px 0 rgba(0,0,0,.03);transition:all ease-in .15s}.simpay-form-builder-automator__integrations-integration img{display:block;margin:16px auto;height:50px}.simpay-form-builder-automator__integrations-integration span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:8px 16px;display:block;border-top:1px solid #eee}.simpay-form-builder-automator__integrations-integration:hover{cursor:pointer;border-color:#ddd;box-shadow:0 2px 4px 0 rgba(0,0,0,.06)}body.site-health #wpbody-content,body.post-type-simple-pay #wpbody-content{padding-bottom:200px}#wpfooter .simpay-footer-promotion{text-align:center;font-weight:400;font-size:13px;line-height:16px;color:#787c82;padding:20px 0 30px 0;margin-bottom:20px}#wpfooter .simpay-footer-promotion p{font-weight:600}#wpfooter .simpay-footer-promotion-links,#wpfooter .simpay-footer-promotion-social{display:flex;justify-content:center;align-items:center}#wpfooter .simpay-footer-promotion-links{margin:9px 0 0}#wpfooter .simpay-footer-promotion-links span{color:#c3c4c7;padding:0 7px}#wpfooter .simpay-footer-promotion-social{margin:10px 0 0 0;gap:10px}#wpfooter .simpay-footer-promotion-social li{margin-bottom:0}#wpfooter .simpay-footer-promotion-social li:hover path{fill:#50575e}#wpfooter .simpay-footer-promotion-social a{display:block;height:16px}.simpay-settings-is_upe td{background:#fff;border:1px solid #c3c4c7;border-left-width:4px;border-left-color:#2271b1;box-shadow:0 1px 1px rgba(0,0,0,.04);padding:12px 18px} diff --git a/includes/core/assets/js/dist/simpay-admin-dashboard-widget-report-css.asset.php b/includes/core/assets/js/dist/simpay-admin-dashboard-widget-report-css.asset.php index 9781c80d..d5f13db7 100644 --- a/includes/core/assets/js/dist/simpay-admin-dashboard-widget-report-css.asset.php +++ b/includes/core/assets/js/dist/simpay-admin-dashboard-widget-report-css.asset.php @@ -1 +1 @@ - array(), 'version' => '10e0c9aefff5d3a8302d317cb61bc427'); \ No newline at end of file + array(), 'version' => '2fc5df850afb9619b482b2d36d70211f'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-dashboard-widget-report.asset.php b/includes/core/assets/js/dist/simpay-admin-dashboard-widget-report.asset.php index aff448bd..6e941e93 100644 --- a/includes/core/assets/js/dist/simpay-admin-dashboard-widget-report.asset.php +++ b/includes/core/assets/js/dist/simpay-admin-dashboard-widget-report.asset.php @@ -1 +1 @@ - array('lodash', 'react', 'wp-api-fetch', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => 'af7158193a243840baf147a2c1cd6f5e'); \ No newline at end of file + array('lodash', 'react', 'wp-api-fetch', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => '45676981d2cb1015b0e201bc2fd50dc7'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-dashboard-widget-report.js b/includes/core/assets/js/dist/simpay-admin-dashboard-widget-report.js index 20f5f114..86fffe34 100644 --- a/includes/core/assets/js/dist/simpay-admin-dashboard-widget-report.js +++ b/includes/core/assets/js/dist/simpay-admin-dashboard-widget-report.js @@ -1,4 +1,4 @@ -!function(t){var e={};function i(n){if(e[n])return e[n].exports;var s=e[n]={i:n,l:!1,exports:{}};return t[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}i.m=t,i.c=e,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 s in t)i.d(n,s,function(e){return t[e]}.bind(null,s));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="",i(i.s=83)}([function(t,e){t.exports=window.wp.element},,function(t,e){t.exports=window.wp.i18n},function(t,e){t.exports=window.wp.components},function(t,e,i){"use strict";function n(t,e){if(e.length1?"s":"")+" required, but only "+e.length+" present")}i.d(e,"a",(function(){return n}))},function(t,e){t.exports=window.React},function(t,e,i){var n=i(26),s=i(27),r=i(22),o=i(28);t.exports=function(t,e){return n(t)||s(t,e)||r(t,e)||o()},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){"use strict";function n(t){if(null===t||!0===t||!1===t)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}i.d(e,"a",(function(){return n}))},function(t,e,i){"use strict";i.d(e,"a",(function(){return r}));var n=i(4);function s(t){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t){Object(n.a)(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||"object"===s(t)&&"[object Date]"===e?new Date(t.getTime()):"number"==typeof t||"[object Number]"===e?new Date(t):("string"!=typeof t&&"[object String]"!==e||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}},function(t,e){t.exports=window.wp.primitives},function(t,e){t.exports=window.wp.url},function(t,e,i){var n=i(30);t.exports=function(t,e,i){return(e=n(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=window.lodash},function(t,e,i){var n;!function(){"use strict";var i={}.hasOwnProperty;function s(){for(var t=[],e=0;eArray.prototype.slice.call(t));let s=!1,r=[];return function(...i){r=n(i),s||(s=!0,h.call(window,()=>{s=!1,t.apply(e,r)}))}}const u=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2;function f(){}const g=function(){let t=0;return function(){return t++}}();function p(t){return null==t}function m(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.substr(0,7)&&"Array]"===e.substr(-6)}function b(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}const x=t=>("number"==typeof t||t instanceof Number)&&isFinite(+t);function y(t,e){return x(t)?t:e}function v(t,e){return void 0===t?e:t}const _=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function w(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function M(t,e,i,n){let s,r,o;if(m(t))if(r=t.length,n)for(s=r-1;s>=0;s--)e.call(i,t[s],s);else for(s=0;si;)t=t[e.substr(i,n-i)],i=n+1,n=E(e,i);return t}function A(t){return t.charAt(0).toUpperCase()+t.slice(1)}const L=t=>void 0!==t,R=t=>"function"==typeof t,F=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0},z=Math.PI,I=2*z,N=I+z,V=Number.POSITIVE_INFINITY,W=z/180,B=z/2,H=z/4,U=2*z/3,Y=Math.log10,$=Math.sign;function X(t){const e=Math.round(t);t=G(t,e,t/1e3)?e:t;const i=Math.pow(10,Math.floor(Y(t))),n=t/i;return(n<=1?1:n<=2?2:n<=5?5:10)*i}function q(t){return!isNaN(parseFloat(t))&&isFinite(t)}function G(t,e,i){return Math.abs(t-e)l&&c=Math.min(e,i)-n&&t<=Math.max(e,i)+n}const at=t=>0===t||1===t,lt=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*I/i),ct=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*I/i)+1,ht={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*B),easeOutSine:t=>Math.sin(t*B),easeInOutSine:t=>-.5*(Math.cos(z*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>at(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>at(t)?t:lt(t,.075,.3),easeOutElastic:t=>at(t)?t:ct(t,.075,.3),easeInOutElastic(t){const e=.1125;return at(t)?t:t<.5?.5*lt(2*t,e,.45):.5+.5*ct(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-ht.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*ht.easeInBounce(2*t):.5*ht.easeOutBounce(2*t-1)+.5},dt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},ut="0123456789ABCDEF",ft=t=>ut[15&t],gt=t=>ut[(240&t)>>4]+ut[15&t],pt=t=>(240&t)>>4==(15&t);function mt(t){return t+.5|0}const bt=(t,e,i)=>Math.max(Math.min(t,i),e);function xt(t){return bt(mt(2.55*t),0,255)}function yt(t){return bt(mt(255*t),0,255)}function vt(t){return bt(mt(t/2.55)/100,0,1)}function _t(t){return bt(mt(100*t),0,100)}const wt=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/,Mt=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Ot(t,e,i){const n=e*Math.min(i,1-i),s=(e,s=(e+t/30)%12)=>i-n*Math.max(Math.min(s-3,9-s,1),-1);return[s(0),s(8),s(4)]}function kt(t,e,i){const n=(n,s=(n+t/60)%6)=>i-i*e*Math.max(Math.min(s,4-s,1),0);return[n(5),n(3),n(1)]}function St(t,e,i){const n=Ot(t,1,.5);let s;for(e+i>1&&(s=1/(e+i),e*=s,i*=s),s=0;s<3;s++)n[s]*=1-e-i,n[s]+=e;return n}function Dt(t){const e=t.r/255,i=t.g/255,n=t.b/255,s=Math.max(e,i,n),r=Math.min(e,i,n),o=(s+r)/2;let a,l,c;return s!==r&&(c=s-r,l=o>.5?c/(2-s-r):c/(s+r),a=s===e?(i-n)/c+(i=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=yt(t[3]))):(e=Rt(t,{r:0,g:0,b:0,a:1})).a=yt(e.a),e}function zt(t){return"r"===t.charAt(0)?function(t){const e=wt.exec(t);let i,n,s,r=255;if(e){if(e[7]!==i){const t=+e[7];r=255&(e[8]?xt(t):255*t)}return i=+e[1],n=+e[3],s=+e[5],i=255&(e[2]?xt(i):i),n=255&(e[4]?xt(n):n),s=255&(e[6]?xt(s):s),{r:i,g:n,b:s,a:r}}}(t):function(t){const e=Mt.exec(t);let i,n=255;if(!e)return;e[5]!==i&&(n=e[6]?xt(+e[5]):yt(+e[5]));const s=Tt(+e[2]),r=+e[3]/100,o=+e[4]/100;return i="hwb"===e[1]?function(t,e,i){return Pt(St,t,e,i)}(s,r,o):"hsv"===e[1]?function(t,e,i){return Pt(kt,t,e,i)}(s,r,o):Ct(s,r,o),{r:i[0],g:i[1],b:i[2],a:n}}(t)}class It{constructor(t){if(t instanceof It)return t;const e=typeof t;let i;var n,s,r;"object"===e?i=Ft(t):"string"===e&&(r=(n=t).length,"#"===n[0]&&(4===r||5===r?s={r:255&17*dt[n[1]],g:255&17*dt[n[2]],b:255&17*dt[n[3]],a:5===r?17*dt[n[4]]:255}:7!==r&&9!==r||(s={r:dt[n[1]]<<4|dt[n[2]],g:dt[n[3]]<<4|dt[n[4]],b:dt[n[5]]<<4|dt[n[6]],a:9===r?dt[n[7]]<<4|dt[n[8]]:255})),i=s||function(t){At||(At=function(){const t={},e=Object.keys(jt),i=Object.keys(Et);let n,s,r,o,a;for(n=0;n>16&255,r>>8&255,255&r]}return t}(),At.transparent=[0,0,0,0]);const e=At[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}(t)||zt(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Rt(this._rgb);return t&&(t.a=vt(t.a)),t}set rgb(t){this._rgb=Ft(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${vt(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):this._rgb;var t}hexString(){return this._valid?(t=this._rgb,e=function(t){return pt(t.r)&&pt(t.g)&&pt(t.b)&&pt(t.a)}(t)?ft:gt,t?"#"+e(t.r)+e(t.g)+e(t.b)+(t.a<255?e(t.a):""):t):this._rgb;var t,e}hslString(){return this._valid?function(t){if(!t)return;const e=Dt(t),i=e[0],n=_t(e[1]),s=_t(e[2]);return t.a<255?`hsla(${i}, ${n}%, ${s}%, ${vt(t.a)})`:`hsl(${i}, ${n}%, ${s}%)`}(this._rgb):this._rgb}mix(t,e){const i=this;if(t){const n=i.rgb,s=t.rgb;let r;const o=e===r?.5:e,a=2*o-1,l=n.a-s.a,c=((a*l==-1?a:(a+l)/(1+a*l))+1)/2;r=1-c,n.r=255&c*n.r+r*s.r+.5,n.g=255&c*n.g+r*s.g+.5,n.b=255&c*n.b+r*s.b+.5,n.a=o*n.a+(1-o)*s.a,i.rgb=n}return i}clone(){return new It(this.rgb)}alpha(t){return this._rgb.a=yt(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=mt(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Lt(this._rgb,2,t),this}darken(t){return Lt(this._rgb,2,-t),this}saturate(t){return Lt(this._rgb,1,t),this}desaturate(t){return Lt(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=Dt(t);i[0]=Tt(i[0]+e),i=Ct(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}function Nt(t){return new It(t)}const Vt=t=>t instanceof CanvasGradient||t instanceof CanvasPattern;function Wt(t){return Vt(t)?t:Nt(t)}function Bt(t){return Vt(t)?t:Nt(t).saturate(.5).darken(.1).hexString()}const Ht=Object.create(null),Ut=Object.create(null);function Yt(t,e){if(!e)return t;const i=e.split(".");for(let e=0,n=i.length;et.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>Bt(e.backgroundColor),this.hoverBorderColor=(t,e)=>Bt(e.borderColor),this.hoverColor=(t,e)=>Bt(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t)}set(t,e){return $t(this,t,e)}get(t){return Yt(this,t)}describe(t,e){return $t(Ut,t,e)}override(t,e){return $t(Ht,t,e)}route(t,e,i,n){const s=Yt(this,t),r=Yt(this,i),o="_"+e;Object.defineProperties(s,{[o]:{value:s[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[o],e=r[n];return b(t)?Object.assign({},e,t):v(t,e)},set(t){this[o]=t}}})}}({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function qt(t,e,i,n,s){let r=e[s];return r||(r=e[s]=t.measureText(s).width,i.push(s)),r>n&&(n=r),n}function Gt(t,e,i,n){let s=(n=n||{}).data=n.data||{},r=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(s=n.data={},r=n.garbageCollect=[],n.font=e),t.save(),t.font=e;let o=0;const a=i.length;let l,c,h,d,u;for(l=0;li.length){for(l=0;l0&&t.stroke()}}function Jt(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.xe.top-i&&t.y0&&""!==r.strokeColor;let l,c;for(t.save(),t.font=s.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),p(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,r),l=0;lv(t[i],t[e[i]]):e=>t[e]:()=>t;for(const t of s)i[t]=+r(t)||0;return i}function de(t){return he(t,{top:"y",right:"x",bottom:"y",left:"x"})}function ue(t){return he(t,["topLeft","topRight","bottomLeft","bottomRight"])}function fe(t){const e=de(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function ge(t,e){t=t||{},e=e||Xt.font;let i=v(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let n=v(t.style,e.style);n&&!(""+n).match(le)&&(console.warn('Invalid font style specified: "'+n+'"'),n="");const s={family:v(t.family,e.family),lineHeight:ce(v(t.lineHeight,e.lineHeight),i),size:i,style:n,weight:v(t.weight,e.weight),string:""};return s.string=function(t){return!t||p(t.size)||p(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(s),s}function pe(t,e,i,n){let s,r,o,a=!0;for(s=0,r=t.length;st[i]1;)n=r+s>>1,i(n)?r=n:s=n;return{lo:r,hi:s}}const xe=(t,e,i)=>be(t,i,n=>t[n][e]be(t,i,n=>t[n][e]>=i),ve=["push","pop","shift","splice","unshift"];function _e(t,e){const i=t._chartjs;if(!i)return;const n=i.listeners,s=n.indexOf(e);-1!==s&&n.splice(s,1),n.length>0||(ve.forEach(e=>{delete t[e]}),delete t._chartjs)}function we(t){const e=new Set;let i,n;for(i=0,n=t.length;it[0])){L(n)||(n=Le("_fallback",t));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:i,_fallback:n,_getTarget:s,override:s=>Me([s,...t],e,i,n)};return new Proxy(r,{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,n)=>Pe(i,n,()=>function(t,e,i,n){let s;for(const r of e)if(s=Le(Se(r,t),i),L(s))return De(t,s)?je(i,n,t,s):s}(n,e,t,i)),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>Re(t).includes(e),ownKeys:t=>Re(t),set(t,e,i){const n=t._storage||(t._storage=s());return t[e]=n[e]=i,delete t._keys,!0}})}function Oe(t,e,i,n){const s={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:ke(t,n),setContext:e=>Oe(t,e,i,n),override:s=>Oe(t.override(s),e,i,n)};return new Proxy(s,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>Pe(t,e,()=>function(t,e,i){const{_proxy:n,_context:s,_subProxy:r,_descriptors:o}=t;let a=n[e];return R(a)&&o.isScriptable(e)&&(a=function(t,e,i,n){const{_proxy:s,_context:r,_subProxy:o,_stack:a}=i;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);return a.add(t),e=e(r,o||n),a.delete(t),De(t,e)&&(e=je(s._scopes,s,t,e)),e}(e,a,t,i)),m(a)&&a.length&&(a=function(t,e,i,n){const{_proxy:s,_context:r,_subProxy:o,_descriptors:a}=i;if(L(r.index)&&n(t))e=e[r.index%e.length];else if(b(e[0])){const i=e,n=s._scopes.filter(t=>t!==i);e=[];for(const l of i){const i=je(n,s,t,l);e.push(Oe(i,r,o&&o[t],a))}}return e}(e,a,t,o.isIndexable)),De(e,a)&&(a=Oe(a,s,r&&r[e],o)),a}(t,e,i)),getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,i)=>Reflect.has(t,i),ownKeys:()=>Reflect.ownKeys(t),set:(e,i,n)=>(t[i]=n,delete e[i],!0)})}function ke(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:n=e.indexable,_allKeys:s=e.allKeys}=t;return{allKeys:s,scriptable:i,indexable:n,isScriptable:R(i)?i:()=>i,isIndexable:R(n)?n:()=>n}}const Se=(t,e)=>t?t+A(e):e,De=(t,e)=>b(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function Pe(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const n=i();return t[e]=n,n}function Ce(t,e,i){return R(t)?t(e,i):t}const Te=(t,e)=>!0===t?e:"string"==typeof t?j(e,t):void 0;function Ee(t,e,i,n,s){for(const r of e){const e=Te(i,r);if(e){t.add(e);const r=Ce(e._fallback,i,s);if(L(r)&&r!==i&&r!==n)return r}else if(!1===e&&L(n)&&i!==n)return null}return!1}function je(t,e,i,n){const s=e._rootScopes,r=Ce(e._fallback,i,n),o=[...t,...s],a=new Set;a.add(n);let l=Ae(a,o,i,r||i,n);return null!==l&&(!L(r)||r===i||(l=Ae(a,o,r,l,n),null!==l))&&Me(Array.from(a),[""],s,r,()=>function(t,e,i){const n=t._getTarget();e in n||(n[e]={});const s=n[e];return m(s)&&b(i)?i:s}(e,i,n))}function Ae(t,e,i,n,s){for(;i;)i=Ee(t,e,i,n,s);return i}function Le(t,e){for(const i of e){if(!i)continue;const e=i[t];if(L(e))return e}}function Re(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter(t=>!t.startsWith("_")))e.add(t);return Array.from(e)}(t._scopes)),e}const Fe=Number.EPSILON||1e-14,ze=(t,e)=>e"x"===t?"y":"x";function Ne(t,e,i,n){const s=t.skip?e:t,r=e,o=i.skip?e:i,a=et(r,s),l=et(o,r);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=n*c,u=n*h;return{previous:{x:r.x-d*(o.x-s.x),y:r.y-d*(o.y-s.y)},next:{x:r.x+u*(o.x-s.x),y:r.y+u*(o.y-s.y)}}}function Ve(t,e,i){return Math.max(Math.min(t,i),e)}function We(t,e,i,n,s){let r,o,a,l;if(e.spanGaps&&(t=t.filter(t=>!t.skip)),"monotone"===e.cubicInterpolationMode)!function(t,e="x"){const i=Ie(e),n=t.length,s=Array(n).fill(0),r=Array(n);let o,a,l,c=ze(t,0);for(o=0;owindow.getComputedStyle(t,null),$e=["top","right","bottom","left"];function Xe(t,e,i){const n={};i=i?"-"+i:"";for(let s=0;s<4;s++){const r=$e[s];n[r]=parseFloat(t[e+"-"+r+i])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function qe(t,e){const{canvas:i,currentDevicePixelRatio:n}=e,s=Ye(i),r="border-box"===s.boxSizing,o=Xe(s,"padding"),a=Xe(s,"border","width"),{x:l,y:c,box:h}=function(t,e){const i=t.native||t,n=i.touches,s=n&&n.length?n[0]:i,{offsetX:r,offsetY:o}=s;let a,l,c=!1;if(((t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot))(r,o,i.target))a=r,l=o;else{const t=e.getBoundingClientRect();a=s.clientX-t.left,l=s.clientY-t.top,c=!0}return{x:a,y:l,box:c}}(t,i),d=o.left+(h&&a.left),u=o.top+(h&&a.top);let{width:f,height:g}=e;return r&&(f-=o.width+a.width,g-=o.height+a.height),{x:Math.round((l-d)/f*i.width/n),y:Math.round((c-u)/g*i.height/n)}}const Ge=t=>Math.round(10*t)/10;function Qe(t,e,i){const n=e||1,s=Math.floor(t.height*n),r=Math.floor(t.width*n);t.height=s/n,t.width=r/n;const o=t.canvas;return o.style&&(i||!o.style.height&&!o.style.width)&&(o.style.height=t.height+"px",o.style.width=t.width+"px"),(t.currentDevicePixelRatio!==n||o.height!==s||o.width!==r)&&(t.currentDevicePixelRatio=n,o.height=s,o.width=r,t.ctx.setTransform(n,0,0,n,0,0),!0)}const Ke=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(t){}return t}();function Ze(t,e){const i=function(t,e){return Ye(t).getPropertyValue(e)}(t,e),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function Je(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function ti(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:"middle"===n?i<.5?t.y:e.y:"after"===n?i<1?t.y:e.y:i>0?e.y:t.y}}function ei(t,e,i,n){const s={x:t.cp2x,y:t.cp2y},r={x:e.cp1x,y:e.cp1y},o=Je(t,s,i),a=Je(s,r,i),l=Je(r,e,i),c=Je(o,a,i),h=Je(a,l,i);return Je(c,h,i)}const ii=new Map;function ni(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let n=ii.get(i);return n||(n=new Intl.NumberFormat(t,e),ii.set(i,n)),n}(e,i).format(t)}function si(t,e,i){return t?function(t,e){return{x:i=>t+t+e-i,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,i):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function ri(t){return"angle"===t?{between:st,compare:it,normalize:nt}:{between:ot,compare:(t,e)=>t-e,normalize:t=>t}}function oi({start:t,end:e,count:i,loop:n,style:s}){return{start:t%i,end:e%i,loop:n&&(e-t+1)%i==0,style:s}}function ai(t,e,i){if(!i)return[t];const{property:n,start:s,end:r}=i,o=e.length,{compare:a,between:l,normalize:c}=ri(n),{start:h,end:d,loop:u,style:f}=function(t,e,i){const{property:n,start:s,end:r}=i,{between:o,normalize:a}=ri(n),l=e.length;let c,h,{start:d,end:u,loop:f}=t;if(f){for(d+=l,u+=l,c=0,h=l;cn({chart:t,initial:e.initial,numSteps:r,currentStep:Math.min(i-e.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=h.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,n)=>{if(!i.running||!i.items.length)return;const s=i.items;let r,o=s.length-1,a=!1;for(;o>=0;--o)r=s[o],r._active?(r._total>i.duration&&(i.duration=r._total),r.tick(t),a=!0):(s[o]=s[s.length-1],s.pop());a&&(n.draw(),this._notify(n,i,t,"progress")),s.length||(i.running=!1,this._notify(n,i,t,"complete"),i.initial=!1),e+=s.length}),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((t,e)=>Math.max(t,e._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let n=i.length-1;for(;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}};const ui={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const n=Wt(t||"transparent"),s=n.valid&&Wt(e||"transparent");return s&&s.valid?s.mix(n,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class fi{constructor(t,e,i,n){const s=e[i];n=pe([t.to,n,s,t.from]);const r=pe([t.from,s,n]);this._active=!0,this._fn=t.fn||ui[t.type||typeof r],this._easing=ht[t.easing]||ht.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=r,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const n=this._target[this._prop],s=i-this._start,r=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=s,this._loop=!!t.loop,this._to=pe([t.to,e,n,t.from]),this._from=pe([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,n=this._prop,s=this._from,r=this._loop,o=this._to;let a;if(this._active=s!==o&&(r||e1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[n]=this._fn(s,o,a))}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let t=0;t"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),Xt.set("animations",{colors:{type:"color",properties:["color","borderColor","backgroundColor"]},numbers:{type:"number",properties:["x","y","borderWidth","radius","tension"]}}),Xt.describe("animations",{_fallback:"animation"}),Xt.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}});class pi{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!b(t))return;const e=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const n=t[i];if(!b(n))return;const s={};for(const t of gi)s[t]=n[t];(m(n.properties)&&n.properties||[i]).forEach(t=>{t!==i&&e.has(t)||e.set(t,s)})})}_animateOptions(t,e){const i=e.options,n=function(t,e){if(!e)return;let i=t.options;if(i)return i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i;t.options=e}(t,i);if(!n)return[];const s=this._createAnimations(n,i);return i.$shared&&function(t,e){const i=[],n=Object.keys(e);for(let e=0;e{t.options=i},()=>{}),s}_createAnimations(t,e){const i=this._properties,n=[],s=t.$animations||(t.$animations={}),r=Object.keys(e),o=Date.now();let a;for(a=r.length-1;a>=0;--a){const l=r[a];if("$"===l.charAt(0))continue;if("options"===l){n.push(...this._animateOptions(t,e));continue}const c=e[l];let h=s[l];const d=i.get(l);if(h){if(d&&h.active()){h.update(d,c,o);continue}h.cancel()}d&&d.duration?(s[l]=h=new fi(d,t,l,c),n.push(h)):t[l]=c}return n}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(di.add(this._chart,i),!0):void 0}}function mi(t,e){const i=t&&t.options||{},n=i.reverse,s=void 0===i.min?e:0,r=void 0===i.max?e:0;return{start:n?r:s,end:n?s:r}}function bi(t,e){const i=[],n=t._getSortedDatasetMetas(e);let s,r;for(s=0,r=n.length;s0||!i&&e<0)return s.index}return null}function wi(t,e){const{chart:i,_cachedMeta:n}=t,s=i._stacks||(i._stacks={}),{iScale:r,vScale:o,index:a}=n,l=r.axis,c=o.axis,h=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(r,o,n),d=e.length;let u;for(let t=0;ti[t].axis===e).shift()}function Oi(t,e){const i=t.controller.index,n=t.vScale&&t.vScale.axis;if(n){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[n]||void 0===e[n][i])return;delete e[n][i]}}}const ki=t=>"reset"===t||"none"===t,Si=(t,e)=>e?t:Object.assign({},t);class Di{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=yi(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&Oi(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=(t,e,i,n)=>"x"===t?e:"r"===t?n:i,s=e.xAxisID=v(i.xAxisID,Mi(t,"x")),r=e.yAxisID=v(i.yAxisID,Mi(t,"y")),o=e.rAxisID=v(i.rAxisID,Mi(t,"r")),a=e.indexAxis,l=e.iAxisID=n(a,s,r,o),c=e.vAxisID=n(a,r,s,o);e.xScale=this.getScaleForId(s),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(o),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&_e(this._data,this),t._stacked&&Oi(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(b(e))this._data=function(t){const e=Object.keys(t),i=new Array(e.length);let n,s,r;for(n=0,s=e.length;n{const e="_onData"+A(t),i=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...t){const s=i.apply(this,t);return n._chartjs.listeners.forEach(i=>{"function"==typeof i[e]&&i[e](...t)}),s}})}))),this._syncList=[],this._data=e}var n}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let n=!1;this._dataCheck();const s=e._stacked;e._stacked=yi(e.vScale,e),e.stack!==i.stack&&(n=!0,Oi(e),e.stack=i.stack),this._resyncElements(t),(n||s!==e._stacked)&&wi(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:n}=this,{iScale:s,_stacked:r}=i,o=s.axis;let a,l,c,h=0===t&&e===n.length||i._sorted,d=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=n,i._sorted=!0,c=n;else{c=m(n[t])?this.parseArrayData(i,n,t,e):b(n[t])?this.parseObjectData(i,n,t,e):this.parsePrimitiveData(i,n,t,e);const s=()=>null===l[o]||d&&l[o]t&&!e.hidden&&e._stacked&&{keys:bi(i,!0),values:null})(e,i,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:h}=function(t){const{min:e,max:i,minDefined:n,maxDefined:s}=t.getUserBounds();return{min:n?e:Number.NEGATIVE_INFINITY,max:s?i:Number.POSITIVE_INFINITY}}(o);let d,u;function f(){u=n[d];const e=u[o.axis];return!x(u[t.axis])||c>e||h=0;--d)if(!f()){this.updateRangeFromParsed(l,t,u,a);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let n,s,r;for(n=0,s=e.length;n=0&&tthis.getContext(i,n),h);return f.$shared&&(f.$shared=a,s[r]=Object.freeze(Si(f,a))),f}_resolveAnimations(t,e,i){const n=this.chart,s=this._cachedDataOpts,r="animation-"+e,o=s[r];if(o)return o;let a;if(!1!==n.options.animation){const n=this.chart.config,s=n.datasetAnimationScopeKeys(this._type,e),r=n.getOptionScopes(this.getDataset(),s);a=n.createResolver(r,this.getContext(t,i,e))}const l=new pi(n,a&&a.animations);return a&&a._cacheable&&(s[r]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||ki(t)||this.chart._animationsDisabled}updateElement(t,e,i,n){ki(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!ki(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;const s=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(s)||s})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];const n=i.length,s=e.length,r=Math.min(s,n);r&&this.parse(0,r),s>n?this._insertElements(n,s-n,t):s{for(t.length+=e,o=t.length-1;o>=r;o--)t[o]=t[o-e]};for(a(s),o=t;ot-e))}return t._cache.$bar}(e,t.type);let n,s,r,o,a=e._length;const l=()=>{32767!==r&&-32768!==r&&(L(o)&&(a=Math.min(a,Math.abs(r-o)||a)),o=r)};for(n=0,s=i.length;nMath.abs(a)&&(l=a,c=o),e[i.axis]=c,e._custom={barStart:l,barEnd:c,start:s,end:r,min:o,max:a}}(t,e,i,n):e[i.axis]=i.parse(t,n),e}function Ti(t,e,i,n){const s=t.iScale,r=t.vScale,o=s.getLabels(),a=s===r,l=[];let c,h,d,u;for(c=i,h=i+n;ct.x,i="left",n="right"):(e=t.base=i?1:-1)}(h,e,r)*s,d===r&&(m-=h/2),c=m+h),m===e.getPixelForValue(r)){const t=$(h)*e.getLineWidthForValue(r)/2;m+=t,h-=t}return{size:h,base:m,head:c,center:c+h/2}}_calculateBarIndexPixels(t,e){const i=e.scale,n=this.options,s=n.skipNull,r=v(n.maxBarThickness,1/0);let o,a;if(e.grouped){const i=s?this._getStackCount(t):e.stackCount,l="flex"===n.barThickness?function(t,e,i,n){const s=e.pixels,r=s[t];let o=t>0?s[t-1]:null,a=t=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,{xScale:i,yScale:n}=e,s=this.getParsed(t),r=i.getLabelForValue(s.x),o=n.getLabelForValue(s.y),a=s._custom;return{label:e.label,value:"("+r+", "+o+(a?", "+a:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,n){const s="reset"===n,{iScale:r,vScale:o}=this._cachedMeta,a=this.resolveDataElementOptions(e,n),l=this.getSharedOptions(a),c=this.includeOptions(n,l),h=r.axis,d=o.axis;for(let a=e;a""}}}};class Ii extends Di{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,n=this._cachedMeta;if(!1===this._parsing)n._parsed=i;else{let s,r,o=t=>+i[t];if(b(i[t])){const{key:t="value"}=this._parsing;o=e=>+j(i[e],t)}for(s=t,r=t+e;sst(t,a,l,!0)?1:Math.max(e,e*i,n,n*i),g=(t,e,n)=>st(t,a,l,!0)?-1:Math.min(e,e*i,n,n*i),p=f(0,c,d),m=f(B,h,u),b=g(z,c,d),x=g(z+B,h,u);n=(p-b)/2,s=(m-x)/2,r=-(p+b)/2,o=-(m+x)/2}return{ratioX:n,ratioY:s,offsetX:r,offsetY:o}}(u,d,a),b=(i.width-r)/f,x=(i.height-r)/g,y=Math.max(Math.min(b,x)/2,0),v=_(this.options.radius,y),w=(v-Math.max(v*a,0))/this._getVisibleDatasetWeightTotal();this.offsetX=p*v,this.offsetY=m*v,n.total=this.calculateTotal(),this.outerRadius=v-w*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-w*h,0),this.updateElements(s,0,s.length,t)}_circumference(t,e){const i=this.options,n=this._cachedMeta,s=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===n._parsed[t]||n.data[t].hidden?0:this.calculateCircumference(n._parsed[t]*s/I)}updateElements(t,e,i,n){const s="reset"===n,r=this.chart,o=r.chartArea,a=r.options.animation,l=(o.left+o.right)/2,c=(o.top+o.bottom)/2,h=s&&a.animateScale,d=h?0:this.innerRadius,u=h?0:this.outerRadius,f=this.resolveDataElementOptions(e,n),g=this.getSharedOptions(f),p=this.includeOptions(n,g);let m,b=this._getRotation();for(m=0;m0&&!isNaN(t)?I*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],s=ni(e._parsed[t],i.options.locale);return{label:n[t]||"",value:s}}getMaxBorderWidth(t){let e=0;const i=this.chart;let n,s,r,o,a;if(!t)for(n=0,s=i.data.datasets.length;n"spacing"!==t,_indexable:t=>"spacing"!==t},Ii.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map((e,n)=>{const s=t.getDatasetMeta(0).controller.getStyle(n);return{text:e,fillStyle:s.backgroundColor,strokeStyle:s.borderColor,lineWidth:s.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label(t){let e=t.label;const i=": "+t.formattedValue;return m(e)?(e=e.slice(),e[0]+=i):e+=i,e}}}}};class Ni extends Di{initialize(){this.enableOptionSharing=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:n=[],_dataset:s}=e,r=this.chart._animationsDisabled;let{start:o,count:a}=function(t,e,i){const n=e.length;let s=0,r=n;if(t._sorted){const{iScale:o,_parsed:a}=t,l=o.axis,{min:c,max:h,minDefined:d,maxDefined:u}=o.getUserBounds();d&&(s=rt(Math.min(xe(a,o.axis,c).lo,i?n:xe(e,l,o.getPixelForValue(c)).lo),0,n-1)),r=u?rt(Math.max(xe(a,o.axis,h).hi+1,i?0:xe(e,l,o.getPixelForValue(h)).hi+1),s,n)-s:n-s}return{start:s,count:r}}(e,n,r);this._drawStart=o,this._drawCount=a,function(t){const{xScale:e,yScale:i,_scaleRanges:n}=t,s={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!n)return t._scaleRanges=s,!0;const r=n.xmin!==e.min||n.xmax!==e.max||n.ymin!==i.min||n.ymax!==i.max;return Object.assign(n,s),r}(e)&&(o=0,a=n.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!s._decimated,i.points=n;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!r,options:l},t),this.updateElements(n,o,a,t)}updateElements(t,e,i,n){const s="reset"===n,{iScale:r,vScale:o,_stacked:a,_dataset:l}=this._cachedMeta,c=this.resolveDataElementOptions(e,n),h=this.getSharedOptions(c),d=this.includeOptions(n,h),u=r.axis,f=o.axis,{spanGaps:g,segment:m}=this.options,b=q(g)?g:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||s||"none"===n;let y=e>0&&this.getParsed(e-1);for(let c=e;c0&&i[u]-y[u]>b,m&&(g.parsed=i,g.raw=l.data[c]),d&&(g.options=h||this.resolveDataElementOptions(c,e.active?"active":n)),x||this.updateElement(e,c,g,n),y=i}this.updateSharedOptions(h,n,c)}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return i;const s=n[0].size(this.resolveDataElementOptions(0)),r=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,s,r)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}Ni.id="line",Ni.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},Ni.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class Vi extends Di{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],s=ni(e._parsed[t].r,i.options.locale);return{label:n[t]||"",value:s}}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),s=Math.max(n/2,0),r=(s-Math.max(i.cutoutPercentage?s/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=s-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(t,e,i,n){const s="reset"===n,r=this.chart,o=this.getDataset(),a=r.options.animation,l=this._cachedMeta.rScale,c=l.xCenter,h=l.yCenter,d=l.getIndexAngle(0)-.5*z;let u,f=d;const g=360/this.countVisibleElements();for(u=0;u{!isNaN(t.data[n])&&this.chart.getDataVisibility(n)&&i++}),i}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?K(this.resolveDataElementOptions(t,e).angle||i):0}}Vi.id="polarArea",Vi.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},Vi.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map((e,n)=>{const s=t.getDatasetMeta(0).controller.getStyle(n);return{text:e,fillStyle:s.backgroundColor,strokeStyle:s.borderColor,lineWidth:s.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label:t=>t.chart.data.labels[t.dataIndex]+": "+t.formattedValue}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class Wi extends Ii{}Wi.id="pie",Wi.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Bi extends Di{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}update(t){const e=this._cachedMeta,i=e.dataset,n=e.data||[],s=e.iScale.getLabels();if(i.points=n,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const r={_loop:!0,_fullLoop:s.length===n.length,options:e};this.updateElement(i,void 0,r,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,i,n){const s=this.getDataset(),r=this._cachedMeta.rScale,o="reset"===n;for(let a=e;a"",label:t=>"("+t.label+", "+t.formattedValue+")"}}},scales:{x:{type:"linear"},y:{type:"linear"}}};class Yi{constructor(t){this.options=t||{}}formats(){return Ui()}parse(t,e){return Ui()}format(t,e){return Ui()}add(t,e,i){return Ui()}diff(t,e,i){return Ui()}startOf(t,e,i){return Ui()}endOf(t,e){return Ui()}}Yi.override=function(t){Object.assign(Yi.prototype,t)};var $i={_date:Yi};function Xi(t,e){return"native"in t?{x:t.x,y:t.y}:qe(t,e)}function qi(t,e,i,n){const{controller:s,data:r,_sorted:o}=t,a=s._cachedMeta.iScale;if(a&&e===a.axis&&"r"!==e&&o&&r.length){const t=a._reversePixels?ye:xe;if(!n)return t(r,e,i);if(s._sharedOptions){const n=r[0],s="function"==typeof n.getRange&&n.getRange(e);if(s){const n=t(r,e,i-s),o=t(r,e,i+s);return{lo:n.lo,hi:o.hi}}}}return{lo:0,hi:r.length-1}}function Gi(t,e,i,n,s){const r=t.getSortedVisibleDatasetMetas(),o=i[e];for(let t=0,i=r.length;t{t[a](s[o],n)&&r.push({element:t,datasetIndex:e,index:i}),t.inRange(s.x,s.y,n)&&(l=!0)}),i.intersect&&!l?[]:r}var Ji={modes:{index(t,e,i,n){const s=Xi(e,t),r=i.axis||"x",o=i.intersect?Qi(t,s,r,n):Ki(t,s,r,!1,n),a=[];return o.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{const e=o[0].index,i=t.data[e];i&&!i.skip&&a.push({element:i,datasetIndex:t.index,index:e})}),a):[]},dataset(t,e,i,n){const s=Xi(e,t),r=i.axis||"xy";let o=i.intersect?Qi(t,s,r,n):Ki(t,s,r,!1,n);if(o.length>0){const e=o[0].datasetIndex,i=t.getDatasetMeta(e).data;o=[];for(let t=0;tQi(t,Xi(e,t),i.axis||"xy",n),nearest:(t,e,i,n)=>Ki(t,Xi(e,t),i.axis||"xy",i.intersect,n),x:(t,e,i,n)=>Zi(t,e,{axis:"x",intersect:i.intersect},n),y:(t,e,i,n)=>Zi(t,e,{axis:"y",intersect:i.intersect},n)}};const tn=["left","top","right","bottom"];function en(t,e){return t.filter(t=>t.pos===e)}function nn(t,e){return t.filter(t=>-1===tn.indexOf(t.pos)&&t.box.axis===e)}function sn(t,e){return t.sort((t,i)=>{const n=e?i:t,s=e?t:i;return n.weight===s.weight?n.index-s.index:n.weight-s.weight})}function rn(t,e,i,n){return Math.max(t[i],e[i])+Math.max(t[n],e[n])}function on(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function an(t,e,i,n){const{pos:s,box:r}=i,o=t.maxPadding;if(!b(s)){i.size&&(t[s]-=i.size);const e=n[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?r.height:r.width),i.size=e.size/e.count,t[s]+=i.size}r.getPadding&&on(o,r.getPadding());const a=Math.max(0,e.outerWidth-rn(o,t,"left","right")),l=Math.max(0,e.outerHeight-rn(o,t,"top","bottom")),c=a!==t.w,h=l!==t.h;return t.w=a,t.h=l,i.horizontal?{same:c,other:h}:{same:h,other:c}}function ln(t,e){const i=e.maxPadding;return function(t){const n={left:0,top:0,right:0,bottom:0};return t.forEach(t=>{n[t]=Math.max(e[t],i[t])}),n}(t?["left","right"]:["top","bottom"])}function cn(t,e,i,n){const s=[];let r,o,a,l,c,h;for(r=0,o=t.length,c=0;rt.box.fullSize),!0),n=sn(en(e,"left"),!0),s=sn(en(e,"right")),r=sn(en(e,"top"),!0),o=sn(en(e,"bottom")),a=nn(e,"x"),l=nn(e,"y");return{fullSize:i,leftAndTop:n.concat(r),rightAndBottom:s.concat(l).concat(o).concat(a),chartArea:en(e,"chartArea"),vertical:n.concat(s).concat(l),horizontal:r.concat(o).concat(a)}}(t.boxes),l=a.vertical,c=a.horizontal;M(t.boxes,t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()});const h=l.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1,d=Object.freeze({outerWidth:e,outerHeight:i,padding:s,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/h,hBoxMaxHeight:o/2}),u=Object.assign({},s);on(u,fe(n));const f=Object.assign({maxPadding:u,w:r,h:o,x:s.left,y:s.top},s),g=function(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:n,stackWeight:s}=i;if(!t||!tn.includes(n))continue;const r=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=s}return e}(t),{vBoxMaxWidth:n,hBoxMaxHeight:s}=e;let r,o,a;for(r=0,o=t.length;r{const i=e.box;Object.assign(i,t.chartArea),i.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class fn{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}isAttached(t){return!0}updateConfig(t){}}class gn extends fn{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const pn={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},mn=t=>null===t||""===t,bn=!!Ke&&{passive:!0};function xn(t,e,i){t.canvas.removeEventListener(e,i,bn)}function yn(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function vn(t,e,i){const n=t.canvas,s=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||yn(i.addedNodes,n),e=e&&!yn(i.removedNodes,n);e&&i()});return s.observe(document,{childList:!0,subtree:!0}),s}function wn(t,e,i){const n=t.canvas,s=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||yn(i.removedNodes,n),e=e&&!yn(i.addedNodes,n);e&&i()});return s.observe(document,{childList:!0,subtree:!0}),s}const Mn=new Map;let On=0;function kn(){const t=window.devicePixelRatio;t!==On&&(On=t,Mn.forEach((e,i)=>{i.currentDevicePixelRatio!==t&&e()}))}function Sn(t,e,i){const n=t.canvas,s=n&&He(n);if(!s)return;const r=d((t,e)=>{const n=s.clientWidth;i(t,e),n{const e=t[0],i=e.contentRect.width,n=e.contentRect.height;0===i&&0===n||r(i,n)});return o.observe(s),function(t,e){Mn.size||window.addEventListener("resize",kn),Mn.set(t,e)}(t,r),o}function Dn(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){Mn.delete(t),Mn.size||window.removeEventListener("resize",kn)}(t)}function Pn(t,e,i){const n=t.canvas,s=d(e=>{null!==t.ctx&&i(function(t,e){const i=pn[t.type]||t.type,{x:n,y:s}=qe(t,e);return{type:i,chart:e,native:t,x:void 0!==n?n:null,y:void 0!==s?s:null}}(e,t))},t,t=>{const e=t[0];return[e,e.offsetX,e.offsetY]});return function(t,e,i){t.addEventListener(e,i,bn)}(n,e,s),s}class Cn extends fn{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,n=t.getAttribute("height"),s=t.getAttribute("width");if(t.$chartjs={initial:{height:n,width:s,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",mn(s)){const e=Ze(t,"width");void 0!==e&&(t.width=e)}if(mn(n))if(""===t.style.height)t.height=t.width/(e||2);else{const e=Ze(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e.$chartjs)return!1;const i=e.$chartjs.initial;["height","width"].forEach(t=>{const n=i[t];p(n)?e.removeAttribute(t):e.setAttribute(t,n)});const n=i.style||{};return Object.keys(n).forEach(t=>{e.style[t]=n[t]}),e.width=e.width,delete e.$chartjs,!0}addEventListener(t,e,i){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),s={attach:vn,detach:wn,resize:Sn}[e]||Pn;n[e]=s(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),n=i[e];n&&(({attach:Dn,detach:Dn,resize:Dn}[e]||xn)(t,e,n),i[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return function(t,e,i,n){const s=Ye(t),r=Xe(s,"margin"),o=Ue(s.maxWidth,t,"clientWidth")||V,a=Ue(s.maxHeight,t,"clientHeight")||V,l=function(t,e,i){let n,s;if(void 0===e||void 0===i){const r=He(t);if(r){const t=r.getBoundingClientRect(),o=Ye(r),a=Xe(o,"border","width"),l=Xe(o,"padding");e=t.width-l.width-a.width,i=t.height-l.height-a.height,n=Ue(o.maxWidth,r,"clientWidth"),s=Ue(o.maxHeight,r,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:n||V,maxHeight:s||V}}(t,e,i);let{width:c,height:h}=l;if("content-box"===s.boxSizing){const t=Xe(s,"border","width"),e=Xe(s,"padding");c-=e.width+t.width,h-=e.height+t.height}return c=Math.max(0,c-r.width),h=Math.max(0,n?Math.floor(c/n):h-r.height),c=Ge(Math.min(c,o,l.maxWidth)),h=Ge(Math.min(h,a,l.maxHeight)),c&&!h&&(h=Ge(c/2)),{width:c,height:h}}(t,e,i,n)}isAttached(t){const e=He(t);return!(!e||!e.isConnected)}}class Tn{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return q(this.x)&&q(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const n={};return t.forEach(t=>{n[t]=i[t]&&i[t].active()?i[t]._to:this[t]}),n}}Tn.defaults={},Tn.defaultRoutes=void 0;const En={values:t=>m(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";const n=this.chart.options.locale;let s,r=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(s="scientific"),r=function(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t)),i}(t,i)}const o=Y(Math.abs(r)),a=Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),ni(t,n,l)},logarithmic(t,e,i){if(0===t)return"0";const n=t/Math.pow(10,Math.floor(Y(t)));return 1===n||2===n||5===n?En.numeric.call(this,t,e,i):""}};var jn={formatters:En};function An(t,e,i,n,s){const r=v(n,0),o=Math.min(v(s,t.length),t.length);let a,l,c,h=0;for(i=Math.ceil(i),s&&(a=s-n,i=a/Math.floor(a/i)),c=r;c<0;)h++,c=Math.round(r+h*i);for(l=Math.max(r,0);le.lineWidth,tickColor:(t,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:jn.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),Xt.route("scale.ticks","color","","color"),Xt.route("scale.grid","color","","borderColor"),Xt.route("scale.grid","borderColor","","borderColor"),Xt.route("scale.title","color","","color"),Xt.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t}),Xt.describe("scales",{_fallback:"scale"}),Xt.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t});const Ln=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i;function Rn(t,e){const i=[],n=t.length/e,s=t.length;let r=0;for(;ro+1e-6)))return l}function zn(t){return t.drawTicks?t.tickLength:0}function In(t,e){if(!t.display)return 0;const i=ge(t.font,e),n=fe(t.padding);return(m(t.text)?t.text.length:1)*i.lineHeight+n.height}function Nn(t,e,i){let n=(t=>"start"===t?"left":"end"===t?"right":"center")(t);return(i&&"right"!==e||!i&&"right"===e)&&(n=(t=>"left"===t?"right":"right"===t?"left":t)(n)),n}class Vn extends Tn{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:n}=this;return t=y(t,Number.POSITIVE_INFINITY),e=y(e,Number.NEGATIVE_INFINITY),i=y(i,Number.POSITIVE_INFINITY),n=y(n,Number.NEGATIVE_INFINITY),{min:y(t,i),max:y(e,n),minDefined:x(t),maxDefined:x(e)}}getMinMax(t){let e,{min:i,max:n,minDefined:s,maxDefined:r}=this.getUserBounds();if(s&&r)return{min:i,max:n};const o=this.getMatchingVisibleMetas();for(let a=0,l=o.length;an?n:i,n=s&&i>n?i:n,{min:y(i,y(n,i)),max:y(n,y(i,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){w(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:n,grace:s,ticks:r}=this.options,o=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(t,e,i){const{min:n,max:s}=t,r=_(e,(s-n)/2),o=(t,e)=>i&&0===t?0:t+e;return{min:o(n,-Math.abs(r)),max:o(s,r)}}(this,s,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=on)return function(t,e,i,n){let s,r=0,o=i[0];for(n=Math.ceil(n),s=0;st-e).pop(),e}(n);for(let t=0,e=r.length-1;ts)return e}return Math.max(s,1)}(s,e,n);if(r>0){let t,i;const n=r>1?Math.round((a-o)/(r-1)):null;for(An(e,l,c,p(n)?0:o-n,o),t=0,i=r-1;t=s||i<=1||!this.isHorizontal())return void(this.labelRotation=n);const c=this._getLabelSizes(),h=c.widest.width,d=c.highest.height,u=rt(this.chart.width-h,0,this.maxWidth);r=t.offset?this.maxWidth/i:u/(i-1),h+6>r&&(r=u/(i-(t.offset?.5:1)),o=this.maxHeight-zn(t.grid)-e.padding-In(t.title,this.chart.options.font),a=Math.sqrt(h*h+d*d),l=Z(Math.min(Math.asin(rt((c.highest.height+6)/r,-1,1)),Math.asin(rt(o/a,-1,1))-Math.asin(rt(d/a,-1,1)))),l=Math.max(n,Math.min(s,l))),this.labelRotation=l}afterCalculateLabelRotation(){w(this.options.afterCalculateLabelRotation,[this])}beforeFit(){w(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:n,grid:s}}=this,r=this._isVisible(),o=this.isHorizontal();if(r){const r=In(n,e.options.font);if(o?(t.width=this.maxWidth,t.height=zn(s)+r):(t.height=this.maxHeight,t.width=zn(s)+r),i.display&&this.ticks.length){const{first:e,last:n,widest:s,highest:r}=this._getLabelSizes(),a=2*i.padding,l=K(this.labelRotation),c=Math.cos(l),h=Math.sin(l);if(o){const e=i.mirror?0:h*s.width+c*r.height;t.height=Math.min(this.maxHeight,t.height+e+a)}else{const e=i.mirror?0:c*s.width+h*r.height;t.width=Math.min(this.maxWidth,t.width+e+a)}this._calculatePadding(e,n,h,c)}}this._handleMargins(),o?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,n){const{ticks:{align:s,padding:r},position:o}=this.options,a=0!==this.labelRotation,l="top"!==o&&"x"===this.axis;if(this.isHorizontal()){const o=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,d=0;a?l?(h=n*t.width,d=i*e.height):(h=i*t.height,d=n*e.width):"start"===s?d=e.width:"end"===s?h=t.width:(h=t.width/2,d=e.width/2),this.paddingLeft=Math.max((h-o+r)*this.width/(this.width-o),0),this.paddingRight=Math.max((d-c+r)*this.width/(this.width-c),0)}else{let i=e.height/2,n=t.height/2;"start"===s?(i=0,n=t.height):"end"===s&&(i=e.height,n=0),this.paddingTop=i+r,this.paddingBottom=n+r}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){w(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e{const i=t.gc,n=i.length/2;let s;if(n>e){for(s=0;s({width:s[t]||0,height:r[t]||0});return{first:O(0),last:O(e-1),widest:O(_),highest:O(w),widths:s,heights:r}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return rt(this._alignToPixels?Qt(this.chart,e,0):e,-32768,32767)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&to*n?o/i:a/n:a*n0}_computeGridLineItems(t){const e=this.axis,i=this.chart,n=this.options,{grid:s,position:r}=n,o=s.offset,a=this.isHorizontal(),l=this.ticks.length+(o?1:0),c=zn(s),h=[],d=s.setContext(this.getContext()),u=d.drawBorder?d.borderWidth:0,f=u/2,g=function(t){return Qt(i,t,u)};let p,m,x,y,_,w,M,O,k,S,D,P;if("top"===r)p=g(this.bottom),w=this.bottom-c,O=p-f,S=g(t.top)+f,P=t.bottom;else if("bottom"===r)p=g(this.top),S=t.top,P=g(t.bottom)-f,w=p+f,O=this.top+c;else if("left"===r)p=g(this.right),_=this.right-c,M=p-f,k=g(t.left)+f,D=t.right;else if("right"===r)p=g(this.left),k=t.left,D=g(t.right)-f,_=p+f,M=this.left+c;else if("x"===e){if("center"===r)p=g((t.top+t.bottom)/2+.5);else if(b(r)){const t=Object.keys(r)[0],e=r[t];p=g(this.chart.scales[t].getPixelForValue(e))}S=t.top,P=t.bottom,w=p+f,O=w+c}else if("y"===e){if("center"===r)p=g((t.left+t.right)/2);else if(b(r)){const t=Object.keys(r)[0],e=r[t];p=g(this.chart.scales[t].getPixelForValue(e))}_=p-f,M=_-c,k=t.left,D=t.right}const C=v(n.ticks.maxTicksLimit,l),T=Math.max(1,Math.ceil(l/C));for(m=0;me.value===t);return i>=0?e.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,r;const o=(t,e,n)=>{n.width&&n.color&&(i.save(),i.lineWidth=n.width,i.strokeStyle=n.color,i.setLineDash(n.borderDash||[]),i.lineDashOffset=n.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(s=0,r=n.length;s{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:i+1,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",n=[];let s,r;for(s=0,r=e.length;s{const n=i.split("."),s=n.pop(),r=[t].concat(n).join("."),o=e[i].split("."),a=o.pop(),l=o.join(".");Xt.route(r,s,l,a)})}(e,t.defaultRoutes),t.descriptors&&Xt.describe(e,t.descriptors)}(t,r,i),this.override&&Xt.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,n=this.scope;i in e&&delete e[i],n&&i in Xt[n]&&(delete Xt[n][i],this.override&&delete Ht[i])}}var Bn=new class{constructor(){this.controllers=new Wn(Di,"datasets",!0),this.elements=new Wn(Tn,"elements"),this.plugins=new Wn(Object,"plugins"),this.scales=new Wn(Vn,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(e=>{const n=i||this._getRegistryForType(e);i||n.isForType(e)||n===this.plugins&&e.id?this._exec(t,n,e):M(e,e=>{const n=i||this._getRegistryForType(e);this._exec(t,n,e)})})}_exec(t,e,i){const n=A(t);w(i["before"+n],[],i),e[t](i),w(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;et.filter(t=>!e.some(e=>t.plugin.id===e.plugin.id));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}}function Un(t,e){return e||!1!==t?!0===t?{}:t:null}function Yn(t,e,i,n){const s=t.pluginScopeKeys(e),r=t.getOptionScopes(i,s);return t.createResolver(r,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function $n(t,e){const i=Xt.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function Xn(t,e){return"x"===t||"y"===t?t:e.axis||("top"===(i=e.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0)||t.charAt(0).toLowerCase();var i}function qn(t){const e=t.options||(t.options={});e.plugins=v(e.plugins,{}),e.scales=function(t,e){const i=Ht[t.type]||{scales:{}},n=e.scales||{},s=$n(t.type,e),r=Object.create(null),o=Object.create(null);return Object.keys(n).forEach(t=>{const e=n[t];if(!b(e))return console.error("Invalid scale configuration for scale: "+t);if(e._proxy)return console.warn("Ignoring resolver passed as options for scale: "+t);const a=Xn(t,e),l=function(t,e){return t===e?"_index_":"_value_"}(a,s),c=i.scales||{};r[a]=r[a]||t,o[t]=C(Object.create(null),[{axis:a},e,c[a],c[l]])}),t.data.datasets.forEach(i=>{const s=i.type||t.type,a=i.indexAxis||$n(s,e),l=(Ht[s]||{}).scales||{};Object.keys(l).forEach(t=>{const e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,a),s=i[e+"AxisID"]||r[e]||e;o[s]=o[s]||Object.create(null),C(o[s],[{axis:e},n[s],l[t]])})}),Object.keys(o).forEach(t=>{const e=o[t];C(e,[Xt.scales[e.type],Xt.scale])}),o}(t,e)}function Gn(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const Qn=new Map,Kn=new Set;function Zn(t,e){let i=Qn.get(t);return i||(i=e(),Qn.set(t,i),Kn.add(i)),i}const Jn=(t,e,i)=>{const n=j(e,i);void 0!==n&&t.add(n)};class ts{constructor(t){this._config=function(t){return(t=t||{}).data=Gn(t.data),qn(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Gn(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),qn(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Zn(t,()=>[["datasets."+t,""]])}datasetAnimationScopeKeys(t,e){return Zn(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,"transitions."+e],["datasets."+t,""]])}datasetElementScopeKeys(t,e){return Zn(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,"datasets."+t,"elements."+e,""]])}pluginScopeKeys(t){const e=t.id;return Zn(`${this.type}-plugin-${e}`,()=>[["plugins."+e,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let n=i.get(t);return n&&!e||(n=new Map,i.set(t,n)),n}getOptionScopes(t,e,i){const{options:n,type:s}=this,r=this._cachedScopes(t,i),o=r.get(e);if(o)return o;const a=new Set;e.forEach(e=>{t&&(a.add(t),e.forEach(e=>Jn(a,t,e))),e.forEach(t=>Jn(a,n,t)),e.forEach(t=>Jn(a,Ht[s]||{},t)),e.forEach(t=>Jn(a,Xt,t)),e.forEach(t=>Jn(a,Ut,t))});const l=Array.from(a);return 0===l.length&&l.push(Object.create(null)),Kn.has(e)&&r.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,Ht[e]||{},Xt.datasets[e]||{},{type:e},Xt,Ut]}resolveNamedOptions(t,e,i,n=[""]){const s={$shared:!0},{resolver:r,subPrefixes:o}=es(this._resolverCache,t,n);let a=r;(function(t,e){const{isScriptable:i,isIndexable:n}=ke(t);for(const s of e){const e=i(s),r=n(s),o=(r||e)&&t[s];if(e&&(R(o)||is(o))||r&&m(o))return!0}return!1})(r,e)&&(s.$shared=!1,a=Oe(r,i=R(i)?i():i,this.createResolver(t,i,o)));for(const t of e)s[t]=a[t];return s}createResolver(t,e,i=[""],n){const{resolver:s}=es(this._resolverCache,t,i);return b(e)?Oe(s,e,void 0,n):s}}function es(t,e,i){let n=t.get(e);n||(n=new Map,t.set(e,n));const s=i.join();let r=n.get(s);return r||(r={resolver:Me(e,i),subPrefixes:i.filter(t=>!t.toLowerCase().includes("hover"))},n.set(s,r)),r}const is=t=>b(t)&&Object.getOwnPropertyNames(t).reduce((e,i)=>e||R(t[i]),!1),ns=["top","bottom","left","right","chartArea"];function ss(t,e){return"top"===t||"bottom"===t||-1===ns.indexOf(t)&&"x"===e}function rs(t,e){return function(i,n){return i[t]===n[t]?i[e]-n[e]:i[t]-n[t]}}function os(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),w(i&&i.onComplete,[t],e)}function as(t){const e=t.chart,i=e.options.animation;w(i&&i.onProgress,[t],e)}function ls(t){return Be()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const cs={},hs=t=>{const e=ls(t);return Object.values(cs).filter(t=>t.canvas===e).pop()};function ds(t,e,i){const n=Object.keys(t);for(const s of n){const n=+s;if(n>=e){const r=t[s];delete t[s],(i>0||n>e)&&(t[n+i]=r)}}}class us{constructor(t,e){const i=this.config=new ts(e),n=ls(t),s=hs(n);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas can be reused.");const r=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||function(t){return!Be()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?gn:Cn}(n)),this.platform.updateConfig(i);const o=this.platform.acquireContext(n,r.aspectRatio),a=o&&o.canvas,l=a&&a.height,c=a&&a.width;this.id=g(),this.ctx=o,this.canvas=a,this.width=c,this.height=l,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Hn,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let i;return function(...n){return e?(clearTimeout(i),i=setTimeout(t,e,n)):t.apply(this,n),e}}(t=>this.update(t),r.resizeDelay||0),this._dataChanges=[],cs[this.id]=this,o&&a?(di.listen(this,"complete",os),di.listen(this,"progress",as),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:s}=this;return p(t)?e&&s?s:n?i/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Qe(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Kt(this.canvas,this.ctx),this}stop(){return di.stop(this),this}resize(t,e){di.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,n=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(n,t,e,s),o=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,Qe(this,o,!0)&&(this.notifyPlugins("resize",{size:r}),w(i.onResize,[this,r],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){M(this.options.scales||{},(t,e)=>{t.id=e})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,n=Object.keys(i).reduce((t,e)=>(t[e]=!1,t),{});let s=[];e&&(s=s.concat(Object.keys(e).map(t=>{const i=e[t],n=Xn(t,i),s="r"===n,r="x"===n;return{options:i,dposition:s?"chartArea":r?"bottom":"left",dtype:s?"radialLinear":r?"category":"linear"}}))),M(s,e=>{const s=e.options,r=s.id,o=Xn(r,s),a=v(s.type,e.dtype);void 0!==s.position&&ss(s.position,o)===ss(e.dposition)||(s.position=e.dposition),n[r]=!0;let l=null;r in i&&i[r].type===a?l=i[r]:(l=new(Bn.getScale(a))({id:r,type:a,ctx:this.ctx,chart:this}),i[l.id]=l),l.init(s,t)}),M(n,(t,e)=>{t||delete i[e]}),M(i,t=>{un.configure(this,t,t.options),un.addBox(this,t)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((t,e)=>t.index-e.index),i>e){for(let t=e;te.length&&delete this._stacks,t.forEach((t,i)=>{0===e.filter(e=>e===t._dataset).length&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,n;for(this._removeUnreferencedMetasets(),i=0,n=e.length;i{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let t=0,e=this.data.datasets.length;t{t.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(rs("z","_idx"));const{_active:o,_lastEvent:a}=this;a?this._eventHandler(a,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){M(this.scales,t=>{un.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);F(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:n,count:s}of e)ds(t,n,"_removeElements"===i?-s:s)}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter(t=>t[0]===e).map((t,e)=>e+","+t.splice(1).join(","))),n=i(0);for(let t=1;tt.split(",")).map(t=>({method:t[1],start:+t[2],count:+t[3]}))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;un.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],M(this.boxes,t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))},this),this._layers.forEach((t,e)=>{t._idx=e}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,n=!i.disabled,s=this.chartArea,r={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",r)&&(n&&te(e,{left:!1===i.left?0:s.left-i.left,right:!1===i.right?this.width:s.right+i.right,top:!1===i.top?0:s.top-i.top,bottom:!1===i.bottom?this.height:s.bottom+i.bottom}),t.controller.draw(),n&&ee(e),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}getElementsAtEventForMode(t,e,i,n){const s=Ji.modes[e];return"function"==typeof s?s(this,t,i,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let n=i.filter(t=>t&&t._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(n)),n}getContext(){return this.$context||(this.$context=me(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const n=i?"show":"hide",s=this.getDatasetMeta(t),r=s.controller._resolveAnimations(void 0,n);L(e)?(s.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),r.update(s,{visible:i}),this.update(e=>e.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),di.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,i,n),t[i]=n},n=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};M(this.options.events,t=>i(t,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,n)=>{e.addEventListener(this,i,n),t[i]=n},n=(i,n)=>{t[i]&&(e.removeEventListener(this,i,n),delete t[i])},s=(t,e)=>{this.canvas&&this.resize(t,e)};let r;const o=()=>{n("attach",o),this.attached=!0,this.resize(),i("resize",s),i("detach",r)};r=()=>{this.attached=!1,n("resize",s),this._stop(),this._resize(0,0),i("attach",o)},e.isAttached(this.canvas)?o():r()}unbindEvents(){M(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},M(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const n=i?"set":"remove";let s,r,o,a;for("dataset"===e&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+n+"DatasetHoverStyle"]()),o=0,a=t.length;o{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}});!O(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}_updateHoverStyles(t,e,i){const n=this.options.hover,s=(t,e)=>t.filter(t=>!e.some(e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)),r=s(e,t),o=i?t:s(t,e);r.length&&this.updateHoverStyle(r,n.mode,!1),o.length&&n.mode&&this.updateHoverStyle(o,n.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:Jt(t,this.chartArea,this._minPadding)},n=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,n))return;const s=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(s||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:n=[],options:s}=this,r=e,o=this._getActiveElements(t,n,i,r),a=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}(t),l=function(t,e,i,n){return i&&"mouseout"!==t.type?n?e:t:null}(t,this._lastEvent,i,a);i&&(this._lastEvent=null,w(s.onHover,[t,o,this],this),a&&w(s.onClick,[t,o,this],this));const c=!O(o,n);return(c||e)&&(this._active=o,this._updateHoverStyles(o,n,e)),this._lastEvent=l,c}_getActiveElements(t,e,i,n){if("mouseout"===t.type)return[];if(!i)return e;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,n)}}const fs=()=>M(us.instances,t=>t._plugins.invalidate());function gs(t,e,i){const{startAngle:n,pixelMargin:s,x:r,y:o,outerRadius:a,innerRadius:l}=e;let c=s/a;t.beginPath(),t.arc(r,o,a,n-c,i+c),l>s?(c=s/l,t.arc(r,o,l,i+c,n-c,!0)):t.arc(r,o,s,i+B,n-B),t.closePath(),t.clip()}function ps(t,e,i,n){return{x:i+t*Math.cos(e),y:n+t*Math.sin(e)}}function ms(t,e,i,n,s){const{x:r,y:o,startAngle:a,pixelMargin:l,innerRadius:c}=e,h=Math.max(e.outerRadius+n+i-l,0),d=c>0?c+n+i+l:0;let u=0;const f=s-a;if(n){const t=((c>0?c-n:0)+(h>0?h-n:0))/2;u=(f-(0!==t?f*t/(t+n):f))/2}const g=(f-Math.max(.001,f*h-i/z)/h)/2,p=a+g+u,m=s-g-u,{outerStart:b,outerEnd:x,innerStart:y,innerEnd:v}=function(t,e,i,n){const s=he(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]),r=(i-e)/2,o=Math.min(r,n*e/2),a=t=>{const e=(i-Math.min(r,t))*n/2;return rt(t,0,Math.min(r,e))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:rt(s.innerStart,0,o),innerEnd:rt(s.innerEnd,0,o)}}(e,d,h,m-p),_=h-b,w=h-x,M=p+b/_,O=m-x/w,k=d+y,S=d+v,D=p+y/k,P=m-v/S;if(t.beginPath(),t.arc(r,o,h,M,O),x>0){const e=ps(w,O,r,o);t.arc(e.x,e.y,x,O,m+B)}const C=ps(S,m,r,o);if(t.lineTo(C.x,C.y),v>0){const e=ps(S,P,r,o);t.arc(e.x,e.y,v,m+B,P+Math.PI)}if(t.arc(r,o,d,m-v/d,p+y/d,!0),y>0){const e=ps(k,D,r,o);t.arc(e.x,e.y,y,D+Math.PI,p-B)}const T=ps(_,p,r,o);if(t.lineTo(T.x,T.y),b>0){const e=ps(_,M,r,o);t.arc(e.x,e.y,b,p-B,M)}t.closePath()}Object.defineProperties(us,{defaults:{enumerable:!0,value:Xt},instances:{enumerable:!0,value:cs},overrides:{enumerable:!0,value:Ht},registry:{enumerable:!0,value:Bn},version:{enumerable:!0,value:"3.7.1"},getChart:{enumerable:!0,value:hs},register:{enumerable:!0,value:(...t)=>{Bn.add(...t),fs()}},unregister:{enumerable:!0,value:(...t)=>{Bn.remove(...t),fs()}}});class bs extends Tn{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.getProps(["x","y"],i),{angle:s,distance:r}=tt(n,{x:t,y:e}),{startAngle:o,endAngle:a,innerRadius:l,outerRadius:c,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),d=this.options.spacing/2,u=v(h,a-o)>=I||st(s,o,a),f=ot(r,l+d,c+d);return u&&f}getCenterPoint(t){const{x:e,y:i,startAngle:n,endAngle:s,innerRadius:r,outerRadius:o}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:a,spacing:l}=this.options,c=(n+s)/2,h=(r+o+l+a)/2;return{x:e+Math.cos(c)*h,y:i+Math.sin(c)*h}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,n=(e.offset||0)/2,s=(e.spacing||0)/2;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>I?Math.floor(i/I):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();let r=0;if(n){r=n/2;const e=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(e)*r,Math.sin(e)*r),this.circumference>=z&&(r=n)}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;const o=function(t,e,i,n){const{fullCircles:s,startAngle:r,circumference:o}=e;let a=e.endAngle;if(s){ms(t,e,i,n,r+I);for(let e=0;ea&&r>a;return{count:n,start:l,loop:e.loop,ilen:c(o+(c?a-t:t))%r,y=()=>{f!==g&&(t.lineTo(m,g),t.lineTo(m,f),t.lineTo(m,p))};for(l&&(d=s[x(0)],t.moveTo(d.x,d.y)),h=0;h<=a;++h){if(d=s[x(h)],d.skip)continue;const e=d.x,i=d.y,n=0|e;n===u?(ig&&(g=i),m=(b*m+e)/++b):(y(),t.lineTo(e,i),u=n,b=0,f=g=i),p=i}y()}function Ms(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i?_s:ws}bs.id="arc",bs.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0},bs.defaultRoutes={backgroundColor:"backgroundColor"};const Os="function"==typeof Path2D;class ks extends Tn{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const n=i.spanGaps?this._loop:this._fullLoop;We(this._points,i,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(t,e){const i=t.points,n=t.options.spanGaps,s=i.length;if(!s)return[];const r=!!t._loop,{start:o,end:a}=function(t,e,i,n){let s=0,r=e-1;if(i&&!n)for(;ss&&t[r%e].skip;)r--;return r%=e,{start:s,end:r}}(i,s,r,n);return function(t,e,i,n){return n&&n.setContext&&i?function(t,e,i,n){const s=t._chart.getContext(),r=ci(t.options),{_datasetIndex:o,options:{spanGaps:a}}=t,l=i.length,c=[];let h=r,d=e[0].start,u=d;function f(t,e,n,s){const r=a?-1:1;if(t!==e){for(t+=l;i[t%l].skip;)t-=r;for(;i[e%l].skip;)e+=r;t%l!=e%l&&(c.push({start:t%l,end:e%l,loop:n,style:s}),h=s,d=e%l)}}for(const t of e){d=a?d:t.start;let e,r=i[d%l];for(u=d+1;u<=t.end;u++){const a=i[u%l];e=ci(n.setContext(me(s,{type:"segment",p0:r,p1:a,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:o}))),hi(e,h)&&f(d,u-1,t.loop,h),r=a,h=e}d"borderDash"!==t&&"fill"!==t};class Ds extends Tn{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.options,{x:s,y:r}=this.getProps(["x","y"],i);return Math.pow(t-s,2)+Math.pow(e-r,2)=i)&&s):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}As.id="bar",As.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0},As.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};class Rs{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:n,y:s,radius:r}=this;return e=e||{start:0,end:I},t.arc(n,s,r,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:n}=this,s=t.angle;return{x:e+Math.cos(s)*n,y:i+Math.sin(s)*n,angle:s}}}function Fs(t,e,i){for(;e>t;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function zs(t,e,i){const n=[];for(let s=0;s{e=Fs(t,e,s);const o=s[t],a=s[e];null!==n?(r.push({x:o.x,y:n}),r.push({x:a.x,y:n})):null!==i&&(r.push({x:i,y:o.y}),r.push({x:i,y:a.y}))}),r}(t,e),i.length?new ks({points:i,options:{tension:0},_loop:n,_fullLoop:n}):null}function Ws(t,e,i){let n=t[e].fill;const s=[e];let r;if(!i)return n;for(;!1!==n&&-1===s.indexOf(n);){if(!x(n))return n;if(r=t[n],!r)return!1;if(r.visible)return n;s.push(n),n=r.fill}return!1}function Bs(t,e,i){const{segments:n,points:s}=e;let r=!0,o=!1;t.beginPath();for(const a of n){const{start:n,end:l}=a,c=s[n],h=s[Fs(n,l,s)];r?(t.moveTo(c.x,c.y),r=!1):(t.lineTo(c.x,i),t.lineTo(c.x,c.y)),o=!!e.pathSegment(t,a,{move:o}),o?t.closePath():t.lineTo(h.x,i)}t.lineTo(e.first().x,i),t.closePath(),t.clip()}function Hs(t,e,i,n){if(n)return;let s=e[t],r=i[t];return"angle"===t&&(s=nt(s),r=nt(r)),{property:t,start:s,end:r}}function Us(t,e,i,n){return t&&e?n(t[i],e[i]):t?t[i]:e?e[i]:0}function Ys(t,e,i){const{top:n,bottom:s}=e.chart.chartArea,{property:r,start:o,end:a}=i||{};"x"===r&&(t.beginPath(),t.rect(o,n,a-o,s-n),t.clip())}function $s(t,e,i,n){const s=e.interpolate(i,n);s&&t.lineTo(s.x,s.y)}function Xs(t,e){const{line:i,target:n,property:s,color:r,scale:o}=e,a=function(t,e,i){const n=t.segments,s=t.points,r=e.points,o=[];for(const t of n){let{start:n,end:a}=t;a=Fs(n,a,s);const l=Hs(i,s[n],s[a],t.loop);if(!e.segments){o.push({source:t,target:l,start:s[n],end:s[a]});continue}const c=li(e,l);for(const e of c){const n=Hs(i,r[e.start],r[e.end],e.loop),a=ai(t,s,n);for(const t of a)o.push({source:t,target:e,start:{[i]:Us(l,n,"start",Math.max)},end:{[i]:Us(l,n,"end",Math.min)}})}}return o}(i,n,s);for(const{source:e,target:l,start:c,end:h}of a){const{style:{backgroundColor:a=r}={}}=e,d=!0!==n;t.save(),t.fillStyle=a,Ys(t,o,d&&Hs(s,c,h)),t.beginPath();const u=!!i.pathSegment(t,e);let f;if(d){u?t.closePath():$s(t,n,h,s);const e=!!n.pathSegment(t,l,{move:u,reverse:!0});f=u&&e,f||$s(t,n,c,s)}t.closePath(),t.fill(f?"evenodd":"nonzero"),t.restore()}}function qs(t,e,i){const n=Ns(e),{line:s,scale:r,axis:o}=e,a=s.options,l=a.fill,c=a.backgroundColor,{above:h=c,below:d=c}=l||{};n&&s.points.length&&(te(t,i),function(t,e){const{line:i,target:n,above:s,below:r,area:o,scale:a}=e,l=i._loop?"angle":e.axis;t.save(),"x"===l&&r!==s&&(Bs(t,n,o.top),Xs(t,{line:i,target:n,color:s,scale:a,property:l}),t.restore(),t.save(),Bs(t,n,o.bottom)),Xs(t,{line:i,target:n,color:r,scale:a,property:l}),t.restore()}(t,{line:s,target:n,above:h,below:d,area:i,scale:r,axis:o}),ee(t))}var Gs={id:"filler",afterDatasetsUpdate(t,e,i){const n=(t.data.datasets||[]).length,s=[];let r,o,a,l;for(o=0;o=0;--e){const i=s[e].$filler;i&&(i.line.updateControlPoints(r,i.axis),n&&qs(t.ctx,i,r))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const n=t.getSortedVisibleDatasetMetas();for(let e=n.length-1;e>=0;--e){const i=n[e].$filler;i&&qs(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){const n=e.meta.$filler;n&&!1!==n.fill&&"beforeDatasetDraw"===i.drawTime&&qs(t.ctx,n,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};new WeakMap;const Qs={average(t){if(!t.length)return!1;let e,i,n=0,s=0,r=0;for(e=0,i=t.length;e-1?t.split("\n"):t}function Js(t,e){const{element:i,datasetIndex:n,index:s}=e,r=t.getDatasetMeta(n).controller,{label:o,value:a}=r.getLabelAndValue(s);return{chart:t,label:o,parsed:r.getParsed(s),raw:t.data.datasets[n].data[s],formattedValue:a,dataset:r.getDataset(),dataIndex:s,datasetIndex:n,element:i}}function tr(t,e){const i=t.chart.ctx,{body:n,footer:s,title:r}=t,{boxWidth:o,boxHeight:a}=e,l=ge(e.bodyFont),c=ge(e.titleFont),h=ge(e.footerFont),d=r.length,u=s.length,f=n.length,g=fe(e.padding);let p=g.height,m=0,b=n.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);b+=t.beforeBody.length+t.afterBody.length,d&&(p+=d*c.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),b&&(p+=f*(e.displayColors?Math.max(a,l.lineHeight):l.lineHeight)+(b-f)*l.lineHeight+(b-1)*e.bodySpacing),u&&(p+=e.footerMarginTop+u*h.lineHeight+(u-1)*e.footerSpacing);let x=0;const y=function(t){m=Math.max(m,i.measureText(t).width+x)};return i.save(),i.font=c.string,M(t.title,y),i.font=l.string,M(t.beforeBody.concat(t.afterBody),y),x=e.displayColors?o+2+e.boxPadding:0,M(n,t=>{M(t.before,y),M(t.lines,y),M(t.after,y)}),x=0,i.font=h.string,M(t.footer,y),i.restore(),m+=g.width,{width:m,height:p}}function er(t,e,i,n){const{x:s,width:r}=i,{width:o,chartArea:{left:a,right:l}}=t;let c="center";return"center"===n?c=s<=(a+l)/2?"left":"right":s<=r/2?c="left":s>=o-r/2&&(c="right"),function(t,e,i,n){const{x:s,width:r}=n,o=i.caretSize+i.caretPadding;return"left"===t&&s+r+o>e.width||"right"===t&&s-r-o<0||void 0}(c,t,e,i)&&(c="center"),c}function ir(t,e,i){const n=i.yAlign||e.yAlign||function(t,e){const{y:i,height:n}=e;return it.height-n/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||er(t,e,i,n),yAlign:n}}function nr(t,e,i,n){const{caretSize:s,caretPadding:r,cornerRadius:o}=t,{xAlign:a,yAlign:l}=i,c=s+r,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=ue(o);let g=function(t,e){let{x:i,width:n}=t;return"right"===e?i-=n:"center"===e&&(i-=n/2),i}(e,a);const p=function(t,e,i){let{y:n,height:s}=t;return"top"===e?n+=i:n-="bottom"===e?s+i:s/2,n}(e,l,c);return"center"===l?"left"===a?g+=c:"right"===a&&(g-=c):"left"===a?g-=Math.max(h,u)+s:"right"===a&&(g+=Math.max(d,f)+s),{x:rt(g,0,n.width-e.width),y:rt(p,0,n.height-e.height)}}function sr(t,e,i){const n=fe(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-n.right:t.x+n.left}function rr(t){return Ks([],Zs(t))}function or(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}class ar extends Tn{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart||t._chart,this._chart=this.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),n=i.enabled&&e.options.animation&&i.animations,s=new pi(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=(this,me(this.chart.getContext(),{tooltip:this,tooltipItems:this._tooltipItems,type:"tooltip"})))}getTitle(t,e){const{callbacks:i}=e,n=i.beforeTitle.apply(this,[t]),s=i.title.apply(this,[t]),r=i.afterTitle.apply(this,[t]);let o=[];return o=Ks(o,Zs(n)),o=Ks(o,Zs(s)),o=Ks(o,Zs(r)),o}getBeforeBody(t,e){return rr(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){const{callbacks:i}=e,n=[];return M(t,t=>{const e={before:[],lines:[],after:[]},s=or(i,t);Ks(e.before,Zs(s.beforeLabel.call(this,t))),Ks(e.lines,s.label.call(this,t)),Ks(e.after,Zs(s.afterLabel.call(this,t))),n.push(e)}),n}getAfterBody(t,e){return rr(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){const{callbacks:i}=e,n=i.beforeFooter.apply(this,[t]),s=i.footer.apply(this,[t]),r=i.afterFooter.apply(this,[t]);let o=[];return o=Ks(o,Zs(n)),o=Ks(o,Zs(s)),o=Ks(o,Zs(r)),o}_createItems(t){const e=this._active,i=this.chart.data,n=[],s=[],r=[];let o,a,l=[];for(o=0,a=e.length;ot.filter(e,n,s,i))),t.itemSort&&(l=l.sort((e,n)=>t.itemSort(e,n,i))),M(l,e=>{const i=or(t.callbacks,e);n.push(i.labelColor.call(this,e)),s.push(i.labelPointStyle.call(this,e)),r.push(i.labelTextColor.call(this,e))}),this.labelColors=n,this.labelPointStyles=s,this.labelTextColors=r,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),n=this._active;let s,r=[];if(n.length){const t=Qs[i.position].call(this,n,this._eventPosition);r=this._createItems(i),this.title=this.getTitle(r,i),this.beforeBody=this.getBeforeBody(r,i),this.body=this.getBody(r,i),this.afterBody=this.getAfterBody(r,i),this.footer=this.getFooter(r,i);const e=this._size=tr(this,i),o=Object.assign({},t,e),a=ir(this.chart,i,o),l=nr(i,o,a,this.chart);this.xAlign=a.xAlign,this.yAlign=a.yAlign,s={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(s={opacity:0});this._tooltipItems=r,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,n){const s=this.getCaretPosition(t,i,n);e.lineTo(s.x1,s.y1),e.lineTo(s.x2,s.y2),e.lineTo(s.x3,s.y3)}getCaretPosition(t,e,i){const{xAlign:n,yAlign:s}=this,{caretSize:r,cornerRadius:o}=i,{topLeft:a,topRight:l,bottomLeft:c,bottomRight:h}=ue(o),{x:d,y:u}=t,{width:f,height:g}=e;let p,m,b,x,y,v;return"center"===s?(y=u+g/2,"left"===n?(p=d,m=p-r,x=y+r,v=y-r):(p=d+f,m=p+r,x=y-r,v=y+r),b=p):(m="left"===n?d+Math.max(a,c)+r:"right"===n?d+f-Math.max(l,h)-r:this.caretX,"top"===s?(x=u,y=x-r,p=m-r,b=m+r):(x=u+g,y=x+r,p=m+r,b=m-r),v=x),{x1:p,x2:m,x3:b,y1:x,y2:y,y3:v}}drawTitle(t,e,i){const n=this.title,s=n.length;let r,o,a;if(s){const l=si(i.rtl,this.x,this.width);for(t.x=sr(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",r=ge(i.titleFont),o=i.titleSpacing,e.fillStyle=i.titleColor,e.font=r.string,a=0;a0!==t)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,oe(t,{x:e,y:g,w:l,h:a,radius:o}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),oe(t,{x:i,y:g+1,w:l-2,h:a-2,radius:o}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(e,g,l,a),t.strokeRect(e,g,l,a),t.fillStyle=r.backgroundColor,t.fillRect(i,g+1,l-2,a-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:n}=this,{bodySpacing:s,bodyAlign:r,displayColors:o,boxHeight:a,boxWidth:l,boxPadding:c}=i,h=ge(i.bodyFont);let d=h.lineHeight,u=0;const f=si(i.rtl,this.x,this.width),g=function(i){e.fillText(i,f.x(t.x+u),t.y+d/2),t.y+=d+s},p=f.textAlign(r);let m,b,x,y,v,_,w;for(e.textAlign=r,e.textBaseline="middle",e.font=h.string,t.x=sr(this,p,i),e.fillStyle=i.bodyColor,M(this.beforeBody,g),u=o&&"right"!==p?"center"===r?l/2+c:l+2+c:0,y=0,_=n.length;y<_;++y){for(m=n[y],b=this.labelTextColors[y],e.fillStyle=b,M(m.before,g),x=m.lines,o&&x.length&&(this._drawColorBox(e,t,y,f,i),d=Math.max(h.lineHeight,a)),v=0,w=x.length;v0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,n=i&&i.x,s=i&&i.y;if(n||s){const i=Qs[t.position].call(this,this._active,this._eventPosition);if(!i)return;const r=this._size=tr(this,t),o=Object.assign({},i,this._size),a=ir(e,t,o),l=nr(t,o,a,e);n._to===l.x&&s._to===l.y||(this.xAlign=a.xAlign,this.yAlign=a.yAlign,this.width=r.width,this.height=r.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const r=fe(e.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&o&&(t.save(),t.globalAlpha=i,this.drawBackground(s,t,n,e),function(t,e){let i,n;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,n=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=n)}(t,e.textDirection),s.y+=r.top,this.drawTitle(s,t,e),this.drawBody(s,t,e),this.drawFooter(s,t,e),function(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,n=t.map(({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),s=!O(i,n),r=this._positionChanged(n,e);(s||r)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,s=this._active||[],r=this._getActiveElements(t,s,e,i),o=this._positionChanged(r,t),a=e||!O(r,s)||o;return a&&(this._active=r,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),a}_getActiveElements(t,e,i,n){const s=this.options;if("mouseout"===t.type)return[];if(!n)return e;const r=this.chart.getElementsAtEventForMode(t,s.mode,s,i);return s.reverse&&r.reverse(),r}_positionChanged(t,e){const{caretX:i,caretY:n,options:s}=this,r=Qs[s.position].call(this,t,e);return!1!==r&&(i!==r.x||n!==r.y)}}ar.positioners=Qs;var lr={id:"tooltip",_element:ar,positioners:Qs,afterInit(t,e,i){i&&(t.tooltip=new ar({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip,i={tooltip:e};!1!==t.notifyPlugins("beforeTooltipDraw",i)&&(e&&e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i))},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:f,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,n=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(n>0&&e.dataIndex"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};class cr extends Vn{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:i,label:n}of e)t[i]===n&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(p(t))return null;const i=this.getLabels();return((t,e)=>null===t?null:rt(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:function(t,e,i,n){const s=t.indexOf(e);return-1===s?((t,e,i,n)=>("string"==typeof e?(i=t.push(e)-1,n.unshift({index:i,label:e})):isNaN(e)&&(i=null),i))(t,e,i,n):s!==t.lastIndexOf(e)?i:s}(i,t,v(e,t),this._addedLabels),i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:n}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(n=this.getLabels().length-1)),this.min=i,this.max=n}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,n=[];let s=this.getLabels();s=0===t&&e===s.length-1?s:s.slice(t,e+1),this._valueRange=Math.max(s.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let i=t;i<=e;i++)n.push({value:i});return n}getLabelForValue(t){const e=this.getLabels();return t>=0&&te.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function hr(t,e,{horizontal:i,minRotation:n}){const s=K(n),r=(i?Math.sin(s):Math.cos(s))||.001,o=.75*e*(""+t).length;return Math.min(e/r,o)}cr.id="category",cr.defaults={ticks:{callback:cr.prototype.getLabelForValue}};class dr extends Vn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return p(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:n,max:s}=this;const r=t=>n=e?n:t,o=t=>s=i?s:t;if(t){const t=$(n),e=$(s);t<0&&e<0?o(0):t>0&&e>0&&r(0)}if(n===s){let e=1;(s>=Number.MAX_SAFE_INTEGER||n<=Number.MIN_SAFE_INTEGER)&&(e=Math.abs(.05*s)),o(s+e),t||r(n-e)}this.min=n,this.max=s}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:n}=t;return n?(e=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const n=function(t,e){const i=[],{bounds:n,step:s,min:r,max:o,precision:a,count:l,maxTicks:c,maxDigits:h,includeBounds:d}=t,u=s||1,f=c-1,{min:g,max:m}=e,b=!p(r),x=!p(o),y=!p(l),v=(m-g)/(h+1);let _,w,M,O,k=X((m-g)/f/u)*u;if(k<1e-14&&!b&&!x)return[{value:g},{value:m}];O=Math.ceil(m/k)-Math.floor(g/k),O>f&&(k=X(O*k/f/u)*u),p(a)||(_=Math.pow(10,a),k=Math.ceil(k*_)/_),"ticks"===n?(w=Math.floor(g/k)*k,M=Math.ceil(m/k)*k):(w=g,M=m),b&&x&&s&&function(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}((o-r)/s,k/1e3)?(O=Math.round(Math.min((o-r)/k,c)),k=(o-r)/O,w=r,M=o):y?(w=b?r:w,M=x?o:M,O=l-1,k=(M-w)/O):(O=(M-w)/k,O=G(O,Math.round(O),k/1e3)?Math.round(O):Math.ceil(O));const S=Math.max(J(k),J(w));_=Math.pow(10,p(a)?S:a),w=Math.round(w*_)/_,M=Math.round(M*_)/_;let D=0;for(b&&(d&&w!==r?(i.push({value:r}),w0?i:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=x(t)?Math.max(0,t):null,this.max=x(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,n=this.max;const s=e=>i=t?i:e,r=t=>n=e?n:t,o=(t,e)=>Math.pow(10,Math.floor(Y(t))+e);i===n&&(i<=0?(s(1),r(10)):(s(o(i,-1)),r(o(n,1)))),i<=0&&s(o(n,-1)),n<=0&&r(o(i,1)),this._zero&&this.min!==this._suggestedMin&&i===o(this.min,0)&&s(o(i,-1)),this.min=i,this.max=n}buildTicks(){const t=this.options,e=function(t,e){const i=Math.floor(Y(e.max)),n=Math.ceil(e.max/Math.pow(10,i)),s=[];let r=y(t.min,Math.pow(10,Math.floor(Y(e.min)))),o=Math.floor(Y(r)),a=Math.floor(r/Math.pow(10,o)),l=o<0?Math.pow(10,Math.abs(o)):1;do{s.push({value:r,major:fr(r)}),++a,10===a&&(a=1,++o,l=o>=0?1:l),r=Math.round(a*Math.pow(10,o)*l)/l}while(os?{start:e-i,end:e}:{start:e,end:e+i}}function br(t,e,i,n,s){const r=Math.abs(Math.sin(i)),o=Math.abs(Math.cos(i));let a=0,l=0;n.starte.r&&(a=(n.end-e.r)/r,t.r=Math.max(t.r,e.r+a)),s.starte.b&&(l=(s.end-e.b)/o,t.b=Math.max(t.b,e.b+l))}function xr(t){return 0===t||180===t?"center":t<180?"left":"right"}function yr(t,e,i){return 90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e),t}function vr(t,e,i,n){const{ctx:s}=t;if(i)s.arc(t.xCenter,t.yCenter,e,0,I);else{let i=t.getPointPosition(0,e);s.moveTo(i.x,i.y);for(let r=1;r{const i=w(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""}).filter((t,e)=>this.chart.getDataVisibility(e))}fit(){const t=this.options;t.display&&t.pointLabels.display?function(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),n=[],s=[],r=t._pointLabels.length,o=t.options.pointLabels,a=o.centerPointLabels?z/r:0;for(let d=0;d=0&&t=0;s--){const e=n.setContext(t.getPointLabelContext(s)),r=ge(e.font),{x:o,y:a,textAlign:l,left:c,top:h,right:d,bottom:u}=t._pointLabelItems[s],{backdropColor:f}=e;if(!p(f)){const t=fe(e.backdropPadding);i.fillStyle=f,i.fillRect(c-t.left,h-t.top,d-c+t.width,u-h+t.height)}se(i,t._pointLabels[s],o,a+r.lineHeight/2,r,{color:e.color,textAlign:l,textBaseline:"middle"})}}(this,s),n.display&&this.ticks.forEach((t,e)=>{0!==e&&(o=this.getDistanceFromCenterForValue(t.value),function(t,e,i,n){const s=t.ctx,r=e.circular,{color:o,lineWidth:a}=e;!r&&!n||!o||!a||i<0||(s.save(),s.strokeStyle=o,s.lineWidth=a,s.setLineDash(e.borderDash),s.lineDashOffset=e.borderDashOffset,s.beginPath(),vr(t,i,r,n),s.closePath(),s.stroke(),s.restore())}(this,n.setContext(this.getContext(e-1)),o,s))}),i.display){for(t.save(),r=s-1;r>=0;r--){const n=i.setContext(this.getPointLabelContext(r)),{color:s,lineWidth:l}=n;l&&s&&(t.lineWidth=l,t.strokeStyle=s,t.setLineDash(n.borderDash),t.lineDashOffset=n.borderDashOffset,o=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),a=this.getPointPosition(r,o),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(a.x,a.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const n=this.getIndexAngle(0);let s,r;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(n),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((n,o)=>{if(0===o&&!e.reverse)return;const a=i.setContext(this.getContext(o)),l=ge(a.font);if(s=this.getDistanceFromCenterForValue(this.ticks[o].value),a.showLabelBackdrop){t.font=l.string,r=t.measureText(n.label).width,t.fillStyle=a.backdropColor;const e=fe(a.backdropPadding);t.fillRect(-r/2-e.left,-s-l.size/2-e.top,r+e.width,l.size+e.height)}se(t,n.label,0,-s,l,{color:a.color})}),t.restore()}drawTitle(){}}_r.id="radialLinear",_r.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:jn.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}},_r.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},_r.descriptors={angleLines:{_fallback:"grid"}};const wr={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Mr=Object.keys(wr);function Or(t,e){return t-e}function kr(t,e){if(p(e))return null;const i=t._adapter,{parser:n,round:s,isoWeekday:r}=t._parseOpts;let o=e;return"function"==typeof n&&(o=n(o)),x(o)||(o="string"==typeof n?i.parse(o,n):i.parse(o)),null===o?null:(s&&(o="week"!==s||!q(r)&&!0!==r?i.startOf(o,s):i.startOf(o,"isoWeek",r)),+o)}function Sr(t,e,i,n){const s=Mr.length;for(let r=Mr.indexOf(t);r=e?i[n]:i[s]]=!0}}else t[e]=!0}function Pr(t,e,i){const n=[],s={},r=e.length;let o,a;for(o=0;o=0&&(e[l].major=!0);return e}(t,n,s,i):n}class Cr extends Vn{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e){const i=t.time||(t.time={}),n=this._adapter=new $i._date(t.adapters.date);C(i.displayFormats,n.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:kr(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:n,max:s,minDefined:r,maxDefined:o}=this.getUserBounds();function a(t){r||isNaN(t.min)||(n=Math.min(n,t.min)),o||isNaN(t.max)||(s=Math.max(s,t.max))}r&&o||(a(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||a(this.getMinMax(!1))),n=x(n)&&!isNaN(n)?n:+e.startOf(Date.now(),i),s=x(s)&&!isNaN(s)?s:+e.endOf(Date.now(),i)+1,this.min=Math.min(n,s-1),this.max=Math.max(n+1,s)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,n="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const s=this.min,r=function(t,e,i){let n=0,s=t.length;for(;nn&&t[s-1]>i;)s--;return n>0||s=Mr.indexOf(i);r--){const i=Mr[r];if(wr[i].common&&t._adapter.diff(s,n,i)>=e-1)return i}return Mr[i?Mr.indexOf(i):0]}(this,r.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(let e=Mr.indexOf(t)+1,i=Mr.length;e1e5*o)throw new Error(e+" and "+i+" are too far apart with stepSize of "+o+" "+r);const f="data"===n.ticks.source&&this.getDataTimestamps();for(h=u,d=0;ht-e).map(t=>+t)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}_tickFormatFunction(t,e,i,n){const s=this.options,r=s.time.displayFormats,o=this._unit,a=this._majorUnit,l=o&&r[o],c=a&&r[a],h=i[e],d=a&&c&&h&&h.major,u=this._adapter.format(t,n||(d?c:l)),f=s.ticks.callback;return f?w(f,[u,e,i],this):u}generateTickLabels(t){let e,i,n;for(e=0,i=t.length;e0?o:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(t=0,e=n.length;t=t[a].pos&&e<=t[l].pos&&({lo:a,hi:l}=xe(t,"pos",e)),({pos:n,time:r}=t[a]),({pos:s,time:o}=t[l])):(e>=t[a].time&&e<=t[l].time&&({lo:a,hi:l}=xe(t,"time",e)),({time:n,pos:r}=t[a]),({time:s,pos:o}=t[l]));const c=s-n;return c?r+(o-r)*(e-n)/c:r}Cr.id="time",Cr.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};class Er extends Cr{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Tr(e,this.min),this._tableRange=Tr(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,n=[],s=[];let r,o,a,l,c;for(r=0,o=t.length;r=e&&l<=i&&n.push(l);if(n.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(r=0,o=n.length;r2&&void 0!==arguments[2]?arguments[2]:"label";const n=[];t.datasets=e.map(e=>{const s=t.datasets.find(t=>t[i]===e[i]);return s&&e.data&&!n.includes(s)?(n.push(s),Object.assign(s,e),s):{...e}})}function zr(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"label";const i={labels:[],datasets:[]};return Rr(i,t.labels),Fr(i,t.datasets,e),i}function Ir(t,e){let{height:i=150,width:n=300,redraw:s=!1,datasetIdKey:r,type:o,data:a,options:l,plugins:c=[],fallbackContent:h,...d}=t;const u=Object(jr.useRef)(null),f=Object(jr.useRef)(),g=()=>{u.current&&(f.current=new us(u.current,{type:o,data:zr(a,r),options:l,plugins:c}),Lr(e,f.current))},p=()=>{Lr(e,null),f.current&&(f.current.destroy(),f.current=null)};return Object(jr.useEffect)(()=>{var t,e;!s&&f.current&&l&&(t=f.current,e=l,t.options={...e})},[s,l]),Object(jr.useEffect)(()=>{!s&&f.current&&Rr(f.current.config.data,a.labels)},[s,a.labels]),Object(jr.useEffect)(()=>{!s&&f.current&&a.datasets&&Fr(f.current.config.data,a.datasets,r)},[s,a.datasets]),Object(jr.useEffect)(()=>{f.current&&(s?(p(),setTimeout(g)):f.current.update())},[s,l,a.labels,a.datasets]),Object(jr.useEffect)(()=>(g(),()=>p()),[]),Ar.a.createElement("canvas",Object.assign({ref:u,role:"img",height:i,width:n},d),h)}const Nr=Object(jr.forwardRef)(Ir);var Vr=i(3),Wr=i(17),Br=i(7),Hr=i(8),Ur=i(4);function Yr(t,e){Object(Ur.a)(2,arguments);var i=Object(Hr.a)(t),n=Object(Br.a)(e);return isNaN(n)?new Date(NaN):n?(i.setDate(i.getDate()+n),i):i}function $r(t,e){Object(Ur.a)(2,arguments);var i=Object(Br.a)(e);return Yr(t,-i)}function Xr(t,e){Object(Ur.a)(2,arguments);var i=Object(Hr.a)(t),n=Object(Br.a)(e);if(isNaN(n))return new Date(NaN);if(!n)return i;var s=i.getDate(),r=new Date(i.getTime());r.setMonth(i.getMonth()+n+1,0);var o=r.getDate();return s>=o?r:(i.setFullYear(r.getFullYear(),r.getMonth(),s),i)}function qr(t,e){Object(Ur.a)(2,arguments);var i=Object(Br.a)(e);return Xr(t,-i)}function Gr(t){return(Gr="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 Qr(t,e){if(Object(Ur.a)(2,arguments),!e||"object"!==Gr(e))return new Date(NaN);var i=e.years?Object(Br.a)(e.years):0,n=e.months?Object(Br.a)(e.months):0,s=e.weeks?Object(Br.a)(e.weeks):0,r=e.days?Object(Br.a)(e.days):0,o=e.hours?Object(Br.a)(e.hours):0,a=e.minutes?Object(Br.a)(e.minutes):0,l=e.seconds?Object(Br.a)(e.seconds):0,c=qr(t,n+12*i),h=$r(c,r+7*s),d=a+60*o,u=l+60*d,f=1e3*u,g=new Date(h.getTime()-f);return g}function Kr(t){return(Kr="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 Zr(t,e){if(Object(Ur.a)(2,arguments),!e||"object"!==Kr(e))return new Date(NaN);var i=e.years?Object(Br.a)(e.years):0,n=e.months?Object(Br.a)(e.months):0,s=e.weeks?Object(Br.a)(e.weeks):0,r=e.days?Object(Br.a)(e.days):0,o=e.hours?Object(Br.a)(e.hours):0,a=e.minutes?Object(Br.a)(e.minutes):0,l=e.seconds?Object(Br.a)(e.seconds):0,c=Object(Hr.a)(t),h=n||i?Xr(c,n+12*i):c,d=r||s?Yr(h,r+7*s):h,u=a+60*o,f=l+60*u,g=1e3*f,p=new Date(d.getTime()+g);return p}function Jr(t,e){var i;Object(Ur.a)(1,arguments);var n=Object(Br.a)(null!==(i=null==e?void 0:e.additionalDigits)&&void 0!==i?i:2);if(2!==n&&1!==n&&0!==n)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof t&&"[object String]"!==Object.prototype.toString.call(t))return new Date(NaN);var s,r=so(t);if(r.date){var o=ro(r.date,n);s=oo(o.restDateString,o.year)}if(!s||isNaN(s.getTime()))return new Date(NaN);var a,l=s.getTime(),c=0;if(r.time&&(c=lo(r.time),isNaN(c)))return new Date(NaN);if(!r.timezone){var h=new Date(l+c),d=new Date(0);return d.setFullYear(h.getUTCFullYear(),h.getUTCMonth(),h.getUTCDate()),d.setHours(h.getUTCHours(),h.getUTCMinutes(),h.getUTCSeconds(),h.getUTCMilliseconds()),d}return a=ho(r.timezone),isNaN(a)?new Date(NaN):new Date(l+c+a)}Math.pow(10,8);var to={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},eo=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,io=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,no=/^([+-])(\d{2})(?::?(\d{2}))?$/;function so(t){var e,i={},n=t.split(to.dateTimeDelimiter);if(n.length>2)return i;if(/:/.test(n[0])?e=n[0]:(i.date=n[0],e=n[1],to.timeZoneDelimiter.test(i.date)&&(i.date=t.split(to.timeZoneDelimiter)[0],e=t.substr(i.date.length,t.length))),e){var s=to.timezone.exec(e);s?(i.time=e.replace(s[1],""),i.timezone=s[1]):i.time=e}return i}function ro(t,e){var i=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),n=t.match(i);if(!n)return{year:NaN,restDateString:""};var s=n[1]?parseInt(n[1]):null,r=n[2]?parseInt(n[2]):null;return{year:null===r?s:100*r,restDateString:t.slice((n[1]||n[2]).length)}}function oo(t,e){if(null===e)return new Date(NaN);var i=t.match(eo);if(!i)return new Date(NaN);var n=!!i[4],s=ao(i[1]),r=ao(i[2])-1,o=ao(i[3]),a=ao(i[4]),l=ao(i[5])-1;if(n)return function(t,e,i){return e>=1&&e<=53&&i>=0&&i<=6}(0,a,l)?function(t,e,i){var n=new Date(0);n.setUTCFullYear(t,0,4);var s=7*(e-1)+i+1-(n.getUTCDay()||7);return n.setUTCDate(n.getUTCDate()+s),n}(e,a,l):new Date(NaN);var c=new Date(0);return function(t,e,i){return e>=0&&e<=11&&i>=1&&i<=(uo[e]||(fo(t)?29:28))}(e,r,o)&&function(t,e){return e>=1&&e<=(fo(t)?366:365)}(e,s)?(c.setUTCFullYear(e,r,Math.max(s,o)),c):new Date(NaN)}function ao(t){return t?parseInt(t):1}function lo(t){var e=t.match(io);if(!e)return NaN;var i=co(e[1]),n=co(e[2]),s=co(e[3]);return function(t,e,i){return 24===t?0===e&&0===i:i>=0&&i<60&&e>=0&&e<60&&t>=0&&t<25}(i,n,s)?36e5*i+6e4*n+1e3*s:NaN}function co(t){return t&&parseFloat(t.replace(",","."))||0}function ho(t){if("Z"===t)return 0;var e=t.match(no);if(!e)return 0;var i="+"===e[1]?-1:1,n=parseInt(e[2]),s=e[3]&&parseInt(e[3])||0;return function(t,e){return e>=0&&e<=59}(0,s)?i*(36e5*n+6e4*s):NaN}var uo=[31,null,31,30,31,30,31,31,30,31,30,31];function fo(t){return t%400==0||t%4==0&&t%100!=0}var go=i(78);function po(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function mo(t){for(var e=1;e0,"is-negative":e<0});return Object(c.createElement)("div",{className:r},Object(c.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"simpay-admin-charts-badge__icon",width:"16",height:"16"},e>0?Object(c.createElement)("path",{d:"M16.004 9.414l-8.607 8.607-1.414-1.414L14.589 8H7.004V6h11v11h-2V9.414z"}):Object(c.createElement)("path",{d:"M14.59 16.004L5.982 7.397l1.414-1.414 8.607 8.606V7.004h2v11h-11v-2z"})),!n&&Object(c.createElement)("span",null,Math.abs(e),"%"))},Eo="simpay-admin-charts-period-over-period__tooltip",jo=function(t){var e=t.position,i=t.opacity,n=t.data,s=t.delta,r=t.deltaChangedString;if(!n.length)return null;var o=e.top,a=e.left,l=e.right,h=Co()("simpay-admin-charts-badge",{"is-positive":s>0,"is-negative":s<0});return Object(c.createElement)("div",{className:Eo,style:{top:o,left:a||"auto",right:l||"auto",opacity:i}},n.map((function(t,e){var i=t.label,n=t.value;return Object(c.createElement)("div",{className:"".concat(Eo,"-data"),"data-dataset":e,key:i+Math.random()},Object(c.createElement)("strong",null,i)," ",Object(c.createElement)("em",null,Object(Wr.decodeEntities)(n)))})),0!==s&&Object(c.createElement)("div",{className:"".concat(Eo,"-delta")},Object(c.createElement)("div",{className:h},Object(c.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"simpay-admin-charts-badge__icon"},s>0?Object(c.createElement)("path",{fillRule:"evenodd",d:"M5.22 14.78a.75.75 0 001.06 0l7.22-7.22v5.69a.75.75 0 001.5 0v-7.5a.75.75 0 00-.75-.75h-7.5a.75.75 0 000 1.5h5.69l-7.22 7.22a.75.75 0 000 1.06z",clipRule:"evenodd"}):Object(c.createElement)("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06l7.22 7.22H6.75a.75.75 0 000 1.5h7.5a.747.747 0 00.75-.75v-7.5a.75.75 0 00-1.5 0v5.69L6.28 5.22z"}))),Object(c.createElement)("span",null,r)))},Ao=function(t){var e=t.chart,i=function(t,e){var i=Object(c.useState)({marginTop:0,marginRight:0,marginBottom:0,marginLeft:0}),n=l()(i,2),s=n[0],r=s.marginTop,o=s.marginRight,a=s.marginBottom,h=s.marginLeft,d=n[1];return Object(c.useEffect)((function(){t.current&&d({marginTop:Math.floor(t.current.chartArea.top),marginRight:Math.floor(t.current.width-t.current.chartArea.right),marginBottom:Math.floor(t.current.chartArea.bottom),marginLeft:Math.floor(t.current.chartArea.left)})}),[t,e]),{marginTop:r,marginRight:o,marginBottom:a,marginLeft:h}}(t.chartRef,e),n=i.marginLeft,s=i.marginRight;return Object(c.createElement)("div",{style:{width:"100%",position:"relative",fontSize:"12px",display:"flex",justifyContent:"space-between",marginTop:"-2px"}},Object(c.createElement)("div",{style:{marginLeft:n,textAlign:"left"}},e.datasets[0].data[0].x),Object(c.createElement)("div",{style:{marginRight:s,textAlign:"right"}},e.datasets[0].data[e.datasets[0].data.length-1].x))};function Lo(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Ro(t){for(var e=1;e0}))}));return Object(c.createElement)("div",{className:"simpay-admin-charts-period-over-period",style:r},!O&&Object(c.createElement)("div",{className:"simpay-admin-charts-no-data",style:Ro(Ro({},r),{},{height:"calc(".concat(r.height," + 15px)")})},a),Object(c.createElement)(Nr,{type:"line",ref:p,options:M,plugins:[_o,(_="rgb(".concat(f.primary_color.join(","),")"),{id:"YGridLineHover",afterDraw:function(t){var e;if(null!==(e=t.tooltip)&&void 0!==e&&null!==(e=e._active)&&void 0!==e&&e.length){var i=t.tooltip._active[0].element.x,n=t.scales.yAxis,s=t.ctx;s.save(),s.beginPath(),s.moveTo(i,n.top),s.lineTo(i,n.bottom),s.lineWidth=2,s.strokeStyle=_,s.stroke(),s.restore()}}})],data:{datasets:m}}),Object(c.createElement)(Ao,{chartRef:p,chart:f}),Object(c.createElement)(jo,s()({},y,{deltaChangedString:h(y)})),Object(c.createElement)(Vr.Popover.Slot,null))}},function(t,e){function i(){return t.exports=i=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var i=0,n=new Array(e);i=r.getTime()?i+1:e.getTime()>=l.getTime()?i:i-1}function f(t){Object(n.a)(1,arguments);var e=u(t),i=new Date(0);i.setUTCFullYear(e,0,4),i.setUTCHours(0,0,0,0);var s=d(i);return s}var g={};function p(){return g}function m(t,e){var i,s,r,a,c,h,d,u;Object(n.a)(1,arguments);var f=p(),g=Object(l.a)(null!==(i=null!==(s=null!==(r=null!==(a=null==e?void 0:e.weekStartsOn)&&void 0!==a?a:null==e||null===(c=e.locale)||void 0===c||null===(h=c.options)||void 0===h?void 0:h.weekStartsOn)&&void 0!==r?r:f.weekStartsOn)&&void 0!==s?s:null===(d=f.locale)||void 0===d||null===(u=d.options)||void 0===u?void 0:u.weekStartsOn)&&void 0!==i?i:0);if(!(g>=0&&g<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var m=Object(o.a)(t),b=m.getUTCDay(),x=(b=1&&x<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var y=new Date(0);y.setUTCFullYear(g+1,0,x),y.setUTCHours(0,0,0,0);var v=m(y,e),_=new Date(0);_.setUTCFullYear(g,0,x),_.setUTCHours(0,0,0,0);var w=m(_,e);return f.getTime()>=v.getTime()?g+1:f.getTime()>=w.getTime()?g:g-1}function x(t,e){var i,s,r,o,a,c,h,d;Object(n.a)(1,arguments);var u=p(),f=Object(l.a)(null!==(i=null!==(s=null!==(r=null!==(o=null==e?void 0:e.firstWeekContainsDate)&&void 0!==o?o:null==e||null===(a=e.locale)||void 0===a||null===(c=a.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==r?r:u.firstWeekContainsDate)&&void 0!==s?s:null===(h=u.locale)||void 0===h||null===(d=h.options)||void 0===d?void 0:d.firstWeekContainsDate)&&void 0!==i?i:1),g=b(t,e),x=new Date(0);x.setUTCFullYear(g,0,f),x.setUTCHours(0,0,0,0);var y=m(x,e);return y}function y(t,e){for(var i=t<0?"-":"",n=Math.abs(t).toString();n.length0?i:1-i;return y("yy"===e?n%100:n,e.length)},_=function(t,e){var i=t.getUTCMonth();return"M"===e?String(i+1):y(i+1,2)},w=function(t,e){return y(t.getUTCDate(),e.length)},M=function(t,e){return y(t.getUTCHours()%12||12,e.length)},O=function(t,e){return y(t.getUTCHours(),e.length)},k=function(t,e){return y(t.getUTCMinutes(),e.length)},S=function(t,e){return y(t.getUTCSeconds(),e.length)},D=function(t,e){var i=e.length,n=t.getUTCMilliseconds();return y(Math.floor(n*Math.pow(10,i-3)),e.length)};function P(t,e){var i=t>0?"-":"+",n=Math.abs(t),s=Math.floor(n/60),r=n%60;if(0===r)return i+String(s);var o=e||"";return i+String(s)+o+y(r,2)}function C(t,e){return t%60==0?(t>0?"-":"+")+y(Math.abs(t)/60,2):T(t,e)}function T(t,e){var i=e||"",n=t>0?"-":"+",s=Math.abs(t);return n+y(Math.floor(s/60),2)+i+y(s%60,2)}var E={G:function(t,e,i){var n=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return i.era(n,{width:"abbreviated"});case"GGGGG":return i.era(n,{width:"narrow"});case"GGGG":default:return i.era(n,{width:"wide"})}},y:function(t,e,i){if("yo"===e){var n=t.getUTCFullYear(),s=n>0?n:1-n;return i.ordinalNumber(s,{unit:"year"})}return v(t,e)},Y:function(t,e,i,n){var s=b(t,n),r=s>0?s:1-s;return"YY"===e?y(r%100,2):"Yo"===e?i.ordinalNumber(r,{unit:"year"}):y(r,e.length)},R:function(t,e){return y(u(t),e.length)},u:function(t,e){return y(t.getUTCFullYear(),e.length)},Q:function(t,e,i){var n=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return y(n,2);case"Qo":return i.ordinalNumber(n,{unit:"quarter"});case"QQQ":return i.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return i.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return i.quarter(n,{width:"wide",context:"formatting"})}},q:function(t,e,i){var n=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return y(n,2);case"qo":return i.ordinalNumber(n,{unit:"quarter"});case"qqq":return i.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return i.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return i.quarter(n,{width:"wide",context:"standalone"})}},M:function(t,e,i){var n=t.getUTCMonth();switch(e){case"M":case"MM":return _(t,e);case"Mo":return i.ordinalNumber(n+1,{unit:"month"});case"MMM":return i.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return i.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return i.month(n,{width:"wide",context:"formatting"})}},L:function(t,e,i){var n=t.getUTCMonth();switch(e){case"L":return String(n+1);case"LL":return y(n+1,2);case"Lo":return i.ordinalNumber(n+1,{unit:"month"});case"LLL":return i.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return i.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return i.month(n,{width:"wide",context:"standalone"})}},w:function(t,e,i,s){var r=function(t,e){Object(n.a)(1,arguments);var i=Object(o.a)(t),s=m(i,e).getTime()-x(i,e).getTime();return Math.round(s/6048e5)+1}(t,s);return"wo"===e?i.ordinalNumber(r,{unit:"week"}):y(r,e.length)},I:function(t,e,i){var s=function(t){Object(n.a)(1,arguments);var e=Object(o.a)(t),i=d(e).getTime()-f(e).getTime();return Math.round(i/6048e5)+1}(t);return"Io"===e?i.ordinalNumber(s,{unit:"week"}):y(s,e.length)},d:function(t,e,i){return"do"===e?i.ordinalNumber(t.getUTCDate(),{unit:"date"}):w(t,e)},D:function(t,e,i){var s=function(t){Object(n.a)(1,arguments);var e=Object(o.a)(t),i=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var s=e.getTime(),r=i-s;return Math.floor(r/864e5)+1}(t);return"Do"===e?i.ordinalNumber(s,{unit:"dayOfYear"}):y(s,e.length)},E:function(t,e,i){var n=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return i.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return i.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(n,{width:"short",context:"formatting"});case"EEEE":default:return i.day(n,{width:"wide",context:"formatting"})}},e:function(t,e,i,n){var s=t.getUTCDay(),r=(s-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(r);case"ee":return y(r,2);case"eo":return i.ordinalNumber(r,{unit:"day"});case"eee":return i.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return i.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(s,{width:"short",context:"formatting"});case"eeee":default:return i.day(s,{width:"wide",context:"formatting"})}},c:function(t,e,i,n){var s=t.getUTCDay(),r=(s-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(r);case"cc":return y(r,e.length);case"co":return i.ordinalNumber(r,{unit:"day"});case"ccc":return i.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return i.day(s,{width:"narrow",context:"standalone"});case"cccccc":return i.day(s,{width:"short",context:"standalone"});case"cccc":default:return i.day(s,{width:"wide",context:"standalone"})}},i:function(t,e,i){var n=t.getUTCDay(),s=0===n?7:n;switch(e){case"i":return String(s);case"ii":return y(s,e.length);case"io":return i.ordinalNumber(s,{unit:"day"});case"iii":return i.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return i.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return i.day(n,{width:"short",context:"formatting"});case"iiii":default:return i.day(n,{width:"wide",context:"formatting"})}},a:function(t,e,i){var n=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return i.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return i.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(t,e,i){var n,s=t.getUTCHours();switch(n=12===s?"noon":0===s?"midnight":s/12>=1?"pm":"am",e){case"b":case"bb":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return i.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return i.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(t,e,i){var n,s=t.getUTCHours();switch(n=s>=17?"evening":s>=12?"afternoon":s>=4?"morning":"night",e){case"B":case"BB":case"BBB":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return i.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return i.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(t,e,i){if("ho"===e){var n=t.getUTCHours()%12;return 0===n&&(n=12),i.ordinalNumber(n,{unit:"hour"})}return M(t,e)},H:function(t,e,i){return"Ho"===e?i.ordinalNumber(t.getUTCHours(),{unit:"hour"}):O(t,e)},K:function(t,e,i){var n=t.getUTCHours()%12;return"Ko"===e?i.ordinalNumber(n,{unit:"hour"}):y(n,e.length)},k:function(t,e,i){var n=t.getUTCHours();return 0===n&&(n=24),"ko"===e?i.ordinalNumber(n,{unit:"hour"}):y(n,e.length)},m:function(t,e,i){return"mo"===e?i.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):k(t,e)},s:function(t,e,i){return"so"===e?i.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):S(t,e)},S:function(t,e){return D(t,e)},X:function(t,e,i,n){var s=(n._originalDate||t).getTimezoneOffset();if(0===s)return"Z";switch(e){case"X":return C(s);case"XXXX":case"XX":return T(s);case"XXXXX":case"XXX":default:return T(s,":")}},x:function(t,e,i,n){var s=(n._originalDate||t).getTimezoneOffset();switch(e){case"x":return C(s);case"xxxx":case"xx":return T(s);case"xxxxx":case"xxx":default:return T(s,":")}},O:function(t,e,i,n){var s=(n._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+P(s,":");case"OOOO":default:return"GMT"+T(s,":")}},z:function(t,e,i,n){var s=(n._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+P(s,":");case"zzzz":default:return"GMT"+T(s,":")}},t:function(t,e,i,n){var s=n._originalDate||t;return y(Math.floor(s.getTime()/1e3),e.length)},T:function(t,e,i,n){return y((n._originalDate||t).getTime(),e.length)}},j=function(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},A=function(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},L={p:A,P:function(t,e){var i,n=t.match(/(P+)(p+)?/)||[],s=n[1],r=n[2];if(!r)return j(t,e);switch(s){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"})}return i.replace("{{date}}",j(s,e)).replace("{{time}}",A(r,e))}};function R(t){var e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}var F=["D","DD"],z=["YY","YYYY"];function I(t){return-1!==F.indexOf(t)}function N(t){return-1!==z.indexOf(t)}function V(t,e,i){if("YYYY"===t)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===t)throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===t)throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===t)throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var W={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function B(t){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.width?String(e.width):t.defaultWidth,n=t.formats[i]||t.formats[t.defaultWidth];return n}}var H={date:B({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:B({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:B({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},U={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function Y(t){return function(e,i){var n;if("formatting"===(null!=i&&i.context?String(i.context):"standalone")&&t.formattingValues){var s=t.defaultFormattingWidth||t.defaultWidth,r=null!=i&&i.width?String(i.width):s;n=t.formattingValues[r]||t.formattingValues[s]}else{var o=t.defaultWidth,a=null!=i&&i.width?String(i.width):t.defaultWidth;n=t.values[a]||t.values[o]}return n[t.argumentCallback?t.argumentCallback(e):e]}}function $(t){return function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.width,s=n&&t.matchPatterns[n]||t.matchPatterns[t.defaultMatchWidth],r=e.match(s);if(!r)return null;var o,a=r[0],l=n&&t.parsePatterns[n]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?q(l,(function(t){return t.test(a)})):X(l,(function(t){return t.test(a)}));o=t.valueCallback?t.valueCallback(c):c,o=i.valueCallback?i.valueCallback(o):o;var h=e.slice(a.length);return{value:o,rest:h}}}function X(t,e){for(var i in t)if(t.hasOwnProperty(i)&&e(t[i]))return i}function q(t,e){for(var i=0;i0?"in "+n:n+" ago":n},formatLong:H,formatRelative:function(t,e,i,n){return U[t]},localize:{ordinalNumber:function(t,e){var i=Number(t),n=i%100;if(n>20||n<10)switch(n%10){case 1:return i+"st";case 2:return i+"nd";case 3:return i+"rd"}return i+"th"},era:Y({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Y({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:Y({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:Y({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:Y({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(G={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(t){return parseInt(t,10)}},function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.match(G.matchPattern);if(!i)return null;var n=i[0],s=t.match(G.parsePattern);if(!s)return null;var r=G.valueCallback?G.valueCallback(s[0]):s[0];r=e.valueCallback?e.valueCallback(r):r;var o=t.slice(n.length);return{value:r,rest:o}}),era:$({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:$({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:$({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:$({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:$({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}},K=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Z=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,J=/^'([^]*?)'?$/,tt=/''/g,et=/[a-zA-Z]/;function it(t,e,i){var s,r,c,d,u,f,g,m,b,x,y,v,_,w,M,O,k,S;Object(n.a)(2,arguments);var D=String(e),P=p(),C=null!==(s=null!==(r=null==i?void 0:i.locale)&&void 0!==r?r:P.locale)&&void 0!==s?s:Q,T=Object(l.a)(null!==(c=null!==(d=null!==(u=null!==(f=null==i?void 0:i.firstWeekContainsDate)&&void 0!==f?f:null==i||null===(g=i.locale)||void 0===g||null===(m=g.options)||void 0===m?void 0:m.firstWeekContainsDate)&&void 0!==u?u:P.firstWeekContainsDate)&&void 0!==d?d:null===(b=P.locale)||void 0===b||null===(x=b.options)||void 0===x?void 0:x.firstWeekContainsDate)&&void 0!==c?c:1);if(!(T>=1&&T<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var j=Object(l.a)(null!==(y=null!==(v=null!==(_=null!==(w=null==i?void 0:i.weekStartsOn)&&void 0!==w?w:null==i||null===(M=i.locale)||void 0===M||null===(O=M.options)||void 0===O?void 0:O.weekStartsOn)&&void 0!==_?_:P.weekStartsOn)&&void 0!==v?v:null===(k=P.locale)||void 0===k||null===(S=k.options)||void 0===S?void 0:S.weekStartsOn)&&void 0!==y?y:0);if(!(j>=0&&j<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!C.localize)throw new RangeError("locale must contain localize property");if(!C.formatLong)throw new RangeError("locale must contain formatLong property");var A=Object(o.a)(t);if(!a(A))throw new RangeError("Invalid time value");var F=R(A),z=h(A,F),W={firstWeekContainsDate:T,weekStartsOn:j,locale:C,_originalDate:A},B=D.match(Z).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,L[e])(t,C.formatLong):t})).join("").match(K).map((function(n){if("''"===n)return"'";var s=n[0];if("'"===s)return nt(n);var r=E[s];if(r)return null!=i&&i.useAdditionalWeekYearTokens||!N(n)||V(n,e,String(t)),null!=i&&i.useAdditionalDayOfYearTokens||!I(n)||V(n,e,String(t)),r(z,n,C.localize,W);if(s.match(et))throw new RangeError("Format string contains an unescaped latin alphabet character `"+s+"`");return n})).join("");return B}function nt(t){var e=t.match(J);return e?e[1].replace(tt,"'"):t}},,,,,function(t,e,i){"use strict";i.r(e);var n=i(6),s=i.n(n),r=i(0),o=(i(37),i(10)),a=i(25),l=i.n(a),c=i(2),h=i(11),d=i.n(h);function u(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function f(t){for(var e=1;ewebhooks to be properly configured to populate correctly.","stripe"),{url:Object(r.createElement)("a",{href:y})})),Object(r.createElement)(p.Flex,null,Object(r.createElement)(p.Button,{variant:"link",onClick:function(){return e(!1)}},Object(c.__)("Close","stripe")),Object(r.createElement)(p.Button,{variant:"primary",isPrimary:!0,href:"https://dashboard.stripe.com/reports/hub",target:"_blank"},Object(c.__)("View advanced reports in Stripe →","stripe"))))},w=i(14),M=simpayAdminDashboardWidgetReport.currencies,O=new Date,k=function(t){var e=t.report,i=t.currency,n=t.setCurrency,o=t.range,a=t.setRange,l=e.data.delta,h=Object(r.useState)(!1),d=s()(h,2),u=d[0],f=d[1];return Object(r.createElement)("div",{className:"simpay-admin-dashboard-widget-report__data-filter"},Object(r.createElement)("div",{className:"simpay-admin-dashboard-widget-report__data-filter-title"},Object(r.createElement)("strong",null,Object(c.__)("Top Forms","stripe")),u&&Object(r.createElement)(_,{setIsOpen:f}),Object(r.createElement)(p.Button,{variant:"link",onClick:function(){return f(!0)}},Object(r.createElement)(m.a,{size:20,icon:b.a}))),Object(r.createElement)("div",{className:"simpay-admin-dashboard-widget-report__data-filter-controls"},!e.isLoading&&0!==l&&Object(r.createElement)(w.a,{delta:l}),Object(r.createElement)(p.SelectControl,{label:Object(c.__)("Currency","stripe"),hideLabelFromVision:!0,value:i,onChange:n,options:M.map((function(t){return{label:t,value:t.toLowerCase()}}))}),Object(r.createElement)(p.SelectControl,{label:Object(c.__)("Range","stripe"),hideLabelFromVision:!0,value:o.type,onChange:function(t){return a({type:t,start:Object(w.d)(t,O),end:Object(w.c)(t,o.end)})},options:[{label:"Today",value:"today"},{label:"Last 7 days",value:"7days"},{label:"Last 4 weeks",value:"4weeks"}]})))},S=i(15),D=i.n(S),P=i(17),C=function(t){var e=t.id,i=t.title,n=t.total_formatted,s=Object(o.addQueryArgs)("post.php",{post:e,action:"edit"});return Object(r.createElement)("div",{style:{display:"flex",justifyContent:"space-between"}},Object(r.createElement)("span",null,i?Object(r.createElement)("a",{href:s,target:"_blank",rel:"noreferrer"},i):Object(c.sprintf)(/* translators: %d Form ID. */ +!function(t){var e={};function i(n){if(e[n])return e[n].exports;var s=e[n]={i:n,l:!1,exports:{}};return t[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}i.m=t,i.c=e,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 s in t)i.d(n,s,function(e){return t[e]}.bind(null,s));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="",i(i.s=81)}([function(t,e){t.exports=window.wp.element},,function(t,e){t.exports=window.wp.i18n},function(t,e){t.exports=window.wp.components},function(t,e,i){"use strict";function n(t,e){if(e.length1?"s":"")+" required, but only "+e.length+" present")}i.d(e,"a",(function(){return n}))},function(t,e){t.exports=window.React},function(t,e,i){var n=i(26),s=i(27),r=i(21),o=i(28);t.exports=function(t,e){return n(t)||s(t,e)||r(t,e)||o()},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){"use strict";function n(t){if(null===t||!0===t||!1===t)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}i.d(e,"a",(function(){return n}))},function(t,e,i){"use strict";i.d(e,"a",(function(){return r}));var n=i(4);function s(t){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t){Object(n.a)(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||"object"===s(t)&&"[object Date]"===e?new Date(t.getTime()):"number"==typeof t||"[object Number]"===e?new Date(t):("string"!=typeof t&&"[object String]"!==e||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}},function(t,e){t.exports=window.wp.primitives},function(t,e){t.exports=window.wp.url},function(t,e,i){var n=i(30);t.exports=function(t,e,i){return(e=n(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=window.lodash},function(t,e,i){"use strict";i.d(e,"b",(function(){return Fo})),i.d(e,"e",(function(){return Do})),i.d(e,"d",(function(){return yo})),i.d(e,"c",(function(){return vo})),i.d(e,"a",(function(){return To}));var n=i(15),s=i.n(n),r=i(11),o=i.n(r),a=i(6),l=i.n(a),c=i(0);const h="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function d(t,e,i){const n=i||(t=>Array.prototype.slice.call(t));let s=!1,r=[];return function(...i){r=n(i),s||(s=!0,h.call(window,()=>{s=!1,t.apply(e,r)}))}}const u=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2;function f(){}const g=function(){let t=0;return function(){return t++}}();function p(t){return null==t}function m(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.substr(0,7)&&"Array]"===e.substr(-6)}function b(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}const x=t=>("number"==typeof t||t instanceof Number)&&isFinite(+t);function y(t,e){return x(t)?t:e}function v(t,e){return void 0===t?e:t}const _=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function w(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function M(t,e,i,n){let s,r,o;if(m(t))if(r=t.length,n)for(s=r-1;s>=0;s--)e.call(i,t[s],s);else for(s=0;si;)t=t[e.substr(i,n-i)],i=n+1,n=E(e,i);return t}function A(t){return t.charAt(0).toUpperCase()+t.slice(1)}const L=t=>void 0!==t,R=t=>"function"==typeof t,F=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0},z=Math.PI,I=2*z,N=I+z,V=Number.POSITIVE_INFINITY,W=z/180,B=z/2,H=z/4,U=2*z/3,Y=Math.log10,$=Math.sign;function X(t){const e=Math.round(t);t=G(t,e,t/1e3)?e:t;const i=Math.pow(10,Math.floor(Y(t))),n=t/i;return(n<=1?1:n<=2?2:n<=5?5:10)*i}function q(t){return!isNaN(parseFloat(t))&&isFinite(t)}function G(t,e,i){return Math.abs(t-e)l&&c=Math.min(e,i)-n&&t<=Math.max(e,i)+n}const at=t=>0===t||1===t,lt=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*I/i),ct=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*I/i)+1,ht={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*B),easeOutSine:t=>Math.sin(t*B),easeInOutSine:t=>-.5*(Math.cos(z*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>at(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>at(t)?t:lt(t,.075,.3),easeOutElastic:t=>at(t)?t:ct(t,.075,.3),easeInOutElastic(t){const e=.1125;return at(t)?t:t<.5?.5*lt(2*t,e,.45):.5+.5*ct(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-ht.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*ht.easeInBounce(2*t):.5*ht.easeOutBounce(2*t-1)+.5},dt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},ut="0123456789ABCDEF",ft=t=>ut[15&t],gt=t=>ut[(240&t)>>4]+ut[15&t],pt=t=>(240&t)>>4==(15&t);function mt(t){return t+.5|0}const bt=(t,e,i)=>Math.max(Math.min(t,i),e);function xt(t){return bt(mt(2.55*t),0,255)}function yt(t){return bt(mt(255*t),0,255)}function vt(t){return bt(mt(t/2.55)/100,0,1)}function _t(t){return bt(mt(100*t),0,100)}const wt=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/,Mt=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Ot(t,e,i){const n=e*Math.min(i,1-i),s=(e,s=(e+t/30)%12)=>i-n*Math.max(Math.min(s-3,9-s,1),-1);return[s(0),s(8),s(4)]}function kt(t,e,i){const n=(n,s=(n+t/60)%6)=>i-i*e*Math.max(Math.min(s,4-s,1),0);return[n(5),n(3),n(1)]}function St(t,e,i){const n=Ot(t,1,.5);let s;for(e+i>1&&(s=1/(e+i),e*=s,i*=s),s=0;s<3;s++)n[s]*=1-e-i,n[s]+=e;return n}function Dt(t){const e=t.r/255,i=t.g/255,n=t.b/255,s=Math.max(e,i,n),r=Math.min(e,i,n),o=(s+r)/2;let a,l,c;return s!==r&&(c=s-r,l=o>.5?c/(2-s-r):c/(s+r),a=s===e?(i-n)/c+(i=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=yt(t[3]))):(e=Rt(t,{r:0,g:0,b:0,a:1})).a=yt(e.a),e}function zt(t){return"r"===t.charAt(0)?function(t){const e=wt.exec(t);let i,n,s,r=255;if(e){if(e[7]!==i){const t=+e[7];r=255&(e[8]?xt(t):255*t)}return i=+e[1],n=+e[3],s=+e[5],i=255&(e[2]?xt(i):i),n=255&(e[4]?xt(n):n),s=255&(e[6]?xt(s):s),{r:i,g:n,b:s,a:r}}}(t):function(t){const e=Mt.exec(t);let i,n=255;if(!e)return;e[5]!==i&&(n=e[6]?xt(+e[5]):yt(+e[5]));const s=Tt(+e[2]),r=+e[3]/100,o=+e[4]/100;return i="hwb"===e[1]?function(t,e,i){return Pt(St,t,e,i)}(s,r,o):"hsv"===e[1]?function(t,e,i){return Pt(kt,t,e,i)}(s,r,o):Ct(s,r,o),{r:i[0],g:i[1],b:i[2],a:n}}(t)}class It{constructor(t){if(t instanceof It)return t;const e=typeof t;let i;var n,s,r;"object"===e?i=Ft(t):"string"===e&&(r=(n=t).length,"#"===n[0]&&(4===r||5===r?s={r:255&17*dt[n[1]],g:255&17*dt[n[2]],b:255&17*dt[n[3]],a:5===r?17*dt[n[4]]:255}:7!==r&&9!==r||(s={r:dt[n[1]]<<4|dt[n[2]],g:dt[n[3]]<<4|dt[n[4]],b:dt[n[5]]<<4|dt[n[6]],a:9===r?dt[n[7]]<<4|dt[n[8]]:255})),i=s||function(t){At||(At=function(){const t={},e=Object.keys(jt),i=Object.keys(Et);let n,s,r,o,a;for(n=0;n>16&255,r>>8&255,255&r]}return t}(),At.transparent=[0,0,0,0]);const e=At[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}(t)||zt(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Rt(this._rgb);return t&&(t.a=vt(t.a)),t}set rgb(t){this._rgb=Ft(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${vt(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):this._rgb;var t}hexString(){return this._valid?(t=this._rgb,e=function(t){return pt(t.r)&&pt(t.g)&&pt(t.b)&&pt(t.a)}(t)?ft:gt,t?"#"+e(t.r)+e(t.g)+e(t.b)+(t.a<255?e(t.a):""):t):this._rgb;var t,e}hslString(){return this._valid?function(t){if(!t)return;const e=Dt(t),i=e[0],n=_t(e[1]),s=_t(e[2]);return t.a<255?`hsla(${i}, ${n}%, ${s}%, ${vt(t.a)})`:`hsl(${i}, ${n}%, ${s}%)`}(this._rgb):this._rgb}mix(t,e){const i=this;if(t){const n=i.rgb,s=t.rgb;let r;const o=e===r?.5:e,a=2*o-1,l=n.a-s.a,c=((a*l==-1?a:(a+l)/(1+a*l))+1)/2;r=1-c,n.r=255&c*n.r+r*s.r+.5,n.g=255&c*n.g+r*s.g+.5,n.b=255&c*n.b+r*s.b+.5,n.a=o*n.a+(1-o)*s.a,i.rgb=n}return i}clone(){return new It(this.rgb)}alpha(t){return this._rgb.a=yt(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=mt(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Lt(this._rgb,2,t),this}darken(t){return Lt(this._rgb,2,-t),this}saturate(t){return Lt(this._rgb,1,t),this}desaturate(t){return Lt(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=Dt(t);i[0]=Tt(i[0]+e),i=Ct(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}function Nt(t){return new It(t)}const Vt=t=>t instanceof CanvasGradient||t instanceof CanvasPattern;function Wt(t){return Vt(t)?t:Nt(t)}function Bt(t){return Vt(t)?t:Nt(t).saturate(.5).darken(.1).hexString()}const Ht=Object.create(null),Ut=Object.create(null);function Yt(t,e){if(!e)return t;const i=e.split(".");for(let e=0,n=i.length;et.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>Bt(e.backgroundColor),this.hoverBorderColor=(t,e)=>Bt(e.borderColor),this.hoverColor=(t,e)=>Bt(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t)}set(t,e){return $t(this,t,e)}get(t){return Yt(this,t)}describe(t,e){return $t(Ut,t,e)}override(t,e){return $t(Ht,t,e)}route(t,e,i,n){const s=Yt(this,t),r=Yt(this,i),o="_"+e;Object.defineProperties(s,{[o]:{value:s[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[o],e=r[n];return b(t)?Object.assign({},e,t):v(t,e)},set(t){this[o]=t}}})}}({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function qt(t,e,i,n,s){let r=e[s];return r||(r=e[s]=t.measureText(s).width,i.push(s)),r>n&&(n=r),n}function Gt(t,e,i,n){let s=(n=n||{}).data=n.data||{},r=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(s=n.data={},r=n.garbageCollect=[],n.font=e),t.save(),t.font=e;let o=0;const a=i.length;let l,c,h,d,u;for(l=0;li.length){for(l=0;l0&&t.stroke()}}function Jt(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.xe.top-i&&t.y0&&""!==r.strokeColor;let l,c;for(t.save(),t.font=s.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),p(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,r),l=0;lv(t[i],t[e[i]]):e=>t[e]:()=>t;for(const t of s)i[t]=+r(t)||0;return i}function de(t){return he(t,{top:"y",right:"x",bottom:"y",left:"x"})}function ue(t){return he(t,["topLeft","topRight","bottomLeft","bottomRight"])}function fe(t){const e=de(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function ge(t,e){t=t||{},e=e||Xt.font;let i=v(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let n=v(t.style,e.style);n&&!(""+n).match(le)&&(console.warn('Invalid font style specified: "'+n+'"'),n="");const s={family:v(t.family,e.family),lineHeight:ce(v(t.lineHeight,e.lineHeight),i),size:i,style:n,weight:v(t.weight,e.weight),string:""};return s.string=function(t){return!t||p(t.size)||p(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(s),s}function pe(t,e,i,n){let s,r,o,a=!0;for(s=0,r=t.length;st[i]1;)n=r+s>>1,i(n)?r=n:s=n;return{lo:r,hi:s}}const xe=(t,e,i)=>be(t,i,n=>t[n][e]be(t,i,n=>t[n][e]>=i),ve=["push","pop","shift","splice","unshift"];function _e(t,e){const i=t._chartjs;if(!i)return;const n=i.listeners,s=n.indexOf(e);-1!==s&&n.splice(s,1),n.length>0||(ve.forEach(e=>{delete t[e]}),delete t._chartjs)}function we(t){const e=new Set;let i,n;for(i=0,n=t.length;it[0])){L(n)||(n=Le("_fallback",t));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:i,_fallback:n,_getTarget:s,override:s=>Me([s,...t],e,i,n)};return new Proxy(r,{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,n)=>Pe(i,n,()=>function(t,e,i,n){let s;for(const r of e)if(s=Le(Se(r,t),i),L(s))return De(t,s)?je(i,n,t,s):s}(n,e,t,i)),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>Re(t).includes(e),ownKeys:t=>Re(t),set(t,e,i){const n=t._storage||(t._storage=s());return t[e]=n[e]=i,delete t._keys,!0}})}function Oe(t,e,i,n){const s={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:ke(t,n),setContext:e=>Oe(t,e,i,n),override:s=>Oe(t.override(s),e,i,n)};return new Proxy(s,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>Pe(t,e,()=>function(t,e,i){const{_proxy:n,_context:s,_subProxy:r,_descriptors:o}=t;let a=n[e];return R(a)&&o.isScriptable(e)&&(a=function(t,e,i,n){const{_proxy:s,_context:r,_subProxy:o,_stack:a}=i;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);return a.add(t),e=e(r,o||n),a.delete(t),De(t,e)&&(e=je(s._scopes,s,t,e)),e}(e,a,t,i)),m(a)&&a.length&&(a=function(t,e,i,n){const{_proxy:s,_context:r,_subProxy:o,_descriptors:a}=i;if(L(r.index)&&n(t))e=e[r.index%e.length];else if(b(e[0])){const i=e,n=s._scopes.filter(t=>t!==i);e=[];for(const l of i){const i=je(n,s,t,l);e.push(Oe(i,r,o&&o[t],a))}}return e}(e,a,t,o.isIndexable)),De(e,a)&&(a=Oe(a,s,r&&r[e],o)),a}(t,e,i)),getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,i)=>Reflect.has(t,i),ownKeys:()=>Reflect.ownKeys(t),set:(e,i,n)=>(t[i]=n,delete e[i],!0)})}function ke(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:n=e.indexable,_allKeys:s=e.allKeys}=t;return{allKeys:s,scriptable:i,indexable:n,isScriptable:R(i)?i:()=>i,isIndexable:R(n)?n:()=>n}}const Se=(t,e)=>t?t+A(e):e,De=(t,e)=>b(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function Pe(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const n=i();return t[e]=n,n}function Ce(t,e,i){return R(t)?t(e,i):t}const Te=(t,e)=>!0===t?e:"string"==typeof t?j(e,t):void 0;function Ee(t,e,i,n,s){for(const r of e){const e=Te(i,r);if(e){t.add(e);const r=Ce(e._fallback,i,s);if(L(r)&&r!==i&&r!==n)return r}else if(!1===e&&L(n)&&i!==n)return null}return!1}function je(t,e,i,n){const s=e._rootScopes,r=Ce(e._fallback,i,n),o=[...t,...s],a=new Set;a.add(n);let l=Ae(a,o,i,r||i,n);return null!==l&&(!L(r)||r===i||(l=Ae(a,o,r,l,n),null!==l))&&Me(Array.from(a),[""],s,r,()=>function(t,e,i){const n=t._getTarget();e in n||(n[e]={});const s=n[e];return m(s)&&b(i)?i:s}(e,i,n))}function Ae(t,e,i,n,s){for(;i;)i=Ee(t,e,i,n,s);return i}function Le(t,e){for(const i of e){if(!i)continue;const e=i[t];if(L(e))return e}}function Re(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter(t=>!t.startsWith("_")))e.add(t);return Array.from(e)}(t._scopes)),e}const Fe=Number.EPSILON||1e-14,ze=(t,e)=>e"x"===t?"y":"x";function Ne(t,e,i,n){const s=t.skip?e:t,r=e,o=i.skip?e:i,a=et(r,s),l=et(o,r);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=n*c,u=n*h;return{previous:{x:r.x-d*(o.x-s.x),y:r.y-d*(o.y-s.y)},next:{x:r.x+u*(o.x-s.x),y:r.y+u*(o.y-s.y)}}}function Ve(t,e,i){return Math.max(Math.min(t,i),e)}function We(t,e,i,n,s){let r,o,a,l;if(e.spanGaps&&(t=t.filter(t=>!t.skip)),"monotone"===e.cubicInterpolationMode)!function(t,e="x"){const i=Ie(e),n=t.length,s=Array(n).fill(0),r=Array(n);let o,a,l,c=ze(t,0);for(o=0;owindow.getComputedStyle(t,null),$e=["top","right","bottom","left"];function Xe(t,e,i){const n={};i=i?"-"+i:"";for(let s=0;s<4;s++){const r=$e[s];n[r]=parseFloat(t[e+"-"+r+i])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function qe(t,e){const{canvas:i,currentDevicePixelRatio:n}=e,s=Ye(i),r="border-box"===s.boxSizing,o=Xe(s,"padding"),a=Xe(s,"border","width"),{x:l,y:c,box:h}=function(t,e){const i=t.native||t,n=i.touches,s=n&&n.length?n[0]:i,{offsetX:r,offsetY:o}=s;let a,l,c=!1;if(((t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot))(r,o,i.target))a=r,l=o;else{const t=e.getBoundingClientRect();a=s.clientX-t.left,l=s.clientY-t.top,c=!0}return{x:a,y:l,box:c}}(t,i),d=o.left+(h&&a.left),u=o.top+(h&&a.top);let{width:f,height:g}=e;return r&&(f-=o.width+a.width,g-=o.height+a.height),{x:Math.round((l-d)/f*i.width/n),y:Math.round((c-u)/g*i.height/n)}}const Ge=t=>Math.round(10*t)/10;function Qe(t,e,i){const n=e||1,s=Math.floor(t.height*n),r=Math.floor(t.width*n);t.height=s/n,t.width=r/n;const o=t.canvas;return o.style&&(i||!o.style.height&&!o.style.width)&&(o.style.height=t.height+"px",o.style.width=t.width+"px"),(t.currentDevicePixelRatio!==n||o.height!==s||o.width!==r)&&(t.currentDevicePixelRatio=n,o.height=s,o.width=r,t.ctx.setTransform(n,0,0,n,0,0),!0)}const Ke=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(t){}return t}();function Ze(t,e){const i=function(t,e){return Ye(t).getPropertyValue(e)}(t,e),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function Je(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function ti(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:"middle"===n?i<.5?t.y:e.y:"after"===n?i<1?t.y:e.y:i>0?e.y:t.y}}function ei(t,e,i,n){const s={x:t.cp2x,y:t.cp2y},r={x:e.cp1x,y:e.cp1y},o=Je(t,s,i),a=Je(s,r,i),l=Je(r,e,i),c=Je(o,a,i),h=Je(a,l,i);return Je(c,h,i)}const ii=new Map;function ni(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let n=ii.get(i);return n||(n=new Intl.NumberFormat(t,e),ii.set(i,n)),n}(e,i).format(t)}function si(t,e,i){return t?function(t,e){return{x:i=>t+t+e-i,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,i):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function ri(t){return"angle"===t?{between:st,compare:it,normalize:nt}:{between:ot,compare:(t,e)=>t-e,normalize:t=>t}}function oi({start:t,end:e,count:i,loop:n,style:s}){return{start:t%i,end:e%i,loop:n&&(e-t+1)%i==0,style:s}}function ai(t,e,i){if(!i)return[t];const{property:n,start:s,end:r}=i,o=e.length,{compare:a,between:l,normalize:c}=ri(n),{start:h,end:d,loop:u,style:f}=function(t,e,i){const{property:n,start:s,end:r}=i,{between:o,normalize:a}=ri(n),l=e.length;let c,h,{start:d,end:u,loop:f}=t;if(f){for(d+=l,u+=l,c=0,h=l;cn({chart:t,initial:e.initial,numSteps:r,currentStep:Math.min(i-e.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=h.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,n)=>{if(!i.running||!i.items.length)return;const s=i.items;let r,o=s.length-1,a=!1;for(;o>=0;--o)r=s[o],r._active?(r._total>i.duration&&(i.duration=r._total),r.tick(t),a=!0):(s[o]=s[s.length-1],s.pop());a&&(n.draw(),this._notify(n,i,t,"progress")),s.length||(i.running=!1,this._notify(n,i,t,"complete"),i.initial=!1),e+=s.length}),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((t,e)=>Math.max(t,e._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let n=i.length-1;for(;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}};const ui={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const n=Wt(t||"transparent"),s=n.valid&&Wt(e||"transparent");return s&&s.valid?s.mix(n,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class fi{constructor(t,e,i,n){const s=e[i];n=pe([t.to,n,s,t.from]);const r=pe([t.from,s,n]);this._active=!0,this._fn=t.fn||ui[t.type||typeof r],this._easing=ht[t.easing]||ht.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=r,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const n=this._target[this._prop],s=i-this._start,r=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=s,this._loop=!!t.loop,this._to=pe([t.to,e,n,t.from]),this._from=pe([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,n=this._prop,s=this._from,r=this._loop,o=this._to;let a;if(this._active=s!==o&&(r||e1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[n]=this._fn(s,o,a))}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let t=0;t"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),Xt.set("animations",{colors:{type:"color",properties:["color","borderColor","backgroundColor"]},numbers:{type:"number",properties:["x","y","borderWidth","radius","tension"]}}),Xt.describe("animations",{_fallback:"animation"}),Xt.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}});class pi{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!b(t))return;const e=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const n=t[i];if(!b(n))return;const s={};for(const t of gi)s[t]=n[t];(m(n.properties)&&n.properties||[i]).forEach(t=>{t!==i&&e.has(t)||e.set(t,s)})})}_animateOptions(t,e){const i=e.options,n=function(t,e){if(!e)return;let i=t.options;if(i)return i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i;t.options=e}(t,i);if(!n)return[];const s=this._createAnimations(n,i);return i.$shared&&function(t,e){const i=[],n=Object.keys(e);for(let e=0;e{t.options=i},()=>{}),s}_createAnimations(t,e){const i=this._properties,n=[],s=t.$animations||(t.$animations={}),r=Object.keys(e),o=Date.now();let a;for(a=r.length-1;a>=0;--a){const l=r[a];if("$"===l.charAt(0))continue;if("options"===l){n.push(...this._animateOptions(t,e));continue}const c=e[l];let h=s[l];const d=i.get(l);if(h){if(d&&h.active()){h.update(d,c,o);continue}h.cancel()}d&&d.duration?(s[l]=h=new fi(d,t,l,c),n.push(h)):t[l]=c}return n}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(di.add(this._chart,i),!0):void 0}}function mi(t,e){const i=t&&t.options||{},n=i.reverse,s=void 0===i.min?e:0,r=void 0===i.max?e:0;return{start:n?r:s,end:n?s:r}}function bi(t,e){const i=[],n=t._getSortedDatasetMetas(e);let s,r;for(s=0,r=n.length;s0||!i&&e<0)return s.index}return null}function wi(t,e){const{chart:i,_cachedMeta:n}=t,s=i._stacks||(i._stacks={}),{iScale:r,vScale:o,index:a}=n,l=r.axis,c=o.axis,h=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(r,o,n),d=e.length;let u;for(let t=0;ti[t].axis===e).shift()}function Oi(t,e){const i=t.controller.index,n=t.vScale&&t.vScale.axis;if(n){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[n]||void 0===e[n][i])return;delete e[n][i]}}}const ki=t=>"reset"===t||"none"===t,Si=(t,e)=>e?t:Object.assign({},t);class Di{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=yi(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&Oi(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=(t,e,i,n)=>"x"===t?e:"r"===t?n:i,s=e.xAxisID=v(i.xAxisID,Mi(t,"x")),r=e.yAxisID=v(i.yAxisID,Mi(t,"y")),o=e.rAxisID=v(i.rAxisID,Mi(t,"r")),a=e.indexAxis,l=e.iAxisID=n(a,s,r,o),c=e.vAxisID=n(a,r,s,o);e.xScale=this.getScaleForId(s),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(o),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&_e(this._data,this),t._stacked&&Oi(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(b(e))this._data=function(t){const e=Object.keys(t),i=new Array(e.length);let n,s,r;for(n=0,s=e.length;n{const e="_onData"+A(t),i=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...t){const s=i.apply(this,t);return n._chartjs.listeners.forEach(i=>{"function"==typeof i[e]&&i[e](...t)}),s}})}))),this._syncList=[],this._data=e}var n}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let n=!1;this._dataCheck();const s=e._stacked;e._stacked=yi(e.vScale,e),e.stack!==i.stack&&(n=!0,Oi(e),e.stack=i.stack),this._resyncElements(t),(n||s!==e._stacked)&&wi(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:n}=this,{iScale:s,_stacked:r}=i,o=s.axis;let a,l,c,h=0===t&&e===n.length||i._sorted,d=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=n,i._sorted=!0,c=n;else{c=m(n[t])?this.parseArrayData(i,n,t,e):b(n[t])?this.parseObjectData(i,n,t,e):this.parsePrimitiveData(i,n,t,e);const s=()=>null===l[o]||d&&l[o]t&&!e.hidden&&e._stacked&&{keys:bi(i,!0),values:null})(e,i,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:h}=function(t){const{min:e,max:i,minDefined:n,maxDefined:s}=t.getUserBounds();return{min:n?e:Number.NEGATIVE_INFINITY,max:s?i:Number.POSITIVE_INFINITY}}(o);let d,u;function f(){u=n[d];const e=u[o.axis];return!x(u[t.axis])||c>e||h=0;--d)if(!f()){this.updateRangeFromParsed(l,t,u,a);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let n,s,r;for(n=0,s=e.length;n=0&&tthis.getContext(i,n),h);return f.$shared&&(f.$shared=a,s[r]=Object.freeze(Si(f,a))),f}_resolveAnimations(t,e,i){const n=this.chart,s=this._cachedDataOpts,r="animation-"+e,o=s[r];if(o)return o;let a;if(!1!==n.options.animation){const n=this.chart.config,s=n.datasetAnimationScopeKeys(this._type,e),r=n.getOptionScopes(this.getDataset(),s);a=n.createResolver(r,this.getContext(t,i,e))}const l=new pi(n,a&&a.animations);return a&&a._cacheable&&(s[r]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||ki(t)||this.chart._animationsDisabled}updateElement(t,e,i,n){ki(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!ki(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;const s=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(s)||s})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];const n=i.length,s=e.length,r=Math.min(s,n);r&&this.parse(0,r),s>n?this._insertElements(n,s-n,t):s{for(t.length+=e,o=t.length-1;o>=r;o--)t[o]=t[o-e]};for(a(s),o=t;ot-e))}return t._cache.$bar}(e,t.type);let n,s,r,o,a=e._length;const l=()=>{32767!==r&&-32768!==r&&(L(o)&&(a=Math.min(a,Math.abs(r-o)||a)),o=r)};for(n=0,s=i.length;nMath.abs(a)&&(l=a,c=o),e[i.axis]=c,e._custom={barStart:l,barEnd:c,start:s,end:r,min:o,max:a}}(t,e,i,n):e[i.axis]=i.parse(t,n),e}function Ti(t,e,i,n){const s=t.iScale,r=t.vScale,o=s.getLabels(),a=s===r,l=[];let c,h,d,u;for(c=i,h=i+n;ct.x,i="left",n="right"):(e=t.base=i?1:-1)}(h,e,r)*s,d===r&&(m-=h/2),c=m+h),m===e.getPixelForValue(r)){const t=$(h)*e.getLineWidthForValue(r)/2;m+=t,h-=t}return{size:h,base:m,head:c,center:c+h/2}}_calculateBarIndexPixels(t,e){const i=e.scale,n=this.options,s=n.skipNull,r=v(n.maxBarThickness,1/0);let o,a;if(e.grouped){const i=s?this._getStackCount(t):e.stackCount,l="flex"===n.barThickness?function(t,e,i,n){const s=e.pixels,r=s[t];let o=t>0?s[t-1]:null,a=t=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,{xScale:i,yScale:n}=e,s=this.getParsed(t),r=i.getLabelForValue(s.x),o=n.getLabelForValue(s.y),a=s._custom;return{label:e.label,value:"("+r+", "+o+(a?", "+a:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,n){const s="reset"===n,{iScale:r,vScale:o}=this._cachedMeta,a=this.resolveDataElementOptions(e,n),l=this.getSharedOptions(a),c=this.includeOptions(n,l),h=r.axis,d=o.axis;for(let a=e;a""}}}};class Ii extends Di{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,n=this._cachedMeta;if(!1===this._parsing)n._parsed=i;else{let s,r,o=t=>+i[t];if(b(i[t])){const{key:t="value"}=this._parsing;o=e=>+j(i[e],t)}for(s=t,r=t+e;sst(t,a,l,!0)?1:Math.max(e,e*i,n,n*i),g=(t,e,n)=>st(t,a,l,!0)?-1:Math.min(e,e*i,n,n*i),p=f(0,c,d),m=f(B,h,u),b=g(z,c,d),x=g(z+B,h,u);n=(p-b)/2,s=(m-x)/2,r=-(p+b)/2,o=-(m+x)/2}return{ratioX:n,ratioY:s,offsetX:r,offsetY:o}}(u,d,a),b=(i.width-r)/f,x=(i.height-r)/g,y=Math.max(Math.min(b,x)/2,0),v=_(this.options.radius,y),w=(v-Math.max(v*a,0))/this._getVisibleDatasetWeightTotal();this.offsetX=p*v,this.offsetY=m*v,n.total=this.calculateTotal(),this.outerRadius=v-w*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-w*h,0),this.updateElements(s,0,s.length,t)}_circumference(t,e){const i=this.options,n=this._cachedMeta,s=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===n._parsed[t]||n.data[t].hidden?0:this.calculateCircumference(n._parsed[t]*s/I)}updateElements(t,e,i,n){const s="reset"===n,r=this.chart,o=r.chartArea,a=r.options.animation,l=(o.left+o.right)/2,c=(o.top+o.bottom)/2,h=s&&a.animateScale,d=h?0:this.innerRadius,u=h?0:this.outerRadius,f=this.resolveDataElementOptions(e,n),g=this.getSharedOptions(f),p=this.includeOptions(n,g);let m,b=this._getRotation();for(m=0;m0&&!isNaN(t)?I*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],s=ni(e._parsed[t],i.options.locale);return{label:n[t]||"",value:s}}getMaxBorderWidth(t){let e=0;const i=this.chart;let n,s,r,o,a;if(!t)for(n=0,s=i.data.datasets.length;n"spacing"!==t,_indexable:t=>"spacing"!==t},Ii.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map((e,n)=>{const s=t.getDatasetMeta(0).controller.getStyle(n);return{text:e,fillStyle:s.backgroundColor,strokeStyle:s.borderColor,lineWidth:s.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label(t){let e=t.label;const i=": "+t.formattedValue;return m(e)?(e=e.slice(),e[0]+=i):e+=i,e}}}}};class Ni extends Di{initialize(){this.enableOptionSharing=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:n=[],_dataset:s}=e,r=this.chart._animationsDisabled;let{start:o,count:a}=function(t,e,i){const n=e.length;let s=0,r=n;if(t._sorted){const{iScale:o,_parsed:a}=t,l=o.axis,{min:c,max:h,minDefined:d,maxDefined:u}=o.getUserBounds();d&&(s=rt(Math.min(xe(a,o.axis,c).lo,i?n:xe(e,l,o.getPixelForValue(c)).lo),0,n-1)),r=u?rt(Math.max(xe(a,o.axis,h).hi+1,i?0:xe(e,l,o.getPixelForValue(h)).hi+1),s,n)-s:n-s}return{start:s,count:r}}(e,n,r);this._drawStart=o,this._drawCount=a,function(t){const{xScale:e,yScale:i,_scaleRanges:n}=t,s={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!n)return t._scaleRanges=s,!0;const r=n.xmin!==e.min||n.xmax!==e.max||n.ymin!==i.min||n.ymax!==i.max;return Object.assign(n,s),r}(e)&&(o=0,a=n.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!s._decimated,i.points=n;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!r,options:l},t),this.updateElements(n,o,a,t)}updateElements(t,e,i,n){const s="reset"===n,{iScale:r,vScale:o,_stacked:a,_dataset:l}=this._cachedMeta,c=this.resolveDataElementOptions(e,n),h=this.getSharedOptions(c),d=this.includeOptions(n,h),u=r.axis,f=o.axis,{spanGaps:g,segment:m}=this.options,b=q(g)?g:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||s||"none"===n;let y=e>0&&this.getParsed(e-1);for(let c=e;c0&&i[u]-y[u]>b,m&&(g.parsed=i,g.raw=l.data[c]),d&&(g.options=h||this.resolveDataElementOptions(c,e.active?"active":n)),x||this.updateElement(e,c,g,n),y=i}this.updateSharedOptions(h,n,c)}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return i;const s=n[0].size(this.resolveDataElementOptions(0)),r=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,s,r)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}Ni.id="line",Ni.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},Ni.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class Vi extends Di{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],s=ni(e._parsed[t].r,i.options.locale);return{label:n[t]||"",value:s}}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),s=Math.max(n/2,0),r=(s-Math.max(i.cutoutPercentage?s/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=s-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(t,e,i,n){const s="reset"===n,r=this.chart,o=this.getDataset(),a=r.options.animation,l=this._cachedMeta.rScale,c=l.xCenter,h=l.yCenter,d=l.getIndexAngle(0)-.5*z;let u,f=d;const g=360/this.countVisibleElements();for(u=0;u{!isNaN(t.data[n])&&this.chart.getDataVisibility(n)&&i++}),i}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?K(this.resolveDataElementOptions(t,e).angle||i):0}}Vi.id="polarArea",Vi.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},Vi.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map((e,n)=>{const s=t.getDatasetMeta(0).controller.getStyle(n);return{text:e,fillStyle:s.backgroundColor,strokeStyle:s.borderColor,lineWidth:s.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label:t=>t.chart.data.labels[t.dataIndex]+": "+t.formattedValue}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class Wi extends Ii{}Wi.id="pie",Wi.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Bi extends Di{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}update(t){const e=this._cachedMeta,i=e.dataset,n=e.data||[],s=e.iScale.getLabels();if(i.points=n,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const r={_loop:!0,_fullLoop:s.length===n.length,options:e};this.updateElement(i,void 0,r,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,i,n){const s=this.getDataset(),r=this._cachedMeta.rScale,o="reset"===n;for(let a=e;a"",label:t=>"("+t.label+", "+t.formattedValue+")"}}},scales:{x:{type:"linear"},y:{type:"linear"}}};class Yi{constructor(t){this.options=t||{}}formats(){return Ui()}parse(t,e){return Ui()}format(t,e){return Ui()}add(t,e,i){return Ui()}diff(t,e,i){return Ui()}startOf(t,e,i){return Ui()}endOf(t,e){return Ui()}}Yi.override=function(t){Object.assign(Yi.prototype,t)};var $i={_date:Yi};function Xi(t,e){return"native"in t?{x:t.x,y:t.y}:qe(t,e)}function qi(t,e,i,n){const{controller:s,data:r,_sorted:o}=t,a=s._cachedMeta.iScale;if(a&&e===a.axis&&"r"!==e&&o&&r.length){const t=a._reversePixels?ye:xe;if(!n)return t(r,e,i);if(s._sharedOptions){const n=r[0],s="function"==typeof n.getRange&&n.getRange(e);if(s){const n=t(r,e,i-s),o=t(r,e,i+s);return{lo:n.lo,hi:o.hi}}}}return{lo:0,hi:r.length-1}}function Gi(t,e,i,n,s){const r=t.getSortedVisibleDatasetMetas(),o=i[e];for(let t=0,i=r.length;t{t[a](s[o],n)&&r.push({element:t,datasetIndex:e,index:i}),t.inRange(s.x,s.y,n)&&(l=!0)}),i.intersect&&!l?[]:r}var Ji={modes:{index(t,e,i,n){const s=Xi(e,t),r=i.axis||"x",o=i.intersect?Qi(t,s,r,n):Ki(t,s,r,!1,n),a=[];return o.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{const e=o[0].index,i=t.data[e];i&&!i.skip&&a.push({element:i,datasetIndex:t.index,index:e})}),a):[]},dataset(t,e,i,n){const s=Xi(e,t),r=i.axis||"xy";let o=i.intersect?Qi(t,s,r,n):Ki(t,s,r,!1,n);if(o.length>0){const e=o[0].datasetIndex,i=t.getDatasetMeta(e).data;o=[];for(let t=0;tQi(t,Xi(e,t),i.axis||"xy",n),nearest:(t,e,i,n)=>Ki(t,Xi(e,t),i.axis||"xy",i.intersect,n),x:(t,e,i,n)=>Zi(t,e,{axis:"x",intersect:i.intersect},n),y:(t,e,i,n)=>Zi(t,e,{axis:"y",intersect:i.intersect},n)}};const tn=["left","top","right","bottom"];function en(t,e){return t.filter(t=>t.pos===e)}function nn(t,e){return t.filter(t=>-1===tn.indexOf(t.pos)&&t.box.axis===e)}function sn(t,e){return t.sort((t,i)=>{const n=e?i:t,s=e?t:i;return n.weight===s.weight?n.index-s.index:n.weight-s.weight})}function rn(t,e,i,n){return Math.max(t[i],e[i])+Math.max(t[n],e[n])}function on(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function an(t,e,i,n){const{pos:s,box:r}=i,o=t.maxPadding;if(!b(s)){i.size&&(t[s]-=i.size);const e=n[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?r.height:r.width),i.size=e.size/e.count,t[s]+=i.size}r.getPadding&&on(o,r.getPadding());const a=Math.max(0,e.outerWidth-rn(o,t,"left","right")),l=Math.max(0,e.outerHeight-rn(o,t,"top","bottom")),c=a!==t.w,h=l!==t.h;return t.w=a,t.h=l,i.horizontal?{same:c,other:h}:{same:h,other:c}}function ln(t,e){const i=e.maxPadding;return function(t){const n={left:0,top:0,right:0,bottom:0};return t.forEach(t=>{n[t]=Math.max(e[t],i[t])}),n}(t?["left","right"]:["top","bottom"])}function cn(t,e,i,n){const s=[];let r,o,a,l,c,h;for(r=0,o=t.length,c=0;rt.box.fullSize),!0),n=sn(en(e,"left"),!0),s=sn(en(e,"right")),r=sn(en(e,"top"),!0),o=sn(en(e,"bottom")),a=nn(e,"x"),l=nn(e,"y");return{fullSize:i,leftAndTop:n.concat(r),rightAndBottom:s.concat(l).concat(o).concat(a),chartArea:en(e,"chartArea"),vertical:n.concat(s).concat(l),horizontal:r.concat(o).concat(a)}}(t.boxes),l=a.vertical,c=a.horizontal;M(t.boxes,t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()});const h=l.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1,d=Object.freeze({outerWidth:e,outerHeight:i,padding:s,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/h,hBoxMaxHeight:o/2}),u=Object.assign({},s);on(u,fe(n));const f=Object.assign({maxPadding:u,w:r,h:o,x:s.left,y:s.top},s),g=function(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:n,stackWeight:s}=i;if(!t||!tn.includes(n))continue;const r=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=s}return e}(t),{vBoxMaxWidth:n,hBoxMaxHeight:s}=e;let r,o,a;for(r=0,o=t.length;r{const i=e.box;Object.assign(i,t.chartArea),i.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class fn{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}isAttached(t){return!0}updateConfig(t){}}class gn extends fn{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const pn={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},mn=t=>null===t||""===t,bn=!!Ke&&{passive:!0};function xn(t,e,i){t.canvas.removeEventListener(e,i,bn)}function yn(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function vn(t,e,i){const n=t.canvas,s=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||yn(i.addedNodes,n),e=e&&!yn(i.removedNodes,n);e&&i()});return s.observe(document,{childList:!0,subtree:!0}),s}function wn(t,e,i){const n=t.canvas,s=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||yn(i.removedNodes,n),e=e&&!yn(i.addedNodes,n);e&&i()});return s.observe(document,{childList:!0,subtree:!0}),s}const Mn=new Map;let On=0;function kn(){const t=window.devicePixelRatio;t!==On&&(On=t,Mn.forEach((e,i)=>{i.currentDevicePixelRatio!==t&&e()}))}function Sn(t,e,i){const n=t.canvas,s=n&&He(n);if(!s)return;const r=d((t,e)=>{const n=s.clientWidth;i(t,e),n{const e=t[0],i=e.contentRect.width,n=e.contentRect.height;0===i&&0===n||r(i,n)});return o.observe(s),function(t,e){Mn.size||window.addEventListener("resize",kn),Mn.set(t,e)}(t,r),o}function Dn(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){Mn.delete(t),Mn.size||window.removeEventListener("resize",kn)}(t)}function Pn(t,e,i){const n=t.canvas,s=d(e=>{null!==t.ctx&&i(function(t,e){const i=pn[t.type]||t.type,{x:n,y:s}=qe(t,e);return{type:i,chart:e,native:t,x:void 0!==n?n:null,y:void 0!==s?s:null}}(e,t))},t,t=>{const e=t[0];return[e,e.offsetX,e.offsetY]});return function(t,e,i){t.addEventListener(e,i,bn)}(n,e,s),s}class Cn extends fn{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,n=t.getAttribute("height"),s=t.getAttribute("width");if(t.$chartjs={initial:{height:n,width:s,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",mn(s)){const e=Ze(t,"width");void 0!==e&&(t.width=e)}if(mn(n))if(""===t.style.height)t.height=t.width/(e||2);else{const e=Ze(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e.$chartjs)return!1;const i=e.$chartjs.initial;["height","width"].forEach(t=>{const n=i[t];p(n)?e.removeAttribute(t):e.setAttribute(t,n)});const n=i.style||{};return Object.keys(n).forEach(t=>{e.style[t]=n[t]}),e.width=e.width,delete e.$chartjs,!0}addEventListener(t,e,i){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),s={attach:vn,detach:wn,resize:Sn}[e]||Pn;n[e]=s(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),n=i[e];n&&(({attach:Dn,detach:Dn,resize:Dn}[e]||xn)(t,e,n),i[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return function(t,e,i,n){const s=Ye(t),r=Xe(s,"margin"),o=Ue(s.maxWidth,t,"clientWidth")||V,a=Ue(s.maxHeight,t,"clientHeight")||V,l=function(t,e,i){let n,s;if(void 0===e||void 0===i){const r=He(t);if(r){const t=r.getBoundingClientRect(),o=Ye(r),a=Xe(o,"border","width"),l=Xe(o,"padding");e=t.width-l.width-a.width,i=t.height-l.height-a.height,n=Ue(o.maxWidth,r,"clientWidth"),s=Ue(o.maxHeight,r,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:n||V,maxHeight:s||V}}(t,e,i);let{width:c,height:h}=l;if("content-box"===s.boxSizing){const t=Xe(s,"border","width"),e=Xe(s,"padding");c-=e.width+t.width,h-=e.height+t.height}return c=Math.max(0,c-r.width),h=Math.max(0,n?Math.floor(c/n):h-r.height),c=Ge(Math.min(c,o,l.maxWidth)),h=Ge(Math.min(h,a,l.maxHeight)),c&&!h&&(h=Ge(c/2)),{width:c,height:h}}(t,e,i,n)}isAttached(t){const e=He(t);return!(!e||!e.isConnected)}}class Tn{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return q(this.x)&&q(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const n={};return t.forEach(t=>{n[t]=i[t]&&i[t].active()?i[t]._to:this[t]}),n}}Tn.defaults={},Tn.defaultRoutes=void 0;const En={values:t=>m(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";const n=this.chart.options.locale;let s,r=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(s="scientific"),r=function(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t)),i}(t,i)}const o=Y(Math.abs(r)),a=Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),ni(t,n,l)},logarithmic(t,e,i){if(0===t)return"0";const n=t/Math.pow(10,Math.floor(Y(t)));return 1===n||2===n||5===n?En.numeric.call(this,t,e,i):""}};var jn={formatters:En};function An(t,e,i,n,s){const r=v(n,0),o=Math.min(v(s,t.length),t.length);let a,l,c,h=0;for(i=Math.ceil(i),s&&(a=s-n,i=a/Math.floor(a/i)),c=r;c<0;)h++,c=Math.round(r+h*i);for(l=Math.max(r,0);le.lineWidth,tickColor:(t,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:jn.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),Xt.route("scale.ticks","color","","color"),Xt.route("scale.grid","color","","borderColor"),Xt.route("scale.grid","borderColor","","borderColor"),Xt.route("scale.title","color","","color"),Xt.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t}),Xt.describe("scales",{_fallback:"scale"}),Xt.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t});const Ln=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i;function Rn(t,e){const i=[],n=t.length/e,s=t.length;let r=0;for(;ro+1e-6)))return l}function zn(t){return t.drawTicks?t.tickLength:0}function In(t,e){if(!t.display)return 0;const i=ge(t.font,e),n=fe(t.padding);return(m(t.text)?t.text.length:1)*i.lineHeight+n.height}function Nn(t,e,i){let n=(t=>"start"===t?"left":"end"===t?"right":"center")(t);return(i&&"right"!==e||!i&&"right"===e)&&(n=(t=>"left"===t?"right":"right"===t?"left":t)(n)),n}class Vn extends Tn{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:n}=this;return t=y(t,Number.POSITIVE_INFINITY),e=y(e,Number.NEGATIVE_INFINITY),i=y(i,Number.POSITIVE_INFINITY),n=y(n,Number.NEGATIVE_INFINITY),{min:y(t,i),max:y(e,n),minDefined:x(t),maxDefined:x(e)}}getMinMax(t){let e,{min:i,max:n,minDefined:s,maxDefined:r}=this.getUserBounds();if(s&&r)return{min:i,max:n};const o=this.getMatchingVisibleMetas();for(let a=0,l=o.length;an?n:i,n=s&&i>n?i:n,{min:y(i,y(n,i)),max:y(n,y(i,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){w(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:n,grace:s,ticks:r}=this.options,o=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(t,e,i){const{min:n,max:s}=t,r=_(e,(s-n)/2),o=(t,e)=>i&&0===t?0:t+e;return{min:o(n,-Math.abs(r)),max:o(s,r)}}(this,s,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=on)return function(t,e,i,n){let s,r=0,o=i[0];for(n=Math.ceil(n),s=0;st-e).pop(),e}(n);for(let t=0,e=r.length-1;ts)return e}return Math.max(s,1)}(s,e,n);if(r>0){let t,i;const n=r>1?Math.round((a-o)/(r-1)):null;for(An(e,l,c,p(n)?0:o-n,o),t=0,i=r-1;t=s||i<=1||!this.isHorizontal())return void(this.labelRotation=n);const c=this._getLabelSizes(),h=c.widest.width,d=c.highest.height,u=rt(this.chart.width-h,0,this.maxWidth);r=t.offset?this.maxWidth/i:u/(i-1),h+6>r&&(r=u/(i-(t.offset?.5:1)),o=this.maxHeight-zn(t.grid)-e.padding-In(t.title,this.chart.options.font),a=Math.sqrt(h*h+d*d),l=Z(Math.min(Math.asin(rt((c.highest.height+6)/r,-1,1)),Math.asin(rt(o/a,-1,1))-Math.asin(rt(d/a,-1,1)))),l=Math.max(n,Math.min(s,l))),this.labelRotation=l}afterCalculateLabelRotation(){w(this.options.afterCalculateLabelRotation,[this])}beforeFit(){w(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:n,grid:s}}=this,r=this._isVisible(),o=this.isHorizontal();if(r){const r=In(n,e.options.font);if(o?(t.width=this.maxWidth,t.height=zn(s)+r):(t.height=this.maxHeight,t.width=zn(s)+r),i.display&&this.ticks.length){const{first:e,last:n,widest:s,highest:r}=this._getLabelSizes(),a=2*i.padding,l=K(this.labelRotation),c=Math.cos(l),h=Math.sin(l);if(o){const e=i.mirror?0:h*s.width+c*r.height;t.height=Math.min(this.maxHeight,t.height+e+a)}else{const e=i.mirror?0:c*s.width+h*r.height;t.width=Math.min(this.maxWidth,t.width+e+a)}this._calculatePadding(e,n,h,c)}}this._handleMargins(),o?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,n){const{ticks:{align:s,padding:r},position:o}=this.options,a=0!==this.labelRotation,l="top"!==o&&"x"===this.axis;if(this.isHorizontal()){const o=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,d=0;a?l?(h=n*t.width,d=i*e.height):(h=i*t.height,d=n*e.width):"start"===s?d=e.width:"end"===s?h=t.width:(h=t.width/2,d=e.width/2),this.paddingLeft=Math.max((h-o+r)*this.width/(this.width-o),0),this.paddingRight=Math.max((d-c+r)*this.width/(this.width-c),0)}else{let i=e.height/2,n=t.height/2;"start"===s?(i=0,n=t.height):"end"===s&&(i=e.height,n=0),this.paddingTop=i+r,this.paddingBottom=n+r}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){w(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e{const i=t.gc,n=i.length/2;let s;if(n>e){for(s=0;s({width:s[t]||0,height:r[t]||0});return{first:O(0),last:O(e-1),widest:O(_),highest:O(w),widths:s,heights:r}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return rt(this._alignToPixels?Qt(this.chart,e,0):e,-32768,32767)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&to*n?o/i:a/n:a*n0}_computeGridLineItems(t){const e=this.axis,i=this.chart,n=this.options,{grid:s,position:r}=n,o=s.offset,a=this.isHorizontal(),l=this.ticks.length+(o?1:0),c=zn(s),h=[],d=s.setContext(this.getContext()),u=d.drawBorder?d.borderWidth:0,f=u/2,g=function(t){return Qt(i,t,u)};let p,m,x,y,_,w,M,O,k,S,D,P;if("top"===r)p=g(this.bottom),w=this.bottom-c,O=p-f,S=g(t.top)+f,P=t.bottom;else if("bottom"===r)p=g(this.top),S=t.top,P=g(t.bottom)-f,w=p+f,O=this.top+c;else if("left"===r)p=g(this.right),_=this.right-c,M=p-f,k=g(t.left)+f,D=t.right;else if("right"===r)p=g(this.left),k=t.left,D=g(t.right)-f,_=p+f,M=this.left+c;else if("x"===e){if("center"===r)p=g((t.top+t.bottom)/2+.5);else if(b(r)){const t=Object.keys(r)[0],e=r[t];p=g(this.chart.scales[t].getPixelForValue(e))}S=t.top,P=t.bottom,w=p+f,O=w+c}else if("y"===e){if("center"===r)p=g((t.left+t.right)/2);else if(b(r)){const t=Object.keys(r)[0],e=r[t];p=g(this.chart.scales[t].getPixelForValue(e))}_=p-f,M=_-c,k=t.left,D=t.right}const C=v(n.ticks.maxTicksLimit,l),T=Math.max(1,Math.ceil(l/C));for(m=0;me.value===t);return i>=0?e.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,r;const o=(t,e,n)=>{n.width&&n.color&&(i.save(),i.lineWidth=n.width,i.strokeStyle=n.color,i.setLineDash(n.borderDash||[]),i.lineDashOffset=n.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(s=0,r=n.length;s{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:i+1,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",n=[];let s,r;for(s=0,r=e.length;s{const n=i.split("."),s=n.pop(),r=[t].concat(n).join("."),o=e[i].split("."),a=o.pop(),l=o.join(".");Xt.route(r,s,l,a)})}(e,t.defaultRoutes),t.descriptors&&Xt.describe(e,t.descriptors)}(t,r,i),this.override&&Xt.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,n=this.scope;i in e&&delete e[i],n&&i in Xt[n]&&(delete Xt[n][i],this.override&&delete Ht[i])}}var Bn=new class{constructor(){this.controllers=new Wn(Di,"datasets",!0),this.elements=new Wn(Tn,"elements"),this.plugins=new Wn(Object,"plugins"),this.scales=new Wn(Vn,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(e=>{const n=i||this._getRegistryForType(e);i||n.isForType(e)||n===this.plugins&&e.id?this._exec(t,n,e):M(e,e=>{const n=i||this._getRegistryForType(e);this._exec(t,n,e)})})}_exec(t,e,i){const n=A(t);w(i["before"+n],[],i),e[t](i),w(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;et.filter(t=>!e.some(e=>t.plugin.id===e.plugin.id));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}}function Un(t,e){return e||!1!==t?!0===t?{}:t:null}function Yn(t,e,i,n){const s=t.pluginScopeKeys(e),r=t.getOptionScopes(i,s);return t.createResolver(r,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function $n(t,e){const i=Xt.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function Xn(t,e){return"x"===t||"y"===t?t:e.axis||("top"===(i=e.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0)||t.charAt(0).toLowerCase();var i}function qn(t){const e=t.options||(t.options={});e.plugins=v(e.plugins,{}),e.scales=function(t,e){const i=Ht[t.type]||{scales:{}},n=e.scales||{},s=$n(t.type,e),r=Object.create(null),o=Object.create(null);return Object.keys(n).forEach(t=>{const e=n[t];if(!b(e))return console.error("Invalid scale configuration for scale: "+t);if(e._proxy)return console.warn("Ignoring resolver passed as options for scale: "+t);const a=Xn(t,e),l=function(t,e){return t===e?"_index_":"_value_"}(a,s),c=i.scales||{};r[a]=r[a]||t,o[t]=C(Object.create(null),[{axis:a},e,c[a],c[l]])}),t.data.datasets.forEach(i=>{const s=i.type||t.type,a=i.indexAxis||$n(s,e),l=(Ht[s]||{}).scales||{};Object.keys(l).forEach(t=>{const e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,a),s=i[e+"AxisID"]||r[e]||e;o[s]=o[s]||Object.create(null),C(o[s],[{axis:e},n[s],l[t]])})}),Object.keys(o).forEach(t=>{const e=o[t];C(e,[Xt.scales[e.type],Xt.scale])}),o}(t,e)}function Gn(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const Qn=new Map,Kn=new Set;function Zn(t,e){let i=Qn.get(t);return i||(i=e(),Qn.set(t,i),Kn.add(i)),i}const Jn=(t,e,i)=>{const n=j(e,i);void 0!==n&&t.add(n)};class ts{constructor(t){this._config=function(t){return(t=t||{}).data=Gn(t.data),qn(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Gn(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),qn(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Zn(t,()=>[["datasets."+t,""]])}datasetAnimationScopeKeys(t,e){return Zn(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,"transitions."+e],["datasets."+t,""]])}datasetElementScopeKeys(t,e){return Zn(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,"datasets."+t,"elements."+e,""]])}pluginScopeKeys(t){const e=t.id;return Zn(`${this.type}-plugin-${e}`,()=>[["plugins."+e,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let n=i.get(t);return n&&!e||(n=new Map,i.set(t,n)),n}getOptionScopes(t,e,i){const{options:n,type:s}=this,r=this._cachedScopes(t,i),o=r.get(e);if(o)return o;const a=new Set;e.forEach(e=>{t&&(a.add(t),e.forEach(e=>Jn(a,t,e))),e.forEach(t=>Jn(a,n,t)),e.forEach(t=>Jn(a,Ht[s]||{},t)),e.forEach(t=>Jn(a,Xt,t)),e.forEach(t=>Jn(a,Ut,t))});const l=Array.from(a);return 0===l.length&&l.push(Object.create(null)),Kn.has(e)&&r.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,Ht[e]||{},Xt.datasets[e]||{},{type:e},Xt,Ut]}resolveNamedOptions(t,e,i,n=[""]){const s={$shared:!0},{resolver:r,subPrefixes:o}=es(this._resolverCache,t,n);let a=r;(function(t,e){const{isScriptable:i,isIndexable:n}=ke(t);for(const s of e){const e=i(s),r=n(s),o=(r||e)&&t[s];if(e&&(R(o)||is(o))||r&&m(o))return!0}return!1})(r,e)&&(s.$shared=!1,a=Oe(r,i=R(i)?i():i,this.createResolver(t,i,o)));for(const t of e)s[t]=a[t];return s}createResolver(t,e,i=[""],n){const{resolver:s}=es(this._resolverCache,t,i);return b(e)?Oe(s,e,void 0,n):s}}function es(t,e,i){let n=t.get(e);n||(n=new Map,t.set(e,n));const s=i.join();let r=n.get(s);return r||(r={resolver:Me(e,i),subPrefixes:i.filter(t=>!t.toLowerCase().includes("hover"))},n.set(s,r)),r}const is=t=>b(t)&&Object.getOwnPropertyNames(t).reduce((e,i)=>e||R(t[i]),!1),ns=["top","bottom","left","right","chartArea"];function ss(t,e){return"top"===t||"bottom"===t||-1===ns.indexOf(t)&&"x"===e}function rs(t,e){return function(i,n){return i[t]===n[t]?i[e]-n[e]:i[t]-n[t]}}function os(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),w(i&&i.onComplete,[t],e)}function as(t){const e=t.chart,i=e.options.animation;w(i&&i.onProgress,[t],e)}function ls(t){return Be()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const cs={},hs=t=>{const e=ls(t);return Object.values(cs).filter(t=>t.canvas===e).pop()};function ds(t,e,i){const n=Object.keys(t);for(const s of n){const n=+s;if(n>=e){const r=t[s];delete t[s],(i>0||n>e)&&(t[n+i]=r)}}}class us{constructor(t,e){const i=this.config=new ts(e),n=ls(t),s=hs(n);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas can be reused.");const r=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||function(t){return!Be()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?gn:Cn}(n)),this.platform.updateConfig(i);const o=this.platform.acquireContext(n,r.aspectRatio),a=o&&o.canvas,l=a&&a.height,c=a&&a.width;this.id=g(),this.ctx=o,this.canvas=a,this.width=c,this.height=l,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Hn,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let i;return function(...n){return e?(clearTimeout(i),i=setTimeout(t,e,n)):t.apply(this,n),e}}(t=>this.update(t),r.resizeDelay||0),this._dataChanges=[],cs[this.id]=this,o&&a?(di.listen(this,"complete",os),di.listen(this,"progress",as),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:s}=this;return p(t)?e&&s?s:n?i/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Qe(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Kt(this.canvas,this.ctx),this}stop(){return di.stop(this),this}resize(t,e){di.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,n=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(n,t,e,s),o=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,Qe(this,o,!0)&&(this.notifyPlugins("resize",{size:r}),w(i.onResize,[this,r],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){M(this.options.scales||{},(t,e)=>{t.id=e})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,n=Object.keys(i).reduce((t,e)=>(t[e]=!1,t),{});let s=[];e&&(s=s.concat(Object.keys(e).map(t=>{const i=e[t],n=Xn(t,i),s="r"===n,r="x"===n;return{options:i,dposition:s?"chartArea":r?"bottom":"left",dtype:s?"radialLinear":r?"category":"linear"}}))),M(s,e=>{const s=e.options,r=s.id,o=Xn(r,s),a=v(s.type,e.dtype);void 0!==s.position&&ss(s.position,o)===ss(e.dposition)||(s.position=e.dposition),n[r]=!0;let l=null;r in i&&i[r].type===a?l=i[r]:(l=new(Bn.getScale(a))({id:r,type:a,ctx:this.ctx,chart:this}),i[l.id]=l),l.init(s,t)}),M(n,(t,e)=>{t||delete i[e]}),M(i,t=>{un.configure(this,t,t.options),un.addBox(this,t)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((t,e)=>t.index-e.index),i>e){for(let t=e;te.length&&delete this._stacks,t.forEach((t,i)=>{0===e.filter(e=>e===t._dataset).length&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,n;for(this._removeUnreferencedMetasets(),i=0,n=e.length;i{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let t=0,e=this.data.datasets.length;t{t.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(rs("z","_idx"));const{_active:o,_lastEvent:a}=this;a?this._eventHandler(a,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){M(this.scales,t=>{un.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);F(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:n,count:s}of e)ds(t,n,"_removeElements"===i?-s:s)}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter(t=>t[0]===e).map((t,e)=>e+","+t.splice(1).join(","))),n=i(0);for(let t=1;tt.split(",")).map(t=>({method:t[1],start:+t[2],count:+t[3]}))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;un.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],M(this.boxes,t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))},this),this._layers.forEach((t,e)=>{t._idx=e}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,n=!i.disabled,s=this.chartArea,r={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",r)&&(n&&te(e,{left:!1===i.left?0:s.left-i.left,right:!1===i.right?this.width:s.right+i.right,top:!1===i.top?0:s.top-i.top,bottom:!1===i.bottom?this.height:s.bottom+i.bottom}),t.controller.draw(),n&&ee(e),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}getElementsAtEventForMode(t,e,i,n){const s=Ji.modes[e];return"function"==typeof s?s(this,t,i,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let n=i.filter(t=>t&&t._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(n)),n}getContext(){return this.$context||(this.$context=me(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const n=i?"show":"hide",s=this.getDatasetMeta(t),r=s.controller._resolveAnimations(void 0,n);L(e)?(s.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),r.update(s,{visible:i}),this.update(e=>e.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),di.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,i,n),t[i]=n},n=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};M(this.options.events,t=>i(t,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,n)=>{e.addEventListener(this,i,n),t[i]=n},n=(i,n)=>{t[i]&&(e.removeEventListener(this,i,n),delete t[i])},s=(t,e)=>{this.canvas&&this.resize(t,e)};let r;const o=()=>{n("attach",o),this.attached=!0,this.resize(),i("resize",s),i("detach",r)};r=()=>{this.attached=!1,n("resize",s),this._stop(),this._resize(0,0),i("attach",o)},e.isAttached(this.canvas)?o():r()}unbindEvents(){M(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},M(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const n=i?"set":"remove";let s,r,o,a;for("dataset"===e&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+n+"DatasetHoverStyle"]()),o=0,a=t.length;o{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}});!O(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}_updateHoverStyles(t,e,i){const n=this.options.hover,s=(t,e)=>t.filter(t=>!e.some(e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)),r=s(e,t),o=i?t:s(t,e);r.length&&this.updateHoverStyle(r,n.mode,!1),o.length&&n.mode&&this.updateHoverStyle(o,n.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:Jt(t,this.chartArea,this._minPadding)},n=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,n))return;const s=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(s||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:n=[],options:s}=this,r=e,o=this._getActiveElements(t,n,i,r),a=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}(t),l=function(t,e,i,n){return i&&"mouseout"!==t.type?n?e:t:null}(t,this._lastEvent,i,a);i&&(this._lastEvent=null,w(s.onHover,[t,o,this],this),a&&w(s.onClick,[t,o,this],this));const c=!O(o,n);return(c||e)&&(this._active=o,this._updateHoverStyles(o,n,e)),this._lastEvent=l,c}_getActiveElements(t,e,i,n){if("mouseout"===t.type)return[];if(!i)return e;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,n)}}const fs=()=>M(us.instances,t=>t._plugins.invalidate());function gs(t,e,i){const{startAngle:n,pixelMargin:s,x:r,y:o,outerRadius:a,innerRadius:l}=e;let c=s/a;t.beginPath(),t.arc(r,o,a,n-c,i+c),l>s?(c=s/l,t.arc(r,o,l,i+c,n-c,!0)):t.arc(r,o,s,i+B,n-B),t.closePath(),t.clip()}function ps(t,e,i,n){return{x:i+t*Math.cos(e),y:n+t*Math.sin(e)}}function ms(t,e,i,n,s){const{x:r,y:o,startAngle:a,pixelMargin:l,innerRadius:c}=e,h=Math.max(e.outerRadius+n+i-l,0),d=c>0?c+n+i+l:0;let u=0;const f=s-a;if(n){const t=((c>0?c-n:0)+(h>0?h-n:0))/2;u=(f-(0!==t?f*t/(t+n):f))/2}const g=(f-Math.max(.001,f*h-i/z)/h)/2,p=a+g+u,m=s-g-u,{outerStart:b,outerEnd:x,innerStart:y,innerEnd:v}=function(t,e,i,n){const s=he(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]),r=(i-e)/2,o=Math.min(r,n*e/2),a=t=>{const e=(i-Math.min(r,t))*n/2;return rt(t,0,Math.min(r,e))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:rt(s.innerStart,0,o),innerEnd:rt(s.innerEnd,0,o)}}(e,d,h,m-p),_=h-b,w=h-x,M=p+b/_,O=m-x/w,k=d+y,S=d+v,D=p+y/k,P=m-v/S;if(t.beginPath(),t.arc(r,o,h,M,O),x>0){const e=ps(w,O,r,o);t.arc(e.x,e.y,x,O,m+B)}const C=ps(S,m,r,o);if(t.lineTo(C.x,C.y),v>0){const e=ps(S,P,r,o);t.arc(e.x,e.y,v,m+B,P+Math.PI)}if(t.arc(r,o,d,m-v/d,p+y/d,!0),y>0){const e=ps(k,D,r,o);t.arc(e.x,e.y,y,D+Math.PI,p-B)}const T=ps(_,p,r,o);if(t.lineTo(T.x,T.y),b>0){const e=ps(_,M,r,o);t.arc(e.x,e.y,b,p-B,M)}t.closePath()}Object.defineProperties(us,{defaults:{enumerable:!0,value:Xt},instances:{enumerable:!0,value:cs},overrides:{enumerable:!0,value:Ht},registry:{enumerable:!0,value:Bn},version:{enumerable:!0,value:"3.7.1"},getChart:{enumerable:!0,value:hs},register:{enumerable:!0,value:(...t)=>{Bn.add(...t),fs()}},unregister:{enumerable:!0,value:(...t)=>{Bn.remove(...t),fs()}}});class bs extends Tn{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.getProps(["x","y"],i),{angle:s,distance:r}=tt(n,{x:t,y:e}),{startAngle:o,endAngle:a,innerRadius:l,outerRadius:c,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),d=this.options.spacing/2,u=v(h,a-o)>=I||st(s,o,a),f=ot(r,l+d,c+d);return u&&f}getCenterPoint(t){const{x:e,y:i,startAngle:n,endAngle:s,innerRadius:r,outerRadius:o}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:a,spacing:l}=this.options,c=(n+s)/2,h=(r+o+l+a)/2;return{x:e+Math.cos(c)*h,y:i+Math.sin(c)*h}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,n=(e.offset||0)/2,s=(e.spacing||0)/2;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>I?Math.floor(i/I):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();let r=0;if(n){r=n/2;const e=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(e)*r,Math.sin(e)*r),this.circumference>=z&&(r=n)}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;const o=function(t,e,i,n){const{fullCircles:s,startAngle:r,circumference:o}=e;let a=e.endAngle;if(s){ms(t,e,i,n,r+I);for(let e=0;ea&&r>a;return{count:n,start:l,loop:e.loop,ilen:c(o+(c?a-t:t))%r,y=()=>{f!==g&&(t.lineTo(m,g),t.lineTo(m,f),t.lineTo(m,p))};for(l&&(d=s[x(0)],t.moveTo(d.x,d.y)),h=0;h<=a;++h){if(d=s[x(h)],d.skip)continue;const e=d.x,i=d.y,n=0|e;n===u?(ig&&(g=i),m=(b*m+e)/++b):(y(),t.lineTo(e,i),u=n,b=0,f=g=i),p=i}y()}function Ms(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i?_s:ws}bs.id="arc",bs.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0},bs.defaultRoutes={backgroundColor:"backgroundColor"};const Os="function"==typeof Path2D;class ks extends Tn{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const n=i.spanGaps?this._loop:this._fullLoop;We(this._points,i,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(t,e){const i=t.points,n=t.options.spanGaps,s=i.length;if(!s)return[];const r=!!t._loop,{start:o,end:a}=function(t,e,i,n){let s=0,r=e-1;if(i&&!n)for(;ss&&t[r%e].skip;)r--;return r%=e,{start:s,end:r}}(i,s,r,n);return function(t,e,i,n){return n&&n.setContext&&i?function(t,e,i,n){const s=t._chart.getContext(),r=ci(t.options),{_datasetIndex:o,options:{spanGaps:a}}=t,l=i.length,c=[];let h=r,d=e[0].start,u=d;function f(t,e,n,s){const r=a?-1:1;if(t!==e){for(t+=l;i[t%l].skip;)t-=r;for(;i[e%l].skip;)e+=r;t%l!=e%l&&(c.push({start:t%l,end:e%l,loop:n,style:s}),h=s,d=e%l)}}for(const t of e){d=a?d:t.start;let e,r=i[d%l];for(u=d+1;u<=t.end;u++){const a=i[u%l];e=ci(n.setContext(me(s,{type:"segment",p0:r,p1:a,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:o}))),hi(e,h)&&f(d,u-1,t.loop,h),r=a,h=e}d"borderDash"!==t&&"fill"!==t};class Ds extends Tn{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.options,{x:s,y:r}=this.getProps(["x","y"],i);return Math.pow(t-s,2)+Math.pow(e-r,2)=i)&&s):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}As.id="bar",As.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0},As.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};class Rs{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:n,y:s,radius:r}=this;return e=e||{start:0,end:I},t.arc(n,s,r,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:n}=this,s=t.angle;return{x:e+Math.cos(s)*n,y:i+Math.sin(s)*n,angle:s}}}function Fs(t,e,i){for(;e>t;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function zs(t,e,i){const n=[];for(let s=0;s{e=Fs(t,e,s);const o=s[t],a=s[e];null!==n?(r.push({x:o.x,y:n}),r.push({x:a.x,y:n})):null!==i&&(r.push({x:i,y:o.y}),r.push({x:i,y:a.y}))}),r}(t,e),i.length?new ks({points:i,options:{tension:0},_loop:n,_fullLoop:n}):null}function Ws(t,e,i){let n=t[e].fill;const s=[e];let r;if(!i)return n;for(;!1!==n&&-1===s.indexOf(n);){if(!x(n))return n;if(r=t[n],!r)return!1;if(r.visible)return n;s.push(n),n=r.fill}return!1}function Bs(t,e,i){const{segments:n,points:s}=e;let r=!0,o=!1;t.beginPath();for(const a of n){const{start:n,end:l}=a,c=s[n],h=s[Fs(n,l,s)];r?(t.moveTo(c.x,c.y),r=!1):(t.lineTo(c.x,i),t.lineTo(c.x,c.y)),o=!!e.pathSegment(t,a,{move:o}),o?t.closePath():t.lineTo(h.x,i)}t.lineTo(e.first().x,i),t.closePath(),t.clip()}function Hs(t,e,i,n){if(n)return;let s=e[t],r=i[t];return"angle"===t&&(s=nt(s),r=nt(r)),{property:t,start:s,end:r}}function Us(t,e,i,n){return t&&e?n(t[i],e[i]):t?t[i]:e?e[i]:0}function Ys(t,e,i){const{top:n,bottom:s}=e.chart.chartArea,{property:r,start:o,end:a}=i||{};"x"===r&&(t.beginPath(),t.rect(o,n,a-o,s-n),t.clip())}function $s(t,e,i,n){const s=e.interpolate(i,n);s&&t.lineTo(s.x,s.y)}function Xs(t,e){const{line:i,target:n,property:s,color:r,scale:o}=e,a=function(t,e,i){const n=t.segments,s=t.points,r=e.points,o=[];for(const t of n){let{start:n,end:a}=t;a=Fs(n,a,s);const l=Hs(i,s[n],s[a],t.loop);if(!e.segments){o.push({source:t,target:l,start:s[n],end:s[a]});continue}const c=li(e,l);for(const e of c){const n=Hs(i,r[e.start],r[e.end],e.loop),a=ai(t,s,n);for(const t of a)o.push({source:t,target:e,start:{[i]:Us(l,n,"start",Math.max)},end:{[i]:Us(l,n,"end",Math.min)}})}}return o}(i,n,s);for(const{source:e,target:l,start:c,end:h}of a){const{style:{backgroundColor:a=r}={}}=e,d=!0!==n;t.save(),t.fillStyle=a,Ys(t,o,d&&Hs(s,c,h)),t.beginPath();const u=!!i.pathSegment(t,e);let f;if(d){u?t.closePath():$s(t,n,h,s);const e=!!n.pathSegment(t,l,{move:u,reverse:!0});f=u&&e,f||$s(t,n,c,s)}t.closePath(),t.fill(f?"evenodd":"nonzero"),t.restore()}}function qs(t,e,i){const n=Ns(e),{line:s,scale:r,axis:o}=e,a=s.options,l=a.fill,c=a.backgroundColor,{above:h=c,below:d=c}=l||{};n&&s.points.length&&(te(t,i),function(t,e){const{line:i,target:n,above:s,below:r,area:o,scale:a}=e,l=i._loop?"angle":e.axis;t.save(),"x"===l&&r!==s&&(Bs(t,n,o.top),Xs(t,{line:i,target:n,color:s,scale:a,property:l}),t.restore(),t.save(),Bs(t,n,o.bottom)),Xs(t,{line:i,target:n,color:r,scale:a,property:l}),t.restore()}(t,{line:s,target:n,above:h,below:d,area:i,scale:r,axis:o}),ee(t))}var Gs={id:"filler",afterDatasetsUpdate(t,e,i){const n=(t.data.datasets||[]).length,s=[];let r,o,a,l;for(o=0;o=0;--e){const i=s[e].$filler;i&&(i.line.updateControlPoints(r,i.axis),n&&qs(t.ctx,i,r))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const n=t.getSortedVisibleDatasetMetas();for(let e=n.length-1;e>=0;--e){const i=n[e].$filler;i&&qs(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){const n=e.meta.$filler;n&&!1!==n.fill&&"beforeDatasetDraw"===i.drawTime&&qs(t.ctx,n,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};new WeakMap;const Qs={average(t){if(!t.length)return!1;let e,i,n=0,s=0,r=0;for(e=0,i=t.length;e-1?t.split("\n"):t}function Js(t,e){const{element:i,datasetIndex:n,index:s}=e,r=t.getDatasetMeta(n).controller,{label:o,value:a}=r.getLabelAndValue(s);return{chart:t,label:o,parsed:r.getParsed(s),raw:t.data.datasets[n].data[s],formattedValue:a,dataset:r.getDataset(),dataIndex:s,datasetIndex:n,element:i}}function tr(t,e){const i=t.chart.ctx,{body:n,footer:s,title:r}=t,{boxWidth:o,boxHeight:a}=e,l=ge(e.bodyFont),c=ge(e.titleFont),h=ge(e.footerFont),d=r.length,u=s.length,f=n.length,g=fe(e.padding);let p=g.height,m=0,b=n.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);b+=t.beforeBody.length+t.afterBody.length,d&&(p+=d*c.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),b&&(p+=f*(e.displayColors?Math.max(a,l.lineHeight):l.lineHeight)+(b-f)*l.lineHeight+(b-1)*e.bodySpacing),u&&(p+=e.footerMarginTop+u*h.lineHeight+(u-1)*e.footerSpacing);let x=0;const y=function(t){m=Math.max(m,i.measureText(t).width+x)};return i.save(),i.font=c.string,M(t.title,y),i.font=l.string,M(t.beforeBody.concat(t.afterBody),y),x=e.displayColors?o+2+e.boxPadding:0,M(n,t=>{M(t.before,y),M(t.lines,y),M(t.after,y)}),x=0,i.font=h.string,M(t.footer,y),i.restore(),m+=g.width,{width:m,height:p}}function er(t,e,i,n){const{x:s,width:r}=i,{width:o,chartArea:{left:a,right:l}}=t;let c="center";return"center"===n?c=s<=(a+l)/2?"left":"right":s<=r/2?c="left":s>=o-r/2&&(c="right"),function(t,e,i,n){const{x:s,width:r}=n,o=i.caretSize+i.caretPadding;return"left"===t&&s+r+o>e.width||"right"===t&&s-r-o<0||void 0}(c,t,e,i)&&(c="center"),c}function ir(t,e,i){const n=i.yAlign||e.yAlign||function(t,e){const{y:i,height:n}=e;return it.height-n/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||er(t,e,i,n),yAlign:n}}function nr(t,e,i,n){const{caretSize:s,caretPadding:r,cornerRadius:o}=t,{xAlign:a,yAlign:l}=i,c=s+r,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=ue(o);let g=function(t,e){let{x:i,width:n}=t;return"right"===e?i-=n:"center"===e&&(i-=n/2),i}(e,a);const p=function(t,e,i){let{y:n,height:s}=t;return"top"===e?n+=i:n-="bottom"===e?s+i:s/2,n}(e,l,c);return"center"===l?"left"===a?g+=c:"right"===a&&(g-=c):"left"===a?g-=Math.max(h,u)+s:"right"===a&&(g+=Math.max(d,f)+s),{x:rt(g,0,n.width-e.width),y:rt(p,0,n.height-e.height)}}function sr(t,e,i){const n=fe(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-n.right:t.x+n.left}function rr(t){return Ks([],Zs(t))}function or(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}class ar extends Tn{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart||t._chart,this._chart=this.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),n=i.enabled&&e.options.animation&&i.animations,s=new pi(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=(this,me(this.chart.getContext(),{tooltip:this,tooltipItems:this._tooltipItems,type:"tooltip"})))}getTitle(t,e){const{callbacks:i}=e,n=i.beforeTitle.apply(this,[t]),s=i.title.apply(this,[t]),r=i.afterTitle.apply(this,[t]);let o=[];return o=Ks(o,Zs(n)),o=Ks(o,Zs(s)),o=Ks(o,Zs(r)),o}getBeforeBody(t,e){return rr(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){const{callbacks:i}=e,n=[];return M(t,t=>{const e={before:[],lines:[],after:[]},s=or(i,t);Ks(e.before,Zs(s.beforeLabel.call(this,t))),Ks(e.lines,s.label.call(this,t)),Ks(e.after,Zs(s.afterLabel.call(this,t))),n.push(e)}),n}getAfterBody(t,e){return rr(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){const{callbacks:i}=e,n=i.beforeFooter.apply(this,[t]),s=i.footer.apply(this,[t]),r=i.afterFooter.apply(this,[t]);let o=[];return o=Ks(o,Zs(n)),o=Ks(o,Zs(s)),o=Ks(o,Zs(r)),o}_createItems(t){const e=this._active,i=this.chart.data,n=[],s=[],r=[];let o,a,l=[];for(o=0,a=e.length;ot.filter(e,n,s,i))),t.itemSort&&(l=l.sort((e,n)=>t.itemSort(e,n,i))),M(l,e=>{const i=or(t.callbacks,e);n.push(i.labelColor.call(this,e)),s.push(i.labelPointStyle.call(this,e)),r.push(i.labelTextColor.call(this,e))}),this.labelColors=n,this.labelPointStyles=s,this.labelTextColors=r,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),n=this._active;let s,r=[];if(n.length){const t=Qs[i.position].call(this,n,this._eventPosition);r=this._createItems(i),this.title=this.getTitle(r,i),this.beforeBody=this.getBeforeBody(r,i),this.body=this.getBody(r,i),this.afterBody=this.getAfterBody(r,i),this.footer=this.getFooter(r,i);const e=this._size=tr(this,i),o=Object.assign({},t,e),a=ir(this.chart,i,o),l=nr(i,o,a,this.chart);this.xAlign=a.xAlign,this.yAlign=a.yAlign,s={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(s={opacity:0});this._tooltipItems=r,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,n){const s=this.getCaretPosition(t,i,n);e.lineTo(s.x1,s.y1),e.lineTo(s.x2,s.y2),e.lineTo(s.x3,s.y3)}getCaretPosition(t,e,i){const{xAlign:n,yAlign:s}=this,{caretSize:r,cornerRadius:o}=i,{topLeft:a,topRight:l,bottomLeft:c,bottomRight:h}=ue(o),{x:d,y:u}=t,{width:f,height:g}=e;let p,m,b,x,y,v;return"center"===s?(y=u+g/2,"left"===n?(p=d,m=p-r,x=y+r,v=y-r):(p=d+f,m=p+r,x=y-r,v=y+r),b=p):(m="left"===n?d+Math.max(a,c)+r:"right"===n?d+f-Math.max(l,h)-r:this.caretX,"top"===s?(x=u,y=x-r,p=m-r,b=m+r):(x=u+g,y=x+r,p=m+r,b=m-r),v=x),{x1:p,x2:m,x3:b,y1:x,y2:y,y3:v}}drawTitle(t,e,i){const n=this.title,s=n.length;let r,o,a;if(s){const l=si(i.rtl,this.x,this.width);for(t.x=sr(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",r=ge(i.titleFont),o=i.titleSpacing,e.fillStyle=i.titleColor,e.font=r.string,a=0;a0!==t)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,oe(t,{x:e,y:g,w:l,h:a,radius:o}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),oe(t,{x:i,y:g+1,w:l-2,h:a-2,radius:o}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(e,g,l,a),t.strokeRect(e,g,l,a),t.fillStyle=r.backgroundColor,t.fillRect(i,g+1,l-2,a-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:n}=this,{bodySpacing:s,bodyAlign:r,displayColors:o,boxHeight:a,boxWidth:l,boxPadding:c}=i,h=ge(i.bodyFont);let d=h.lineHeight,u=0;const f=si(i.rtl,this.x,this.width),g=function(i){e.fillText(i,f.x(t.x+u),t.y+d/2),t.y+=d+s},p=f.textAlign(r);let m,b,x,y,v,_,w;for(e.textAlign=r,e.textBaseline="middle",e.font=h.string,t.x=sr(this,p,i),e.fillStyle=i.bodyColor,M(this.beforeBody,g),u=o&&"right"!==p?"center"===r?l/2+c:l+2+c:0,y=0,_=n.length;y<_;++y){for(m=n[y],b=this.labelTextColors[y],e.fillStyle=b,M(m.before,g),x=m.lines,o&&x.length&&(this._drawColorBox(e,t,y,f,i),d=Math.max(h.lineHeight,a)),v=0,w=x.length;v0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,n=i&&i.x,s=i&&i.y;if(n||s){const i=Qs[t.position].call(this,this._active,this._eventPosition);if(!i)return;const r=this._size=tr(this,t),o=Object.assign({},i,this._size),a=ir(e,t,o),l=nr(t,o,a,e);n._to===l.x&&s._to===l.y||(this.xAlign=a.xAlign,this.yAlign=a.yAlign,this.width=r.width,this.height=r.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const r=fe(e.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&o&&(t.save(),t.globalAlpha=i,this.drawBackground(s,t,n,e),function(t,e){let i,n;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,n=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=n)}(t,e.textDirection),s.y+=r.top,this.drawTitle(s,t,e),this.drawBody(s,t,e),this.drawFooter(s,t,e),function(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,n=t.map(({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),s=!O(i,n),r=this._positionChanged(n,e);(s||r)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,s=this._active||[],r=this._getActiveElements(t,s,e,i),o=this._positionChanged(r,t),a=e||!O(r,s)||o;return a&&(this._active=r,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),a}_getActiveElements(t,e,i,n){const s=this.options;if("mouseout"===t.type)return[];if(!n)return e;const r=this.chart.getElementsAtEventForMode(t,s.mode,s,i);return s.reverse&&r.reverse(),r}_positionChanged(t,e){const{caretX:i,caretY:n,options:s}=this,r=Qs[s.position].call(this,t,e);return!1!==r&&(i!==r.x||n!==r.y)}}ar.positioners=Qs;var lr={id:"tooltip",_element:ar,positioners:Qs,afterInit(t,e,i){i&&(t.tooltip=new ar({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip,i={tooltip:e};!1!==t.notifyPlugins("beforeTooltipDraw",i)&&(e&&e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i))},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:f,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,n=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(n>0&&e.dataIndex"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};class cr extends Vn{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:i,label:n}of e)t[i]===n&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(p(t))return null;const i=this.getLabels();return((t,e)=>null===t?null:rt(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:function(t,e,i,n){const s=t.indexOf(e);return-1===s?((t,e,i,n)=>("string"==typeof e?(i=t.push(e)-1,n.unshift({index:i,label:e})):isNaN(e)&&(i=null),i))(t,e,i,n):s!==t.lastIndexOf(e)?i:s}(i,t,v(e,t),this._addedLabels),i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:n}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(n=this.getLabels().length-1)),this.min=i,this.max=n}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,n=[];let s=this.getLabels();s=0===t&&e===s.length-1?s:s.slice(t,e+1),this._valueRange=Math.max(s.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let i=t;i<=e;i++)n.push({value:i});return n}getLabelForValue(t){const e=this.getLabels();return t>=0&&te.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function hr(t,e,{horizontal:i,minRotation:n}){const s=K(n),r=(i?Math.sin(s):Math.cos(s))||.001,o=.75*e*(""+t).length;return Math.min(e/r,o)}cr.id="category",cr.defaults={ticks:{callback:cr.prototype.getLabelForValue}};class dr extends Vn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return p(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:n,max:s}=this;const r=t=>n=e?n:t,o=t=>s=i?s:t;if(t){const t=$(n),e=$(s);t<0&&e<0?o(0):t>0&&e>0&&r(0)}if(n===s){let e=1;(s>=Number.MAX_SAFE_INTEGER||n<=Number.MIN_SAFE_INTEGER)&&(e=Math.abs(.05*s)),o(s+e),t||r(n-e)}this.min=n,this.max=s}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:n}=t;return n?(e=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const n=function(t,e){const i=[],{bounds:n,step:s,min:r,max:o,precision:a,count:l,maxTicks:c,maxDigits:h,includeBounds:d}=t,u=s||1,f=c-1,{min:g,max:m}=e,b=!p(r),x=!p(o),y=!p(l),v=(m-g)/(h+1);let _,w,M,O,k=X((m-g)/f/u)*u;if(k<1e-14&&!b&&!x)return[{value:g},{value:m}];O=Math.ceil(m/k)-Math.floor(g/k),O>f&&(k=X(O*k/f/u)*u),p(a)||(_=Math.pow(10,a),k=Math.ceil(k*_)/_),"ticks"===n?(w=Math.floor(g/k)*k,M=Math.ceil(m/k)*k):(w=g,M=m),b&&x&&s&&function(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}((o-r)/s,k/1e3)?(O=Math.round(Math.min((o-r)/k,c)),k=(o-r)/O,w=r,M=o):y?(w=b?r:w,M=x?o:M,O=l-1,k=(M-w)/O):(O=(M-w)/k,O=G(O,Math.round(O),k/1e3)?Math.round(O):Math.ceil(O));const S=Math.max(J(k),J(w));_=Math.pow(10,p(a)?S:a),w=Math.round(w*_)/_,M=Math.round(M*_)/_;let D=0;for(b&&(d&&w!==r?(i.push({value:r}),w0?i:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=x(t)?Math.max(0,t):null,this.max=x(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,n=this.max;const s=e=>i=t?i:e,r=t=>n=e?n:t,o=(t,e)=>Math.pow(10,Math.floor(Y(t))+e);i===n&&(i<=0?(s(1),r(10)):(s(o(i,-1)),r(o(n,1)))),i<=0&&s(o(n,-1)),n<=0&&r(o(i,1)),this._zero&&this.min!==this._suggestedMin&&i===o(this.min,0)&&s(o(i,-1)),this.min=i,this.max=n}buildTicks(){const t=this.options,e=function(t,e){const i=Math.floor(Y(e.max)),n=Math.ceil(e.max/Math.pow(10,i)),s=[];let r=y(t.min,Math.pow(10,Math.floor(Y(e.min)))),o=Math.floor(Y(r)),a=Math.floor(r/Math.pow(10,o)),l=o<0?Math.pow(10,Math.abs(o)):1;do{s.push({value:r,major:fr(r)}),++a,10===a&&(a=1,++o,l=o>=0?1:l),r=Math.round(a*Math.pow(10,o)*l)/l}while(os?{start:e-i,end:e}:{start:e,end:e+i}}function br(t,e,i,n,s){const r=Math.abs(Math.sin(i)),o=Math.abs(Math.cos(i));let a=0,l=0;n.starte.r&&(a=(n.end-e.r)/r,t.r=Math.max(t.r,e.r+a)),s.starte.b&&(l=(s.end-e.b)/o,t.b=Math.max(t.b,e.b+l))}function xr(t){return 0===t||180===t?"center":t<180?"left":"right"}function yr(t,e,i){return 90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e),t}function vr(t,e,i,n){const{ctx:s}=t;if(i)s.arc(t.xCenter,t.yCenter,e,0,I);else{let i=t.getPointPosition(0,e);s.moveTo(i.x,i.y);for(let r=1;r{const i=w(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""}).filter((t,e)=>this.chart.getDataVisibility(e))}fit(){const t=this.options;t.display&&t.pointLabels.display?function(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),n=[],s=[],r=t._pointLabels.length,o=t.options.pointLabels,a=o.centerPointLabels?z/r:0;for(let d=0;d=0&&t=0;s--){const e=n.setContext(t.getPointLabelContext(s)),r=ge(e.font),{x:o,y:a,textAlign:l,left:c,top:h,right:d,bottom:u}=t._pointLabelItems[s],{backdropColor:f}=e;if(!p(f)){const t=fe(e.backdropPadding);i.fillStyle=f,i.fillRect(c-t.left,h-t.top,d-c+t.width,u-h+t.height)}se(i,t._pointLabels[s],o,a+r.lineHeight/2,r,{color:e.color,textAlign:l,textBaseline:"middle"})}}(this,s),n.display&&this.ticks.forEach((t,e)=>{0!==e&&(o=this.getDistanceFromCenterForValue(t.value),function(t,e,i,n){const s=t.ctx,r=e.circular,{color:o,lineWidth:a}=e;!r&&!n||!o||!a||i<0||(s.save(),s.strokeStyle=o,s.lineWidth=a,s.setLineDash(e.borderDash),s.lineDashOffset=e.borderDashOffset,s.beginPath(),vr(t,i,r,n),s.closePath(),s.stroke(),s.restore())}(this,n.setContext(this.getContext(e-1)),o,s))}),i.display){for(t.save(),r=s-1;r>=0;r--){const n=i.setContext(this.getPointLabelContext(r)),{color:s,lineWidth:l}=n;l&&s&&(t.lineWidth=l,t.strokeStyle=s,t.setLineDash(n.borderDash),t.lineDashOffset=n.borderDashOffset,o=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),a=this.getPointPosition(r,o),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(a.x,a.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const n=this.getIndexAngle(0);let s,r;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(n),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((n,o)=>{if(0===o&&!e.reverse)return;const a=i.setContext(this.getContext(o)),l=ge(a.font);if(s=this.getDistanceFromCenterForValue(this.ticks[o].value),a.showLabelBackdrop){t.font=l.string,r=t.measureText(n.label).width,t.fillStyle=a.backdropColor;const e=fe(a.backdropPadding);t.fillRect(-r/2-e.left,-s-l.size/2-e.top,r+e.width,l.size+e.height)}se(t,n.label,0,-s,l,{color:a.color})}),t.restore()}drawTitle(){}}_r.id="radialLinear",_r.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:jn.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}},_r.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},_r.descriptors={angleLines:{_fallback:"grid"}};const wr={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Mr=Object.keys(wr);function Or(t,e){return t-e}function kr(t,e){if(p(e))return null;const i=t._adapter,{parser:n,round:s,isoWeekday:r}=t._parseOpts;let o=e;return"function"==typeof n&&(o=n(o)),x(o)||(o="string"==typeof n?i.parse(o,n):i.parse(o)),null===o?null:(s&&(o="week"!==s||!q(r)&&!0!==r?i.startOf(o,s):i.startOf(o,"isoWeek",r)),+o)}function Sr(t,e,i,n){const s=Mr.length;for(let r=Mr.indexOf(t);r=e?i[n]:i[s]]=!0}}else t[e]=!0}function Pr(t,e,i){const n=[],s={},r=e.length;let o,a;for(o=0;o=0&&(e[l].major=!0);return e}(t,n,s,i):n}class Cr extends Vn{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e){const i=t.time||(t.time={}),n=this._adapter=new $i._date(t.adapters.date);C(i.displayFormats,n.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:kr(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:n,max:s,minDefined:r,maxDefined:o}=this.getUserBounds();function a(t){r||isNaN(t.min)||(n=Math.min(n,t.min)),o||isNaN(t.max)||(s=Math.max(s,t.max))}r&&o||(a(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||a(this.getMinMax(!1))),n=x(n)&&!isNaN(n)?n:+e.startOf(Date.now(),i),s=x(s)&&!isNaN(s)?s:+e.endOf(Date.now(),i)+1,this.min=Math.min(n,s-1),this.max=Math.max(n+1,s)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,n="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const s=this.min,r=function(t,e,i){let n=0,s=t.length;for(;nn&&t[s-1]>i;)s--;return n>0||s=Mr.indexOf(i);r--){const i=Mr[r];if(wr[i].common&&t._adapter.diff(s,n,i)>=e-1)return i}return Mr[i?Mr.indexOf(i):0]}(this,r.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(let e=Mr.indexOf(t)+1,i=Mr.length;e1e5*o)throw new Error(e+" and "+i+" are too far apart with stepSize of "+o+" "+r);const f="data"===n.ticks.source&&this.getDataTimestamps();for(h=u,d=0;ht-e).map(t=>+t)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}_tickFormatFunction(t,e,i,n){const s=this.options,r=s.time.displayFormats,o=this._unit,a=this._majorUnit,l=o&&r[o],c=a&&r[a],h=i[e],d=a&&c&&h&&h.major,u=this._adapter.format(t,n||(d?c:l)),f=s.ticks.callback;return f?w(f,[u,e,i],this):u}generateTickLabels(t){let e,i,n;for(e=0,i=t.length;e0?o:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(t=0,e=n.length;t=t[a].pos&&e<=t[l].pos&&({lo:a,hi:l}=xe(t,"pos",e)),({pos:n,time:r}=t[a]),({pos:s,time:o}=t[l])):(e>=t[a].time&&e<=t[l].time&&({lo:a,hi:l}=xe(t,"time",e)),({time:n,pos:r}=t[a]),({time:s,pos:o}=t[l]));const c=s-n;return c?r+(o-r)*(e-n)/c:r}Cr.id="time",Cr.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};class Er extends Cr{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Tr(e,this.min),this._tableRange=Tr(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,n=[],s=[];let r,o,a,l,c;for(r=0,o=t.length;r=e&&l<=i&&n.push(l);if(n.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(r=0,o=n.length;r2&&void 0!==arguments[2]?arguments[2]:"label";const n=[];t.datasets=e.map(e=>{const s=t.datasets.find(t=>t[i]===e[i]);return s&&e.data&&!n.includes(s)?(n.push(s),Object.assign(s,e),s):{...e}})}function zr(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"label";const i={labels:[],datasets:[]};return Rr(i,t.labels),Fr(i,t.datasets,e),i}function Ir(t,e){let{height:i=150,width:n=300,redraw:s=!1,datasetIdKey:r,type:o,data:a,options:l,plugins:c=[],fallbackContent:h,...d}=t;const u=Object(jr.useRef)(null),f=Object(jr.useRef)(),g=()=>{u.current&&(f.current=new us(u.current,{type:o,data:zr(a,r),options:l,plugins:c}),Lr(e,f.current))},p=()=>{Lr(e,null),f.current&&(f.current.destroy(),f.current=null)};return Object(jr.useEffect)(()=>{var t,e;!s&&f.current&&l&&(t=f.current,e=l,t.options={...e})},[s,l]),Object(jr.useEffect)(()=>{!s&&f.current&&Rr(f.current.config.data,a.labels)},[s,a.labels]),Object(jr.useEffect)(()=>{!s&&f.current&&a.datasets&&Fr(f.current.config.data,a.datasets,r)},[s,a.datasets]),Object(jr.useEffect)(()=>{f.current&&(s?(p(),setTimeout(g)):f.current.update())},[s,l,a.labels,a.datasets]),Object(jr.useEffect)(()=>(g(),()=>p()),[]),Ar.a.createElement("canvas",Object.assign({ref:u,role:"img",height:i,width:n},d),h)}const Nr=Object(jr.forwardRef)(Ir);var Vr=i(3),Wr=i(16),Br=i(7),Hr=i(8),Ur=i(4);function Yr(t,e){Object(Ur.a)(2,arguments);var i=Object(Hr.a)(t),n=Object(Br.a)(e);return isNaN(n)?new Date(NaN):n?(i.setDate(i.getDate()+n),i):i}function $r(t,e){Object(Ur.a)(2,arguments);var i=Object(Br.a)(e);return Yr(t,-i)}function Xr(t,e){Object(Ur.a)(2,arguments);var i=Object(Hr.a)(t),n=Object(Br.a)(e);if(isNaN(n))return new Date(NaN);if(!n)return i;var s=i.getDate(),r=new Date(i.getTime());r.setMonth(i.getMonth()+n+1,0);var o=r.getDate();return s>=o?r:(i.setFullYear(r.getFullYear(),r.getMonth(),s),i)}function qr(t,e){Object(Ur.a)(2,arguments);var i=Object(Br.a)(e);return Xr(t,-i)}function Gr(t){return(Gr="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 Qr(t,e){if(Object(Ur.a)(2,arguments),!e||"object"!==Gr(e))return new Date(NaN);var i=e.years?Object(Br.a)(e.years):0,n=e.months?Object(Br.a)(e.months):0,s=e.weeks?Object(Br.a)(e.weeks):0,r=e.days?Object(Br.a)(e.days):0,o=e.hours?Object(Br.a)(e.hours):0,a=e.minutes?Object(Br.a)(e.minutes):0,l=e.seconds?Object(Br.a)(e.seconds):0,c=qr(t,n+12*i),h=$r(c,r+7*s),d=a+60*o,u=l+60*d,f=1e3*u,g=new Date(h.getTime()-f);return g}function Kr(t){return(Kr="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 Zr(t,e){if(Object(Ur.a)(2,arguments),!e||"object"!==Kr(e))return new Date(NaN);var i=e.years?Object(Br.a)(e.years):0,n=e.months?Object(Br.a)(e.months):0,s=e.weeks?Object(Br.a)(e.weeks):0,r=e.days?Object(Br.a)(e.days):0,o=e.hours?Object(Br.a)(e.hours):0,a=e.minutes?Object(Br.a)(e.minutes):0,l=e.seconds?Object(Br.a)(e.seconds):0,c=Object(Hr.a)(t),h=n||i?Xr(c,n+12*i):c,d=r||s?Yr(h,r+7*s):h,u=a+60*o,f=l+60*u,g=1e3*f,p=new Date(d.getTime()+g);return p}function Jr(t,e){var i;Object(Ur.a)(1,arguments);var n=Object(Br.a)(null!==(i=null==e?void 0:e.additionalDigits)&&void 0!==i?i:2);if(2!==n&&1!==n&&0!==n)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof t&&"[object String]"!==Object.prototype.toString.call(t))return new Date(NaN);var s,r=so(t);if(r.date){var o=ro(r.date,n);s=oo(o.restDateString,o.year)}if(!s||isNaN(s.getTime()))return new Date(NaN);var a,l=s.getTime(),c=0;if(r.time&&(c=lo(r.time),isNaN(c)))return new Date(NaN);if(!r.timezone){var h=new Date(l+c),d=new Date(0);return d.setFullYear(h.getUTCFullYear(),h.getUTCMonth(),h.getUTCDate()),d.setHours(h.getUTCHours(),h.getUTCMinutes(),h.getUTCSeconds(),h.getUTCMilliseconds()),d}return a=ho(r.timezone),isNaN(a)?new Date(NaN):new Date(l+c+a)}Math.pow(10,8);var to={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},eo=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,io=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,no=/^([+-])(\d{2})(?::?(\d{2}))?$/;function so(t){var e,i={},n=t.split(to.dateTimeDelimiter);if(n.length>2)return i;if(/:/.test(n[0])?e=n[0]:(i.date=n[0],e=n[1],to.timeZoneDelimiter.test(i.date)&&(i.date=t.split(to.timeZoneDelimiter)[0],e=t.substr(i.date.length,t.length))),e){var s=to.timezone.exec(e);s?(i.time=e.replace(s[1],""),i.timezone=s[1]):i.time=e}return i}function ro(t,e){var i=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),n=t.match(i);if(!n)return{year:NaN,restDateString:""};var s=n[1]?parseInt(n[1]):null,r=n[2]?parseInt(n[2]):null;return{year:null===r?s:100*r,restDateString:t.slice((n[1]||n[2]).length)}}function oo(t,e){if(null===e)return new Date(NaN);var i=t.match(eo);if(!i)return new Date(NaN);var n=!!i[4],s=ao(i[1]),r=ao(i[2])-1,o=ao(i[3]),a=ao(i[4]),l=ao(i[5])-1;if(n)return function(t,e,i){return e>=1&&e<=53&&i>=0&&i<=6}(0,a,l)?function(t,e,i){var n=new Date(0);n.setUTCFullYear(t,0,4);var s=7*(e-1)+i+1-(n.getUTCDay()||7);return n.setUTCDate(n.getUTCDate()+s),n}(e,a,l):new Date(NaN);var c=new Date(0);return function(t,e,i){return e>=0&&e<=11&&i>=1&&i<=(uo[e]||(fo(t)?29:28))}(e,r,o)&&function(t,e){return e>=1&&e<=(fo(t)?366:365)}(e,s)?(c.setUTCFullYear(e,r,Math.max(s,o)),c):new Date(NaN)}function ao(t){return t?parseInt(t):1}function lo(t){var e=t.match(io);if(!e)return NaN;var i=co(e[1]),n=co(e[2]),s=co(e[3]);return function(t,e,i){return 24===t?0===e&&0===i:i>=0&&i<60&&e>=0&&e<60&&t>=0&&t<25}(i,n,s)?36e5*i+6e4*n+1e3*s:NaN}function co(t){return t&&parseFloat(t.replace(",","."))||0}function ho(t){if("Z"===t)return 0;var e=t.match(no);if(!e)return 0;var i="+"===e[1]?-1:1,n=parseInt(e[2]),s=e[3]&&parseInt(e[3])||0;return function(t,e){return e>=0&&e<=59}(0,s)?i*(36e5*n+6e4*s):NaN}var uo=[31,null,31,30,31,30,31,31,30,31,30,31];function fo(t){return t%400==0||t%4==0&&t%100!=0}var go=i(76);function po(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function mo(t){for(var e=1;e0,"is-negative":e<0});return Object(c.createElement)("div",{className:r},Object(c.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"simpay-admin-charts-badge__icon",width:"16",height:"16"},e>0?Object(c.createElement)("path",{d:"M16.004 9.414l-8.607 8.607-1.414-1.414L14.589 8H7.004V6h11v11h-2V9.414z"}):Object(c.createElement)("path",{d:"M14.59 16.004L5.982 7.397l1.414-1.414 8.607 8.606V7.004h2v11h-11v-2z"})),!n&&Object(c.createElement)("span",null,Math.abs(e),"%"))},Eo="simpay-admin-charts-period-over-period__tooltip",jo=function(t){var e=t.position,i=t.opacity,n=t.data,s=t.delta,r=t.deltaChangedString;if(!n.length)return null;var o=e.top,a=e.left,l=e.right,h=Co()("simpay-admin-charts-badge",{"is-positive":s>0,"is-negative":s<0});return Object(c.createElement)("div",{className:Eo,style:{top:o,left:a||"auto",right:l||"auto",opacity:i}},n.map((function(t,e){var i=t.label,n=t.value;return Object(c.createElement)("div",{className:"".concat(Eo,"-data"),"data-dataset":e,key:i+Math.random()},Object(c.createElement)("strong",null,i)," ",Object(c.createElement)("em",null,Object(Wr.decodeEntities)(n)))})),0!==s&&Object(c.createElement)("div",{className:"".concat(Eo,"-delta")},Object(c.createElement)("div",{className:h},Object(c.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"simpay-admin-charts-badge__icon"},s>0?Object(c.createElement)("path",{fillRule:"evenodd",d:"M5.22 14.78a.75.75 0 001.06 0l7.22-7.22v5.69a.75.75 0 001.5 0v-7.5a.75.75 0 00-.75-.75h-7.5a.75.75 0 000 1.5h5.69l-7.22 7.22a.75.75 0 000 1.06z",clipRule:"evenodd"}):Object(c.createElement)("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06l7.22 7.22H6.75a.75.75 0 000 1.5h7.5a.747.747 0 00.75-.75v-7.5a.75.75 0 00-1.5 0v5.69L6.28 5.22z"}))),Object(c.createElement)("span",null,r)))},Ao=function(t){var e=t.chart,i=function(t,e){var i=Object(c.useState)({marginTop:0,marginRight:0,marginBottom:0,marginLeft:0}),n=l()(i,2),s=n[0],r=s.marginTop,o=s.marginRight,a=s.marginBottom,h=s.marginLeft,d=n[1];return Object(c.useEffect)((function(){t.current&&d({marginTop:Math.floor(t.current.chartArea.top),marginRight:Math.floor(t.current.width-t.current.chartArea.right),marginBottom:Math.floor(t.current.chartArea.bottom),marginLeft:Math.floor(t.current.chartArea.left)})}),[t,e]),{marginTop:r,marginRight:o,marginBottom:a,marginLeft:h}}(t.chartRef,e),n=i.marginLeft,s=i.marginRight;return Object(c.createElement)("div",{style:{width:"100%",position:"relative",fontSize:"12px",display:"flex",justifyContent:"space-between",marginTop:"-2px"}},Object(c.createElement)("div",{style:{marginLeft:n,textAlign:"left"}},e.datasets[0].data[0].x),Object(c.createElement)("div",{style:{marginRight:s,textAlign:"right"}},e.datasets[0].data[e.datasets[0].data.length-1].x))};function Lo(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Ro(t){for(var e=1;e0}))}));return Object(c.createElement)("div",{className:"simpay-admin-charts-period-over-period",style:r},!O&&Object(c.createElement)("div",{className:"simpay-admin-charts-no-data",style:Ro(Ro({},r),{},{height:"calc(".concat(r.height," + 15px)")})},a),Object(c.createElement)(Nr,{type:"line",ref:p,options:M,plugins:[_o,(_="rgb(".concat(f.primary_color.join(","),")"),{id:"YGridLineHover",afterDraw:function(t){var e;if(null!==(e=t.tooltip)&&void 0!==e&&null!==(e=e._active)&&void 0!==e&&e.length){var i=t.tooltip._active[0].element.x,n=t.scales.yAxis,s=t.ctx;s.save(),s.beginPath(),s.moveTo(i,n.top),s.lineTo(i,n.bottom),s.lineWidth=2,s.strokeStyle=_,s.stroke(),s.restore()}}})],data:{datasets:m}}),Object(c.createElement)(Ao,{chartRef:p,chart:f}),Object(c.createElement)(jo,s()({},y,{deltaChangedString:h(y)})),Object(c.createElement)(Vr.Popover.Slot,null))}},function(t,e,i){var n;!function(){"use strict";var i={}.hasOwnProperty;function s(){for(var t=[],e=0;et.length)&&(e=t.length);for(var i=0,n=new Array(e);i=r.getTime()?i+1:e.getTime()>=l.getTime()?i:i-1}function f(t){Object(n.a)(1,arguments);var e=u(t),i=new Date(0);i.setUTCFullYear(e,0,4),i.setUTCHours(0,0,0,0);var s=d(i);return s}var g={};function p(){return g}function m(t,e){var i,s,r,a,c,h,d,u;Object(n.a)(1,arguments);var f=p(),g=Object(l.a)(null!==(i=null!==(s=null!==(r=null!==(a=null==e?void 0:e.weekStartsOn)&&void 0!==a?a:null==e||null===(c=e.locale)||void 0===c||null===(h=c.options)||void 0===h?void 0:h.weekStartsOn)&&void 0!==r?r:f.weekStartsOn)&&void 0!==s?s:null===(d=f.locale)||void 0===d||null===(u=d.options)||void 0===u?void 0:u.weekStartsOn)&&void 0!==i?i:0);if(!(g>=0&&g<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var m=Object(o.a)(t),b=m.getUTCDay(),x=(b=1&&x<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var y=new Date(0);y.setUTCFullYear(g+1,0,x),y.setUTCHours(0,0,0,0);var v=m(y,e),_=new Date(0);_.setUTCFullYear(g,0,x),_.setUTCHours(0,0,0,0);var w=m(_,e);return f.getTime()>=v.getTime()?g+1:f.getTime()>=w.getTime()?g:g-1}function x(t,e){var i,s,r,o,a,c,h,d;Object(n.a)(1,arguments);var u=p(),f=Object(l.a)(null!==(i=null!==(s=null!==(r=null!==(o=null==e?void 0:e.firstWeekContainsDate)&&void 0!==o?o:null==e||null===(a=e.locale)||void 0===a||null===(c=a.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==r?r:u.firstWeekContainsDate)&&void 0!==s?s:null===(h=u.locale)||void 0===h||null===(d=h.options)||void 0===d?void 0:d.firstWeekContainsDate)&&void 0!==i?i:1),g=b(t,e),x=new Date(0);x.setUTCFullYear(g,0,f),x.setUTCHours(0,0,0,0);var y=m(x,e);return y}function y(t,e){for(var i=t<0?"-":"",n=Math.abs(t).toString();n.length0?i:1-i;return y("yy"===e?n%100:n,e.length)},_=function(t,e){var i=t.getUTCMonth();return"M"===e?String(i+1):y(i+1,2)},w=function(t,e){return y(t.getUTCDate(),e.length)},M=function(t,e){return y(t.getUTCHours()%12||12,e.length)},O=function(t,e){return y(t.getUTCHours(),e.length)},k=function(t,e){return y(t.getUTCMinutes(),e.length)},S=function(t,e){return y(t.getUTCSeconds(),e.length)},D=function(t,e){var i=e.length,n=t.getUTCMilliseconds();return y(Math.floor(n*Math.pow(10,i-3)),e.length)};function P(t,e){var i=t>0?"-":"+",n=Math.abs(t),s=Math.floor(n/60),r=n%60;if(0===r)return i+String(s);var o=e||"";return i+String(s)+o+y(r,2)}function C(t,e){return t%60==0?(t>0?"-":"+")+y(Math.abs(t)/60,2):T(t,e)}function T(t,e){var i=e||"",n=t>0?"-":"+",s=Math.abs(t);return n+y(Math.floor(s/60),2)+i+y(s%60,2)}var E={G:function(t,e,i){var n=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return i.era(n,{width:"abbreviated"});case"GGGGG":return i.era(n,{width:"narrow"});case"GGGG":default:return i.era(n,{width:"wide"})}},y:function(t,e,i){if("yo"===e){var n=t.getUTCFullYear(),s=n>0?n:1-n;return i.ordinalNumber(s,{unit:"year"})}return v(t,e)},Y:function(t,e,i,n){var s=b(t,n),r=s>0?s:1-s;return"YY"===e?y(r%100,2):"Yo"===e?i.ordinalNumber(r,{unit:"year"}):y(r,e.length)},R:function(t,e){return y(u(t),e.length)},u:function(t,e){return y(t.getUTCFullYear(),e.length)},Q:function(t,e,i){var n=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return y(n,2);case"Qo":return i.ordinalNumber(n,{unit:"quarter"});case"QQQ":return i.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return i.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return i.quarter(n,{width:"wide",context:"formatting"})}},q:function(t,e,i){var n=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return y(n,2);case"qo":return i.ordinalNumber(n,{unit:"quarter"});case"qqq":return i.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return i.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return i.quarter(n,{width:"wide",context:"standalone"})}},M:function(t,e,i){var n=t.getUTCMonth();switch(e){case"M":case"MM":return _(t,e);case"Mo":return i.ordinalNumber(n+1,{unit:"month"});case"MMM":return i.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return i.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return i.month(n,{width:"wide",context:"formatting"})}},L:function(t,e,i){var n=t.getUTCMonth();switch(e){case"L":return String(n+1);case"LL":return y(n+1,2);case"Lo":return i.ordinalNumber(n+1,{unit:"month"});case"LLL":return i.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return i.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return i.month(n,{width:"wide",context:"standalone"})}},w:function(t,e,i,s){var r=function(t,e){Object(n.a)(1,arguments);var i=Object(o.a)(t),s=m(i,e).getTime()-x(i,e).getTime();return Math.round(s/6048e5)+1}(t,s);return"wo"===e?i.ordinalNumber(r,{unit:"week"}):y(r,e.length)},I:function(t,e,i){var s=function(t){Object(n.a)(1,arguments);var e=Object(o.a)(t),i=d(e).getTime()-f(e).getTime();return Math.round(i/6048e5)+1}(t);return"Io"===e?i.ordinalNumber(s,{unit:"week"}):y(s,e.length)},d:function(t,e,i){return"do"===e?i.ordinalNumber(t.getUTCDate(),{unit:"date"}):w(t,e)},D:function(t,e,i){var s=function(t){Object(n.a)(1,arguments);var e=Object(o.a)(t),i=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var s=e.getTime(),r=i-s;return Math.floor(r/864e5)+1}(t);return"Do"===e?i.ordinalNumber(s,{unit:"dayOfYear"}):y(s,e.length)},E:function(t,e,i){var n=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return i.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return i.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(n,{width:"short",context:"formatting"});case"EEEE":default:return i.day(n,{width:"wide",context:"formatting"})}},e:function(t,e,i,n){var s=t.getUTCDay(),r=(s-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(r);case"ee":return y(r,2);case"eo":return i.ordinalNumber(r,{unit:"day"});case"eee":return i.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return i.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(s,{width:"short",context:"formatting"});case"eeee":default:return i.day(s,{width:"wide",context:"formatting"})}},c:function(t,e,i,n){var s=t.getUTCDay(),r=(s-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(r);case"cc":return y(r,e.length);case"co":return i.ordinalNumber(r,{unit:"day"});case"ccc":return i.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return i.day(s,{width:"narrow",context:"standalone"});case"cccccc":return i.day(s,{width:"short",context:"standalone"});case"cccc":default:return i.day(s,{width:"wide",context:"standalone"})}},i:function(t,e,i){var n=t.getUTCDay(),s=0===n?7:n;switch(e){case"i":return String(s);case"ii":return y(s,e.length);case"io":return i.ordinalNumber(s,{unit:"day"});case"iii":return i.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return i.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return i.day(n,{width:"short",context:"formatting"});case"iiii":default:return i.day(n,{width:"wide",context:"formatting"})}},a:function(t,e,i){var n=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return i.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return i.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(t,e,i){var n,s=t.getUTCHours();switch(n=12===s?"noon":0===s?"midnight":s/12>=1?"pm":"am",e){case"b":case"bb":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return i.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return i.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(t,e,i){var n,s=t.getUTCHours();switch(n=s>=17?"evening":s>=12?"afternoon":s>=4?"morning":"night",e){case"B":case"BB":case"BBB":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return i.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return i.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(t,e,i){if("ho"===e){var n=t.getUTCHours()%12;return 0===n&&(n=12),i.ordinalNumber(n,{unit:"hour"})}return M(t,e)},H:function(t,e,i){return"Ho"===e?i.ordinalNumber(t.getUTCHours(),{unit:"hour"}):O(t,e)},K:function(t,e,i){var n=t.getUTCHours()%12;return"Ko"===e?i.ordinalNumber(n,{unit:"hour"}):y(n,e.length)},k:function(t,e,i){var n=t.getUTCHours();return 0===n&&(n=24),"ko"===e?i.ordinalNumber(n,{unit:"hour"}):y(n,e.length)},m:function(t,e,i){return"mo"===e?i.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):k(t,e)},s:function(t,e,i){return"so"===e?i.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):S(t,e)},S:function(t,e){return D(t,e)},X:function(t,e,i,n){var s=(n._originalDate||t).getTimezoneOffset();if(0===s)return"Z";switch(e){case"X":return C(s);case"XXXX":case"XX":return T(s);case"XXXXX":case"XXX":default:return T(s,":")}},x:function(t,e,i,n){var s=(n._originalDate||t).getTimezoneOffset();switch(e){case"x":return C(s);case"xxxx":case"xx":return T(s);case"xxxxx":case"xxx":default:return T(s,":")}},O:function(t,e,i,n){var s=(n._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+P(s,":");case"OOOO":default:return"GMT"+T(s,":")}},z:function(t,e,i,n){var s=(n._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+P(s,":");case"zzzz":default:return"GMT"+T(s,":")}},t:function(t,e,i,n){var s=n._originalDate||t;return y(Math.floor(s.getTime()/1e3),e.length)},T:function(t,e,i,n){return y((n._originalDate||t).getTime(),e.length)}},j=function(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},A=function(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},L={p:A,P:function(t,e){var i,n=t.match(/(P+)(p+)?/)||[],s=n[1],r=n[2];if(!r)return j(t,e);switch(s){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"})}return i.replace("{{date}}",j(s,e)).replace("{{time}}",A(r,e))}};function R(t){var e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}var F=["D","DD"],z=["YY","YYYY"];function I(t){return-1!==F.indexOf(t)}function N(t){return-1!==z.indexOf(t)}function V(t,e,i){if("YYYY"===t)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===t)throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===t)throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===t)throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var W={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function B(t){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.width?String(e.width):t.defaultWidth,n=t.formats[i]||t.formats[t.defaultWidth];return n}}var H={date:B({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:B({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:B({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},U={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function Y(t){return function(e,i){var n;if("formatting"===(null!=i&&i.context?String(i.context):"standalone")&&t.formattingValues){var s=t.defaultFormattingWidth||t.defaultWidth,r=null!=i&&i.width?String(i.width):s;n=t.formattingValues[r]||t.formattingValues[s]}else{var o=t.defaultWidth,a=null!=i&&i.width?String(i.width):t.defaultWidth;n=t.values[a]||t.values[o]}return n[t.argumentCallback?t.argumentCallback(e):e]}}function $(t){return function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.width,s=n&&t.matchPatterns[n]||t.matchPatterns[t.defaultMatchWidth],r=e.match(s);if(!r)return null;var o,a=r[0],l=n&&t.parsePatterns[n]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?q(l,(function(t){return t.test(a)})):X(l,(function(t){return t.test(a)}));o=t.valueCallback?t.valueCallback(c):c,o=i.valueCallback?i.valueCallback(o):o;var h=e.slice(a.length);return{value:o,rest:h}}}function X(t,e){for(var i in t)if(t.hasOwnProperty(i)&&e(t[i]))return i}function q(t,e){for(var i=0;i0?"in "+n:n+" ago":n},formatLong:H,formatRelative:function(t,e,i,n){return U[t]},localize:{ordinalNumber:function(t,e){var i=Number(t),n=i%100;if(n>20||n<10)switch(n%10){case 1:return i+"st";case 2:return i+"nd";case 3:return i+"rd"}return i+"th"},era:Y({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Y({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:Y({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:Y({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:Y({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(G={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(t){return parseInt(t,10)}},function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.match(G.matchPattern);if(!i)return null;var n=i[0],s=t.match(G.parsePattern);if(!s)return null;var r=G.valueCallback?G.valueCallback(s[0]):s[0];r=e.valueCallback?e.valueCallback(r):r;var o=t.slice(n.length);return{value:r,rest:o}}),era:$({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:$({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:$({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:$({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:$({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}},K=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Z=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,J=/^'([^]*?)'?$/,tt=/''/g,et=/[a-zA-Z]/;function it(t,e,i){var s,r,c,d,u,f,g,m,b,x,y,v,_,w,M,O,k,S;Object(n.a)(2,arguments);var D=String(e),P=p(),C=null!==(s=null!==(r=null==i?void 0:i.locale)&&void 0!==r?r:P.locale)&&void 0!==s?s:Q,T=Object(l.a)(null!==(c=null!==(d=null!==(u=null!==(f=null==i?void 0:i.firstWeekContainsDate)&&void 0!==f?f:null==i||null===(g=i.locale)||void 0===g||null===(m=g.options)||void 0===m?void 0:m.firstWeekContainsDate)&&void 0!==u?u:P.firstWeekContainsDate)&&void 0!==d?d:null===(b=P.locale)||void 0===b||null===(x=b.options)||void 0===x?void 0:x.firstWeekContainsDate)&&void 0!==c?c:1);if(!(T>=1&&T<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var j=Object(l.a)(null!==(y=null!==(v=null!==(_=null!==(w=null==i?void 0:i.weekStartsOn)&&void 0!==w?w:null==i||null===(M=i.locale)||void 0===M||null===(O=M.options)||void 0===O?void 0:O.weekStartsOn)&&void 0!==_?_:P.weekStartsOn)&&void 0!==v?v:null===(k=P.locale)||void 0===k||null===(S=k.options)||void 0===S?void 0:S.weekStartsOn)&&void 0!==y?y:0);if(!(j>=0&&j<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!C.localize)throw new RangeError("locale must contain localize property");if(!C.formatLong)throw new RangeError("locale must contain formatLong property");var A=Object(o.a)(t);if(!a(A))throw new RangeError("Invalid time value");var F=R(A),z=h(A,F),W={firstWeekContainsDate:T,weekStartsOn:j,locale:C,_originalDate:A},B=D.match(Z).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,L[e])(t,C.formatLong):t})).join("").match(K).map((function(n){if("''"===n)return"'";var s=n[0];if("'"===s)return nt(n);var r=E[s];if(r)return null!=i&&i.useAdditionalWeekYearTokens||!N(n)||V(n,e,String(t)),null!=i&&i.useAdditionalDayOfYearTokens||!I(n)||V(n,e,String(t)),r(z,n,C.localize,W);if(s.match(et))throw new RangeError("Format string contains an unescaped latin alphabet character `"+s+"`");return n})).join("");return B}function nt(t){var e=t.match(J);return e?e[1].replace(tt,"'"):t}},,,,,function(t,e,i){"use strict";i.r(e);var n=i(6),s=i.n(n),r=i(0),o=(i(37),i(10)),a=i(24),l=i.n(a),c=i(2),h=i(11),d=i.n(h);function u(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function f(t){for(var e=1;ewebhooks to be properly configured to populate correctly.","stripe"),{url:Object(r.createElement)("a",{href:y})})),Object(r.createElement)(p.Flex,null,Object(r.createElement)(p.Button,{variant:"link",onClick:function(){return e(!1)}},Object(c.__)("Close","stripe")),Object(r.createElement)(p.Button,{variant:"primary",isPrimary:!0,href:"https://dashboard.stripe.com/reports/hub",target:"_blank"},Object(c.__)("View advanced reports in Stripe →","stripe"))))},w=i(13),M=simpayAdminDashboardWidgetReport.currencies,O=new Date,k=function(t){var e=t.report,i=t.currency,n=t.setCurrency,o=t.range,a=t.setRange,l=e.data.delta,h=Object(r.useState)(!1),d=s()(h,2),u=d[0],f=d[1];return Object(r.createElement)("div",{className:"simpay-admin-dashboard-widget-report__data-filter"},Object(r.createElement)("div",{className:"simpay-admin-dashboard-widget-report__data-filter-title"},Object(r.createElement)("strong",null,Object(c.__)("Top Forms","stripe")),u&&Object(r.createElement)(_,{setIsOpen:f}),Object(r.createElement)(p.Button,{variant:"link",onClick:function(){return f(!0)}},Object(r.createElement)(m.a,{size:20,icon:b.a}))),Object(r.createElement)("div",{className:"simpay-admin-dashboard-widget-report__data-filter-controls"},!e.isLoading&&0!==l&&Object(r.createElement)(w.a,{delta:l}),Object(r.createElement)(p.SelectControl,{label:Object(c.__)("Currency","stripe"),hideLabelFromVision:!0,value:i,onChange:n,options:M.map((function(t){return{label:t,value:t.toLowerCase()}}))}),Object(r.createElement)(p.SelectControl,{label:Object(c.__)("Range","stripe"),hideLabelFromVision:!0,value:o.type,onChange:function(t){return a({type:t,start:Object(w.d)(t,O),end:Object(w.c)(t,o.end)})},options:[{label:"Today",value:"today"},{label:"Last 7 days",value:"7days"},{label:"Last 4 weeks",value:"4weeks"}]})))},S=i(15),D=i.n(S),P=i(16),C=function(t){var e=t.id,i=t.title,n=t.total_formatted,s=Object(o.addQueryArgs)("post.php",{post:e,action:"edit"});return Object(r.createElement)("div",{style:{display:"flex",justifyContent:"space-between"}},Object(r.createElement)("span",null,i?Object(r.createElement)("a",{href:s,target:"_blank",rel:"noreferrer"},i):Object(c.sprintf)(/* translators: %d Form ID. */ Object(c.__)("Payment form %d (deleted)","stripe"),e)),Object(r.createElement)("div",null,Object(r.createElement)("strong",null,Object(P.decodeEntities)(n))))},T=function(t){var e=t.report;if(e.isLoading)return Object(r.createElement)("div",{className:"simpay-admin-dashboard-widget-report__data-list"});var i=e.data.top_forms,n=i.top,s=i.remaining;return Object(r.createElement)("div",{className:"simpay-admin-dashboard-widget-report__data-list"},n.map((function(t){return Object(r.createElement)(C,D()({key:t.id},t))})),s.count>0&&Object(r.createElement)("div",{style:{display:"flex",justifyContent:"space-between"}},Object(r.createElement)("div",null,Object(c.sprintf)(/* translators: %d The number of forms included in results that are not shown. */ Object(c.__)("…and %d more","stripe"),s.count)),Object(r.createElement)("div",null,Object(P.decodeEntities)(s.total_formatted))))},E=simpayAdminDashboardWidgetReport,j=E.user_id,A=E.default_range,L=A.type,R=A.start,F=A.end,z=E.default_currency;Object(r.render)(Object(r.createElement)((function(){var t=Object(w.e)(j,"simpay_dashboard_widget_report_range",{start:Object(w.d)(L,R),end:Object(w.c)(L,F),type:L}),e=s()(t,2),i=e[0],n=e[1],a=Object(w.e)(j,"simpay_dashboard_widget_report_currency",z),h=s()(a,2),d=h[0],u=h[1],f=Object(r.useReducer)(g,{data:!1,isLoading:!0}),p=s()(f,2),m=p[0],b=p[1];return Object(r.useEffect)((function(){var t=Object(o.addQueryArgs)("/wpsp/__internal__/report/dashboard-widget",{range:i,currency:d});b({type:"START_RESOLUTION"}),l()({path:t}).then((function(t){b({type:"RECEIVE",data:t}),b({type:"FINISH_RESOLUTION"})}))}),[i,d]),Object(r.createElement)(r.Fragment,null,Object(r.createElement)("div",{className:"simpay-admin-dashboard-widget-report__chart"},Object(r.createElement)(w.b,{report:m,style:{width:"100%",height:"300px"},config:{yAxisIsCurrency:!0},noData:Object(r.createElement)("div",null,Object(r.createElement)("strong",null,Object(c.sprintf)(/* translators: %s Currency code. */ Object(c.__)("No %s transactions found.","stripe"),d.toUpperCase())),Object(r.createElement)("div",null,Object(c.__)("Please select a different currency, date range, or check back later.","stripe"))),deltaChangedString:function(t){return Object(r.createInterpolateElement)(Object(c.sprintf)(/* translators: %s: delta percentage */ diff --git a/includes/core/assets/js/dist/simpay-admin-form-template-explorer-css.asset.php b/includes/core/assets/js/dist/simpay-admin-form-template-explorer-css.asset.php index 2cde2dd0..80de1957 100644 --- a/includes/core/assets/js/dist/simpay-admin-form-template-explorer-css.asset.php +++ b/includes/core/assets/js/dist/simpay-admin-form-template-explorer-css.asset.php @@ -1 +1 @@ - array(), 'version' => 'f65ff075fab34cb49b6d582d31577036'); \ No newline at end of file + array(), 'version' => '374a19a9c7d1b2e8f63c64cfdc233506'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-form-template-explorer.asset.php b/includes/core/assets/js/dist/simpay-admin-form-template-explorer.asset.php index 14a894bd..c8473798 100644 --- a/includes/core/assets/js/dist/simpay-admin-form-template-explorer.asset.php +++ b/includes/core/assets/js/dist/simpay-admin-form-template-explorer.asset.php @@ -1 +1 @@ - array('lodash', 'wp-a11y', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => '5dce049d9407deb8d0ff4624ab58bb21'); \ No newline at end of file + array('lodash', 'wp-a11y', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => 'd317b524f24f6ec8bc0334b96339c4fe'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-form-template-explorer.js b/includes/core/assets/js/dist/simpay-admin-form-template-explorer.js index dc41c979..3ee0704b 100644 --- a/includes/core/assets/js/dist/simpay-admin-form-template-explorer.js +++ b/includes/core/assets/js/dist/simpay-admin-form-template-explorer.js @@ -1,4 +1,4 @@ -!function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.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 a in e)r.d(n,a,function(t){return e[t]}.bind(null,a));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=81)}([function(e,t){e.exports=window.wp.element},,function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wp.components},,,function(e,t,r){var n=r(26),a=r(27),o=r(22),l=r(28);e.exports=function(e,t){return n(e)||a(e,t)||o(e,t)||l()},e.exports.__esModule=!0,e.exports.default=e.exports},,,function(e,t){e.exports=window.wp.primitives},function(e,t){e.exports=window.wp.url},,function(e,t){e.exports=window.lodash},function(e,t,r){var n;!function(){"use strict";var r={}.hasOwnProperty;function a(){for(var e=[],t=0;te.length)&&(t=e.length);for(var r=0,n=new Array(t);rbasic form. Have a suggestion for a new template? We'd love to hear it!","stripe"),{blank:Object(o.createElement)("a",{href:b}),suggest:Object(o.createElement)("a",{href:p,target:"_blank",rel:"noopener noreferrer"})})))},O=r(13),_=r.n(O),v=r(20),h=r(66),E=r(44),x=r(67),w=function e(t){var r=t.className,n=t.onChange,a=t.value,c=t.label,s=t.placeholder,u=void 0===s?Object(i.__)("Search"):s,p=t.hideLabelFromVision,m=void 0===p||p,d=t.help,f=Object(v.useInstanceId)(e),b=Object(o.useRef)(),g="components-search-control-".concat(f);return Object(o.createElement)(l.BaseControl,{label:c,id:g,hideLabelFromVision:m,help:d,className:_()(r,"components-search-control")},Object(o.createElement)("div",{className:"components-search-control__input-wrapper"},Object(o.createElement)("input",{ref:b,className:"components-search-control__input",id:g,type:"search",placeholder:u,onChange:function(e){return n(e.target.value)},autoComplete:"off",value:a||""}),Object(o.createElement)("div",{className:"components-search-control__icon"},!!a&&Object(o.createElement)(l.Button,{icon:h.a,label:Object(i.__)("Reset search","stripe"),onClick:function(){n(""),b.current.focus()}}),!a&&Object(o.createElement)(E.a,{icon:x.a}))))},C="simpay-form-template-explorer-main__sidebar";function S(e){var t=e.selectedCategory,r=e.templateCategories,n=e.onClickCategory;return Object(o.createElement)(l.NavigableMenu,{orientation:"vertical",className:"".concat(C,"-categories")},Object.keys(r).map((function(e){var a=_()("category-".concat(e),"".concat(C,"-categories_category"));return Object(o.createElement)(l.Button,{key:e,label:r[e],className:a,isPressed:t===e,onClick:function(){n(e)}},r[e])})))}function k(e){var t=e.filterValue,r=e.setFilterValue;return Object(o.createElement)("div",{className:"".concat(C,"-search")},Object(o.createElement)(w,{onChange:r,value:t,label:Object(i.__)("Search for templates","stripe"),placeholder:Object(i.__)("Search","stripe")}))}var N=function(e){var t=e.selectedCategory,r=e.templateCategories,n=e.onClickCategory,a=e.filterValue,l=e.setFilterValue;return Object(o.createElement)("div",{className:C},Object(o.createElement)(k,{filterValue:a,setFilterValue:l}),!a&&Object(o.createElement)(S,{selectedCategory:t,templateCategories:r,onClickCategory:n}))},M=r(39),P=r(9),V=Object(o.createElement)(P.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(o.createElement)(P.Path,{d:"M8 5C8 3.34315 9.34315 2 11 2H13C14.6569 2 16 3.34315 16 5V9H18C19.2624 9 20 9.9804 20 11V19C20 20.0196 19.2624 21 18 21H6C4.73763 21 4 20.0196 4 19V11C4 9.9804 4.73763 9 6 9H8V5ZM9.5 9H14.5V5C14.5 4.17157 13.8284 3.5 13 3.5H11C10.1716 3.5 9.5 4.17157 9.5 5V9Z"})),L=r(64),B=simpayFormBuilderTemplateExplorer,A=B.alreadyPurchasedUrl,U=B.licenseLevel,F=B.upgradeUrl,I="simpay-form-template-explorer-upgrade",T=function(e){var t=e.template,r=e.setIsShowingUpgradeModal;return Object(o.createElement)(l.Modal,{title:Object(i.__)("Upgrade Required","stripe"),onRequestClose:function(){return r(!1)},className:I},Object(o.createElement)("div",{className:"".concat(I,"__content")},Object(o.createElement)(E.a,{icon:V,size:"48px"}),Object(o.createElement)("h3",{className:"".concat(I,"__title")},Object(i.sprintf)(/* translators: %s Template name */ -Object(i.__)('Unlock the "%s" Template',"stripe"),t.name)),Object(o.createElement)("p",{className:"".concat(I,"__description")},Object(o.createInterpolateElement)(Object(i.sprintf)(/* translators: %$ss Template name. %2$s Minimum license level. */ -Object(i.__)('We\'re sorry, the "%1$s" template is not available on your plan. Please upgrade to the %2$s plan or higher to unlock this and other awesome features.',"stripe"),t.name,Object(c.upperFirst)(t.license[0])),{strong:Object(o.createElement)("strong",null)})),Object(o.createElement)(l.Button,{isPrimary:!0,variant:"primary",href:Object(s.addQueryArgs)(F,{utm_content:t.name}),target:"_blank",rel:"noopener noreferrer"},"lite"===U?Object(i.__)("Upgrade to Pro","stripe"):Object(i.__)("See Upgrade Options","stripe")),Object(o.createElement)("a",{href:A,target:"_blank",rel:"noopener noreferrer",className:"".concat(I,"__purchased")},Object(i.__)("Already purchased?","stripe")),Object(o.createElement)("p",{className:"".concat(I,"__discount")},Object(o.createElement)(E.a,{icon:L.a}),"lite"===U?Object(o.createInterpolateElement)(Object(i.__)("Bonus: WP Simple Pay Lite users get 50% off regular price, automatically applied at checkout. Upgrade to Pro →","stripe"),{strong:Object(o.createElement)("strong",null),highlight:Object(o.createElement)("u",null),upgrade:Object(o.createElement)("a",{href:Object(s.addQueryArgs)(F,{utm_content:t.name}),target:"_blank",rel:"noopener noreferrer"})}):Object(o.createInterpolateElement)(Object(i.__)("Bonus: WP Simple Pay Pro users get 50% off upgrade pricing, automatically applied at checkout. See Upgrade Options →","stripe"),{strong:Object(o.createElement)("strong",null),highlight:Object(o.createElement)("u",null),upgrade:Object(o.createElement)("a",{href:Object(s.addQueryArgs)(F,{utm_content:t.name}),target:"_blank",rel:"noopener noreferrer"})}))))},H=simpayFormBuilderTemplateExplorer,W=H.licenseLevel,z=H.addNewUrl,G=H.isLite,Q="simpay-form-template-explorer-main__content",R=["payment-button","donate-button","payment-form","product-installment-plan-form","product-purchse-form","product-subscription-form","product-subscription-form-coupon","recurring-service-setup-fee-form","recurring-service-trial-period-form","recurring-services-form","alipay-payment-button","giropay-payment-button","ideal-payment-button","przelewy24-payment-button"],Z=function(e){var t=e.template,r=Object(o.useState)(!1),n=a()(r,2),c=n[0],u=n[1],p=!t.license.includes(W),m=Object(s.addQueryArgs)(z,{"simpay-template":t.id}),d=Object(s.addQueryArgs)("https://wpsimplepay.com/templates/".concat(t.slug,"/"),{utm_source:"WordPress",utm_campaign:"1"===G?"lite-plugin":"pro-plugin",utm_medium:"template-explorer",utm_content:t.name});return Object(o.createElement)(o.Fragment,null,c&&Object(o.createElement)(T,{template:t,setIsShowingUpgradeModal:u}),Object(o.createElement)("div",{key:t.id,className:"".concat(Q,"-list-item")},p&&Object(o.createElement)("div",{className:"".concat(Q,"-list-item__badge")},Object(o.createElement)(E.a,{icon:V,size:"16px"})),Object(o.createElement)("div",{id:t.id,className:"".concat(Q,"-list-item__name ").concat(p?"".concat(Q,"-list-item__name--is-locked"):"")},t.name),Object(o.createElement)("div",{className:"".concat(Q,"-list-item__description")},t.description),Object(o.createElement)("div",{className:"".concat(Q,"-list-item__actions")},Object(o.createElement)(l.Button,{isPrimary:!0,variant:"primary",href:p?void 0:m,onClick:function(){return p?u(!0):null}},Object(i.__)("Use Template","stripe")),!R.includes(t.slug)&&Object(o.createElement)(l.Button,{isSecondary:!0,variant:"secondary",href:d,style:{marginLeft:"10px"},target:"_blank"},Object(i.__)("View Demo","stripe")))))},q=Object(o.createElement)(P.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(o.createElement)(P.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M6.68822 16.625L5.5 17.8145L5.5 5.5L18.5 5.5L18.5 16.625L6.68822 16.625ZM7.31 18.125L19 18.125C19.5523 18.125 20 17.6773 20 17.125L20 5C20 4.44772 19.5523 4 19 4H5C4.44772 4 4 4.44772 4 5V19.5247C4 19.8173 4.16123 20.086 4.41935 20.2237C4.72711 20.3878 5.10601 20.3313 5.35252 20.0845L7.31 18.125ZM16 9.99997H8V8.49997H16V9.99997ZM8 14H13V12.5H8V14Z"})),D=simpayFormBuilderTemplateExplorer.suggestUrl,$=function(){return Object(o.createElement)("div",{className:"".concat("simpay-form-template-explorer-main__content","-suggest")},Object(o.createElement)("div",{style:{flexGrow:0}},Object(o.createElement)(E.a,{icon:q,size:"42px"})),Object(o.createElement)("div",null,Object(o.createElement)("h4",null,Object(i.__)("We need your help!","stripe")),Object(o.createElement)("p",null,Object(o.createInterpolateElement)(Object(i.__)("We're constantly building more pre-made payment form templates to get you up and running even faster. If you have ideas for future templates, please let us know!","stripe"),{suggest:Object(o.createElement)("a",{href:D,target:"_blank",rel:"noopener noreferrer"})})),Object(o.createElement)(l.Button,{isSecondary:!0,variant:"secondary",isLink:!0,href:D,target:"_blank"},Object(i.__)("Suggest a Template","stripe"))))},K=simpayFormBuilderTemplateExplorer,J=K.isLite,X=K.upgradeUrl,Y=function(){return Object(o.createElement)("div",{className:"".concat("simpay-form-template-explorer-main__content","-upgrade")},Object(o.createElement)("div",null,Object(o.createElement)("h4",null,Object(i.__)("Get Access to All of Our Pre-Made Payment Form Templates","stripe")),Object(o.createElement)("p",null,Object(i.__)("Never start from scratch again! Upgrade to gain access to every payment form template we make and unlock powerful new features.","stripe"))),Object(o.createElement)(l.Button,{isSecondary:!0,variant:"primary",isLink:!0,size:"large",href:X,target:"_blank"},J?Object(i.__)("Upgrade to Pro","stripe"):Object(i.__)("Upgrade Now","stripe")))},ee=r(29),te=r.n(ee),re=function(e){return e.name||""},ne=function(e){return e.description||""},ae=function(e){return e.keywords||[]},oe=function(e){return e.category};function le(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(e=(e=Object(c.deburr)(e)).replace(/^\//,"")).toLowerCase()}var ce=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Object(c.words)(le(e))},ie=function(e,t){return Object(c.differenceWith)(e,ce(t),(function(e,t){return t.includes(e)}))};function se(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.getName,a=void 0===n?re:n,o=r.getDescription,l=void 0===o?ne:o,i=r.getKeywords,s=void 0===i?ae:i,u=r.getCategory,p=void 0===u?oe:u,m=a(e),d=l(e),f=s(e),b=p(e),g=le(t),y=le(m),j=0;if(g===y)j+=30;else if(y.startsWith(g))j+=20;else{var O=[m,d].concat(te()(f),[b]).join(" "),_=Object(c.words)(g),v=ie(_,O);0===v.length&&(j+=10)}return j}var ue=simpayFormBuilderTemplateExplorer,pe=ue.suggestUrl,me=ue.licenseLevel,de=function(e){var t=e.filterValue,r=e.selectedCategory,n=e.templates,l=Object(v.useDebounce)(M.speak,500),s=Object(o.useMemo)((function(){var e=n;return t?e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=ce(t);if(0===n.length)return e;var o=e.map((function(e){return[e,se(e,t,r)]})).filter((function(e){return a()(e,2)[1]>0}));return o.sort((function(e,t){var r=a()(e,2)[1];return a()(t,2)[1]-r})),o.map((function(e){return a()(e,1)[0]}))}(n,t):""!==r&&(e=n.filter((function(e){return e.categories.includes(r)}))),Object(c.sortBy)(e,(function(e){return!e.license.includes(me)}))}),[t,r,n]);Object(o.useEffect)((function(){if(t){var e=s.length,r=Object(i.sprintf)(/* translators: %d: number of results. */ -Object(i._n)("%d result found.","%d results found.",e,"stripe"),e);l(r)}}),[t,l]);var u=!(null==s||!s.length),p=_()("simpay-form-template-explorer-main__content",{"is-empty":!u});return Object(o.createElement)("div",{className:p},!u&&Object(o.createElement)("p",null,Object(o.createInterpolateElement)(Object(i.__)("No results found. Have a suggestion for a new template? We'd love to hear it!","stripe"),{suggest:Object(o.createElement)("a",{href:pe,target:"_blank",rel:"noopener noreferrer"})})),u&&Object(o.createElement)(o.Fragment,null,s.map((function(e,r){var n=Object(o.createElement)(Z,{key:e.slug,template:e});return""===t&&["lite","personal","plus"].includes(me)&&5===r?Object(o.createElement)(o.Fragment,{key:"upgrade-frag"},n,Object(o.createElement)(Y,null)):n})),Object(o.createElement)($,null)))},fe=simpayFormBuilderTemplateExplorer,be=fe.hasNew,ge=fe.templates,ye=fe.categories;Object(o.render)(Object(o.createElement)((function(){var e=Object(o.useState)(""),t=a()(e,2),r=t[0],n=t[1],c=Object(o.useState)(be?"new":""),i=a()(c,2),s=i[0],u=i[1];return Object(o.useEffect)((function(){document.querySelector("body").classList.add("simpay-template-explorer-open")}),[]),Object(o.createElement)(l.SlotFillProvider,null,Object(o.createElement)("div",{className:"simpay-form-template-explorer"},Object(o.createElement)(j,null),Object(o.createElement)("div",{className:"".concat("simpay-form-template-explorer","-main")},Object(o.createElement)(N,{selectedCategory:s,templateCategories:ye,onClickCategory:u,filterValue:r,setFilterValue:function(e){n(e),u("")}}),Object(o.createElement)(de,{templates:ge,templateCategories:ye,selectedCategory:s,filterValue:r}))),Object(o.createElement)(l.Popover.Slot,null))}),null),document.getElementById("simpay-form-template-explorer"))}]); \ No newline at end of file +!function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.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 a in e)r.d(n,a,function(t){return e[t]}.bind(null,a));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=79)}([function(e,t){e.exports=window.wp.element},,function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wp.components},,,function(e,t,r){var n=r(26),a=r(27),o=r(21),l=r(28);e.exports=function(e,t){return n(e)||a(e,t)||o(e,t)||l()},e.exports.__esModule=!0,e.exports.default=e.exports},,,function(e,t){e.exports=window.wp.primitives},function(e,t){e.exports=window.wp.url},,function(e,t){e.exports=window.lodash},,function(e,t,r){var n;!function(){"use strict";var r={}.hasOwnProperty;function a(){for(var e=[],t=0;te.length)&&(t=e.length);for(var r=0,n=new Array(t);rbasic form. Have a suggestion for a new template? We'd love to hear it!","stripe"),{blank:Object(o.createElement)("a",{href:b}),suggest:Object(o.createElement)("a",{href:p,target:"_blank",rel:"noopener noreferrer"})})))},O=r(14),_=r.n(O),v="simpay-form-template-explorer-main__sidebar";function h(e){var t=e.selectedCategory,r=e.templateCategories,n=e.onClickCategory;return Object(o.createElement)(l.NavigableMenu,{orientation:"vertical",className:"".concat(v,"-categories")},Object.keys(r).map((function(e){var a=_()("category-".concat(e),"".concat(v,"-categories_category"));return Object(o.createElement)(l.Button,{key:e,label:r[e],className:a,isPressed:t===e,onClick:function(){n(e)}},r[e])})))}function E(e){var t=e.filterValue,r=e.setFilterValue;return Object(o.createElement)("div",{className:"".concat(v,"-search")},Object(o.createElement)(l.SearchControl,{onChange:r,value:t,label:Object(i.__)("Search for templates","stripe"),placeholder:Object(i.__)("Search","stripe")}))}var x=function(e){var t=e.selectedCategory,r=e.templateCategories,n=e.onClickCategory,a=e.filterValue,l=e.setFilterValue;return Object(o.createElement)("div",{className:v},Object(o.createElement)(E,{filterValue:a,setFilterValue:l}),!a&&Object(o.createElement)(h,{selectedCategory:t,templateCategories:r,onClickCategory:n}))},w=r(22),C=r(39),S=r(44),k=r(9),N=Object(o.createElement)(k.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(o.createElement)(k.Path,{d:"M8 5C8 3.34315 9.34315 2 11 2H13C14.6569 2 16 3.34315 16 5V9H18C19.2624 9 20 9.9804 20 11V19C20 20.0196 19.2624 21 18 21H6C4.73763 21 4 20.0196 4 19V11C4 9.9804 4.73763 9 6 9H8V5ZM9.5 9H14.5V5C14.5 4.17157 13.8284 3.5 13 3.5H11C10.1716 3.5 9.5 4.17157 9.5 5V9Z"})),M=r(64),P=simpayFormBuilderTemplateExplorer,V=P.alreadyPurchasedUrl,A=P.licenseLevel,L=P.upgradeUrl,U="simpay-form-template-explorer-upgrade",B=function(e){var t=e.template,r=e.setIsShowingUpgradeModal;return Object(o.createElement)(l.Modal,{title:Object(i.__)("Upgrade Required","stripe"),onRequestClose:function(){return r(!1)},className:U},Object(o.createElement)("div",{className:"".concat(U,"__content")},Object(o.createElement)(S.a,{icon:N,size:"48px"}),Object(o.createElement)("h3",{className:"".concat(U,"__title")},Object(i.sprintf)(/* translators: %s Template name */ +Object(i.__)('Unlock the "%s" Template',"stripe"),t.name)),Object(o.createElement)("p",{className:"".concat(U,"__description")},Object(o.createInterpolateElement)(Object(i.sprintf)(/* translators: %$ss Template name. %2$s Minimum license level. */ +Object(i.__)('We\'re sorry, the "%1$s" template is not available on your plan. Please upgrade to the %2$s plan or higher to unlock this and other awesome features.',"stripe"),t.name,Object(c.upperFirst)(t.license[0])),{strong:Object(o.createElement)("strong",null)})),Object(o.createElement)(l.Button,{isPrimary:!0,variant:"primary",href:Object(s.addQueryArgs)(L,{utm_content:t.name}),target:"_blank",rel:"noopener noreferrer"},"lite"===A?Object(i.__)("Upgrade to Pro","stripe"):Object(i.__)("See Upgrade Options","stripe")),Object(o.createElement)("a",{href:V,target:"_blank",rel:"noopener noreferrer",className:"".concat(U,"__purchased")},Object(i.__)("Already purchased?","stripe")),Object(o.createElement)("p",{className:"".concat(U,"__discount")},Object(o.createElement)(S.a,{icon:M.a}),"lite"===A?Object(o.createInterpolateElement)(Object(i.__)("Bonus: WP Simple Pay Lite users get 50% off regular price, automatically applied at checkout. Upgrade to Pro →","stripe"),{strong:Object(o.createElement)("strong",null),highlight:Object(o.createElement)("u",null),upgrade:Object(o.createElement)("a",{href:Object(s.addQueryArgs)(L,{utm_content:t.name}),target:"_blank",rel:"noopener noreferrer"})}):Object(o.createInterpolateElement)(Object(i.__)("Bonus: WP Simple Pay Pro users get 50% off upgrade pricing, automatically applied at checkout. See Upgrade Options →","stripe"),{strong:Object(o.createElement)("strong",null),highlight:Object(o.createElement)("u",null),upgrade:Object(o.createElement)("a",{href:Object(s.addQueryArgs)(L,{utm_content:t.name}),target:"_blank",rel:"noopener noreferrer"})}))))},F=simpayFormBuilderTemplateExplorer,T=F.licenseLevel,I=F.addNewUrl,H=F.isLite,W="simpay-form-template-explorer-main__content",z=["payment-button","donate-button","payment-form","product-installment-plan-form","product-purchse-form","product-subscription-form","product-subscription-form-coupon","recurring-service-setup-fee-form","recurring-service-trial-period-form","recurring-services-form","alipay-payment-button","giropay-payment-button","ideal-payment-button","przelewy24-payment-button"],Q=function(e){var t=e.template,r=Object(o.useState)(!1),n=a()(r,2),c=n[0],u=n[1],p=!t.license.includes(T),m=Object(s.addQueryArgs)(I,{"simpay-template":t.id}),d=Object(s.addQueryArgs)("https://wpsimplepay.com/templates/".concat(t.slug,"/"),{utm_source:"WordPress",utm_campaign:"1"===H?"lite-plugin":"pro-plugin",utm_medium:"template-explorer",utm_content:t.name});return Object(o.createElement)(o.Fragment,null,c&&Object(o.createElement)(B,{template:t,setIsShowingUpgradeModal:u}),Object(o.createElement)("div",{key:t.id,className:"".concat(W,"-list-item")},p&&Object(o.createElement)("div",{className:"".concat(W,"-list-item__badge")},Object(o.createElement)(S.a,{icon:N,size:"16px"})),Object(o.createElement)("div",{id:t.id,className:"".concat(W,"-list-item__name ").concat(p?"".concat(W,"-list-item__name--is-locked"):"")},t.name),Object(o.createElement)("div",{className:"".concat(W,"-list-item__description")},t.description),Object(o.createElement)("div",{className:"".concat(W,"-list-item__actions")},Object(o.createElement)(l.Button,{isPrimary:!0,variant:"primary",href:p?void 0:m,onClick:function(){return p?u(!0):null}},Object(i.__)("Use Template","stripe")),!z.includes(t.slug)&&Object(o.createElement)(l.Button,{isSecondary:!0,variant:"secondary",href:d,style:{marginLeft:"10px"},target:"_blank"},Object(i.__)("View Demo","stripe")))))},G=Object(o.createElement)(k.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(o.createElement)(k.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M6.68822 16.625L5.5 17.8145L5.5 5.5L18.5 5.5L18.5 16.625L6.68822 16.625ZM7.31 18.125L19 18.125C19.5523 18.125 20 17.6773 20 17.125L20 5C20 4.44772 19.5523 4 19 4H5C4.44772 4 4 4.44772 4 5V19.5247C4 19.8173 4.16123 20.086 4.41935 20.2237C4.72711 20.3878 5.10601 20.3313 5.35252 20.0845L7.31 18.125ZM16 9.99997H8V8.49997H16V9.99997ZM8 14H13V12.5H8V14Z"})),Z=simpayFormBuilderTemplateExplorer.suggestUrl,R=function(){return Object(o.createElement)("div",{className:"".concat("simpay-form-template-explorer-main__content","-suggest")},Object(o.createElement)("div",{style:{flexGrow:0}},Object(o.createElement)(S.a,{icon:G,size:"42px"})),Object(o.createElement)("div",null,Object(o.createElement)("h4",null,Object(i.__)("We need your help!","stripe")),Object(o.createElement)("p",null,Object(o.createInterpolateElement)(Object(i.__)("We're constantly building more pre-made payment form templates to get you up and running even faster. If you have ideas for future templates, please let us know!","stripe"),{suggest:Object(o.createElement)("a",{href:Z,target:"_blank",rel:"noopener noreferrer"})})),Object(o.createElement)(l.Button,{isSecondary:!0,variant:"secondary",isLink:!0,href:Z,target:"_blank"},Object(i.__)("Suggest a Template","stripe"))))},q=simpayFormBuilderTemplateExplorer,D=q.isLite,$=q.upgradeUrl,K=function(){return Object(o.createElement)("div",{className:"".concat("simpay-form-template-explorer-main__content","-upgrade")},Object(o.createElement)("div",null,Object(o.createElement)("h4",null,Object(i.__)("Get Access to All of Our Pre-Made Payment Form Templates","stripe")),Object(o.createElement)("p",null,Object(i.__)("Never start from scratch again! Upgrade to gain access to every payment form template we make and unlock powerful new features.","stripe"))),Object(o.createElement)(l.Button,{isSecondary:!0,variant:"primary",isLink:!0,size:"large",href:$,target:"_blank"},D?Object(i.__)("Upgrade to Pro","stripe"):Object(i.__)("Upgrade Now","stripe")))},J=r(29),X=r.n(J),Y=function(e){return e.name||""},ee=function(e){return e.description||""},te=function(e){return e.keywords||[]},re=function(e){return e.category};function ne(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(e=(e=Object(c.deburr)(e)).replace(/^\//,"")).toLowerCase()}var ae=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Object(c.words)(ne(e))},oe=function(e,t){return Object(c.differenceWith)(e,ae(t),(function(e,t){return t.includes(e)}))};function le(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.getName,a=void 0===n?Y:n,o=r.getDescription,l=void 0===o?ee:o,i=r.getKeywords,s=void 0===i?te:i,u=r.getCategory,p=void 0===u?re:u,m=a(e),d=l(e),f=s(e),b=p(e),g=ne(t),y=ne(m),j=0;if(g===y)j+=30;else if(y.startsWith(g))j+=20;else{var O=[m,d].concat(X()(f),[b]).join(" "),_=Object(c.words)(g),v=oe(_,O);0===v.length&&(j+=10)}return j}var ce=simpayFormBuilderTemplateExplorer,ie=ce.suggestUrl,se=ce.licenseLevel,ue=function(e){var t=e.filterValue,r=e.selectedCategory,n=e.templates,l=Object(w.useDebounce)(C.speak,500),s=Object(o.useMemo)((function(){var e=n;return t?e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=ae(t);if(0===n.length)return e;var o=e.map((function(e){return[e,le(e,t,r)]})).filter((function(e){return a()(e,2)[1]>0}));return o.sort((function(e,t){var r=a()(e,2)[1];return a()(t,2)[1]-r})),o.map((function(e){return a()(e,1)[0]}))}(n,t):""!==r&&(e=n.filter((function(e){return e.categories.includes(r)}))),Object(c.sortBy)(e,(function(e){return!e.license.includes(se)}))}),[t,r,n]);Object(o.useEffect)((function(){if(t){var e=s.length,r=Object(i.sprintf)(/* translators: %d: number of results. */ +Object(i._n)("%d result found.","%d results found.",e,"stripe"),e);l(r)}}),[t,l]);var u=!(null==s||!s.length),p=_()("simpay-form-template-explorer-main__content",{"is-empty":!u});return Object(o.createElement)("div",{className:p},!u&&Object(o.createElement)("p",null,Object(o.createInterpolateElement)(Object(i.__)("No results found. Have a suggestion for a new template? We'd love to hear it!","stripe"),{suggest:Object(o.createElement)("a",{href:ie,target:"_blank",rel:"noopener noreferrer"})})),u&&Object(o.createElement)(o.Fragment,null,s.map((function(e,r){var n=Object(o.createElement)(Q,{key:e.slug,template:e});return""===t&&["lite","personal","plus"].includes(se)&&5===r?Object(o.createElement)(o.Fragment,{key:"upgrade-frag"},n,Object(o.createElement)(K,null)):n})),Object(o.createElement)(R,null)))},pe=simpayFormBuilderTemplateExplorer,me=pe.hasNew,de=pe.templates,fe=pe.categories;Object(o.render)(Object(o.createElement)((function(){var e=Object(o.useState)(""),t=a()(e,2),r=t[0],n=t[1],c=Object(o.useState)(me?"new":""),i=a()(c,2),s=i[0],u=i[1];return Object(o.useEffect)((function(){document.querySelector("body").classList.add("simpay-template-explorer-open")}),[]),Object(o.createElement)(l.SlotFillProvider,null,Object(o.createElement)("div",{className:"simpay-form-template-explorer"},Object(o.createElement)(j,null),Object(o.createElement)("div",{className:"".concat("simpay-form-template-explorer","-main")},Object(o.createElement)(x,{selectedCategory:s,templateCategories:fe,onClickCategory:u,filterValue:r,setFilterValue:function(e){n(e),u("")}}),Object(o.createElement)(ue,{templates:de,templateCategories:fe,selectedCategory:s,filterValue:r}))),Object(o.createElement)(l.Popover.Slot,null))}),null),document.getElementById("simpay-form-template-explorer"))}]); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-help-css.asset.php b/includes/core/assets/js/dist/simpay-admin-help-css.asset.php index 94f97812..8639218a 100644 --- a/includes/core/assets/js/dist/simpay-admin-help-css.asset.php +++ b/includes/core/assets/js/dist/simpay-admin-help-css.asset.php @@ -1 +1 @@ - array(), 'version' => '657fa03a722399c998ae7b0233b5bb8d'); \ No newline at end of file + array(), 'version' => '410c8f231808c04de36b327b88c79222'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-help.asset.php b/includes/core/assets/js/dist/simpay-admin-help.asset.php index 7df9e571..dac4e37b 100644 --- a/includes/core/assets/js/dist/simpay-admin-help.asset.php +++ b/includes/core/assets/js/dist/simpay-admin-help.asset.php @@ -1 +1 @@ - array('lodash', 'wp-a11y', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-keycodes', 'wp-primitives', 'wp-url'), 'version' => '340417a4172b75d60d3db387972142da'); \ No newline at end of file + array('lodash', 'wp-a11y', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-keycodes', 'wp-primitives', 'wp-url'), 'version' => '2582dbcfcda65c13b2fd8474ce3c3a1b'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-help.js b/includes/core/assets/js/dist/simpay-admin-help.js index 62736c2a..e152225b 100644 --- a/includes/core/assets/js/dist/simpay-admin-help.js +++ b/includes/core/assets/js/dist/simpay-admin-help.js @@ -1,2 +1,2 @@ -!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=80)}([function(e,t){e.exports=window.wp.element},,function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wp.components},,,function(e,t,n){var r=n(26),o=n(27),c=n(22),a=n(28);e.exports=function(e,t){return r(e)||o(e,t)||c(e,t)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},,,function(e,t){e.exports=window.wp.primitives},function(e,t){e.exports=window.wp.url},,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;te.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n5&&Object(c.createElement)(a.Button,{variant:"secondary",isSecondary:!0,isSmall:!0,onClick:function(){return f(!0)}},Object(s.__)("View all","stripe"))))},R=simpayHelp,I=R.docs,G=R.docsCategories,D=function(){var e,t=Object(c.useState)("getting-started"),n=o()(t,2),r=n[0],a=n[1];return Object(c.createElement)("div",{className:"simpay-help-panel__categories"},(e=Object(V.groupBy)(I,"categories"),Object(V.map)(e,(function(e,t){return{slug:t,title:G[t]||"",docs:e}}))).map((function(e){return Object(c.createElement)(H,k()({key:e.slug,openCategory:r,setOpenCategory:a},e))})))},F=n(29),W=n.n(F);function U(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(e=(e=Object(V.deburr)(e)).replace(/^\//,"")).toLowerCase()}var Z=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Object(V.words)(U(e))};function $(e,t){var n,r,o=e.title||"",c=e.excerpt||"",a=e.categories||[],l=e.tags||[],i=U(t),s=U(o),u=0;if(i===s)u+=30;else if(s.startsWith(i))u+=20;else{var p=[o,c].concat(W()(a),W()(l)).join(" ");0===(n=Object(V.words)(i),r=p,Object(V.differenceWith)(n,Z(r),(function(e,t){return t.includes(e)}))).length&&(u+=10)}return u}var Q=simpayHelp.docs,K=function(e){var t=e.searchTerm,n=Object(c.useMemo)((function(){var e=[];return""!==t&&(e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=Z(t);if(0===n.length)return e;var r=e.map((function(e){return[e,$(e,t)]})).filter((function(e){return o()(e,2)[1]>0}));return r.sort((function(e,t){var n=o()(e,2)[1];return o()(t,2)[1]-n})),r.map((function(e){return o()(e,1)[0]}))}(Q,t)),e}),[t]),r=Object(b.useDebounce)(P.speak,500);Object(c.useEffect)((function(){if(t){var e=n.length,o=Object(s.sprintf)(/* translators: %d: number of results. */ -Object(s._n)("%d result found.","%d results found.",e,"stripe"),e);r(o)}}),[t,r]);var a=!(null==n||!n.length);return Object(c.createElement)("div",{className:"simpay-help-panel__results"},!a&&Object(c.createElement)(D,null),a&&n.map((function(e){return Object(c.createElement)(N,k()({key:e.id,searchTerm:t},e))})))},q=function(e){var t=e.onClose,n=e.onSearch,r=e.searchTerm,o=Object(b.useFocusOnMount)("firstElement"),l=function(e){var t=Object(c.useRef)(),n=Object(c.useRef)(!1),r=Object(c.useRef)([]),o=Object(c.useRef)(e);return o.current=e,Object(c.useLayoutEffect)((function(){!1===n.current&&e.forEach((function(e,n){var o=r.current[n];e!==o&&(h(o,null),h(e,t.current))})),r.current=e}),e),Object(c.useLayoutEffect)((function(){n.current=!1})),Object(c.useCallback)((function(e){h(t,e),n.current=!0;var c,a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return 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 c,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,c=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw c}}}}(e?o.current:r.current);try{for(a.s();!(c=a.n()).done;)h(c.value,e)}catch(e){a.e(e)}finally{a.f()}}),[])}([Object(b.useConstrainedTabbing)(),Object(b.useFocusReturn)(),o]);return Object(c.createElement)(a.Animate,{type:"slide-in",options:{origin:"left"}},(function(e){var o=e.className,a=f()("simpay-help-panel",o);return Object(c.createElement)("div",{ref:l,className:a},Object(c.createElement)(v,{onClose:t}),Object(c.createElement)("div",{className:"simpay-help-panel__search"},Object(c.createElement)(M,{label:Object(s.__)("Search the documentation","stripe"),placeholder:Object(s.__)("Search","stripe"),onChange:n,value:r}),Object(c.createElement)(K,{searchTerm:r})),Object(c.createElement)(x,{searchTerm:r}))}))},J=function(e){var t=e.isOpen,n=e.onClose;return Object(c.useEffect)((function(){return document.body.classList.toggle("simpay-help-body-locked"),function(){document.body.classList.remove("simpay-help-body-locked")}}),[t]),Object(c.createElement)("button",{className:"simpay-help-backdrop",onClick:n})},X=simpayHelp,Y=X.docsSearchTerm,ee=X.docs;function te(e){var t=Object(i.getFragment)(e),n=Y;if(t&&t.includes("/")){var r=t.split("/");t=r[0],n=Object(i.safeDecodeURI)(r[1])}return{hash:t,searchTerm:n}}Object(c.render)(Object(c.createElement)((function(){var e=te(window.location.href),t=e.hash,n=e.searchTerm,r=Object(c.useState)(n),i=o()(r,2),s=i[0],u=i[1],m=Object(c.useState)("#help"===t),f=o()(m,2),b=f[0],d=f[1];function h(){d(!1),window.history.pushState("",document.title,window.location.pathname+window.location.search)}return Object(c.useEffect)((function(){function e(e){var t=te(e.newURL),r=t.hash,o=t.searchTerm;"#help"===r&&d(!0),o!==n&&u(o)}return window.addEventListener("hashchange",e),function(){window.removeEventListener("hashchange",e)}}),[]),Object(c.createElement)("div",{onKeyDown:function(e){e.keyCode!==l.ESCAPE||e.defaultPrevented||(e.preventDefault(),d(!1))},role:"region"},Object(c.createElement)(p,{isOpen:b,onOpen:function(){u(Y),d(!0),window.history.pushState("",document.title,window.location.pathname+window.location.search+"#help")}}),b&&Object(c.createElement)(c.Fragment,null,Object(c.createElement)(q,{onClose:h,onSearch:u,searchTerm:s,docs:ee}),Object(c.createElement)(J,{onClose:h})),Object(c.createElement)(a.Popover.Slot,null))}),null),document.getElementById("simpay-branding-bar-help"))}]); \ No newline at end of file +!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=78)}([function(e,t){e.exports=window.wp.element},,function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wp.components},,,function(e,t,n){var r=n(26),o=n(27),c=n(21),a=n(28);e.exports=function(e,t){return r(e)||o(e,t)||c(e,t)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},,,function(e,t){e.exports=window.wp.primitives},function(e,t){e.exports=window.wp.url},,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;te.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n5&&Object(c.createElement)(a.Button,{variant:"secondary",isSecondary:!0,isSmall:!0,onClick:function(){return m(!0)}},Object(s.__)("View all","stripe"))))},N=simpayHelp,B=N.docs,L=N.docsCategories,R=function(){var e,t=Object(c.useState)("getting-started"),n=o()(t,2),r=n[0],a=n[1];return Object(c.createElement)("div",{className:"simpay-help-panel__categories"},(e=Object(P.groupBy)(B,"categories"),Object(P.map)(e,(function(e,t){return{slug:t,title:L[t]||"",docs:e}}))).map((function(e){return Object(c.createElement)(V,C()({key:e.slug,openCategory:r,setOpenCategory:a},e))})))},I=n(29),G=n.n(I);function D(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(e=(e=Object(P.deburr)(e)).replace(/^\//,"")).toLowerCase()}var W=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Object(P.words)(D(e))};function F(e,t){var n,r,o=e.title||"",c=e.excerpt||"",a=e.categories||[],l=e.tags||[],i=D(t),s=D(o),u=0;if(i===s)u+=30;else if(s.startsWith(i))u+=20;else{var p=[o,c].concat(G()(a),G()(l)).join(" ");0===(n=Object(P.words)(i),r=p,Object(P.differenceWith)(n,W(r),(function(e,t){return t.includes(e)}))).length&&(u+=10)}return u}var U=simpayHelp.docs,Z=function(e){var t=e.searchTerm,n=Object(c.useMemo)((function(){var e=[];return""!==t&&(e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=W(t);if(0===n.length)return e;var r=e.map((function(e){return[e,F(e,t)]})).filter((function(e){return o()(e,2)[1]>0}));return r.sort((function(e,t){var n=o()(e,2)[1];return o()(t,2)[1]-n})),r.map((function(e){return o()(e,1)[0]}))}(U,t)),e}),[t]),r=Object(d.useDebounce)(M.speak,500);Object(c.useEffect)((function(){if(t){var e=n.length,o=Object(s.sprintf)(/* translators: %d: number of results. */ +Object(s._n)("%d result found.","%d results found.",e,"stripe"),e);r(o)}}),[t,r]);var a=!(null==n||!n.length);return Object(c.createElement)("div",{className:"simpay-help-panel__results"},!a&&Object(c.createElement)(R,null),a&&n.map((function(e){return Object(c.createElement)(k,C()({key:e.id,searchTerm:t},e))})))},$=function(e){var t=e.onClose,n=e.onSearch,r=e.searchTerm,o=Object(d.useFocusOnMount)("firstElement"),l=function(e){var t=Object(c.useRef)(),n=Object(c.useRef)(!1),r=Object(c.useRef)([]),o=Object(c.useRef)(e);return o.current=e,Object(c.useLayoutEffect)((function(){!1===n.current&&e.forEach((function(e,n){var o=r.current[n];e!==o&&(h(o,null),h(e,t.current))})),r.current=e}),e),Object(c.useLayoutEffect)((function(){n.current=!1})),Object(c.useCallback)((function(e){h(t,e),n.current=!0;var c,a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return b(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)?b(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,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,c=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw c}}}}(e?o.current:r.current);try{for(a.s();!(c=a.n()).done;)h(c.value,e)}catch(e){a.e(e)}finally{a.f()}}),[])}([Object(d.useConstrainedTabbing)(),Object(d.useFocusReturn)(),o]);return Object(c.createElement)(a.Animate,{type:"slide-in",options:{origin:"left"}},(function(e){var o=e.className,i=m()("simpay-help-panel",o);return Object(c.createElement)("div",{ref:l,className:i},Object(c.createElement)(O,{onClose:t}),Object(c.createElement)("div",{className:"simpay-help-panel__search"},Object(c.createElement)(a.SearchControl,{label:Object(s.__)("Search the documentation","stripe"),placeholder:Object(s.__)("Search","stripe"),onChange:n,value:r}),Object(c.createElement)(Z,{searchTerm:r})),Object(c.createElement)(E,{searchTerm:r}))}))},Q=function(e){var t=e.isOpen,n=e.onClose;return Object(c.useEffect)((function(){return document.body.classList.toggle("simpay-help-body-locked"),function(){document.body.classList.remove("simpay-help-body-locked")}}),[t]),Object(c.createElement)("button",{className:"simpay-help-backdrop",onClick:n})},K=simpayHelp,q=K.docsSearchTerm,J=K.docs;function X(e){var t=Object(i.getFragment)(e),n=q;if(t&&t.includes("/")){var r=t.split("/");t=r[0],n=Object(i.safeDecodeURI)(r[1])}return{hash:t,searchTerm:n}}Object(c.render)(Object(c.createElement)((function(){var e=X(window.location.href),t=e.hash,n=e.searchTerm,r=Object(c.useState)(n),i=o()(r,2),s=i[0],u=i[1],f=Object(c.useState)("#help"===t),m=o()(f,2),d=m[0],b=m[1];function h(){b(!1),window.history.pushState("",document.title,window.location.pathname+window.location.search)}return Object(c.useEffect)((function(){function e(e){var t=X(e.newURL),r=t.hash,o=t.searchTerm;"#help"===r&&b(!0),o!==n&&u(o)}return window.addEventListener("hashchange",e),function(){window.removeEventListener("hashchange",e)}}),[]),Object(c.createElement)("div",{onKeyDown:function(e){e.keyCode!==l.ESCAPE||e.defaultPrevented||(e.preventDefault(),b(!1))},role:"region"},Object(c.createElement)(p,{isOpen:d,onOpen:function(){u(q),b(!0),window.history.pushState("",document.title,window.location.pathname+window.location.search+"#help")}}),d&&Object(c.createElement)(c.Fragment,null,Object(c.createElement)($,{onClose:h,onSearch:u,searchTerm:s,docs:J}),Object(c.createElement)(Q,{onClose:h})),Object(c.createElement)(a.Popover.Slot,null))}),null),document.getElementById("simpay-branding-bar-help"))}]); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-notifications-css.asset.php b/includes/core/assets/js/dist/simpay-admin-notifications-css.asset.php index 2c15c1b4..424a7c35 100644 --- a/includes/core/assets/js/dist/simpay-admin-notifications-css.asset.php +++ b/includes/core/assets/js/dist/simpay-admin-notifications-css.asset.php @@ -1 +1 @@ - array(), 'version' => '30784043ec33dac042e57124a07cd0aa'); \ No newline at end of file + array(), 'version' => 'ccb87477a8bed9b0e8f2ca5242289e30'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-notifications.asset.php b/includes/core/assets/js/dist/simpay-admin-notifications.asset.php index 05a6377e..486e7367 100644 --- a/includes/core/assets/js/dist/simpay-admin-notifications.asset.php +++ b/includes/core/assets/js/dist/simpay-admin-notifications.asset.php @@ -1 +1 @@ - array('lodash', 'moment', 'react', 'react-dom', 'wp-api-fetch', 'wp-autop', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '7a8f10de49c3453462dd59a8e9f8066f'); \ No newline at end of file + array('lodash', 'moment', 'react', 'react-dom', 'wp-api-fetch', 'wp-autop', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '1ed40b7b0e41fd10aa673cfdd11b6a5a'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-notifications.js b/includes/core/assets/js/dist/simpay-admin-notifications.js index 351ccf63..d2b40297 100644 --- a/includes/core/assets/js/dist/simpay-admin-notifications.js +++ b/includes/core/assets/js/dist/simpay-admin-notifications.js @@ -1,3 +1,3 @@ -!function(t){var e={};function n(r){if(e[r])return e[r].exports;var s=e[r]={i:r,l:!1,exports:{}};return t[r].call(s.exports,s,s.exports,n),s.l=!0,s.exports}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 s in t)n.d(r,s,function(e){return t[e]}.bind(null,s));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=82)}([function(t,e){t.exports=window.wp.element},function(t,e,n){"use strict";n.d(e,"w",(function(){return s})),n.d(e,"a",(function(){return Ot})),n.d(e,"b",(function(){return q})),n.d(e,"c",(function(){return jt})),n.d(e,"d",(function(){return yt})),n.d(e,"e",(function(){return H})),n.d(e,"f",(function(){return dt})),n.d(e,"g",(function(){return Rt})),n.d(e,"h",(function(){return _})),n.d(e,"i",(function(){return zt})),n.d(e,"j",(function(){return qt})),n.d(e,"k",(function(){return S})),n.d(e,"l",(function(){return E})),n.d(e,"m",(function(){return M})),n.d(e,"n",(function(){return A})),n.d(e,"o",(function(){return U})),n.d(e,"p",(function(){return gt})),n.d(e,"q",(function(){return bt})),n.d(e,"r",(function(){return mt})),n.d(e,"s",(function(){return x})),n.d(e,"t",(function(){return Lt})),n.d(e,"u",(function(){return k})),n.d(e,"v",(function(){return w})),n.d(e,"x",(function(){return wt})),n.d(e,"y",(function(){return P})),n.d(e,"z",(function(){return Ut})),n.d(e,"A",(function(){return Ft})),n.d(e,"B",(function(){return $t})),n.d(e,"C",(function(){return Qt})),n.d(e,"D",(function(){return Gt}));let r=O();const s=t=>m(t,r);let o=O();s.write=t=>m(t,o);let i=O();s.onStart=t=>m(t,i);let a=O();s.onFrame=t=>m(t,a);let c=O();s.onFinish=t=>m(t,c);let u=[];s.setTimeout=(t,e)=>{let n=s.now()+e,r=()=>{let t=u.findIndex(t=>t.cancel==r);~t&&u.splice(t,1),p-=~t?1:0},o={time:n,handler:t,cancel:r};return u.splice(l(n),0,o),p+=1,b(),o};let l=t=>~(~u.findIndex(e=>e.time>t)||~u.length);s.cancel=t=>{i.delete(t),a.delete(t),r.delete(t),o.delete(t),c.delete(t)},s.sync=t=>{h=!0,s.batchedUpdates(t),h=!1},s.throttle=t=>{let e;function n(){try{t(...e)}finally{e=null}}function r(...t){e=t,s.onStart(n)}return r.handler=t,r.cancel=()=>{i.delete(n),e=null},r};let d="undefined"!=typeof window?window.requestAnimationFrame:()=>{};s.use=t=>d=t,s.now="undefined"!=typeof performance?()=>performance.now():Date.now,s.batchedUpdates=t=>t(),s.catch=console.error,s.frameLoop="always",s.advance=()=>{"demand"!==s.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):y()};let f=-1,p=0,h=!1;function m(t,e){h?(e.delete(t),t(0)):(e.add(t),b())}function b(){f<0&&(f=0,"demand"!==s.frameLoop&&d(g))}function g(){~f&&(d(g),s.batchedUpdates(y))}function y(){let t=f;f=s.now();let e=l(f);e&&(v(u.splice(0,e),t=>t.handler()),p-=e),i.flush(),r.flush(t?Math.min(64,f-t):16.667),a.flush(),o.flush(),c.flush(),p||(f=-1)}function O(){let t=new Set,e=t;return{add(n){p+=e!=t||t.has(n)?0:1,t.add(n)},delete:n=>(p-=e==t&&t.has(n)?1:0,t.delete(n)),flush(n){e.size&&(t=new Set,p-=e.size,v(e,e=>e(n)&&t.add(e)),p+=t.size,e=t)}}}function v(t,e){t.forEach(t=>{try{e(t)}catch(t){s.catch(t)}})}var j=n(5);function w(){}const _=(t,e,n)=>Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0}),x={arr:Array.isArray,obj:t=>!!t&&"Object"===t.constructor.name,fun:t=>"function"==typeof t,str:t=>"string"==typeof t,num:t=>"number"==typeof t,und:t=>void 0===t};function k(t,e){if(x.arr(t)){if(!x.arr(e)||t.length!==e.length)return!1;for(let n=0;nt.forEach(e);function E(t,e,n){if(x.arr(t))for(let r=0;rx.und(t)?[]:x.arr(t)?t:[t];function M(t,e){if(t.size){const n=Array.from(t);t.clear(),S(n,e)}}const A=(t,...e)=>M(t,t=>t(...e)),I=()=>"undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent);let C,R,T=null,N=!1,V=w;var q=Object.freeze({__proto__:null,get createStringInterpolator(){return C},get to(){return R},get colors(){return T},get skipAnimation(){return N},get willAdvance(){return V},assign:t=>{t.to&&(R=t.to),t.now&&(s.now=t.now),void 0!==t.colors&&(T=t.colors),null!=t.skipAnimation&&(N=t.skipAnimation),t.createStringInterpolator&&(C=t.createStringInterpolator),t.requestAnimationFrame&&s.use(t.requestAnimationFrame),t.batchedUpdates&&(s.batchedUpdates=t.batchedUpdates),t.willAdvance&&(V=t.willAdvance),t.frameLoop&&(s.frameLoop=t.frameLoop)}});const D=new Set;let z=[],L=[],F=0;const U={get idle(){return!D.size&&!z.length},start(t){F>t.priority?(D.add(t),s.onStart($)):(Q(t),s(G))},advance:G,sort(t){if(F)s.onFrame(()=>U.sort(t));else{const e=z.indexOf(t);~e&&(z.splice(e,1),B(t))}},clear(){z=[],D.clear()}};function $(){D.forEach(Q),D.clear(),s(G)}function Q(t){z.includes(t)||B(t)}function B(t){z.splice(function(e,n){const r=e.findIndex(e=>e.priority>t.priority);return r<0?e.length:r}(z),0,t)}function G(t){const e=L;for(let n=0;n0}const H={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},W="[-+]?\\d*\\.?\\d+";function Z(...t){return"\\(\\s*("+t.join(")\\s*,\\s*(")+")\\s*\\)"}const Y=new RegExp("rgb"+Z(W,W,W)),J=new RegExp("rgba"+Z(W,W,W,W)),K=new RegExp("hsl"+Z(W,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%")),X=new RegExp("hsla"+Z(W,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%",W)),tt=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,et=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,nt=/^#([0-9a-fA-F]{6})$/,rt=/^#([0-9a-fA-F]{8})$/;function st(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function ot(t,e,n){const r=n<.5?n*(1+e):n+e-n*e,s=2*n-r,o=st(s,r,t+1/3),i=st(s,r,t),a=st(s,r,t-1/3);return Math.round(255*o)<<24|Math.round(255*i)<<16|Math.round(255*a)<<8}function it(t){const e=parseInt(t,10);return e<0?0:e>255?255:e}function at(t){return(parseFloat(t)%360+360)%360/360}function ct(t){const e=parseFloat(t);return e<0?0:e>1?255:Math.round(255*e)}function ut(t){const e=parseFloat(t);return e<0?0:e>100?1:e/100}function lt(t){let e=function(t){let e;return"number"==typeof t?t>>>0===t&&t>=0&&t<=4294967295?t:null:(e=nt.exec(t))?parseInt(e[1]+"ff",16)>>>0:T&&void 0!==T[t]?T[t]:(e=Y.exec(t))?(it(e[1])<<24|it(e[2])<<16|it(e[3])<<8|255)>>>0:(e=J.exec(t))?(it(e[1])<<24|it(e[2])<<16|it(e[3])<<8|ct(e[4]))>>>0:(e=tt.exec(t))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+"ff",16)>>>0:(e=rt.exec(t))?parseInt(e[1],16)>>>0:(e=et.exec(t))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+e[4]+e[4],16)>>>0:(e=K.exec(t))?(255|ot(at(e[1]),ut(e[2]),ut(e[3])))>>>0:(e=X.exec(t))?(ot(at(e[1]),ut(e[2]),ut(e[3]))|ct(e[4]))>>>0:null}(t);return null===e?t:(e=e||0,`rgba(${(4278190080&e)>>>24}, ${(16711680&e)>>>16}, ${(65280&e)>>>8}, ${(255&e)/255})`)}const dt=(t,e,n)=>{if(x.fun(t))return t;if(x.arr(t))return dt({range:t,output:e,extrapolate:n});if(x.str(t.output[0]))return C(t);const r=t,s=r.output,o=r.range||[0,1],i=r.extrapolateLeft||r.extrapolate||"extend",a=r.extrapolateRight||r.extrapolate||"extend",c=r.easing||(t=>t);return t=>{const e=function(t,e){for(var n=1;n=t);++n);return n-1}(t,o);return function(t,e,n,r,s,o,i,a,c){let u=c?c(t):t;if(un){if("identity"===a)return u;"clamp"===a&&(u=n)}return r===s?r:e===n?t<=e?r:s:(e===-1/0?u=-u:n===1/0?u-=e:u=(u-e)/(n-e),u=o(u),r===-1/0?u=-u:s===1/0?u+=r:u=u*(s-r)+r,u)}(t,o[e],o[e+1],s[e],s[e+1],c,i,a,r.map)}};function ft(){return(ft=Object.assign||function(t){for(var e=1;eBoolean(t&&t[pt]),bt=t=>t&&t[pt]?t[pt]():t,gt=t=>t[ht]||null;function yt(t,e){let n=t[ht];n&&n.forEach(t=>{!function(t,e){t.eventObserved?t.eventObserved(e):t(e)}(t,e)})}class Ot{constructor(t){if(this[pt]=void 0,this[ht]=void 0,!t&&!(t=this.get))throw Error("Unknown getter");vt(this,t)}}const vt=(t,e)=>_t(t,pt,e);function jt(t,e){if(t[pt]){let n=t[ht];n||_t(t,ht,n=new Set),n.has(e)||(n.add(e),t.observerAdded&&t.observerAdded(n.size,e))}return e}function wt(t,e){let n=t[ht];if(n&&n.has(e)){const r=n.size-1;r?n.delete(e):t[ht]=null,t.observerRemoved&&t.observerRemoved(r,e)}}const _t=(t,e,n)=>Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0}),xt=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,kt=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,St=new RegExp(`(${xt.source})(%|[a-z]+)`,"i"),Et=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Pt=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,Mt=t=>{const[e,n]=At(t);if(!e||I())return t;const r=window.getComputedStyle(document.documentElement).getPropertyValue(e);if(r)return r.trim();if(n&&n.startsWith("--")){return window.getComputedStyle(document.documentElement).getPropertyValue(n)||t}return n&&Pt.test(n)?Mt(n):n||t},At=t=>{const e=Pt.exec(t);if(!e)return[,];const[,n,r]=e;return[n,r]};let It;const Ct=(t,e,n,r,s)=>`rgba(${Math.round(e)}, ${Math.round(n)}, ${Math.round(r)}, ${s})`,Rt=t=>{It||(It=T?new RegExp(`(${Object.keys(T).join("|")})(?!\\w)`,"g"):/^\b$/);const e=t.output.map(t=>bt(t).replace(Pt,Mt).replace(kt,lt).replace(It,lt)),n=e.map(t=>t.match(xt).map(Number)),r=n[0].map((t,e)=>n.map(t=>{if(!(e in t))throw Error('The arity of each "output" value must be equal');return t[e]})).map(e=>dt(ft({},t,{output:e})));return t=>{var n;const s=!St.test(e[0])&&(null==(n=e.find(t=>St.test(t)))?void 0:n.replace(xt,""));let o=0;return e[0].replace(xt,()=>`${r[o++](t)}${s||""}`).replace(Et,Ct)}},Tt="react-spring: ",Nt=t=>{const e=t;let n=!1;if("function"!=typeof e)throw new TypeError(Tt+"once requires a function parameter");return(...t)=>{n||(e(...t),n=!0)}},Vt=Nt(console.warn);function qt(){Vt(Tt+'The "interpolate" function is deprecated in v9 (use "to" instead)')}const Dt=Nt(console.warn);function zt(){Dt(Tt+'Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions')}function Lt(t){return x.str(t)&&("#"==t[0]||/\d/.test(t)||!I()&&Pt.test(t)||t in(T||{}))}const Ft="undefined"!=typeof window&&window.document&&window.document.createElement?j.useLayoutEffect:j.useEffect;function Ut(){const t=Object(j.useState)()[1],e=(()=>{const t=Object(j.useRef)(!1);return Ft(()=>(t.current=!0,()=>{t.current=!1}),[]),t})();return()=>{e.current&&t(Math.random())}}function $t(t,e){const[n]=Object(j.useState)(()=>({inputs:e,result:t()})),r=Object(j.useRef)(),s=r.current;let o=s;return o?Boolean(e&&o.inputs&&function(t,e){if(t.length!==e.length)return!1;for(let n=0;n{r.current=o,s==n&&(n.inputs=n.result=void 0)},[o]),o.result}const Qt=t=>Object(j.useEffect)(t,Bt),Bt=[];function Gt(t){const e=Object(j.useRef)();return Object(j.useEffect)(()=>{e.current=t}),e.current}},function(t,e){t.exports=window.wp.i18n},function(t,e){t.exports=window.wp.components},,function(t,e){t.exports=window.React},function(t,e,n){var r=n(26),s=n(27),o=n(22),i=n(28);t.exports=function(t,e){return r(t)||s(t,e)||o(t,e)||i()},t.exports.__esModule=!0,t.exports.default=t.exports},,,function(t,e){t.exports=window.wp.primitives},function(t,e){t.exports=window.wp.url},function(t,e,n){var r=n(30);t.exports=function(t,e,n){return(e=r(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=window.lodash},function(t,e,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function s(){for(var t=[],e=0;et&&t[o],a=(t,e)=>Object(r.h)(t,o,e),c=t=>t&&t[o]&&t[o].getPayload();class u{constructor(){this.payload=void 0,a(this,this)}getPayload(){return this.payload||[]}}class l extends u{constructor(t){super(),this.done=!0,this.elapsedTime=void 0,this.lastPosition=void 0,this.lastVelocity=void 0,this.v0=void 0,this.durationProgress=0,this._value=t,r.s.num(this._value)&&(this.lastPosition=this._value)}static create(t){return new l(t)}getPayload(){return[this]}getValue(){return this._value}setValue(t,e){return r.s.num(t)&&(this.lastPosition=t,e&&(t=Math.round(t/e)*e,this.done&&(this.lastPosition=t))),this._value!==t&&(this._value=t,!0)}reset(){const{done:t}=this;this.done=!1,r.s.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,t&&(this.lastVelocity=null),this.v0=null)}}class d extends l{constructor(t){super(0),this._string=null,this._toString=void 0,this._toString=Object(r.f)({output:[t,t]})}static create(t){return new d(t)}getValue(){let t=this._string;return null==t?this._string=this._toString(this._value):t}setValue(t){if(r.s.str(t)){if(t==this._string)return!1;this._string=t,this._value=1}else{if(!super.setValue(t))return!1;this._string=null}return!0}reset(t){t&&(this._toString=Object(r.f)({output:[this.getValue(),t]})),this._value=0,super.reset()}}const f={dependencies:null};class p extends u{constructor(t){super(),this.source=t,this.setValue(t)}getValue(t){const e={};return Object(r.l)(this.source,(n,s)=>{var i;(i=n)&&i[o]===i?e[s]=n.getValue(t):Object(r.r)(n)?e[s]=Object(r.q)(n):t||(e[s]=n)}),e}setValue(t){this.source=t,this.payload=this._makePayload(t)}reset(){this.payload&&Object(r.k)(this.payload,t=>t.reset())}_makePayload(t){if(t){const e=new Set;return Object(r.l)(t,this._addToPayload,e),Array.from(e)}}_addToPayload(t){f.dependencies&&Object(r.r)(t)&&f.dependencies.add(t);const e=c(t);e&&Object(r.k)(e,t=>this.add(t))}}class h extends p{constructor(t){super(t)}static create(t){return new h(t)}getValue(){return this.source.map(t=>t.getValue())}setValue(t){const e=this.getPayload();return t.length==e.length?e.map((e,n)=>e.setValue(t[n])).some(Boolean):(super.setValue(t.map(m)),!0)}}function m(t){return(Object(r.t)(t)?d:l).create(t)}function b(t){const e=i(t);return e?e.constructor:r.s.arr(t)?h:Object(r.t)(t)?d:l}function g(){return(g=Object.assign||function(t){for(var e=1;e{const n=!r.s.fun(t)||t.prototype&&t.prototype.isReactComponent;return Object(s.forwardRef)((o,i)=>{const a=Object(s.useRef)(null),c=n&&Object(s.useCallback)(t=>{a.current=function(t,e){return t&&(r.s.fun(t)?t(e):t.current=e),e}(i,t)},[i]),[u,l]=function(t,e){const n=new Set;return f.dependencies=n,t.style&&(t=g({},t,{style:e.createAnimatedStyle(t.style)})),t=new p(t),f.dependencies=null,[t,n]}(o,e),d=Object(r.z)(),h=()=>{const t=a.current;n&&!t||!1===(!!t&&e.applyAnimatedValues(t,u.getValue(!0)))&&d()},m=new O(h,l),b=Object(s.useRef)();Object(r.A)(()=>(b.current=m,Object(r.k)(l,t=>Object(r.c)(t,m)),()=>{b.current&&(Object(r.k)(b.current.deps,t=>Object(r.x)(t,b.current)),r.w.cancel(b.current.update))})),Object(s.useEffect)(h,[]),Object(r.C)(()=>()=>{const t=b.current;Object(r.k)(t.deps,e=>Object(r.x)(e,t))});const y=e.getComponentProps(u.getValue());return s.createElement(t,g({},y,{ref:c}))})};class O{constructor(t,e){this.update=t,this.deps=e}eventObserved(t){"change"==t.type&&r.w.write(this.update)}}const v=Symbol.for("AnimatedComponent"),j=(t,{applyAnimatedValues:e=(()=>!1),createAnimatedStyle:n=(t=>new p(t)),getComponentProps:s=(t=>t)}={})=>{const o={applyAnimatedValues:e,createAnimatedStyle:n,getComponentProps:s},i=t=>{const e=w(t)||"Anonymous";return(t=r.s.str(t)?i[t]||(i[t]=y(t,o)):t[v]||(t[v]=y(t,o))).displayName=`Animated(${e})`,t};return Object(r.l)(t,(e,n)=>{r.s.arr(t)&&(n=w(e)),i[n]=i(e)}),{animated:i}},w=t=>r.s.str(t)?t:t&&r.s.str(t.displayName)?t.displayName:r.s.fun(t)&&t.name||null},function(t,e){t.exports=window.wp.compose},function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n!0===t||!!(e&&t&&(r.s.fun(t)?t(e):Object(r.y)(t).includes(e))),u=(t,e)=>r.s.obj(t)?e&&t[e]:t,l=(t,e)=>!0===t.default?t[e]:t.default?t.default[e]:void 0,d=t=>t,f=(t,e=d)=>{let n=p;t.default&&!0!==t.default&&(t=t.default,n=Object.keys(t));const s={};for(const o of n){const n=e(t[o],o);r.s.und(n)||(s[o]=n)}return s},p=["config","onProps","onStart","onChange","onPause","onResume","onRest"],h={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function m(t){const e=function(t){const e={};let n=0;if(Object(r.l)(t,(t,r)=>{h[r]||(e[r]=t,n++)}),n)return e}(t);if(e){const n={to:e};return Object(r.l)(t,(t,r)=>r in e||(n[r]=t)),n}return i({},t)}function b(t){return t=Object(r.q)(t),r.s.arr(t)?t.map(b):Object(r.t)(t)?r.b.createStringInterpolator({range:[0,1],output:[t,t]})(1):t}function g(t){for(const e in t)return!0;return!1}function y(t){return r.s.fun(t)||r.s.arr(t)&&r.s.obj(t[0])}function O(t,e){var n;null==(n=t.ref)||n.delete(t),null==e||e.delete(t)}function v(t,e){var n;e&&t.ref!==e&&(null==(n=t.ref)||n.delete(t),e.add(t),t.ref=e)}const j={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}},w=1.70158,_=1.525*w,x=2*Math.PI/3,k=2*Math.PI/4.5,S=t=>{const e=7.5625,n=2.75;return t<1/n?e*t*t:t<2/n?e*(t-=1.5/n)*t+.75:t<2.5/n?e*(t-=2.25/n)*t+.9375:e*(t-=2.625/n)*t+.984375},E={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>1-(1-t)*(1-t),easeInOutQuad:t=>t<.5?2*t*t:1-Math.pow(-2*t+2,2)/2,easeInCubic:t=>t*t*t,easeOutCubic:t=>1-Math.pow(1-t,3),easeInOutCubic:t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2,easeInQuart:t=>t*t*t*t,easeOutQuart:t=>1-Math.pow(1-t,4),easeInOutQuart:t=>t<.5?8*t*t*t*t:1-Math.pow(-2*t+2,4)/2,easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>1-Math.pow(1-t,5),easeInOutQuint:t=>t<.5?16*t*t*t*t*t:1-Math.pow(-2*t+2,5)/2,easeInSine:t=>1-Math.cos(t*Math.PI/2),easeOutSine:t=>Math.sin(t*Math.PI/2),easeInOutSine:t=>-(Math.cos(Math.PI*t)-1)/2,easeInExpo:t=>0===t?0:Math.pow(2,10*t-10),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>0===t?0:1===t?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2,easeInCirc:t=>1-Math.sqrt(1-Math.pow(t,2)),easeOutCirc:t=>Math.sqrt(1-Math.pow(t-1,2)),easeInOutCirc:t=>t<.5?(1-Math.sqrt(1-Math.pow(2*t,2)))/2:(Math.sqrt(1-Math.pow(-2*t+2,2))+1)/2,easeInBack:t=>2.70158*t*t*t-w*t*t,easeOutBack:t=>1+2.70158*Math.pow(t-1,3)+w*Math.pow(t-1,2),easeInOutBack:t=>t<.5?Math.pow(2*t,2)*(7.189819*t-_)/2:(Math.pow(2*t-2,2)*((_+1)*(2*t-2)+_)+2)/2,easeInElastic:t=>0===t?0:1===t?1:-Math.pow(2,10*t-10)*Math.sin((10*t-10.75)*x),easeOutElastic:t=>0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin((10*t-.75)*x)+1,easeInOutElastic:t=>0===t?0:1===t?1:t<.5?-Math.pow(2,20*t-10)*Math.sin((20*t-11.125)*k)/2:Math.pow(2,-20*t+10)*Math.sin((20*t-11.125)*k)/2+1,easeInBounce:t=>1-S(1-t),easeOutBounce:S,easeInOutBounce:t=>t<.5?(1-S(1-2*t))/2:(1+S(2*t-1))/2},P=i({},j.default,{mass:1,damping:1,easing:E.linear,clamp:!1});class M{constructor(){this.tension=void 0,this.friction=void 0,this.frequency=void 0,this.damping=void 0,this.mass=void 0,this.velocity=0,this.restVelocity=void 0,this.precision=void 0,this.progress=void 0,this.duration=void 0,this.easing=void 0,this.clamp=void 0,this.bounce=void 0,this.decay=void 0,this.round=void 0,Object.assign(this,P)}}function A(t,e){if(r.s.und(e.decay)){const n=!r.s.und(e.tension)||!r.s.und(e.friction);!n&&r.s.und(e.frequency)&&r.s.und(e.damping)&&r.s.und(e.mass)||(t.duration=void 0,t.decay=void 0),n&&(t.frequency=void 0)}else t.duration=void 0}const I=[];class C{constructor(){this.changed=!1,this.values=I,this.toValues=null,this.fromValues=I,this.to=void 0,this.from=void 0,this.config=new M,this.immediate=!1}}function R(t,{key:e,props:n,defaultProps:s,state:o,actions:u}){return new Promise((l,d)=>{var f;let p,h,m=c(null!=(f=n.cancel)?f:null==s?void 0:s.cancel,e);if(m)y();else{r.s.und(n.pause)||(o.paused=c(n.pause,e));let t=null==s?void 0:s.pause;!0!==t&&(t=o.paused||c(t,e)),p=a(n.delay||0,e),t?(o.resumeQueue.add(g),u.pause()):(u.resume(),g())}function b(){o.resumeQueue.add(g),o.timeouts.delete(h),h.cancel(),p=h.time-r.w.now()}function g(){p>0&&!r.b.skipAnimation?(o.delayed=!0,h=r.w.setTimeout(y,p),o.pauseQueue.add(b),o.timeouts.add(h)):y()}function y(){o.delayed&&(o.delayed=!1),o.pauseQueue.delete(b),o.timeouts.delete(h),t<=(o.cancelId||0)&&(m=!0);try{u.start(i({},n,{callId:t,cancel:m}),l)}catch(t){d(t)}}})}const T=(t,e)=>1==e.length?e[0]:e.some(t=>t.cancelled)?q(t.get()):e.every(t=>t.noop)?N(t.get()):V(t.get(),e.every(t=>t.finished)),N=t=>({value:t,noop:!0,finished:!0,cancelled:!1}),V=(t,e,n=!1)=>({value:t,finished:e,cancelled:n}),q=t=>({value:t,cancelled:!0,finished:!1});function D(t,e,n,s){const{callId:o,parentId:a,onRest:c}=e,{asyncTo:u,promise:l}=n;return a||t!==u||e.reset?n.promise=(async()=>{n.asyncId=o,n.asyncTo=t;const d=f(e,(t,e)=>"onRest"===e?void 0:t);let p,h;const m=new Promise((t,e)=>(p=t,h=e)),b=t=>{const e=o<=(n.cancelId||0)&&q(s)||o!==n.asyncId&&V(s,!1);if(e)throw t.result=e,h(t),t},g=(t,e)=>{const a=new L,c=new F;return(async()=>{if(r.b.skipAnimation)throw z(n),c.result=V(s,!1),h(c),c;b(a);const u=r.s.obj(t)?i({},t):i({},e,{to:t});u.parentId=o,Object(r.l)(d,(t,e)=>{r.s.und(u[e])&&(u[e]=t)});const l=await s.start(u);return b(a),n.paused&&await new Promise(t=>{n.resumeQueue.add(t)}),l})()};let y;if(r.b.skipAnimation)return z(n),V(s,!1);try{let e;e=r.s.arr(t)?(async t=>{for(const e of t)await g(e)})(t):Promise.resolve(t(g,s.stop.bind(s))),await Promise.all([e.then(p),m]),y=V(s.get(),!0,!1)}catch(t){if(t instanceof L)y=t.result;else{if(!(t instanceof F))throw t;y=t.result}}finally{o==n.asyncId&&(n.asyncId=a,n.asyncTo=a?u:void 0,n.promise=a?l:void 0)}return r.s.fun(c)&&r.w.batchedUpdates(()=>{c(y,s,s.item)}),y})():l}function z(t,e){Object(r.m)(t.timeouts,t=>t.cancel()),t.pauseQueue.clear(),t.resumeQueue.clear(),t.asyncId=t.asyncTo=t.promise=void 0,e&&(t.cancelId=e)}class L extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise."),this.result=void 0}}class F extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const U=t=>t instanceof Q;let $=1;class Q extends r.a{constructor(...t){super(...t),this.id=$++,this.key=void 0,this._priority=0}get priority(){return this._priority}set priority(t){this._priority!=t&&(this._priority=t,this._onPriorityChange(t))}get(){const t=Object(o.e)(this);return t&&t.getValue()}to(...t){return r.b.to(this,t)}interpolate(...t){return Object(r.j)(),r.b.to(this,t)}toJSON(){return this.get()}observerAdded(t){1==t&&this._attach()}observerRemoved(t){0==t&&this._detach()}_attach(){}_detach(){}_onChange(t,e=!1){Object(r.d)(this,{type:"change",parent:this,value:t,idle:e})}_onPriorityChange(t){this.idle||r.o.sort(this),Object(r.d)(this,{type:"priority",parent:this,priority:t})}}const B=Symbol.for("SpringPhase"),G=t=>(1&t[B])>0,H=t=>(2&t[B])>0,W=t=>(4&t[B])>0,Z=(t,e)=>e?t[B]|=3:t[B]&=-3,Y=(t,e)=>e?t[B]|=4:t[B]&=-5;class J extends Q{constructor(t,e){if(super(),this.key=void 0,this.animation=new C,this.queue=void 0,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!r.s.und(t)||!r.s.und(e)){const n=r.s.obj(t)?i({},t):i({},e,{from:t});r.s.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(H(this)||this._state.asyncTo)||W(this)}get goal(){return Object(r.q)(this.animation.to)}get velocity(){const t=Object(o.e)(this);return t instanceof o.c?t.lastVelocity||0:t.getPayload().map(t=>t.lastVelocity||0)}get hasAnimated(){return G(this)}get isAnimating(){return H(this)}get isPaused(){return W(this)}get isDelayed(){return this._state.delayed}advance(t){let e=!0,n=!1;const s=this.animation;let{config:i,toValues:a}=s;const c=Object(o.g)(s.to);!c&&Object(r.r)(s.to)&&(a=Object(r.y)(Object(r.q)(s.to))),s.values.forEach((u,l)=>{if(u.done)return;const d=u.constructor==o.b?1:c?c[l].lastPosition:a[l];let f=s.immediate,p=d;if(!f){if(p=u.lastPosition,i.tension<=0)return void(u.done=!0);let e=u.elapsedTime+=t;const n=s.fromValues[l],o=null!=u.v0?u.v0:u.v0=r.s.arr(i.velocity)?i.velocity[l]:i.velocity;let a;if(r.s.und(i.duration))if(i.decay){const t=!0===i.decay?.998:i.decay,r=Math.exp(-(1-t)*e);p=n+o/(1-t)*(1-r),f=Math.abs(u.lastPosition-p)<.1,a=o*r}else{a=null==u.lastVelocity?o:u.lastVelocity;const e=i.precision||(n==d?.005:Math.min(1,.001*Math.abs(d-n))),s=i.restVelocity||e/10,c=i.clamp?0:i.bounce,l=!r.s.und(c),h=n==d?u.v0>0:ns,m||(f=Math.abs(d-p)<=e,!f));++t)l&&(b=p==d||p>d==h,b&&(a=-a*c,p=d)),a+=(1e-6*-i.tension*(p-d)+.001*-i.friction*a)/i.mass*g,p+=a*g}else{let r=1;i.duration>0&&(this._memoizedDuration!==i.duration&&(this._memoizedDuration=i.duration,u.durationProgress>0&&(u.elapsedTime=i.duration*u.durationProgress,e=u.elapsedTime+=t)),r=(i.progress||0)+e/this._memoizedDuration,r=r>1?1:r<0?0:r,u.durationProgress=r),p=n+i.easing(r)*(d-n),a=(p-u.lastPosition)/t,f=1==r}u.lastVelocity=a,Number.isNaN(p)&&(console.warn("Got NaN while animating:",this),f=!0)}c&&!c[l].done&&(f=!1),f?u.done=!0:e=!1,u.setValue(p,i.round)&&(n=!0)});const u=Object(o.e)(this),l=u.getValue();if(e){const t=Object(r.q)(s.to);l===t&&!n||i.decay?n&&i.decay&&this._onChange(l):(u.setValue(t),this._onChange(t)),this._stop()}else n&&this._onChange(l)}set(t){return r.w.batchedUpdates(()=>{this._stop(),this._focus(t),this._set(t)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(H(this)){const{to:t,config:e}=this.animation;r.w.batchedUpdates(()=>{this._onStart(),e.decay||this._set(t,!1),this._stop()})}return this}update(t){return(this.queue||(this.queue=[])).push(t),this}start(t,e){let n;return r.s.und(t)?(n=this.queue||[],this.queue=[]):n=[r.s.obj(t)?t:i({},e,{to:t})],Promise.all(n.map(t=>this._update(t))).then(t=>T(this,t))}stop(t){const{to:e}=this.animation;return this._focus(this.get()),z(this._state,t&&this._lastCallId),r.w.batchedUpdates(()=>this._stop(e,t)),this}reset(){this._update({reset:!0})}eventObserved(t){"change"==t.type?this._start():"priority"==t.type&&(this.priority=t.priority+1)}_prepareNode(t){const e=this.key||"";let{to:n,from:s}=t;n=r.s.obj(n)?n[e]:n,(null==n||y(n))&&(n=void 0),s=r.s.obj(s)?s[e]:s,null==s&&(s=void 0);const i={to:n,from:s};return G(this)||(t.reverse&&([n,s]=[s,n]),s=Object(r.q)(s),r.s.und(s)?Object(o.e)(this)||this._set(n):this._set(s)),i}_update(t,e){let n=i({},t);const{key:s,defaultProps:o}=this;n.default&&Object.assign(o,f(n,(t,e)=>/^on/.test(e)?u(t,s):t)),st(this,n,"onProps"),ot(this,"onProps",n,this);const a=this._prepareNode(n);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const c=this._state;return R(++this._lastCallId,{key:s,props:n,defaultProps:o,state:c,actions:{pause:()=>{W(this)||(Y(this,!0),Object(r.n)(c.pauseQueue),ot(this,"onPause",V(this,K(this,this.animation.to)),this))},resume:()=>{W(this)&&(Y(this,!1),H(this)&&this._resume(),Object(r.n)(c.resumeQueue),ot(this,"onResume",V(this,K(this,this.animation.to)),this))},start:this._merge.bind(this,a)}}).then(t=>{if(n.loop&&t.finished&&(!e||!t.noop)){const t=X(n);if(t)return this._update(t,!0)}return t})}_merge(t,e,n){if(e.cancel)return this.stop(!0),n(q(this));const s=!r.s.und(t.to),u=!r.s.und(t.from);if(s||u){if(!(e.callId>this._lastToId))return n(q(this));this._lastToId=e.callId}const{key:l,defaultProps:d,animation:f}=this,{to:p,from:h}=f;let{to:m=p,from:g=h}=t;!u||s||e.default&&!r.s.und(m)||(m=g),e.reverse&&([m,g]=[g,m]);const O=!Object(r.u)(g,h);O&&(f.from=g),g=Object(r.q)(g);const v=!Object(r.u)(m,p);v&&this._focus(m);const j=y(e.to),{config:w}=f,{decay:_,velocity:x}=w;(s||u)&&(w.velocity=0),e.config&&!j&&function(t,e,n){n&&(A(n=i({},n),e),e=i({},n,e)),A(t,e),Object.assign(t,e);for(const e in P)null==t[e]&&(t[e]=P[e]);let{mass:s,frequency:o,damping:a}=t;r.s.und(o)||(o<.01&&(o=.01),a<0&&(a=0),t.tension=Math.pow(2*Math.PI/o,2)*s,t.friction=4*Math.PI*a*s/o)}(w,a(e.config,l),e.config!==d.config?a(d.config,l):void 0);let k=Object(o.e)(this);if(!k||r.s.und(m))return n(V(this,!0));const S=r.s.und(e.reset)?u&&!e.default:!r.s.und(g)&&c(e.reset,l),E=S?g:this.get(),M=b(m),I=r.s.num(M)||r.s.arr(M)||Object(r.t)(M),C=!j&&(!I||c(d.immediate||e.immediate,l));if(v){const t=Object(o.f)(m);if(t!==k.constructor){if(!C)throw Error(`Cannot animate between ${k.constructor.name} and ${t.name}, as the "to" prop suggests`);k=this._set(M)}}const R=k.constructor;let T=Object(r.r)(m),z=!1;if(!T){const t=S||!G(this)&&O;(v||t)&&(z=Object(r.u)(b(E),M),T=!z),(Object(r.u)(f.immediate,C)||C)&&Object(r.u)(w.decay,_)&&Object(r.u)(w.velocity,x)||(T=!0)}if(z&&H(this)&&(f.changed&&!S?T=!0:T||this._stop(p)),!j&&((T||Object(r.r)(p))&&(f.values=k.getPayload(),f.toValues=Object(r.r)(m)?null:R==o.b?[1]:Object(r.y)(M)),f.immediate!=C&&(f.immediate=C,C||S||this._set(p)),T)){const{onRest:t}=f;Object(r.k)(rt,t=>st(this,e,t));const s=V(this,K(this,p));Object(r.n)(this._pendingCalls,s),this._pendingCalls.add(n),f.changed&&r.w.batchedUpdates(()=>{f.changed=!S,null==t||t(s,this),S?a(d.onRest,s):null==f.onStart||f.onStart(s,this)})}S&&this._set(E),j?n(D(e.to,e,this._state,this)):T?this._start():H(this)&&!v?this._pendingCalls.add(n):n(N(E))}_focus(t){const e=this.animation;t!==e.to&&(Object(r.p)(this)&&this._detach(),e.to=t,Object(r.p)(this)&&this._attach())}_attach(){let t=0;const{to:e}=this.animation;Object(r.r)(e)&&(Object(r.c)(e,this),U(e)&&(t=e.priority+1)),this.priority=t}_detach(){const{to:t}=this.animation;Object(r.r)(t)&&Object(r.x)(t,this)}_set(t,e=!0){const n=Object(r.q)(t);if(!r.s.und(n)){const t=Object(o.e)(this);if(!t||!Object(r.u)(n,t.getValue())){const s=Object(o.f)(n);t&&t.constructor==s?t.setValue(n):Object(o.h)(this,s.create(n)),t&&r.w.batchedUpdates(()=>{this._onChange(n,e)})}}return Object(o.e)(this)}_onStart(){const t=this.animation;t.changed||(t.changed=!0,ot(this,"onStart",V(this,K(this,t.to)),this))}_onChange(t,e){e||(this._onStart(),a(this.animation.onChange,t,this)),a(this.defaultProps.onChange,t,this),super._onChange(t,e)}_start(){const t=this.animation;Object(o.e)(this).reset(Object(r.q)(t.to)),t.immediate||(t.fromValues=t.values.map(t=>t.lastPosition)),H(this)||(Z(this,!0),W(this)||this._resume())}_resume(){r.b.skipAnimation?this.finish():r.o.start(this)}_stop(t,e){if(H(this)){Z(this,!1);const n=this.animation;Object(r.k)(n.values,t=>{t.done=!0}),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Object(r.d)(this,{type:"idle",parent:this});const s=e?q(this.get()):V(this.get(),K(this,null!=t?t:n.to));Object(r.n)(this._pendingCalls,s),n.changed&&(n.changed=!1,ot(this,"onRest",s,this))}}}function K(t,e){const n=b(e),s=b(t.get());return Object(r.u)(s,n)}function X(t,e=t.loop,n=t.to){let r=a(e);if(r){const s=!0!==r&&m(r),o=(s||t).reverse,a=!s||s.reset;return tt(i({},t,{loop:e,default:!1,pause:void 0,to:!o||y(n)?n:void 0,from:a?t.from:void 0,reset:a},s))}}function tt(t){const{to:e,from:n}=t=m(t),s=new Set;return r.s.obj(e)&&nt(e,s),r.s.obj(n)&&nt(n,s),t.keys=s.size?Array.from(s):null,t}function et(t){const e=tt(t);return r.s.und(e.default)&&(e.default=f(e)),e}function nt(t,e){Object(r.l)(t,(t,n)=>null!=t&&e.add(n))}const rt=["onStart","onRest","onChange","onPause","onResume"];function st(t,e,n){t.animation[n]=e[n]!==l(e,n)?u(e[n],t.key):void 0}function ot(t,e,...n){var r,s,o,i;null==(r=(s=t.animation)[e])||r.call(s,...n),null==(o=(i=t.defaultProps)[e])||o.call(i,...n)}const it=["onStart","onChange","onRest"];let at=1;class ct{constructor(t,e){this.id=at++,this.springs={},this.queue=[],this.ref=void 0,this._flush=void 0,this._initialProps=void 0,this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._item=void 0,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),e&&(this._flush=e),t&&this.start(i({default:!0},t))}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(t=>t.idle&&!t.isDelayed&&!t.isPaused)}get item(){return this._item}set item(t){this._item=t}get(){const t={};return this.each((e,n)=>t[n]=e.get()),t}set(t){for(const e in t){const n=t[e];r.s.und(n)||this.springs[e].set(n)}}update(t){return t&&this.queue.push(tt(t)),this}start(t){let{queue:e}=this;return t?e=Object(r.y)(t).map(tt):this.queue=[],this._flush?this._flush(this,e):(ht(this,e),ut(this,e))}stop(t,e){if(t!==!!t&&(e=t),e){const n=this.springs;Object(r.k)(Object(r.y)(e),e=>n[e].stop(!!t))}else z(this._state,this._lastAsyncId),this.each(e=>e.stop(!!t));return this}pause(t){if(r.s.und(t))this.start({pause:!0});else{const e=this.springs;Object(r.k)(Object(r.y)(t),t=>e[t].pause())}return this}resume(t){if(r.s.und(t))this.start({pause:!1});else{const e=this.springs;Object(r.k)(Object(r.y)(t),t=>e[t].resume())}return this}each(t){Object(r.l)(this.springs,t)}_onFrame(){const{onStart:t,onChange:e,onRest:n}=this._events,s=this._active.size>0,o=this._changed.size>0;(s&&!this._started||o&&!this._started)&&(this._started=!0,Object(r.m)(t,([t,e])=>{e.value=this.get(),t(e,this,this._item)}));const i=!s&&this._started,a=o||i&&n.size?this.get():null;o&&e.size&&Object(r.m)(e,([t,e])=>{e.value=a,t(e,this,this._item)}),i&&(this._started=!1,Object(r.m)(n,([t,e])=>{e.value=a,t(e,this,this._item)}))}eventObserved(t){if("change"==t.type)this._changed.add(t.parent),t.idle||this._active.add(t.parent);else{if("idle"!=t.type)return;this._active.delete(t.parent)}r.w.onFrame(this._onFrame)}}function ut(t,e){return Promise.all(e.map(e=>async function t(e,n,s){const{keys:o,to:i,from:a,loop:c,onRest:u,onResolve:d}=n,f=r.s.obj(n.default)&&n.default;c&&(n.loop=!1),!1===i&&(n.to=null),!1===a&&(n.from=null);const p=r.s.arr(i)||r.s.fun(i)?i:void 0;p?(n.to=void 0,n.onRest=void 0,f&&(f.onRest=void 0)):Object(r.k)(it,t=>{const s=n[t];if(r.s.fun(s)){const r=e._events[t];n[t]=({finished:t,cancelled:e})=>{const n=r.get(s);n?(t||(n.finished=!1),e&&(n.cancelled=!0)):r.set(s,{value:null,finished:t||!1,cancelled:e||!1})},f&&(f[t]=n[t])}});const h=e._state;n.pause===!h.paused?(h.paused=n.pause,Object(r.n)(n.pause?h.pauseQueue:h.resumeQueue)):h.paused&&(n.pause=!0);const m=(o||Object.keys(e.springs)).map(t=>e.springs[t].start(n)),b=!0===n.cancel||!0===l(n,"cancel");(p||b&&h.asyncId)&&m.push(R(++e._lastAsyncId,{props:n,state:h,actions:{pause:r.v,resume:r.v,start(t,n){b?(z(h,e._lastAsyncId),n(q(e))):(t.onRest=u,n(D(p,t,h,e)))}}})),h.paused&&await new Promise(t=>{h.resumeQueue.add(t)});const g=T(e,await Promise.all(m));if(c&&g.finished&&(!s||!g.noop)){const r=X(n,c,i);if(r)return ht(e,[r]),t(e,r,!0)}return d&&r.w.batchedUpdates(()=>d(g,e,e.item)),g}(t,e))).then(e=>T(t,e))}function lt(t,e){const n=i({},t.springs);return e&&Object(r.k)(Object(r.y)(e),t=>{r.s.und(t.keys)&&(t=tt(t)),r.s.obj(t.to)||(t=i({},t,{to:void 0})),pt(n,t,t=>ft(t))}),dt(t,n),n}function dt(t,e){Object(r.l)(e,(e,n)=>{t.springs[n]||(t.springs[n]=e,Object(r.c)(e,t))})}function ft(t,e){const n=new J;return n.key=t,e&&Object(r.c)(n,e),n}function pt(t,e,n){e.keys&&Object(r.k)(e.keys,r=>{(t[r]||(t[r]=n(r)))._prepareNode(e)})}function ht(t,e){Object(r.k)(e,e=>{pt(t.springs,e,e=>ft(e,t))})}const mt=["children"],bt=t=>{let{children:e}=t,n=function(t,e){if(null==t)return{};var n,r,s={},o=Object.keys(t);for(r=0;r=0||(s[n]=t[n]);return s}(t,mt);const o=Object(s.useContext)(gt),i=n.pause||!!o.pause,a=n.immediate||!!o.immediate;n=Object(r.B)(()=>({pause:i,immediate:a}),[i,a]);const{Provider:c}=gt;return s.createElement(c,{value:n},e)},gt=(yt=bt,Ot={},Object.assign(yt,s.createContext(Ot)),yt.Provider._context=yt,yt.Consumer._context=yt,yt);var yt,Ot;bt.Provider=gt.Provider,bt.Consumer=gt.Consumer;const vt=()=>{const t=[],e=function(e){Object(r.i)();const s=[];return Object(r.k)(t,(t,o)=>{if(r.s.und(e))s.push(t.start());else{const r=n(e,t,o);r&&s.push(t.start(r))}}),s};e.current=t,e.add=function(e){t.includes(e)||t.push(e)},e.delete=function(e){const n=t.indexOf(e);~n&&t.splice(n,1)},e.pause=function(){return Object(r.k)(t,t=>t.pause(...arguments)),this},e.resume=function(){return Object(r.k)(t,t=>t.resume(...arguments)),this},e.set=function(e){Object(r.k)(t,t=>t.set(e))},e.start=function(e){const n=[];return Object(r.k)(t,(t,s)=>{if(r.s.und(e))n.push(t.start());else{const r=this._getProps(e,t,s);r&&n.push(t.start(r))}}),n},e.stop=function(){return Object(r.k)(t,t=>t.stop(...arguments)),this},e.update=function(e){return Object(r.k)(t,(t,n)=>t.update(this._getProps(e,t,n))),this};const n=function(t,e,n){return r.s.fun(t)?t(n,e):t};return e._getProps=n,e};function jt(t,e,n){const o=r.s.fun(e)&&e;o&&!n&&(n=[]);const a=Object(s.useMemo)(()=>o||3==arguments.length?vt():void 0,[]),c=Object(s.useRef)(0),u=Object(r.z)(),l=Object(s.useMemo)(()=>({ctrls:[],queue:[],flush(t,e){const n=lt(t,e);return c.current>0&&!l.queue.length&&!Object.keys(n).some(e=>!t.springs[e])?ut(t,e):new Promise(r=>{dt(t,n),l.queue.push(()=>{r(ut(t,e))}),u()})}}),[]),d=Object(s.useRef)([...l.ctrls]),f=[],p=Object(r.D)(t)||0;function h(t,n){for(let r=t;r{Object(r.k)(d.current.slice(t,p),t=>{O(t,a),t.stop(!0)}),d.current.length=t,h(p,t)},[t]),Object(s.useMemo)(()=>{h(0,Math.min(p,t))},n);const m=d.current.map((t,e)=>lt(t,f[e])),b=Object(s.useContext)(bt),y=Object(r.D)(b),j=b!==y&&g(b);Object(r.A)(()=>{c.current++,l.ctrls=d.current;const{queue:t}=l;t.length&&(l.queue=[],Object(r.k)(t,t=>t())),Object(r.k)(d.current,(t,e)=>{null==a||a.add(t),j&&t.start({default:b});const n=f[e];n&&(v(t,n.ref),t.ref?t.queue.push(n):t.start(n))})}),Object(r.C)(()=>()=>{Object(r.k)(l.ctrls,t=>t.stop(!0))});const w=m.map(t=>i({},t));return a?[w,a]:w}function wt(t,e){const n=r.s.fun(t),[[s],o]=jt(1,n?t:[t],n?e||[]:e);return n||2==arguments.length?[s,o]:s}let _t;function xt(t,e,n){const o=r.s.fun(e)&&e,{reset:c,sort:u,trail:l=0,expires:d=!0,exitBeforeEnter:p=!1,onDestroyed:h,ref:b,config:y}=o?o():e,j=Object(s.useMemo)(()=>o||3==arguments.length?vt():void 0,[]),w=Object(r.y)(t),_=[],x=Object(s.useRef)(null),k=c?null:x.current;Object(r.A)(()=>{x.current=_}),Object(r.C)(()=>(Object(r.k)(x.current,t=>{var e;null==(e=t.ctrl.ref)||e.add(t.ctrl);const n=C.get(t);n&&t.ctrl.start(n.payload)}),()=>{Object(r.k)(x.current,t=>{t.expired&&clearTimeout(t.expirationId),O(t.ctrl,j),t.ctrl.stop(!0)})}));const S=St(w,o?o():e,k),E=c&&x.current||[];Object(r.A)(()=>Object(r.k)(E,({ctrl:t,item:e,key:n})=>{O(t,j),a(h,e,n)}));const P=[];if(k&&Object(r.k)(k,(t,e)=>{t.expired?(clearTimeout(t.expirationId),E.push(t)):~(e=P[e]=S.indexOf(t.key))&&(_[e]=t)}),Object(r.k)(w,(t,e)=>{_[e]||(_[e]={key:S[e],item:t,phase:_t.MOUNT,ctrl:new ct},_[e].ctrl.item=t)}),P.length){let t=-1;const{leave:n}=o?o():e;Object(r.k)(P,(e,r)=>{const s=k[r];~e?(t=_.indexOf(s),_[t]=i({},s,{item:w[e]})):n&&_.splice(++t,0,s)})}r.s.fun(u)&&_.sort((t,e)=>u(t.item,e.item));let M=-l;const A=Object(r.z)(),I=f(e),C=new Map,R=Object(s.useRef)(new Map),T=Object(s.useRef)(!1);Object(r.k)(_,(t,n)=>{const s=t.key,c=t.phase,u=o?o():e;let f,h,g=a(u.delay||0,s);if(c==_t.MOUNT)f=u.enter,h=_t.ENTER;else{const t=S.indexOf(s)<0;if(c!=_t.LEAVE)if(t)f=u.leave,h=_t.LEAVE;else{if(!(f=u.update))return;h=_t.UPDATE}else{if(t)return;f=u.enter,h=_t.ENTER}}if(f=a(f,t.item,n),f=r.s.obj(f)?m(f):{to:f},!f.config){const e=y||I.config;f.config=a(e,t.item,n,h)}M+=l;const O=i({},I,{delay:g+M,ref:b,immediate:u.immediate,reset:!1},f);if(h==_t.ENTER&&r.s.und(O.from)){const s=o?o():e,i=r.s.und(s.initial)||k?s.from:s.initial;O.from=a(i,t.item,n)}const{onResolve:v}=O;O.onResolve=t=>{a(v,t);const e=x.current,n=e.find(t=>t.key===s);if(n&&(!t.cancelled||n.phase==_t.UPDATE)&&n.ctrl.idle){const t=e.every(t=>t.ctrl.idle);if(n.phase==_t.LEAVE){const e=a(d,n.item);if(!1!==e){const r=!0===e?0:e;if(n.expired=!0,!t&&r>0)return void(r<=2147483647&&(n.expirationId=setTimeout(A,r)))}}t&&e.some(t=>t.expired)&&(R.current.delete(n),p&&(T.current=!0),A())}};const j=lt(t.ctrl,O);h===_t.LEAVE&&p?R.current.set(t,{phase:h,springs:j,payload:O}):C.set(t,{phase:h,springs:j,payload:O})});const N=Object(s.useContext)(bt),V=Object(r.D)(N),q=N!==V&&g(N);Object(r.A)(()=>{q&&Object(r.k)(_,t=>{t.ctrl.start({default:N})})},[N]),Object(r.k)(C,(t,e)=>{if(R.current.size){const t=_.findIndex(t=>t.key===e.key);_.splice(t,1)}}),Object(r.A)(()=>{Object(r.k)(R.current.size?R.current:C,({phase:t,payload:e},n)=>{const{ctrl:r}=n;n.phase=t,null==j||j.add(r),q&&t==_t.ENTER&&r.start({default:N}),e&&(v(r,e.ref),r.ref&&!T.current?r.update(e):(r.start(e),T.current&&(T.current=!1)))})},c?void 0:n);const D=t=>s.createElement(s.Fragment,null,_.map((e,n)=>{const{springs:o}=C.get(e)||e.ctrl,a=t(i({},o),e.item,e,n);return a&&a.type?s.createElement(a.type,i({},a.props,{key:r.s.str(e.key)||r.s.num(e.key)?e.key:e.ctrl.id,ref:a.ref})):a}));return j?[D,j]:D}!function(t){t.MOUNT="mount",t.ENTER="enter",t.UPDATE="update",t.LEAVE="leave"}(_t||(_t={}));let kt=1;function St(t,{key:e,keys:n=e},s){if(null===n){const e=new Set;return t.map(t=>{const n=s&&s.find(n=>n.item===t&&n.phase!==_t.LEAVE&&!e.has(n));return n?(e.add(n),n.key):kt++})}return r.s.und(n)?t:r.s.fun(n)?t.map(n):Object(r.y)(n)}class Et extends Q{constructor(t,e){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=t,this.calc=Object(r.f)(...e);const n=this._get(),s=Object(o.f)(n);Object(o.h)(this,s.create(n))}advance(t){const e=this._get(),n=this.get();Object(r.u)(e,n)||(Object(o.e)(this).setValue(e),this._onChange(e,this.idle)),!this.idle&&Mt(this._active)&&At(this)}_get(){const t=r.s.arr(this.source)?this.source.map(r.q):Object(r.y)(Object(r.q)(this.source));return this.calc(...t)}_start(){this.idle&&!Mt(this._active)&&(this.idle=!1,Object(r.k)(Object(o.g)(this),t=>{t.done=!1}),r.b.skipAnimation?(r.w.batchedUpdates(()=>this.advance()),At(this)):r.o.start(this))}_attach(){let t=1;Object(r.k)(Object(r.y)(this.source),e=>{Object(r.r)(e)&&Object(r.c)(e,this),U(e)&&(e.idle||this._active.add(e),t=Math.max(t,e.priority+1))}),this.priority=t,this._start()}_detach(){Object(r.k)(Object(r.y)(this.source),t=>{Object(r.r)(t)&&Object(r.x)(t,this)}),this._active.clear(),At(this)}eventObserved(t){"change"==t.type?t.idle?this.advance():(this._active.add(t.parent),this._start()):"idle"==t.type?this._active.delete(t.parent):"priority"==t.type&&(this.priority=Object(r.y)(this.source).reduce((t,e)=>Math.max(t,(U(e)?e.priority:0)+1),0))}}function Pt(t){return!1!==t.idle}function Mt(t){return!t.size||Array.from(t).every(Pt)}function At(t){t.idle||(t.idle=!0,Object(r.k)(Object(o.g)(t),t=>{t.done=!0}),Object(r.d)(t,{type:"idle",parent:t}))}r.b.assign({createStringInterpolator:r.g,to:(t,e)=>new Et(t,e)}),r.o.advance},,function(t,e){t.exports=window.regeneratorRuntime},,,function(t,e,n){"use strict";n.d(e,"animated",(function(){return _}));var r=n(43);n.o(r,"config")&&n.d(e,"config",(function(){return r.config})),n.o(r,"useSpring")&&n.d(e,"useSpring",(function(){return r.useSpring})),n.o(r,"useTransition")&&n.d(e,"useTransition",(function(){return r.useTransition}));var s=n(55),o=n(1),i=n(19);function a(t,e){if(null==t)return{};var n,r,s={},o=Object.keys(t);for(r=0;r=0||(s[n]=t[n]);return s}const c=["style","children","scrollTop","scrollLeft"],u=/^--/;function l(t,e){return null==e||"boolean"==typeof e||""===e?"":"number"!=typeof e||0===e||u.test(t)||f.hasOwnProperty(t)&&f[t]?(""+e).trim():e+"px"}const d={};let f={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};const p=["Webkit","Ms","Moz","O"];f=Object.keys(f).reduce((t,e)=>(p.forEach(n=>t[((t,e)=>t+e.charAt(0).toUpperCase()+e.substring(1))(n,e)]=t[e]),t),f);const h=["x","y","z"],m=/^(matrix|translate|scale|rotate|skew)/,b=/^(translate)/,g=/^(rotate|skew)/,y=(t,e)=>o.s.num(t)&&0!==t?t+e:t,O=(t,e)=>o.s.arr(t)?t.every(t=>O(t,e)):o.s.num(t)?t===e:parseFloat(t)===e;class v extends i.a{constructor(t){let{x:e,y:n,z:r}=t,s=a(t,h);const i=[],c=[];(e||n||r)&&(i.push([e||0,n||0,r||0]),c.push(t=>[`translate3d(${t.map(t=>y(t,"px")).join(",")})`,O(t,0)])),Object(o.l)(s,(t,e)=>{if("transform"===e)i.push([t||""]),c.push(t=>[t,""===t]);else if(m.test(e)){if(delete s[e],o.s.und(t))return;const n=b.test(e)?"px":g.test(e)?"deg":"";i.push(Object(o.y)(t)),c.push("rotate3d"===e?([t,e,r,s])=>[`rotate3d(${t},${e},${r},${y(s,n)})`,O(s,0)]:t=>[`${e}(${t.map(t=>y(t,n)).join(",")})`,O(t,e.startsWith("scale")?1:0)])}}),i.length&&(s.transform=new j(i,c)),super(s)}}class j extends o.a{constructor(t,e){super(),this._value=null,this.inputs=t,this.transforms=e}get(){return this._value||(this._value=this._get())}_get(){let t="",e=!0;return Object(o.k)(this.inputs,(n,r)=>{const s=Object(o.q)(n[0]),[i,a]=this.transforms[r](o.s.arr(s)?s:n.map(o.q));t+=" "+i,e=e&&a}),e?"none":t}observerAdded(t){1==t&&Object(o.k)(this.inputs,t=>Object(o.k)(t,t=>Object(o.r)(t)&&Object(o.c)(t,this)))}observerRemoved(t){0==t&&Object(o.k)(this.inputs,t=>Object(o.k)(t,t=>Object(o.r)(t)&&Object(o.x)(t,this)))}eventObserved(t){"change"==t.type&&(this._value=null),Object(o.d)(this,t)}}const w=["scrollTop","scrollLeft"];r.Globals.assign({batchedUpdates:s.unstable_batchedUpdates,createStringInterpolator:o.g,colors:o.e});const _=Object(i.d)(["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"],{applyAnimatedValues:function(t,e){if(!t.nodeType||!t.setAttribute)return!1;const n="filter"===t.nodeName||t.parentNode&&"filter"===t.parentNode.nodeName,r=e,{style:s,children:o,scrollTop:i,scrollLeft:f}=r,p=a(r,c),h=Object.values(p),m=Object.keys(p).map(e=>n||t.hasAttribute(e)?e:d[e]||(d[e]=e.replace(/([A-Z])/g,t=>"-"+t.toLowerCase())));void 0!==o&&(t.textContent=o);for(let e in s)if(s.hasOwnProperty(e)){const n=l(e,s[e]);u.test(e)?t.style.setProperty(e,n):t.style[e]=n}m.forEach((e,n)=>{t.setAttribute(e,h[n])}),void 0!==i&&(t.scrollTop=i),void 0!==f&&(t.scrollLeft=f)},createAnimatedStyle:t=>new v(t),getComponentProps:t=>a(t,w)}).animated},function(t,e){},function(t,e){},,,,,function(t,e){t.exports=window.ReactDOM},function(t,e){t.exports=window.moment},function(t,e){t.exports=window.wp.autop},function(t,e){function n(t,e,n,r,s,o,i){try{var a=t[o](i),c=a.value}catch(t){return void n(t)}a.done?e(c):Promise.resolve(c).then(r,s)}t.exports=function(t){return function(){var e=this,r=arguments;return new Promise((function(s,o){var i=t.apply(e,r);function a(t){n(i,s,o,a,c,"next",t)}function c(t){n(i,s,o,a,c,"throw",t)}a(void 0)}))}},t.exports.__esModule=!0,t.exports.default=t.exports},,,,,,,,,,,function(t,e,n){"use strict";var r=n(0),s=n(9);const o=Object(r.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(s.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"}));e.a=o},,,,,,,,,,,,,function(t,e,n){"use strict";n.r(e);var r=n(6),s=n.n(r),o=n(0),i=n(25),a=n.n(i),c=n(41),u=n(10),l=n(11),d=n.n(l);function f(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}function p(t){for(var e=1;e0&&Object(o.createElement)(m.animated.span,{style:r,className:"simpay-branding-bar__actions-button-count","aria-label":Object(b.sprintf)(/* translators: %d Unread notification count. */ -Object(b.__)("%d unread notifications","stripe"),e)},Object(o.createElement)("span",null,e)),Object(o.createElement)("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(o.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.8333 2.5H4.16667C3.25 2.5 2.5 3.25 2.5 4.16667V15.8333c0 .9167.74167 1.6667 1.66667 1.6667H15.8333c.9167 0 1.6667-.75 1.6667-1.6667V4.16667C17.5 3.25 16.75 2.5 15.8333 2.5Zm0 13.3333H4.16667v-2.5h2.96666C7.70833 14.325 8.775 15 10.0083 15c1.2334 0 2.2917-.675 2.875-1.6667h2.95v2.5Zm-4.1583-4.1666h4.1583V4.16667H4.16667v7.50003h4.175c0 .9166.75 1.6666 1.66663 1.6666.9167 0 1.6667-.75 1.6667-1.6666Z",fill:"currentColor"})))},y=n(56),O=n.n(y),v=n(3),j=n(57),w="simpay-notifications-notification",_=simpayNotifications.isLite;function x(t){switch(t){case"warning":return"warning";case"error":return"dismiss";case"info":return"admin-generic";case"success":default:return"yes-alt"}}function k(t){return Object(u.getAuthority)(window.location.href)!==Object(u.getAuthority)(t)}function S(t,e,n){return!1===k(t)?t:Object(u.addQueryArgs)(t.replace(/\/?$/,"/"),{utm_source:"WordPress",utm_campaign:"1"===_?"lite-plugin":"pro-plugin",utm_medium:e,utm_content:n})}var E=function(t){var e=t.notification,n=t.onDismissNotification,r=e.id,s=e.title,i=e.content,a=e.type,c=e.start,u=e.actions,l=e.is_dismissible;return Object(o.createElement)("div",{className:w,style:{backgroundColor:l?"transparent":"#fafafa"}},Object(o.createElement)("div",{className:"".concat(w,"__icon ").concat(w,"__icon-").concat(a||"success")},Object(o.createElement)("span",{className:"dashicons dashicons-".concat(x(a))})),Object(o.createElement)("div",{className:"".concat(w,"__body")},Object(o.createElement)("div",{className:"".concat(w,"__header")},Object(o.createElement)("div",{className:"".concat(w,"__title")},s),l&&Object(o.createElement)("div",{className:"".concat(w,"__date")},O.a.unix(c).fromNow())),Object(o.createElement)("div",{className:"".concat(w,"__content"),dangerouslySetInnerHTML:{__html:Object(j.autop)(i)}}),Object(o.createElement)("div",{className:"".concat(w,"__actions")},u.map((function(t){var e=t.type,n=t.text,r=t.url;return Object(o.createElement)(v.Button,{key:n,href:S(r,"notification-inbox",s),isPrimary:"primary"===e,isSecondary:"secondary"===e,variant:e,target:k(r)?"_blank":"_self"},n)})),l&&Object(o.createElement)(v.Button,{isLink:!0,variant:"link",onClick:function(){return n(r)}},Object(b.__)("Dismiss","stripe")))))},P=n(58),M=n.n(P),A=n(45),I=n.n(A),C=n(13),R=n.n(C),T=n(12),N=n(20);function V(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nm(t,r);let o=O();s.write=t=>m(t,o);let i=O();s.onStart=t=>m(t,i);let a=O();s.onFrame=t=>m(t,a);let c=O();s.onFinish=t=>m(t,c);let u=[];s.setTimeout=(t,e)=>{let n=s.now()+e,r=()=>{let t=u.findIndex(t=>t.cancel==r);~t&&u.splice(t,1),p-=~t?1:0},o={time:n,handler:t,cancel:r};return u.splice(l(n),0,o),p+=1,b(),o};let l=t=>~(~u.findIndex(e=>e.time>t)||~u.length);s.cancel=t=>{i.delete(t),a.delete(t),r.delete(t),o.delete(t),c.delete(t)},s.sync=t=>{h=!0,s.batchedUpdates(t),h=!1},s.throttle=t=>{let e;function n(){try{t(...e)}finally{e=null}}function r(...t){e=t,s.onStart(n)}return r.handler=t,r.cancel=()=>{i.delete(n),e=null},r};let d="undefined"!=typeof window?window.requestAnimationFrame:()=>{};s.use=t=>d=t,s.now="undefined"!=typeof performance?()=>performance.now():Date.now,s.batchedUpdates=t=>t(),s.catch=console.error,s.frameLoop="always",s.advance=()=>{"demand"!==s.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):y()};let f=-1,p=0,h=!1;function m(t,e){h?(e.delete(t),t(0)):(e.add(t),b())}function b(){f<0&&(f=0,"demand"!==s.frameLoop&&d(g))}function g(){~f&&(d(g),s.batchedUpdates(y))}function y(){let t=f;f=s.now();let e=l(f);e&&(v(u.splice(0,e),t=>t.handler()),p-=e),i.flush(),r.flush(t?Math.min(64,f-t):16.667),a.flush(),o.flush(),c.flush(),p||(f=-1)}function O(){let t=new Set,e=t;return{add(n){p+=e!=t||t.has(n)?0:1,t.add(n)},delete:n=>(p-=e==t&&t.has(n)?1:0,t.delete(n)),flush(n){e.size&&(t=new Set,p-=e.size,v(e,e=>e(n)&&t.add(e)),p+=t.size,e=t)}}}function v(t,e){t.forEach(t=>{try{e(t)}catch(t){s.catch(t)}})}var j=n(5);function w(){}const _=(t,e,n)=>Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0}),x={arr:Array.isArray,obj:t=>!!t&&"Object"===t.constructor.name,fun:t=>"function"==typeof t,str:t=>"string"==typeof t,num:t=>"number"==typeof t,und:t=>void 0===t};function k(t,e){if(x.arr(t)){if(!x.arr(e)||t.length!==e.length)return!1;for(let n=0;nt.forEach(e);function E(t,e,n){if(x.arr(t))for(let r=0;rx.und(t)?[]:x.arr(t)?t:[t];function M(t,e){if(t.size){const n=Array.from(t);t.clear(),S(n,e)}}const A=(t,...e)=>M(t,t=>t(...e)),I=()=>"undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent);let C,R,T=null,N=!1,V=w;var q=Object.freeze({__proto__:null,get createStringInterpolator(){return C},get to(){return R},get colors(){return T},get skipAnimation(){return N},get willAdvance(){return V},assign:t=>{t.to&&(R=t.to),t.now&&(s.now=t.now),void 0!==t.colors&&(T=t.colors),null!=t.skipAnimation&&(N=t.skipAnimation),t.createStringInterpolator&&(C=t.createStringInterpolator),t.requestAnimationFrame&&s.use(t.requestAnimationFrame),t.batchedUpdates&&(s.batchedUpdates=t.batchedUpdates),t.willAdvance&&(V=t.willAdvance),t.frameLoop&&(s.frameLoop=t.frameLoop)}});const D=new Set;let z=[],L=[],F=0;const U={get idle(){return!D.size&&!z.length},start(t){F>t.priority?(D.add(t),s.onStart($)):(Q(t),s(G))},advance:G,sort(t){if(F)s.onFrame(()=>U.sort(t));else{const e=z.indexOf(t);~e&&(z.splice(e,1),B(t))}},clear(){z=[],D.clear()}};function $(){D.forEach(Q),D.clear(),s(G)}function Q(t){z.includes(t)||B(t)}function B(t){z.splice(function(e,n){const r=e.findIndex(e=>e.priority>t.priority);return r<0?e.length:r}(z),0,t)}function G(t){const e=L;for(let n=0;n0}const H={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},W="[-+]?\\d*\\.?\\d+";function Z(...t){return"\\(\\s*("+t.join(")\\s*,\\s*(")+")\\s*\\)"}const Y=new RegExp("rgb"+Z(W,W,W)),J=new RegExp("rgba"+Z(W,W,W,W)),K=new RegExp("hsl"+Z(W,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%")),X=new RegExp("hsla"+Z(W,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%",W)),tt=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,et=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,nt=/^#([0-9a-fA-F]{6})$/,rt=/^#([0-9a-fA-F]{8})$/;function st(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function ot(t,e,n){const r=n<.5?n*(1+e):n+e-n*e,s=2*n-r,o=st(s,r,t+1/3),i=st(s,r,t),a=st(s,r,t-1/3);return Math.round(255*o)<<24|Math.round(255*i)<<16|Math.round(255*a)<<8}function it(t){const e=parseInt(t,10);return e<0?0:e>255?255:e}function at(t){return(parseFloat(t)%360+360)%360/360}function ct(t){const e=parseFloat(t);return e<0?0:e>1?255:Math.round(255*e)}function ut(t){const e=parseFloat(t);return e<0?0:e>100?1:e/100}function lt(t){let e=function(t){let e;return"number"==typeof t?t>>>0===t&&t>=0&&t<=4294967295?t:null:(e=nt.exec(t))?parseInt(e[1]+"ff",16)>>>0:T&&void 0!==T[t]?T[t]:(e=Y.exec(t))?(it(e[1])<<24|it(e[2])<<16|it(e[3])<<8|255)>>>0:(e=J.exec(t))?(it(e[1])<<24|it(e[2])<<16|it(e[3])<<8|ct(e[4]))>>>0:(e=tt.exec(t))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+"ff",16)>>>0:(e=rt.exec(t))?parseInt(e[1],16)>>>0:(e=et.exec(t))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+e[4]+e[4],16)>>>0:(e=K.exec(t))?(255|ot(at(e[1]),ut(e[2]),ut(e[3])))>>>0:(e=X.exec(t))?(ot(at(e[1]),ut(e[2]),ut(e[3]))|ct(e[4]))>>>0:null}(t);return null===e?t:(e=e||0,`rgba(${(4278190080&e)>>>24}, ${(16711680&e)>>>16}, ${(65280&e)>>>8}, ${(255&e)/255})`)}const dt=(t,e,n)=>{if(x.fun(t))return t;if(x.arr(t))return dt({range:t,output:e,extrapolate:n});if(x.str(t.output[0]))return C(t);const r=t,s=r.output,o=r.range||[0,1],i=r.extrapolateLeft||r.extrapolate||"extend",a=r.extrapolateRight||r.extrapolate||"extend",c=r.easing||(t=>t);return t=>{const e=function(t,e){for(var n=1;n=t);++n);return n-1}(t,o);return function(t,e,n,r,s,o,i,a,c){let u=c?c(t):t;if(un){if("identity"===a)return u;"clamp"===a&&(u=n)}return r===s?r:e===n?t<=e?r:s:(e===-1/0?u=-u:n===1/0?u-=e:u=(u-e)/(n-e),u=o(u),r===-1/0?u=-u:s===1/0?u+=r:u=u*(s-r)+r,u)}(t,o[e],o[e+1],s[e],s[e+1],c,i,a,r.map)}};function ft(){return(ft=Object.assign||function(t){for(var e=1;eBoolean(t&&t[pt]),bt=t=>t&&t[pt]?t[pt]():t,gt=t=>t[ht]||null;function yt(t,e){let n=t[ht];n&&n.forEach(t=>{!function(t,e){t.eventObserved?t.eventObserved(e):t(e)}(t,e)})}class Ot{constructor(t){if(this[pt]=void 0,this[ht]=void 0,!t&&!(t=this.get))throw Error("Unknown getter");vt(this,t)}}const vt=(t,e)=>_t(t,pt,e);function jt(t,e){if(t[pt]){let n=t[ht];n||_t(t,ht,n=new Set),n.has(e)||(n.add(e),t.observerAdded&&t.observerAdded(n.size,e))}return e}function wt(t,e){let n=t[ht];if(n&&n.has(e)){const r=n.size-1;r?n.delete(e):t[ht]=null,t.observerRemoved&&t.observerRemoved(r,e)}}const _t=(t,e,n)=>Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0}),xt=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,kt=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,St=new RegExp(`(${xt.source})(%|[a-z]+)`,"i"),Et=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Pt=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,Mt=t=>{const[e,n]=At(t);if(!e||I())return t;const r=window.getComputedStyle(document.documentElement).getPropertyValue(e);if(r)return r.trim();if(n&&n.startsWith("--")){return window.getComputedStyle(document.documentElement).getPropertyValue(n)||t}return n&&Pt.test(n)?Mt(n):n||t},At=t=>{const e=Pt.exec(t);if(!e)return[,];const[,n,r]=e;return[n,r]};let It;const Ct=(t,e,n,r,s)=>`rgba(${Math.round(e)}, ${Math.round(n)}, ${Math.round(r)}, ${s})`,Rt=t=>{It||(It=T?new RegExp(`(${Object.keys(T).join("|")})(?!\\w)`,"g"):/^\b$/);const e=t.output.map(t=>bt(t).replace(Pt,Mt).replace(kt,lt).replace(It,lt)),n=e.map(t=>t.match(xt).map(Number)),r=n[0].map((t,e)=>n.map(t=>{if(!(e in t))throw Error('The arity of each "output" value must be equal');return t[e]})).map(e=>dt(ft({},t,{output:e})));return t=>{var n;const s=!St.test(e[0])&&(null==(n=e.find(t=>St.test(t)))?void 0:n.replace(xt,""));let o=0;return e[0].replace(xt,()=>`${r[o++](t)}${s||""}`).replace(Et,Ct)}},Tt="react-spring: ",Nt=t=>{const e=t;let n=!1;if("function"!=typeof e)throw new TypeError(Tt+"once requires a function parameter");return(...t)=>{n||(e(...t),n=!0)}},Vt=Nt(console.warn);function qt(){Vt(Tt+'The "interpolate" function is deprecated in v9 (use "to" instead)')}const Dt=Nt(console.warn);function zt(){Dt(Tt+'Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions')}function Lt(t){return x.str(t)&&("#"==t[0]||/\d/.test(t)||!I()&&Pt.test(t)||t in(T||{}))}const Ft="undefined"!=typeof window&&window.document&&window.document.createElement?j.useLayoutEffect:j.useEffect;function Ut(){const t=Object(j.useState)()[1],e=(()=>{const t=Object(j.useRef)(!1);return Ft(()=>(t.current=!0,()=>{t.current=!1}),[]),t})();return()=>{e.current&&t(Math.random())}}function $t(t,e){const[n]=Object(j.useState)(()=>({inputs:e,result:t()})),r=Object(j.useRef)(),s=r.current;let o=s;return o?Boolean(e&&o.inputs&&function(t,e){if(t.length!==e.length)return!1;for(let n=0;n{r.current=o,s==n&&(n.inputs=n.result=void 0)},[o]),o.result}const Qt=t=>Object(j.useEffect)(t,Bt),Bt=[];function Gt(t){const e=Object(j.useRef)();return Object(j.useEffect)(()=>{e.current=t}),e.current}},function(t,e){t.exports=window.wp.i18n},function(t,e){t.exports=window.wp.components},,function(t,e){t.exports=window.React},function(t,e,n){var r=n(26),s=n(27),o=n(21),i=n(28);t.exports=function(t,e){return r(t)||s(t,e)||o(t,e)||i()},t.exports.__esModule=!0,t.exports.default=t.exports},,,function(t,e){t.exports=window.wp.primitives},function(t,e){t.exports=window.wp.url},function(t,e,n){var r=n(30);t.exports=function(t,e,n){return(e=r(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=window.lodash},,function(t,e,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function s(){for(var t=[],e=0;et&&t[o],a=(t,e)=>Object(r.h)(t,o,e),c=t=>t&&t[o]&&t[o].getPayload();class u{constructor(){this.payload=void 0,a(this,this)}getPayload(){return this.payload||[]}}class l extends u{constructor(t){super(),this.done=!0,this.elapsedTime=void 0,this.lastPosition=void 0,this.lastVelocity=void 0,this.v0=void 0,this.durationProgress=0,this._value=t,r.s.num(this._value)&&(this.lastPosition=this._value)}static create(t){return new l(t)}getPayload(){return[this]}getValue(){return this._value}setValue(t,e){return r.s.num(t)&&(this.lastPosition=t,e&&(t=Math.round(t/e)*e,this.done&&(this.lastPosition=t))),this._value!==t&&(this._value=t,!0)}reset(){const{done:t}=this;this.done=!1,r.s.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,t&&(this.lastVelocity=null),this.v0=null)}}class d extends l{constructor(t){super(0),this._string=null,this._toString=void 0,this._toString=Object(r.f)({output:[t,t]})}static create(t){return new d(t)}getValue(){let t=this._string;return null==t?this._string=this._toString(this._value):t}setValue(t){if(r.s.str(t)){if(t==this._string)return!1;this._string=t,this._value=1}else{if(!super.setValue(t))return!1;this._string=null}return!0}reset(t){t&&(this._toString=Object(r.f)({output:[this.getValue(),t]})),this._value=0,super.reset()}}const f={dependencies:null};class p extends u{constructor(t){super(),this.source=t,this.setValue(t)}getValue(t){const e={};return Object(r.l)(this.source,(n,s)=>{var i;(i=n)&&i[o]===i?e[s]=n.getValue(t):Object(r.r)(n)?e[s]=Object(r.q)(n):t||(e[s]=n)}),e}setValue(t){this.source=t,this.payload=this._makePayload(t)}reset(){this.payload&&Object(r.k)(this.payload,t=>t.reset())}_makePayload(t){if(t){const e=new Set;return Object(r.l)(t,this._addToPayload,e),Array.from(e)}}_addToPayload(t){f.dependencies&&Object(r.r)(t)&&f.dependencies.add(t);const e=c(t);e&&Object(r.k)(e,t=>this.add(t))}}class h extends p{constructor(t){super(t)}static create(t){return new h(t)}getValue(){return this.source.map(t=>t.getValue())}setValue(t){const e=this.getPayload();return t.length==e.length?e.map((e,n)=>e.setValue(t[n])).some(Boolean):(super.setValue(t.map(m)),!0)}}function m(t){return(Object(r.t)(t)?d:l).create(t)}function b(t){const e=i(t);return e?e.constructor:r.s.arr(t)?h:Object(r.t)(t)?d:l}function g(){return(g=Object.assign||function(t){for(var e=1;e{const n=!r.s.fun(t)||t.prototype&&t.prototype.isReactComponent;return Object(s.forwardRef)((o,i)=>{const a=Object(s.useRef)(null),c=n&&Object(s.useCallback)(t=>{a.current=function(t,e){return t&&(r.s.fun(t)?t(e):t.current=e),e}(i,t)},[i]),[u,l]=function(t,e){const n=new Set;return f.dependencies=n,t.style&&(t=g({},t,{style:e.createAnimatedStyle(t.style)})),t=new p(t),f.dependencies=null,[t,n]}(o,e),d=Object(r.z)(),h=()=>{const t=a.current;n&&!t||!1===(!!t&&e.applyAnimatedValues(t,u.getValue(!0)))&&d()},m=new O(h,l),b=Object(s.useRef)();Object(r.A)(()=>(b.current=m,Object(r.k)(l,t=>Object(r.c)(t,m)),()=>{b.current&&(Object(r.k)(b.current.deps,t=>Object(r.x)(t,b.current)),r.w.cancel(b.current.update))})),Object(s.useEffect)(h,[]),Object(r.C)(()=>()=>{const t=b.current;Object(r.k)(t.deps,e=>Object(r.x)(e,t))});const y=e.getComponentProps(u.getValue());return s.createElement(t,g({},y,{ref:c}))})};class O{constructor(t,e){this.update=t,this.deps=e}eventObserved(t){"change"==t.type&&r.w.write(this.update)}}const v=Symbol.for("AnimatedComponent"),j=(t,{applyAnimatedValues:e=(()=>!1),createAnimatedStyle:n=(t=>new p(t)),getComponentProps:s=(t=>t)}={})=>{const o={applyAnimatedValues:e,createAnimatedStyle:n,getComponentProps:s},i=t=>{const e=w(t)||"Anonymous";return(t=r.s.str(t)?i[t]||(i[t]=y(t,o)):t[v]||(t[v]=y(t,o))).displayName=`Animated(${e})`,t};return Object(r.l)(t,(e,n)=>{r.s.arr(t)&&(n=w(e)),i[n]=i(e)}),{animated:i}},w=t=>r.s.str(t)?t:t&&r.s.str(t.displayName)?t.displayName:r.s.fun(t)&&t.name||null},function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n!0===t||!!(e&&t&&(r.s.fun(t)?t(e):Object(r.y)(t).includes(e))),u=(t,e)=>r.s.obj(t)?e&&t[e]:t,l=(t,e)=>!0===t.default?t[e]:t.default?t.default[e]:void 0,d=t=>t,f=(t,e=d)=>{let n=p;t.default&&!0!==t.default&&(t=t.default,n=Object.keys(t));const s={};for(const o of n){const n=e(t[o],o);r.s.und(n)||(s[o]=n)}return s},p=["config","onProps","onStart","onChange","onPause","onResume","onRest"],h={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function m(t){const e=function(t){const e={};let n=0;if(Object(r.l)(t,(t,r)=>{h[r]||(e[r]=t,n++)}),n)return e}(t);if(e){const n={to:e};return Object(r.l)(t,(t,r)=>r in e||(n[r]=t)),n}return i({},t)}function b(t){return t=Object(r.q)(t),r.s.arr(t)?t.map(b):Object(r.t)(t)?r.b.createStringInterpolator({range:[0,1],output:[t,t]})(1):t}function g(t){for(const e in t)return!0;return!1}function y(t){return r.s.fun(t)||r.s.arr(t)&&r.s.obj(t[0])}function O(t,e){var n;null==(n=t.ref)||n.delete(t),null==e||e.delete(t)}function v(t,e){var n;e&&t.ref!==e&&(null==(n=t.ref)||n.delete(t),e.add(t),t.ref=e)}const j={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}},w=1.70158,_=1.525*w,x=2*Math.PI/3,k=2*Math.PI/4.5,S=t=>{const e=7.5625,n=2.75;return t<1/n?e*t*t:t<2/n?e*(t-=1.5/n)*t+.75:t<2.5/n?e*(t-=2.25/n)*t+.9375:e*(t-=2.625/n)*t+.984375},E={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>1-(1-t)*(1-t),easeInOutQuad:t=>t<.5?2*t*t:1-Math.pow(-2*t+2,2)/2,easeInCubic:t=>t*t*t,easeOutCubic:t=>1-Math.pow(1-t,3),easeInOutCubic:t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2,easeInQuart:t=>t*t*t*t,easeOutQuart:t=>1-Math.pow(1-t,4),easeInOutQuart:t=>t<.5?8*t*t*t*t:1-Math.pow(-2*t+2,4)/2,easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>1-Math.pow(1-t,5),easeInOutQuint:t=>t<.5?16*t*t*t*t*t:1-Math.pow(-2*t+2,5)/2,easeInSine:t=>1-Math.cos(t*Math.PI/2),easeOutSine:t=>Math.sin(t*Math.PI/2),easeInOutSine:t=>-(Math.cos(Math.PI*t)-1)/2,easeInExpo:t=>0===t?0:Math.pow(2,10*t-10),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>0===t?0:1===t?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2,easeInCirc:t=>1-Math.sqrt(1-Math.pow(t,2)),easeOutCirc:t=>Math.sqrt(1-Math.pow(t-1,2)),easeInOutCirc:t=>t<.5?(1-Math.sqrt(1-Math.pow(2*t,2)))/2:(Math.sqrt(1-Math.pow(-2*t+2,2))+1)/2,easeInBack:t=>2.70158*t*t*t-w*t*t,easeOutBack:t=>1+2.70158*Math.pow(t-1,3)+w*Math.pow(t-1,2),easeInOutBack:t=>t<.5?Math.pow(2*t,2)*(7.189819*t-_)/2:(Math.pow(2*t-2,2)*((_+1)*(2*t-2)+_)+2)/2,easeInElastic:t=>0===t?0:1===t?1:-Math.pow(2,10*t-10)*Math.sin((10*t-10.75)*x),easeOutElastic:t=>0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin((10*t-.75)*x)+1,easeInOutElastic:t=>0===t?0:1===t?1:t<.5?-Math.pow(2,20*t-10)*Math.sin((20*t-11.125)*k)/2:Math.pow(2,-20*t+10)*Math.sin((20*t-11.125)*k)/2+1,easeInBounce:t=>1-S(1-t),easeOutBounce:S,easeInOutBounce:t=>t<.5?(1-S(1-2*t))/2:(1+S(2*t-1))/2},P=i({},j.default,{mass:1,damping:1,easing:E.linear,clamp:!1});class M{constructor(){this.tension=void 0,this.friction=void 0,this.frequency=void 0,this.damping=void 0,this.mass=void 0,this.velocity=0,this.restVelocity=void 0,this.precision=void 0,this.progress=void 0,this.duration=void 0,this.easing=void 0,this.clamp=void 0,this.bounce=void 0,this.decay=void 0,this.round=void 0,Object.assign(this,P)}}function A(t,e){if(r.s.und(e.decay)){const n=!r.s.und(e.tension)||!r.s.und(e.friction);!n&&r.s.und(e.frequency)&&r.s.und(e.damping)&&r.s.und(e.mass)||(t.duration=void 0,t.decay=void 0),n&&(t.frequency=void 0)}else t.duration=void 0}const I=[];class C{constructor(){this.changed=!1,this.values=I,this.toValues=null,this.fromValues=I,this.to=void 0,this.from=void 0,this.config=new M,this.immediate=!1}}function R(t,{key:e,props:n,defaultProps:s,state:o,actions:u}){return new Promise((l,d)=>{var f;let p,h,m=c(null!=(f=n.cancel)?f:null==s?void 0:s.cancel,e);if(m)y();else{r.s.und(n.pause)||(o.paused=c(n.pause,e));let t=null==s?void 0:s.pause;!0!==t&&(t=o.paused||c(t,e)),p=a(n.delay||0,e),t?(o.resumeQueue.add(g),u.pause()):(u.resume(),g())}function b(){o.resumeQueue.add(g),o.timeouts.delete(h),h.cancel(),p=h.time-r.w.now()}function g(){p>0&&!r.b.skipAnimation?(o.delayed=!0,h=r.w.setTimeout(y,p),o.pauseQueue.add(b),o.timeouts.add(h)):y()}function y(){o.delayed&&(o.delayed=!1),o.pauseQueue.delete(b),o.timeouts.delete(h),t<=(o.cancelId||0)&&(m=!0);try{u.start(i({},n,{callId:t,cancel:m}),l)}catch(t){d(t)}}})}const T=(t,e)=>1==e.length?e[0]:e.some(t=>t.cancelled)?q(t.get()):e.every(t=>t.noop)?N(t.get()):V(t.get(),e.every(t=>t.finished)),N=t=>({value:t,noop:!0,finished:!0,cancelled:!1}),V=(t,e,n=!1)=>({value:t,finished:e,cancelled:n}),q=t=>({value:t,cancelled:!0,finished:!1});function D(t,e,n,s){const{callId:o,parentId:a,onRest:c}=e,{asyncTo:u,promise:l}=n;return a||t!==u||e.reset?n.promise=(async()=>{n.asyncId=o,n.asyncTo=t;const d=f(e,(t,e)=>"onRest"===e?void 0:t);let p,h;const m=new Promise((t,e)=>(p=t,h=e)),b=t=>{const e=o<=(n.cancelId||0)&&q(s)||o!==n.asyncId&&V(s,!1);if(e)throw t.result=e,h(t),t},g=(t,e)=>{const a=new L,c=new F;return(async()=>{if(r.b.skipAnimation)throw z(n),c.result=V(s,!1),h(c),c;b(a);const u=r.s.obj(t)?i({},t):i({},e,{to:t});u.parentId=o,Object(r.l)(d,(t,e)=>{r.s.und(u[e])&&(u[e]=t)});const l=await s.start(u);return b(a),n.paused&&await new Promise(t=>{n.resumeQueue.add(t)}),l})()};let y;if(r.b.skipAnimation)return z(n),V(s,!1);try{let e;e=r.s.arr(t)?(async t=>{for(const e of t)await g(e)})(t):Promise.resolve(t(g,s.stop.bind(s))),await Promise.all([e.then(p),m]),y=V(s.get(),!0,!1)}catch(t){if(t instanceof L)y=t.result;else{if(!(t instanceof F))throw t;y=t.result}}finally{o==n.asyncId&&(n.asyncId=a,n.asyncTo=a?u:void 0,n.promise=a?l:void 0)}return r.s.fun(c)&&r.w.batchedUpdates(()=>{c(y,s,s.item)}),y})():l}function z(t,e){Object(r.m)(t.timeouts,t=>t.cancel()),t.pauseQueue.clear(),t.resumeQueue.clear(),t.asyncId=t.asyncTo=t.promise=void 0,e&&(t.cancelId=e)}class L extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise."),this.result=void 0}}class F extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const U=t=>t instanceof Q;let $=1;class Q extends r.a{constructor(...t){super(...t),this.id=$++,this.key=void 0,this._priority=0}get priority(){return this._priority}set priority(t){this._priority!=t&&(this._priority=t,this._onPriorityChange(t))}get(){const t=Object(o.e)(this);return t&&t.getValue()}to(...t){return r.b.to(this,t)}interpolate(...t){return Object(r.j)(),r.b.to(this,t)}toJSON(){return this.get()}observerAdded(t){1==t&&this._attach()}observerRemoved(t){0==t&&this._detach()}_attach(){}_detach(){}_onChange(t,e=!1){Object(r.d)(this,{type:"change",parent:this,value:t,idle:e})}_onPriorityChange(t){this.idle||r.o.sort(this),Object(r.d)(this,{type:"priority",parent:this,priority:t})}}const B=Symbol.for("SpringPhase"),G=t=>(1&t[B])>0,H=t=>(2&t[B])>0,W=t=>(4&t[B])>0,Z=(t,e)=>e?t[B]|=3:t[B]&=-3,Y=(t,e)=>e?t[B]|=4:t[B]&=-5;class J extends Q{constructor(t,e){if(super(),this.key=void 0,this.animation=new C,this.queue=void 0,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!r.s.und(t)||!r.s.und(e)){const n=r.s.obj(t)?i({},t):i({},e,{from:t});r.s.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(H(this)||this._state.asyncTo)||W(this)}get goal(){return Object(r.q)(this.animation.to)}get velocity(){const t=Object(o.e)(this);return t instanceof o.c?t.lastVelocity||0:t.getPayload().map(t=>t.lastVelocity||0)}get hasAnimated(){return G(this)}get isAnimating(){return H(this)}get isPaused(){return W(this)}get isDelayed(){return this._state.delayed}advance(t){let e=!0,n=!1;const s=this.animation;let{config:i,toValues:a}=s;const c=Object(o.g)(s.to);!c&&Object(r.r)(s.to)&&(a=Object(r.y)(Object(r.q)(s.to))),s.values.forEach((u,l)=>{if(u.done)return;const d=u.constructor==o.b?1:c?c[l].lastPosition:a[l];let f=s.immediate,p=d;if(!f){if(p=u.lastPosition,i.tension<=0)return void(u.done=!0);let e=u.elapsedTime+=t;const n=s.fromValues[l],o=null!=u.v0?u.v0:u.v0=r.s.arr(i.velocity)?i.velocity[l]:i.velocity;let a;if(r.s.und(i.duration))if(i.decay){const t=!0===i.decay?.998:i.decay,r=Math.exp(-(1-t)*e);p=n+o/(1-t)*(1-r),f=Math.abs(u.lastPosition-p)<.1,a=o*r}else{a=null==u.lastVelocity?o:u.lastVelocity;const e=i.precision||(n==d?.005:Math.min(1,.001*Math.abs(d-n))),s=i.restVelocity||e/10,c=i.clamp?0:i.bounce,l=!r.s.und(c),h=n==d?u.v0>0:ns,m||(f=Math.abs(d-p)<=e,!f));++t)l&&(b=p==d||p>d==h,b&&(a=-a*c,p=d)),a+=(1e-6*-i.tension*(p-d)+.001*-i.friction*a)/i.mass*g,p+=a*g}else{let r=1;i.duration>0&&(this._memoizedDuration!==i.duration&&(this._memoizedDuration=i.duration,u.durationProgress>0&&(u.elapsedTime=i.duration*u.durationProgress,e=u.elapsedTime+=t)),r=(i.progress||0)+e/this._memoizedDuration,r=r>1?1:r<0?0:r,u.durationProgress=r),p=n+i.easing(r)*(d-n),a=(p-u.lastPosition)/t,f=1==r}u.lastVelocity=a,Number.isNaN(p)&&(console.warn("Got NaN while animating:",this),f=!0)}c&&!c[l].done&&(f=!1),f?u.done=!0:e=!1,u.setValue(p,i.round)&&(n=!0)});const u=Object(o.e)(this),l=u.getValue();if(e){const t=Object(r.q)(s.to);l===t&&!n||i.decay?n&&i.decay&&this._onChange(l):(u.setValue(t),this._onChange(t)),this._stop()}else n&&this._onChange(l)}set(t){return r.w.batchedUpdates(()=>{this._stop(),this._focus(t),this._set(t)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(H(this)){const{to:t,config:e}=this.animation;r.w.batchedUpdates(()=>{this._onStart(),e.decay||this._set(t,!1),this._stop()})}return this}update(t){return(this.queue||(this.queue=[])).push(t),this}start(t,e){let n;return r.s.und(t)?(n=this.queue||[],this.queue=[]):n=[r.s.obj(t)?t:i({},e,{to:t})],Promise.all(n.map(t=>this._update(t))).then(t=>T(this,t))}stop(t){const{to:e}=this.animation;return this._focus(this.get()),z(this._state,t&&this._lastCallId),r.w.batchedUpdates(()=>this._stop(e,t)),this}reset(){this._update({reset:!0})}eventObserved(t){"change"==t.type?this._start():"priority"==t.type&&(this.priority=t.priority+1)}_prepareNode(t){const e=this.key||"";let{to:n,from:s}=t;n=r.s.obj(n)?n[e]:n,(null==n||y(n))&&(n=void 0),s=r.s.obj(s)?s[e]:s,null==s&&(s=void 0);const i={to:n,from:s};return G(this)||(t.reverse&&([n,s]=[s,n]),s=Object(r.q)(s),r.s.und(s)?Object(o.e)(this)||this._set(n):this._set(s)),i}_update(t,e){let n=i({},t);const{key:s,defaultProps:o}=this;n.default&&Object.assign(o,f(n,(t,e)=>/^on/.test(e)?u(t,s):t)),st(this,n,"onProps"),ot(this,"onProps",n,this);const a=this._prepareNode(n);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const c=this._state;return R(++this._lastCallId,{key:s,props:n,defaultProps:o,state:c,actions:{pause:()=>{W(this)||(Y(this,!0),Object(r.n)(c.pauseQueue),ot(this,"onPause",V(this,K(this,this.animation.to)),this))},resume:()=>{W(this)&&(Y(this,!1),H(this)&&this._resume(),Object(r.n)(c.resumeQueue),ot(this,"onResume",V(this,K(this,this.animation.to)),this))},start:this._merge.bind(this,a)}}).then(t=>{if(n.loop&&t.finished&&(!e||!t.noop)){const t=X(n);if(t)return this._update(t,!0)}return t})}_merge(t,e,n){if(e.cancel)return this.stop(!0),n(q(this));const s=!r.s.und(t.to),u=!r.s.und(t.from);if(s||u){if(!(e.callId>this._lastToId))return n(q(this));this._lastToId=e.callId}const{key:l,defaultProps:d,animation:f}=this,{to:p,from:h}=f;let{to:m=p,from:g=h}=t;!u||s||e.default&&!r.s.und(m)||(m=g),e.reverse&&([m,g]=[g,m]);const O=!Object(r.u)(g,h);O&&(f.from=g),g=Object(r.q)(g);const v=!Object(r.u)(m,p);v&&this._focus(m);const j=y(e.to),{config:w}=f,{decay:_,velocity:x}=w;(s||u)&&(w.velocity=0),e.config&&!j&&function(t,e,n){n&&(A(n=i({},n),e),e=i({},n,e)),A(t,e),Object.assign(t,e);for(const e in P)null==t[e]&&(t[e]=P[e]);let{mass:s,frequency:o,damping:a}=t;r.s.und(o)||(o<.01&&(o=.01),a<0&&(a=0),t.tension=Math.pow(2*Math.PI/o,2)*s,t.friction=4*Math.PI*a*s/o)}(w,a(e.config,l),e.config!==d.config?a(d.config,l):void 0);let k=Object(o.e)(this);if(!k||r.s.und(m))return n(V(this,!0));const S=r.s.und(e.reset)?u&&!e.default:!r.s.und(g)&&c(e.reset,l),E=S?g:this.get(),M=b(m),I=r.s.num(M)||r.s.arr(M)||Object(r.t)(M),C=!j&&(!I||c(d.immediate||e.immediate,l));if(v){const t=Object(o.f)(m);if(t!==k.constructor){if(!C)throw Error(`Cannot animate between ${k.constructor.name} and ${t.name}, as the "to" prop suggests`);k=this._set(M)}}const R=k.constructor;let T=Object(r.r)(m),z=!1;if(!T){const t=S||!G(this)&&O;(v||t)&&(z=Object(r.u)(b(E),M),T=!z),(Object(r.u)(f.immediate,C)||C)&&Object(r.u)(w.decay,_)&&Object(r.u)(w.velocity,x)||(T=!0)}if(z&&H(this)&&(f.changed&&!S?T=!0:T||this._stop(p)),!j&&((T||Object(r.r)(p))&&(f.values=k.getPayload(),f.toValues=Object(r.r)(m)?null:R==o.b?[1]:Object(r.y)(M)),f.immediate!=C&&(f.immediate=C,C||S||this._set(p)),T)){const{onRest:t}=f;Object(r.k)(rt,t=>st(this,e,t));const s=V(this,K(this,p));Object(r.n)(this._pendingCalls,s),this._pendingCalls.add(n),f.changed&&r.w.batchedUpdates(()=>{f.changed=!S,null==t||t(s,this),S?a(d.onRest,s):null==f.onStart||f.onStart(s,this)})}S&&this._set(E),j?n(D(e.to,e,this._state,this)):T?this._start():H(this)&&!v?this._pendingCalls.add(n):n(N(E))}_focus(t){const e=this.animation;t!==e.to&&(Object(r.p)(this)&&this._detach(),e.to=t,Object(r.p)(this)&&this._attach())}_attach(){let t=0;const{to:e}=this.animation;Object(r.r)(e)&&(Object(r.c)(e,this),U(e)&&(t=e.priority+1)),this.priority=t}_detach(){const{to:t}=this.animation;Object(r.r)(t)&&Object(r.x)(t,this)}_set(t,e=!0){const n=Object(r.q)(t);if(!r.s.und(n)){const t=Object(o.e)(this);if(!t||!Object(r.u)(n,t.getValue())){const s=Object(o.f)(n);t&&t.constructor==s?t.setValue(n):Object(o.h)(this,s.create(n)),t&&r.w.batchedUpdates(()=>{this._onChange(n,e)})}}return Object(o.e)(this)}_onStart(){const t=this.animation;t.changed||(t.changed=!0,ot(this,"onStart",V(this,K(this,t.to)),this))}_onChange(t,e){e||(this._onStart(),a(this.animation.onChange,t,this)),a(this.defaultProps.onChange,t,this),super._onChange(t,e)}_start(){const t=this.animation;Object(o.e)(this).reset(Object(r.q)(t.to)),t.immediate||(t.fromValues=t.values.map(t=>t.lastPosition)),H(this)||(Z(this,!0),W(this)||this._resume())}_resume(){r.b.skipAnimation?this.finish():r.o.start(this)}_stop(t,e){if(H(this)){Z(this,!1);const n=this.animation;Object(r.k)(n.values,t=>{t.done=!0}),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Object(r.d)(this,{type:"idle",parent:this});const s=e?q(this.get()):V(this.get(),K(this,null!=t?t:n.to));Object(r.n)(this._pendingCalls,s),n.changed&&(n.changed=!1,ot(this,"onRest",s,this))}}}function K(t,e){const n=b(e),s=b(t.get());return Object(r.u)(s,n)}function X(t,e=t.loop,n=t.to){let r=a(e);if(r){const s=!0!==r&&m(r),o=(s||t).reverse,a=!s||s.reset;return tt(i({},t,{loop:e,default:!1,pause:void 0,to:!o||y(n)?n:void 0,from:a?t.from:void 0,reset:a},s))}}function tt(t){const{to:e,from:n}=t=m(t),s=new Set;return r.s.obj(e)&&nt(e,s),r.s.obj(n)&&nt(n,s),t.keys=s.size?Array.from(s):null,t}function et(t){const e=tt(t);return r.s.und(e.default)&&(e.default=f(e)),e}function nt(t,e){Object(r.l)(t,(t,n)=>null!=t&&e.add(n))}const rt=["onStart","onRest","onChange","onPause","onResume"];function st(t,e,n){t.animation[n]=e[n]!==l(e,n)?u(e[n],t.key):void 0}function ot(t,e,...n){var r,s,o,i;null==(r=(s=t.animation)[e])||r.call(s,...n),null==(o=(i=t.defaultProps)[e])||o.call(i,...n)}const it=["onStart","onChange","onRest"];let at=1;class ct{constructor(t,e){this.id=at++,this.springs={},this.queue=[],this.ref=void 0,this._flush=void 0,this._initialProps=void 0,this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._item=void 0,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),e&&(this._flush=e),t&&this.start(i({default:!0},t))}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(t=>t.idle&&!t.isDelayed&&!t.isPaused)}get item(){return this._item}set item(t){this._item=t}get(){const t={};return this.each((e,n)=>t[n]=e.get()),t}set(t){for(const e in t){const n=t[e];r.s.und(n)||this.springs[e].set(n)}}update(t){return t&&this.queue.push(tt(t)),this}start(t){let{queue:e}=this;return t?e=Object(r.y)(t).map(tt):this.queue=[],this._flush?this._flush(this,e):(ht(this,e),ut(this,e))}stop(t,e){if(t!==!!t&&(e=t),e){const n=this.springs;Object(r.k)(Object(r.y)(e),e=>n[e].stop(!!t))}else z(this._state,this._lastAsyncId),this.each(e=>e.stop(!!t));return this}pause(t){if(r.s.und(t))this.start({pause:!0});else{const e=this.springs;Object(r.k)(Object(r.y)(t),t=>e[t].pause())}return this}resume(t){if(r.s.und(t))this.start({pause:!1});else{const e=this.springs;Object(r.k)(Object(r.y)(t),t=>e[t].resume())}return this}each(t){Object(r.l)(this.springs,t)}_onFrame(){const{onStart:t,onChange:e,onRest:n}=this._events,s=this._active.size>0,o=this._changed.size>0;(s&&!this._started||o&&!this._started)&&(this._started=!0,Object(r.m)(t,([t,e])=>{e.value=this.get(),t(e,this,this._item)}));const i=!s&&this._started,a=o||i&&n.size?this.get():null;o&&e.size&&Object(r.m)(e,([t,e])=>{e.value=a,t(e,this,this._item)}),i&&(this._started=!1,Object(r.m)(n,([t,e])=>{e.value=a,t(e,this,this._item)}))}eventObserved(t){if("change"==t.type)this._changed.add(t.parent),t.idle||this._active.add(t.parent);else{if("idle"!=t.type)return;this._active.delete(t.parent)}r.w.onFrame(this._onFrame)}}function ut(t,e){return Promise.all(e.map(e=>async function t(e,n,s){const{keys:o,to:i,from:a,loop:c,onRest:u,onResolve:d}=n,f=r.s.obj(n.default)&&n.default;c&&(n.loop=!1),!1===i&&(n.to=null),!1===a&&(n.from=null);const p=r.s.arr(i)||r.s.fun(i)?i:void 0;p?(n.to=void 0,n.onRest=void 0,f&&(f.onRest=void 0)):Object(r.k)(it,t=>{const s=n[t];if(r.s.fun(s)){const r=e._events[t];n[t]=({finished:t,cancelled:e})=>{const n=r.get(s);n?(t||(n.finished=!1),e&&(n.cancelled=!0)):r.set(s,{value:null,finished:t||!1,cancelled:e||!1})},f&&(f[t]=n[t])}});const h=e._state;n.pause===!h.paused?(h.paused=n.pause,Object(r.n)(n.pause?h.pauseQueue:h.resumeQueue)):h.paused&&(n.pause=!0);const m=(o||Object.keys(e.springs)).map(t=>e.springs[t].start(n)),b=!0===n.cancel||!0===l(n,"cancel");(p||b&&h.asyncId)&&m.push(R(++e._lastAsyncId,{props:n,state:h,actions:{pause:r.v,resume:r.v,start(t,n){b?(z(h,e._lastAsyncId),n(q(e))):(t.onRest=u,n(D(p,t,h,e)))}}})),h.paused&&await new Promise(t=>{h.resumeQueue.add(t)});const g=T(e,await Promise.all(m));if(c&&g.finished&&(!s||!g.noop)){const r=X(n,c,i);if(r)return ht(e,[r]),t(e,r,!0)}return d&&r.w.batchedUpdates(()=>d(g,e,e.item)),g}(t,e))).then(e=>T(t,e))}function lt(t,e){const n=i({},t.springs);return e&&Object(r.k)(Object(r.y)(e),t=>{r.s.und(t.keys)&&(t=tt(t)),r.s.obj(t.to)||(t=i({},t,{to:void 0})),pt(n,t,t=>ft(t))}),dt(t,n),n}function dt(t,e){Object(r.l)(e,(e,n)=>{t.springs[n]||(t.springs[n]=e,Object(r.c)(e,t))})}function ft(t,e){const n=new J;return n.key=t,e&&Object(r.c)(n,e),n}function pt(t,e,n){e.keys&&Object(r.k)(e.keys,r=>{(t[r]||(t[r]=n(r)))._prepareNode(e)})}function ht(t,e){Object(r.k)(e,e=>{pt(t.springs,e,e=>ft(e,t))})}const mt=["children"],bt=t=>{let{children:e}=t,n=function(t,e){if(null==t)return{};var n,r,s={},o=Object.keys(t);for(r=0;r=0||(s[n]=t[n]);return s}(t,mt);const o=Object(s.useContext)(gt),i=n.pause||!!o.pause,a=n.immediate||!!o.immediate;n=Object(r.B)(()=>({pause:i,immediate:a}),[i,a]);const{Provider:c}=gt;return s.createElement(c,{value:n},e)},gt=(yt=bt,Ot={},Object.assign(yt,s.createContext(Ot)),yt.Provider._context=yt,yt.Consumer._context=yt,yt);var yt,Ot;bt.Provider=gt.Provider,bt.Consumer=gt.Consumer;const vt=()=>{const t=[],e=function(e){Object(r.i)();const s=[];return Object(r.k)(t,(t,o)=>{if(r.s.und(e))s.push(t.start());else{const r=n(e,t,o);r&&s.push(t.start(r))}}),s};e.current=t,e.add=function(e){t.includes(e)||t.push(e)},e.delete=function(e){const n=t.indexOf(e);~n&&t.splice(n,1)},e.pause=function(){return Object(r.k)(t,t=>t.pause(...arguments)),this},e.resume=function(){return Object(r.k)(t,t=>t.resume(...arguments)),this},e.set=function(e){Object(r.k)(t,t=>t.set(e))},e.start=function(e){const n=[];return Object(r.k)(t,(t,s)=>{if(r.s.und(e))n.push(t.start());else{const r=this._getProps(e,t,s);r&&n.push(t.start(r))}}),n},e.stop=function(){return Object(r.k)(t,t=>t.stop(...arguments)),this},e.update=function(e){return Object(r.k)(t,(t,n)=>t.update(this._getProps(e,t,n))),this};const n=function(t,e,n){return r.s.fun(t)?t(n,e):t};return e._getProps=n,e};function jt(t,e,n){const o=r.s.fun(e)&&e;o&&!n&&(n=[]);const a=Object(s.useMemo)(()=>o||3==arguments.length?vt():void 0,[]),c=Object(s.useRef)(0),u=Object(r.z)(),l=Object(s.useMemo)(()=>({ctrls:[],queue:[],flush(t,e){const n=lt(t,e);return c.current>0&&!l.queue.length&&!Object.keys(n).some(e=>!t.springs[e])?ut(t,e):new Promise(r=>{dt(t,n),l.queue.push(()=>{r(ut(t,e))}),u()})}}),[]),d=Object(s.useRef)([...l.ctrls]),f=[],p=Object(r.D)(t)||0;function h(t,n){for(let r=t;r{Object(r.k)(d.current.slice(t,p),t=>{O(t,a),t.stop(!0)}),d.current.length=t,h(p,t)},[t]),Object(s.useMemo)(()=>{h(0,Math.min(p,t))},n);const m=d.current.map((t,e)=>lt(t,f[e])),b=Object(s.useContext)(bt),y=Object(r.D)(b),j=b!==y&&g(b);Object(r.A)(()=>{c.current++,l.ctrls=d.current;const{queue:t}=l;t.length&&(l.queue=[],Object(r.k)(t,t=>t())),Object(r.k)(d.current,(t,e)=>{null==a||a.add(t),j&&t.start({default:b});const n=f[e];n&&(v(t,n.ref),t.ref?t.queue.push(n):t.start(n))})}),Object(r.C)(()=>()=>{Object(r.k)(l.ctrls,t=>t.stop(!0))});const w=m.map(t=>i({},t));return a?[w,a]:w}function wt(t,e){const n=r.s.fun(t),[[s],o]=jt(1,n?t:[t],n?e||[]:e);return n||2==arguments.length?[s,o]:s}let _t;function xt(t,e,n){const o=r.s.fun(e)&&e,{reset:c,sort:u,trail:l=0,expires:d=!0,exitBeforeEnter:p=!1,onDestroyed:h,ref:b,config:y}=o?o():e,j=Object(s.useMemo)(()=>o||3==arguments.length?vt():void 0,[]),w=Object(r.y)(t),_=[],x=Object(s.useRef)(null),k=c?null:x.current;Object(r.A)(()=>{x.current=_}),Object(r.C)(()=>(Object(r.k)(x.current,t=>{var e;null==(e=t.ctrl.ref)||e.add(t.ctrl);const n=C.get(t);n&&t.ctrl.start(n.payload)}),()=>{Object(r.k)(x.current,t=>{t.expired&&clearTimeout(t.expirationId),O(t.ctrl,j),t.ctrl.stop(!0)})}));const S=St(w,o?o():e,k),E=c&&x.current||[];Object(r.A)(()=>Object(r.k)(E,({ctrl:t,item:e,key:n})=>{O(t,j),a(h,e,n)}));const P=[];if(k&&Object(r.k)(k,(t,e)=>{t.expired?(clearTimeout(t.expirationId),E.push(t)):~(e=P[e]=S.indexOf(t.key))&&(_[e]=t)}),Object(r.k)(w,(t,e)=>{_[e]||(_[e]={key:S[e],item:t,phase:_t.MOUNT,ctrl:new ct},_[e].ctrl.item=t)}),P.length){let t=-1;const{leave:n}=o?o():e;Object(r.k)(P,(e,r)=>{const s=k[r];~e?(t=_.indexOf(s),_[t]=i({},s,{item:w[e]})):n&&_.splice(++t,0,s)})}r.s.fun(u)&&_.sort((t,e)=>u(t.item,e.item));let M=-l;const A=Object(r.z)(),I=f(e),C=new Map,R=Object(s.useRef)(new Map),T=Object(s.useRef)(!1);Object(r.k)(_,(t,n)=>{const s=t.key,c=t.phase,u=o?o():e;let f,h,g=a(u.delay||0,s);if(c==_t.MOUNT)f=u.enter,h=_t.ENTER;else{const t=S.indexOf(s)<0;if(c!=_t.LEAVE)if(t)f=u.leave,h=_t.LEAVE;else{if(!(f=u.update))return;h=_t.UPDATE}else{if(t)return;f=u.enter,h=_t.ENTER}}if(f=a(f,t.item,n),f=r.s.obj(f)?m(f):{to:f},!f.config){const e=y||I.config;f.config=a(e,t.item,n,h)}M+=l;const O=i({},I,{delay:g+M,ref:b,immediate:u.immediate,reset:!1},f);if(h==_t.ENTER&&r.s.und(O.from)){const s=o?o():e,i=r.s.und(s.initial)||k?s.from:s.initial;O.from=a(i,t.item,n)}const{onResolve:v}=O;O.onResolve=t=>{a(v,t);const e=x.current,n=e.find(t=>t.key===s);if(n&&(!t.cancelled||n.phase==_t.UPDATE)&&n.ctrl.idle){const t=e.every(t=>t.ctrl.idle);if(n.phase==_t.LEAVE){const e=a(d,n.item);if(!1!==e){const r=!0===e?0:e;if(n.expired=!0,!t&&r>0)return void(r<=2147483647&&(n.expirationId=setTimeout(A,r)))}}t&&e.some(t=>t.expired)&&(R.current.delete(n),p&&(T.current=!0),A())}};const j=lt(t.ctrl,O);h===_t.LEAVE&&p?R.current.set(t,{phase:h,springs:j,payload:O}):C.set(t,{phase:h,springs:j,payload:O})});const N=Object(s.useContext)(bt),V=Object(r.D)(N),q=N!==V&&g(N);Object(r.A)(()=>{q&&Object(r.k)(_,t=>{t.ctrl.start({default:N})})},[N]),Object(r.k)(C,(t,e)=>{if(R.current.size){const t=_.findIndex(t=>t.key===e.key);_.splice(t,1)}}),Object(r.A)(()=>{Object(r.k)(R.current.size?R.current:C,({phase:t,payload:e},n)=>{const{ctrl:r}=n;n.phase=t,null==j||j.add(r),q&&t==_t.ENTER&&r.start({default:N}),e&&(v(r,e.ref),r.ref&&!T.current?r.update(e):(r.start(e),T.current&&(T.current=!1)))})},c?void 0:n);const D=t=>s.createElement(s.Fragment,null,_.map((e,n)=>{const{springs:o}=C.get(e)||e.ctrl,a=t(i({},o),e.item,e,n);return a&&a.type?s.createElement(a.type,i({},a.props,{key:r.s.str(e.key)||r.s.num(e.key)?e.key:e.ctrl.id,ref:a.ref})):a}));return j?[D,j]:D}!function(t){t.MOUNT="mount",t.ENTER="enter",t.UPDATE="update",t.LEAVE="leave"}(_t||(_t={}));let kt=1;function St(t,{key:e,keys:n=e},s){if(null===n){const e=new Set;return t.map(t=>{const n=s&&s.find(n=>n.item===t&&n.phase!==_t.LEAVE&&!e.has(n));return n?(e.add(n),n.key):kt++})}return r.s.und(n)?t:r.s.fun(n)?t.map(n):Object(r.y)(n)}class Et extends Q{constructor(t,e){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=t,this.calc=Object(r.f)(...e);const n=this._get(),s=Object(o.f)(n);Object(o.h)(this,s.create(n))}advance(t){const e=this._get(),n=this.get();Object(r.u)(e,n)||(Object(o.e)(this).setValue(e),this._onChange(e,this.idle)),!this.idle&&Mt(this._active)&&At(this)}_get(){const t=r.s.arr(this.source)?this.source.map(r.q):Object(r.y)(Object(r.q)(this.source));return this.calc(...t)}_start(){this.idle&&!Mt(this._active)&&(this.idle=!1,Object(r.k)(Object(o.g)(this),t=>{t.done=!1}),r.b.skipAnimation?(r.w.batchedUpdates(()=>this.advance()),At(this)):r.o.start(this))}_attach(){let t=1;Object(r.k)(Object(r.y)(this.source),e=>{Object(r.r)(e)&&Object(r.c)(e,this),U(e)&&(e.idle||this._active.add(e),t=Math.max(t,e.priority+1))}),this.priority=t,this._start()}_detach(){Object(r.k)(Object(r.y)(this.source),t=>{Object(r.r)(t)&&Object(r.x)(t,this)}),this._active.clear(),At(this)}eventObserved(t){"change"==t.type?t.idle?this.advance():(this._active.add(t.parent),this._start()):"idle"==t.type?this._active.delete(t.parent):"priority"==t.type&&(this.priority=Object(r.y)(this.source).reduce((t,e)=>Math.max(t,(U(e)?e.priority:0)+1),0))}}function Pt(t){return!1!==t.idle}function Mt(t){return!t.size||Array.from(t).every(Pt)}function At(t){t.idle||(t.idle=!0,Object(r.k)(Object(o.g)(t),t=>{t.done=!0}),Object(r.d)(t,{type:"idle",parent:t}))}r.b.assign({createStringInterpolator:r.g,to:(t,e)=>new Et(t,e)}),r.o.advance},,function(t,e){t.exports=window.regeneratorRuntime},,,function(t,e,n){"use strict";n.d(e,"animated",(function(){return _}));var r=n(43);n.o(r,"config")&&n.d(e,"config",(function(){return r.config})),n.o(r,"useSpring")&&n.d(e,"useSpring",(function(){return r.useSpring})),n.o(r,"useTransition")&&n.d(e,"useTransition",(function(){return r.useTransition}));var s=n(55),o=n(1),i=n(19);function a(t,e){if(null==t)return{};var n,r,s={},o=Object.keys(t);for(r=0;r=0||(s[n]=t[n]);return s}const c=["style","children","scrollTop","scrollLeft"],u=/^--/;function l(t,e){return null==e||"boolean"==typeof e||""===e?"":"number"!=typeof e||0===e||u.test(t)||f.hasOwnProperty(t)&&f[t]?(""+e).trim():e+"px"}const d={};let f={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};const p=["Webkit","Ms","Moz","O"];f=Object.keys(f).reduce((t,e)=>(p.forEach(n=>t[((t,e)=>t+e.charAt(0).toUpperCase()+e.substring(1))(n,e)]=t[e]),t),f);const h=["x","y","z"],m=/^(matrix|translate|scale|rotate|skew)/,b=/^(translate)/,g=/^(rotate|skew)/,y=(t,e)=>o.s.num(t)&&0!==t?t+e:t,O=(t,e)=>o.s.arr(t)?t.every(t=>O(t,e)):o.s.num(t)?t===e:parseFloat(t)===e;class v extends i.a{constructor(t){let{x:e,y:n,z:r}=t,s=a(t,h);const i=[],c=[];(e||n||r)&&(i.push([e||0,n||0,r||0]),c.push(t=>[`translate3d(${t.map(t=>y(t,"px")).join(",")})`,O(t,0)])),Object(o.l)(s,(t,e)=>{if("transform"===e)i.push([t||""]),c.push(t=>[t,""===t]);else if(m.test(e)){if(delete s[e],o.s.und(t))return;const n=b.test(e)?"px":g.test(e)?"deg":"";i.push(Object(o.y)(t)),c.push("rotate3d"===e?([t,e,r,s])=>[`rotate3d(${t},${e},${r},${y(s,n)})`,O(s,0)]:t=>[`${e}(${t.map(t=>y(t,n)).join(",")})`,O(t,e.startsWith("scale")?1:0)])}}),i.length&&(s.transform=new j(i,c)),super(s)}}class j extends o.a{constructor(t,e){super(),this._value=null,this.inputs=t,this.transforms=e}get(){return this._value||(this._value=this._get())}_get(){let t="",e=!0;return Object(o.k)(this.inputs,(n,r)=>{const s=Object(o.q)(n[0]),[i,a]=this.transforms[r](o.s.arr(s)?s:n.map(o.q));t+=" "+i,e=e&&a}),e?"none":t}observerAdded(t){1==t&&Object(o.k)(this.inputs,t=>Object(o.k)(t,t=>Object(o.r)(t)&&Object(o.c)(t,this)))}observerRemoved(t){0==t&&Object(o.k)(this.inputs,t=>Object(o.k)(t,t=>Object(o.r)(t)&&Object(o.x)(t,this)))}eventObserved(t){"change"==t.type&&(this._value=null),Object(o.d)(this,t)}}const w=["scrollTop","scrollLeft"];r.Globals.assign({batchedUpdates:s.unstable_batchedUpdates,createStringInterpolator:o.g,colors:o.e});const _=Object(i.d)(["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"],{applyAnimatedValues:function(t,e){if(!t.nodeType||!t.setAttribute)return!1;const n="filter"===t.nodeName||t.parentNode&&"filter"===t.parentNode.nodeName,r=e,{style:s,children:o,scrollTop:i,scrollLeft:f}=r,p=a(r,c),h=Object.values(p),m=Object.keys(p).map(e=>n||t.hasAttribute(e)?e:d[e]||(d[e]=e.replace(/([A-Z])/g,t=>"-"+t.toLowerCase())));void 0!==o&&(t.textContent=o);for(let e in s)if(s.hasOwnProperty(e)){const n=l(e,s[e]);u.test(e)?t.style.setProperty(e,n):t.style[e]=n}m.forEach((e,n)=>{t.setAttribute(e,h[n])}),void 0!==i&&(t.scrollTop=i),void 0!==f&&(t.scrollLeft=f)},createAnimatedStyle:t=>new v(t),getComponentProps:t=>a(t,w)}).animated},function(t,e){},function(t,e){},,,,,function(t,e){t.exports=window.ReactDOM},function(t,e){t.exports=window.moment},function(t,e){t.exports=window.wp.autop},function(t,e){function n(t,e,n,r,s,o,i){try{var a=t[o](i),c=a.value}catch(t){return void n(t)}a.done?e(c):Promise.resolve(c).then(r,s)}t.exports=function(t){return function(){var e=this,r=arguments;return new Promise((function(s,o){var i=t.apply(e,r);function a(t){n(i,s,o,a,c,"next",t)}function c(t){n(i,s,o,a,c,"throw",t)}a(void 0)}))}},t.exports.__esModule=!0,t.exports.default=t.exports},,,,,,,,,function(t,e,n){"use strict";var r=n(0),s=n(9);const o=Object(r.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(s.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"}));e.a=o},,,,,,,,,,,,,function(t,e,n){"use strict";n.r(e);var r=n(6),s=n.n(r),o=n(0),i=n(24),a=n.n(i),c=n(41),u=n(10),l=n(11),d=n.n(l);function f(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}function p(t){for(var e=1;e0&&Object(o.createElement)(m.animated.span,{style:r,className:"simpay-branding-bar__actions-button-count","aria-label":Object(b.sprintf)(/* translators: %d Unread notification count. */ +Object(b.__)("%d unread notifications","stripe"),e)},Object(o.createElement)("span",null,e)),Object(o.createElement)("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(o.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.8333 2.5H4.16667C3.25 2.5 2.5 3.25 2.5 4.16667V15.8333c0 .9167.74167 1.6667 1.66667 1.6667H15.8333c.9167 0 1.6667-.75 1.6667-1.6667V4.16667C17.5 3.25 16.75 2.5 15.8333 2.5Zm0 13.3333H4.16667v-2.5h2.96666C7.70833 14.325 8.775 15 10.0083 15c1.2334 0 2.2917-.675 2.875-1.6667h2.95v2.5Zm-4.1583-4.1666h4.1583V4.16667H4.16667v7.50003h4.175c0 .9166.75 1.6666 1.66663 1.6666.9167 0 1.6667-.75 1.6667-1.6666Z",fill:"currentColor"})))},y=n(56),O=n.n(y),v=n(3),j=n(57),w="simpay-notifications-notification",_=simpayNotifications.isLite;function x(t){switch(t){case"warning":return"warning";case"error":return"dismiss";case"info":return"admin-generic";case"success":default:return"yes-alt"}}function k(t){return Object(u.getAuthority)(window.location.href)!==Object(u.getAuthority)(t)}function S(t,e,n){return!1===k(t)?t:Object(u.addQueryArgs)(t.replace(/\/?$/,"/"),{utm_source:"WordPress",utm_campaign:"1"===_?"lite-plugin":"pro-plugin",utm_medium:e,utm_content:n})}var E=function(t){var e=t.notification,n=t.onDismissNotification,r=e.id,s=e.title,i=e.content,a=e.type,c=e.start,u=e.actions,l=e.is_dismissible;return Object(o.createElement)("div",{className:w,style:{backgroundColor:l?"transparent":"#fafafa"}},Object(o.createElement)("div",{className:"".concat(w,"__icon ").concat(w,"__icon-").concat(a||"success")},Object(o.createElement)("span",{className:"dashicons dashicons-".concat(x(a))})),Object(o.createElement)("div",{className:"".concat(w,"__body")},Object(o.createElement)("div",{className:"".concat(w,"__header")},Object(o.createElement)("div",{className:"".concat(w,"__title")},s),l&&Object(o.createElement)("div",{className:"".concat(w,"__date")},O.a.unix(c).fromNow())),Object(o.createElement)("div",{className:"".concat(w,"__content"),dangerouslySetInnerHTML:{__html:Object(j.autop)(i)}}),Object(o.createElement)("div",{className:"".concat(w,"__actions")},u.map((function(t){var e=t.type,n=t.text,r=t.url;return Object(o.createElement)(v.Button,{key:n,href:S(r,"notification-inbox",s),isPrimary:"primary"===e,isSecondary:"secondary"===e,variant:e,target:k(r)?"_blank":"_self"},n)})),l&&Object(o.createElement)(v.Button,{isLink:!0,variant:"link",onClick:function(){return n(r)}},Object(b.__)("Dismiss","stripe")))))},P=n(58),M=n.n(P),A=n(45),I=n.n(A),C=n(14),R=n.n(C),T=n(12),N=n(22);function V(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:s}}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,i=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return i=t.done,t},e:function(t){a=!0,o=t},f:function(){try{i||null==n.return||n.return()}finally{if(a)throw o}}}}(t?s.current:r.current);try{for(i.s();!(o=i.n()).done;)q(o.value,t)}catch(t){i.e(t)}finally{i.f()}}),[])}([Object(N.useConstrainedTabbing)(),Object(N.useFocusReturn)(),c]),l=Object(o.useState)((function(){return new WeakMap})),d=s()(l,1)[0],f=Object(T.sortBy)(i,"is_dismissible"),p=Object(m.useTransition)(f,{config:m.config.default,enter:function(t){return function(){var e=M()(I.a.mark((function e(n){return I.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n({height:d.get(t).offsetHeight,transform:"translate3d(0%, 0px, 0px)"});case 2:case"end":return e.stop()}}),e)})));return function(_x){return e.apply(this,arguments)}}()},leave:[{transform:"translate3d(150%, 0px, 0px)"},{height:0}],keys:function(t){return t.id},trail:100});return Object(o.createElement)(v.Animate,{type:"slide-in",options:{origin:"left"}},(function(t){var s=t.className,c=R()("simpay-notifications-panel",s);return Object(o.createElement)("div",{ref:u,className:c},Object(o.createElement)(z,{count:e.data.length,onClose:n}),Object(o.createElement)("div",{className:"simpay-notifications-panel__notifications"},a&&Object(o.createElement)("div",{className:"simpay-notifications-panel__none"},Object(o.createElement)(v.Spinner,null)),0===i.length&&!a&&Object(o.createElement)("div",{className:"simpay-notifications-panel__none"},Object(o.createElement)("span",null,Object(b.__)("You have no new notifications.","stripe"))),p((function(t,e){return Object(o.createElement)(m.animated.div,{style:F(F({},t),{},{overflow:"hidden"}),ref:function(t){return t&&d.set(e,t)}},Object(o.createElement)(E,{onDismissNotification:r,notification:e}))}))))}))},$=function(t){var e=t.isOpen,n=t.onClose;return Object(o.useEffect)((function(){return document.body.classList.toggle("simpay-notifications-body-locked"),function(){document.body.classList.remove("simpay-notifications-body-locked")}}),[e]),Object(o.createElement)("button",{className:"simpay-notifications-backdrop",onClick:n})};Object(o.render)(Object(o.createElement)((function(){var t=Object(o.useReducer)(h,{data:[],isLoading:!0}),e=s()(t,2),n=e[0],r=e[1],i=Object(o.useState)("#notifications"===Object(u.getFragment)(window.location.href)),l=s()(i,2),d=l[0],f=l[1];function p(){f(!1),window.history.pushState("",document.title,window.location.pathname+window.location.search)}return Object(o.useEffect)((function(){function t(){"#notifications"===Object(u.getFragment)(window.location.href)&&f(!0)}return window.addEventListener("hashchange",t),function(){window.removeEventListener("hashchange",t)}}),[]),Object(o.useEffect)((function(){if(!n.isLoading){var t=document.querySelector("#wp-admin-bar-simpay-admin-bar-test-mode .wp-ui-notification");if(0===n.data.length){t&&t.remove();var e=document.getElementById("wp-admin-bar-simpay-notifications");e&&e.remove();var r=document.querySelector('#menu-posts-simple-pay .wp-submenu a[href$="#notifications"]');r&&r.remove()}else t&&(t.textContent=n.data.length)}}),[n.data]),Object(o.useEffect)((function(){r({type:"START_RESOLUTION"}),a()({path:"/wpsp/__internal__/notifications"}).then((function(t){var e=t.data;r({type:"SET",notifications:e}),r({type:"FINISH_RESOLUTION"})}))}),[]),Object(o.createElement)("div",{onKeyDown:function(t){t.keyCode!==c.ESCAPE||t.defaultPrevented||(t.preventDefault(),f(!1))},role:"region"},Object(o.createElement)(g,{count:n.data.length,isOpen:d,onOpen:function(){f(!0),window.history.pushState("",document.title,window.location.pathname+window.location.search+"#notifications")}}),d&&Object(o.createElement)(o.Fragment,null,Object(o.createElement)(U,{notifications:n,onDismissNotification:function(t){r({type:"DISMISS",id:t}),a()({path:"/wpsp/__internal__/notifications/"+t,method:"DELETE"})},onClose:p}),Object(o.createElement)($,{onClose:p})))}),null),document.getElementById("simpay-branding-bar-notifications"))}]); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-page-activity-reports-css.asset.php b/includes/core/assets/js/dist/simpay-admin-page-activity-reports-css.asset.php index 43f87d6a..85b7af67 100644 --- a/includes/core/assets/js/dist/simpay-admin-page-activity-reports-css.asset.php +++ b/includes/core/assets/js/dist/simpay-admin-page-activity-reports-css.asset.php @@ -1 +1 @@ - array(), 'version' => '573049bae9275d33a66d652f3a3ff8c7'); \ No newline at end of file + array(), 'version' => 'e9b7cd73b88acda30af513715d29ee94'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-page-activity-reports.asset.php b/includes/core/assets/js/dist/simpay-admin-page-activity-reports.asset.php index 8f0ad733..3e8865cd 100644 --- a/includes/core/assets/js/dist/simpay-admin-page-activity-reports.asset.php +++ b/includes/core/assets/js/dist/simpay-admin-page-activity-reports.asset.php @@ -1 +1 @@ - array('lodash', 'react', 'wp-api-fetch', 'wp-components', 'wp-core-data', 'wp-data', 'wp-date', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => '865904a6360b86b2b48ca786d982c481'); \ No newline at end of file + array('lodash', 'react', 'wp-api-fetch', 'wp-components', 'wp-core-data', 'wp-data', 'wp-date', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => '5add37d82a4d7a26743dc6a03948d095'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-page-activity-reports.js b/includes/core/assets/js/dist/simpay-admin-page-activity-reports.js index 4cae676a..80255911 100644 --- a/includes/core/assets/js/dist/simpay-admin-page-activity-reports.js +++ b/includes/core/assets/js/dist/simpay-admin-page-activity-reports.js @@ -1,6 +1,6 @@ -!function(t){var e={};function i(n){if(e[n])return e[n].exports;var a=e[n]={i:n,l:!1,exports:{}};return t[n].call(a.exports,a,a.exports,i),a.l=!0,a.exports}i.m=t,i.c=e,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 a in t)i.d(n,a,function(e){return t[e]}.bind(null,a));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="",i(i.s=79)}([function(t,e){t.exports=window.wp.element},,function(t,e){t.exports=window.wp.i18n},function(t,e){t.exports=window.wp.components},function(t,e,i){"use strict";function n(t,e){if(e.length1?"s":"")+" required, but only "+e.length+" present")}i.d(e,"a",(function(){return n}))},function(t,e){t.exports=window.React},function(t,e,i){var n=i(26),a=i(27),s=i(22),r=i(28);t.exports=function(t,e){return n(t)||a(t,e)||s(t,e)||r()},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){"use strict";function n(t){if(null===t||!0===t||!1===t)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}i.d(e,"a",(function(){return n}))},function(t,e,i){"use strict";i.d(e,"a",(function(){return s}));var n=i(4);function a(t){return(a="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 s(t){Object(n.a)(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||"object"===a(t)&&"[object Date]"===e?new Date(t.getTime()):"number"==typeof t||"[object Number]"===e?new Date(t):("string"!=typeof t&&"[object String]"!==e||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}},function(t,e){t.exports=window.wp.primitives},function(t,e){t.exports=window.wp.url},function(t,e,i){var n=i(30);t.exports=function(t,e,i){return(e=n(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=window.lodash},function(t,e,i){var n;!function(){"use strict";var i={}.hasOwnProperty;function a(){for(var t=[],e=0;eArray.prototype.slice.call(t));let a=!1,s=[];return function(...i){s=n(i),a||(a=!0,h.call(window,()=>{a=!1,t.apply(e,s)}))}}const u=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2;function f(){}const p=function(){let t=0;return function(){return t++}}();function g(t){return null==t}function m(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.substr(0,7)&&"Array]"===e.substr(-6)}function b(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}const y=t=>("number"==typeof t||t instanceof Number)&&isFinite(+t);function x(t,e){return y(t)?t:e}function v(t,e){return void 0===t?e:t}const _=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function w(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function O(t,e,i,n){let a,s,r;if(m(t))if(s=t.length,n)for(a=s-1;a>=0;a--)e.call(i,t[a],a);else for(a=0;ai;)t=t[e.substr(i,n-i)],i=n+1,n=C(e,i);return t}function A(t){return t.charAt(0).toUpperCase()+t.slice(1)}const L=t=>void 0!==t,R=t=>"function"==typeof t,N=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0},F=Math.PI,I=2*F,z=I+F,B=Number.POSITIVE_INFINITY,V=F/180,W=F/2,H=F/4,U=2*F/3,Y=Math.log10,$=Math.sign;function X(t){const e=Math.round(t);t=G(t,e,t/1e3)?e:t;const i=Math.pow(10,Math.floor(Y(t))),n=t/i;return(n<=1?1:n<=2?2:n<=5?5:10)*i}function q(t){return!isNaN(parseFloat(t))&&isFinite(t)}function G(t,e,i){return Math.abs(t-e)l&&c=Math.min(e,i)-n&&t<=Math.max(e,i)+n}const ot=t=>0===t||1===t,lt=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*I/i),ct=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*I/i)+1,ht={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*W),easeOutSine:t=>Math.sin(t*W),easeInOutSine:t=>-.5*(Math.cos(F*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>ot(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>ot(t)?t:lt(t,.075,.3),easeOutElastic:t=>ot(t)?t:ct(t,.075,.3),easeInOutElastic(t){const e=.1125;return ot(t)?t:t<.5?.5*lt(2*t,e,.45):.5+.5*ct(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-ht.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*ht.easeInBounce(2*t):.5*ht.easeOutBounce(2*t-1)+.5},dt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},ut="0123456789ABCDEF",ft=t=>ut[15&t],pt=t=>ut[(240&t)>>4]+ut[15&t],gt=t=>(240&t)>>4==(15&t);function mt(t){return t+.5|0}const bt=(t,e,i)=>Math.max(Math.min(t,i),e);function yt(t){return bt(mt(2.55*t),0,255)}function xt(t){return bt(mt(255*t),0,255)}function vt(t){return bt(mt(t/2.55)/100,0,1)}function _t(t){return bt(mt(100*t),0,100)}const wt=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/,Ot=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Mt(t,e,i){const n=e*Math.min(i,1-i),a=(e,a=(e+t/30)%12)=>i-n*Math.max(Math.min(a-3,9-a,1),-1);return[a(0),a(8),a(4)]}function kt(t,e,i){const n=(n,a=(n+t/60)%6)=>i-i*e*Math.max(Math.min(a,4-a,1),0);return[n(5),n(3),n(1)]}function jt(t,e,i){const n=Mt(t,1,.5);let a;for(e+i>1&&(a=1/(e+i),e*=a,i*=a),a=0;a<3;a++)n[a]*=1-e-i,n[a]+=e;return n}function St(t){const e=t.r/255,i=t.g/255,n=t.b/255,a=Math.max(e,i,n),s=Math.min(e,i,n),r=(a+s)/2;let o,l,c;return a!==s&&(c=a-s,l=r>.5?c/(2-a-s):c/(a+s),o=a===e?(i-n)/c+(i=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=xt(t[3]))):(e=Rt(t,{r:0,g:0,b:0,a:1})).a=xt(e.a),e}function Ft(t){return"r"===t.charAt(0)?function(t){const e=wt.exec(t);let i,n,a,s=255;if(e){if(e[7]!==i){const t=+e[7];s=255&(e[8]?yt(t):255*t)}return i=+e[1],n=+e[3],a=+e[5],i=255&(e[2]?yt(i):i),n=255&(e[4]?yt(n):n),a=255&(e[6]?yt(a):a),{r:i,g:n,b:a,a:s}}}(t):function(t){const e=Ot.exec(t);let i,n=255;if(!e)return;e[5]!==i&&(n=e[6]?yt(+e[5]):xt(+e[5]));const a=Et(+e[2]),s=+e[3]/100,r=+e[4]/100;return i="hwb"===e[1]?function(t,e,i){return Dt(jt,t,e,i)}(a,s,r):"hsv"===e[1]?function(t,e,i){return Dt(kt,t,e,i)}(a,s,r):Pt(a,s,r),{r:i[0],g:i[1],b:i[2],a:n}}(t)}class It{constructor(t){if(t instanceof It)return t;const e=typeof t;let i;var n,a,s;"object"===e?i=Nt(t):"string"===e&&(s=(n=t).length,"#"===n[0]&&(4===s||5===s?a={r:255&17*dt[n[1]],g:255&17*dt[n[2]],b:255&17*dt[n[3]],a:5===s?17*dt[n[4]]:255}:7!==s&&9!==s||(a={r:dt[n[1]]<<4|dt[n[2]],g:dt[n[3]]<<4|dt[n[4]],b:dt[n[5]]<<4|dt[n[6]],a:9===s?dt[n[7]]<<4|dt[n[8]]:255})),i=a||function(t){At||(At=function(){const t={},e=Object.keys(Tt),i=Object.keys(Ct);let n,a,s,r,o;for(n=0;n>16&255,s>>8&255,255&s]}return t}(),At.transparent=[0,0,0,0]);const e=At[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}(t)||Ft(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Rt(this._rgb);return t&&(t.a=vt(t.a)),t}set rgb(t){this._rgb=Nt(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${vt(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):this._rgb;var t}hexString(){return this._valid?(t=this._rgb,e=function(t){return gt(t.r)&>(t.g)&>(t.b)&>(t.a)}(t)?ft:pt,t?"#"+e(t.r)+e(t.g)+e(t.b)+(t.a<255?e(t.a):""):t):this._rgb;var t,e}hslString(){return this._valid?function(t){if(!t)return;const e=St(t),i=e[0],n=_t(e[1]),a=_t(e[2]);return t.a<255?`hsla(${i}, ${n}%, ${a}%, ${vt(t.a)})`:`hsl(${i}, ${n}%, ${a}%)`}(this._rgb):this._rgb}mix(t,e){const i=this;if(t){const n=i.rgb,a=t.rgb;let s;const r=e===s?.5:e,o=2*r-1,l=n.a-a.a,c=((o*l==-1?o:(o+l)/(1+o*l))+1)/2;s=1-c,n.r=255&c*n.r+s*a.r+.5,n.g=255&c*n.g+s*a.g+.5,n.b=255&c*n.b+s*a.b+.5,n.a=r*n.a+(1-r)*a.a,i.rgb=n}return i}clone(){return new It(this.rgb)}alpha(t){return this._rgb.a=xt(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=mt(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Lt(this._rgb,2,t),this}darken(t){return Lt(this._rgb,2,-t),this}saturate(t){return Lt(this._rgb,1,t),this}desaturate(t){return Lt(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=St(t);i[0]=Et(i[0]+e),i=Pt(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}function zt(t){return new It(t)}const Bt=t=>t instanceof CanvasGradient||t instanceof CanvasPattern;function Vt(t){return Bt(t)?t:zt(t)}function Wt(t){return Bt(t)?t:zt(t).saturate(.5).darken(.1).hexString()}const Ht=Object.create(null),Ut=Object.create(null);function Yt(t,e){if(!e)return t;const i=e.split(".");for(let e=0,n=i.length;et.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>Wt(e.backgroundColor),this.hoverBorderColor=(t,e)=>Wt(e.borderColor),this.hoverColor=(t,e)=>Wt(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t)}set(t,e){return $t(this,t,e)}get(t){return Yt(this,t)}describe(t,e){return $t(Ut,t,e)}override(t,e){return $t(Ht,t,e)}route(t,e,i,n){const a=Yt(this,t),s=Yt(this,i),r="_"+e;Object.defineProperties(a,{[r]:{value:a[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[r],e=s[n];return b(t)?Object.assign({},e,t):v(t,e)},set(t){this[r]=t}}})}}({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function qt(t,e,i,n,a){let s=e[a];return s||(s=e[a]=t.measureText(a).width,i.push(a)),s>n&&(n=s),n}function Gt(t,e,i,n){let a=(n=n||{}).data=n.data||{},s=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(a=n.data={},s=n.garbageCollect=[],n.font=e),t.save(),t.font=e;let r=0;const o=i.length;let l,c,h,d,u;for(l=0;li.length){for(l=0;l0&&t.stroke()}}function Jt(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.xe.top-i&&t.y0&&""!==s.strokeColor;let l,c;for(t.save(),t.font=a.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),g(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,s),l=0;lv(t[i],t[e[i]]):e=>t[e]:()=>t;for(const t of a)i[t]=+s(t)||0;return i}function de(t){return he(t,{top:"y",right:"x",bottom:"y",left:"x"})}function ue(t){return he(t,["topLeft","topRight","bottomLeft","bottomRight"])}function fe(t){const e=de(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function pe(t,e){t=t||{},e=e||Xt.font;let i=v(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let n=v(t.style,e.style);n&&!(""+n).match(le)&&(console.warn('Invalid font style specified: "'+n+'"'),n="");const a={family:v(t.family,e.family),lineHeight:ce(v(t.lineHeight,e.lineHeight),i),size:i,style:n,weight:v(t.weight,e.weight),string:""};return a.string=function(t){return!t||g(t.size)||g(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(a),a}function ge(t,e,i,n){let a,s,r,o=!0;for(a=0,s=t.length;at[i]1;)n=s+a>>1,i(n)?s=n:a=n;return{lo:s,hi:a}}const ye=(t,e,i)=>be(t,i,n=>t[n][e]be(t,i,n=>t[n][e]>=i),ve=["push","pop","shift","splice","unshift"];function _e(t,e){const i=t._chartjs;if(!i)return;const n=i.listeners,a=n.indexOf(e);-1!==a&&n.splice(a,1),n.length>0||(ve.forEach(e=>{delete t[e]}),delete t._chartjs)}function we(t){const e=new Set;let i,n;for(i=0,n=t.length;it[0])){L(n)||(n=Le("_fallback",t));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:i,_fallback:n,_getTarget:a,override:a=>Oe([a,...t],e,i,n)};return new Proxy(s,{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,n)=>De(i,n,()=>function(t,e,i,n){let a;for(const s of e)if(a=Le(je(s,t),i),L(a))return Se(t,a)?Te(i,n,t,a):a}(n,e,t,i)),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>Re(t).includes(e),ownKeys:t=>Re(t),set(t,e,i){const n=t._storage||(t._storage=a());return t[e]=n[e]=i,delete t._keys,!0}})}function Me(t,e,i,n){const a={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:ke(t,n),setContext:e=>Me(t,e,i,n),override:a=>Me(t.override(a),e,i,n)};return new Proxy(a,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>De(t,e,()=>function(t,e,i){const{_proxy:n,_context:a,_subProxy:s,_descriptors:r}=t;let o=n[e];return R(o)&&r.isScriptable(e)&&(o=function(t,e,i,n){const{_proxy:a,_context:s,_subProxy:r,_stack:o}=i;if(o.has(t))throw new Error("Recursion detected: "+Array.from(o).join("->")+"->"+t);return o.add(t),e=e(s,r||n),o.delete(t),Se(t,e)&&(e=Te(a._scopes,a,t,e)),e}(e,o,t,i)),m(o)&&o.length&&(o=function(t,e,i,n){const{_proxy:a,_context:s,_subProxy:r,_descriptors:o}=i;if(L(s.index)&&n(t))e=e[s.index%e.length];else if(b(e[0])){const i=e,n=a._scopes.filter(t=>t!==i);e=[];for(const l of i){const i=Te(n,a,t,l);e.push(Me(i,s,r&&r[t],o))}}return e}(e,o,t,r.isIndexable)),Se(e,o)&&(o=Me(o,a,s&&s[e],r)),o}(t,e,i)),getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,i)=>Reflect.has(t,i),ownKeys:()=>Reflect.ownKeys(t),set:(e,i,n)=>(t[i]=n,delete e[i],!0)})}function ke(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:n=e.indexable,_allKeys:a=e.allKeys}=t;return{allKeys:a,scriptable:i,indexable:n,isScriptable:R(i)?i:()=>i,isIndexable:R(n)?n:()=>n}}const je=(t,e)=>t?t+A(e):e,Se=(t,e)=>b(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function De(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const n=i();return t[e]=n,n}function Pe(t,e,i){return R(t)?t(e,i):t}const Ee=(t,e)=>!0===t?e:"string"==typeof t?T(e,t):void 0;function Ce(t,e,i,n,a){for(const s of e){const e=Ee(i,s);if(e){t.add(e);const s=Pe(e._fallback,i,a);if(L(s)&&s!==i&&s!==n)return s}else if(!1===e&&L(n)&&i!==n)return null}return!1}function Te(t,e,i,n){const a=e._rootScopes,s=Pe(e._fallback,i,n),r=[...t,...a],o=new Set;o.add(n);let l=Ae(o,r,i,s||i,n);return null!==l&&(!L(s)||s===i||(l=Ae(o,r,s,l,n),null!==l))&&Oe(Array.from(o),[""],a,s,()=>function(t,e,i){const n=t._getTarget();e in n||(n[e]={});const a=n[e];return m(a)&&b(i)?i:a}(e,i,n))}function Ae(t,e,i,n,a){for(;i;)i=Ce(t,e,i,n,a);return i}function Le(t,e){for(const i of e){if(!i)continue;const e=i[t];if(L(e))return e}}function Re(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter(t=>!t.startsWith("_")))e.add(t);return Array.from(e)}(t._scopes)),e}const Ne=Number.EPSILON||1e-14,Fe=(t,e)=>e"x"===t?"y":"x";function ze(t,e,i,n){const a=t.skip?e:t,s=e,r=i.skip?e:i,o=et(s,a),l=et(r,s);let c=o/(o+l),h=l/(o+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=n*c,u=n*h;return{previous:{x:s.x-d*(r.x-a.x),y:s.y-d*(r.y-a.y)},next:{x:s.x+u*(r.x-a.x),y:s.y+u*(r.y-a.y)}}}function Be(t,e,i){return Math.max(Math.min(t,i),e)}function Ve(t,e,i,n,a){let s,r,o,l;if(e.spanGaps&&(t=t.filter(t=>!t.skip)),"monotone"===e.cubicInterpolationMode)!function(t,e="x"){const i=Ie(e),n=t.length,a=Array(n).fill(0),s=Array(n);let r,o,l,c=Fe(t,0);for(r=0;rwindow.getComputedStyle(t,null),$e=["top","right","bottom","left"];function Xe(t,e,i){const n={};i=i?"-"+i:"";for(let a=0;a<4;a++){const s=$e[a];n[s]=parseFloat(t[e+"-"+s+i])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function qe(t,e){const{canvas:i,currentDevicePixelRatio:n}=e,a=Ye(i),s="border-box"===a.boxSizing,r=Xe(a,"padding"),o=Xe(a,"border","width"),{x:l,y:c,box:h}=function(t,e){const i=t.native||t,n=i.touches,a=n&&n.length?n[0]:i,{offsetX:s,offsetY:r}=a;let o,l,c=!1;if(((t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot))(s,r,i.target))o=s,l=r;else{const t=e.getBoundingClientRect();o=a.clientX-t.left,l=a.clientY-t.top,c=!0}return{x:o,y:l,box:c}}(t,i),d=r.left+(h&&o.left),u=r.top+(h&&o.top);let{width:f,height:p}=e;return s&&(f-=r.width+o.width,p-=r.height+o.height),{x:Math.round((l-d)/f*i.width/n),y:Math.round((c-u)/p*i.height/n)}}const Ge=t=>Math.round(10*t)/10;function Qe(t,e,i){const n=e||1,a=Math.floor(t.height*n),s=Math.floor(t.width*n);t.height=a/n,t.width=s/n;const r=t.canvas;return r.style&&(i||!r.style.height&&!r.style.width)&&(r.style.height=t.height+"px",r.style.width=t.width+"px"),(t.currentDevicePixelRatio!==n||r.height!==a||r.width!==s)&&(t.currentDevicePixelRatio=n,r.height=a,r.width=s,t.ctx.setTransform(n,0,0,n,0,0),!0)}const Ke=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(t){}return t}();function Ze(t,e){const i=function(t,e){return Ye(t).getPropertyValue(e)}(t,e),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function Je(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function ti(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:"middle"===n?i<.5?t.y:e.y:"after"===n?i<1?t.y:e.y:i>0?e.y:t.y}}function ei(t,e,i,n){const a={x:t.cp2x,y:t.cp2y},s={x:e.cp1x,y:e.cp1y},r=Je(t,a,i),o=Je(a,s,i),l=Je(s,e,i),c=Je(r,o,i),h=Je(o,l,i);return Je(c,h,i)}const ii=new Map;function ni(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let n=ii.get(i);return n||(n=new Intl.NumberFormat(t,e),ii.set(i,n)),n}(e,i).format(t)}function ai(t,e,i){return t?function(t,e){return{x:i=>t+t+e-i,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,i):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function si(t){return"angle"===t?{between:at,compare:it,normalize:nt}:{between:rt,compare:(t,e)=>t-e,normalize:t=>t}}function ri({start:t,end:e,count:i,loop:n,style:a}){return{start:t%i,end:e%i,loop:n&&(e-t+1)%i==0,style:a}}function oi(t,e,i){if(!i)return[t];const{property:n,start:a,end:s}=i,r=e.length,{compare:o,between:l,normalize:c}=si(n),{start:h,end:d,loop:u,style:f}=function(t,e,i){const{property:n,start:a,end:s}=i,{between:r,normalize:o}=si(n),l=e.length;let c,h,{start:d,end:u,loop:f}=t;if(f){for(d+=l,u+=l,c=0,h=l;cn({chart:t,initial:e.initial,numSteps:s,currentStep:Math.min(i-e.start,s)}))}_refresh(){this._request||(this._running=!0,this._request=h.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,n)=>{if(!i.running||!i.items.length)return;const a=i.items;let s,r=a.length-1,o=!1;for(;r>=0;--r)s=a[r],s._active?(s._total>i.duration&&(i.duration=s._total),s.tick(t),o=!0):(a[r]=a[a.length-1],a.pop());o&&(n.draw(),this._notify(n,i,t,"progress")),a.length||(i.running=!1,this._notify(n,i,t,"complete"),i.initial=!1),e+=a.length}),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((t,e)=>Math.max(t,e._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let n=i.length-1;for(;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}};const ui={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const n=Vt(t||"transparent"),a=n.valid&&Vt(e||"transparent");return a&&a.valid?a.mix(n,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class fi{constructor(t,e,i,n){const a=e[i];n=ge([t.to,n,a,t.from]);const s=ge([t.from,a,n]);this._active=!0,this._fn=t.fn||ui[t.type||typeof s],this._easing=ht[t.easing]||ht.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=s,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const n=this._target[this._prop],a=i-this._start,s=this._duration-a;this._start=i,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=a,this._loop=!!t.loop,this._to=ge([t.to,e,n,t.from]),this._from=ge([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,n=this._prop,a=this._from,s=this._loop,r=this._to;let o;if(this._active=a!==r&&(s||e1?2-o:o,o=this._easing(Math.min(1,Math.max(0,o))),this._target[n]=this._fn(a,r,o))}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let t=0;t"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),Xt.set("animations",{colors:{type:"color",properties:["color","borderColor","backgroundColor"]},numbers:{type:"number",properties:["x","y","borderWidth","radius","tension"]}}),Xt.describe("animations",{_fallback:"animation"}),Xt.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}});class gi{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!b(t))return;const e=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const n=t[i];if(!b(n))return;const a={};for(const t of pi)a[t]=n[t];(m(n.properties)&&n.properties||[i]).forEach(t=>{t!==i&&e.has(t)||e.set(t,a)})})}_animateOptions(t,e){const i=e.options,n=function(t,e){if(!e)return;let i=t.options;if(i)return i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i;t.options=e}(t,i);if(!n)return[];const a=this._createAnimations(n,i);return i.$shared&&function(t,e){const i=[],n=Object.keys(e);for(let e=0;e{t.options=i},()=>{}),a}_createAnimations(t,e){const i=this._properties,n=[],a=t.$animations||(t.$animations={}),s=Object.keys(e),r=Date.now();let o;for(o=s.length-1;o>=0;--o){const l=s[o];if("$"===l.charAt(0))continue;if("options"===l){n.push(...this._animateOptions(t,e));continue}const c=e[l];let h=a[l];const d=i.get(l);if(h){if(d&&h.active()){h.update(d,c,r);continue}h.cancel()}d&&d.duration?(a[l]=h=new fi(d,t,l,c),n.push(h)):t[l]=c}return n}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(di.add(this._chart,i),!0):void 0}}function mi(t,e){const i=t&&t.options||{},n=i.reverse,a=void 0===i.min?e:0,s=void 0===i.max?e:0;return{start:n?s:a,end:n?a:s}}function bi(t,e){const i=[],n=t._getSortedDatasetMetas(e);let a,s;for(a=0,s=n.length;a0||!i&&e<0)return a.index}return null}function wi(t,e){const{chart:i,_cachedMeta:n}=t,a=i._stacks||(i._stacks={}),{iScale:s,vScale:r,index:o}=n,l=s.axis,c=r.axis,h=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(s,r,n),d=e.length;let u;for(let t=0;ti[t].axis===e).shift()}function Mi(t,e){const i=t.controller.index,n=t.vScale&&t.vScale.axis;if(n){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[n]||void 0===e[n][i])return;delete e[n][i]}}}const ki=t=>"reset"===t||"none"===t,ji=(t,e)=>e?t:Object.assign({},t);class Si{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=xi(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&Mi(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=(t,e,i,n)=>"x"===t?e:"r"===t?n:i,a=e.xAxisID=v(i.xAxisID,Oi(t,"x")),s=e.yAxisID=v(i.yAxisID,Oi(t,"y")),r=e.rAxisID=v(i.rAxisID,Oi(t,"r")),o=e.indexAxis,l=e.iAxisID=n(o,a,s,r),c=e.vAxisID=n(o,s,a,r);e.xScale=this.getScaleForId(a),e.yScale=this.getScaleForId(s),e.rScale=this.getScaleForId(r),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&_e(this._data,this),t._stacked&&Mi(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(b(e))this._data=function(t){const e=Object.keys(t),i=new Array(e.length);let n,a,s;for(n=0,a=e.length;n{const e="_onData"+A(t),i=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...t){const a=i.apply(this,t);return n._chartjs.listeners.forEach(i=>{"function"==typeof i[e]&&i[e](...t)}),a}})}))),this._syncList=[],this._data=e}var n}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let n=!1;this._dataCheck();const a=e._stacked;e._stacked=xi(e.vScale,e),e.stack!==i.stack&&(n=!0,Mi(e),e.stack=i.stack),this._resyncElements(t),(n||a!==e._stacked)&&wi(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:n}=this,{iScale:a,_stacked:s}=i,r=a.axis;let o,l,c,h=0===t&&e===n.length||i._sorted,d=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=n,i._sorted=!0,c=n;else{c=m(n[t])?this.parseArrayData(i,n,t,e):b(n[t])?this.parseObjectData(i,n,t,e):this.parsePrimitiveData(i,n,t,e);const a=()=>null===l[r]||d&&l[r]t&&!e.hidden&&e._stacked&&{keys:bi(i,!0),values:null})(e,i,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:h}=function(t){const{min:e,max:i,minDefined:n,maxDefined:a}=t.getUserBounds();return{min:n?e:Number.NEGATIVE_INFINITY,max:a?i:Number.POSITIVE_INFINITY}}(r);let d,u;function f(){u=n[d];const e=u[r.axis];return!y(u[t.axis])||c>e||h=0;--d)if(!f()){this.updateRangeFromParsed(l,t,u,o);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let n,a,s;for(n=0,a=e.length;n=0&&tthis.getContext(i,n),h);return f.$shared&&(f.$shared=o,a[s]=Object.freeze(ji(f,o))),f}_resolveAnimations(t,e,i){const n=this.chart,a=this._cachedDataOpts,s="animation-"+e,r=a[s];if(r)return r;let o;if(!1!==n.options.animation){const n=this.chart.config,a=n.datasetAnimationScopeKeys(this._type,e),s=n.getOptionScopes(this.getDataset(),a);o=n.createResolver(s,this.getContext(t,i,e))}const l=new gi(n,o&&o.animations);return o&&o._cacheable&&(a[s]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||ki(t)||this.chart._animationsDisabled}updateElement(t,e,i,n){ki(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!ki(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;const a=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(a)||a})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];const n=i.length,a=e.length,s=Math.min(a,n);s&&this.parse(0,s),a>n?this._insertElements(n,a-n,t):a{for(t.length+=e,r=t.length-1;r>=s;r--)t[r]=t[r-e]};for(o(a),r=t;rt-e))}return t._cache.$bar}(e,t.type);let n,a,s,r,o=e._length;const l=()=>{32767!==s&&-32768!==s&&(L(r)&&(o=Math.min(o,Math.abs(s-r)||o)),r=s)};for(n=0,a=i.length;nMath.abs(o)&&(l=o,c=r),e[i.axis]=c,e._custom={barStart:l,barEnd:c,start:a,end:s,min:r,max:o}}(t,e,i,n):e[i.axis]=i.parse(t,n),e}function Ei(t,e,i,n){const a=t.iScale,s=t.vScale,r=a.getLabels(),o=a===s,l=[];let c,h,d,u;for(c=i,h=i+n;ct.x,i="left",n="right"):(e=t.base=i?1:-1)}(h,e,s)*a,d===s&&(m-=h/2),c=m+h),m===e.getPixelForValue(s)){const t=$(h)*e.getLineWidthForValue(s)/2;m+=t,h-=t}return{size:h,base:m,head:c,center:c+h/2}}_calculateBarIndexPixels(t,e){const i=e.scale,n=this.options,a=n.skipNull,s=v(n.maxBarThickness,1/0);let r,o;if(e.grouped){const i=a?this._getStackCount(t):e.stackCount,l="flex"===n.barThickness?function(t,e,i,n){const a=e.pixels,s=a[t];let r=t>0?a[t-1]:null,o=t=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,{xScale:i,yScale:n}=e,a=this.getParsed(t),s=i.getLabelForValue(a.x),r=n.getLabelForValue(a.y),o=a._custom;return{label:e.label,value:"("+s+", "+r+(o?", "+o:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,n){const a="reset"===n,{iScale:s,vScale:r}=this._cachedMeta,o=this.resolveDataElementOptions(e,n),l=this.getSharedOptions(o),c=this.includeOptions(n,l),h=s.axis,d=r.axis;for(let o=e;o""}}}};class Ii extends Si{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,n=this._cachedMeta;if(!1===this._parsing)n._parsed=i;else{let a,s,r=t=>+i[t];if(b(i[t])){const{key:t="value"}=this._parsing;r=e=>+T(i[e],t)}for(a=t,s=t+e;aat(t,o,l,!0)?1:Math.max(e,e*i,n,n*i),p=(t,e,n)=>at(t,o,l,!0)?-1:Math.min(e,e*i,n,n*i),g=f(0,c,d),m=f(W,h,u),b=p(F,c,d),y=p(F+W,h,u);n=(g-b)/2,a=(m-y)/2,s=-(g+b)/2,r=-(m+y)/2}return{ratioX:n,ratioY:a,offsetX:s,offsetY:r}}(u,d,o),b=(i.width-s)/f,y=(i.height-s)/p,x=Math.max(Math.min(b,y)/2,0),v=_(this.options.radius,x),w=(v-Math.max(v*o,0))/this._getVisibleDatasetWeightTotal();this.offsetX=g*v,this.offsetY=m*v,n.total=this.calculateTotal(),this.outerRadius=v-w*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-w*h,0),this.updateElements(a,0,a.length,t)}_circumference(t,e){const i=this.options,n=this._cachedMeta,a=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===n._parsed[t]||n.data[t].hidden?0:this.calculateCircumference(n._parsed[t]*a/I)}updateElements(t,e,i,n){const a="reset"===n,s=this.chart,r=s.chartArea,o=s.options.animation,l=(r.left+r.right)/2,c=(r.top+r.bottom)/2,h=a&&o.animateScale,d=h?0:this.innerRadius,u=h?0:this.outerRadius,f=this.resolveDataElementOptions(e,n),p=this.getSharedOptions(f),g=this.includeOptions(n,p);let m,b=this._getRotation();for(m=0;m0&&!isNaN(t)?I*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],a=ni(e._parsed[t],i.options.locale);return{label:n[t]||"",value:a}}getMaxBorderWidth(t){let e=0;const i=this.chart;let n,a,s,r,o;if(!t)for(n=0,a=i.data.datasets.length;n"spacing"!==t,_indexable:t=>"spacing"!==t},Ii.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map((e,n)=>{const a=t.getDatasetMeta(0).controller.getStyle(n);return{text:e,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,lineWidth:a.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label(t){let e=t.label;const i=": "+t.formattedValue;return m(e)?(e=e.slice(),e[0]+=i):e+=i,e}}}}};class zi extends Si{initialize(){this.enableOptionSharing=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:n=[],_dataset:a}=e,s=this.chart._animationsDisabled;let{start:r,count:o}=function(t,e,i){const n=e.length;let a=0,s=n;if(t._sorted){const{iScale:r,_parsed:o}=t,l=r.axis,{min:c,max:h,minDefined:d,maxDefined:u}=r.getUserBounds();d&&(a=st(Math.min(ye(o,r.axis,c).lo,i?n:ye(e,l,r.getPixelForValue(c)).lo),0,n-1)),s=u?st(Math.max(ye(o,r.axis,h).hi+1,i?0:ye(e,l,r.getPixelForValue(h)).hi+1),a,n)-a:n-a}return{start:a,count:s}}(e,n,s);this._drawStart=r,this._drawCount=o,function(t){const{xScale:e,yScale:i,_scaleRanges:n}=t,a={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!n)return t._scaleRanges=a,!0;const s=n.xmin!==e.min||n.xmax!==e.max||n.ymin!==i.min||n.ymax!==i.max;return Object.assign(n,a),s}(e)&&(r=0,o=n.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!a._decimated,i.points=n;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!s,options:l},t),this.updateElements(n,r,o,t)}updateElements(t,e,i,n){const a="reset"===n,{iScale:s,vScale:r,_stacked:o,_dataset:l}=this._cachedMeta,c=this.resolveDataElementOptions(e,n),h=this.getSharedOptions(c),d=this.includeOptions(n,h),u=s.axis,f=r.axis,{spanGaps:p,segment:m}=this.options,b=q(p)?p:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||a||"none"===n;let x=e>0&&this.getParsed(e-1);for(let c=e;c0&&i[u]-x[u]>b,m&&(p.parsed=i,p.raw=l.data[c]),d&&(p.options=h||this.resolveDataElementOptions(c,e.active?"active":n)),y||this.updateElement(e,c,p,n),x=i}this.updateSharedOptions(h,n,c)}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return i;const a=n[0].size(this.resolveDataElementOptions(0)),s=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,a,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}zi.id="line",zi.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},zi.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class Bi extends Si{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],a=ni(e._parsed[t].r,i.options.locale);return{label:n[t]||"",value:a}}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),a=Math.max(n/2,0),s=(a-Math.max(i.cutoutPercentage?a/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=a-s*this.index,this.innerRadius=this.outerRadius-s}updateElements(t,e,i,n){const a="reset"===n,s=this.chart,r=this.getDataset(),o=s.options.animation,l=this._cachedMeta.rScale,c=l.xCenter,h=l.yCenter,d=l.getIndexAngle(0)-.5*F;let u,f=d;const p=360/this.countVisibleElements();for(u=0;u{!isNaN(t.data[n])&&this.chart.getDataVisibility(n)&&i++}),i}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?K(this.resolveDataElementOptions(t,e).angle||i):0}}Bi.id="polarArea",Bi.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},Bi.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map((e,n)=>{const a=t.getDatasetMeta(0).controller.getStyle(n);return{text:e,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,lineWidth:a.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label:t=>t.chart.data.labels[t.dataIndex]+": "+t.formattedValue}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class Vi extends Ii{}Vi.id="pie",Vi.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Wi extends Si{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}update(t){const e=this._cachedMeta,i=e.dataset,n=e.data||[],a=e.iScale.getLabels();if(i.points=n,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const s={_loop:!0,_fullLoop:a.length===n.length,options:e};this.updateElement(i,void 0,s,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,i,n){const a=this.getDataset(),s=this._cachedMeta.rScale,r="reset"===n;for(let o=e;o"",label:t=>"("+t.label+", "+t.formattedValue+")"}}},scales:{x:{type:"linear"},y:{type:"linear"}}};class Yi{constructor(t){this.options=t||{}}formats(){return Ui()}parse(t,e){return Ui()}format(t,e){return Ui()}add(t,e,i){return Ui()}diff(t,e,i){return Ui()}startOf(t,e,i){return Ui()}endOf(t,e){return Ui()}}Yi.override=function(t){Object.assign(Yi.prototype,t)};var $i={_date:Yi};function Xi(t,e){return"native"in t?{x:t.x,y:t.y}:qe(t,e)}function qi(t,e,i,n){const{controller:a,data:s,_sorted:r}=t,o=a._cachedMeta.iScale;if(o&&e===o.axis&&"r"!==e&&r&&s.length){const t=o._reversePixels?xe:ye;if(!n)return t(s,e,i);if(a._sharedOptions){const n=s[0],a="function"==typeof n.getRange&&n.getRange(e);if(a){const n=t(s,e,i-a),r=t(s,e,i+a);return{lo:n.lo,hi:r.hi}}}}return{lo:0,hi:s.length-1}}function Gi(t,e,i,n,a){const s=t.getSortedVisibleDatasetMetas(),r=i[e];for(let t=0,i=s.length;t{t[o](a[r],n)&&s.push({element:t,datasetIndex:e,index:i}),t.inRange(a.x,a.y,n)&&(l=!0)}),i.intersect&&!l?[]:s}var Ji={modes:{index(t,e,i,n){const a=Xi(e,t),s=i.axis||"x",r=i.intersect?Qi(t,a,s,n):Ki(t,a,s,!1,n),o=[];return r.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{const e=r[0].index,i=t.data[e];i&&!i.skip&&o.push({element:i,datasetIndex:t.index,index:e})}),o):[]},dataset(t,e,i,n){const a=Xi(e,t),s=i.axis||"xy";let r=i.intersect?Qi(t,a,s,n):Ki(t,a,s,!1,n);if(r.length>0){const e=r[0].datasetIndex,i=t.getDatasetMeta(e).data;r=[];for(let t=0;tQi(t,Xi(e,t),i.axis||"xy",n),nearest:(t,e,i,n)=>Ki(t,Xi(e,t),i.axis||"xy",i.intersect,n),x:(t,e,i,n)=>Zi(t,e,{axis:"x",intersect:i.intersect},n),y:(t,e,i,n)=>Zi(t,e,{axis:"y",intersect:i.intersect},n)}};const tn=["left","top","right","bottom"];function en(t,e){return t.filter(t=>t.pos===e)}function nn(t,e){return t.filter(t=>-1===tn.indexOf(t.pos)&&t.box.axis===e)}function an(t,e){return t.sort((t,i)=>{const n=e?i:t,a=e?t:i;return n.weight===a.weight?n.index-a.index:n.weight-a.weight})}function sn(t,e,i,n){return Math.max(t[i],e[i])+Math.max(t[n],e[n])}function rn(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function on(t,e,i,n){const{pos:a,box:s}=i,r=t.maxPadding;if(!b(a)){i.size&&(t[a]-=i.size);const e=n[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?s.height:s.width),i.size=e.size/e.count,t[a]+=i.size}s.getPadding&&rn(r,s.getPadding());const o=Math.max(0,e.outerWidth-sn(r,t,"left","right")),l=Math.max(0,e.outerHeight-sn(r,t,"top","bottom")),c=o!==t.w,h=l!==t.h;return t.w=o,t.h=l,i.horizontal?{same:c,other:h}:{same:h,other:c}}function ln(t,e){const i=e.maxPadding;return function(t){const n={left:0,top:0,right:0,bottom:0};return t.forEach(t=>{n[t]=Math.max(e[t],i[t])}),n}(t?["left","right"]:["top","bottom"])}function cn(t,e,i,n){const a=[];let s,r,o,l,c,h;for(s=0,r=t.length,c=0;st.box.fullSize),!0),n=an(en(e,"left"),!0),a=an(en(e,"right")),s=an(en(e,"top"),!0),r=an(en(e,"bottom")),o=nn(e,"x"),l=nn(e,"y");return{fullSize:i,leftAndTop:n.concat(s),rightAndBottom:a.concat(l).concat(r).concat(o),chartArea:en(e,"chartArea"),vertical:n.concat(a).concat(l),horizontal:s.concat(r).concat(o)}}(t.boxes),l=o.vertical,c=o.horizontal;O(t.boxes,t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()});const h=l.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1,d=Object.freeze({outerWidth:e,outerHeight:i,padding:a,availableWidth:s,availableHeight:r,vBoxMaxWidth:s/2/h,hBoxMaxHeight:r/2}),u=Object.assign({},a);rn(u,fe(n));const f=Object.assign({maxPadding:u,w:s,h:r,x:a.left,y:a.top},a),p=function(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:n,stackWeight:a}=i;if(!t||!tn.includes(n))continue;const s=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=a}return e}(t),{vBoxMaxWidth:n,hBoxMaxHeight:a}=e;let s,r,o;for(s=0,r=t.length;s{const i=e.box;Object.assign(i,t.chartArea),i.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class fn{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}isAttached(t){return!0}updateConfig(t){}}class pn extends fn{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const gn={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},mn=t=>null===t||""===t,bn=!!Ke&&{passive:!0};function yn(t,e,i){t.canvas.removeEventListener(e,i,bn)}function xn(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function vn(t,e,i){const n=t.canvas,a=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||xn(i.addedNodes,n),e=e&&!xn(i.removedNodes,n);e&&i()});return a.observe(document,{childList:!0,subtree:!0}),a}function wn(t,e,i){const n=t.canvas,a=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||xn(i.removedNodes,n),e=e&&!xn(i.addedNodes,n);e&&i()});return a.observe(document,{childList:!0,subtree:!0}),a}const On=new Map;let Mn=0;function kn(){const t=window.devicePixelRatio;t!==Mn&&(Mn=t,On.forEach((e,i)=>{i.currentDevicePixelRatio!==t&&e()}))}function jn(t,e,i){const n=t.canvas,a=n&&He(n);if(!a)return;const s=d((t,e)=>{const n=a.clientWidth;i(t,e),n{const e=t[0],i=e.contentRect.width,n=e.contentRect.height;0===i&&0===n||s(i,n)});return r.observe(a),function(t,e){On.size||window.addEventListener("resize",kn),On.set(t,e)}(t,s),r}function Sn(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){On.delete(t),On.size||window.removeEventListener("resize",kn)}(t)}function Dn(t,e,i){const n=t.canvas,a=d(e=>{null!==t.ctx&&i(function(t,e){const i=gn[t.type]||t.type,{x:n,y:a}=qe(t,e);return{type:i,chart:e,native:t,x:void 0!==n?n:null,y:void 0!==a?a:null}}(e,t))},t,t=>{const e=t[0];return[e,e.offsetX,e.offsetY]});return function(t,e,i){t.addEventListener(e,i,bn)}(n,e,a),a}class Pn extends fn{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,n=t.getAttribute("height"),a=t.getAttribute("width");if(t.$chartjs={initial:{height:n,width:a,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",mn(a)){const e=Ze(t,"width");void 0!==e&&(t.width=e)}if(mn(n))if(""===t.style.height)t.height=t.width/(e||2);else{const e=Ze(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e.$chartjs)return!1;const i=e.$chartjs.initial;["height","width"].forEach(t=>{const n=i[t];g(n)?e.removeAttribute(t):e.setAttribute(t,n)});const n=i.style||{};return Object.keys(n).forEach(t=>{e.style[t]=n[t]}),e.width=e.width,delete e.$chartjs,!0}addEventListener(t,e,i){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),a={attach:vn,detach:wn,resize:jn}[e]||Dn;n[e]=a(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),n=i[e];n&&(({attach:Sn,detach:Sn,resize:Sn}[e]||yn)(t,e,n),i[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return function(t,e,i,n){const a=Ye(t),s=Xe(a,"margin"),r=Ue(a.maxWidth,t,"clientWidth")||B,o=Ue(a.maxHeight,t,"clientHeight")||B,l=function(t,e,i){let n,a;if(void 0===e||void 0===i){const s=He(t);if(s){const t=s.getBoundingClientRect(),r=Ye(s),o=Xe(r,"border","width"),l=Xe(r,"padding");e=t.width-l.width-o.width,i=t.height-l.height-o.height,n=Ue(r.maxWidth,s,"clientWidth"),a=Ue(r.maxHeight,s,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:n||B,maxHeight:a||B}}(t,e,i);let{width:c,height:h}=l;if("content-box"===a.boxSizing){const t=Xe(a,"border","width"),e=Xe(a,"padding");c-=e.width+t.width,h-=e.height+t.height}return c=Math.max(0,c-s.width),h=Math.max(0,n?Math.floor(c/n):h-s.height),c=Ge(Math.min(c,r,l.maxWidth)),h=Ge(Math.min(h,o,l.maxHeight)),c&&!h&&(h=Ge(c/2)),{width:c,height:h}}(t,e,i,n)}isAttached(t){const e=He(t);return!(!e||!e.isConnected)}}class En{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return q(this.x)&&q(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const n={};return t.forEach(t=>{n[t]=i[t]&&i[t].active()?i[t]._to:this[t]}),n}}En.defaults={},En.defaultRoutes=void 0;const Cn={values:t=>m(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";const n=this.chart.options.locale;let a,s=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(a="scientific"),s=function(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t)),i}(t,i)}const r=Y(Math.abs(s)),o=Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:a,minimumFractionDigits:o,maximumFractionDigits:o};return Object.assign(l,this.options.ticks.format),ni(t,n,l)},logarithmic(t,e,i){if(0===t)return"0";const n=t/Math.pow(10,Math.floor(Y(t)));return 1===n||2===n||5===n?Cn.numeric.call(this,t,e,i):""}};var Tn={formatters:Cn};function An(t,e,i,n,a){const s=v(n,0),r=Math.min(v(a,t.length),t.length);let o,l,c,h=0;for(i=Math.ceil(i),a&&(o=a-n,i=o/Math.floor(o/i)),c=s;c<0;)h++,c=Math.round(s+h*i);for(l=Math.max(s,0);le.lineWidth,tickColor:(t,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Tn.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),Xt.route("scale.ticks","color","","color"),Xt.route("scale.grid","color","","borderColor"),Xt.route("scale.grid","borderColor","","borderColor"),Xt.route("scale.title","color","","color"),Xt.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t}),Xt.describe("scales",{_fallback:"scale"}),Xt.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t});const Ln=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i;function Rn(t,e){const i=[],n=t.length/e,a=t.length;let s=0;for(;sr+1e-6)))return l}function Fn(t){return t.drawTicks?t.tickLength:0}function In(t,e){if(!t.display)return 0;const i=pe(t.font,e),n=fe(t.padding);return(m(t.text)?t.text.length:1)*i.lineHeight+n.height}function zn(t,e,i){let n=(t=>"start"===t?"left":"end"===t?"right":"center")(t);return(i&&"right"!==e||!i&&"right"===e)&&(n=(t=>"left"===t?"right":"right"===t?"left":t)(n)),n}class Bn extends En{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:n}=this;return t=x(t,Number.POSITIVE_INFINITY),e=x(e,Number.NEGATIVE_INFINITY),i=x(i,Number.POSITIVE_INFINITY),n=x(n,Number.NEGATIVE_INFINITY),{min:x(t,i),max:x(e,n),minDefined:y(t),maxDefined:y(e)}}getMinMax(t){let e,{min:i,max:n,minDefined:a,maxDefined:s}=this.getUserBounds();if(a&&s)return{min:i,max:n};const r=this.getMatchingVisibleMetas();for(let o=0,l=r.length;on?n:i,n=a&&i>n?i:n,{min:x(i,x(n,i)),max:x(n,x(i,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){w(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:n,grace:a,ticks:s}=this.options,r=s.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(t,e,i){const{min:n,max:a}=t,s=_(e,(a-n)/2),r=(t,e)=>i&&0===t?0:t+e;return{min:r(n,-Math.abs(s)),max:r(a,s)}}(this,a,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const o=rn)return function(t,e,i,n){let a,s=0,r=i[0];for(n=Math.ceil(n),a=0;at-e).pop(),e}(n);for(let t=0,e=s.length-1;ta)return e}return Math.max(a,1)}(a,e,n);if(s>0){let t,i;const n=s>1?Math.round((o-r)/(s-1)):null;for(An(e,l,c,g(n)?0:r-n,r),t=0,i=s-1;t=a||i<=1||!this.isHorizontal())return void(this.labelRotation=n);const c=this._getLabelSizes(),h=c.widest.width,d=c.highest.height,u=st(this.chart.width-h,0,this.maxWidth);s=t.offset?this.maxWidth/i:u/(i-1),h+6>s&&(s=u/(i-(t.offset?.5:1)),r=this.maxHeight-Fn(t.grid)-e.padding-In(t.title,this.chart.options.font),o=Math.sqrt(h*h+d*d),l=Z(Math.min(Math.asin(st((c.highest.height+6)/s,-1,1)),Math.asin(st(r/o,-1,1))-Math.asin(st(d/o,-1,1)))),l=Math.max(n,Math.min(a,l))),this.labelRotation=l}afterCalculateLabelRotation(){w(this.options.afterCalculateLabelRotation,[this])}beforeFit(){w(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:n,grid:a}}=this,s=this._isVisible(),r=this.isHorizontal();if(s){const s=In(n,e.options.font);if(r?(t.width=this.maxWidth,t.height=Fn(a)+s):(t.height=this.maxHeight,t.width=Fn(a)+s),i.display&&this.ticks.length){const{first:e,last:n,widest:a,highest:s}=this._getLabelSizes(),o=2*i.padding,l=K(this.labelRotation),c=Math.cos(l),h=Math.sin(l);if(r){const e=i.mirror?0:h*a.width+c*s.height;t.height=Math.min(this.maxHeight,t.height+e+o)}else{const e=i.mirror?0:c*a.width+h*s.height;t.width=Math.min(this.maxWidth,t.width+e+o)}this._calculatePadding(e,n,h,c)}}this._handleMargins(),r?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,n){const{ticks:{align:a,padding:s},position:r}=this.options,o=0!==this.labelRotation,l="top"!==r&&"x"===this.axis;if(this.isHorizontal()){const r=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,d=0;o?l?(h=n*t.width,d=i*e.height):(h=i*t.height,d=n*e.width):"start"===a?d=e.width:"end"===a?h=t.width:(h=t.width/2,d=e.width/2),this.paddingLeft=Math.max((h-r+s)*this.width/(this.width-r),0),this.paddingRight=Math.max((d-c+s)*this.width/(this.width-c),0)}else{let i=e.height/2,n=t.height/2;"start"===a?(i=0,n=t.height):"end"===a&&(i=e.height,n=0),this.paddingTop=i+s,this.paddingBottom=n+s}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){w(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e{const i=t.gc,n=i.length/2;let a;if(n>e){for(a=0;a({width:a[t]||0,height:s[t]||0});return{first:M(0),last:M(e-1),widest:M(_),highest:M(w),widths:a,heights:s}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return st(this._alignToPixels?Qt(this.chart,e,0):e,-32768,32767)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&tr*n?r/i:o/n:o*n0}_computeGridLineItems(t){const e=this.axis,i=this.chart,n=this.options,{grid:a,position:s}=n,r=a.offset,o=this.isHorizontal(),l=this.ticks.length+(r?1:0),c=Fn(a),h=[],d=a.setContext(this.getContext()),u=d.drawBorder?d.borderWidth:0,f=u/2,p=function(t){return Qt(i,t,u)};let g,m,y,x,_,w,O,M,k,j,S,D;if("top"===s)g=p(this.bottom),w=this.bottom-c,M=g-f,j=p(t.top)+f,D=t.bottom;else if("bottom"===s)g=p(this.top),j=t.top,D=p(t.bottom)-f,w=g+f,M=this.top+c;else if("left"===s)g=p(this.right),_=this.right-c,O=g-f,k=p(t.left)+f,S=t.right;else if("right"===s)g=p(this.left),k=t.left,S=p(t.right)-f,_=g+f,O=this.left+c;else if("x"===e){if("center"===s)g=p((t.top+t.bottom)/2+.5);else if(b(s)){const t=Object.keys(s)[0],e=s[t];g=p(this.chart.scales[t].getPixelForValue(e))}j=t.top,D=t.bottom,w=g+f,M=w+c}else if("y"===e){if("center"===s)g=p((t.left+t.right)/2);else if(b(s)){const t=Object.keys(s)[0],e=s[t];g=p(this.chart.scales[t].getPixelForValue(e))}_=g-f,O=_-c,k=t.left,S=t.right}const P=v(n.ticks.maxTicksLimit,l),E=Math.max(1,Math.ceil(l/P));for(m=0;me.value===t);return i>=0?e.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let a,s;const r=(t,e,n)=>{n.width&&n.color&&(i.save(),i.lineWidth=n.width,i.strokeStyle=n.color,i.setLineDash(n.borderDash||[]),i.lineDashOffset=n.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(a=0,s=n.length;a{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:i+1,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",n=[];let a,s;for(a=0,s=e.length;a{const n=i.split("."),a=n.pop(),s=[t].concat(n).join("."),r=e[i].split("."),o=r.pop(),l=r.join(".");Xt.route(s,a,l,o)})}(e,t.defaultRoutes),t.descriptors&&Xt.describe(e,t.descriptors)}(t,s,i),this.override&&Xt.override(t.id,t.overrides)),s}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,n=this.scope;i in e&&delete e[i],n&&i in Xt[n]&&(delete Xt[n][i],this.override&&delete Ht[i])}}var Wn=new class{constructor(){this.controllers=new Vn(Si,"datasets",!0),this.elements=new Vn(En,"elements"),this.plugins=new Vn(Object,"plugins"),this.scales=new Vn(Bn,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(e=>{const n=i||this._getRegistryForType(e);i||n.isForType(e)||n===this.plugins&&e.id?this._exec(t,n,e):O(e,e=>{const n=i||this._getRegistryForType(e);this._exec(t,n,e)})})}_exec(t,e,i){const n=A(t);w(i["before"+n],[],i),e[t](i),w(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;et.filter(t=>!e.some(e=>t.plugin.id===e.plugin.id));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}}function Un(t,e){return e||!1!==t?!0===t?{}:t:null}function Yn(t,e,i,n){const a=t.pluginScopeKeys(e),s=t.getOptionScopes(i,a);return t.createResolver(s,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function $n(t,e){const i=Xt.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function Xn(t,e){return"x"===t||"y"===t?t:e.axis||("top"===(i=e.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0)||t.charAt(0).toLowerCase();var i}function qn(t){const e=t.options||(t.options={});e.plugins=v(e.plugins,{}),e.scales=function(t,e){const i=Ht[t.type]||{scales:{}},n=e.scales||{},a=$n(t.type,e),s=Object.create(null),r=Object.create(null);return Object.keys(n).forEach(t=>{const e=n[t];if(!b(e))return console.error("Invalid scale configuration for scale: "+t);if(e._proxy)return console.warn("Ignoring resolver passed as options for scale: "+t);const o=Xn(t,e),l=function(t,e){return t===e?"_index_":"_value_"}(o,a),c=i.scales||{};s[o]=s[o]||t,r[t]=P(Object.create(null),[{axis:o},e,c[o],c[l]])}),t.data.datasets.forEach(i=>{const a=i.type||t.type,o=i.indexAxis||$n(a,e),l=(Ht[a]||{}).scales||{};Object.keys(l).forEach(t=>{const e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,o),a=i[e+"AxisID"]||s[e]||e;r[a]=r[a]||Object.create(null),P(r[a],[{axis:e},n[a],l[t]])})}),Object.keys(r).forEach(t=>{const e=r[t];P(e,[Xt.scales[e.type],Xt.scale])}),r}(t,e)}function Gn(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const Qn=new Map,Kn=new Set;function Zn(t,e){let i=Qn.get(t);return i||(i=e(),Qn.set(t,i),Kn.add(i)),i}const Jn=(t,e,i)=>{const n=T(e,i);void 0!==n&&t.add(n)};class ta{constructor(t){this._config=function(t){return(t=t||{}).data=Gn(t.data),qn(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Gn(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),qn(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Zn(t,()=>[["datasets."+t,""]])}datasetAnimationScopeKeys(t,e){return Zn(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,"transitions."+e],["datasets."+t,""]])}datasetElementScopeKeys(t,e){return Zn(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,"datasets."+t,"elements."+e,""]])}pluginScopeKeys(t){const e=t.id;return Zn(`${this.type}-plugin-${e}`,()=>[["plugins."+e,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let n=i.get(t);return n&&!e||(n=new Map,i.set(t,n)),n}getOptionScopes(t,e,i){const{options:n,type:a}=this,s=this._cachedScopes(t,i),r=s.get(e);if(r)return r;const o=new Set;e.forEach(e=>{t&&(o.add(t),e.forEach(e=>Jn(o,t,e))),e.forEach(t=>Jn(o,n,t)),e.forEach(t=>Jn(o,Ht[a]||{},t)),e.forEach(t=>Jn(o,Xt,t)),e.forEach(t=>Jn(o,Ut,t))});const l=Array.from(o);return 0===l.length&&l.push(Object.create(null)),Kn.has(e)&&s.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,Ht[e]||{},Xt.datasets[e]||{},{type:e},Xt,Ut]}resolveNamedOptions(t,e,i,n=[""]){const a={$shared:!0},{resolver:s,subPrefixes:r}=ea(this._resolverCache,t,n);let o=s;(function(t,e){const{isScriptable:i,isIndexable:n}=ke(t);for(const a of e){const e=i(a),s=n(a),r=(s||e)&&t[a];if(e&&(R(r)||ia(r))||s&&m(r))return!0}return!1})(s,e)&&(a.$shared=!1,o=Me(s,i=R(i)?i():i,this.createResolver(t,i,r)));for(const t of e)a[t]=o[t];return a}createResolver(t,e,i=[""],n){const{resolver:a}=ea(this._resolverCache,t,i);return b(e)?Me(a,e,void 0,n):a}}function ea(t,e,i){let n=t.get(e);n||(n=new Map,t.set(e,n));const a=i.join();let s=n.get(a);return s||(s={resolver:Oe(e,i),subPrefixes:i.filter(t=>!t.toLowerCase().includes("hover"))},n.set(a,s)),s}const ia=t=>b(t)&&Object.getOwnPropertyNames(t).reduce((e,i)=>e||R(t[i]),!1),na=["top","bottom","left","right","chartArea"];function aa(t,e){return"top"===t||"bottom"===t||-1===na.indexOf(t)&&"x"===e}function sa(t,e){return function(i,n){return i[t]===n[t]?i[e]-n[e]:i[t]-n[t]}}function ra(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),w(i&&i.onComplete,[t],e)}function oa(t){const e=t.chart,i=e.options.animation;w(i&&i.onProgress,[t],e)}function la(t){return We()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const ca={},ha=t=>{const e=la(t);return Object.values(ca).filter(t=>t.canvas===e).pop()};function da(t,e,i){const n=Object.keys(t);for(const a of n){const n=+a;if(n>=e){const s=t[a];delete t[a],(i>0||n>e)&&(t[n+i]=s)}}}class ua{constructor(t,e){const i=this.config=new ta(e),n=la(t),a=ha(n);if(a)throw new Error("Canvas is already in use. Chart with ID '"+a.id+"' must be destroyed before the canvas can be reused.");const s=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||function(t){return!We()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?pn:Pn}(n)),this.platform.updateConfig(i);const r=this.platform.acquireContext(n,s.aspectRatio),o=r&&r.canvas,l=o&&o.height,c=o&&o.width;this.id=p(),this.ctx=r,this.canvas=o,this.width=c,this.height=l,this._options=s,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Hn,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let i;return function(...n){return e?(clearTimeout(i),i=setTimeout(t,e,n)):t.apply(this,n),e}}(t=>this.update(t),s.resizeDelay||0),this._dataChanges=[],ca[this.id]=this,r&&o?(di.listen(this,"complete",ra),di.listen(this,"progress",oa),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:a}=this;return g(t)?e&&a?a:n?i/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Qe(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Kt(this.canvas,this.ctx),this}stop(){return di.stop(this),this}resize(t,e){di.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,n=this.canvas,a=i.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(n,t,e,a),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),o=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,Qe(this,r,!0)&&(this.notifyPlugins("resize",{size:s}),w(i.onResize,[this,s],this),this.attached&&this._doResize(o)&&this.render())}ensureScalesHaveIDs(){O(this.options.scales||{},(t,e)=>{t.id=e})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,n=Object.keys(i).reduce((t,e)=>(t[e]=!1,t),{});let a=[];e&&(a=a.concat(Object.keys(e).map(t=>{const i=e[t],n=Xn(t,i),a="r"===n,s="x"===n;return{options:i,dposition:a?"chartArea":s?"bottom":"left",dtype:a?"radialLinear":s?"category":"linear"}}))),O(a,e=>{const a=e.options,s=a.id,r=Xn(s,a),o=v(a.type,e.dtype);void 0!==a.position&&aa(a.position,r)===aa(e.dposition)||(a.position=e.dposition),n[s]=!0;let l=null;s in i&&i[s].type===o?l=i[s]:(l=new(Wn.getScale(o))({id:s,type:o,ctx:this.ctx,chart:this}),i[l.id]=l),l.init(a,t)}),O(n,(t,e)=>{t||delete i[e]}),O(i,t=>{un.configure(this,t,t.options),un.addBox(this,t)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((t,e)=>t.index-e.index),i>e){for(let t=e;te.length&&delete this._stacks,t.forEach((t,i)=>{0===e.filter(e=>e===t._dataset).length&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,n;for(this._removeUnreferencedMetasets(),i=0,n=e.length;i{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const a=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let t=0,e=this.data.datasets.length;t{t.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(sa("z","_idx"));const{_active:r,_lastEvent:o}=this;o?this._eventHandler(o,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){O(this.scales,t=>{un.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);N(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:n,count:a}of e)da(t,n,"_removeElements"===i?-a:a)}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter(t=>t[0]===e).map((t,e)=>e+","+t.splice(1).join(","))),n=i(0);for(let t=1;tt.split(",")).map(t=>({method:t[1],start:+t[2],count:+t[3]}))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;un.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],O(this.boxes,t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))},this),this._layers.forEach((t,e)=>{t._idx=e}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,n=!i.disabled,a=this.chartArea,s={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",s)&&(n&&te(e,{left:!1===i.left?0:a.left-i.left,right:!1===i.right?this.width:a.right+i.right,top:!1===i.top?0:a.top-i.top,bottom:!1===i.bottom?this.height:a.bottom+i.bottom}),t.controller.draw(),n&&ee(e),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}getElementsAtEventForMode(t,e,i,n){const a=Ji.modes[e];return"function"==typeof a?a(this,t,i,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let n=i.filter(t=>t&&t._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(n)),n}getContext(){return this.$context||(this.$context=me(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const n=i?"show":"hide",a=this.getDatasetMeta(t),s=a.controller._resolveAnimations(void 0,n);L(e)?(a.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),s.update(a,{visible:i}),this.update(e=>e.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),di.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,i,n),t[i]=n},n=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};O(this.options.events,t=>i(t,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,n)=>{e.addEventListener(this,i,n),t[i]=n},n=(i,n)=>{t[i]&&(e.removeEventListener(this,i,n),delete t[i])},a=(t,e)=>{this.canvas&&this.resize(t,e)};let s;const r=()=>{n("attach",r),this.attached=!0,this.resize(),i("resize",a),i("detach",s)};s=()=>{this.attached=!1,n("resize",a),this._stop(),this._resize(0,0),i("attach",r)},e.isAttached(this.canvas)?r():s()}unbindEvents(){O(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},O(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const n=i?"set":"remove";let a,s,r,o;for("dataset"===e&&(a=this.getDatasetMeta(t[0].datasetIndex),a.controller["_"+n+"DatasetHoverStyle"]()),r=0,o=t.length;r{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}});!M(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}_updateHoverStyles(t,e,i){const n=this.options.hover,a=(t,e)=>t.filter(t=>!e.some(e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)),s=a(e,t),r=i?t:a(t,e);s.length&&this.updateHoverStyle(s,n.mode,!1),r.length&&n.mode&&this.updateHoverStyle(r,n.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:Jt(t,this.chartArea,this._minPadding)},n=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,n))return;const a=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(a||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:n=[],options:a}=this,s=e,r=this._getActiveElements(t,n,i,s),o=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}(t),l=function(t,e,i,n){return i&&"mouseout"!==t.type?n?e:t:null}(t,this._lastEvent,i,o);i&&(this._lastEvent=null,w(a.onHover,[t,r,this],this),o&&w(a.onClick,[t,r,this],this));const c=!M(r,n);return(c||e)&&(this._active=r,this._updateHoverStyles(r,n,e)),this._lastEvent=l,c}_getActiveElements(t,e,i,n){if("mouseout"===t.type)return[];if(!i)return e;const a=this.options.hover;return this.getElementsAtEventForMode(t,a.mode,a,n)}}const fa=()=>O(ua.instances,t=>t._plugins.invalidate());function pa(t,e,i){const{startAngle:n,pixelMargin:a,x:s,y:r,outerRadius:o,innerRadius:l}=e;let c=a/o;t.beginPath(),t.arc(s,r,o,n-c,i+c),l>a?(c=a/l,t.arc(s,r,l,i+c,n-c,!0)):t.arc(s,r,a,i+W,n-W),t.closePath(),t.clip()}function ga(t,e,i,n){return{x:i+t*Math.cos(e),y:n+t*Math.sin(e)}}function ma(t,e,i,n,a){const{x:s,y:r,startAngle:o,pixelMargin:l,innerRadius:c}=e,h=Math.max(e.outerRadius+n+i-l,0),d=c>0?c+n+i+l:0;let u=0;const f=a-o;if(n){const t=((c>0?c-n:0)+(h>0?h-n:0))/2;u=(f-(0!==t?f*t/(t+n):f))/2}const p=(f-Math.max(.001,f*h-i/F)/h)/2,g=o+p+u,m=a-p-u,{outerStart:b,outerEnd:y,innerStart:x,innerEnd:v}=function(t,e,i,n){const a=he(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]),s=(i-e)/2,r=Math.min(s,n*e/2),o=t=>{const e=(i-Math.min(s,t))*n/2;return st(t,0,Math.min(s,e))};return{outerStart:o(a.outerStart),outerEnd:o(a.outerEnd),innerStart:st(a.innerStart,0,r),innerEnd:st(a.innerEnd,0,r)}}(e,d,h,m-g),_=h-b,w=h-y,O=g+b/_,M=m-y/w,k=d+x,j=d+v,S=g+x/k,D=m-v/j;if(t.beginPath(),t.arc(s,r,h,O,M),y>0){const e=ga(w,M,s,r);t.arc(e.x,e.y,y,M,m+W)}const P=ga(j,m,s,r);if(t.lineTo(P.x,P.y),v>0){const e=ga(j,D,s,r);t.arc(e.x,e.y,v,m+W,D+Math.PI)}if(t.arc(s,r,d,m-v/d,g+x/d,!0),x>0){const e=ga(k,S,s,r);t.arc(e.x,e.y,x,S+Math.PI,g-W)}const E=ga(_,g,s,r);if(t.lineTo(E.x,E.y),b>0){const e=ga(_,O,s,r);t.arc(e.x,e.y,b,g-W,O)}t.closePath()}Object.defineProperties(ua,{defaults:{enumerable:!0,value:Xt},instances:{enumerable:!0,value:ca},overrides:{enumerable:!0,value:Ht},registry:{enumerable:!0,value:Wn},version:{enumerable:!0,value:"3.7.1"},getChart:{enumerable:!0,value:ha},register:{enumerable:!0,value:(...t)=>{Wn.add(...t),fa()}},unregister:{enumerable:!0,value:(...t)=>{Wn.remove(...t),fa()}}});class ba extends En{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.getProps(["x","y"],i),{angle:a,distance:s}=tt(n,{x:t,y:e}),{startAngle:r,endAngle:o,innerRadius:l,outerRadius:c,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),d=this.options.spacing/2,u=v(h,o-r)>=I||at(a,r,o),f=rt(s,l+d,c+d);return u&&f}getCenterPoint(t){const{x:e,y:i,startAngle:n,endAngle:a,innerRadius:s,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:o,spacing:l}=this.options,c=(n+a)/2,h=(s+r+l+o)/2;return{x:e+Math.cos(c)*h,y:i+Math.sin(c)*h}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,n=(e.offset||0)/2,a=(e.spacing||0)/2;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>I?Math.floor(i/I):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();let s=0;if(n){s=n/2;const e=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(e)*s,Math.sin(e)*s),this.circumference>=F&&(s=n)}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;const r=function(t,e,i,n){const{fullCircles:a,startAngle:s,circumference:r}=e;let o=e.endAngle;if(a){ma(t,e,i,n,s+I);for(let e=0;eo&&s>o;return{count:n,start:l,loop:e.loop,ilen:c(r+(c?o-t:t))%s,x=()=>{f!==p&&(t.lineTo(m,p),t.lineTo(m,f),t.lineTo(m,g))};for(l&&(d=a[y(0)],t.moveTo(d.x,d.y)),h=0;h<=o;++h){if(d=a[y(h)],d.skip)continue;const e=d.x,i=d.y,n=0|e;n===u?(ip&&(p=i),m=(b*m+e)/++b):(x(),t.lineTo(e,i),u=n,b=0,f=p=i),g=i}x()}function Oa(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i?_a:wa}ba.id="arc",ba.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0},ba.defaultRoutes={backgroundColor:"backgroundColor"};const Ma="function"==typeof Path2D;class ka extends En{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const n=i.spanGaps?this._loop:this._fullLoop;Ve(this._points,i,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(t,e){const i=t.points,n=t.options.spanGaps,a=i.length;if(!a)return[];const s=!!t._loop,{start:r,end:o}=function(t,e,i,n){let a=0,s=e-1;if(i&&!n)for(;aa&&t[s%e].skip;)s--;return s%=e,{start:a,end:s}}(i,a,s,n);return function(t,e,i,n){return n&&n.setContext&&i?function(t,e,i,n){const a=t._chart.getContext(),s=ci(t.options),{_datasetIndex:r,options:{spanGaps:o}}=t,l=i.length,c=[];let h=s,d=e[0].start,u=d;function f(t,e,n,a){const s=o?-1:1;if(t!==e){for(t+=l;i[t%l].skip;)t-=s;for(;i[e%l].skip;)e+=s;t%l!=e%l&&(c.push({start:t%l,end:e%l,loop:n,style:a}),h=a,d=e%l)}}for(const t of e){d=o?d:t.start;let e,s=i[d%l];for(u=d+1;u<=t.end;u++){const o=i[u%l];e=ci(n.setContext(me(a,{type:"segment",p0:s,p1:o,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:r}))),hi(e,h)&&f(d,u-1,t.loop,h),s=o,h=e}d"borderDash"!==t&&"fill"!==t};class Sa extends En{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.options,{x:a,y:s}=this.getProps(["x","y"],i);return Math.pow(t-a,2)+Math.pow(e-s,2)=i)&&a):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}Aa.id="bar",Aa.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0},Aa.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};class Ra{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:n,y:a,radius:s}=this;return e=e||{start:0,end:I},t.arc(n,a,s,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:n}=this,a=t.angle;return{x:e+Math.cos(a)*n,y:i+Math.sin(a)*n,angle:a}}}function Na(t,e,i){for(;e>t;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function Fa(t,e,i){const n=[];for(let a=0;a{e=Na(t,e,a);const r=a[t],o=a[e];null!==n?(s.push({x:r.x,y:n}),s.push({x:o.x,y:n})):null!==i&&(s.push({x:i,y:r.y}),s.push({x:i,y:o.y}))}),s}(t,e),i.length?new ka({points:i,options:{tension:0},_loop:n,_fullLoop:n}):null}function Va(t,e,i){let n=t[e].fill;const a=[e];let s;if(!i)return n;for(;!1!==n&&-1===a.indexOf(n);){if(!y(n))return n;if(s=t[n],!s)return!1;if(s.visible)return n;a.push(n),n=s.fill}return!1}function Wa(t,e,i){const{segments:n,points:a}=e;let s=!0,r=!1;t.beginPath();for(const o of n){const{start:n,end:l}=o,c=a[n],h=a[Na(n,l,a)];s?(t.moveTo(c.x,c.y),s=!1):(t.lineTo(c.x,i),t.lineTo(c.x,c.y)),r=!!e.pathSegment(t,o,{move:r}),r?t.closePath():t.lineTo(h.x,i)}t.lineTo(e.first().x,i),t.closePath(),t.clip()}function Ha(t,e,i,n){if(n)return;let a=e[t],s=i[t];return"angle"===t&&(a=nt(a),s=nt(s)),{property:t,start:a,end:s}}function Ua(t,e,i,n){return t&&e?n(t[i],e[i]):t?t[i]:e?e[i]:0}function Ya(t,e,i){const{top:n,bottom:a}=e.chart.chartArea,{property:s,start:r,end:o}=i||{};"x"===s&&(t.beginPath(),t.rect(r,n,o-r,a-n),t.clip())}function $a(t,e,i,n){const a=e.interpolate(i,n);a&&t.lineTo(a.x,a.y)}function Xa(t,e){const{line:i,target:n,property:a,color:s,scale:r}=e,o=function(t,e,i){const n=t.segments,a=t.points,s=e.points,r=[];for(const t of n){let{start:n,end:o}=t;o=Na(n,o,a);const l=Ha(i,a[n],a[o],t.loop);if(!e.segments){r.push({source:t,target:l,start:a[n],end:a[o]});continue}const c=li(e,l);for(const e of c){const n=Ha(i,s[e.start],s[e.end],e.loop),o=oi(t,a,n);for(const t of o)r.push({source:t,target:e,start:{[i]:Ua(l,n,"start",Math.max)},end:{[i]:Ua(l,n,"end",Math.min)}})}}return r}(i,n,a);for(const{source:e,target:l,start:c,end:h}of o){const{style:{backgroundColor:o=s}={}}=e,d=!0!==n;t.save(),t.fillStyle=o,Ya(t,r,d&&Ha(a,c,h)),t.beginPath();const u=!!i.pathSegment(t,e);let f;if(d){u?t.closePath():$a(t,n,h,a);const e=!!n.pathSegment(t,l,{move:u,reverse:!0});f=u&&e,f||$a(t,n,c,a)}t.closePath(),t.fill(f?"evenodd":"nonzero"),t.restore()}}function qa(t,e,i){const n=za(e),{line:a,scale:s,axis:r}=e,o=a.options,l=o.fill,c=o.backgroundColor,{above:h=c,below:d=c}=l||{};n&&a.points.length&&(te(t,i),function(t,e){const{line:i,target:n,above:a,below:s,area:r,scale:o}=e,l=i._loop?"angle":e.axis;t.save(),"x"===l&&s!==a&&(Wa(t,n,r.top),Xa(t,{line:i,target:n,color:a,scale:o,property:l}),t.restore(),t.save(),Wa(t,n,r.bottom)),Xa(t,{line:i,target:n,color:s,scale:o,property:l}),t.restore()}(t,{line:a,target:n,above:h,below:d,area:i,scale:s,axis:r}),ee(t))}var Ga={id:"filler",afterDatasetsUpdate(t,e,i){const n=(t.data.datasets||[]).length,a=[];let s,r,o,l;for(r=0;r=0;--e){const i=a[e].$filler;i&&(i.line.updateControlPoints(s,i.axis),n&&qa(t.ctx,i,s))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const n=t.getSortedVisibleDatasetMetas();for(let e=n.length-1;e>=0;--e){const i=n[e].$filler;i&&qa(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){const n=e.meta.$filler;n&&!1!==n.fill&&"beforeDatasetDraw"===i.drawTime&&qa(t.ctx,n,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};new WeakMap;const Qa={average(t){if(!t.length)return!1;let e,i,n=0,a=0,s=0;for(e=0,i=t.length;e-1?t.split("\n"):t}function Ja(t,e){const{element:i,datasetIndex:n,index:a}=e,s=t.getDatasetMeta(n).controller,{label:r,value:o}=s.getLabelAndValue(a);return{chart:t,label:r,parsed:s.getParsed(a),raw:t.data.datasets[n].data[a],formattedValue:o,dataset:s.getDataset(),dataIndex:a,datasetIndex:n,element:i}}function ts(t,e){const i=t.chart.ctx,{body:n,footer:a,title:s}=t,{boxWidth:r,boxHeight:o}=e,l=pe(e.bodyFont),c=pe(e.titleFont),h=pe(e.footerFont),d=s.length,u=a.length,f=n.length,p=fe(e.padding);let g=p.height,m=0,b=n.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);b+=t.beforeBody.length+t.afterBody.length,d&&(g+=d*c.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),b&&(g+=f*(e.displayColors?Math.max(o,l.lineHeight):l.lineHeight)+(b-f)*l.lineHeight+(b-1)*e.bodySpacing),u&&(g+=e.footerMarginTop+u*h.lineHeight+(u-1)*e.footerSpacing);let y=0;const x=function(t){m=Math.max(m,i.measureText(t).width+y)};return i.save(),i.font=c.string,O(t.title,x),i.font=l.string,O(t.beforeBody.concat(t.afterBody),x),y=e.displayColors?r+2+e.boxPadding:0,O(n,t=>{O(t.before,x),O(t.lines,x),O(t.after,x)}),y=0,i.font=h.string,O(t.footer,x),i.restore(),m+=p.width,{width:m,height:g}}function es(t,e,i,n){const{x:a,width:s}=i,{width:r,chartArea:{left:o,right:l}}=t;let c="center";return"center"===n?c=a<=(o+l)/2?"left":"right":a<=s/2?c="left":a>=r-s/2&&(c="right"),function(t,e,i,n){const{x:a,width:s}=n,r=i.caretSize+i.caretPadding;return"left"===t&&a+s+r>e.width||"right"===t&&a-s-r<0||void 0}(c,t,e,i)&&(c="center"),c}function is(t,e,i){const n=i.yAlign||e.yAlign||function(t,e){const{y:i,height:n}=e;return it.height-n/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||es(t,e,i,n),yAlign:n}}function ns(t,e,i,n){const{caretSize:a,caretPadding:s,cornerRadius:r}=t,{xAlign:o,yAlign:l}=i,c=a+s,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=ue(r);let p=function(t,e){let{x:i,width:n}=t;return"right"===e?i-=n:"center"===e&&(i-=n/2),i}(e,o);const g=function(t,e,i){let{y:n,height:a}=t;return"top"===e?n+=i:n-="bottom"===e?a+i:a/2,n}(e,l,c);return"center"===l?"left"===o?p+=c:"right"===o&&(p-=c):"left"===o?p-=Math.max(h,u)+a:"right"===o&&(p+=Math.max(d,f)+a),{x:st(p,0,n.width-e.width),y:st(g,0,n.height-e.height)}}function as(t,e,i){const n=fe(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-n.right:t.x+n.left}function ss(t){return Ka([],Za(t))}function rs(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}class os extends En{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart||t._chart,this._chart=this.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),n=i.enabled&&e.options.animation&&i.animations,a=new gi(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(a)),a}getContext(){return this.$context||(this.$context=(this,me(this.chart.getContext(),{tooltip:this,tooltipItems:this._tooltipItems,type:"tooltip"})))}getTitle(t,e){const{callbacks:i}=e,n=i.beforeTitle.apply(this,[t]),a=i.title.apply(this,[t]),s=i.afterTitle.apply(this,[t]);let r=[];return r=Ka(r,Za(n)),r=Ka(r,Za(a)),r=Ka(r,Za(s)),r}getBeforeBody(t,e){return ss(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){const{callbacks:i}=e,n=[];return O(t,t=>{const e={before:[],lines:[],after:[]},a=rs(i,t);Ka(e.before,Za(a.beforeLabel.call(this,t))),Ka(e.lines,a.label.call(this,t)),Ka(e.after,Za(a.afterLabel.call(this,t))),n.push(e)}),n}getAfterBody(t,e){return ss(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){const{callbacks:i}=e,n=i.beforeFooter.apply(this,[t]),a=i.footer.apply(this,[t]),s=i.afterFooter.apply(this,[t]);let r=[];return r=Ka(r,Za(n)),r=Ka(r,Za(a)),r=Ka(r,Za(s)),r}_createItems(t){const e=this._active,i=this.chart.data,n=[],a=[],s=[];let r,o,l=[];for(r=0,o=e.length;rt.filter(e,n,a,i))),t.itemSort&&(l=l.sort((e,n)=>t.itemSort(e,n,i))),O(l,e=>{const i=rs(t.callbacks,e);n.push(i.labelColor.call(this,e)),a.push(i.labelPointStyle.call(this,e)),s.push(i.labelTextColor.call(this,e))}),this.labelColors=n,this.labelPointStyles=a,this.labelTextColors=s,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),n=this._active;let a,s=[];if(n.length){const t=Qa[i.position].call(this,n,this._eventPosition);s=this._createItems(i),this.title=this.getTitle(s,i),this.beforeBody=this.getBeforeBody(s,i),this.body=this.getBody(s,i),this.afterBody=this.getAfterBody(s,i),this.footer=this.getFooter(s,i);const e=this._size=ts(this,i),r=Object.assign({},t,e),o=is(this.chart,i,r),l=ns(i,r,o,this.chart);this.xAlign=o.xAlign,this.yAlign=o.yAlign,a={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(a={opacity:0});this._tooltipItems=s,this.$context=void 0,a&&this._resolveAnimations().update(this,a),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,n){const a=this.getCaretPosition(t,i,n);e.lineTo(a.x1,a.y1),e.lineTo(a.x2,a.y2),e.lineTo(a.x3,a.y3)}getCaretPosition(t,e,i){const{xAlign:n,yAlign:a}=this,{caretSize:s,cornerRadius:r}=i,{topLeft:o,topRight:l,bottomLeft:c,bottomRight:h}=ue(r),{x:d,y:u}=t,{width:f,height:p}=e;let g,m,b,y,x,v;return"center"===a?(x=u+p/2,"left"===n?(g=d,m=g-s,y=x+s,v=x-s):(g=d+f,m=g+s,y=x-s,v=x+s),b=g):(m="left"===n?d+Math.max(o,c)+s:"right"===n?d+f-Math.max(l,h)-s:this.caretX,"top"===a?(y=u,x=y-s,g=m-s,b=m+s):(y=u+p,x=y+s,g=m+s,b=m-s),v=y),{x1:g,x2:m,x3:b,y1:y,y2:x,y3:v}}drawTitle(t,e,i){const n=this.title,a=n.length;let s,r,o;if(a){const l=ai(i.rtl,this.x,this.width);for(t.x=as(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",s=pe(i.titleFont),r=i.titleSpacing,e.fillStyle=i.titleColor,e.font=s.string,o=0;o0!==t)?(t.beginPath(),t.fillStyle=a.multiKeyBackground,re(t,{x:e,y:p,w:l,h:o,radius:r}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),re(t,{x:i,y:p+1,w:l-2,h:o-2,radius:r}),t.fill()):(t.fillStyle=a.multiKeyBackground,t.fillRect(e,p,l,o),t.strokeRect(e,p,l,o),t.fillStyle=s.backgroundColor,t.fillRect(i,p+1,l-2,o-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:n}=this,{bodySpacing:a,bodyAlign:s,displayColors:r,boxHeight:o,boxWidth:l,boxPadding:c}=i,h=pe(i.bodyFont);let d=h.lineHeight,u=0;const f=ai(i.rtl,this.x,this.width),p=function(i){e.fillText(i,f.x(t.x+u),t.y+d/2),t.y+=d+a},g=f.textAlign(s);let m,b,y,x,v,_,w;for(e.textAlign=s,e.textBaseline="middle",e.font=h.string,t.x=as(this,g,i),e.fillStyle=i.bodyColor,O(this.beforeBody,p),u=r&&"right"!==g?"center"===s?l/2+c:l+2+c:0,x=0,_=n.length;x<_;++x){for(m=n[x],b=this.labelTextColors[x],e.fillStyle=b,O(m.before,p),y=m.lines,r&&y.length&&(this._drawColorBox(e,t,x,f,i),d=Math.max(h.lineHeight,o)),v=0,w=y.length;v0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,n=i&&i.x,a=i&&i.y;if(n||a){const i=Qa[t.position].call(this,this._active,this._eventPosition);if(!i)return;const s=this._size=ts(this,t),r=Object.assign({},i,this._size),o=is(e,t,r),l=ns(t,r,o,e);n._to===l.x&&a._to===l.y||(this.xAlign=o.xAlign,this.yAlign=o.yAlign,this.width=s.width,this.height=s.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},a={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const s=fe(e.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&r&&(t.save(),t.globalAlpha=i,this.drawBackground(a,t,n,e),function(t,e){let i,n;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,n=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=n)}(t,e.textDirection),a.y+=s.top,this.drawTitle(a,t,e),this.drawBody(a,t,e),this.drawFooter(a,t,e),function(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,n=t.map(({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),a=!M(i,n),s=this._positionChanged(n,e);(a||s)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,a=this._active||[],s=this._getActiveElements(t,a,e,i),r=this._positionChanged(s,t),o=e||!M(s,a)||r;return o&&(this._active=s,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),o}_getActiveElements(t,e,i,n){const a=this.options;if("mouseout"===t.type)return[];if(!n)return e;const s=this.chart.getElementsAtEventForMode(t,a.mode,a,i);return a.reverse&&s.reverse(),s}_positionChanged(t,e){const{caretX:i,caretY:n,options:a}=this,s=Qa[a.position].call(this,t,e);return!1!==s&&(i!==s.x||n!==s.y)}}os.positioners=Qa;var ls={id:"tooltip",_element:os,positioners:Qa,afterInit(t,e,i){i&&(t.tooltip=new os({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip,i={tooltip:e};!1!==t.notifyPlugins("beforeTooltipDraw",i)&&(e&&e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i))},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:f,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,n=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(n>0&&e.dataIndex"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};class cs extends Bn{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:i,label:n}of e)t[i]===n&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(g(t))return null;const i=this.getLabels();return((t,e)=>null===t?null:st(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:function(t,e,i,n){const a=t.indexOf(e);return-1===a?((t,e,i,n)=>("string"==typeof e?(i=t.push(e)-1,n.unshift({index:i,label:e})):isNaN(e)&&(i=null),i))(t,e,i,n):a!==t.lastIndexOf(e)?i:a}(i,t,v(e,t),this._addedLabels),i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:n}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(n=this.getLabels().length-1)),this.min=i,this.max=n}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,n=[];let a=this.getLabels();a=0===t&&e===a.length-1?a:a.slice(t,e+1),this._valueRange=Math.max(a.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let i=t;i<=e;i++)n.push({value:i});return n}getLabelForValue(t){const e=this.getLabels();return t>=0&&te.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function hs(t,e,{horizontal:i,minRotation:n}){const a=K(n),s=(i?Math.sin(a):Math.cos(a))||.001,r=.75*e*(""+t).length;return Math.min(e/s,r)}cs.id="category",cs.defaults={ticks:{callback:cs.prototype.getLabelForValue}};class ds extends Bn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return g(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:n,max:a}=this;const s=t=>n=e?n:t,r=t=>a=i?a:t;if(t){const t=$(n),e=$(a);t<0&&e<0?r(0):t>0&&e>0&&s(0)}if(n===a){let e=1;(a>=Number.MAX_SAFE_INTEGER||n<=Number.MIN_SAFE_INTEGER)&&(e=Math.abs(.05*a)),r(a+e),t||s(n-e)}this.min=n,this.max=a}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:n}=t;return n?(e=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const n=function(t,e){const i=[],{bounds:n,step:a,min:s,max:r,precision:o,count:l,maxTicks:c,maxDigits:h,includeBounds:d}=t,u=a||1,f=c-1,{min:p,max:m}=e,b=!g(s),y=!g(r),x=!g(l),v=(m-p)/(h+1);let _,w,O,M,k=X((m-p)/f/u)*u;if(k<1e-14&&!b&&!y)return[{value:p},{value:m}];M=Math.ceil(m/k)-Math.floor(p/k),M>f&&(k=X(M*k/f/u)*u),g(o)||(_=Math.pow(10,o),k=Math.ceil(k*_)/_),"ticks"===n?(w=Math.floor(p/k)*k,O=Math.ceil(m/k)*k):(w=p,O=m),b&&y&&a&&function(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}((r-s)/a,k/1e3)?(M=Math.round(Math.min((r-s)/k,c)),k=(r-s)/M,w=s,O=r):x?(w=b?s:w,O=y?r:O,M=l-1,k=(O-w)/M):(M=(O-w)/k,M=G(M,Math.round(M),k/1e3)?Math.round(M):Math.ceil(M));const j=Math.max(J(k),J(w));_=Math.pow(10,g(o)?j:o),w=Math.round(w*_)/_,O=Math.round(O*_)/_;let S=0;for(b&&(d&&w!==s?(i.push({value:s}),w0?i:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=y(t)?Math.max(0,t):null,this.max=y(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,n=this.max;const a=e=>i=t?i:e,s=t=>n=e?n:t,r=(t,e)=>Math.pow(10,Math.floor(Y(t))+e);i===n&&(i<=0?(a(1),s(10)):(a(r(i,-1)),s(r(n,1)))),i<=0&&a(r(n,-1)),n<=0&&s(r(i,1)),this._zero&&this.min!==this._suggestedMin&&i===r(this.min,0)&&a(r(i,-1)),this.min=i,this.max=n}buildTicks(){const t=this.options,e=function(t,e){const i=Math.floor(Y(e.max)),n=Math.ceil(e.max/Math.pow(10,i)),a=[];let s=x(t.min,Math.pow(10,Math.floor(Y(e.min)))),r=Math.floor(Y(s)),o=Math.floor(s/Math.pow(10,r)),l=r<0?Math.pow(10,Math.abs(r)):1;do{a.push({value:s,major:fs(s)}),++o,10===o&&(o=1,++r,l=r>=0?1:l),s=Math.round(o*Math.pow(10,r)*l)/l}while(ra?{start:e-i,end:e}:{start:e,end:e+i}}function bs(t,e,i,n,a){const s=Math.abs(Math.sin(i)),r=Math.abs(Math.cos(i));let o=0,l=0;n.starte.r&&(o=(n.end-e.r)/s,t.r=Math.max(t.r,e.r+o)),a.starte.b&&(l=(a.end-e.b)/r,t.b=Math.max(t.b,e.b+l))}function ys(t){return 0===t||180===t?"center":t<180?"left":"right"}function xs(t,e,i){return 90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e),t}function vs(t,e,i,n){const{ctx:a}=t;if(i)a.arc(t.xCenter,t.yCenter,e,0,I);else{let i=t.getPointPosition(0,e);a.moveTo(i.x,i.y);for(let s=1;s{const i=w(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""}).filter((t,e)=>this.chart.getDataVisibility(e))}fit(){const t=this.options;t.display&&t.pointLabels.display?function(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),n=[],a=[],s=t._pointLabels.length,r=t.options.pointLabels,o=r.centerPointLabels?F/s:0;for(let d=0;d=0&&t=0;a--){const e=n.setContext(t.getPointLabelContext(a)),s=pe(e.font),{x:r,y:o,textAlign:l,left:c,top:h,right:d,bottom:u}=t._pointLabelItems[a],{backdropColor:f}=e;if(!g(f)){const t=fe(e.backdropPadding);i.fillStyle=f,i.fillRect(c-t.left,h-t.top,d-c+t.width,u-h+t.height)}ae(i,t._pointLabels[a],r,o+s.lineHeight/2,s,{color:e.color,textAlign:l,textBaseline:"middle"})}}(this,a),n.display&&this.ticks.forEach((t,e)=>{0!==e&&(r=this.getDistanceFromCenterForValue(t.value),function(t,e,i,n){const a=t.ctx,s=e.circular,{color:r,lineWidth:o}=e;!s&&!n||!r||!o||i<0||(a.save(),a.strokeStyle=r,a.lineWidth=o,a.setLineDash(e.borderDash),a.lineDashOffset=e.borderDashOffset,a.beginPath(),vs(t,i,s,n),a.closePath(),a.stroke(),a.restore())}(this,n.setContext(this.getContext(e-1)),r,a))}),i.display){for(t.save(),s=a-1;s>=0;s--){const n=i.setContext(this.getPointLabelContext(s)),{color:a,lineWidth:l}=n;l&&a&&(t.lineWidth=l,t.strokeStyle=a,t.setLineDash(n.borderDash),t.lineDashOffset=n.borderDashOffset,r=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),o=this.getPointPosition(s,r),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(o.x,o.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const n=this.getIndexAngle(0);let a,s;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(n),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((n,r)=>{if(0===r&&!e.reverse)return;const o=i.setContext(this.getContext(r)),l=pe(o.font);if(a=this.getDistanceFromCenterForValue(this.ticks[r].value),o.showLabelBackdrop){t.font=l.string,s=t.measureText(n.label).width,t.fillStyle=o.backdropColor;const e=fe(o.backdropPadding);t.fillRect(-s/2-e.left,-a-l.size/2-e.top,s+e.width,l.size+e.height)}ae(t,n.label,0,-a,l,{color:o.color})}),t.restore()}drawTitle(){}}_s.id="radialLinear",_s.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Tn.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}},_s.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},_s.descriptors={angleLines:{_fallback:"grid"}};const ws={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Os=Object.keys(ws);function Ms(t,e){return t-e}function ks(t,e){if(g(e))return null;const i=t._adapter,{parser:n,round:a,isoWeekday:s}=t._parseOpts;let r=e;return"function"==typeof n&&(r=n(r)),y(r)||(r="string"==typeof n?i.parse(r,n):i.parse(r)),null===r?null:(a&&(r="week"!==a||!q(s)&&!0!==s?i.startOf(r,a):i.startOf(r,"isoWeek",s)),+r)}function js(t,e,i,n){const a=Os.length;for(let s=Os.indexOf(t);s=e?i[n]:i[a]]=!0}}else t[e]=!0}function Ds(t,e,i){const n=[],a={},s=e.length;let r,o;for(r=0;r=0&&(e[l].major=!0);return e}(t,n,a,i):n}class Ps extends Bn{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e){const i=t.time||(t.time={}),n=this._adapter=new $i._date(t.adapters.date);P(i.displayFormats,n.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:ks(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:n,max:a,minDefined:s,maxDefined:r}=this.getUserBounds();function o(t){s||isNaN(t.min)||(n=Math.min(n,t.min)),r||isNaN(t.max)||(a=Math.max(a,t.max))}s&&r||(o(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||o(this.getMinMax(!1))),n=y(n)&&!isNaN(n)?n:+e.startOf(Date.now(),i),a=y(a)&&!isNaN(a)?a:+e.endOf(Date.now(),i)+1,this.min=Math.min(n,a-1),this.max=Math.max(n+1,a)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,n="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const a=this.min,s=function(t,e,i){let n=0,a=t.length;for(;nn&&t[a-1]>i;)a--;return n>0||a=Os.indexOf(i);s--){const i=Os[s];if(ws[i].common&&t._adapter.diff(a,n,i)>=e-1)return i}return Os[i?Os.indexOf(i):0]}(this,s.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(let e=Os.indexOf(t)+1,i=Os.length;e1e5*r)throw new Error(e+" and "+i+" are too far apart with stepSize of "+r+" "+s);const f="data"===n.ticks.source&&this.getDataTimestamps();for(h=u,d=0;ht-e).map(t=>+t)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}_tickFormatFunction(t,e,i,n){const a=this.options,s=a.time.displayFormats,r=this._unit,o=this._majorUnit,l=r&&s[r],c=o&&s[o],h=i[e],d=o&&c&&h&&h.major,u=this._adapter.format(t,n||(d?c:l)),f=a.ticks.callback;return f?w(f,[u,e,i],this):u}generateTickLabels(t){let e,i,n;for(e=0,i=t.length;e0?r:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(t=0,e=n.length;t=t[o].pos&&e<=t[l].pos&&({lo:o,hi:l}=ye(t,"pos",e)),({pos:n,time:s}=t[o]),({pos:a,time:r}=t[l])):(e>=t[o].time&&e<=t[l].time&&({lo:o,hi:l}=ye(t,"time",e)),({time:n,pos:s}=t[o]),({time:a,pos:r}=t[l]));const c=a-n;return c?s+(r-s)*(e-n)/c:s}Ps.id="time",Ps.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};class Cs extends Ps{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Es(e,this.min),this._tableRange=Es(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,n=[],a=[];let s,r,o,l,c;for(s=0,r=t.length;s=e&&l<=i&&n.push(l);if(n.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(s=0,r=n.length;s2&&void 0!==arguments[2]?arguments[2]:"label";const n=[];t.datasets=e.map(e=>{const a=t.datasets.find(t=>t[i]===e[i]);return a&&e.data&&!n.includes(a)?(n.push(a),Object.assign(a,e),a):{...e}})}function Fs(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"label";const i={labels:[],datasets:[]};return Rs(i,t.labels),Ns(i,t.datasets,e),i}function Is(t,e){let{height:i=150,width:n=300,redraw:a=!1,datasetIdKey:s,type:r,data:o,options:l,plugins:c=[],fallbackContent:h,...d}=t;const u=Object(Ts.useRef)(null),f=Object(Ts.useRef)(),p=()=>{u.current&&(f.current=new ua(u.current,{type:r,data:Fs(o,s),options:l,plugins:c}),Ls(e,f.current))},g=()=>{Ls(e,null),f.current&&(f.current.destroy(),f.current=null)};return Object(Ts.useEffect)(()=>{var t,e;!a&&f.current&&l&&(t=f.current,e=l,t.options={...e})},[a,l]),Object(Ts.useEffect)(()=>{!a&&f.current&&Rs(f.current.config.data,o.labels)},[a,o.labels]),Object(Ts.useEffect)(()=>{!a&&f.current&&o.datasets&&Ns(f.current.config.data,o.datasets,s)},[a,o.datasets]),Object(Ts.useEffect)(()=>{f.current&&(a?(g(),setTimeout(p)):f.current.update())},[a,l,o.labels,o.datasets]),Object(Ts.useEffect)(()=>(p(),()=>g()),[]),As.a.createElement("canvas",Object.assign({ref:u,role:"img",height:i,width:n},d),h)}const zs=Object(Ts.forwardRef)(Is);var Bs=i(3),Vs=i(17),Ws=i(7),Hs=i(8),Us=i(4);function Ys(t,e){Object(Us.a)(2,arguments);var i=Object(Hs.a)(t),n=Object(Ws.a)(e);return isNaN(n)?new Date(NaN):n?(i.setDate(i.getDate()+n),i):i}function $s(t,e){Object(Us.a)(2,arguments);var i=Object(Ws.a)(e);return Ys(t,-i)}function Xs(t,e){Object(Us.a)(2,arguments);var i=Object(Hs.a)(t),n=Object(Ws.a)(e);if(isNaN(n))return new Date(NaN);if(!n)return i;var a=i.getDate(),s=new Date(i.getTime());s.setMonth(i.getMonth()+n+1,0);var r=s.getDate();return a>=r?s:(i.setFullYear(s.getFullYear(),s.getMonth(),a),i)}function qs(t,e){Object(Us.a)(2,arguments);var i=Object(Ws.a)(e);return Xs(t,-i)}function Gs(t){return(Gs="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 Qs(t,e){if(Object(Us.a)(2,arguments),!e||"object"!==Gs(e))return new Date(NaN);var i=e.years?Object(Ws.a)(e.years):0,n=e.months?Object(Ws.a)(e.months):0,a=e.weeks?Object(Ws.a)(e.weeks):0,s=e.days?Object(Ws.a)(e.days):0,r=e.hours?Object(Ws.a)(e.hours):0,o=e.minutes?Object(Ws.a)(e.minutes):0,l=e.seconds?Object(Ws.a)(e.seconds):0,c=qs(t,n+12*i),h=$s(c,s+7*a),d=o+60*r,u=l+60*d,f=1e3*u,p=new Date(h.getTime()-f);return p}function Ks(t){return(Ks="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 Zs(t,e){if(Object(Us.a)(2,arguments),!e||"object"!==Ks(e))return new Date(NaN);var i=e.years?Object(Ws.a)(e.years):0,n=e.months?Object(Ws.a)(e.months):0,a=e.weeks?Object(Ws.a)(e.weeks):0,s=e.days?Object(Ws.a)(e.days):0,r=e.hours?Object(Ws.a)(e.hours):0,o=e.minutes?Object(Ws.a)(e.minutes):0,l=e.seconds?Object(Ws.a)(e.seconds):0,c=Object(Hs.a)(t),h=n||i?Xs(c,n+12*i):c,d=s||a?Ys(h,s+7*a):h,u=o+60*r,f=l+60*u,p=1e3*f,g=new Date(d.getTime()+p);return g}function Js(t,e){var i;Object(Us.a)(1,arguments);var n=Object(Ws.a)(null!==(i=null==e?void 0:e.additionalDigits)&&void 0!==i?i:2);if(2!==n&&1!==n&&0!==n)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof t&&"[object String]"!==Object.prototype.toString.call(t))return new Date(NaN);var a,s=ar(t);if(s.date){var r=sr(s.date,n);a=rr(r.restDateString,r.year)}if(!a||isNaN(a.getTime()))return new Date(NaN);var o,l=a.getTime(),c=0;if(s.time&&(c=lr(s.time),isNaN(c)))return new Date(NaN);if(!s.timezone){var h=new Date(l+c),d=new Date(0);return d.setFullYear(h.getUTCFullYear(),h.getUTCMonth(),h.getUTCDate()),d.setHours(h.getUTCHours(),h.getUTCMinutes(),h.getUTCSeconds(),h.getUTCMilliseconds()),d}return o=hr(s.timezone),isNaN(o)?new Date(NaN):new Date(l+c+o)}Math.pow(10,8);var tr={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},er=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,ir=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,nr=/^([+-])(\d{2})(?::?(\d{2}))?$/;function ar(t){var e,i={},n=t.split(tr.dateTimeDelimiter);if(n.length>2)return i;if(/:/.test(n[0])?e=n[0]:(i.date=n[0],e=n[1],tr.timeZoneDelimiter.test(i.date)&&(i.date=t.split(tr.timeZoneDelimiter)[0],e=t.substr(i.date.length,t.length))),e){var a=tr.timezone.exec(e);a?(i.time=e.replace(a[1],""),i.timezone=a[1]):i.time=e}return i}function sr(t,e){var i=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),n=t.match(i);if(!n)return{year:NaN,restDateString:""};var a=n[1]?parseInt(n[1]):null,s=n[2]?parseInt(n[2]):null;return{year:null===s?a:100*s,restDateString:t.slice((n[1]||n[2]).length)}}function rr(t,e){if(null===e)return new Date(NaN);var i=t.match(er);if(!i)return new Date(NaN);var n=!!i[4],a=or(i[1]),s=or(i[2])-1,r=or(i[3]),o=or(i[4]),l=or(i[5])-1;if(n)return function(t,e,i){return e>=1&&e<=53&&i>=0&&i<=6}(0,o,l)?function(t,e,i){var n=new Date(0);n.setUTCFullYear(t,0,4);var a=7*(e-1)+i+1-(n.getUTCDay()||7);return n.setUTCDate(n.getUTCDate()+a),n}(e,o,l):new Date(NaN);var c=new Date(0);return function(t,e,i){return e>=0&&e<=11&&i>=1&&i<=(dr[e]||(ur(t)?29:28))}(e,s,r)&&function(t,e){return e>=1&&e<=(ur(t)?366:365)}(e,a)?(c.setUTCFullYear(e,s,Math.max(a,r)),c):new Date(NaN)}function or(t){return t?parseInt(t):1}function lr(t){var e=t.match(ir);if(!e)return NaN;var i=cr(e[1]),n=cr(e[2]),a=cr(e[3]);return function(t,e,i){return 24===t?0===e&&0===i:i>=0&&i<60&&e>=0&&e<60&&t>=0&&t<25}(i,n,a)?36e5*i+6e4*n+1e3*a:NaN}function cr(t){return t&&parseFloat(t.replace(",","."))||0}function hr(t){if("Z"===t)return 0;var e=t.match(nr);if(!e)return 0;var i="+"===e[1]?-1:1,n=parseInt(e[2]),a=e[3]&&parseInt(e[3])||0;return function(t,e){return e>=0&&e<=59}(0,a)?i*(36e5*n+6e4*a):NaN}var dr=[31,null,31,30,31,30,31,31,30,31,30,31];function ur(t){return t%400==0||t%4==0&&t%100!=0}var fr=i(78);function pr(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function gr(t){for(var e=1;e0,"is-negative":e<0});return Object(c.createElement)("div",{className:s},Object(c.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"simpay-admin-charts-badge__icon",width:"16",height:"16"},e>0?Object(c.createElement)("path",{d:"M16.004 9.414l-8.607 8.607-1.414-1.414L14.589 8H7.004V6h11v11h-2V9.414z"}):Object(c.createElement)("path",{d:"M14.59 16.004L5.982 7.397l1.414-1.414 8.607 8.606V7.004h2v11h-11v-2z"})),!n&&Object(c.createElement)("span",null,Math.abs(e),"%"))},Er="simpay-admin-charts-period-over-period__tooltip",Cr=function(t){var e=t.position,i=t.opacity,n=t.data,a=t.delta,s=t.deltaChangedString;if(!n.length)return null;var r=e.top,o=e.left,l=e.right,h=Dr()("simpay-admin-charts-badge",{"is-positive":a>0,"is-negative":a<0});return Object(c.createElement)("div",{className:Er,style:{top:r,left:o||"auto",right:l||"auto",opacity:i}},n.map((function(t,e){var i=t.label,n=t.value;return Object(c.createElement)("div",{className:"".concat(Er,"-data"),"data-dataset":e,key:i+Math.random()},Object(c.createElement)("strong",null,i)," ",Object(c.createElement)("em",null,Object(Vs.decodeEntities)(n)))})),0!==a&&Object(c.createElement)("div",{className:"".concat(Er,"-delta")},Object(c.createElement)("div",{className:h},Object(c.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"simpay-admin-charts-badge__icon"},a>0?Object(c.createElement)("path",{fillRule:"evenodd",d:"M5.22 14.78a.75.75 0 001.06 0l7.22-7.22v5.69a.75.75 0 001.5 0v-7.5a.75.75 0 00-.75-.75h-7.5a.75.75 0 000 1.5h5.69l-7.22 7.22a.75.75 0 000 1.06z",clipRule:"evenodd"}):Object(c.createElement)("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06l7.22 7.22H6.75a.75.75 0 000 1.5h7.5a.747.747 0 00.75-.75v-7.5a.75.75 0 00-1.5 0v5.69L6.28 5.22z"}))),Object(c.createElement)("span",null,s)))},Tr=function(t){var e=t.chart,i=function(t,e){var i=Object(c.useState)({marginTop:0,marginRight:0,marginBottom:0,marginLeft:0}),n=l()(i,2),a=n[0],s=a.marginTop,r=a.marginRight,o=a.marginBottom,h=a.marginLeft,d=n[1];return Object(c.useEffect)((function(){t.current&&d({marginTop:Math.floor(t.current.chartArea.top),marginRight:Math.floor(t.current.width-t.current.chartArea.right),marginBottom:Math.floor(t.current.chartArea.bottom),marginLeft:Math.floor(t.current.chartArea.left)})}),[t,e]),{marginTop:s,marginRight:r,marginBottom:o,marginLeft:h}}(t.chartRef,e),n=i.marginLeft,a=i.marginRight;return Object(c.createElement)("div",{style:{width:"100%",position:"relative",fontSize:"12px",display:"flex",justifyContent:"space-between",marginTop:"-2px"}},Object(c.createElement)("div",{style:{marginLeft:n,textAlign:"left"}},e.datasets[0].data[0].x),Object(c.createElement)("div",{style:{marginRight:a,textAlign:"right"}},e.datasets[0].data[e.datasets[0].data.length-1].x))};function Ar(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Lr(t){for(var e=1;e0}))}));return Object(c.createElement)("div",{className:"simpay-admin-charts-period-over-period",style:s},!M&&Object(c.createElement)("div",{className:"simpay-admin-charts-no-data",style:Lr(Lr({},s),{},{height:"calc(".concat(s.height," + 15px)")})},o),Object(c.createElement)(zs,{type:"line",ref:g,options:O,plugins:[vr,(_="rgb(".concat(f.primary_color.join(","),")"),{id:"YGridLineHover",afterDraw:function(t){var e;if(null!==(e=t.tooltip)&&void 0!==e&&null!==(e=e._active)&&void 0!==e&&e.length){var i=t.tooltip._active[0].element.x,n=t.scales.yAxis,a=t.ctx;a.save(),a.beginPath(),a.moveTo(i,n.top),a.lineTo(i,n.bottom),a.lineWidth=2,a.strokeStyle=_,a.stroke(),a.restore()}}})],data:{datasets:m}}),Object(c.createElement)(Tr,{chartRef:g,chart:f}),Object(c.createElement)(Cr,a()({},x,{deltaChangedString:h(x)})),Object(c.createElement)(Bs.Popover.Slot,null))}},function(t,e){function i(){return t.exports=i=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var i=0,n=new Array(e);i=s.getTime()?i+1:e.getTime()>=l.getTime()?i:i-1}function f(t){Object(n.a)(1,arguments);var e=u(t),i=new Date(0);i.setUTCFullYear(e,0,4),i.setUTCHours(0,0,0,0);var a=d(i);return a}var p={};function g(){return p}function m(t,e){var i,a,s,o,c,h,d,u;Object(n.a)(1,arguments);var f=g(),p=Object(l.a)(null!==(i=null!==(a=null!==(s=null!==(o=null==e?void 0:e.weekStartsOn)&&void 0!==o?o:null==e||null===(c=e.locale)||void 0===c||null===(h=c.options)||void 0===h?void 0:h.weekStartsOn)&&void 0!==s?s:f.weekStartsOn)&&void 0!==a?a:null===(d=f.locale)||void 0===d||null===(u=d.options)||void 0===u?void 0:u.weekStartsOn)&&void 0!==i?i:0);if(!(p>=0&&p<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var m=Object(r.a)(t),b=m.getUTCDay(),y=(b=1&&y<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var x=new Date(0);x.setUTCFullYear(p+1,0,y),x.setUTCHours(0,0,0,0);var v=m(x,e),_=new Date(0);_.setUTCFullYear(p,0,y),_.setUTCHours(0,0,0,0);var w=m(_,e);return f.getTime()>=v.getTime()?p+1:f.getTime()>=w.getTime()?p:p-1}function y(t,e){var i,a,s,r,o,c,h,d;Object(n.a)(1,arguments);var u=g(),f=Object(l.a)(null!==(i=null!==(a=null!==(s=null!==(r=null==e?void 0:e.firstWeekContainsDate)&&void 0!==r?r:null==e||null===(o=e.locale)||void 0===o||null===(c=o.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==s?s:u.firstWeekContainsDate)&&void 0!==a?a:null===(h=u.locale)||void 0===h||null===(d=h.options)||void 0===d?void 0:d.firstWeekContainsDate)&&void 0!==i?i:1),p=b(t,e),y=new Date(0);y.setUTCFullYear(p,0,f),y.setUTCHours(0,0,0,0);var x=m(y,e);return x}function x(t,e){for(var i=t<0?"-":"",n=Math.abs(t).toString();n.length0?i:1-i;return x("yy"===e?n%100:n,e.length)},_=function(t,e){var i=t.getUTCMonth();return"M"===e?String(i+1):x(i+1,2)},w=function(t,e){return x(t.getUTCDate(),e.length)},O=function(t,e){return x(t.getUTCHours()%12||12,e.length)},M=function(t,e){return x(t.getUTCHours(),e.length)},k=function(t,e){return x(t.getUTCMinutes(),e.length)},j=function(t,e){return x(t.getUTCSeconds(),e.length)},S=function(t,e){var i=e.length,n=t.getUTCMilliseconds();return x(Math.floor(n*Math.pow(10,i-3)),e.length)};function D(t,e){var i=t>0?"-":"+",n=Math.abs(t),a=Math.floor(n/60),s=n%60;if(0===s)return i+String(a);var r=e||"";return i+String(a)+r+x(s,2)}function P(t,e){return t%60==0?(t>0?"-":"+")+x(Math.abs(t)/60,2):E(t,e)}function E(t,e){var i=e||"",n=t>0?"-":"+",a=Math.abs(t);return n+x(Math.floor(a/60),2)+i+x(a%60,2)}var C={G:function(t,e,i){var n=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return i.era(n,{width:"abbreviated"});case"GGGGG":return i.era(n,{width:"narrow"});case"GGGG":default:return i.era(n,{width:"wide"})}},y:function(t,e,i){if("yo"===e){var n=t.getUTCFullYear(),a=n>0?n:1-n;return i.ordinalNumber(a,{unit:"year"})}return v(t,e)},Y:function(t,e,i,n){var a=b(t,n),s=a>0?a:1-a;return"YY"===e?x(s%100,2):"Yo"===e?i.ordinalNumber(s,{unit:"year"}):x(s,e.length)},R:function(t,e){return x(u(t),e.length)},u:function(t,e){return x(t.getUTCFullYear(),e.length)},Q:function(t,e,i){var n=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return x(n,2);case"Qo":return i.ordinalNumber(n,{unit:"quarter"});case"QQQ":return i.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return i.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return i.quarter(n,{width:"wide",context:"formatting"})}},q:function(t,e,i){var n=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return x(n,2);case"qo":return i.ordinalNumber(n,{unit:"quarter"});case"qqq":return i.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return i.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return i.quarter(n,{width:"wide",context:"standalone"})}},M:function(t,e,i){var n=t.getUTCMonth();switch(e){case"M":case"MM":return _(t,e);case"Mo":return i.ordinalNumber(n+1,{unit:"month"});case"MMM":return i.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return i.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return i.month(n,{width:"wide",context:"formatting"})}},L:function(t,e,i){var n=t.getUTCMonth();switch(e){case"L":return String(n+1);case"LL":return x(n+1,2);case"Lo":return i.ordinalNumber(n+1,{unit:"month"});case"LLL":return i.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return i.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return i.month(n,{width:"wide",context:"standalone"})}},w:function(t,e,i,a){var s=function(t,e){Object(n.a)(1,arguments);var i=Object(r.a)(t),a=m(i,e).getTime()-y(i,e).getTime();return Math.round(a/6048e5)+1}(t,a);return"wo"===e?i.ordinalNumber(s,{unit:"week"}):x(s,e.length)},I:function(t,e,i){var a=function(t){Object(n.a)(1,arguments);var e=Object(r.a)(t),i=d(e).getTime()-f(e).getTime();return Math.round(i/6048e5)+1}(t);return"Io"===e?i.ordinalNumber(a,{unit:"week"}):x(a,e.length)},d:function(t,e,i){return"do"===e?i.ordinalNumber(t.getUTCDate(),{unit:"date"}):w(t,e)},D:function(t,e,i){var a=function(t){Object(n.a)(1,arguments);var e=Object(r.a)(t),i=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var a=e.getTime(),s=i-a;return Math.floor(s/864e5)+1}(t);return"Do"===e?i.ordinalNumber(a,{unit:"dayOfYear"}):x(a,e.length)},E:function(t,e,i){var n=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return i.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return i.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(n,{width:"short",context:"formatting"});case"EEEE":default:return i.day(n,{width:"wide",context:"formatting"})}},e:function(t,e,i,n){var a=t.getUTCDay(),s=(a-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return x(s,2);case"eo":return i.ordinalNumber(s,{unit:"day"});case"eee":return i.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return i.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(a,{width:"short",context:"formatting"});case"eeee":default:return i.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,i,n){var a=t.getUTCDay(),s=(a-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return x(s,e.length);case"co":return i.ordinalNumber(s,{unit:"day"});case"ccc":return i.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return i.day(a,{width:"narrow",context:"standalone"});case"cccccc":return i.day(a,{width:"short",context:"standalone"});case"cccc":default:return i.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,i){var n=t.getUTCDay(),a=0===n?7:n;switch(e){case"i":return String(a);case"ii":return x(a,e.length);case"io":return i.ordinalNumber(a,{unit:"day"});case"iii":return i.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return i.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return i.day(n,{width:"short",context:"formatting"});case"iiii":default:return i.day(n,{width:"wide",context:"formatting"})}},a:function(t,e,i){var n=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return i.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return i.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(t,e,i){var n,a=t.getUTCHours();switch(n=12===a?"noon":0===a?"midnight":a/12>=1?"pm":"am",e){case"b":case"bb":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return i.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return i.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(t,e,i){var n,a=t.getUTCHours();switch(n=a>=17?"evening":a>=12?"afternoon":a>=4?"morning":"night",e){case"B":case"BB":case"BBB":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return i.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return i.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(t,e,i){if("ho"===e){var n=t.getUTCHours()%12;return 0===n&&(n=12),i.ordinalNumber(n,{unit:"hour"})}return O(t,e)},H:function(t,e,i){return"Ho"===e?i.ordinalNumber(t.getUTCHours(),{unit:"hour"}):M(t,e)},K:function(t,e,i){var n=t.getUTCHours()%12;return"Ko"===e?i.ordinalNumber(n,{unit:"hour"}):x(n,e.length)},k:function(t,e,i){var n=t.getUTCHours();return 0===n&&(n=24),"ko"===e?i.ordinalNumber(n,{unit:"hour"}):x(n,e.length)},m:function(t,e,i){return"mo"===e?i.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):k(t,e)},s:function(t,e,i){return"so"===e?i.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):j(t,e)},S:function(t,e){return S(t,e)},X:function(t,e,i,n){var a=(n._originalDate||t).getTimezoneOffset();if(0===a)return"Z";switch(e){case"X":return P(a);case"XXXX":case"XX":return E(a);case"XXXXX":case"XXX":default:return E(a,":")}},x:function(t,e,i,n){var a=(n._originalDate||t).getTimezoneOffset();switch(e){case"x":return P(a);case"xxxx":case"xx":return E(a);case"xxxxx":case"xxx":default:return E(a,":")}},O:function(t,e,i,n){var a=(n._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+D(a,":");case"OOOO":default:return"GMT"+E(a,":")}},z:function(t,e,i,n){var a=(n._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+D(a,":");case"zzzz":default:return"GMT"+E(a,":")}},t:function(t,e,i,n){var a=n._originalDate||t;return x(Math.floor(a.getTime()/1e3),e.length)},T:function(t,e,i,n){return x((n._originalDate||t).getTime(),e.length)}},T=function(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},A=function(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},L={p:A,P:function(t,e){var i,n=t.match(/(P+)(p+)?/)||[],a=n[1],s=n[2];if(!s)return T(t,e);switch(a){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"})}return i.replace("{{date}}",T(a,e)).replace("{{time}}",A(s,e))}};function R(t){var e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}var N=["D","DD"],F=["YY","YYYY"];function I(t){return-1!==N.indexOf(t)}function z(t){return-1!==F.indexOf(t)}function B(t,e,i){if("YYYY"===t)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===t)throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===t)throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===t)throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var V={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function W(t){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.width?String(e.width):t.defaultWidth,n=t.formats[i]||t.formats[t.defaultWidth];return n}}var H={date:W({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:W({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:W({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},U={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function Y(t){return function(e,i){var n;if("formatting"===(null!=i&&i.context?String(i.context):"standalone")&&t.formattingValues){var a=t.defaultFormattingWidth||t.defaultWidth,s=null!=i&&i.width?String(i.width):a;n=t.formattingValues[s]||t.formattingValues[a]}else{var r=t.defaultWidth,o=null!=i&&i.width?String(i.width):t.defaultWidth;n=t.values[o]||t.values[r]}return n[t.argumentCallback?t.argumentCallback(e):e]}}function $(t){return function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.width,a=n&&t.matchPatterns[n]||t.matchPatterns[t.defaultMatchWidth],s=e.match(a);if(!s)return null;var r,o=s[0],l=n&&t.parsePatterns[n]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?q(l,(function(t){return t.test(o)})):X(l,(function(t){return t.test(o)}));r=t.valueCallback?t.valueCallback(c):c,r=i.valueCallback?i.valueCallback(r):r;var h=e.slice(o.length);return{value:r,rest:h}}}function X(t,e){for(var i in t)if(t.hasOwnProperty(i)&&e(t[i]))return i}function q(t,e){for(var i=0;i0?"in "+n:n+" ago":n},formatLong:H,formatRelative:function(t,e,i,n){return U[t]},localize:{ordinalNumber:function(t,e){var i=Number(t),n=i%100;if(n>20||n<10)switch(n%10){case 1:return i+"st";case 2:return i+"nd";case 3:return i+"rd"}return i+"th"},era:Y({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Y({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:Y({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:Y({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:Y({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(G={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(t){return parseInt(t,10)}},function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.match(G.matchPattern);if(!i)return null;var n=i[0],a=t.match(G.parsePattern);if(!a)return null;var s=G.valueCallback?G.valueCallback(a[0]):a[0];s=e.valueCallback?e.valueCallback(s):s;var r=t.slice(n.length);return{value:s,rest:r}}),era:$({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:$({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:$({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:$({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:$({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}},K=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Z=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,J=/^'([^]*?)'?$/,tt=/''/g,et=/[a-zA-Z]/;function it(t,e,i){var a,s,c,d,u,f,p,m,b,y,x,v,_,w,O,M,k,j;Object(n.a)(2,arguments);var S=String(e),D=g(),P=null!==(a=null!==(s=null==i?void 0:i.locale)&&void 0!==s?s:D.locale)&&void 0!==a?a:Q,E=Object(l.a)(null!==(c=null!==(d=null!==(u=null!==(f=null==i?void 0:i.firstWeekContainsDate)&&void 0!==f?f:null==i||null===(p=i.locale)||void 0===p||null===(m=p.options)||void 0===m?void 0:m.firstWeekContainsDate)&&void 0!==u?u:D.firstWeekContainsDate)&&void 0!==d?d:null===(b=D.locale)||void 0===b||null===(y=b.options)||void 0===y?void 0:y.firstWeekContainsDate)&&void 0!==c?c:1);if(!(E>=1&&E<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var T=Object(l.a)(null!==(x=null!==(v=null!==(_=null!==(w=null==i?void 0:i.weekStartsOn)&&void 0!==w?w:null==i||null===(O=i.locale)||void 0===O||null===(M=O.options)||void 0===M?void 0:M.weekStartsOn)&&void 0!==_?_:D.weekStartsOn)&&void 0!==v?v:null===(k=D.locale)||void 0===k||null===(j=k.options)||void 0===j?void 0:j.weekStartsOn)&&void 0!==x?x:0);if(!(T>=0&&T<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!P.localize)throw new RangeError("locale must contain localize property");if(!P.formatLong)throw new RangeError("locale must contain formatLong property");var A=Object(r.a)(t);if(!o(A))throw new RangeError("Invalid time value");var N=R(A),F=h(A,N),V={firstWeekContainsDate:E,weekStartsOn:T,locale:P,_originalDate:A},W=S.match(Z).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,L[e])(t,P.formatLong):t})).join("").match(K).map((function(n){if("''"===n)return"'";var a=n[0];if("'"===a)return nt(n);var s=C[a];if(s)return null!=i&&i.useAdditionalWeekYearTokens||!z(n)||B(n,e,String(t)),null!=i&&i.useAdditionalDayOfYearTokens||!I(n)||B(n,e,String(t)),s(F,n,P.localize,V);if(a.match(et))throw new RangeError("Format string contains an unescaped latin alphabet character `"+a+"`");return n})).join("");return W}function nt(t){var e=t.match(J);return e?e[1].replace(tt,"'"):t}},function(t,e,i){"use strict";i.r(e);var n=i(0),a=(i(37),i(3)),s=i(6),r=i.n(s),o=i(2),l=i(9),c=Object(n.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(l.Path,{fillRule:"evenodd",d:"M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z",clipRule:"evenodd"})),h=i(10),d=i(14),u=simpayAdminPageActivityReports,f=u.user_id,p=u.currencies,g=u.default_currency,m=i(15),b=i.n(m),y=i(17),x=i(11),v=i.n(x),_=i(25),w=i.n(_);function O(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function M(t){for(var e=1;e0&&Object(n.createElement)(n.Fragment,null,Object(n.createElement)(a.CardDivider,null),Object(n.createElement)("h3",{className:"".concat("simpay-activity-reports-card-today","-today-misc-title")},Object(o.__)("Top Forms","stripe")),Object(n.createElement)("div",{className:"".concat("simpay-activity-reports-card-today","-forms")},s.map((function(t){return Object(n.createElement)(D,b()({key:t.id},t))})))),r&&Object(n.createElement)("div",{className:"".concat("simpay-activity-reports-card-today","-tip")},Object(n.createElement)("strong",null,Object(n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{d:"M11.7 2.805a.75.75 0 01.6 0A60.65 60.65 0 0122.83 8.72a.75.75 0 01-.231 1.337 49.949 49.949 0 00-9.902 3.912l-.003.002-.34.18a.75.75 0 01-.707 0A50.009 50.009 0 007.5 12.174v-.224c0-.131.067-.248.172-.311a54.614 54.614 0 014.653-2.52.75.75 0 00-.65-1.352 56.129 56.129 0 00-4.78 2.589 1.858 1.858 0 00-.859 1.228 49.803 49.803 0 00-4.634-1.527.75.75 0 01-.231-1.337A60.653 60.653 0 0111.7 2.805z"}),Object(n.createElement)("path",{d:"M13.06 15.473a48.45 48.45 0 017.666-3.282c.134 1.414.22 2.843.255 4.285a.75.75 0 01-.46.71 47.878 47.878 0 00-8.105 4.342.75.75 0 01-.832 0 47.877 47.877 0 00-8.104-4.342.75.75 0 01-.461-.71c.035-1.442.121-2.87.255-4.286A48.4 48.4 0 016 13.18v1.27a1.5 1.5 0 00-.14 2.508c-.09.38-.222.753-.397 1.11.452.213.901.434 1.346.661a6.729 6.729 0 00.551-1.608 1.5 1.5 0 00.14-2.67v-.645a48.549 48.549 0 013.44 1.668 2.25 2.25 0 002.12 0z"}),Object(n.createElement)("path",{d:"M4.462 19.462c.42-.419.753-.89 1-1.394.453.213.902.434 1.347.661a6.743 6.743 0 01-1.286 1.794.75.75 0 11-1.06-1.06z"})),r.title),Object(n.createElement)("p",null,r.text," ",Object(n.createElement)("a",{href:Object(y.decodeEntities)(r.href),target:"_blank",rel:"noreferrer"},Object(o.__)("Learn More →","stripe")))))))},C=function(t){var e=t.currency;return Object(n.createElement)("div",{className:"simpay-admin-charts-no-data",style:{width:"100%",height:"100%"}},Object(n.createElement)("div",null,Object(n.createElement)("strong",null,Object(o.sprintf)(/* translators: %s Currency code. */ -Object(o.__)("No %s transactions found.","stripe"),e.toUpperCase())),Object(n.createElement)("div",null,Object(o.__)("Please select a different currency or check back later.","stripe"))))},T=i(13),A=i.n(T),L=function(t){var e=t.currency,i=t.amount_total_formatted,s=t.status,r=t.status_formatted,l=t.email,c=t.payment_method_type_icon,h=t.date_created_human_time_diff,d=t.links,u=d.customer,f=d.payment,p="simpay-activity-reports-card-latest-payment",g=A()("simpay-activity-reports-badge",{"is-succeeded":"succeeded"===s,"is-failed":"failed"===s});return Object(n.createElement)("tr",{className:p},Object(n.createElement)("td",{className:"".concat(p,"__amount")},Object(y.decodeEntities)(i)," ",Object(n.createElement)("small",{style:{fontWeight:"normal"}},e.toUpperCase())),Object(n.createElement)("td",{className:"".concat(p,"__type")},""!==c&&Object(n.createElement)("span",{dangerouslySetInnerHTML:{__html:c}})),Object(n.createElement)("td",{className:"".concat(p,"__status")},Object(n.createElement)("div",{className:g},Object(n.createElement)("span",null,r),Object(n.createElement)("svg",{"aria-hidden":"true",className:"simpay-activity-reports-badge__icon",height:"12",width:"12",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",style:{marginLeft:"4px"}},"succeeded"===s?Object(n.createElement)("path",{d:"M5.297 13.213.293 8.255c-.39-.394-.39-1.033 0-1.426s1.024-.394 1.414 0l4.294 4.224 8.288-8.258c.39-.393 1.024-.393 1.414 0s.39 1.033 0 1.426L6.7 13.208a.994.994 0 0 1-1.402.005z",fillRule:"evenodd"}):Object(n.createElement)("path",{d:"m8 6.585 4.593-4.592a1 1 0 0 1 1.415 1.416L9.417 8l4.591 4.591a1 1 0 0 1-1.415 1.416L8 9.415l-4.592 4.592a1 1 0 0 1-1.416-1.416L6.584 8l-4.59-4.591a1 1 0 1 1 1.415-1.416z",fillRule:"evenodd"})))),Object(n.createElement)("td",{className:"".concat(p,"__email")},Object(n.createElement)(a.Tooltip,{text:Object(o.__)("View customer records","stripe")},Object(n.createElement)("a",{href:u,target:"_blank",rel:"noreferrer noopener"},l))),Object(n.createElement)("td",{className:"".concat(p,"__date")},Object(n.createElement)(a.Tooltip,{text:Object(o.__)("View payment record","stripe")},Object(n.createElement)("a",{href:f,target:"_blank",rel:"noreferrer noopener"},h))))},R=simpayAdminPageActivityReports,N=R.default_currency,F=R.links.all_payments,I=function(){var t=j("/wpsp/__internal__/report/latest-payments",{currency:N},[]),e=t.data.payments;return Object(n.createElement)(a.Card,{elevation:2,className:"simpay-activity-reports-card-latest"},Object(n.createElement)(a.CardHeader,null,Object(n.createElement)("h2",{className:"simpay-activity-reports-card-title"},Object(o.__)("Latest Payments","stripe")),Object(n.createElement)(a.Button,{className:"simpay-activity-reports-card-title-link",href:F,variant:"link",isSmall:!0,target:"_blank"},Object(o.__)("View More →","stripe"))),Object(n.createElement)(a.CardBody,null,t.isLoading&&Object(n.createElement)(a.Spinner,null),!t.isLoading&&e.length>0&&Object(n.createElement)("table",{className:"".concat("simpay-activity-reports-card-latest","-payments")},Object(n.createElement)("tbody",null,e.map((function(t){return Object(n.createElement)(L,b()({key:t.id},t))})))),!t.isLoading&&0===e.length&&Object(n.createElement)(C,{currency:N})))},z=i(8),B=i(4);function V(t,e){Object(B.a)(2,arguments);var i=Object(z.a)(t),n=Object(z.a)(e),a=i.getFullYear()-n.getFullYear(),s=i.getMonth()-n.getMonth();return 12*a+s}function W(t,e){Object(B.a)(2,arguments);var i=Object(z.a)(t),n=Object(z.a)(e),a=i.getTime()-n.getTime();return a<0?-1:a>0?1:a}function H(t){Object(B.a)(1,arguments);var e=Object(z.a)(t);return e.setHours(23,59,59,999),e}function U(t){Object(B.a)(1,arguments);var e=Object(z.a)(t),i=e.getMonth();return e.setFullYear(e.getFullYear(),i+1,0),e.setHours(23,59,59,999),e}function Y(t){Object(B.a)(1,arguments);var e=Object(z.a)(t);return H(e).getTime()===U(e).getTime()}var $=i(78),X=i(33);function q(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function G(t){for(var e=1;e27&&n.setDate(30),n.setMonth(n.getMonth()-s*r);var o=W(n,a)===-s;Y(Object(z.a)(t))&&1===r&&1===W(t,a)&&(o=!1),i=s*(r-Number(o))}return 0===i?0:i}(new Date(s.end),new Date(s.start))>12?(e=Object(X.dateI18n)("F Y",s.start),i=Object(X.dateI18n)("F Y",s.end)):"today"===s.type?(e=Object(X.dateI18n)(l.formats.date,K),i=e):(e=Object(X.dateI18n)(l.formats.date,s.start),i=Object(X.dateI18n)(l.formats.date,s.end)),Object(n.createElement)("div",{className:"simpay-activity-reports-card-reports-date-range"},Object(n.createElement)(a.SelectControl,{label:Object(o.__)("Report range","stripe"),value:s.type,options:"custom"===s.type?[].concat(c,[{label:Object(o.__)("Custom","stripe"),value:"custom"}]):c,onChange:function(t){r(G(G({},s),{},{type:t,start:Object(d.d)(t,K),end:Object(d.c)(t,s.end)}))},hideLabelFromVision:!0}),Object(n.createElement)(a.Dropdown,{position:"bottom center",popoverProps:{noArrow:!1},renderToggle:function(t){var i=t.isOpen,s=t.onToggle;return Object(n.createElement)(a.Button,{variant:"tertiary",onClick:s,"aria-expanded":i},e)},renderContent:function(t){var e=t.onToggle;return Object(n.createElement)(a.DatePicker,{currentDate:new Date(s.start),onChange:function(t){r(G(G({},s),{},{start:Object($.a)(new Date(t),"yyyy-MM-dd 00:00:00"),type:"custom"})),e()},startOfWeek:l.l10n.startOfWeek,isInvalidDate:function(t){return t>new Date(s.end)}})}}),Object(n.createElement)("span",{style:{color:"#ccc"}},"–"),Object(n.createElement)(a.Dropdown,{position:"bottom center",popoverProps:{noArrow:!1},renderToggle:function(t){var e=t.isOpen,s=t.onToggle;return Object(n.createElement)(a.Button,{variant:"tertiary",onClick:s,"aria-expanded":e},i)},renderContent:function(t){var e=t.onToggle;return Object(n.createElement)(a.DatePicker,{currentDate:new Date(s.end),onChange:function(t){r(G(G({},s),{},{end:Object($.a)(new Date(t),"yyyy-MM-dd 23:59:59"),type:"custom"})),e()},startOfWeek:l.l10n.startOfWeek,isInvalidDate:function(t){return tnew Date}})}}))},J="simpay-activity-reports-data-bar",tt=function(t){var e=t.isLoading,i=t.label,s=t.data;return Object(n.createElement)("div",{className:J},Object(n.createElement)("div",{className:"".concat(J,"__header")},Object(n.createElement)("h3",{className:"".concat(J,"__label")},i),!e&&Object(n.createElement)("div",{className:"".concat(J,"__legend")},s.map((function(t){var e=t.label,i=t.color;return Object(n.createElement)("div",{key:e,className:"".concat(J,"__legend-item"),style:{color:i}},Object(n.createElement)("span",null,e))})))),Object(n.createElement)("div",{className:"".concat(J,"__bar")},!e&&s.length>0&&s.map((function(t){return Object(n.createElement)(a.Button,{key:t.label,label:"".concat(t.label,": ").concat(t.value,"%"),showTooltip:!0,className:"".concat(J,"__bar-item"),style:{backgroundColor:t.color,flexBasis:"".concat(t.value,"%"),flexGrow:1}},Object(n.createElement)("div",{className:"screen-reader-text"},t.label))})),!e&&0===s.length&&Object(n.createElement)("div",{className:"".concat(J,"__bar-item-none")},Object(o.__)("n/a","stripe"))))},et=function(t){var e=t.currency,i=t.range,a=j("/wpsp/__internal__/report/payment-info",{range:i,currency:e},[i]),s=a.data,r=s.payment_method_types,l=s.payment_statuses;return Object(n.createElement)("div",{className:"".concat("simpay-activity-reports-card-reports","-payment-breakdown")},Object(n.createElement)(tt,{label:Object(o.__)("Payment Methods","stripe"),data:r,isLoading:a.isLoading}),Object(n.createElement)(tt,{label:Object(o.__)("Payments","stripe"),data:l,isLoading:a.isLoading}))},it=function(t){var e=t.currency,i=t.range,a=j("/wpsp/__internal__/report/gross-volume-period-over-period",{range:i,currency:e},[i]),s=a.data,r=s.delta,l=s.total_formatted;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)("div",{className:"".concat("simpay-activity-reports-card-reports","-report-title")},Object(n.createElement)("h3",null,Object(o.__)("Gross Volume","stripe"),!a.isLoading&&Object(n.createElement)(n.Fragment,null,": ",Object(n.createElement)("em",null,Object(y.decodeEntities)(l)))),!a.isLoading&&Object(n.createElement)(d.a,{delta:r})),Object(n.createElement)(d.b,{report:a,style:{width:"100%",height:"300px"},config:{yAxisIsCurrency:!0},noData:Object(n.createElement)("div",null,Object(n.createElement)("strong",null,Object(o.sprintf)(/* translators: %s Currency code. */ +!function(t){var e={};function i(n){if(e[n])return e[n].exports;var a=e[n]={i:n,l:!1,exports:{}};return t[n].call(a.exports,a,a.exports,i),a.l=!0,a.exports}i.m=t,i.c=e,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 a in t)i.d(n,a,function(e){return t[e]}.bind(null,a));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="",i(i.s=77)}([function(t,e){t.exports=window.wp.element},,function(t,e){t.exports=window.wp.i18n},function(t,e){t.exports=window.wp.components},function(t,e,i){"use strict";function n(t,e){if(e.length1?"s":"")+" required, but only "+e.length+" present")}i.d(e,"a",(function(){return n}))},function(t,e){t.exports=window.React},function(t,e,i){var n=i(26),a=i(27),s=i(21),r=i(28);t.exports=function(t,e){return n(t)||a(t,e)||s(t,e)||r()},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){"use strict";function n(t){if(null===t||!0===t||!1===t)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}i.d(e,"a",(function(){return n}))},function(t,e,i){"use strict";i.d(e,"a",(function(){return s}));var n=i(4);function a(t){return(a="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 s(t){Object(n.a)(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||"object"===a(t)&&"[object Date]"===e?new Date(t.getTime()):"number"==typeof t||"[object Number]"===e?new Date(t):("string"!=typeof t&&"[object String]"!==e||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}},function(t,e){t.exports=window.wp.primitives},function(t,e){t.exports=window.wp.url},function(t,e,i){var n=i(30);t.exports=function(t,e,i){return(e=n(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=window.lodash},function(t,e,i){"use strict";i.d(e,"b",(function(){return Rr})),i.d(e,"e",(function(){return jr})),i.d(e,"d",(function(){return yr})),i.d(e,"c",(function(){return xr})),i.d(e,"a",(function(){return Pr}));var n=i(15),a=i.n(n),s=i(11),r=i.n(s),o=i(6),l=i.n(o),c=i(0);const h="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function d(t,e,i){const n=i||(t=>Array.prototype.slice.call(t));let a=!1,s=[];return function(...i){s=n(i),a||(a=!0,h.call(window,()=>{a=!1,t.apply(e,s)}))}}const u=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2;function f(){}const p=function(){let t=0;return function(){return t++}}();function g(t){return null==t}function m(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.substr(0,7)&&"Array]"===e.substr(-6)}function b(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}const y=t=>("number"==typeof t||t instanceof Number)&&isFinite(+t);function x(t,e){return y(t)?t:e}function v(t,e){return void 0===t?e:t}const _=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function w(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function O(t,e,i,n){let a,s,r;if(m(t))if(s=t.length,n)for(a=s-1;a>=0;a--)e.call(i,t[a],a);else for(a=0;ai;)t=t[e.substr(i,n-i)],i=n+1,n=C(e,i);return t}function A(t){return t.charAt(0).toUpperCase()+t.slice(1)}const L=t=>void 0!==t,R=t=>"function"==typeof t,N=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0},F=Math.PI,I=2*F,z=I+F,V=Number.POSITIVE_INFINITY,B=F/180,W=F/2,H=F/4,U=2*F/3,Y=Math.log10,$=Math.sign;function X(t){const e=Math.round(t);t=G(t,e,t/1e3)?e:t;const i=Math.pow(10,Math.floor(Y(t))),n=t/i;return(n<=1?1:n<=2?2:n<=5?5:10)*i}function q(t){return!isNaN(parseFloat(t))&&isFinite(t)}function G(t,e,i){return Math.abs(t-e)l&&c=Math.min(e,i)-n&&t<=Math.max(e,i)+n}const ot=t=>0===t||1===t,lt=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*I/i),ct=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*I/i)+1,ht={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*W),easeOutSine:t=>Math.sin(t*W),easeInOutSine:t=>-.5*(Math.cos(F*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>ot(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>ot(t)?t:lt(t,.075,.3),easeOutElastic:t=>ot(t)?t:ct(t,.075,.3),easeInOutElastic(t){const e=.1125;return ot(t)?t:t<.5?.5*lt(2*t,e,.45):.5+.5*ct(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-ht.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*ht.easeInBounce(2*t):.5*ht.easeOutBounce(2*t-1)+.5},dt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},ut="0123456789ABCDEF",ft=t=>ut[15&t],pt=t=>ut[(240&t)>>4]+ut[15&t],gt=t=>(240&t)>>4==(15&t);function mt(t){return t+.5|0}const bt=(t,e,i)=>Math.max(Math.min(t,i),e);function yt(t){return bt(mt(2.55*t),0,255)}function xt(t){return bt(mt(255*t),0,255)}function vt(t){return bt(mt(t/2.55)/100,0,1)}function _t(t){return bt(mt(100*t),0,100)}const wt=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/,Ot=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Mt(t,e,i){const n=e*Math.min(i,1-i),a=(e,a=(e+t/30)%12)=>i-n*Math.max(Math.min(a-3,9-a,1),-1);return[a(0),a(8),a(4)]}function kt(t,e,i){const n=(n,a=(n+t/60)%6)=>i-i*e*Math.max(Math.min(a,4-a,1),0);return[n(5),n(3),n(1)]}function jt(t,e,i){const n=Mt(t,1,.5);let a;for(e+i>1&&(a=1/(e+i),e*=a,i*=a),a=0;a<3;a++)n[a]*=1-e-i,n[a]+=e;return n}function St(t){const e=t.r/255,i=t.g/255,n=t.b/255,a=Math.max(e,i,n),s=Math.min(e,i,n),r=(a+s)/2;let o,l,c;return a!==s&&(c=a-s,l=r>.5?c/(2-a-s):c/(a+s),o=a===e?(i-n)/c+(i=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=xt(t[3]))):(e=Rt(t,{r:0,g:0,b:0,a:1})).a=xt(e.a),e}function Ft(t){return"r"===t.charAt(0)?function(t){const e=wt.exec(t);let i,n,a,s=255;if(e){if(e[7]!==i){const t=+e[7];s=255&(e[8]?yt(t):255*t)}return i=+e[1],n=+e[3],a=+e[5],i=255&(e[2]?yt(i):i),n=255&(e[4]?yt(n):n),a=255&(e[6]?yt(a):a),{r:i,g:n,b:a,a:s}}}(t):function(t){const e=Ot.exec(t);let i,n=255;if(!e)return;e[5]!==i&&(n=e[6]?yt(+e[5]):xt(+e[5]));const a=Et(+e[2]),s=+e[3]/100,r=+e[4]/100;return i="hwb"===e[1]?function(t,e,i){return Dt(jt,t,e,i)}(a,s,r):"hsv"===e[1]?function(t,e,i){return Dt(kt,t,e,i)}(a,s,r):Pt(a,s,r),{r:i[0],g:i[1],b:i[2],a:n}}(t)}class It{constructor(t){if(t instanceof It)return t;const e=typeof t;let i;var n,a,s;"object"===e?i=Nt(t):"string"===e&&(s=(n=t).length,"#"===n[0]&&(4===s||5===s?a={r:255&17*dt[n[1]],g:255&17*dt[n[2]],b:255&17*dt[n[3]],a:5===s?17*dt[n[4]]:255}:7!==s&&9!==s||(a={r:dt[n[1]]<<4|dt[n[2]],g:dt[n[3]]<<4|dt[n[4]],b:dt[n[5]]<<4|dt[n[6]],a:9===s?dt[n[7]]<<4|dt[n[8]]:255})),i=a||function(t){At||(At=function(){const t={},e=Object.keys(Tt),i=Object.keys(Ct);let n,a,s,r,o;for(n=0;n>16&255,s>>8&255,255&s]}return t}(),At.transparent=[0,0,0,0]);const e=At[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}(t)||Ft(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Rt(this._rgb);return t&&(t.a=vt(t.a)),t}set rgb(t){this._rgb=Nt(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${vt(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):this._rgb;var t}hexString(){return this._valid?(t=this._rgb,e=function(t){return gt(t.r)&>(t.g)&>(t.b)&>(t.a)}(t)?ft:pt,t?"#"+e(t.r)+e(t.g)+e(t.b)+(t.a<255?e(t.a):""):t):this._rgb;var t,e}hslString(){return this._valid?function(t){if(!t)return;const e=St(t),i=e[0],n=_t(e[1]),a=_t(e[2]);return t.a<255?`hsla(${i}, ${n}%, ${a}%, ${vt(t.a)})`:`hsl(${i}, ${n}%, ${a}%)`}(this._rgb):this._rgb}mix(t,e){const i=this;if(t){const n=i.rgb,a=t.rgb;let s;const r=e===s?.5:e,o=2*r-1,l=n.a-a.a,c=((o*l==-1?o:(o+l)/(1+o*l))+1)/2;s=1-c,n.r=255&c*n.r+s*a.r+.5,n.g=255&c*n.g+s*a.g+.5,n.b=255&c*n.b+s*a.b+.5,n.a=r*n.a+(1-r)*a.a,i.rgb=n}return i}clone(){return new It(this.rgb)}alpha(t){return this._rgb.a=xt(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=mt(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Lt(this._rgb,2,t),this}darken(t){return Lt(this._rgb,2,-t),this}saturate(t){return Lt(this._rgb,1,t),this}desaturate(t){return Lt(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=St(t);i[0]=Et(i[0]+e),i=Pt(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}function zt(t){return new It(t)}const Vt=t=>t instanceof CanvasGradient||t instanceof CanvasPattern;function Bt(t){return Vt(t)?t:zt(t)}function Wt(t){return Vt(t)?t:zt(t).saturate(.5).darken(.1).hexString()}const Ht=Object.create(null),Ut=Object.create(null);function Yt(t,e){if(!e)return t;const i=e.split(".");for(let e=0,n=i.length;et.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>Wt(e.backgroundColor),this.hoverBorderColor=(t,e)=>Wt(e.borderColor),this.hoverColor=(t,e)=>Wt(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t)}set(t,e){return $t(this,t,e)}get(t){return Yt(this,t)}describe(t,e){return $t(Ut,t,e)}override(t,e){return $t(Ht,t,e)}route(t,e,i,n){const a=Yt(this,t),s=Yt(this,i),r="_"+e;Object.defineProperties(a,{[r]:{value:a[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[r],e=s[n];return b(t)?Object.assign({},e,t):v(t,e)},set(t){this[r]=t}}})}}({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function qt(t,e,i,n,a){let s=e[a];return s||(s=e[a]=t.measureText(a).width,i.push(a)),s>n&&(n=s),n}function Gt(t,e,i,n){let a=(n=n||{}).data=n.data||{},s=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(a=n.data={},s=n.garbageCollect=[],n.font=e),t.save(),t.font=e;let r=0;const o=i.length;let l,c,h,d,u;for(l=0;li.length){for(l=0;l0&&t.stroke()}}function Jt(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.xe.top-i&&t.y0&&""!==s.strokeColor;let l,c;for(t.save(),t.font=a.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),g(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,s),l=0;lv(t[i],t[e[i]]):e=>t[e]:()=>t;for(const t of a)i[t]=+s(t)||0;return i}function de(t){return he(t,{top:"y",right:"x",bottom:"y",left:"x"})}function ue(t){return he(t,["topLeft","topRight","bottomLeft","bottomRight"])}function fe(t){const e=de(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function pe(t,e){t=t||{},e=e||Xt.font;let i=v(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let n=v(t.style,e.style);n&&!(""+n).match(le)&&(console.warn('Invalid font style specified: "'+n+'"'),n="");const a={family:v(t.family,e.family),lineHeight:ce(v(t.lineHeight,e.lineHeight),i),size:i,style:n,weight:v(t.weight,e.weight),string:""};return a.string=function(t){return!t||g(t.size)||g(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(a),a}function ge(t,e,i,n){let a,s,r,o=!0;for(a=0,s=t.length;at[i]1;)n=s+a>>1,i(n)?s=n:a=n;return{lo:s,hi:a}}const ye=(t,e,i)=>be(t,i,n=>t[n][e]be(t,i,n=>t[n][e]>=i),ve=["push","pop","shift","splice","unshift"];function _e(t,e){const i=t._chartjs;if(!i)return;const n=i.listeners,a=n.indexOf(e);-1!==a&&n.splice(a,1),n.length>0||(ve.forEach(e=>{delete t[e]}),delete t._chartjs)}function we(t){const e=new Set;let i,n;for(i=0,n=t.length;it[0])){L(n)||(n=Le("_fallback",t));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:i,_fallback:n,_getTarget:a,override:a=>Oe([a,...t],e,i,n)};return new Proxy(s,{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,n)=>De(i,n,()=>function(t,e,i,n){let a;for(const s of e)if(a=Le(je(s,t),i),L(a))return Se(t,a)?Te(i,n,t,a):a}(n,e,t,i)),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>Re(t).includes(e),ownKeys:t=>Re(t),set(t,e,i){const n=t._storage||(t._storage=a());return t[e]=n[e]=i,delete t._keys,!0}})}function Me(t,e,i,n){const a={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:ke(t,n),setContext:e=>Me(t,e,i,n),override:a=>Me(t.override(a),e,i,n)};return new Proxy(a,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>De(t,e,()=>function(t,e,i){const{_proxy:n,_context:a,_subProxy:s,_descriptors:r}=t;let o=n[e];return R(o)&&r.isScriptable(e)&&(o=function(t,e,i,n){const{_proxy:a,_context:s,_subProxy:r,_stack:o}=i;if(o.has(t))throw new Error("Recursion detected: "+Array.from(o).join("->")+"->"+t);return o.add(t),e=e(s,r||n),o.delete(t),Se(t,e)&&(e=Te(a._scopes,a,t,e)),e}(e,o,t,i)),m(o)&&o.length&&(o=function(t,e,i,n){const{_proxy:a,_context:s,_subProxy:r,_descriptors:o}=i;if(L(s.index)&&n(t))e=e[s.index%e.length];else if(b(e[0])){const i=e,n=a._scopes.filter(t=>t!==i);e=[];for(const l of i){const i=Te(n,a,t,l);e.push(Me(i,s,r&&r[t],o))}}return e}(e,o,t,r.isIndexable)),Se(e,o)&&(o=Me(o,a,s&&s[e],r)),o}(t,e,i)),getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,i)=>Reflect.has(t,i),ownKeys:()=>Reflect.ownKeys(t),set:(e,i,n)=>(t[i]=n,delete e[i],!0)})}function ke(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:n=e.indexable,_allKeys:a=e.allKeys}=t;return{allKeys:a,scriptable:i,indexable:n,isScriptable:R(i)?i:()=>i,isIndexable:R(n)?n:()=>n}}const je=(t,e)=>t?t+A(e):e,Se=(t,e)=>b(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function De(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const n=i();return t[e]=n,n}function Pe(t,e,i){return R(t)?t(e,i):t}const Ee=(t,e)=>!0===t?e:"string"==typeof t?T(e,t):void 0;function Ce(t,e,i,n,a){for(const s of e){const e=Ee(i,s);if(e){t.add(e);const s=Pe(e._fallback,i,a);if(L(s)&&s!==i&&s!==n)return s}else if(!1===e&&L(n)&&i!==n)return null}return!1}function Te(t,e,i,n){const a=e._rootScopes,s=Pe(e._fallback,i,n),r=[...t,...a],o=new Set;o.add(n);let l=Ae(o,r,i,s||i,n);return null!==l&&(!L(s)||s===i||(l=Ae(o,r,s,l,n),null!==l))&&Oe(Array.from(o),[""],a,s,()=>function(t,e,i){const n=t._getTarget();e in n||(n[e]={});const a=n[e];return m(a)&&b(i)?i:a}(e,i,n))}function Ae(t,e,i,n,a){for(;i;)i=Ce(t,e,i,n,a);return i}function Le(t,e){for(const i of e){if(!i)continue;const e=i[t];if(L(e))return e}}function Re(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter(t=>!t.startsWith("_")))e.add(t);return Array.from(e)}(t._scopes)),e}const Ne=Number.EPSILON||1e-14,Fe=(t,e)=>e"x"===t?"y":"x";function ze(t,e,i,n){const a=t.skip?e:t,s=e,r=i.skip?e:i,o=et(s,a),l=et(r,s);let c=o/(o+l),h=l/(o+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=n*c,u=n*h;return{previous:{x:s.x-d*(r.x-a.x),y:s.y-d*(r.y-a.y)},next:{x:s.x+u*(r.x-a.x),y:s.y+u*(r.y-a.y)}}}function Ve(t,e,i){return Math.max(Math.min(t,i),e)}function Be(t,e,i,n,a){let s,r,o,l;if(e.spanGaps&&(t=t.filter(t=>!t.skip)),"monotone"===e.cubicInterpolationMode)!function(t,e="x"){const i=Ie(e),n=t.length,a=Array(n).fill(0),s=Array(n);let r,o,l,c=Fe(t,0);for(r=0;rwindow.getComputedStyle(t,null),$e=["top","right","bottom","left"];function Xe(t,e,i){const n={};i=i?"-"+i:"";for(let a=0;a<4;a++){const s=$e[a];n[s]=parseFloat(t[e+"-"+s+i])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function qe(t,e){const{canvas:i,currentDevicePixelRatio:n}=e,a=Ye(i),s="border-box"===a.boxSizing,r=Xe(a,"padding"),o=Xe(a,"border","width"),{x:l,y:c,box:h}=function(t,e){const i=t.native||t,n=i.touches,a=n&&n.length?n[0]:i,{offsetX:s,offsetY:r}=a;let o,l,c=!1;if(((t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot))(s,r,i.target))o=s,l=r;else{const t=e.getBoundingClientRect();o=a.clientX-t.left,l=a.clientY-t.top,c=!0}return{x:o,y:l,box:c}}(t,i),d=r.left+(h&&o.left),u=r.top+(h&&o.top);let{width:f,height:p}=e;return s&&(f-=r.width+o.width,p-=r.height+o.height),{x:Math.round((l-d)/f*i.width/n),y:Math.round((c-u)/p*i.height/n)}}const Ge=t=>Math.round(10*t)/10;function Qe(t,e,i){const n=e||1,a=Math.floor(t.height*n),s=Math.floor(t.width*n);t.height=a/n,t.width=s/n;const r=t.canvas;return r.style&&(i||!r.style.height&&!r.style.width)&&(r.style.height=t.height+"px",r.style.width=t.width+"px"),(t.currentDevicePixelRatio!==n||r.height!==a||r.width!==s)&&(t.currentDevicePixelRatio=n,r.height=a,r.width=s,t.ctx.setTransform(n,0,0,n,0,0),!0)}const Ze=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(t){}return t}();function Ke(t,e){const i=function(t,e){return Ye(t).getPropertyValue(e)}(t,e),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function Je(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function ti(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:"middle"===n?i<.5?t.y:e.y:"after"===n?i<1?t.y:e.y:i>0?e.y:t.y}}function ei(t,e,i,n){const a={x:t.cp2x,y:t.cp2y},s={x:e.cp1x,y:e.cp1y},r=Je(t,a,i),o=Je(a,s,i),l=Je(s,e,i),c=Je(r,o,i),h=Je(o,l,i);return Je(c,h,i)}const ii=new Map;function ni(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let n=ii.get(i);return n||(n=new Intl.NumberFormat(t,e),ii.set(i,n)),n}(e,i).format(t)}function ai(t,e,i){return t?function(t,e){return{x:i=>t+t+e-i,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,i):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function si(t){return"angle"===t?{between:at,compare:it,normalize:nt}:{between:rt,compare:(t,e)=>t-e,normalize:t=>t}}function ri({start:t,end:e,count:i,loop:n,style:a}){return{start:t%i,end:e%i,loop:n&&(e-t+1)%i==0,style:a}}function oi(t,e,i){if(!i)return[t];const{property:n,start:a,end:s}=i,r=e.length,{compare:o,between:l,normalize:c}=si(n),{start:h,end:d,loop:u,style:f}=function(t,e,i){const{property:n,start:a,end:s}=i,{between:r,normalize:o}=si(n),l=e.length;let c,h,{start:d,end:u,loop:f}=t;if(f){for(d+=l,u+=l,c=0,h=l;cn({chart:t,initial:e.initial,numSteps:s,currentStep:Math.min(i-e.start,s)}))}_refresh(){this._request||(this._running=!0,this._request=h.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,n)=>{if(!i.running||!i.items.length)return;const a=i.items;let s,r=a.length-1,o=!1;for(;r>=0;--r)s=a[r],s._active?(s._total>i.duration&&(i.duration=s._total),s.tick(t),o=!0):(a[r]=a[a.length-1],a.pop());o&&(n.draw(),this._notify(n,i,t,"progress")),a.length||(i.running=!1,this._notify(n,i,t,"complete"),i.initial=!1),e+=a.length}),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((t,e)=>Math.max(t,e._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let n=i.length-1;for(;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}};const ui={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const n=Bt(t||"transparent"),a=n.valid&&Bt(e||"transparent");return a&&a.valid?a.mix(n,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class fi{constructor(t,e,i,n){const a=e[i];n=ge([t.to,n,a,t.from]);const s=ge([t.from,a,n]);this._active=!0,this._fn=t.fn||ui[t.type||typeof s],this._easing=ht[t.easing]||ht.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=s,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const n=this._target[this._prop],a=i-this._start,s=this._duration-a;this._start=i,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=a,this._loop=!!t.loop,this._to=ge([t.to,e,n,t.from]),this._from=ge([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,n=this._prop,a=this._from,s=this._loop,r=this._to;let o;if(this._active=a!==r&&(s||e1?2-o:o,o=this._easing(Math.min(1,Math.max(0,o))),this._target[n]=this._fn(a,r,o))}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let t=0;t"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),Xt.set("animations",{colors:{type:"color",properties:["color","borderColor","backgroundColor"]},numbers:{type:"number",properties:["x","y","borderWidth","radius","tension"]}}),Xt.describe("animations",{_fallback:"animation"}),Xt.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}});class gi{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!b(t))return;const e=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const n=t[i];if(!b(n))return;const a={};for(const t of pi)a[t]=n[t];(m(n.properties)&&n.properties||[i]).forEach(t=>{t!==i&&e.has(t)||e.set(t,a)})})}_animateOptions(t,e){const i=e.options,n=function(t,e){if(!e)return;let i=t.options;if(i)return i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i;t.options=e}(t,i);if(!n)return[];const a=this._createAnimations(n,i);return i.$shared&&function(t,e){const i=[],n=Object.keys(e);for(let e=0;e{t.options=i},()=>{}),a}_createAnimations(t,e){const i=this._properties,n=[],a=t.$animations||(t.$animations={}),s=Object.keys(e),r=Date.now();let o;for(o=s.length-1;o>=0;--o){const l=s[o];if("$"===l.charAt(0))continue;if("options"===l){n.push(...this._animateOptions(t,e));continue}const c=e[l];let h=a[l];const d=i.get(l);if(h){if(d&&h.active()){h.update(d,c,r);continue}h.cancel()}d&&d.duration?(a[l]=h=new fi(d,t,l,c),n.push(h)):t[l]=c}return n}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(di.add(this._chart,i),!0):void 0}}function mi(t,e){const i=t&&t.options||{},n=i.reverse,a=void 0===i.min?e:0,s=void 0===i.max?e:0;return{start:n?s:a,end:n?a:s}}function bi(t,e){const i=[],n=t._getSortedDatasetMetas(e);let a,s;for(a=0,s=n.length;a0||!i&&e<0)return a.index}return null}function wi(t,e){const{chart:i,_cachedMeta:n}=t,a=i._stacks||(i._stacks={}),{iScale:s,vScale:r,index:o}=n,l=s.axis,c=r.axis,h=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(s,r,n),d=e.length;let u;for(let t=0;ti[t].axis===e).shift()}function Mi(t,e){const i=t.controller.index,n=t.vScale&&t.vScale.axis;if(n){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[n]||void 0===e[n][i])return;delete e[n][i]}}}const ki=t=>"reset"===t||"none"===t,ji=(t,e)=>e?t:Object.assign({},t);class Si{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=xi(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&Mi(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=(t,e,i,n)=>"x"===t?e:"r"===t?n:i,a=e.xAxisID=v(i.xAxisID,Oi(t,"x")),s=e.yAxisID=v(i.yAxisID,Oi(t,"y")),r=e.rAxisID=v(i.rAxisID,Oi(t,"r")),o=e.indexAxis,l=e.iAxisID=n(o,a,s,r),c=e.vAxisID=n(o,s,a,r);e.xScale=this.getScaleForId(a),e.yScale=this.getScaleForId(s),e.rScale=this.getScaleForId(r),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&_e(this._data,this),t._stacked&&Mi(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(b(e))this._data=function(t){const e=Object.keys(t),i=new Array(e.length);let n,a,s;for(n=0,a=e.length;n{const e="_onData"+A(t),i=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...t){const a=i.apply(this,t);return n._chartjs.listeners.forEach(i=>{"function"==typeof i[e]&&i[e](...t)}),a}})}))),this._syncList=[],this._data=e}var n}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let n=!1;this._dataCheck();const a=e._stacked;e._stacked=xi(e.vScale,e),e.stack!==i.stack&&(n=!0,Mi(e),e.stack=i.stack),this._resyncElements(t),(n||a!==e._stacked)&&wi(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:n}=this,{iScale:a,_stacked:s}=i,r=a.axis;let o,l,c,h=0===t&&e===n.length||i._sorted,d=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=n,i._sorted=!0,c=n;else{c=m(n[t])?this.parseArrayData(i,n,t,e):b(n[t])?this.parseObjectData(i,n,t,e):this.parsePrimitiveData(i,n,t,e);const a=()=>null===l[r]||d&&l[r]t&&!e.hidden&&e._stacked&&{keys:bi(i,!0),values:null})(e,i,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:h}=function(t){const{min:e,max:i,minDefined:n,maxDefined:a}=t.getUserBounds();return{min:n?e:Number.NEGATIVE_INFINITY,max:a?i:Number.POSITIVE_INFINITY}}(r);let d,u;function f(){u=n[d];const e=u[r.axis];return!y(u[t.axis])||c>e||h=0;--d)if(!f()){this.updateRangeFromParsed(l,t,u,o);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let n,a,s;for(n=0,a=e.length;n=0&&tthis.getContext(i,n),h);return f.$shared&&(f.$shared=o,a[s]=Object.freeze(ji(f,o))),f}_resolveAnimations(t,e,i){const n=this.chart,a=this._cachedDataOpts,s="animation-"+e,r=a[s];if(r)return r;let o;if(!1!==n.options.animation){const n=this.chart.config,a=n.datasetAnimationScopeKeys(this._type,e),s=n.getOptionScopes(this.getDataset(),a);o=n.createResolver(s,this.getContext(t,i,e))}const l=new gi(n,o&&o.animations);return o&&o._cacheable&&(a[s]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||ki(t)||this.chart._animationsDisabled}updateElement(t,e,i,n){ki(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!ki(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;const a=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(a)||a})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];const n=i.length,a=e.length,s=Math.min(a,n);s&&this.parse(0,s),a>n?this._insertElements(n,a-n,t):a{for(t.length+=e,r=t.length-1;r>=s;r--)t[r]=t[r-e]};for(o(a),r=t;rt-e))}return t._cache.$bar}(e,t.type);let n,a,s,r,o=e._length;const l=()=>{32767!==s&&-32768!==s&&(L(r)&&(o=Math.min(o,Math.abs(s-r)||o)),r=s)};for(n=0,a=i.length;nMath.abs(o)&&(l=o,c=r),e[i.axis]=c,e._custom={barStart:l,barEnd:c,start:a,end:s,min:r,max:o}}(t,e,i,n):e[i.axis]=i.parse(t,n),e}function Ei(t,e,i,n){const a=t.iScale,s=t.vScale,r=a.getLabels(),o=a===s,l=[];let c,h,d,u;for(c=i,h=i+n;ct.x,i="left",n="right"):(e=t.base=i?1:-1)}(h,e,s)*a,d===s&&(m-=h/2),c=m+h),m===e.getPixelForValue(s)){const t=$(h)*e.getLineWidthForValue(s)/2;m+=t,h-=t}return{size:h,base:m,head:c,center:c+h/2}}_calculateBarIndexPixels(t,e){const i=e.scale,n=this.options,a=n.skipNull,s=v(n.maxBarThickness,1/0);let r,o;if(e.grouped){const i=a?this._getStackCount(t):e.stackCount,l="flex"===n.barThickness?function(t,e,i,n){const a=e.pixels,s=a[t];let r=t>0?a[t-1]:null,o=t=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,{xScale:i,yScale:n}=e,a=this.getParsed(t),s=i.getLabelForValue(a.x),r=n.getLabelForValue(a.y),o=a._custom;return{label:e.label,value:"("+s+", "+r+(o?", "+o:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,n){const a="reset"===n,{iScale:s,vScale:r}=this._cachedMeta,o=this.resolveDataElementOptions(e,n),l=this.getSharedOptions(o),c=this.includeOptions(n,l),h=s.axis,d=r.axis;for(let o=e;o""}}}};class Ii extends Si{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,n=this._cachedMeta;if(!1===this._parsing)n._parsed=i;else{let a,s,r=t=>+i[t];if(b(i[t])){const{key:t="value"}=this._parsing;r=e=>+T(i[e],t)}for(a=t,s=t+e;aat(t,o,l,!0)?1:Math.max(e,e*i,n,n*i),p=(t,e,n)=>at(t,o,l,!0)?-1:Math.min(e,e*i,n,n*i),g=f(0,c,d),m=f(W,h,u),b=p(F,c,d),y=p(F+W,h,u);n=(g-b)/2,a=(m-y)/2,s=-(g+b)/2,r=-(m+y)/2}return{ratioX:n,ratioY:a,offsetX:s,offsetY:r}}(u,d,o),b=(i.width-s)/f,y=(i.height-s)/p,x=Math.max(Math.min(b,y)/2,0),v=_(this.options.radius,x),w=(v-Math.max(v*o,0))/this._getVisibleDatasetWeightTotal();this.offsetX=g*v,this.offsetY=m*v,n.total=this.calculateTotal(),this.outerRadius=v-w*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-w*h,0),this.updateElements(a,0,a.length,t)}_circumference(t,e){const i=this.options,n=this._cachedMeta,a=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===n._parsed[t]||n.data[t].hidden?0:this.calculateCircumference(n._parsed[t]*a/I)}updateElements(t,e,i,n){const a="reset"===n,s=this.chart,r=s.chartArea,o=s.options.animation,l=(r.left+r.right)/2,c=(r.top+r.bottom)/2,h=a&&o.animateScale,d=h?0:this.innerRadius,u=h?0:this.outerRadius,f=this.resolveDataElementOptions(e,n),p=this.getSharedOptions(f),g=this.includeOptions(n,p);let m,b=this._getRotation();for(m=0;m0&&!isNaN(t)?I*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],a=ni(e._parsed[t],i.options.locale);return{label:n[t]||"",value:a}}getMaxBorderWidth(t){let e=0;const i=this.chart;let n,a,s,r,o;if(!t)for(n=0,a=i.data.datasets.length;n"spacing"!==t,_indexable:t=>"spacing"!==t},Ii.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map((e,n)=>{const a=t.getDatasetMeta(0).controller.getStyle(n);return{text:e,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,lineWidth:a.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label(t){let e=t.label;const i=": "+t.formattedValue;return m(e)?(e=e.slice(),e[0]+=i):e+=i,e}}}}};class zi extends Si{initialize(){this.enableOptionSharing=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:n=[],_dataset:a}=e,s=this.chart._animationsDisabled;let{start:r,count:o}=function(t,e,i){const n=e.length;let a=0,s=n;if(t._sorted){const{iScale:r,_parsed:o}=t,l=r.axis,{min:c,max:h,minDefined:d,maxDefined:u}=r.getUserBounds();d&&(a=st(Math.min(ye(o,r.axis,c).lo,i?n:ye(e,l,r.getPixelForValue(c)).lo),0,n-1)),s=u?st(Math.max(ye(o,r.axis,h).hi+1,i?0:ye(e,l,r.getPixelForValue(h)).hi+1),a,n)-a:n-a}return{start:a,count:s}}(e,n,s);this._drawStart=r,this._drawCount=o,function(t){const{xScale:e,yScale:i,_scaleRanges:n}=t,a={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!n)return t._scaleRanges=a,!0;const s=n.xmin!==e.min||n.xmax!==e.max||n.ymin!==i.min||n.ymax!==i.max;return Object.assign(n,a),s}(e)&&(r=0,o=n.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!a._decimated,i.points=n;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!s,options:l},t),this.updateElements(n,r,o,t)}updateElements(t,e,i,n){const a="reset"===n,{iScale:s,vScale:r,_stacked:o,_dataset:l}=this._cachedMeta,c=this.resolveDataElementOptions(e,n),h=this.getSharedOptions(c),d=this.includeOptions(n,h),u=s.axis,f=r.axis,{spanGaps:p,segment:m}=this.options,b=q(p)?p:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||a||"none"===n;let x=e>0&&this.getParsed(e-1);for(let c=e;c0&&i[u]-x[u]>b,m&&(p.parsed=i,p.raw=l.data[c]),d&&(p.options=h||this.resolveDataElementOptions(c,e.active?"active":n)),y||this.updateElement(e,c,p,n),x=i}this.updateSharedOptions(h,n,c)}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return i;const a=n[0].size(this.resolveDataElementOptions(0)),s=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,a,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}zi.id="line",zi.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},zi.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class Vi extends Si{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],a=ni(e._parsed[t].r,i.options.locale);return{label:n[t]||"",value:a}}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),a=Math.max(n/2,0),s=(a-Math.max(i.cutoutPercentage?a/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=a-s*this.index,this.innerRadius=this.outerRadius-s}updateElements(t,e,i,n){const a="reset"===n,s=this.chart,r=this.getDataset(),o=s.options.animation,l=this._cachedMeta.rScale,c=l.xCenter,h=l.yCenter,d=l.getIndexAngle(0)-.5*F;let u,f=d;const p=360/this.countVisibleElements();for(u=0;u{!isNaN(t.data[n])&&this.chart.getDataVisibility(n)&&i++}),i}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?Z(this.resolveDataElementOptions(t,e).angle||i):0}}Vi.id="polarArea",Vi.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},Vi.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map((e,n)=>{const a=t.getDatasetMeta(0).controller.getStyle(n);return{text:e,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,lineWidth:a.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label:t=>t.chart.data.labels[t.dataIndex]+": "+t.formattedValue}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class Bi extends Ii{}Bi.id="pie",Bi.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Wi extends Si{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}update(t){const e=this._cachedMeta,i=e.dataset,n=e.data||[],a=e.iScale.getLabels();if(i.points=n,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const s={_loop:!0,_fullLoop:a.length===n.length,options:e};this.updateElement(i,void 0,s,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,i,n){const a=this.getDataset(),s=this._cachedMeta.rScale,r="reset"===n;for(let o=e;o"",label:t=>"("+t.label+", "+t.formattedValue+")"}}},scales:{x:{type:"linear"},y:{type:"linear"}}};class Yi{constructor(t){this.options=t||{}}formats(){return Ui()}parse(t,e){return Ui()}format(t,e){return Ui()}add(t,e,i){return Ui()}diff(t,e,i){return Ui()}startOf(t,e,i){return Ui()}endOf(t,e){return Ui()}}Yi.override=function(t){Object.assign(Yi.prototype,t)};var $i={_date:Yi};function Xi(t,e){return"native"in t?{x:t.x,y:t.y}:qe(t,e)}function qi(t,e,i,n){const{controller:a,data:s,_sorted:r}=t,o=a._cachedMeta.iScale;if(o&&e===o.axis&&"r"!==e&&r&&s.length){const t=o._reversePixels?xe:ye;if(!n)return t(s,e,i);if(a._sharedOptions){const n=s[0],a="function"==typeof n.getRange&&n.getRange(e);if(a){const n=t(s,e,i-a),r=t(s,e,i+a);return{lo:n.lo,hi:r.hi}}}}return{lo:0,hi:s.length-1}}function Gi(t,e,i,n,a){const s=t.getSortedVisibleDatasetMetas(),r=i[e];for(let t=0,i=s.length;t{t[o](a[r],n)&&s.push({element:t,datasetIndex:e,index:i}),t.inRange(a.x,a.y,n)&&(l=!0)}),i.intersect&&!l?[]:s}var Ji={modes:{index(t,e,i,n){const a=Xi(e,t),s=i.axis||"x",r=i.intersect?Qi(t,a,s,n):Zi(t,a,s,!1,n),o=[];return r.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{const e=r[0].index,i=t.data[e];i&&!i.skip&&o.push({element:i,datasetIndex:t.index,index:e})}),o):[]},dataset(t,e,i,n){const a=Xi(e,t),s=i.axis||"xy";let r=i.intersect?Qi(t,a,s,n):Zi(t,a,s,!1,n);if(r.length>0){const e=r[0].datasetIndex,i=t.getDatasetMeta(e).data;r=[];for(let t=0;tQi(t,Xi(e,t),i.axis||"xy",n),nearest:(t,e,i,n)=>Zi(t,Xi(e,t),i.axis||"xy",i.intersect,n),x:(t,e,i,n)=>Ki(t,e,{axis:"x",intersect:i.intersect},n),y:(t,e,i,n)=>Ki(t,e,{axis:"y",intersect:i.intersect},n)}};const tn=["left","top","right","bottom"];function en(t,e){return t.filter(t=>t.pos===e)}function nn(t,e){return t.filter(t=>-1===tn.indexOf(t.pos)&&t.box.axis===e)}function an(t,e){return t.sort((t,i)=>{const n=e?i:t,a=e?t:i;return n.weight===a.weight?n.index-a.index:n.weight-a.weight})}function sn(t,e,i,n){return Math.max(t[i],e[i])+Math.max(t[n],e[n])}function rn(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function on(t,e,i,n){const{pos:a,box:s}=i,r=t.maxPadding;if(!b(a)){i.size&&(t[a]-=i.size);const e=n[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?s.height:s.width),i.size=e.size/e.count,t[a]+=i.size}s.getPadding&&rn(r,s.getPadding());const o=Math.max(0,e.outerWidth-sn(r,t,"left","right")),l=Math.max(0,e.outerHeight-sn(r,t,"top","bottom")),c=o!==t.w,h=l!==t.h;return t.w=o,t.h=l,i.horizontal?{same:c,other:h}:{same:h,other:c}}function ln(t,e){const i=e.maxPadding;return function(t){const n={left:0,top:0,right:0,bottom:0};return t.forEach(t=>{n[t]=Math.max(e[t],i[t])}),n}(t?["left","right"]:["top","bottom"])}function cn(t,e,i,n){const a=[];let s,r,o,l,c,h;for(s=0,r=t.length,c=0;st.box.fullSize),!0),n=an(en(e,"left"),!0),a=an(en(e,"right")),s=an(en(e,"top"),!0),r=an(en(e,"bottom")),o=nn(e,"x"),l=nn(e,"y");return{fullSize:i,leftAndTop:n.concat(s),rightAndBottom:a.concat(l).concat(r).concat(o),chartArea:en(e,"chartArea"),vertical:n.concat(a).concat(l),horizontal:s.concat(r).concat(o)}}(t.boxes),l=o.vertical,c=o.horizontal;O(t.boxes,t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()});const h=l.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1,d=Object.freeze({outerWidth:e,outerHeight:i,padding:a,availableWidth:s,availableHeight:r,vBoxMaxWidth:s/2/h,hBoxMaxHeight:r/2}),u=Object.assign({},a);rn(u,fe(n));const f=Object.assign({maxPadding:u,w:s,h:r,x:a.left,y:a.top},a),p=function(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:n,stackWeight:a}=i;if(!t||!tn.includes(n))continue;const s=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=a}return e}(t),{vBoxMaxWidth:n,hBoxMaxHeight:a}=e;let s,r,o;for(s=0,r=t.length;s{const i=e.box;Object.assign(i,t.chartArea),i.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class fn{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}isAttached(t){return!0}updateConfig(t){}}class pn extends fn{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const gn={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},mn=t=>null===t||""===t,bn=!!Ze&&{passive:!0};function yn(t,e,i){t.canvas.removeEventListener(e,i,bn)}function xn(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function vn(t,e,i){const n=t.canvas,a=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||xn(i.addedNodes,n),e=e&&!xn(i.removedNodes,n);e&&i()});return a.observe(document,{childList:!0,subtree:!0}),a}function wn(t,e,i){const n=t.canvas,a=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||xn(i.removedNodes,n),e=e&&!xn(i.addedNodes,n);e&&i()});return a.observe(document,{childList:!0,subtree:!0}),a}const On=new Map;let Mn=0;function kn(){const t=window.devicePixelRatio;t!==Mn&&(Mn=t,On.forEach((e,i)=>{i.currentDevicePixelRatio!==t&&e()}))}function jn(t,e,i){const n=t.canvas,a=n&&He(n);if(!a)return;const s=d((t,e)=>{const n=a.clientWidth;i(t,e),n{const e=t[0],i=e.contentRect.width,n=e.contentRect.height;0===i&&0===n||s(i,n)});return r.observe(a),function(t,e){On.size||window.addEventListener("resize",kn),On.set(t,e)}(t,s),r}function Sn(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){On.delete(t),On.size||window.removeEventListener("resize",kn)}(t)}function Dn(t,e,i){const n=t.canvas,a=d(e=>{null!==t.ctx&&i(function(t,e){const i=gn[t.type]||t.type,{x:n,y:a}=qe(t,e);return{type:i,chart:e,native:t,x:void 0!==n?n:null,y:void 0!==a?a:null}}(e,t))},t,t=>{const e=t[0];return[e,e.offsetX,e.offsetY]});return function(t,e,i){t.addEventListener(e,i,bn)}(n,e,a),a}class Pn extends fn{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,n=t.getAttribute("height"),a=t.getAttribute("width");if(t.$chartjs={initial:{height:n,width:a,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",mn(a)){const e=Ke(t,"width");void 0!==e&&(t.width=e)}if(mn(n))if(""===t.style.height)t.height=t.width/(e||2);else{const e=Ke(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e.$chartjs)return!1;const i=e.$chartjs.initial;["height","width"].forEach(t=>{const n=i[t];g(n)?e.removeAttribute(t):e.setAttribute(t,n)});const n=i.style||{};return Object.keys(n).forEach(t=>{e.style[t]=n[t]}),e.width=e.width,delete e.$chartjs,!0}addEventListener(t,e,i){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),a={attach:vn,detach:wn,resize:jn}[e]||Dn;n[e]=a(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),n=i[e];n&&(({attach:Sn,detach:Sn,resize:Sn}[e]||yn)(t,e,n),i[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return function(t,e,i,n){const a=Ye(t),s=Xe(a,"margin"),r=Ue(a.maxWidth,t,"clientWidth")||V,o=Ue(a.maxHeight,t,"clientHeight")||V,l=function(t,e,i){let n,a;if(void 0===e||void 0===i){const s=He(t);if(s){const t=s.getBoundingClientRect(),r=Ye(s),o=Xe(r,"border","width"),l=Xe(r,"padding");e=t.width-l.width-o.width,i=t.height-l.height-o.height,n=Ue(r.maxWidth,s,"clientWidth"),a=Ue(r.maxHeight,s,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:n||V,maxHeight:a||V}}(t,e,i);let{width:c,height:h}=l;if("content-box"===a.boxSizing){const t=Xe(a,"border","width"),e=Xe(a,"padding");c-=e.width+t.width,h-=e.height+t.height}return c=Math.max(0,c-s.width),h=Math.max(0,n?Math.floor(c/n):h-s.height),c=Ge(Math.min(c,r,l.maxWidth)),h=Ge(Math.min(h,o,l.maxHeight)),c&&!h&&(h=Ge(c/2)),{width:c,height:h}}(t,e,i,n)}isAttached(t){const e=He(t);return!(!e||!e.isConnected)}}class En{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return q(this.x)&&q(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const n={};return t.forEach(t=>{n[t]=i[t]&&i[t].active()?i[t]._to:this[t]}),n}}En.defaults={},En.defaultRoutes=void 0;const Cn={values:t=>m(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";const n=this.chart.options.locale;let a,s=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(a="scientific"),s=function(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t)),i}(t,i)}const r=Y(Math.abs(s)),o=Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:a,minimumFractionDigits:o,maximumFractionDigits:o};return Object.assign(l,this.options.ticks.format),ni(t,n,l)},logarithmic(t,e,i){if(0===t)return"0";const n=t/Math.pow(10,Math.floor(Y(t)));return 1===n||2===n||5===n?Cn.numeric.call(this,t,e,i):""}};var Tn={formatters:Cn};function An(t,e,i,n,a){const s=v(n,0),r=Math.min(v(a,t.length),t.length);let o,l,c,h=0;for(i=Math.ceil(i),a&&(o=a-n,i=o/Math.floor(o/i)),c=s;c<0;)h++,c=Math.round(s+h*i);for(l=Math.max(s,0);le.lineWidth,tickColor:(t,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Tn.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),Xt.route("scale.ticks","color","","color"),Xt.route("scale.grid","color","","borderColor"),Xt.route("scale.grid","borderColor","","borderColor"),Xt.route("scale.title","color","","color"),Xt.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t}),Xt.describe("scales",{_fallback:"scale"}),Xt.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t});const Ln=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i;function Rn(t,e){const i=[],n=t.length/e,a=t.length;let s=0;for(;sr+1e-6)))return l}function Fn(t){return t.drawTicks?t.tickLength:0}function In(t,e){if(!t.display)return 0;const i=pe(t.font,e),n=fe(t.padding);return(m(t.text)?t.text.length:1)*i.lineHeight+n.height}function zn(t,e,i){let n=(t=>"start"===t?"left":"end"===t?"right":"center")(t);return(i&&"right"!==e||!i&&"right"===e)&&(n=(t=>"left"===t?"right":"right"===t?"left":t)(n)),n}class Vn extends En{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:n}=this;return t=x(t,Number.POSITIVE_INFINITY),e=x(e,Number.NEGATIVE_INFINITY),i=x(i,Number.POSITIVE_INFINITY),n=x(n,Number.NEGATIVE_INFINITY),{min:x(t,i),max:x(e,n),minDefined:y(t),maxDefined:y(e)}}getMinMax(t){let e,{min:i,max:n,minDefined:a,maxDefined:s}=this.getUserBounds();if(a&&s)return{min:i,max:n};const r=this.getMatchingVisibleMetas();for(let o=0,l=r.length;on?n:i,n=a&&i>n?i:n,{min:x(i,x(n,i)),max:x(n,x(i,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){w(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:n,grace:a,ticks:s}=this.options,r=s.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(t,e,i){const{min:n,max:a}=t,s=_(e,(a-n)/2),r=(t,e)=>i&&0===t?0:t+e;return{min:r(n,-Math.abs(s)),max:r(a,s)}}(this,a,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const o=rn)return function(t,e,i,n){let a,s=0,r=i[0];for(n=Math.ceil(n),a=0;at-e).pop(),e}(n);for(let t=0,e=s.length-1;ta)return e}return Math.max(a,1)}(a,e,n);if(s>0){let t,i;const n=s>1?Math.round((o-r)/(s-1)):null;for(An(e,l,c,g(n)?0:r-n,r),t=0,i=s-1;t=a||i<=1||!this.isHorizontal())return void(this.labelRotation=n);const c=this._getLabelSizes(),h=c.widest.width,d=c.highest.height,u=st(this.chart.width-h,0,this.maxWidth);s=t.offset?this.maxWidth/i:u/(i-1),h+6>s&&(s=u/(i-(t.offset?.5:1)),r=this.maxHeight-Fn(t.grid)-e.padding-In(t.title,this.chart.options.font),o=Math.sqrt(h*h+d*d),l=K(Math.min(Math.asin(st((c.highest.height+6)/s,-1,1)),Math.asin(st(r/o,-1,1))-Math.asin(st(d/o,-1,1)))),l=Math.max(n,Math.min(a,l))),this.labelRotation=l}afterCalculateLabelRotation(){w(this.options.afterCalculateLabelRotation,[this])}beforeFit(){w(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:n,grid:a}}=this,s=this._isVisible(),r=this.isHorizontal();if(s){const s=In(n,e.options.font);if(r?(t.width=this.maxWidth,t.height=Fn(a)+s):(t.height=this.maxHeight,t.width=Fn(a)+s),i.display&&this.ticks.length){const{first:e,last:n,widest:a,highest:s}=this._getLabelSizes(),o=2*i.padding,l=Z(this.labelRotation),c=Math.cos(l),h=Math.sin(l);if(r){const e=i.mirror?0:h*a.width+c*s.height;t.height=Math.min(this.maxHeight,t.height+e+o)}else{const e=i.mirror?0:c*a.width+h*s.height;t.width=Math.min(this.maxWidth,t.width+e+o)}this._calculatePadding(e,n,h,c)}}this._handleMargins(),r?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,n){const{ticks:{align:a,padding:s},position:r}=this.options,o=0!==this.labelRotation,l="top"!==r&&"x"===this.axis;if(this.isHorizontal()){const r=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,d=0;o?l?(h=n*t.width,d=i*e.height):(h=i*t.height,d=n*e.width):"start"===a?d=e.width:"end"===a?h=t.width:(h=t.width/2,d=e.width/2),this.paddingLeft=Math.max((h-r+s)*this.width/(this.width-r),0),this.paddingRight=Math.max((d-c+s)*this.width/(this.width-c),0)}else{let i=e.height/2,n=t.height/2;"start"===a?(i=0,n=t.height):"end"===a&&(i=e.height,n=0),this.paddingTop=i+s,this.paddingBottom=n+s}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){w(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e{const i=t.gc,n=i.length/2;let a;if(n>e){for(a=0;a({width:a[t]||0,height:s[t]||0});return{first:M(0),last:M(e-1),widest:M(_),highest:M(w),widths:a,heights:s}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return st(this._alignToPixels?Qt(this.chart,e,0):e,-32768,32767)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&tr*n?r/i:o/n:o*n0}_computeGridLineItems(t){const e=this.axis,i=this.chart,n=this.options,{grid:a,position:s}=n,r=a.offset,o=this.isHorizontal(),l=this.ticks.length+(r?1:0),c=Fn(a),h=[],d=a.setContext(this.getContext()),u=d.drawBorder?d.borderWidth:0,f=u/2,p=function(t){return Qt(i,t,u)};let g,m,y,x,_,w,O,M,k,j,S,D;if("top"===s)g=p(this.bottom),w=this.bottom-c,M=g-f,j=p(t.top)+f,D=t.bottom;else if("bottom"===s)g=p(this.top),j=t.top,D=p(t.bottom)-f,w=g+f,M=this.top+c;else if("left"===s)g=p(this.right),_=this.right-c,O=g-f,k=p(t.left)+f,S=t.right;else if("right"===s)g=p(this.left),k=t.left,S=p(t.right)-f,_=g+f,O=this.left+c;else if("x"===e){if("center"===s)g=p((t.top+t.bottom)/2+.5);else if(b(s)){const t=Object.keys(s)[0],e=s[t];g=p(this.chart.scales[t].getPixelForValue(e))}j=t.top,D=t.bottom,w=g+f,M=w+c}else if("y"===e){if("center"===s)g=p((t.left+t.right)/2);else if(b(s)){const t=Object.keys(s)[0],e=s[t];g=p(this.chart.scales[t].getPixelForValue(e))}_=g-f,O=_-c,k=t.left,S=t.right}const P=v(n.ticks.maxTicksLimit,l),E=Math.max(1,Math.ceil(l/P));for(m=0;me.value===t);return i>=0?e.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let a,s;const r=(t,e,n)=>{n.width&&n.color&&(i.save(),i.lineWidth=n.width,i.strokeStyle=n.color,i.setLineDash(n.borderDash||[]),i.lineDashOffset=n.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(a=0,s=n.length;a{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:i+1,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",n=[];let a,s;for(a=0,s=e.length;a{const n=i.split("."),a=n.pop(),s=[t].concat(n).join("."),r=e[i].split("."),o=r.pop(),l=r.join(".");Xt.route(s,a,l,o)})}(e,t.defaultRoutes),t.descriptors&&Xt.describe(e,t.descriptors)}(t,s,i),this.override&&Xt.override(t.id,t.overrides)),s}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,n=this.scope;i in e&&delete e[i],n&&i in Xt[n]&&(delete Xt[n][i],this.override&&delete Ht[i])}}var Wn=new class{constructor(){this.controllers=new Bn(Si,"datasets",!0),this.elements=new Bn(En,"elements"),this.plugins=new Bn(Object,"plugins"),this.scales=new Bn(Vn,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(e=>{const n=i||this._getRegistryForType(e);i||n.isForType(e)||n===this.plugins&&e.id?this._exec(t,n,e):O(e,e=>{const n=i||this._getRegistryForType(e);this._exec(t,n,e)})})}_exec(t,e,i){const n=A(t);w(i["before"+n],[],i),e[t](i),w(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;et.filter(t=>!e.some(e=>t.plugin.id===e.plugin.id));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}}function Un(t,e){return e||!1!==t?!0===t?{}:t:null}function Yn(t,e,i,n){const a=t.pluginScopeKeys(e),s=t.getOptionScopes(i,a);return t.createResolver(s,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function $n(t,e){const i=Xt.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function Xn(t,e){return"x"===t||"y"===t?t:e.axis||("top"===(i=e.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0)||t.charAt(0).toLowerCase();var i}function qn(t){const e=t.options||(t.options={});e.plugins=v(e.plugins,{}),e.scales=function(t,e){const i=Ht[t.type]||{scales:{}},n=e.scales||{},a=$n(t.type,e),s=Object.create(null),r=Object.create(null);return Object.keys(n).forEach(t=>{const e=n[t];if(!b(e))return console.error("Invalid scale configuration for scale: "+t);if(e._proxy)return console.warn("Ignoring resolver passed as options for scale: "+t);const o=Xn(t,e),l=function(t,e){return t===e?"_index_":"_value_"}(o,a),c=i.scales||{};s[o]=s[o]||t,r[t]=P(Object.create(null),[{axis:o},e,c[o],c[l]])}),t.data.datasets.forEach(i=>{const a=i.type||t.type,o=i.indexAxis||$n(a,e),l=(Ht[a]||{}).scales||{};Object.keys(l).forEach(t=>{const e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,o),a=i[e+"AxisID"]||s[e]||e;r[a]=r[a]||Object.create(null),P(r[a],[{axis:e},n[a],l[t]])})}),Object.keys(r).forEach(t=>{const e=r[t];P(e,[Xt.scales[e.type],Xt.scale])}),r}(t,e)}function Gn(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const Qn=new Map,Zn=new Set;function Kn(t,e){let i=Qn.get(t);return i||(i=e(),Qn.set(t,i),Zn.add(i)),i}const Jn=(t,e,i)=>{const n=T(e,i);void 0!==n&&t.add(n)};class ta{constructor(t){this._config=function(t){return(t=t||{}).data=Gn(t.data),qn(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Gn(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),qn(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Kn(t,()=>[["datasets."+t,""]])}datasetAnimationScopeKeys(t,e){return Kn(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,"transitions."+e],["datasets."+t,""]])}datasetElementScopeKeys(t,e){return Kn(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,"datasets."+t,"elements."+e,""]])}pluginScopeKeys(t){const e=t.id;return Kn(`${this.type}-plugin-${e}`,()=>[["plugins."+e,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let n=i.get(t);return n&&!e||(n=new Map,i.set(t,n)),n}getOptionScopes(t,e,i){const{options:n,type:a}=this,s=this._cachedScopes(t,i),r=s.get(e);if(r)return r;const o=new Set;e.forEach(e=>{t&&(o.add(t),e.forEach(e=>Jn(o,t,e))),e.forEach(t=>Jn(o,n,t)),e.forEach(t=>Jn(o,Ht[a]||{},t)),e.forEach(t=>Jn(o,Xt,t)),e.forEach(t=>Jn(o,Ut,t))});const l=Array.from(o);return 0===l.length&&l.push(Object.create(null)),Zn.has(e)&&s.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,Ht[e]||{},Xt.datasets[e]||{},{type:e},Xt,Ut]}resolveNamedOptions(t,e,i,n=[""]){const a={$shared:!0},{resolver:s,subPrefixes:r}=ea(this._resolverCache,t,n);let o=s;(function(t,e){const{isScriptable:i,isIndexable:n}=ke(t);for(const a of e){const e=i(a),s=n(a),r=(s||e)&&t[a];if(e&&(R(r)||ia(r))||s&&m(r))return!0}return!1})(s,e)&&(a.$shared=!1,o=Me(s,i=R(i)?i():i,this.createResolver(t,i,r)));for(const t of e)a[t]=o[t];return a}createResolver(t,e,i=[""],n){const{resolver:a}=ea(this._resolverCache,t,i);return b(e)?Me(a,e,void 0,n):a}}function ea(t,e,i){let n=t.get(e);n||(n=new Map,t.set(e,n));const a=i.join();let s=n.get(a);return s||(s={resolver:Oe(e,i),subPrefixes:i.filter(t=>!t.toLowerCase().includes("hover"))},n.set(a,s)),s}const ia=t=>b(t)&&Object.getOwnPropertyNames(t).reduce((e,i)=>e||R(t[i]),!1),na=["top","bottom","left","right","chartArea"];function aa(t,e){return"top"===t||"bottom"===t||-1===na.indexOf(t)&&"x"===e}function sa(t,e){return function(i,n){return i[t]===n[t]?i[e]-n[e]:i[t]-n[t]}}function ra(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),w(i&&i.onComplete,[t],e)}function oa(t){const e=t.chart,i=e.options.animation;w(i&&i.onProgress,[t],e)}function la(t){return We()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const ca={},ha=t=>{const e=la(t);return Object.values(ca).filter(t=>t.canvas===e).pop()};function da(t,e,i){const n=Object.keys(t);for(const a of n){const n=+a;if(n>=e){const s=t[a];delete t[a],(i>0||n>e)&&(t[n+i]=s)}}}class ua{constructor(t,e){const i=this.config=new ta(e),n=la(t),a=ha(n);if(a)throw new Error("Canvas is already in use. Chart with ID '"+a.id+"' must be destroyed before the canvas can be reused.");const s=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||function(t){return!We()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?pn:Pn}(n)),this.platform.updateConfig(i);const r=this.platform.acquireContext(n,s.aspectRatio),o=r&&r.canvas,l=o&&o.height,c=o&&o.width;this.id=p(),this.ctx=r,this.canvas=o,this.width=c,this.height=l,this._options=s,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Hn,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let i;return function(...n){return e?(clearTimeout(i),i=setTimeout(t,e,n)):t.apply(this,n),e}}(t=>this.update(t),s.resizeDelay||0),this._dataChanges=[],ca[this.id]=this,r&&o?(di.listen(this,"complete",ra),di.listen(this,"progress",oa),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:a}=this;return g(t)?e&&a?a:n?i/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Qe(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Zt(this.canvas,this.ctx),this}stop(){return di.stop(this),this}resize(t,e){di.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,n=this.canvas,a=i.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(n,t,e,a),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),o=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,Qe(this,r,!0)&&(this.notifyPlugins("resize",{size:s}),w(i.onResize,[this,s],this),this.attached&&this._doResize(o)&&this.render())}ensureScalesHaveIDs(){O(this.options.scales||{},(t,e)=>{t.id=e})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,n=Object.keys(i).reduce((t,e)=>(t[e]=!1,t),{});let a=[];e&&(a=a.concat(Object.keys(e).map(t=>{const i=e[t],n=Xn(t,i),a="r"===n,s="x"===n;return{options:i,dposition:a?"chartArea":s?"bottom":"left",dtype:a?"radialLinear":s?"category":"linear"}}))),O(a,e=>{const a=e.options,s=a.id,r=Xn(s,a),o=v(a.type,e.dtype);void 0!==a.position&&aa(a.position,r)===aa(e.dposition)||(a.position=e.dposition),n[s]=!0;let l=null;s in i&&i[s].type===o?l=i[s]:(l=new(Wn.getScale(o))({id:s,type:o,ctx:this.ctx,chart:this}),i[l.id]=l),l.init(a,t)}),O(n,(t,e)=>{t||delete i[e]}),O(i,t=>{un.configure(this,t,t.options),un.addBox(this,t)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((t,e)=>t.index-e.index),i>e){for(let t=e;te.length&&delete this._stacks,t.forEach((t,i)=>{0===e.filter(e=>e===t._dataset).length&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,n;for(this._removeUnreferencedMetasets(),i=0,n=e.length;i{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const a=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let t=0,e=this.data.datasets.length;t{t.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(sa("z","_idx"));const{_active:r,_lastEvent:o}=this;o?this._eventHandler(o,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){O(this.scales,t=>{un.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);N(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:n,count:a}of e)da(t,n,"_removeElements"===i?-a:a)}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter(t=>t[0]===e).map((t,e)=>e+","+t.splice(1).join(","))),n=i(0);for(let t=1;tt.split(",")).map(t=>({method:t[1],start:+t[2],count:+t[3]}))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;un.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],O(this.boxes,t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))},this),this._layers.forEach((t,e)=>{t._idx=e}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,n=!i.disabled,a=this.chartArea,s={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",s)&&(n&&te(e,{left:!1===i.left?0:a.left-i.left,right:!1===i.right?this.width:a.right+i.right,top:!1===i.top?0:a.top-i.top,bottom:!1===i.bottom?this.height:a.bottom+i.bottom}),t.controller.draw(),n&&ee(e),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}getElementsAtEventForMode(t,e,i,n){const a=Ji.modes[e];return"function"==typeof a?a(this,t,i,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let n=i.filter(t=>t&&t._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(n)),n}getContext(){return this.$context||(this.$context=me(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const n=i?"show":"hide",a=this.getDatasetMeta(t),s=a.controller._resolveAnimations(void 0,n);L(e)?(a.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),s.update(a,{visible:i}),this.update(e=>e.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),di.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,i,n),t[i]=n},n=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};O(this.options.events,t=>i(t,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,n)=>{e.addEventListener(this,i,n),t[i]=n},n=(i,n)=>{t[i]&&(e.removeEventListener(this,i,n),delete t[i])},a=(t,e)=>{this.canvas&&this.resize(t,e)};let s;const r=()=>{n("attach",r),this.attached=!0,this.resize(),i("resize",a),i("detach",s)};s=()=>{this.attached=!1,n("resize",a),this._stop(),this._resize(0,0),i("attach",r)},e.isAttached(this.canvas)?r():s()}unbindEvents(){O(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},O(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const n=i?"set":"remove";let a,s,r,o;for("dataset"===e&&(a=this.getDatasetMeta(t[0].datasetIndex),a.controller["_"+n+"DatasetHoverStyle"]()),r=0,o=t.length;r{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}});!M(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}_updateHoverStyles(t,e,i){const n=this.options.hover,a=(t,e)=>t.filter(t=>!e.some(e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)),s=a(e,t),r=i?t:a(t,e);s.length&&this.updateHoverStyle(s,n.mode,!1),r.length&&n.mode&&this.updateHoverStyle(r,n.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:Jt(t,this.chartArea,this._minPadding)},n=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,n))return;const a=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(a||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:n=[],options:a}=this,s=e,r=this._getActiveElements(t,n,i,s),o=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}(t),l=function(t,e,i,n){return i&&"mouseout"!==t.type?n?e:t:null}(t,this._lastEvent,i,o);i&&(this._lastEvent=null,w(a.onHover,[t,r,this],this),o&&w(a.onClick,[t,r,this],this));const c=!M(r,n);return(c||e)&&(this._active=r,this._updateHoverStyles(r,n,e)),this._lastEvent=l,c}_getActiveElements(t,e,i,n){if("mouseout"===t.type)return[];if(!i)return e;const a=this.options.hover;return this.getElementsAtEventForMode(t,a.mode,a,n)}}const fa=()=>O(ua.instances,t=>t._plugins.invalidate());function pa(t,e,i){const{startAngle:n,pixelMargin:a,x:s,y:r,outerRadius:o,innerRadius:l}=e;let c=a/o;t.beginPath(),t.arc(s,r,o,n-c,i+c),l>a?(c=a/l,t.arc(s,r,l,i+c,n-c,!0)):t.arc(s,r,a,i+W,n-W),t.closePath(),t.clip()}function ga(t,e,i,n){return{x:i+t*Math.cos(e),y:n+t*Math.sin(e)}}function ma(t,e,i,n,a){const{x:s,y:r,startAngle:o,pixelMargin:l,innerRadius:c}=e,h=Math.max(e.outerRadius+n+i-l,0),d=c>0?c+n+i+l:0;let u=0;const f=a-o;if(n){const t=((c>0?c-n:0)+(h>0?h-n:0))/2;u=(f-(0!==t?f*t/(t+n):f))/2}const p=(f-Math.max(.001,f*h-i/F)/h)/2,g=o+p+u,m=a-p-u,{outerStart:b,outerEnd:y,innerStart:x,innerEnd:v}=function(t,e,i,n){const a=he(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]),s=(i-e)/2,r=Math.min(s,n*e/2),o=t=>{const e=(i-Math.min(s,t))*n/2;return st(t,0,Math.min(s,e))};return{outerStart:o(a.outerStart),outerEnd:o(a.outerEnd),innerStart:st(a.innerStart,0,r),innerEnd:st(a.innerEnd,0,r)}}(e,d,h,m-g),_=h-b,w=h-y,O=g+b/_,M=m-y/w,k=d+x,j=d+v,S=g+x/k,D=m-v/j;if(t.beginPath(),t.arc(s,r,h,O,M),y>0){const e=ga(w,M,s,r);t.arc(e.x,e.y,y,M,m+W)}const P=ga(j,m,s,r);if(t.lineTo(P.x,P.y),v>0){const e=ga(j,D,s,r);t.arc(e.x,e.y,v,m+W,D+Math.PI)}if(t.arc(s,r,d,m-v/d,g+x/d,!0),x>0){const e=ga(k,S,s,r);t.arc(e.x,e.y,x,S+Math.PI,g-W)}const E=ga(_,g,s,r);if(t.lineTo(E.x,E.y),b>0){const e=ga(_,O,s,r);t.arc(e.x,e.y,b,g-W,O)}t.closePath()}Object.defineProperties(ua,{defaults:{enumerable:!0,value:Xt},instances:{enumerable:!0,value:ca},overrides:{enumerable:!0,value:Ht},registry:{enumerable:!0,value:Wn},version:{enumerable:!0,value:"3.7.1"},getChart:{enumerable:!0,value:ha},register:{enumerable:!0,value:(...t)=>{Wn.add(...t),fa()}},unregister:{enumerable:!0,value:(...t)=>{Wn.remove(...t),fa()}}});class ba extends En{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.getProps(["x","y"],i),{angle:a,distance:s}=tt(n,{x:t,y:e}),{startAngle:r,endAngle:o,innerRadius:l,outerRadius:c,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),d=this.options.spacing/2,u=v(h,o-r)>=I||at(a,r,o),f=rt(s,l+d,c+d);return u&&f}getCenterPoint(t){const{x:e,y:i,startAngle:n,endAngle:a,innerRadius:s,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:o,spacing:l}=this.options,c=(n+a)/2,h=(s+r+l+o)/2;return{x:e+Math.cos(c)*h,y:i+Math.sin(c)*h}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,n=(e.offset||0)/2,a=(e.spacing||0)/2;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>I?Math.floor(i/I):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();let s=0;if(n){s=n/2;const e=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(e)*s,Math.sin(e)*s),this.circumference>=F&&(s=n)}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;const r=function(t,e,i,n){const{fullCircles:a,startAngle:s,circumference:r}=e;let o=e.endAngle;if(a){ma(t,e,i,n,s+I);for(let e=0;eo&&s>o;return{count:n,start:l,loop:e.loop,ilen:c(r+(c?o-t:t))%s,x=()=>{f!==p&&(t.lineTo(m,p),t.lineTo(m,f),t.lineTo(m,g))};for(l&&(d=a[y(0)],t.moveTo(d.x,d.y)),h=0;h<=o;++h){if(d=a[y(h)],d.skip)continue;const e=d.x,i=d.y,n=0|e;n===u?(ip&&(p=i),m=(b*m+e)/++b):(x(),t.lineTo(e,i),u=n,b=0,f=p=i),g=i}x()}function Oa(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i?_a:wa}ba.id="arc",ba.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0},ba.defaultRoutes={backgroundColor:"backgroundColor"};const Ma="function"==typeof Path2D;class ka extends En{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const n=i.spanGaps?this._loop:this._fullLoop;Be(this._points,i,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(t,e){const i=t.points,n=t.options.spanGaps,a=i.length;if(!a)return[];const s=!!t._loop,{start:r,end:o}=function(t,e,i,n){let a=0,s=e-1;if(i&&!n)for(;aa&&t[s%e].skip;)s--;return s%=e,{start:a,end:s}}(i,a,s,n);return function(t,e,i,n){return n&&n.setContext&&i?function(t,e,i,n){const a=t._chart.getContext(),s=ci(t.options),{_datasetIndex:r,options:{spanGaps:o}}=t,l=i.length,c=[];let h=s,d=e[0].start,u=d;function f(t,e,n,a){const s=o?-1:1;if(t!==e){for(t+=l;i[t%l].skip;)t-=s;for(;i[e%l].skip;)e+=s;t%l!=e%l&&(c.push({start:t%l,end:e%l,loop:n,style:a}),h=a,d=e%l)}}for(const t of e){d=o?d:t.start;let e,s=i[d%l];for(u=d+1;u<=t.end;u++){const o=i[u%l];e=ci(n.setContext(me(a,{type:"segment",p0:s,p1:o,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:r}))),hi(e,h)&&f(d,u-1,t.loop,h),s=o,h=e}d"borderDash"!==t&&"fill"!==t};class Sa extends En{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.options,{x:a,y:s}=this.getProps(["x","y"],i);return Math.pow(t-a,2)+Math.pow(e-s,2)=i)&&a):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}Aa.id="bar",Aa.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0},Aa.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};class Ra{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:n,y:a,radius:s}=this;return e=e||{start:0,end:I},t.arc(n,a,s,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:n}=this,a=t.angle;return{x:e+Math.cos(a)*n,y:i+Math.sin(a)*n,angle:a}}}function Na(t,e,i){for(;e>t;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function Fa(t,e,i){const n=[];for(let a=0;a{e=Na(t,e,a);const r=a[t],o=a[e];null!==n?(s.push({x:r.x,y:n}),s.push({x:o.x,y:n})):null!==i&&(s.push({x:i,y:r.y}),s.push({x:i,y:o.y}))}),s}(t,e),i.length?new ka({points:i,options:{tension:0},_loop:n,_fullLoop:n}):null}function Ba(t,e,i){let n=t[e].fill;const a=[e];let s;if(!i)return n;for(;!1!==n&&-1===a.indexOf(n);){if(!y(n))return n;if(s=t[n],!s)return!1;if(s.visible)return n;a.push(n),n=s.fill}return!1}function Wa(t,e,i){const{segments:n,points:a}=e;let s=!0,r=!1;t.beginPath();for(const o of n){const{start:n,end:l}=o,c=a[n],h=a[Na(n,l,a)];s?(t.moveTo(c.x,c.y),s=!1):(t.lineTo(c.x,i),t.lineTo(c.x,c.y)),r=!!e.pathSegment(t,o,{move:r}),r?t.closePath():t.lineTo(h.x,i)}t.lineTo(e.first().x,i),t.closePath(),t.clip()}function Ha(t,e,i,n){if(n)return;let a=e[t],s=i[t];return"angle"===t&&(a=nt(a),s=nt(s)),{property:t,start:a,end:s}}function Ua(t,e,i,n){return t&&e?n(t[i],e[i]):t?t[i]:e?e[i]:0}function Ya(t,e,i){const{top:n,bottom:a}=e.chart.chartArea,{property:s,start:r,end:o}=i||{};"x"===s&&(t.beginPath(),t.rect(r,n,o-r,a-n),t.clip())}function $a(t,e,i,n){const a=e.interpolate(i,n);a&&t.lineTo(a.x,a.y)}function Xa(t,e){const{line:i,target:n,property:a,color:s,scale:r}=e,o=function(t,e,i){const n=t.segments,a=t.points,s=e.points,r=[];for(const t of n){let{start:n,end:o}=t;o=Na(n,o,a);const l=Ha(i,a[n],a[o],t.loop);if(!e.segments){r.push({source:t,target:l,start:a[n],end:a[o]});continue}const c=li(e,l);for(const e of c){const n=Ha(i,s[e.start],s[e.end],e.loop),o=oi(t,a,n);for(const t of o)r.push({source:t,target:e,start:{[i]:Ua(l,n,"start",Math.max)},end:{[i]:Ua(l,n,"end",Math.min)}})}}return r}(i,n,a);for(const{source:e,target:l,start:c,end:h}of o){const{style:{backgroundColor:o=s}={}}=e,d=!0!==n;t.save(),t.fillStyle=o,Ya(t,r,d&&Ha(a,c,h)),t.beginPath();const u=!!i.pathSegment(t,e);let f;if(d){u?t.closePath():$a(t,n,h,a);const e=!!n.pathSegment(t,l,{move:u,reverse:!0});f=u&&e,f||$a(t,n,c,a)}t.closePath(),t.fill(f?"evenodd":"nonzero"),t.restore()}}function qa(t,e,i){const n=za(e),{line:a,scale:s,axis:r}=e,o=a.options,l=o.fill,c=o.backgroundColor,{above:h=c,below:d=c}=l||{};n&&a.points.length&&(te(t,i),function(t,e){const{line:i,target:n,above:a,below:s,area:r,scale:o}=e,l=i._loop?"angle":e.axis;t.save(),"x"===l&&s!==a&&(Wa(t,n,r.top),Xa(t,{line:i,target:n,color:a,scale:o,property:l}),t.restore(),t.save(),Wa(t,n,r.bottom)),Xa(t,{line:i,target:n,color:s,scale:o,property:l}),t.restore()}(t,{line:a,target:n,above:h,below:d,area:i,scale:s,axis:r}),ee(t))}var Ga={id:"filler",afterDatasetsUpdate(t,e,i){const n=(t.data.datasets||[]).length,a=[];let s,r,o,l;for(r=0;r=0;--e){const i=a[e].$filler;i&&(i.line.updateControlPoints(s,i.axis),n&&qa(t.ctx,i,s))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const n=t.getSortedVisibleDatasetMetas();for(let e=n.length-1;e>=0;--e){const i=n[e].$filler;i&&qa(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){const n=e.meta.$filler;n&&!1!==n.fill&&"beforeDatasetDraw"===i.drawTime&&qa(t.ctx,n,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};new WeakMap;const Qa={average(t){if(!t.length)return!1;let e,i,n=0,a=0,s=0;for(e=0,i=t.length;e-1?t.split("\n"):t}function Ja(t,e){const{element:i,datasetIndex:n,index:a}=e,s=t.getDatasetMeta(n).controller,{label:r,value:o}=s.getLabelAndValue(a);return{chart:t,label:r,parsed:s.getParsed(a),raw:t.data.datasets[n].data[a],formattedValue:o,dataset:s.getDataset(),dataIndex:a,datasetIndex:n,element:i}}function ts(t,e){const i=t.chart.ctx,{body:n,footer:a,title:s}=t,{boxWidth:r,boxHeight:o}=e,l=pe(e.bodyFont),c=pe(e.titleFont),h=pe(e.footerFont),d=s.length,u=a.length,f=n.length,p=fe(e.padding);let g=p.height,m=0,b=n.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);b+=t.beforeBody.length+t.afterBody.length,d&&(g+=d*c.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),b&&(g+=f*(e.displayColors?Math.max(o,l.lineHeight):l.lineHeight)+(b-f)*l.lineHeight+(b-1)*e.bodySpacing),u&&(g+=e.footerMarginTop+u*h.lineHeight+(u-1)*e.footerSpacing);let y=0;const x=function(t){m=Math.max(m,i.measureText(t).width+y)};return i.save(),i.font=c.string,O(t.title,x),i.font=l.string,O(t.beforeBody.concat(t.afterBody),x),y=e.displayColors?r+2+e.boxPadding:0,O(n,t=>{O(t.before,x),O(t.lines,x),O(t.after,x)}),y=0,i.font=h.string,O(t.footer,x),i.restore(),m+=p.width,{width:m,height:g}}function es(t,e,i,n){const{x:a,width:s}=i,{width:r,chartArea:{left:o,right:l}}=t;let c="center";return"center"===n?c=a<=(o+l)/2?"left":"right":a<=s/2?c="left":a>=r-s/2&&(c="right"),function(t,e,i,n){const{x:a,width:s}=n,r=i.caretSize+i.caretPadding;return"left"===t&&a+s+r>e.width||"right"===t&&a-s-r<0||void 0}(c,t,e,i)&&(c="center"),c}function is(t,e,i){const n=i.yAlign||e.yAlign||function(t,e){const{y:i,height:n}=e;return it.height-n/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||es(t,e,i,n),yAlign:n}}function ns(t,e,i,n){const{caretSize:a,caretPadding:s,cornerRadius:r}=t,{xAlign:o,yAlign:l}=i,c=a+s,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=ue(r);let p=function(t,e){let{x:i,width:n}=t;return"right"===e?i-=n:"center"===e&&(i-=n/2),i}(e,o);const g=function(t,e,i){let{y:n,height:a}=t;return"top"===e?n+=i:n-="bottom"===e?a+i:a/2,n}(e,l,c);return"center"===l?"left"===o?p+=c:"right"===o&&(p-=c):"left"===o?p-=Math.max(h,u)+a:"right"===o&&(p+=Math.max(d,f)+a),{x:st(p,0,n.width-e.width),y:st(g,0,n.height-e.height)}}function as(t,e,i){const n=fe(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-n.right:t.x+n.left}function ss(t){return Za([],Ka(t))}function rs(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}class os extends En{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart||t._chart,this._chart=this.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),n=i.enabled&&e.options.animation&&i.animations,a=new gi(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(a)),a}getContext(){return this.$context||(this.$context=(this,me(this.chart.getContext(),{tooltip:this,tooltipItems:this._tooltipItems,type:"tooltip"})))}getTitle(t,e){const{callbacks:i}=e,n=i.beforeTitle.apply(this,[t]),a=i.title.apply(this,[t]),s=i.afterTitle.apply(this,[t]);let r=[];return r=Za(r,Ka(n)),r=Za(r,Ka(a)),r=Za(r,Ka(s)),r}getBeforeBody(t,e){return ss(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){const{callbacks:i}=e,n=[];return O(t,t=>{const e={before:[],lines:[],after:[]},a=rs(i,t);Za(e.before,Ka(a.beforeLabel.call(this,t))),Za(e.lines,a.label.call(this,t)),Za(e.after,Ka(a.afterLabel.call(this,t))),n.push(e)}),n}getAfterBody(t,e){return ss(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){const{callbacks:i}=e,n=i.beforeFooter.apply(this,[t]),a=i.footer.apply(this,[t]),s=i.afterFooter.apply(this,[t]);let r=[];return r=Za(r,Ka(n)),r=Za(r,Ka(a)),r=Za(r,Ka(s)),r}_createItems(t){const e=this._active,i=this.chart.data,n=[],a=[],s=[];let r,o,l=[];for(r=0,o=e.length;rt.filter(e,n,a,i))),t.itemSort&&(l=l.sort((e,n)=>t.itemSort(e,n,i))),O(l,e=>{const i=rs(t.callbacks,e);n.push(i.labelColor.call(this,e)),a.push(i.labelPointStyle.call(this,e)),s.push(i.labelTextColor.call(this,e))}),this.labelColors=n,this.labelPointStyles=a,this.labelTextColors=s,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),n=this._active;let a,s=[];if(n.length){const t=Qa[i.position].call(this,n,this._eventPosition);s=this._createItems(i),this.title=this.getTitle(s,i),this.beforeBody=this.getBeforeBody(s,i),this.body=this.getBody(s,i),this.afterBody=this.getAfterBody(s,i),this.footer=this.getFooter(s,i);const e=this._size=ts(this,i),r=Object.assign({},t,e),o=is(this.chart,i,r),l=ns(i,r,o,this.chart);this.xAlign=o.xAlign,this.yAlign=o.yAlign,a={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(a={opacity:0});this._tooltipItems=s,this.$context=void 0,a&&this._resolveAnimations().update(this,a),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,n){const a=this.getCaretPosition(t,i,n);e.lineTo(a.x1,a.y1),e.lineTo(a.x2,a.y2),e.lineTo(a.x3,a.y3)}getCaretPosition(t,e,i){const{xAlign:n,yAlign:a}=this,{caretSize:s,cornerRadius:r}=i,{topLeft:o,topRight:l,bottomLeft:c,bottomRight:h}=ue(r),{x:d,y:u}=t,{width:f,height:p}=e;let g,m,b,y,x,v;return"center"===a?(x=u+p/2,"left"===n?(g=d,m=g-s,y=x+s,v=x-s):(g=d+f,m=g+s,y=x-s,v=x+s),b=g):(m="left"===n?d+Math.max(o,c)+s:"right"===n?d+f-Math.max(l,h)-s:this.caretX,"top"===a?(y=u,x=y-s,g=m-s,b=m+s):(y=u+p,x=y+s,g=m+s,b=m-s),v=y),{x1:g,x2:m,x3:b,y1:y,y2:x,y3:v}}drawTitle(t,e,i){const n=this.title,a=n.length;let s,r,o;if(a){const l=ai(i.rtl,this.x,this.width);for(t.x=as(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",s=pe(i.titleFont),r=i.titleSpacing,e.fillStyle=i.titleColor,e.font=s.string,o=0;o0!==t)?(t.beginPath(),t.fillStyle=a.multiKeyBackground,re(t,{x:e,y:p,w:l,h:o,radius:r}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),re(t,{x:i,y:p+1,w:l-2,h:o-2,radius:r}),t.fill()):(t.fillStyle=a.multiKeyBackground,t.fillRect(e,p,l,o),t.strokeRect(e,p,l,o),t.fillStyle=s.backgroundColor,t.fillRect(i,p+1,l-2,o-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:n}=this,{bodySpacing:a,bodyAlign:s,displayColors:r,boxHeight:o,boxWidth:l,boxPadding:c}=i,h=pe(i.bodyFont);let d=h.lineHeight,u=0;const f=ai(i.rtl,this.x,this.width),p=function(i){e.fillText(i,f.x(t.x+u),t.y+d/2),t.y+=d+a},g=f.textAlign(s);let m,b,y,x,v,_,w;for(e.textAlign=s,e.textBaseline="middle",e.font=h.string,t.x=as(this,g,i),e.fillStyle=i.bodyColor,O(this.beforeBody,p),u=r&&"right"!==g?"center"===s?l/2+c:l+2+c:0,x=0,_=n.length;x<_;++x){for(m=n[x],b=this.labelTextColors[x],e.fillStyle=b,O(m.before,p),y=m.lines,r&&y.length&&(this._drawColorBox(e,t,x,f,i),d=Math.max(h.lineHeight,o)),v=0,w=y.length;v0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,n=i&&i.x,a=i&&i.y;if(n||a){const i=Qa[t.position].call(this,this._active,this._eventPosition);if(!i)return;const s=this._size=ts(this,t),r=Object.assign({},i,this._size),o=is(e,t,r),l=ns(t,r,o,e);n._to===l.x&&a._to===l.y||(this.xAlign=o.xAlign,this.yAlign=o.yAlign,this.width=s.width,this.height=s.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},a={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const s=fe(e.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&r&&(t.save(),t.globalAlpha=i,this.drawBackground(a,t,n,e),function(t,e){let i,n;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,n=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=n)}(t,e.textDirection),a.y+=s.top,this.drawTitle(a,t,e),this.drawBody(a,t,e),this.drawFooter(a,t,e),function(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,n=t.map(({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),a=!M(i,n),s=this._positionChanged(n,e);(a||s)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,a=this._active||[],s=this._getActiveElements(t,a,e,i),r=this._positionChanged(s,t),o=e||!M(s,a)||r;return o&&(this._active=s,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),o}_getActiveElements(t,e,i,n){const a=this.options;if("mouseout"===t.type)return[];if(!n)return e;const s=this.chart.getElementsAtEventForMode(t,a.mode,a,i);return a.reverse&&s.reverse(),s}_positionChanged(t,e){const{caretX:i,caretY:n,options:a}=this,s=Qa[a.position].call(this,t,e);return!1!==s&&(i!==s.x||n!==s.y)}}os.positioners=Qa;var ls={id:"tooltip",_element:os,positioners:Qa,afterInit(t,e,i){i&&(t.tooltip=new os({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip,i={tooltip:e};!1!==t.notifyPlugins("beforeTooltipDraw",i)&&(e&&e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i))},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:f,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,n=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(n>0&&e.dataIndex"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};class cs extends Vn{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:i,label:n}of e)t[i]===n&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(g(t))return null;const i=this.getLabels();return((t,e)=>null===t?null:st(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:function(t,e,i,n){const a=t.indexOf(e);return-1===a?((t,e,i,n)=>("string"==typeof e?(i=t.push(e)-1,n.unshift({index:i,label:e})):isNaN(e)&&(i=null),i))(t,e,i,n):a!==t.lastIndexOf(e)?i:a}(i,t,v(e,t),this._addedLabels),i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:n}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(n=this.getLabels().length-1)),this.min=i,this.max=n}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,n=[];let a=this.getLabels();a=0===t&&e===a.length-1?a:a.slice(t,e+1),this._valueRange=Math.max(a.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let i=t;i<=e;i++)n.push({value:i});return n}getLabelForValue(t){const e=this.getLabels();return t>=0&&te.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function hs(t,e,{horizontal:i,minRotation:n}){const a=Z(n),s=(i?Math.sin(a):Math.cos(a))||.001,r=.75*e*(""+t).length;return Math.min(e/s,r)}cs.id="category",cs.defaults={ticks:{callback:cs.prototype.getLabelForValue}};class ds extends Vn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return g(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:n,max:a}=this;const s=t=>n=e?n:t,r=t=>a=i?a:t;if(t){const t=$(n),e=$(a);t<0&&e<0?r(0):t>0&&e>0&&s(0)}if(n===a){let e=1;(a>=Number.MAX_SAFE_INTEGER||n<=Number.MIN_SAFE_INTEGER)&&(e=Math.abs(.05*a)),r(a+e),t||s(n-e)}this.min=n,this.max=a}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:n}=t;return n?(e=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const n=function(t,e){const i=[],{bounds:n,step:a,min:s,max:r,precision:o,count:l,maxTicks:c,maxDigits:h,includeBounds:d}=t,u=a||1,f=c-1,{min:p,max:m}=e,b=!g(s),y=!g(r),x=!g(l),v=(m-p)/(h+1);let _,w,O,M,k=X((m-p)/f/u)*u;if(k<1e-14&&!b&&!y)return[{value:p},{value:m}];M=Math.ceil(m/k)-Math.floor(p/k),M>f&&(k=X(M*k/f/u)*u),g(o)||(_=Math.pow(10,o),k=Math.ceil(k*_)/_),"ticks"===n?(w=Math.floor(p/k)*k,O=Math.ceil(m/k)*k):(w=p,O=m),b&&y&&a&&function(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}((r-s)/a,k/1e3)?(M=Math.round(Math.min((r-s)/k,c)),k=(r-s)/M,w=s,O=r):x?(w=b?s:w,O=y?r:O,M=l-1,k=(O-w)/M):(M=(O-w)/k,M=G(M,Math.round(M),k/1e3)?Math.round(M):Math.ceil(M));const j=Math.max(J(k),J(w));_=Math.pow(10,g(o)?j:o),w=Math.round(w*_)/_,O=Math.round(O*_)/_;let S=0;for(b&&(d&&w!==s?(i.push({value:s}),w0?i:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=y(t)?Math.max(0,t):null,this.max=y(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,n=this.max;const a=e=>i=t?i:e,s=t=>n=e?n:t,r=(t,e)=>Math.pow(10,Math.floor(Y(t))+e);i===n&&(i<=0?(a(1),s(10)):(a(r(i,-1)),s(r(n,1)))),i<=0&&a(r(n,-1)),n<=0&&s(r(i,1)),this._zero&&this.min!==this._suggestedMin&&i===r(this.min,0)&&a(r(i,-1)),this.min=i,this.max=n}buildTicks(){const t=this.options,e=function(t,e){const i=Math.floor(Y(e.max)),n=Math.ceil(e.max/Math.pow(10,i)),a=[];let s=x(t.min,Math.pow(10,Math.floor(Y(e.min)))),r=Math.floor(Y(s)),o=Math.floor(s/Math.pow(10,r)),l=r<0?Math.pow(10,Math.abs(r)):1;do{a.push({value:s,major:fs(s)}),++o,10===o&&(o=1,++r,l=r>=0?1:l),s=Math.round(o*Math.pow(10,r)*l)/l}while(ra?{start:e-i,end:e}:{start:e,end:e+i}}function bs(t,e,i,n,a){const s=Math.abs(Math.sin(i)),r=Math.abs(Math.cos(i));let o=0,l=0;n.starte.r&&(o=(n.end-e.r)/s,t.r=Math.max(t.r,e.r+o)),a.starte.b&&(l=(a.end-e.b)/r,t.b=Math.max(t.b,e.b+l))}function ys(t){return 0===t||180===t?"center":t<180?"left":"right"}function xs(t,e,i){return 90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e),t}function vs(t,e,i,n){const{ctx:a}=t;if(i)a.arc(t.xCenter,t.yCenter,e,0,I);else{let i=t.getPointPosition(0,e);a.moveTo(i.x,i.y);for(let s=1;s{const i=w(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""}).filter((t,e)=>this.chart.getDataVisibility(e))}fit(){const t=this.options;t.display&&t.pointLabels.display?function(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),n=[],a=[],s=t._pointLabels.length,r=t.options.pointLabels,o=r.centerPointLabels?F/s:0;for(let d=0;d=0&&t=0;a--){const e=n.setContext(t.getPointLabelContext(a)),s=pe(e.font),{x:r,y:o,textAlign:l,left:c,top:h,right:d,bottom:u}=t._pointLabelItems[a],{backdropColor:f}=e;if(!g(f)){const t=fe(e.backdropPadding);i.fillStyle=f,i.fillRect(c-t.left,h-t.top,d-c+t.width,u-h+t.height)}ae(i,t._pointLabels[a],r,o+s.lineHeight/2,s,{color:e.color,textAlign:l,textBaseline:"middle"})}}(this,a),n.display&&this.ticks.forEach((t,e)=>{0!==e&&(r=this.getDistanceFromCenterForValue(t.value),function(t,e,i,n){const a=t.ctx,s=e.circular,{color:r,lineWidth:o}=e;!s&&!n||!r||!o||i<0||(a.save(),a.strokeStyle=r,a.lineWidth=o,a.setLineDash(e.borderDash),a.lineDashOffset=e.borderDashOffset,a.beginPath(),vs(t,i,s,n),a.closePath(),a.stroke(),a.restore())}(this,n.setContext(this.getContext(e-1)),r,a))}),i.display){for(t.save(),s=a-1;s>=0;s--){const n=i.setContext(this.getPointLabelContext(s)),{color:a,lineWidth:l}=n;l&&a&&(t.lineWidth=l,t.strokeStyle=a,t.setLineDash(n.borderDash),t.lineDashOffset=n.borderDashOffset,r=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),o=this.getPointPosition(s,r),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(o.x,o.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const n=this.getIndexAngle(0);let a,s;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(n),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((n,r)=>{if(0===r&&!e.reverse)return;const o=i.setContext(this.getContext(r)),l=pe(o.font);if(a=this.getDistanceFromCenterForValue(this.ticks[r].value),o.showLabelBackdrop){t.font=l.string,s=t.measureText(n.label).width,t.fillStyle=o.backdropColor;const e=fe(o.backdropPadding);t.fillRect(-s/2-e.left,-a-l.size/2-e.top,s+e.width,l.size+e.height)}ae(t,n.label,0,-a,l,{color:o.color})}),t.restore()}drawTitle(){}}_s.id="radialLinear",_s.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Tn.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}},_s.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},_s.descriptors={angleLines:{_fallback:"grid"}};const ws={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Os=Object.keys(ws);function Ms(t,e){return t-e}function ks(t,e){if(g(e))return null;const i=t._adapter,{parser:n,round:a,isoWeekday:s}=t._parseOpts;let r=e;return"function"==typeof n&&(r=n(r)),y(r)||(r="string"==typeof n?i.parse(r,n):i.parse(r)),null===r?null:(a&&(r="week"!==a||!q(s)&&!0!==s?i.startOf(r,a):i.startOf(r,"isoWeek",s)),+r)}function js(t,e,i,n){const a=Os.length;for(let s=Os.indexOf(t);s=e?i[n]:i[a]]=!0}}else t[e]=!0}function Ds(t,e,i){const n=[],a={},s=e.length;let r,o;for(r=0;r=0&&(e[l].major=!0);return e}(t,n,a,i):n}class Ps extends Vn{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e){const i=t.time||(t.time={}),n=this._adapter=new $i._date(t.adapters.date);P(i.displayFormats,n.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:ks(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:n,max:a,minDefined:s,maxDefined:r}=this.getUserBounds();function o(t){s||isNaN(t.min)||(n=Math.min(n,t.min)),r||isNaN(t.max)||(a=Math.max(a,t.max))}s&&r||(o(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||o(this.getMinMax(!1))),n=y(n)&&!isNaN(n)?n:+e.startOf(Date.now(),i),a=y(a)&&!isNaN(a)?a:+e.endOf(Date.now(),i)+1,this.min=Math.min(n,a-1),this.max=Math.max(n+1,a)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,n="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const a=this.min,s=function(t,e,i){let n=0,a=t.length;for(;nn&&t[a-1]>i;)a--;return n>0||a=Os.indexOf(i);s--){const i=Os[s];if(ws[i].common&&t._adapter.diff(a,n,i)>=e-1)return i}return Os[i?Os.indexOf(i):0]}(this,s.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(let e=Os.indexOf(t)+1,i=Os.length;e1e5*r)throw new Error(e+" and "+i+" are too far apart with stepSize of "+r+" "+s);const f="data"===n.ticks.source&&this.getDataTimestamps();for(h=u,d=0;ht-e).map(t=>+t)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}_tickFormatFunction(t,e,i,n){const a=this.options,s=a.time.displayFormats,r=this._unit,o=this._majorUnit,l=r&&s[r],c=o&&s[o],h=i[e],d=o&&c&&h&&h.major,u=this._adapter.format(t,n||(d?c:l)),f=a.ticks.callback;return f?w(f,[u,e,i],this):u}generateTickLabels(t){let e,i,n;for(e=0,i=t.length;e0?r:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(t=0,e=n.length;t=t[o].pos&&e<=t[l].pos&&({lo:o,hi:l}=ye(t,"pos",e)),({pos:n,time:s}=t[o]),({pos:a,time:r}=t[l])):(e>=t[o].time&&e<=t[l].time&&({lo:o,hi:l}=ye(t,"time",e)),({time:n,pos:s}=t[o]),({time:a,pos:r}=t[l]));const c=a-n;return c?s+(r-s)*(e-n)/c:s}Ps.id="time",Ps.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};class Cs extends Ps{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Es(e,this.min),this._tableRange=Es(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,n=[],a=[];let s,r,o,l,c;for(s=0,r=t.length;s=e&&l<=i&&n.push(l);if(n.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(s=0,r=n.length;s2&&void 0!==arguments[2]?arguments[2]:"label";const n=[];t.datasets=e.map(e=>{const a=t.datasets.find(t=>t[i]===e[i]);return a&&e.data&&!n.includes(a)?(n.push(a),Object.assign(a,e),a):{...e}})}function Fs(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"label";const i={labels:[],datasets:[]};return Rs(i,t.labels),Ns(i,t.datasets,e),i}function Is(t,e){let{height:i=150,width:n=300,redraw:a=!1,datasetIdKey:s,type:r,data:o,options:l,plugins:c=[],fallbackContent:h,...d}=t;const u=Object(Ts.useRef)(null),f=Object(Ts.useRef)(),p=()=>{u.current&&(f.current=new ua(u.current,{type:r,data:Fs(o,s),options:l,plugins:c}),Ls(e,f.current))},g=()=>{Ls(e,null),f.current&&(f.current.destroy(),f.current=null)};return Object(Ts.useEffect)(()=>{var t,e;!a&&f.current&&l&&(t=f.current,e=l,t.options={...e})},[a,l]),Object(Ts.useEffect)(()=>{!a&&f.current&&Rs(f.current.config.data,o.labels)},[a,o.labels]),Object(Ts.useEffect)(()=>{!a&&f.current&&o.datasets&&Ns(f.current.config.data,o.datasets,s)},[a,o.datasets]),Object(Ts.useEffect)(()=>{f.current&&(a?(g(),setTimeout(p)):f.current.update())},[a,l,o.labels,o.datasets]),Object(Ts.useEffect)(()=>(p(),()=>g()),[]),As.a.createElement("canvas",Object.assign({ref:u,role:"img",height:i,width:n},d),h)}const zs=Object(Ts.forwardRef)(Is);var Vs=i(3),Bs=i(16),Ws=i(7),Hs=i(8),Us=i(4);function Ys(t,e){Object(Us.a)(2,arguments);var i=Object(Hs.a)(t),n=Object(Ws.a)(e);return isNaN(n)?new Date(NaN):n?(i.setDate(i.getDate()+n),i):i}function $s(t,e){Object(Us.a)(2,arguments);var i=Object(Ws.a)(e);return Ys(t,-i)}function Xs(t,e){Object(Us.a)(2,arguments);var i=Object(Hs.a)(t),n=Object(Ws.a)(e);if(isNaN(n))return new Date(NaN);if(!n)return i;var a=i.getDate(),s=new Date(i.getTime());s.setMonth(i.getMonth()+n+1,0);var r=s.getDate();return a>=r?s:(i.setFullYear(s.getFullYear(),s.getMonth(),a),i)}function qs(t,e){Object(Us.a)(2,arguments);var i=Object(Ws.a)(e);return Xs(t,-i)}function Gs(t){return(Gs="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 Qs(t,e){if(Object(Us.a)(2,arguments),!e||"object"!==Gs(e))return new Date(NaN);var i=e.years?Object(Ws.a)(e.years):0,n=e.months?Object(Ws.a)(e.months):0,a=e.weeks?Object(Ws.a)(e.weeks):0,s=e.days?Object(Ws.a)(e.days):0,r=e.hours?Object(Ws.a)(e.hours):0,o=e.minutes?Object(Ws.a)(e.minutes):0,l=e.seconds?Object(Ws.a)(e.seconds):0,c=qs(t,n+12*i),h=$s(c,s+7*a),d=o+60*r,u=l+60*d,f=1e3*u,p=new Date(h.getTime()-f);return p}function Zs(t){return(Zs="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 Ks(t,e){if(Object(Us.a)(2,arguments),!e||"object"!==Zs(e))return new Date(NaN);var i=e.years?Object(Ws.a)(e.years):0,n=e.months?Object(Ws.a)(e.months):0,a=e.weeks?Object(Ws.a)(e.weeks):0,s=e.days?Object(Ws.a)(e.days):0,r=e.hours?Object(Ws.a)(e.hours):0,o=e.minutes?Object(Ws.a)(e.minutes):0,l=e.seconds?Object(Ws.a)(e.seconds):0,c=Object(Hs.a)(t),h=n||i?Xs(c,n+12*i):c,d=s||a?Ys(h,s+7*a):h,u=o+60*r,f=l+60*u,p=1e3*f,g=new Date(d.getTime()+p);return g}function Js(t,e){var i;Object(Us.a)(1,arguments);var n=Object(Ws.a)(null!==(i=null==e?void 0:e.additionalDigits)&&void 0!==i?i:2);if(2!==n&&1!==n&&0!==n)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof t&&"[object String]"!==Object.prototype.toString.call(t))return new Date(NaN);var a,s=ar(t);if(s.date){var r=sr(s.date,n);a=rr(r.restDateString,r.year)}if(!a||isNaN(a.getTime()))return new Date(NaN);var o,l=a.getTime(),c=0;if(s.time&&(c=lr(s.time),isNaN(c)))return new Date(NaN);if(!s.timezone){var h=new Date(l+c),d=new Date(0);return d.setFullYear(h.getUTCFullYear(),h.getUTCMonth(),h.getUTCDate()),d.setHours(h.getUTCHours(),h.getUTCMinutes(),h.getUTCSeconds(),h.getUTCMilliseconds()),d}return o=hr(s.timezone),isNaN(o)?new Date(NaN):new Date(l+c+o)}Math.pow(10,8);var tr={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},er=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,ir=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,nr=/^([+-])(\d{2})(?::?(\d{2}))?$/;function ar(t){var e,i={},n=t.split(tr.dateTimeDelimiter);if(n.length>2)return i;if(/:/.test(n[0])?e=n[0]:(i.date=n[0],e=n[1],tr.timeZoneDelimiter.test(i.date)&&(i.date=t.split(tr.timeZoneDelimiter)[0],e=t.substr(i.date.length,t.length))),e){var a=tr.timezone.exec(e);a?(i.time=e.replace(a[1],""),i.timezone=a[1]):i.time=e}return i}function sr(t,e){var i=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),n=t.match(i);if(!n)return{year:NaN,restDateString:""};var a=n[1]?parseInt(n[1]):null,s=n[2]?parseInt(n[2]):null;return{year:null===s?a:100*s,restDateString:t.slice((n[1]||n[2]).length)}}function rr(t,e){if(null===e)return new Date(NaN);var i=t.match(er);if(!i)return new Date(NaN);var n=!!i[4],a=or(i[1]),s=or(i[2])-1,r=or(i[3]),o=or(i[4]),l=or(i[5])-1;if(n)return function(t,e,i){return e>=1&&e<=53&&i>=0&&i<=6}(0,o,l)?function(t,e,i){var n=new Date(0);n.setUTCFullYear(t,0,4);var a=7*(e-1)+i+1-(n.getUTCDay()||7);return n.setUTCDate(n.getUTCDate()+a),n}(e,o,l):new Date(NaN);var c=new Date(0);return function(t,e,i){return e>=0&&e<=11&&i>=1&&i<=(dr[e]||(ur(t)?29:28))}(e,s,r)&&function(t,e){return e>=1&&e<=(ur(t)?366:365)}(e,a)?(c.setUTCFullYear(e,s,Math.max(a,r)),c):new Date(NaN)}function or(t){return t?parseInt(t):1}function lr(t){var e=t.match(ir);if(!e)return NaN;var i=cr(e[1]),n=cr(e[2]),a=cr(e[3]);return function(t,e,i){return 24===t?0===e&&0===i:i>=0&&i<60&&e>=0&&e<60&&t>=0&&t<25}(i,n,a)?36e5*i+6e4*n+1e3*a:NaN}function cr(t){return t&&parseFloat(t.replace(",","."))||0}function hr(t){if("Z"===t)return 0;var e=t.match(nr);if(!e)return 0;var i="+"===e[1]?-1:1,n=parseInt(e[2]),a=e[3]&&parseInt(e[3])||0;return function(t,e){return e>=0&&e<=59}(0,a)?i*(36e5*n+6e4*a):NaN}var dr=[31,null,31,30,31,30,31,31,30,31,30,31];function ur(t){return t%400==0||t%4==0&&t%100!=0}var fr=i(76);function pr(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function gr(t){for(var e=1;e0,"is-negative":e<0});return Object(c.createElement)("div",{className:s},Object(c.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"simpay-admin-charts-badge__icon",width:"16",height:"16"},e>0?Object(c.createElement)("path",{d:"M16.004 9.414l-8.607 8.607-1.414-1.414L14.589 8H7.004V6h11v11h-2V9.414z"}):Object(c.createElement)("path",{d:"M14.59 16.004L5.982 7.397l1.414-1.414 8.607 8.606V7.004h2v11h-11v-2z"})),!n&&Object(c.createElement)("span",null,Math.abs(e),"%"))},Er="simpay-admin-charts-period-over-period__tooltip",Cr=function(t){var e=t.position,i=t.opacity,n=t.data,a=t.delta,s=t.deltaChangedString;if(!n.length)return null;var r=e.top,o=e.left,l=e.right,h=Dr()("simpay-admin-charts-badge",{"is-positive":a>0,"is-negative":a<0});return Object(c.createElement)("div",{className:Er,style:{top:r,left:o||"auto",right:l||"auto",opacity:i}},n.map((function(t,e){var i=t.label,n=t.value;return Object(c.createElement)("div",{className:"".concat(Er,"-data"),"data-dataset":e,key:i+Math.random()},Object(c.createElement)("strong",null,i)," ",Object(c.createElement)("em",null,Object(Bs.decodeEntities)(n)))})),0!==a&&Object(c.createElement)("div",{className:"".concat(Er,"-delta")},Object(c.createElement)("div",{className:h},Object(c.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"simpay-admin-charts-badge__icon"},a>0?Object(c.createElement)("path",{fillRule:"evenodd",d:"M5.22 14.78a.75.75 0 001.06 0l7.22-7.22v5.69a.75.75 0 001.5 0v-7.5a.75.75 0 00-.75-.75h-7.5a.75.75 0 000 1.5h5.69l-7.22 7.22a.75.75 0 000 1.06z",clipRule:"evenodd"}):Object(c.createElement)("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06l7.22 7.22H6.75a.75.75 0 000 1.5h7.5a.747.747 0 00.75-.75v-7.5a.75.75 0 00-1.5 0v5.69L6.28 5.22z"}))),Object(c.createElement)("span",null,s)))},Tr=function(t){var e=t.chart,i=function(t,e){var i=Object(c.useState)({marginTop:0,marginRight:0,marginBottom:0,marginLeft:0}),n=l()(i,2),a=n[0],s=a.marginTop,r=a.marginRight,o=a.marginBottom,h=a.marginLeft,d=n[1];return Object(c.useEffect)((function(){t.current&&d({marginTop:Math.floor(t.current.chartArea.top),marginRight:Math.floor(t.current.width-t.current.chartArea.right),marginBottom:Math.floor(t.current.chartArea.bottom),marginLeft:Math.floor(t.current.chartArea.left)})}),[t,e]),{marginTop:s,marginRight:r,marginBottom:o,marginLeft:h}}(t.chartRef,e),n=i.marginLeft,a=i.marginRight;return Object(c.createElement)("div",{style:{width:"100%",position:"relative",fontSize:"12px",display:"flex",justifyContent:"space-between",marginTop:"-2px"}},Object(c.createElement)("div",{style:{marginLeft:n,textAlign:"left"}},e.datasets[0].data[0].x),Object(c.createElement)("div",{style:{marginRight:a,textAlign:"right"}},e.datasets[0].data[e.datasets[0].data.length-1].x))};function Ar(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Lr(t){for(var e=1;e0}))}));return Object(c.createElement)("div",{className:"simpay-admin-charts-period-over-period",style:s},!M&&Object(c.createElement)("div",{className:"simpay-admin-charts-no-data",style:Lr(Lr({},s),{},{height:"calc(".concat(s.height," + 15px)")})},o),Object(c.createElement)(zs,{type:"line",ref:g,options:O,plugins:[vr,(_="rgb(".concat(f.primary_color.join(","),")"),{id:"YGridLineHover",afterDraw:function(t){var e;if(null!==(e=t.tooltip)&&void 0!==e&&null!==(e=e._active)&&void 0!==e&&e.length){var i=t.tooltip._active[0].element.x,n=t.scales.yAxis,a=t.ctx;a.save(),a.beginPath(),a.moveTo(i,n.top),a.lineTo(i,n.bottom),a.lineWidth=2,a.strokeStyle=_,a.stroke(),a.restore()}}})],data:{datasets:m}}),Object(c.createElement)(Tr,{chartRef:g,chart:f}),Object(c.createElement)(Cr,a()({},x,{deltaChangedString:h(x)})),Object(c.createElement)(Vs.Popover.Slot,null))}},function(t,e,i){var n;!function(){"use strict";var i={}.hasOwnProperty;function a(){for(var t=[],e=0;et.length)&&(e=t.length);for(var i=0,n=new Array(e);i=s.getTime()?i+1:e.getTime()>=l.getTime()?i:i-1}function f(t){Object(n.a)(1,arguments);var e=u(t),i=new Date(0);i.setUTCFullYear(e,0,4),i.setUTCHours(0,0,0,0);var a=d(i);return a}var p={};function g(){return p}function m(t,e){var i,a,s,o,c,h,d,u;Object(n.a)(1,arguments);var f=g(),p=Object(l.a)(null!==(i=null!==(a=null!==(s=null!==(o=null==e?void 0:e.weekStartsOn)&&void 0!==o?o:null==e||null===(c=e.locale)||void 0===c||null===(h=c.options)||void 0===h?void 0:h.weekStartsOn)&&void 0!==s?s:f.weekStartsOn)&&void 0!==a?a:null===(d=f.locale)||void 0===d||null===(u=d.options)||void 0===u?void 0:u.weekStartsOn)&&void 0!==i?i:0);if(!(p>=0&&p<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var m=Object(r.a)(t),b=m.getUTCDay(),y=(b=1&&y<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var x=new Date(0);x.setUTCFullYear(p+1,0,y),x.setUTCHours(0,0,0,0);var v=m(x,e),_=new Date(0);_.setUTCFullYear(p,0,y),_.setUTCHours(0,0,0,0);var w=m(_,e);return f.getTime()>=v.getTime()?p+1:f.getTime()>=w.getTime()?p:p-1}function y(t,e){var i,a,s,r,o,c,h,d;Object(n.a)(1,arguments);var u=g(),f=Object(l.a)(null!==(i=null!==(a=null!==(s=null!==(r=null==e?void 0:e.firstWeekContainsDate)&&void 0!==r?r:null==e||null===(o=e.locale)||void 0===o||null===(c=o.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==s?s:u.firstWeekContainsDate)&&void 0!==a?a:null===(h=u.locale)||void 0===h||null===(d=h.options)||void 0===d?void 0:d.firstWeekContainsDate)&&void 0!==i?i:1),p=b(t,e),y=new Date(0);y.setUTCFullYear(p,0,f),y.setUTCHours(0,0,0,0);var x=m(y,e);return x}function x(t,e){for(var i=t<0?"-":"",n=Math.abs(t).toString();n.length0?i:1-i;return x("yy"===e?n%100:n,e.length)},_=function(t,e){var i=t.getUTCMonth();return"M"===e?String(i+1):x(i+1,2)},w=function(t,e){return x(t.getUTCDate(),e.length)},O=function(t,e){return x(t.getUTCHours()%12||12,e.length)},M=function(t,e){return x(t.getUTCHours(),e.length)},k=function(t,e){return x(t.getUTCMinutes(),e.length)},j=function(t,e){return x(t.getUTCSeconds(),e.length)},S=function(t,e){var i=e.length,n=t.getUTCMilliseconds();return x(Math.floor(n*Math.pow(10,i-3)),e.length)};function D(t,e){var i=t>0?"-":"+",n=Math.abs(t),a=Math.floor(n/60),s=n%60;if(0===s)return i+String(a);var r=e||"";return i+String(a)+r+x(s,2)}function P(t,e){return t%60==0?(t>0?"-":"+")+x(Math.abs(t)/60,2):E(t,e)}function E(t,e){var i=e||"",n=t>0?"-":"+",a=Math.abs(t);return n+x(Math.floor(a/60),2)+i+x(a%60,2)}var C={G:function(t,e,i){var n=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return i.era(n,{width:"abbreviated"});case"GGGGG":return i.era(n,{width:"narrow"});case"GGGG":default:return i.era(n,{width:"wide"})}},y:function(t,e,i){if("yo"===e){var n=t.getUTCFullYear(),a=n>0?n:1-n;return i.ordinalNumber(a,{unit:"year"})}return v(t,e)},Y:function(t,e,i,n){var a=b(t,n),s=a>0?a:1-a;return"YY"===e?x(s%100,2):"Yo"===e?i.ordinalNumber(s,{unit:"year"}):x(s,e.length)},R:function(t,e){return x(u(t),e.length)},u:function(t,e){return x(t.getUTCFullYear(),e.length)},Q:function(t,e,i){var n=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return x(n,2);case"Qo":return i.ordinalNumber(n,{unit:"quarter"});case"QQQ":return i.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return i.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return i.quarter(n,{width:"wide",context:"formatting"})}},q:function(t,e,i){var n=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return x(n,2);case"qo":return i.ordinalNumber(n,{unit:"quarter"});case"qqq":return i.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return i.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return i.quarter(n,{width:"wide",context:"standalone"})}},M:function(t,e,i){var n=t.getUTCMonth();switch(e){case"M":case"MM":return _(t,e);case"Mo":return i.ordinalNumber(n+1,{unit:"month"});case"MMM":return i.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return i.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return i.month(n,{width:"wide",context:"formatting"})}},L:function(t,e,i){var n=t.getUTCMonth();switch(e){case"L":return String(n+1);case"LL":return x(n+1,2);case"Lo":return i.ordinalNumber(n+1,{unit:"month"});case"LLL":return i.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return i.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return i.month(n,{width:"wide",context:"standalone"})}},w:function(t,e,i,a){var s=function(t,e){Object(n.a)(1,arguments);var i=Object(r.a)(t),a=m(i,e).getTime()-y(i,e).getTime();return Math.round(a/6048e5)+1}(t,a);return"wo"===e?i.ordinalNumber(s,{unit:"week"}):x(s,e.length)},I:function(t,e,i){var a=function(t){Object(n.a)(1,arguments);var e=Object(r.a)(t),i=d(e).getTime()-f(e).getTime();return Math.round(i/6048e5)+1}(t);return"Io"===e?i.ordinalNumber(a,{unit:"week"}):x(a,e.length)},d:function(t,e,i){return"do"===e?i.ordinalNumber(t.getUTCDate(),{unit:"date"}):w(t,e)},D:function(t,e,i){var a=function(t){Object(n.a)(1,arguments);var e=Object(r.a)(t),i=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var a=e.getTime(),s=i-a;return Math.floor(s/864e5)+1}(t);return"Do"===e?i.ordinalNumber(a,{unit:"dayOfYear"}):x(a,e.length)},E:function(t,e,i){var n=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return i.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return i.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(n,{width:"short",context:"formatting"});case"EEEE":default:return i.day(n,{width:"wide",context:"formatting"})}},e:function(t,e,i,n){var a=t.getUTCDay(),s=(a-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return x(s,2);case"eo":return i.ordinalNumber(s,{unit:"day"});case"eee":return i.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return i.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(a,{width:"short",context:"formatting"});case"eeee":default:return i.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,i,n){var a=t.getUTCDay(),s=(a-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return x(s,e.length);case"co":return i.ordinalNumber(s,{unit:"day"});case"ccc":return i.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return i.day(a,{width:"narrow",context:"standalone"});case"cccccc":return i.day(a,{width:"short",context:"standalone"});case"cccc":default:return i.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,i){var n=t.getUTCDay(),a=0===n?7:n;switch(e){case"i":return String(a);case"ii":return x(a,e.length);case"io":return i.ordinalNumber(a,{unit:"day"});case"iii":return i.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return i.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return i.day(n,{width:"short",context:"formatting"});case"iiii":default:return i.day(n,{width:"wide",context:"formatting"})}},a:function(t,e,i){var n=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return i.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return i.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(t,e,i){var n,a=t.getUTCHours();switch(n=12===a?"noon":0===a?"midnight":a/12>=1?"pm":"am",e){case"b":case"bb":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return i.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return i.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(t,e,i){var n,a=t.getUTCHours();switch(n=a>=17?"evening":a>=12?"afternoon":a>=4?"morning":"night",e){case"B":case"BB":case"BBB":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return i.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return i.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(t,e,i){if("ho"===e){var n=t.getUTCHours()%12;return 0===n&&(n=12),i.ordinalNumber(n,{unit:"hour"})}return O(t,e)},H:function(t,e,i){return"Ho"===e?i.ordinalNumber(t.getUTCHours(),{unit:"hour"}):M(t,e)},K:function(t,e,i){var n=t.getUTCHours()%12;return"Ko"===e?i.ordinalNumber(n,{unit:"hour"}):x(n,e.length)},k:function(t,e,i){var n=t.getUTCHours();return 0===n&&(n=24),"ko"===e?i.ordinalNumber(n,{unit:"hour"}):x(n,e.length)},m:function(t,e,i){return"mo"===e?i.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):k(t,e)},s:function(t,e,i){return"so"===e?i.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):j(t,e)},S:function(t,e){return S(t,e)},X:function(t,e,i,n){var a=(n._originalDate||t).getTimezoneOffset();if(0===a)return"Z";switch(e){case"X":return P(a);case"XXXX":case"XX":return E(a);case"XXXXX":case"XXX":default:return E(a,":")}},x:function(t,e,i,n){var a=(n._originalDate||t).getTimezoneOffset();switch(e){case"x":return P(a);case"xxxx":case"xx":return E(a);case"xxxxx":case"xxx":default:return E(a,":")}},O:function(t,e,i,n){var a=(n._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+D(a,":");case"OOOO":default:return"GMT"+E(a,":")}},z:function(t,e,i,n){var a=(n._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+D(a,":");case"zzzz":default:return"GMT"+E(a,":")}},t:function(t,e,i,n){var a=n._originalDate||t;return x(Math.floor(a.getTime()/1e3),e.length)},T:function(t,e,i,n){return x((n._originalDate||t).getTime(),e.length)}},T=function(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},A=function(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},L={p:A,P:function(t,e){var i,n=t.match(/(P+)(p+)?/)||[],a=n[1],s=n[2];if(!s)return T(t,e);switch(a){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"})}return i.replace("{{date}}",T(a,e)).replace("{{time}}",A(s,e))}};function R(t){var e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}var N=["D","DD"],F=["YY","YYYY"];function I(t){return-1!==N.indexOf(t)}function z(t){return-1!==F.indexOf(t)}function V(t,e,i){if("YYYY"===t)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===t)throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===t)throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===t)throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var B={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function W(t){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.width?String(e.width):t.defaultWidth,n=t.formats[i]||t.formats[t.defaultWidth];return n}}var H={date:W({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:W({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:W({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},U={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function Y(t){return function(e,i){var n;if("formatting"===(null!=i&&i.context?String(i.context):"standalone")&&t.formattingValues){var a=t.defaultFormattingWidth||t.defaultWidth,s=null!=i&&i.width?String(i.width):a;n=t.formattingValues[s]||t.formattingValues[a]}else{var r=t.defaultWidth,o=null!=i&&i.width?String(i.width):t.defaultWidth;n=t.values[o]||t.values[r]}return n[t.argumentCallback?t.argumentCallback(e):e]}}function $(t){return function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.width,a=n&&t.matchPatterns[n]||t.matchPatterns[t.defaultMatchWidth],s=e.match(a);if(!s)return null;var r,o=s[0],l=n&&t.parsePatterns[n]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?q(l,(function(t){return t.test(o)})):X(l,(function(t){return t.test(o)}));r=t.valueCallback?t.valueCallback(c):c,r=i.valueCallback?i.valueCallback(r):r;var h=e.slice(o.length);return{value:r,rest:h}}}function X(t,e){for(var i in t)if(t.hasOwnProperty(i)&&e(t[i]))return i}function q(t,e){for(var i=0;i0?"in "+n:n+" ago":n},formatLong:H,formatRelative:function(t,e,i,n){return U[t]},localize:{ordinalNumber:function(t,e){var i=Number(t),n=i%100;if(n>20||n<10)switch(n%10){case 1:return i+"st";case 2:return i+"nd";case 3:return i+"rd"}return i+"th"},era:Y({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Y({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:Y({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:Y({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:Y({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(G={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(t){return parseInt(t,10)}},function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.match(G.matchPattern);if(!i)return null;var n=i[0],a=t.match(G.parsePattern);if(!a)return null;var s=G.valueCallback?G.valueCallback(a[0]):a[0];s=e.valueCallback?e.valueCallback(s):s;var r=t.slice(n.length);return{value:s,rest:r}}),era:$({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:$({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:$({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:$({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:$({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}},Z=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,K=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,J=/^'([^]*?)'?$/,tt=/''/g,et=/[a-zA-Z]/;function it(t,e,i){var a,s,c,d,u,f,p,m,b,y,x,v,_,w,O,M,k,j;Object(n.a)(2,arguments);var S=String(e),D=g(),P=null!==(a=null!==(s=null==i?void 0:i.locale)&&void 0!==s?s:D.locale)&&void 0!==a?a:Q,E=Object(l.a)(null!==(c=null!==(d=null!==(u=null!==(f=null==i?void 0:i.firstWeekContainsDate)&&void 0!==f?f:null==i||null===(p=i.locale)||void 0===p||null===(m=p.options)||void 0===m?void 0:m.firstWeekContainsDate)&&void 0!==u?u:D.firstWeekContainsDate)&&void 0!==d?d:null===(b=D.locale)||void 0===b||null===(y=b.options)||void 0===y?void 0:y.firstWeekContainsDate)&&void 0!==c?c:1);if(!(E>=1&&E<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var T=Object(l.a)(null!==(x=null!==(v=null!==(_=null!==(w=null==i?void 0:i.weekStartsOn)&&void 0!==w?w:null==i||null===(O=i.locale)||void 0===O||null===(M=O.options)||void 0===M?void 0:M.weekStartsOn)&&void 0!==_?_:D.weekStartsOn)&&void 0!==v?v:null===(k=D.locale)||void 0===k||null===(j=k.options)||void 0===j?void 0:j.weekStartsOn)&&void 0!==x?x:0);if(!(T>=0&&T<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!P.localize)throw new RangeError("locale must contain localize property");if(!P.formatLong)throw new RangeError("locale must contain formatLong property");var A=Object(r.a)(t);if(!o(A))throw new RangeError("Invalid time value");var N=R(A),F=h(A,N),B={firstWeekContainsDate:E,weekStartsOn:T,locale:P,_originalDate:A},W=S.match(K).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,L[e])(t,P.formatLong):t})).join("").match(Z).map((function(n){if("''"===n)return"'";var a=n[0];if("'"===a)return nt(n);var s=C[a];if(s)return null!=i&&i.useAdditionalWeekYearTokens||!z(n)||V(n,e,String(t)),null!=i&&i.useAdditionalDayOfYearTokens||!I(n)||V(n,e,String(t)),s(F,n,P.localize,B);if(a.match(et))throw new RangeError("Format string contains an unescaped latin alphabet character `"+a+"`");return n})).join("");return W}function nt(t){var e=t.match(J);return e?e[1].replace(tt,"'"):t}},function(t,e,i){"use strict";i.r(e);var n=i(0),a=(i(37),i(3)),s=i(6),r=i.n(s),o=i(2),l=i(9),c=Object(n.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(l.Path,{fillRule:"evenodd",d:"M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z",clipRule:"evenodd"})),h=i(10),d=i(13),u=simpayAdminPageActivityReports,f=u.user_id,p=u.currencies,g=u.default_currency,m=i(15),b=i.n(m),y=i(16),x=i(11),v=i.n(x),_=i(24),w=i.n(_);function O(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function M(t){for(var e=1;e0&&Object(n.createElement)(n.Fragment,null,Object(n.createElement)(a.CardDivider,null),Object(n.createElement)("h3",{className:"".concat("simpay-activity-reports-card-today","-today-misc-title")},Object(o.__)("Top Forms","stripe")),Object(n.createElement)("div",{className:"".concat("simpay-activity-reports-card-today","-forms")},s.map((function(t){return Object(n.createElement)(D,b()({key:t.id},t))})))),r&&Object(n.createElement)("div",{className:"".concat("simpay-activity-reports-card-today","-tip")},Object(n.createElement)("strong",null,Object(n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{d:"M11.7 2.805a.75.75 0 01.6 0A60.65 60.65 0 0122.83 8.72a.75.75 0 01-.231 1.337 49.949 49.949 0 00-9.902 3.912l-.003.002-.34.18a.75.75 0 01-.707 0A50.009 50.009 0 007.5 12.174v-.224c0-.131.067-.248.172-.311a54.614 54.614 0 014.653-2.52.75.75 0 00-.65-1.352 56.129 56.129 0 00-4.78 2.589 1.858 1.858 0 00-.859 1.228 49.803 49.803 0 00-4.634-1.527.75.75 0 01-.231-1.337A60.653 60.653 0 0111.7 2.805z"}),Object(n.createElement)("path",{d:"M13.06 15.473a48.45 48.45 0 017.666-3.282c.134 1.414.22 2.843.255 4.285a.75.75 0 01-.46.71 47.878 47.878 0 00-8.105 4.342.75.75 0 01-.832 0 47.877 47.877 0 00-8.104-4.342.75.75 0 01-.461-.71c.035-1.442.121-2.87.255-4.286A48.4 48.4 0 016 13.18v1.27a1.5 1.5 0 00-.14 2.508c-.09.38-.222.753-.397 1.11.452.213.901.434 1.346.661a6.729 6.729 0 00.551-1.608 1.5 1.5 0 00.14-2.67v-.645a48.549 48.549 0 013.44 1.668 2.25 2.25 0 002.12 0z"}),Object(n.createElement)("path",{d:"M4.462 19.462c.42-.419.753-.89 1-1.394.453.213.902.434 1.347.661a6.743 6.743 0 01-1.286 1.794.75.75 0 11-1.06-1.06z"})),r.title),Object(n.createElement)("p",null,r.text," ",Object(n.createElement)("a",{href:Object(y.decodeEntities)(r.href),target:"_blank",rel:"noreferrer"},Object(o.__)("Learn More →","stripe")))))))},C=function(t){var e=t.currency;return Object(n.createElement)("div",{className:"simpay-admin-charts-no-data",style:{width:"100%",height:"100%"}},Object(n.createElement)("div",null,Object(n.createElement)("strong",null,Object(o.sprintf)(/* translators: %s Currency code. */ +Object(o.__)("No %s transactions found.","stripe"),e.toUpperCase())),Object(n.createElement)("div",null,Object(o.__)("Please select a different currency or check back later.","stripe"))))},T=i(14),A=i.n(T),L=function(t){var e=t.currency,i=t.amount_total_formatted,s=t.status,r=t.status_formatted,l=t.email,c=t.payment_method_type_icon,h=t.date_created_human_time_diff,d=t.links,u=d.customer,f=d.payment,p="simpay-activity-reports-card-latest-payment",g=A()("simpay-activity-reports-badge",{"is-succeeded":"succeeded"===s,"is-failed":"failed"===s}),m=function(){return"refunded"===s&&t.amount_refunded!==t.amount_total};return Object(n.createElement)("tr",{className:p},Object(n.createElement)("td",{className:"".concat(p,"__amount")},Object(y.decodeEntities)(i)," ",Object(n.createElement)("small",{style:{fontWeight:"normal"}},e.toUpperCase())),Object(n.createElement)("td",{className:"".concat(p,"__type")},""!==c&&Object(n.createElement)("span",{dangerouslySetInnerHTML:{__html:c}})),Object(n.createElement)("td",{className:"".concat(p,"__status")},Object(n.createElement)(a.Tooltip,{text:function(){if(m()&&"refunded"===s)return Object(o.sprintf)(Object(o.__)("%s refund was initiated","stripe"),Object(y.decodeEntities)(t.amount_refunded_formatted))}()},Object(n.createElement)("div",{className:g},Object(n.createElement)("span",null,r),Object(n.createElement)("svg",{"aria-hidden":"true",className:"simpay-activity-reports-badge__icon",height:"12",width:"12",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",style:{marginLeft:"4px"}},"succeeded"===s?Object(n.createElement)("path",{d:"M5.297 13.213.293 8.255c-.39-.394-.39-1.033 0-1.426s1.024-.394 1.414 0l4.294 4.224 8.288-8.258c.39-.393 1.024-.393 1.414 0s.39 1.033 0 1.426L6.7 13.208a.994.994 0 0 1-1.402.005z",fillRule:"evenodd"}):"refunded"===s&&m()?Object(n.createElement)(n.Fragment,null,Object(n.createElement)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11 2.5H5A2.5 2.5 0 0 0 2.5 5v6A2.5 2.5 0 0 0 5 13.5h6a2.5 2.5 0 0 0 2.5-2.5V5A2.5 2.5 0 0 0 11 2.5ZM5 1a4 4 0 0 0-4 4v6a4 4 0 0 0 4 4h6a4 4 0 0 0 4-4V5a4 4 0 0 0-4-4H5Z"}),Object(n.createElement)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M6.25 8A.75.75 0 0 1 7 7.25h1.25A.75.75 0 0 1 9 8v3.5a.75.75 0 0 1-1.5 0V8.75H7A.75.75 0 0 1 6.25 8Z"}),Object(n.createElement)("path",{d:"M6.75 5a1.25 1.25 0 1 1 2.5 0 1.25 1.25 0 0 1-2.5 0Z"})):"refunded"!==s||m()?Object(n.createElement)("path",{d:"m8 6.585 4.593-4.592a1 1 0 0 1 1.415 1.416L9.417 8l4.591 4.591a1 1 0 0 1-1.415 1.416L8 9.415l-4.592 4.592a1 1 0 0 1-1.416-1.416L6.584 8l-4.59-4.591a1 1 0 1 1 1.415-1.416z",fillRule:"evenodd"}):Object(n.createElement)(n.Fragment,null,Object(n.createElement)("path",{d:"M5.994 2.38a.875.875 0 1 0-1.238-1.238l-4.25 4.25A.849.849 0 0 0 .25 6c0 .232.093.466.257.63l4.25 4.24a.875.875 0 1 0 1.236-1.24L3.238 6.875h7.387C12.492 6.875 14 8.271 14 10c0 1.797-1.578 3.375-3.375 3.375a.875.875 0 0 0 0 1.75c2.763 0 5.125-2.362 5.125-5.125 0-2.83-2.43-4.872-5.12-4.875H3.24l2.754-2.746Z",fillRule:"evenodd"})))))),Object(n.createElement)("td",{className:"".concat(p,"__email")},Object(n.createElement)(a.Tooltip,{text:Object(o.__)("View customer records","stripe")},Object(n.createElement)("a",{href:u,target:"_blank",rel:"noreferrer noopener"},l))),Object(n.createElement)("td",{className:"".concat(p,"__date")},Object(n.createElement)(a.Tooltip,{text:Object(o.__)("View payment record","stripe")},Object(n.createElement)("a",{href:f,target:"_blank",rel:"noreferrer noopener"},h))))},R=simpayAdminPageActivityReports,N=R.default_currency,F=R.links.all_payments,I=function(){var t=j("/wpsp/__internal__/report/latest-payments",{currency:N},[]),e=t.data.payments;return Object(n.createElement)(a.Card,{elevation:2,className:"simpay-activity-reports-card-latest"},Object(n.createElement)(a.CardHeader,null,Object(n.createElement)("h2",{className:"simpay-activity-reports-card-title"},Object(o.__)("Latest Payments","stripe")),Object(n.createElement)(a.Button,{className:"simpay-activity-reports-card-title-link",href:F,variant:"link",isSmall:!0,target:"_blank"},Object(o.__)("View More →","stripe"))),Object(n.createElement)(a.CardBody,null,t.isLoading&&Object(n.createElement)(a.Spinner,null),!t.isLoading&&e.length>0&&Object(n.createElement)("table",{className:"".concat("simpay-activity-reports-card-latest","-payments")},Object(n.createElement)("tbody",null,e.map((function(t){return Object(n.createElement)(L,b()({key:t.id},t))})))),!t.isLoading&&0===e.length&&Object(n.createElement)(C,{currency:N})))},z=i(8),V=i(4);function B(t,e){Object(V.a)(2,arguments);var i=Object(z.a)(t),n=Object(z.a)(e),a=i.getFullYear()-n.getFullYear(),s=i.getMonth()-n.getMonth();return 12*a+s}function W(t,e){Object(V.a)(2,arguments);var i=Object(z.a)(t),n=Object(z.a)(e),a=i.getTime()-n.getTime();return a<0?-1:a>0?1:a}function H(t){Object(V.a)(1,arguments);var e=Object(z.a)(t);return e.setHours(23,59,59,999),e}function U(t){Object(V.a)(1,arguments);var e=Object(z.a)(t),i=e.getMonth();return e.setFullYear(e.getFullYear(),i+1,0),e.setHours(23,59,59,999),e}function Y(t){Object(V.a)(1,arguments);var e=Object(z.a)(t);return H(e).getTime()===U(e).getTime()}var $=i(76),X=i(33);function q(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function G(t){for(var e=1;e27&&n.setDate(30),n.setMonth(n.getMonth()-s*r);var o=W(n,a)===-s;Y(Object(z.a)(t))&&1===r&&1===W(t,a)&&(o=!1),i=s*(r-Number(o))}return 0===i?0:i}(new Date(s.end),new Date(s.start))>12?(e=Object(X.dateI18n)("F Y",s.start),i=Object(X.dateI18n)("F Y",s.end)):"today"===s.type?(e=Object(X.dateI18n)(l.formats.date,Z),i=e):(e=Object(X.dateI18n)(l.formats.date,s.start),i=Object(X.dateI18n)(l.formats.date,s.end)),Object(n.createElement)("div",{className:"simpay-activity-reports-card-reports-date-range"},Object(n.createElement)(a.SelectControl,{label:Object(o.__)("Report range","stripe"),value:s.type,options:"custom"===s.type?[].concat(c,[{label:Object(o.__)("Custom","stripe"),value:"custom"}]):c,onChange:function(t){r(G(G({},s),{},{type:t,start:Object(d.d)(t,Z),end:Object(d.c)(t,s.end)}))},hideLabelFromVision:!0}),Object(n.createElement)(a.Dropdown,{position:"bottom center",popoverProps:{noArrow:!1},renderToggle:function(t){var i=t.isOpen,s=t.onToggle;return Object(n.createElement)(a.Button,{variant:"tertiary",onClick:s,"aria-expanded":i},e)},renderContent:function(t){var e=t.onToggle;return Object(n.createElement)(a.DatePicker,{currentDate:new Date(s.start),onChange:function(t){r(G(G({},s),{},{start:Object($.a)(new Date(t),"yyyy-MM-dd 00:00:00"),type:"custom"})),e()},startOfWeek:l.l10n.startOfWeek,isInvalidDate:function(t){return t>new Date(s.end)}})}}),Object(n.createElement)("span",{style:{color:"#ccc"}},"–"),Object(n.createElement)(a.Dropdown,{position:"bottom center",popoverProps:{noArrow:!1},renderToggle:function(t){var e=t.isOpen,s=t.onToggle;return Object(n.createElement)(a.Button,{variant:"tertiary",onClick:s,"aria-expanded":e},i)},renderContent:function(t){var e=t.onToggle;return Object(n.createElement)(a.DatePicker,{currentDate:new Date(s.end),onChange:function(t){r(G(G({},s),{},{end:Object($.a)(new Date(t),"yyyy-MM-dd 23:59:59"),type:"custom"})),e()},startOfWeek:l.l10n.startOfWeek,isInvalidDate:function(t){return tnew Date}})}}))},J="simpay-activity-reports-data-bar",tt=function(t){var e=t.isLoading,i=t.label,s=t.data;return Object(n.createElement)("div",{className:J},Object(n.createElement)("div",{className:"".concat(J,"__header")},Object(n.createElement)("h3",{className:"".concat(J,"__label")},i),!e&&Object(n.createElement)("div",{className:"".concat(J,"__legend")},s.map((function(t){var e=t.label,i=t.color;return Object(n.createElement)("div",{key:e,className:"".concat(J,"__legend-item"),style:{color:i}},Object(n.createElement)("span",null,e))})))),Object(n.createElement)("div",{className:"".concat(J,"__bar")},!e&&s.length>0&&s.map((function(t){return Object(n.createElement)(a.Button,{key:t.label,label:"".concat(t.label,": ").concat(t.value,"%"),showTooltip:!0,className:"".concat(J,"__bar-item"),style:{backgroundColor:t.color,flexBasis:"".concat(t.value,"%"),flexGrow:1}},Object(n.createElement)("div",{className:"screen-reader-text"},t.label))})),!e&&0===s.length&&Object(n.createElement)("div",{className:"".concat(J,"__bar-item-none")},Object(o.__)("n/a","stripe"))))},et=function(t){var e=t.currency,i=t.range,a=j("/wpsp/__internal__/report/payment-info",{range:i,currency:e},[i]),s=a.data,r=s.payment_method_types,l=s.payment_statuses;return Object(n.createElement)("div",{className:"".concat("simpay-activity-reports-card-reports","-payment-breakdown")},Object(n.createElement)(tt,{label:Object(o.__)("Payment Methods","stripe"),data:r,isLoading:a.isLoading}),Object(n.createElement)(tt,{label:Object(o.__)("Payments","stripe"),data:l,isLoading:a.isLoading}))},it=function(t){var e=t.currency,i=t.range,a=j("/wpsp/__internal__/report/gross-volume-period-over-period",{range:i,currency:e},[i]),s=a.data,r=s.delta,l=s.total_formatted;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)("div",{className:"".concat("simpay-activity-reports-card-reports","-report-title")},Object(n.createElement)("h3",null,Object(o.__)("Gross Volume","stripe"),!a.isLoading&&Object(n.createElement)(n.Fragment,null,": ",Object(n.createElement)("em",null,Object(y.decodeEntities)(l)))),!a.isLoading&&Object(n.createElement)(d.a,{delta:r})),Object(n.createElement)(d.b,{report:a,style:{width:"100%",height:"300px"},config:{yAxisIsCurrency:!0},noData:Object(n.createElement)("div",null,Object(n.createElement)("strong",null,Object(o.sprintf)(/* translators: %s Currency code. */ Object(o.__)("No %s transactions found.","stripe"),e.toUpperCase())),Object(n.createElement)("div",null,Object(o.__)("Please select a different currency, date range, or check back later.","stripe"))),deltaChangedString:function(t){return Object(n.createInterpolateElement)(Object(o.sprintf)(/* translators: %s: delta percentage */ Object(o.__)("%1$s%% vs. previous period","stripe"),Math.abs(t.delta)),{delta:Object(n.createElement)("strong",{className:t.delta>0?"is-positive":"is-negative"})})}}))},nt=simpayAdminPageActivityReports.default_currency,at=function(t){var e=t.range,i=j("/wpsp/__internal__/report/successful-payments-period-over-period",{range:e,currency:nt},[e]),a=i.data,s=a.delta,r=a.total_formatted;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)("div",{className:"".concat("simpay-activity-reports-card-reports","-report-title")},Object(n.createElement)("h3",null,Object(o.__)("Successful Payments","stripe"),!i.isLoading&&Object(n.createElement)(n.Fragment,null,": ",Object(n.createElement)("em",null,r))),!i.isLoading&&Object(n.createElement)(d.a,{delta:s})),Object(n.createElement)(d.b,{report:i,style:{width:"100%",height:"300px"},config:{yAxisIsCurrency:!1},noData:Object(n.createElement)("div",null,Object(n.createElement)("strong",null,Object(o.sprintf)(/* translators: %s Currency code. */ Object(o.__)("No %s transactions found.","stripe"),nt.toUpperCase())),Object(n.createElement)("div",null,Object(o.__)("Please select a different currency, date range, or check back later.","stripe"))),deltaChangedString:function(t){return Object(n.createInterpolateElement)(Object(o.sprintf)(/* translators: %s: delta percentage */ -Object(o.__)("%1$s%% vs. previous period","stripe"),Math.abs(t.delta)),{delta:Object(n.createElement)("strong",{className:t.delta>0?"is-positive":"is-negative"})})}}))},st=simpayAdminPageActivityReports,rt=st.user_id,ot=st.default_range,lt=ot.start,ct=ot.end,ht=ot.type,dt=st.default_currency,ut=function(){var t=Object(d.e)(rt,"simpay_activity_reports_range",{start:Object(d.d)(ht,lt),end:Object(d.c)(ht,ct),type:ht}),e=r()(t,2),i=e[0],s=e[1];return Object(n.createElement)(a.Card,{elevation:2,className:"simpay-activity-reports-card-reports"},Object(n.createElement)(a.CardHeader,{className:"".concat("simpay-activity-reports-card-reports","-header")},Object(n.createElement)("h2",{className:"simpay-activity-reports-card-title"},Object(o.__)("Reports","stripe")),Object(n.createElement)(Z,{range:i,setRange:s})),Object(n.createElement)(a.CardBody,null,Object(n.createElement)(et,{range:i,currency:dt}),Object(n.createElement)(a.CardDivider,null),Object(n.createElement)(it,{range:i,currency:dt}),Object(n.createElement)(a.CardDivider,null),Object(n.createElement)(at,{range:i,currency:dt})))};Object(n.render)(Object(n.createElement)((function(){var t=Object(d.e)(f,"simpay_activity_reports_currency",g),e=r()(t,3),i=e[0],s=e[1],l=e[2];function u(){var t=Object(h.addQueryArgs)(window.location.href,{currency:i});window.location.href=t}return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(a.Dropdown,{position:"bottom center",popoverProps:{noArrow:!1},renderToggle:function(t){var e=t.isOpen,i=t.onToggle;return Object(n.createElement)(a.Button,{variant:"secondary",onClick:i,"aria-expanded":e,icon:c,tooltip:Object(o.__)("Settings","stripe")})},renderContent:function(){return Object(n.createElement)("div",{style:{width:"200px",padding:"8px"}},Object(n.createElement)(a.SelectControl,{label:Object(o.__)("Currency","stripe"),value:i,onChange:s,options:p.map((function(t){return{label:t,value:t.toLowerCase()}})),help:Object(o.__)("Activity with the selected currency and global payment mode will be shown.","stripe")}),Object(n.createElement)(a.Button,{type:"submit",variant:"primary",onClick:u,isBusy:l,disabled:l},Object(o.__)("Update","stripe")))}}),Object(n.createElement)(a.Popover.Slot,null))}),null),document.getElementById("simpay-admin-page-activity-reports-config")),Object(n.render)(Object(n.createElement)((function(){return Object(n.createElement)("div",{className:"simpay-activity-reports"},Object(n.createElement)(E,null),Object(n.createElement)(I,null),Object(n.createElement)(ut,null),Object(n.createElement)(a.Popover.Slot,null))}),null),document.getElementById("simpay-admin-page-activity-reports"))}]); \ No newline at end of file +Object(o.__)("%1$s%% vs. previous period","stripe"),Math.abs(t.delta)),{delta:Object(n.createElement)("strong",{className:t.delta>0?"is-positive":"is-negative"})})}}))},st=simpayAdminPageActivityReports,rt=st.user_id,ot=st.default_range,lt=ot.start,ct=ot.end,ht=ot.type,dt=st.default_currency,ut=function(){var t=Object(d.e)(rt,"simpay_activity_reports_range",{start:Object(d.d)(ht,lt),end:Object(d.c)(ht,ct),type:ht}),e=r()(t,2),i=e[0],s=e[1];return Object(n.createElement)(a.Card,{elevation:2,className:"simpay-activity-reports-card-reports"},Object(n.createElement)(a.CardHeader,{className:"".concat("simpay-activity-reports-card-reports","-header")},Object(n.createElement)("h2",{className:"simpay-activity-reports-card-title"},Object(o.__)("Reports","stripe")),Object(n.createElement)(K,{range:i,setRange:s})),Object(n.createElement)(a.CardBody,null,Object(n.createElement)(et,{range:i,currency:dt}),Object(n.createElement)(a.CardDivider,null),Object(n.createElement)(it,{range:i,currency:dt}),Object(n.createElement)(a.CardDivider,null),Object(n.createElement)(at,{range:i,currency:dt})))};Object(n.render)(Object(n.createElement)((function(){var t=Object(d.e)(f,"simpay_activity_reports_currency",g),e=r()(t,3),i=e[0],s=e[1],l=e[2];function u(){var t=Object(h.addQueryArgs)(window.location.href,{currency:i});window.location.href=t}return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(a.Dropdown,{position:"bottom center",popoverProps:{noArrow:!1},renderToggle:function(t){var e=t.isOpen,i=t.onToggle;return Object(n.createElement)(a.Button,{variant:"secondary",onClick:i,"aria-expanded":e,icon:c,tooltip:Object(o.__)("Settings","stripe")})},renderContent:function(){return Object(n.createElement)("div",{style:{width:"200px",padding:"8px"}},Object(n.createElement)(a.SelectControl,{label:Object(o.__)("Currency","stripe"),value:i,onChange:s,options:p.map((function(t){return{label:t,value:t.toLowerCase()}})),help:Object(o.__)("Activity with the selected currency and global payment mode will be shown.","stripe")}),Object(n.createElement)(a.Button,{type:"submit",variant:"primary",onClick:u,isBusy:l,disabled:l},Object(o.__)("Update","stripe")))}}),Object(n.createElement)(a.Popover.Slot,null))}),null),document.getElementById("simpay-admin-page-activity-reports-config")),Object(n.render)(Object(n.createElement)((function(){return Object(n.createElement)("div",{className:"simpay-activity-reports"},Object(n.createElement)(E,null),Object(n.createElement)(I,null),Object(n.createElement)(ut,null),Object(n.createElement)(a.Popover.Slot,null))}),null),document.getElementById("simpay-admin-page-activity-reports"))}]); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-page-setup-wizard-css.asset.php b/includes/core/assets/js/dist/simpay-admin-page-setup-wizard-css.asset.php index bb8b4ef8..b71491df 100644 --- a/includes/core/assets/js/dist/simpay-admin-page-setup-wizard-css.asset.php +++ b/includes/core/assets/js/dist/simpay-admin-page-setup-wizard-css.asset.php @@ -1 +1 @@ - array(), 'version' => 'd99dc49f938c91cae2684bcc17849259'); \ No newline at end of file + array(), 'version' => 'fffb1affd7c46d59ca8858785f26ba36'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-page-setup-wizard.asset.php b/includes/core/assets/js/dist/simpay-admin-page-setup-wizard.asset.php index 15e647bb..49ec2325 100644 --- a/includes/core/assets/js/dist/simpay-admin-page-setup-wizard.asset.php +++ b/includes/core/assets/js/dist/simpay-admin-page-setup-wizard.asset.php @@ -1 +1 @@ - array('lodash', 'react', 'wp-api-fetch', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-primitives', 'wp-url'), 'version' => '579b9765c204b25653135173b92b4236'); \ No newline at end of file + array('lodash', 'react', 'wp-api-fetch', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-primitives', 'wp-url'), 'version' => '21c6959b11500cc7331462593884c2a7'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-page-setup-wizard.js b/includes/core/assets/js/dist/simpay-admin-page-setup-wizard.js index b515d6a7..08b72398 100644 --- a/includes/core/assets/js/dist/simpay-admin-page-setup-wizard.js +++ b/includes/core/assets/js/dist/simpay-admin-page-setup-wizard.js @@ -1,2 +1,2 @@ -!function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.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 a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));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=77)}([function(e,t){e.exports=window.wp.element},,function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wp.components},,function(e,t){e.exports=window.React},function(e,t,n){var r=n(26),a=n(27),i=n(22),c=n(28);e.exports=function(e,t){return r(e)||a(e,t)||i(e,t)||c()},e.exports.__esModule=!0,e.exports.default=e.exports},,,function(e,t){e.exports=window.wp.primitives},function(e,t){e.exports=window.wp.url},function(e,t,n){var r=n(30);e.exports=function(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=window.lodash},function(e,t,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function a(){for(var e=[],t=0;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i},e.exports.__esModule=!0,e.exports.default=e.exports},,,,,,,,function(e,t){e.exports=window.wp.notices},function(e,t,n){"use strict";e.exports=n(62)},function(e,t,n){"use strict";var r="function"==typeof Symbol&&Symbol.for,a=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,c=r?Symbol.for("react.fragment"):60107,o=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,p=r?Symbol.for("react.async_mode"):60111,m=r?Symbol.for("react.concurrent_mode"):60111,f=r?Symbol.for("react.forward_ref"):60112,d=r?Symbol.for("react.suspense"):60113,b=r?Symbol.for("react.suspense_list"):60120,y=r?Symbol.for("react.memo"):60115,h=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,j=r?Symbol.for("react.scope"):60119;function _(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case a:switch(e=e.type){case p:case m:case c:case s:case o:case d:return e;default:switch(e=e&&e.$$typeof){case u:case f:case h:case y:case l:return e;default:return t}}case i:return t}}}function x(e){return _(e)===m}t.AsyncMode=p,t.ConcurrentMode=m,t.ContextConsumer=u,t.ContextProvider=l,t.Element=a,t.ForwardRef=f,t.Fragment=c,t.Lazy=h,t.Memo=y,t.Portal=i,t.Profiler=s,t.StrictMode=o,t.Suspense=d,t.isAsyncMode=function(e){return x(e)||_(e)===p},t.isConcurrentMode=x,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===a},t.isForwardRef=function(e){return _(e)===f},t.isFragment=function(e){return _(e)===c},t.isLazy=function(e){return _(e)===h},t.isMemo=function(e){return _(e)===y},t.isPortal=function(e){return _(e)===i},t.isProfiler=function(e){return _(e)===s},t.isStrictMode=function(e){return _(e)===o},t.isSuspense=function(e){return _(e)===d},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===c||e===m||e===s||e===o||e===d||e===b||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===y||e.$$typeof===l||e.$$typeof===u||e.$$typeof===f||e.$$typeof===v||e.$$typeof===O||e.$$typeof===j||e.$$typeof===g)},t.typeOf=_},function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r=0||(a[n]=e[n]);return a},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";var r=n(0),a=n(9);const i=Object(r.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(a.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}));t.a=i},function(e,t,n){"use strict";var r=n(0),a=n(9);const i=Object(r.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(a.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"}));t.a=i},,,,,,,,,,,,function(e,t,n){"use strict";n.r(t);var r=n(6),a=n.n(r),i=n(0),c=(n(60),n(3)),o=n(2),s=n(10),l=n(37),u=n(12),p=n(25),m=n.n(p),f=n(44),d=n(65),b=n(18),y=n.n(b),h=n(15),g=n.n(h),v=n(5);function O(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var j=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|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|enterKeyHint|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|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|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)-.*))$/,_=O((function(e){return j.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}));function x(){return(x=Object.assign?Object.assign.bind():function(e){for(var t=1;t2||J(V)>3?"":" "}function ae(e,t){for(;--t&&Y()&&!(V<48||V>102||V>57&&V<65||V>70&&V<97););return K(e,Q()+(t<6&&32==X()&&32==Y()))}function ie(e,t){for(;Y()&&e+V!==57&&(e+V!==84||47!==X()););return"/*"+K(t,Z-1)+"*"+A(47===e?e:Y())}function ce(e){for(;!J(X());)Y();return K(e,Z)}function oe(e,t,n,r,a,i,c,o,s,l,u){for(var p=a-1,m=0===a?i:[""],f=D(m),d=0,b=0,y=0;d0?m[h]+" "+g:$(g,/&\f/g,m[h])))&&(s[y++]=v);return G(e,t,n,0===a?k:o,s,l,u)}function se(e,t,n){return G(e,t,n,S,A(V),F(e,2,-2),0)}function le(e,t,n,r){return G(e,t,n,C,F(e,0,r),F(e,r+1,-1),r)}function ue(e,t){for(var n="",r=D(e),a=0;a-1&&!e.return)switch(e.type){case C:e.return=function e(t,n){switch(a=n,45^T(r=t,0)?(((a<<2^T(r,0))<<2^T(r,1))<<2^T(r,2))<<2^T(r,3):0){case 5103:return E+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return E+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return E+t+"-moz-"+t+"-ms-"+t+t;case 6828:case 4268:return E+t+"-ms-"+t+t;case 6165:return E+t+"-ms-flex-"+t+t;case 5187:return E+t+$(t,/(\w+).+(:[^]+)/,E+"box-$1$2-ms-flex-$1$2")+t;case 5443:return E+t+"-ms-flex-item-"+$(t,/flex-|-self/,"")+t;case 4675:return E+t+"-ms-flex-line-pack"+$(t,/align-content|flex-|-self/,"")+t;case 5548:return E+t+"-ms-"+$(t,"shrink","negative")+t;case 5292:return E+t+"-ms-"+$(t,"basis","preferred-size")+t;case 6060:return E+"box-"+$(t,"-grow","")+E+t+"-ms-"+$(t,"grow","positive")+t;case 4554:return E+$(t,/([^-])(transform)/g,"$1"+E+"$2")+t;case 6187:return $($($(t,/(zoom-|grab)/,E+"$1"),/(image-set)/,E+"$1"),t,"")+t;case 5495:case 3959:return $(t,/(image-set\([^]*)/,E+"$1$`$1");case 4968:return $($(t,/(.+:)(flex-)?(.*)/,E+"box-pack:$3-ms-flex-pack:$3"),/s.+-b[^;]+/,"justify")+E+t+t;case 4095:case 3583:case 4068:case 2532:return $(t,/(.+)-inline(.+)/,E+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(L(t)-1-n>6)switch(T(t,n+1)){case 109:if(45!==T(t,n+4))break;case 102:return $(t,/(.+:)(.+)-([^]+)/,"$1"+E+"$2-$3$1-moz-"+(108==T(t,n+3)?"$3":"$2-$3"))+t;case 115:return~R(t,"stretch")?e($(t,"stretch","fill-available"),n)+t:t}break;case 4949:if(115!==T(t,n+1))break;case 6444:switch(T(t,L(t)-3-(~R(t,"!important")&&10))){case 107:return $(t,":",":"+E)+t;case 101:return $(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+E+(45===T(t,14)?"inline-":"")+"box$3$1"+E+"$2$3$1-ms-$2box$3")+t}break;case 5936:switch(T(t,n+11)){case 114:return E+t+"-ms-"+$(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return E+t+"-ms-"+$(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return E+t+"-ms-"+$(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return E+t+"-ms-"+t+t}var r,a;return t}(e.value,e.length);break;case P:return ue([q(e,{value:$(e.value,"@","@"+E)})],r);case k:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch((n=/(::plac\w+|:read-\w+)/.exec(n=t))?n[0]:n){case":read-only":case":read-write":return ue([q(e,{props:[$(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return ue([q(e,{props:[$(t,/:(plac\w+)/,":"+E+"input-$1")]}),q(e,{props:[$(t,/:(plac\w+)/,":-moz-$1")]}),q(e,{props:[$(t,/:(plac\w+)/,"-ms-input-$1")]})],r)}var n;return""}))}}],ge=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var r,a,i=e.stylisPlugins||he,c={},o=[];r=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n0&&L(w)-m&&B(d>32?le(w+";",a,r,m-1):le($(w," ","")+";",a,r,m-2),l);break;case 59:w+=";";default:if(B(x=oe(w,n,r,u,p,i,s,O,j=[],_=[],m),c),123===v)if(0===p)e(w,n,x,x,j,c,m,s,_);else switch(99===f&&110===T(w,3)?100:f){case 100:case 108:case 109:case 115:e(t,x,x,a&&B(oe(t,x,x,0,0,i,s,O,i,j=[],m),_),i,_,m,s,a?j:_);break;default:e(w,x,x,x,[""],_,0,s,_)}}u=p=d=0,y=g=1,O=w="",m=o;break;case 58:m=1+L(w),d=b;default:if(y<1)if(123==v)--y;else if(125==v&&0==y++&&125==(V=Z>0?T(H,--Z):0,W--,10===V&&(W=1,U--),V))continue;switch(w+=A(v),v*y){case 38:g=p>0?1:(w+="\f",-1);break;case 44:s[u++]=(L(w)-1)*g,g=1;break;case 64:45===X()&&(w+=ne(Y())),f=X(),p=m=L(O=w+=ce(Q())),v++;break;case 45:45===b&&2==L(w)&&(y=0)}}return c}("",null,null,null,[""],e=ee(e),0,[0],e))}(e?e+"{"+t.styles+"}":t.styles),p),r&&(m.inserted[t.name]=!0)};var m={key:t,sheet:new w({key:t,container:r,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:c,registered:{},insert:a};return m.sheet.hydrate(o),m};function ve(e,t,n){var r="";return n.split(" ").forEach((function(n){void 0!==e[n]?t.push(e[n]+";"):r+=n+" "})),r}n(51);var Oe=function(e,t,n){!function(e,t,n){var r=e.key+"-"+t.name;!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles)}(e,t,n);var r=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var a=t;do{e.insert(t===a?"."+r:"",a,e.sheet,!0),a=a.next}while(void 0!==a)}},je={animationIterationCount:1,aspectRatio: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},_e=/[A-Z]|^ms/g,xe=/_EMO_([^_]+?)_([^]*?)_EMO_/g,we=function(e){return 45===e.charCodeAt(1)},Ee=function(e){return null!=e&&"boolean"!=typeof e},Se=O((function(e){return we(e)?e:e.replace(_e,"-$&").toLowerCase()})),ke=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(xe,(function(e,t,n){return Pe={name:t,styles:n,next:Pe},t}))}return 1===je[e]||we(e)||"number"!=typeof t||0===t?t:t+"px"};function Ce(e,t,n){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 Pe={name:n.name,styles:n.styles,next:Pe},n.name;if(void 0!==n.styles){var r=n.next;if(void 0!==r)for(;void 0!==r;)Pe={name:r.name,styles:r.styles,next:Pe},r=r.next;return n.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var a=0;a=4;++r,a-=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(a){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)}(a)+s,styles:a,next:Pe}},Me=(!!v.useInsertionEffect&&v.useInsertionEffect||v.useLayoutEffect,v.createContext("undefined"!=typeof HTMLElement?ge({key:"css"}):null));Me.Provider;var Ne=function(e){return Object(v.forwardRef)((function(t,n){var r=Object(v.useContext)(Me);return e(t,r,n)}))},$e=v.createContext({}),Re=_,Te=function(e){return"theme"!==e},Fe=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?Re:Te},Le=function(e,t,n){var r;if(t){var a=t.shouldForwardProp;r=e.__emotion_forwardProp&&a?function(t){return e.__emotion_forwardProp(t)&&a(t)}:a}return"function"!=typeof r&&n&&(r=e.__emotion_forwardProp),r},De=function(){return null},Be=function e(t,n){var r,a,i=t.__emotion_real===t,c=i&&t.__emotion_base||t;void 0!==n&&(r=n.label,a=n.target);var o=Le(t,n,i),s=o||Fe(c),l=!s("as");return function(){var u=arguments,p=i&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==r&&p.push("label:"+r+";"),null==u[0]||void 0===u[0].raw)p.push.apply(p,u);else{p.push(u[0][0]);for(var m=u.length,f=1;f div {\n\t\tmargin-left: 8px;\n\t}\n\n\tsvg {\n\t\tdisplay: block;\n\n\t\t&:hover {\n\t\t\tcursor: pointer;\n\t\t}\n\t}\n"]))),Ke=Ye(c.Popover)(Ie||(Ie=y()(["\n\t.components-popover__content {\n\t\tpadding: 20px;\n\t\twidth: 200px;\n\t}\n"]))),Je=Ye(c.ToggleControl)(Ze||(Ze=y()(["\n\t&& {\n\t\t.components-base-control__field {\n\t\t\tmargin-bottom: 0;\n\t\t}\n\t}\n"]))),et=n(52),tt=n.n(et),nt=Ye(c.Card)(Ve||(Ve=y()(["\n\tpadding: 30px;\n\n\t&& {\n\t\tbox-shadow: 0 2px 6px 0 rgba( 0, 0, 0, 0.05 );\n\t\tborder: 1px solid #ccc;\n\t\twidth: 100%;\n\t}\n"]))),rt=Ye(c.CardHeader)(He||(He=y()(["\n\t&&& {\n\t\tpadding: 0 0 30px;\n\t}\n\n\th1 {\n\t\tfont-size: 26px;\n\t\tline-height: 1;\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t}\n\n\tsmall {\n\t\tcolor: #c0c0c0;\n\t\tfont-size: 13px;\n\t\tfont-weight: normal;\n\t\tdisplay: block;\n\t\tmargin: 0 0 3px;\n\t}\n"]))),at=Ye(c.CardFooter)(Ge||(Ge=y()(["\n\t&&& {\n\t\tpadding: 30px 0 0;\n\t}\n"]))),it=Ye(c.CardBody)(qe||(qe=y()(["\n\t&&& {\n\t\tpadding: 30px 0;\n\t}\n\n\t> * {\n\t\tmargin: 0 0 2rem;\n\n\t\t&:last-child {\n\t\t\tmargin-bottom: 0;\n\t\t}\n\t}\n\n\t> p {\n\t\tcolor: #555555;\n\t\tfont-size: 15px;\n\t}\n"]))),ct=["title","supTitle","children"];function ot(e){return Object(i.createElement)(nt,e)}function st(e){var t=e.title,n=e.supTitle,r=e.children,a=tt()(e,ct);return Object(i.createElement)(rt,a,Object(i.createElement)("div",null,n&&Object(i.createElement)("small",null,n),t&&Object(i.createElement)("h1",null,t)),r)}function lt(e){return Object(i.createElement)(at,e)}function ut(e){return Object(i.createElement)(it,e)}var pt,mt=simpaySetupWizard.adminUrl;function ft(e){var t=e.isFirst,n=Object(i.useState)(!1),r=a()(n,2),s=r[0],l=r[1];return Object(i.createElement)(c.Flex,{justify:"center"},s&&Object(i.createElement)(c.Modal,{title:Object(o.__)("Are you sure you want to exit the wizard?","stripe"),onRequestClose:function(){return l(!1)}},Object(i.createElement)("p",{style:{marginBottom:"2rem"}},Object(o.__)("Manual setup is only recommended for experienced users.","stripe")),Object(i.createElement)(c.Flex,null,Object(i.createElement)(c.Button,{href:mt,isDestructive:!0,variant:"destructive"},Object(o.__)("Exit Setup Wizard","stripe")),Object(i.createElement)(c.Button,{variant:"primary",isPrimary:!0,onClick:function(){return l(!1)}},Object(o.__)("Continue Setup","stripe")))),Object(i.createElement)(c.Button,{isLink:!0,variant:"link",className:"simpay-setup-wizard-subtle-link",onClick:function(){return l(!0)}},t?Object(o.__)("Go back to the Dashboard","stripe"):Object(o.__)("Close and exit the Setup Wizard","stripe")))}var dt=Ye(c.Button)(pt||(pt=y()(["\n\t&& {\n\t\tfont-size: 16px;\n\t\tfont-weight: bold;\n\t\tpadding: 15px 30px !important;\n\t\theight: auto;\n\t}\n"]))),bt=Object(i.forwardRef)((function(e,t){return Object(i.createElement)(dt,g()({isPrimary:!0,variant:"primary"},e,{ref:t}))}));function yt(e){return e.width,Object(i.createElement)("svg",{width:"311",height:"41",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(i.createElement)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.352 0C1.052 0 0 1.02 0 2.277v30.746C0 34.281 1.053 35.3 2.352 35.3h28.806c.975 0 1.764-.764 1.764-1.708 0-.943-.79-1.708-1.763-1.708H5.29c-.974 0-1.764-.765-1.764-1.708v-17.08c0-.944.79-1.709 1.764-1.709h44.092c1.299 0 2.352-1.02 2.352-2.277V2.277C51.735 1.02 50.682 0 49.383 0H2.352Zm55.262 24.198h-1.47v-1.993c0-4.088-3.422-7.402-7.643-7.402-4.22 0-7.642 3.314-7.642 7.402v1.993H38.8c-1.299 0-2.352 1.02-2.352 2.277v11.387c0 1.258 1.053 2.278 2.352 2.278h18.813c1.299 0 2.351-1.02 2.351-2.278V26.475c0-1.258-1.053-2.277-2.351-2.277Zm-4.997-1.993v1.993h-8.23v-1.993c0-2.201 1.842-3.985 4.114-3.985 2.273 0 4.116 1.784 4.116 3.985ZM8.23 20.497c0-.629.526-1.139 1.175-1.139H28.22c.65 0 1.176.51 1.176 1.139s-.527 1.139-1.176 1.139H9.406c-.649 0-1.175-.51-1.175-1.139Zm0 5.124c0-.629.526-1.138 1.175-1.138h7.055c.65 0 1.176.51 1.176 1.138 0 .63-.527 1.139-1.176 1.139H9.406c-.649 0-1.175-.51-1.175-1.139Zm31.158 11.672V27.045h17.637v10.248H39.389Z",fill:"#428BCA"}),Object(i.createElement)("path",{d:"M81.08 30.745h5.288l5.41-17.186 5.596 17.187h5.289l7.84-24.29h-5.288l-5.289 17.956L94.7 6.457h-5.842L83.785 24.38 78.528 6.457h-5.289l7.84 24.288Zm31.511 0h4.796v-8.793h6.456c5.319 0 8.302-3.228 8.302-7.963 0-4.735-2.983-7.532-8.302-7.532h-11.252v24.288Zm4.796-13.405V11.1h5.288c2.952 0 4.52 1.168 4.52 3.104 0 1.968-1.507 3.136-4.366 3.136h-5.442Zm35.473 13.897c6.303 0 10.023-3.197 10.023-7.747 0-10.3-14.789-4.581-14.789-10.085 0-1.906 1.599-3.013 4.52-3.013 2.859 0 4.519 1.322 4.704 3.567h5.288c0-4.92-4.089-7.994-9.9-7.994-5.872 0-9.562 2.89-9.562 7.502 0 10.268 14.758 4.642 14.758 10.084 0 1.998-1.752 3.26-4.919 3.26-3.228 0-5.073-1.6-5.165-4.305h-5.381c0 5.503 4.274 8.731 10.423 8.731Zm15.137-18.447c1.66 0 2.89-1.23 2.89-2.89 0-1.66-1.23-2.829-2.89-2.829-1.691 0-2.921 1.169-2.921 2.83 0 1.66 1.23 2.89 2.921 2.89Zm-2.306 17.956h4.581V14.758h-4.581v15.988Zm7.696-.001h4.55v-8.178c0-2.644 1.384-4.366 3.597-4.366 1.968 0 3.136 1.415 3.136 3.751v8.793h4.612v-8.178c0-2.644 1.384-4.366 3.597-4.366 1.968 0 3.136 1.415 3.136 3.751v8.793h4.643v-9.039c0-4.888-1.968-7.44-5.965-7.44-2.459 0-4.642.86-6.21 3.044-.892-2.03-2.583-3.044-5.135-3.044-2.552 0-4.335 1.076-5.411 2.798v-2.306h-4.55v15.988Zm30.183 6.15h4.551v-8.24c1.106 1.63 2.859 2.582 5.38 2.582 4.028 0 6.887-3.504 6.887-8.424 0-5.011-2.859-8.547-6.887-8.547-2.521 0-4.274.953-5.38 2.583v-2.091h-4.551v22.137Zm8.363-9.593c-2.244 0-3.843-1.875-3.843-4.52 0-2.674 1.599-4.58 3.843-4.58 2.275 0 3.874 1.906 3.874 4.58 0 2.645-1.599 4.52-3.874 4.52Zm10.651 3.443h4.551V6.457h-4.551v24.288Zm15.443.492c3.905 0 6.918-2.213 7.41-5.688h-4.551c-.184 1.107-1.229 1.968-2.828 1.968-2.368 0-3.536-1.353-3.751-3.412h11.222v-1.476c0-5.104-3.259-8.363-7.502-8.363-4.919 0-8.363 3.505-8.363 8.455 0 4.98 3.444 8.516 8.363 8.516Zm-3.689-9.93c.276-1.845 1.352-3.106 3.505-3.106 1.937 0 3.013 1.322 3.105 3.106h-6.61Zm22.358 9.438h4.796v-8.793h6.457c5.319 0 8.301-3.228 8.301-7.963 0-4.735-2.982-7.532-8.301-7.532h-11.253v24.288Zm4.796-13.405V11.1h5.288c2.952 0 4.52 1.168 4.52 3.104 0 1.968-1.507 3.136-4.366 3.136h-5.442Zm20.704 13.897c2.736 0 4.458-1.23 5.257-3.228.4 2.183 2.152 3.413 5.688 2.613v-3.259c-1.261.123-1.507-.338-1.507-1.66v-5.411c0-3.782-2.644-6.026-7.317-6.026-4.612 0-7.317 2.275-7.317 6.118h4.488c0-1.383 1.015-2.183 2.768-2.183 1.906 0 2.859.769 2.828 2.091v.492l-3.659.43c-4.519.523-7.071 2.368-7.071 5.258 0 2.429 1.722 4.765 5.842 4.765Zm.922-3.382c-1.414 0-2.183-.645-2.183-1.63 0-1.167 1.507-1.629 4.397-1.998l1.568-.153c-.277 2.152-1.599 3.781-3.782 3.781Zm11.126 9.04h1.967c3.936 0 6.641-1.077 8.271-4.981L311 14.758h-4.766l-3.996 10.669-4.797-10.67h-4.796l7.225 16.234c-1.014 1.446-2.06 1.907-4.058 1.876h-1.568v4.028Z",fill:"#428BCA"}))}var ht=n(16);function gt(e){var t=Object(ht.useSelect)((function(e){return Object(u.filter)(e("core/notices").getNotices(),{type:"snackbar"})}),[]),n=Object(ht.useDispatch)("core/notices").removeNotice;return 0===t.length?null:Object(i.createElement)(c.SnackbarList,g()({onRemove:n,notices:t},e))}var vt,Ot,jt,_t,xt,wt=n(64),Et=Ye.div(vt||(vt=y()(["\n\tmax-width: 80%;\n\tdisplay: flex;\n\talign-items: center;\n\n\t> * {\n\t\tmargin-right: 8px;\n\n\t\t&:last-child {\n\t\t\tmargin-right: 0;\n\t\t}\n\t}\n"]))),St={current:"var(--wp-admin-theme-color)",complete:"var(--wp-admin-theme-color)",incomplete:"#c0c0c0"},kt=Ye.div(Ot||(Ot=y()(["\n\twidth: 16px;\n\theight: 16px;\n\tborder-radius: 50%;\n\tbackground-color: ",";\n\tflex-shrink: 0;\n\tposition: relative;\n\ttransition: backgroundColor 0.2s ease-in-out;\n\n\tsvg {\n\t\tfill: #fff;\n\t\tposition: absolute;\n\t\tleft: -1px;\n\t\ttop: -1px;\n\t\ttransition: opacity 0.2s ease-in-out;\n\t\topacity: ",";\n\t}\n\n\tdiv {\n\t\topacity: ",";\n\t}\n\n\tpath {\n\t\tstroke: #fff;\n\t}\n"])),(function(e){return St[e.status]}),(function(e){return e.isComplete?"1":"0"}),(function(e){var t=e.isCurrent,n=e.isComplete;return t&&!n?"1":"0"})),Ct=Ye.div(jt||(jt=y()(["\n\twidth: 6px;\n\theight: 6px;\n\tbackground-color: #f0f0f1;\n\tborder-radius: 50%;\n\tposition: absolute;\n\ttop: 5px;\n\tleft: 5px;\n\ttransition: opacity 0.2s ease-in-out;\n"]))),Pt=Ye.div(_t||(_t=y()(["\n\twidth: 100%;\n\theight: 2px;\n\tbackground-color: rgba( 192, 192, 192, 0.5 );\n\twidth: 100px;\n"])));function zt(e){for(var t=e.current,n=e.total,r=[],a=1;a<=n;a++){var c="incomplete";a * {\n\t\tmargin: 25px 0;\n\t}\n"])));function Nt(e){return Object(i.createElement)(Mt,e)}var $t=Ye(c.Button)(At||(At=y()(["\n\t&&&& {\n\t\tfont-size: 16px;\n\t\tfont-weight: bold;\n\t\tpadding: 13px 30px 12px !important;\n\t\theight: auto;\n\t\tbackground-color: #635bff;\n\n\t\t&:focus {\n\t\t\tbackground-color: #635bff;\n\t\t\tbox-shadow: inset 0 0 0 1px #fff,\n\t\t\t\t0 0 0 var( --wp-admin-border-width-focus ) #635bff;\n\t\t}\n\n\t\t&:hover {\n\t\t\tbackground-color: #0a2540 !important;\n\t\t}\n\n\t\t&:focus:hover {\n\t\t\tbox-shadow: inset 0 0 0 1px #fff,\n\t\t\t\t0 0 0 var( --wp-admin-border-width-focus ) #0a2540;\n\t\t}\n\n\t\tsvg {\n\t\t\tmargin-left: 5px;\n\t\t}\n\t}\n"]))),Rt=Object(i.forwardRef)((function(e,t){return Object(i.createElement)($t,g()({isPrimary:!0,variant:"primary"},e,{ref:t}))}));function Tt(){return Object(i.createElement)("svg",{width:56,height:23,fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(i.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M55.742 11.884c0-3.93-1.92-7.032-5.59-7.032-3.684 0-5.914 3.101-5.914 7.001 0 4.622 2.632 6.955 6.41 6.955 1.843 0 3.236-.414 4.29-.998v-3.07c-1.053.522-2.261.844-3.794.844-1.502 0-2.834-.522-3.004-2.334h7.572c0-.2.03-.998.03-1.366Zm-7.649-1.459c0-1.735 1.069-2.456 2.044-2.456.945 0 1.951.721 1.951 2.456h-3.995Zm-9.832-5.573c-1.517 0-2.493.706-3.035 1.197l-.201-.952h-3.407V23l3.871-.814.016-4.345c.557.4 1.378.967 2.74.967 2.772 0 5.296-2.21 5.296-7.078-.015-4.452-2.57-6.878-5.28-6.878Zm-.929 10.579c-.913 0-1.456-.323-1.827-.722l-.016-5.696c.403-.446.96-.753 1.843-.753 1.41 0 2.385 1.566 2.385 3.578 0 2.057-.96 3.593-2.385 3.593ZM26.292 3.946l3.886-.83V0l-3.886.814v3.132Zm0 1.167h3.886v13.434h-3.886V5.113Zm-4.165 1.136-.248-1.136h-3.345v13.434h3.871V9.443c.914-1.183 2.462-.968 2.942-.799V5.113c-.495-.184-2.307-.522-3.22 1.136Zm-7.742-4.468-3.778.798-.016 12.299c0 2.272 1.719 3.946 4.01 3.946 1.27 0 2.2-.23 2.71-.507V15.2c-.495.2-2.942.906-2.942-1.366v-5.45h2.942V5.112H14.37l.016-3.332ZM3.917 9.013c0-.6.496-.83 1.317-.83 1.176 0 2.663.354 3.84.983V5.558c-1.286-.507-2.555-.706-3.84-.706C2.09 4.852 0 6.479 0 9.197c0 4.238 5.884 3.562 5.884 5.39 0 .705-.62.936-1.487.936-1.285 0-2.926-.522-4.227-1.229v3.655c1.44.614 2.896.875 4.227.875 3.221 0 5.435-1.582 5.435-4.33-.015-4.575-5.915-3.762-5.915-5.481Z",fill:"#fff"}))}var Ft=n(11),Lt=n.n(Ft);function Dt(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 Bt(e){for(var t=1;tWP Simple Pay account or purchase receipt email.","stripe"),{strong:Object(i.createElement)("strong",null),a:Object(i.createElement)("a",{href:Jt,target:"_blank",rel:"noopener noreferrer"})})),Object(i.createElement)(c.TextControl,{label:Object(o.__)("License Key","stripe"),value:l,className:_,onChange:function(e){return u(e)},disabled:d,help:g||Object(o.__)("An active license ensures automatic updates and the latest features.","stripe"),ref:j})),Object(i.createElement)(lt,{justify:"flex-end",align:"center"},Object(i.createElement)(bt,{onClick:function(){b(!0);var e=new FormData;e.append("action","simpay_activate_license"),e.append("nonce",en),e.append("license",l),m()({url:Kt,method:"POST",body:e}).then((function(e){var r=e.success,a=e.data,i=a.message,c=a.license;if(!r)throw{message:i};n(c),O(Object(o.__)("License activated","stripe"),{type:"snackbar"}),b(!1),t()})).catch((function(e){var t=e.message;v(t),b(!1)}))},disabled:""===l||d,isBusy:d},Object(o.__)("Activate and Continue →","stripe"))))}},{id:"stripe",title:Object(o.__)("Connect to Stripe","stripe"),content:wn},{id:"emails",title:Object(o.__)("Configure Emails","stripe"),content:function(e){var t=e.goPrev,n=e.goNext,r=e.licenseData,a=Wt(),s=a.settings,l=a.rawSettings,p=a.discardChanges,m=a.editSettings,f=a.saveSettings,d=Object(i.useRef)();if(Object(i.useLayoutEffect)((function(){d.current&&d.current.focus()}),[l]),Object(u.isEmpty)(s))return Object(i.createElement)(ut,null,Object(i.createElement)(c.Spinner,null));var b=s["email_payment-confirmation"],y=s["email_payment-notification"],h=s["email_payment-notification_to"],g=s["email_upcoming-invoice"],v=s["email_invoice-confirmation"],O=r.features,j=O.subscriptions,_=O.enhanced_subscriptions;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(ut,null,Object(i.createElement)("ul",{className:"simpay-setup-wizard-toggle-list"},Object(i.createElement)("li",null,Object(i.createElement)("label",{htmlFor:"email_payment-confirmation"},Object(i.createElement)("h3",null,Object(o.__)("Payment Receipt","stripe")),Object(i.createElement)("p",null,Object(o.__)("Send a payment receipt email to the customer upon successful payment.","stripe"))),Object(i.createElement)(c.FormToggle,{id:"email_payment-confirmation",checked:"no"!==b,onChange:function(e){var t=e.target;return m({"email_payment-confirmation":t.checked?"yes":"no"})}})),Object(i.createElement)("li",null,Object(i.createElement)("label",{htmlFor:"email_payment-notification"},Object(i.createElement)("h3",null,Object(o.__)("Payment Notification","stripe")),Object(i.createElement)("p",null,Object(o.__)("Receive an email notification when a new payment is made.","stripe"))),Object(i.createElement)(c.FormToggle,{id:"email_payment-notification",checked:"no"!==y,onChange:function(e){var t=e.target;return m({"email_payment-notification":t.checked?"yes":"no"})}})),"no"!==y&&Object(i.createElement)("li",{className:"simpay-setup-wizard-toggle-list__child"},Object(i.createElement)(c.TextControl,{label:Object(o.__)("Send to:","stripe"),value:h,onChange:function(e){return m({"email_payment-notification_to":e})}})),_&&Object(i.createElement)("li",null,Object(i.createElement)("label",{htmlFor:"email_invoice-confirmation"},Object(i.createElement)("h3",null,Object(o.__)("Invoice Receipt","stripe")),Object(i.createElement)("p",null,Object(o.__)("Send a payment receipt email to the customer upon successful invoice.","stripe"))),Object(i.createElement)(c.FormToggle,{id:"email_payment-confirmation",checked:"no"!==v,onChange:function(e){var t=e.target;return m({"email_invoice-confirmation":t.checked?"yes":"no"})}})),j&&Object(i.createElement)("li",null,Object(i.createElement)("label",{htmlFor:"email_upcoming-invoice"},Object(i.createElement)("h3",null,Object(o.__)("Upcoming Invoice","stripe")),Object(i.createElement)("p",null,Object(o.__)("Remind customers of upcoming invoices and allow payment method changes.","stripe"))),Object(i.createElement)(c.FormToggle,{id:"email_upcoming-invoice",checked:"no"!==g,onChange:function(e){var t=e.target;return m({"email_upcoming-invoice":t.checked?"yes":"no"})}})))),Object(i.createElement)(lt,{justify:"space-between",align:"center"},Object(i.createElement)("div",null,Object(i.createElement)(c.Button,{isLink:!0,variant:"link",onClick:t,className:"simpay-setup-wizard-subtle-link"},Object(o.__)("← Previous Step","stripe"))),Object(i.createElement)("div",{style:{display:"flex",justifyContent:"center"}},Object(i.createElement)(c.Button,{isLink:!0,variant:"link",onClick:function(){p(),n()},style:{marginRight:"16px"},className:"simpay-setup-wizard-subtle-link"},Object(o.__)("Skip Step","stripe")),Object(i.createElement)(bt,{onClick:function(){f(),n()},ref:d},Object(o.__)("Save and Continue →","stripe")))))}},{id:"next-steps",title:Object(o.__)("🎉 Setup Complete","stripe"),content:function(){return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(ut,null,Object(i.createElement)("div",{className:"simpay-setup-wizard-content-list"},Object(i.createElement)("div",{className:"simpay-setup-wizard-content-list__content"},Object(i.createElement)("p",null,Object(o.__)("Congratulations, you’re ready to start accepting payments!","stripe")),Object(i.createElement)("p",null,Object(o.__)("WP Simple Pay is just that: simple. Create your first payment form below to start collecting payments, or fine-tune your setup through some of these suggestions:","stripe"))),Object(i.createElement)("div",{className:"simpay-setup-wizard-content-list__list"},Object(i.createElement)("ul",{className:"simpay-setup-wizard-bullet-list"},Object(i.createElement)("li",null,Object(i.createElement)("a",{href:bn,target:"_blank",rel:"noopener noreferrer"},Object(o.__)("Collect tax or GST","stripe"))),Object(i.createElement)("li",null,Object(i.createElement)("a",{href:yn,target:"_blank",rel:"noopener noreferrer"},Object(o.__)("Add anti-spam protection","stripe"))),Object(i.createElement)("li",null,Object(i.createElement)("a",{href:hn,target:"_blank",rel:"noopener noreferrer"},Object(o.__)("Change the default currency","stripe"))),Object(i.createElement)("li",null,Object(i.createElement)("a",{href:gn,target:"_blank",rel:"noopener noreferrer"},Object(o.__)("Customize receipts","stripe")))))),Object(i.createElement)("hr",null),Object(i.createElement)("div",{className:"simpay-setup-wizard-doc-suggestions"},Object(i.createElement)("div",null,Object(i.createElement)("h3",null,Object(o.__)("Accept Donations","stripe")),Object(i.createElement)("p",null,Object(o.__)("Easily fundraise or accept donations online via 135+ supported currencies. Offer one-time or recurring donations of fixed or user-defined amounts.","stripe")),Object(i.createElement)(c.Button,{href:vn,variant:"secondary",isSecondary:!0,target:"_blank",rel:"noopener noreferrer"},Object(o.__)("View Walkthrough","stripe"))),Object(i.createElement)("div",null,Object(i.createElement)("h3",null,Object(o.__)("Reconcile Invoices","stripe")),Object(i.createElement)("p",null,Object(o.__)("Collect additional custom data on your payment forms such as an Invoice ID to reconcile invoices against your own invoicing system.","stripe")),Object(i.createElement)(c.Button,{href:On,variant:"secondary",isSecondary:!0,target:"_blank",rel:"noopener noreferrer"},Object(o.__)("View Walkthrough","stripe"))))),Object(i.createElement)(lt,{justify:"space-between",align:"center"},Object(i.createElement)("div",{style:{flexBasis:"100%"}},Object(i.createElement)(c.Button,{isLink:!0,variant:"link",href:fn,className:"simpay-setup-wizard-subtle-link",icon:Object(i.createElement)(f.a,{icon:rn})},Object(o.__)("Return to Dashboard","stripe"))),Object(i.createElement)(c.Flex,{justify:"flex-end",gap:4},Object(i.createElement)(bt,{href:dn},Object(o.__)("Create a Payment Form →","stripe")))))}}],lite:[{id:"stripe",title:Object(o.__)("Connect to Stripe","stripe"),content:wn},{id:"analytics",title:Object(o.__)("Help Improve WP Simple Pay + Smart Recommendations","stripe"),content:function(e){var t=e.goPrev,n=e.goNext,r=Wt(),s=r.settings,l=r.rawSettings,p=r.discardChanges,b=r.editSettings,y=r.saveSettings,h=Object(i.useState)(!0),g=a()(h,2),v=g[0],O=g[1],j=Object(i.useState)(Ht),_=a()(j,2),x=_[0],w=_[1],E=Object(i.useState)(!1),S=a()(E,2),k=S[0],C=S[1],P=Object(i.useState)(!1),z=a()(P,2),A=z[0],M=z[1],N=Object(i.useRef)();return Object(i.useLayoutEffect)((function(){N.current&&N.current.focus()}),[l]),Object(u.isEmpty)(s)?Object(i.createElement)(ut,null,Object(i.createElement)(c.Spinner,null)):Object(i.createElement)(i.Fragment,null,Object(i.createElement)(ut,null,Object(i.createElement)("p",null,Object(o.__)("Get helpful suggestions from WP Simple Pay on how to optimize your payment forms and grow your business or increase donations.","stripe")),Object(i.createElement)(c.TextControl,{label:Object(o.__)("Your Email Address:","stripe"),value:x,className:"simpay-setup-wizard-large-input",onChange:function(e){return w(e)},help:Object(o.__)("Your email is needed so you receive recommendations.","stripe"),ref:N,disabled:k}),Object(i.createElement)("hr",null),Object(i.createElement)(Xe,null,Object(i.createElement)(Qe,null,Object(o.__)("Help make WP Simple Pay better for everyone","stripe"),Object(i.createElement)("div",null,A&&Object(i.createElement)(Ke,{position:"top center"},Object(o.__)("By allowing us to track usage data we can better help you because we know which WordPress configurations, themes, and plugins we should test.","stripe")),Object(i.createElement)(f.a,{size:20,icon:d.a,onMouseEnter:function(){return M(!0)},onMouseLeave:function(){return M(!1)}}))),Object(i.createElement)(Je,{label:Object(o.__)("Yes, count me in","stripe"),id:"email_payment-confirmation",checked:v,disabled:k,onChange:function(e){O(e)}}))),Object(i.createElement)(lt,{justify:"space-between",align:"center"},Object(i.createElement)("div",null,Object(i.createElement)(c.Button,{isLink:!0,variant:"link",onClick:t,className:"simpay-setup-wizard-subtle-link",disabled:k},Object(o.__)("← Previous Step","stripe"))),Object(i.createElement)("div",{style:{display:"flex",justifyContent:"center"}},Object(i.createElement)(c.Button,{isLink:!0,variant:"link",onClick:function(){p(),n()},style:{marginRight:"16px"},className:"simpay-setup-wizard-subtle-link",disabled:k},Object(o.__)("Skip Step","stripe")),Object(i.createElement)(bt,{onClick:function(){C(!0),b({usage_tracking_opt_in:v?"yes":"no"}),y();var e=new FormData;e.append("action","simpay_setup_wizard_subscribe_email"),e.append("nonce",Gt),e.append("email",x),m()({url:qt,method:"POST",body:e}).finally((function(){C(!1),n()}))},isBusy:k,disabled:k},Object(o.__)("Save and Continue →","stripe")))))}},{id:"next-steps",title:Object(o.__)("🎉 Setup Complete","stripe"),content:function(){return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(ut,null,Object(i.createElement)(c.Flex,{justify:"space-between",align:"center",className:"simpay-setup-wizard-content-list"},Object(i.createElement)("div",{className:"simpay-setup-wizard-content-list__content"},Object(i.createElement)("p",null,Object(o.__)("Congratulations, you’re ready to start easily and securely accepting payments with WP Simple Pay!","stripe"))),Object(i.createElement)("div",null,Object(i.createElement)(bt,{href:ln},Object(o.__)("Create a Payment Form →","stripe")))),Object(i.createElement)("hr",null),Object(i.createElement)(an,null,Object(i.createElement)("h4",null,Object(o.__)("Special Upgrade Offer - Save 50%","stripe")),Object(i.createElement)("h3",null,Object(o.__)("Upgrade to WP Simple Pay Pro Today and Save","stripe")),Object(i.createElement)(cn,{className:"simpay-setup-wizard-check-list"},pn.map((function(e){return Object(i.createElement)("li",{key:e},Object(i.createElement)(f.a,{icon:wt.a}),e)}))),Object(i.createElement)(c.Button,{isLarge:!0,isSecondary:!0,variant:"secondary",href:un,target:"_blank",rel:"noopener noreferrer"},Object(o.__)("Upgrade to WP Simple Pay Pro","stripe")))),Object(i.createElement)(lt,{justify:"center"},Object(i.createElement)(c.Button,{isLink:!0,variant:"link",href:sn,className:"simpay-setup-wizard-subtle-link",icon:Object(i.createElement)(f.a,{icon:rn})},Object(o.__)("Return to Dashboard","stripe"))))}}]},Cn=simpaySetupWizard,Pn=Cn.license,zn=Cn.adminUrl,An=Pn.is_lite;Object(i.render)(Object(i.createElement)((function(){var e=kn[!0===An?"lite":"pro"],t=Object(s.getQueryArg)(window.location.href,"step"),n=Object(i.useState)(Pn),r=a()(n,2),u=r[0],p=r[1],m=function(e){var t=e.steps,n=e.currentStepId,r=t.findIndex((function(e){return e.id===n}))||0,c=Object(i.useState)(r),o=a()(c,2),l=o[0],u=o[1];function p(e){u(e),window.history.pushState({},"",Object(s.addQueryArgs)(window.location.href,{step:t[e].id}))}return Object(i.useEffect)((function(){var e=function(){var e=Object(s.getQueryArg)(window.location.search,"step"),n=t.findIndex((function(t){return t.id===e}))||0;u(n)};return window.addEventListener("popstate",e),window.addEventListener("pushstate",e),function(){window.removeEventListener("popstate",e),window.removeEventListener("pushstate",e)}}),[]),{currentStep:l,setCurrentStep:u,hasNext:l0}}({steps:e,currentStepId:t}),f=m.currentStep,d=m.goNext,b=m.goPrev,y=m.hasNext,h=m.hasPrev;if(-1===f)return Object(i.createElement)(Sn,{steps:e,goNext:d});var g=e[f],v=g.content;return Object(i.createElement)(c.SlotFillProvider,null,Object(i.createElement)(l.EntityProvider,{kind:"root",type:"site"},Object(i.createElement)(Nt,null,Object(i.createElement)("a",{href:zn},Object(i.createElement)(yt,{width:"250px"})),Object(i.createElement)(zt,{current:f+1,total:e.length}),Object(i.createElement)(ot,{isRounded:!0},Object(i.createElement)(st,{supTitle:Object(o.sprintf)(/* translators: %1$d current step count. %2$d total step count*/ +!function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.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 a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));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=75)}([function(e,t){e.exports=window.wp.element},,function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wp.components},,function(e,t){e.exports=window.React},function(e,t,n){var r=n(26),a=n(27),i=n(21),c=n(28);e.exports=function(e,t){return r(e)||a(e,t)||i(e,t)||c()},e.exports.__esModule=!0,e.exports.default=e.exports},,,function(e,t){e.exports=window.wp.primitives},function(e,t){e.exports=window.wp.url},function(e,t,n){var r=n(30);e.exports=function(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=window.lodash},,function(e,t,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function a(){for(var e=[],t=0;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i},e.exports.__esModule=!0,e.exports.default=e.exports},,,,,,,,function(e,t){e.exports=window.wp.notices},function(e,t,n){"use strict";e.exports=n(62)},function(e,t,n){"use strict";var r="function"==typeof Symbol&&Symbol.for,a=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,c=r?Symbol.for("react.fragment"):60107,o=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,p=r?Symbol.for("react.async_mode"):60111,m=r?Symbol.for("react.concurrent_mode"):60111,f=r?Symbol.for("react.forward_ref"):60112,d=r?Symbol.for("react.suspense"):60113,b=r?Symbol.for("react.suspense_list"):60120,y=r?Symbol.for("react.memo"):60115,h=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,j=r?Symbol.for("react.scope"):60119;function _(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case a:switch(e=e.type){case p:case m:case c:case s:case o:case d:return e;default:switch(e=e&&e.$$typeof){case u:case f:case h:case y:case l:return e;default:return t}}case i:return t}}}function x(e){return _(e)===m}t.AsyncMode=p,t.ConcurrentMode=m,t.ContextConsumer=u,t.ContextProvider=l,t.Element=a,t.ForwardRef=f,t.Fragment=c,t.Lazy=h,t.Memo=y,t.Portal=i,t.Profiler=s,t.StrictMode=o,t.Suspense=d,t.isAsyncMode=function(e){return x(e)||_(e)===p},t.isConcurrentMode=x,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===a},t.isForwardRef=function(e){return _(e)===f},t.isFragment=function(e){return _(e)===c},t.isLazy=function(e){return _(e)===h},t.isMemo=function(e){return _(e)===y},t.isPortal=function(e){return _(e)===i},t.isProfiler=function(e){return _(e)===s},t.isStrictMode=function(e){return _(e)===o},t.isSuspense=function(e){return _(e)===d},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===c||e===m||e===s||e===o||e===d||e===b||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===y||e.$$typeof===l||e.$$typeof===u||e.$$typeof===f||e.$$typeof===v||e.$$typeof===O||e.$$typeof===j||e.$$typeof===g)},t.typeOf=_},function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r=0||(a[n]=e[n]);return a},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";var r=n(0),a=n(9);const i=Object(r.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(a.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}));t.a=i},function(e,t,n){"use strict";var r=n(0),a=n(9);const i=Object(r.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(a.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"}));t.a=i},,,,,,,,,,function(e,t,n){"use strict";n.r(t);var r=n(6),a=n.n(r),i=n(0),c=(n(60),n(3)),o=n(2),s=n(10),l=n(37),u=n(12),p=n(24),m=n.n(p),f=n(44),d=n(65),b=n(18),y=n.n(b),h=n(15),g=n.n(h),v=n(5);function O(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var j=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|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|enterKeyHint|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|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|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)-.*))$/,_=O((function(e){return j.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}));function x(){return(x=Object.assign?Object.assign.bind():function(e){for(var t=1;t2||J(V)>3?"":" "}function ae(e,t){for(;--t&&Y()&&!(V<48||V>102||V>57&&V<65||V>70&&V<97););return K(e,Q()+(t<6&&32==X()&&32==Y()))}function ie(e,t){for(;Y()&&e+V!==57&&(e+V!==84||47!==X()););return"/*"+K(t,Z-1)+"*"+A(47===e?e:Y())}function ce(e){for(;!J(X());)Y();return K(e,Z)}function oe(e,t,n,r,a,i,c,o,s,l,u){for(var p=a-1,m=0===a?i:[""],f=D(m),d=0,b=0,y=0;d0?m[h]+" "+g:$(g,/&\f/g,m[h])))&&(s[y++]=v);return G(e,t,n,0===a?k:o,s,l,u)}function se(e,t,n){return G(e,t,n,S,A(V),F(e,2,-2),0)}function le(e,t,n,r){return G(e,t,n,C,F(e,0,r),F(e,r+1,-1),r)}function ue(e,t){for(var n="",r=D(e),a=0;a-1&&!e.return)switch(e.type){case C:e.return=function e(t,n){switch(a=n,45^T(r=t,0)?(((a<<2^T(r,0))<<2^T(r,1))<<2^T(r,2))<<2^T(r,3):0){case 5103:return E+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return E+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return E+t+"-moz-"+t+"-ms-"+t+t;case 6828:case 4268:return E+t+"-ms-"+t+t;case 6165:return E+t+"-ms-flex-"+t+t;case 5187:return E+t+$(t,/(\w+).+(:[^]+)/,E+"box-$1$2-ms-flex-$1$2")+t;case 5443:return E+t+"-ms-flex-item-"+$(t,/flex-|-self/,"")+t;case 4675:return E+t+"-ms-flex-line-pack"+$(t,/align-content|flex-|-self/,"")+t;case 5548:return E+t+"-ms-"+$(t,"shrink","negative")+t;case 5292:return E+t+"-ms-"+$(t,"basis","preferred-size")+t;case 6060:return E+"box-"+$(t,"-grow","")+E+t+"-ms-"+$(t,"grow","positive")+t;case 4554:return E+$(t,/([^-])(transform)/g,"$1"+E+"$2")+t;case 6187:return $($($(t,/(zoom-|grab)/,E+"$1"),/(image-set)/,E+"$1"),t,"")+t;case 5495:case 3959:return $(t,/(image-set\([^]*)/,E+"$1$`$1");case 4968:return $($(t,/(.+:)(flex-)?(.*)/,E+"box-pack:$3-ms-flex-pack:$3"),/s.+-b[^;]+/,"justify")+E+t+t;case 4095:case 3583:case 4068:case 2532:return $(t,/(.+)-inline(.+)/,E+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(L(t)-1-n>6)switch(T(t,n+1)){case 109:if(45!==T(t,n+4))break;case 102:return $(t,/(.+:)(.+)-([^]+)/,"$1"+E+"$2-$3$1-moz-"+(108==T(t,n+3)?"$3":"$2-$3"))+t;case 115:return~R(t,"stretch")?e($(t,"stretch","fill-available"),n)+t:t}break;case 4949:if(115!==T(t,n+1))break;case 6444:switch(T(t,L(t)-3-(~R(t,"!important")&&10))){case 107:return $(t,":",":"+E)+t;case 101:return $(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+E+(45===T(t,14)?"inline-":"")+"box$3$1"+E+"$2$3$1-ms-$2box$3")+t}break;case 5936:switch(T(t,n+11)){case 114:return E+t+"-ms-"+$(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return E+t+"-ms-"+$(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return E+t+"-ms-"+$(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return E+t+"-ms-"+t+t}var r,a;return t}(e.value,e.length);break;case P:return ue([q(e,{value:$(e.value,"@","@"+E)})],r);case k:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch((n=/(::plac\w+|:read-\w+)/.exec(n=t))?n[0]:n){case":read-only":case":read-write":return ue([q(e,{props:[$(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return ue([q(e,{props:[$(t,/:(plac\w+)/,":"+E+"input-$1")]}),q(e,{props:[$(t,/:(plac\w+)/,":-moz-$1")]}),q(e,{props:[$(t,/:(plac\w+)/,"-ms-input-$1")]})],r)}var n;return""}))}}],ge=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var r,a,i=e.stylisPlugins||he,c={},o=[];r=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n0&&L(w)-m&&B(d>32?le(w+";",a,r,m-1):le($(w," ","")+";",a,r,m-2),l);break;case 59:w+=";";default:if(B(x=oe(w,n,r,u,p,i,s,O,j=[],_=[],m),c),123===v)if(0===p)e(w,n,x,x,j,c,m,s,_);else switch(99===f&&110===T(w,3)?100:f){case 100:case 108:case 109:case 115:e(t,x,x,a&&B(oe(t,x,x,0,0,i,s,O,i,j=[],m),_),i,_,m,s,a?j:_);break;default:e(w,x,x,x,[""],_,0,s,_)}}u=p=d=0,y=g=1,O=w="",m=o;break;case 58:m=1+L(w),d=b;default:if(y<1)if(123==v)--y;else if(125==v&&0==y++&&125==(V=Z>0?T(H,--Z):0,W--,10===V&&(W=1,U--),V))continue;switch(w+=A(v),v*y){case 38:g=p>0?1:(w+="\f",-1);break;case 44:s[u++]=(L(w)-1)*g,g=1;break;case 64:45===X()&&(w+=ne(Y())),f=X(),p=m=L(O=w+=ce(Q())),v++;break;case 45:45===b&&2==L(w)&&(y=0)}}return c}("",null,null,null,[""],e=ee(e),0,[0],e))}(e?e+"{"+t.styles+"}":t.styles),p),r&&(m.inserted[t.name]=!0)};var m={key:t,sheet:new w({key:t,container:r,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:c,registered:{},insert:a};return m.sheet.hydrate(o),m};function ve(e,t,n){var r="";return n.split(" ").forEach((function(n){void 0!==e[n]?t.push(e[n]+";"):r+=n+" "})),r}n(51);var Oe=function(e,t,n){!function(e,t,n){var r=e.key+"-"+t.name;!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles)}(e,t,n);var r=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var a=t;do{e.insert(t===a?"."+r:"",a,e.sheet,!0),a=a.next}while(void 0!==a)}},je={animationIterationCount:1,aspectRatio: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},_e=/[A-Z]|^ms/g,xe=/_EMO_([^_]+?)_([^]*?)_EMO_/g,we=function(e){return 45===e.charCodeAt(1)},Ee=function(e){return null!=e&&"boolean"!=typeof e},Se=O((function(e){return we(e)?e:e.replace(_e,"-$&").toLowerCase()})),ke=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(xe,(function(e,t,n){return Pe={name:t,styles:n,next:Pe},t}))}return 1===je[e]||we(e)||"number"!=typeof t||0===t?t:t+"px"};function Ce(e,t,n){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 Pe={name:n.name,styles:n.styles,next:Pe},n.name;if(void 0!==n.styles){var r=n.next;if(void 0!==r)for(;void 0!==r;)Pe={name:r.name,styles:r.styles,next:Pe},r=r.next;return n.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var a=0;a=4;++r,a-=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(a){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)}(a)+s,styles:a,next:Pe}},Me=(!!v.useInsertionEffect&&v.useInsertionEffect||v.useLayoutEffect,v.createContext("undefined"!=typeof HTMLElement?ge({key:"css"}):null));Me.Provider;var Ne=function(e){return Object(v.forwardRef)((function(t,n){var r=Object(v.useContext)(Me);return e(t,r,n)}))},$e=v.createContext({}),Re=_,Te=function(e){return"theme"!==e},Fe=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?Re:Te},Le=function(e,t,n){var r;if(t){var a=t.shouldForwardProp;r=e.__emotion_forwardProp&&a?function(t){return e.__emotion_forwardProp(t)&&a(t)}:a}return"function"!=typeof r&&n&&(r=e.__emotion_forwardProp),r},De=function(){return null},Be=function e(t,n){var r,a,i=t.__emotion_real===t,c=i&&t.__emotion_base||t;void 0!==n&&(r=n.label,a=n.target);var o=Le(t,n,i),s=o||Fe(c),l=!s("as");return function(){var u=arguments,p=i&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==r&&p.push("label:"+r+";"),null==u[0]||void 0===u[0].raw)p.push.apply(p,u);else{p.push(u[0][0]);for(var m=u.length,f=1;f div {\n\t\tmargin-left: 8px;\n\t}\n\n\tsvg {\n\t\tdisplay: block;\n\n\t\t&:hover {\n\t\t\tcursor: pointer;\n\t\t}\n\t}\n"]))),Ke=Ye(c.Popover)(Ie||(Ie=y()(["\n\t.components-popover__content {\n\t\tpadding: 20px;\n\t\twidth: 200px;\n\t}\n"]))),Je=Ye(c.ToggleControl)(Ze||(Ze=y()(["\n\t&& {\n\t\t.components-base-control__field {\n\t\t\tmargin-bottom: 0;\n\t\t}\n\t}\n"]))),et=n(52),tt=n.n(et),nt=Ye(c.Card)(Ve||(Ve=y()(["\n\tpadding: 30px;\n\n\t&& {\n\t\tbox-shadow: 0 2px 6px 0 rgba( 0, 0, 0, 0.05 );\n\t\tborder: 1px solid #ccc;\n\t\twidth: 100%;\n\t}\n"]))),rt=Ye(c.CardHeader)(He||(He=y()(["\n\t&&& {\n\t\tpadding: 0 0 30px;\n\t}\n\n\th1 {\n\t\tfont-size: 26px;\n\t\tline-height: 1;\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t}\n\n\tsmall {\n\t\tcolor: #c0c0c0;\n\t\tfont-size: 13px;\n\t\tfont-weight: normal;\n\t\tdisplay: block;\n\t\tmargin: 0 0 3px;\n\t}\n"]))),at=Ye(c.CardFooter)(Ge||(Ge=y()(["\n\t&&& {\n\t\tpadding: 30px 0 0;\n\t}\n"]))),it=Ye(c.CardBody)(qe||(qe=y()(["\n\t&&& {\n\t\tpadding: 30px 0;\n\t}\n\n\t> * {\n\t\tmargin: 0 0 2rem;\n\n\t\t&:last-child {\n\t\t\tmargin-bottom: 0;\n\t\t}\n\t}\n\n\t> p {\n\t\tcolor: #555555;\n\t\tfont-size: 15px;\n\t}\n"]))),ct=["title","supTitle","children"];function ot(e){return Object(i.createElement)(nt,e)}function st(e){var t=e.title,n=e.supTitle,r=e.children,a=tt()(e,ct);return Object(i.createElement)(rt,a,Object(i.createElement)("div",null,n&&Object(i.createElement)("small",null,n),t&&Object(i.createElement)("h1",null,t)),r)}function lt(e){return Object(i.createElement)(at,e)}function ut(e){return Object(i.createElement)(it,e)}var pt,mt=simpaySetupWizard.adminUrl;function ft(e){var t=e.isFirst,n=Object(i.useState)(!1),r=a()(n,2),s=r[0],l=r[1];return Object(i.createElement)(c.Flex,{justify:"center"},s&&Object(i.createElement)(c.Modal,{title:Object(o.__)("Are you sure you want to exit the wizard?","stripe"),onRequestClose:function(){return l(!1)}},Object(i.createElement)("p",{style:{marginBottom:"2rem"}},Object(o.__)("Manual setup is only recommended for experienced users.","stripe")),Object(i.createElement)(c.Flex,null,Object(i.createElement)(c.Button,{href:mt,isDestructive:!0,variant:"destructive"},Object(o.__)("Exit Setup Wizard","stripe")),Object(i.createElement)(c.Button,{variant:"primary",isPrimary:!0,onClick:function(){return l(!1)}},Object(o.__)("Continue Setup","stripe")))),Object(i.createElement)(c.Button,{isLink:!0,variant:"link",className:"simpay-setup-wizard-subtle-link",onClick:function(){return l(!0)}},t?Object(o.__)("Go back to the Dashboard","stripe"):Object(o.__)("Close and exit the Setup Wizard","stripe")))}var dt=Ye(c.Button)(pt||(pt=y()(["\n\t&& {\n\t\tfont-size: 16px;\n\t\tfont-weight: bold;\n\t\tpadding: 15px 30px !important;\n\t\theight: auto;\n\t}\n"]))),bt=Object(i.forwardRef)((function(e,t){return Object(i.createElement)(dt,g()({isPrimary:!0,variant:"primary"},e,{ref:t}))}));function yt(e){return e.width,Object(i.createElement)("svg",{width:"311",height:"41",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(i.createElement)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.352 0C1.052 0 0 1.02 0 2.277v30.746C0 34.281 1.053 35.3 2.352 35.3h28.806c.975 0 1.764-.764 1.764-1.708 0-.943-.79-1.708-1.763-1.708H5.29c-.974 0-1.764-.765-1.764-1.708v-17.08c0-.944.79-1.709 1.764-1.709h44.092c1.299 0 2.352-1.02 2.352-2.277V2.277C51.735 1.02 50.682 0 49.383 0H2.352Zm55.262 24.198h-1.47v-1.993c0-4.088-3.422-7.402-7.643-7.402-4.22 0-7.642 3.314-7.642 7.402v1.993H38.8c-1.299 0-2.352 1.02-2.352 2.277v11.387c0 1.258 1.053 2.278 2.352 2.278h18.813c1.299 0 2.351-1.02 2.351-2.278V26.475c0-1.258-1.053-2.277-2.351-2.277Zm-4.997-1.993v1.993h-8.23v-1.993c0-2.201 1.842-3.985 4.114-3.985 2.273 0 4.116 1.784 4.116 3.985ZM8.23 20.497c0-.629.526-1.139 1.175-1.139H28.22c.65 0 1.176.51 1.176 1.139s-.527 1.139-1.176 1.139H9.406c-.649 0-1.175-.51-1.175-1.139Zm0 5.124c0-.629.526-1.138 1.175-1.138h7.055c.65 0 1.176.51 1.176 1.138 0 .63-.527 1.139-1.176 1.139H9.406c-.649 0-1.175-.51-1.175-1.139Zm31.158 11.672V27.045h17.637v10.248H39.389Z",fill:"#428BCA"}),Object(i.createElement)("path",{d:"M81.08 30.745h5.288l5.41-17.186 5.596 17.187h5.289l7.84-24.29h-5.288l-5.289 17.956L94.7 6.457h-5.842L83.785 24.38 78.528 6.457h-5.289l7.84 24.288Zm31.511 0h4.796v-8.793h6.456c5.319 0 8.302-3.228 8.302-7.963 0-4.735-2.983-7.532-8.302-7.532h-11.252v24.288Zm4.796-13.405V11.1h5.288c2.952 0 4.52 1.168 4.52 3.104 0 1.968-1.507 3.136-4.366 3.136h-5.442Zm35.473 13.897c6.303 0 10.023-3.197 10.023-7.747 0-10.3-14.789-4.581-14.789-10.085 0-1.906 1.599-3.013 4.52-3.013 2.859 0 4.519 1.322 4.704 3.567h5.288c0-4.92-4.089-7.994-9.9-7.994-5.872 0-9.562 2.89-9.562 7.502 0 10.268 14.758 4.642 14.758 10.084 0 1.998-1.752 3.26-4.919 3.26-3.228 0-5.073-1.6-5.165-4.305h-5.381c0 5.503 4.274 8.731 10.423 8.731Zm15.137-18.447c1.66 0 2.89-1.23 2.89-2.89 0-1.66-1.23-2.829-2.89-2.829-1.691 0-2.921 1.169-2.921 2.83 0 1.66 1.23 2.89 2.921 2.89Zm-2.306 17.956h4.581V14.758h-4.581v15.988Zm7.696-.001h4.55v-8.178c0-2.644 1.384-4.366 3.597-4.366 1.968 0 3.136 1.415 3.136 3.751v8.793h4.612v-8.178c0-2.644 1.384-4.366 3.597-4.366 1.968 0 3.136 1.415 3.136 3.751v8.793h4.643v-9.039c0-4.888-1.968-7.44-5.965-7.44-2.459 0-4.642.86-6.21 3.044-.892-2.03-2.583-3.044-5.135-3.044-2.552 0-4.335 1.076-5.411 2.798v-2.306h-4.55v15.988Zm30.183 6.15h4.551v-8.24c1.106 1.63 2.859 2.582 5.38 2.582 4.028 0 6.887-3.504 6.887-8.424 0-5.011-2.859-8.547-6.887-8.547-2.521 0-4.274.953-5.38 2.583v-2.091h-4.551v22.137Zm8.363-9.593c-2.244 0-3.843-1.875-3.843-4.52 0-2.674 1.599-4.58 3.843-4.58 2.275 0 3.874 1.906 3.874 4.58 0 2.645-1.599 4.52-3.874 4.52Zm10.651 3.443h4.551V6.457h-4.551v24.288Zm15.443.492c3.905 0 6.918-2.213 7.41-5.688h-4.551c-.184 1.107-1.229 1.968-2.828 1.968-2.368 0-3.536-1.353-3.751-3.412h11.222v-1.476c0-5.104-3.259-8.363-7.502-8.363-4.919 0-8.363 3.505-8.363 8.455 0 4.98 3.444 8.516 8.363 8.516Zm-3.689-9.93c.276-1.845 1.352-3.106 3.505-3.106 1.937 0 3.013 1.322 3.105 3.106h-6.61Zm22.358 9.438h4.796v-8.793h6.457c5.319 0 8.301-3.228 8.301-7.963 0-4.735-2.982-7.532-8.301-7.532h-11.253v24.288Zm4.796-13.405V11.1h5.288c2.952 0 4.52 1.168 4.52 3.104 0 1.968-1.507 3.136-4.366 3.136h-5.442Zm20.704 13.897c2.736 0 4.458-1.23 5.257-3.228.4 2.183 2.152 3.413 5.688 2.613v-3.259c-1.261.123-1.507-.338-1.507-1.66v-5.411c0-3.782-2.644-6.026-7.317-6.026-4.612 0-7.317 2.275-7.317 6.118h4.488c0-1.383 1.015-2.183 2.768-2.183 1.906 0 2.859.769 2.828 2.091v.492l-3.659.43c-4.519.523-7.071 2.368-7.071 5.258 0 2.429 1.722 4.765 5.842 4.765Zm.922-3.382c-1.414 0-2.183-.645-2.183-1.63 0-1.167 1.507-1.629 4.397-1.998l1.568-.153c-.277 2.152-1.599 3.781-3.782 3.781Zm11.126 9.04h1.967c3.936 0 6.641-1.077 8.271-4.981L311 14.758h-4.766l-3.996 10.669-4.797-10.67h-4.796l7.225 16.234c-1.014 1.446-2.06 1.907-4.058 1.876h-1.568v4.028Z",fill:"#428BCA"}))}var ht=n(17);function gt(e){var t=Object(ht.useSelect)((function(e){return Object(u.filter)(e("core/notices").getNotices(),{type:"snackbar"})}),[]),n=Object(ht.useDispatch)("core/notices").removeNotice;return 0===t.length?null:Object(i.createElement)(c.SnackbarList,g()({onRemove:n,notices:t},e))}var vt,Ot,jt,_t,xt,wt=n(64),Et=Ye.div(vt||(vt=y()(["\n\tmax-width: 80%;\n\tdisplay: flex;\n\talign-items: center;\n\n\t> * {\n\t\tmargin-right: 8px;\n\n\t\t&:last-child {\n\t\t\tmargin-right: 0;\n\t\t}\n\t}\n"]))),St={current:"var(--wp-admin-theme-color)",complete:"var(--wp-admin-theme-color)",incomplete:"#c0c0c0"},kt=Ye.div(Ot||(Ot=y()(["\n\twidth: 16px;\n\theight: 16px;\n\tborder-radius: 50%;\n\tbackground-color: ",";\n\tflex-shrink: 0;\n\tposition: relative;\n\ttransition: backgroundColor 0.2s ease-in-out;\n\n\tsvg {\n\t\tfill: #fff;\n\t\tposition: absolute;\n\t\tleft: -1px;\n\t\ttop: -1px;\n\t\ttransition: opacity 0.2s ease-in-out;\n\t\topacity: ",";\n\t}\n\n\tdiv {\n\t\topacity: ",";\n\t}\n\n\tpath {\n\t\tstroke: #fff;\n\t}\n"])),(function(e){return St[e.status]}),(function(e){return e.isComplete?"1":"0"}),(function(e){var t=e.isCurrent,n=e.isComplete;return t&&!n?"1":"0"})),Ct=Ye.div(jt||(jt=y()(["\n\twidth: 6px;\n\theight: 6px;\n\tbackground-color: #f0f0f1;\n\tborder-radius: 50%;\n\tposition: absolute;\n\ttop: 5px;\n\tleft: 5px;\n\ttransition: opacity 0.2s ease-in-out;\n"]))),Pt=Ye.div(_t||(_t=y()(["\n\twidth: 100%;\n\theight: 2px;\n\tbackground-color: rgba( 192, 192, 192, 0.5 );\n\twidth: 100px;\n"])));function zt(e){for(var t=e.current,n=e.total,r=[],a=1;a<=n;a++){var c="incomplete";a * {\n\t\tmargin: 25px 0;\n\t}\n"])));function Nt(e){return Object(i.createElement)(Mt,e)}var $t=Ye(c.Button)(At||(At=y()(["\n\t&&&& {\n\t\tfont-size: 16px;\n\t\tfont-weight: bold;\n\t\tpadding: 13px 30px 12px !important;\n\t\theight: auto;\n\t\tbackground-color: #635bff;\n\n\t\t&:focus {\n\t\t\tbackground-color: #635bff;\n\t\t\tbox-shadow: inset 0 0 0 1px #fff,\n\t\t\t\t0 0 0 var( --wp-admin-border-width-focus ) #635bff;\n\t\t}\n\n\t\t&:hover {\n\t\t\tbackground-color: #0a2540 !important;\n\t\t}\n\n\t\t&:focus:hover {\n\t\t\tbox-shadow: inset 0 0 0 1px #fff,\n\t\t\t\t0 0 0 var( --wp-admin-border-width-focus ) #0a2540;\n\t\t}\n\n\t\tsvg {\n\t\t\tmargin-left: 5px;\n\t\t}\n\t}\n"]))),Rt=Object(i.forwardRef)((function(e,t){return Object(i.createElement)($t,g()({isPrimary:!0,variant:"primary"},e,{ref:t}))}));function Tt(){return Object(i.createElement)("svg",{width:56,height:23,fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(i.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M55.742 11.884c0-3.93-1.92-7.032-5.59-7.032-3.684 0-5.914 3.101-5.914 7.001 0 4.622 2.632 6.955 6.41 6.955 1.843 0 3.236-.414 4.29-.998v-3.07c-1.053.522-2.261.844-3.794.844-1.502 0-2.834-.522-3.004-2.334h7.572c0-.2.03-.998.03-1.366Zm-7.649-1.459c0-1.735 1.069-2.456 2.044-2.456.945 0 1.951.721 1.951 2.456h-3.995Zm-9.832-5.573c-1.517 0-2.493.706-3.035 1.197l-.201-.952h-3.407V23l3.871-.814.016-4.345c.557.4 1.378.967 2.74.967 2.772 0 5.296-2.21 5.296-7.078-.015-4.452-2.57-6.878-5.28-6.878Zm-.929 10.579c-.913 0-1.456-.323-1.827-.722l-.016-5.696c.403-.446.96-.753 1.843-.753 1.41 0 2.385 1.566 2.385 3.578 0 2.057-.96 3.593-2.385 3.593ZM26.292 3.946l3.886-.83V0l-3.886.814v3.132Zm0 1.167h3.886v13.434h-3.886V5.113Zm-4.165 1.136-.248-1.136h-3.345v13.434h3.871V9.443c.914-1.183 2.462-.968 2.942-.799V5.113c-.495-.184-2.307-.522-3.22 1.136Zm-7.742-4.468-3.778.798-.016 12.299c0 2.272 1.719 3.946 4.01 3.946 1.27 0 2.2-.23 2.71-.507V15.2c-.495.2-2.942.906-2.942-1.366v-5.45h2.942V5.112H14.37l.016-3.332ZM3.917 9.013c0-.6.496-.83 1.317-.83 1.176 0 2.663.354 3.84.983V5.558c-1.286-.507-2.555-.706-3.84-.706C2.09 4.852 0 6.479 0 9.197c0 4.238 5.884 3.562 5.884 5.39 0 .705-.62.936-1.487.936-1.285 0-2.926-.522-4.227-1.229v3.655c1.44.614 2.896.875 4.227.875 3.221 0 5.435-1.582 5.435-4.33-.015-4.575-5.915-3.762-5.915-5.481Z",fill:"#fff"}))}var Ft=n(11),Lt=n.n(Ft);function Dt(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 Bt(e){for(var t=1;tWP Simple Pay account or purchase receipt email.","stripe"),{strong:Object(i.createElement)("strong",null),a:Object(i.createElement)("a",{href:Jt,target:"_blank",rel:"noopener noreferrer"})})),Object(i.createElement)(c.TextControl,{label:Object(o.__)("License Key","stripe"),value:l,className:_,onChange:function(e){return u(e)},disabled:d,help:g||Object(o.__)("An active license ensures automatic updates and the latest features.","stripe"),ref:j})),Object(i.createElement)(lt,{justify:"flex-end",align:"center"},Object(i.createElement)(bt,{onClick:function(){b(!0);var e=new FormData;e.append("action","simpay_activate_license"),e.append("nonce",en),e.append("license",l),m()({url:Kt,method:"POST",body:e}).then((function(e){var r=e.success,a=e.data,i=a.message,c=a.license;if(!r)throw{message:i};n(c),O(Object(o.__)("License activated","stripe"),{type:"snackbar"}),b(!1),t()})).catch((function(e){var t=e.message;v(t),b(!1)}))},disabled:""===l||d,isBusy:d},Object(o.__)("Activate and Continue →","stripe"))))}},{id:"stripe",title:Object(o.__)("Connect to Stripe","stripe"),content:wn},{id:"emails",title:Object(o.__)("Configure Emails","stripe"),content:function(e){var t=e.goPrev,n=e.goNext,r=e.licenseData,a=Wt(),s=a.settings,l=a.rawSettings,p=a.discardChanges,m=a.editSettings,f=a.saveSettings,d=Object(i.useRef)();if(Object(i.useLayoutEffect)((function(){d.current&&d.current.focus()}),[l]),Object(u.isEmpty)(s))return Object(i.createElement)(ut,null,Object(i.createElement)(c.Spinner,null));var b=s["email_payment-confirmation"],y=s["email_payment-notification"],h=s["email_payment-notification_to"],g=s["email_upcoming-invoice"],v=s["email_invoice-confirmation"],O=r.features,j=O.subscriptions,_=O.enhanced_subscriptions;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(ut,null,Object(i.createElement)("ul",{className:"simpay-setup-wizard-toggle-list"},Object(i.createElement)("li",null,Object(i.createElement)("label",{htmlFor:"email_payment-confirmation"},Object(i.createElement)("h3",null,Object(o.__)("Payment Receipt","stripe")),Object(i.createElement)("p",null,Object(o.__)("Send a payment receipt email to the customer upon successful payment.","stripe"))),Object(i.createElement)(c.FormToggle,{id:"email_payment-confirmation",checked:"no"!==b,onChange:function(e){var t=e.target;return m({"email_payment-confirmation":t.checked?"yes":"no"})}})),Object(i.createElement)("li",null,Object(i.createElement)("label",{htmlFor:"email_payment-notification"},Object(i.createElement)("h3",null,Object(o.__)("Payment Notification","stripe")),Object(i.createElement)("p",null,Object(o.__)("Receive an email notification when a new payment is made.","stripe"))),Object(i.createElement)(c.FormToggle,{id:"email_payment-notification",checked:"no"!==y,onChange:function(e){var t=e.target;return m({"email_payment-notification":t.checked?"yes":"no"})}})),"no"!==y&&Object(i.createElement)("li",{className:"simpay-setup-wizard-toggle-list__child"},Object(i.createElement)(c.TextControl,{label:Object(o.__)("Send to:","stripe"),value:h,onChange:function(e){return m({"email_payment-notification_to":e})}})),_&&Object(i.createElement)("li",null,Object(i.createElement)("label",{htmlFor:"email_invoice-confirmation"},Object(i.createElement)("h3",null,Object(o.__)("Invoice Receipt","stripe")),Object(i.createElement)("p",null,Object(o.__)("Send a payment receipt email to the customer upon successful invoice.","stripe"))),Object(i.createElement)(c.FormToggle,{id:"email_payment-confirmation",checked:"no"!==v,onChange:function(e){var t=e.target;return m({"email_invoice-confirmation":t.checked?"yes":"no"})}})),j&&Object(i.createElement)("li",null,Object(i.createElement)("label",{htmlFor:"email_upcoming-invoice"},Object(i.createElement)("h3",null,Object(o.__)("Upcoming Invoice","stripe")),Object(i.createElement)("p",null,Object(o.__)("Remind customers of upcoming invoices and allow payment method changes.","stripe"))),Object(i.createElement)(c.FormToggle,{id:"email_upcoming-invoice",checked:"no"!==g,onChange:function(e){var t=e.target;return m({"email_upcoming-invoice":t.checked?"yes":"no"})}})))),Object(i.createElement)(lt,{justify:"space-between",align:"center"},Object(i.createElement)("div",null,Object(i.createElement)(c.Button,{isLink:!0,variant:"link",onClick:t,className:"simpay-setup-wizard-subtle-link"},Object(o.__)("← Previous Step","stripe"))),Object(i.createElement)("div",{style:{display:"flex",justifyContent:"center"}},Object(i.createElement)(c.Button,{isLink:!0,variant:"link",onClick:function(){p(),n()},style:{marginRight:"16px"},className:"simpay-setup-wizard-subtle-link"},Object(o.__)("Skip Step","stripe")),Object(i.createElement)(bt,{onClick:function(){f(),n()},ref:d},Object(o.__)("Save and Continue →","stripe")))))}},{id:"next-steps",title:Object(o.__)("🎉 Setup Complete","stripe"),content:function(){return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(ut,null,Object(i.createElement)("div",{className:"simpay-setup-wizard-content-list"},Object(i.createElement)("div",{className:"simpay-setup-wizard-content-list__content"},Object(i.createElement)("p",null,Object(o.__)("Congratulations, you’re ready to start accepting payments!","stripe")),Object(i.createElement)("p",null,Object(o.__)("WP Simple Pay is just that: simple. Create your first payment form below to start collecting payments, or fine-tune your setup through some of these suggestions:","stripe"))),Object(i.createElement)("div",{className:"simpay-setup-wizard-content-list__list"},Object(i.createElement)("ul",{className:"simpay-setup-wizard-bullet-list"},Object(i.createElement)("li",null,Object(i.createElement)("a",{href:bn,target:"_blank",rel:"noopener noreferrer"},Object(o.__)("Collect tax or GST","stripe"))),Object(i.createElement)("li",null,Object(i.createElement)("a",{href:yn,target:"_blank",rel:"noopener noreferrer"},Object(o.__)("Add anti-spam protection","stripe"))),Object(i.createElement)("li",null,Object(i.createElement)("a",{href:hn,target:"_blank",rel:"noopener noreferrer"},Object(o.__)("Change the default currency","stripe"))),Object(i.createElement)("li",null,Object(i.createElement)("a",{href:gn,target:"_blank",rel:"noopener noreferrer"},Object(o.__)("Customize receipts","stripe")))))),Object(i.createElement)("hr",null),Object(i.createElement)("div",{className:"simpay-setup-wizard-doc-suggestions"},Object(i.createElement)("div",null,Object(i.createElement)("h3",null,Object(o.__)("Accept Donations","stripe")),Object(i.createElement)("p",null,Object(o.__)("Easily fundraise or accept donations online via 135+ supported currencies. Offer one-time or recurring donations of fixed or user-defined amounts.","stripe")),Object(i.createElement)(c.Button,{href:vn,variant:"secondary",isSecondary:!0,target:"_blank",rel:"noopener noreferrer"},Object(o.__)("View Walkthrough","stripe"))),Object(i.createElement)("div",null,Object(i.createElement)("h3",null,Object(o.__)("Reconcile Invoices","stripe")),Object(i.createElement)("p",null,Object(o.__)("Collect additional custom data on your payment forms such as an Invoice ID to reconcile invoices against your own invoicing system.","stripe")),Object(i.createElement)(c.Button,{href:On,variant:"secondary",isSecondary:!0,target:"_blank",rel:"noopener noreferrer"},Object(o.__)("View Walkthrough","stripe"))))),Object(i.createElement)(lt,{justify:"space-between",align:"center"},Object(i.createElement)("div",{style:{flexBasis:"100%"}},Object(i.createElement)(c.Button,{isLink:!0,variant:"link",href:fn,className:"simpay-setup-wizard-subtle-link",icon:Object(i.createElement)(f.a,{icon:rn})},Object(o.__)("Return to Dashboard","stripe"))),Object(i.createElement)(c.Flex,{justify:"flex-end",gap:4},Object(i.createElement)(bt,{href:dn},Object(o.__)("Create a Payment Form →","stripe")))))}}],lite:[{id:"stripe",title:Object(o.__)("Connect to Stripe","stripe"),content:wn},{id:"analytics",title:Object(o.__)("Help Improve WP Simple Pay + Smart Recommendations","stripe"),content:function(e){var t=e.goPrev,n=e.goNext,r=Wt(),s=r.settings,l=r.rawSettings,p=r.discardChanges,b=r.editSettings,y=r.saveSettings,h=Object(i.useState)(!0),g=a()(h,2),v=g[0],O=g[1],j=Object(i.useState)(Ht),_=a()(j,2),x=_[0],w=_[1],E=Object(i.useState)(!1),S=a()(E,2),k=S[0],C=S[1],P=Object(i.useState)(!1),z=a()(P,2),A=z[0],M=z[1],N=Object(i.useRef)();return Object(i.useLayoutEffect)((function(){N.current&&N.current.focus()}),[l]),Object(u.isEmpty)(s)?Object(i.createElement)(ut,null,Object(i.createElement)(c.Spinner,null)):Object(i.createElement)(i.Fragment,null,Object(i.createElement)(ut,null,Object(i.createElement)("p",null,Object(o.__)("Get helpful suggestions from WP Simple Pay on how to optimize your payment forms and grow your business or increase donations.","stripe")),Object(i.createElement)(c.TextControl,{label:Object(o.__)("Your Email Address:","stripe"),value:x,className:"simpay-setup-wizard-large-input",onChange:function(e){return w(e)},help:Object(o.__)("Your email is needed so you receive recommendations.","stripe"),ref:N,disabled:k}),Object(i.createElement)("hr",null),Object(i.createElement)(Xe,null,Object(i.createElement)(Qe,null,Object(o.__)("Help make WP Simple Pay better for everyone","stripe"),Object(i.createElement)("div",null,A&&Object(i.createElement)(Ke,{position:"top center"},Object(o.__)("By allowing us to track usage data we can better help you because we know which WordPress configurations, themes, and plugins we should test.","stripe")),Object(i.createElement)(f.a,{size:20,icon:d.a,onMouseEnter:function(){return M(!0)},onMouseLeave:function(){return M(!1)}}))),Object(i.createElement)(Je,{label:Object(o.__)("Yes, count me in","stripe"),id:"email_payment-confirmation",checked:v,disabled:k,onChange:function(e){O(e)}}))),Object(i.createElement)(lt,{justify:"space-between",align:"center"},Object(i.createElement)("div",null,Object(i.createElement)(c.Button,{isLink:!0,variant:"link",onClick:t,className:"simpay-setup-wizard-subtle-link",disabled:k},Object(o.__)("← Previous Step","stripe"))),Object(i.createElement)("div",{style:{display:"flex",justifyContent:"center"}},Object(i.createElement)(c.Button,{isLink:!0,variant:"link",onClick:function(){p(),n()},style:{marginRight:"16px"},className:"simpay-setup-wizard-subtle-link",disabled:k},Object(o.__)("Skip Step","stripe")),Object(i.createElement)(bt,{onClick:function(){C(!0),b({usage_tracking_opt_in:v?"yes":"no"}),y();var e=new FormData;e.append("action","simpay_setup_wizard_subscribe_email"),e.append("nonce",Gt),e.append("email",x),m()({url:qt,method:"POST",body:e}).finally((function(){C(!1),n()}))},isBusy:k,disabled:k},Object(o.__)("Save and Continue →","stripe")))))}},{id:"next-steps",title:Object(o.__)("🎉 Setup Complete","stripe"),content:function(){return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(ut,null,Object(i.createElement)(c.Flex,{justify:"space-between",align:"center",className:"simpay-setup-wizard-content-list"},Object(i.createElement)("div",{className:"simpay-setup-wizard-content-list__content"},Object(i.createElement)("p",null,Object(o.__)("Congratulations, you’re ready to start easily and securely accepting payments with WP Simple Pay!","stripe"))),Object(i.createElement)("div",null,Object(i.createElement)(bt,{href:ln},Object(o.__)("Create a Payment Form →","stripe")))),Object(i.createElement)("hr",null),Object(i.createElement)(an,null,Object(i.createElement)("h4",null,Object(o.__)("Special Upgrade Offer - Save 50%","stripe")),Object(i.createElement)("h3",null,Object(o.__)("Upgrade to WP Simple Pay Pro Today and Save","stripe")),Object(i.createElement)(cn,{className:"simpay-setup-wizard-check-list"},pn.map((function(e){return Object(i.createElement)("li",{key:e},Object(i.createElement)(f.a,{icon:wt.a}),e)}))),Object(i.createElement)(c.Button,{isLarge:!0,isSecondary:!0,variant:"secondary",href:un,target:"_blank",rel:"noopener noreferrer"},Object(o.__)("Upgrade to WP Simple Pay Pro","stripe")))),Object(i.createElement)(lt,{justify:"center"},Object(i.createElement)(c.Button,{isLink:!0,variant:"link",href:sn,className:"simpay-setup-wizard-subtle-link",icon:Object(i.createElement)(f.a,{icon:rn})},Object(o.__)("Return to Dashboard","stripe"))))}}]},Cn=simpaySetupWizard,Pn=Cn.license,zn=Cn.adminUrl,An=Pn.is_lite;Object(i.render)(Object(i.createElement)((function(){var e=kn[!0===An?"lite":"pro"],t=Object(s.getQueryArg)(window.location.href,"step"),n=Object(i.useState)(Pn),r=a()(n,2),u=r[0],p=r[1],m=function(e){var t=e.steps,n=e.currentStepId,r=t.findIndex((function(e){return e.id===n}))||0,c=Object(i.useState)(r),o=a()(c,2),l=o[0],u=o[1];function p(e){u(e),window.history.pushState({},"",Object(s.addQueryArgs)(window.location.href,{step:t[e].id}))}return Object(i.useEffect)((function(){var e=function(){var e=Object(s.getQueryArg)(window.location.search,"step"),n=t.findIndex((function(t){return t.id===e}))||0;u(n)};return window.addEventListener("popstate",e),window.addEventListener("pushstate",e),function(){window.removeEventListener("popstate",e),window.removeEventListener("pushstate",e)}}),[]),{currentStep:l,setCurrentStep:u,hasNext:l0}}({steps:e,currentStepId:t}),f=m.currentStep,d=m.goNext,b=m.goPrev,y=m.hasNext,h=m.hasPrev;if(-1===f)return Object(i.createElement)(Sn,{steps:e,goNext:d});var g=e[f],v=g.content;return Object(i.createElement)(c.SlotFillProvider,null,Object(i.createElement)(l.EntityProvider,{kind:"root",type:"site"},Object(i.createElement)(Nt,null,Object(i.createElement)("a",{href:zn},Object(i.createElement)(yt,{width:"250px"})),Object(i.createElement)(zt,{current:f+1,total:e.length}),Object(i.createElement)(ot,{isRounded:!0},Object(i.createElement)(st,{supTitle:Object(o.sprintf)(/* translators: %1$d current step count. %2$d total step count*/ Object(o.__)("Step %1$d of %2$d","stripe"),f+1,e.length),title:g.title}),Object(i.createElement)(v,{steps:e,currentStep:f,goPrev:b,goNext:d,hasNext:y,hasPrev:h,licenseData:u,setLicenseData:p})),y&&Object(i.createElement)(ft,null)),Object(i.createElement)(gt,{className:"simpay-setup-wizard-toasts"}),Object(i.createElement)(c.Popover.Slot,null)))}),null),document.getElementById("simpay-setup-wizard"))}]); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin.js b/includes/core/assets/js/dist/simpay-admin.js index 2e7940ca..e98243df 100644 --- a/includes/core/assets/js/dist/simpay-admin.js +++ b/includes/core/assets/js/dist/simpay-admin.js @@ -1 +1 @@ -!function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.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 a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));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=32)}([function(e,t,n){"use strict";function r(e){"complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",e):e()}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return c}));var r=n(9),a=n.n(r),i=n(5),o=n.n(i);function c(_x,e){return s.apply(this,arguments)}function s(){return(s=a()(o.a.mark((function t(n,r){return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.ajax({data:r,method:"POST",url:"".concat(wpApiSettings.root,"wpsp/").concat(n),beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",wpApiSettings.nonce)}});case 3:return t.abrupt("return",t.sent);case 6:throw t.prev=6,t.t0=t.catch(0),t.t0.responseJSON;case 10:case"end":return t.stop()}}),t,null,[[0,6]])})))).apply(this,arguments)}}).call(this,n(7))},function(e,t,n){var r=n(18);e.exports=function(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";var r=n(27);n.o(r,"maybeBlockButtonWithUpgradeModal")&&n.d(t,"maybeBlockButtonWithUpgradeModal",(function(){return r.maybeBlockButtonWithUpgradeModal})),n.o(r,"maybeBlockCheckboxWithUpgradeModal")&&n.d(t,"maybeBlockCheckboxWithUpgradeModal",(function(){return r.maybeBlockCheckboxWithUpgradeModal})),n.o(r,"maybeBlockSelectWithUpgradeModal")&&n.d(t,"maybeBlockSelectWithUpgradeModal",(function(){return r.maybeBlockSelectWithUpgradeModal})),n.o(r,"upgradeModal")&&n.d(t,"upgradeModal",(function(){return r.upgradeModal})),n(15);var a=n(28);n.d(t,"maybeBlockButtonWithUpgradeModal",(function(){return a.a})),n.d(t,"maybeBlockCheckboxWithUpgradeModal",(function(){return a.b})),n.d(t,"maybeBlockSelectWithUpgradeModal",(function(){return a.c})),n.d(t,"upgradeModal",(function(){return a.d}))},function(e,t){var n=/^(?:submit|button|image|reset|file)$/i,r=/^(?:input|select|textarea|keygen)/i,a=/(\[[^\[\]]*\])/g;function i(e,t,n){if(t.match(a))!function e(t,n,r){if(0===n.length)return r;var a=n.shift(),i=a.match(/^\[(.+?)\]$/);if("[]"===a)return t=t||[],Array.isArray(t)?t.push(e(null,n,r)):(t._values=t._values||[],t._values.push(e(null,n,r))),t;if(i){var o=i[1],c=+o;isNaN(c)?(t=t||{})[o]=e(t[o],n,r):(t=t||[])[c]=e(t[c],n,r)}else t[a]=e(t[a],n,r);return t}(e,function(e){var t=[],n=new RegExp(a),r=/^([^\[\]]*)/.exec(e);for(r[1]&&t.push(r[1]);null!==(r=n.exec(e));)t.push(r[1]);return t}(t),n);else{var r=e[t];r?(Array.isArray(r)||(e[t]=[r]),e[t].push(n)):e[t]=n}return e}function o(e,t,n){return n=n.replace(/(\r)?\n/g,"\r\n"),n=(n=encodeURIComponent(n)).replace(/%20/g,"+"),e+(e?"&":"")+encodeURIComponent(t)+"="+n}e.exports=function(e,t){"object"!=typeof t?t={hash:!!t}:void 0===t.hash&&(t.hash=!0);for(var a=t.hash?{}:"",c=t.serializer||(t.hash?i:o),s=e&&e.elements?e.elements:[],l=Object.create(null),u=0;u3&&void 0!==arguments[3]?arguments[3]:10;if(a(t)&&r(n))if("function"==typeof i)if("number"==typeof o){var c={callback:i,priority:o,namespace:n};if(e[t]){var s,l=e[t].handlers;for(s=l.length;s>0&&!(o>=l[s-1].priority);s--);s===l.length?l[s]=c:l.splice(s,0,c),(e.__current||[]).forEach((function(e){e.name===t&&e.currentIndex>=s&&e.currentIndex++}))}else e[t]={handlers:[c],runs:0};"hookAdded"!==t&&f("hookAdded",t,n,i,o)}else console.error("If specified, the hook priority must be a number.");else console.error("The hook callback must be a function.")}},o=function(e,t){return function(n,i){if(a(n)&&(t||r(i))){if(!e[n])return 0;var o=0;if(t)o=e[n].handlers.length,e[n]={runs:e[n].runs,handlers:[]};else for(var c=e[n].handlers,s=function(t){c[t].namespace===i&&(c.splice(t,1),o++,(e.__current||[]).forEach((function(e){e.name===n&&e.currentIndex>=t&&e.currentIndex--})))},l=c.length-1;l>=0;l--)s(l);return"hookRemoved"!==n&&f("hookRemoved",n,i),o}}},c=function(e){return function(t,n){return void 0!==n?t in e&&e[t].handlers.some((function(e){return e.namespace===n})):t in e}},s=function(e,t){return function(n){e[n]||(e[n]={handlers:[],runs:0}),e[n].runs++;for(var r=e[n].handlers,a=arguments.length,i=new Array(a>1?a-1:0),o=1;o0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=t.id,r=t.getFormData;return Object(i.a)("v2/customer",d({form_values:l()(t[0],{hash:!0}),form_data:r(),form_id:n},e))}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;t0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=t.id,r=t.getFormData;return Object(i.a)("v2/checkout-session",f({form_values:l()(t[0],{hash:!0}),form_data:r(),form_id:n},e))}n(9),n(5),n(11)},,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=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),l=o.call(i,"finallyLoc");if(s&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),q(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;q(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:M(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},n}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){var r=n(6).default;e.exports=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,t||"default");if("object"!=r(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){Number.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},Number.isSafeInteger=Number.isSafeInteger||function(e){return Number.isInteger(e)&&Math.abs(e)<=Number.MAX_SAFE_INTEGER},Number.MAX_SAFE_INTEGER||(Number.MAX_SAFE_INTEGER=9007199254740991)},function(e,t,n){"use strict";(function(e){n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return s})),n.d(t,"c",(function(){return l})),n.d(t,"d",(function(){return u}));var r=n(2),a=n.n(r);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 o(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};e(".simpay-upgrade-modal").dialog(o({position:{my:"center",at:"center",of:window},modal:!0,width:600,resizable:!1,draggable:!1,open:function(){var t=e(this);t.parent().find(".ui-dialog-titlebar").css({borderBottom:0}),t.find(".simpay-upgrade-modal__title").html(n),t.find(".simpay-upgrade-modal__description").html(r),t.find(".simpay-upgrade-modal__upgrade-url").attr("href",a),t.find(".simpay-upgrade-modal__upgrade-purchased-url").attr("href",i)}},c))}}).call(this,n(7))},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return a}));var r=n(0);function a(e,t){var n=document.getElementById("simpay-test-mode-toggle-notice");if(n)if(e!==t){var r=document.getElementById("simpay-toggle-notice-status"),a=document.getElementById("simpay-toggle-notice-status-link");n.style.display="block",r&&a&&(r.innerHTML=""+r.dataset[e]+"",a.href=a.dataset[e])}else n.style.display="none"}function i(){var t=document.querySelectorAll(".simpay-disconnect-link");if(t){var n=simpayAdmin.i18n,r=n.disconnectConfirm,a=n.disconnectCancel;t.forEach((function(t){t.addEventListener("click",(function(n){n.preventDefault(),e(".simpay-disconnect-confirm").dialog({resizable:!1,height:"auto",width:400,modal:!0,draggable:!1,open:function(){e(".ui-dialog-buttonset .ui-button").removeClass("ui-button").last().css({marginLeft:"10px"}).focus()},buttons:[{text:a,click:function(){e(this).dialog("close")},class:"button button-secondary"},{text:r,click:function(){window.location.href=t.href},class:"button button-primary"}]})}))}))}}Object(r.a)((function(){var e;(e=document.getElementById("simpay-stripe-account-info"))&&wp.ajax.send("simpay_stripe_connect_account_information",{data:{nonce:e.dataset.nonce},success:function(t){e.querySelector("p").innerHTML=t.message,e.style.display="block","simpay-stripe-activated-account-actions"===t.actions?e.classList.add("notice-info"):e.classList.add("notice-warning");var n=document.getElementById(t.actions);n&&(n.style.display="block"),i()},error:function(t){e.querySelector("p").innerHTML=t.message,e.style.display="block",e.classList.add("notice-error");var n=document.getElementById(t.actions);n&&(n.style.display="block",i())}})}))}).call(this,n(7))},,,function(e,t,n){"use strict";n.r(t),function(e){var t=n(10),r=n.n(t),a=n(8),i=(n(33),n(34),n(35),n(29));n(36),n(37),n(59),n(42),n(43),window.wpsp=window.wpsp||{hooks:a.b};var o,c,s,l=simpayAdmin,u=l.licenseLevel,d=l.i18n.trashFormConfirm,p={};p={init:function(){c=o(document.body),s=c.find("#simpay-form-settings"),this.handleMetaboxTabClick(),window.postboxes&&window.postboxes.handle_click&&s.on("click",".postbox .simpay-hndle, .postbox .simpay-handlediv",window.postboxes.handle_click),a.b.addAction("settings.toggleTestMode","wpsp/settings/stripe-connect",i.a),this.handleFormBuilderSettingToggles(),a.b.addAction("customFieldAdded","wpsp/payment-form",this.handleFormBuilderSettingToggles),s.on("click.simpayTabLink",".simpay-tab-link",(function(e){e.preventDefault(),p.handleInternalLinkToTabClicks(o(this))})),o(document).on("click.simpayImagePreview",".simpay-remove-image-preview",(function(e){p.handleRemoveImagePreviewClick(e)})),this.setupChosen(),this.addMediaFields(),this.stripeConnect(),this.initSortableFields(s.find(".simpay-custom-fields")),s.find(".add-field").on("click.simpayAddField",this.addField),s.find(".simpay-custom-fields").on("click",".simpay-remove-field-link",this.removeField);var e=o(".simpay-payment-modes");e.length&&e.find("input").each((function(){var t=o(this);e.hasClass("simpay-payment-mode--"+t.val())||t.attr("disabled",!0)})),this.bindTrashWarning(),c.trigger("simpayAdminInit"),o(".show-settings").detach().prependTo(".simpay-branding-bar__actions").removeClass().addClass("simpay-branding-bar__actions-button").html('').on("click",window.screenMeta.toggleEvent)},handleFormBuilderSettingToggles:function(){["_amount_type","_success_redirect_type","_subscription_type","_subscription_custom_amount","_form_type","_tax_status","_enable_payment_page","_inventory","_inventory_behavior","_schedule_start","_schedule_end",".simpay-total-amount-label-recurring",".simpay-total-amount-label-tax",".simpay-shipping-address",".simpay-text-multiline",".simpay-dropdown-type",".simpay-radio-type",".simpay-price-enable-custom",".simpay-price-type input",".simpay-email-link-enabled",".simpay-phone-smart-enabled"].forEach((function(e){var t=o(e),n=!1;"."!==e.substring(0,1)?t='[name="'.concat(e,'"]'):(t=e,n=!0),o("#simpay-form-settings").on("change",t,(function(){var t=o("#simpay-form-settings");!0===n&&(t=o(this).closest(".simpay-field-data"));var r=o(this).val();o(this).is(":checkbox")&&(r=o(this).is(":checked")?"yes":"no"),t.find(o('.simpay-show-if[data-if="'.concat(e,'"]'))).each((function(){var e=o(this),t=e.data("is");e.hide(),t.includes(r)&&e.show().css("display","block")}))})),o(t).filter(":checkbox").trigger("change"),o(t).filter(":checked").trigger("change"),o(t).is("select")&&o(t).trigger("change")}))},handleRemoveImagePreviewClick:function(e){e.preventDefault(),o(e.target).parents("td").find(".simpay-image-preview-wrap").val("").hide(),o(e.target).parents("td").find(".simpay-field-image-url").val(""),o(e.target).parents("td").find(".simpay-remove-image-preview").hide()},addMediaFields:function(){o(".simpay-media-uploader").on("click",(function(e){e.preventDefault();var t=wp.media.frames.file_frame=wp.media({title:simpayAdmin.i18n.mediaTitle,button:{text:simpayAdmin.i18n.mediaButtonText},multiple:!1}),n=o(this);t.on("select",(function(){var e=t.state().get("selection").first().toJSON(),r=n.parents("td").find(".simpay-field-image-url"),a="id"===r.data("fvalue")?e.id:e.url;n.parents("td").find(".simpay-image-preview-wrap").show(),n.parents("td").find(".simpay-remove-image-preview").show(),n.parents("td").find(".simpay-image-preview").prop("src",a),r.val(a)})),t.open()}))},setupChosen:function(){var e=o(".simpay-chosen-select, .simpay-chosen-search");e.chosen({disable_search_threshold:20}),e.chosen()},handleMetaboxTabClick:function(){var e=o('ul.simpay-tabs li:not([data-available="no"]) a'),t=o("div.simpay-panel"),n=e.parents("li");e.on("click",(function(e){e.preventDefault();var r=o(this).parent(),a=o(o(this).attr("href")),i=o(this).attr("href");history.pushState(null,null,i),setTimeout((function(){window.scrollTo(0,0)}),1),o('[name="simpay_form_settings_tab"]').val(i),o(".simpay-panels > .spinner").hide(),n.removeClass("active"),r.addClass("active"),t.addClass("simpay-panel-hidden"),a.removeClass("simpay-panel-hidden")}));var r="#form-display-options-settings-panel";location.hash.length&&(r=location.hash);var a=o('ul.simpay-tabs a[href="'+r+'"]');o('[name="simpay_form_settings_tab"]').val(r),a.length&&a.click()},stripeConnect:function(){var e="tr:nth-child(2), tr:nth-child(3), tr:nth-child(4), tr:nth-child(5)";o(".simpay-settings.stripe-account .form-table").find(e).hide(),o("#wpsp-api-keys-row-reveal button").on("click",(function(t){t.preventDefault(),o(".simpay-settings.stripe-account .form-table").find(e).show(),o("#wpsp-api-keys-row-hide").show(),o(this).parent().hide(),o(".wpsp-manual-key-warning").show()})),o("#wpsp-api-keys-row-hide button").on("click",(function(t){t.preventDefault(),o(".simpay-settings.stripe-account .form-table").find(e).hide(),o("#wpsp-api-keys-row-reveal").show(),o(this).parent().hide(),o(".wpsp-manual-key-warning").hide()}))},handleInternalLinkToTabClicks:function(e){var t=e.data("show-tab");c.find("."+t+"-tab a").click()},bindTrashWarning:function(){["plus","professional","elite","ultimate"].includes(u)&&(o(".post-type-simple-pay .submitdelete").click((function(e){confirm(d)||e.preventDefault()})),o(".post-type-simple-pay #posts-filter").submit((function(e){"trash"===o(this).find('select[name="action"]').val()&&(confirm(d)||e.preventDefault())})))},initSortableFields:function(e){e.sortable({items:".simpay-field-metabox:not(.simpay-custom-field-payment-button):not(.simpay-custom-field-checkout-button)",containment:"#simpay-form-settings",handle:".simpay-hndle",placeholder:"sortable-placeholder",cursor:"move",delay:o(document.body).hasClass("mobile")?200:0,distance:2,tolerance:"pointer",forcePlaceholderSize:!0,opacity:.65,stop:function(e,t){p.orderFields()},helper:function(e,t){return t.clone().find(":input").attr("name",(function(e,t){return"sort_"+parseInt(1e5*Math.random(),10).toString()+"_"+t})).end()}})},addField:function(e){var t=s.find(".simpay-custom-fields .simpay-field-metabox").length,n=o("#simpay-custom-fields-wrap").find(".simpay-metaboxes"),i=s.find("#custom-field-select"),c=i.val(),l=r()(document.querySelectorAll(".field-uid")).map((function(e){return parseInt(e.value)})),u={action:"simpay_add_field",post_id:o("#post_ID").val(),fieldType:c,counter:parseInt(t)+1,nextUid:parseInt(_.max(l))+1,addFieldNonce:s.find("#simpay_custom_fields_nonce").val()};e.preventDefault(),s.find(".simpay-field-data").each((function(){o(this).is(":visible")&&(o(this).hide(),o(this).addClass("closed"))})),o.ajax({url:ajaxurl,method:"POST",data:u,success:function(e){var t=o("
").append(e);["payment_button","checkout_button"].includes(c)?n.append(t.html()):n.prepend(t.html()),i.prop("selectedIndex",0),p.orderFields(),a.b.doAction("customFieldAdded",e)},error:function(e){window.spShared.debugLog(e)}})},removeField:function(e){if(e.preventDefault(),s.find("#custom-field-select"),window.confirm("Are you sure you want to remove this field?")){var t=o(this).closest(".simpay-field-metabox");t.data("type"),t.remove(),a.b.doAction("customFieldRemoved")}},orderFields:function(){o(".simpay-custom-fields .simpay-field-metabox").each((function(e,t){var n=parseInt(o(t).index(".simpay-custom-fields .simpay-field-metabox"));o(".field-order",t).val(n+1)}))}},(o=e)(document).ready((function(e){p.init()}))}.call(this,n(7))},function(e,t,n){"use strict";var r=n(10),a=n.n(r),i=n(0),o=simpayAdminSettingToggles||[];function c(e){var t=e.id,n=document.querySelector(".simpay-settings-".concat(t));if(!n)return{};var r=n.querySelectorAll('input[name="simpay_settings['.concat(t,']"]'));0===r.length&&(r=n.querySelectorAll('select[name="'.concat(t,'"]')));var i=r[0].value;if(["radio","checkbox"].includes(r[0].type)){var o=a()(r).filter((function(e){return e.checked}));i=0===o.length?"no":o[0].value}return{setting:r,currentValue:i}}function s(e){var t=e.id,n=e.value,r=e.toggles,a=e.compare;if("none"!==document.querySelector(".simpay-settings-".concat(t)).style.display){var i=c(e).currentValue;r.map((function(e){return document.querySelector(".simpay-settings-".concat(e))})).forEach((function(e){e&&(e.style.display="IS NOT"===a?i===n?"none":"table-row":i===n?"table-row":"none")})),r.forEach((function(e){var t=_.find(o,{id:e});t&&s(t)}))}}Object(i.a)((function(){o.forEach((function(e){s(e),c(e).setting.forEach((function(t){t.addEventListener("change",(function(){s(e)}))}))}))}))},function(e,t,n){"use strict";var r=n(0);Object(r.a)((function(){var e=window.wpsp.hooks,t=document.querySelectorAll('[name="simpay_settings[test_mode]"]');if(0!==t.length){var n="enabled"===document.querySelector('[name="simpay_settings[test_mode]"]:checked').value?"test":"live";e.doAction("settings.toggleTestMode",n,n),_.each(t,(function(t){return t.addEventListener("change",(function(t){var r="enabled"===t.target.value?"test":"live";e.doAction("settings.toggleTestMode",r,n)}))}))}}))},function(e,t,n){"use strict";var r=n(0);function a(e){var t=document.getElementById("simpay-connect-license-feedback"),n=document.getElementById("simpay-connect-license-submit");e.message?(t.innerText=e.message,t.classList.remove("simpay-license-message--valid"),t.classList.add("simpay-license-message--invalid"),t.style.display="block"):t.style.display="none",e.reload?setTimeout((function(){window.location.reload()}),2e3):(n.disabled=!1,n.innerText=n.dataset.connect)}function i(e){var t=document.getElementById("simpay-connect-license-feedback");e.message?(t.innerText=e.message,t.classList.remove("simpay-license-message--invalid"),t.classList.add("simpay-license-message--valid"),t.style.display="block"):t.style.display="none",e.reload?setTimeout((function(){window.location.reload()}),2e3):window.location=e.url}function o(){var e=document.getElementById("simpay-connect-license-key"),t=document.getElementById("simpay-connect-license-nonce"),n=document.getElementById("simpay-connect-license-submit");n.disabled=!0,n.innerText=n.dataset.connecting,wp.ajax.send("simpay_get_connect_url",{data:{nonce:t.value,key:e.value},success:i,error:a})}Object(r.a)((function(){var e=document.getElementById("simpay-connect-license-key");if(e){var t=document.getElementById("simpay-connect-license-submit");e.addEventListener("keypress",(function(e){"Enter"===e.key&&(e.preventDefault(),o())})),t.addEventListener("click",(function(e){e.preventDefault(),t.disabled=!0,o()}))}}))},function(e,t,n){"use strict";var r=n(0),a=[".simpay-settings-hcaptcha_setup",".simpay-settings-hcaptcha_site_key",".simpay-settings-hcaptcha_secret_key",".simpay-settings-recaptcha_setup",".simpay-settings-recaptcha_site_key",".simpay-settings-recaptcha_secret_key",".simpay-settings-recaptcha_score_threshold",".simpay-settings-cloudflare_turnstile_setup",".simpay-settings-cloudflare_turnstile_site_key",".simpay-settings-cloudflare_turnstile_secret_key",".simpay-settings-no_captcha_warning"];function i(e){var t,n=e.target.value;switch(n){case"none":t="no_captcha";break;case"recaptcha-v3":t="recaptcha";break;case"cloudflare-turnstile":t="cloudflare_turnstile";break;default:t=n}a.forEach((function(e){var n=document.querySelector(e);n&&(n.style.display=e.includes(t)?"table-row":"none")}))}Object(r.a)((function(){var e=document.querySelectorAll('input[name="simpay_settings[captcha_type]"]');if(0!==e.length){a.forEach((function(e){var t=document.querySelector(e);t&&(t.style.display="none")})),e.forEach((function(e){return e.addEventListener("change",i)}));var t=document.querySelector('input[name="simpay_settings[captcha_type]"]:checked');t&&t.dispatchEvent(new Event("change")),function(){var e=document.querySelector(".simpay-recaptcha-feedback");if(e){var t=simpayGoogleRecaptcha,n=t.siteKey,r=t.i18n;""!==n&&grecaptcha.ready((function(){var e=document.querySelector(".grecaptcha-badge");e&&(e.style.display="none");try{grecaptcha.execute(n,{action:"simple_pay_admin_test"}).then((function(e){wp.ajax.send("simpay_validate_recaptcha_source",{data:{token:e,recaptcha_action:"simple_pay_admin_test"},error:a})})).catch(a)}catch(e){a()}}))}function a(){e.style.display="block",e.classList.add("notice-error"),e.innerHTML="";var t=document.createElement("p");t.innerText=r.invalid,e.appendChild(t)}}()}}))},function(e,t,n){"use strict";var r=n(0),a=n(3);Object(r.a)((function(){var e=document.querySelector(".simpay-settings-emails-configure");e&&(document.querySelector(".simpay-settings-subsection-delivery").after(e),function(e){var t=e.querySelector("select");t&&t.addEventListener("change",(function(e){var n=e.target,r=n.options[n.selectedIndex].dataset,i=r.available,o=r.upgradeTitle,c=r.upgradeDescription,s=r.upgradeUrl,l=r.upgradePurchasedUrl;"no"===i&&(Object(a.upgradeModal)({title:o,description:c,url:s,purchasedUrl:l}),t.value="",t.selectedIndex=0)}))}(e))}))},function(e,t,n){"use strict";(function(e){var t=n(4),r=n.n(t),a=n(0),i=n(3);Object(a.a)((function(){var t,n,a,o,c=document.querySelector(".post-type-simple-pay #post");if(c){var s=r()(c,{hash:!0});delete s.simpay_form_settings_tab,function(t){function n(e){var n=r()(document.querySelector(".post-type-simple-pay form#post"),{hash:!0});if(delete n.simpay_form_settings_tab,delete n.simpay_save_preview,JSON.stringify(n)!==t)return e.preventDefault(),simpayAdmin.i18n.leavePageConfirm}window.addEventListener("beforeunload",n),window.onbeforeunload=n,e(".post-type-simple-pay form#post").off("submit").on("submit",(function(){window.removeEventListener("beforeunload",n),window.onbeforeunload=null}))}(JSON.stringify(s)),a=document.getElementById("form-type-select"),o=document.getElementById("is-overlay"),a.addEventListener("change",(function(e){var t=e.target,n=t.options[t.selectedIndex],r=n.value;"on-site"===r&&Object(i.maybeBlockSelectWithUpgradeModal)(e),"off-site"===r&&(o.querySelector("input").checked=!1),o.style.display="yes"===n.dataset.available&&"on-site"===r?"block":"none"})),(n=document.getElementById("_recaptcha"))&&n.addEventListener("change",(function(e){e.preventDefault(),e.target.checked=!e.target.checked,window.open(e.target.dataset.settingsUrl,"_blank")})),function(){var e=document.getElementById("_email_verification");e&&e.addEventListener("change",(function(e){e.preventDefault(),e.target.checked=!e.target.checked,window.open(e.target.dataset.settingsUrl,"_blank")}))}(),(t=document.querySelector("#_company_name"))&&(t.addEventListener("blur",(function(){0===t.value.length?(t.nextElementSibling.classList.remove("hidden"),t.value=simpayAdmin.siteTitle):t.nextElementSibling.classList.add("hidden")})),t.addEventListener("focus",(function(){0!==t.value.length&&t.nextElementSibling.classList.add("hidden")})))}}))}).call(this,n(7))},function(e,t,n){"use strict";(function(e){var t=n(10),r=n.n(t),a=n(0),i=n(8),o=n(3);function c(){var e=document.getElementById("simpay-prices");if(e){var t=e.querySelectorAll(".simpay-price").length;document.querySelectorAll(".simpay-price-label-default").forEach((function(e){return e.style.display=t>1?"none":"block"})),document.querySelectorAll(".simpay-price-label-display").forEach((function(e){return e.style.display=t>1?"block":"none"})),document.querySelectorAll(".simpay-price-option-label").forEach((function(e){if(t>1)e.style.display="block";else{var n=e.querySelector("input");n&&""!==n.value.trim()?e.style.display="block":e.style.display="none"}})),document.querySelectorAll(".simpay-price-default-check").forEach((function(e){return e.style.display=t>1?"block":"none"}));var n=document.querySelector(".simpay-custom-field-plan-select");n&&(n.style.display=t>1?"block":"none")}}function s(e){var t,n=e.querySelector(".simpay-price-label-display"),r=e.querySelector(".simpay-price-label"),a=simpayAdmin,o=a.currencyPosition,c=a.i18n,s=c.recurringIntervals,l=c.recurringIntervalDisplay,u=c.customAmountLabel;if(""!==r.value)t=r.value;else{var d=e.querySelector(".simpay-price-currency"),p=e.querySelector(".simpay-price-amount"),m=e.querySelector(".simpay-price-amount-type"),f=e.querySelector(".simpay-price-custom-amount input"),y=e.querySelector(".simpay-price-enable-custom-amount"),h=d.options[d.selectedIndex].dataset.symbol;switch(t=!0===y.checked?f.value:p.value,o){case"left":t="".concat(h).concat(t);break;case"left_space":t="".concat(h," ").concat(t);break;case"right":t="".concat(t).concat(h);break;case"right_space":t="".concat(t," ").concat(h)}if(!0===y.checked&&(t=u.replace("%s",t)),"recurring"===m.value){var v=e.querySelector(".simpay-price-recurring-interval"),g=e.querySelector(".simpay-price-recurring-interval-count"),b=s[v.options[v.selectedIndex].value];t=l.replace("%1$s",t).replace("%2$s",g.value).replace("%3$s","1"===g.value?b[0]:b[1])}}n.innerHTML=t,Object(i.c)("simpayFormBuilderPriceOptionLabelUpdated",t,e)}function l(e,t){e.querySelector(".simpay-price-recurring-settings").style.display=t.checked?"table":"none"}function u(e){var t=e.querySelector(".simpay-price-recurring-interval"),n=e.querySelector(".simpay-price-recurring-interval-count"),a=parseInt(n.value);switch(t.options[t.selectedIndex].value){case"day":a>365&&(n.value=365);break;case"week":a>52&&(n.value=52);break;case"month":a>12&&(n.value=12);break;case"year":a>1&&(n.value=1)}var i=JSON.parse(t.dataset.intervals);r()(t.options).forEach((function(e,r){var a=e.value;t.options[r].text=1===parseInt(n.value)?i[a][0]:i[a][1]}))}function d(){document.querySelectorAll(".simpay-price").forEach((function(e){var t=e.querySelector(".simpay-price-amount-type").value;e.querySelector(".simpay-price-label").addEventListener("keyup",(function(){return s(e)})),s(e),e.querySelector(".simpay-price-currency").addEventListener("change",(function(){!function(e){var t=e.querySelector(".simpay-price-currency"),n=t.options[t.selectedIndex].dataset.symbol;e.querySelectorAll(".simpay-price-currency-symbol").forEach((function(e){return e.innerText=n}))}(e),s(e)}));var n=e.querySelectorAll(".simpay-price-amount-type .button");n.length>0&&n.forEach((function(t){return t.addEventListener("click",(function(t){t.preventDefault();var n=t.target.dataset,r=n.available,a=n.upgradeTitle,i=n.upgradeDescription,c=n.upgradeUrl,l=n.upgradePurchasedUrl;"no"===r?Object(o.upgradeModal)({title:a,description:i,url:c,purchasedUrl:l}):(function(e,t){e.querySelectorAll(".simpay-price-amount-type .button").forEach((function(e){return e.classList.remove("button-primary")}));var n=t.dataset.amountType,r=e.querySelector(".simpay-price-recurring-settings");t.classList.add("button-primary"),r.style.display="recurring"===n?"table":"none";var a=e.querySelector(".simpay-price-recurring-amount-toggle"),i=e.querySelector(".simpay-price-enable-optional-subscription");a.style.display="recurring"===n?"none":"block",i.checked=!1,e.querySelector(".simpay-price-amount-type").value=n}(e,t.target),s(e))}))})),e.querySelector(".simpay-price-amount").addEventListener("keyup",(function(){return s(e)}));var r=e.querySelector(".simpay-price-enable-optional-subscription");r&&(r.addEventListener("click",(function(t){var n=t.target,r=n.dataset,a=r.available,i=r.upgradeTitle,c=r.upgradeDescription,u=r.upgradeUrl,d=r.upgradePurchasedUrl;"no"===a?(n.checked=!1,t.preventDefault(),Object(o.upgradeModal)({title:i,description:c,url:u,purchasedUrl:d})):(l(e,n),s(e))})),"recurring"!==t&&l(e,r));var a=e.querySelector(".simpay-price-enable-custom-amount");a.addEventListener("change",(function(){!function(e,t){e.querySelector(".simpay-price-custom-amount").style.display=t.checked?"table":"none"}(e,a),s(e)})),e.querySelector(".simpay-price-recurring-interval").addEventListener("change",(function(){s(e),u(e)}));var d=e.querySelector(".simpay-price-recurring-interval-count");u(e),d.addEventListener("keyup",(function(){u(e),s(e)})),d.addEventListener("change",(function(){u(e),s(e)}));var m=e.querySelector(".simpay-price-legacy-setting-toggle");m&&m.addEventListener("click",(function(t){t.preventDefault(),function(e){e.querySelectorAll(".simpay-price-legacy-setting").forEach((function(e){return e.style.display="block"===e.style.display?"none":"block"}))}(e)})),e.querySelector(".simpay-price-default").addEventListener("change",(function(){return function(e){document.querySelectorAll(".simpay-price-default").forEach((function(e){return e.checked=!1})),e.querySelector(".simpay-price-default").checked=!0}(e)})),e.querySelector(".simpay-price-remove").addEventListener("click",(function(t){t.preventDefault(),function(e){e.remove(),p(),c(),Object(i.c)("simpayFormBuilderPriceRemoved",e.id)}(e)}))})),c()}function p(){var e=document.querySelectorAll(".simpay-price");document.querySelector(".simpay-price-default:checked")||(e[0].querySelector(".simpay-price-default").checked=!0)}Object(a.a)((function(){var t,n,r,a,s,l,u;e(".simpay-prices").sortable({items:".simpay-field-metabox",containment:"#simpay-prices",handle:".simpay-hndle",placeholder:"sortable-placeholder",cursor:"move",delay:e(document.body).hasClass("mobile")?200:0,distance:2,tolerance:"pointer",forcePlaceholderSize:!0,opacity:.65,helper:function(e,t){return t.clone().find(":input").attr("name",(function(e,t){return"sort_"+parseInt(1e5*Math.random(),10).toString()+"_"+t})).end()}}),d(),t=document.getElementById("simpay-prices-advanced-toggle"),n=document.getElementById("simpay-prices-advanced"),t&&n&&t.addEventListener("click",(function(e){e.preventDefault(),n.style.display="block"===n.style.display?"none":"block"})),(u=document.getElementById("simpay-prices-advanced-add"))&&u.addEventListener("click",(function(t){var n,r,a,i,o,s;t.preventDefault(),a=(r=(n=u).dataset).nonce,i=r.formId,o=document.getElementById("simpay-prices"),s=document.getElementById("simpay-prices-advanced-plan-id"),n.classList.add("disabled"),wp.ajax.send("simpay_add_plan",{data:{_wpnonce:a,form_id:i,plan_id:s.value},success:function(t){e(o).append(t),d(),document.getElementById("simpay-prices-advanced").style.display="none",s.value="",n.classList.remove("disabled"),c()},error:function(e){var t=e.message;window.alert(t),n.classList.remove("disabled")}})})),function(){var t=document.getElementById("simpay-add-price");t&&t.addEventListener("click",(function(n){var r,a,o,s,l;n.preventDefault(),o=(a=(r=t).dataset).nonce,s=a.formId,l=document.getElementById("simpay-prices"),r.classList.add("disabled"),wp.ajax.send("simpay_add_price",{data:{_wpnonce:o,form_id:s},success:function(t){e(l).append(t),d(),p(),r.classList.remove("disabled"),c(),Object(i.c)("simpayFormBuilderPriceAdded",t)},error:function(e){var t=e.message;window.alert(t),r.classList.remove("disabled")}})}))}(),(r=document.getElementById("simpay-add-price-lite"))&&r.addEventListener("click",o.maybeBlockButtonWithUpgradeModal),(a=document.getElementById("simpay-amount-type-lite"))&&a.addEventListener("click",o.maybeBlockButtonWithUpgradeModal),(s=document.getElementById("simpay-can-recur-lite"))&&s.addEventListener("click",o.maybeBlockButtonWithUpgradeModal),(l=document.getElementById("simpay-custom-lite"))&&l.addEventListener("click",o.maybeBlockButtonWithUpgradeModal)}))}).call(this,n(7))},function(e,t,n){"use strict";(function(e){var t=n(0),r=n(3);Object(t.a)((function(){var t;document.querySelector(".post-type-simple-pay #post")&&(t=e("#simpay-form-settings").find("#lite-add-field"))&&t.on("click.simpayAddField",(function(e){var t=e,n=document.querySelectorAll(".simpay-custom-fields > div").length;t.target.dataset.available=n>=3?"no":"yes",Object(r.maybeBlockButtonWithUpgradeModal)(t)&&e.stopImmediatePropagation()}))}))}).call(this,n(7))},function(e,t,n){"use strict";(function(e){var t=n(0),r=n(3);Object(t.a)((function(){var t,n,a;(t=document.querySelector('[name="_enable_payment_page"]'))&&t.addEventListener("change",r.maybeBlockCheckboxWithUpgradeModal),(n=document.querySelector('[name="_payment_page_powered_by"]'))&&n.addEventListener("change",r.maybeBlockCheckboxWithUpgradeModal),function(){if(document.getElementById("payment-page-background-color-custom")){e("#payment-page-background-color-custom").wpColorPicker();var t=document.querySelector(".simpay-payment-page-background-color .wp-color-result"),n=document.querySelectorAll(".simpay-payment-page-background-color");t.addEventListener("click",(function(t){n.forEach((function(e){e.querySelector("input").checked=!1})),t.target.classList.add("is-selected"),e(t.target).parent().find("input").prop("checked",!0)})),n.forEach((function(e){e.querySelector("input").addEventListener("change",(function(){t.classList.remove("is-selected")}))}))}}(),(a=document.querySelector('[name="_payment_page_slug"]'))&&a.addEventListener("keyup",(function(e){var t=document.querySelector(".simpay-payment-page-url");t&&(t.dataset.clipboardText="".concat(window.location.origin,"/").concat(e.target.value))}))}))}).call(this,n(7))},function(e,t,n){"use strict";(function(e){var t=n(6),r=n.n(t),a=n(0),i='',o='',c=simpayAdmin,s=c.nonce,l=c.ajaxUrl,u=c.i18n,d=u.addonActivated,p=u.addonActivate,m=u.addonActive,f=u.addonDeactivate,y=u.addonInactive,h=u.addonInstall,v=u.addonError,g=u.pluginError;function b(t){t.preventDefault();var n,a,c,u,b,_,k=e(t.target);if(k.hasClass("status-go-to-url"))window.open(k.attr("data-plugin"),"_blank");else{var w=k.attr("data-type");if(k.prop("disabled",!0).addClass("loading"),k.html(''),k.hasClass("status-active"))n="deactivate",a="status-installed","plugin"===w&&(a+=" button button-secondary"),c=y,u=p,b=f,"addon"===w&&(u=i+u,b=o+b);else if(k.hasClass("status-installed"))n="activate",a="status-active","plugin"===w&&(a+=" button button-secondary disabled"),c=m,u=f,"addon"===w?(u=o+u,b=i+p):"plugin"===w&&(u=d,b=p);else{if(!k.hasClass("status-missing"))return;n="install",a="status-active","plugin"===w&&(a+=" button disabled"),c=m,u=d,b='',"addon"===w&&(u=i+f,b+=h)}var x=k.closest(".simpay-addon");!function(t,n,r,a){var i={activate:"simpay_activate_addon",install:"simpay_install_addon",deactivate:"simpay_deactivate_addon"}[n];if(i){var o={action:i,nonce:s,plugin:t,type:r};e.post(l,o,a).fail((function(e){console.log(e.responseText)}))}}(k.attr("data-plugin"),n,w,(function(e){e.success?("install"===n?(k.attr("data-plugin",e.data.basename),_=e.data.msg,e.data.is_activated||(c=y,u="plugin"===w?p:i+p,a="plugin"===w?"status-installed button button-secondary":"status-installed")):_=e.data,x.find(".simpay-addon__actions").append('
'+_+"
"),x.find("span.status-label").removeClass("status-active status-installed status-missing").addClass(a).removeClass("button button-primary button-secondary disabled").text(c),k.removeClass("status-active status-installed status-missing").removeClass("button button-primary button-secondary disabled").addClass(a).html(u)):("object"===r()(e.data)?"addon"===w?x.find(".simpay-addon__actions").append('
'+v+"
"):x.find(".simpay-addon__actions").append('
'+g+"
"):x.find(".simpay-addon__actions").append('
'+e.data+"
"),"install"===n&&"plugin"===w&&k.addClass("status-go-to-url").removeClass("status-missing"),k.html(b)),k.prop("disabled",!1).removeClass("loading"),setTimeout((function(){x.find(".msg").remove()}),3e3)}))}}Object(a.a)((function(){document.querySelector(".simpay-addons")&&document.querySelectorAll(".simpay-addon").forEach((function(e){e.querySelector("button").addEventListener("click",b)}))}))}).call(this,n(7))},function(e,t,n){"use strict";var r=n(0);Object(r.a)((function(){var e=new ClipboardJS(".simpay-copy-button");e.on("success",(function(t){var n=t.trigger,r=n.dataset.copied,a=n.innerHTML;clearTimeout(i),n.innerHTML=r,n.classList.contains("button-secondary")&&(n.style.color="green",n.style.borderColor="green"),t.clearSelection();var i=setTimeout((function(){n.innerHTML=a,n.classList.contains("button-secondary")&&(n.style.color="",n.style.borderColor=""),e.clipboardAction.fakeElem&&e.clipboardAction.removeFake&&e.clipboardAction.removeFake()}),3e3);wp.a11y.speak(r)}))}))},,,,,,,,,,,,,,,,function(e,t,n){"use strict";n(38),n(39);var r=n(10),a=n.n(r),i=n(0),o=n(3);function c(e){var t=e.target,n=t.options[t.selectedIndex].value,r=document.querySelectorAll(".simpay-panel-field-payment-method[data-payment-method]");a()(r).forEach((function(e){var t="popular"===JSON.parse(e.dataset.paymentMethod).scope?"block":"none";e.style.display="all"===n?"block":t}))}Object(i.a)((function(){var e=document.querySelectorAll(".simpay-panel-field-payment-method-filter");0!==e.length&&a()(e).forEach((function(e){e.addEventListener("change",c)}));var t=document.querySelectorAll(".simpay-payment-method-lite");t&&t.forEach((function(e){return e.addEventListener("change",o.maybeBlockCheckboxWithUpgradeModal)}));var n=document.querySelectorAll(".simpay-payment-method-fee-recovery-lite");n&&n.forEach((function(e){return e.addEventListener("click",o.maybeBlockButtonWithUpgradeModal)}))})),Object(i.a)((function(){var e=document.getElementById("_tax_status_lite");e&&e.addEventListener("change",o.maybeBlockSelectWithUpgradeModal)})),n(40),Object(i.a)((function(){var e,t;(e=document.getElementById("_enable_tax_id"))&&e.addEventListener("change",o.maybeBlockCheckboxWithUpgradeModal),(t=document.getElementById("_enable_promotion_codes"))&&t.addEventListener("change",o.maybeBlockCheckboxWithUpgradeModal)})),n(41),Object(i.a)((function(){var e=document.getElementById("_inventory");e&&e.addEventListener("change",o.maybeBlockCheckboxWithUpgradeModal);var t=document.getElementById("_inventory_behavior_individual");t&&t.addEventListener("change",o.maybeBlockCheckboxWithUpgradeModal);var n=document.getElementById("_schedule_start");n&&n.addEventListener("change",o.maybeBlockCheckboxWithUpgradeModal);var r=document.getElementById("_schedule_end");r&&r.addEventListener("change",o.maybeBlockCheckboxWithUpgradeModal)})),Object(i.a)((function(){var e=document.getElementById("automations-search");if(e){var t=document.querySelectorAll(".simpay-form-builder-automator__integrations-integration");e.addEventListener("input",(function(){var n=e.value.toLowerCase();t.forEach((function(e){for(var t=Object.values(e.dataset),r=0;r3&&void 0!==arguments[3]?arguments[3]:10;if(a(t)&&r(n))if("function"==typeof i)if("number"==typeof o){var c={callback:i,priority:o,namespace:n};if(e[t]){var s,l=e[t].handlers;for(s=l.length;s>0&&!(o>=l[s-1].priority);s--);s===l.length?l[s]=c:l.splice(s,0,c),(e.__current||[]).forEach((function(e){e.name===t&&e.currentIndex>=s&&e.currentIndex++}))}else e[t]={handlers:[c],runs:0};"hookAdded"!==t&&f("hookAdded",t,n,i,o)}else console.error("If specified, the hook priority must be a number.");else console.error("The hook callback must be a function.")}},o=function(e,t){return function(n,i){if(a(n)&&(t||r(i))){if(!e[n])return 0;var o=0;if(t)o=e[n].handlers.length,e[n]={runs:e[n].runs,handlers:[]};else for(var c=e[n].handlers,s=function(t){c[t].namespace===i&&(c.splice(t,1),o++,(e.__current||[]).forEach((function(e){e.name===n&&e.currentIndex>=t&&e.currentIndex--})))},l=c.length-1;l>=0;l--)s(l);return"hookRemoved"!==n&&f("hookRemoved",n,i),o}}},c=function(e){return function(t,n){return void 0!==n?t in e&&e[t].handlers.some((function(e){return e.namespace===n})):t in e}},s=function(e,t){return function(n){e[n]||(e[n]={handlers:[],runs:0}),e[n].runs++;for(var r=e[n].handlers,a=arguments.length,i=new Array(a>1?a-1:0),o=1;o0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=t.id,r=t.getFormData;return Object(i.a)("v2/customer",d({form_values:l()(t[0],{hash:!0}),form_data:r(),form_id:n},e))}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;t0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=t.id,r=t.getFormData;return Object(i.a)("v2/checkout-session",f({form_values:l()(t[0],{hash:!0}),form_data:r(),form_id:n},e))}n(9),n(5),n(11)},,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=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),l=o.call(i,"finallyLoc");if(s&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),q(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;q(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:M(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},n}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){var r=n(6).default;e.exports=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,t||"default");if("object"!=r(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){Number.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},Number.isSafeInteger=Number.isSafeInteger||function(e){return Number.isInteger(e)&&Math.abs(e)<=Number.MAX_SAFE_INTEGER},Number.MAX_SAFE_INTEGER||(Number.MAX_SAFE_INTEGER=9007199254740991)},function(e,t,n){"use strict";(function(e){n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return s})),n.d(t,"c",(function(){return l})),n.d(t,"d",(function(){return u}));var r=n(2),a=n.n(r);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 o(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};e(".simpay-upgrade-modal").dialog(o({position:{my:"center",at:"center",of:window},modal:!0,width:600,resizable:!1,draggable:!1,open:function(){var t=e(this);t.parent().find(".ui-dialog-titlebar").css({borderBottom:0}),t.find(".simpay-upgrade-modal__title").html(n),t.find(".simpay-upgrade-modal__description").html(r),t.find(".simpay-upgrade-modal__upgrade-url").attr("href",a),t.find(".simpay-upgrade-modal__upgrade-purchased-url").attr("href",i)}},c))}}).call(this,n(7))},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return a}));var r=n(0);function a(e,t){var n=document.getElementById("simpay-test-mode-toggle-notice");if(n)if(e!==t){var r=document.getElementById("simpay-toggle-notice-status"),a=document.getElementById("simpay-toggle-notice-status-link");n.style.display="block",r&&a&&(r.innerHTML=""+r.dataset[e]+"",a.href=a.dataset[e])}else n.style.display="none"}function i(){var t=document.querySelectorAll(".simpay-disconnect-link");if(t){var n=simpayAdmin.i18n,r=n.disconnectConfirm,a=n.disconnectCancel;t.forEach((function(t){t.addEventListener("click",(function(n){n.preventDefault(),e(".simpay-disconnect-confirm").dialog({resizable:!1,height:"auto",width:400,modal:!0,draggable:!1,open:function(){e(".ui-dialog-buttonset .ui-button").removeClass("ui-button").last().css({marginLeft:"10px"}).focus()},buttons:[{text:a,click:function(){e(this).dialog("close")},class:"button button-secondary"},{text:r,click:function(){window.location.href=t.href},class:"button button-primary"}]})}))}))}}Object(r.a)((function(){var e;(e=document.getElementById("simpay-stripe-account-info"))&&wp.ajax.send("simpay_stripe_connect_account_information",{data:{nonce:e.dataset.nonce},success:function(t){e.querySelector("p").innerHTML=t.message,e.style.display="block","simpay-stripe-activated-account-actions"===t.actions?e.classList.add("notice-info"):e.classList.add("notice-warning");var n=document.getElementById(t.actions);n&&(n.style.display="block"),i()},error:function(t){e.querySelector("p").innerHTML=t.message,e.style.display="block",e.classList.add("notice-error");var n=document.getElementById(t.actions);n&&(n.style.display="block",i())}})}))}).call(this,n(7))},,,function(e,t,n){"use strict";n.r(t),function(e){var t=n(10),r=n.n(t),a=n(8),i=(n(33),n(34),n(35),n(29));n(36),n(37),n(59),n(42),n(43),window.wpsp=window.wpsp||{hooks:a.b};var o,c,s,l=simpayAdmin,u=l.licenseLevel,d=l.i18n.trashFormConfirm,p={};p={init:function(){c=o(document.body),s=c.find("#simpay-form-settings"),this.handleMetaboxTabClick(),window.postboxes&&window.postboxes.handle_click&&s.on("click",".postbox .simpay-hndle, .postbox .simpay-handlediv",window.postboxes.handle_click),a.b.addAction("settings.toggleTestMode","wpsp/settings/stripe-connect",i.a),this.handleFormBuilderSettingToggles(),a.b.addAction("customFieldAdded","wpsp/payment-form",this.handleFormBuilderSettingToggles),s.on("click.simpayTabLink",".simpay-tab-link",(function(e){e.preventDefault(),p.handleInternalLinkToTabClicks(o(this))})),o(document).on("click.simpayImagePreview",".simpay-remove-image-preview",(function(e){p.handleRemoveImagePreviewClick(e)})),this.setupChosen(),this.addMediaFields(),this.stripeConnect(),this.initSortableFields(s.find(".simpay-custom-fields")),s.find(".add-field").on("click.simpayAddField",this.addField),s.find(".simpay-custom-fields").on("click",".simpay-remove-field-link",this.removeField);var e=o(".simpay-payment-modes");e.length&&e.find("input").each((function(){var t=o(this);e.hasClass("simpay-payment-mode--"+t.val())||t.attr("disabled",!0)})),this.bindTrashWarning(),c.trigger("simpayAdminInit"),o(".show-settings").detach().prependTo(".simpay-branding-bar__actions").removeClass().addClass("simpay-branding-bar__actions-button").html('').on("click",window.screenMeta.toggleEvent)},handleFormBuilderSettingToggles:function(){["_amount_type","_success_redirect_type","_subscription_type","_subscription_custom_amount","_form_type","_tax_status","_enable_payment_page","_inventory","_inventory_behavior","_schedule_start","_schedule_end",".simpay-total-amount-label-recurring",".simpay-total-amount-label-tax",".simpay-shipping-address",".simpay-text-multiline",".simpay-dropdown-type",".simpay-radio-type",".simpay-price-enable-custom",".simpay-price-type input",".simpay-email-link-enabled",".simpay-phone-smart-enabled"].forEach((function(e){var t=o(e),n=!1;"."!==e.substring(0,1)?t='[name="'.concat(e,'"]'):(t=e,n=!0),o("#simpay-form-settings").on("change",t,(function(){var t=o("#simpay-form-settings");!0===n&&(t=o(this).closest(".simpay-field-data"));var r=o(this).val();o(this).is(":checkbox")&&(r=o(this).is(":checked")?"yes":"no"),t.find(o('.simpay-show-if[data-if="'.concat(e,'"]'))).each((function(){var e=o(this),t=e.data("is");e.hide(),t.includes(r)&&e.show().css("display","block")}))})),o(t).filter(":checkbox").trigger("change"),o(t).filter(":checked").trigger("change"),o(t).is("select")&&o(t).trigger("change")}))},handleRemoveImagePreviewClick:function(e){e.preventDefault(),o(e.target).parents("td").find(".simpay-image-preview-wrap").val("").hide(),o(e.target).parents("td").find(".simpay-field-image-url").val(""),o(e.target).parents("td").find(".simpay-remove-image-preview").hide()},addMediaFields:function(){o(".simpay-media-uploader").on("click",(function(e){e.preventDefault();var t=wp.media.frames.file_frame=wp.media({title:simpayAdmin.i18n.mediaTitle,button:{text:simpayAdmin.i18n.mediaButtonText},multiple:!1}),n=o(this);t.on("select",(function(){var e=t.state().get("selection").first().toJSON(),r=n.parents("td").find(".simpay-field-image-url"),a="id"===r.data("fvalue")?e.id:e.url;n.parents("td").find(".simpay-image-preview-wrap").show(),n.parents("td").find(".simpay-remove-image-preview").show(),n.parents("td").find(".simpay-image-preview").prop("src",a),r.val(a)})),t.open()}))},setupChosen:function(){var e=o(".simpay-chosen-select, .simpay-chosen-search");e.chosen({disable_search_threshold:20}),e.chosen()},handleMetaboxTabClick:function(){var e=o('ul.simpay-tabs li:not([data-available="no"]) a'),t=o("div.simpay-panel"),n=e.parents("li");e.on("click",(function(e){e.preventDefault();var r=o(this).parent(),a=o(o(this).attr("href")),i=o(this).attr("href");history.pushState(null,null,i),setTimeout((function(){window.scrollTo(0,0)}),1),o('[name="simpay_form_settings_tab"]').val(i),o(".simpay-panels > .spinner").hide(),n.removeClass("active"),r.addClass("active"),t.addClass("simpay-panel-hidden"),a.removeClass("simpay-panel-hidden")}));var r="#form-display-options-settings-panel";location.hash.length&&(r=location.hash);var a=o('ul.simpay-tabs a[href="'+r+'"]');o('[name="simpay_form_settings_tab"]').val(r),a.length&&a.click()},stripeConnect:function(){var e="tr:nth-child(2), tr:nth-child(3), tr:nth-child(4), tr:nth-child(5)";o(".simpay-settings.stripe-account .form-table").find(e).hide(),o("#wpsp-api-keys-row-reveal button").on("click",(function(t){t.preventDefault(),o(".simpay-settings.stripe-account .form-table").find(e).show(),o("#wpsp-api-keys-row-hide").show(),o(this).parent().hide(),o(".wpsp-manual-key-warning").show()})),o("#wpsp-api-keys-row-hide button").on("click",(function(t){t.preventDefault(),o(".simpay-settings.stripe-account .form-table").find(e).hide(),o("#wpsp-api-keys-row-reveal").show(),o(this).parent().hide(),o(".wpsp-manual-key-warning").hide()}))},handleInternalLinkToTabClicks:function(e){var t=e.data("show-tab");c.find("."+t+"-tab a").click()},bindTrashWarning:function(){["plus","professional","elite","ultimate"].includes(u)&&(o(".post-type-simple-pay .submitdelete").click((function(e){confirm(d)||e.preventDefault()})),o(".post-type-simple-pay #posts-filter").submit((function(e){"trash"===o(this).find('select[name="action"]').val()&&(confirm(d)||e.preventDefault())})))},initSortableFields:function(e){e.sortable({items:".simpay-field-metabox:not(.simpay-custom-field-payment-button):not(.simpay-custom-field-checkout-button)",containment:"#simpay-form-settings",handle:".simpay-hndle",placeholder:"sortable-placeholder",cursor:"move",delay:o(document.body).hasClass("mobile")?200:0,distance:2,tolerance:"pointer",forcePlaceholderSize:!0,opacity:.65,stop:function(e,t){p.orderFields()},helper:function(e,t){return t.clone().find(":input").attr("name",(function(e,t){return"sort_"+parseInt(1e5*Math.random(),10).toString()+"_"+t})).end()}})},addField:function(e){var t=s.find(".simpay-custom-fields .simpay-field-metabox").length,n=o("#simpay-custom-fields-wrap").find(".simpay-metaboxes"),i=s.find("#custom-field-select"),c=i.val(),l=r()(document.querySelectorAll(".field-uid")).map((function(e){return parseInt(e.value)})),u={action:"simpay_add_field",post_id:o("#post_ID").val(),fieldType:c,counter:parseInt(t)+1,nextUid:parseInt(_.max(l))+1,addFieldNonce:s.find("#simpay_custom_fields_nonce").val()};e.preventDefault(),s.find(".postbox").each((function(){o(this).is(":visible")&&o(this).addClass("closed")})),o.ajax({url:ajaxurl,method:"POST",data:u,success:function(e){var t=o("
").append(e);["payment_button","checkout_button"].includes(c)?n.append(t.html()):n.prepend(t.html()),i.prop("selectedIndex",0),p.orderFields(),a.b.doAction("customFieldAdded",e)},error:function(e){window.spShared.debugLog(e)}})},removeField:function(e){if(e.preventDefault(),s.find("#custom-field-select"),window.confirm("Are you sure you want to remove this field?")){var t=o(this).closest(".simpay-field-metabox");t.data("type"),t.remove(),a.b.doAction("customFieldRemoved")}},orderFields:function(){o(".simpay-custom-fields .simpay-field-metabox").each((function(e,t){var n=parseInt(o(t).index(".simpay-custom-fields .simpay-field-metabox"));o(".field-order",t).val(n+1)}))}},(o=e)(document).ready((function(e){p.init()}))}.call(this,n(7))},function(e,t,n){"use strict";var r=n(10),a=n.n(r),i=n(0),o=simpayAdminSettingToggles||[];function c(e){var t=e.id,n=document.querySelector(".simpay-settings-".concat(t));if(!n)return{};var r=n.querySelectorAll('input[name="simpay_settings['.concat(t,']"]'));0===r.length&&(r=n.querySelectorAll('select[name="'.concat(t,'"]')));var i=r[0].value;if(["radio","checkbox"].includes(r[0].type)){var o=a()(r).filter((function(e){return e.checked}));i=0===o.length?"no":o[0].value}return{setting:r,currentValue:i}}function s(e){var t=e.id,n=e.value,r=e.toggles,a=e.compare;if("none"!==document.querySelector(".simpay-settings-".concat(t)).style.display){var i=c(e).currentValue;r.map((function(e){return document.querySelector(".simpay-settings-".concat(e))})).forEach((function(e){e&&(e.style.display="IS NOT"===a?i===n?"none":"table-row":i===n?"table-row":"none")})),r.forEach((function(e){var t=_.find(o,{id:e});t&&s(t)}))}}Object(i.a)((function(){o.forEach((function(e){s(e),c(e).setting.forEach((function(t){t.addEventListener("change",(function(){s(e)}))}))}))}))},function(e,t,n){"use strict";var r=n(0);Object(r.a)((function(){var e=window.wpsp.hooks,t=document.querySelectorAll('[name="simpay_settings[test_mode]"]');if(0!==t.length){var n="enabled"===document.querySelector('[name="simpay_settings[test_mode]"]:checked').value?"test":"live";e.doAction("settings.toggleTestMode",n,n),_.each(t,(function(t){return t.addEventListener("change",(function(t){var r="enabled"===t.target.value?"test":"live";e.doAction("settings.toggleTestMode",r,n)}))}))}}))},function(e,t,n){"use strict";var r=n(0);function a(e){var t=document.getElementById("simpay-connect-license-feedback"),n=document.getElementById("simpay-connect-license-submit");e.message?(t.innerText=e.message,t.classList.remove("simpay-license-message--valid"),t.classList.add("simpay-license-message--invalid"),t.style.display="block"):t.style.display="none",e.reload?setTimeout((function(){window.location.reload()}),2e3):(n.disabled=!1,n.innerText=n.dataset.connect)}function i(e){var t=document.getElementById("simpay-connect-license-feedback");e.message?(t.innerText=e.message,t.classList.remove("simpay-license-message--invalid"),t.classList.add("simpay-license-message--valid"),t.style.display="block"):t.style.display="none",e.reload?setTimeout((function(){window.location.reload()}),2e3):window.location=e.url}function o(){var e=document.getElementById("simpay-connect-license-key"),t=document.getElementById("simpay-connect-license-nonce"),n=document.getElementById("simpay-connect-license-submit");n.disabled=!0,n.innerText=n.dataset.connecting,wp.ajax.send("simpay_get_connect_url",{data:{nonce:t.value,key:e.value},success:i,error:a})}Object(r.a)((function(){var e=document.getElementById("simpay-connect-license-key");if(e){var t=document.getElementById("simpay-connect-license-submit");e.addEventListener("keypress",(function(e){"Enter"===e.key&&(e.preventDefault(),o())})),t.addEventListener("click",(function(e){e.preventDefault(),t.disabled=!0,o()}))}}))},function(e,t,n){"use strict";var r=n(0),a=[".simpay-settings-hcaptcha_setup",".simpay-settings-hcaptcha_site_key",".simpay-settings-hcaptcha_secret_key",".simpay-settings-recaptcha_setup",".simpay-settings-recaptcha_site_key",".simpay-settings-recaptcha_secret_key",".simpay-settings-recaptcha_score_threshold",".simpay-settings-cloudflare_turnstile_setup",".simpay-settings-cloudflare_turnstile_site_key",".simpay-settings-cloudflare_turnstile_secret_key",".simpay-settings-no_captcha_warning"];function i(e){var t,n=e.target.value;switch(n){case"none":t="no_captcha";break;case"recaptcha-v3":t="recaptcha";break;case"cloudflare-turnstile":t="cloudflare_turnstile";break;default:t=n}a.forEach((function(e){var n=document.querySelector(e);n&&(n.style.display=e.includes(t)?"table-row":"none")}))}Object(r.a)((function(){var e=document.querySelectorAll('input[name="simpay_settings[captcha_type]"]');if(0!==e.length){a.forEach((function(e){var t=document.querySelector(e);t&&(t.style.display="none")})),e.forEach((function(e){return e.addEventListener("change",i)}));var t=document.querySelector('input[name="simpay_settings[captcha_type]"]:checked');t&&t.dispatchEvent(new Event("change")),function(){var e=document.querySelector(".simpay-recaptcha-feedback");if(e){var t=simpayGoogleRecaptcha,n=t.siteKey,r=t.i18n;""!==n&&grecaptcha.ready((function(){var e=document.querySelector(".grecaptcha-badge");e&&(e.style.display="none");try{grecaptcha.execute(n,{action:"simple_pay_admin_test"}).then((function(e){wp.ajax.send("simpay_validate_recaptcha_source",{data:{token:e,recaptcha_action:"simple_pay_admin_test"},error:a})})).catch(a)}catch(e){a()}}))}function a(){e.style.display="block",e.classList.add("notice-error"),e.innerHTML="";var t=document.createElement("p");t.innerText=r.invalid,e.appendChild(t)}}()}}))},function(e,t,n){"use strict";var r=n(0),a=n(3);Object(r.a)((function(){var e=document.querySelector(".simpay-settings-emails-configure");e&&(document.querySelector(".simpay-settings-subsection-delivery").after(e),function(e){var t=e.querySelector("select");t&&t.addEventListener("change",(function(e){var n=e.target,r=n.options[n.selectedIndex].dataset,i=r.available,o=r.upgradeTitle,c=r.upgradeDescription,s=r.upgradeUrl,l=r.upgradePurchasedUrl;"no"===i&&(Object(a.upgradeModal)({title:o,description:c,url:s,purchasedUrl:l}),t.value="",t.selectedIndex=0)}))}(e))}))},function(e,t,n){"use strict";(function(e){var t=n(4),r=n.n(t),a=n(0),i=n(3);Object(a.a)((function(){var t,n,a,o,c=document.querySelector(".post-type-simple-pay #post");if(c){var s=r()(c,{hash:!0});delete s.simpay_form_settings_tab,function(t){function n(e){var n=r()(document.querySelector(".post-type-simple-pay form#post"),{hash:!0});if(delete n.simpay_form_settings_tab,delete n.simpay_save_preview,JSON.stringify(n)!==t)return e.preventDefault(),simpayAdmin.i18n.leavePageConfirm}window.addEventListener("beforeunload",n),window.onbeforeunload=n,e(".post-type-simple-pay form#post").off("submit").on("submit",(function(){window.removeEventListener("beforeunload",n),window.onbeforeunload=null}))}(JSON.stringify(s)),a=document.getElementById("form-type-select"),o=document.getElementById("is-overlay"),a.addEventListener("change",(function(e){var t=e.target,n=t.options[t.selectedIndex],r=n.value;"on-site"===r&&Object(i.maybeBlockSelectWithUpgradeModal)(e),"off-site"===r&&(o.querySelector("input").checked=!1),o.style.display="yes"===n.dataset.available&&"on-site"===r?"block":"none"})),(n=document.getElementById("_recaptcha"))&&n.addEventListener("change",(function(e){e.preventDefault(),e.target.checked=!e.target.checked,window.open(e.target.dataset.settingsUrl,"_blank")})),function(){var e=document.getElementById("_email_verification");e&&e.addEventListener("change",(function(e){e.preventDefault(),e.target.checked=!e.target.checked,window.open(e.target.dataset.settingsUrl,"_blank")}))}(),(t=document.querySelector("#_company_name"))&&(t.addEventListener("blur",(function(){0===t.value.length?(t.nextElementSibling.classList.remove("hidden"),t.value=simpayAdmin.siteTitle):t.nextElementSibling.classList.add("hidden")})),t.addEventListener("focus",(function(){0!==t.value.length&&t.nextElementSibling.classList.add("hidden")})))}}))}).call(this,n(7))},function(e,t,n){"use strict";(function(e){var t=n(10),r=n.n(t),a=n(0),i=n(8),o=n(3);function c(){var e=document.getElementById("simpay-prices");if(e){var t=e.querySelectorAll(".simpay-price").length;document.querySelectorAll(".simpay-price-label-default").forEach((function(e){return e.style.display=t>1?"none":"block"})),document.querySelectorAll(".simpay-price-label-display").forEach((function(e){return e.style.display=t>1?"block":"none"})),document.querySelectorAll(".simpay-price-option-label").forEach((function(e){if(t>1)e.style.display="block";else{var n=e.querySelector("input");n&&""!==n.value.trim()?e.style.display="block":e.style.display="none"}})),document.querySelectorAll(".simpay-price-default-check").forEach((function(e){return e.style.display=t>1?"block":"none"}));var n=document.querySelector(".simpay-custom-field-plan-select");n&&(n.style.display=t>1?"block":"none")}}function s(e){var t,n=e.querySelector(".simpay-price-label-display"),r=e.querySelector(".simpay-price-label"),a=simpayAdmin,o=a.currencyPosition,c=a.i18n,s=c.recurringIntervals,l=c.recurringIntervalDisplay,u=c.customAmountLabel;if(""!==r.value)t=r.value;else{var d=e.querySelector(".simpay-price-currency"),p=e.querySelector(".simpay-price-amount"),m=e.querySelector(".simpay-price-amount-type"),f=e.querySelector(".simpay-price-custom-amount input"),y=e.querySelector(".simpay-price-enable-custom-amount"),h=d.options[d.selectedIndex].dataset.symbol;switch(t=!0===y.checked?f.value:p.value,o){case"left":t="".concat(h).concat(t);break;case"left_space":t="".concat(h," ").concat(t);break;case"right":t="".concat(t).concat(h);break;case"right_space":t="".concat(t," ").concat(h)}if(!0===y.checked&&(t=u.replace("%s",t)),"recurring"===m.value){var v=e.querySelector(".simpay-price-recurring-interval"),g=e.querySelector(".simpay-price-recurring-interval-count"),b=s[v.options[v.selectedIndex].value];t=l.replace("%1$s",t).replace("%2$s",g.value).replace("%3$s","1"===g.value?b[0]:b[1])}}n.innerHTML=t,Object(i.c)("simpayFormBuilderPriceOptionLabelUpdated",t,e)}function l(e,t){e.querySelector(".simpay-price-recurring-settings").style.display=t.checked?"table":"none"}function u(e){var t=e.querySelector(".simpay-price-recurring-interval"),n=e.querySelector(".simpay-price-recurring-interval-count"),a=parseInt(n.value);switch(t.options[t.selectedIndex].value){case"day":a>365&&(n.value=365);break;case"week":a>52&&(n.value=52);break;case"month":a>12&&(n.value=12);break;case"year":a>1&&(n.value=1)}var i=JSON.parse(t.dataset.intervals);r()(t.options).forEach((function(e,r){var a=e.value;t.options[r].text=1===parseInt(n.value)?i[a][0]:i[a][1]}))}function d(){document.querySelectorAll(".simpay-price").forEach((function(e){var t=e.querySelector(".simpay-price-amount-type").value;e.querySelector(".simpay-price-label").addEventListener("keyup",(function(){return s(e)})),s(e),e.querySelector(".simpay-price-currency").addEventListener("change",(function(){!function(e){var t=e.querySelector(".simpay-price-currency"),n=t.options[t.selectedIndex].dataset.symbol;e.querySelectorAll(".simpay-price-currency-symbol").forEach((function(e){return e.innerText=n}))}(e),s(e)}));var n=e.querySelectorAll(".simpay-price-amount-type .button");n.length>0&&n.forEach((function(t){return t.addEventListener("click",(function(t){t.preventDefault();var n=t.target.dataset,r=n.available,a=n.upgradeTitle,i=n.upgradeDescription,c=n.upgradeUrl,l=n.upgradePurchasedUrl;"no"===r?Object(o.upgradeModal)({title:a,description:i,url:c,purchasedUrl:l}):(function(e,t){e.querySelectorAll(".simpay-price-amount-type .button").forEach((function(e){return e.classList.remove("button-primary")}));var n=t.dataset.amountType,r=e.querySelector(".simpay-price-recurring-settings");t.classList.add("button-primary"),r.style.display="recurring"===n?"table":"none";var a=e.querySelector(".simpay-price-recurring-amount-toggle"),i=e.querySelector(".simpay-price-enable-optional-subscription");a.style.display="recurring"===n?"none":"block",i.checked=!1,e.querySelector(".simpay-price-amount-type").value=n}(e,t.target),s(e))}))})),e.querySelector(".simpay-price-amount").addEventListener("keyup",(function(){return s(e)}));var r=e.querySelector(".simpay-price-enable-optional-subscription");r&&(r.addEventListener("click",(function(t){var n=t.target,r=n.dataset,a=r.available,i=r.upgradeTitle,c=r.upgradeDescription,u=r.upgradeUrl,d=r.upgradePurchasedUrl;"no"===a?(n.checked=!1,t.preventDefault(),Object(o.upgradeModal)({title:i,description:c,url:u,purchasedUrl:d})):(l(e,n),s(e))})),"recurring"!==t&&l(e,r));var a=e.querySelector(".simpay-price-enable-custom-amount");a.addEventListener("change",(function(){!function(e,t){e.querySelector(".simpay-price-custom-amount").style.display=t.checked?"table":"none"}(e,a),s(e)})),e.querySelector(".simpay-price-recurring-interval").addEventListener("change",(function(){s(e),u(e)}));var d=e.querySelector(".simpay-price-recurring-interval-count");u(e),d.addEventListener("keyup",(function(){u(e),s(e)})),d.addEventListener("change",(function(){u(e),s(e)}));var m=e.querySelector(".simpay-price-legacy-setting-toggle");m&&m.addEventListener("click",(function(t){t.preventDefault(),function(e){e.querySelectorAll(".simpay-price-legacy-setting").forEach((function(e){return e.style.display="block"===e.style.display?"none":"block"}))}(e)})),e.querySelector(".simpay-price-default").addEventListener("change",(function(){return function(e){document.querySelectorAll(".simpay-price-default").forEach((function(e){return e.checked=!1})),e.querySelector(".simpay-price-default").checked=!0}(e)})),e.querySelector(".simpay-price-remove").addEventListener("click",(function(t){t.preventDefault(),function(e){e.remove(),p(),c(),Object(i.c)("simpayFormBuilderPriceRemoved",e.id)}(e)}))})),c()}function p(){var e=document.querySelectorAll(".simpay-price");document.querySelector(".simpay-price-default:checked")||(e[0].querySelector(".simpay-price-default").checked=!0)}Object(a.a)((function(){var t,n,r,a,s,l,u;e(".simpay-prices").sortable({items:".simpay-field-metabox",containment:"#simpay-prices",handle:".simpay-hndle",placeholder:"sortable-placeholder",cursor:"move",delay:e(document.body).hasClass("mobile")?200:0,distance:2,tolerance:"pointer",forcePlaceholderSize:!0,opacity:.65,helper:function(e,t){return t.clone().find(":input").attr("name",(function(e,t){return"sort_"+parseInt(1e5*Math.random(),10).toString()+"_"+t})).end()}}),d(),t=document.getElementById("simpay-prices-advanced-toggle"),n=document.getElementById("simpay-prices-advanced"),t&&n&&t.addEventListener("click",(function(e){e.preventDefault(),n.style.display="block"===n.style.display?"none":"block"})),(u=document.getElementById("simpay-prices-advanced-add"))&&u.addEventListener("click",(function(t){var n,r,a,i,o,s;t.preventDefault(),a=(r=(n=u).dataset).nonce,i=r.formId,o=document.getElementById("simpay-prices"),s=document.getElementById("simpay-prices-advanced-plan-id"),n.classList.add("disabled"),wp.ajax.send("simpay_add_plan",{data:{_wpnonce:a,form_id:i,plan_id:s.value},success:function(t){e(o).append(t),d(),document.getElementById("simpay-prices-advanced").style.display="none",s.value="",n.classList.remove("disabled"),c()},error:function(e){var t=e.message;window.alert(t),n.classList.remove("disabled")}})})),function(){var t=document.getElementById("simpay-add-price");t&&t.addEventListener("click",(function(n){var r,a,o,s,l;n.preventDefault(),o=(a=(r=t).dataset).nonce,s=a.formId,l=document.getElementById("simpay-prices"),r.classList.add("disabled"),wp.ajax.send("simpay_add_price",{data:{_wpnonce:o,form_id:s},success:function(t){e(l).append(t),d(),p(),r.classList.remove("disabled"),c(),Object(i.c)("simpayFormBuilderPriceAdded",t)},error:function(e){var t=e.message;window.alert(t),r.classList.remove("disabled")}})}))}(),(r=document.getElementById("simpay-add-price-lite"))&&r.addEventListener("click",o.maybeBlockButtonWithUpgradeModal),(a=document.getElementById("simpay-amount-type-lite"))&&a.addEventListener("click",o.maybeBlockButtonWithUpgradeModal),(s=document.getElementById("simpay-can-recur-lite"))&&s.addEventListener("click",o.maybeBlockButtonWithUpgradeModal),(l=document.getElementById("simpay-custom-lite"))&&l.addEventListener("click",o.maybeBlockButtonWithUpgradeModal)}))}).call(this,n(7))},function(e,t,n){"use strict";(function(e){var t=n(0),r=n(3);Object(t.a)((function(){var t;document.querySelector(".post-type-simple-pay #post")&&(t=e("#simpay-form-settings").find("#lite-add-field"))&&t.on("click.simpayAddField",(function(e){var t=e,n=document.querySelectorAll(".simpay-custom-fields > div").length;t.target.dataset.available=n>=3?"no":"yes",Object(r.maybeBlockButtonWithUpgradeModal)(t)&&e.stopImmediatePropagation()}))}))}).call(this,n(7))},function(e,t,n){"use strict";(function(e){var t=n(0),r=n(3);Object(t.a)((function(){var t,n,a;(t=document.querySelector('[name="_enable_payment_page"]'))&&t.addEventListener("change",r.maybeBlockCheckboxWithUpgradeModal),(n=document.querySelector('[name="_payment_page_powered_by"]'))&&n.addEventListener("change",r.maybeBlockCheckboxWithUpgradeModal),function(){if(document.getElementById("payment-page-background-color-custom")){e("#payment-page-background-color-custom").wpColorPicker();var t=document.querySelector(".simpay-payment-page-background-color .wp-color-result"),n=document.querySelectorAll(".simpay-payment-page-background-color");t.addEventListener("click",(function(t){n.forEach((function(e){e.querySelector("input").checked=!1})),t.target.classList.add("is-selected"),e(t.target).parent().find("input").prop("checked",!0)})),n.forEach((function(e){e.querySelector("input").addEventListener("change",(function(){t.classList.remove("is-selected")}))}))}}(),(a=document.querySelector('[name="_payment_page_slug"]'))&&a.addEventListener("keyup",(function(e){var t=document.querySelector(".simpay-payment-page-url");t&&(t.dataset.clipboardText="".concat(window.location.origin,"/").concat(e.target.value))}))}))}).call(this,n(7))},function(e,t,n){"use strict";(function(e){var t=n(6),r=n.n(t),a=n(0),i='',o='',c=simpayAdmin,s=c.nonce,l=c.ajaxUrl,u=c.i18n,d=u.addonActivated,p=u.addonActivate,m=u.addonActive,f=u.addonDeactivate,y=u.addonInactive,h=u.addonInstall,v=u.addonError,g=u.pluginError;function b(t){t.preventDefault();var n,a,c,u,b,_,k=e(t.target);if(k.hasClass("status-go-to-url"))window.open(k.attr("data-plugin"),"_blank");else{var w=k.attr("data-type");if(k.prop("disabled",!0).addClass("loading"),k.html(''),k.hasClass("status-active"))n="deactivate",a="status-installed","plugin"===w&&(a+=" button button-secondary"),c=y,u=p,b=f,"addon"===w&&(u=i+u,b=o+b);else if(k.hasClass("status-installed"))n="activate",a="status-active","plugin"===w&&(a+=" button button-secondary disabled"),c=m,u=f,"addon"===w?(u=o+u,b=i+p):"plugin"===w&&(u=d,b=p);else{if(!k.hasClass("status-missing"))return;n="install",a="status-active","plugin"===w&&(a+=" button disabled"),c=m,u=d,b='',"addon"===w&&(u=i+f,b+=h)}var x=k.closest(".simpay-addon");!function(t,n,r,a){var i={activate:"simpay_activate_addon",install:"simpay_install_addon",deactivate:"simpay_deactivate_addon"}[n];if(i){var o={action:i,nonce:s,plugin:t,type:r};e.post(l,o,a).fail((function(e){console.log(e.responseText)}))}}(k.attr("data-plugin"),n,w,(function(e){e.success?("install"===n?(k.attr("data-plugin",e.data.basename),_=e.data.msg,e.data.is_activated||(c=y,u="plugin"===w?p:i+p,a="plugin"===w?"status-installed button button-secondary":"status-installed")):_=e.data,x.find(".simpay-addon__actions").append('
'+_+"
"),x.find("span.status-label").removeClass("status-active status-installed status-missing").addClass(a).removeClass("button button-primary button-secondary disabled").text(c),k.removeClass("status-active status-installed status-missing").removeClass("button button-primary button-secondary disabled").addClass(a).html(u)):("object"===r()(e.data)?"addon"===w?x.find(".simpay-addon__actions").append('
'+v+"
"):x.find(".simpay-addon__actions").append('
'+g+"
"):x.find(".simpay-addon__actions").append('
'+e.data+"
"),"install"===n&&"plugin"===w&&k.addClass("status-go-to-url").removeClass("status-missing"),k.html(b)),k.prop("disabled",!1).removeClass("loading"),setTimeout((function(){x.find(".msg").remove()}),3e3)}))}}Object(a.a)((function(){document.querySelector(".simpay-addons")&&document.querySelectorAll(".simpay-addon").forEach((function(e){e.querySelector("button").addEventListener("click",b)}))}))}).call(this,n(7))},function(e,t,n){"use strict";var r=n(0);Object(r.a)((function(){var e=new ClipboardJS(".simpay-copy-button");e.on("success",(function(t){var n=t.trigger,r=n.dataset.copied,a=n.innerHTML;clearTimeout(i),n.innerHTML=r,n.classList.contains("button-secondary")&&(n.style.color="green",n.style.borderColor="green"),t.clearSelection();var i=setTimeout((function(){n.innerHTML=a,n.classList.contains("button-secondary")&&(n.style.color="",n.style.borderColor=""),e.clipboardAction.fakeElem&&e.clipboardAction.removeFake&&e.clipboardAction.removeFake()}),3e3);wp.a11y.speak(r)}))}))},,,,,,,,,,,,,,,,function(e,t,n){"use strict";n(38),n(39);var r=n(10),a=n.n(r),i=n(0),o=n(3);function c(e){var t=e.target,n=t.options[t.selectedIndex].value,r=document.querySelectorAll(".simpay-panel-field-payment-method[data-payment-method]");a()(r).forEach((function(e){var t="popular"===JSON.parse(e.dataset.paymentMethod).scope?"block":"none";e.style.display="all"===n?"block":t}))}Object(i.a)((function(){var e=document.querySelectorAll(".simpay-panel-field-payment-method-filter");0!==e.length&&a()(e).forEach((function(e){e.addEventListener("change",c)}));var t=document.querySelectorAll(".simpay-payment-method-lite");t&&t.forEach((function(e){return e.addEventListener("change",o.maybeBlockCheckboxWithUpgradeModal)}));var n=document.querySelectorAll(".simpay-payment-method-fee-recovery-lite");n&&n.forEach((function(e){return e.addEventListener("click",o.maybeBlockButtonWithUpgradeModal)}))})),Object(i.a)((function(){var e=document.getElementById("_tax_status_lite");e&&e.addEventListener("change",o.maybeBlockSelectWithUpgradeModal)})),n(40),Object(i.a)((function(){var e,t;(e=document.getElementById("_enable_tax_id"))&&e.addEventListener("change",o.maybeBlockCheckboxWithUpgradeModal),(t=document.getElementById("_enable_promotion_codes"))&&t.addEventListener("change",o.maybeBlockCheckboxWithUpgradeModal)})),n(41),Object(i.a)((function(){var e=document.getElementById("_inventory");e&&e.addEventListener("change",o.maybeBlockCheckboxWithUpgradeModal);var t=document.getElementById("_inventory_behavior_individual");t&&t.addEventListener("change",o.maybeBlockCheckboxWithUpgradeModal);var n=document.getElementById("_schedule_start");n&&n.addEventListener("change",o.maybeBlockCheckboxWithUpgradeModal);var r=document.getElementById("_schedule_end");r&&r.addEventListener("change",o.maybeBlockCheckboxWithUpgradeModal)})),Object(i.a)((function(){var e=document.getElementById("automations-search");if(e){var t=document.querySelectorAll(".simpay-form-builder-automator__integrations-integration");e.addEventListener("input",(function(){var n=e.value.toLowerCase();t.forEach((function(e){for(var t=Object.values(e.dataset),r=0;r array('wp-block-editor', 'wp-components', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-primitives'), 'version' => 'f832a397ccab62027d2aab6dcfeae955'); \ No newline at end of file + array('wp-block-editor', 'wp-components', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-primitives'), 'version' => 'dda6568c499f1c76658381fc4c6c324c'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-block-button.js b/includes/core/assets/js/dist/simpay-block-button.js index 3d964eed..c1ea774e 100644 --- a/includes/core/assets/js/dist/simpay-block-button.js +++ b/includes/core/assets/js/dist/simpay-block-button.js @@ -1 +1 @@ -!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}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=85)}({0:function(e,t){e.exports=window.wp.element},11:function(e,t,r){var o=r(30);e.exports=function(e,t,r){return(t=o(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},2:function(e,t){e.exports=window.wp.i18n},20:function(e,t){e.exports=window.wp.compose},21:function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);re.length)&&(t=e.length);for(var r=0,o=new Array(t);r array(), 'version' => '1334fe88e4b24843d98aa4ae04c0275a'); \ No newline at end of file + array(), 'version' => '91ece58c7a9ea4949d4f311a542142fc'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-block-payment-form.asset.php b/includes/core/assets/js/dist/simpay-block-payment-form.asset.php index 6e425254..4980812c 100644 --- a/includes/core/assets/js/dist/simpay-block-payment-form.asset.php +++ b/includes/core/assets/js/dist/simpay-block-payment-form.asset.php @@ -1 +1 @@ - array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-server-side-render'), 'version' => '0e00c2ad55cf5fb0e7e38ffbc8efe143'); \ No newline at end of file + array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-server-side-render'), 'version' => '8b9e84675cdf249f06a70f5e13506ecc'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-block-payment-form.js b/includes/core/assets/js/dist/simpay-block-payment-form.js index 92e5fdf8..58d5f6e0 100644 --- a/includes/core/assets/js/dist/simpay-block-payment-form.js +++ b/includes/core/assets/js/dist/simpay-block-payment-form.js @@ -1 +1 @@ -!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=84)}({0:function(e,t){e.exports=window.wp.element},16:function(e,t){e.exports=window.wp.data},2:function(e,t){e.exports=window.wp.i18n},21:function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r compat for WordPress 5.6-5.8 - -/** - * External dependencies - */ -import classnames from 'classnames'; - -/** - * WordPress dependencies - */ -import { useInstanceId } from '@wordpress/compose'; -import { __ } from '@wordpress/i18n'; -import { Icon, search, closeSmall } from '@wordpress/icons'; -import { useRef } from '@wordpress/element'; -import { BaseControl, Button } from '@wordpress/components'; - -function SearchControl( { - className, - onChange, - value, - label, - placeholder = __( 'Search' ), - hideLabelFromVision = true, - help, -} ) { - const instanceId = useInstanceId( SearchControl ); - const searchInput = useRef(); - const id = `components-search-control-${ instanceId }`; - - return ( - -
- onChange( event.target.value ) } - autoComplete="off" - value={ value || '' } - /> -
- { !! value && ( -
-
-
- ); -} - -export default SearchControl; diff --git a/includes/core/assets/js/src/admin/index.js b/includes/core/assets/js/src/admin/index.js index fc13003d..89a3df97 100644 --- a/includes/core/assets/js/src/admin/index.js +++ b/includes/core/assets/js/src/admin/index.js @@ -554,9 +554,8 @@ let spAdmin = {}; e.preventDefault(); - spFormSettings.find( '.simpay-field-data' ).each( function () { + spFormSettings.find( '.postbox' ).each( function () { if ( $( this ).is( ':visible' ) ) { - $( this ).hide(); $( this ).addClass( 'closed' ); } } ); diff --git a/includes/core/assets/js/src/admin/pages/activity-reports/components/card-latest-payments/payment.js b/includes/core/assets/js/src/admin/pages/activity-reports/components/card-latest-payments/payment.js index 02d3167d..7c600dbf 100644 --- a/includes/core/assets/js/src/admin/pages/activity-reports/components/card-latest-payments/payment.js +++ b/includes/core/assets/js/src/admin/pages/activity-reports/components/card-latest-payments/payment.js @@ -7,7 +7,7 @@ import classnames from 'classnames'; * WordPress dependencies */ import { Tooltip } from '@wordpress/components'; -import { __ } from '@wordpress/i18n'; +import { __ , sprintf } from '@wordpress/i18n'; import { decodeEntities } from '@wordpress/html-entities'; function Payment( payment ) { @@ -27,6 +27,27 @@ function Payment( payment ) { 'is-failed': 'failed' === status, } ); + + const getTooltipText = () => { + if ( isPartialRefund() && 'refunded' === status ) { + return sprintf( + __('%s refund was initiated', 'simple-pay'), + decodeEntities(payment.amount_refunded_formatted) + ); + } + }; + + const isPartialRefund = () => { + if ( + status === 'refunded' && + payment.amount_refunded !== payment.amount_total + ) { + return true; + } + + return false; + }; + return ( @@ -45,32 +66,58 @@ function Payment( payment ) { ) } -
- { statusFormatted } + +
+ + { statusFormatted } + - -
+ +
+ diff --git a/includes/core/assets/js/src/admin/payment-form/template-explorer/search-control.js b/includes/core/assets/js/src/admin/payment-form/template-explorer/search-control.js deleted file mode 100644 index bca5b427..00000000 --- a/includes/core/assets/js/src/admin/payment-form/template-explorer/search-control.js +++ /dev/null @@ -1,67 +0,0 @@ -// compat for WordPress 5.6-5.8 - -/** - * External dependencies - */ -import classnames from 'classnames'; - -/** - * WordPress dependencies - */ -import { useInstanceId } from '@wordpress/compose'; -import { __ } from '@wordpress/i18n'; -import { Icon, search, closeSmall } from '@wordpress/icons'; -import { useRef } from '@wordpress/element'; -import { BaseControl, Button } from '@wordpress/components'; - -function SearchControl( { - className, - onChange, - value, - label, - placeholder = __( 'Search' ), - hideLabelFromVision = true, - help, -} ) { - const instanceId = useInstanceId( SearchControl ); - const searchInput = useRef(); - const id = `components-search-control-${ instanceId }`; - - return ( - -
- onChange( event.target.value ) } - autoComplete="off" - value={ value || '' } - /> -
- { !! value && ( -
-
-
- ); -} - -export default SearchControl; diff --git a/includes/core/assets/js/src/admin/payment-form/template-explorer/sidebar.js b/includes/core/assets/js/src/admin/payment-form/template-explorer/sidebar.js index f70f43de..f72fe6f0 100644 --- a/includes/core/assets/js/src/admin/payment-form/template-explorer/sidebar.js +++ b/includes/core/assets/js/src/admin/payment-form/template-explorer/sidebar.js @@ -6,13 +6,10 @@ import classnames from 'classnames'; /** * WordPress dependencies */ -import { Button, NavigableMenu } from '@wordpress/components'; +import { Button, NavigableMenu , SearchControl } from '@wordpress/components'; import { __ } from '@wordpress/i18n'; -/** - * Internal dependencies - */ -import SearchControl from './search-control.js'; + const baseClassName = 'simpay-form-template-explorer-main__sidebar'; diff --git a/includes/core/bootstrap/compatibility.php b/includes/core/bootstrap/compatibility.php index 935a5e8a..c3e3f9a6 100644 --- a/includes/core/bootstrap/compatibility.php +++ b/includes/core/bootstrap/compatibility.php @@ -33,8 +33,8 @@ function get_requirements_list() { return array( 'wp' => array( 'name' => 'WordPress', - 'requires' => '5.2', - 'met' => version_compare( get_bloginfo( 'version' ), '5.2', '>=' ), + 'requires' => '5.9', + 'met' => version_compare( get_bloginfo( 'version' ), '5.9', '>=' ), ), 'php' => array( 'name' => 'PHP', @@ -97,7 +97,7 @@ function show_admin_notices() { */ add_action( 'admin_notices', - function() use ( $requirement ) { + function () use ( $requirement ) { ?>
diff --git a/includes/core/forms/functions.php b/includes/core/forms/functions.php index 25d41f8c..b8a17da3 100644 --- a/includes/core/forms/functions.php +++ b/includes/core/forms/functions.php @@ -577,7 +577,7 @@ function simpay_payment_form_add_missing_custom_fields( } elseif ( false === $has_custom_amount ) { if ( isset( $fields['custom_amount'] ) ) { unset( $fields['custom_amount'] ); - $changes[] = __( 'Custom Amount Input has been removed from the payment form. A price option with that allows user-defined amounts is required. ', 'stripe' ); + $changes[] = __( 'Custom Amount Input has been removed from the payment form. A price option that allows user-defined amounts is required. ', 'stripe' ); } } diff --git a/includes/core/payments/payment-confirmation-template-tags.php b/includes/core/payments/payment-confirmation-template-tags.php index 2b8da8db..cdce7992 100644 --- a/includes/core/payments/payment-confirmation-template-tags.php +++ b/includes/core/payments/payment-confirmation-template-tags.php @@ -102,6 +102,10 @@ function parse_content( $content, $payment_confirmation_data ) { if ( has_filter( sprintf( 'simpay_payment_confirmation_template_tag_%s', $tag ) ) ) { foreach ( $tags_with_keys as $tag_with_keys ) { + $keys = explode( '|', $tag_with_keys ); + + $fallback_value = isset( $keys[1] ) ? trim( trim( substr( $keys[1], 1, -1 ), '"' ) ) : ''; + /** * Filters the value used to replace the smart tag with. * @@ -121,6 +125,7 @@ function parse_content( $content, $payment_confirmation_data ) { * @param string $tag Payment confirmation smart tag name, excluding curly braces. * @param array $tags_with_keys Payment confirmation smart tags including keys, excluding curly braces. */ + $value = apply_filters( sprintf( 'simpay_payment_confirmation_template_tag_%s', $tag ), // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores $value, @@ -129,6 +134,10 @@ function parse_content( $content, $payment_confirmation_data ) { $tag_with_keys ); + if ( empty( $value ) ) { + $value = $fallback_value; + } + $content = replace_tag( $tag_with_keys, $value, $content ); } } @@ -149,7 +158,30 @@ function parse_content( $content, $payment_confirmation_data ) { * @return string */ function replace_tag( $tag, $value, $content ) { - return str_replace( '{' . $tag . '}', $value, $content ); + // Remove non-breaking spaces for tag only. + $content = preg_replace_callback( + '/\{([^}]*)\}/', + function ( $matches ) { + return str_replace( "\xC2\xA0", '', $matches[0] ); + }, + $content + ); + $pattern = '/{(' . $tag . '(?::\w+)*)(?:\s*\|\s*"((?:\\"|[^"])*?)")?\}/U'; + $content = preg_replace( '/\{\s*(.*?)\s*\}/', '{$1}', $content ); + preg_match_all( $pattern, $content, $matches, PREG_SET_ORDER ); + + if ( ! empty( $matches ) ) { + foreach ( $matches as $match ) { + // If value is empty, use the fallback value. + if ( empty( $value ) ) { + $value = isset( $match[2] ) ? $match[2] : $value; + } + // $match[0] is the full tag. Example: {form-details}. + $content = str_replace( $match[0], $value, $content ); + } + } + + return $content; } /** @@ -164,16 +196,31 @@ function replace_tag( $tag, $value, $content ) { * @return string $tags_with_keys Tag including keys, excluding curly braces. */ function get_tags_with_keys( $tag, $content ) { + // Remove non-breaking spaces for tag only. + $content = preg_replace_callback( + '/\{([^}]*)\}/', + function ( $matches ) { + return str_replace( "\xC2\xA0", '', $matches[0] ); + }, + $content + ); $tags_with_keys = array(); + $pattern = '/{(' . $tag . '(?::\w+)*)(?:\s*\|\s*"((?:\\"|[^"])*?)")?\}/U'; + $content = preg_replace( '/\{\s*(.*?)\s*\}/', '{$1}', $content ); - preg_match_all( '/{' . $tag . '(:.*)?}/U', $content, $matches ); + preg_match_all( $pattern, $content, $matches, PREG_SET_ORDER ); if ( ! empty( $matches ) ) { - $full_matches = $matches[0]; - foreach ( $full_matches as $match ) { - // Remove { from start and } from end. - $tags_with_keys[] = substr( $match, 1, -1 ); + foreach ( $matches as $match ) { + $tag_with_key = $match[1]; + $key = isset( $match[2] ) ? stripcslashes( $match[2] ) : ''; + + $unique_key = $tag_with_key . ( $key ? " | \"$key\"" : '' ); + + if ( ! in_array( $unique_key, $tags_with_keys, true ) ) { + $tags_with_keys[] = $unique_key; + } } } @@ -734,6 +781,10 @@ function __unstable_get_tags_and_descriptions() { // phpcs:ignore PHPCompatibili 'The unique charge ID returned from Stripe.', 'stripe' ), + 'subtotal-amount' => esc_html__( + 'The cumulative cost of selected items.', + 'stripe' + ), ); if ( simpay_is_upe() ) { diff --git a/includes/core/settings/register-emails.php b/includes/core/settings/register-emails.php index aec4da5c..440a06fa 100644 --- a/includes/core/settings/register-emails.php +++ b/includes/core/settings/register-emails.php @@ -438,6 +438,11 @@ function add_email_selector() { Emails\Email\UpcomingInvoiceEmail::class, Emails\Email\InvoiceConfirmationEmail::class, Emails\Email\ManageSubscriptionsEmail::class, + Emails\Email\PaymentProcessingConfirmationEmail::class, + Emails\Email\PaymentProcessingNotificationEmail::class, + Emails\Email\PaymentRefundedConfirmationEmail::class, + Emails\Email\SubscriptionCancellationConfirmation::class, + Emails\Email\SubscriptionCancellationNotification::class, ), ), 'general' => array( diff --git a/languages/stripe.pot b/languages/stripe.pot index 9e747f30..9c640f32 100644 --- a/languages/stripe.pot +++ b/languages/stripe.pot @@ -2,16 +2,16 @@ # This file is distributed under the same license as the WP Simple Pay Lite plugin. msgid "" msgstr "" -"Project-Id-Version: WP Simple Pay Lite 4.8.0\n" +"Project-Id-Version: WP Simple Pay Lite 4.9.0\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-simple-pay-lite\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2024-04-01T19:04:40+00:00\n" +"POT-Creation-Date: 2024-05-02T15:27:06+00:00\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"X-Generator: WP-CLI 2.8.1\n" +"X-Generator: WP-CLI 2.9.0\n" "X-Domain: stripe\n" #. Plugin Name of the plugin @@ -280,7 +280,7 @@ msgstr "" #. translators: %1$s Future PHP version requirement. #: includes/core/admin/functions/notices.php:167 -msgid "In order to be compatible with future versions of WP Simple Pay, you should update your PHP version to %1$s, 7.0, 7.1, or 7.2. On a normal WordPress site, switching to PHP %1$s should never cause issues. We would however actually recommend you switch to PHP 7.1 or higher to receive the full speed and security benefits provided to more modern and fully supported versions of PHP. However, some plugins may not be fully compatible with PHP 7.x, so more testing may be required." +msgid "In order to be compatible with future versions of WP Simple Pay, you should update your PHP version to %1$s, 7.4, or 8.0. On a normal WordPress site, switching to PHP %1$s should never cause issues. We would however actually recommend you switch to PHP 8.0 or higher to receive the full speed and security benefits provided to more modern and fully supported versions of PHP. However, some plugins may not be fully compatible with PHP 8.x, so more testing may be required." msgstr "" #: includes/core/admin/functions/notices.php:181 @@ -605,7 +605,7 @@ msgid "The Custom Amount Input field is required because you have set a custom a msgstr "" #: includes/core/forms/functions.php:580 -msgid "Custom Amount Input has been removed from the payment form. A price option with that allows user-defined amounts is required. " +msgid "Custom Amount Input has been removed from the payment form. A price option that allows user-defined amounts is required. " msgstr "" #: includes/core/forms/functions.php:594 @@ -10317,75 +10317,77 @@ msgid "" msgstr "" #: includes/core/payments/customer.php:213 +#: src/RestApi/Internal/Payment/TaxCalculationRoute.php:162 #: src/RestApi/Internal/Payment/Traits/CustomerTrait.php:219 msgid "Please select a valid Tax ID type." msgstr "" -#: includes/core/payments/payment-confirmation-template-tags.php:647 +#: includes/core/payments/payment-confirmation-template-tags.php:694 #: includes/core/post-types/simple-pay/edit-form-payment-options.php:490 #: includes/core/post-types/simple-pay/edit-form-payment-options.php:498 msgid "Subscription" msgstr "" -#: includes/core/payments/payment-confirmation-template-tags.php:649 +#: includes/core/payments/payment-confirmation-template-tags.php:696 #: includes/core/post-types/simple-pay/edit-form-payment-options.php:481 #: includes/core/post-types/simple-pay/edit-form-payment-options.php:485 msgid "One time" msgstr "" -#: includes/core/payments/payment-confirmation-template-tags.php:713 +#: includes/core/payments/payment-confirmation-template-tags.php:760 msgid "The form's title." msgstr "" -#: includes/core/payments/payment-confirmation-template-tags.php:717 +#: includes/core/payments/payment-confirmation-template-tags.php:764 msgid "The form's description." msgstr "" -#: includes/core/payments/payment-confirmation-template-tags.php:721 +#: includes/core/payments/payment-confirmation-template-tags.php:768 msgid "The total price of the payment." msgstr "" -#: includes/core/payments/payment-confirmation-template-tags.php:725 +#: includes/core/payments/payment-confirmation-template-tags.php:772 msgid "The value of the Name form field." msgstr "" -#: includes/core/payments/payment-confirmation-template-tags.php:729 +#: includes/core/payments/payment-confirmation-template-tags.php:776 msgid "The charge date returned from Stripe." msgstr "" -#: includes/core/payments/payment-confirmation-template-tags.php:733 +#: includes/core/payments/payment-confirmation-template-tags.php:780 msgid "The unique charge ID returned from Stripe." msgstr "" -#: includes/core/payments/payment-confirmation-template-tags.php:740 +#: includes/core/payments/payment-confirmation-template-tags.php:784 +#: includes/core/payments/payment-confirmation-template-tags.php:791 msgid "The cumulative cost of selected items." msgstr "" -#: includes/core/payments/payment-confirmation-template-tags.php:747 +#: includes/core/payments/payment-confirmation-template-tags.php:798 msgid "The type of payment (one-time or recurring)." msgstr "" -#: includes/core/payments/payment-confirmation-template-tags.php:752 +#: includes/core/payments/payment-confirmation-template-tags.php:803 msgid "The brand of the card used. Visa, Amex, etc." msgstr "" -#: includes/core/payments/payment-confirmation-template-tags.php:757 +#: includes/core/payments/payment-confirmation-template-tags.php:808 msgid "The last four digits of the card used." msgstr "" -#: includes/core/payments/payment-confirmation-template-tags.php:762 +#: includes/core/payments/payment-confirmation-template-tags.php:813 msgid "The calculated tax amount based on the total and the tax percent setting." msgstr "" -#: includes/core/payments/payment-confirmation-template-tags.php:767 +#: includes/core/payments/payment-confirmation-template-tags.php:818 msgid "The calculated fee recovery amount based on the total and the fee recovery percent setting." msgstr "" -#: includes/core/payments/payment-confirmation-template-tags.php:773 +#: includes/core/payments/payment-confirmation-template-tags.php:824 msgid "The amount of the coupon applied to the payment." msgstr "" -#: includes/core/payments/payment-confirmation-template-tags.php:801 +#: includes/core/payments/payment-confirmation-template-tags.php:852 msgid "Available smart tags:" msgstr "" @@ -11054,7 +11056,7 @@ msgid "Learn more" msgstr "" #: includes/core/post-types/simple-pay/edit-form-stripe-checkout.php:288 -#: includes/core/settings/register-emails.php:444 +#: includes/core/settings/register-emails.php:449 msgid "Other" msgstr "" @@ -11648,6 +11650,8 @@ msgstr "" #: includes/core/rest-api/class-controller.php:104 #: src/RestApi/Internal/Payment/LitePaymentCreateRoute.php:72 +#: src/RestApi/Internal/Payment/ProPaymentCreateRoute.php:88 +#: src/RestApi/Internal/Payment/UpdatePaymentMethodRoute.php:147 msgid "Sorry, you have made too many requests. Please try again later." msgstr "" @@ -11657,6 +11661,8 @@ msgstr "" #: includes/core/rest-api/v2/class-paymentintent-controller.php:143 #: src/AntiSpam/EmailVerification.php:578 #: src/AntiSpam/EmailVerification.php:672 +#: src/RestApi/Internal/Payment/ProPaymentCreateRoute.php:136 +#: src/RestApi/Internal/Payment/TaxCalculationRoute.php:108 #: src/RestApi/Internal/Payment/Traits/PaymentIntentTrait.php:142 #: src/RestApi/Internal/Payment/Utils/CouponUtils.php:119 msgid "Invalid request. Please try again." @@ -11823,21 +11829,21 @@ msgstr "" msgid "Payments" msgstr "" -#: includes/core/settings/register-emails.php:461 +#: includes/core/settings/register-emails.php:466 msgid "Select an email to configure…" msgstr "" #. translators: Email label. -#: includes/core/settings/register-emails.php:471 +#: includes/core/settings/register-emails.php:476 msgid "Unlock \"%s\" Email" msgstr "" #. translators: %1$s Email label. %2$s License level required. -#: includes/core/settings/register-emails.php:480 +#: includes/core/settings/register-emails.php:485 msgid "We're sorry, sending and customizing the \"%1$s\" email is not available on your plan. Please upgrade to the %2$s plan or higher to unlock this and other awesome features." msgstr "" -#: includes/core/settings/register-emails.php:534 +#: includes/core/settings/register-emails.php:539 msgid "Configure" msgstr "" @@ -12792,6 +12798,7 @@ msgstr "" #: src/Block/ManageSubscriptionsBlock.php:63 #: src/RestApi/Internal/Payment/LitePaymentCreateRoute.php:82 +#: src/RestApi/Internal/Payment/ProPaymentCreateRoute.php:109 #: src/RestApi/Internal/SubscriptionsManagement/SendSubscriptions.php:146 msgid "Invalid CAPTCHA. Please try again." msgstr "" @@ -12941,6 +12948,71 @@ msgstr "" msgid "View %s in Stripe →" msgstr "" +#: src/Emails/Email/PaymentProcessingConfirmationEmail.php:44 +msgid "Payment Processing Confirmation" +msgstr "" + +#: src/Emails/Email/PaymentProcessingConfirmationEmail.php:51 +msgid "Send a payment processing confirmation email to the customer upon successful payment" +msgstr "" + +#. translators: %s Site name +#: src/Emails/Email/PaymentProcessingConfirmationEmail.php:71 +msgid "Payment Processing Confirmation for %s" +msgstr "" + +#: src/Emails/Email/PaymentProcessingNotificationEmail.php:44 +msgid "Payment Processing Notification" +msgstr "" + +#: src/Emails/Email/PaymentProcessingNotificationEmail.php:51 +msgid "Send a payment processing notification email to the merchant upon successful payment" +msgstr "" + +#. translators: %s Site name +#: src/Emails/Email/PaymentProcessingNotificationEmail.php:88 +msgid "Payment Processing Notification for %s" +msgstr "" + +#: src/Emails/Email/PaymentRefundedConfirmationEmail.php:44 +msgid "Payment Refunded Confirmation" +msgstr "" + +#: src/Emails/Email/PaymentRefundedConfirmationEmail.php:51 +msgid "Send a confirmation email for a payment refund" +msgstr "" + +#. translators: %s Site name +#: src/Emails/Email/PaymentRefundedConfirmationEmail.php:87 +msgid "Payment refunded on %s" +msgstr "" + +#: src/Emails/Email/SubscriptionCancellationConfirmation.php:53 +msgid "Subscription Cancellation Confirmation" +msgstr "" + +#: src/Emails/Email/SubscriptionCancellationConfirmation.php:60 +msgid "Email sent to users when their subscription is cancelled." +msgstr "" + +#. translators: %s Site name +#: src/Emails/Email/SubscriptionCancellationConfirmation.php:80 +msgid "Subscription Cancelled for %s" +msgstr "" + +#: src/Emails/Email/SubscriptionCancellationNotification.php:53 +msgid "Subscription Cancellation Notification" +msgstr "" + +#: src/Emails/Email/SubscriptionCancellationNotification.php:60 +msgid "Email sent to merchants when a subscription is cancelled." +msgstr "" + +#. translators: %s Site name +#: src/Emails/Email/SubscriptionCancellationNotification.php:97 +msgid "Subscription Cancellation Notification for %s" +msgstr "" + #: src/Emails/Email/SummaryReportEmail.php:47 msgid "Summary Report" msgstr "" @@ -13170,6 +13242,18 @@ msgstr "" msgid "Counting results via a query is not allowed. Use the ::count() method." msgstr "" +#: src/RestApi/Internal/Payment/PaymentUpdateRoute.php:114 +#: src/RestApi/Internal/Payment/PaymentUpdateRoute.php:149 +#: src/RestApi/Internal/Payment/PaymentUpdateRoute.php:159 +#: src/RestApi/Internal/Payment/PaymentUpdateRoute.php:169 +#: src/RestApi/Internal/Payment/PaymentUpdateRoute.php:196 +msgid "Invalid request. Please try again" +msgstr "" + +#: src/RestApi/Internal/Payment/TaxCalculationRoute.php:133 +msgid "Please enter a valid address to calculate tax." +msgstr "" + #: src/RestApi/Internal/Payment/Traits/SubscriptionTrait.php:407 msgid "Plan Setup Fee" msgstr "" @@ -13365,6 +13449,14 @@ msgstr "" msgid "The %s field can not be empty." msgstr "" +#: src/RestApi/Internal/Payment/ValidateCouponRoute.php:103 +msgid "Please enter a coupon code." +msgstr "" + +#: src/RestApi/Internal/Payment/ValidateCouponRoute.php:133 +msgid "Coupon is invalid." +msgstr "" + #: src/RestApi/Internal/Report/GrossVolumePeriodOverPeriodReport.php:152 #: src/RestApi/Internal/Report/SuccessfulPaymentsPeriodOverPeriodReport.php:142 msgid "Current period" @@ -13376,21 +13468,29 @@ msgid "Previous period" msgstr "" #. translators: %s Payment created date. -#: src/RestApi/Internal/Report/LatestPaymentsReport.php:155 +#: src/RestApi/Internal/Report/LatestPaymentsReport.php:160 msgid "%s ago" msgstr "" -#: src/RestApi/Internal/Report/LatestPaymentsReport.php:188 +#: src/RestApi/Internal/Report/LatestPaymentsReport.php:194 #: src/RestApi/Internal/Report/PaymentInfoReport.php:356 msgid "Succeeded" msgstr "" -#: src/RestApi/Internal/Report/LatestPaymentsReport.php:190 +#: src/RestApi/Internal/Report/LatestPaymentsReport.php:196 #: src/RestApi/Internal/Report/PaymentInfoReport.php:354 msgid "Failed" msgstr "" -#: src/RestApi/Internal/Report/LatestPaymentsReport.php:192 +#: src/RestApi/Internal/Report/LatestPaymentsReport.php:198 +msgid "Refunded" +msgstr "" + +#: src/RestApi/Internal/Report/LatestPaymentsReport.php:200 +msgid "Partially Refunded" +msgstr "" + +#: src/RestApi/Internal/Report/LatestPaymentsReport.php:202 #: src/RestApi/Internal/Report/PaymentInfoReport.php:358 msgid "Incomplete" msgstr "" @@ -14179,11 +14279,6 @@ msgstr "" msgid "To speed up the process you can select from one of our pre-made templates or start with a basic form. Have a suggestion for a new template? We'd love to hear it!" msgstr "" -#: includes/core/assets/js/dist/simpay-admin-form-template-explorer.js:1 -#: includes/core/assets/js/dist/simpay-admin-help.js:1 -msgid "Reset search" -msgstr "" - #: includes/core/assets/js/dist/simpay-admin-form-template-explorer.js:1 msgid "Search for templates" msgstr "" @@ -14340,6 +14435,10 @@ msgstr "" msgid "Please select a different currency or check back later." msgstr "" +#: includes/core/assets/js/dist/simpay-admin-page-activity-reports.js:2 +msgid "%s refund was initiated" +msgstr "" + #: includes/core/assets/js/dist/simpay-admin-page-activity-reports.js:2 msgid "View customer records" msgstr "" diff --git a/package-lock.json b/package-lock.json index e0e82d83..633594c0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,43 +1,65 @@ { "name": "wp-simple-pay-lite", - "version": "4.8.0", - "lockfileVersion": 1, + "version": "4.9.0", + "lockfileVersion": 3, "requires": true, - "dependencies": { - "abbrev": { + "packages": { + "": { + "name": "wp-simple-pay-lite", + "version": "4.9.0", + "license": "GPL-2.0-or-later", + "devDependencies": { + "grunt": "^1.0.4", + "grunt-banner": "0.x", + "grunt-checktextdomain": "1.x", + "grunt-contrib-clean": "2.x", + "grunt-contrib-compress": "^1.5.0", + "grunt-contrib-copy": "1.x", + "grunt-sed": "^0.1.1", + "grunt-wp-i18n": "^1.0.3", + "load-grunt-tasks": "4.x" + } + }, + "node_modules/abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "dev": true }, - "ansi-regex": { + "node_modules/ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "ansi-styles": { + "node_modules/ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, - "requires": { + "dependencies": { "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" } }, - "aproba": { + "node_modules/aproba": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", "dev": true, "optional": true }, - "archiver": { + "node_modules/archiver": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/archiver/-/archiver-1.3.0.tgz", "integrity": "sha1-TyGU1tj5nfP1MeaIHxTxXVX6ryI=", "dev": true, - "requires": { + "dependencies": { "archiver-utils": "^1.3.0", "async": "^2.0.0", "buffer-crc32": "^0.2.1", @@ -48,153 +70,194 @@ "walkdir": "^0.0.11", "zip-stream": "^1.1.0" }, - "dependencies": { - "async": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", - "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", - "dev": true, - "requires": { - "lodash": "^4.17.14" - } - } + "engines": { + "node": ">= 0.10.0" } }, - "archiver-utils": { + "node_modules/archiver-utils": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-1.3.0.tgz", "integrity": "sha1-5QtMCccL89aA4y/xt5lOn52JUXQ=", "dev": true, - "requires": { + "dependencies": { "glob": "^7.0.0", "graceful-fs": "^4.1.0", "lazystream": "^1.0.0", "lodash": "^4.8.0", "normalize-path": "^2.0.0", "readable-stream": "^2.0.0" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/archiver/node_modules/async": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", + "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", + "dev": true, + "dependencies": { + "lodash": "^4.17.14" } }, - "are-we-there-yet": { + "node_modules/are-we-there-yet": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", "dev": true, "optional": true, - "requires": { + "dependencies": { "delegates": "^1.0.0", "readable-stream": "^2.0.6" } }, - "argparse": { + "node_modules/argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, - "requires": { - "sprintf-js": "~1.0.2" - }, "dependencies": { - "sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true - } + "sprintf-js": "~1.0.2" } }, - "arr-diff": { + "node_modules/argparse/node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "node_modules/arr-diff": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", - "dev": true + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "arr-flatten": { + "node_modules/arr-flatten": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", - "dev": true + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "arr-union": { + "node_modules/arr-union": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", - "dev": true + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "array-differ": { + "node_modules/array-differ": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-1.0.0.tgz", "integrity": "sha1-7/UuN1gknTO+QCuLuOVkuytdQDE=", - "dev": true + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "array-each": { + "node_modules/array-each": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz", "integrity": "sha1-p5SvDAWrF1KEbudTofIRoFugxE8=", - "dev": true + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "array-slice": { + "node_modules/array-slice": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.1.0.tgz", "integrity": "sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==", - "dev": true + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "array-union": { + "node_modules/array-union": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", "dev": true, - "requires": { + "dependencies": { "array-uniq": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" } }, - "array-uniq": { + "node_modules/array-uniq": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", - "dev": true + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "array-unique": { + "node_modules/array-unique": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "dev": true + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "arrify": { + "node_modules/arrify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", - "dev": true + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "assign-symbols": { + "node_modules/assign-symbols": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", - "dev": true + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "async": { + "node_modules/async": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", "dev": true }, - "atob": { + "node_modules/atob": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", - "dev": true + "dev": true, + "bin": { + "atob": "bin/atob.js" + }, + "engines": { + "node": ">= 4.5.0" + } }, - "balanced-match": { + "node_modules/balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true }, - "base": { + "node_modules/base": { "version": "0.11.2", "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", "dev": true, - "requires": { + "dependencies": { "cache-base": "^1.0.1", "class-utils": "^0.3.5", "component-emitter": "^1.2.1", @@ -203,85 +266,100 @@ "mixin-deep": "^1.2.0", "pascalcase": "^0.1.1" }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/base/node_modules/define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } + "is-descriptor": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/base/node_modules/is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "deprecated": "Please upgrade to v1.0.1", + "dev": true, + "dependencies": { + "kind-of": "^6.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/base/node_modules/is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "deprecated": "Please upgrade to v1.0.1", + "dev": true, + "dependencies": { + "kind-of": "^6.0.0" + }, + "engines": { + "node": ">=0.10.0" } }, - "base64-js": { + "node_modules/base/node_modules/is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "dependencies": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/base64-js": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==", "dev": true }, - "bl": { + "node_modules/bl": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.2.tgz", "integrity": "sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA==", "dev": true, - "requires": { + "dependencies": { "readable-stream": "^2.3.5", "safe-buffer": "^5.1.1" } }, - "bluebird": { + "node_modules/bluebird": { "version": "3.7.2", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", "dev": true }, - "brace-expansion": { + "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, - "requires": { + "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, - "braces": { + "node_modules/braces": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", "dev": true, - "requires": { + "dependencies": { "arr-flatten": "^1.1.0", "array-unique": "^0.3.2", "extend-shallow": "^2.0.1", @@ -293,62 +371,69 @@ "split-string": "^3.0.2", "to-regex": "^3.0.1" }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/braces/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" } }, - "buffer": { + "node_modules/buffer": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.6.0.tgz", "integrity": "sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw==", "dev": true, - "requires": { + "dependencies": { "base64-js": "^1.0.2", "ieee754": "^1.1.4" } }, - "buffer-alloc": { + "node_modules/buffer-alloc": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz", "integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==", "dev": true, - "requires": { + "dependencies": { "buffer-alloc-unsafe": "^1.1.0", "buffer-fill": "^1.0.0" } }, - "buffer-alloc-unsafe": { + "node_modules/buffer-alloc-unsafe": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz", "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==", "dev": true }, - "buffer-crc32": { + "node_modules/buffer-crc32": { "version": "0.2.13", "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=", - "dev": true + "dev": true, + "engines": { + "node": "*" + } }, - "buffer-fill": { + "node_modules/buffer-fill": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz", "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=", "dev": true }, - "cache-base": { + "node_modules/cache-base": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", "dev": true, - "requires": { + "dependencies": { "collection-visit": "^1.0.0", "component-emitter": "^1.2.1", "get-value": "^2.0.6", @@ -358,307 +443,382 @@ "to-object-path": "^0.3.0", "union-value": "^1.0.0", "unset-value": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" } }, - "chalk": { + "node_modules/chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, - "requires": { + "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" } }, - "chownr": { + "node_modules/chownr": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", "dev": true, "optional": true }, - "class-utils": { + "node_modules/class-utils": { "version": "0.3.6", "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", "dev": true, - "requires": { + "dependencies": { "arr-union": "^3.1.0", "define-property": "^0.2.5", "isobject": "^3.0.0", "static-extend": "^0.1.1" }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/class-utils/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" } }, - "code-point-at": { + "node_modules/code-point-at": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", "dev": true, - "optional": true + "optional": true, + "engines": { + "node": ">=0.10.0" + } }, - "collection-visit": { + "node_modules/collection-visit": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", "dev": true, - "requires": { + "dependencies": { "map-visit": "^1.0.0", "object-visit": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" } }, - "color-convert": { + "node_modules/color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, - "requires": { + "dependencies": { "color-name": "1.1.3" } }, - "color-name": { + "node_modules/color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, - "colors": { + "node_modules/colors": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz", "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=", - "dev": true + "dev": true, + "engines": { + "node": ">=0.1.90" + } }, - "component-emitter": { + "node_modules/component-emitter": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", "dev": true }, - "compress-commons": { + "node_modules/compress-commons": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-1.2.2.tgz", "integrity": "sha1-UkqfEJA/OoEzibAiXSfEi7dRiQ8=", "dev": true, - "requires": { + "dependencies": { "buffer-crc32": "^0.2.1", "crc32-stream": "^2.0.0", "normalize-path": "^2.0.0", "readable-stream": "^2.0.0" + }, + "engines": { + "node": ">= 0.10.0" } }, - "concat-map": { + "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, - "console-control-strings": { + "node_modules/console-control-strings": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", "dev": true, "optional": true }, - "copy-descriptor": { + "node_modules/copy-descriptor": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", - "dev": true + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "core-util-is": { + "node_modules/core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "dev": true }, - "crc": { + "node_modules/crc": { "version": "3.8.0", "resolved": "https://registry.npmjs.org/crc/-/crc-3.8.0.tgz", "integrity": "sha512-iX3mfgcTMIq3ZKLIsVFAbv7+Mc10kxabAGQb8HvjA1o3T1PIYprbakQ65d3I+2HGHt6nSKkM9PYjgoJO2KcFBQ==", "dev": true, - "requires": { + "dependencies": { "buffer": "^5.1.0" } }, - "crc32-stream": { + "node_modules/crc32-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-2.0.0.tgz", "integrity": "sha1-483TtN8xaN10494/u8t7KX/pCPQ=", "dev": true, - "requires": { + "dependencies": { "crc": "^3.4.4", "readable-stream": "^2.0.0" + }, + "engines": { + "node": ">= 0.10.0" } }, - "dateformat": { + "node_modules/dateformat": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz", "integrity": "sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==", - "dev": true + "dev": true, + "engines": { + "node": "*" + } }, - "debug": { + "node_modules/debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, - "requires": { + "dependencies": { "ms": "2.0.0" } }, - "decode-uri-component": { + "node_modules/decode-uri-component": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", - "dev": true + "dev": true, + "engines": { + "node": ">=0.10" + } }, - "decompress-response": { + "node_modules/decompress-response": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz", "integrity": "sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==", "dev": true, "optional": true, - "requires": { + "dependencies": { "mimic-response": "^2.0.0" + }, + "engines": { + "node": ">=8" } }, - "deep-extend": { + "node_modules/deep-extend": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", "dev": true, - "optional": true + "optional": true, + "engines": { + "node": ">=4.0.0" + } }, - "define-property": { + "node_modules/define-property": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", "dev": true, - "requires": { + "dependencies": { "is-descriptor": "^1.0.2", "isobject": "^3.0.1" }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/define-property/node_modules/is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "deprecated": "Please upgrade to v1.0.1", + "dev": true, "dependencies": { - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } + "kind-of": "^6.0.0" + }, + "engines": { + "node": ">=0.10.0" } }, - "delegates": { + "node_modules/define-property/node_modules/is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "deprecated": "Please upgrade to v1.0.1", + "dev": true, + "dependencies": { + "kind-of": "^6.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/define-property/node_modules/is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "dependencies": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/delegates": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", "dev": true, "optional": true }, - "detect-file": { + "node_modules/detect-file": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=", - "dev": true + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "detect-libc": { + "node_modules/detect-libc": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", "dev": true, - "optional": true + "optional": true, + "bin": { + "detect-libc": "bin/detect-libc.js" + }, + "engines": { + "node": ">=0.10" + } }, - "encoding": { + "node_modules/encoding": { "version": "0.1.13", "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", "dev": true, - "requires": { + "dependencies": { "iconv-lite": "^0.6.2" - }, + } + }, + "node_modules/encoding/node_modules/iconv-lite": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.2.tgz", + "integrity": "sha512-2y91h5OpQlolefMPmUlivelittSWy0rP+oYVpn6A7GwVHNE8AWzoYOBNmlwks3LobaJxgHCYZAnyNo2GgpNRNQ==", + "dev": true, "dependencies": { - "iconv-lite": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.2.tgz", - "integrity": "sha512-2y91h5OpQlolefMPmUlivelittSWy0rP+oYVpn6A7GwVHNE8AWzoYOBNmlwks3LobaJxgHCYZAnyNo2GgpNRNQ==", - "dev": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - } - } + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" } }, - "end-of-stream": { + "node_modules/end-of-stream": { "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", "dev": true, - "requires": { + "dependencies": { "once": "^1.4.0" } }, - "escape-string-regexp": { + "node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true + "dev": true, + "engines": { + "node": ">=0.8.0" + } }, - "esprima": { + "node_modules/esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true + "dev": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } }, - "eventemitter2": { + "node_modules/eventemitter2": { "version": "0.4.14", "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-0.4.14.tgz", "integrity": "sha1-j2G3XN4BKy6esoTUVFWDtWQ7Yas=", "dev": true }, - "exit": { + "node_modules/exit": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", - "dev": true + "dev": true, + "engines": { + "node": ">= 0.8.0" + } }, - "expand-brackets": { + "node_modules/expand-brackets": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", "dev": true, - "requires": { + "dependencies": { "debug": "^2.3.3", "define-property": "^0.2.5", "extend-shallow": "^2.0.1", @@ -667,76 +827,93 @@ "snapdragon": "^0.8.1", "to-regex": "^3.0.1" }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/expand-brackets/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/expand-brackets/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" } }, - "expand-template": { + "node_modules/expand-template": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", "dev": true, - "optional": true + "optional": true, + "engines": { + "node": ">=6" + } }, - "expand-tilde": { + "node_modules/expand-tilde": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", "dev": true, - "requires": { + "dependencies": { "homedir-polyfill": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" } }, - "extend": { + "node_modules/extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", "dev": true }, - "extend-shallow": { + "node_modules/extend-shallow": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", "dev": true, - "requires": { + "dependencies": { "assign-symbols": "^1.0.0", "is-extendable": "^1.0.1" }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/extend-shallow/node_modules/is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } + "is-plain-object": "^2.0.4" + }, + "engines": { + "node": ">=0.10.0" } }, - "extglob": { + "node_modules/extglob": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", "dev": true, - "requires": { + "dependencies": { "array-unique": "^0.3.2", "define-property": "^1.0.0", "expand-brackets": "^2.1.4", @@ -746,180 +923,224 @@ "snapdragon": "^0.8.1", "to-regex": "^3.0.1" }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/extglob/node_modules/define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } + "is-descriptor": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/extglob/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" } }, - "file-sync-cmp": { + "node_modules/extglob/node_modules/is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "deprecated": "Please upgrade to v1.0.1", + "dev": true, + "dependencies": { + "kind-of": "^6.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/extglob/node_modules/is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "deprecated": "Please upgrade to v1.0.1", + "dev": true, + "dependencies": { + "kind-of": "^6.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/extglob/node_modules/is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "dependencies": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/file-sync-cmp": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/file-sync-cmp/-/file-sync-cmp-0.1.1.tgz", "integrity": "sha1-peeo/7+kk7Q7kju9TKiaU7Y7YSs=", "dev": true }, - "fill-range": { + "node_modules/fill-range": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", "dev": true, - "requires": { + "dependencies": { "extend-shallow": "^2.0.1", "is-number": "^3.0.0", "repeat-string": "^1.6.1", "to-regex-range": "^2.1.0" }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fill-range/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" } }, - "find-up": { + "node_modules/find-up": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", "dev": true, - "requires": { + "dependencies": { "locate-path": "^2.0.0" + }, + "engines": { + "node": ">=4" } }, - "findup-sync": { + "node_modules/findup-sync": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.3.0.tgz", "integrity": "sha1-N5MKpdgWt3fANEXhlmzGeQpMCxY=", "dev": true, - "requires": { + "dependencies": { "glob": "~5.0.0" }, + "engines": { + "node": ">= 0.6.0" + } + }, + "node_modules/findup-sync/node_modules/glob": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "dev": true, "dependencies": { - "glob": { - "version": "5.0.15", - "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", - "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", - "dev": true, - "requires": { - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "2 || 3", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - } + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" } }, - "fined": { + "node_modules/fined": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/fined/-/fined-1.2.0.tgz", "integrity": "sha512-ZYDqPLGxDkDhDZBjZBb+oD1+j0rA4E0pXY50eplAAOPg2N/gUBSSk5IM1/QhPfyVo19lJ+CvXpqfvk+b2p/8Ng==", "dev": true, - "requires": { + "dependencies": { "expand-tilde": "^2.0.2", "is-plain-object": "^2.0.3", "object.defaults": "^1.1.0", "object.pick": "^1.2.0", "parse-filepath": "^1.0.1" + }, + "engines": { + "node": ">= 0.10" } }, - "flagged-respawn": { + "node_modules/flagged-respawn": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-1.0.1.tgz", "integrity": "sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q==", - "dev": true + "dev": true, + "engines": { + "node": ">= 0.10" + } }, - "for-in": { + "node_modules/for-in": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", - "dev": true + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "for-own": { + "node_modules/for-own": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz", "integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=", "dev": true, - "requires": { + "dependencies": { "for-in": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" } }, - "fragment-cache": { + "node_modules/fragment-cache": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", "dev": true, - "requires": { + "dependencies": { "map-cache": "^0.2.2" + }, + "engines": { + "node": ">=0.10.0" } }, - "fs-constants": { + "node_modules/fs-constants": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", "dev": true }, - "fs.realpath": { + "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, - "gauge": { + "node_modules/gauge": { "version": "2.7.4", "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", "dev": true, "optional": true, - "requires": { + "dependencies": { "aproba": "^1.0.3", "console-control-strings": "^1.0.0", "has-unicode": "^2.0.0", @@ -930,99 +1151,118 @@ "wide-align": "^1.1.0" } }, - "get-value": { + "node_modules/get-value": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", - "dev": true + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "getobject": { + "node_modules/getobject": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/getobject/-/getobject-0.1.0.tgz", "integrity": "sha1-BHpEl4n6Fg0Bj1SG7ZEyC27HiFw=", - "dev": true + "dev": true, + "engines": { + "node": ">= 0.8.0" + } }, - "gettext-parser": { + "node_modules/gettext-parser": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/gettext-parser/-/gettext-parser-3.1.1.tgz", "integrity": "sha512-vNhWcqXEtZPs5Ft1ReA34g7ByWotpcOIeJvXVy2jF3/G2U9v6W0wG4Z4hXzcU8R//jArqkgHcVCGgGqa4vxVlQ==", "dev": true, - "requires": { + "dependencies": { "encoding": "^0.1.12", "readable-stream": "^3.2.0", "safe-buffer": "^5.1.2" - }, + } + }, + "node_modules/gettext-parser/node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, "dependencies": { - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - } + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" } }, - "github-from-package": { + "node_modules/github-from-package": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", "integrity": "sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4=", "dev": true, "optional": true }, - "glob": { + "node_modules/glob": { "version": "7.1.6", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", "dev": true, - "requires": { + "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^3.0.4", "once": "^1.3.0", "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "global-modules": { + "node_modules/global-modules": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", "dev": true, - "requires": { + "dependencies": { "global-prefix": "^1.0.1", "is-windows": "^1.0.1", "resolve-dir": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" } }, - "global-prefix": { + "node_modules/global-prefix": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", "dev": true, - "requires": { + "dependencies": { "expand-tilde": "^2.0.2", "homedir-polyfill": "^1.0.1", "ini": "^1.3.4", "is-windows": "^1.0.1", "which": "^1.2.14" + }, + "engines": { + "node": ">=0.10.0" } }, - "graceful-fs": { + "node_modules/graceful-fs": { "version": "4.2.4", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", "dev": true }, - "grunt": { + "node_modules/grunt": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/grunt/-/grunt-1.2.1.tgz", "integrity": "sha512-zgJjn9N56tScvRt/y0+1QA+zDBnKTrkpyeSBqQPLcZvbqTD/oyGMrdZQXmm6I3828s+FmPvxc3Xv+lgKFtudOw==", "dev": true, - "requires": { + "dependencies": { "dateformat": "~3.0.3", "eventemitter2": "~0.4.13", "exit": "~0.1.2", @@ -1039,240 +1279,280 @@ "nopt": "~3.0.6", "rimraf": "~3.0.2" }, - "dependencies": { - "grunt-cli": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/grunt-cli/-/grunt-cli-1.3.2.tgz", - "integrity": "sha512-8OHDiZZkcptxVXtMfDxJvmN7MVJNE8L/yIcPb4HB7TlyFD1kDvjHrb62uhySsU14wJx9ORMnTuhRMQ40lH/orQ==", - "dev": true, - "requires": { - "grunt-known-options": "~1.1.0", - "interpret": "~1.1.0", - "liftoff": "~2.5.0", - "nopt": "~4.0.1", - "v8flags": "~3.1.1" - }, - "dependencies": { - "nopt": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz", - "integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==", - "dev": true, - "requires": { - "abbrev": "1", - "osenv": "^0.1.4" - } - } - } - } + "bin": { + "grunt": "bin/grunt" + }, + "engines": { + "node": ">=8" } }, - "grunt-banner": { + "node_modules/grunt-banner": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/grunt-banner/-/grunt-banner-0.6.0.tgz", "integrity": "sha1-P4eQIdEj+linuloLb7a+QStYhaw=", "dev": true, - "requires": { + "dependencies": { "chalk": "^1.1.0" }, + "engines": { + "node": ">=0.10.0" + }, + "peerDependencies": { + "grunt": ">=0.4.0" + } + }, + "node_modules/grunt-banner/node_modules/ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/grunt-banner/node_modules/chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/grunt-banner/node_modules/supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true, + "engines": { + "node": ">=0.8.0" } }, - "grunt-checktextdomain": { + "node_modules/grunt-checktextdomain": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/grunt-checktextdomain/-/grunt-checktextdomain-1.0.1.tgz", "integrity": "sha1-slTQHh3pEwBdTbHFMD2QI7mD4Zs=", "dev": true, - "requires": { + "dependencies": { "chalk": "~0.2.1", "text-table": "~0.2.0" }, + "engines": { + "node": ">= 0.8.0" + }, + "peerDependencies": { + "grunt": ">=0.4.1" + } + }, + "node_modules/grunt-checktextdomain/node_modules/ansi-styles": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-0.2.0.tgz", + "integrity": "sha1-NZq0sV3NZLptdHNLcsNjYKmvLBk=", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/grunt-checktextdomain/node_modules/chalk": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-0.2.1.tgz", + "integrity": "sha1-dhPhV1FFshOGSD9/SFql/6jL0Qw=", + "dev": true, "dependencies": { - "ansi-styles": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-0.2.0.tgz", - "integrity": "sha1-NZq0sV3NZLptdHNLcsNjYKmvLBk=", - "dev": true - }, - "chalk": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-0.2.1.tgz", - "integrity": "sha1-dhPhV1FFshOGSD9/SFql/6jL0Qw=", - "dev": true, - "requires": { - "ansi-styles": "~0.2.0", - "has-color": "~0.1.0" - } - } + "ansi-styles": "~0.2.0", + "has-color": "~0.1.0" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/grunt-contrib-clean": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/grunt-contrib-clean/-/grunt-contrib-clean-2.0.0.tgz", + "integrity": "sha512-g5ZD3ORk6gMa5ugZosLDQl3dZO7cI3R14U75hTM+dVLVxdMNJCPVmwf9OUt4v4eWgpKKWWoVK9DZc1amJp4nQw==", + "dev": true, + "dependencies": { + "async": "^2.6.1", + "rimraf": "^2.6.2" + }, + "engines": { + "node": ">=6" + }, + "peerDependencies": { + "grunt": ">=0.4.5" + } + }, + "node_modules/grunt-contrib-clean/node_modules/async": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", + "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", + "dev": true, + "dependencies": { + "lodash": "^4.17.14" } }, - "grunt-contrib-clean": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/grunt-contrib-clean/-/grunt-contrib-clean-2.0.0.tgz", - "integrity": "sha512-g5ZD3ORk6gMa5ugZosLDQl3dZO7cI3R14U75hTM+dVLVxdMNJCPVmwf9OUt4v4eWgpKKWWoVK9DZc1amJp4nQw==", + "node_modules/grunt-contrib-clean/node_modules/rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", "dev": true, - "requires": { - "async": "^2.6.1", - "rimraf": "^2.6.2" - }, "dependencies": { - "async": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", - "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", - "dev": true, - "requires": { - "lodash": "^4.17.14" - } - }, - "rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - } + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" } }, - "grunt-contrib-compress": { + "node_modules/grunt-contrib-compress": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/grunt-contrib-compress/-/grunt-contrib-compress-1.6.0.tgz", "integrity": "sha512-wIFuvk+/Ny4E+OgEfJYFZgoH7KcU/nnNFbYasB7gRvrcRyW6vmTp3Pj8a4rFSR3tbFMjrGvTUszdO6fgLajgZQ==", "dev": true, - "requires": { + "dependencies": { "archiver": "^1.3.0", "chalk": "^1.1.1", - "iltorb": "^2.4.3", "lodash": "^4.7.0", "pretty-bytes": "^4.0.2", "stream-buffers": "^2.1.0" }, + "engines": { + "node": ">=4.0" + }, + "optionalDependencies": { + "iltorb": "^2.4.3" + } + }, + "node_modules/grunt-contrib-compress/node_modules/ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/grunt-contrib-compress/node_modules/chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" } }, - "grunt-contrib-copy": { + "node_modules/grunt-contrib-compress/node_modules/supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/grunt-contrib-copy": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/grunt-contrib-copy/-/grunt-contrib-copy-1.0.0.tgz", "integrity": "sha1-cGDGWB6QS4qw0A8HbgqPbj58NXM=", "dev": true, - "requires": { + "dependencies": { "chalk": "^1.1.1", "file-sync-cmp": "^0.1.0" }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/grunt-contrib-copy/node_modules/ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/grunt-contrib-copy/node_modules/chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" } }, - "grunt-known-options": { + "node_modules/grunt-contrib-copy/node_modules/supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/grunt-known-options": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/grunt-known-options/-/grunt-known-options-1.1.1.tgz", "integrity": "sha512-cHwsLqoighpu7TuYj5RonnEuxGVFnztcUqTqp5rXFGYL4OuPFofwC4Ycg7n9fYwvK6F5WbYgeVOwph9Crs2fsQ==", - "dev": true + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "grunt-legacy-log": { + "node_modules/grunt-legacy-log": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/grunt-legacy-log/-/grunt-legacy-log-2.0.0.tgz", "integrity": "sha512-1m3+5QvDYfR1ltr8hjiaiNjddxGdQWcH0rw1iKKiQnF0+xtgTazirSTGu68RchPyh1OBng1bBUjLmX8q9NpoCw==", "dev": true, - "requires": { + "dependencies": { "colors": "~1.1.2", "grunt-legacy-log-utils": "~2.0.0", "hooker": "~0.2.3", "lodash": "~4.17.5" + }, + "engines": { + "node": ">= 0.10.0" } }, - "grunt-legacy-log-utils": { + "node_modules/grunt-legacy-log-utils": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/grunt-legacy-log-utils/-/grunt-legacy-log-utils-2.0.1.tgz", "integrity": "sha512-o7uHyO/J+i2tXG8r2bZNlVk20vlIFJ9IEYyHMCQGfWYru8Jv3wTqKZzvV30YW9rWEjq0eP3cflQ1qWojIe9VFA==", "dev": true, - "requires": { + "dependencies": { "chalk": "~2.4.1", "lodash": "~4.17.10" + }, + "engines": { + "node": ">=6" } }, - "grunt-legacy-util": { + "node_modules/grunt-legacy-util": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/grunt-legacy-util/-/grunt-legacy-util-1.1.1.tgz", "integrity": "sha512-9zyA29w/fBe6BIfjGENndwoe1Uy31BIXxTH3s8mga0Z5Bz2Sp4UCjkeyv2tI449ymkx3x26B+46FV4fXEddl5A==", "dev": true, - "requires": { + "dependencies": { "async": "~1.5.2", "exit": "~0.1.1", "getobject": "~0.1.0", @@ -1280,124 +1560,195 @@ "lodash": "~4.17.10", "underscore.string": "~3.3.4", "which": "~1.3.0" + }, + "engines": { + "node": ">= 6" } }, - "grunt-sed": { + "node_modules/grunt-sed": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/grunt-sed/-/grunt-sed-0.1.1.tgz", "integrity": "sha512-70jT0SJrvYWtgZ6pzG/rOFEZtV8bmC4YhkutSkQ38osv8lumb+UkFIrdN49ArlJSmfUo+SqdIKQsMtzpy8fOaw==", "dev": true, - "requires": { + "dependencies": { "replace": "~0.2.4" + }, + "engines": { + "node": ">=0.8.0" + }, + "peerDependencies": { + "grunt": "~0.4" } }, - "grunt-wp-i18n": { + "node_modules/grunt-wp-i18n": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/grunt-wp-i18n/-/grunt-wp-i18n-1.0.3.tgz", "integrity": "sha512-CJNbEKeBeOSAPeaJ9B8iCgSwtaG63UR9/uT46a4OsIqnFhOJpeAi138JTlvjfIbnDVoBrzvdrKJe1svveLjUtA==", "dev": true, - "requires": { + "dependencies": { "grunt": "^1.0.3", "node-wp-i18n": "^1.2.2" + }, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/grunt/node_modules/grunt-cli": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/grunt-cli/-/grunt-cli-1.3.2.tgz", + "integrity": "sha512-8OHDiZZkcptxVXtMfDxJvmN7MVJNE8L/yIcPb4HB7TlyFD1kDvjHrb62uhySsU14wJx9ORMnTuhRMQ40lH/orQ==", + "dev": true, + "dependencies": { + "grunt-known-options": "~1.1.0", + "interpret": "~1.1.0", + "liftoff": "~2.5.0", + "nopt": "~4.0.1", + "v8flags": "~3.1.1" + }, + "bin": { + "grunt": "bin/grunt" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/grunt/node_modules/grunt-cli/node_modules/nopt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz", + "integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==", + "dev": true, + "dependencies": { + "abbrev": "1", + "osenv": "^0.1.4" + }, + "bin": { + "nopt": "bin/nopt.js" } }, - "has-ansi": { + "node_modules/has-ansi": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", "dev": true, - "requires": { + "dependencies": { "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" } }, - "has-color": { + "node_modules/has-color": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/has-color/-/has-color-0.1.7.tgz", "integrity": "sha1-ZxRKUmDDT8PMpnfQQdr1L+e3iy8=", - "dev": true + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "has-flag": { + "node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true + "dev": true, + "engines": { + "node": ">=4" + } }, - "has-unicode": { + "node_modules/has-unicode": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", "dev": true, "optional": true }, - "has-value": { + "node_modules/has-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", "dev": true, - "requires": { + "dependencies": { "get-value": "^2.0.6", "has-values": "^1.0.0", "isobject": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" } }, - "has-values": { + "node_modules/has-values": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", "dev": true, - "requires": { + "dependencies": { "is-number": "^3.0.0", "kind-of": "^4.0.0" }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/has-values/node_modules/kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, "dependencies": { - "kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" } }, - "homedir-polyfill": { + "node_modules/homedir-polyfill": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", "dev": true, - "requires": { + "dependencies": { "parse-passwd": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" } }, - "hooker": { + "node_modules/hooker": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/hooker/-/hooker-0.2.3.tgz", "integrity": "sha1-uDT3I8xKJCqmWWNFnfbZhMXT2Vk=", - "dev": true + "dev": true, + "engines": { + "node": "*" + } }, - "iconv-lite": { + "node_modules/iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "dev": true, - "requires": { + "dependencies": { "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" } }, - "ieee754": { + "node_modules/ieee754": { "version": "1.1.13", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==", "dev": true }, - "iltorb": { + "node_modules/iltorb": { "version": "2.4.5", "resolved": "https://registry.npmjs.org/iltorb/-/iltorb-2.4.5.tgz", "integrity": "sha512-EMCMl3LnnNSZJS5QrxyZmMTaAC4+TJkM5woD+xbpm9RB+mFYCr7C05GFE3TEGCsVQSVHmjX+3sf5AiwsylNInQ==", + "deprecated": "The zlib module provides APIs for brotli compression/decompression starting with Node.js v10.16.0, please use it over iltorb", "dev": true, + "hasInstallScript": true, "optional": true, - "requires": { + "dependencies": { "detect-libc": "^1.0.3", "nan": "^2.14.0", "npmlog": "^4.1.2", @@ -1405,242 +1756,303 @@ "which-pm-runs": "^1.0.0" } }, - "inflight": { + "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, - "requires": { + "dependencies": { "once": "^1.3.0", "wrappy": "1" } }, - "inherits": { + "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, - "ini": { + "node_modules/ini": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", - "dev": true + "deprecated": "Please update to ini >=1.3.6 to avoid a prototype pollution issue", + "dev": true, + "engines": { + "node": "*" + } }, - "interpret": { + "node_modules/interpret": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.1.0.tgz", "integrity": "sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ=", "dev": true }, - "is-absolute": { + "node_modules/is-absolute": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", "dev": true, - "requires": { + "dependencies": { "is-relative": "^1.0.0", "is-windows": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" } }, - "is-accessor-descriptor": { + "node_modules/is-accessor-descriptor": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "deprecated": "Please upgrade to v0.1.7", "dev": true, - "requires": { + "dependencies": { "kind-of": "^3.0.2" }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-accessor-descriptor/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" } }, - "is-buffer": { + "node_modules/is-buffer": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", "dev": true }, - "is-data-descriptor": { + "node_modules/is-data-descriptor": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "deprecated": "Please upgrade to v0.1.5", "dev": true, - "requires": { + "dependencies": { "kind-of": "^3.0.2" }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-data-descriptor/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" } }, - "is-descriptor": { + "node_modules/is-descriptor": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", "dev": true, - "requires": { + "dependencies": { "is-accessor-descriptor": "^0.1.6", "is-data-descriptor": "^0.1.4", "kind-of": "^5.0.0" }, - "dependencies": { - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true - } + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-descriptor/node_modules/kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true, + "engines": { + "node": ">=0.10.0" } }, - "is-extendable": { + "node_modules/is-extendable": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "is-extglob": { + "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "is-fullwidth-code-point": { + "node_modules/is-fullwidth-code-point": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "dev": true, "optional": true, - "requires": { + "dependencies": { "number-is-nan": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" } }, - "is-glob": { + "node_modules/is-glob": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", "dev": true, - "requires": { + "dependencies": { "is-extglob": "^2.1.0" + }, + "engines": { + "node": ">=0.10.0" } }, - "is-number": { + "node_modules/is-number": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", "dev": true, - "requires": { + "dependencies": { "kind-of": "^3.0.2" }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" } }, - "is-plain-object": { + "node_modules/is-plain-object": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", "dev": true, - "requires": { + "dependencies": { "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" } }, - "is-relative": { + "node_modules/is-relative": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", "dev": true, - "requires": { + "dependencies": { "is-unc-path": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" } }, - "is-unc-path": { + "node_modules/is-unc-path": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", "dev": true, - "requires": { + "dependencies": { "unc-path-regex": "^0.1.2" + }, + "engines": { + "node": ">=0.10.0" } }, - "is-windows": { + "node_modules/is-windows": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", - "dev": true + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "isarray": { + "node_modules/isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "dev": true }, - "isexe": { + "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, - "isobject": { + "node_modules/isobject": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "js-yaml": { + "node_modules/js-yaml": { "version": "3.14.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz", "integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==", "dev": true, - "requires": { + "dependencies": { "argparse": "^1.0.7", "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" } }, - "kind-of": { + "node_modules/kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "lazystream": { + "node_modules/lazystream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.0.tgz", "integrity": "sha1-9plf4PggOS9hOWvolGJAe7dxaOQ=", "dev": true, - "requires": { + "dependencies": { "readable-stream": "^2.0.5" + }, + "engines": { + "node": ">= 0.6.3" } }, - "liftoff": { + "node_modules/liftoff": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/liftoff/-/liftoff-2.5.0.tgz", "integrity": "sha1-IAkpG7Mc6oYbvxCnwVooyvdcMew=", "dev": true, - "requires": { + "dependencies": { "extend": "^3.0.0", "findup-sync": "^2.0.0", "fined": "^1.0.1", @@ -1650,85 +2062,107 @@ "rechoir": "^0.6.2", "resolve": "^1.1.7" }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/liftoff/node_modules/findup-sync": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-2.0.0.tgz", + "integrity": "sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw=", + "dev": true, "dependencies": { - "findup-sync": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-2.0.0.tgz", - "integrity": "sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw=", - "dev": true, - "requires": { - "detect-file": "^1.0.0", - "is-glob": "^3.1.0", - "micromatch": "^3.0.4", - "resolve-dir": "^1.0.1" - } - } + "detect-file": "^1.0.0", + "is-glob": "^3.1.0", + "micromatch": "^3.0.4", + "resolve-dir": "^1.0.1" + }, + "engines": { + "node": ">= 0.10" } }, - "load-grunt-tasks": { + "node_modules/load-grunt-tasks": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/load-grunt-tasks/-/load-grunt-tasks-4.0.0.tgz", "integrity": "sha512-w5JYPHpZgMxu9XFR9N9MEzyX8E0mLhQkwQ1qVP4mb3gmuomw8Ww8J49NHMbXqyQliq2LUCqdU7/wW96IVuPCKw==", "dev": true, - "requires": { + "dependencies": { "arrify": "^1.0.0", "multimatch": "^2.0.0", "pkg-up": "^2.0.0", "resolve-pkg": "^1.0.0" + }, + "engines": { + "node": ">=6" + }, + "peerDependencies": { + "grunt": ">=1" } }, - "locate-path": { + "node_modules/locate-path": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", "dev": true, - "requires": { + "dependencies": { "p-locate": "^2.0.0", "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=4" } }, - "lodash": { + "node_modules/lodash": { "version": "4.17.19", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==", "dev": true }, - "lru-cache": { + "node_modules/lru-cache": { "version": "2.7.3", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", "integrity": "sha512-WpibWJ60c3AgAz8a2iYErDrcT2C7OmKnsWhIcHOjkUHFjkXncJhtLxNSqUmxRxRunpb5I8Vprd7aNSd2NtksJQ==", "dev": true }, - "make-iterator": { + "node_modules/make-iterator": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz", "integrity": "sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==", "dev": true, - "requires": { + "dependencies": { "kind-of": "^6.0.2" + }, + "engines": { + "node": ">=0.10.0" } }, - "map-cache": { + "node_modules/map-cache": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", - "dev": true + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "map-visit": { + "node_modules/map-visit": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", "dev": true, - "requires": { + "dependencies": { "object-visit": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" } }, - "micromatch": { + "node_modules/micromatch": { "version": "3.1.10", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", "dev": true, - "requires": { + "dependencies": { "arr-diff": "^4.0.0", "array-unique": "^0.3.2", "braces": "^2.3.1", @@ -1742,95 +2176,120 @@ "regex-not": "^1.0.0", "snapdragon": "^0.8.1", "to-regex": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" } }, - "mimic-response": { + "node_modules/mimic-response": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz", "integrity": "sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA==", "dev": true, - "optional": true + "optional": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "minimatch": { + "node_modules/minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, - "requires": { + "dependencies": { "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" } }, - "minimist": { + "node_modules/minimist": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "dev": true }, - "mixin-deep": { + "node_modules/mixin-deep": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", "dev": true, - "requires": { + "dependencies": { "for-in": "^1.0.2", "is-extendable": "^1.0.1" }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/mixin-deep/node_modules/is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } + "is-plain-object": "^2.0.4" + }, + "engines": { + "node": ">=0.10.0" } }, - "mkdirp": { + "node_modules/mkdirp": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "dev": true + "dev": true, + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } }, - "mkdirp-classic": { + "node_modules/mkdirp-classic": { "version": "0.5.3", "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", "dev": true, "optional": true }, - "ms": { + "node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true }, - "multimatch": { + "node_modules/multimatch": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-2.1.0.tgz", "integrity": "sha1-nHkGoi+0wCkZ4vX3UWG0zb1LKis=", "dev": true, - "requires": { + "dependencies": { "array-differ": "^1.0.0", "array-union": "^1.0.1", "arrify": "^1.0.0", "minimatch": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" } }, - "nan": { + "node_modules/nan": { "version": "2.14.1", "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.1.tgz", "integrity": "sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==", "dev": true, "optional": true }, - "nanomatch": { + "node_modules/nanomatch": { "version": "1.2.13", "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", "dev": true, - "requires": { + "dependencies": { "arr-diff": "^4.0.0", "array-unique": "^0.3.2", "define-property": "^2.0.2", @@ -1842,31 +2301,34 @@ "regex-not": "^1.0.0", "snapdragon": "^0.8.1", "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" } }, - "napi-build-utils": { + "node_modules/napi-build-utils": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==", "dev": true, "optional": true }, - "node-abi": { + "node_modules/node-abi": { "version": "2.18.0", "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.18.0.tgz", "integrity": "sha512-yi05ZoiuNNEbyT/xXfSySZE+yVnQW6fxPZuFbLyS1s6b5Kw3HzV2PHOM4XR+nsjzkHxByK+2Wg+yCQbe35l8dw==", "dev": true, "optional": true, - "requires": { + "dependencies": { "semver": "^5.4.1" } }, - "node-wp-i18n": { + "node_modules/node-wp-i18n": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/node-wp-i18n/-/node-wp-i18n-1.2.3.tgz", "integrity": "sha512-YMzMcsjXbGYDB9vHyb289CYXAGmXhcNLbeTlOnWgPNkZd9xrovcbRd7cQyKd9BQHOjS7Nw8WCbJ7nvtR7rc0rg==", "dev": true, - "requires": { + "dependencies": { "bluebird": "^3.4.1", "gettext-parser": "^3.1.0", "glob": "^7.0.5", @@ -1875,292 +2337,371 @@ "mkdirp": "^0.5.1", "tmp": "^0.0.33" }, + "bin": { + "wpi18n": "bin/wpi18n" + } + }, + "node_modules/node-wp-i18n/node_modules/mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, "dependencies": { - "mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "dev": true, - "requires": { - "minimist": "^1.2.5" - } - } + "minimist": "^1.2.5" + }, + "bin": { + "mkdirp": "bin/cmd.js" } }, - "nomnom": { + "node_modules/nomnom": { "version": "1.6.2", "resolved": "https://registry.npmjs.org/nomnom/-/nomnom-1.6.2.tgz", "integrity": "sha512-mscrcqifc/QKP6/afmtoC84/mK6SKcDTDEfKPMSgJKeV5dtshiw5+AF90uwHyAqHkMIYIEcGkSAJnV6+T9PY/g==", + "deprecated": "Package no longer supported. Contact support@npmjs.com for more info.", "dev": true, - "requires": { + "dependencies": { "colors": "0.5.x", "underscore": "~1.4.4" - }, - "dependencies": { - "colors": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/colors/-/colors-0.5.1.tgz", - "integrity": "sha512-XjsuUwpDeY98+yz959OlUK6m7mLBM+1MEG5oaenfuQnNnrQk1WvtcvFgN3FNDP3f2NmZ211t0mNEfSEN1h0eIg==", - "dev": true - } } }, - "noop-logger": { + "node_modules/nomnom/node_modules/colors": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/colors/-/colors-0.5.1.tgz", + "integrity": "sha512-XjsuUwpDeY98+yz959OlUK6m7mLBM+1MEG5oaenfuQnNnrQk1WvtcvFgN3FNDP3f2NmZ211t0mNEfSEN1h0eIg==", + "dev": true, + "engines": { + "node": ">=0.1.90" + } + }, + "node_modules/noop-logger": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/noop-logger/-/noop-logger-0.1.1.tgz", "integrity": "sha1-lKKxYzxPExdVMAfYlm/Q6EG2pMI=", "dev": true, "optional": true }, - "nopt": { + "node_modules/nopt": { "version": "3.0.6", "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", "dev": true, - "requires": { + "dependencies": { "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" } }, - "normalize-path": { + "node_modules/normalize-path": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", "dev": true, - "requires": { + "dependencies": { "remove-trailing-separator": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" } }, - "npmlog": { + "node_modules/npmlog": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", "dev": true, "optional": true, - "requires": { + "dependencies": { "are-we-there-yet": "~1.1.2", "console-control-strings": "~1.1.0", "gauge": "~2.7.3", "set-blocking": "~2.0.0" } }, - "number-is-nan": { + "node_modules/number-is-nan": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", "dev": true, - "optional": true + "optional": true, + "engines": { + "node": ">=0.10.0" + } }, - "object-assign": { + "node_modules/object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "dev": true, - "optional": true + "optional": true, + "engines": { + "node": ">=0.10.0" + } }, - "object-copy": { + "node_modules/object-copy": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", "dev": true, - "requires": { + "dependencies": { "copy-descriptor": "^0.1.0", "define-property": "^0.2.5", "kind-of": "^3.0.3" }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-copy/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-copy/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" } }, - "object-visit": { + "node_modules/object-visit": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", "dev": true, - "requires": { + "dependencies": { "isobject": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" } }, - "object.defaults": { + "node_modules/object.defaults": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz", "integrity": "sha1-On+GgzS0B96gbaFtiNXNKeQ1/s8=", "dev": true, - "requires": { + "dependencies": { "array-each": "^1.0.1", "array-slice": "^1.0.0", "for-own": "^1.0.0", "isobject": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" } }, - "object.map": { + "node_modules/object.map": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/object.map/-/object.map-1.0.1.tgz", "integrity": "sha1-z4Plncj8wK1fQlDh94s7gb2AHTc=", "dev": true, - "requires": { + "dependencies": { "for-own": "^1.0.0", "make-iterator": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" } }, - "object.pick": { + "node_modules/object.pick": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", "dev": true, - "requires": { + "dependencies": { "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" } }, - "once": { + "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, - "requires": { + "dependencies": { "wrappy": "1" } }, - "os-homedir": { + "node_modules/os-homedir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", - "dev": true + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "os-tmpdir": { + "node_modules/os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", - "dev": true + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "osenv": { + "node_modules/osenv": { "version": "0.1.5", "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", "dev": true, - "requires": { + "dependencies": { "os-homedir": "^1.0.0", "os-tmpdir": "^1.0.0" } }, - "p-limit": { + "node_modules/p-limit": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", "dev": true, - "requires": { + "dependencies": { "p-try": "^1.0.0" + }, + "engines": { + "node": ">=4" } }, - "p-locate": { + "node_modules/p-locate": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", "dev": true, - "requires": { + "dependencies": { "p-limit": "^1.1.0" + }, + "engines": { + "node": ">=4" } }, - "p-try": { + "node_modules/p-try": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true + "dev": true, + "engines": { + "node": ">=4" + } }, - "parse-filepath": { + "node_modules/parse-filepath": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.2.tgz", "integrity": "sha1-pjISf1Oq89FYdvWHLz/6x2PWyJE=", "dev": true, - "requires": { + "dependencies": { "is-absolute": "^1.0.0", "map-cache": "^0.2.0", "path-root": "^0.1.1" + }, + "engines": { + "node": ">=0.8" } }, - "parse-passwd": { + "node_modules/parse-passwd": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", - "dev": true + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "pascalcase": { + "node_modules/pascalcase": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", - "dev": true + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "path-exists": { + "node_modules/path-exists": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true + "dev": true, + "engines": { + "node": ">=4" + } }, - "path-is-absolute": { + "node_modules/path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "path-parse": { + "node_modules/path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, - "path-root": { + "node_modules/path-root": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/path-root/-/path-root-0.1.1.tgz", "integrity": "sha1-mkpoFMrBwM1zNgqV8yCDyOpHRbc=", "dev": true, - "requires": { + "dependencies": { "path-root-regex": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" } }, - "path-root-regex": { + "node_modules/path-root-regex": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/path-root-regex/-/path-root-regex-0.1.2.tgz", "integrity": "sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0=", - "dev": true + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "pkg-up": { + "node_modules/pkg-up": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-2.0.0.tgz", "integrity": "sha1-yBmscoBZpGHKscOImivjxJoATX8=", "dev": true, - "requires": { + "dependencies": { "find-up": "^2.1.0" + }, + "engines": { + "node": ">=4" } }, - "posix-character-classes": { + "node_modules/posix-character-classes": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", - "dev": true + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "prebuild-install": { + "node_modules/prebuild-install": { "version": "5.3.5", "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-5.3.5.tgz", "integrity": "sha512-YmMO7dph9CYKi5IR/BzjOJlRzpxGGVo1EsLSUZ0mt/Mq0HWZIHOKHHcHdT69yG54C9m6i45GpItwRHpk0Py7Uw==", "dev": true, "optional": true, - "requires": { + "dependencies": { "detect-libc": "^1.0.3", "expand-template": "^2.0.3", "github-from-package": "0.0.0", @@ -2177,61 +2718,74 @@ "tunnel-agent": "^0.6.0", "which-pm-runs": "^1.0.0" }, + "bin": { + "prebuild-install": "bin.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/prebuild-install/node_modules/mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "optional": true, "dependencies": { - "mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "dev": true, - "optional": true, - "requires": { - "minimist": "^1.2.5" - } - } + "minimist": "^1.2.5" + }, + "bin": { + "mkdirp": "bin/cmd.js" } }, - "pretty-bytes": { + "node_modules/pretty-bytes": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-4.0.2.tgz", "integrity": "sha1-sr+C5zUNZcbDOqlaqlpPYyf2HNk=", - "dev": true + "dev": true, + "engines": { + "node": ">=4" + } }, - "process-nextick-args": { + "node_modules/process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", "dev": true }, - "pump": { + "node_modules/pump": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", "dev": true, "optional": true, - "requires": { + "dependencies": { "end-of-stream": "^1.1.0", "once": "^1.3.1" } }, - "rc": { + "node_modules/rc": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", "dev": true, "optional": true, - "requires": { + "dependencies": { "deep-extend": "^0.6.0", "ini": "~1.3.0", "minimist": "^1.2.0", "strip-json-comments": "~2.0.1" + }, + "bin": { + "rc": "cli.js" } }, - "readable-stream": { + "node_modules/readable-stream": { "version": "2.3.7", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "dev": true, - "requires": { + "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", "isarray": "~1.0.0", @@ -2241,223 +2795,287 @@ "util-deprecate": "~1.0.1" } }, - "rechoir": { + "node_modules/rechoir": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", "dev": true, - "requires": { + "dependencies": { "resolve": "^1.1.6" + }, + "engines": { + "node": ">= 0.10" } }, - "regex-not": { + "node_modules/regex-not": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", "dev": true, - "requires": { + "dependencies": { "extend-shallow": "^3.0.2", "safe-regex": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" } }, - "remove-trailing-separator": { + "node_modules/remove-trailing-separator": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", "dev": true }, - "repeat-element": { + "node_modules/repeat-element": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", - "dev": true + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "repeat-string": { + "node_modules/repeat-string": { "version": "1.6.1", "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", - "dev": true + "dev": true, + "engines": { + "node": ">=0.10" + } }, - "replace": { + "node_modules/replace": { "version": "0.2.10", "resolved": "https://registry.npmjs.org/replace/-/replace-0.2.10.tgz", "integrity": "sha512-CTu46uJCtYGGfDVQL64zqkhN7nD6KRao7e5IaYiPiPwF69/XX4QHhAPV08YWaODrgBiwVbp9Pua436WMp2tdOw==", "dev": true, - "requires": { + "dependencies": { "colors": "0.5.x", "minimatch": "~0.2.9", "nomnom": "1.6.x" }, + "bin": { + "replace": "bin/replace.js", + "search": "bin/search.js" + } + }, + "node_modules/replace/node_modules/colors": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/colors/-/colors-0.5.1.tgz", + "integrity": "sha512-XjsuUwpDeY98+yz959OlUK6m7mLBM+1MEG5oaenfuQnNnrQk1WvtcvFgN3FNDP3f2NmZ211t0mNEfSEN1h0eIg==", + "dev": true, + "engines": { + "node": ">=0.1.90" + } + }, + "node_modules/replace/node_modules/minimatch": { + "version": "0.2.14", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", + "integrity": "sha512-zZ+Jy8lVWlvqqeM8iZB7w7KmQkoJn8djM585z88rywrEbzoqawVa9FR5p2hwD+y74nfuKOjmNvi9gtWJNLqHvA==", + "deprecated": "Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue", + "dev": true, "dependencies": { - "colors": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/colors/-/colors-0.5.1.tgz", - "integrity": "sha512-XjsuUwpDeY98+yz959OlUK6m7mLBM+1MEG5oaenfuQnNnrQk1WvtcvFgN3FNDP3f2NmZ211t0mNEfSEN1h0eIg==", - "dev": true - }, - "minimatch": { - "version": "0.2.14", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", - "integrity": "sha512-zZ+Jy8lVWlvqqeM8iZB7w7KmQkoJn8djM585z88rywrEbzoqawVa9FR5p2hwD+y74nfuKOjmNvi9gtWJNLqHvA==", - "dev": true, - "requires": { - "lru-cache": "2", - "sigmund": "~1.0.0" - } - } + "lru-cache": "2", + "sigmund": "~1.0.0" + }, + "engines": { + "node": "*" } }, - "resolve": { + "node_modules/resolve": { "version": "1.17.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", "dev": true, - "requires": { + "dependencies": { "path-parse": "^1.0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "resolve-dir": { + "node_modules/resolve-dir": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", "dev": true, - "requires": { + "dependencies": { "expand-tilde": "^2.0.0", "global-modules": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" } }, - "resolve-from": { + "node_modules/resolve-from": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-2.0.0.tgz", "integrity": "sha1-lICrIOlP+h2egKgEx+oUdhGWa1c=", - "dev": true + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "resolve-pkg": { + "node_modules/resolve-pkg": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/resolve-pkg/-/resolve-pkg-1.0.0.tgz", "integrity": "sha1-4ZoV54rKLhJEYdySsuOUPvk0lNk=", "dev": true, - "requires": { + "dependencies": { "resolve-from": "^2.0.0" + }, + "engines": { + "node": ">=4" } }, - "resolve-url": { + "node_modules/resolve-url": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "deprecated": "https://github.com/lydell/resolve-url#deprecated", "dev": true }, - "ret": { + "node_modules/ret": { "version": "0.1.15", "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", - "dev": true + "dev": true, + "engines": { + "node": ">=0.12" + } }, - "rimraf": { + "node_modules/rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "dev": true, - "requires": { + "dependencies": { "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "safe-buffer": { + "node_modules/safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, - "safe-regex": { + "node_modules/safe-regex": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", "dev": true, - "requires": { + "dependencies": { "ret": "~0.1.10" } }, - "safer-buffer": { + "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true }, - "semver": { + "node_modules/semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true, - "optional": true + "optional": true, + "bin": { + "semver": "bin/semver" + } }, - "set-blocking": { + "node_modules/set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true, "optional": true }, - "set-value": { + "node_modules/set-value": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", "dev": true, - "requires": { + "dependencies": { "extend-shallow": "^2.0.1", "is-extendable": "^0.1.1", "is-plain-object": "^2.0.3", "split-string": "^3.0.1" }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/set-value/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" } }, - "sigmund": { + "node_modules/sigmund": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", "integrity": "sha512-fCvEXfh6NWpm+YSuY2bpXb/VIihqWA6hLsgboC+0nl71Q7N7o2eaCW8mJa/NLvQhs6jpd3VZV4UiUQlV6+lc8g==", "dev": true }, - "signal-exit": { + "node_modules/signal-exit": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", "dev": true, "optional": true }, - "simple-concat": { + "node_modules/simple-concat": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], "optional": true }, - "simple-get": { + "node_modules/simple-get": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.0.tgz", "integrity": "sha512-bCR6cP+aTdScaQCnQKbPKtJOKDp/hj9EDLJo3Nw4y1QksqaovlW/bnptB6/c1e+qmNIDHRK+oXFDdEqBT8WzUA==", "dev": true, "optional": true, - "requires": { + "dependencies": { "decompress-response": "^4.2.0", "once": "^1.3.1", "simple-concat": "^1.0.0" } }, - "snapdragon": { + "node_modules/snapdragon": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", "dev": true, - "requires": { + "dependencies": { "base": "^0.11.1", "debug": "^2.2.0", "define-property": "^0.2.5", @@ -2467,110 +3085,140 @@ "source-map-resolve": "^0.5.0", "use": "^3.1.0" }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } + "engines": { + "node": ">=0.10.0" } }, - "snapdragon-node": { + "node_modules/snapdragon-node": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", "dev": true, - "requires": { + "dependencies": { "define-property": "^1.0.0", "isobject": "^3.0.0", "snapdragon-util": "^3.0.1" }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon-node/node_modules/define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "dependencies": { + "is-descriptor": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon-node/node_modules/is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "deprecated": "Please upgrade to v1.0.1", + "dev": true, "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } + "kind-of": "^6.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon-node/node_modules/is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "deprecated": "Please upgrade to v1.0.1", + "dev": true, + "dependencies": { + "kind-of": "^6.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon-node/node_modules/is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "dependencies": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + }, + "engines": { + "node": ">=0.10.0" } }, - "snapdragon-util": { + "node_modules/snapdragon-util": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", "dev": true, - "requires": { + "dependencies": { "kind-of": "^3.2.0" }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon-util/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" } }, - "source-map": { + "node_modules/source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "source-map-resolve": { + "node_modules/source-map-resolve": { "version": "0.5.3", "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", + "deprecated": "See https://github.com/lydell/source-map-resolve#deprecated", "dev": true, - "requires": { + "dependencies": { "atob": "^2.1.2", "decode-uri-component": "^0.2.0", "resolve-url": "^0.2.1", @@ -2578,159 +3226,186 @@ "urix": "^0.1.0" } }, - "source-map-url": { + "node_modules/source-map-url": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", + "deprecated": "See https://github.com/lydell/source-map-url#deprecated", "dev": true }, - "split-string": { + "node_modules/split-string": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", "dev": true, - "requires": { + "dependencies": { "extend-shallow": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" } }, - "sprintf-js": { + "node_modules/sprintf-js": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz", "integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==", "dev": true }, - "static-extend": { + "node_modules/static-extend": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", "dev": true, - "requires": { + "dependencies": { "define-property": "^0.2.5", "object-copy": "^0.1.0" }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/static-extend/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" } }, - "stream-buffers": { + "node_modules/stream-buffers": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/stream-buffers/-/stream-buffers-2.2.0.tgz", "integrity": "sha1-kdX1Ew0c75bc+n9yaUUYh0HQnuQ=", - "dev": true + "dev": true, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } }, - "string-width": { + "node_modules/string-width": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, "optional": true, - "requires": { + "dependencies": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", "strip-ansi": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" } }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "strip-ansi": { + "node_modules/strip-ansi": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, - "requires": { + "dependencies": { "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" } }, - "strip-json-comments": { + "node_modules/strip-json-comments": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", "dev": true, - "optional": true + "optional": true, + "engines": { + "node": ">=0.10.0" + } }, - "supports-color": { + "node_modules/supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, - "requires": { + "dependencies": { "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" } }, - "tar-fs": { + "node_modules/tar-fs": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.0.tgz", "integrity": "sha512-9uW5iDvrIMCVpvasdFHW0wJPez0K4JnMZtsuIeDI7HyMGJNxmDZDOCQROr7lXyS+iL/QMpj07qcjGYTSdRFXUg==", "dev": true, "optional": true, - "requires": { + "dependencies": { "chownr": "^1.1.1", "mkdirp-classic": "^0.5.2", "pump": "^3.0.0", "tar-stream": "^2.0.0" + } + }, + "node_modules/tar-fs/node_modules/bl": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.0.2.tgz", + "integrity": "sha512-j4OH8f6Qg2bGuWfRiltT2HYGx0e1QcBTrK9KAHNMwMZdQnDZFk0ZSYIpADjYCB3U12nicC5tVJwSIhwOWjb4RQ==", + "dev": true, + "optional": true, + "dependencies": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/tar-fs/node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "optional": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/tar-fs/node_modules/tar-stream": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.1.3.tgz", + "integrity": "sha512-Z9yri56Dih8IaK8gncVPx4Wqt86NDmQTSh49XLZgjWpGZL9GK9HKParS2scqHCC4w6X9Gh2jwaU45V47XTKwVA==", + "dev": true, + "optional": true, "dependencies": { - "bl": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/bl/-/bl-4.0.2.tgz", - "integrity": "sha512-j4OH8f6Qg2bGuWfRiltT2HYGx0e1QcBTrK9KAHNMwMZdQnDZFk0ZSYIpADjYCB3U12nicC5tVJwSIhwOWjb4RQ==", - "dev": true, - "optional": true, - "requires": { - "buffer": "^5.5.0", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" - } - }, - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "optional": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "tar-stream": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.1.3.tgz", - "integrity": "sha512-Z9yri56Dih8IaK8gncVPx4Wqt86NDmQTSh49XLZgjWpGZL9GK9HKParS2scqHCC4w6X9Gh2jwaU45V47XTKwVA==", - "dev": true, - "optional": true, - "requires": { - "bl": "^4.0.1", - "end-of-stream": "^1.4.1", - "fs-constants": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^3.1.1" - } - } + "bl": "^4.0.1", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + }, + "engines": { + "node": ">=6" } }, - "tar-stream": { + "node_modules/tar-stream": { "version": "1.6.2", "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.6.2.tgz", "integrity": "sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A==", "dev": true, - "requires": { + "dependencies": { "bl": "^1.0.0", "buffer-alloc": "^1.2.0", "end-of-stream": "^1.0.0", @@ -2738,236 +3413,291 @@ "readable-stream": "^2.3.0", "to-buffer": "^1.1.1", "xtend": "^4.0.0" + }, + "engines": { + "node": ">= 0.8.0" } }, - "text-table": { + "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", "dev": true }, - "tmp": { + "node_modules/tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", "dev": true, - "requires": { + "dependencies": { "os-tmpdir": "~1.0.2" + }, + "engines": { + "node": ">=0.6.0" } }, - "to-buffer": { + "node_modules/to-buffer": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.1.1.tgz", "integrity": "sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg==", "dev": true }, - "to-object-path": { + "node_modules/to-object-path": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", "dev": true, - "requires": { + "dependencies": { "kind-of": "^3.0.2" }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/to-object-path/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" } }, - "to-regex": { + "node_modules/to-regex": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", "dev": true, - "requires": { + "dependencies": { "define-property": "^2.0.2", "extend-shallow": "^3.0.2", "regex-not": "^1.0.2", "safe-regex": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" } }, - "to-regex-range": { + "node_modules/to-regex-range": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", "dev": true, - "requires": { + "dependencies": { "is-number": "^3.0.0", "repeat-string": "^1.6.1" + }, + "engines": { + "node": ">=0.10.0" } }, - "tunnel-agent": { + "node_modules/tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", "dev": true, "optional": true, - "requires": { + "dependencies": { "safe-buffer": "^5.0.1" + }, + "engines": { + "node": "*" } }, - "unc-path-regex": { + "node_modules/unc-path-regex": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=", - "dev": true + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "underscore": { + "node_modules/underscore": { "version": "1.4.4", "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.4.4.tgz", "integrity": "sha512-ZqGrAgaqqZM7LGRzNjLnw5elevWb5M8LEoDMadxIW3OWbcv72wMMgKdwOKpd5Fqxe8choLD8HN3iSj3TUh/giQ==", "dev": true }, - "underscore.string": { + "node_modules/underscore.string": { "version": "3.3.5", "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-3.3.5.tgz", "integrity": "sha512-g+dpmgn+XBneLmXXo+sGlW5xQEt4ErkS3mgeN2GFbremYeMBSJKr9Wf2KJplQVaiPY/f7FN6atosWYNm9ovrYg==", "dev": true, - "requires": { + "dependencies": { "sprintf-js": "^1.0.3", "util-deprecate": "^1.0.2" + }, + "engines": { + "node": "*" } }, - "union-value": { + "node_modules/union-value": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", "dev": true, - "requires": { + "dependencies": { "arr-union": "^3.1.0", "get-value": "^2.0.6", "is-extendable": "^0.1.1", "set-value": "^2.0.1" + }, + "engines": { + "node": ">=0.10.0" } }, - "unset-value": { + "node_modules/unset-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", "dev": true, - "requires": { + "dependencies": { "has-value": "^0.3.1", "isobject": "^3.0.0" }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/unset-value/node_modules/has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "dev": true, "dependencies": { - "has-value": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", - "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", - "dev": true, - "requires": { - "get-value": "^2.0.3", - "has-values": "^0.1.4", - "isobject": "^2.0.0" - }, - "dependencies": { - "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true, - "requires": { - "isarray": "1.0.0" - } - } - } - }, - "has-values": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", - "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", - "dev": true - } + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/unset-value/node_modules/has-value/node_modules/isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "dependencies": { + "isarray": "1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/unset-value/node_modules/has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "dev": true, + "engines": { + "node": ">=0.10.0" } }, - "urix": { + "node_modules/urix": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "deprecated": "Please see https://github.com/lydell/urix#deprecated", "dev": true }, - "use": { + "node_modules/use": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", - "dev": true + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "util-deprecate": { + "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true }, - "v8flags": { + "node_modules/v8flags": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.1.3.tgz", "integrity": "sha512-amh9CCg3ZxkzQ48Mhcb8iX7xpAfYJgePHxWMQCBWECpOSqJUXgY26ncA61UTV0BkPqfhcy6mzwCIoP4ygxpW8w==", "dev": true, - "requires": { + "dependencies": { "homedir-polyfill": "^1.0.1" + }, + "engines": { + "node": ">= 0.10" } }, - "walkdir": { + "node_modules/walkdir": { "version": "0.0.11", "resolved": "https://registry.npmjs.org/walkdir/-/walkdir-0.0.11.tgz", "integrity": "sha1-oW0CXrkxvQO1LzCMrtD0D86+lTI=", - "dev": true + "dev": true, + "engines": { + "node": ">=0.6.0" + } }, - "which": { + "node_modules/which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, - "requires": { + "dependencies": { "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" } }, - "which-pm-runs": { + "node_modules/which-pm-runs": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz", "integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=", "dev": true, "optional": true }, - "wide-align": { + "node_modules/wide-align": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", "dev": true, "optional": true, - "requires": { + "dependencies": { "string-width": "^1.0.2 || 2" } }, - "wrappy": { + "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, - "xtend": { + "node_modules/xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", - "dev": true + "dev": true, + "engines": { + "node": ">=0.4" + } }, - "zip-stream": { + "node_modules/zip-stream": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-1.2.0.tgz", "integrity": "sha1-qLxF9MG0lpnGuQGYuqyqzbzUugQ=", "dev": true, - "requires": { + "dependencies": { "archiver-utils": "^1.3.0", "compress-commons": "^1.2.0", "lodash": "^4.8.0", "readable-stream": "^2.0.0" + }, + "engines": { + "node": ">= 0.10.0" } } } diff --git a/package.json b/package.json index bdcba82d..b4b46ea9 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "wp-simple-pay-lite", "title": "WP Simple Pay Lite for Stripe", "description": "Add high conversion Stripe Checkout forms to your WordPress site and start accepting payments in minutes. **Lite Version**", - "version": "4.9.0", + "version": "4.10.0-beta-1", "license": "GPL-2.0-or-later", "homepage": "https://wpsimplepay.com/", "repository": { diff --git a/readme.txt b/readme.txt index 88f21cd8..9760d1cd 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: wpsimplepay, pderksen, spencerfinnell, adamjlea, mordauk, cklosows Tags: stripe, stripe checkout, stripe payments, credit card payments, stripe gateway Requires at least: 5.2 Tested up to: 6.5 -Stable tag: 4.9.0 +Stable tag: 4.10.0 Requires PHP: 5.6 License: GPLv2 or later diff --git a/src/Emails/Email/PaymentProcessingConfirmationEmail.php b/src/Emails/Email/PaymentProcessingConfirmationEmail.php new file mode 100644 index 00000000..fd04363b --- /dev/null +++ b/src/Emails/Email/PaymentProcessingConfirmationEmail.php @@ -0,0 +1,90 @@ +get_id() ), + esc_html( + sprintf( + /* translators: %s Site name */ + __( 'Payment Processing Confirmation for %s', 'stripe' ), + get_bloginfo( 'name' ) + ) + ) + ); + + return $subject; + } + + /** + * Returns the body (content) of the email. + * + * @since 4.10.0 + * + * @return string + */ + public function get_body() { + return Settings\Emails\PaymentProcessingConfirmation\get_body_setting_or_default(); + } +} diff --git a/src/Emails/Email/PaymentProcessingNotificationEmail.php b/src/Emails/Email/PaymentProcessingNotificationEmail.php new file mode 100644 index 00000000..7efd9b1c --- /dev/null +++ b/src/Emails/Email/PaymentProcessingNotificationEmail.php @@ -0,0 +1,107 @@ +get_id() ), + get_bloginfo( 'admin_email' ) + ); + + return $to_address; + } + + /** + * Returns the subject of the email. + * + * @since 4.10.0 + * + * @return string + */ + public function get_subject() { + /** @var string $subject */ + $subject = simpay_get_setting( + sprintf( 'email_%s_subject', $this->get_id() ), + esc_html( + sprintf( + /* translators: %s Site name */ + __( 'Payment Processing Notification for %s', 'stripe' ), + get_bloginfo( 'name' ) + ) + ) + ); + + return $subject; + } + + /** + * Returns the body (content) of the email. + * + * @since 4.10.0 + * + * @return string + */ + public function get_body() { + return Settings\Emails\PaymentProcessingNotification\get_body_setting_or_default(); + } +} diff --git a/src/Emails/Email/PaymentRefundedConfirmationEmail.php b/src/Emails/Email/PaymentRefundedConfirmationEmail.php new file mode 100644 index 00000000..6d7b4d21 --- /dev/null +++ b/src/Emails/Email/PaymentRefundedConfirmationEmail.php @@ -0,0 +1,105 @@ +get_id() ), + get_bloginfo( 'admin_email' ) + ); + + return $to_address; + } + + /** + * Returns the subject of the email. + * + * @since 4.10.0 + * + * @return string + */ + public function get_subject() { + /** @var string $subject */ + $subject = simpay_get_setting( + sprintf( 'email_%s_subject', $this->get_id() ), + sprintf( + /* translators: %s Site name */ + __( 'Payment refunded on %s', 'stripe' ), + get_bloginfo( 'name' ) + ) + ); + + return $subject; + } + + /** + * Returns the body (content) of the email. + * + * @since 4.10.0 + * + * @return string + */ + public function get_body() { + return Settings\Emails\PaymentRefundedConfirmation\get_body_setting_or_default(); + } +} diff --git a/src/Emails/Email/SubscriptionCancellationConfirmation.php b/src/Emails/Email/SubscriptionCancellationConfirmation.php new file mode 100644 index 00000000..84e8bd76 --- /dev/null +++ b/src/Emails/Email/SubscriptionCancellationConfirmation.php @@ -0,0 +1,99 @@ +get_id() ), + esc_html( + sprintf( + /* translators: %s Site name */ + __( 'Subscription Cancelled for %s', 'stripe' ), + get_bloginfo( 'name' ) + ) + ) + ); + + return $subject; + } + + /** + * Returns the body (content) of the email. + * + * @since 4.10.0 + * + * @return string + */ + public function get_body() { + return Settings\Emails\SubscriptionCancellationConfirmation\get_body_setting_or_default(); + } +} diff --git a/src/Emails/Email/SubscriptionCancellationNotification.php b/src/Emails/Email/SubscriptionCancellationNotification.php new file mode 100644 index 00000000..8c0d9ac2 --- /dev/null +++ b/src/Emails/Email/SubscriptionCancellationNotification.php @@ -0,0 +1,116 @@ +get_id() ), + get_bloginfo( 'admin_email' ) + ); + + return $to_address; + } + + /** + * Returns the subject of the email. + * + * @since 4.10.0 + * + * @return string + */ + public function get_subject() { + /** @var string $subject */ + $subject = simpay_get_setting( + sprintf( 'email_%s_subject', $this->get_id() ), + esc_html( + sprintf( + /* translators: %s Site name */ + __( 'Subscription Cancellation Notification for %s', 'stripe' ), + get_bloginfo( 'name' ) + ) + ) + ); + + return $subject; + } + + /** + * Returns the body (content) of the email. + * + * @since 4.10.0 + * + * @return string + */ + public function get_body() { + return Settings\Emails\SubscriptionCancellationNotification\get_body_setting_or_default(); + } +} diff --git a/src/Emails/EmailServiceProvider.php b/src/Emails/EmailServiceProvider.php index e12dee0d..0ab04a23 100644 --- a/src/Emails/EmailServiceProvider.php +++ b/src/Emails/EmailServiceProvider.php @@ -32,6 +32,10 @@ public function get_services() { 'email-upcoming-invoice', 'email-summary-report', 'email-manage-subscriptions', + 'email-payment-processing-confirmation', + 'email-payment-processing-notification', + 'email-payment-refunded-confirmation', + 'email-subscription-cancel', ); } @@ -85,6 +89,31 @@ public function register() { Email\ManageSubscriptionsEmail::class ); + $container->add( + 'email-payment-processing-confirmation', + Email\PaymentProcessingConfirmationEmail::class + ); + + $container->add( + 'email-payment-processing-notification', + Email\PaymentProcessingNotificationEmail::class + ); + + $container->add( + 'email-payment-refunded-confirmation', + Email\PaymentRefundedConfirmationEmail::class + ); + + $container->add( + 'email-subscription-cancel-confirmation', + Email\SubscriptionCancellationConfirmation::class + ); + + $container->add( + 'email-subscription-cancel-notification', + Email\SubscriptionCancellationNotification::class + ); + // Summary report scheduler. $container->add( 'email-summary-report-scheduler', @@ -101,12 +130,17 @@ public function register() { $container->share( 'email-subscriber', EmailSubscriber::class ) ->withArgument( array( - 'invoice-confirmation' => $container->get( 'email-invoice-confirmation' ), - 'payment-confirmation' => $container->get( 'email-payment-confirmation' ), - 'payment-notification' => $container->get( 'email-payment-notification' ), - 'upcoming-invoice' => $container->get( 'email-upcoming-invoice' ), - 'summary-report' => $container->get( 'email-summary-report' ), - 'manage-subscriptions' => $container->get( 'email-manage-subscriptions' ), + 'invoice-confirmation' => $container->get( 'email-invoice-confirmation' ), + 'payment-confirmation' => $container->get( 'email-payment-confirmation' ), + 'payment-notification' => $container->get( 'email-payment-notification' ), + 'upcoming-invoice' => $container->get( 'email-upcoming-invoice' ), + 'summary-report' => $container->get( 'email-summary-report' ), + 'manage-subscriptions' => $container->get( 'email-manage-subscriptions' ), + 'subscription-cancel-confirmation' => $container->get( 'email-subscription-cancel-confirmation' ), + 'subscription-cancel-notification' => $container->get( 'email-subscription-cancel-notification' ), + 'payment-processing-confirmation' => $container->get( 'email-payment-processing-confirmation' ), + 'payment-processing-notification' => $container->get( 'email-payment-processing-notification' ), + 'payment-refunded-confirmation' => $container->get( 'email-payment-refunded-confirmation' ), ) ); } diff --git a/src/Emails/EmailSubscriber.php b/src/Emails/EmailSubscriber.php index 3c718c12..47936204 100644 --- a/src/Emails/EmailSubscriber.php +++ b/src/Emails/EmailSubscriber.php @@ -104,6 +104,20 @@ public function get_subscribed_events() { 3, ); + // Payment processing. + $subscribers['simpay_webhook_payment_intent_processing'] = array( + 'payment_processing', + 10, + 3, + ); + + // Refunded payment confirmation. + $subscribers['simpay_webhook_charge_refunded'] = array( + 'payment_refunded_confirmation', + 10, + 3, + ); + // Legacy. // These aren't used anymore, but we'll keep it here for backwards compatibility. // `simpay_webhook_payment_intent_succeeded` is used instead instead. @@ -112,6 +126,12 @@ public function get_subscribed_events() { $payment_confirmation, ); + $subscribers['simpay_webhook_subscription_cancel'] = array( + 'subscription_cancel', + 10, + 3, + ); + return $subscribers; } @@ -511,4 +531,164 @@ public function summary_report() { add_filter( 'simpay_emails_autop', '__return_true' ); } + /** + * Mails the "Payment Refunded Confirmation" email. + * + * @since 4.10.0 + * @param \SimplePay\Vendor\Stripe\Event $event Stripe Event object. + * @param \SimplePay\Vendor\Stripe\Charge $charge Stripe Charge object. + * @param \SimplePay\Core\Abstracts\Form $form Form object. + * + * @return void + */ + public function payment_refunded_confirmation( $event, $charge, $form ) { + /** @var \SimplePay\Core\Emails\Email\PaymentRefundedConfirmationEmail $email */ + $email = $this->emails['payment-refunded-confirmation']; + + // If the email is not enabled, do nothing. + if ( ! $email->is_enabled() ) { + return; + } + + // Ensure we have data before proceeding. + $payment_refund_data = Payment_Confirmation\get_confirmation_data( + $charge->customer->id, // @phpstan-ignore-line + false, + $form->id + ); + + // Setup the mailer. + $mailer = new Mailer( $email ); + + // Set data. + + $mailer->set_data( $payment_refund_data ); + + // ...then set the address(es). + $mailer->set_to( $payment_refund_data['customer']->email ); + + // ...then set the subject. + $mailer->set_subject( $email->get_subject() ); + + // ...then parse and set the body. + $mailer->set_body( $email->get_body() ); + + // Finally, send the email. + $mailer->send(); + } + + /** + * Mails the 'Subscription Cancel' email . + * + * @since 4.10.0 + * + * @param \SimplePay\Vendor\Stripe\Event $event Stripe Event object . + * @param \SimplePay\Vendor\Stripe\Subscription $subscription Stripe Subscription object . + * @return void + */ + public function subscription_cancel( $event, $subscription ) { + if ( null === $subscription->canceled_at ) { + return; + } + + if ( 'customer.subscription.deleted' === $event->type + && $subscription->cancel_at_period_end ) { + return; + } + + /** @var \SimplePay\Core\Emails\Email\SubscriptionCancellationNotification $subscription_cancel_confirmation_email */ + $subscription_cancel_confirmation_email = $this->emails['subscription-cancel-confirmation']; + + /** @var \SimplePay\Core\Emails\Email\SubscriptionCancellationNotification $subscription_cancel_notification_email */ + $subscription_cancel_notification_email = $this->emails['subscription-cancel-notification']; + + $notification_mailer = new Mailer( $subscription_cancel_notification_email ); + $confirmation_mailer = new Mailer( $subscription_cancel_confirmation_email ); + + // Retrieve the payment confirmation data. + /** @var \SimplePay\Vendor\Stripe\Customer $customer */ + $customer = $subscription->customer; + + // Ensure we have data before proceeding. + $payment_confirmation_data = Payment_Confirmation\get_confirmation_data( + $customer->id, + false, + $subscription->metadata->simpay_form_id // @phpstan-ignore-line + ); + + // Set email for merchant. + $notification_mailer->set_data( $payment_confirmation_data ); + $notification_mailer->set_to( $subscription_cancel_notification_email->get_to() ); + $notification_mailer->set_subject( $subscription_cancel_notification_email->get_subject() ); + $notification_mailer->set_body( $subscription_cancel_notification_email->get_body() ); + + // Set email for customer. + $confirmation_mailer->set_data( $payment_confirmation_data ); + $confirmation_mailer->set_to( $subscription->customer->email ); /** @phpstan-ignore-line */ + $confirmation_mailer->set_subject( $subscription_cancel_confirmation_email->get_subject() ); + $confirmation_mailer->set_body( $subscription_cancel_confirmation_email->get_body() ); + + // Send emails. + if ( $subscription_cancel_notification_email->is_enabled() ) { + $notification_mailer->send(); + } + + if ( $subscription_cancel_confirmation_email->is_enabled() ) { + $confirmation_mailer->send(); + } + } + + /** + * Mails the "Payment Processing" email. + * + * @since 4.10.0 + * + * @param \SimplePay\Vendor\Stripe\Event $event Stripe webhook event. + * @param \SimplePay\Vendor\Stripe\PaymentIntent $payment_intent Stripe PaymentIntent. + * @param \SimplePay\Core\Abstracts\Form $form Form object. + * @return void + */ + public function payment_processing( $event, $payment_intent, $form ) { + // Retrieve the payment confirmation data. + /** @var \SimplePay\Vendor\Stripe\Customer $customer */ + $customer = $payment_intent->customer; + + // Ensure we have data before proceeding. + $payment_confirmation_data = Payment_Confirmation\get_confirmation_data( + $customer->id, + false, + $form->id + ); + + // if there is no data, do nothing. + if ( empty( $payment_confirmation_data ) ) { + return; + } + + /** @var \SimplePay\Core\Emails\Email\PaymentProcessingConfirmationEmail $payment_processing_confirmation_email */ + $payment_processing_confirmation_email = $this->emails['payment-processing-confirmation']; + + /** @var \SimplePay\Core\Emails\Email\PaymentProcessingNotificationEmail $payment_processing_notification_email */ + $payment_processing_notification_email = $this->emails['payment-processing-notification']; + + // Send confirmation email if enabled. + if ( $payment_processing_confirmation_email->is_enabled() ) { + $confirmation_mailer = new Mailer( $payment_processing_confirmation_email ); + $confirmation_mailer->set_data( $payment_confirmation_data ); + $confirmation_mailer->set_to( $customer->email ); // @phpstan-ignore-line + $confirmation_mailer->set_subject( $payment_processing_confirmation_email->get_subject() ); + $confirmation_mailer->set_body( $payment_processing_confirmation_email->get_body() ); + $confirmation_mailer->send(); + } + + // Send notification email if enabled. + if ( $payment_processing_notification_email->is_enabled() ) { + $notification_mailer = new Mailer( $payment_processing_notification_email ); + $notification_mailer->set_data( $payment_confirmation_data ); + $notification_mailer->set_to( $payment_processing_notification_email->get_to() ); + $notification_mailer->set_subject( $payment_processing_notification_email->get_subject() ); + $notification_mailer->set_body( $payment_processing_notification_email->get_body() ); + $notification_mailer->send(); + } + } } diff --git a/src/NotificationInbox/Database/Query.php b/src/NotificationInbox/Database/Query.php old mode 100755 new mode 100644 diff --git a/src/NotificationInbox/Database/Schema.php b/src/NotificationInbox/Database/Schema.php old mode 100755 new mode 100644 diff --git a/src/NotificationInbox/Database/Table.php b/src/NotificationInbox/Database/Table.php old mode 100755 new mode 100644 diff --git a/src/Plugin.php b/src/Plugin.php index d3eaa7c1..b9c8cabf 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -81,7 +81,7 @@ public function load() { * @return \SimplePay\Core\PluginContainer */ public function setup_container() { - $this->container = new PluginContainer; + $this->container = new PluginContainer(); // Event management. $this->container->share( @@ -92,7 +92,7 @@ public function setup_container() { // Scheduler. $this->container->share( 'scheduler', - function() { + function () { $events = $this->container->get( 'event-manager' ); if ( ! $events instanceof EventManager ) { @@ -108,7 +108,7 @@ function() { return new Scheduler\WpCronScheduler( $events ); } - return new Scheduler\ActionScheduler; + return new Scheduler\ActionScheduler(); } ); @@ -200,57 +200,42 @@ private function get_service_providers() { global $wp_version; $service_providers = array( - new AdminBar\AdminBarServiceProvider, - new AntiSpam\AntiSpamServiceProvider, - new CustomerSuccess\CustomerSuccessServiceProvider, - new Emails\EmailServiceProvider, - new FormPreview\FormPreviewServiceProvider, - new Integration\IntegrationServiceProvider, - new License\LicenseServiceProvider, - new Connect\ConnectServiceProvider, - new PaymentPage\PaymentPageServiceProvider, - new Report\ReportServiceProvider, - new RestApi\RestApiServiceProvider, - new StripeConnect\StripeConnectServiceProvider, - new Transaction\TransactionServiceProvider, - new Webhook\WebhookServiceProvider, + new AdminBar\AdminBarServiceProvider(), + new AntiSpam\AntiSpamServiceProvider(), + new Block\BlockServiceProvider(), + new Connect\ConnectServiceProvider(), + new CustomerSuccess\CustomerSuccessServiceProvider(), + new Emails\EmailServiceProvider(), + new FormPreview\FormPreviewServiceProvider(), + new Help\HelpServiceProvider(), + new Integration\IntegrationServiceProvider(), + new License\LicenseServiceProvider(), + new NotificationInbox\NotificationInboxServiceProvider(), + new PaymentPage\PaymentPageServiceProvider(), + new Report\ReportServiceProvider(), + new RestApi\RestApiServiceProvider(), + new StripeConnect\StripeConnectServiceProvider(), + new Transaction\TransactionServiceProvider(), + new Webhook\WebhookServiceProvider(), ); - if ( version_compare( $wp_version, '5.6', '>=' ) ) { - $service_providers[] = new Block\BlockServiceProvider; - } - - if ( version_compare( $wp_version, '5.7', '>=' ) ) { - $service_providers[] = new Help\HelpServiceProvider; - $service_providers[] = new NotificationInbox\NotificationInboxServiceProvider; - } - if ( is_admin() ) { global $wp_version; $admin_service_providers = array( - new Admin\AdminServiceProvider, - new Admin\Addon\AddonServiceProvider, - new Admin\DashboardWidget\DashboardWidgetServiceProvider, - new Admin\Education\EducationServiceProvider, - new Admin\SiteHealth\SiteHealthServiceProvider, - new Admin\Translations\TranslationsServiceProvider, + new Admin\AdminServiceProvider(), + new Admin\Addon\AddonServiceProvider(), + new Admin\DashboardWidget\DashboardWidgetServiceProvider(), + new Admin\Education\EducationServiceProvider(), + new Admin\FormBuilder\FormBuilderServiceProvider(), + new Admin\SetupWizard\SetupWizardServiceProvider(), + new Admin\SiteHealth\SiteHealthServiceProvider(), + new Admin\Translations\TranslationsServiceProvider(), ); - if ( version_compare( $wp_version, '5.5', '>=' ) ) { - $admin_service_providers[] = - new Admin\SetupWizard\SetupWizardServiceProvider; - } - - if ( version_compare( $wp_version, '5.6', '>=' ) ) { - $admin_service_providers[] = - new Admin\FormBuilder\FormBuilderServiceProvider; - } - return array_merge( $admin_service_providers, $service_providers ); } return $service_providers; } - } diff --git a/src/RestApi/Internal/Payment/PaymentUpdateRoute.php b/src/RestApi/Internal/Payment/PaymentUpdateRoute.php new file mode 100644 index 00000000..54ea6f6d --- /dev/null +++ b/src/RestApi/Internal/Payment/PaymentUpdateRoute.php @@ -0,0 +1,456 @@ + SchemaUtils::get_form_id_schema(), + 'object_id' => SchemaUtils::get_object_id_schema(), + 'customer_id' => SchemaUtils::get_customer_id_schema(), + 'price_id' => SchemaUtils::get_price_id_schema(), + 'custom_amount' => SchemaUtils::get_custom_amount_schema(), + 'payment_method_type' => SchemaUtils::get_payment_method_type_schema(), + 'is_covering_fees' => SchemaUtils::get_is_covering_fees_schema(), + ); + + $update_item_route = array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => array( $this, 'update_payment' ), + 'permission_callback' => array( $this, 'update_payment_permissions_check' ), + 'args' => $update_args, + ); + + register_rest_route( + $this->namespace, + 'payment/update', + $update_item_route + ); + } + + /** + * Determines if the current request should be able to create a payment. + * + * @since 4.7.0 + * + * @param \WP_REST_Request $request The payment request. + * @return bool + */ + public function update_payment_permissions_check( $request ) { + return true; + } + + /** + * Updates a payment amount when the payment method changes, to account for + * new fee recovery amounts. + * + * This works by retrieving the payment intent or subscription, and then + * using the stored sipmay_fee_recovery_unit_amount metadata to calculate + * the original price so we can add the new fee recovery amount. + * + * With payment intents this is done simply by updating the existing payment intent. + * With subscriptions the finalized (but not collected) invoice must be voided and + * a new subscription created (voiding the first invoice cancels the subscription). + * + * @since 4.7.0 + * + * @param \WP_REST_Request $request The payment request. + * @return \WP_REST_Response The response object. + * @throws \Exception If the payment does not need to be updated. + */ + public function update_payment( $request ) { + $form = PaymentRequestUtils::get_form( $request ); + + /** @var string $object_id */ + $object_id = $request->get_param( 'object_id' ); + + /** @var string $customer_id */ + $customer_id = $request->get_param( 'customer_id' ); + + /** @var bool $is_covering_fees */ + $is_covering_fees = $request->get_param( 'is_covering_fees' ); + + try { + // Ensure fee recovery is enabled on at least one payment method, and + // if fee recovery is optional, that it is opted-in. + if ( + ! $form->has_fee_recovery() || + ( ! $form->has_forced_fee_recovery() && ! $is_covering_fees ) + ) { + throw new Exception( + __( 'Invalid request. Please try again', 'stripe' ) + ); + } + + // If the payment ID starts with pi_, then it is a PaymentIntent, retrieve it. + if ( 0 === strpos( $object_id, 'pi_' ) ) { + $object = API\PaymentIntents\retrieve( + array( + 'id' => $object_id, + 'expand' => array( + 'customer', + ), + ), + $form->get_api_request_args() + ); + + $object_type = 'payment_intent'; + + // If it starts with sub_, then it is a Subscription, retrieve it. + } elseif ( 0 === strpos( $object_id, 'sub_' ) ) { + $object = API\Subscriptions\retrieve( + array( + 'id' => $object_id, + 'expand' => array( + 'latest_invoice.payment_intent', + 'customer', + 'pending_setup_intent', + ), + ), + $form->get_api_request_args() + ); + + $object_type = 'subscription'; + } else { + throw new Exception( + __( 'Invalid request. Please try again', 'stripe' ) + ); + } + + // Double check that the customer ID in the request matches the customer ID on the object. + /** @var \SimplePay\Vendor\Stripe\Customer $customer */ + $customer = $object->customer; + + if ( $customer->id !== $customer_id ) { + throw new Exception( + __( 'Invalid request. Please try again', 'stripe' ) + ); + } + + // Objects can only be updated if they were created with fee recovery. + /** @var \SimplePay\Vendor\Stripe\StripeObject $metadata */ + $metadata = $object->metadata; + + if ( ! isset( $metadata->simpay_fee_recovery_unit_amount ) ) { + throw new Exception( + __( 'Invalid request. Please try again', 'stripe' ) + ); + } + + // Create a new object and return a relevant intent. + switch ( $object_type ) { + case 'payment_intent': + /** @var \SimplePay\Vendor\Stripe\PaymentIntent $object */ + $intent = $this->update_payment_intent( $request, $object ); + $object_id = $intent->id; + + break; + case 'subscription': + /** @var \SimplePay\Vendor\Stripe\Subscription $object */ + $subscription = $this->update_subscription( $request, $object ); + $object_id = $subscription->id; + + if ( isset( $subscription->pending_setup_intent ) ) { + $intent = $subscription->pending_setup_intent; + } else { + /** @var \SimplePay\Vendor\Stripe\Invoice $invoice */ + $invoice = $subscription->latest_invoice; + $intent = $invoice->payment_intent; + } + break; + default: + throw new Exception( + __( 'Invalid request. Please try again', 'stripe' ) + ); + } + + /** @var \SimplePay\Vendor\Stripe\PaymentIntent $intent */ + + return new WP_REST_Response( + array( + 'object_id' => $object_id, + 'client_secret' => $intent->client_secret, + 'changed' => $object->id !== $object_id, + ) + ); + } catch ( Exception $e ) { + return new WP_REST_Response( + array( + 'message' => Utils\handle_exception_message( $e ), + ), + 400 + ); + } + } + + /** + * Updates a payment intent's amount to include the fee recovery amount + * for the current payment method. + * + * @since 4.7.0 + * + * @param \WP_REST_Request $request The payment request. + * @param \SimplePay\Vendor\Stripe\PaymentIntent $payment_intent Payment intent. + * @return \SimplePay\Vendor\Stripe\PaymentIntent + */ + private function update_payment_intent( $request, $payment_intent ) { + /** @var \SimplePay\Vendor\Stripe\StripeObject $metadata */ + $metadata = $payment_intent->metadata; + + if ( ! isset( $metadata->simpay_fee_recovery_unit_amount ) ) { + return $payment_intent; + } + + $form = PaymentRequestUtils::get_form( $request ); + $fee_recovery_amount = intval( + $metadata->simpay_fee_recovery_unit_amount + ); + $total_amount = intval( $payment_intent->amount ); + $base_amount = $total_amount - $fee_recovery_amount; + $new_fee_recovery_amount = FeeRecoveryUtils::get_fee_recovery_unit_amount( + $request, + $base_amount + ); + + // Do not update the intent if the recovery amount has not changed. + if ( (int) $fee_recovery_amount === (int) $new_fee_recovery_amount ) { + return $payment_intent; + } + + return API\PaymentIntents\update( + $payment_intent->id, + array( + 'amount' => $base_amount + $new_fee_recovery_amount, + 'metadata' => array( + 'simpay_fee_recovery_unit_amount' => $new_fee_recovery_amount, + ), + 'expand' => array( + 'customer', + ), + ), + $form->get_api_request_args() + ); + } + + /** + * Updates a subscription's initial amount to include the fee recovery amount + * for the current payment method. + * + * To to this we must gather the line items from the current subscription object + * and discard the line item that matches the amount of the recorded fee recovery + * amount. Then, we void the initial invoice which in turn cancels the current + * incomplete subscription. Finally, we create a new subscription with the new + * fee recovery line item and the remaining line items from the original subscription. + * + * @since 4.7.0 + * + * @param \WP_REST_Request $request The payment request. + * @param \SimplePay\Vendor\Stripe\Subscription $subscription Subscription. + * @return \SimplePay\Vendor\Stripe\Subscription + */ + private function update_subscription( $request, $subscription ) { + $form = PaymentRequestUtils::get_form( $request ); + $price = PaymentRequestUtils::get_price( $request ); + $invoice = $subscription->latest_invoice; + + // Copy the base arguments from the current subscription. + /** @var \SimplePay\Vendor\Stripe\StripeObject $metadata */ + $metadata = $subscription->metadata; + $metadata = $metadata->toArray(); + + $original_metadata = $metadata; + unset( $metadata['simpay_fee_recovery_unit_amount'] ); + unset( $metadata['simpay_subscription_key'] ); + + /** @var \SimplePay\Vendor\Stripe\StripeObject $automatic_tax */ + $automatic_tax = $subscription->automatic_tax; + + /** @var \SimplePay\Vendor\Stripe\StripeObject $payment_settings */ + $payment_settings = $subscription->payment_settings; + + $new_subscription_args = array( + 'customer' => $subscription->customer, + 'metadata' => array_merge( + $metadata, + array( + 'simpay_subscription_key' => $this->get_subscription_key(), + ) + ), + 'trial_period_days' => $price->recurring && isset( $price->recurring['trial_period_days'] ) + ? $price->recurring['trial_period_days'] + : null, + 'automatic_tax' => $automatic_tax->toArray(), + 'payment_behavior' => 'default_incomplete', + 'off_session' => true, + 'payment_settings' => $payment_settings->toArray(), + 'expand' => array( + 'latest_invoice.payment_intent', + 'customer', + 'pending_setup_intent', + ), + ); + + // Find the non-fee recovery line items from the current subscription. + $setup_fee_amounts = ! empty( $price->line_items ) + ? wp_list_pluck( $price->line_items, 'unit_amount' ) + : array(); + + $price_amounts = array_merge( + array( PaymentRequestUtils::get_unit_amount( $request ) ), + $setup_fee_amounts + ); + + /** @var \SimplePay\Vendor\Stripe\Invoice $invoice */ + + $non_fee_recovery_line_items = array_filter( + $invoice->lines->data, + function ( $line_item ) use ( $price_amounts ) { + return in_array( $line_item->amount, $price_amounts, true ); + } + ); + + $one_time_line_items = array_filter( + $non_fee_recovery_line_items, + function ( $line_item ) { + /** @var \SimplePay\Vendor\Stripe\Price $price */ + $price = $line_item->price; + + return 'one_time' === $price->type; + } + ); + + $one_time_line_items = array_map( + array( $this, 'recreate_line_item' ), + $one_time_line_items + ); + + $recurring_line_items = array_filter( + $non_fee_recovery_line_items, + function ( $line_item ) { + /** @var \SimplePay\Vendor\Stripe\Price $price */ + $price = $line_item->price; + + return 'recurring' === $price->type; + } + ); + + $recurring_line_items = array_map( + array( $this, 'recreate_line_item' ), + $recurring_line_items + ); + + // Add the found line items to the new subscription arguments. + $new_subscription_args['items'] = array_values( + $recurring_line_items + ); + + $new_subscription_args['add_invoice_items'] = array_values( + $one_time_line_items + ); + + // Add the fee recovery line items, if needed. + // Instead of running this in `self::get_subscription_recurring_line_items()` + // and `self::get_subscription_additional_invoice_line_items()`, we run it here + // so we have access to all of the line items at once. + $new_subscription_args = FeeRecoveryUtils::add_subscription_fee_recovery_line_items( + $request, + $new_subscription_args + ); + + // Do not update void and recreate a subscription if the fee recovery amount has not changed. + + /** @var int $original_fee_recovery_amount */ + $original_fee_recovery_amount = $original_metadata['simpay_fee_recovery_unit_amount']; + + /** @var array $metadata */ + $metadata = $new_subscription_args['metadata']; + $new_fee_recovery_amount = $metadata['simpay_fee_recovery_unit_amount']; + + if ( (int) $original_fee_recovery_amount === (int) $new_fee_recovery_amount ) { + return $subscription; + } + + // Void the previous Invoice. + $invoice->voidInvoice( $invoice->id, $form->get_api_request_args() ); // @phpstan-ignore-line + + // Return the new Subscription. + return API\Subscriptions\create( + $new_subscription_args, + $form->get_api_request_args() + ); + } + + /** + * Returns line item data from a Stripe line item object that can be used to + * create a new line item. + * + * @since 4.7.0 + * + * @param \SimplePay\Vendor\Stripe\InvoiceLineItem $line_item Line item object. + * @return array Line item data. + */ + private function recreate_line_item( $line_item ) { + /** @var \SimplePay\Vendor\Stripe\Price $price */ + $price = $line_item->price; + + if ( $price->active ) { + return array( + 'price' => $price->id, + 'quantity' => $line_item->quantity, + ); + } + + return array( + 'quantity' => $line_item->quantity, + 'price_data' => array( + 'unit_amount' => $line_item->amount, + 'currency' => $line_item->currency, + 'product' => $price->product, + 'recurring' => isset( $price->recurring ) + ? array( + 'interval' => isset( $price->recurring->interval ) + ? $price->recurring->interval + : null, + 'interval_count' => isset( $price->recurring->interval_count ) + ? $price->recurring->interval_count + : null, + ) + : null, + ), + ); + } + +} diff --git a/src/RestApi/Internal/Payment/ProPaymentCreateRoute.php b/src/RestApi/Internal/Payment/ProPaymentCreateRoute.php new file mode 100644 index 00000000..ae788883 --- /dev/null +++ b/src/RestApi/Internal/Payment/ProPaymentCreateRoute.php @@ -0,0 +1,384 @@ + SchemaUtils::get_form_id_schema(), + 'form_values' => SchemaUtils::get_form_values_schema(), + 'price_id' => SchemaUtils::get_price_id_schema(), + 'quantity' => SchemaUtils::get_quantity_schema(), + 'custom_amount' => SchemaUtils::get_custom_amount_schema(), + 'payment_method_type' => SchemaUtils::get_payment_method_type_schema(), + 'is_optionally_recurring' => SchemaUtils::get_is_optionally_recurring_schema(), + 'is_covering_fees' => SchemaUtils::get_is_covering_fees_schema(), + 'coupon_code' => SchemaUtils::get_coupon_code_schema(), + 'billing_address' => SchemaUtils::get_billing_address_schema(), + 'shipping_address' => SchemaUtils::get_shipping_address_schema(), + 'token' => SchemaUtils::get_token_schema(), + ); + + $create_item_route = array( + 'methods' => WP_REST_Server::CREATABLE, + 'callback' => array( $this, 'create_payment' ), + 'permission_callback' => array( $this, 'create_payment_permissions_check' ), + 'args' => $create_args, + ); + + register_rest_route( + $this->namespace, + $this->route, + $create_item_route + ); + } + + /** + * {@inheritdoc} + * + * @throws \Exception If the payment could not be created. + * @throws \Simplepay\Core\RestApi\Internal\Payment\Exception\ValidationException If a validation error occurs. + */ + public function create_payment( $request ) { + try { + // Check rate limit. + // This is done here to avoid double increments (in authorization callback) + // and more human-friendly error messages. + if ( false === $this->validate_rate_limit( $request ) ) { + throw new ValidationException( + __( + 'Sorry, you have made too many requests. Please try again later.', + 'stripe' + ) + ); + } + + /** + * Allows processing before a payment is created. + * + * @since 4.7.x + * + * @param \WP_REST_Request $request The request object. + */ + do_action( 'simpay_before_payment_create', $request ); + + // Check form token. + // This is done here to avoid double increments (in authorization callback) + // and more human-friendly error messages. + if ( false === TokenValidationUtils::validate_token( $request ) ) { + throw new ValidationException( + __( 'Invalid CAPTCHA. Please try again.', 'stripe' ) + ); + } + + // Add a Customer, if needed. + $customer = $this->get_customer( $request ); + + // Handle the payment based on the form type. + $form = PaymentRequestUtils::get_form( $request ); + + // Handle an off-site Checkout Session form. + if ( 'stripe_checkout' === $form->get_display_type() ) { + $payment = $this->create_checkout_session( + $request, + $this->get_checkout_session_args( $request, $customer ) + ); + + return new WP_REST_Response( + array( + 'redirect' => $payment->url, + ) + ); + + // Handle an on-site Elements form. + } else { + if ( ! $customer instanceof Customer ) { + throw new Exception( + __( 'Invalid request. Please try again.', 'stripe' ) + ); + } + + if ( PaymentRequestUtils::is_recurring( $request ) ) { + $object = $this->create_subscription( $request, $customer ); + + if ( isset( $object->pending_setup_intent ) ) { + $intent = $object->pending_setup_intent; + } else { + /** @var \SimplePay\Vendor\Stripe\Invoice $latest_invoice */ + $latest_invoice = $object->latest_invoice; + $intent = $latest_invoice->payment_intent; + } + } else { + $object = $this->create_payment_intent( $request, $customer ); + $intent = $object; + } + + /** @var \SimplePay\Vendor\Stripe\PaymentIntent|\SimplePay\Vendor\Stripe\SetupIntent $intent */ + + return new WP_REST_Response( + array( + // Send back the parent object ID. This is may be used + // in subsequent requests to retrieve the object and + // update the payment intent being used. + 'object_id' => $object->id, + 'customer_id' => $customer->id, + 'client_secret' => $intent->client_secret, + 'return_url' => esc_url( + add_query_arg( + array( + 'customer_id' => $customer->id, + ), + $form->payment_success_page + ) + ), + ) + ); + } + } catch ( ValidationException $e ) { + return new WP_REST_Response( + array( + 'message' => Utils\handle_exception_message( $e ), + ), + rest_authorization_required_code() + ); + } catch ( Exception $e ) { + return new WP_REST_Response( + array( + 'message' => Utils\handle_exception_message( $e ), + ), + 400 + ); + } + } + + /** + * Overrides the Checkout Session arguments used in Lite, adding additional + * for the given request. + * + * @since 4.7.0 + * + * @param \WP_REST_Request $request The payment request. + * @param \SimplePay\Vendor\Stripe\Customer|null $customer Customer, if one was created. + * @return array + * @throws \Exception If the custom amount is not valid. + */ + protected function get_checkout_session_args( $request, $customer ) { + $form = PaymentRequestUtils::get_form( $request ); + $tax_status = get_post_meta( $form->id, '_tax_status', true ); + $tax_behavior = get_post_meta( $form->id, '_tax_behavior', true ); + + // Pull the base Checkout Session arguments used in Lite. + $session_args = parent::get_checkout_session_args( $request, $customer ); + + // Remove custom fields from the Checkout Session arguments as those fields + // are collected on-site in Pro. + unset( $session_args['custom_fields'] ); + + // Update the application fee to account for discounts and taxes, if needed. + if ( isset( + $session_args['payment_intent_data'], + $session_args['payment_intent_data']['application_fee_amount'] // @phpstan-ignore-line + ) ) { + $unit_amount = PaymentRequestUtils::get_unit_amount( $request ); + + // Remove the coupon amount, if needed. + $discount = CouponUtils::get_discount_unit_amount( + $request, + $unit_amount, + $customer ? $customer->id : null + ); + + if ( 0 !== $discount ) { + $unit_amount = $unit_amount - $discount; + } + + // Add the tax amount, if needed. + $tax = TaxUtils::get_tax_unit_amount( $request, $unit_amount ); + + if ( 0 !== $tax ) { + // Automatic tax, and exclusive, so add the amount. + if ( 'automatic' === $tax_status && 'exclusive' === $tax_behavior ) { + $unit_amount = $unit_amount + $tax; + + // Fixed global, add the amount (accounts for inclusive) in calculatinos. + } elseif ( empty( $tax_behavior ) || 'fixed-global' === $tax_behavior ) { + $unit_amount = $unit_amount + $tax; + } + } + + $session_args['payment_intent_data']['application_fee_amount'] = + $this->application_fee->get_application_fee_amount( $unit_amount ); + } + + // Add the customer, if needed. + if ( $customer instanceof Customer ) { + $session_args['customer'] = $customer->id; + $session_args['customer_update'] = array( + 'name' => 'auto', + 'address' => 'auto', + 'shipping' => 'auto', + ); + + // You may only specify one of these parameters: customer, customer_creation. + unset( $session_args['customer_creation'] ); + } + + // Merge in additional top level metadata. + $session_args['metadata'] = array_merge( + $session_args['metadata'], // @phpstan-ignore-line + $session_args['payment_intent_data']['metadata'] // @phpstan-ignore-line + ); + + // Set the allowed payment method types. + $session_args['payment_method_types'] = PaymentRequestUtils::get_payment_method_types( + $request + ); + + // Set the payment method options. + $session_args['payment_method_options'] = PaymentRequestUtils::get_payment_method_options( + $request + ); + + // Add a discount, if needed. + $coupon = PaymentRequestUtils::get_coupon_code( $request ); + + if ( ! empty( $coupon ) ) { + $session_args['discounts'] = array( + array( + 'coupon' => $coupon, + ), + ); + } + + // Allow promotion codes, if needed. + $enable_coupons = 'yes' === simpay_get_saved_meta( + $form->id, + '_enable_promotion_codes', + 'no' + ); + + if ( true === $enable_coupons && empty( $coupon ) ) { + $session_args['allow_promotion_codes'] = true; + } + + // Collect the Customer Tax ID, if needed. + $enable_tax_id = 'yes' === simpay_get_saved_meta( + $form->id, + '_enable_tax_id', + 'no' + ); + + if ( true === $enable_tax_id ) { + $session_args['tax_id_collection'] = array( + 'enabled' => true, + ); + } + + // Update the line items, if needed (due to a custom amount). + $price = PaymentRequestUtils::get_price( $request ); + + if ( false === simpay_payment_form_prices_is_defined_price( $price->id ) ) { + $custom_amount = PaymentRequestUtils::get_custom_unit_amount( $request ); + + $price_data = array( + 'currency' => $price->currency, + 'unit_amount' => $custom_amount, + 'product' => $price->product_id, + ); + + // Remove defined price and add custom price data. + unset( $session_args['line_items'][0]['price'] ); // @phpstan-ignore-line + $session_args['line_items'][0]['price_data'] = $price_data; // @phpstan-ignore-line + } + + // Make adjustments to the arguments if a subscription is being created. + if ( PaymentRequestUtils::is_recurring( $request ) ) { + // Remove unsupported arguments. + unset( $session_args['payment_intent_data'] ); + unset( $session_args['submit_type'] ); + unset( $session_args['customer_creation'] ); + + // Set the mode to Subscription. + $session_args['mode'] = 'subscription'; + + // Set the subscription data. + $session_args['subscription_data'] = $this->get_subscription_args( + $request + ); + + // Merge subscription data metadata into the top level metadata. + if ( isset( $session_args['subscription_data']['metadata'] ) ) { + $session_args['metadata'] = array_merge( + $session_args['metadata'], // @phpstan-ignore-line + $session_args['subscription_data']['metadata'] // @phpstan-ignore-line + ); + } + + // Set the line items. + // Checkout Sessions use a singular `line_items` argument. + $session_args['line_items'] = array_merge( + $this->get_subscription_recurring_line_items( $request ), + $this->get_subscription_additional_invoice_line_items( $request ) + ); + + if ( $this->application_fee->has_application_fee() ) { + $session_args['subscription_data']['application_fee_percent'] = + $this->application_fee->get_application_fee_percentage(); + } + } + + // Add tax rates to line items, if needed. + $session_args['line_items'] = TaxUtils::add_tax_rates_to_line_items( + $request, + $session_args['line_items'] // @phpstan-ignore-line + ); + + // Add automatic tax collection, if needed. + $session_args = TaxUtils::add_automatic_tax_args( + $request, + $session_args + ); + + return $session_args; + } + +} diff --git a/src/RestApi/Internal/Payment/TaxCalculationRoute.php b/src/RestApi/Internal/Payment/TaxCalculationRoute.php new file mode 100644 index 00000000..8d2d0748 --- /dev/null +++ b/src/RestApi/Internal/Payment/TaxCalculationRoute.php @@ -0,0 +1,385 @@ + SchemaUtils::get_form_id_schema(), + // Form values aren't required, but we check for the Customer Tax ID + // if it is available. + 'form_values' => SchemaUtils::get_form_values_schema( + array( + 'required' => false, + 'validate_callback' => 'rest_validate_request_arg', + ) + ), + 'price_id' => SchemaUtils::get_price_id_schema(), + 'quantity' => SchemaUtils::get_quantity_schema(), + 'custom_amount' => SchemaUtils::get_custom_amount_schema(), + 'billing_address' => SchemaUtils::get_billing_address_schema(), + 'shipping_address' => SchemaUtils::get_shipping_address_schema(), + 'coupon_code' => SchemaUtils::get_coupon_code_schema(), + 'is_covering_fees' => SchemaUtils::get_is_covering_fees_schema(), + 'is_optionally_recurring' => SchemaUtils::get_is_optionally_recurring_schema(), + ); + + $create_item_route = array( + 'methods' => WP_REST_Server::CREATABLE, + 'callback' => array( $this, 'create_calculation' ), + 'permission_callback' => array( $this, 'create_calculation_permissions_check' ), + 'args' => $create_args, + ); + + register_rest_route( + $this->namespace, + 'payment/calculate-tax', + $create_item_route + ); + } + + /** + * Determines if the current request should be able to create a tax calculation. + * + * @since 4.7.0 + * + * @param \WP_REST_Request $request The payment request. + * @return bool + */ + public function create_calculation_permissions_check( $request ) { + return true; + } + + /** + * Creates a tax calculation for the given request. + * + * @since 4.7.0 + * + * @param \WP_REST_Request $request The payment request. + * @return \WP_REST_Response The calculation response. + * @throws \Exception If the request does not need a tax calculation. + */ + public function create_calculation( $request ) { + $form = PaymentRequestUtils::get_form( $request ); + $price = PaymentRequestUtils::get_price( $request ); + $form_values = PaymentRequestUtils::get_form_values( $request ); + $is_recurring = PaymentRequestUtils::is_recurring( $request ); + $tax_status = get_post_meta( $form->id, '_tax_status', true ); + $tax_behavior = get_post_meta( $form->id, '_tax_behavior', true ); + + try { + if ( 'automatic' !== $tax_status ) { + throw new Exception( + __( 'Invalid request. Please try again.', 'stripe' ) + ); + } + + $args = array( + 'currency' => $price->currency, + 'customer_details' => array(), + 'tax_date' => time(), + ); + + // Add the provided billing or shipping adddress. + if ( $request->get_param( 'billing_address' ) ) { + $args['customer_details']['address_source'] = 'billing'; + $args['customer_details']['address'] = $request->get_param( + 'billing_address' + ); + } elseif ( $request->get_param( 'shipping_address' ) ) { + $args['customer_details']['address_source'] = 'shipping'; + $args['customer_details']['address'] = $request->get_param( + 'shipping_address' + ); + } + + if ( ! isset( $args['customer_details']['address'] ) ) { + throw new Exception( + __( + 'Please enter a valid address to calculate tax.', + 'stripe' + ) + ); + } + + // Remove empty values. + /** @var array $address */ + $address = $args['customer_details']['address']; + + $args['customer_details']['address'] = array_filter( + $address, + function ( $value ) { + return ! empty( $value ); + } + ); + + // Add the tax ID, if provided. + if ( isset( $form_values['simpay_tax_id'] ) ) { + /** @var string $tax_id_type */ + $tax_id_type = isset( $form_values['simpay_tax_id_type'] ) + ? $form_values['simpay_tax_id_type'] + : ''; + + $valid_tax_id_types = i18n\get_stripe_tax_id_types(); + + if ( false === array_key_exists( $tax_id_type, $valid_tax_id_types ) ) { + throw new Exception( + esc_html__( + 'Please select a valid Tax ID type.', + 'stripe' + ) + ); + } + + /** @var string $tax_id */ + $tax_id = $form_values['simpay_tax_id']; + $tax_id = sanitize_text_field( $tax_id ); + + $args['customer_details']['tax_ids'] = array( + array( + 'type' => $tax_id_type, + 'value' => $tax_id, + ), + ); + } + + // @todo These aren't the best names, but it requires less refactoring + // of the client Cart. + $total_details = array( + 'amount_discount' => 0, + 'amount_shipping' => 0, + 'amount_tax' => 0, + ); + $upcoming_invoice = $total_details; + + $today_line_items = $this->get_tax_today_line_items( + $request + ); + + if ( ! empty( $today_line_items ) ) { + $today_tax_calculation = Stripe_API::request( + 'Tax\Calculation', + 'create', + array_merge( + $args, + array( + 'line_items' => $today_line_items, + ) + ), + $form->get_api_request_args() + ); + + $total_details['amount_tax'] = 'exclusive' === $tax_behavior + ? $today_tax_calculation->tax_amount_exclusive + : $today_tax_calculation->tax_amount_inclusive; + } else { + $total_details['amount_tax'] = 0; + } + + if ( $is_recurring ) { + $upcoming_line_items = $this->get_tax_upcoming_line_items( + $request + ); + + if ( ! empty( $upcoming_line_items ) ) { + $upcoming_tax_calculation = Stripe_API::request( + 'Tax\Calculation', + 'create', + array_merge( + $args, + array( + 'line_items' => $upcoming_line_items, + ) + ), + $form->get_api_request_args() + ); + + $upcoming_invoice['amount_tax'] = 'exclusive' === $tax_behavior + ? $upcoming_tax_calculation->tax_amount_exclusive + : $upcoming_tax_calculation->tax_amount_inclusive; + } else { + $upcoming_invoice['amount_tax'] = 0; + } + } + + return new WP_REST_Response( + array( + 'id' => ! empty( $today_tax_calculation ) + ? $today_tax_calculation->id + : null, + 'tax' => array( + 'behavior' => $tax_behavior, + ), + 'total_details' => $total_details, + 'upcoming_invoice' => $upcoming_invoice, + ) + ); + } catch ( Exception $e ) { + return new WP_REST_Response( + array( + 'message' => Utils\handle_exception_message( $e ), + ), + 400 + ); + } + } + + /** + * Returns the line items for the tax due today for the given request. + * + * Plan and Setup Fees are added to a singular line item so the discount amount + * can be easily calculated. When automatic tax is used with Billing, they + * are added as separate line items. + * + * @since 4.7.0 + * + * @param \WP_REST_Request $request The payment request. + * @return array> The line items. + */ + private function get_tax_today_line_items( $request ) { + $form = PaymentRequestUtils::get_form( $request ); + $price = PaymentRequestUtils::get_price( $request ); + $base_unit_amount = PaymentRequestUtils::get_unit_amount( $request ); + $quantity = PaymentRequestUtils::get_quantity( $request ); + $tax_code = get_post_meta( $form->id, '_tax_code', true ); + $tax_behavior = get_post_meta( $form->id, '_tax_behavior', true ); + + // If there is a trial period, reset the amount to 0. + if ( + $price->recurring && + isset( $price->recurring['trial_period_days'] ) + ) { + $base_unit_amount = 0; + } + + // Add the setup (and plan) fee, if needed. + if ( ! empty( $price->line_items ) ) { + $setup_fee_unit_amount = array_reduce( + $price->line_items, + function ( $carry, $item ) { + $carry = $carry + $item['unit_amount']; + return $carry; + }, + 0 + ); + + $base_unit_amount = $base_unit_amount + $setup_fee_unit_amount; + } + + // Remove the coupon amount, if needed. + $discount = CouponUtils::get_discount_unit_amount( + $request, + $base_unit_amount + ); + + if ( 0 !== $discount ) { + $base_unit_amount = $base_unit_amount - $discount; + } + + // If the amount is 0, there is no tax due. + if ( 0 === $base_unit_amount ) { + return array(); + } + + return array( + array( + 'amount' => $base_unit_amount, + 'product' => $price->product_id, + 'quantity' => $quantity, + 'tax_behavior' => $tax_behavior, + 'tax_code' => $tax_code, + 'reference' => $price->id, + ), + ); + } + + /** + * Returns the line items for the tax due on the next invoice for the given request. + * + * @since 4.7.0 + * + * @param \WP_REST_Request $request The payment request. + * @return array> The line items. + */ + private function get_tax_upcoming_line_items( $request ) { + $form = PaymentRequestUtils::get_form( $request ); + $price = PaymentRequestUtils::get_price( $request ); + $base_unit_amount = PaymentRequestUtils::get_unit_amount( $request ); + $quantity = PaymentRequestUtils::get_quantity( $request ); + $tax_code = get_post_meta( $form->id, '_tax_code', true ); + $tax_behavior = get_post_meta( $form->id, '_tax_behavior', true ); + $coupon_code = PaymentRequestUtils::get_coupon_code( $request ); + + // Remove the coupon amount, if needed. + // We need to ensure the coupon is valid for the next invoice. + if ( $coupon_code ) { + $coupon = API\Coupons\retrieve( + $coupon_code, + $form->get_api_request_args() + ); + + if ( 'once' !== $coupon->duration ) { + $discount = CouponUtils::get_discount_unit_amount( + $request, + $base_unit_amount + ); + + if ( 0 !== $discount ) { + $base_unit_amount = $base_unit_amount - $discount; + } + } + } + + // If the amount is 0, there is no tax due. + if ( 0 === $base_unit_amount ) { + return array(); + } + + return array( + array( + 'amount' => $base_unit_amount, + 'product' => $price->product_id, + 'quantity' => $quantity, + 'tax_behavior' => $tax_behavior, + 'tax_code' => $tax_code, + 'reference' => wp_generate_uuid4(), + ), + ); + } + +} diff --git a/src/RestApi/Internal/Payment/UpdatePaymentMethodRoute.php b/src/RestApi/Internal/Payment/UpdatePaymentMethodRoute.php new file mode 100644 index 00000000..a97a86b9 --- /dev/null +++ b/src/RestApi/Internal/Payment/UpdatePaymentMethodRoute.php @@ -0,0 +1,179 @@ + SchemaUtils::get_form_id_schema(), + 'customer_id' => SchemaUtils::get_customer_id_schema(), + 'setup_intent_id' => SchemaUtils::get_setup_intent_id_schema(), + 'payment_method_id' => SchemaUtils::get_payment_method_id_schema(), + 'subscription_id' => SchemaUtils::get_subscription_id_schema(), + 'subscription_key' => SchemaUtils::get_subscription_key_schema(), + ); + + $update_item_route = array( + 'methods' => WP_REST_Server::EDITABLE, + 'callback' => array( $this, 'update_payment_method' ), + 'permission_callback' => array( $this, 'update_payment_method_permissions_check' ), + 'args' => $update_args, + ); + + register_rest_route( + $this->namespace, + 'payment/update-payment-method', + $update_item_route + ); + } + + /** + * Determines if the current request should be able to update the payment method. + * + * @since 4.7.0 + * + * @param \WP_REST_Request $request The update payment method request. + * @return bool + */ + public function update_payment_method_permissions_check( $request ) { + // Next, validate that the form exists. + // When using a parameter inside of a validation function, we do not know + // if it has been validated yet. So we need to validate it again. + /** @var int $form_id */ + $form_id = $request->get_param( 'form_id' ); + $form_id = intval( $form_id ); + $form = simpay_get_form( $form_id ); + + if ( false === $form ) { + return false; + } + + /** @var string $customer_id */ + $customer_id = $request->get_param( 'customer_id' ); + $customer_id = sanitize_text_field( $customer_id ); + + /** @var string $subscription_id */ + $subscription_id = $request->get_param( 'subscription_id' ); + $subscription_id = sanitize_text_field( $subscription_id ); + + /** @var string $subscription_key */ + $subscription_key = $request->get_param( 'subscription_key' ); + $subscription_key = sanitize_text_field( $subscription_key ); + + try { + $subscription = API\Subscriptions\retrieve( + $subscription_id, + $form->get_api_request_args() + ); + + // Ensure customers match. + if ( $subscription->customer !== $customer_id ) { + return false; + } + + // Ensure keys match. + if ( + ! isset( $subscription->metadata->simpay_subscription_key ) || + $subscription->metadata->simpay_subscription_key !== $subscription_key + ) { + return false; + } + + /** @var string $setup_intent_id */ + $setup_intent_id = $request->get_param( 'setup_intent_id' ); + + $setup_intent = API\SetupIntents\retrieve( + $setup_intent_id, + $form->get_api_request_args() + ); + + if ( $setup_intent->customer !== $customer_id ) { + return false; + } + + // Something went wrong. + } catch ( Exception $e ) { + return false; + } + + return true; + } + + /** + * Updates a Subscription's payment method. + * + * @since 4.7.0 + * + * @param \WP_REST_Request $request The update payment method request. + * @throws \SimplePay\Core\RestApi\Internal\Payment\Exception\ValidationException When the request is invalid. + * @return \WP_REST_Response + */ + public function update_payment_method( $request ) { + try { + // Check rate limit. + // This is done here to avoid double increments (in authorization callback) + // or non-human-friendly error messages (in API argument validation). + if ( false === $this->validate_rate_limit( $request ) ) { + throw new ValidationException( + __( + 'Sorry, you have made too many requests. Please try again later.', + 'stripe' + ) + ); + } + + /** @var string $subscription_id */ + $subscription_id = $request->get_param( 'subscription_id' ); + + /** @var string $payment_method_id */ + $payment_method_id = $request->get_param( 'payment_method_id' ); + + API\Subscriptions\update( + $subscription_id, + array( + 'default_payment_method' => $payment_method_id, + 'cancel_at_period_end' => false, + ) + ); + + return new WP_REST_Response( array() ); + } catch ( Exception $e ) { + return new WP_REST_Response( + array( + 'message' => $e->getMessage(), + ), + 400 + ); + } + } + +} diff --git a/src/RestApi/Internal/Payment/ValidateCouponRoute.php b/src/RestApi/Internal/Payment/ValidateCouponRoute.php new file mode 100644 index 00000000..de73f450 --- /dev/null +++ b/src/RestApi/Internal/Payment/ValidateCouponRoute.php @@ -0,0 +1,148 @@ + SchemaUtils::get_form_id_schema(), + 'currency' => SchemaUtils::get_currency_schema( + array( + 'required' => true, + ) + ), + 'subtotal' => SchemaUtils::get_subtotal_schema( + array( + 'required' => true, + ) + ), + 'coupon_code' => SchemaUtils::get_coupon_code_schema(), + ); + + $create_item_route = array( + 'methods' => WP_REST_Server::CREATABLE, + 'callback' => array( + $this, + 'create_coupon_validation', + ), + 'permission_callback' => array( + $this, + 'create_coupon_validation_permissions_check', + ), + 'args' => $create_args, + ); + + register_rest_route( + $this->namespace, + 'payment/validate-coupon', + $create_item_route + ); + } + + /** + * Determines who can validate a coupon using this route. + * + * @since 4.7.0 + * + * @return bool + */ + public function create_coupon_validation_permissions_check() { + return true; + } + + /** + * Validates a coupon code for the given request. + * + * @since 4.7.0 + * + * @param \WP_REST_Request $request The coupon validation request. + * @return \WP_REST_Response The coupon validation response. + * @throws \Exception If the coupon code is invalid. + */ + public function create_coupon_validation( $request ) { + $form = PaymentRequestUtils::get_form( $request ); + $coupon_code = PaymentRequestUtils::get_coupon_code( $request ); + + /** @var string $currency */ + $currency = $request->get_param( 'currency' ); + + /** @var int $subtotal */ + $subtotal = $request->get_param( 'subtotal' ); + + try { + if ( empty( $coupon_code ) ) { + throw new Exception( + __( 'Please enter a coupon code.', 'stripe' ) + ); + } + + $coupon_data = CouponUtils::get_coupon_data( + $request, + $coupon_code, + $subtotal, + $currency + ); + + if ( isset( $coupon_data['error'] ) ) { + /** @var string $error_message */ + $error_message = $coupon_data['error']; + throw new Exception( $error_message ); + } + + $api_args = $form->get_api_request_args(); + $coupons = new Coupon_Query( + $form->is_livemode(), + $api_args['api_key'] + ); + + $simpay_coupon = $coupons->get_by_name( $coupon_code ); + + if ( + $simpay_coupon instanceof \SimplePay\Pro\Coupons\Coupon && + false === $simpay_coupon->applies_to_form( $form->id ) + ) { + throw new Exception( + __( 'Coupon is invalid.', 'stripe' ) + ); + } + + return new WP_REST_Response( $coupon_data ); + } catch ( Exception $e ) { + return new WP_REST_Response( + array( + 'message' => Utils\handle_exception_message( $e ), + ), + 400 + ); + } + } + +} diff --git a/src/RestApi/Internal/Report/LatestPaymentsReport.php b/src/RestApi/Internal/Report/LatestPaymentsReport.php index 7bf2bb06..986a0972 100644 --- a/src/RestApi/Internal/Report/LatestPaymentsReport.php +++ b/src/RestApi/Internal/Report/LatestPaymentsReport.php @@ -114,7 +114,7 @@ private function get_results( $currency ) { $results = $wpdb->get_results( // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared $wpdb->prepare( - "SELECT * FROM {$wpdb->prefix}wpsp_transactions WHERE livemode = %d AND currency = %s AND status IN ( 'succeeded', 'failed', 'requires_payment_method') AND object IN ('payment_intent', 'setup_intent') ORDER BY date_created DESC LIMIT 0, 10", + "SELECT * FROM {$wpdb->prefix}wpsp_transactions WHERE livemode = %d AND currency = %s AND status IN ( 'succeeded', 'failed', 'requires_payment_method', 'refunded') AND object IN ('payment_intent', 'setup_intent') ORDER BY date_created DESC LIMIT 0, 10", simpay_is_test_mode() ? 0 : 1, $currency ), @@ -144,11 +144,16 @@ private function format_result( $result ) { $result->currency ); + $result->amount_refunded_formatted = simpay_format_currency( + $result->amount_refunded, + $result->currency + ); + $result->payment_method_type_icon = $this->get_payment_method_type_icon( $result->payment_method_type ); - $result->status_formatted = $this->format_status( $result->status ); + $result->status_formatted = $this->format_status( $result ); $result->date_created_human_time_diff = sprintf( /* translators: %s Payment created date. */ @@ -179,20 +184,41 @@ private function format_result( $result ) { * * @since 4.6.7 * - * @param string $status Status. + * @param \stdClass $result Result object. * @return string */ - private function format_status( $status ) { + private function format_status( $result ) { + $status = $this->get_status( $result ); switch ( $status ) { case 'succeeded': return __( 'Succeeded', 'stripe' ); case 'failed': return __( 'Failed', 'stripe' ); + case 'refunded': + return __( 'Refunded', 'stripe' ); + case 'partial_refund': + return __( 'Partially Refunded', 'stripe' ); default: return __( 'Incomplete', 'stripe' ); } } + /** + * Formats status for the Latest Payments report. + * + * @since 4.10.0 + * + * @param \stdClass $result Result object. + * @return string + */ + private function get_status( $result ) { + if ( $result->amount_refunded !== $result->amount_total && 'refunded' === $result->status ) { + return 'partial_refund'; + } + + return $result->status; + } + /** * Returns an icon for a given payment method type from the Payment Method registry. * @@ -236,5 +262,4 @@ private function get_payment_method_type_icon( $payment_method_type ) { return $payment_method->icon_sm; } } - } diff --git a/src/Transaction/Database/Query.php b/src/Transaction/Database/Query.php old mode 100755 new mode 100644 diff --git a/src/Transaction/Database/Schema.php b/src/Transaction/Database/Schema.php old mode 100755 new mode 100644 index 2c0b0ddc..a17d874c --- a/src/Transaction/Database/Schema.php +++ b/src/Transaction/Database/Schema.php @@ -104,6 +104,16 @@ class Schema extends BerlinDBSchema { 'validate' => 'intval', ), + // amount_refunded. + array( + 'name' => 'amount_refunded', + 'type' => 'bigint', + 'length' => '20', + 'default' => 0, + 'allow_null' => false, + 'validate' => 'intval', + ), + // amount_tax. array( 'name' => 'amount_tax', diff --git a/src/Transaction/Database/Table.php b/src/Transaction/Database/Table.php old mode 100755 new mode 100644 index 8d93328d..f2daf97f --- a/src/Transaction/Database/Table.php +++ b/src/Transaction/Database/Table.php @@ -42,7 +42,7 @@ class Table extends BerlinDBTable { * * @var int */ - protected $version = 202301090001; + protected $version = 202404230001; /** * {@inheritdoc} @@ -59,6 +59,7 @@ class Table extends BerlinDBTable { protected $upgrades = array( // @phpstan-ignore-line '202206170001' => 202206170001, '202301090001' => 202301090001, + '202404230001' => 202404230001, ); /** @@ -77,6 +78,7 @@ protected function set_schema() { amount_subtotal bigint(20) NOT NULL, amount_shipping bigint(20) NOT NULL, amount_discount bigint(20) NOT NULL, + amount_refunded bigint(20) NOT NULL DEFAULT 0, amount_tax bigint(20) NOT NULL, currency varchar(3) NOT NULL, payment_method_type varchar(50) DEFAULT NULL, @@ -151,4 +153,20 @@ protected function __202301090001() { return $this->is_success( true ); } + /** + * Upgrade to version 202404230001. + * - Add a new `amount_refunded` column. + * + * @since 4.10.0 + * + * @return bool + */ + protected function __202404230001() { + // Add the `amount_refunded` column after `amount_discount`. + $this->get_db()->query( + "ALTER TABLE {$this->table_name} ADD COLUMN `amount_refunded` bigint(20) NOT NULL DEFAULT 0 AFTER `amount_discount`" + ); + + return $this->is_success( true ); + } } diff --git a/src/Transaction/TransactionObserver.php b/src/Transaction/TransactionObserver.php index b3987d23..8fd45997 100644 --- a/src/Transaction/TransactionObserver.php +++ b/src/Transaction/TransactionObserver.php @@ -106,6 +106,7 @@ public function get_subscribed_events() { array( 'update_on_failed', 10, 2 ), array( 'maybe_increment_stock', 10, 2 ), ), + 'simpay_webhook_charge_refunded' => array( 'add_refund_log', 10, 3 ), ); // Update Checkout Session in Lite when viewing confirmation. @@ -117,6 +118,60 @@ public function get_subscribed_events() { return $observe; } + /** + * Logs a transaction when a refund is created. + * + * @since 4.10.0 + * + * @param \SimplePay\Vendor\Stripe\Event $event Stripe Event object. + * @param \SimplePay\Vendor\Stripe\Charge $charge Stripe Charge object. + * @param \SimplePay\Core\Abstracts\Form $form Payment Form. + * @return void + */ + public function add_refund_log( $event, $charge, $form ) { + // Check if the payment made form WP Simple Pay. + if ( ! isset( $charge->payment_intent->metadata->simpay_form_id ) ) { + return; + } + + $transaction = $this->transactions->get_by_object_id( + $charge->payment_intent->id + ); + + // Update the transaction status if it exists. + if ( $transaction instanceof Transaction ) { + $this->transactions->update( + $transaction->id, + array( + 'status' => 'refunded', + 'amount_refunded' => $charge->amount_refunded, + ) + ); + } else { + // Create a new transaction log if it doesn't exist. + $this->transactions->add( + array( + 'form_id' => $charge->payment_intent->metadata->simpay_form_id, + 'object' => 'payment_intent', + 'object_id' => $charge->payment_intent->id, + 'livemode' => (bool) $charge->livemode, + 'amount_total' => $charge->amount, + 'amount_subtotal' => $charge->amount_refunded, + 'amount_shipping' => 0, + 'amount_discount' => 0, + 'amount_refunded' => $charge->amount_refunded, + 'currency' => $charge->currency, + 'payment_method_type' => null, + 'email' => $charge->billing_details->email, // @phpstan-ignore-line + 'customer_id' => $charge->customer->id, // @phpstan-ignore-line + 'subscription_id' => null, + 'status' => 'refunded', + 'application_fee' => $this->application_fee->has_application_fee(), + ) + ); + } + } + /** * Logs a transaction when a PaymentIntent is created. * @@ -291,7 +346,7 @@ public function add_on_invoice( $event, $invoice, $subscription ) { * @param int $total_discount Total discount, so far. * @param \stdClass $discount Discount object. */ - function( $total_discount, $discount ) { + function ( $total_discount, $discount ) { /** @var \stdClass $discount */ return $total_discount + $discount->amount; }, @@ -487,7 +542,7 @@ public function update_on_checkout_session( $event, $customer, $payment_intent, * @property int $amount_discount * @property int $amount_tax */ - $default_totals = new stdClass; + $default_totals = new stdClass(); $default_totals->amount_shipping = 0; $default_totals->amount_discount = 0; $default_totals->amount_tax = 0; @@ -579,7 +634,7 @@ public function update_on_checkout_session_lite( $payment_confirmation_data ) { * @property int $amount_discount * @property int $amount_tax */ - $default_totals = new stdClass; + $default_totals = new stdClass(); $default_totals->amount_shipping = 0; $default_totals->amount_discount = 0; $default_totals->amount_tax = 0; @@ -671,7 +726,7 @@ public function update_on_invoice( $event, $invoice, $subscription ) { * @param int $total_discount Total discount, so far. * @param \stdClass $discount Discount object. */ - function( $total_discount, $discount ) { + function ( $total_discount, $discount ) { /** @var \stdClass $discount */ return $total_discount + $discount->amount; }, @@ -852,5 +907,4 @@ public function maybe_increment_stock( $event, $charge ) { $form->adjust_inventory( 'increment', $quantity, $instance_id ); } } - } diff --git a/stripe-checkout.php b/stripe-checkout.php index 4d2ea03c..77127f2e 100644 --- a/stripe-checkout.php +++ b/stripe-checkout.php @@ -99,15 +99,15 @@ } // Compatibility files. - require_once( SIMPLE_PAY_DIR . 'includes/core/bootstrap/compatibility.php' ); + require_once SIMPLE_PAY_DIR . 'includes/core/bootstrap/compatibility.php'; if ( Compatibility\server_requirements_met() ) { // Autoloader. - require_once( SIMPLE_PAY_DIR . 'vendor/autoload.php' ); - require_once( SIMPLE_PAY_DIR . 'includes/core/bootstrap/autoload.php' ); + require_once SIMPLE_PAY_DIR . 'vendor/autoload.php'; + require_once SIMPLE_PAY_DIR . 'includes/core/bootstrap/autoload.php'; // Plugin files. - require_once( SIMPLE_PAY_DIR . 'includes/core/class-simplepay.php' ); + require_once SIMPLE_PAY_DIR . 'includes/core/class-simplepay.php'; // New plugin container. $plugin = new Plugin( __FILE__ ); @@ -115,7 +115,6 @@ } else { Compatibility\show_admin_notices(); } - } else { deactivate_plugins( plugin_basename( SIMPLE_PAY_MAIN_FILE ) ); } diff --git a/vendor/autoload.php b/vendor/autoload.php index 6b51f067..6ca089cf 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -22,4 +22,4 @@ require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInit7abf4d20bb7a19977d9816908974e30a::getLoader(); +return ComposerAutoloaderInit701e4bb2effeb4cb61f223daf5d29988::getLoader(); diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index 44ef7e3d..6b5dca02 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -6,7 +6,14 @@ $baseDir = dirname($vendorDir); return array( + 'TijsVerkoyen\\CssToInlineStyles\\' => array($vendorDir . '/tijsverkoyen/css-to-inline-styles/src'), + 'Symfony\\Component\\CssSelector\\' => array($vendorDir . '/symfony/css-selector'), + 'Stripe\\' => array($vendorDir . '/stripe/stripe-php/lib'), 'SimplePay\\Vendor\\Stripe\\' => array($baseDir . '/lib/Stripe/lib'), 'SimplePay\\Vendor\\' => array($baseDir . '/lib'), 'SimplePay\\Core\\' => array($baseDir . '/src'), + 'Psr\\Container\\' => array($vendorDir . '/psr/container/src'), + 'League\\Container\\' => array($vendorDir . '/league/container/src'), + 'Interop\\Container\\' => array($vendorDir . '/container-interop/container-interop/src/Interop/Container'), + 'BerlinDB\\' => array($vendorDir . '/berlindb/core/src'), ); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 4c67691f..deb79a8a 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit7abf4d20bb7a19977d9816908974e30a +class ComposerAutoloaderInit701e4bb2effeb4cb61f223daf5d29988 { private static $loader; @@ -22,12 +22,14 @@ public static function getLoader() return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInit7abf4d20bb7a19977d9816908974e30a', 'loadClassLoader'), true, true); + require __DIR__ . '/platform_check.php'; + + spl_autoload_register(array('ComposerAutoloaderInit701e4bb2effeb4cb61f223daf5d29988', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); - spl_autoload_unregister(array('ComposerAutoloaderInit7abf4d20bb7a19977d9816908974e30a', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit701e4bb2effeb4cb61f223daf5d29988', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInit7abf4d20bb7a19977d9816908974e30a::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInit701e4bb2effeb4cb61f223daf5d29988::getInitializer($loader)); $loader->register(true); diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 7c4d022a..a40ac2db 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,18 +4,52 @@ namespace Composer\Autoload; -class ComposerStaticInit7abf4d20bb7a19977d9816908974e30a +class ComposerStaticInit701e4bb2effeb4cb61f223daf5d29988 { public static $prefixLengthsPsr4 = array ( + 'T' => + array ( + 'TijsVerkoyen\\CssToInlineStyles\\' => 31, + ), 'S' => array ( + 'Symfony\\Component\\CssSelector\\' => 30, + 'Stripe\\' => 7, 'SimplePay\\Vendor\\Stripe\\' => 24, 'SimplePay\\Vendor\\' => 17, 'SimplePay\\Core\\' => 15, ), + 'P' => + array ( + 'Psr\\Container\\' => 14, + ), + 'L' => + array ( + 'League\\Container\\' => 17, + ), + 'I' => + array ( + 'Interop\\Container\\' => 18, + ), + 'B' => + array ( + 'BerlinDB\\' => 9, + ), ); public static $prefixDirsPsr4 = array ( + 'TijsVerkoyen\\CssToInlineStyles\\' => + array ( + 0 => __DIR__ . '/..' . '/tijsverkoyen/css-to-inline-styles/src', + ), + 'Symfony\\Component\\CssSelector\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/css-selector', + ), + 'Stripe\\' => + array ( + 0 => __DIR__ . '/..' . '/stripe/stripe-php/lib', + ), 'SimplePay\\Vendor\\Stripe\\' => array ( 0 => __DIR__ . '/../..' . '/lib/Stripe/lib', @@ -28,6 +62,22 @@ class ComposerStaticInit7abf4d20bb7a19977d9816908974e30a array ( 0 => __DIR__ . '/../..' . '/src', ), + 'Psr\\Container\\' => + array ( + 0 => __DIR__ . '/..' . '/psr/container/src', + ), + 'League\\Container\\' => + array ( + 0 => __DIR__ . '/..' . '/league/container/src', + ), + 'Interop\\Container\\' => + array ( + 0 => __DIR__ . '/..' . '/container-interop/container-interop/src/Interop/Container', + ), + 'BerlinDB\\' => + array ( + 0 => __DIR__ . '/..' . '/berlindb/core/src', + ), ); public static $classMap = array ( @@ -37,9 +87,9 @@ class ComposerStaticInit7abf4d20bb7a19977d9816908974e30a public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit7abf4d20bb7a19977d9816908974e30a::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit7abf4d20bb7a19977d9816908974e30a::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInit7abf4d20bb7a19977d9816908974e30a::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInit701e4bb2effeb4cb61f223daf5d29988::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit701e4bb2effeb4cb61f223daf5d29988::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInit701e4bb2effeb4cb61f223daf5d29988::$classMap; }, null, ClassLoader::class); } diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 4d6dc29a..d5f2c847 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -272,23 +272,23 @@ }, { "name": "symfony/css-selector", - "version": "v3.4.47", - "version_normalized": "3.4.47.0", + "version": "v6.4.7", + "version_normalized": "6.4.7.0", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "da3d9da2ce0026771f5fe64cb332158f1bd2bc33" + "reference": "1c5d5c2103c3762aff27a27e1e2409e30a79083b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/da3d9da2ce0026771f5fe64cb332158f1bd2bc33", - "reference": "da3d9da2ce0026771f5fe64cb332158f1bd2bc33", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/1c5d5c2103c3762aff27a27e1e2409e30a79083b", + "reference": "1c5d5c2103c3762aff27a27e1e2409e30a79083b", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": ">=8.1" }, - "time": "2020-10-24T10:57:07+00:00", + "time": "2024-04-18T09:22:46+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -317,10 +317,10 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony CssSelector Component", + "description": "Converts CSS selectors to XPath expressions", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/css-selector/tree/v3.4.47" + "source": "https://github.com/symfony/css-selector/tree/v6.4.7" }, "funding": [ { @@ -340,31 +340,33 @@ }, { "name": "tijsverkoyen/css-to-inline-styles", - "version": "2.2.0", - "version_normalized": "2.2.0.0", + "version": "v2.2.7", + "version_normalized": "2.2.7.0", "source": { "type": "git", "url": "https://github.com/tijsverkoyen/CssToInlineStyles.git", - "reference": "ab03919dfd85a74ae0372f8baf9f3c7d5c03b04b" + "reference": "83ee6f38df0a63106a9e4536e3060458b74ccedb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/tijsverkoyen/CssToInlineStyles/zipball/ab03919dfd85a74ae0372f8baf9f3c7d5c03b04b", - "reference": "ab03919dfd85a74ae0372f8baf9f3c7d5c03b04b", + "url": "https://api.github.com/repos/tijsverkoyen/CssToInlineStyles/zipball/83ee6f38df0a63106a9e4536e3060458b74ccedb", + "reference": "83ee6f38df0a63106a9e4536e3060458b74ccedb", "shasum": "" }, "require": { - "php": "^5.5 || ^7", - "symfony/css-selector": "^2.7|~3.0" + "ext-dom": "*", + "ext-libxml": "*", + "php": "^5.5 || ^7.0 || ^8.0", + "symfony/css-selector": "^2.7 || ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.8|5.1.*" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0 || ^7.5 || ^8.5.21 || ^9.5.10" }, - "time": "2016-09-20T12:50:39+00:00", + "time": "2023-12-08T13:03:43+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "2.2.x-dev" } }, "installation-source": "dist", @@ -388,7 +390,7 @@ "homepage": "https://github.com/tijsverkoyen/CssToInlineStyles", "support": { "issues": "https://github.com/tijsverkoyen/CssToInlineStyles/issues", - "source": "https://github.com/tijsverkoyen/CssToInlineStyles/tree/master" + "source": "https://github.com/tijsverkoyen/CssToInlineStyles/tree/v2.2.7" }, "install-path": "../tijsverkoyen/css-to-inline-styles" }, diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 4ee40f27..7a2ca5b4 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => 'wpsimplepay/wp-simple-pay-pro-3', 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => '1237271e191bfe440c2c61e1d9143af8f5079247', + 'reference' => 'bde3ced4ecdb11b86f94860a8f145c92ef7d30e4', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -74,18 +74,18 @@ 'dev_requirement' => false, ), 'symfony/css-selector' => array( - 'pretty_version' => 'v3.4.47', - 'version' => '3.4.47.0', - 'reference' => 'da3d9da2ce0026771f5fe64cb332158f1bd2bc33', + 'pretty_version' => 'v6.4.7', + 'version' => '6.4.7.0', + 'reference' => '1c5d5c2103c3762aff27a27e1e2409e30a79083b', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/css-selector', 'aliases' => array(), 'dev_requirement' => false, ), 'tijsverkoyen/css-to-inline-styles' => array( - 'pretty_version' => '2.2.0', - 'version' => '2.2.0.0', - 'reference' => 'ab03919dfd85a74ae0372f8baf9f3c7d5c03b04b', + 'pretty_version' => 'v2.2.7', + 'version' => '2.2.7.0', + 'reference' => '83ee6f38df0a63106a9e4536e3060458b74ccedb', 'type' => 'library', 'install_path' => __DIR__ . '/../tijsverkoyen/css-to-inline-styles', 'aliases' => array(), @@ -103,7 +103,7 @@ 'wpsimplepay/wp-simple-pay-pro-3' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => '1237271e191bfe440c2c61e1d9143af8f5079247', + 'reference' => 'bde3ced4ecdb11b86f94860a8f145c92ef7d30e4', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), From 188913c4bbac6893c20315b4e34ad2796db18fb9 Mon Sep 17 00:00:00 2001 From: Prappo Date: Thu, 2 May 2024 21:34:21 +0600 Subject: [PATCH 02/11] bump version to 4.10.0-beta-1 --- stripe-checkout.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stripe-checkout.php b/stripe-checkout.php index 77127f2e..2b8e0f8a 100644 --- a/stripe-checkout.php +++ b/stripe-checkout.php @@ -5,7 +5,7 @@ * Description: Add high conversion Stripe payment forms to your WordPress site in minutes. * Author: WP Simple Pay * Author URI: https://wpsimplepay.com - * Version: 4.9.0 + * Version: 4.10.0-beta-1 * Text Domain: stripe * Domain Path: /languages */ @@ -54,7 +54,7 @@ // // Lite/Pro-specific. // - define( 'SIMPLE_PAY_VERSION', '4.9.0' ); + define( 'SIMPLE_PAY_VERSION', '4.10.0-beta-1' ); if ( ! defined( 'SIMPLE_PAY_PLUGIN_NAME' ) ) { define( 'SIMPLE_PAY_PLUGIN_NAME', 'WP Simple Pay Lite' ); From ffb17a48bc50e8d54667e0427de220bb6b55861f Mon Sep 17 00:00:00 2001 From: Prappo Date: Thu, 2 May 2024 21:35:35 +0600 Subject: [PATCH 03/11] add changelog --- readme.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/readme.txt b/readme.txt index 9760d1cd..cc5d8f98 100644 --- a/readme.txt +++ b/readme.txt @@ -249,6 +249,19 @@ No. WP Simple Pay is a standalone Stripe payments plugin and does not integrate == Changelog == += Stripe Payment Forms v4.10.0 - May 2, 2024 = + +* New: Emails - Add Support for Delayed Notification Payment Methods (ACH Direct Debit, etc). +* New: Emails - Notify Merchant and Users of Cancelled Subscriptions. +* New: Emails - Notify Users about Refunds. +* New: Add Refunded and Partially Refunded statuses to the latest payments. +* New: Smart Tags - Provide Fallback For Optional Fields. +* Fix: Form Builder - Custom Fields Can Become Unexpandable. +* Fix: Remove Redundant Word in Sentence. +* Fix: Template Explorer - Search Field Broken in WordPress 6.5. +* Update: Require PHP Version 7.2 minimum. +* Update: Require WordPress version to be at least 5.9. + = Stripe Payment Forms v4.9.0 - April 2, 2024 = * New: WP Simple Pay is now translated in 10 additional languages. From e667e116dbbe32d5408524893a6ddd6fa1f80af9 Mon Sep 17 00:00:00 2001 From: Prappo Prince Date: Fri, 3 May 2024 18:25:58 +0600 Subject: [PATCH 04/11] Sync from Pro --- .../assets/css/simpay-admin-page-smtp.min.css | 2 +- includes/core/assets/css/simpay-admin.min.css | 2 +- ...ay-admin-dashboard-widget-report.asset.php | 2 +- ...pay-admin-form-template-explorer.asset.php | 2 +- .../js/dist/simpay-admin-help.asset.php | 2 +- .../dist/simpay-admin-notifications.asset.php | 2 +- ...mpay-admin-page-activity-reports.asset.php | 2 +- .../simpay-admin-page-setup-wizard.asset.php | 2 +- .../js/dist/simpay-block-button.asset.php | 2 +- .../dist/simpay-block-payment-form.asset.php | 2 +- languages/stripe.pot | 4 +- .../Component/CssSelector/CHANGELOG.md | 5 + .../CssSelector/CssSelectorConverter.php | 16 +- .../Exception/ExceptionInterface.php | 2 +- .../Exception/SyntaxErrorException.php | 13 +- lib/Symfony/Component/CssSelector/LICENSE | 2 +- .../CssSelector/Node/AbstractNode.php | 5 +- .../CssSelector/Node/AttributeNode.php | 40 +- .../Component/CssSelector/Node/ClassNode.php | 22 +- .../CssSelector/Node/CombinedSelectorNode.php | 27 +- .../CssSelector/Node/ElementNode.php | 23 +- .../CssSelector/Node/FunctionNode.php | 22 +- .../Component/CssSelector/Node/HashNode.php | 22 +- .../CssSelector/Node/NegationNode.php | 17 +- .../CssSelector/Node/NodeInterface.php | 21 +- .../Component/CssSelector/Node/PseudoNode.php | 22 +- .../CssSelector/Node/SelectorNode.php | 22 +- .../CssSelector/Node/Specificity.php | 29 +- .../Parser/Handler/CommentHandler.php | 2 +- .../Parser/Handler/HandlerInterface.php | 5 +- .../Parser/Handler/HashHandler.php | 2 +- .../Parser/Handler/IdentifierHandler.php | 2 +- .../Parser/Handler/NumberHandler.php | 2 +- .../Parser/Handler/StringHandler.php | 2 +- .../Parser/Handler/WhitespaceHandler.php | 2 +- .../Component/CssSelector/Parser/Parser.php | 58 +-- .../CssSelector/Parser/ParserInterface.php | 4 +- .../Component/CssSelector/Parser/Reader.php | 44 +- .../Parser/Shortcut/ClassParser.php | 2 +- .../Parser/Shortcut/ElementParser.php | 2 +- .../Parser/Shortcut/EmptyStringParser.php | 2 +- .../Parser/Shortcut/HashParser.php | 2 +- .../Component/CssSelector/Parser/Token.php | 76 +--- .../CssSelector/Parser/TokenStream.php | 26 +- .../Parser/Tokenizer/Tokenizer.php | 4 +- .../Parser/Tokenizer/TokenizerEscaping.php | 21 +- .../Parser/Tokenizer/TokenizerPatterns.php | 45 +- lib/Symfony/Component/CssSelector/README.md | 10 +- .../Tests/CssSelectorConverterTest.php | 74 ---- .../Tests/Node/AbstractNodeTest.php | 34 -- .../Tests/Node/AttributeNodeTest.php | 37 -- .../CssSelector/Tests/Node/ClassNodeTest.php | 33 -- .../Tests/Node/CombinedSelectorNodeTest.php | 35 -- .../Tests/Node/ElementNodeTest.php | 35 -- .../Tests/Node/FunctionNodeTest.php | 47 -- .../CssSelector/Tests/Node/HashNodeTest.php | 33 -- .../Tests/Node/NegationNodeTest.php | 33 -- .../CssSelector/Tests/Node/PseudoNodeTest.php | 32 -- .../Tests/Node/SelectorNodeTest.php | 34 -- .../Tests/Node/SpecificityTest.php | 63 --- .../Parser/Handler/AbstractHandlerTest.php | 70 --- .../Parser/Handler/CommentHandlerTest.php | 55 --- .../Tests/Parser/Handler/HashHandlerTest.php | 49 --- .../Parser/Handler/IdentifierHandlerTest.php | 49 --- .../Parser/Handler/NumberHandlerTest.php | 50 --- .../Parser/Handler/StringHandlerTest.php | 50 --- .../Parser/Handler/WhitespaceHandlerTest.php | 44 -- .../CssSelector/Tests/Parser/ParserTest.php | 253 ----------- .../CssSelector/Tests/Parser/ReaderTest.php | 102 ----- .../Tests/Parser/Shortcut/ClassParserTest.php | 45 -- .../Parser/Shortcut/ElementParserTest.php | 44 -- .../Parser/Shortcut/EmptyStringParserTest.php | 36 -- .../Tests/Parser/Shortcut/HashParserTest.php | 45 -- .../Tests/Parser/TokenStreamTest.php | 96 ---- .../CssSelector/Tests/XPath/Fixtures/ids.html | 48 -- .../CssSelector/Tests/XPath/Fixtures/lang.xml | 11 - .../Tests/XPath/Fixtures/shakespear.html | 308 ------------- .../Tests/XPath/TranslatorTest.php | 413 ------------------ .../XPath/Extension/AbstractExtension.php | 10 +- .../Extension/AttributeMatchingExtension.php | 68 +-- .../XPath/Extension/CombinationExtension.php | 24 +- .../XPath/Extension/ExtensionInterface.php | 14 +- .../XPath/Extension/FunctionExtension.php | 35 +- .../XPath/Extension/HtmlExtension.php | 50 +-- .../XPath/Extension/NodeExtension.php | 85 +--- .../XPath/Extension/PseudoClassExtension.php | 48 +- .../CssSelector/XPath/Translator.php | 77 +--- .../CssSelector/XPath/TranslatorInterface.php | 13 +- .../Component/CssSelector/XPath/XPathExpr.php | 34 +- .../Component/CssSelector/composer.json | 5 +- .../Component/CssSelector/phpunit.xml.dist | 31 -- lib/Symfony/Polyfill/Php80/LICENSE | 19 + lib/Symfony/Polyfill/Php80/Php80.php | 115 +++++ lib/Symfony/Polyfill/Php80/PhpToken.php | 103 +++++ lib/Symfony/Polyfill/Php80/README.md | 25 ++ .../Php80/Resources/stubs/Attribute.php | 31 ++ .../Php80/Resources/stubs/PhpToken.php | 16 + .../Php80/Resources/stubs/Stringable.php | 20 + .../Resources/stubs/UnhandledMatchError.php | 16 + .../Php80/Resources/stubs/ValueError.php | 16 + lib/Symfony/Polyfill/Php80/bootstrap.php | 42 ++ lib/Symfony/Polyfill/Php80/composer.json | 37 ++ .../CssToInlineStyles/Css/Processor.php | 8 +- .../Css/Property/Processor.php | 21 +- .../Css/Property/Property.php | 4 +- .../CssToInlineStyles/Css/Rule/Processor.php | 26 +- .../CssToInlineStyles/Css/Rule/Rule.php | 5 +- .../CssToInlineStyles/CssToInlineStyles.php | 9 +- package-lock.json | 4 +- vendor/autoload.php | 2 +- vendor/composer/autoload_psr4.php | 7 - vendor/composer/autoload_real.php | 10 +- vendor/composer/autoload_static.php | 58 +-- vendor/composer/installed.json | 100 ++++- vendor/composer/installed.php | 15 +- 115 files changed, 890 insertions(+), 3218 deletions(-) delete mode 100644 lib/Symfony/Component/CssSelector/Tests/CssSelectorConverterTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Node/AbstractNodeTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Node/AttributeNodeTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Node/ClassNodeTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Node/CombinedSelectorNodeTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Node/ElementNodeTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Node/FunctionNodeTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Node/HashNodeTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Node/NegationNodeTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Node/PseudoNodeTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Node/SelectorNodeTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Node/SpecificityTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Parser/Handler/AbstractHandlerTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Parser/Handler/CommentHandlerTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Parser/Handler/HashHandlerTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Parser/Handler/IdentifierHandlerTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Parser/Handler/NumberHandlerTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Parser/Handler/StringHandlerTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Parser/Handler/WhitespaceHandlerTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Parser/ParserTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Parser/ReaderTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Parser/Shortcut/ClassParserTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Parser/Shortcut/ElementParserTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Parser/Shortcut/EmptyStringParserTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Parser/Shortcut/HashParserTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Parser/TokenStreamTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/XPath/Fixtures/ids.html delete mode 100644 lib/Symfony/Component/CssSelector/Tests/XPath/Fixtures/lang.xml delete mode 100644 lib/Symfony/Component/CssSelector/Tests/XPath/Fixtures/shakespear.html delete mode 100644 lib/Symfony/Component/CssSelector/Tests/XPath/TranslatorTest.php delete mode 100644 lib/Symfony/Component/CssSelector/phpunit.xml.dist create mode 100644 lib/Symfony/Polyfill/Php80/LICENSE create mode 100644 lib/Symfony/Polyfill/Php80/Php80.php create mode 100644 lib/Symfony/Polyfill/Php80/PhpToken.php create mode 100644 lib/Symfony/Polyfill/Php80/README.md create mode 100644 lib/Symfony/Polyfill/Php80/Resources/stubs/Attribute.php create mode 100644 lib/Symfony/Polyfill/Php80/Resources/stubs/PhpToken.php create mode 100644 lib/Symfony/Polyfill/Php80/Resources/stubs/Stringable.php create mode 100644 lib/Symfony/Polyfill/Php80/Resources/stubs/UnhandledMatchError.php create mode 100644 lib/Symfony/Polyfill/Php80/Resources/stubs/ValueError.php create mode 100644 lib/Symfony/Polyfill/Php80/bootstrap.php create mode 100644 lib/Symfony/Polyfill/Php80/composer.json diff --git a/includes/core/assets/css/simpay-admin-page-smtp.min.css b/includes/core/assets/css/simpay-admin-page-smtp.min.css index 6185775e..54385c98 100644 --- a/includes/core/assets/css/simpay-admin-page-smtp.min.css +++ b/includes/core/assets/css/simpay-admin-page-smtp.min.css @@ -1 +1 @@ -.lity,.lity-container{transition:opacity .5s ease}.lity-active,.lity-active body{overflow:initial}#wpbody-content .notice,#wpbody-content .update-nag{display:none !important}.simpay-plugin-page .notice{display:none !important}.simpay-plugin-page .loader{margin:0 auto;position:relative;text-indent:-9999em;border-top:4px solid #969696;border-right:4px solid #969696;border-bottom:4px solid #969696;border-left:4px solid #404040;transform:translateZ(0);animation:load8 1.1s infinite linear;background-color:rgba(0,0,0,0)}.simpay-plugin-page .loader,.simpay-plugin-page .loader:after{display:block;border-radius:50%;width:50px;height:50px}@keyframes load8{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}#simpay-plugin-page-smtp{width:700px;margin:0 auto}#simpay-plugin-page-smtp *,#simpay-plugin-page-smtp *::before,#simpay-plugin-page-smtp *::after{box-sizing:border-box}#simpay-plugin-page-smtp section{margin:50px 0;text-align:left;clear:both}#simpay-plugin-page-smtp p{font-size:15px}#simpay-plugin-page-smtp .top{text-align:center}#simpay-plugin-page-smtp .top img{margin-bottom:38px}#simpay-plugin-page-smtp .top h1{font-size:26px;font-weight:600;margin-bottom:0;padding:0}#simpay-plugin-page-smtp .top p{font-size:17px;color:#777;margin-top:.5em}#simpay-plugin-page-smtp .top .updated{display:none}#simpay-plugin-page-smtp .screenshot>*{vertical-align:middle}#simpay-plugin-page-smtp .screenshot .cont{display:inline-block;position:relative;width:315px;padding:5px;background-color:#fff;box-shadow:0px 2px 5px 0px rgba(0,0,0,.05);border-radius:3px}#simpay-plugin-page-smtp .screenshot .cont img{max-width:100%;display:block}#simpay-plugin-page-smtp .screenshot .cont .hover{position:absolute;opacity:0;height:100%;width:100%;top:0;left:0;border:5px solid #fff;background-color:rgba(0,0,0,.15);background-image:url(data:image/svg+xml;base64,PHN2ZyBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjojZmZmZmZmMDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCIgaGVpZ2h0PSIxMDAiPjxwYXRoIGQ9Ik01MCAwYzI3LjYxNCAwIDUwIDIyLjM4NiA1MCA1MHMtMjIuMzg2IDUwLTUwIDUwUzAgNzcuNjE0IDAgNTAgMjIuMzg2IDAgNTAgMHoiIGZpbGw9IiMxNjg1YjciLz48cGF0aCBkPSJNNzMuMDIzIDY3LjA2N2wtOS4zNDQtOS4zNDRhMi4yNDcgMi4yNDcgMCAwMC0xLjU5My0uNjU2aC0xLjUyOGExOS4zOTkgMTkuMzk5IDAgMDA0LjEyNC0xMS45OTZjMC0xMC43Ny04LjcyNS0xOS40OTUtMTkuNDk0LTE5LjQ5NS0xMC43NjggMC0xOS40OTQgOC43MjYtMTkuNDk0IDE5LjQ5NSAwIDEwLjc2OCA4LjcyNiAxOS40OTMgMTkuNDk0IDE5LjQ5M2ExOS40IDE5LjQgMCAwMDExLjk5Ny00LjEyM3YxLjUyN2MwIC42LjIzNCAxLjE3Mi42NTUgMS41OTRsOS4zNDQgOS4zNDRhMi4yNCAyLjI0IDAgMDAzLjE3OCAwbDIuNjUyLTIuNjUzYTIuMjYgMi4yNiAwIDAwLjAxLTMuMTg2em0tMjcuODM1LTEwYy02LjYyNiAwLTExLjk5Ni01LjM2MS0xMS45OTYtMTEuOTk2IDAtNi42MjcgNS4zNi0xMS45OTcgMTEuOTk2LTExLjk5NyA2LjYyNiAwIDExLjk5NyA1LjM2MSAxMS45OTcgMTEuOTk3IDAgNi42MjYtNS4zNjEgMTEuOTk2LTExLjk5NyAxMS45OTZ6IiBmaWxsPSIjZmZmIi8+PC9zdmc+);background-repeat:no-repeat;background-position:center;background-size:50px;transition:all .3s}#simpay-plugin-page-smtp .screenshot .cont:hover .hover{opacity:1;transition:all .3s}#simpay-plugin-page-smtp .screenshot ul{display:inline-block;margin:0 0 0 30px;list-style-type:none;max-width:calc(100% - 350px)}#simpay-plugin-page-smtp .screenshot li{margin:16px 0;padding:0 0 0 24px;font-size:15px;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEzLjc3NjIgNi40NTYwNUw4LjcyMDMyIDEuNDAwMDVDOC41NzU5OSAxLjI1NTcyIDguMzgzNjQgMS4xNzY1IDguMTc4NTMgMS4xNzY1QzcuOTczMiAxLjE3NjUgNy43ODA5NiAxLjI1NTg0IDcuNjM2NjQgMS40MDAwNUw3LjE3NzYgMS44NTkyQzcuMDMzMzkgMi4wMDMyOSA2Ljk1Mzk1IDIuMTk1NzYgNi45NTM5NSAyLjQwMDk4QzYuOTUzOTUgMi42MDYwOCA3LjAzMzM5IDIuODA1MDQgNy4xNzc2IDIuOTQ5MTRMMTAuMTI3MSA1LjkwNTE2SDAuNzU2MzM0QzAuMzMzODM0IDUuOTA1MTYgMCA2LjIzNTkyIDAgNi42NTg1NFY3LjMwNzY1QzAgNy43MzAyNyAwLjMzMzgzNCA4LjA5NDM4IDAuNzU2MzM0IDguMDk0MzhIMTAuMTYwNkw3LjE3NzcyIDExLjA2NjlDNy4wMzM1MSAxMS4yMTEyIDYuOTU0MDYgMTEuMzk4NSA2Ljk1NDA2IDExLjYwMzdDNi45NTQwNiAxMS44MDg3IDcuMDMzNTEgMTEuOTk4NiA3LjE3NzcyIDEyLjE0MjhMNy42MzY3NSAxMi42MDA1QzcuNzgxMDcgMTIuNzQ0OCA3Ljk3MzMyIDEyLjgyMzUgOC4xNzg2NSAxMi44MjM1QzguMzgzNzUgMTIuODIzNSA4LjU3NjExIDEyLjc0MzggOC43MjA0MyAxMi41OTk1TDEzLjc3NjMgNy41NDM2QzEzLjkyMSA3LjM5ODgyIDE0LjAwMDUgNy4yMDU1NiAxNCA3LjAwMDExQzE0LjAwMDQgNi43OTM5OCAxMy45MjEgNi42MDA2IDEzLjc3NjIgNi40NTYwNVY2LjQ1NjA1WiIgZmlsbD0iIzQyOEJDQSIvPgo8L3N2Zz4K);background-position:left 3px;background-repeat:no-repeat;background-size:14px;color:#777}#simpay-plugin-page-smtp .step{background-color:#f9f9f9;box-shadow:0px 2px 5px 0px rgba(0,0,0,.05);border:1px solid #e5e5e5;margin:0 0 25px 0}#simpay-plugin-page-smtp .step>*{vertical-align:middle}#simpay-plugin-page-smtp .step .num{display:inline-block;position:relative;width:100px;height:50px;text-align:center}#simpay-plugin-page-smtp .step .loader{margin-top:-54px;transition:all .3s;opacity:1}#simpay-plugin-page-smtp .step div{display:inline-block;width:calc(100% - 104px);background-color:#fff;padding:30px;border-left:1px solid #eee}#simpay-plugin-page-smtp .step h2{font-size:24px;line-height:22px;margin-top:0;margin-bottom:15px}#simpay-plugin-page-smtp .step p{font-size:16px;color:#777}#simpay-plugin-page-smtp .step .error{font-size:14px;color:#b97474;margin-bottom:0}#simpay-plugin-page-smtp .step .link{text-decoration:none}#simpay-plugin-page-smtp .step .button{font-weight:500;box-shadow:none;padding:12px;min-width:200px;height:auto;line-height:13px;text-align:center;font-size:15px;transition:all .3s}#simpay-plugin-page-smtp .step .button.grey{background:#f6f6f6;border:1px solid #ddd;text-shadow:none;color:#9fa5aa}#simpay-plugin-page-smtp .step .button.disabled{cursor:default}#simpay-plugin-page-smtp .step .hidden{opacity:0;transition:all .3s}#simpay-plugin-page-smtp .grey{opacity:.5}@media(max-width: 767px){#simpay-admin-smtp{width:auto;margin:0 20px}#simpay-admin-smtp .screenshot .cont{width:auto}#simpay-admin-smtp .screenshot ul{margin:20px 0 0 15px;max-width:100%}#simpay-admin-smtp .button{white-space:normal}} +.lity,.lity-container{transition:opacity .5s ease}.lity-active,.lity-active body{overflow:initial}#wpbody-content .notice,#wpbody-content .update-nag{display:none !important}.simpay-plugin-page .notice{display:none !important}.simpay-plugin-page .loader{margin:0 auto;position:relative;text-indent:-9999em;border-top:4px solid #969696;border-right:4px solid #969696;border-bottom:4px solid #969696;border-left:4px solid #404040;transform:translateZ(0);animation:load8 1.1s infinite linear;background-color:rgba(0,0,0,0)}.simpay-plugin-page .loader,.simpay-plugin-page .loader:after{display:block;border-radius:50%;width:50px;height:50px}@keyframes load8{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}#simpay-plugin-page-smtp{width:700px;margin:0 auto}#simpay-plugin-page-smtp *,#simpay-plugin-page-smtp *::before,#simpay-plugin-page-smtp *::after{box-sizing:border-box}#simpay-plugin-page-smtp section{margin:50px 0;text-align:left;clear:both}#simpay-plugin-page-smtp p{font-size:15px}#simpay-plugin-page-smtp .top{text-align:center}#simpay-plugin-page-smtp .top img{margin-bottom:38px}#simpay-plugin-page-smtp .top h1{font-size:26px;font-weight:600;margin-bottom:0;padding:0}#simpay-plugin-page-smtp .top p{font-size:17px;color:#777;margin-top:.5em}#simpay-plugin-page-smtp .top .updated{display:none}#simpay-plugin-page-smtp .screenshot>*{vertical-align:middle}#simpay-plugin-page-smtp .screenshot .cont{display:inline-block;position:relative;width:315px;padding:5px;background-color:#fff;box-shadow:0px 2px 5px 0px rgba(0,0,0,.05);border-radius:3px}#simpay-plugin-page-smtp .screenshot .cont img{max-width:100%;display:block}#simpay-plugin-page-smtp .screenshot .cont .hover{position:absolute;opacity:0;height:100%;width:100%;top:0;left:0;border:5px solid #fff;background-color:rgba(0,0,0,.15);background-image:url(data:image/svg+xml;base64,PHN2ZyBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjojZmZmZmZmMDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCIgaGVpZ2h0PSIxMDAiPjxwYXRoIGQ9Ik01MCAwYzI3LjYxNCAwIDUwIDIyLjM4NiA1MCA1MHMtMjIuMzg2IDUwLTUwIDUwUzAgNzcuNjE0IDAgNTAgMjIuMzg2IDAgNTAgMHoiIGZpbGw9IiMxNjg1YjciLz48cGF0aCBkPSJNNzMuMDIzIDY3LjA2N2wtOS4zNDQtOS4zNDRhMi4yNDcgMi4yNDcgMCAwMC0xLjU5My0uNjU2aC0xLjUyOGExOS4zOTkgMTkuMzk5IDAgMDA0LjEyNC0xMS45OTZjMC0xMC43Ny04LjcyNS0xOS40OTUtMTkuNDk0LTE5LjQ5NS0xMC43NjggMC0xOS40OTQgOC43MjYtMTkuNDk0IDE5LjQ5NSAwIDEwLjc2OCA4LjcyNiAxOS40OTMgMTkuNDk0IDE5LjQ5M2ExOS40IDE5LjQgMCAwMDExLjk5Ny00LjEyM3YxLjUyN2MwIC42LjIzNCAxLjE3Mi42NTUgMS41OTRsOS4zNDQgOS4zNDRhMi4yNCAyLjI0IDAgMDAzLjE3OCAwbDIuNjUyLTIuNjUzYTIuMjYgMi4yNiAwIDAwLjAxLTMuMTg2em0tMjcuODM1LTEwYy02LjYyNiAwLTExLjk5Ni01LjM2MS0xMS45OTYtMTEuOTk2IDAtNi42MjcgNS4zNi0xMS45OTcgMTEuOTk2LTExLjk5NyA2LjYyNiAwIDExLjk5NyA1LjM2MSAxMS45OTcgMTEuOTk3IDAgNi42MjYtNS4zNjEgMTEuOTk2LTExLjk5NyAxMS45OTZ6IiBmaWxsPSIjZmZmIi8+PC9zdmc+);background-repeat:no-repeat;background-position:center;background-size:50px;transition:all .3s}#simpay-plugin-page-smtp .screenshot .cont:hover .hover{opacity:1;transition:all .3s}#simpay-plugin-page-smtp .screenshot ul{display:inline-block;margin:0 0 0 30px;list-style-type:none;max-width:calc(100% - 350px)}#simpay-plugin-page-smtp .screenshot li{margin:16px 0;padding:0 0 0 24px;font-size:15px;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGQ9Ik0xMy43NzYyIDYuNDU2MDVMOC43MjAzMiAxLjQwMDA1QzguNTc1OTkgMS4yNTU3MiA4LjM4MzY0IDEuMTc2NSA4LjE3ODUzIDEuMTc2NUM3Ljk3MzIgMS4xNzY1IDcuNzgwOTYgMS4yNTU4NCA3LjYzNjY0IDEuNDAwMDVMNy4xNzc2IDEuODU5MkM3LjAzMzM5IDIuMDAzMjkgNi45NTM5NSAyLjE5NTc2IDYuOTUzOTUgMi40MDA5OEM2Ljk1Mzk1IDIuNjA2MDggNy4wMzMzOSAyLjgwNTA0IDcuMTc3NiAyLjk0OTE0TDEwLjEyNzEgNS45MDUxNkgwLjc1NjMzNEMwLjMzMzgzNCA1LjkwNTE2IDAgNi4yMzU5MiAwIDYuNjU4NTRWNy4zMDc2NUMwIDcuNzMwMjcgMC4zMzM4MzQgOC4wOTQzOCAwLjc1NjMzNCA4LjA5NDM4SDEwLjE2MDZMNy4xNzc3MiAxMS4wNjY5QzcuMDMzNTEgMTEuMjExMiA2Ljk1NDA2IDExLjM5ODUgNi45NTQwNiAxMS42MDM3QzYuOTU0MDYgMTEuODA4NyA3LjAzMzUxIDExLjk5ODYgNy4xNzc3MiAxMi4xNDI4TDcuNjM2NzUgMTIuNjAwNUM3Ljc4MTA3IDEyLjc0NDggNy45NzMzMiAxMi44MjM1IDguMTc4NjUgMTIuODIzNUM4LjM4Mzc1IDEyLjgyMzUgOC41NzYxMSAxMi43NDM4IDguNzIwNDMgMTIuNTk5NUwxMy43NzYzIDcuNTQzNkMxMy45MjEgNy4zOTg4MiAxNC4wMDA1IDcuMjA1NTYgMTQgNy4wMDAxMUMxNC4wMDA0IDYuNzkzOTggMTMuOTIxIDYuNjAwNiAxMy43NzYyIDYuNDU2MDVWNi40NTYwNVoiIGZpbGw9IiM0MjhCQ0EiLz4NCjwvc3ZnPg0K);background-position:left 3px;background-repeat:no-repeat;background-size:14px;color:#777}#simpay-plugin-page-smtp .step{background-color:#f9f9f9;box-shadow:0px 2px 5px 0px rgba(0,0,0,.05);border:1px solid #e5e5e5;margin:0 0 25px 0}#simpay-plugin-page-smtp .step>*{vertical-align:middle}#simpay-plugin-page-smtp .step .num{display:inline-block;position:relative;width:100px;height:50px;text-align:center}#simpay-plugin-page-smtp .step .loader{margin-top:-54px;transition:all .3s;opacity:1}#simpay-plugin-page-smtp .step div{display:inline-block;width:calc(100% - 104px);background-color:#fff;padding:30px;border-left:1px solid #eee}#simpay-plugin-page-smtp .step h2{font-size:24px;line-height:22px;margin-top:0;margin-bottom:15px}#simpay-plugin-page-smtp .step p{font-size:16px;color:#777}#simpay-plugin-page-smtp .step .error{font-size:14px;color:#b97474;margin-bottom:0}#simpay-plugin-page-smtp .step .link{text-decoration:none}#simpay-plugin-page-smtp .step .button{font-weight:500;box-shadow:none;padding:12px;min-width:200px;height:auto;line-height:13px;text-align:center;font-size:15px;transition:all .3s}#simpay-plugin-page-smtp .step .button.grey{background:#f6f6f6;border:1px solid #ddd;text-shadow:none;color:#9fa5aa}#simpay-plugin-page-smtp .step .button.disabled{cursor:default}#simpay-plugin-page-smtp .step .hidden{opacity:0;transition:all .3s}#simpay-plugin-page-smtp .grey{opacity:.5}@media(max-width: 767px){#simpay-admin-smtp{width:auto;margin:0 20px}#simpay-admin-smtp .screenshot .cont{width:auto}#simpay-admin-smtp .screenshot ul{margin:20px 0 0 15px;max-width:100%}#simpay-admin-smtp .button{white-space:normal}} diff --git a/includes/core/assets/css/simpay-admin.min.css b/includes/core/assets/css/simpay-admin.min.css index 3296730a..77c3dbb9 100644 --- a/includes/core/assets/css/simpay-admin.min.css +++ b/includes/core/assets/css/simpay-admin.min.css @@ -1 +1 @@ -.simpay-settings-subsections{display:flex;align-items:center;box-shadow:inset 0 -1px 0 0 #ccc}.simpay-settings-subsections__subsection{font-weight:500;text-decoration:none;padding:15px;display:flex;align-items:center}.simpay-settings-subsections__subsection .dashicons{width:18px;height:18px;font-size:18px;margin-right:4px}.simpay-settings-subsections__subsection.is-active{box-shadow:inset 0 -4px 0 0 currentColor;position:relative;z-index:1}.simpay-settings-subsections__subsection:not(.is-active){color:#23282d}.simpay-settings form>h2:not(.nav-tab-wrapper){clip:rect(1px, 1px, 1px, 1px);height:1px;overflow:hidden;position:absolute !important;width:1px}.simpay-settings .form-table td fieldset+p,.simpay-settings .form-table td label+p,.simpay-settings .form-table td select+p,.simpay-settings .form-table td input+p{color:#666;font-style:italic}.simpay-settings .simpay-settings-subsections__subsection{display:flex;align-items:center}.simpay-settings .simpay-settings-subsections__subsection .simpay-settings-bubble{margin-left:5px}.simpay-settings .simpay-settings-visual-toggles{margin:30px 0 0;display:flex}.simpay-settings .simpay-settings-visual-toggles input[type=radio]{display:none}.simpay-settings .simpay-settings-visual-toggles__toggle{-webkit-user-select:none;-moz-user-select:none;user-select:none;min-width:180px;margin:0 30px 0 0 !important;position:relative;display:block;background-color:#fff;border-radius:4px;border:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04)}.simpay-settings .simpay-settings-visual-toggles__toggle:hover{border:1px solid #999;box-shadow:0 1px 2px rgba(0,0,0,.1)}.simpay-settings .simpay-settings-visual-toggles input[type=radio]:checked+.simpay-settings-visual-toggles__toggle{border-color:#007cba;border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px #007cba;box-shadow:0 0 0 1px var(--wp-admin-theme-color)}.simpay-settings .simpay-settings-visual-toggles__toggle-recommended,.simpay-settings .simpay-settings-visual-toggles__toggle-not-recommended{text-align:center;font-size:12px;text-transform:uppercase;font-weight:bold;margin:0;padding:5px 0;display:block;border-top-right-radius:4px;border-top-left-radius:4px}.simpay-settings .simpay-settings-visual-toggles__toggle-recommended{color:#0f8569;background:#f4f9f7}.simpay-settings .simpay-settings-visual-toggles__toggle-not-recommended{color:#b91c1b;background:#fef2f2}.simpay-settings .simpay-settings-visual-toggles__toggle-icon{margin:20px auto 15px;padding:0 15px;display:block}.simpay-settings .simpay-settings-visual-toggles__toggle-label{line-height:1.5;text-align:center;font-size:16px;font-weight:500;margin:15px;display:block}.simpay-settings .simpay-settings-visual-toggles__toggle-label small{color:#666;font-weight:normal;font-size:13px;line-height:1;display:block;margin:4px 0}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type .simpay-settings-visual-toggles__toggle{min-height:160px}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type .simpay-settings-visual-toggles__toggle-icon{width:80px;height:80px}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type input[type=radio].simpay-settings-captcha-type--is-recommended:checked+.simpay-settings-visual-toggles__toggle{border-color:#0f8569;box-shadow:0 0 0 1px #0f8569}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type input[type=radio].simpay-settings-captcha-type--is-not-recommended:checked+.simpay-settings-visual-toggles__toggle{border-color:#b91c1b;box-shadow:0 0 0 1px #b91c1b}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type label[for=simpay-settings-captcha-type-cloudflare-turnstile] .simpay-settings-visual-toggles__toggle-icon{width:120px}.simpay-settings-general-recaptcha-no_captcha_warning th,.simpay-settings-general-recaptcha-no_captcha_warning td,.simpay-settings-hcaptcha_secret_key th,.simpay-settings-hcaptcha_secret_key td,.simpay-settings-cloudflare_turnstile_secret_key th,.simpay-settings-cloudflare_turnstile_secret_key td,.simpay-settings-recaptcha_score_threshold th,.simpay-settings-recaptcha_score_threshold td{padding-bottom:50px !important}.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-summary-report,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-payment-confirmation,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-payment-notification,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-upcoming-invoice,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-manage-subscriptions,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-payment-processing-confirmation,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-payment-processing-notification,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-payment-refunded-confirmation,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-subscription-cancel-confirmation,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-subscription-cancel-notification,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-invoice-confirmation{display:none}.simpay-settings .simpay-settings-subsection-emails-tools{margin-left:auto}.simpay-admin-charts-period-over-period{position:relative;padding-bottom:12px}.simpay-admin-charts-period-over-period *{box-sizing:border-box}.simpay-admin-charts-period-over-period__tooltip{position:absolute;background:#fff;border:1px solid #c3c3c3;box-shadow:0 2px 6px rgba(0,0,0,.05);border-radius:2px;padding:10px 14px;display:flex;flex-direction:column;z-Index:10000;min-width:175px}.simpay-admin-charts-period-over-period__tooltip-data{white-space:nowrap;margin-bottom:8px;display:grid;grid-template-columns:1fr auto;grid-auto-rows:auto;-moz-column-gap:16px;column-gap:16px}.simpay-admin-charts-period-over-period__tooltip-data:last-child{margin-bottom:0}.simpay-admin-charts-period-over-period__tooltip-data[data-dataset="1"]{opacity:.65}.simpay-admin-charts-period-over-period__tooltip-data em{font-style:normal;text-align:right}.simpay-admin-charts-period-over-period__tooltip-delta{font-size:12px;margin:0 -14px -10px;padding:8px 14px;border-top:1px solid #eee;background:#fdfdfd;border-radius:2px;display:flex;align-items:center;justify-content:center}.simpay-admin-charts-period-over-period__tooltip-delta .simpay-admin-charts-badge{margin-right:4px}.simpay-admin-charts-period-over-period__tooltip-delta strong.is-positive{color:#006908}.simpay-admin-charts-period-over-period__tooltip-delta strong.is-negative{color:#b3093c}.simpay-admin-charts-badge{color:#2f2f2f;font-size:12px;font-weight:500;font-style:normal;line-height:1;padding:3px 6px;display:inline-flex;align-items:center;background:#f0f0f0;border-radius:100px}.simpay-admin-charts-badge.is-positive{color:#006908;background-color:#d7f7c2}.simpay-admin-charts-badge.is-negative{color:#b3093c;background-color:#ffe7f2}.simpay-admin-charts-badge__icon{width:15px;height:15px}.simpay-admin-charts-no-data{position:absolute;top:0;left:0;display:flex;justify-content:center;align-items:center;background:rgba(255,255,255,.5);z-index:2}.simpay-admin-charts-no-data>div{text-align:center;padding:24px;background:#fff;border:1px solid #c3c3c3;box-shadow:0 2px 6px rgba(0,0,0,.1);border-radius:2px;max-width:60%}.simpay-admin-charts-no-data strong{font-size:15px;margin-bottom:8px;display:block}.button.button-large.simpay-button-large{font-size:14px;line-height:30px;padding:4px 12px}.simpay-copy-hidden-input{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}.fixed .column-livemode{width:15%;text-align:right}@media screen and (max-width: 782px){.fixed .column-livemode{text-align:left}}.fixed .column-livemode .simpay-badge{margin-top:3px}.fixed .column-shortcode{width:25%}.fixed .column-shortcode .simpay-shortcode{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}.post-type-simple-pay .misc-pub-curtime,.post-type-simple-pay .misc-pub-visibility{display:none}.simpay-metabox-title{border:1px solid #eee}.simpay-shortcode-section{border-top:1px solid #ddd;border-width:1px 0;padding-top:15px;padding-bottom:15px;position:relative}.simpay-shortcode-section label{display:block;margin-bottom:6px}.simpay-shortcode-section label .dashicons{color:#8c8f94;margin-right:3px}.simpay-shortcode-section .simpay-copy-button{line-height:normal;position:absolute;right:20px;bottom:20px;border:0;background:none;box-shadow:none;padding:0}.simpay-shortcode-section .simpay-copy-button:hover{border:0;background:none;box-shadow:none}.simpay-shortcode-section .simpay-copy-button .dashicons{color:#3c434a}.simpay-shortcode{width:100%;padding:8px;line-height:1;margin:0;height:32px;resize:none}.simpay-badge{color:#3f3f46;text-align:center;line-height:1;padding:5px 7px;border-radius:3px;background:#e4e4e7;border:0;box-shadow:none;display:inline-flex;align-items:center}button.simpay-badge{cursor:pointer}button.simpay-badge:hover{background:#d4d4d8}.simpay-badge__icon{opacity:.8;margin:2px 5px 0 0}.simpay-badge--green{color:#0e6245;background:#cbf4c9}.simpay-badge--yellow{color:#983705;background:#f8e5b9}.simpay-stripe-account-info{display:flex;align-items:center;margin-bottom:8px;position:relative}.simpay-stripe-account-info .spinner{float:none;margin-top:0;margin-left:0}.simple-pay_page_simpay_settings .simpay-settings-upgrade,.post-type-simple-pay .simpay-settings-upgrade{margin-top:20px;padding:1px;position:relative;background:#fff;border-radius:4px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.2),0 5px 10px rgba(0,0,0,.1);max-width:677px}.simple-pay_page_simpay_settings .simpay-settings-upgrade__inner,.post-type-simple-pay .simpay-settings-upgrade__inner{text-align:center;margin:0;padding:30px}.simple-pay_page_simpay_settings .simpay-settings-upgrade h3,.post-type-simple-pay .simpay-settings-upgrade h3{line-height:1.5;font-size:22px;margin:0 0 1.5rem}.simple-pay_page_simpay_settings .simpay-settings-upgrade ul,.post-type-simple-pay .simpay-settings-upgrade ul{margin:1.5rem 0 calc(1.5rem - 6px);display:flex;flex-wrap:wrap;justify-content:center}@media screen and (min-width: 782px){.simple-pay_page_simpay_settings .simpay-settings-upgrade ul,.post-type-simple-pay .simpay-settings-upgrade ul{margin-left:4rem;margin-right:4rem}}.simple-pay_page_simpay_settings .simpay-settings-upgrade li,.post-type-simple-pay .simpay-settings-upgrade li{font-size:15px;margin:6px 0;width:100%}.simple-pay_page_simpay_settings .simpay-settings-upgrade li a,.post-type-simple-pay .simpay-settings-upgrade li a{color:#3c434a;text-decoration:none}.simple-pay_page_simpay_settings .simpay-settings-upgrade li a:hover,.post-type-simple-pay .simpay-settings-upgrade li a:hover{color:var(--wp-admin-theme-color);text-decoration:underline}@media screen and (min-width: 782px){.simple-pay_page_simpay_settings .simpay-settings-upgrade li,.post-type-simple-pay .simpay-settings-upgrade li{text-align:left;width:50%}}.simple-pay_page_simpay_settings .simpay-settings-upgrade .button.button-large,.post-type-simple-pay .simpay-settings-upgrade .button.button-large{font-size:17px;line-height:30px;padding:10px 20px}.simple-pay_page_simpay_settings .simpay-settings-upgrade small,.post-type-simple-pay .simpay-settings-upgrade small{color:#666;margin:15px 0 0;display:block}.simple-pay_page_simpay_settings .simpay-settings-upgrade .dashicons-yes,.post-type-simple-pay .simpay-settings-upgrade .dashicons-yes{color:#428bca}.simple-pay_page_simpay_settings .simpay-settings-upgrade .button-link,.post-type-simple-pay .simpay-settings-upgrade .button-link{position:absolute;top:0;right:0;font-size:20px;color:#666;font-weight:bold;text-decoration:none;margin-left:5px;padding:6px 10px;z-index:2}.simple-pay_page_simpay_settings .simpay-settings-upgrade .button-link:hover,.simple-pay_page_simpay_settings .simpay-settings-upgrade .button-link:active,.simple-pay_page_simpay_settings .simpay-settings-upgrade .button-link:focus,.post-type-simple-pay .simpay-settings-upgrade .button-link:hover,.post-type-simple-pay .simpay-settings-upgrade .button-link:active,.post-type-simple-pay .simpay-settings-upgrade .button-link:focus{color:#666;text-decoration:none}.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext{text-align:center;margin:0;padding:30px 20px 20px;background-color:#fcf9e8;border:1px solid #edeac9;border-width:1px 0 0;position:relative;border-radius:0;border-bottom-left-radius:4px;border-bottom-right-radius:4px}@media screen and (min-width: 782px){.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext{padding-left:4rem;padding-right:4rem}}.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext svg,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext svg{background:#00a32a;fill:#fff;border-radius:50%;border:4px solid #fff;box-shadow:0 0 0 1px #edeac9;width:28px;height:28px;position:absolute;top:-18px;left:50%;margin-left:-18px}.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext u,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext u{text-decoration:none;font-weight:bold;color:#00a32a}.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext a,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext a{font-weight:normal;display:inline-block}#simpay-payment-form-settings table{width:100%;border-collapse:collapse}#simpay-payment-form-settings ::-webkit-input-placeholder{color:#9ba1a9}#simpay-payment-form-settings ::-moz-placeholder{color:#9ba1a9;opacity:1}#simpay-payment-form-settings :-ms-input-placeholder{color:#9ba1a9}#simpay-payment-form-settings .inside{margin:0;padding:0}#simpay-payment-form-settings .simpay-panel-field .toolbar{margin-bottom:-4px}#simpay-payment-form-settings .simpay-panel-field .toolbar .simpay-field-select{margin:0 0 4px;width:auto;max-width:70%}#simpay-payment-form-settings .simpay-tabs{margin:0;padding:0;list-style:none;background:#fafafa;border-right:1px solid #ccd0d4;line-height:1em;position:relative;flex:0 0 25%}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-tabs{flex-basis:100%;flex-grow:1;border-right:0}}#simpay-payment-form-settings .simpay-tabs li{margin:0;padding:0}#simpay-payment-form-settings .simpay-tabs li:first-child{margin-top:12px}#simpay-payment-form-settings .simpay-tabs li:last-child{margin-bottom:20px}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-tabs li:last-child{margin-bottom:0}}#simpay-payment-form-settings .simpay-tabs li.active{margin-left:-1px;box-shadow:0 1px 1px rgba(0,0,0,.04);position:relative}#simpay-payment-form-settings .simpay-tabs li.active:focus:after{display:none}#simpay-payment-form-settings .simpay-tabs li.active:before,#simpay-payment-form-settings .simpay-tabs li.active:after{content:"";width:calc(100% + 1px);height:1px;background:#ccd0d4;position:absolute;top:0;left:0;right:0;z-index:2}#simpay-payment-form-settings .simpay-tabs li.active:after{top:auto;bottom:0}#simpay-payment-form-settings .simpay-tabs li.active a{font-weight:bold;background-color:#fff;position:relative;margin-right:-1px}#simpay-payment-form-settings .simpay-tabs li.active a:before{content:"";position:absolute;top:0;left:0;bottom:0;width:4px;height:100%;background:currentColor;z-index:3}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-tabs li.active a{margin-right:0}}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item{display:flex;align-items:center;line-height:20px;margin:0;padding:8px 10px 8px 14px;text-decoration:none;transition:all .05s ease-in-out}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item svg,#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item .dashicons{margin-right:6px}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item{padding:18px}}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item:focus{outline:0;position:relative;z-index:3;box-shadow:inset 0 0 0 1px currentColor,0 0 0 1px currentColor}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item[href="#purchase-restrictions-settings-panel"],#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item[href="#payment-page-settings-panel"]{margin-bottom:20px;position:relative}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item[href="#purchase-restrictions-settings-panel"]:after,#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item[href="#payment-page-settings-panel"]:after{content:"";position:absolute;left:14px;right:14px;bottom:-10px;width:calc(100% - 28px);height:1px;background:#eaeaea}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item span>span{color:#f18500;font-size:12px;font-weight:600;margin:0 0 0 5px;display:inline-block}#simpay-payment-form-settings .simpay-tabs li:not(.active) .simpay-tab-item{color:inherit}#simpay-payment-form-settings .simpay-panels-wrap{background:#fff;display:flex}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-panels-wrap{flex-direction:column}}#simpay-payment-form-settings .simpay-panels{flex:0 0 75%;display:flex}@media screen and (min-width: 1400px){#simpay-payment-form-settings .simpay-panels{flex-basis:75%}}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-panels{flex-basis:100%}}#simpay-payment-form-settings .simpay-panel,#simpay-payment-form-settings .simpay-panel-section{width:100%}#simpay-payment-form-settings .simpay-panel>table,#simpay-payment-form-settings .simpay-panel>table>tr,#simpay-payment-form-settings .simpay-panel>table>tbody,#simpay-payment-form-settings .simpay-panel>table>tbody>tr,#simpay-payment-form-settings .simpay-panel>table>thead,#simpay-payment-form-settings .simpay-panel>table>thead>tr{display:block;width:100%}#simpay-payment-form-settings .simpay-panel>table:last-child>tbody:last-child>tr:last-child>td{border-bottom:0}#simpay-payment-form-settings .simpay-panel-field--requires-upgrade{position:relative}#simpay-payment-form-settings .simpay-panel-field--requires-upgrade td>div{margin-right:80px}#simpay-payment-form-settings .simpay-panel-field--requires-upgrade td>div .button-small{position:absolute;top:calc(50% - 13px);right:18px}#simpay-payment-form-settings .simpay-panel-field,#simpay-payment-form-settings .simpay-panel-field>td,#simpay-payment-form-settings .simpay-panel-field>th{text-align:left;display:block}#simpay-payment-form-settings .simpay-panel-field>td,#simpay-payment-form-settings .simpay-panel-field>th{width:calc(100% - 36px);margin-left:18px;margin-right:18px}#simpay-payment-form-settings .simpay-panel-field th{font-weight:bold;padding-top:18px;padding-bottom:5px}#simpay-payment-form-settings .simpay-panel-field td{border-bottom:1px solid #ddd;padding-bottom:18px}#simpay-payment-form-settings .simpay-panel-field p.description{margin-top:4px}#simpay-payment-form-settings .simpay-panel-field p.description:last-of-type{margin-bottom:0}#simpay-payment-form-settings .simpay-panel-field .simpay-panel-field__nested{margin-top:18px}#simpay-payment-form-settings .simpay-panel-field .simpay-panel-field__nested label{font-weight:bold;display:block;margin-bottom:4px}#simpay-payment-form-settings .simpay-panel-field .simpay-field-select,#simpay-payment-form-settings .simpay-panel-field .simpay-field-text{min-width:75%;max-width:100%}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-panel-field .simpay-field-select,#simpay-payment-form-settings .simpay-panel-field .simpay-field-text{min-width:0;width:100%}}#simpay-payment-form-settings .simpay-panel-field .simpay-field-textarea{width:100%;max-width:100%}#simpay-payment-form-settings .simpay-panel-field .notice:last-of-type{margin-bottom:0}#simpay-payment-form-settings .simpay-panel-field .error,#simpay-payment-form-settings .simpay-panel-field .simpay-important{color:#a94442;font-weight:normal}#simpay-payment-form-settings .simpay-panel-field .simpay-image-preview-wrap{position:relative;margin-top:12px}#simpay-payment-form-settings .simpay-panel-field .simpay-image-preview-wrap .simpay-remove-image-preview{position:absolute;top:-15px;left:-15px;cursor:pointer;background-color:#fff}#simpay-payment-form-settings .simpay-panel-field .simpay-image-preview-wrap .simpay-remove-image-preview::before{font-size:22px;line-height:26px}#simpay-payment-form-settings .simpay-panel-field .simpay-image-preview-wrap .simpay-image-preview{max-height:128px;max-width:128px;border:1px solid #ddd}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box{background-color:#f4f4f4;border:1px solid #e5e5e5;padding:18px;margin-top:18px;position:relative}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box__dismiss{color:inherit;text-decoration:none;position:absolute;top:8px;right:8px}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box__dismiss .dashicons-dismiss{font-size:16px;width:16px;height:16px}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box h3{font-size:18px;font-weight:600;margin:0;padding:0}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box p{font-size:14px}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box p:last-child{margin-bottom:0}#simpay-payment-form-settings .simpay-metabox-content{margin-bottom:-1px;background-color:#f5f5f5;border:1px solid #c3c4c7;border-width:1px 0;box-shadow:0 1px 1px rgba(0,0,0,.04);position:relative}#simpay-payment-form-settings .simpay-show-if,#simpay-payment-form-settings .simpay-panel-hidden{display:none}#simpay-payment-form-settings .simpay-payment-methods{border:1px solid #ccd0d4;border-radius:4px;box-shadow:0 1px 1px rgba(0,0,0,.04)}#simpay-payment-form-settings .simpay-panel-field-payment-method{display:block;border-top:1px solid #ccd0d4;padding:7px;box-sizing:border-box}#simpay-payment-form-settings .simpay-panel-field-payment-method:first-child{border-top:0;border-top-left-radius:4px;border-top-right-radius:4px}#simpay-payment-form-settings .simpay-panel-field-payment-method__enable{display:flex;align-items:center}#simpay-payment-form-settings .simpay-panel-field-payment-method__enable input[type=checkbox]{margin-top:0;margin-right:8px}#simpay-payment-form-settings .simpay-panel-field-payment-method__help{text-decoration:none}#simpay-payment-form-settings .simpay-panel-field-payment-method__help .dashicons{font-size:18px;width:18px;height:18px}#simpay-payment-form-settings .simpay-panel-field-payment-method__restrictions,#simpay-payment-form-settings .simpay-panel-field-payment-method__restrictions-ach{margin-left:72px}#simpay-payment-form-settings .simpay-panel-field-payment-method__icon{border-radius:3px;overflow:hidden;margin:0 8px 0 5px;width:30px;height:30px;flex-shrink:0}#simpay-payment-form-settings .simpay-panel-field-payment-method__icon svg{width:30px;height:30px}#simpay-payment-form-settings .simpay-panel-field-payment-method__configure{display:flex;align-items:center;justify-content:center}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metaboxes:not(.is-empty),#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metaboxes:not(.is-empty){border:1px solid #ccd0d4;box-shadow:0 1px 1px rgba(0,0,0,.04);border-radius:4px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-handlediv,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-handlediv{display:none;float:right;width:36px;height:36px;margin:0;padding:0;border:0;background:none;cursor:pointer;display:block}#simpay-global-settings .simpay-metaboxes-wrapper .postbox.closed .simpay-handlediv .toggle-indicator:before,#simpay-form-settings .simpay-metaboxes-wrapper .postbox.closed .simpay-handlediv .toggle-indicator:before{content:""}#simpay-global-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv:focus,#simpay-form-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv:focus{outline:0}#simpay-global-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv:focus .toggle-indicator:before,#simpay-form-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv:focus .toggle-indicator:before{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}#simpay-global-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv .toggle-indicator:before,#simpay-form-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv .toggle-indicator:before{margin-top:4px;width:20px;border-radius:50%;text-indent:-1px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox{background:#fff;border:1px solid #ccd0d4;margin:0 -1px -1px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .hndle,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .hndle{border:0}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox select,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox select{font-weight:400}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox:first-of-type,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox:first-of-type{margin-top:-1px;border-top-left-radius:4px;border-top-right-radius:4px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox:last-of-type,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox:last-of-type{margin-bottom:-1px;border-bottom-left-radius:4px;border-bottom-right-radius:4px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox:last-of-type .simpay-metabox-content,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox:last-of-type .simpay-metabox-content{border-bottom-left-radius:4px;border-bottom-right-radius:4px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2{cursor:pointer;display:flex;align-items:center;padding:10px 0 10px 12px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .simpay-field-type,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .simpay-field-type{font-size:90%;color:gray;font-weight:normal;text-decoration:none;margin-left:10px}@media screen and (max-width: 782px){#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .simpay-field-type,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .simpay-field-type{display:none}}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .dashicons-handle,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .dashicons-handle{cursor:move}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 strong,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 strong{font-size:95%;margin-left:8px;display:flex;align-items:center;flex-grow:1}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 svg,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 svg{border-radius:3px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 select,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 select{font-family:sans-serif;max-width:20%;margin:.25em .25em .25em 0}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2.fixed,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2.fixed{cursor:pointer !important}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .dashicons-menu,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .dashicons-menu{cursor:move}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions{padding:9px 18px;justify-content:space-between;display:flex;align-items:center}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id{display:flex;align-items:center}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id input,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id input{margin:0 2px 0 5px;width:50px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id a,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id a{text-decoration:none}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .button-link.simpay-remove-field-link,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .button-link.simpay-remove-field-link{color:#a00}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .button-link.simpay-remove-field-link:hover,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .button-link.simpay-remove-field-link:hover{color:#dc3232}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox table,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox table{border-spacing:0;width:100%}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox table.simpay-inner-table,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox table.simpay-inner-table{border:none;padding:0 1em}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox table tr td,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox table tr td{border-bottom-color:#ccd0d4}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-remove-plan,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-remove-plan{color:#a00}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-custom-field-payment-button .dashicons-menu,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-custom-field-payment-button .dashicons-menu{visibility:hidden}#simpay-global-settings .sortable-placeholder,#simpay-form-settings .sortable-placeholder{margin:5px;display:block;min-height:36px}#simpay-global-settings .chosen-container,#simpay-form-settings .chosen-container{min-width:20em;max-width:30em}#simpay-global-settings .simpay-field.simpay-small-text,#simpay-form-settings .simpay-field.simpay-small-text{width:7em}#simpay-global-settings .simpay-field.simpay-medium-text,#simpay-form-settings .simpay-field.simpay-medium-text{width:15em}#simpay-global-settings .simpay-field-radios ul,#simpay-form-settings .simpay-field-radios ul{margin:0}#simpay-global-settings .simpay-field-radios>i,#simpay-form-settings .simpay-field-radios>i{margin-left:5px;vertical-align:middle}#simpay-global-settings ul.simpay-field-radios-inline,#simpay-form-settings ul.simpay-field-radios-inline{margin:0 0 -10px}#simpay-global-settings ul.simpay-field-radios-inline li,#simpay-form-settings ul.simpay-field-radios-inline li{display:inline-block;margin:0 10px 10px 0}#simpay-global-settings ul.simpay-field-radios-inline li:last-child,#simpay-form-settings ul.simpay-field-radios-inline li:last-child{margin-right:0}#simpay-global-settings .simpay-currency-field,#simpay-form-settings .simpay-currency-field{display:flex;align-items:center}>#simpay-global-settings .simpay-currency-field:focus,>#simpay-form-settings .simpay-currency-field:focus{position:relative;z-index:5}#simpay-global-settings .simpay-currency-symbol,#simpay-form-settings .simpay-currency-symbol{margin:0;padding-left:8px;padding-right:8px;line-height:28px;font-size:14px}@media screen and (max-width: 782px){#simpay-global-settings .simpay-currency-symbol,#simpay-form-settings .simpay-currency-symbol{line-height:38px}}#simpay-global-settings .simpay-currency-symbol-left,#simpay-form-settings .simpay-currency-symbol-left{border-top-left-radius:4px;border-bottom-left-radius:4px}#simpay-global-settings .simpay-currency-symbol-right,#simpay-form-settings .simpay-currency-symbol-right{border-top-right-radius:4px;border-bottom-right-radius:4px}#simpay-global-settings div.simpay-currency-symbol,#simpay-form-settings div.simpay-currency-symbol{border-color:#7e8993;border-style:solid;background-color:#fff}#simpay-global-settings select.simpay-currency-symbol,#simpay-form-settings select.simpay-currency-symbol{padding-right:25px}#simpay-global-settings .simpay-currency-symbol-left,#simpay-form-settings .simpay-currency-symbol-left{border-width:1px 0 1px 1px}#simpay-global-settings .simpay-currency-symbol-left+.simpay-field-amount,#simpay-form-settings .simpay-currency-symbol-left+.simpay-field-amount{border-radius:0 4px 4px 0}#simpay-global-settings .simpay-currency-symbol-right,#simpay-form-settings .simpay-currency-symbol-right{border-width:1px 1px 1px 0}#simpay-global-settings .simpay-field-amount,#simpay-form-settings .simpay-field-amount{margin:0;padding-left:8px;padding-right:8px;font-size:14px;width:6em;position:relative;z-index:2;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px}#simpay-global-settings .simpay-error,#simpay-form-settings .simpay-error{color:red}#simpay-global-settings .simpay-docs-link-wrap,#simpay-form-settings .simpay-docs-link-wrap{position:absolute;right:0;bottom:0;color:#666;font-size:13px;font-style:italic;padding:15px 18px}#simpay-global-settings .simpay-docs-link-wrap a .dashicons-editor-help,#simpay-form-settings .simpay-docs-link-wrap a .dashicons-editor-help{color:#666;text-decoration:none;width:17px;height:17px;font-size:17px;padding-left:4px}#simpay-global-settings .simpay-docs-icon,#simpay-form-settings .simpay-docs-icon{color:#666}#simpay-global-settings .simpay-docs-icon,#simpay-global-settings .simpay-docs-icon .dashicons-editor-help,#simpay-form-settings .simpay-docs-icon,#simpay-form-settings .simpay-docs-icon .dashicons-editor-help{text-decoration:none;width:17px;height:17px;font-size:17px}.button.button-primary.simpay-upgrade-btn{background-color:#428bca;border:1px solid #428bca;color:#fff;display:inline-block}.button.button-primary.simpay-upgrade-btn:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px #2d6ca2}.button.button-primary.simpay-upgrade-btn:hover{background-color:#037ad0;border:1px solid #428bca}.simpay-upgrade-btn-subtext{color:#3c434a;font-size:14px;line-height:1.5;text-align:center;margin:40px 0 0;padding:30px 35px 20px;background-color:#fcf9e8;border:3px solid #ebe29a;border-radius:4px;position:relative}.simpay-upgrade-btn-subtext svg{background:#00a32a;fill:#fff;border-radius:50%;border:3px solid #ebe29a;width:28px;height:28px;position:absolute;top:-14px;left:50%;margin-left:-14px}.simpay-upgrade-btn-subtext u{text-decoration:none;font-weight:bold;color:#00a32a}.simpay-upgrade-btn-subtext a{text-decoration:none;display:block;margin-top:6px;font-weight:bold}.post-type-simple-pay #post-body-content{display:none}.simpay-card{margin:0 0 20px;padding:30px;background:#fff;border:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04)}.simpay-card,.simpay-card p{line-height:1.5;font-size:16px}.simpay-card h3{line-height:1.6;font-size:18px;margin:0 0 20px;color:#23282c}.simpay-card p{margin:0 0 20px}.simpay-card p:last-child,.simpay-card ul:last-child{margin-bottom:0}.simpay-card figure{float:right;margin:0 0 30px 30px;max-width:400px}.simpay-card figure iframe,.simpay-card figure img{max-width:100%}.simpay-card figure figcaption{text-align:center}@media screen and (max-width: 782px){.simpay-card figure{margin:0 0 30px;max-width:100%;float:none}}.simpay-doc-suggestions{width:100%;display:flex;flex-wrap:wrap;padding:0}.simpay-doc-suggestion{text-align:center;display:flex;flex-direction:column;justify-content:center;align-items:center;flex:0 1 33.333%;padding:30px;border-right:1px solid #c3c4c7;box-sizing:border-box}.simpay-doc-suggestion:nth-child(3n){border-right:0}@media screen and (max-width: 782px){.simpay-doc-suggestion{flex:0 1 100%;border-bottom:1px solid #c3c4c7;border-right:0}.simpay-doc-suggestion:last-child{border-bottom:0}}.simpay-doc-suggestion h3{font-size:20px;margin-bottom:10px}.simpay-doc-suggestion p{font-size:15px}.simpay-doc-suggestion .dashicons{font-size:40px;width:40px;height:40px;display:block;margin-bottom:10px}.simpay-doc-suggestion .button-large{font-size:16px}.simpay-addons{display:flex;flex-wrap:wrap;justify-content:space-between;margin:20px 0}.simpay-addon{background:#fff;border:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04);margin-bottom:20px;display:flex;flex-direction:column;flex-basis:calc(33% - 10px);box-sizing:border-box}@media screen and (max-width: 782px){.simpay-addon{flex-basis:100%}}.simpay-addon img{float:left;max-width:75px}.simpay-addon h5{margin:0 0 10px 100px;font-size:16px}.simpay-addon__details{padding:20px;flex:1 0 auto}.simpay-addon__actions{display:flex;align-items:center;justify-content:space-between;flex:0 1 auto;background-color:#f7f7f7;border-top:1px solid #ddd;margin-top:auto;padding:20px;position:relative}.simpay-addon__actions .msg{text-align:center;justify-content:center;display:flex;align-items:center;position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;background-color:#f7f7f7;z-index:3}.simpay-addon .error,.simpay-addon .status-label.status-installed{color:#d63638}.simpay-addon .success,.simpay-addon .status-label.status-active{color:#00a32a}.simpay-addon .addon-desc{margin:0 0 0 100px}.form-table td .simpay-stripe-connect-help{margin:15px 0;display:flex;align-items:center}.form-table td .simpay-stripe-connect-help .dashicons{margin-right:4px}.simpay-currency-field{display:flex;align-items:center}>.simpay-currency-field:focus{position:relative;z-index:5}.simpay-currency-symbol{margin:0;padding-left:8px;padding-right:8px;line-height:28px;font-size:14px}@media screen and (max-width: 782px){.simpay-currency-symbol{line-height:38px}}.simpay-currency-symbol-left{border-top-left-radius:4px;border-bottom-left-radius:4px}.simpay-currency-symbol-right{border-top-right-radius:4px;border-bottom-right-radius:4px}div.simpay-currency-symbol{border-color:#7e8993;border-style:solid;background-color:#fff}select.simpay-currency-symbol{padding-right:25px}.simpay-currency-symbol-left{border-width:1px 0 1px 1px}.simpay-currency-symbol-left+.simpay-field-amount{border-radius:0 4px 4px 0}.simpay-currency-symbol-right{border-width:1px 1px 1px 0}.simpay-field-amount{margin:0;padding-left:8px;padding-right:8px;font-size:14px;width:6em;position:relative;z-index:2;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px}.simpay-template-explorer-open .show-settings{display:none !important}.simpay-branding-bar{margin:0 -20px;padding:14px 22px;background:#fff;border-bottom:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04);width:calc(100% + 20px);display:flex;justify-content:space-between;box-sizing:border-box}.site-health .simpay-branding-bar{display:none}.simpay-branding-bar__title{display:flex;align-items:center;margin:8px 0}.simpay-branding-bar__logo{width:200px}.simpay-branding-bar__divider{color:#dadbdf;font-size:23px;font-weight:400;margin:0 15px}.simpay-branding-bar__actions{display:flex;align-items:center}.simpay-branding-bar__actions>div{margin-left:10px;min-width:40px}.simpay-branding-bar__actions-button{color:#000;cursor:pointer;padding:10px;width:40px;height:40px;background-color:#f3f4f5;border-radius:50%;border:0;box-shadow:none;position:relative;transition:background-color .2s ease;box-sizing:border-box;display:block}.simpay-branding-bar__actions-button:hover{background-color:#e5e5e5}.simpay-branding-bar__actions-button:active,.simpay-branding-bar__actions-button:focus{box-shadow:0 0 0 2px var(--wp-admin-theme-color)}.simpay-branding-bar__actions-button-count{font-weight:600;font-size:10px;line-height:16px;color:#fff;margin:0;background-color:#df2a4a;border-radius:100%;width:16px;height:16px;position:absolute;top:-8px;left:50%;margin-left:-8px}.simpay-branding-bar .wp-heading-inline{font-size:23px;font-weight:400;margin:0}.simpay-branding-bar .page-title-action{font-weight:600;font-size:13px;line-height:normal;cursor:pointer;text-shadow:none;text-decoration:none;margin-left:10px;padding:4px 8px;border:1px solid currentColor;border-radius:2px;background:#f6f7f7}.simpay-landing-zone{text-align:center;max-width:700px;margin:40px auto}.simpay-landing-zone__title{font-size:26px;font-weight:600;margin:0 0 1.5rem;padding:0}.simpay-landing-zone__subtitle{font-size:17px;color:#666;margin:.25rem 0}.simpay-landing-zone__subtitle strong{color:#444}.simpay-landing-zone section{margin:2rem 0}.simpay-landing-zone__empty-state-graphic img{width:425px}.simpay-landing-zone__screenshot>*{vertical-align:middle}.simpay-landing-zone__screenshot-img{display:inline-block;position:relative;width:315px;padding:5px;background-color:#fff;box-shadow:0px 2px 5px 0px rgba(0,0,0,.05);border-radius:3px}.simpay-landing-zone__screenshot-img img{max-width:100%;display:block}.simpay-landing-zone__screenshot-img .hover{position:absolute;opacity:0;height:calc(100% - 10px);width:calc(100% - 10px);top:0;left:0;border:5px solid #fff;background-color:rgba(0,0,0,.15);background-image:url(data:image/svg+xml;base64,PHN2ZyBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjojZmZmZmZmMDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCIgaGVpZ2h0PSIxMDAiPjxwYXRoIGQ9Ik01MCAwYzI3LjYxNCAwIDUwIDIyLjM4NiA1MCA1MHMtMjIuMzg2IDUwLTUwIDUwUzAgNzcuNjE0IDAgNTAgMjIuMzg2IDAgNTAgMHoiIGZpbGw9IiMxNjg1YjciLz48cGF0aCBkPSJNNzMuMDIzIDY3LjA2N2wtOS4zNDQtOS4zNDRhMi4yNDcgMi4yNDcgMCAwMC0xLjU5My0uNjU2aC0xLjUyOGExOS4zOTkgMTkuMzk5IDAgMDA0LjEyNC0xMS45OTZjMC0xMC43Ny04LjcyNS0xOS40OTUtMTkuNDk0LTE5LjQ5NS0xMC43NjggMC0xOS40OTQgOC43MjYtMTkuNDk0IDE5LjQ5NSAwIDEwLjc2OCA4LjcyNiAxOS40OTMgMTkuNDk0IDE5LjQ5M2ExOS40IDE5LjQgMCAwMDExLjk5Ny00LjEyM3YxLjUyN2MwIC42LjIzNCAxLjE3Mi42NTUgMS41OTRsOS4zNDQgOS4zNDRhMi4yNCAyLjI0IDAgMDAzLjE3OCAwbDIuNjUyLTIuNjUzYTIuMjYgMi4yNiAwIDAwLjAxLTMuMTg2em0tMjcuODM1LTEwYy02LjYyNiAwLTExLjk5Ni01LjM2MS0xMS45OTYtMTEuOTk2IDAtNi42MjcgNS4zNi0xMS45OTcgMTEuOTk2LTExLjk5NyA2LjYyNiAwIDExLjk5NyA1LjM2MSAxMS45OTcgMTEuOTk3IDAgNi42MjYtNS4zNjEgMTEuOTk2LTExLjk5NyAxMS45OTZ6IiBmaWxsPSIjZmZmIi8+PC9zdmc+);background-repeat:no-repeat;background-position:center;background-size:50px;transition:all .3s}.simpay-landing-zone__screenshot-img:hover .hover{opacity:1;transition:all .3s}.simpay-landing-zone__screenshot ul{text-align:left;display:inline-block;margin:0 0 0 30px;list-style-type:none;max-width:calc(100% - 350px)}@media screen and (max-width: 782px){.simpay-landing-zone__screenshot ul{text-align:center;margin:30px auto;max-width:100%;display:block}}.simpay-landing-zone__screenshot li{margin:16px 0;padding:0;font-size:15px;color:#777;position:relative}.simpay-landing-zone__screenshot li:before{content:"";background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEzLjc3NjIgNi40NTYwNUw4LjcyMDMyIDEuNDAwMDVDOC41NzU5OSAxLjI1NTcyIDguMzgzNjQgMS4xNzY1IDguMTc4NTMgMS4xNzY1QzcuOTczMiAxLjE3NjUgNy43ODA5NiAxLjI1NTg0IDcuNjM2NjQgMS40MDAwNUw3LjE3NzYgMS44NTkyQzcuMDMzMzkgMi4wMDMyOSA2Ljk1Mzk1IDIuMTk1NzYgNi45NTM5NSAyLjQwMDk4QzYuOTUzOTUgMi42MDYwOCA3LjAzMzM5IDIuODA1MDQgNy4xNzc2IDIuOTQ5MTRMMTAuMTI3MSA1LjkwNTE2SDAuNzU2MzM0QzAuMzMzODM0IDUuOTA1MTYgMCA2LjIzNTkyIDAgNi42NTg1NFY3LjMwNzY1QzAgNy43MzAyNyAwLjMzMzgzNCA4LjA5NDM4IDAuNzU2MzM0IDguMDk0MzhIMTAuMTYwNkw3LjE3NzcyIDExLjA2NjlDNy4wMzM1MSAxMS4yMTEyIDYuOTU0MDYgMTEuMzk4NSA2Ljk1NDA2IDExLjYwMzdDNi45NTQwNiAxMS44MDg3IDcuMDMzNTEgMTEuOTk4NiA3LjE3NzcyIDEyLjE0MjhMNy42MzY3NSAxMi42MDA1QzcuNzgxMDcgMTIuNzQ0OCA3Ljk3MzMyIDEyLjgyMzUgOC4xNzg2NSAxMi44MjM1QzguMzgzNzUgMTIuODIzNSA4LjU3NjExIDEyLjc0MzggOC43MjA0MyAxMi41OTk1TDEzLjc3NjMgNy41NDM2QzEzLjkyMSA3LjM5ODgyIDE0LjAwMDUgNy4yMDU1NiAxNCA3LjAwMDExQzE0LjAwMDQgNi43OTM5OCAxMy45MjEgNi42MDA2IDEzLjc3NjIgNi40NTYwNVY2LjQ1NjA1WiIgZmlsbD0iIzQyOEJDQSIvPgo8L3N2Zz4K);background-position:center;background-repeat:no-repeat;background-size:14px;width:14px;height:14px;display:inline-block;margin:-3px 5px 0 0;vertical-align:middle}.simpay-landing-zone .button.button-large{font-size:17px;line-height:30px;padding:10px 20px}.simpay-landing-zone__purchased{display:block;margin:15px 0 0}.simpay-upgrade-modal,.simpay-upgrade-upe-modal{padding:0 !important}.simpay-upgrade-modal *,.simpay-upgrade-upe-modal *{box-sizing:border-box}.simpay-upgrade-modal__content,.simpay-upgrade-upe-modal__content{text-align:center;display:flex;flex-direction:column;align-items:center;padding:16px 32px 32px}.simpay-upgrade-modal__content>.dashicons,.simpay-upgrade-upe-modal__content>.dashicons{color:#333;font-size:48px;width:48px;height:48px}.simpay-upgrade-modal__title,.simpay-upgrade-upe-modal__title{font-size:22px;line-height:1.5;display:block;margin:12px 0 0}.simpay-upgrade-modal__description,.simpay-upgrade-upe-modal__description{color:#777;font-size:16px;margin:16px 0 24px}.simpay-upgrade-modal__description strong,.simpay-upgrade-upe-modal__description strong{color:#333}.simpay-upgrade-modal__discount,.simpay-upgrade-upe-modal__discount{font-size:15px;text-align:center;margin:32px -32px -32px;padding:24px 40px;background-color:#fcf9e8;position:relative}.simpay-upgrade-modal__discount svg,.simpay-upgrade-upe-modal__discount svg{background:#00a32a;fill:#fff;border-radius:50%;border:4px solid #fff;width:32px;height:32px;position:absolute;top:-16px;left:50%;margin-left:-16px}.simpay-upgrade-modal__discount u,.simpay-upgrade-upe-modal__discount u{text-decoration:none;font-weight:bold;color:#00a32a}.simpay-upgrade-modal .button-large,.simpay-upgrade-upe-modal .button-large{font-size:16px;font-weight:bold;margin:0 0 15px;padding:8px 30px !important;height:auto}.simpay-teaser-float{margin:50px;position:relative}.simpay-teaser-float__card{text-align:center;padding:30px;background:#fff;border-radius:4px;box-shadow:0 0 30px 15px rgba(0,0,0,.18);position:relative;z-index:2}#poststuff .simpay-teaser-float h2,.simpay-teaser-float h2{font-size:24px;font-weight:600;margin:0;padding:0}.simpay-teaser-float p{font-size:15px;line-height:1.35;color:#666}.simpay-teaser-float p strong{color:#444}.simpay-teaser-float ul{text-align:left;display:inline-block;margin:-10px 0 20px;list-style-type:none}.simpay-teaser-float li{margin:16px 0;padding:0 0 0 24px;font-size:15px;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEzLjc3NjIgNi40NTYwNUw4LjcyMDMyIDEuNDAwMDVDOC41NzU5OSAxLjI1NTcyIDguMzgzNjQgMS4xNzY1IDguMTc4NTMgMS4xNzY1QzcuOTczMiAxLjE3NjUgNy43ODA5NiAxLjI1NTg0IDcuNjM2NjQgMS40MDAwNUw3LjE3NzYgMS44NTkyQzcuMDMzMzkgMi4wMDMyOSA2Ljk1Mzk1IDIuMTk1NzYgNi45NTM5NSAyLjQwMDk4QzYuOTUzOTUgMi42MDYwOCA3LjAzMzM5IDIuODA1MDQgNy4xNzc2IDIuOTQ5MTRMMTAuMTI3MSA1LjkwNTE2SDAuNzU2MzM0QzAuMzMzODM0IDUuOTA1MTYgMCA2LjIzNTkyIDAgNi42NTg1NFY3LjMwNzY1QzAgNy43MzAyNyAwLjMzMzgzNCA4LjA5NDM4IDAuNzU2MzM0IDguMDk0MzhIMTAuMTYwNkw3LjE3NzcyIDExLjA2NjlDNy4wMzM1MSAxMS4yMTEyIDYuOTU0MDYgMTEuMzk4NSA2Ljk1NDA2IDExLjYwMzdDNi45NTQwNiAxMS44MDg3IDcuMDMzNTEgMTEuOTk4NiA3LjE3NzcyIDEyLjE0MjhMNy42MzY3NSAxMi42MDA1QzcuNzgxMDcgMTIuNzQ0OCA3Ljk3MzMyIDEyLjgyMzUgOC4xNzg2NSAxMi44MjM1QzguMzgzNzUgMTIuODIzNSA4LjU3NjExIDEyLjc0MzggOC43MjA0MyAxMi41OTk1TDEzLjc3NjMgNy41NDM2QzEzLjkyMSA3LjM5ODgyIDE0LjAwMDUgNy4yMDU1NiAxNCA3LjAwMDExQzE0LjAwMDQgNi43OTM5OCAxMy45MjEgNi42MDA2IDEzLjc3NjIgNi40NTYwNVY2LjQ1NjA1WiIgZmlsbD0iIzQyOEJDQSIvPgo8L3N2Zz4K);background-position:left 3px;background-repeat:no-repeat;background-size:14px;color:#777}.simpay-teaser-float .button.button-large{font-size:17px;line-height:30px;padding:10px 20px}.simpay-teaser-float .simpay-notice-dismiss{position:absolute;top:0;right:0;font-size:20px;color:#666;font-weight:bold;text-decoration:none;margin-left:5px;padding:6px 10px;z-index:2}.simpay-teaser-float .simpay-notice-dismiss:hover,.simpay-teaser-float .simpay-notice-dismiss:active,.simpay-teaser-float .simpay-notice-dismiss:focus{color:#666;text-decoration:none}.simpay-teaser-float:after,.simpay-teaser-float:before{opacity:.75;z-index:0;content:"";position:absolute;left:-30px;right:-30px;top:-35px;width:calc(100% + 60px);height:170px;background-image:linear-gradient(#ddd, #ddd),linear-gradient(#eee, #eee),linear-gradient(#ddd, #ddd),linear-gradient(#eee, #eee);background-repeat:no-repeat;background-size:100% 20px,100% 40px,100% 20px,100% 40px;background-position:0 0,0 30px,0 100px,0 130px}.simpay-teaser-float:before{top:170px}.simpay-teaser-float .simpay-upgrade-btn-subtext{margin:24px -30px -30px;padding:32px 40px;border-bottom-left-radius:2px;border-bottom-right-radius:2px;border:0}.simpay-teaser-float .simpay-upgrade-btn-subtext svg{border-color:#fff}.simpay-teaser-float--inline{margin:40px 30px 30px}.simpay-teaser-float--inline .simpay-teaser-float__card{padding:30px;box-shadow:0 0 12px 6px rgba(0,0,0,.16)}#poststuff .simpay-teaser-float--inline h2,.simpay-teaser-float--inline h2{font-size:20px}.simpay-teaser-float--inline p{font-size:15px;margin:.75rem 0}.simpay-teaser-float--inline .button.button-large{font-size:15px;line-height:24px;margin:1rem 0;padding:8px 14px;display:inline-block}.simpay-teaser-float--inline:before,.simpay-teaser-float--inline:after{opacity:.6}.simpay-teaser-float--inline:before{display:none}.simpay-teaser-float--inline:after{top:15px}.simpay-form-settings-notice{font-weight:normal;color:#1d2327;position:relative;margin:18px 18px 0;padding:14px;border-radius:4px;background:#f5f5ff}.simpay-form-settings-notice a{color:#635aff}.simpay-form-settings-notice .simpay-external-link .dashicons-external{margin:1px 0 0 2px}.simpay-form-settings-notice strong{font-size:14px}.simpay-form-settings-notice p{margin:5px 0 0 23px}.simpay-form-settings-notice .simpay-notice-dismiss{font-size:20px;color:#b0b0f0;font-weight:bold;line-height:1;position:absolute;top:0;right:5px;text-decoration:none;padding:0 5px;z-index:2}.simpay-form-settings-notice .simpay-notice-dismiss:hover,.simpay-form-settings-notice .simpay-notice-dismiss:active,.simpay-form-settings-notice .simpay-notice-dismiss:focus{color:#9191ef;text-decoration:none;background:none}.simpay-settings .simpay-form-settings-notice{border:2px solid #645aff;box-shadow:0 1px 1px rgba(0,0,0,.04)}.post-type-simple-pay .lity{z-index:999999999;padding:20px}.post-type-simple-pay .lity-close{margin:10px}.post-type-simple-pay .lity-content{max-width:80vw;max-height:80vh}.post-type-simple-pay .lity-content img{max-height:80vh !important;max-width:80vw !important}#wpsp-api-keys-row-hide{display:none}.post-type-simple-pay #post-preview:not(.simpay-preview-button){display:none}.simpay-license-field-wrapper{margin:20px 0}#simpay-settings-license-key-license-key{margin:0}#simpay-settings-license-key-license-key[readonly]{background:#fff}.simpay-license-message__loading,.simpay-license-field{display:flex;align-items:center}.wp-core-ui .button.simpay-license-button.button-primary,.wp-core-ui .button.simpay-license-button.button-secondary{font-size:1rem;line-height:1;margin:0 8px;padding:13px}.simpay-license-message{font-size:15px;margin-top:8px}.simpay-license-message--valid{color:#15803d}.simpay-license-message--invalid{color:#b91c1c}.simpay-recaptcha-payment-form-feedback .dashicons{margin-top:-1px;display:inline-block}.simpay-recaptcha-payment-form-feedback .dashicons-update-alt{animation:rotation 2s infinite linear}.simpay-form-builder-inset-settings{margin:3px 0 0 24px}fieldset.simpay-form-builder-inset-settings>*:not(legend){margin:5px 0 8px}.simpay-form-builder-inset-settings>*:last-child{margin-bottom:0}.simpay-form-builder-inventory-control{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;padding:6px 8px;box-shadow:0 0 0 rgba(0,0,0,0);transition:box-shadow .1s linear;border-radius:2px;border:1px solid #757575;font-size:16px;line-height:normal;margin:0;padding:0;width:auto;display:inline-flex;align-items:center}@media(prefers-reduced-motion: reduce){.simpay-form-builder-inventory-control{transition-duration:0s;transition-delay:0s}}@media(min-width: 600px){.simpay-form-builder-inventory-control{font-size:13px;line-height:normal}}.simpay-form-builder-inventory-control:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid rgba(0,0,0,0)}.simpay-form-builder-inventory-control::-webkit-input-placeholder{color:rgba(30,30,30,.62)}.simpay-form-builder-inventory-control::-moz-placeholder{opacity:1;color:rgba(30,30,30,.62)}.simpay-form-builder-inventory-control:-ms-input-placeholder{color:rgba(30,30,30,.62)}.simpay-form-builder-inventory-control:focus-within{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid rgba(0,0,0,0)}.simpay-form-builder-inventory-control input[type=number]{border:0;box-shadow:none;background:none;border-radius:0;width:75px}.simpay-form-builder-inventory-control input[type=number]:focus{border:0;box-shadow:none;outline:0}.simpay-form-builder-inventory-control+label{margin-left:8px}.simpay-form-builder-inventory-control__initial{color:#757575;font-size:16px;line-height:normal;padding-right:8px}@media(min-width: 600px){.simpay-form-builder-inventory-control__initial{font-size:13px;line-height:normal}}.simpay-form-builder-inventory-control__initial:before{content:"/";display:inline-block;vertical-align:top;margin-top:-1px}.simpay-form-builder-purchase-restrictions__restriction-item{display:flex;align-items:center;margin-top:8px;margin-bottom:8px}.simpay-form-builder-purchase-restrictions__restriction-item label{margin-left:8px}.simpay-form-builder-purchase-restrictions__restriction-item-datetime{display:flex;align-items:center}.simpay-form-builder-purchase-restrictions__restriction-item-datetime>*{margin-right:10px}.simpay-form-builder-purchase-restrictions__restriction-item-datetime span{color:#757575}.simpay-form-builder-fee-recovery__amounts{display:flex;align-items:center;margin-top:5px}.simpay-form-builder-fee-recovery ::-webkit-input-placeholder{color:#b7bec7}.simpay-form-builder-fee-recovery ::-moz-placeholder{color:#b7bec7;opacity:1}.simpay-form-builder-fee-recovery :-ms-input-placeholder{color:#b7bec7}.simpay-form-builder-fee-recovery>*{margin-right:8px}.simpay-form-builder-fee-percent-control{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;padding:6px 8px;box-shadow:0 0 0 rgba(0,0,0,0);transition:box-shadow .1s linear;border-radius:2px;border:1px solid #757575;font-size:16px;line-height:normal;margin:0;padding:0;width:auto;display:inline-flex;align-items:center}@media(prefers-reduced-motion: reduce){.simpay-form-builder-fee-percent-control{transition-duration:0s;transition-delay:0s}}@media(min-width: 600px){.simpay-form-builder-fee-percent-control{font-size:13px;line-height:normal}}.simpay-form-builder-fee-percent-control:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid rgba(0,0,0,0)}.simpay-form-builder-fee-percent-control::-webkit-input-placeholder{color:rgba(30,30,30,.62)}.simpay-form-builder-fee-percent-control::-moz-placeholder{opacity:1;color:rgba(30,30,30,.62)}.simpay-form-builder-fee-percent-control:-ms-input-placeholder{color:rgba(30,30,30,.62)}.simpay-form-builder-fee-percent-control:focus-within{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid rgba(0,0,0,0)}.simpay-form-builder-fee-percent-control input[type=number]{border:0;box-shadow:none;background:none;border-radius:0;width:75px}.simpay-form-builder-fee-percent-control input[type=number]:focus{border:0;box-shadow:none;outline:0}.simpay-form-builder-fee-percent-control+label{margin-left:8px}.simpay-form-builder-fee-percent-control__suffix{color:#757575;font-size:16px;line-height:normal;padding-right:8px}@media(min-width: 600px){.simpay-form-builder-fee-percent-control__suffix{font-size:13px;line-height:normal}}.simpay-form-builder-automations__cta{margin:24px 0 6px;text-align:center}.simpay-form-builder-automator{padding:16px 4px 26px !important}.simpay-form-builder-automator,.simpay-form-builder-automator *{box-sizing:border-box}.simpay-form-builder-automator input[type=search]{font-size:15px;padding:2px 8px}.simpay-form-builder-automator__integrations{display:grid;grid-template-columns:repeat(4, minmax(0, 1fr));grid-column-gap:16px;grid-row-gap:16px;margin:18px -18px 0;padding:0 18px 10px;width:calc(100% + 36px);max-height:400px;overflow-y:scroll}.simpay-form-builder-automator__integrations-integration{color:initial;text-align:center;text-decoration:none;background:#fff;border:1px solid #eee;border-radius:4px;box-shadow:0 1px 3px 0 rgba(0,0,0,.03);transition:all ease-in .15s}.simpay-form-builder-automator__integrations-integration img{display:block;margin:16px auto;height:50px}.simpay-form-builder-automator__integrations-integration span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:8px 16px;display:block;border-top:1px solid #eee}.simpay-form-builder-automator__integrations-integration:hover{cursor:pointer;border-color:#ddd;box-shadow:0 2px 4px 0 rgba(0,0,0,.06)}body.site-health #wpbody-content,body.post-type-simple-pay #wpbody-content{padding-bottom:200px}#wpfooter .simpay-footer-promotion{text-align:center;font-weight:400;font-size:13px;line-height:16px;color:#787c82;padding:20px 0 30px 0;margin-bottom:20px}#wpfooter .simpay-footer-promotion p{font-weight:600}#wpfooter .simpay-footer-promotion-links,#wpfooter .simpay-footer-promotion-social{display:flex;justify-content:center;align-items:center}#wpfooter .simpay-footer-promotion-links{margin:9px 0 0}#wpfooter .simpay-footer-promotion-links span{color:#c3c4c7;padding:0 7px}#wpfooter .simpay-footer-promotion-social{margin:10px 0 0 0;gap:10px}#wpfooter .simpay-footer-promotion-social li{margin-bottom:0}#wpfooter .simpay-footer-promotion-social li:hover path{fill:#50575e}#wpfooter .simpay-footer-promotion-social a{display:block;height:16px}.simpay-settings-is_upe td{background:#fff;border:1px solid #c3c4c7;border-left-width:4px;border-left-color:#2271b1;box-shadow:0 1px 1px rgba(0,0,0,.04);padding:12px 18px} +.simpay-settings-subsections{display:flex;align-items:center;box-shadow:inset 0 -1px 0 0 #ccc}.simpay-settings-subsections__subsection{font-weight:500;text-decoration:none;padding:15px;display:flex;align-items:center}.simpay-settings-subsections__subsection .dashicons{width:18px;height:18px;font-size:18px;margin-right:4px}.simpay-settings-subsections__subsection.is-active{box-shadow:inset 0 -4px 0 0 currentColor;position:relative;z-index:1}.simpay-settings-subsections__subsection:not(.is-active){color:#23282d}.simpay-settings form>h2:not(.nav-tab-wrapper){clip:rect(1px, 1px, 1px, 1px);height:1px;overflow:hidden;position:absolute !important;width:1px}.simpay-settings .form-table td fieldset+p,.simpay-settings .form-table td label+p,.simpay-settings .form-table td select+p,.simpay-settings .form-table td input+p{color:#666;font-style:italic}.simpay-settings .simpay-settings-subsections__subsection{display:flex;align-items:center}.simpay-settings .simpay-settings-subsections__subsection .simpay-settings-bubble{margin-left:5px}.simpay-settings .simpay-settings-visual-toggles{margin:30px 0 0;display:flex}.simpay-settings .simpay-settings-visual-toggles input[type=radio]{display:none}.simpay-settings .simpay-settings-visual-toggles__toggle{-webkit-user-select:none;-moz-user-select:none;user-select:none;min-width:180px;margin:0 30px 0 0 !important;position:relative;display:block;background-color:#fff;border-radius:4px;border:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04)}.simpay-settings .simpay-settings-visual-toggles__toggle:hover{border:1px solid #999;box-shadow:0 1px 2px rgba(0,0,0,.1)}.simpay-settings .simpay-settings-visual-toggles input[type=radio]:checked+.simpay-settings-visual-toggles__toggle{border-color:#007cba;border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px #007cba;box-shadow:0 0 0 1px var(--wp-admin-theme-color)}.simpay-settings .simpay-settings-visual-toggles__toggle-recommended,.simpay-settings .simpay-settings-visual-toggles__toggle-not-recommended{text-align:center;font-size:12px;text-transform:uppercase;font-weight:bold;margin:0;padding:5px 0;display:block;border-top-right-radius:4px;border-top-left-radius:4px}.simpay-settings .simpay-settings-visual-toggles__toggle-recommended{color:#0f8569;background:#f4f9f7}.simpay-settings .simpay-settings-visual-toggles__toggle-not-recommended{color:#b91c1b;background:#fef2f2}.simpay-settings .simpay-settings-visual-toggles__toggle-icon{margin:20px auto 15px;padding:0 15px;display:block}.simpay-settings .simpay-settings-visual-toggles__toggle-label{line-height:1.5;text-align:center;font-size:16px;font-weight:500;margin:15px;display:block}.simpay-settings .simpay-settings-visual-toggles__toggle-label small{color:#666;font-weight:normal;font-size:13px;line-height:1;display:block;margin:4px 0}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type .simpay-settings-visual-toggles__toggle{min-height:160px}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type .simpay-settings-visual-toggles__toggle-icon{width:80px;height:80px}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type input[type=radio].simpay-settings-captcha-type--is-recommended:checked+.simpay-settings-visual-toggles__toggle{border-color:#0f8569;box-shadow:0 0 0 1px #0f8569}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type input[type=radio].simpay-settings-captcha-type--is-not-recommended:checked+.simpay-settings-visual-toggles__toggle{border-color:#b91c1b;box-shadow:0 0 0 1px #b91c1b}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type label[for=simpay-settings-captcha-type-cloudflare-turnstile] .simpay-settings-visual-toggles__toggle-icon{width:120px}.simpay-settings-general-recaptcha-no_captcha_warning th,.simpay-settings-general-recaptcha-no_captcha_warning td,.simpay-settings-hcaptcha_secret_key th,.simpay-settings-hcaptcha_secret_key td,.simpay-settings-cloudflare_turnstile_secret_key th,.simpay-settings-cloudflare_turnstile_secret_key td,.simpay-settings-recaptcha_score_threshold th,.simpay-settings-recaptcha_score_threshold td{padding-bottom:50px !important}.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-summary-report,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-payment-confirmation,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-payment-notification,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-upcoming-invoice,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-manage-subscriptions,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-payment-processing-confirmation,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-payment-processing-notification,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-payment-refunded-confirmation,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-subscription-cancel-confirmation,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-subscription-cancel-notification,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-invoice-confirmation{display:none}.simpay-settings .simpay-settings-subsection-emails-tools{margin-left:auto}.simpay-admin-charts-period-over-period{position:relative;padding-bottom:12px}.simpay-admin-charts-period-over-period *{box-sizing:border-box}.simpay-admin-charts-period-over-period__tooltip{position:absolute;background:#fff;border:1px solid #c3c3c3;box-shadow:0 2px 6px rgba(0,0,0,.05);border-radius:2px;padding:10px 14px;display:flex;flex-direction:column;z-Index:10000;min-width:175px}.simpay-admin-charts-period-over-period__tooltip-data{white-space:nowrap;margin-bottom:8px;display:grid;grid-template-columns:1fr auto;grid-auto-rows:auto;-moz-column-gap:16px;column-gap:16px}.simpay-admin-charts-period-over-period__tooltip-data:last-child{margin-bottom:0}.simpay-admin-charts-period-over-period__tooltip-data[data-dataset="1"]{opacity:.65}.simpay-admin-charts-period-over-period__tooltip-data em{font-style:normal;text-align:right}.simpay-admin-charts-period-over-period__tooltip-delta{font-size:12px;margin:0 -14px -10px;padding:8px 14px;border-top:1px solid #eee;background:#fdfdfd;border-radius:2px;display:flex;align-items:center;justify-content:center}.simpay-admin-charts-period-over-period__tooltip-delta .simpay-admin-charts-badge{margin-right:4px}.simpay-admin-charts-period-over-period__tooltip-delta strong.is-positive{color:#006908}.simpay-admin-charts-period-over-period__tooltip-delta strong.is-negative{color:#b3093c}.simpay-admin-charts-badge{color:#2f2f2f;font-size:12px;font-weight:500;font-style:normal;line-height:1;padding:3px 6px;display:inline-flex;align-items:center;background:#f0f0f0;border-radius:100px}.simpay-admin-charts-badge.is-positive{color:#006908;background-color:#d7f7c2}.simpay-admin-charts-badge.is-negative{color:#b3093c;background-color:#ffe7f2}.simpay-admin-charts-badge__icon{width:15px;height:15px}.simpay-admin-charts-no-data{position:absolute;top:0;left:0;display:flex;justify-content:center;align-items:center;background:rgba(255,255,255,.5);z-index:2}.simpay-admin-charts-no-data>div{text-align:center;padding:24px;background:#fff;border:1px solid #c3c3c3;box-shadow:0 2px 6px rgba(0,0,0,.1);border-radius:2px;max-width:60%}.simpay-admin-charts-no-data strong{font-size:15px;margin-bottom:8px;display:block}.button.button-large.simpay-button-large{font-size:14px;line-height:30px;padding:4px 12px}.simpay-copy-hidden-input{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}.fixed .column-livemode{width:15%;text-align:right}@media screen and (max-width: 782px){.fixed .column-livemode{text-align:left}}.fixed .column-livemode .simpay-badge{margin-top:3px}.fixed .column-shortcode{width:25%}.fixed .column-shortcode .simpay-shortcode{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}.post-type-simple-pay .misc-pub-curtime,.post-type-simple-pay .misc-pub-visibility{display:none}.simpay-metabox-title{border:1px solid #eee}.simpay-shortcode-section{border-top:1px solid #ddd;border-width:1px 0;padding-top:15px;padding-bottom:15px;position:relative}.simpay-shortcode-section label{display:block;margin-bottom:6px}.simpay-shortcode-section label .dashicons{color:#8c8f94;margin-right:3px}.simpay-shortcode-section .simpay-copy-button{line-height:normal;position:absolute;right:20px;bottom:20px;border:0;background:none;box-shadow:none;padding:0}.simpay-shortcode-section .simpay-copy-button:hover{border:0;background:none;box-shadow:none}.simpay-shortcode-section .simpay-copy-button .dashicons{color:#3c434a}.simpay-shortcode{width:100%;padding:8px;line-height:1;margin:0;height:32px;resize:none}.simpay-badge{color:#3f3f46;text-align:center;line-height:1;padding:5px 7px;border-radius:3px;background:#e4e4e7;border:0;box-shadow:none;display:inline-flex;align-items:center}button.simpay-badge{cursor:pointer}button.simpay-badge:hover{background:#d4d4d8}.simpay-badge__icon{opacity:.8;margin:2px 5px 0 0}.simpay-badge--green{color:#0e6245;background:#cbf4c9}.simpay-badge--yellow{color:#983705;background:#f8e5b9}.simpay-stripe-account-info{display:flex;align-items:center;margin-bottom:8px;position:relative}.simpay-stripe-account-info .spinner{float:none;margin-top:0;margin-left:0}.simple-pay_page_simpay_settings .simpay-settings-upgrade,.post-type-simple-pay .simpay-settings-upgrade{margin-top:20px;padding:1px;position:relative;background:#fff;border-radius:4px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.2),0 5px 10px rgba(0,0,0,.1);max-width:677px}.simple-pay_page_simpay_settings .simpay-settings-upgrade__inner,.post-type-simple-pay .simpay-settings-upgrade__inner{text-align:center;margin:0;padding:30px}.simple-pay_page_simpay_settings .simpay-settings-upgrade h3,.post-type-simple-pay .simpay-settings-upgrade h3{line-height:1.5;font-size:22px;margin:0 0 1.5rem}.simple-pay_page_simpay_settings .simpay-settings-upgrade ul,.post-type-simple-pay .simpay-settings-upgrade ul{margin:1.5rem 0 calc(1.5rem - 6px);display:flex;flex-wrap:wrap;justify-content:center}@media screen and (min-width: 782px){.simple-pay_page_simpay_settings .simpay-settings-upgrade ul,.post-type-simple-pay .simpay-settings-upgrade ul{margin-left:4rem;margin-right:4rem}}.simple-pay_page_simpay_settings .simpay-settings-upgrade li,.post-type-simple-pay .simpay-settings-upgrade li{font-size:15px;margin:6px 0;width:100%}.simple-pay_page_simpay_settings .simpay-settings-upgrade li a,.post-type-simple-pay .simpay-settings-upgrade li a{color:#3c434a;text-decoration:none}.simple-pay_page_simpay_settings .simpay-settings-upgrade li a:hover,.post-type-simple-pay .simpay-settings-upgrade li a:hover{color:var(--wp-admin-theme-color);text-decoration:underline}@media screen and (min-width: 782px){.simple-pay_page_simpay_settings .simpay-settings-upgrade li,.post-type-simple-pay .simpay-settings-upgrade li{text-align:left;width:50%}}.simple-pay_page_simpay_settings .simpay-settings-upgrade .button.button-large,.post-type-simple-pay .simpay-settings-upgrade .button.button-large{font-size:17px;line-height:30px;padding:10px 20px}.simple-pay_page_simpay_settings .simpay-settings-upgrade small,.post-type-simple-pay .simpay-settings-upgrade small{color:#666;margin:15px 0 0;display:block}.simple-pay_page_simpay_settings .simpay-settings-upgrade .dashicons-yes,.post-type-simple-pay .simpay-settings-upgrade .dashicons-yes{color:#428bca}.simple-pay_page_simpay_settings .simpay-settings-upgrade .button-link,.post-type-simple-pay .simpay-settings-upgrade .button-link{position:absolute;top:0;right:0;font-size:20px;color:#666;font-weight:bold;text-decoration:none;margin-left:5px;padding:6px 10px;z-index:2}.simple-pay_page_simpay_settings .simpay-settings-upgrade .button-link:hover,.simple-pay_page_simpay_settings .simpay-settings-upgrade .button-link:active,.simple-pay_page_simpay_settings .simpay-settings-upgrade .button-link:focus,.post-type-simple-pay .simpay-settings-upgrade .button-link:hover,.post-type-simple-pay .simpay-settings-upgrade .button-link:active,.post-type-simple-pay .simpay-settings-upgrade .button-link:focus{color:#666;text-decoration:none}.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext{text-align:center;margin:0;padding:30px 20px 20px;background-color:#fcf9e8;border:1px solid #edeac9;border-width:1px 0 0;position:relative;border-radius:0;border-bottom-left-radius:4px;border-bottom-right-radius:4px}@media screen and (min-width: 782px){.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext{padding-left:4rem;padding-right:4rem}}.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext svg,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext svg{background:#00a32a;fill:#fff;border-radius:50%;border:4px solid #fff;box-shadow:0 0 0 1px #edeac9;width:28px;height:28px;position:absolute;top:-18px;left:50%;margin-left:-18px}.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext u,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext u{text-decoration:none;font-weight:bold;color:#00a32a}.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext a,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext a{font-weight:normal;display:inline-block}#simpay-payment-form-settings table{width:100%;border-collapse:collapse}#simpay-payment-form-settings ::-webkit-input-placeholder{color:#9ba1a9}#simpay-payment-form-settings ::-moz-placeholder{color:#9ba1a9;opacity:1}#simpay-payment-form-settings :-ms-input-placeholder{color:#9ba1a9}#simpay-payment-form-settings .inside{margin:0;padding:0}#simpay-payment-form-settings .simpay-panel-field .toolbar{margin-bottom:-4px}#simpay-payment-form-settings .simpay-panel-field .toolbar .simpay-field-select{margin:0 0 4px;width:auto;max-width:70%}#simpay-payment-form-settings .simpay-tabs{margin:0;padding:0;list-style:none;background:#fafafa;border-right:1px solid #ccd0d4;line-height:1em;position:relative;flex:0 0 25%}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-tabs{flex-basis:100%;flex-grow:1;border-right:0}}#simpay-payment-form-settings .simpay-tabs li{margin:0;padding:0}#simpay-payment-form-settings .simpay-tabs li:first-child{margin-top:12px}#simpay-payment-form-settings .simpay-tabs li:last-child{margin-bottom:20px}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-tabs li:last-child{margin-bottom:0}}#simpay-payment-form-settings .simpay-tabs li.active{margin-left:-1px;box-shadow:0 1px 1px rgba(0,0,0,.04);position:relative}#simpay-payment-form-settings .simpay-tabs li.active:focus:after{display:none}#simpay-payment-form-settings .simpay-tabs li.active:before,#simpay-payment-form-settings .simpay-tabs li.active:after{content:"";width:calc(100% + 1px);height:1px;background:#ccd0d4;position:absolute;top:0;left:0;right:0;z-index:2}#simpay-payment-form-settings .simpay-tabs li.active:after{top:auto;bottom:0}#simpay-payment-form-settings .simpay-tabs li.active a{font-weight:bold;background-color:#fff;position:relative;margin-right:-1px}#simpay-payment-form-settings .simpay-tabs li.active a:before{content:"";position:absolute;top:0;left:0;bottom:0;width:4px;height:100%;background:currentColor;z-index:3}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-tabs li.active a{margin-right:0}}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item{display:flex;align-items:center;line-height:20px;margin:0;padding:8px 10px 8px 14px;text-decoration:none;transition:all .05s ease-in-out}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item svg,#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item .dashicons{margin-right:6px}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item{padding:18px}}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item:focus{outline:0;position:relative;z-index:3;box-shadow:inset 0 0 0 1px currentColor,0 0 0 1px currentColor}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item[href="#purchase-restrictions-settings-panel"],#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item[href="#payment-page-settings-panel"]{margin-bottom:20px;position:relative}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item[href="#purchase-restrictions-settings-panel"]:after,#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item[href="#payment-page-settings-panel"]:after{content:"";position:absolute;left:14px;right:14px;bottom:-10px;width:calc(100% - 28px);height:1px;background:#eaeaea}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item span>span{color:#f18500;font-size:12px;font-weight:600;margin:0 0 0 5px;display:inline-block}#simpay-payment-form-settings .simpay-tabs li:not(.active) .simpay-tab-item{color:inherit}#simpay-payment-form-settings .simpay-panels-wrap{background:#fff;display:flex}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-panels-wrap{flex-direction:column}}#simpay-payment-form-settings .simpay-panels{flex:0 0 75%;display:flex}@media screen and (min-width: 1400px){#simpay-payment-form-settings .simpay-panels{flex-basis:75%}}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-panels{flex-basis:100%}}#simpay-payment-form-settings .simpay-panel,#simpay-payment-form-settings .simpay-panel-section{width:100%}#simpay-payment-form-settings .simpay-panel>table,#simpay-payment-form-settings .simpay-panel>table>tr,#simpay-payment-form-settings .simpay-panel>table>tbody,#simpay-payment-form-settings .simpay-panel>table>tbody>tr,#simpay-payment-form-settings .simpay-panel>table>thead,#simpay-payment-form-settings .simpay-panel>table>thead>tr{display:block;width:100%}#simpay-payment-form-settings .simpay-panel>table:last-child>tbody:last-child>tr:last-child>td{border-bottom:0}#simpay-payment-form-settings .simpay-panel-field--requires-upgrade{position:relative}#simpay-payment-form-settings .simpay-panel-field--requires-upgrade td>div{margin-right:80px}#simpay-payment-form-settings .simpay-panel-field--requires-upgrade td>div .button-small{position:absolute;top:calc(50% - 13px);right:18px}#simpay-payment-form-settings .simpay-panel-field,#simpay-payment-form-settings .simpay-panel-field>td,#simpay-payment-form-settings .simpay-panel-field>th{text-align:left;display:block}#simpay-payment-form-settings .simpay-panel-field>td,#simpay-payment-form-settings .simpay-panel-field>th{width:calc(100% - 36px);margin-left:18px;margin-right:18px}#simpay-payment-form-settings .simpay-panel-field th{font-weight:bold;padding-top:18px;padding-bottom:5px}#simpay-payment-form-settings .simpay-panel-field td{border-bottom:1px solid #ddd;padding-bottom:18px}#simpay-payment-form-settings .simpay-panel-field p.description{margin-top:4px}#simpay-payment-form-settings .simpay-panel-field p.description:last-of-type{margin-bottom:0}#simpay-payment-form-settings .simpay-panel-field .simpay-panel-field__nested{margin-top:18px}#simpay-payment-form-settings .simpay-panel-field .simpay-panel-field__nested label{font-weight:bold;display:block;margin-bottom:4px}#simpay-payment-form-settings .simpay-panel-field .simpay-field-select,#simpay-payment-form-settings .simpay-panel-field .simpay-field-text{min-width:75%;max-width:100%}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-panel-field .simpay-field-select,#simpay-payment-form-settings .simpay-panel-field .simpay-field-text{min-width:0;width:100%}}#simpay-payment-form-settings .simpay-panel-field .simpay-field-textarea{width:100%;max-width:100%}#simpay-payment-form-settings .simpay-panel-field .notice:last-of-type{margin-bottom:0}#simpay-payment-form-settings .simpay-panel-field .error,#simpay-payment-form-settings .simpay-panel-field .simpay-important{color:#a94442;font-weight:normal}#simpay-payment-form-settings .simpay-panel-field .simpay-image-preview-wrap{position:relative;margin-top:12px}#simpay-payment-form-settings .simpay-panel-field .simpay-image-preview-wrap .simpay-remove-image-preview{position:absolute;top:-15px;left:-15px;cursor:pointer;background-color:#fff}#simpay-payment-form-settings .simpay-panel-field .simpay-image-preview-wrap .simpay-remove-image-preview::before{font-size:22px;line-height:26px}#simpay-payment-form-settings .simpay-panel-field .simpay-image-preview-wrap .simpay-image-preview{max-height:128px;max-width:128px;border:1px solid #ddd}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box{background-color:#f4f4f4;border:1px solid #e5e5e5;padding:18px;margin-top:18px;position:relative}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box__dismiss{color:inherit;text-decoration:none;position:absolute;top:8px;right:8px}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box__dismiss .dashicons-dismiss{font-size:16px;width:16px;height:16px}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box h3{font-size:18px;font-weight:600;margin:0;padding:0}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box p{font-size:14px}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box p:last-child{margin-bottom:0}#simpay-payment-form-settings .simpay-metabox-content{margin-bottom:-1px;background-color:#f5f5f5;border:1px solid #c3c4c7;border-width:1px 0;box-shadow:0 1px 1px rgba(0,0,0,.04);position:relative}#simpay-payment-form-settings .simpay-show-if,#simpay-payment-form-settings .simpay-panel-hidden{display:none}#simpay-payment-form-settings .simpay-payment-methods{border:1px solid #ccd0d4;border-radius:4px;box-shadow:0 1px 1px rgba(0,0,0,.04)}#simpay-payment-form-settings .simpay-panel-field-payment-method{display:block;border-top:1px solid #ccd0d4;padding:7px;box-sizing:border-box}#simpay-payment-form-settings .simpay-panel-field-payment-method:first-child{border-top:0;border-top-left-radius:4px;border-top-right-radius:4px}#simpay-payment-form-settings .simpay-panel-field-payment-method__enable{display:flex;align-items:center}#simpay-payment-form-settings .simpay-panel-field-payment-method__enable input[type=checkbox]{margin-top:0;margin-right:8px}#simpay-payment-form-settings .simpay-panel-field-payment-method__help{text-decoration:none}#simpay-payment-form-settings .simpay-panel-field-payment-method__help .dashicons{font-size:18px;width:18px;height:18px}#simpay-payment-form-settings .simpay-panel-field-payment-method__restrictions,#simpay-payment-form-settings .simpay-panel-field-payment-method__restrictions-ach{margin-left:72px}#simpay-payment-form-settings .simpay-panel-field-payment-method__icon{border-radius:3px;overflow:hidden;margin:0 8px 0 5px;width:30px;height:30px;flex-shrink:0}#simpay-payment-form-settings .simpay-panel-field-payment-method__icon svg{width:30px;height:30px}#simpay-payment-form-settings .simpay-panel-field-payment-method__configure{display:flex;align-items:center;justify-content:center}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metaboxes:not(.is-empty),#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metaboxes:not(.is-empty){border:1px solid #ccd0d4;box-shadow:0 1px 1px rgba(0,0,0,.04);border-radius:4px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-handlediv,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-handlediv{display:none;float:right;width:36px;height:36px;margin:0;padding:0;border:0;background:none;cursor:pointer;display:block}#simpay-global-settings .simpay-metaboxes-wrapper .postbox.closed .simpay-handlediv .toggle-indicator:before,#simpay-form-settings .simpay-metaboxes-wrapper .postbox.closed .simpay-handlediv .toggle-indicator:before{content:""}#simpay-global-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv:focus,#simpay-form-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv:focus{outline:0}#simpay-global-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv:focus .toggle-indicator:before,#simpay-form-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv:focus .toggle-indicator:before{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}#simpay-global-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv .toggle-indicator:before,#simpay-form-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv .toggle-indicator:before{margin-top:4px;width:20px;border-radius:50%;text-indent:-1px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox{background:#fff;border:1px solid #ccd0d4;margin:0 -1px -1px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .hndle,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .hndle{border:0}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox select,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox select{font-weight:400}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox:first-of-type,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox:first-of-type{margin-top:-1px;border-top-left-radius:4px;border-top-right-radius:4px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox:last-of-type,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox:last-of-type{margin-bottom:-1px;border-bottom-left-radius:4px;border-bottom-right-radius:4px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox:last-of-type .simpay-metabox-content,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox:last-of-type .simpay-metabox-content{border-bottom-left-radius:4px;border-bottom-right-radius:4px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2{cursor:pointer;display:flex;align-items:center;padding:10px 0 10px 12px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .simpay-field-type,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .simpay-field-type{font-size:90%;color:gray;font-weight:normal;text-decoration:none;margin-left:10px}@media screen and (max-width: 782px){#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .simpay-field-type,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .simpay-field-type{display:none}}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .dashicons-handle,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .dashicons-handle{cursor:move}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 strong,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 strong{font-size:95%;margin-left:8px;display:flex;align-items:center;flex-grow:1}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 svg,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 svg{border-radius:3px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 select,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 select{font-family:sans-serif;max-width:20%;margin:.25em .25em .25em 0}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2.fixed,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2.fixed{cursor:pointer !important}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .dashicons-menu,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .dashicons-menu{cursor:move}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions{padding:9px 18px;justify-content:space-between;display:flex;align-items:center}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id{display:flex;align-items:center}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id input,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id input{margin:0 2px 0 5px;width:50px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id a,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id a{text-decoration:none}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .button-link.simpay-remove-field-link,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .button-link.simpay-remove-field-link{color:#a00}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .button-link.simpay-remove-field-link:hover,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .button-link.simpay-remove-field-link:hover{color:#dc3232}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox table,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox table{border-spacing:0;width:100%}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox table.simpay-inner-table,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox table.simpay-inner-table{border:none;padding:0 1em}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox table tr td,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox table tr td{border-bottom-color:#ccd0d4}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-remove-plan,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-remove-plan{color:#a00}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-custom-field-payment-button .dashicons-menu,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-custom-field-payment-button .dashicons-menu{visibility:hidden}#simpay-global-settings .sortable-placeholder,#simpay-form-settings .sortable-placeholder{margin:5px;display:block;min-height:36px}#simpay-global-settings .chosen-container,#simpay-form-settings .chosen-container{min-width:20em;max-width:30em}#simpay-global-settings .simpay-field.simpay-small-text,#simpay-form-settings .simpay-field.simpay-small-text{width:7em}#simpay-global-settings .simpay-field.simpay-medium-text,#simpay-form-settings .simpay-field.simpay-medium-text{width:15em}#simpay-global-settings .simpay-field-radios ul,#simpay-form-settings .simpay-field-radios ul{margin:0}#simpay-global-settings .simpay-field-radios>i,#simpay-form-settings .simpay-field-radios>i{margin-left:5px;vertical-align:middle}#simpay-global-settings ul.simpay-field-radios-inline,#simpay-form-settings ul.simpay-field-radios-inline{margin:0 0 -10px}#simpay-global-settings ul.simpay-field-radios-inline li,#simpay-form-settings ul.simpay-field-radios-inline li{display:inline-block;margin:0 10px 10px 0}#simpay-global-settings ul.simpay-field-radios-inline li:last-child,#simpay-form-settings ul.simpay-field-radios-inline li:last-child{margin-right:0}#simpay-global-settings .simpay-currency-field,#simpay-form-settings .simpay-currency-field{display:flex;align-items:center}>#simpay-global-settings .simpay-currency-field:focus,>#simpay-form-settings .simpay-currency-field:focus{position:relative;z-index:5}#simpay-global-settings .simpay-currency-symbol,#simpay-form-settings .simpay-currency-symbol{margin:0;padding-left:8px;padding-right:8px;line-height:28px;font-size:14px}@media screen and (max-width: 782px){#simpay-global-settings .simpay-currency-symbol,#simpay-form-settings .simpay-currency-symbol{line-height:38px}}#simpay-global-settings .simpay-currency-symbol-left,#simpay-form-settings .simpay-currency-symbol-left{border-top-left-radius:4px;border-bottom-left-radius:4px}#simpay-global-settings .simpay-currency-symbol-right,#simpay-form-settings .simpay-currency-symbol-right{border-top-right-radius:4px;border-bottom-right-radius:4px}#simpay-global-settings div.simpay-currency-symbol,#simpay-form-settings div.simpay-currency-symbol{border-color:#7e8993;border-style:solid;background-color:#fff}#simpay-global-settings select.simpay-currency-symbol,#simpay-form-settings select.simpay-currency-symbol{padding-right:25px}#simpay-global-settings .simpay-currency-symbol-left,#simpay-form-settings .simpay-currency-symbol-left{border-width:1px 0 1px 1px}#simpay-global-settings .simpay-currency-symbol-left+.simpay-field-amount,#simpay-form-settings .simpay-currency-symbol-left+.simpay-field-amount{border-radius:0 4px 4px 0}#simpay-global-settings .simpay-currency-symbol-right,#simpay-form-settings .simpay-currency-symbol-right{border-width:1px 1px 1px 0}#simpay-global-settings .simpay-field-amount,#simpay-form-settings .simpay-field-amount{margin:0;padding-left:8px;padding-right:8px;font-size:14px;width:6em;position:relative;z-index:2;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px}#simpay-global-settings .simpay-error,#simpay-form-settings .simpay-error{color:red}#simpay-global-settings .simpay-docs-link-wrap,#simpay-form-settings .simpay-docs-link-wrap{position:absolute;right:0;bottom:0;color:#666;font-size:13px;font-style:italic;padding:15px 18px}#simpay-global-settings .simpay-docs-link-wrap a .dashicons-editor-help,#simpay-form-settings .simpay-docs-link-wrap a .dashicons-editor-help{color:#666;text-decoration:none;width:17px;height:17px;font-size:17px;padding-left:4px}#simpay-global-settings .simpay-docs-icon,#simpay-form-settings .simpay-docs-icon{color:#666}#simpay-global-settings .simpay-docs-icon,#simpay-global-settings .simpay-docs-icon .dashicons-editor-help,#simpay-form-settings .simpay-docs-icon,#simpay-form-settings .simpay-docs-icon .dashicons-editor-help{text-decoration:none;width:17px;height:17px;font-size:17px}.button.button-primary.simpay-upgrade-btn{background-color:#428bca;border:1px solid #428bca;color:#fff;display:inline-block}.button.button-primary.simpay-upgrade-btn:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px #2d6ca2}.button.button-primary.simpay-upgrade-btn:hover{background-color:#037ad0;border:1px solid #428bca}.simpay-upgrade-btn-subtext{color:#3c434a;font-size:14px;line-height:1.5;text-align:center;margin:40px 0 0;padding:30px 35px 20px;background-color:#fcf9e8;border:3px solid #ebe29a;border-radius:4px;position:relative}.simpay-upgrade-btn-subtext svg{background:#00a32a;fill:#fff;border-radius:50%;border:3px solid #ebe29a;width:28px;height:28px;position:absolute;top:-14px;left:50%;margin-left:-14px}.simpay-upgrade-btn-subtext u{text-decoration:none;font-weight:bold;color:#00a32a}.simpay-upgrade-btn-subtext a{text-decoration:none;display:block;margin-top:6px;font-weight:bold}.post-type-simple-pay #post-body-content{display:none}.simpay-card{margin:0 0 20px;padding:30px;background:#fff;border:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04)}.simpay-card,.simpay-card p{line-height:1.5;font-size:16px}.simpay-card h3{line-height:1.6;font-size:18px;margin:0 0 20px;color:#23282c}.simpay-card p{margin:0 0 20px}.simpay-card p:last-child,.simpay-card ul:last-child{margin-bottom:0}.simpay-card figure{float:right;margin:0 0 30px 30px;max-width:400px}.simpay-card figure iframe,.simpay-card figure img{max-width:100%}.simpay-card figure figcaption{text-align:center}@media screen and (max-width: 782px){.simpay-card figure{margin:0 0 30px;max-width:100%;float:none}}.simpay-doc-suggestions{width:100%;display:flex;flex-wrap:wrap;padding:0}.simpay-doc-suggestion{text-align:center;display:flex;flex-direction:column;justify-content:center;align-items:center;flex:0 1 33.333%;padding:30px;border-right:1px solid #c3c4c7;box-sizing:border-box}.simpay-doc-suggestion:nth-child(3n){border-right:0}@media screen and (max-width: 782px){.simpay-doc-suggestion{flex:0 1 100%;border-bottom:1px solid #c3c4c7;border-right:0}.simpay-doc-suggestion:last-child{border-bottom:0}}.simpay-doc-suggestion h3{font-size:20px;margin-bottom:10px}.simpay-doc-suggestion p{font-size:15px}.simpay-doc-suggestion .dashicons{font-size:40px;width:40px;height:40px;display:block;margin-bottom:10px}.simpay-doc-suggestion .button-large{font-size:16px}.simpay-addons{display:flex;flex-wrap:wrap;justify-content:space-between;margin:20px 0}.simpay-addon{background:#fff;border:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04);margin-bottom:20px;display:flex;flex-direction:column;flex-basis:calc(33% - 10px);box-sizing:border-box}@media screen and (max-width: 782px){.simpay-addon{flex-basis:100%}}.simpay-addon img{float:left;max-width:75px}.simpay-addon h5{margin:0 0 10px 100px;font-size:16px}.simpay-addon__details{padding:20px;flex:1 0 auto}.simpay-addon__actions{display:flex;align-items:center;justify-content:space-between;flex:0 1 auto;background-color:#f7f7f7;border-top:1px solid #ddd;margin-top:auto;padding:20px;position:relative}.simpay-addon__actions .msg{text-align:center;justify-content:center;display:flex;align-items:center;position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;background-color:#f7f7f7;z-index:3}.simpay-addon .error,.simpay-addon .status-label.status-installed{color:#d63638}.simpay-addon .success,.simpay-addon .status-label.status-active{color:#00a32a}.simpay-addon .addon-desc{margin:0 0 0 100px}.form-table td .simpay-stripe-connect-help{margin:15px 0;display:flex;align-items:center}.form-table td .simpay-stripe-connect-help .dashicons{margin-right:4px}.simpay-currency-field{display:flex;align-items:center}>.simpay-currency-field:focus{position:relative;z-index:5}.simpay-currency-symbol{margin:0;padding-left:8px;padding-right:8px;line-height:28px;font-size:14px}@media screen and (max-width: 782px){.simpay-currency-symbol{line-height:38px}}.simpay-currency-symbol-left{border-top-left-radius:4px;border-bottom-left-radius:4px}.simpay-currency-symbol-right{border-top-right-radius:4px;border-bottom-right-radius:4px}div.simpay-currency-symbol{border-color:#7e8993;border-style:solid;background-color:#fff}select.simpay-currency-symbol{padding-right:25px}.simpay-currency-symbol-left{border-width:1px 0 1px 1px}.simpay-currency-symbol-left+.simpay-field-amount{border-radius:0 4px 4px 0}.simpay-currency-symbol-right{border-width:1px 1px 1px 0}.simpay-field-amount{margin:0;padding-left:8px;padding-right:8px;font-size:14px;width:6em;position:relative;z-index:2;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px}.simpay-template-explorer-open .show-settings{display:none !important}.simpay-branding-bar{margin:0 -20px;padding:14px 22px;background:#fff;border-bottom:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04);width:calc(100% + 20px);display:flex;justify-content:space-between;box-sizing:border-box}.site-health .simpay-branding-bar{display:none}.simpay-branding-bar__title{display:flex;align-items:center;margin:8px 0}.simpay-branding-bar__logo{width:200px}.simpay-branding-bar__divider{color:#dadbdf;font-size:23px;font-weight:400;margin:0 15px}.simpay-branding-bar__actions{display:flex;align-items:center}.simpay-branding-bar__actions>div{margin-left:10px;min-width:40px}.simpay-branding-bar__actions-button{color:#000;cursor:pointer;padding:10px;width:40px;height:40px;background-color:#f3f4f5;border-radius:50%;border:0;box-shadow:none;position:relative;transition:background-color .2s ease;box-sizing:border-box;display:block}.simpay-branding-bar__actions-button:hover{background-color:#e5e5e5}.simpay-branding-bar__actions-button:active,.simpay-branding-bar__actions-button:focus{box-shadow:0 0 0 2px var(--wp-admin-theme-color)}.simpay-branding-bar__actions-button-count{font-weight:600;font-size:10px;line-height:16px;color:#fff;margin:0;background-color:#df2a4a;border-radius:100%;width:16px;height:16px;position:absolute;top:-8px;left:50%;margin-left:-8px}.simpay-branding-bar .wp-heading-inline{font-size:23px;font-weight:400;margin:0}.simpay-branding-bar .page-title-action{font-weight:600;font-size:13px;line-height:normal;cursor:pointer;text-shadow:none;text-decoration:none;margin-left:10px;padding:4px 8px;border:1px solid currentColor;border-radius:2px;background:#f6f7f7}.simpay-landing-zone{text-align:center;max-width:700px;margin:40px auto}.simpay-landing-zone__title{font-size:26px;font-weight:600;margin:0 0 1.5rem;padding:0}.simpay-landing-zone__subtitle{font-size:17px;color:#666;margin:.25rem 0}.simpay-landing-zone__subtitle strong{color:#444}.simpay-landing-zone section{margin:2rem 0}.simpay-landing-zone__empty-state-graphic img{width:425px}.simpay-landing-zone__screenshot>*{vertical-align:middle}.simpay-landing-zone__screenshot-img{display:inline-block;position:relative;width:315px;padding:5px;background-color:#fff;box-shadow:0px 2px 5px 0px rgba(0,0,0,.05);border-radius:3px}.simpay-landing-zone__screenshot-img img{max-width:100%;display:block}.simpay-landing-zone__screenshot-img .hover{position:absolute;opacity:0;height:calc(100% - 10px);width:calc(100% - 10px);top:0;left:0;border:5px solid #fff;background-color:rgba(0,0,0,.15);background-image:url(data:image/svg+xml;base64,PHN2ZyBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjojZmZmZmZmMDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCIgaGVpZ2h0PSIxMDAiPjxwYXRoIGQ9Ik01MCAwYzI3LjYxNCAwIDUwIDIyLjM4NiA1MCA1MHMtMjIuMzg2IDUwLTUwIDUwUzAgNzcuNjE0IDAgNTAgMjIuMzg2IDAgNTAgMHoiIGZpbGw9IiMxNjg1YjciLz48cGF0aCBkPSJNNzMuMDIzIDY3LjA2N2wtOS4zNDQtOS4zNDRhMi4yNDcgMi4yNDcgMCAwMC0xLjU5My0uNjU2aC0xLjUyOGExOS4zOTkgMTkuMzk5IDAgMDA0LjEyNC0xMS45OTZjMC0xMC43Ny04LjcyNS0xOS40OTUtMTkuNDk0LTE5LjQ5NS0xMC43NjggMC0xOS40OTQgOC43MjYtMTkuNDk0IDE5LjQ5NSAwIDEwLjc2OCA4LjcyNiAxOS40OTMgMTkuNDk0IDE5LjQ5M2ExOS40IDE5LjQgMCAwMDExLjk5Ny00LjEyM3YxLjUyN2MwIC42LjIzNCAxLjE3Mi42NTUgMS41OTRsOS4zNDQgOS4zNDRhMi4yNCAyLjI0IDAgMDAzLjE3OCAwbDIuNjUyLTIuNjUzYTIuMjYgMi4yNiAwIDAwLjAxLTMuMTg2em0tMjcuODM1LTEwYy02LjYyNiAwLTExLjk5Ni01LjM2MS0xMS45OTYtMTEuOTk2IDAtNi42MjcgNS4zNi0xMS45OTcgMTEuOTk2LTExLjk5NyA2LjYyNiAwIDExLjk5NyA1LjM2MSAxMS45OTcgMTEuOTk3IDAgNi42MjYtNS4zNjEgMTEuOTk2LTExLjk5NyAxMS45OTZ6IiBmaWxsPSIjZmZmIi8+PC9zdmc+);background-repeat:no-repeat;background-position:center;background-size:50px;transition:all .3s}.simpay-landing-zone__screenshot-img:hover .hover{opacity:1;transition:all .3s}.simpay-landing-zone__screenshot ul{text-align:left;display:inline-block;margin:0 0 0 30px;list-style-type:none;max-width:calc(100% - 350px)}@media screen and (max-width: 782px){.simpay-landing-zone__screenshot ul{text-align:center;margin:30px auto;max-width:100%;display:block}}.simpay-landing-zone__screenshot li{margin:16px 0;padding:0;font-size:15px;color:#777;position:relative}.simpay-landing-zone__screenshot li:before{content:"";background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGQ9Ik0xMy43NzYyIDYuNDU2MDVMOC43MjAzMiAxLjQwMDA1QzguNTc1OTkgMS4yNTU3MiA4LjM4MzY0IDEuMTc2NSA4LjE3ODUzIDEuMTc2NUM3Ljk3MzIgMS4xNzY1IDcuNzgwOTYgMS4yNTU4NCA3LjYzNjY0IDEuNDAwMDVMNy4xNzc2IDEuODU5MkM3LjAzMzM5IDIuMDAzMjkgNi45NTM5NSAyLjE5NTc2IDYuOTUzOTUgMi40MDA5OEM2Ljk1Mzk1IDIuNjA2MDggNy4wMzMzOSAyLjgwNTA0IDcuMTc3NiAyLjk0OTE0TDEwLjEyNzEgNS45MDUxNkgwLjc1NjMzNEMwLjMzMzgzNCA1LjkwNTE2IDAgNi4yMzU5MiAwIDYuNjU4NTRWNy4zMDc2NUMwIDcuNzMwMjcgMC4zMzM4MzQgOC4wOTQzOCAwLjc1NjMzNCA4LjA5NDM4SDEwLjE2MDZMNy4xNzc3MiAxMS4wNjY5QzcuMDMzNTEgMTEuMjExMiA2Ljk1NDA2IDExLjM5ODUgNi45NTQwNiAxMS42MDM3QzYuOTU0MDYgMTEuODA4NyA3LjAzMzUxIDExLjk5ODYgNy4xNzc3MiAxMi4xNDI4TDcuNjM2NzUgMTIuNjAwNUM3Ljc4MTA3IDEyLjc0NDggNy45NzMzMiAxMi44MjM1IDguMTc4NjUgMTIuODIzNUM4LjM4Mzc1IDEyLjgyMzUgOC41NzYxMSAxMi43NDM4IDguNzIwNDMgMTIuNTk5NUwxMy43NzYzIDcuNTQzNkMxMy45MjEgNy4zOTg4MiAxNC4wMDA1IDcuMjA1NTYgMTQgNy4wMDAxMUMxNC4wMDA0IDYuNzkzOTggMTMuOTIxIDYuNjAwNiAxMy43NzYyIDYuNDU2MDVWNi40NTYwNVoiIGZpbGw9IiM0MjhCQ0EiLz4NCjwvc3ZnPg0K);background-position:center;background-repeat:no-repeat;background-size:14px;width:14px;height:14px;display:inline-block;margin:-3px 5px 0 0;vertical-align:middle}.simpay-landing-zone .button.button-large{font-size:17px;line-height:30px;padding:10px 20px}.simpay-landing-zone__purchased{display:block;margin:15px 0 0}.simpay-upgrade-modal,.simpay-upgrade-upe-modal{padding:0 !important}.simpay-upgrade-modal *,.simpay-upgrade-upe-modal *{box-sizing:border-box}.simpay-upgrade-modal__content,.simpay-upgrade-upe-modal__content{text-align:center;display:flex;flex-direction:column;align-items:center;padding:16px 32px 32px}.simpay-upgrade-modal__content>.dashicons,.simpay-upgrade-upe-modal__content>.dashicons{color:#333;font-size:48px;width:48px;height:48px}.simpay-upgrade-modal__title,.simpay-upgrade-upe-modal__title{font-size:22px;line-height:1.5;display:block;margin:12px 0 0}.simpay-upgrade-modal__description,.simpay-upgrade-upe-modal__description{color:#777;font-size:16px;margin:16px 0 24px}.simpay-upgrade-modal__description strong,.simpay-upgrade-upe-modal__description strong{color:#333}.simpay-upgrade-modal__discount,.simpay-upgrade-upe-modal__discount{font-size:15px;text-align:center;margin:32px -32px -32px;padding:24px 40px;background-color:#fcf9e8;position:relative}.simpay-upgrade-modal__discount svg,.simpay-upgrade-upe-modal__discount svg{background:#00a32a;fill:#fff;border-radius:50%;border:4px solid #fff;width:32px;height:32px;position:absolute;top:-16px;left:50%;margin-left:-16px}.simpay-upgrade-modal__discount u,.simpay-upgrade-upe-modal__discount u{text-decoration:none;font-weight:bold;color:#00a32a}.simpay-upgrade-modal .button-large,.simpay-upgrade-upe-modal .button-large{font-size:16px;font-weight:bold;margin:0 0 15px;padding:8px 30px !important;height:auto}.simpay-teaser-float{margin:50px;position:relative}.simpay-teaser-float__card{text-align:center;padding:30px;background:#fff;border-radius:4px;box-shadow:0 0 30px 15px rgba(0,0,0,.18);position:relative;z-index:2}#poststuff .simpay-teaser-float h2,.simpay-teaser-float h2{font-size:24px;font-weight:600;margin:0;padding:0}.simpay-teaser-float p{font-size:15px;line-height:1.35;color:#666}.simpay-teaser-float p strong{color:#444}.simpay-teaser-float ul{text-align:left;display:inline-block;margin:-10px 0 20px;list-style-type:none}.simpay-teaser-float li{margin:16px 0;padding:0 0 0 24px;font-size:15px;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGQ9Ik0xMy43NzYyIDYuNDU2MDVMOC43MjAzMiAxLjQwMDA1QzguNTc1OTkgMS4yNTU3MiA4LjM4MzY0IDEuMTc2NSA4LjE3ODUzIDEuMTc2NUM3Ljk3MzIgMS4xNzY1IDcuNzgwOTYgMS4yNTU4NCA3LjYzNjY0IDEuNDAwMDVMNy4xNzc2IDEuODU5MkM3LjAzMzM5IDIuMDAzMjkgNi45NTM5NSAyLjE5NTc2IDYuOTUzOTUgMi40MDA5OEM2Ljk1Mzk1IDIuNjA2MDggNy4wMzMzOSAyLjgwNTA0IDcuMTc3NiAyLjk0OTE0TDEwLjEyNzEgNS45MDUxNkgwLjc1NjMzNEMwLjMzMzgzNCA1LjkwNTE2IDAgNi4yMzU5MiAwIDYuNjU4NTRWNy4zMDc2NUMwIDcuNzMwMjcgMC4zMzM4MzQgOC4wOTQzOCAwLjc1NjMzNCA4LjA5NDM4SDEwLjE2MDZMNy4xNzc3MiAxMS4wNjY5QzcuMDMzNTEgMTEuMjExMiA2Ljk1NDA2IDExLjM5ODUgNi45NTQwNiAxMS42MDM3QzYuOTU0MDYgMTEuODA4NyA3LjAzMzUxIDExLjk5ODYgNy4xNzc3MiAxMi4xNDI4TDcuNjM2NzUgMTIuNjAwNUM3Ljc4MTA3IDEyLjc0NDggNy45NzMzMiAxMi44MjM1IDguMTc4NjUgMTIuODIzNUM4LjM4Mzc1IDEyLjgyMzUgOC41NzYxMSAxMi43NDM4IDguNzIwNDMgMTIuNTk5NUwxMy43NzYzIDcuNTQzNkMxMy45MjEgNy4zOTg4MiAxNC4wMDA1IDcuMjA1NTYgMTQgNy4wMDAxMUMxNC4wMDA0IDYuNzkzOTggMTMuOTIxIDYuNjAwNiAxMy43NzYyIDYuNDU2MDVWNi40NTYwNVoiIGZpbGw9IiM0MjhCQ0EiLz4NCjwvc3ZnPg0K);background-position:left 3px;background-repeat:no-repeat;background-size:14px;color:#777}.simpay-teaser-float .button.button-large{font-size:17px;line-height:30px;padding:10px 20px}.simpay-teaser-float .simpay-notice-dismiss{position:absolute;top:0;right:0;font-size:20px;color:#666;font-weight:bold;text-decoration:none;margin-left:5px;padding:6px 10px;z-index:2}.simpay-teaser-float .simpay-notice-dismiss:hover,.simpay-teaser-float .simpay-notice-dismiss:active,.simpay-teaser-float .simpay-notice-dismiss:focus{color:#666;text-decoration:none}.simpay-teaser-float:after,.simpay-teaser-float:before{opacity:.75;z-index:0;content:"";position:absolute;left:-30px;right:-30px;top:-35px;width:calc(100% + 60px);height:170px;background-image:linear-gradient(#ddd, #ddd),linear-gradient(#eee, #eee),linear-gradient(#ddd, #ddd),linear-gradient(#eee, #eee);background-repeat:no-repeat;background-size:100% 20px,100% 40px,100% 20px,100% 40px;background-position:0 0,0 30px,0 100px,0 130px}.simpay-teaser-float:before{top:170px}.simpay-teaser-float .simpay-upgrade-btn-subtext{margin:24px -30px -30px;padding:32px 40px;border-bottom-left-radius:2px;border-bottom-right-radius:2px;border:0}.simpay-teaser-float .simpay-upgrade-btn-subtext svg{border-color:#fff}.simpay-teaser-float--inline{margin:40px 30px 30px}.simpay-teaser-float--inline .simpay-teaser-float__card{padding:30px;box-shadow:0 0 12px 6px rgba(0,0,0,.16)}#poststuff .simpay-teaser-float--inline h2,.simpay-teaser-float--inline h2{font-size:20px}.simpay-teaser-float--inline p{font-size:15px;margin:.75rem 0}.simpay-teaser-float--inline .button.button-large{font-size:15px;line-height:24px;margin:1rem 0;padding:8px 14px;display:inline-block}.simpay-teaser-float--inline:before,.simpay-teaser-float--inline:after{opacity:.6}.simpay-teaser-float--inline:before{display:none}.simpay-teaser-float--inline:after{top:15px}.simpay-form-settings-notice{font-weight:normal;color:#1d2327;position:relative;margin:18px 18px 0;padding:14px;border-radius:4px;background:#f5f5ff}.simpay-form-settings-notice a{color:#635aff}.simpay-form-settings-notice .simpay-external-link .dashicons-external{margin:1px 0 0 2px}.simpay-form-settings-notice strong{font-size:14px}.simpay-form-settings-notice p{margin:5px 0 0 23px}.simpay-form-settings-notice .simpay-notice-dismiss{font-size:20px;color:#b0b0f0;font-weight:bold;line-height:1;position:absolute;top:0;right:5px;text-decoration:none;padding:0 5px;z-index:2}.simpay-form-settings-notice .simpay-notice-dismiss:hover,.simpay-form-settings-notice .simpay-notice-dismiss:active,.simpay-form-settings-notice .simpay-notice-dismiss:focus{color:#9191ef;text-decoration:none;background:none}.simpay-settings .simpay-form-settings-notice{border:2px solid #645aff;box-shadow:0 1px 1px rgba(0,0,0,.04)}.post-type-simple-pay .lity{z-index:999999999;padding:20px}.post-type-simple-pay .lity-close{margin:10px}.post-type-simple-pay .lity-content{max-width:80vw;max-height:80vh}.post-type-simple-pay .lity-content img{max-height:80vh !important;max-width:80vw !important}#wpsp-api-keys-row-hide{display:none}.post-type-simple-pay #post-preview:not(.simpay-preview-button){display:none}.simpay-license-field-wrapper{margin:20px 0}#simpay-settings-license-key-license-key{margin:0}#simpay-settings-license-key-license-key[readonly]{background:#fff}.simpay-license-message__loading,.simpay-license-field{display:flex;align-items:center}.wp-core-ui .button.simpay-license-button.button-primary,.wp-core-ui .button.simpay-license-button.button-secondary{font-size:1rem;line-height:1;margin:0 8px;padding:13px}.simpay-license-message{font-size:15px;margin-top:8px}.simpay-license-message--valid{color:#15803d}.simpay-license-message--invalid{color:#b91c1c}.simpay-recaptcha-payment-form-feedback .dashicons{margin-top:-1px;display:inline-block}.simpay-recaptcha-payment-form-feedback .dashicons-update-alt{animation:rotation 2s infinite linear}.simpay-form-builder-inset-settings{margin:3px 0 0 24px}fieldset.simpay-form-builder-inset-settings>*:not(legend){margin:5px 0 8px}.simpay-form-builder-inset-settings>*:last-child{margin-bottom:0}.simpay-form-builder-inventory-control{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;padding:6px 8px;box-shadow:0 0 0 rgba(0,0,0,0);transition:box-shadow .1s linear;border-radius:2px;border:1px solid #757575;font-size:16px;line-height:normal;margin:0;padding:0;width:auto;display:inline-flex;align-items:center}@media(prefers-reduced-motion: reduce){.simpay-form-builder-inventory-control{transition-duration:0s;transition-delay:0s}}@media(min-width: 600px){.simpay-form-builder-inventory-control{font-size:13px;line-height:normal}}.simpay-form-builder-inventory-control:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid rgba(0,0,0,0)}.simpay-form-builder-inventory-control::-webkit-input-placeholder{color:rgba(30,30,30,.62)}.simpay-form-builder-inventory-control::-moz-placeholder{opacity:1;color:rgba(30,30,30,.62)}.simpay-form-builder-inventory-control:-ms-input-placeholder{color:rgba(30,30,30,.62)}.simpay-form-builder-inventory-control:focus-within{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid rgba(0,0,0,0)}.simpay-form-builder-inventory-control input[type=number]{border:0;box-shadow:none;background:none;border-radius:0;width:75px}.simpay-form-builder-inventory-control input[type=number]:focus{border:0;box-shadow:none;outline:0}.simpay-form-builder-inventory-control+label{margin-left:8px}.simpay-form-builder-inventory-control__initial{color:#757575;font-size:16px;line-height:normal;padding-right:8px}@media(min-width: 600px){.simpay-form-builder-inventory-control__initial{font-size:13px;line-height:normal}}.simpay-form-builder-inventory-control__initial:before{content:"/";display:inline-block;vertical-align:top;margin-top:-1px}.simpay-form-builder-purchase-restrictions__restriction-item{display:flex;align-items:center;margin-top:8px;margin-bottom:8px}.simpay-form-builder-purchase-restrictions__restriction-item label{margin-left:8px}.simpay-form-builder-purchase-restrictions__restriction-item-datetime{display:flex;align-items:center}.simpay-form-builder-purchase-restrictions__restriction-item-datetime>*{margin-right:10px}.simpay-form-builder-purchase-restrictions__restriction-item-datetime span{color:#757575}.simpay-form-builder-fee-recovery__amounts{display:flex;align-items:center;margin-top:5px}.simpay-form-builder-fee-recovery ::-webkit-input-placeholder{color:#b7bec7}.simpay-form-builder-fee-recovery ::-moz-placeholder{color:#b7bec7;opacity:1}.simpay-form-builder-fee-recovery :-ms-input-placeholder{color:#b7bec7}.simpay-form-builder-fee-recovery>*{margin-right:8px}.simpay-form-builder-fee-percent-control{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;padding:6px 8px;box-shadow:0 0 0 rgba(0,0,0,0);transition:box-shadow .1s linear;border-radius:2px;border:1px solid #757575;font-size:16px;line-height:normal;margin:0;padding:0;width:auto;display:inline-flex;align-items:center}@media(prefers-reduced-motion: reduce){.simpay-form-builder-fee-percent-control{transition-duration:0s;transition-delay:0s}}@media(min-width: 600px){.simpay-form-builder-fee-percent-control{font-size:13px;line-height:normal}}.simpay-form-builder-fee-percent-control:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid rgba(0,0,0,0)}.simpay-form-builder-fee-percent-control::-webkit-input-placeholder{color:rgba(30,30,30,.62)}.simpay-form-builder-fee-percent-control::-moz-placeholder{opacity:1;color:rgba(30,30,30,.62)}.simpay-form-builder-fee-percent-control:-ms-input-placeholder{color:rgba(30,30,30,.62)}.simpay-form-builder-fee-percent-control:focus-within{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid rgba(0,0,0,0)}.simpay-form-builder-fee-percent-control input[type=number]{border:0;box-shadow:none;background:none;border-radius:0;width:75px}.simpay-form-builder-fee-percent-control input[type=number]:focus{border:0;box-shadow:none;outline:0}.simpay-form-builder-fee-percent-control+label{margin-left:8px}.simpay-form-builder-fee-percent-control__suffix{color:#757575;font-size:16px;line-height:normal;padding-right:8px}@media(min-width: 600px){.simpay-form-builder-fee-percent-control__suffix{font-size:13px;line-height:normal}}.simpay-form-builder-automations__cta{margin:24px 0 6px;text-align:center}.simpay-form-builder-automator{padding:16px 4px 26px !important}.simpay-form-builder-automator,.simpay-form-builder-automator *{box-sizing:border-box}.simpay-form-builder-automator input[type=search]{font-size:15px;padding:2px 8px}.simpay-form-builder-automator__integrations{display:grid;grid-template-columns:repeat(4, minmax(0, 1fr));grid-column-gap:16px;grid-row-gap:16px;margin:18px -18px 0;padding:0 18px 10px;width:calc(100% + 36px);max-height:400px;overflow-y:scroll}.simpay-form-builder-automator__integrations-integration{color:initial;text-align:center;text-decoration:none;background:#fff;border:1px solid #eee;border-radius:4px;box-shadow:0 1px 3px 0 rgba(0,0,0,.03);transition:all ease-in .15s}.simpay-form-builder-automator__integrations-integration img{display:block;margin:16px auto;height:50px}.simpay-form-builder-automator__integrations-integration span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:8px 16px;display:block;border-top:1px solid #eee}.simpay-form-builder-automator__integrations-integration:hover{cursor:pointer;border-color:#ddd;box-shadow:0 2px 4px 0 rgba(0,0,0,.06)}body.site-health #wpbody-content,body.post-type-simple-pay #wpbody-content{padding-bottom:200px}#wpfooter .simpay-footer-promotion{text-align:center;font-weight:400;font-size:13px;line-height:16px;color:#787c82;padding:20px 0 30px 0;margin-bottom:20px}#wpfooter .simpay-footer-promotion p{font-weight:600}#wpfooter .simpay-footer-promotion-links,#wpfooter .simpay-footer-promotion-social{display:flex;justify-content:center;align-items:center}#wpfooter .simpay-footer-promotion-links{margin:9px 0 0}#wpfooter .simpay-footer-promotion-links span{color:#c3c4c7;padding:0 7px}#wpfooter .simpay-footer-promotion-social{margin:10px 0 0 0;gap:10px}#wpfooter .simpay-footer-promotion-social li{margin-bottom:0}#wpfooter .simpay-footer-promotion-social li:hover path{fill:#50575e}#wpfooter .simpay-footer-promotion-social a{display:block;height:16px}.simpay-settings-is_upe td{background:#fff;border:1px solid #c3c4c7;border-left-width:4px;border-left-color:#2271b1;box-shadow:0 1px 1px rgba(0,0,0,.04);padding:12px 18px} diff --git a/includes/core/assets/js/dist/simpay-admin-dashboard-widget-report.asset.php b/includes/core/assets/js/dist/simpay-admin-dashboard-widget-report.asset.php index 6e941e93..9d17f391 100644 --- a/includes/core/assets/js/dist/simpay-admin-dashboard-widget-report.asset.php +++ b/includes/core/assets/js/dist/simpay-admin-dashboard-widget-report.asset.php @@ -1 +1 @@ - array('lodash', 'react', 'wp-api-fetch', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => '45676981d2cb1015b0e201bc2fd50dc7'); \ No newline at end of file + array('lodash', 'react', 'wp-api-fetch', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => 'f514bdccae609dacea820edddfa0180d'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-form-template-explorer.asset.php b/includes/core/assets/js/dist/simpay-admin-form-template-explorer.asset.php index c8473798..4a372b96 100644 --- a/includes/core/assets/js/dist/simpay-admin-form-template-explorer.asset.php +++ b/includes/core/assets/js/dist/simpay-admin-form-template-explorer.asset.php @@ -1 +1 @@ - array('lodash', 'wp-a11y', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => 'd317b524f24f6ec8bc0334b96339c4fe'); \ No newline at end of file + array('lodash', 'wp-a11y', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => 'add823490f99b1581a187fb38a6e7774'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-help.asset.php b/includes/core/assets/js/dist/simpay-admin-help.asset.php index dac4e37b..c98f974a 100644 --- a/includes/core/assets/js/dist/simpay-admin-help.asset.php +++ b/includes/core/assets/js/dist/simpay-admin-help.asset.php @@ -1 +1 @@ - array('lodash', 'wp-a11y', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-keycodes', 'wp-primitives', 'wp-url'), 'version' => '2582dbcfcda65c13b2fd8474ce3c3a1b'); \ No newline at end of file + array('lodash', 'wp-a11y', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-keycodes', 'wp-primitives', 'wp-url'), 'version' => '9e27307fcbc57bdefdd2b401ec9fa40b'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-notifications.asset.php b/includes/core/assets/js/dist/simpay-admin-notifications.asset.php index 486e7367..c4d18091 100644 --- a/includes/core/assets/js/dist/simpay-admin-notifications.asset.php +++ b/includes/core/assets/js/dist/simpay-admin-notifications.asset.php @@ -1 +1 @@ - array('lodash', 'moment', 'react', 'react-dom', 'wp-api-fetch', 'wp-autop', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '1ed40b7b0e41fd10aa673cfdd11b6a5a'); \ No newline at end of file + array('lodash', 'moment', 'react', 'react-dom', 'wp-api-fetch', 'wp-autop', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => 'cdcd4da1e020aec5e51d9de7811f6fdd'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-page-activity-reports.asset.php b/includes/core/assets/js/dist/simpay-admin-page-activity-reports.asset.php index 3e8865cd..6b760685 100644 --- a/includes/core/assets/js/dist/simpay-admin-page-activity-reports.asset.php +++ b/includes/core/assets/js/dist/simpay-admin-page-activity-reports.asset.php @@ -1 +1 @@ - array('lodash', 'react', 'wp-api-fetch', 'wp-components', 'wp-core-data', 'wp-data', 'wp-date', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => '5add37d82a4d7a26743dc6a03948d095'); \ No newline at end of file + array('lodash', 'react', 'wp-api-fetch', 'wp-components', 'wp-core-data', 'wp-data', 'wp-date', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => 'ad02552a44b26c92e9cfba7c85c340fc'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-page-setup-wizard.asset.php b/includes/core/assets/js/dist/simpay-admin-page-setup-wizard.asset.php index 49ec2325..c9a7fad6 100644 --- a/includes/core/assets/js/dist/simpay-admin-page-setup-wizard.asset.php +++ b/includes/core/assets/js/dist/simpay-admin-page-setup-wizard.asset.php @@ -1 +1 @@ - array('lodash', 'react', 'wp-api-fetch', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-primitives', 'wp-url'), 'version' => '21c6959b11500cc7331462593884c2a7'); \ No newline at end of file + array('lodash', 'react', 'wp-api-fetch', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-primitives', 'wp-url'), 'version' => '460aeaabd1d5ec4ac3dfda45048d8c3b'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-block-button.asset.php b/includes/core/assets/js/dist/simpay-block-button.asset.php index e0534b9e..79fda27f 100644 --- a/includes/core/assets/js/dist/simpay-block-button.asset.php +++ b/includes/core/assets/js/dist/simpay-block-button.asset.php @@ -1 +1 @@ - array('wp-block-editor', 'wp-components', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-primitives'), 'version' => 'dda6568c499f1c76658381fc4c6c324c'); \ No newline at end of file + array('wp-block-editor', 'wp-components', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-primitives'), 'version' => 'b18683d83e7524462f85ba4914d1391f'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-block-payment-form.asset.php b/includes/core/assets/js/dist/simpay-block-payment-form.asset.php index 4980812c..3a808135 100644 --- a/includes/core/assets/js/dist/simpay-block-payment-form.asset.php +++ b/includes/core/assets/js/dist/simpay-block-payment-form.asset.php @@ -1 +1 @@ - array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-server-side-render'), 'version' => '8b9e84675cdf249f06a70f5e13506ecc'); \ No newline at end of file + array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-server-side-render'), 'version' => 'f4d7ea43f1839a3ab7a2f8eb25fc66bb'); \ No newline at end of file diff --git a/languages/stripe.pot b/languages/stripe.pot index 9c640f32..d56c5adb 100644 --- a/languages/stripe.pot +++ b/languages/stripe.pot @@ -2,14 +2,14 @@ # This file is distributed under the same license as the WP Simple Pay Lite plugin. msgid "" msgstr "" -"Project-Id-Version: WP Simple Pay Lite 4.9.0\n" +"Project-Id-Version: WP Simple Pay Lite 4.10.0-beta-2\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-simple-pay-lite\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2024-05-02T15:27:06+00:00\n" +"POT-Creation-Date: 2024-05-03T12:05:38+00:00\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "X-Generator: WP-CLI 2.9.0\n" "X-Domain: stripe\n" diff --git a/lib/Symfony/Component/CssSelector/CHANGELOG.md b/lib/Symfony/Component/CssSelector/CHANGELOG.md index 4061ff20..de81fa2e 100644 --- a/lib/Symfony/Component/CssSelector/CHANGELOG.md +++ b/lib/Symfony/Component/CssSelector/CHANGELOG.md @@ -1,6 +1,11 @@ CHANGELOG ========= +4.4.0 +----- + + * Added support for `*:only-of-type` + 2.8.0 ----- diff --git a/lib/Symfony/Component/CssSelector/CssSelectorConverter.php b/lib/Symfony/Component/CssSelector/CssSelectorConverter.php index ffd641e8..3a62cc43 100644 --- a/lib/Symfony/Component/CssSelector/CssSelectorConverter.php +++ b/lib/Symfony/Component/CssSelector/CssSelectorConverter.php @@ -27,16 +27,23 @@ class CssSelectorConverter { private $translator; + private $cache; + + private static $xmlCache = []; + private static $htmlCache = []; /** * @param bool $html Whether HTML support should be enabled. Disable it for XML documents */ - public function __construct($html = true) + public function __construct(bool $html = true) { $this->translator = new Translator(); if ($html) { $this->translator->registerExtension(new HtmlExtension($this->translator)); + $this->cache = &self::$htmlCache; + } else { + $this->cache = &self::$xmlCache; } $this->translator @@ -53,13 +60,10 @@ public function __construct($html = true) * Optionally, a prefix can be added to the resulting XPath * expression with the $prefix parameter. * - * @param string $cssExpr The CSS expression - * @param string $prefix An optional prefix for the XPath expression - * * @return string */ - public function toXPath($cssExpr, $prefix = 'descendant-or-self::') + public function toXPath(string $cssExpr, string $prefix = 'descendant-or-self::') { - return $this->translator->cssToXPath($cssExpr, $prefix); + return $this->cache[$prefix][$cssExpr] ?? $this->cache[$prefix][$cssExpr] = $this->translator->cssToXPath($cssExpr, $prefix); } } diff --git a/lib/Symfony/Component/CssSelector/Exception/ExceptionInterface.php b/lib/Symfony/Component/CssSelector/Exception/ExceptionInterface.php index 649216a0..8c8c825e 100644 --- a/lib/Symfony/Component/CssSelector/Exception/ExceptionInterface.php +++ b/lib/Symfony/Component/CssSelector/Exception/ExceptionInterface.php @@ -19,6 +19,6 @@ * * @author Jean-François Simon */ -interface ExceptionInterface +interface ExceptionInterface extends \Throwable { } diff --git a/lib/Symfony/Component/CssSelector/Exception/SyntaxErrorException.php b/lib/Symfony/Component/CssSelector/Exception/SyntaxErrorException.php index 081a164e..1a5e279c 100644 --- a/lib/Symfony/Component/CssSelector/Exception/SyntaxErrorException.php +++ b/lib/Symfony/Component/CssSelector/Exception/SyntaxErrorException.php @@ -24,32 +24,25 @@ class SyntaxErrorException extends ParseException { /** - * @param string $expectedValue - * * @return self */ - public static function unexpectedToken($expectedValue, Token $foundToken) + public static function unexpectedToken(string $expectedValue, Token $foundToken) { return new self(sprintf('Expected %s, but %s found.', $expectedValue, $foundToken)); } /** - * @param string $pseudoElement - * @param string $unexpectedLocation - * * @return self */ - public static function pseudoElementFound($pseudoElement, $unexpectedLocation) + public static function pseudoElementFound(string $pseudoElement, string $unexpectedLocation) { return new self(sprintf('Unexpected pseudo-element "::%s" found %s.', $pseudoElement, $unexpectedLocation)); } /** - * @param int $position - * * @return self */ - public static function unclosedString($position) + public static function unclosedString(int $position) { return new self(sprintf('Unclosed/invalid string at %s.', $position)); } diff --git a/lib/Symfony/Component/CssSelector/LICENSE b/lib/Symfony/Component/CssSelector/LICENSE index 9e936ec0..0138f8f0 100644 --- a/lib/Symfony/Component/CssSelector/LICENSE +++ b/lib/Symfony/Component/CssSelector/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2020 Fabien Potencier +Copyright (c) 2004-present Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/lib/Symfony/Component/CssSelector/Node/AbstractNode.php b/lib/Symfony/Component/CssSelector/Node/AbstractNode.php index 0046a613..ce8fc043 100644 --- a/lib/Symfony/Component/CssSelector/Node/AbstractNode.php +++ b/lib/Symfony/Component/CssSelector/Node/AbstractNode.php @@ -28,10 +28,7 @@ abstract class AbstractNode implements NodeInterface */ private $nodeName; - /** - * @return string - */ - public function getNodeName() + public function getNodeName(): string { if (null === $this->nodeName) { $this->nodeName = preg_replace('~.*\\\\([^\\\\]+)Node$~', '$1', static::class); diff --git a/lib/Symfony/Component/CssSelector/Node/AttributeNode.php b/lib/Symfony/Component/CssSelector/Node/AttributeNode.php index 3fbccdfb..5587ff0c 100644 --- a/lib/Symfony/Component/CssSelector/Node/AttributeNode.php +++ b/lib/Symfony/Component/CssSelector/Node/AttributeNode.php @@ -29,13 +29,7 @@ class AttributeNode extends AbstractNode private $operator; private $value; - /** - * @param string $namespace - * @param string $attribute - * @param string $operator - * @param string $value - */ - public function __construct(NodeInterface $selector, $namespace, $attribute, $operator, $value) + public function __construct(NodeInterface $selector, ?string $namespace, string $attribute, string $operator, ?string $value) { $this->selector = $selector; $this->namespace = $namespace; @@ -44,42 +38,27 @@ public function __construct(NodeInterface $selector, $namespace, $attribute, $op $this->value = $value; } - /** - * @return NodeInterface - */ - public function getSelector() + public function getSelector(): NodeInterface { return $this->selector; } - /** - * @return string - */ - public function getNamespace() + public function getNamespace(): ?string { return $this->namespace; } - /** - * @return string - */ - public function getAttribute() + public function getAttribute(): string { return $this->attribute; } - /** - * @return string - */ - public function getOperator() + public function getOperator(): string { return $this->operator; } - /** - * @return string - */ - public function getValue() + public function getValue(): ?string { return $this->value; } @@ -87,15 +66,12 @@ public function getValue() /** * {@inheritdoc} */ - public function getSpecificity() + public function getSpecificity(): Specificity { return $this->selector->getSpecificity()->plus(new Specificity(0, 1, 0)); } - /** - * {@inheritdoc} - */ - public function __toString() + public function __toString(): string { $attribute = $this->namespace ? $this->namespace.'|'.$this->attribute : $this->attribute; diff --git a/lib/Symfony/Component/CssSelector/Node/ClassNode.php b/lib/Symfony/Component/CssSelector/Node/ClassNode.php index aa1e7603..d03ea954 100644 --- a/lib/Symfony/Component/CssSelector/Node/ClassNode.php +++ b/lib/Symfony/Component/CssSelector/Node/ClassNode.php @@ -26,27 +26,18 @@ class ClassNode extends AbstractNode private $selector; private $name; - /** - * @param string $name - */ - public function __construct(NodeInterface $selector, $name) + public function __construct(NodeInterface $selector, string $name) { $this->selector = $selector; $this->name = $name; } - /** - * @return NodeInterface - */ - public function getSelector() + public function getSelector(): NodeInterface { return $this->selector; } - /** - * @return string - */ - public function getName() + public function getName(): string { return $this->name; } @@ -54,15 +45,12 @@ public function getName() /** * {@inheritdoc} */ - public function getSpecificity() + public function getSpecificity(): Specificity { return $this->selector->getSpecificity()->plus(new Specificity(0, 1, 0)); } - /** - * {@inheritdoc} - */ - public function __toString() + public function __toString(): string { return sprintf('%s[%s.%s]', $this->getNodeName(), $this->selector, $this->name); } diff --git a/lib/Symfony/Component/CssSelector/Node/CombinedSelectorNode.php b/lib/Symfony/Component/CssSelector/Node/CombinedSelectorNode.php index 964659c6..09832c16 100644 --- a/lib/Symfony/Component/CssSelector/Node/CombinedSelectorNode.php +++ b/lib/Symfony/Component/CssSelector/Node/CombinedSelectorNode.php @@ -27,36 +27,24 @@ class CombinedSelectorNode extends AbstractNode private $combinator; private $subSelector; - /** - * @param string $combinator - */ - public function __construct(NodeInterface $selector, $combinator, NodeInterface $subSelector) + public function __construct(NodeInterface $selector, string $combinator, NodeInterface $subSelector) { $this->selector = $selector; $this->combinator = $combinator; $this->subSelector = $subSelector; } - /** - * @return NodeInterface - */ - public function getSelector() + public function getSelector(): NodeInterface { return $this->selector; } - /** - * @return string - */ - public function getCombinator() + public function getCombinator(): string { return $this->combinator; } - /** - * @return NodeInterface - */ - public function getSubSelector() + public function getSubSelector(): NodeInterface { return $this->subSelector; } @@ -64,15 +52,12 @@ public function getSubSelector() /** * {@inheritdoc} */ - public function getSpecificity() + public function getSpecificity(): Specificity { return $this->selector->getSpecificity()->plus($this->subSelector->getSpecificity()); } - /** - * {@inheritdoc} - */ - public function __toString() + public function __toString(): string { $combinator = ' ' === $this->combinator ? '' : $this->combinator; diff --git a/lib/Symfony/Component/CssSelector/Node/ElementNode.php b/lib/Symfony/Component/CssSelector/Node/ElementNode.php index ce28f31b..a68b629b 100644 --- a/lib/Symfony/Component/CssSelector/Node/ElementNode.php +++ b/lib/Symfony/Component/CssSelector/Node/ElementNode.php @@ -26,28 +26,18 @@ class ElementNode extends AbstractNode private $namespace; private $element; - /** - * @param string|null $namespace - * @param string|null $element - */ - public function __construct($namespace = null, $element = null) + public function __construct(?string $namespace = null, ?string $element = null) { $this->namespace = $namespace; $this->element = $element; } - /** - * @return string|null - */ - public function getNamespace() + public function getNamespace(): ?string { return $this->namespace; } - /** - * @return string|null - */ - public function getElement() + public function getElement(): ?string { return $this->element; } @@ -55,15 +45,12 @@ public function getElement() /** * {@inheritdoc} */ - public function getSpecificity() + public function getSpecificity(): Specificity { return new Specificity(0, 0, $this->element ? 1 : 0); } - /** - * {@inheritdoc} - */ - public function __toString() + public function __toString(): string { $element = $this->element ?: '*'; diff --git a/lib/Symfony/Component/CssSelector/Node/FunctionNode.php b/lib/Symfony/Component/CssSelector/Node/FunctionNode.php index 311fc648..14d07b1c 100644 --- a/lib/Symfony/Component/CssSelector/Node/FunctionNode.php +++ b/lib/Symfony/Component/CssSelector/Node/FunctionNode.php @@ -30,28 +30,21 @@ class FunctionNode extends AbstractNode private $arguments; /** - * @param string $name * @param Token[] $arguments */ - public function __construct(NodeInterface $selector, $name, array $arguments = []) + public function __construct(NodeInterface $selector, string $name, array $arguments = []) { $this->selector = $selector; $this->name = strtolower($name); $this->arguments = $arguments; } - /** - * @return NodeInterface - */ - public function getSelector() + public function getSelector(): NodeInterface { return $this->selector; } - /** - * @return string - */ - public function getName() + public function getName(): string { return $this->name; } @@ -59,7 +52,7 @@ public function getName() /** * @return Token[] */ - public function getArguments() + public function getArguments(): array { return $this->arguments; } @@ -67,15 +60,12 @@ public function getArguments() /** * {@inheritdoc} */ - public function getSpecificity() + public function getSpecificity(): Specificity { return $this->selector->getSpecificity()->plus(new Specificity(0, 1, 0)); } - /** - * {@inheritdoc} - */ - public function __toString() + public function __toString(): string { $arguments = implode(', ', array_map(function (Token $token) { return "'".$token->getValue()."'"; diff --git a/lib/Symfony/Component/CssSelector/Node/HashNode.php b/lib/Symfony/Component/CssSelector/Node/HashNode.php index a6bd2394..524ac76a 100644 --- a/lib/Symfony/Component/CssSelector/Node/HashNode.php +++ b/lib/Symfony/Component/CssSelector/Node/HashNode.php @@ -26,27 +26,18 @@ class HashNode extends AbstractNode private $selector; private $id; - /** - * @param string $id - */ - public function __construct(NodeInterface $selector, $id) + public function __construct(NodeInterface $selector, string $id) { $this->selector = $selector; $this->id = $id; } - /** - * @return NodeInterface - */ - public function getSelector() + public function getSelector(): NodeInterface { return $this->selector; } - /** - * @return string - */ - public function getId() + public function getId(): string { return $this->id; } @@ -54,15 +45,12 @@ public function getId() /** * {@inheritdoc} */ - public function getSpecificity() + public function getSpecificity(): Specificity { return $this->selector->getSpecificity()->plus(new Specificity(1, 0, 0)); } - /** - * {@inheritdoc} - */ - public function __toString() + public function __toString(): string { return sprintf('%s[%s#%s]', $this->getNodeName(), $this->selector, $this->id); } diff --git a/lib/Symfony/Component/CssSelector/Node/NegationNode.php b/lib/Symfony/Component/CssSelector/Node/NegationNode.php index d014c76d..39010ca6 100644 --- a/lib/Symfony/Component/CssSelector/Node/NegationNode.php +++ b/lib/Symfony/Component/CssSelector/Node/NegationNode.php @@ -32,18 +32,12 @@ public function __construct(NodeInterface $selector, NodeInterface $subSelector) $this->subSelector = $subSelector; } - /** - * @return NodeInterface - */ - public function getSelector() + public function getSelector(): NodeInterface { return $this->selector; } - /** - * @return NodeInterface - */ - public function getSubSelector() + public function getSubSelector(): NodeInterface { return $this->subSelector; } @@ -51,15 +45,12 @@ public function getSubSelector() /** * {@inheritdoc} */ - public function getSpecificity() + public function getSpecificity(): Specificity { return $this->selector->getSpecificity()->plus($this->subSelector->getSpecificity()); } - /** - * {@inheritdoc} - */ - public function __toString() + public function __toString(): string { return sprintf('%s[%s:not(%s)]', $this->getNodeName(), $this->selector, $this->subSelector); } diff --git a/lib/Symfony/Component/CssSelector/Node/NodeInterface.php b/lib/Symfony/Component/CssSelector/Node/NodeInterface.php index 4ceafd24..e2eb3b22 100644 --- a/lib/Symfony/Component/CssSelector/Node/NodeInterface.php +++ b/lib/Symfony/Component/CssSelector/Node/NodeInterface.php @@ -23,24 +23,9 @@ */ interface NodeInterface { - /** - * Returns node's name. - * - * @return string - */ - public function getNodeName(); + public function getNodeName(): string; - /** - * Returns node's specificity. - * - * @return Specificity - */ - public function getSpecificity(); + public function getSpecificity(): Specificity; - /** - * Returns node's string representation. - * - * @return string - */ - public function __toString(); + public function __toString(): string; } diff --git a/lib/Symfony/Component/CssSelector/Node/PseudoNode.php b/lib/Symfony/Component/CssSelector/Node/PseudoNode.php index 6772b0db..4a20145c 100644 --- a/lib/Symfony/Component/CssSelector/Node/PseudoNode.php +++ b/lib/Symfony/Component/CssSelector/Node/PseudoNode.php @@ -26,27 +26,18 @@ class PseudoNode extends AbstractNode private $selector; private $identifier; - /** - * @param string $identifier - */ - public function __construct(NodeInterface $selector, $identifier) + public function __construct(NodeInterface $selector, string $identifier) { $this->selector = $selector; $this->identifier = strtolower($identifier); } - /** - * @return NodeInterface - */ - public function getSelector() + public function getSelector(): NodeInterface { return $this->selector; } - /** - * @return string - */ - public function getIdentifier() + public function getIdentifier(): string { return $this->identifier; } @@ -54,15 +45,12 @@ public function getIdentifier() /** * {@inheritdoc} */ - public function getSpecificity() + public function getSpecificity(): Specificity { return $this->selector->getSpecificity()->plus(new Specificity(0, 1, 0)); } - /** - * {@inheritdoc} - */ - public function __toString() + public function __toString(): string { return sprintf('%s[%s:%s]', $this->getNodeName(), $this->selector, $this->identifier); } diff --git a/lib/Symfony/Component/CssSelector/Node/SelectorNode.php b/lib/Symfony/Component/CssSelector/Node/SelectorNode.php index 8f7807ab..c9b30c41 100644 --- a/lib/Symfony/Component/CssSelector/Node/SelectorNode.php +++ b/lib/Symfony/Component/CssSelector/Node/SelectorNode.php @@ -26,27 +26,18 @@ class SelectorNode extends AbstractNode private $tree; private $pseudoElement; - /** - * @param string|null $pseudoElement - */ - public function __construct(NodeInterface $tree, $pseudoElement = null) + public function __construct(NodeInterface $tree, ?string $pseudoElement = null) { $this->tree = $tree; $this->pseudoElement = $pseudoElement ? strtolower($pseudoElement) : null; } - /** - * @return NodeInterface - */ - public function getTree() + public function getTree(): NodeInterface { return $this->tree; } - /** - * @return string|null - */ - public function getPseudoElement() + public function getPseudoElement(): ?string { return $this->pseudoElement; } @@ -54,15 +45,12 @@ public function getPseudoElement() /** * {@inheritdoc} */ - public function getSpecificity() + public function getSpecificity(): Specificity { return $this->tree->getSpecificity()->plus(new Specificity(0, 0, $this->pseudoElement ? 1 : 0)); } - /** - * {@inheritdoc} - */ - public function __toString() + public function __toString(): string { return sprintf('%s[%s%s]', $this->getNodeName(), $this->tree, $this->pseudoElement ? '::'.$this->pseudoElement : ''); } diff --git a/lib/Symfony/Component/CssSelector/Node/Specificity.php b/lib/Symfony/Component/CssSelector/Node/Specificity.php index a473dd7f..3dcf7ab4 100644 --- a/lib/Symfony/Component/CssSelector/Node/Specificity.php +++ b/lib/Symfony/Component/CssSelector/Node/Specificity.php @@ -25,40 +25,27 @@ */ class Specificity { - const A_FACTOR = 100; - const B_FACTOR = 10; - const C_FACTOR = 1; + public const A_FACTOR = 100; + public const B_FACTOR = 10; + public const C_FACTOR = 1; private $a; private $b; private $c; - /** - * @param int $a - * @param int $b - * @param int $c - */ - public function __construct($a, $b, $c) + public function __construct(int $a, int $b, int $c) { $this->a = $a; $this->b = $b; $this->c = $c; } - /** - * @return self - */ - public function plus(self $specificity) + public function plus(self $specificity): self { return new self($this->a + $specificity->a, $this->b + $specificity->b, $this->c + $specificity->c); } - /** - * Returns global specificity value. - * - * @return int - */ - public function getValue() + public function getValue(): int { return $this->a * self::A_FACTOR + $this->b * self::B_FACTOR + $this->c * self::C_FACTOR; } @@ -66,10 +53,8 @@ public function getValue() /** * Returns -1 if the object specificity is lower than the argument, * 0 if they are equal, and 1 if the argument is lower. - * - * @return int */ - public function compareTo(self $specificity) + public function compareTo(self $specificity): int { if ($this->a !== $specificity->a) { return $this->a > $specificity->a ? 1 : -1; diff --git a/lib/Symfony/Component/CssSelector/Parser/Handler/CommentHandler.php b/lib/Symfony/Component/CssSelector/Parser/Handler/CommentHandler.php index 1d3feb7a..fefe062f 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Handler/CommentHandler.php +++ b/lib/Symfony/Component/CssSelector/Parser/Handler/CommentHandler.php @@ -29,7 +29,7 @@ class CommentHandler implements HandlerInterface /** * {@inheritdoc} */ - public function handle(Reader $reader, TokenStream $stream) + public function handle(Reader $reader, TokenStream $stream): bool { if ('/*' !== $reader->getSubstring(2)) { return false; diff --git a/lib/Symfony/Component/CssSelector/Parser/Handler/HandlerInterface.php b/lib/Symfony/Component/CssSelector/Parser/Handler/HandlerInterface.php index 6716e91b..53889e4a 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Handler/HandlerInterface.php +++ b/lib/Symfony/Component/CssSelector/Parser/Handler/HandlerInterface.php @@ -26,8 +26,5 @@ */ interface HandlerInterface { - /** - * @return bool - */ - public function handle(Reader $reader, TokenStream $stream); + public function handle(Reader $reader, TokenStream $stream): bool; } diff --git a/lib/Symfony/Component/CssSelector/Parser/Handler/HashHandler.php b/lib/Symfony/Component/CssSelector/Parser/Handler/HashHandler.php index 87d2f57e..2730de70 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Handler/HashHandler.php +++ b/lib/Symfony/Component/CssSelector/Parser/Handler/HashHandler.php @@ -41,7 +41,7 @@ public function __construct(TokenizerPatterns $patterns, TokenizerEscaping $esca /** * {@inheritdoc} */ - public function handle(Reader $reader, TokenStream $stream) + public function handle(Reader $reader, TokenStream $stream): bool { $match = $reader->findPattern($this->patterns->getHashPattern()); diff --git a/lib/Symfony/Component/CssSelector/Parser/Handler/IdentifierHandler.php b/lib/Symfony/Component/CssSelector/Parser/Handler/IdentifierHandler.php index 5146fb6d..1744e421 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Handler/IdentifierHandler.php +++ b/lib/Symfony/Component/CssSelector/Parser/Handler/IdentifierHandler.php @@ -41,7 +41,7 @@ public function __construct(TokenizerPatterns $patterns, TokenizerEscaping $esca /** * {@inheritdoc} */ - public function handle(Reader $reader, TokenStream $stream) + public function handle(Reader $reader, TokenStream $stream): bool { $match = $reader->findPattern($this->patterns->getIdentifierPattern()); diff --git a/lib/Symfony/Component/CssSelector/Parser/Handler/NumberHandler.php b/lib/Symfony/Component/CssSelector/Parser/Handler/NumberHandler.php index 6bf8355a..8c831035 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Handler/NumberHandler.php +++ b/lib/Symfony/Component/CssSelector/Parser/Handler/NumberHandler.php @@ -38,7 +38,7 @@ public function __construct(TokenizerPatterns $patterns) /** * {@inheritdoc} */ - public function handle(Reader $reader, TokenStream $stream) + public function handle(Reader $reader, TokenStream $stream): bool { $match = $reader->findPattern($this->patterns->getNumberPattern()); diff --git a/lib/Symfony/Component/CssSelector/Parser/Handler/StringHandler.php b/lib/Symfony/Component/CssSelector/Parser/Handler/StringHandler.php index 10efd0f1..89a331b6 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Handler/StringHandler.php +++ b/lib/Symfony/Component/CssSelector/Parser/Handler/StringHandler.php @@ -43,7 +43,7 @@ public function __construct(TokenizerPatterns $patterns, TokenizerEscaping $esca /** * {@inheritdoc} */ - public function handle(Reader $reader, TokenStream $stream) + public function handle(Reader $reader, TokenStream $stream): bool { $quote = $reader->getSubstring(1); diff --git a/lib/Symfony/Component/CssSelector/Parser/Handler/WhitespaceHandler.php b/lib/Symfony/Component/CssSelector/Parser/Handler/WhitespaceHandler.php index 2c712021..bae5c97c 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Handler/WhitespaceHandler.php +++ b/lib/Symfony/Component/CssSelector/Parser/Handler/WhitespaceHandler.php @@ -30,7 +30,7 @@ class WhitespaceHandler implements HandlerInterface /** * {@inheritdoc} */ - public function handle(Reader $reader, TokenStream $stream) + public function handle(Reader $reader, TokenStream $stream): bool { $match = $reader->findPattern('~^[ \t\r\n\f]+~'); diff --git a/lib/Symfony/Component/CssSelector/Parser/Parser.php b/lib/Symfony/Component/CssSelector/Parser/Parser.php index dc6e2b92..5cd87d55 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Parser.php +++ b/lib/Symfony/Component/CssSelector/Parser/Parser.php @@ -29,15 +29,15 @@ class Parser implements ParserInterface { private $tokenizer; - public function __construct(Tokenizer $tokenizer = null) + public function __construct(?Tokenizer $tokenizer = null) { - $this->tokenizer = $tokenizer ?: new Tokenizer(); + $this->tokenizer = $tokenizer ?? new Tokenizer(); } /** * {@inheritdoc} */ - public function parse($source) + public function parse(string $source): array { $reader = new Reader($source); $stream = $this->tokenizer->tokenize($reader); @@ -50,11 +50,9 @@ public function parse($source) * * @param Token[] $tokens * - * @return array - * * @throws SyntaxErrorException */ - public static function parseSeries(array $tokens) + public static function parseSeries(array $tokens): array { foreach ($tokens as $token) { if ($token->isString()) { @@ -81,12 +79,12 @@ public static function parseSeries(array $tokens) return [2, 0]; case 'n' === $joined: return [1, 0]; - case false === strpos($joined, 'n'): + case !str_contains($joined, 'n'): return [0, $int($joined)]; } $split = explode('n', $joined); - $first = isset($split[0]) ? $split[0] : null; + $first = $split[0] ?? null; return [ $first ? ('-' === $first || '+' === $first ? $int($first.'1') : $int($first)) : 1, @@ -94,12 +92,7 @@ public static function parseSeries(array $tokens) ]; } - /** - * Parses selector nodes. - * - * @return array - */ - private function parseSelectorList(TokenStream $stream) + private function parseSelectorList(TokenStream $stream): array { $stream->skipWhitespace(); $selectors = []; @@ -118,16 +111,9 @@ private function parseSelectorList(TokenStream $stream) return $selectors; } - /** - * Parses next selector or combined node. - * - * @return Node\SelectorNode - * - * @throws SyntaxErrorException - */ - private function parserSelectorNode(TokenStream $stream) + private function parserSelectorNode(TokenStream $stream): Node\SelectorNode { - list($result, $pseudoElement) = $this->parseSimpleSelector($stream); + [$result, $pseudoElement] = $this->parseSimpleSelector($stream); while (true) { $stream->skipWhitespace(); @@ -148,7 +134,7 @@ private function parserSelectorNode(TokenStream $stream) $combinator = ' '; } - list($nextSelector, $pseudoElement) = $this->parseSimpleSelector($stream); + [$nextSelector, $pseudoElement] = $this->parseSimpleSelector($stream); $result = new Node\CombinedSelectorNode($result, $combinator, $nextSelector); } @@ -158,13 +144,9 @@ private function parserSelectorNode(TokenStream $stream) /** * Parses next simple node (hash, class, pseudo, negation). * - * @param bool $insideNegation - * - * @return array - * * @throws SyntaxErrorException */ - private function parseSimpleSelector(TokenStream $stream, $insideNegation = false) + private function parseSimpleSelector(TokenStream $stream, bool $insideNegation = false): array { $stream->skipWhitespace(); @@ -227,7 +209,7 @@ private function parseSimpleSelector(TokenStream $stream, $insideNegation = fals throw SyntaxErrorException::nestedNot(); } - list($argument, $argumentPseudoElement) = $this->parseSimpleSelector($stream, true); + [$argument, $argumentPseudoElement] = $this->parseSimpleSelector($stream, true); $next = $stream->getNext(); if (null !== $argumentPseudoElement) { @@ -278,12 +260,7 @@ private function parseSimpleSelector(TokenStream $stream, $insideNegation = fals return [$result, $pseudoElement]; } - /** - * Parses next element node. - * - * @return Node\ElementNode - */ - private function parseElementNode(TokenStream $stream) + private function parseElementNode(TokenStream $stream): Node\ElementNode { $peek = $stream->getPeek(); @@ -309,14 +286,7 @@ private function parseElementNode(TokenStream $stream) return new Node\ElementNode($namespace, $element); } - /** - * Parses next attribute node. - * - * @return Node\AttributeNode - * - * @throws SyntaxErrorException - */ - private function parseAttributeNode(Node\NodeInterface $selector, TokenStream $stream) + private function parseAttributeNode(Node\NodeInterface $selector, TokenStream $stream): Node\AttributeNode { $stream->skipWhitespace(); $attribute = $stream->getNextIdentifierOrStar(); diff --git a/lib/Symfony/Component/CssSelector/Parser/ParserInterface.php b/lib/Symfony/Component/CssSelector/Parser/ParserInterface.php index 0690f95f..d693befa 100644 --- a/lib/Symfony/Component/CssSelector/Parser/ParserInterface.php +++ b/lib/Symfony/Component/CssSelector/Parser/ParserInterface.php @@ -28,9 +28,7 @@ interface ParserInterface /** * Parses given selector source into an array of tokens. * - * @param string $source - * * @return SelectorNode[] */ - public function parse($source); + public function parse(string $source): array; } diff --git a/lib/Symfony/Component/CssSelector/Parser/Reader.php b/lib/Symfony/Component/CssSelector/Parser/Reader.php index ebd5fc51..b04a6c07 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Reader.php +++ b/lib/Symfony/Component/CssSelector/Parser/Reader.php @@ -27,56 +27,33 @@ class Reader private $length; private $position = 0; - /** - * @param string $source - */ - public function __construct($source) + public function __construct(string $source) { $this->source = $source; $this->length = \strlen($source); } - /** - * @return bool - */ - public function isEOF() + public function isEOF(): bool { return $this->position >= $this->length; } - /** - * @return int - */ - public function getPosition() + public function getPosition(): int { return $this->position; } - /** - * @return int - */ - public function getRemainingLength() + public function getRemainingLength(): int { return $this->length - $this->position; } - /** - * @param int $length - * @param int $offset - * - * @return string - */ - public function getSubstring($length, $offset = 0) + public function getSubstring(int $length, int $offset = 0): string { return substr($this->source, $this->position + $offset, $length); } - /** - * @param string $string - * - * @return int - */ - public function getOffset($string) + public function getOffset(string $string) { $position = strpos($this->source, $string, $this->position); @@ -84,11 +61,9 @@ public function getOffset($string) } /** - * @param string $pattern - * * @return array|false */ - public function findPattern($pattern) + public function findPattern(string $pattern) { $source = substr($this->source, $this->position); @@ -99,10 +74,7 @@ public function findPattern($pattern) return false; } - /** - * @param int $length - */ - public function moveForward($length) + public function moveForward(int $length) { $this->position += $length; } diff --git a/lib/Symfony/Component/CssSelector/Parser/Shortcut/ClassParser.php b/lib/Symfony/Component/CssSelector/Parser/Shortcut/ClassParser.php index 985baec8..a026faa7 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Shortcut/ClassParser.php +++ b/lib/Symfony/Component/CssSelector/Parser/Shortcut/ClassParser.php @@ -31,7 +31,7 @@ class ClassParser implements ParserInterface /** * {@inheritdoc} */ - public function parse($source) + public function parse(string $source): array { // Matches an optional namespace, optional element, and required class // $source = 'test|input.ab6bd_field'; diff --git a/lib/Symfony/Component/CssSelector/Parser/Shortcut/ElementParser.php b/lib/Symfony/Component/CssSelector/Parser/Shortcut/ElementParser.php index 97bf6de3..a0c4afaa 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Shortcut/ElementParser.php +++ b/lib/Symfony/Component/CssSelector/Parser/Shortcut/ElementParser.php @@ -30,7 +30,7 @@ class ElementParser implements ParserInterface /** * {@inheritdoc} */ - public function parse($source) + public function parse(string $source): array { // Matches an optional namespace, required element or `*` // $source = 'testns|testel'; diff --git a/lib/Symfony/Component/CssSelector/Parser/Shortcut/EmptyStringParser.php b/lib/Symfony/Component/CssSelector/Parser/Shortcut/EmptyStringParser.php index 24f9a459..c5c82a9b 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Shortcut/EmptyStringParser.php +++ b/lib/Symfony/Component/CssSelector/Parser/Shortcut/EmptyStringParser.php @@ -34,7 +34,7 @@ class EmptyStringParser implements ParserInterface /** * {@inheritdoc} */ - public function parse($source) + public function parse(string $source): array { // Matches an empty string if ('' == $source) { diff --git a/lib/Symfony/Component/CssSelector/Parser/Shortcut/HashParser.php b/lib/Symfony/Component/CssSelector/Parser/Shortcut/HashParser.php index f65a2587..bcab6fe8 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Shortcut/HashParser.php +++ b/lib/Symfony/Component/CssSelector/Parser/Shortcut/HashParser.php @@ -31,7 +31,7 @@ class HashParser implements ParserInterface /** * {@inheritdoc} */ - public function parse($source) + public function parse(string $source): array { // Matches an optional namespace, optional element, and required id // $source = 'test|input#ab6bd_field'; diff --git a/lib/Symfony/Component/CssSelector/Parser/Token.php b/lib/Symfony/Component/CssSelector/Parser/Token.php index f647e103..735cf47d 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Token.php +++ b/lib/Symfony/Component/CssSelector/Parser/Token.php @@ -23,66 +23,46 @@ */ class Token { - const TYPE_FILE_END = 'eof'; - const TYPE_DELIMITER = 'delimiter'; - const TYPE_WHITESPACE = 'whitespace'; - const TYPE_IDENTIFIER = 'identifier'; - const TYPE_HASH = 'hash'; - const TYPE_NUMBER = 'number'; - const TYPE_STRING = 'string'; + public const TYPE_FILE_END = 'eof'; + public const TYPE_DELIMITER = 'delimiter'; + public const TYPE_WHITESPACE = 'whitespace'; + public const TYPE_IDENTIFIER = 'identifier'; + public const TYPE_HASH = 'hash'; + public const TYPE_NUMBER = 'number'; + public const TYPE_STRING = 'string'; private $type; private $value; private $position; - /** - * @param int $type - * @param string $value - * @param int $position - */ - public function __construct($type, $value, $position) + public function __construct(?string $type, ?string $value, ?int $position) { $this->type = $type; $this->value = $value; $this->position = $position; } - /** - * @return int - */ - public function getType() + public function getType(): ?int { return $this->type; } - /** - * @return string - */ - public function getValue() + public function getValue(): ?string { return $this->value; } - /** - * @return int - */ - public function getPosition() + public function getPosition(): ?int { return $this->position; } - /** - * @return bool - */ - public function isFileEnd() + public function isFileEnd(): bool { return self::TYPE_FILE_END === $this->type; } - /** - * @return bool - */ - public function isDelimiter(array $values = []) + public function isDelimiter(array $values = []): bool { if (self::TYPE_DELIMITER !== $this->type) { return false; @@ -95,50 +75,32 @@ public function isDelimiter(array $values = []) return \in_array($this->value, $values); } - /** - * @return bool - */ - public function isWhitespace() + public function isWhitespace(): bool { return self::TYPE_WHITESPACE === $this->type; } - /** - * @return bool - */ - public function isIdentifier() + public function isIdentifier(): bool { return self::TYPE_IDENTIFIER === $this->type; } - /** - * @return bool - */ - public function isHash() + public function isHash(): bool { return self::TYPE_HASH === $this->type; } - /** - * @return bool - */ - public function isNumber() + public function isNumber(): bool { return self::TYPE_NUMBER === $this->type; } - /** - * @return bool - */ - public function isString() + public function isString(): bool { return self::TYPE_STRING === $this->type; } - /** - * @return string - */ - public function __toString() + public function __toString(): string { if ($this->value) { return sprintf('<%s "%s" at %s>', $this->type, $this->value, $this->position); diff --git a/lib/Symfony/Component/CssSelector/Parser/TokenStream.php b/lib/Symfony/Component/CssSelector/Parser/TokenStream.php index e8cbbb61..28af1ca1 100644 --- a/lib/Symfony/Component/CssSelector/Parser/TokenStream.php +++ b/lib/Symfony/Component/CssSelector/Parser/TokenStream.php @@ -56,7 +56,7 @@ class TokenStream * * @return $this */ - public function push(Token $token) + public function push(Token $token): self { $this->tokens[] = $token; @@ -68,7 +68,7 @@ public function push(Token $token) * * @return $this */ - public function freeze() + public function freeze(): self { return $this; } @@ -76,11 +76,9 @@ public function freeze() /** * Returns next token. * - * @return Token - * * @throws InternalErrorException If there is no more token */ - public function getNext() + public function getNext(): Token { if ($this->peeking) { $this->peeking = false; @@ -98,10 +96,8 @@ public function getNext() /** * Returns peeked token. - * - * @return Token */ - public function getPeek() + public function getPeek(): Token { if (!$this->peeking) { $this->peeked = $this->getNext(); @@ -116,19 +112,17 @@ public function getPeek() * * @return Token[] */ - public function getUsed() + public function getUsed(): array { return $this->used; } /** - * Returns nex identifier token. - * - * @return string The identifier token value + * Returns next identifier token. * * @throws SyntaxErrorException If next token is not an identifier */ - public function getNextIdentifier() + public function getNextIdentifier(): string { $next = $this->getNext(); @@ -140,13 +134,11 @@ public function getNextIdentifier() } /** - * Returns nex identifier or star delimiter token. - * - * @return string|null The identifier token value or null if star found + * Returns next identifier or null if star delimiter token is found. * * @throws SyntaxErrorException If next token is not an identifier or a star delimiter */ - public function getNextIdentifierOrStar() + public function getNextIdentifierOrStar(): ?string { $next = $this->getNext(); diff --git a/lib/Symfony/Component/CssSelector/Parser/Tokenizer/Tokenizer.php b/lib/Symfony/Component/CssSelector/Parser/Tokenizer/Tokenizer.php index adfd3d55..643cc8e5 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Tokenizer/Tokenizer.php +++ b/lib/Symfony/Component/CssSelector/Parser/Tokenizer/Tokenizer.php @@ -50,10 +50,8 @@ public function __construct() /** * Tokenize selector source code. - * - * @return TokenStream */ - public function tokenize(Reader $reader) + public function tokenize(Reader $reader): TokenStream { $stream = new TokenStream(); diff --git a/lib/Symfony/Component/CssSelector/Parser/Tokenizer/TokenizerEscaping.php b/lib/Symfony/Component/CssSelector/Parser/Tokenizer/TokenizerEscaping.php index 4dd83403..b476fbbd 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Tokenizer/TokenizerEscaping.php +++ b/lib/Symfony/Component/CssSelector/Parser/Tokenizer/TokenizerEscaping.php @@ -30,36 +30,21 @@ public function __construct(TokenizerPatterns $patterns) $this->patterns = $patterns; } - /** - * @param string $value - * - * @return string - */ - public function escapeUnicode($value) + public function escapeUnicode(string $value): string { $value = $this->replaceUnicodeSequences($value); return preg_replace($this->patterns->getSimpleEscapePattern(), '$1', $value); } - /** - * @param string $value - * - * @return string - */ - public function escapeUnicodeAndNewLine($value) + public function escapeUnicodeAndNewLine(string $value): string { $value = preg_replace($this->patterns->getNewLineEscapePattern(), '', $value); return $this->escapeUnicode($value); } - /** - * @param string $value - * - * @return string - */ - private function replaceUnicodeSequences($value) + private function replaceUnicodeSequences(string $value): string { return preg_replace_callback($this->patterns->getUnicodeEscapePattern(), function ($match) { $c = hexdec($match[1]); diff --git a/lib/Symfony/Component/CssSelector/Parser/Tokenizer/TokenizerPatterns.php b/lib/Symfony/Component/CssSelector/Parser/Tokenizer/TokenizerPatterns.php index fec6d044..a3f91c8e 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Tokenizer/TokenizerPatterns.php +++ b/lib/Symfony/Component/CssSelector/Parser/Tokenizer/TokenizerPatterns.php @@ -49,63 +49,40 @@ public function __construct() $this->identifierPattern = '-?(?:'.$this->nmStartPattern.')(?:'.$this->nmCharPattern.')*'; $this->hashPattern = '#((?:'.$this->nmCharPattern.')+)'; $this->numberPattern = '[+-]?(?:[0-9]*\.[0-9]+|[0-9]+)'; - $this->quotedStringPattern = '([^\n\r\f%s]|'.$this->stringEscapePattern.')*'; + $this->quotedStringPattern = '([^\n\r\f\\\\%s]|'.$this->stringEscapePattern.')*'; } - /** - * @return string - */ - public function getNewLineEscapePattern() + public function getNewLineEscapePattern(): string { - return '~^'.$this->newLineEscapePattern.'~'; + return '~'.$this->newLineEscapePattern.'~'; } - /** - * @return string - */ - public function getSimpleEscapePattern() + public function getSimpleEscapePattern(): string { - return '~^'.$this->simpleEscapePattern.'~'; + return '~'.$this->simpleEscapePattern.'~'; } - /** - * @return string - */ - public function getUnicodeEscapePattern() + public function getUnicodeEscapePattern(): string { - return '~^'.$this->unicodeEscapePattern.'~i'; + return '~'.$this->unicodeEscapePattern.'~i'; } - /** - * @return string - */ - public function getIdentifierPattern() + public function getIdentifierPattern(): string { return '~^'.$this->identifierPattern.'~i'; } - /** - * @return string - */ - public function getHashPattern() + public function getHashPattern(): string { return '~^'.$this->hashPattern.'~i'; } - /** - * @return string - */ - public function getNumberPattern() + public function getNumberPattern(): string { return '~^'.$this->numberPattern.'~'; } - /** - * @param string $quote - * - * @return string - */ - public function getQuotedStringPattern($quote) + public function getQuotedStringPattern(string $quote): string { return '~^'.sprintf($this->quotedStringPattern, $quote).'~i'; } diff --git a/lib/Symfony/Component/CssSelector/README.md b/lib/Symfony/Component/CssSelector/README.md index 7c4c4116..ede4a3ac 100644 --- a/lib/Symfony/Component/CssSelector/README.md +++ b/lib/Symfony/Component/CssSelector/README.md @@ -6,11 +6,11 @@ The CssSelector component converts CSS selectors to XPath expressions. Resources --------- - * [Documentation](https://symfony.com/doc/current/components/css_selector.html) - * [Contributing](https://symfony.com/doc/current/contributing/index.html) - * [Report issues](https://github.com/symfony/symfony/issues) and - [send Pull Requests](https://github.com/symfony/symfony/pulls) - in the [main Symfony repository](https://github.com/symfony/symfony) + * [Documentation](https://symfony.com/doc/current/components/css_selector.html) + * [Contributing](https://symfony.com/doc/current/contributing/index.html) + * [Report issues](https://github.com/symfony/symfony/issues) and + [send Pull Requests](https://github.com/symfony/symfony/pulls) + in the [main Symfony repository](https://github.com/symfony/symfony) Credits ------- diff --git a/lib/Symfony/Component/CssSelector/Tests/CssSelectorConverterTest.php b/lib/Symfony/Component/CssSelector/Tests/CssSelectorConverterTest.php deleted file mode 100644 index 68e98c4f..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/CssSelectorConverterTest.php +++ /dev/null @@ -1,74 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests; - -use PHPUnit\Framework\TestCase; -use SimplePay\Vendor\Symfony\Component\CssSelector\CssSelectorConverter; - -class CssSelectorConverterTest extends TestCase -{ - public function testCssToXPath() - { - $converter = new CssSelectorConverter(); - - $this->assertEquals('descendant-or-self::*', $converter->toXPath('')); - $this->assertEquals('descendant-or-self::h1', $converter->toXPath('h1')); - $this->assertEquals("descendant-or-self::h1[@id = 'foo']", $converter->toXPath('h1#foo')); - $this->assertEquals("descendant-or-self::h1[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]", $converter->toXPath('h1.foo')); - $this->assertEquals('descendant-or-self::foo:h1', $converter->toXPath('foo|h1')); - $this->assertEquals('descendant-or-self::h1', $converter->toXPath('H1')); - } - - public function testCssToXPathXml() - { - $converter = new CssSelectorConverter(false); - - $this->assertEquals('descendant-or-self::H1', $converter->toXPath('H1')); - } - - public function testParseExceptions() - { - $this->expectException('SimplePay\Vendor\Symfony\Component\CssSelector\Exception\ParseException'); - $this->expectExceptionMessage('Expected identifier, but found.'); - $converter = new CssSelectorConverter(); - $converter->toXPath('h1:'); - } - - /** @dataProvider getCssToXPathWithoutPrefixTestData */ - public function testCssToXPathWithoutPrefix($css, $xpath) - { - $converter = new CssSelectorConverter(); - - $this->assertEquals($xpath, $converter->toXPath($css, ''), '->parse() parses an input string and returns a node'); - } - - public function getCssToXPathWithoutPrefixTestData() - { - return [ - ['h1', 'h1'], - ['foo|h1', 'foo:h1'], - ['h1, h2, h3', 'h1 | h2 | h3'], - ['h1:nth-child(3n+1)', "*/*[(name() = 'h1') and (position() - 1 >= 0 and (position() - 1) mod 3 = 0)]"], - ['h1 > p', 'h1/p'], - ['h1#foo', "h1[@id = 'foo']"], - ['h1.foo', "h1[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"], - ['h1[class*="foo bar"]', "h1[@class and contains(@class, 'foo bar')]"], - ['h1[foo|class*="foo bar"]', "h1[@foo:class and contains(@foo:class, 'foo bar')]"], - ['h1[class]', 'h1[@class]'], - ['h1 .foo', "h1/descendant-or-self::*/*[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"], - ['h1 #foo', "h1/descendant-or-self::*/*[@id = 'foo']"], - ['h1 [class*=foo]', "h1/descendant-or-self::*/*[@class and contains(@class, 'foo')]"], - ['div>.foo', "div/*[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"], - ['div > .foo', "div/*[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"], - ]; - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Node/AbstractNodeTest.php b/lib/Symfony/Component/CssSelector/Tests/Node/AbstractNodeTest.php deleted file mode 100644 index 834f8a88..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Node/AbstractNodeTest.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Node; - -use PHPUnit\Framework\TestCase; -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\NodeInterface; - -abstract class AbstractNodeTest extends TestCase -{ - /** @dataProvider getToStringConversionTestData */ - public function testToStringConversion(NodeInterface $node, $representation) - { - $this->assertEquals($representation, (string) $node); - } - - /** @dataProvider getSpecificityValueTestData */ - public function testSpecificityValue(NodeInterface $node, $value) - { - $this->assertEquals($value, $node->getSpecificity()->getValue()); - } - - abstract public function getToStringConversionTestData(); - - abstract public function getSpecificityValueTestData(); -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Node/AttributeNodeTest.php b/lib/Symfony/Component/CssSelector/Tests/Node/AttributeNodeTest.php deleted file mode 100644 index 0e7ca0ac..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Node/AttributeNodeTest.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Node; - -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\AttributeNode; -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\ElementNode; - -class AttributeNodeTest extends AbstractNodeTest -{ - public function getToStringConversionTestData() - { - return [ - [new AttributeNode(new ElementNode(), null, 'attribute', 'exists', null), 'Attribute[Element[*][attribute]]'], - [new AttributeNode(new ElementNode(), null, 'attribute', '$=', 'value'), "Attribute[Element[*][attribute $= 'value']]"], - [new AttributeNode(new ElementNode(), 'namespace', 'attribute', '$=', 'value'), "Attribute[Element[*][namespace|attribute $= 'value']]"], - ]; - } - - public function getSpecificityValueTestData() - { - return [ - [new AttributeNode(new ElementNode(), null, 'attribute', 'exists', null), 10], - [new AttributeNode(new ElementNode(null, 'element'), null, 'attribute', 'exists', null), 11], - [new AttributeNode(new ElementNode(), null, 'attribute', '$=', 'value'), 10], - [new AttributeNode(new ElementNode(), 'namespace', 'attribute', '$=', 'value'), 10], - ]; - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Node/ClassNodeTest.php b/lib/Symfony/Component/CssSelector/Tests/Node/ClassNodeTest.php deleted file mode 100644 index d988e4a4..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Node/ClassNodeTest.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Node; - -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\ClassNode; -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\ElementNode; - -class ClassNodeTest extends AbstractNodeTest -{ - public function getToStringConversionTestData() - { - return [ - [new ClassNode(new ElementNode(), 'class'), 'Class[Element[*].class]'], - ]; - } - - public function getSpecificityValueTestData() - { - return [ - [new ClassNode(new ElementNode(), 'class'), 10], - [new ClassNode(new ElementNode(null, 'element'), 'class'), 11], - ]; - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Node/CombinedSelectorNodeTest.php b/lib/Symfony/Component/CssSelector/Tests/Node/CombinedSelectorNodeTest.php deleted file mode 100644 index 9de72bde..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Node/CombinedSelectorNodeTest.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Node; - -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\CombinedSelectorNode; -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\ElementNode; - -class CombinedSelectorNodeTest extends AbstractNodeTest -{ - public function getToStringConversionTestData() - { - return [ - [new CombinedSelectorNode(new ElementNode(), '>', new ElementNode()), 'CombinedSelector[Element[*] > Element[*]]'], - [new CombinedSelectorNode(new ElementNode(), ' ', new ElementNode()), 'CombinedSelector[Element[*] Element[*]]'], - ]; - } - - public function getSpecificityValueTestData() - { - return [ - [new CombinedSelectorNode(new ElementNode(), '>', new ElementNode()), 0], - [new CombinedSelectorNode(new ElementNode(null, 'element'), '>', new ElementNode()), 1], - [new CombinedSelectorNode(new ElementNode(null, 'element'), '>', new ElementNode(null, 'element')), 2], - ]; - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Node/ElementNodeTest.php b/lib/Symfony/Component/CssSelector/Tests/Node/ElementNodeTest.php deleted file mode 100644 index 0f4984ee..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Node/ElementNodeTest.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Node; - -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\ElementNode; - -class ElementNodeTest extends AbstractNodeTest -{ - public function getToStringConversionTestData() - { - return [ - [new ElementNode(), 'Element[*]'], - [new ElementNode(null, 'element'), 'Element[element]'], - [new ElementNode('namespace', 'element'), 'Element[namespace|element]'], - ]; - } - - public function getSpecificityValueTestData() - { - return [ - [new ElementNode(), 0], - [new ElementNode(null, 'element'), 1], - [new ElementNode('namespace', 'element'), 1], - ]; - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Node/FunctionNodeTest.php b/lib/Symfony/Component/CssSelector/Tests/Node/FunctionNodeTest.php deleted file mode 100644 index 9d389eed..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Node/FunctionNodeTest.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Node; - -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\ElementNode; -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\FunctionNode; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Token; - -class FunctionNodeTest extends AbstractNodeTest -{ - public function getToStringConversionTestData() - { - return [ - [new FunctionNode(new ElementNode(), 'function'), 'Function[Element[*]:function()]'], - [new FunctionNode(new ElementNode(), 'function', [ - new Token(Token::TYPE_IDENTIFIER, 'value', 0), - ]), "Function[Element[*]:function(['value'])]"], - [new FunctionNode(new ElementNode(), 'function', [ - new Token(Token::TYPE_STRING, 'value1', 0), - new Token(Token::TYPE_NUMBER, 'value2', 0), - ]), "Function[Element[*]:function(['value1', 'value2'])]"], - ]; - } - - public function getSpecificityValueTestData() - { - return [ - [new FunctionNode(new ElementNode(), 'function'), 10], - [new FunctionNode(new ElementNode(), 'function', [ - new Token(Token::TYPE_IDENTIFIER, 'value', 0), - ]), 10], - [new FunctionNode(new ElementNode(), 'function', [ - new Token(Token::TYPE_STRING, 'value1', 0), - new Token(Token::TYPE_NUMBER, 'value2', 0), - ]), 10], - ]; - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Node/HashNodeTest.php b/lib/Symfony/Component/CssSelector/Tests/Node/HashNodeTest.php deleted file mode 100644 index 88382c39..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Node/HashNodeTest.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Node; - -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\ElementNode; -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\HashNode; - -class HashNodeTest extends AbstractNodeTest -{ - public function getToStringConversionTestData() - { - return [ - [new HashNode(new ElementNode(), 'id'), 'Hash[Element[*]#id]'], - ]; - } - - public function getSpecificityValueTestData() - { - return [ - [new HashNode(new ElementNode(), 'id'), 100], - [new HashNode(new ElementNode(null, 'id'), 'class'), 101], - ]; - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Node/NegationNodeTest.php b/lib/Symfony/Component/CssSelector/Tests/Node/NegationNodeTest.php deleted file mode 100644 index b0798f5a..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Node/NegationNodeTest.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Node; - -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\ClassNode; -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\ElementNode; -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\NegationNode; - -class NegationNodeTest extends AbstractNodeTest -{ - public function getToStringConversionTestData() - { - return [ - [new NegationNode(new ElementNode(), new ClassNode(new ElementNode(), 'class')), 'Negation[Element[*]:not(Class[Element[*].class])]'], - ]; - } - - public function getSpecificityValueTestData() - { - return [ - [new NegationNode(new ElementNode(), new ClassNode(new ElementNode(), 'class')), 10], - ]; - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Node/PseudoNodeTest.php b/lib/Symfony/Component/CssSelector/Tests/Node/PseudoNodeTest.php deleted file mode 100644 index 81f169f1..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Node/PseudoNodeTest.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Node; - -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\ElementNode; -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\PseudoNode; - -class PseudoNodeTest extends AbstractNodeTest -{ - public function getToStringConversionTestData() - { - return [ - [new PseudoNode(new ElementNode(), 'pseudo'), 'Pseudo[Element[*]:pseudo]'], - ]; - } - - public function getSpecificityValueTestData() - { - return [ - [new PseudoNode(new ElementNode(), 'pseudo'), 10], - ]; - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Node/SelectorNodeTest.php b/lib/Symfony/Component/CssSelector/Tests/Node/SelectorNodeTest.php deleted file mode 100644 index 6ca772f8..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Node/SelectorNodeTest.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Node; - -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\ElementNode; -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\SelectorNode; - -class SelectorNodeTest extends AbstractNodeTest -{ - public function getToStringConversionTestData() - { - return [ - [new SelectorNode(new ElementNode()), 'Selector[Element[*]]'], - [new SelectorNode(new ElementNode(), 'pseudo'), 'Selector[Element[*]::pseudo]'], - ]; - } - - public function getSpecificityValueTestData() - { - return [ - [new SelectorNode(new ElementNode()), 0], - [new SelectorNode(new ElementNode(), 'pseudo'), 1], - ]; - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Node/SpecificityTest.php b/lib/Symfony/Component/CssSelector/Tests/Node/SpecificityTest.php deleted file mode 100644 index 8c5cd9a4..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Node/SpecificityTest.php +++ /dev/null @@ -1,63 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Node; - -use PHPUnit\Framework\TestCase; -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\Specificity; - -class SpecificityTest extends TestCase -{ - /** @dataProvider getValueTestData */ - public function testValue(Specificity $specificity, $value) - { - $this->assertEquals($value, $specificity->getValue()); - } - - /** @dataProvider getValueTestData */ - public function testPlusValue(Specificity $specificity, $value) - { - $this->assertEquals($value + 123, $specificity->plus(new Specificity(1, 2, 3))->getValue()); - } - - public function getValueTestData() - { - return [ - [new Specificity(0, 0, 0), 0], - [new Specificity(0, 0, 2), 2], - [new Specificity(0, 3, 0), 30], - [new Specificity(4, 0, 0), 400], - [new Specificity(4, 3, 2), 432], - ]; - } - - /** @dataProvider getCompareTestData */ - public function testCompareTo(Specificity $a, Specificity $b, $result) - { - $this->assertEquals($result, $a->compareTo($b)); - } - - public function getCompareTestData() - { - return [ - [new Specificity(0, 0, 0), new Specificity(0, 0, 0), 0], - [new Specificity(0, 0, 1), new Specificity(0, 0, 1), 0], - [new Specificity(0, 0, 2), new Specificity(0, 0, 1), 1], - [new Specificity(0, 0, 2), new Specificity(0, 0, 3), -1], - [new Specificity(0, 4, 0), new Specificity(0, 4, 0), 0], - [new Specificity(0, 6, 0), new Specificity(0, 5, 11), 1], - [new Specificity(0, 7, 0), new Specificity(0, 8, 0), -1], - [new Specificity(9, 0, 0), new Specificity(9, 0, 0), 0], - [new Specificity(11, 0, 0), new Specificity(10, 11, 0), 1], - [new Specificity(12, 11, 0), new Specificity(13, 0, 0), -1], - ]; - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/AbstractHandlerTest.php b/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/AbstractHandlerTest.php deleted file mode 100644 index 9de6f0e4..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/AbstractHandlerTest.php +++ /dev/null @@ -1,70 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Parser\Handler; - -use PHPUnit\Framework\TestCase; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Reader; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Token; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\TokenStream; - -/** - * @author Jean-François Simon - */ -abstract class AbstractHandlerTest extends TestCase -{ - /** @dataProvider getHandleValueTestData */ - public function testHandleValue($value, Token $expectedToken, $remainingContent) - { - $reader = new Reader($value); - $stream = new TokenStream(); - - $this->assertTrue($this->generateHandler()->handle($reader, $stream)); - $this->assertEquals($expectedToken, $stream->getNext()); - $this->assertRemainingContent($reader, $remainingContent); - } - - /** @dataProvider getDontHandleValueTestData */ - public function testDontHandleValue($value) - { - $reader = new Reader($value); - $stream = new TokenStream(); - - $this->assertFalse($this->generateHandler()->handle($reader, $stream)); - $this->assertStreamEmpty($stream); - $this->assertRemainingContent($reader, $value); - } - - abstract public function getHandleValueTestData(); - - abstract public function getDontHandleValueTestData(); - - abstract protected function generateHandler(); - - protected function assertStreamEmpty(TokenStream $stream) - { - $property = new \ReflectionProperty($stream, 'tokens'); - $property->setAccessible(true); - - $this->assertEquals([], $property->getValue($stream)); - } - - protected function assertRemainingContent(Reader $reader, $remainingContent) - { - if ('' === $remainingContent) { - $this->assertEquals(0, $reader->getRemainingLength()); - $this->assertTrue($reader->isEOF()); - } else { - $this->assertEquals(\strlen($remainingContent), $reader->getRemainingLength()); - $this->assertEquals(0, $reader->getOffset($remainingContent)); - } - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/CommentHandlerTest.php b/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/CommentHandlerTest.php deleted file mode 100644 index fc621278..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/CommentHandlerTest.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Parser\Handler; - -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Handler\CommentHandler; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Reader; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Token; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\TokenStream; - -class CommentHandlerTest extends AbstractHandlerTest -{ - /** @dataProvider getHandleValueTestData */ - public function testHandleValue($value, Token $unusedArgument, $remainingContent) - { - $reader = new Reader($value); - $stream = new TokenStream(); - - $this->assertTrue($this->generateHandler()->handle($reader, $stream)); - // comments are ignored (not pushed as token in stream) - $this->assertStreamEmpty($stream); - $this->assertRemainingContent($reader, $remainingContent); - } - - public function getHandleValueTestData() - { - return [ - // 2nd argument only exists for inherited method compatibility - ['/* comment */', new Token(null, null, null), ''], - ['/* comment */foo', new Token(null, null, null), 'foo'], - ]; - } - - public function getDontHandleValueTestData() - { - return [ - ['>'], - ['+'], - [' '], - ]; - } - - protected function generateHandler() - { - return new CommentHandler(); - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/HashHandlerTest.php b/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/HashHandlerTest.php deleted file mode 100644 index eeafa65f..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/HashHandlerTest.php +++ /dev/null @@ -1,49 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Parser\Handler; - -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Handler\HashHandler; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Token; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerEscaping; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns; - -class HashHandlerTest extends AbstractHandlerTest -{ - public function getHandleValueTestData() - { - return [ - ['#id', new Token(Token::TYPE_HASH, 'id', 0), ''], - ['#123', new Token(Token::TYPE_HASH, '123', 0), ''], - - ['#id.class', new Token(Token::TYPE_HASH, 'id', 0), '.class'], - ['#id element', new Token(Token::TYPE_HASH, 'id', 0), ' element'], - ]; - } - - public function getDontHandleValueTestData() - { - return [ - ['id'], - ['123'], - ['<'], - ['<'], - ['#'], - ]; - } - - protected function generateHandler() - { - $patterns = new TokenizerPatterns(); - - return new HashHandler($patterns, new TokenizerEscaping($patterns)); - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/IdentifierHandlerTest.php b/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/IdentifierHandlerTest.php deleted file mode 100644 index 678defe1..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/IdentifierHandlerTest.php +++ /dev/null @@ -1,49 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Parser\Handler; - -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Handler\IdentifierHandler; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Token; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerEscaping; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns; - -class IdentifierHandlerTest extends AbstractHandlerTest -{ - public function getHandleValueTestData() - { - return [ - ['foo', new Token(Token::TYPE_IDENTIFIER, 'foo', 0), ''], - ['foo|bar', new Token(Token::TYPE_IDENTIFIER, 'foo', 0), '|bar'], - ['foo.class', new Token(Token::TYPE_IDENTIFIER, 'foo', 0), '.class'], - ['foo[attr]', new Token(Token::TYPE_IDENTIFIER, 'foo', 0), '[attr]'], - ['foo bar', new Token(Token::TYPE_IDENTIFIER, 'foo', 0), ' bar'], - ]; - } - - public function getDontHandleValueTestData() - { - return [ - ['>'], - ['+'], - [' '], - ['*|foo'], - ['/* comment */'], - ]; - } - - protected function generateHandler() - { - $patterns = new TokenizerPatterns(); - - return new IdentifierHandler($patterns, new TokenizerEscaping($patterns)); - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/NumberHandlerTest.php b/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/NumberHandlerTest.php deleted file mode 100644 index f57fbb1c..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/NumberHandlerTest.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Parser\Handler; - -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Handler\NumberHandler; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Token; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns; - -class NumberHandlerTest extends AbstractHandlerTest -{ - public function getHandleValueTestData() - { - return [ - ['12', new Token(Token::TYPE_NUMBER, '12', 0), ''], - ['12.34', new Token(Token::TYPE_NUMBER, '12.34', 0), ''], - ['+12.34', new Token(Token::TYPE_NUMBER, '+12.34', 0), ''], - ['-12.34', new Token(Token::TYPE_NUMBER, '-12.34', 0), ''], - - ['12 arg', new Token(Token::TYPE_NUMBER, '12', 0), ' arg'], - ['12]', new Token(Token::TYPE_NUMBER, '12', 0), ']'], - ]; - } - - public function getDontHandleValueTestData() - { - return [ - ['hello'], - ['>'], - ['+'], - [' '], - ['/* comment */'], - ]; - } - - protected function generateHandler() - { - $patterns = new TokenizerPatterns(); - - return new NumberHandler($patterns); - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/StringHandlerTest.php b/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/StringHandlerTest.php deleted file mode 100644 index a7707525..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/StringHandlerTest.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Parser\Handler; - -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Handler\StringHandler; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Token; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerEscaping; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns; - -class StringHandlerTest extends AbstractHandlerTest -{ - public function getHandleValueTestData() - { - return [ - ['"hello"', new Token(Token::TYPE_STRING, 'hello', 1), ''], - ['"1"', new Token(Token::TYPE_STRING, '1', 1), ''], - ['" "', new Token(Token::TYPE_STRING, ' ', 1), ''], - ['""', new Token(Token::TYPE_STRING, '', 1), ''], - ["'hello'", new Token(Token::TYPE_STRING, 'hello', 1), ''], - - ["'foo'bar", new Token(Token::TYPE_STRING, 'foo', 1), 'bar'], - ]; - } - - public function getDontHandleValueTestData() - { - return [ - ['hello'], - ['>'], - ['1'], - [' '], - ]; - } - - protected function generateHandler() - { - $patterns = new TokenizerPatterns(); - - return new StringHandler($patterns, new TokenizerEscaping($patterns)); - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/WhitespaceHandlerTest.php b/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/WhitespaceHandlerTest.php deleted file mode 100644 index 2b05aeca..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/WhitespaceHandlerTest.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Parser\Handler; - -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Handler\WhitespaceHandler; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Token; - -class WhitespaceHandlerTest extends AbstractHandlerTest -{ - public function getHandleValueTestData() - { - return [ - [' ', new Token(Token::TYPE_WHITESPACE, ' ', 0), ''], - ["\n", new Token(Token::TYPE_WHITESPACE, "\n", 0), ''], - ["\t", new Token(Token::TYPE_WHITESPACE, "\t", 0), ''], - - [' foo', new Token(Token::TYPE_WHITESPACE, ' ', 0), 'foo'], - [' .foo', new Token(Token::TYPE_WHITESPACE, ' ', 0), '.foo'], - ]; - } - - public function getDontHandleValueTestData() - { - return [ - ['>'], - ['1'], - ['a'], - ]; - } - - protected function generateHandler() - { - return new WhitespaceHandler(); - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Parser/ParserTest.php b/lib/Symfony/Component/CssSelector/Tests/Parser/ParserTest.php deleted file mode 100644 index 030ce734..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Parser/ParserTest.php +++ /dev/null @@ -1,253 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Parser; - -use PHPUnit\Framework\TestCase; -use SimplePay\Vendor\Symfony\Component\CssSelector\Exception\SyntaxErrorException; -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\FunctionNode; -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\SelectorNode; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Parser; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Token; - -class ParserTest extends TestCase -{ - /** @dataProvider getParserTestData */ - public function testParser($source, $representation) - { - $parser = new Parser(); - - $this->assertEquals($representation, array_map(function (SelectorNode $node) { - return (string) $node->getTree(); - }, $parser->parse($source))); - } - - /** @dataProvider getParserExceptionTestData */ - public function testParserException($source, $message) - { - $parser = new Parser(); - - try { - $parser->parse($source); - $this->fail('Parser should throw a SyntaxErrorException.'); - } catch (SyntaxErrorException $e) { - $this->assertEquals($message, $e->getMessage()); - } - } - - /** @dataProvider getPseudoElementsTestData */ - public function testPseudoElements($source, $element, $pseudo) - { - $parser = new Parser(); - $selectors = $parser->parse($source); - $this->assertCount(1, $selectors); - - /** @var SelectorNode $selector */ - $selector = $selectors[0]; - $this->assertEquals($element, (string) $selector->getTree()); - $this->assertEquals($pseudo, (string) $selector->getPseudoElement()); - } - - /** @dataProvider getSpecificityTestData */ - public function testSpecificity($source, $value) - { - $parser = new Parser(); - $selectors = $parser->parse($source); - $this->assertCount(1, $selectors); - - /** @var SelectorNode $selector */ - $selector = $selectors[0]; - $this->assertEquals($value, $selector->getSpecificity()->getValue()); - } - - /** @dataProvider getParseSeriesTestData */ - public function testParseSeries($series, $a, $b) - { - $parser = new Parser(); - $selectors = $parser->parse(sprintf(':nth-child(%s)', $series)); - $this->assertCount(1, $selectors); - - /** @var FunctionNode $function */ - $function = $selectors[0]->getTree(); - $this->assertEquals([$a, $b], Parser::parseSeries($function->getArguments())); - } - - /** @dataProvider getParseSeriesExceptionTestData */ - public function testParseSeriesException($series) - { - $parser = new Parser(); - $selectors = $parser->parse(sprintf(':nth-child(%s)', $series)); - $this->assertCount(1, $selectors); - - /** @var FunctionNode $function */ - $function = $selectors[0]->getTree(); - $this->expectException('SimplePay\Vendor\Symfony\Component\CssSelector\Exception\SyntaxErrorException'); - Parser::parseSeries($function->getArguments()); - } - - public function getParserTestData() - { - return [ - ['*', ['Element[*]']], - ['*|*', ['Element[*]']], - ['*|foo', ['Element[foo]']], - ['foo|*', ['Element[foo|*]']], - ['foo|bar', ['Element[foo|bar]']], - ['#foo#bar', ['Hash[Hash[Element[*]#foo]#bar]']], - ['div>.foo', ['CombinedSelector[Element[div] > Class[Element[*].foo]]']], - ['div> .foo', ['CombinedSelector[Element[div] > Class[Element[*].foo]]']], - ['div >.foo', ['CombinedSelector[Element[div] > Class[Element[*].foo]]']], - ['div > .foo', ['CombinedSelector[Element[div] > Class[Element[*].foo]]']], - ["div \n> \t \t .foo", ['CombinedSelector[Element[div] > Class[Element[*].foo]]']], - ['td.foo,.bar', ['Class[Element[td].foo]', 'Class[Element[*].bar]']], - ['td.foo, .bar', ['Class[Element[td].foo]', 'Class[Element[*].bar]']], - ["td.foo\t\r\n\f ,\t\r\n\f .bar", ['Class[Element[td].foo]', 'Class[Element[*].bar]']], - ['td.foo,.bar', ['Class[Element[td].foo]', 'Class[Element[*].bar]']], - ['td.foo, .bar', ['Class[Element[td].foo]', 'Class[Element[*].bar]']], - ["td.foo\t\r\n\f ,\t\r\n\f .bar", ['Class[Element[td].foo]', 'Class[Element[*].bar]']], - ['div, td.foo, div.bar span', ['Element[div]', 'Class[Element[td].foo]', 'CombinedSelector[Class[Element[div].bar] Element[span]]']], - ['div > p', ['CombinedSelector[Element[div] > Element[p]]']], - ['td:first', ['Pseudo[Element[td]:first]']], - ['td :first', ['CombinedSelector[Element[td] Pseudo[Element[*]:first]]']], - ['a[name]', ['Attribute[Element[a][name]]']], - ["a[ name\t]", ['Attribute[Element[a][name]]']], - ['a [name]', ['CombinedSelector[Element[a] Attribute[Element[*][name]]]']], - ['[name="foo"]', ["Attribute[Element[*][name = 'foo']]"]], - ["[name='foo[1]']", ["Attribute[Element[*][name = 'foo[1]']]"]], - ["[name='foo[0][bar]']", ["Attribute[Element[*][name = 'foo[0][bar]']]"]], - ['a[rel="include"]', ["Attribute[Element[a][rel = 'include']]"]], - ['a[rel = include]', ["Attribute[Element[a][rel = 'include']]"]], - ["a[hreflang |= 'en']", ["Attribute[Element[a][hreflang |= 'en']]"]], - ['a[hreflang|=en]', ["Attribute[Element[a][hreflang |= 'en']]"]], - ['div:nth-child(10)', ["Function[Element[div]:nth-child(['10'])]"]], - [':nth-child(2n+2)', ["Function[Element[*]:nth-child(['2', 'n', '+2'])]"]], - ['div:nth-of-type(10)', ["Function[Element[div]:nth-of-type(['10'])]"]], - ['div div:nth-of-type(10) .aclass', ["CombinedSelector[CombinedSelector[Element[div] Function[Element[div]:nth-of-type(['10'])]] Class[Element[*].aclass]]"]], - ['label:only', ['Pseudo[Element[label]:only]']], - ['a:lang(fr)', ["Function[Element[a]:lang(['fr'])]"]], - ['div:contains("foo")', ["Function[Element[div]:contains(['foo'])]"]], - ['div#foobar', ['Hash[Element[div]#foobar]']], - ['div:not(div.foo)', ['Negation[Element[div]:not(Class[Element[div].foo])]']], - ['td ~ th', ['CombinedSelector[Element[td] ~ Element[th]]']], - ['.foo[data-bar][data-baz=0]', ["Attribute[Attribute[Class[Element[*].foo][data-bar]][data-baz = '0']]"]], - ]; - } - - public function getParserExceptionTestData() - { - return [ - ['attributes(href)/html/body/a', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '(', 10))->getMessage()], - ['attributes(href)', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '(', 10))->getMessage()], - ['html/body/a', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '/', 4))->getMessage()], - [' ', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_FILE_END, '', 1))->getMessage()], - ['div, ', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_FILE_END, '', 5))->getMessage()], - [' , div', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, ',', 1))->getMessage()], - ['p, , div', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, ',', 3))->getMessage()], - ['div > ', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_FILE_END, '', 6))->getMessage()], - [' > div', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '>', 2))->getMessage()], - ['foo|#bar', SyntaxErrorException::unexpectedToken('identifier or "*"', new Token(Token::TYPE_HASH, 'bar', 4))->getMessage()], - ['#.foo', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '#', 0))->getMessage()], - ['.#foo', SyntaxErrorException::unexpectedToken('identifier', new Token(Token::TYPE_HASH, 'foo', 1))->getMessage()], - [':#foo', SyntaxErrorException::unexpectedToken('identifier', new Token(Token::TYPE_HASH, 'foo', 1))->getMessage()], - ['[*]', SyntaxErrorException::unexpectedToken('"|"', new Token(Token::TYPE_DELIMITER, ']', 2))->getMessage()], - ['[foo|]', SyntaxErrorException::unexpectedToken('identifier', new Token(Token::TYPE_DELIMITER, ']', 5))->getMessage()], - ['[#]', SyntaxErrorException::unexpectedToken('identifier or "*"', new Token(Token::TYPE_DELIMITER, '#', 1))->getMessage()], - ['[foo=#]', SyntaxErrorException::unexpectedToken('string or identifier', new Token(Token::TYPE_DELIMITER, '#', 5))->getMessage()], - [':nth-child()', SyntaxErrorException::unexpectedToken('at least one argument', new Token(Token::TYPE_DELIMITER, ')', 11))->getMessage()], - ['[href]a', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_IDENTIFIER, 'a', 6))->getMessage()], - ['[rel:stylesheet]', SyntaxErrorException::unexpectedToken('operator', new Token(Token::TYPE_DELIMITER, ':', 4))->getMessage()], - ['[rel=stylesheet', SyntaxErrorException::unexpectedToken('"]"', new Token(Token::TYPE_FILE_END, '', 15))->getMessage()], - [':lang(fr', SyntaxErrorException::unexpectedToken('an argument', new Token(Token::TYPE_FILE_END, '', 8))->getMessage()], - [':contains("foo', SyntaxErrorException::unclosedString(10)->getMessage()], - ['foo!', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '!', 3))->getMessage()], - ]; - } - - public function getPseudoElementsTestData() - { - return [ - ['foo', 'Element[foo]', ''], - ['*', 'Element[*]', ''], - [':empty', 'Pseudo[Element[*]:empty]', ''], - [':BEfore', 'Element[*]', 'before'], - [':aftER', 'Element[*]', 'after'], - [':First-Line', 'Element[*]', 'first-line'], - [':First-Letter', 'Element[*]', 'first-letter'], - ['::befoRE', 'Element[*]', 'before'], - ['::AFter', 'Element[*]', 'after'], - ['::firsT-linE', 'Element[*]', 'first-line'], - ['::firsT-letteR', 'Element[*]', 'first-letter'], - ['::Selection', 'Element[*]', 'selection'], - ['foo:after', 'Element[foo]', 'after'], - ['foo::selection', 'Element[foo]', 'selection'], - ['lorem#ipsum ~ a#b.c[href]:empty::selection', 'CombinedSelector[Hash[Element[lorem]#ipsum] ~ Pseudo[Attribute[Class[Hash[Element[a]#b].c][href]]:empty]]', 'selection'], - ['video::-webkit-media-controls', 'Element[video]', '-webkit-media-controls'], - ]; - } - - public function getSpecificityTestData() - { - return [ - ['*', 0], - [' foo', 1], - [':empty ', 10], - [':before', 1], - ['*:before', 1], - [':nth-child(2)', 10], - ['.bar', 10], - ['[baz]', 10], - ['[baz="4"]', 10], - ['[baz^="4"]', 10], - ['#lipsum', 100], - [':not(*)', 0], - [':not(foo)', 1], - [':not(.foo)', 10], - [':not([foo])', 10], - [':not(:empty)', 10], - [':not(#foo)', 100], - ['foo:empty', 11], - ['foo:before', 2], - ['foo::before', 2], - ['foo:empty::before', 12], - ['#lorem + foo#ipsum:first-child > bar:first-line', 213], - ]; - } - - public function getParseSeriesTestData() - { - return [ - ['1n+3', 1, 3], - ['1n +3', 1, 3], - ['1n + 3', 1, 3], - ['1n+ 3', 1, 3], - ['1n-3', 1, -3], - ['1n -3', 1, -3], - ['1n - 3', 1, -3], - ['1n- 3', 1, -3], - ['n-5', 1, -5], - ['odd', 2, 1], - ['even', 2, 0], - ['3n', 3, 0], - ['n', 1, 0], - ['+n', 1, 0], - ['-n', -1, 0], - ['5', 0, 5], - ]; - } - - public function getParseSeriesExceptionTestData() - { - return [ - ['foo'], - ['n+'], - ]; - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Parser/ReaderTest.php b/lib/Symfony/Component/CssSelector/Tests/Parser/ReaderTest.php deleted file mode 100644 index 72c04698..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Parser/ReaderTest.php +++ /dev/null @@ -1,102 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Parser; - -use PHPUnit\Framework\TestCase; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Reader; - -class ReaderTest extends TestCase -{ - public function testIsEOF() - { - $reader = new Reader(''); - $this->assertTrue($reader->isEOF()); - - $reader = new Reader('hello'); - $this->assertFalse($reader->isEOF()); - - $this->assignPosition($reader, 2); - $this->assertFalse($reader->isEOF()); - - $this->assignPosition($reader, 5); - $this->assertTrue($reader->isEOF()); - } - - public function testGetRemainingLength() - { - $reader = new Reader('hello'); - $this->assertEquals(5, $reader->getRemainingLength()); - - $this->assignPosition($reader, 2); - $this->assertEquals(3, $reader->getRemainingLength()); - - $this->assignPosition($reader, 5); - $this->assertEquals(0, $reader->getRemainingLength()); - } - - public function testGetSubstring() - { - $reader = new Reader('hello'); - $this->assertEquals('he', $reader->getSubstring(2)); - $this->assertEquals('el', $reader->getSubstring(2, 1)); - - $this->assignPosition($reader, 2); - $this->assertEquals('ll', $reader->getSubstring(2)); - $this->assertEquals('lo', $reader->getSubstring(2, 1)); - } - - public function testGetOffset() - { - $reader = new Reader('hello'); - $this->assertEquals(2, $reader->getOffset('ll')); - $this->assertFalse($reader->getOffset('w')); - - $this->assignPosition($reader, 2); - $this->assertEquals(0, $reader->getOffset('ll')); - $this->assertFalse($reader->getOffset('he')); - } - - public function testFindPattern() - { - $reader = new Reader('hello'); - - $this->assertFalse($reader->findPattern('/world/')); - $this->assertEquals(['hello', 'h'], $reader->findPattern('/^([a-z]).*/')); - - $this->assignPosition($reader, 2); - $this->assertFalse($reader->findPattern('/^h.*/')); - $this->assertEquals(['llo'], $reader->findPattern('/^llo$/')); - } - - public function testMoveForward() - { - $reader = new Reader('hello'); - $this->assertEquals(0, $reader->getPosition()); - - $reader->moveForward(2); - $this->assertEquals(2, $reader->getPosition()); - } - - public function testToEnd() - { - $reader = new Reader('hello'); - $reader->moveToEnd(); - $this->assertTrue($reader->isEOF()); - } - - private function assignPosition(Reader $reader, $value) - { - $position = new \ReflectionProperty($reader, 'position'); - $position->setAccessible(true); - $position->setValue($reader, $value); - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Parser/Shortcut/ClassParserTest.php b/lib/Symfony/Component/CssSelector/Tests/Parser/Shortcut/ClassParserTest.php deleted file mode 100644 index c0cbc60c..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Parser/Shortcut/ClassParserTest.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Parser\Shortcut; - -use PHPUnit\Framework\TestCase; -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\SelectorNode; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Shortcut\ClassParser; - -/** - * @author Jean-François Simon - */ -class ClassParserTest extends TestCase -{ - /** @dataProvider getParseTestData */ - public function testParse($source, $representation) - { - $parser = new ClassParser(); - $selectors = $parser->parse($source); - $this->assertCount(1, $selectors); - - /** @var SelectorNode $selector */ - $selector = $selectors[0]; - $this->assertEquals($representation, (string) $selector->getTree()); - } - - public function getParseTestData() - { - return [ - ['.testclass', 'Class[Element[*].testclass]'], - ['testel.testclass', 'Class[Element[testel].testclass]'], - ['testns|.testclass', 'Class[Element[testns|*].testclass]'], - ['testns|*.testclass', 'Class[Element[testns|*].testclass]'], - ['testns|testel.testclass', 'Class[Element[testns|testel].testclass]'], - ]; - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Parser/Shortcut/ElementParserTest.php b/lib/Symfony/Component/CssSelector/Tests/Parser/Shortcut/ElementParserTest.php deleted file mode 100644 index 71cda4ae..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Parser/Shortcut/ElementParserTest.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Parser\Shortcut; - -use PHPUnit\Framework\TestCase; -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\SelectorNode; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Shortcut\ElementParser; - -/** - * @author Jean-François Simon - */ -class ElementParserTest extends TestCase -{ - /** @dataProvider getParseTestData */ - public function testParse($source, $representation) - { - $parser = new ElementParser(); - $selectors = $parser->parse($source); - $this->assertCount(1, $selectors); - - /** @var SelectorNode $selector */ - $selector = $selectors[0]; - $this->assertEquals($representation, (string) $selector->getTree()); - } - - public function getParseTestData() - { - return [ - ['*', 'Element[*]'], - ['testel', 'Element[testel]'], - ['testns|*', 'Element[testns|*]'], - ['testns|testel', 'Element[testns|testel]'], - ]; - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Parser/Shortcut/EmptyStringParserTest.php b/lib/Symfony/Component/CssSelector/Tests/Parser/Shortcut/EmptyStringParserTest.php deleted file mode 100644 index 638d8fb8..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Parser/Shortcut/EmptyStringParserTest.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Parser\Shortcut; - -use PHPUnit\Framework\TestCase; -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\SelectorNode; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Shortcut\EmptyStringParser; - -/** - * @author Jean-François Simon - */ -class EmptyStringParserTest extends TestCase -{ - public function testParse() - { - $parser = new EmptyStringParser(); - $selectors = $parser->parse(''); - $this->assertCount(1, $selectors); - - /** @var SelectorNode $selector */ - $selector = $selectors[0]; - $this->assertEquals('Element[*]', (string) $selector->getTree()); - - $selectors = $parser->parse('this will produce an empty array'); - $this->assertCount(0, $selectors); - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Parser/Shortcut/HashParserTest.php b/lib/Symfony/Component/CssSelector/Tests/Parser/Shortcut/HashParserTest.php deleted file mode 100644 index f86bf8d9..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Parser/Shortcut/HashParserTest.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Parser\Shortcut; - -use PHPUnit\Framework\TestCase; -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\SelectorNode; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Shortcut\HashParser; - -/** - * @author Jean-François Simon - */ -class HashParserTest extends TestCase -{ - /** @dataProvider getParseTestData */ - public function testParse($source, $representation) - { - $parser = new HashParser(); - $selectors = $parser->parse($source); - $this->assertCount(1, $selectors); - - /** @var SelectorNode $selector */ - $selector = $selectors[0]; - $this->assertEquals($representation, (string) $selector->getTree()); - } - - public function getParseTestData() - { - return [ - ['#testid', 'Hash[Element[*]#testid]'], - ['testel#testid', 'Hash[Element[testel]#testid]'], - ['testns|#testid', 'Hash[Element[testns|*]#testid]'], - ['testns|*#testid', 'Hash[Element[testns|*]#testid]'], - ['testns|testel#testid', 'Hash[Element[testns|testel]#testid]'], - ]; - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Parser/TokenStreamTest.php b/lib/Symfony/Component/CssSelector/Tests/Parser/TokenStreamTest.php deleted file mode 100644 index c5917981..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Parser/TokenStreamTest.php +++ /dev/null @@ -1,96 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Parser; - -use PHPUnit\Framework\TestCase; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Token; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\TokenStream; - -class TokenStreamTest extends TestCase -{ - public function testGetNext() - { - $stream = new TokenStream(); - $stream->push($t1 = new Token(Token::TYPE_IDENTIFIER, 'h1', 0)); - $stream->push($t2 = new Token(Token::TYPE_DELIMITER, '.', 2)); - $stream->push($t3 = new Token(Token::TYPE_IDENTIFIER, 'title', 3)); - - $this->assertSame($t1, $stream->getNext()); - $this->assertSame($t2, $stream->getNext()); - $this->assertSame($t3, $stream->getNext()); - } - - public function testGetPeek() - { - $stream = new TokenStream(); - $stream->push($t1 = new Token(Token::TYPE_IDENTIFIER, 'h1', 0)); - $stream->push($t2 = new Token(Token::TYPE_DELIMITER, '.', 2)); - $stream->push($t3 = new Token(Token::TYPE_IDENTIFIER, 'title', 3)); - - $this->assertSame($t1, $stream->getPeek()); - $this->assertSame($t1, $stream->getNext()); - $this->assertSame($t2, $stream->getPeek()); - $this->assertSame($t2, $stream->getPeek()); - $this->assertSame($t2, $stream->getNext()); - } - - public function testGetNextIdentifier() - { - $stream = new TokenStream(); - $stream->push(new Token(Token::TYPE_IDENTIFIER, 'h1', 0)); - - $this->assertEquals('h1', $stream->getNextIdentifier()); - } - - public function testFailToGetNextIdentifier() - { - $this->expectException('SimplePay\Vendor\Symfony\Component\CssSelector\Exception\SyntaxErrorException'); - - $stream = new TokenStream(); - $stream->push(new Token(Token::TYPE_DELIMITER, '.', 2)); - $stream->getNextIdentifier(); - } - - public function testGetNextIdentifierOrStar() - { - $stream = new TokenStream(); - - $stream->push(new Token(Token::TYPE_IDENTIFIER, 'h1', 0)); - $this->assertEquals('h1', $stream->getNextIdentifierOrStar()); - - $stream->push(new Token(Token::TYPE_DELIMITER, '*', 0)); - $this->assertNull($stream->getNextIdentifierOrStar()); - } - - public function testFailToGetNextIdentifierOrStar() - { - $this->expectException('SimplePay\Vendor\Symfony\Component\CssSelector\Exception\SyntaxErrorException'); - - $stream = new TokenStream(); - $stream->push(new Token(Token::TYPE_DELIMITER, '.', 2)); - $stream->getNextIdentifierOrStar(); - } - - public function testSkipWhitespace() - { - $stream = new TokenStream(); - $stream->push($t1 = new Token(Token::TYPE_IDENTIFIER, 'h1', 0)); - $stream->push($t2 = new Token(Token::TYPE_WHITESPACE, ' ', 2)); - $stream->push($t3 = new Token(Token::TYPE_IDENTIFIER, 'h1', 3)); - - $stream->skipWhitespace(); - $this->assertSame($t1, $stream->getNext()); - - $stream->skipWhitespace(); - $this->assertSame($t3, $stream->getNext()); - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/XPath/Fixtures/ids.html b/lib/Symfony/Component/CssSelector/Tests/XPath/Fixtures/ids.html deleted file mode 100644 index 5799fad2..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/XPath/Fixtures/ids.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - -
- - - - link -
    -
  1. content
  2. -
  3. -
    -
    -
  4. -
  5. -
  6. -
  7. -
  8. -
  9. -
-

- hi there - guy - - - - - - - -

- - -
-

-
    -
- - - - -
-
- diff --git a/lib/Symfony/Component/CssSelector/Tests/XPath/Fixtures/lang.xml b/lib/Symfony/Component/CssSelector/Tests/XPath/Fixtures/lang.xml deleted file mode 100644 index 14f8dbed..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/XPath/Fixtures/lang.xml +++ /dev/null @@ -1,11 +0,0 @@ - - a - b - c - d - e - f - - - - diff --git a/lib/Symfony/Component/CssSelector/Tests/XPath/Fixtures/shakespear.html b/lib/Symfony/Component/CssSelector/Tests/XPath/Fixtures/shakespear.html deleted file mode 100644 index 15d1ad33..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/XPath/Fixtures/shakespear.html +++ /dev/null @@ -1,308 +0,0 @@ - - - - - - -
-
-

As You Like It

-
- by William Shakespeare -
-
-

ACT I, SCENE III. A room in the palace.

-
-
Enter CELIA and ROSALIND
-
-
CELIA
-
-
Why, cousin! why, Rosalind! Cupid have mercy! not a word?
-
-
ROSALIND
-
-
Not one to throw at a dog.
-
-
CELIA
-
-
No, thy words are too precious to be cast away upon
-
curs; throw some of them at me; come, lame me with reasons.
-
-
ROSALIND
-
CELIA
-
-
But is all this for your father?
-
-
-
Then there were two cousins laid up; when the one
-
should be lamed with reasons and the other mad
-
without any.
-
-
ROSALIND
-
-
No, some of it is for my child's father. O, how
-
full of briers is this working-day world!
-
-
CELIA
-
-
They are but burs, cousin, thrown upon thee in
-
holiday foolery: if we walk not in the trodden
-
paths our very petticoats will catch them.
-
-
ROSALIND
-
-
I could shake them off my coat: these burs are in my heart.
-
-
CELIA
-
-
Hem them away.
-
-
ROSALIND
-
-
I would try, if I could cry 'hem' and have him.
-
-
CELIA
-
-
Come, come, wrestle with thy affections.
-
-
ROSALIND
-
-
O, they take the part of a better wrestler than myself!
-
-
CELIA
-
-
O, a good wish upon you! you will try in time, in
-
despite of a fall. But, turning these jests out of
-
service, let us talk in good earnest: is it
-
possible, on such a sudden, you should fall into so
-
strong a liking with old Sir Rowland's youngest son?
-
-
ROSALIND
-
-
The duke my father loved his father dearly.
-
-
CELIA
-
-
Doth it therefore ensue that you should love his son
-
dearly? By this kind of chase, I should hate him,
-
for my father hated his father dearly; yet I hate
-
not Orlando.
-
-
ROSALIND
-
-
No, faith, hate him not, for my sake.
-
-
CELIA
-
-
Why should I not? doth he not deserve well?
-
-
ROSALIND
-
-
Let me love him for that, and do you love him
-
because I do. Look, here comes the duke.
-
-
CELIA
-
-
With his eyes full of anger.
-
Enter DUKE FREDERICK, with Lords
-
-
DUKE FREDERICK
-
-
Mistress, dispatch you with your safest haste
-
And get you from our court.
-
-
ROSALIND
-
-
Me, uncle?
-
-
DUKE FREDERICK
-
-
You, cousin
-
Within these ten days if that thou be'st found
-
So near our public court as twenty miles,
-
Thou diest for it.
-
-
ROSALIND
-
-
I do beseech your grace,
-
Let me the knowledge of my fault bear with me:
-
If with myself I hold intelligence
-
Or have acquaintance with mine own desires,
-
If that I do not dream or be not frantic,--
-
As I do trust I am not--then, dear uncle,
-
Never so much as in a thought unborn
-
Did I offend your highness.
-
-
DUKE FREDERICK
-
-
Thus do all traitors:
-
If their purgation did consist in words,
-
They are as innocent as grace itself:
-
Let it suffice thee that I trust thee not.
-
-
ROSALIND
-
-
Yet your mistrust cannot make me a traitor:
-
Tell me whereon the likelihood depends.
-
-
DUKE FREDERICK
-
-
Thou art thy father's daughter; there's enough.
-
-
ROSALIND
-
-
So was I when your highness took his dukedom;
-
So was I when your highness banish'd him:
-
Treason is not inherited, my lord;
-
Or, if we did derive it from our friends,
-
What's that to me? my father was no traitor:
-
Then, good my liege, mistake me not so much
-
To think my poverty is treacherous.
-
-
CELIA
-
-
Dear sovereign, hear me speak.
-
-
DUKE FREDERICK
-
-
Ay, Celia; we stay'd her for your sake,
-
Else had she with her father ranged along.
-
-
CELIA
-
-
I did not then entreat to have her stay;
-
It was your pleasure and your own remorse:
-
I was too young that time to value her;
-
But now I know her: if she be a traitor,
-
Why so am I; we still have slept together,
-
Rose at an instant, learn'd, play'd, eat together,
-
And wheresoever we went, like Juno's swans,
-
Still we went coupled and inseparable.
-
-
DUKE FREDERICK
-
-
She is too subtle for thee; and her smoothness,
-
Her very silence and her patience
-
Speak to the people, and they pity her.
-
Thou art a fool: she robs thee of thy name;
-
And thou wilt show more bright and seem more virtuous
-
When she is gone. Then open not thy lips:
-
Firm and irrevocable is my doom
-
Which I have pass'd upon her; she is banish'd.
-
-
CELIA
-
-
Pronounce that sentence then on me, my liege:
-
I cannot live out of her company.
-
-
DUKE FREDERICK
-
-
You are a fool. You, niece, provide yourself:
-
If you outstay the time, upon mine honour,
-
And in the greatness of my word, you die.
-
Exeunt DUKE FREDERICK and Lords
-
-
CELIA
-
-
O my poor Rosalind, whither wilt thou go?
-
Wilt thou change fathers? I will give thee mine.
-
I charge thee, be not thou more grieved than I am.
-
-
ROSALIND
-
-
I have more cause.
-
-
CELIA
-
-
Thou hast not, cousin;
-
Prithee be cheerful: know'st thou not, the duke
-
Hath banish'd me, his daughter?
-
-
ROSALIND
-
-
That he hath not.
-
-
CELIA
-
-
No, hath not? Rosalind lacks then the love
-
Which teacheth thee that thou and I am one:
-
Shall we be sunder'd? shall we part, sweet girl?
-
No: let my father seek another heir.
-
Therefore devise with me how we may fly,
-
Whither to go and what to bear with us;
-
And do not seek to take your change upon you,
-
To bear your griefs yourself and leave me out;
-
For, by this heaven, now at our sorrows pale,
-
Say what thou canst, I'll go along with thee.
-
-
ROSALIND
-
-
Why, whither shall we go?
-
-
CELIA
-
-
To seek my uncle in the forest of Arden.
-
-
ROSALIND
-
-
Alas, what danger will it be to us,
-
Maids as we are, to travel forth so far!
-
Beauty provoketh thieves sooner than gold.
-
-
CELIA
-
-
I'll put myself in poor and mean attire
-
And with a kind of umber smirch my face;
-
The like do you: so shall we pass along
-
And never stir assailants.
-
-
ROSALIND
-
-
Were it not better,
-
Because that I am more than common tall,
-
That I did suit me all points like a man?
-
A gallant curtle-axe upon my thigh,
-
A boar-spear in my hand; and--in my heart
-
Lie there what hidden woman's fear there will--
-
We'll have a swashing and a martial outside,
-
As many other mannish cowards have
-
That do outface it with their semblances.
-
-
CELIA
-
-
What shall I call thee when thou art a man?
-
-
ROSALIND
-
-
I'll have no worse a name than Jove's own page;
-
And therefore look you call me Ganymede.
-
But what will you be call'd?
-
-
CELIA
-
-
Something that hath a reference to my state
-
No longer Celia, but Aliena.
-
-
ROSALIND
-
-
But, cousin, what if we assay'd to steal
-
The clownish fool out of your father's court?
-
Would he not be a comfort to our travel?
-
-
CELIA
-
-
He'll go along o'er the wide world with me;
-
Leave me alone to woo him. Let's away,
-
And get our jewels and our wealth together,
-
Devise the fittest time and safest way
-
To hide us from pursuit that will be made
-
After my flight. Now go we in content
-
To liberty and not to banishment.
-
Exeunt
-
-
-
-
- - diff --git a/lib/Symfony/Component/CssSelector/Tests/XPath/TranslatorTest.php b/lib/Symfony/Component/CssSelector/Tests/XPath/TranslatorTest.php deleted file mode 100644 index 66c8f8b0..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/XPath/TranslatorTest.php +++ /dev/null @@ -1,413 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\XPath; - -use PHPUnit\Framework\TestCase; -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\ElementNode; -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\FunctionNode; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Parser; -use SimplePay\Vendor\Symfony\Component\CssSelector\XPath\Extension\HtmlExtension; -use SimplePay\Vendor\Symfony\Component\CssSelector\XPath\Translator; -use SimplePay\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr; - -class TranslatorTest extends TestCase -{ - /** @dataProvider getXpathLiteralTestData */ - public function testXpathLiteral($value, $literal) - { - $this->assertEquals($literal, Translator::getXpathLiteral($value)); - } - - /** @dataProvider getCssToXPathTestData */ - public function testCssToXPath($css, $xpath) - { - $translator = new Translator(); - $translator->registerExtension(new HtmlExtension($translator)); - $this->assertEquals($xpath, $translator->cssToXPath($css, '')); - } - - public function testCssToXPathPseudoElement() - { - $this->expectException('SimplePay\Vendor\Symfony\Component\CssSelector\Exception\ExpressionErrorException'); - $translator = new Translator(); - $translator->registerExtension(new HtmlExtension($translator)); - $translator->cssToXPath('e::first-line'); - } - - public function testGetExtensionNotExistsExtension() - { - $this->expectException('SimplePay\Vendor\Symfony\Component\CssSelector\Exception\ExpressionErrorException'); - $translator = new Translator(); - $translator->registerExtension(new HtmlExtension($translator)); - $translator->getExtension('fake'); - } - - public function testAddCombinationNotExistsExtension() - { - $this->expectException('SimplePay\Vendor\Symfony\Component\CssSelector\Exception\ExpressionErrorException'); - $translator = new Translator(); - $translator->registerExtension(new HtmlExtension($translator)); - $parser = new Parser(); - $xpath = $parser->parse('*')[0]; - $combinedXpath = $parser->parse('*')[0]; - $translator->addCombination('fake', $xpath, $combinedXpath); - } - - public function testAddFunctionNotExistsFunction() - { - $this->expectException('SimplePay\Vendor\Symfony\Component\CssSelector\Exception\ExpressionErrorException'); - $translator = new Translator(); - $translator->registerExtension(new HtmlExtension($translator)); - $xpath = new XPathExpr(); - $function = new FunctionNode(new ElementNode(), 'fake'); - $translator->addFunction($xpath, $function); - } - - public function testAddPseudoClassNotExistsClass() - { - $this->expectException('SimplePay\Vendor\Symfony\Component\CssSelector\Exception\ExpressionErrorException'); - $translator = new Translator(); - $translator->registerExtension(new HtmlExtension($translator)); - $xpath = new XPathExpr(); - $translator->addPseudoClass($xpath, 'fake'); - } - - public function testAddAttributeMatchingClassNotExistsClass() - { - $this->expectException('SimplePay\Vendor\Symfony\Component\CssSelector\Exception\ExpressionErrorException'); - $translator = new Translator(); - $translator->registerExtension(new HtmlExtension($translator)); - $xpath = new XPathExpr(); - $translator->addAttributeMatching($xpath, '', '', ''); - } - - /** @dataProvider getXmlLangTestData */ - public function testXmlLang($css, array $elementsId) - { - $translator = new Translator(); - $document = new \SimpleXMLElement(file_get_contents(__DIR__.'/Fixtures/lang.xml')); - $elements = $document->xpath($translator->cssToXPath($css)); - $this->assertCount(\count($elementsId), $elements); - foreach ($elements as $element) { - $this->assertContains((string) $element->attributes()->id, $elementsId); - } - } - - /** @dataProvider getHtmlIdsTestData */ - public function testHtmlIds($css, array $elementsId) - { - $translator = new Translator(); - $translator->registerExtension(new HtmlExtension($translator)); - $document = new \DOMDocument(); - $document->strictErrorChecking = false; - $internalErrors = libxml_use_internal_errors(true); - $document->loadHTMLFile(__DIR__.'/Fixtures/ids.html'); - $document = simplexml_import_dom($document); - $elements = $document->xpath($translator->cssToXPath($css)); - $this->assertCount(\count($elementsId), $elementsId); - foreach ($elements as $element) { - if (null !== $element->attributes()->id) { - $this->assertContains((string) $element->attributes()->id, $elementsId); - } - } - libxml_clear_errors(); - libxml_use_internal_errors($internalErrors); - } - - /** @dataProvider getHtmlShakespearTestData */ - public function testHtmlShakespear($css, $count) - { - $translator = new Translator(); - $translator->registerExtension(new HtmlExtension($translator)); - $document = new \DOMDocument(); - $document->strictErrorChecking = false; - $document->loadHTMLFile(__DIR__.'/Fixtures/shakespear.html'); - $document = simplexml_import_dom($document); - $bodies = $document->xpath('//body'); - $elements = $bodies[0]->xpath($translator->cssToXPath($css)); - $this->assertCount($count, $elements); - } - - public function testOnlyOfTypeFindsSingleChildrenOfGivenType() - { - $translator = new Translator(); - $translator->registerExtension(new HtmlExtension($translator)); - $document = new \DOMDocument(); - $document->loadHTML(<<<'HTML' - - -

- A -

-

- B - C -

- - -HTML -); - - $xpath = new \DOMXPath($document); - $nodeList = $xpath->query($translator->cssToXPath('span:only-of-type')); - - $this->assertSame(1, $nodeList->length); - $this->assertSame('A', $nodeList->item(0)->textContent); - } - - public function getXpathLiteralTestData() - { - return [ - ['foo', "'foo'"], - ["foo's bar", '"foo\'s bar"'], - ["foo's \"middle\" bar", 'concat(\'foo\', "\'", \'s "middle" bar\')'], - ["foo's 'middle' \"bar\"", 'concat(\'foo\', "\'", \'s \', "\'", \'middle\', "\'", \' "bar"\')'], - ]; - } - - public function getCssToXPathTestData() - { - return [ - ['*', '*'], - ['e', 'e'], - ['*|e', 'e'], - ['e|f', 'e:f'], - ['e[foo]', 'e[@foo]'], - ['e[foo|bar]', 'e[@foo:bar]'], - ['e[foo="bar"]', "e[@foo = 'bar']"], - ['e[foo~="bar"]', "e[@foo and contains(concat(' ', normalize-space(@foo), ' '), ' bar ')]"], - ['e[foo^="bar"]', "e[@foo and starts-with(@foo, 'bar')]"], - ['e[foo$="bar"]', "e[@foo and substring(@foo, string-length(@foo)-2) = 'bar']"], - ['e[foo*="bar"]', "e[@foo and contains(@foo, 'bar')]"], - ['e[foo!="bar"]', "e[not(@foo) or @foo != 'bar']"], - ['e[foo!="bar"][foo!="baz"]', "e[(not(@foo) or @foo != 'bar') and (not(@foo) or @foo != 'baz')]"], - ['e[hreflang|="en"]', "e[@hreflang and (@hreflang = 'en' or starts-with(@hreflang, 'en-'))]"], - ['e:nth-child(1)', "*/*[(name() = 'e') and (position() = 1)]"], - ['e:nth-last-child(1)', "*/*[(name() = 'e') and (position() = last() - 0)]"], - ['e:nth-last-child(2n+2)', "*/*[(name() = 'e') and (last() - position() - 1 >= 0 and (last() - position() - 1) mod 2 = 0)]"], - ['e:nth-of-type(1)', '*/e[position() = 1]'], - ['e:nth-last-of-type(1)', '*/e[position() = last() - 0]'], - ['div e:nth-last-of-type(1) .aclass', "div/descendant-or-self::*/e[position() = last() - 0]/descendant-or-self::*/*[@class and contains(concat(' ', normalize-space(@class), ' '), ' aclass ')]"], - ['e:first-child', "*/*[(name() = 'e') and (position() = 1)]"], - ['e:last-child', "*/*[(name() = 'e') and (position() = last())]"], - ['e:first-of-type', '*/e[position() = 1]'], - ['e:last-of-type', '*/e[position() = last()]'], - ['e:only-child', "*/*[(name() = 'e') and (last() = 1)]"], - ['e:only-of-type', 'e[count(preceding-sibling::e)=0 and count(following-sibling::e)=0]'], - ['e:empty', 'e[not(*) and not(string-length())]'], - ['e:EmPTY', 'e[not(*) and not(string-length())]'], - ['e:root', 'e[not(parent::*)]'], - ['e:hover', 'e[0]'], - ['e:contains("foo")', "e[contains(string(.), 'foo')]"], - ['e:ConTains(foo)', "e[contains(string(.), 'foo')]"], - ['e.warning', "e[@class and contains(concat(' ', normalize-space(@class), ' '), ' warning ')]"], - ['e#myid', "e[@id = 'myid']"], - ['e:not(:nth-child(odd))', 'e[not(position() - 1 >= 0 and (position() - 1) mod 2 = 0)]'], - ['e:nOT(*)', 'e[0]'], - ['e f', 'e/descendant-or-self::*/f'], - ['e > f', 'e/f'], - ['e + f', "e/following-sibling::*[(name() = 'f') and (position() = 1)]"], - ['e ~ f', 'e/following-sibling::f'], - ['div#container p', "div[@id = 'container']/descendant-or-self::*/p"], - ]; - } - - public function getXmlLangTestData() - { - return [ - [':lang("EN")', ['first', 'second', 'third', 'fourth']], - [':lang("en-us")', ['second', 'fourth']], - [':lang(en-nz)', ['third']], - [':lang(fr)', ['fifth']], - [':lang(ru)', ['sixth']], - [":lang('ZH')", ['eighth']], - [':lang(de) :lang(zh)', ['eighth']], - [':lang(en), :lang(zh)', ['first', 'second', 'third', 'fourth', 'eighth']], - [':lang(es)', []], - ]; - } - - public function getHtmlIdsTestData() - { - return [ - ['div', ['outer-div', 'li-div', 'foobar-div']], - ['DIV', ['outer-div', 'li-div', 'foobar-div']], // case-insensitive in HTML - ['div div', ['li-div']], - ['div, div div', ['outer-div', 'li-div', 'foobar-div']], - ['a[name]', ['name-anchor']], - ['a[NAme]', ['name-anchor']], // case-insensitive in HTML: - ['a[rel]', ['tag-anchor', 'nofollow-anchor']], - ['a[rel="tag"]', ['tag-anchor']], - ['a[href*="localhost"]', ['tag-anchor']], - ['a[href*=""]', []], - ['a[href^="http"]', ['tag-anchor', 'nofollow-anchor']], - ['a[href^="http:"]', ['tag-anchor']], - ['a[href^=""]', []], - ['a[href$="org"]', ['nofollow-anchor']], - ['a[href$=""]', []], - ['div[foobar~="bc"]', ['foobar-div']], - ['div[foobar~="cde"]', ['foobar-div']], - ['[foobar~="ab bc"]', ['foobar-div']], - ['[foobar~=""]', []], - ['[foobar~=" \t"]', []], - ['div[foobar~="cd"]', []], - ['*[lang|="En"]', ['second-li']], - ['[lang|="En-us"]', ['second-li']], - // Attribute values are case sensitive - ['*[lang|="en"]', []], - ['[lang|="en-US"]', []], - ['*[lang|="e"]', []], - // ... :lang() is not. - [':lang("EN")', ['second-li', 'li-div']], - ['*:lang(en-US)', ['second-li', 'li-div']], - [':lang("e")', []], - ['li:nth-child(3)', ['third-li']], - ['li:nth-child(10)', []], - ['li:nth-child(2n)', ['second-li', 'fourth-li', 'sixth-li']], - ['li:nth-child(even)', ['second-li', 'fourth-li', 'sixth-li']], - ['li:nth-child(2n+0)', ['second-li', 'fourth-li', 'sixth-li']], - ['li:nth-child(+2n+1)', ['first-li', 'third-li', 'fifth-li', 'seventh-li']], - ['li:nth-child(odd)', ['first-li', 'third-li', 'fifth-li', 'seventh-li']], - ['li:nth-child(2n+4)', ['fourth-li', 'sixth-li']], - ['li:nth-child(3n+1)', ['first-li', 'fourth-li', 'seventh-li']], - ['li:nth-child(n)', ['first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li']], - ['li:nth-child(n-1)', ['first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li']], - ['li:nth-child(n+1)', ['first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li']], - ['li:nth-child(n+3)', ['third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li']], - ['li:nth-child(-n)', []], - ['li:nth-child(-n-1)', []], - ['li:nth-child(-n+1)', ['first-li']], - ['li:nth-child(-n+3)', ['first-li', 'second-li', 'third-li']], - ['li:nth-last-child(0)', []], - ['li:nth-last-child(2n)', ['second-li', 'fourth-li', 'sixth-li']], - ['li:nth-last-child(even)', ['second-li', 'fourth-li', 'sixth-li']], - ['li:nth-last-child(2n+2)', ['second-li', 'fourth-li', 'sixth-li']], - ['li:nth-last-child(n)', ['first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li']], - ['li:nth-last-child(n-1)', ['first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li']], - ['li:nth-last-child(n-3)', ['first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li']], - ['li:nth-last-child(n+1)', ['first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li']], - ['li:nth-last-child(n+3)', ['first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li']], - ['li:nth-last-child(-n)', []], - ['li:nth-last-child(-n-1)', []], - ['li:nth-last-child(-n+1)', ['seventh-li']], - ['li:nth-last-child(-n+3)', ['fifth-li', 'sixth-li', 'seventh-li']], - ['ol:first-of-type', ['first-ol']], - ['ol:nth-child(1)', ['first-ol']], - ['ol:nth-of-type(2)', ['second-ol']], - ['ol:nth-last-of-type(1)', ['second-ol']], - ['span:only-child', ['foobar-span']], - ['li div:only-child', ['li-div']], - ['div *:only-child', ['li-div', 'foobar-span']], - ['p:only-of-type', ['paragraph']], - ['a:empty', ['name-anchor']], - ['a:EMpty', ['name-anchor']], - ['li:empty', ['third-li', 'fourth-li', 'fifth-li', 'sixth-li']], - [':root', ['html']], - ['html:root', ['html']], - ['li:root', []], - ['* :root', []], - ['*:contains("link")', ['html', 'outer-div', 'tag-anchor', 'nofollow-anchor']], - [':CONtains("link")', ['html', 'outer-div', 'tag-anchor', 'nofollow-anchor']], - ['*:contains("LInk")', []], // case sensitive - ['*:contains("e")', ['html', 'nil', 'outer-div', 'first-ol', 'first-li', 'paragraph', 'p-em']], - ['*:contains("E")', []], // case-sensitive - ['.a', ['first-ol']], - ['.b', ['first-ol']], - ['*.a', ['first-ol']], - ['ol.a', ['first-ol']], - ['.c', ['first-ol', 'third-li', 'fourth-li']], - ['*.c', ['first-ol', 'third-li', 'fourth-li']], - ['ol *.c', ['third-li', 'fourth-li']], - ['ol li.c', ['third-li', 'fourth-li']], - ['li ~ li.c', ['third-li', 'fourth-li']], - ['ol > li.c', ['third-li', 'fourth-li']], - ['#first-li', ['first-li']], - ['li#first-li', ['first-li']], - ['*#first-li', ['first-li']], - ['li div', ['li-div']], - ['li > div', ['li-div']], - ['div div', ['li-div']], - ['div > div', []], - ['div>.c', ['first-ol']], - ['div > .c', ['first-ol']], - ['div + div', ['foobar-div']], - ['a ~ a', ['tag-anchor', 'nofollow-anchor']], - ['a[rel="tag"] ~ a', ['nofollow-anchor']], - ['ol#first-ol li:last-child', ['seventh-li']], - ['ol#first-ol *:last-child', ['li-div', 'seventh-li']], - ['#outer-div:first-child', ['outer-div']], - ['#outer-div :first-child', ['name-anchor', 'first-li', 'li-div', 'p-b', 'checkbox-fieldset-disabled', 'area-href']], - ['a[href]', ['tag-anchor', 'nofollow-anchor']], - [':not(*)', []], - ['a:not([href])', ['name-anchor']], - ['ol :Not(li[class])', ['first-li', 'second-li', 'li-div', 'fifth-li', 'sixth-li', 'seventh-li']], - // HTML-specific - [':link', ['link-href', 'tag-anchor', 'nofollow-anchor', 'area-href']], - [':visited', []], - [':enabled', ['link-href', 'tag-anchor', 'nofollow-anchor', 'checkbox-unchecked', 'text-checked', 'checkbox-checked', 'area-href']], - [':disabled', ['checkbox-disabled', 'checkbox-disabled-checked', 'fieldset', 'checkbox-fieldset-disabled']], - [':checked', ['checkbox-checked', 'checkbox-disabled-checked']], - ]; - } - - public function getHtmlShakespearTestData() - { - return [ - ['*', 246], - ['div:contains(CELIA)', 26], - ['div:only-child', 22], // ? - ['div:nth-child(even)', 106], - ['div:nth-child(2n)', 106], - ['div:nth-child(odd)', 137], - ['div:nth-child(2n+1)', 137], - ['div:nth-child(n)', 243], - ['div:last-child', 53], - ['div:first-child', 51], - ['div > div', 242], - ['div + div', 190], - ['div ~ div', 190], - ['body', 1], - ['body div', 243], - ['div', 243], - ['div div', 242], - ['div div div', 241], - ['div, div, div', 243], - ['div, a, span', 243], - ['.dialog', 51], - ['div.dialog', 51], - ['div .dialog', 51], - ['div.character, div.dialog', 99], - ['div.direction.dialog', 0], - ['div.dialog.direction', 0], - ['div.dialog.scene', 1], - ['div.scene.scene', 1], - ['div.scene .scene', 0], - ['div.direction .dialog ', 0], - ['div .dialog .direction', 4], - ['div.dialog .dialog .direction', 4], - ['#speech5', 1], - ['div#speech5', 1], - ['div #speech5', 1], - ['div.scene div.dialog', 49], - ['div#scene1 div.dialog div', 142], - ['#scene1 #speech1', 1], - ['div[class]', 103], - ['div[class=dialog]', 50], - ['div[class^=dia]', 51], - ['div[class$=log]', 50], - ['div[class*=sce]', 1], - ['div[class|=dialog]', 50], // ? Seems right - ['div[class!=madeup]', 243], // ? Seems right - ['div[class~=dialog]', 51], // ? Seems right - ]; - } -} diff --git a/lib/Symfony/Component/CssSelector/XPath/Extension/AbstractExtension.php b/lib/Symfony/Component/CssSelector/XPath/Extension/AbstractExtension.php index c7483c74..9db3fdc9 100644 --- a/lib/Symfony/Component/CssSelector/XPath/Extension/AbstractExtension.php +++ b/lib/Symfony/Component/CssSelector/XPath/Extension/AbstractExtension.php @@ -26,7 +26,7 @@ abstract class AbstractExtension implements ExtensionInterface /** * {@inheritdoc} */ - public function getNodeTranslators() + public function getNodeTranslators(): array { return []; } @@ -34,7 +34,7 @@ public function getNodeTranslators() /** * {@inheritdoc} */ - public function getCombinationTranslators() + public function getCombinationTranslators(): array { return []; } @@ -42,7 +42,7 @@ public function getCombinationTranslators() /** * {@inheritdoc} */ - public function getFunctionTranslators() + public function getFunctionTranslators(): array { return []; } @@ -50,7 +50,7 @@ public function getFunctionTranslators() /** * {@inheritdoc} */ - public function getPseudoClassTranslators() + public function getPseudoClassTranslators(): array { return []; } @@ -58,7 +58,7 @@ public function getPseudoClassTranslators() /** * {@inheritdoc} */ - public function getAttributeMatchingTranslators() + public function getAttributeMatchingTranslators(): array { return []; } diff --git a/lib/Symfony/Component/CssSelector/XPath/Extension/AttributeMatchingExtension.php b/lib/Symfony/Component/CssSelector/XPath/Extension/AttributeMatchingExtension.php index 6b555a31..70d3c331 100644 --- a/lib/Symfony/Component/CssSelector/XPath/Extension/AttributeMatchingExtension.php +++ b/lib/Symfony/Component/CssSelector/XPath/Extension/AttributeMatchingExtension.php @@ -29,7 +29,7 @@ class AttributeMatchingExtension extends AbstractExtension /** * {@inheritdoc} */ - public function getAttributeMatchingTranslators() + public function getAttributeMatchingTranslators(): array { return [ 'exists' => [$this, 'translateExists'], @@ -43,35 +43,17 @@ public function getAttributeMatchingTranslators() ]; } - /** - * @param string $attribute - * @param string $value - * - * @return XPathExpr - */ - public function translateExists(XPathExpr $xpath, $attribute, $value) + public function translateExists(XPathExpr $xpath, string $attribute, ?string $value): XPathExpr { return $xpath->addCondition($attribute); } - /** - * @param string $attribute - * @param string $value - * - * @return XPathExpr - */ - public function translateEquals(XPathExpr $xpath, $attribute, $value) + public function translateEquals(XPathExpr $xpath, string $attribute, ?string $value): XPathExpr { return $xpath->addCondition(sprintf('%s = %s', $attribute, Translator::getXpathLiteral($value))); } - /** - * @param string $attribute - * @param string $value - * - * @return XPathExpr - */ - public function translateIncludes(XPathExpr $xpath, $attribute, $value) + public function translateIncludes(XPathExpr $xpath, string $attribute, ?string $value): XPathExpr { return $xpath->addCondition($value ? sprintf( '%1$s and contains(concat(\' \', normalize-space(%1$s), \' \'), %2$s)', @@ -80,13 +62,7 @@ public function translateIncludes(XPathExpr $xpath, $attribute, $value) ) : '0'); } - /** - * @param string $attribute - * @param string $value - * - * @return XPathExpr - */ - public function translateDashMatch(XPathExpr $xpath, $attribute, $value) + public function translateDashMatch(XPathExpr $xpath, string $attribute, ?string $value): XPathExpr { return $xpath->addCondition(sprintf( '%1$s and (%1$s = %2$s or starts-with(%1$s, %3$s))', @@ -96,13 +72,7 @@ public function translateDashMatch(XPathExpr $xpath, $attribute, $value) )); } - /** - * @param string $attribute - * @param string $value - * - * @return XPathExpr - */ - public function translatePrefixMatch(XPathExpr $xpath, $attribute, $value) + public function translatePrefixMatch(XPathExpr $xpath, string $attribute, ?string $value): XPathExpr { return $xpath->addCondition($value ? sprintf( '%1$s and starts-with(%1$s, %2$s)', @@ -111,13 +81,7 @@ public function translatePrefixMatch(XPathExpr $xpath, $attribute, $value) ) : '0'); } - /** - * @param string $attribute - * @param string $value - * - * @return XPathExpr - */ - public function translateSuffixMatch(XPathExpr $xpath, $attribute, $value) + public function translateSuffixMatch(XPathExpr $xpath, string $attribute, ?string $value): XPathExpr { return $xpath->addCondition($value ? sprintf( '%1$s and substring(%1$s, string-length(%1$s)-%2$s) = %3$s', @@ -127,13 +91,7 @@ public function translateSuffixMatch(XPathExpr $xpath, $attribute, $value) ) : '0'); } - /** - * @param string $attribute - * @param string $value - * - * @return XPathExpr - */ - public function translateSubstringMatch(XPathExpr $xpath, $attribute, $value) + public function translateSubstringMatch(XPathExpr $xpath, string $attribute, ?string $value): XPathExpr { return $xpath->addCondition($value ? sprintf( '%1$s and contains(%1$s, %2$s)', @@ -142,13 +100,7 @@ public function translateSubstringMatch(XPathExpr $xpath, $attribute, $value) ) : '0'); } - /** - * @param string $attribute - * @param string $value - * - * @return XPathExpr - */ - public function translateDifferent(XPathExpr $xpath, $attribute, $value) + public function translateDifferent(XPathExpr $xpath, string $attribute, ?string $value): XPathExpr { return $xpath->addCondition(sprintf( $value ? 'not(%1$s) or %1$s != %2$s' : '%s != %s', @@ -160,7 +112,7 @@ public function translateDifferent(XPathExpr $xpath, $attribute, $value) /** * {@inheritdoc} */ - public function getName() + public function getName(): string { return 'attribute-matching'; } diff --git a/lib/Symfony/Component/CssSelector/XPath/Extension/CombinationExtension.php b/lib/Symfony/Component/CssSelector/XPath/Extension/CombinationExtension.php index 75207ad3..7e589c58 100644 --- a/lib/Symfony/Component/CssSelector/XPath/Extension/CombinationExtension.php +++ b/lib/Symfony/Component/CssSelector/XPath/Extension/CombinationExtension.php @@ -28,7 +28,7 @@ class CombinationExtension extends AbstractExtension /** * {@inheritdoc} */ - public function getCombinationTranslators() + public function getCombinationTranslators(): array { return [ ' ' => [$this, 'translateDescendant'], @@ -38,26 +38,17 @@ public function getCombinationTranslators() ]; } - /** - * @return XPathExpr - */ - public function translateDescendant(XPathExpr $xpath, XPathExpr $combinedXpath) + public function translateDescendant(XPathExpr $xpath, XPathExpr $combinedXpath): XPathExpr { return $xpath->join('/descendant-or-self::*/', $combinedXpath); } - /** - * @return XPathExpr - */ - public function translateChild(XPathExpr $xpath, XPathExpr $combinedXpath) + public function translateChild(XPathExpr $xpath, XPathExpr $combinedXpath): XPathExpr { return $xpath->join('/', $combinedXpath); } - /** - * @return XPathExpr - */ - public function translateDirectAdjacent(XPathExpr $xpath, XPathExpr $combinedXpath) + public function translateDirectAdjacent(XPathExpr $xpath, XPathExpr $combinedXpath): XPathExpr { return $xpath ->join('/following-sibling::', $combinedXpath) @@ -65,10 +56,7 @@ public function translateDirectAdjacent(XPathExpr $xpath, XPathExpr $combinedXpa ->addCondition('position() = 1'); } - /** - * @return XPathExpr - */ - public function translateIndirectAdjacent(XPathExpr $xpath, XPathExpr $combinedXpath) + public function translateIndirectAdjacent(XPathExpr $xpath, XPathExpr $combinedXpath): XPathExpr { return $xpath->join('/following-sibling::', $combinedXpath); } @@ -76,7 +64,7 @@ public function translateIndirectAdjacent(XPathExpr $xpath, XPathExpr $combinedX /** * {@inheritdoc} */ - public function getName() + public function getName(): string { return 'combination'; } diff --git a/lib/Symfony/Component/CssSelector/XPath/Extension/ExtensionInterface.php b/lib/Symfony/Component/CssSelector/XPath/Extension/ExtensionInterface.php index 11ac5734..0dc17426 100644 --- a/lib/Symfony/Component/CssSelector/XPath/Extension/ExtensionInterface.php +++ b/lib/Symfony/Component/CssSelector/XPath/Extension/ExtensionInterface.php @@ -30,40 +30,38 @@ interface ExtensionInterface * * @return callable[] */ - public function getNodeTranslators(); + public function getNodeTranslators(): array; /** * Returns combination translators. * * @return callable[] */ - public function getCombinationTranslators(); + public function getCombinationTranslators(): array; /** * Returns function translators. * * @return callable[] */ - public function getFunctionTranslators(); + public function getFunctionTranslators(): array; /** * Returns pseudo-class translators. * * @return callable[] */ - public function getPseudoClassTranslators(); + public function getPseudoClassTranslators(): array; /** * Returns attribute operation translators. * * @return callable[] */ - public function getAttributeMatchingTranslators(); + public function getAttributeMatchingTranslators(): array; /** * Returns extension name. - * - * @return string */ - public function getName(); + public function getName(): string; } diff --git a/lib/Symfony/Component/CssSelector/XPath/Extension/FunctionExtension.php b/lib/Symfony/Component/CssSelector/XPath/Extension/FunctionExtension.php index 0afaaccd..ba398238 100644 --- a/lib/Symfony/Component/CssSelector/XPath/Extension/FunctionExtension.php +++ b/lib/Symfony/Component/CssSelector/XPath/Extension/FunctionExtension.php @@ -33,7 +33,7 @@ class FunctionExtension extends AbstractExtension /** * {@inheritdoc} */ - public function getFunctionTranslators() + public function getFunctionTranslators(): array { return [ 'nth-child' => [$this, 'translateNthChild'], @@ -46,17 +46,12 @@ public function getFunctionTranslators() } /** - * @param bool $last - * @param bool $addNameTest - * - * @return XPathExpr - * * @throws ExpressionErrorException */ - public function translateNthChild(XPathExpr $xpath, FunctionNode $function, $last = false, $addNameTest = true) + public function translateNthChild(XPathExpr $xpath, FunctionNode $function, bool $last = false, bool $addNameTest = true): XPathExpr { try { - list($a, $b) = Parser::parseSeries($function->getArguments()); + [$a, $b] = Parser::parseSeries($function->getArguments()); } catch (SyntaxErrorException $e) { throw new ExpressionErrorException(sprintf('Invalid series: "%s".', implode('", "', $function->getArguments())), 0, $e); } @@ -108,28 +103,20 @@ public function translateNthChild(XPathExpr $xpath, FunctionNode $function, $las // -1n+6 means elements 6 and previous } - /** - * @return XPathExpr - */ - public function translateNthLastChild(XPathExpr $xpath, FunctionNode $function) + public function translateNthLastChild(XPathExpr $xpath, FunctionNode $function): XPathExpr { return $this->translateNthChild($xpath, $function, true); } - /** - * @return XPathExpr - */ - public function translateNthOfType(XPathExpr $xpath, FunctionNode $function) + public function translateNthOfType(XPathExpr $xpath, FunctionNode $function): XPathExpr { return $this->translateNthChild($xpath, $function, false, false); } /** - * @return XPathExpr - * * @throws ExpressionErrorException */ - public function translateNthLastOfType(XPathExpr $xpath, FunctionNode $function) + public function translateNthLastOfType(XPathExpr $xpath, FunctionNode $function): XPathExpr { if ('*' === $xpath->getElement()) { throw new ExpressionErrorException('"*:nth-of-type()" is not implemented.'); @@ -139,11 +126,9 @@ public function translateNthLastOfType(XPathExpr $xpath, FunctionNode $function) } /** - * @return XPathExpr - * * @throws ExpressionErrorException */ - public function translateContains(XPathExpr $xpath, FunctionNode $function) + public function translateContains(XPathExpr $xpath, FunctionNode $function): XPathExpr { $arguments = $function->getArguments(); foreach ($arguments as $token) { @@ -159,11 +144,9 @@ public function translateContains(XPathExpr $xpath, FunctionNode $function) } /** - * @return XPathExpr - * * @throws ExpressionErrorException */ - public function translateLang(XPathExpr $xpath, FunctionNode $function) + public function translateLang(XPathExpr $xpath, FunctionNode $function): XPathExpr { $arguments = $function->getArguments(); foreach ($arguments as $token) { @@ -181,7 +164,7 @@ public function translateLang(XPathExpr $xpath, FunctionNode $function) /** * {@inheritdoc} */ - public function getName() + public function getName(): string { return 'function'; } diff --git a/lib/Symfony/Component/CssSelector/XPath/Extension/HtmlExtension.php b/lib/Symfony/Component/CssSelector/XPath/Extension/HtmlExtension.php index 58a0c5d5..64dc3871 100644 --- a/lib/Symfony/Component/CssSelector/XPath/Extension/HtmlExtension.php +++ b/lib/Symfony/Component/CssSelector/XPath/Extension/HtmlExtension.php @@ -39,7 +39,7 @@ public function __construct(Translator $translator) /** * {@inheritdoc} */ - public function getPseudoClassTranslators() + public function getPseudoClassTranslators(): array { return [ 'checked' => [$this, 'translateChecked'], @@ -56,17 +56,14 @@ public function getPseudoClassTranslators() /** * {@inheritdoc} */ - public function getFunctionTranslators() + public function getFunctionTranslators(): array { return [ 'lang' => [$this, 'translateLang'], ]; } - /** - * @return XPathExpr - */ - public function translateChecked(XPathExpr $xpath) + public function translateChecked(XPathExpr $xpath): XPathExpr { return $xpath->addCondition( '(@checked ' @@ -75,18 +72,12 @@ public function translateChecked(XPathExpr $xpath) ); } - /** - * @return XPathExpr - */ - public function translateLink(XPathExpr $xpath) + public function translateLink(XPathExpr $xpath): XPathExpr { return $xpath->addCondition("@href and (name(.) = 'a' or name(.) = 'link' or name(.) = 'area')"); } - /** - * @return XPathExpr - */ - public function translateDisabled(XPathExpr $xpath) + public function translateDisabled(XPathExpr $xpath): XPathExpr { return $xpath->addCondition( '(' @@ -112,10 +103,7 @@ public function translateDisabled(XPathExpr $xpath) // todo: in the second half, add "and is not a descendant of that fieldset element's first legend element child, if any." } - /** - * @return XPathExpr - */ - public function translateEnabled(XPathExpr $xpath) + public function translateEnabled(XPathExpr $xpath): XPathExpr { return $xpath->addCondition( '(' @@ -149,11 +137,9 @@ public function translateEnabled(XPathExpr $xpath) } /** - * @return XPathExpr - * * @throws ExpressionErrorException */ - public function translateLang(XPathExpr $xpath, FunctionNode $function) + public function translateLang(XPathExpr $xpath, FunctionNode $function): XPathExpr { $arguments = $function->getArguments(); foreach ($arguments as $token) { @@ -171,34 +157,22 @@ public function translateLang(XPathExpr $xpath, FunctionNode $function) )); } - /** - * @return XPathExpr - */ - public function translateSelected(XPathExpr $xpath) + public function translateSelected(XPathExpr $xpath): XPathExpr { return $xpath->addCondition("(@selected and name(.) = 'option')"); } - /** - * @return XPathExpr - */ - public function translateInvalid(XPathExpr $xpath) + public function translateInvalid(XPathExpr $xpath): XPathExpr { return $xpath->addCondition('0'); } - /** - * @return XPathExpr - */ - public function translateHover(XPathExpr $xpath) + public function translateHover(XPathExpr $xpath): XPathExpr { return $xpath->addCondition('0'); } - /** - * @return XPathExpr - */ - public function translateVisited(XPathExpr $xpath) + public function translateVisited(XPathExpr $xpath): XPathExpr { return $xpath->addCondition('0'); } @@ -206,7 +180,7 @@ public function translateVisited(XPathExpr $xpath) /** * {@inheritdoc} */ - public function getName() + public function getName(): string { return 'html'; } diff --git a/lib/Symfony/Component/CssSelector/XPath/Extension/NodeExtension.php b/lib/Symfony/Component/CssSelector/XPath/Extension/NodeExtension.php index 4034b315..6628c0fa 100644 --- a/lib/Symfony/Component/CssSelector/XPath/Extension/NodeExtension.php +++ b/lib/Symfony/Component/CssSelector/XPath/Extension/NodeExtension.php @@ -27,27 +27,21 @@ */ class NodeExtension extends AbstractExtension { - const ELEMENT_NAME_IN_LOWER_CASE = 1; - const ATTRIBUTE_NAME_IN_LOWER_CASE = 2; - const ATTRIBUTE_VALUE_IN_LOWER_CASE = 4; + public const ELEMENT_NAME_IN_LOWER_CASE = 1; + public const ATTRIBUTE_NAME_IN_LOWER_CASE = 2; + public const ATTRIBUTE_VALUE_IN_LOWER_CASE = 4; private $flags; - /** - * @param int $flags - */ - public function __construct($flags = 0) + public function __construct(int $flags = 0) { $this->flags = $flags; } /** - * @param int $flag - * @param bool $on - * * @return $this */ - public function setFlag($flag, $on) + public function setFlag(int $flag, bool $on): self { if ($on && !$this->hasFlag($flag)) { $this->flags += $flag; @@ -60,12 +54,7 @@ public function setFlag($flag, $on) return $this; } - /** - * @param int $flag - * - * @return bool - */ - public function hasFlag($flag) + public function hasFlag(int $flag): bool { return (bool) ($this->flags & $flag); } @@ -73,7 +62,7 @@ public function hasFlag($flag) /** * {@inheritdoc} */ - public function getNodeTranslators() + public function getNodeTranslators(): array { return [ 'Selector' => [$this, 'translateSelector'], @@ -81,33 +70,24 @@ public function getNodeTranslators() 'Negation' => [$this, 'translateNegation'], 'Function' => [$this, 'translateFunction'], 'Pseudo' => [$this, 'translatePseudo'], - 'Attribute' => [$this, 'translateAttribute'], + 'SimplePay_Attribute' => [$this, 'translateAttribute'], 'Class' => [$this, 'translateClass'], 'Hash' => [$this, 'translateHash'], 'Element' => [$this, 'translateElement'], ]; } - /** - * @return XPathExpr - */ - public function translateSelector(Node\SelectorNode $node, Translator $translator) + public function translateSelector(Node\SelectorNode $node, Translator $translator): XPathExpr { return $translator->nodeToXPath($node->getTree()); } - /** - * @return XPathExpr - */ - public function translateCombinedSelector(Node\CombinedSelectorNode $node, Translator $translator) + public function translateCombinedSelector(Node\CombinedSelectorNode $node, Translator $translator): XPathExpr { return $translator->addCombination($node->getCombinator(), $node->getSelector(), $node->getSubSelector()); } - /** - * @return XPathExpr - */ - public function translateNegation(Node\NegationNode $node, Translator $translator) + public function translateNegation(Node\NegationNode $node, Translator $translator): XPathExpr { $xpath = $translator->nodeToXPath($node->getSelector()); $subXpath = $translator->nodeToXPath($node->getSubSelector()); @@ -120,30 +100,21 @@ public function translateNegation(Node\NegationNode $node, Translator $translato return $xpath->addCondition('0'); } - /** - * @return XPathExpr - */ - public function translateFunction(Node\FunctionNode $node, Translator $translator) + public function translateFunction(Node\FunctionNode $node, Translator $translator): XPathExpr { $xpath = $translator->nodeToXPath($node->getSelector()); return $translator->addFunction($xpath, $node); } - /** - * @return XPathExpr - */ - public function translatePseudo(Node\PseudoNode $node, Translator $translator) + public function translatePseudo(Node\PseudoNode $node, Translator $translator): XPathExpr { $xpath = $translator->nodeToXPath($node->getSelector()); return $translator->addPseudoClass($xpath, $node->getIdentifier()); } - /** - * @return XPathExpr - */ - public function translateAttribute(Node\AttributeNode $node, Translator $translator) + public function translateAttribute(Node\AttributeNode $node, Translator $translator): XPathExpr { $name = $node->getAttribute(); $safe = $this->isSafeName($name); @@ -168,34 +139,25 @@ public function translateAttribute(Node\AttributeNode $node, Translator $transla return $translator->addAttributeMatching($xpath, $node->getOperator(), $attribute, $value); } - /** - * @return XPathExpr - */ - public function translateClass(Node\ClassNode $node, Translator $translator) + public function translateClass(Node\ClassNode $node, Translator $translator): XPathExpr { $xpath = $translator->nodeToXPath($node->getSelector()); return $translator->addAttributeMatching($xpath, '~=', '@class', $node->getName()); } - /** - * @return XPathExpr - */ - public function translateHash(Node\HashNode $node, Translator $translator) + public function translateHash(Node\HashNode $node, Translator $translator): XPathExpr { $xpath = $translator->nodeToXPath($node->getSelector()); return $translator->addAttributeMatching($xpath, '=', '@id', $node->getId()); } - /** - * @return XPathExpr - */ - public function translateElement(Node\ElementNode $node) + public function translateElement(Node\ElementNode $node): XPathExpr { $element = $node->getElement(); - if ($this->hasFlag(self::ELEMENT_NAME_IN_LOWER_CASE)) { + if ($element && $this->hasFlag(self::ELEMENT_NAME_IN_LOWER_CASE)) { $element = strtolower($element); } @@ -223,19 +185,12 @@ public function translateElement(Node\ElementNode $node) /** * {@inheritdoc} */ - public function getName() + public function getName(): string { return 'node'; } - /** - * Tests if given name is safe. - * - * @param string $name - * - * @return bool - */ - private function isSafeName($name) + private function isSafeName(string $name): bool { return 0 < preg_match('~^[a-zA-Z_][a-zA-Z0-9_.-]*$~', $name); } diff --git a/lib/Symfony/Component/CssSelector/XPath/Extension/PseudoClassExtension.php b/lib/Symfony/Component/CssSelector/XPath/Extension/PseudoClassExtension.php index 30c13f70..32a8a065 100644 --- a/lib/Symfony/Component/CssSelector/XPath/Extension/PseudoClassExtension.php +++ b/lib/Symfony/Component/CssSelector/XPath/Extension/PseudoClassExtension.php @@ -29,7 +29,7 @@ class PseudoClassExtension extends AbstractExtension /** * {@inheritdoc} */ - public function getPseudoClassTranslators() + public function getPseudoClassTranslators(): array { return [ 'root' => [$this, 'translateRoot'], @@ -43,18 +43,12 @@ public function getPseudoClassTranslators() ]; } - /** - * @return XPathExpr - */ - public function translateRoot(XPathExpr $xpath) + public function translateRoot(XPathExpr $xpath): XPathExpr { return $xpath->addCondition('not(parent::*)'); } - /** - * @return XPathExpr - */ - public function translateFirstChild(XPathExpr $xpath) + public function translateFirstChild(XPathExpr $xpath): XPathExpr { return $xpath ->addStarPrefix() @@ -62,10 +56,7 @@ public function translateFirstChild(XPathExpr $xpath) ->addCondition('position() = 1'); } - /** - * @return XPathExpr - */ - public function translateLastChild(XPathExpr $xpath) + public function translateLastChild(XPathExpr $xpath): XPathExpr { return $xpath ->addStarPrefix() @@ -74,11 +65,9 @@ public function translateLastChild(XPathExpr $xpath) } /** - * @return XPathExpr - * * @throws ExpressionErrorException */ - public function translateFirstOfType(XPathExpr $xpath) + public function translateFirstOfType(XPathExpr $xpath): XPathExpr { if ('*' === $xpath->getElement()) { throw new ExpressionErrorException('"*:first-of-type" is not implemented.'); @@ -90,11 +79,9 @@ public function translateFirstOfType(XPathExpr $xpath) } /** - * @return XPathExpr - * * @throws ExpressionErrorException */ - public function translateLastOfType(XPathExpr $xpath) + public function translateLastOfType(XPathExpr $xpath): XPathExpr { if ('*' === $xpath->getElement()) { throw new ExpressionErrorException('"*:last-of-type" is not implemented.'); @@ -105,10 +92,7 @@ public function translateLastOfType(XPathExpr $xpath) ->addCondition('position() = last()'); } - /** - * @return XPathExpr - */ - public function translateOnlyChild(XPathExpr $xpath) + public function translateOnlyChild(XPathExpr $xpath): XPathExpr { return $xpath ->addStarPrefix() @@ -116,26 +100,14 @@ public function translateOnlyChild(XPathExpr $xpath) ->addCondition('last() = 1'); } - /** - * @return XPathExpr - * - * @throws ExpressionErrorException - */ - public function translateOnlyOfType(XPathExpr $xpath) + public function translateOnlyOfType(XPathExpr $xpath): XPathExpr { $element = $xpath->getElement(); - if ('*' === $element) { - throw new ExpressionErrorException('"*:only-of-type" is not implemented.'); - } - return $xpath->addCondition(sprintf('count(preceding-sibling::%s)=0 and count(following-sibling::%s)=0', $element, $element)); } - /** - * @return XPathExpr - */ - public function translateEmpty(XPathExpr $xpath) + public function translateEmpty(XPathExpr $xpath): XPathExpr { return $xpath->addCondition('not(*) and not(string-length())'); } @@ -143,7 +115,7 @@ public function translateEmpty(XPathExpr $xpath) /** * {@inheritdoc} */ - public function getName() + public function getName(): string { return 'pseudo-class'; } diff --git a/lib/Symfony/Component/CssSelector/XPath/Translator.php b/lib/Symfony/Component/CssSelector/XPath/Translator.php index e910035a..2150cfaa 100644 --- a/lib/Symfony/Component/CssSelector/XPath/Translator.php +++ b/lib/Symfony/Component/CssSelector/XPath/Translator.php @@ -48,9 +48,9 @@ class Translator implements TranslatorInterface private $pseudoClassTranslators = []; private $attributeMatchingTranslators = []; - public function __construct(ParserInterface $parser = null) + public function __construct(?ParserInterface $parser = null) { - $this->mainParser = $parser ?: new Parser(); + $this->mainParser = $parser ?? new Parser(); $this ->registerExtension(new Extension\NodeExtension()) @@ -61,18 +61,13 @@ public function __construct(ParserInterface $parser = null) ; } - /** - * @param string $element - * - * @return string - */ - public static function getXpathLiteral($element) + public static function getXpathLiteral(string $element): string { - if (false === strpos($element, "'")) { + if (!str_contains($element, "'")) { return "'".$element."'"; } - if (false === strpos($element, '"')) { + if (!str_contains($element, '"')) { return '"'.$element.'"'; } @@ -95,7 +90,7 @@ public static function getXpathLiteral($element) /** * {@inheritdoc} */ - public function cssToXPath($cssExpr, $prefix = 'descendant-or-self::') + public function cssToXPath(string $cssExpr, string $prefix = 'descendant-or-self::'): string { $selectors = $this->parseSelectors($cssExpr); @@ -114,17 +109,15 @@ public function cssToXPath($cssExpr, $prefix = 'descendant-or-self::') /** * {@inheritdoc} */ - public function selectorToXPath(SelectorNode $selector, $prefix = 'descendant-or-self::') + public function selectorToXPath(SelectorNode $selector, string $prefix = 'descendant-or-self::'): string { return ($prefix ?: '').$this->nodeToXPath($selector); } /** - * Registers an extension. - * * @return $this */ - public function registerExtension(Extension\ExtensionInterface $extension) + public function registerExtension(Extension\ExtensionInterface $extension): self { $this->extensions[$extension->getName()] = $extension; @@ -138,13 +131,9 @@ public function registerExtension(Extension\ExtensionInterface $extension) } /** - * @param string $name - * - * @return Extension\ExtensionInterface - * * @throws ExpressionErrorException */ - public function getExtension($name) + public function getExtension(string $name): Extension\ExtensionInterface { if (!isset($this->extensions[$name])) { throw new ExpressionErrorException(sprintf('Extension "%s" not registered.', $name)); @@ -154,11 +143,9 @@ public function getExtension($name) } /** - * Registers a shortcut parser. - * * @return $this */ - public function registerParserShortcut(ParserInterface $shortcut) + public function registerParserShortcut(ParserInterface $shortcut): self { $this->shortcutParsers[] = $shortcut; @@ -166,89 +153,69 @@ public function registerParserShortcut(ParserInterface $shortcut) } /** - * @return XPathExpr - * * @throws ExpressionErrorException */ - public function nodeToXPath(NodeInterface $node) + public function nodeToXPath(NodeInterface $node): XPathExpr { if (!isset($this->nodeTranslators[$node->getNodeName()])) { throw new ExpressionErrorException(sprintf('Node "%s" not supported.', $node->getNodeName())); } - return \call_user_func($this->nodeTranslators[$node->getNodeName()], $node, $this); + return $this->nodeTranslators[$node->getNodeName()]($node, $this); } /** - * @param string $combiner - * - * @return XPathExpr - * * @throws ExpressionErrorException */ - public function addCombination($combiner, NodeInterface $xpath, NodeInterface $combinedXpath) + public function addCombination(string $combiner, NodeInterface $xpath, NodeInterface $combinedXpath): XPathExpr { if (!isset($this->combinationTranslators[$combiner])) { throw new ExpressionErrorException(sprintf('Combiner "%s" not supported.', $combiner)); } - return \call_user_func($this->combinationTranslators[$combiner], $this->nodeToXPath($xpath), $this->nodeToXPath($combinedXpath)); + return $this->combinationTranslators[$combiner]($this->nodeToXPath($xpath), $this->nodeToXPath($combinedXpath)); } /** - * @return XPathExpr - * * @throws ExpressionErrorException */ - public function addFunction(XPathExpr $xpath, FunctionNode $function) + public function addFunction(XPathExpr $xpath, FunctionNode $function): XPathExpr { if (!isset($this->functionTranslators[$function->getName()])) { throw new ExpressionErrorException(sprintf('Function "%s" not supported.', $function->getName())); } - return \call_user_func($this->functionTranslators[$function->getName()], $xpath, $function); + return $this->functionTranslators[$function->getName()]($xpath, $function); } /** - * @param string $pseudoClass - * - * @return XPathExpr - * * @throws ExpressionErrorException */ - public function addPseudoClass(XPathExpr $xpath, $pseudoClass) + public function addPseudoClass(XPathExpr $xpath, string $pseudoClass): XPathExpr { if (!isset($this->pseudoClassTranslators[$pseudoClass])) { throw new ExpressionErrorException(sprintf('Pseudo-class "%s" not supported.', $pseudoClass)); } - return \call_user_func($this->pseudoClassTranslators[$pseudoClass], $xpath); + return $this->pseudoClassTranslators[$pseudoClass]($xpath); } /** - * @param string $operator - * @param string $attribute - * @param string $value - * - * @return XPathExpr - * * @throws ExpressionErrorException */ - public function addAttributeMatching(XPathExpr $xpath, $operator, $attribute, $value) + public function addAttributeMatching(XPathExpr $xpath, string $operator, string $attribute, ?string $value): XPathExpr { if (!isset($this->attributeMatchingTranslators[$operator])) { - throw new ExpressionErrorException(sprintf('Attribute matcher operator "%s" not supported.', $operator)); + throw new ExpressionErrorException(sprintf('SimplePay_Attribute matcher operator "%s" not supported.', $operator)); } - return \call_user_func($this->attributeMatchingTranslators[$operator], $xpath, $attribute, $value); + return $this->attributeMatchingTranslators[$operator]($xpath, $attribute, $value); } /** - * @param string $css - * * @return SelectorNode[] */ - private function parseSelectors($css) + private function parseSelectors(string $css): array { foreach ($this->shortcutParsers as $shortcut) { $tokens = $shortcut->parse($css); diff --git a/lib/Symfony/Component/CssSelector/XPath/TranslatorInterface.php b/lib/Symfony/Component/CssSelector/XPath/TranslatorInterface.php index f2613206..b956fb79 100644 --- a/lib/Symfony/Component/CssSelector/XPath/TranslatorInterface.php +++ b/lib/Symfony/Component/CssSelector/XPath/TranslatorInterface.php @@ -27,20 +27,11 @@ interface TranslatorInterface { /** * Translates a CSS selector to an XPath expression. - * - * @param string $cssExpr - * @param string $prefix - * - * @return string */ - public function cssToXPath($cssExpr, $prefix = 'descendant-or-self::'); + public function cssToXPath(string $cssExpr, string $prefix = 'descendant-or-self::'): string; /** * Translates a parsed selector node to an XPath expression. - * - * @param string $prefix - * - * @return string */ - public function selectorToXPath(SelectorNode $selector, $prefix = 'descendant-or-self::'); + public function selectorToXPath(SelectorNode $selector, string $prefix = 'descendant-or-self::'): string; } diff --git a/lib/Symfony/Component/CssSelector/XPath/XPathExpr.php b/lib/Symfony/Component/CssSelector/XPath/XPathExpr.php index 89a3e742..613025e8 100644 --- a/lib/Symfony/Component/CssSelector/XPath/XPathExpr.php +++ b/lib/Symfony/Component/CssSelector/XPath/XPathExpr.php @@ -27,13 +27,7 @@ class XPathExpr private $element; private $condition; - /** - * @param string $path - * @param string $element - * @param string $condition - * @param bool $starPrefix - */ - public function __construct($path = '', $element = '*', $condition = '', $starPrefix = false) + public function __construct(string $path = '', string $element = '*', string $condition = '', bool $starPrefix = false) { $this->path = $path; $this->element = $element; @@ -44,10 +38,7 @@ public function __construct($path = '', $element = '*', $condition = '', $starPr } } - /** - * @return string - */ - public function getElement() + public function getElement(): string { return $this->element; } @@ -55,17 +46,14 @@ public function getElement() /** * @return $this */ - public function addCondition($condition) + public function addCondition(string $condition): self { $this->condition = $this->condition ? sprintf('(%s) and (%s)', $this->condition, $condition) : $condition; return $this; } - /** - * @return string - */ - public function getCondition() + public function getCondition(): string { return $this->condition; } @@ -73,7 +61,7 @@ public function getCondition() /** * @return $this */ - public function addNameTest() + public function addNameTest(): self { if ('*' !== $this->element) { $this->addCondition('name() = '.Translator::getXpathLiteral($this->element)); @@ -86,7 +74,7 @@ public function addNameTest() /** * @return $this */ - public function addStarPrefix() + public function addStarPrefix(): self { $this->path .= '*/'; @@ -96,12 +84,9 @@ public function addStarPrefix() /** * Joins another XPathExpr with a combiner. * - * @param string $combiner - * @param XPathExpr $expr - * * @return $this */ - public function join($combiner, self $expr) + public function join(string $combiner, self $expr): self { $path = $this->__toString().$combiner; @@ -116,10 +101,7 @@ public function join($combiner, self $expr) return $this; } - /** - * @return string - */ - public function __toString() + public function __toString(): string { $path = $this->path.$this->element; $condition = null === $this->condition || '' === $this->condition ? '' : '['.$this->condition.']'; diff --git a/lib/Symfony/Component/CssSelector/composer.json b/lib/Symfony/Component/CssSelector/composer.json index 435063fd..f0b71249 100644 --- a/lib/Symfony/Component/CssSelector/composer.json +++ b/lib/Symfony/Component/CssSelector/composer.json @@ -1,7 +1,7 @@ { "name": "symfony/css-selector", "type": "library", - "description": "Symfony CssSelector Component", + "description": "Converts CSS selectors to XPath expressions", "keywords": [], "homepage": "https://symfony.com", "license": "MIT", @@ -20,7 +20,8 @@ } ], "require": { - "php": "^5.5.9|>=7.0.8" + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.16" }, "autoload": { "psr-4": { "Symfony\\Component\\CssSelector\\": "" }, diff --git a/lib/Symfony/Component/CssSelector/phpunit.xml.dist b/lib/Symfony/Component/CssSelector/phpunit.xml.dist deleted file mode 100644 index a8e537ef..00000000 --- a/lib/Symfony/Component/CssSelector/phpunit.xml.dist +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - ./Tests/ - - - - - - ./ - - ./Resources - ./Tests - ./vendor - - - - diff --git a/lib/Symfony/Polyfill/Php80/LICENSE b/lib/Symfony/Polyfill/Php80/LICENSE new file mode 100644 index 00000000..0ed3a246 --- /dev/null +++ b/lib/Symfony/Polyfill/Php80/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2020-present Fabien Potencier + +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. diff --git a/lib/Symfony/Polyfill/Php80/Php80.php b/lib/Symfony/Polyfill/Php80/Php80.php new file mode 100644 index 00000000..97dce9e5 --- /dev/null +++ b/lib/Symfony/Polyfill/Php80/Php80.php @@ -0,0 +1,115 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SimplePay\Vendor\Symfony\Polyfill\Php80; + +/** + * @author Ion Bazan + * @author Nico Oelgart + * @author Nicolas Grekas + * + * @internal + */ +final class Php80 +{ + public static function fdiv(float $dividend, float $divisor): float + { + return @($dividend / $divisor); + } + + public static function get_debug_type($value): string + { + switch (true) { + case null === $value: return 'null'; + case \is_bool($value): return 'bool'; + case \is_string($value): return 'string'; + case \is_array($value): return 'array'; + case \is_int($value): return 'int'; + case \is_float($value): return 'float'; + case \is_object($value): break; + case $value instanceof \__PHP_Incomplete_Class: return '__PHP_Incomplete_Class'; + default: + if (null === $type = @get_resource_type($value)) { + return 'unknown'; + } + + if ('Unknown' === $type) { + $type = 'closed'; + } + + return "resource ($type)"; + } + + $class = \get_class($value); + + if (false === strpos($class, '@')) { + return $class; + } + + return (get_parent_class($class) ?: key(class_implements($class)) ?: 'class').'@anonymous'; + } + + public static function get_resource_id($res): int + { + if (!\is_resource($res) && null === @get_resource_type($res)) { + throw new \TypeError(sprintf('Argument 1 passed to get_resource_id() must be of the type resource, %s given', get_debug_type($res))); + } + + return (int) $res; + } + + public static function preg_last_error_msg(): string + { + switch (preg_last_error()) { + case \PREG_INTERNAL_ERROR: + return 'Internal error'; + case \PREG_BAD_UTF8_ERROR: + return 'Malformed UTF-8 characters, possibly incorrectly encoded'; + case \PREG_BAD_UTF8_OFFSET_ERROR: + return 'The offset did not correspond to the beginning of a valid UTF-8 code point'; + case \PREG_BACKTRACK_LIMIT_ERROR: + return 'Backtrack limit exhausted'; + case \PREG_RECURSION_LIMIT_ERROR: + return 'Recursion limit exhausted'; + case \PREG_JIT_STACKLIMIT_ERROR: + return 'JIT stack limit exhausted'; + case \PREG_NO_ERROR: + return 'No error'; + default: + return 'Unknown error'; + } + } + + public static function str_contains(string $haystack, string $needle): bool + { + return '' === $needle || false !== strpos($haystack, $needle); + } + + public static function str_starts_with(string $haystack, string $needle): bool + { + return 0 === strncmp($haystack, $needle, \strlen($needle)); + } + + public static function str_ends_with(string $haystack, string $needle): bool + { + if ('' === $needle || $needle === $haystack) { + return true; + } + + if ('' === $haystack) { + return false; + } + + $needleLength = \strlen($needle); + + return $needleLength <= \strlen($haystack) && 0 === substr_compare($haystack, $needle, -$needleLength); + } +} diff --git a/lib/Symfony/Polyfill/Php80/PhpToken.php b/lib/Symfony/Polyfill/Php80/PhpToken.php new file mode 100644 index 00000000..81bf6fc9 --- /dev/null +++ b/lib/Symfony/Polyfill/Php80/PhpToken.php @@ -0,0 +1,103 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SimplePay\Vendor\Symfony\Polyfill\Php80; + +/** + * @author Fedonyuk Anton + * + * @internal + */ +class SimplePay_PhpToken implements \SimplePay_Stringable +{ + /** + * @var int + */ + public $id; + + /** + * @var string + */ + public $text; + + /** + * @var int + */ + public $line; + + /** + * @var int + */ + public $pos; + + public function __construct(int $id, string $text, int $line = -1, int $position = -1) + { + $this->id = $id; + $this->text = $text; + $this->line = $line; + $this->pos = $position; + } + + public function getTokenName(): ?string + { + if ('UNKNOWN' === $name = token_name($this->id)) { + $name = \strlen($this->text) > 1 || \ord($this->text) < 32 ? null : $this->text; + } + + return $name; + } + + /** + * @param int|string|array $kind + */ + public function is($kind): bool + { + foreach ((array) $kind as $value) { + if (\in_array($value, [$this->id, $this->text], true)) { + return true; + } + } + + return false; + } + + public function isIgnorable(): bool + { + return \in_array($this->id, [\T_WHITESPACE, \T_COMMENT, \T_DOC_COMMENT, \T_OPEN_TAG], true); + } + + public function __toString(): string + { + return (string) $this->text; + } + + /** + * @return static[] + */ + public static function tokenize(string $code, int $flags = 0): array + { + $line = 1; + $position = 0; + $tokens = token_get_all($code, $flags); + foreach ($tokens as $index => $token) { + if (\is_string($token)) { + $id = \ord($token); + $text = $token; + } else { + [$id, $text, $line] = $token; + } + $tokens[$index] = new static($id, $text, $line, $position); + $position += \strlen($text); + } + + return $tokens; + } +} diff --git a/lib/Symfony/Polyfill/Php80/README.md b/lib/Symfony/Polyfill/Php80/README.md new file mode 100644 index 00000000..3816c559 --- /dev/null +++ b/lib/Symfony/Polyfill/Php80/README.md @@ -0,0 +1,25 @@ +Symfony Polyfill / Php80 +======================== + +This component provides features added to PHP 8.0 core: + +- [`Stringable`](https://php.net/stringable) interface +- [`fdiv`](https://php.net/fdiv) +- [`ValueError`](https://php.net/valueerror) class +- [`UnhandledMatchError`](https://php.net/unhandledmatcherror) class +- `FILTER_VALIDATE_BOOL` constant +- [`get_debug_type`](https://php.net/get_debug_type) +- [`PhpToken`](https://php.net/phptoken) class +- [`preg_last_error_msg`](https://php.net/preg_last_error_msg) +- [`str_contains`](https://php.net/str_contains) +- [`str_starts_with`](https://php.net/str_starts_with) +- [`str_ends_with`](https://php.net/str_ends_with) +- [`get_resource_id`](https://php.net/get_resource_id) + +More information can be found in the +[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). + +License +======= + +This library is released under the [MIT license](LICENSE). diff --git a/lib/Symfony/Polyfill/Php80/Resources/stubs/Attribute.php b/lib/Symfony/Polyfill/Php80/Resources/stubs/Attribute.php new file mode 100644 index 00000000..3cb3a2a1 --- /dev/null +++ b/lib/Symfony/Polyfill/Php80/Resources/stubs/Attribute.php @@ -0,0 +1,31 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#[SimplePay_Attribute(Attribute::TARGET_CLASS)] +final class SimplePay_Attribute +{ + public const TARGET_CLASS = 1; + public const TARGET_FUNCTION = 2; + public const TARGET_METHOD = 4; + public const TARGET_PROPERTY = 8; + public const TARGET_CLASS_CONSTANT = 16; + public const TARGET_PARAMETER = 32; + public const TARGET_ALL = 63; + public const IS_REPEATABLE = 64; + + /** @var int */ + public $flags; + + public function __construct(int $flags = self::TARGET_ALL) + { + $this->flags = $flags; + } +} diff --git a/lib/Symfony/Polyfill/Php80/Resources/stubs/PhpToken.php b/lib/Symfony/Polyfill/Php80/Resources/stubs/PhpToken.php new file mode 100644 index 00000000..2d8fa240 --- /dev/null +++ b/lib/Symfony/Polyfill/Php80/Resources/stubs/PhpToken.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80000 && extension_loaded('tokenizer')) { + class SimplePay_PhpToken extends SimplePay\Vendor\Symfony\Polyfill\Php80\SimplePay_PhpToken + { + } +} diff --git a/lib/Symfony/Polyfill/Php80/Resources/stubs/Stringable.php b/lib/Symfony/Polyfill/Php80/Resources/stubs/Stringable.php new file mode 100644 index 00000000..3d6cb5bb --- /dev/null +++ b/lib/Symfony/Polyfill/Php80/Resources/stubs/Stringable.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80000) { + interface SimplePay_Stringable + { + /** + * @return string + */ + public function __toString(); + } +} diff --git a/lib/Symfony/Polyfill/Php80/Resources/stubs/UnhandledMatchError.php b/lib/Symfony/Polyfill/Php80/Resources/stubs/UnhandledMatchError.php new file mode 100644 index 00000000..1a48aee8 --- /dev/null +++ b/lib/Symfony/Polyfill/Php80/Resources/stubs/UnhandledMatchError.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80000) { + class SimplePay_UnhandledMatchError extends Error + { + } +} diff --git a/lib/Symfony/Polyfill/Php80/Resources/stubs/ValueError.php b/lib/Symfony/Polyfill/Php80/Resources/stubs/ValueError.php new file mode 100644 index 00000000..9ee29b14 --- /dev/null +++ b/lib/Symfony/Polyfill/Php80/Resources/stubs/ValueError.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80000) { + class SimplePay_ValueError extends Error + { + } +} diff --git a/lib/Symfony/Polyfill/Php80/bootstrap.php b/lib/Symfony/Polyfill/Php80/bootstrap.php new file mode 100644 index 00000000..e441add4 --- /dev/null +++ b/lib/Symfony/Polyfill/Php80/bootstrap.php @@ -0,0 +1,42 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use SimplePay\Vendor\Symfony\Polyfill\Php80 as p; + +if (\PHP_VERSION_ID >= 80000) { + return; +} + +if (!defined('FILTER_VALIDATE_BOOL') && defined('FILTER_VALIDATE_BOOLEAN')) { + define('FILTER_VALIDATE_BOOL', \FILTER_VALIDATE_BOOLEAN); +} + +if (!function_exists('fdiv')) { + function fdiv(float $num1, float $num2): float { return p\Php80::fdiv($num1, $num2); } +} +if (!function_exists('preg_last_error_msg')) { + function preg_last_error_msg(): string { return p\Php80::preg_last_error_msg(); } +} +if (!function_exists('str_contains')) { + function str_contains(?string $haystack, ?string $needle): bool { return p\Php80::str_contains($haystack ?? '', $needle ?? ''); } +} +if (!function_exists('str_starts_with')) { + function str_starts_with(?string $haystack, ?string $needle): bool { return p\Php80::str_starts_with($haystack ?? '', $needle ?? ''); } +} +if (!function_exists('str_ends_with')) { + function str_ends_with(?string $haystack, ?string $needle): bool { return p\Php80::str_ends_with($haystack ?? '', $needle ?? ''); } +} +if (!function_exists('get_debug_type')) { + function get_debug_type($value): string { return p\Php80::get_debug_type($value); } +} +if (!function_exists('get_resource_id')) { + function get_resource_id($resource): int { return p\Php80::get_resource_id($resource); } +} diff --git a/lib/Symfony/Polyfill/Php80/composer.json b/lib/Symfony/Polyfill/Php80/composer.json new file mode 100644 index 00000000..46ccde20 --- /dev/null +++ b/lib/Symfony/Polyfill/Php80/composer.json @@ -0,0 +1,37 @@ +{ + "name": "symfony/polyfill-php80", + "type": "library", + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "keywords": ["polyfill", "shim", "compatibility", "portable"], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=7.1" + }, + "autoload": { + "psr-4": { "Symfony\\Polyfill\\Php80\\": "" }, + "files": [ "bootstrap.php" ], + "classmap": [ "Resources/stubs" ] + }, + "minimum-stability": "dev", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + } +} diff --git a/lib/TijsVerkoyen/CssToInlineStyles/Css/Processor.php b/lib/TijsVerkoyen/CssToInlineStyles/Css/Processor.php index 88bf0fd0..f19c6a9d 100644 --- a/lib/TijsVerkoyen/CssToInlineStyles/Css/Processor.php +++ b/lib/TijsVerkoyen/CssToInlineStyles/Css/Processor.php @@ -11,7 +11,8 @@ class Processor * Get the rules from a given CSS-string * * @param string $css - * @param array $existingRules + * @param Rule[] $existingRules + * * @return Rule[] */ public function getRules($css, $existingRules = array()) @@ -27,13 +28,15 @@ public function getRules($css, $existingRules = array()) * Get the CSS from the style-tags in the given HTML-string * * @param string $html + * * @return string */ public function getCssFromStyleTags($html) { $css = ''; $matches = array(); - preg_match_all('|(.*)|isU', $html, $matches); + $htmlNoComments = preg_replace('||s', '', $html); + preg_match_all('|(.*)|isU', $htmlNoComments, $matches); if (!empty($matches[1])) { foreach ($matches[1] as $match) { @@ -46,6 +49,7 @@ public function getCssFromStyleTags($html) /** * @param string $css + * * @return string */ private function doCleanup($css) diff --git a/lib/TijsVerkoyen/CssToInlineStyles/Css/Property/Processor.php b/lib/TijsVerkoyen/CssToInlineStyles/Css/Property/Processor.php index 3830e2a2..27fe4b3a 100644 --- a/lib/TijsVerkoyen/CssToInlineStyles/Css/Property/Processor.php +++ b/lib/TijsVerkoyen/CssToInlineStyles/Css/Property/Processor.php @@ -7,10 +7,11 @@ class Processor { /** - * Split a string into seperate properties + * Split a string into separate properties * * @param string $propertiesString - * @return array + * + * @return string[] */ public function splitIntoSeparateProperties($propertiesString) { @@ -40,8 +41,9 @@ public function splitIntoSeparateProperties($propertiesString) } /** - * @param $string - * @return mixed|string + * @param string $string + * + * @return string */ private function cleanup($string) { @@ -58,9 +60,10 @@ private function cleanup($string) } /** - * Convert a property-string into an object + * Converts a property-string into an object * * @param string $property + * * @return Property|null */ public function convertToObject($property, Specificity $specificity = null) @@ -82,9 +85,10 @@ public function convertToObject($property, Specificity $specificity = null) } /** - * Convert an array of property-strings into objects + * Converts an array of property-strings into objects + * + * @param string[] $properties * - * @param array $properties * @return Property[] */ public function convertArrayToObjects(array $properties, Specificity $specificity = null) @@ -106,7 +110,8 @@ public function convertArrayToObjects(array $properties, Specificity $specificit /** * Build the property-string for multiple properties * - * @param array $properties + * @param Property[] $properties + * * @return string */ public function buildPropertiesString(array $properties) diff --git a/lib/TijsVerkoyen/CssToInlineStyles/Css/Property/Property.php b/lib/TijsVerkoyen/CssToInlineStyles/Css/Property/Property.php index 22bd371f..ff31b90c 100644 --- a/lib/TijsVerkoyen/CssToInlineStyles/Css/Property/Property.php +++ b/lib/TijsVerkoyen/CssToInlineStyles/Css/Property/Property.php @@ -23,8 +23,8 @@ final class Property /** * Property constructor. - * @param $name - * @param $value + * @param string $name + * @param string $value * @param Specificity|null $specificity */ public function __construct($name, $value, Specificity $specificity = null) diff --git a/lib/TijsVerkoyen/CssToInlineStyles/Css/Rule/Processor.php b/lib/TijsVerkoyen/CssToInlineStyles/Css/Rule/Processor.php index 9cb2142d..b16fed2a 100644 --- a/lib/TijsVerkoyen/CssToInlineStyles/Css/Rule/Processor.php +++ b/lib/TijsVerkoyen/CssToInlineStyles/Css/Rule/Processor.php @@ -8,10 +8,11 @@ class Processor { /** - * Split a string into seperate rules + * Splits a string into separate rules * * @param string $rulesString - * @return array + * + * @return string[] */ public function splitIntoSeparateRules($rulesString) { @@ -22,6 +23,7 @@ public function splitIntoSeparateRules($rulesString) /** * @param string $string + * * @return string */ private function cleanup($string) @@ -39,11 +41,12 @@ private function cleanup($string) } /** - * Convert a rule-string into an object + * Converts a rule-string into an object * * @param string $rule * @param int $originalOrder - * @return array + * + * @return Rule[] */ public function convertToObjects($rule, $originalOrder) { @@ -74,11 +77,13 @@ public function convertToObjects($rule, $originalOrder) } /** - * Calculate the specificity based on a CSS Selector string, + * Calculates the specificity based on a CSS Selector string, * Based on the patterns from premailer/css_parser by Alex Dunae * * @see https://github.com/premailer/css_parser/blob/master/lib/css_parser/regexps.rb + * * @param string $selector + * * @return Specificity */ public function calculateSpecificityBasedOnASelector($selector) @@ -118,7 +123,9 @@ public function calculateSpecificityBasedOnASelector($selector) } /** - * @param array $rules + * @param string[] $rules + * @param Rule[] $objects + * * @return Rule[] */ public function convertArrayToObjects(array $rules, array $objects = array()) @@ -133,12 +140,13 @@ public function convertArrayToObjects(array $rules, array $objects = array()) } /** - * Sort an array on the specificity element in an ascending way + * Sorts an array on the specificity element in an ascending way * Lower specificity will be sorted to the beginning of the array * + * @param Rule $e1 The first element. + * @param Rule $e2 The second element. + * * @return int - * @param Rule $e1 The first element. - * @param Rule $e2 The second element. */ public static function sortOnSpecificity(Rule $e1, Rule $e2) { diff --git a/lib/TijsVerkoyen/CssToInlineStyles/Css/Rule/Rule.php b/lib/TijsVerkoyen/CssToInlineStyles/Css/Rule/Rule.php index 9ab5ff54..6d4ae802 100644 --- a/lib/TijsVerkoyen/CssToInlineStyles/Css/Rule/Rule.php +++ b/lib/TijsVerkoyen/CssToInlineStyles/Css/Rule/Rule.php @@ -3,6 +3,7 @@ namespace SimplePay\Vendor\TijsVerkoyen\CssToInlineStyles\Css\Rule; use SimplePay\Vendor\Symfony\Component\CssSelector\Node\Specificity; +use SimplePay\Vendor\TijsVerkoyen\CssToInlineStyles\Css\Property\Property; final class Rule { @@ -12,7 +13,7 @@ final class Rule private $selector; /** - * @var array + * @var Property[] */ private $properties; @@ -55,7 +56,7 @@ public function getSelector() /** * Get properties * - * @return array + * @return Property[] */ public function getProperties() { diff --git a/lib/TijsVerkoyen/CssToInlineStyles/CssToInlineStyles.php b/lib/TijsVerkoyen/CssToInlineStyles/CssToInlineStyles.php index bc017d97..dca3dde1 100644 --- a/lib/TijsVerkoyen/CssToInlineStyles/CssToInlineStyles.php +++ b/lib/TijsVerkoyen/CssToInlineStyles/CssToInlineStyles.php @@ -8,7 +8,6 @@ use SimplePay\Vendor\TijsVerkoyen\CssToInlineStyles\Css\Processor; use SimplePay\Vendor\TijsVerkoyen\CssToInlineStyles\Css\Property\Processor as PropertyProcessor; use SimplePay\Vendor\TijsVerkoyen\CssToInlineStyles\Css\Rule\Processor as RuleProcessor; -use SimplePay\Vendor\TijsVerkoyen\CssToInlineStyles\Css\Rule\Rule; class CssToInlineStyles { @@ -29,6 +28,7 @@ public function __construct() * * @param string $html * @param string $css + * * @return string */ public function convert($html, $css = null) @@ -55,6 +55,7 @@ public function convert($html, $css = null) * * @param \DOMElement $element * @param Css\Property\Property[] $properties + * * @return \DOMElement */ public function inlineCssOnElement(\DOMElement $element, array $properties) @@ -89,6 +90,7 @@ public function inlineCssOnElement(\DOMElement $element, array $properties) * Get the current inline styles for a given DOMElement * * @param \DOMElement $element + * * @return Css\Property\Property[] */ public function getInlineStyles(\DOMElement $element) @@ -104,13 +106,14 @@ public function getInlineStyles(\DOMElement $element) /** * @param string $html + * * @return \DOMDocument */ protected function createDomDocumentFromHtml($html) { $document = new \DOMDocument('1.0', 'UTF-8'); $internalErrors = libxml_use_internal_errors(true); - $document->loadHTML(mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8')); + $document->loadHTML(mb_encode_numericentity($html, [0x80, 0x10FFFF, 0, 0x1FFFFF], 'UTF-8')); libxml_use_internal_errors($internalErrors); $document->formatOutput = true; @@ -119,6 +122,7 @@ protected function createDomDocumentFromHtml($html) /** * @param \DOMDocument $document + * * @return string */ protected function getHtmlFromDocument(\DOMDocument $document) @@ -145,6 +149,7 @@ protected function getHtmlFromDocument(\DOMDocument $document) /** * @param \DOMDocument $document * @param Css\Rule\Rule[] $rules + * * @return \DOMDocument */ protected function inline(\DOMDocument $document, array $rules) diff --git a/package-lock.json b/package-lock.json index 633594c0..9b41d6ed 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "wp-simple-pay-lite", - "version": "4.9.0", + "version": "4.10.0-beta-2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "wp-simple-pay-lite", - "version": "4.9.0", + "version": "4.10.0-beta-2", "license": "GPL-2.0-or-later", "devDependencies": { "grunt": "^1.0.4", diff --git a/vendor/autoload.php b/vendor/autoload.php index 6ca089cf..d2e743f5 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -22,4 +22,4 @@ require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInit701e4bb2effeb4cb61f223daf5d29988::getLoader(); +return ComposerAutoloaderInitc67ad27e892acdfcae5f60503f3a27f3::getLoader(); diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index 6b5dca02..44ef7e3d 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -6,14 +6,7 @@ $baseDir = dirname($vendorDir); return array( - 'TijsVerkoyen\\CssToInlineStyles\\' => array($vendorDir . '/tijsverkoyen/css-to-inline-styles/src'), - 'Symfony\\Component\\CssSelector\\' => array($vendorDir . '/symfony/css-selector'), - 'Stripe\\' => array($vendorDir . '/stripe/stripe-php/lib'), 'SimplePay\\Vendor\\Stripe\\' => array($baseDir . '/lib/Stripe/lib'), 'SimplePay\\Vendor\\' => array($baseDir . '/lib'), 'SimplePay\\Core\\' => array($baseDir . '/src'), - 'Psr\\Container\\' => array($vendorDir . '/psr/container/src'), - 'League\\Container\\' => array($vendorDir . '/league/container/src'), - 'Interop\\Container\\' => array($vendorDir . '/container-interop/container-interop/src/Interop/Container'), - 'BerlinDB\\' => array($vendorDir . '/berlindb/core/src'), ); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index deb79a8a..7f0fe8ec 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit701e4bb2effeb4cb61f223daf5d29988 +class ComposerAutoloaderInitc67ad27e892acdfcae5f60503f3a27f3 { private static $loader; @@ -22,14 +22,12 @@ public static function getLoader() return self::$loader; } - require __DIR__ . '/platform_check.php'; - - spl_autoload_register(array('ComposerAutoloaderInit701e4bb2effeb4cb61f223daf5d29988', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInitc67ad27e892acdfcae5f60503f3a27f3', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); - spl_autoload_unregister(array('ComposerAutoloaderInit701e4bb2effeb4cb61f223daf5d29988', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInitc67ad27e892acdfcae5f60503f3a27f3', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInit701e4bb2effeb4cb61f223daf5d29988::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInitc67ad27e892acdfcae5f60503f3a27f3::getInitializer($loader)); $loader->register(true); diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index a40ac2db..c07e354d 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,52 +4,18 @@ namespace Composer\Autoload; -class ComposerStaticInit701e4bb2effeb4cb61f223daf5d29988 +class ComposerStaticInitc67ad27e892acdfcae5f60503f3a27f3 { public static $prefixLengthsPsr4 = array ( - 'T' => - array ( - 'TijsVerkoyen\\CssToInlineStyles\\' => 31, - ), 'S' => array ( - 'Symfony\\Component\\CssSelector\\' => 30, - 'Stripe\\' => 7, 'SimplePay\\Vendor\\Stripe\\' => 24, 'SimplePay\\Vendor\\' => 17, 'SimplePay\\Core\\' => 15, ), - 'P' => - array ( - 'Psr\\Container\\' => 14, - ), - 'L' => - array ( - 'League\\Container\\' => 17, - ), - 'I' => - array ( - 'Interop\\Container\\' => 18, - ), - 'B' => - array ( - 'BerlinDB\\' => 9, - ), ); public static $prefixDirsPsr4 = array ( - 'TijsVerkoyen\\CssToInlineStyles\\' => - array ( - 0 => __DIR__ . '/..' . '/tijsverkoyen/css-to-inline-styles/src', - ), - 'Symfony\\Component\\CssSelector\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/css-selector', - ), - 'Stripe\\' => - array ( - 0 => __DIR__ . '/..' . '/stripe/stripe-php/lib', - ), 'SimplePay\\Vendor\\Stripe\\' => array ( 0 => __DIR__ . '/../..' . '/lib/Stripe/lib', @@ -62,22 +28,6 @@ class ComposerStaticInit701e4bb2effeb4cb61f223daf5d29988 array ( 0 => __DIR__ . '/../..' . '/src', ), - 'Psr\\Container\\' => - array ( - 0 => __DIR__ . '/..' . '/psr/container/src', - ), - 'League\\Container\\' => - array ( - 0 => __DIR__ . '/..' . '/league/container/src', - ), - 'Interop\\Container\\' => - array ( - 0 => __DIR__ . '/..' . '/container-interop/container-interop/src/Interop/Container', - ), - 'BerlinDB\\' => - array ( - 0 => __DIR__ . '/..' . '/berlindb/core/src', - ), ); public static $classMap = array ( @@ -87,9 +37,9 @@ class ComposerStaticInit701e4bb2effeb4cb61f223daf5d29988 public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit701e4bb2effeb4cb61f223daf5d29988::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit701e4bb2effeb4cb61f223daf5d29988::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInit701e4bb2effeb4cb61f223daf5d29988::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInitc67ad27e892acdfcae5f60503f3a27f3::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInitc67ad27e892acdfcae5f60503f3a27f3::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInitc67ad27e892acdfcae5f60503f3a27f3::$classMap; }, null, ClassLoader::class); } diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index d5f2c847..7e6e744e 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -272,23 +272,24 @@ }, { "name": "symfony/css-selector", - "version": "v6.4.7", - "version_normalized": "6.4.7.0", + "version": "v5.4.39", + "version_normalized": "5.4.39.0", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "1c5d5c2103c3762aff27a27e1e2409e30a79083b" + "reference": "0934c9f1d433776f25c629bdc93f3e157d139e08" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/1c5d5c2103c3762aff27a27e1e2409e30a79083b", - "reference": "1c5d5c2103c3762aff27a27e1e2409e30a79083b", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/0934c9f1d433776f25c629bdc93f3e157d139e08", + "reference": "0934c9f1d433776f25c629bdc93f3e157d139e08", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.16" }, - "time": "2024-04-18T09:22:46+00:00", + "time": "2024-04-18T08:26:06+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -320,7 +321,7 @@ "description": "Converts CSS selectors to XPath expressions", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/css-selector/tree/v6.4.7" + "source": "https://github.com/symfony/css-selector/tree/v5.4.39" }, "funding": [ { @@ -338,6 +339,89 @@ ], "install-path": "../symfony/css-selector" }, + { + "name": "symfony/polyfill-php80", + "version": "v1.29.0", + "version_normalized": "1.29.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", + "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "time": "2024-01-29T20:11:03+00:00", + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.29.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/polyfill-php80" + }, { "name": "tijsverkoyen/css-to-inline-styles", "version": "v2.2.7", diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 7a2ca5b4..2c11e5d4 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -74,14 +74,23 @@ 'dev_requirement' => false, ), 'symfony/css-selector' => array( - 'pretty_version' => 'v6.4.7', - 'version' => '6.4.7.0', - 'reference' => '1c5d5c2103c3762aff27a27e1e2409e30a79083b', + 'pretty_version' => 'v5.4.39', + 'version' => '5.4.39.0', + 'reference' => '0934c9f1d433776f25c629bdc93f3e157d139e08', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/css-selector', 'aliases' => array(), 'dev_requirement' => false, ), + 'symfony/polyfill-php80' => array( + 'pretty_version' => 'v1.29.0', + 'version' => '1.29.0.0', + 'reference' => '87b68208d5c1188808dd7839ee1e6c8ec3b02f1b', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-php80', + 'aliases' => array(), + 'dev_requirement' => false, + ), 'tijsverkoyen/css-to-inline-styles' => array( 'pretty_version' => 'v2.2.7', 'version' => '2.2.7.0', From bda91d9b66e1c6025b086c6b2ddb9af26176678d Mon Sep 17 00:00:00 2001 From: Prappo Prince Date: Fri, 3 May 2024 18:26:22 +0600 Subject: [PATCH 05/11] Bump version to 4.10.0-beta-2 --- package.json | 2 +- stripe-checkout.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index b4b46ea9..9bf1363e 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "wp-simple-pay-lite", "title": "WP Simple Pay Lite for Stripe", "description": "Add high conversion Stripe Checkout forms to your WordPress site and start accepting payments in minutes. **Lite Version**", - "version": "4.10.0-beta-1", + "version": "4.10.0-beta-2", "license": "GPL-2.0-or-later", "homepage": "https://wpsimplepay.com/", "repository": { diff --git a/stripe-checkout.php b/stripe-checkout.php index 2b8e0f8a..5a562d6f 100644 --- a/stripe-checkout.php +++ b/stripe-checkout.php @@ -5,7 +5,7 @@ * Description: Add high conversion Stripe payment forms to your WordPress site in minutes. * Author: WP Simple Pay * Author URI: https://wpsimplepay.com - * Version: 4.10.0-beta-1 + * Version: 4.10.0-beta-2 * Text Domain: stripe * Domain Path: /languages */ @@ -54,7 +54,7 @@ // // Lite/Pro-specific. // - define( 'SIMPLE_PAY_VERSION', '4.10.0-beta-1' ); + define( 'SIMPLE_PAY_VERSION', '4.10.0-beta-2' ); if ( ! defined( 'SIMPLE_PAY_PLUGIN_NAME' ) ) { define( 'SIMPLE_PAY_PLUGIN_NAME', 'WP Simple Pay Lite' ); From 2fac101620936babdec4315ae506c06e9e414fee Mon Sep 17 00:00:00 2001 From: Prappo Prince Date: Wed, 8 May 2024 21:00:01 +0600 Subject: [PATCH 06/11] Sync from Pro --- includes/core/admin/class-notice-manager.php | 13 +- includes/core/admin/functions/notices.php | 114 ++--- includes/core/assets/css/admin/settings.scss | 5 - .../assets/css/simpay-admin-page-smtp.min.css | 2 +- includes/core/assets/css/simpay-admin.min.css | 2 +- ...dmin-dashboard-widget-report-css.asset.php | 2 +- ...ay-admin-dashboard-widget-report.asset.php | 2 +- .../simpay-admin-dashboard-widget-report.js | 2 +- ...admin-form-template-explorer-css.asset.php | 2 +- ...pay-admin-form-template-explorer.asset.php | 2 +- .../simpay-admin-form-template-explorer.js | 8 +- .../js/dist/simpay-admin-help-css.asset.php | 2 +- .../js/dist/simpay-admin-help.asset.php | 2 +- .../core/assets/js/dist/simpay-admin-help.js | 4 +- .../simpay-admin-notifications-css.asset.php | 2 +- .../dist/simpay-admin-notifications.asset.php | 2 +- .../js/dist/simpay-admin-notifications.js | 4 +- ...-admin-page-activity-reports-css.asset.php | 2 +- ...mpay-admin-page-activity-reports.asset.php | 2 +- .../simpay-admin-page-activity-reports.js | 6 +- ...mpay-admin-page-setup-wizard-css.asset.php | 2 +- .../simpay-admin-page-setup-wizard.asset.php | 2 +- .../js/dist/simpay-admin-page-setup-wizard.js | 2 +- includes/core/assets/js/dist/simpay-admin.js | 2 +- .../js/dist/simpay-block-button.asset.php | 2 +- .../assets/js/dist/simpay-block-button.js | 2 +- .../simpay-block-payment-form-css.asset.php | 2 +- .../dist/simpay-block-payment-form.asset.php | 2 +- .../js/dist/simpay-block-payment-form.js | 2 +- .../src/admin/help/components/panel/panel.js | 3 +- .../help/components/panel/search-control.js | 67 +++ includes/core/assets/js/src/admin/index.js | 3 +- .../card-latest-payments/payment.js | 99 +--- .../template-explorer/search-control.js | 67 +++ .../payment-form/template-explorer/sidebar.js | 7 +- includes/core/bootstrap/compatibility.php | 6 +- includes/core/forms/functions.php | 2 +- .../payment-confirmation-template-tags.php | 63 +-- includes/core/settings/register-emails.php | 5 - languages/stripe.pot | 165 ++----- .../Component/CssSelector/CHANGELOG.md | 5 - .../CssSelector/CssSelectorConverter.php | 16 +- .../Exception/ExceptionInterface.php | 2 +- .../Exception/SyntaxErrorException.php | 13 +- lib/Symfony/Component/CssSelector/LICENSE | 2 +- .../CssSelector/Node/AbstractNode.php | 5 +- .../CssSelector/Node/AttributeNode.php | 40 +- .../Component/CssSelector/Node/ClassNode.php | 22 +- .../CssSelector/Node/CombinedSelectorNode.php | 27 +- .../CssSelector/Node/ElementNode.php | 23 +- .../CssSelector/Node/FunctionNode.php | 22 +- .../Component/CssSelector/Node/HashNode.php | 22 +- .../CssSelector/Node/NegationNode.php | 17 +- .../CssSelector/Node/NodeInterface.php | 21 +- .../Component/CssSelector/Node/PseudoNode.php | 22 +- .../CssSelector/Node/SelectorNode.php | 22 +- .../CssSelector/Node/Specificity.php | 29 +- .../Parser/Handler/CommentHandler.php | 2 +- .../Parser/Handler/HandlerInterface.php | 5 +- .../Parser/Handler/HashHandler.php | 2 +- .../Parser/Handler/IdentifierHandler.php | 2 +- .../Parser/Handler/NumberHandler.php | 2 +- .../Parser/Handler/StringHandler.php | 2 +- .../Parser/Handler/WhitespaceHandler.php | 2 +- .../Component/CssSelector/Parser/Parser.php | 58 ++- .../CssSelector/Parser/ParserInterface.php | 4 +- .../Component/CssSelector/Parser/Reader.php | 44 +- .../Parser/Shortcut/ClassParser.php | 2 +- .../Parser/Shortcut/ElementParser.php | 2 +- .../Parser/Shortcut/EmptyStringParser.php | 2 +- .../Parser/Shortcut/HashParser.php | 2 +- .../Component/CssSelector/Parser/Token.php | 76 ++- .../CssSelector/Parser/TokenStream.php | 26 +- .../Parser/Tokenizer/Tokenizer.php | 4 +- .../Parser/Tokenizer/TokenizerEscaping.php | 21 +- .../Parser/Tokenizer/TokenizerPatterns.php | 45 +- lib/Symfony/Component/CssSelector/README.md | 10 +- .../Tests/CssSelectorConverterTest.php | 74 +++ .../Tests/Node/AbstractNodeTest.php | 34 ++ .../Tests/Node/AttributeNodeTest.php | 37 ++ .../CssSelector/Tests/Node/ClassNodeTest.php | 33 ++ .../Tests/Node/CombinedSelectorNodeTest.php | 35 ++ .../Tests/Node/ElementNodeTest.php | 35 ++ .../Tests/Node/FunctionNodeTest.php | 47 ++ .../CssSelector/Tests/Node/HashNodeTest.php | 33 ++ .../Tests/Node/NegationNodeTest.php | 33 ++ .../CssSelector/Tests/Node/PseudoNodeTest.php | 32 ++ .../Tests/Node/SelectorNodeTest.php | 34 ++ .../Tests/Node/SpecificityTest.php | 63 +++ .../Parser/Handler/AbstractHandlerTest.php | 70 +++ .../Parser/Handler/CommentHandlerTest.php | 55 +++ .../Tests/Parser/Handler/HashHandlerTest.php | 49 ++ .../Parser/Handler/IdentifierHandlerTest.php | 49 ++ .../Parser/Handler/NumberHandlerTest.php | 50 ++ .../Parser/Handler/StringHandlerTest.php | 50 ++ .../Parser/Handler/WhitespaceHandlerTest.php | 44 ++ .../CssSelector/Tests/Parser/ParserTest.php | 253 ++++++++++ .../CssSelector/Tests/Parser/ReaderTest.php | 102 ++++ .../Tests/Parser/Shortcut/ClassParserTest.php | 45 ++ .../Parser/Shortcut/ElementParserTest.php | 44 ++ .../Parser/Shortcut/EmptyStringParserTest.php | 36 ++ .../Tests/Parser/Shortcut/HashParserTest.php | 45 ++ .../Tests/Parser/TokenStreamTest.php | 96 ++++ .../CssSelector/Tests/XPath/Fixtures/ids.html | 48 ++ .../CssSelector/Tests/XPath/Fixtures/lang.xml | 11 + .../Tests/XPath/Fixtures/shakespear.html | 308 ++++++++++++ .../Tests/XPath/TranslatorTest.php | 413 ++++++++++++++++ .../XPath/Extension/AbstractExtension.php | 10 +- .../Extension/AttributeMatchingExtension.php | 68 ++- .../XPath/Extension/CombinationExtension.php | 24 +- .../XPath/Extension/ExtensionInterface.php | 14 +- .../XPath/Extension/FunctionExtension.php | 35 +- .../XPath/Extension/HtmlExtension.php | 50 +- .../XPath/Extension/NodeExtension.php | 85 +++- .../XPath/Extension/PseudoClassExtension.php | 48 +- .../CssSelector/XPath/Translator.php | 77 ++- .../CssSelector/XPath/TranslatorInterface.php | 13 +- .../Component/CssSelector/XPath/XPathExpr.php | 34 +- .../Component/CssSelector/composer.json | 5 +- .../Component/CssSelector/phpunit.xml.dist | 31 ++ lib/Symfony/Polyfill/Php80/LICENSE | 19 - lib/Symfony/Polyfill/Php80/Php80.php | 115 ----- lib/Symfony/Polyfill/Php80/PhpToken.php | 103 ---- lib/Symfony/Polyfill/Php80/README.md | 25 - .../Php80/Resources/stubs/Attribute.php | 31 -- .../Php80/Resources/stubs/PhpToken.php | 16 - .../Php80/Resources/stubs/Stringable.php | 20 - .../Resources/stubs/UnhandledMatchError.php | 16 - .../Php80/Resources/stubs/ValueError.php | 16 - lib/Symfony/Polyfill/Php80/bootstrap.php | 42 -- lib/Symfony/Polyfill/Php80/composer.json | 37 -- .../CssToInlineStyles/Css/Processor.php | 8 +- .../Css/Property/Processor.php | 21 +- .../Css/Property/Property.php | 4 +- .../CssToInlineStyles/Css/Rule/Processor.php | 26 +- .../CssToInlineStyles/Css/Rule/Rule.php | 5 +- .../CssToInlineStyles/CssToInlineStyles.php | 9 +- .../PaymentProcessingConfirmationEmail.php | 90 ---- .../PaymentProcessingNotificationEmail.php | 107 ---- .../PaymentRefundedConfirmationEmail.php | 105 ---- .../SubscriptionCancellationConfirmation.php | 99 ---- .../SubscriptionCancellationNotification.php | 116 ----- src/Emails/EmailServiceProvider.php | 46 +- src/Emails/EmailSubscriber.php | 180 ------- src/Plugin.php | 71 +-- .../Internal/Payment/PaymentUpdateRoute.php | 456 ------------------ .../Payment/ProPaymentCreateRoute.php | 384 --------------- .../Internal/Payment/TaxCalculationRoute.php | 385 --------------- .../Payment/UpdatePaymentMethodRoute.php | 179 ------- .../Internal/Payment/ValidateCouponRoute.php | 148 ------ .../Internal/Report/LatestPaymentsReport.php | 35 +- src/Transaction/Database/Schema.php | 10 - src/Transaction/Database/Table.php | 20 +- src/Transaction/TransactionObserver.php | 64 +-- vendor/autoload.php | 2 +- vendor/composer/autoload_real.php | 8 +- vendor/composer/autoload_static.php | 8 +- vendor/composer/installed.json | 126 +---- vendor/composer/installed.php | 25 +- 159 files changed, 3531 insertions(+), 3706 deletions(-) create mode 100644 includes/core/assets/js/src/admin/help/components/panel/search-control.js create mode 100644 includes/core/assets/js/src/admin/payment-form/template-explorer/search-control.js create mode 100644 lib/Symfony/Component/CssSelector/Tests/CssSelectorConverterTest.php create mode 100644 lib/Symfony/Component/CssSelector/Tests/Node/AbstractNodeTest.php create mode 100644 lib/Symfony/Component/CssSelector/Tests/Node/AttributeNodeTest.php create mode 100644 lib/Symfony/Component/CssSelector/Tests/Node/ClassNodeTest.php create mode 100644 lib/Symfony/Component/CssSelector/Tests/Node/CombinedSelectorNodeTest.php create mode 100644 lib/Symfony/Component/CssSelector/Tests/Node/ElementNodeTest.php create mode 100644 lib/Symfony/Component/CssSelector/Tests/Node/FunctionNodeTest.php create mode 100644 lib/Symfony/Component/CssSelector/Tests/Node/HashNodeTest.php create mode 100644 lib/Symfony/Component/CssSelector/Tests/Node/NegationNodeTest.php create mode 100644 lib/Symfony/Component/CssSelector/Tests/Node/PseudoNodeTest.php create mode 100644 lib/Symfony/Component/CssSelector/Tests/Node/SelectorNodeTest.php create mode 100644 lib/Symfony/Component/CssSelector/Tests/Node/SpecificityTest.php create mode 100644 lib/Symfony/Component/CssSelector/Tests/Parser/Handler/AbstractHandlerTest.php create mode 100644 lib/Symfony/Component/CssSelector/Tests/Parser/Handler/CommentHandlerTest.php create mode 100644 lib/Symfony/Component/CssSelector/Tests/Parser/Handler/HashHandlerTest.php create mode 100644 lib/Symfony/Component/CssSelector/Tests/Parser/Handler/IdentifierHandlerTest.php create mode 100644 lib/Symfony/Component/CssSelector/Tests/Parser/Handler/NumberHandlerTest.php create mode 100644 lib/Symfony/Component/CssSelector/Tests/Parser/Handler/StringHandlerTest.php create mode 100644 lib/Symfony/Component/CssSelector/Tests/Parser/Handler/WhitespaceHandlerTest.php create mode 100644 lib/Symfony/Component/CssSelector/Tests/Parser/ParserTest.php create mode 100644 lib/Symfony/Component/CssSelector/Tests/Parser/ReaderTest.php create mode 100644 lib/Symfony/Component/CssSelector/Tests/Parser/Shortcut/ClassParserTest.php create mode 100644 lib/Symfony/Component/CssSelector/Tests/Parser/Shortcut/ElementParserTest.php create mode 100644 lib/Symfony/Component/CssSelector/Tests/Parser/Shortcut/EmptyStringParserTest.php create mode 100644 lib/Symfony/Component/CssSelector/Tests/Parser/Shortcut/HashParserTest.php create mode 100644 lib/Symfony/Component/CssSelector/Tests/Parser/TokenStreamTest.php create mode 100644 lib/Symfony/Component/CssSelector/Tests/XPath/Fixtures/ids.html create mode 100644 lib/Symfony/Component/CssSelector/Tests/XPath/Fixtures/lang.xml create mode 100644 lib/Symfony/Component/CssSelector/Tests/XPath/Fixtures/shakespear.html create mode 100644 lib/Symfony/Component/CssSelector/Tests/XPath/TranslatorTest.php create mode 100644 lib/Symfony/Component/CssSelector/phpunit.xml.dist delete mode 100644 lib/Symfony/Polyfill/Php80/LICENSE delete mode 100644 lib/Symfony/Polyfill/Php80/Php80.php delete mode 100644 lib/Symfony/Polyfill/Php80/PhpToken.php delete mode 100644 lib/Symfony/Polyfill/Php80/README.md delete mode 100644 lib/Symfony/Polyfill/Php80/Resources/stubs/Attribute.php delete mode 100644 lib/Symfony/Polyfill/Php80/Resources/stubs/PhpToken.php delete mode 100644 lib/Symfony/Polyfill/Php80/Resources/stubs/Stringable.php delete mode 100644 lib/Symfony/Polyfill/Php80/Resources/stubs/UnhandledMatchError.php delete mode 100644 lib/Symfony/Polyfill/Php80/Resources/stubs/ValueError.php delete mode 100644 lib/Symfony/Polyfill/Php80/bootstrap.php delete mode 100644 lib/Symfony/Polyfill/Php80/composer.json delete mode 100644 src/Emails/Email/PaymentProcessingConfirmationEmail.php delete mode 100644 src/Emails/Email/PaymentProcessingNotificationEmail.php delete mode 100644 src/Emails/Email/PaymentRefundedConfirmationEmail.php delete mode 100644 src/Emails/Email/SubscriptionCancellationConfirmation.php delete mode 100644 src/Emails/Email/SubscriptionCancellationNotification.php delete mode 100644 src/RestApi/Internal/Payment/PaymentUpdateRoute.php delete mode 100644 src/RestApi/Internal/Payment/ProPaymentCreateRoute.php delete mode 100644 src/RestApi/Internal/Payment/TaxCalculationRoute.php delete mode 100644 src/RestApi/Internal/Payment/UpdatePaymentMethodRoute.php delete mode 100644 src/RestApi/Internal/Payment/ValidateCouponRoute.php diff --git a/includes/core/admin/class-notice-manager.php b/includes/core/admin/class-notice-manager.php index fbb63508..1d5ad6b4 100644 --- a/includes/core/admin/class-notice-manager.php +++ b/includes/core/admin/class-notice-manager.php @@ -44,22 +44,22 @@ class Notice_Manager { */ public function __construct() { self::$core_notices = array( - 'rest_api_error' => array( + 'rest_api_error' => array( 'dismissible' => false, 'type' => 'error', 'callback' => 'SimplePay\Core\Admin\Notices\no_rest_api', ), - 'ssl_error' => array( + 'ssl_error' => array( 'dismissible' => false, 'type' => 'error', 'callback' => 'SimplePay\Core\Admin\Notices\no_ssl', ), - 'php_version_72' => array( + 'php_version_56' => array( 'dismissible' => false, 'type' => 'error', - 'callback' => 'SimplePay\Core\Admin\Notices\php_version_72', + 'callback' => 'SimplePay\Core\Admin\Notices\php_version_56', ), - 'stripe_connect' => array( + 'stripe_connect' => array( 'dismissible' => true, 'type' => 'info', 'callback' => 'SimplePay\Core\Admin\Notices\stripe_connect', @@ -217,7 +217,7 @@ public static function ajax_dismiss_notice() { return wp_send_json_error(); } - $lifespan = isset( $_POST['lifespan'] ) + $lifespan = isset( $_POST['lifespan'] ) ? sanitize_text_field( $_POST['lifespan'] ) : ''; @@ -240,6 +240,7 @@ public static function link_dismiss_notice() { ? sanitize_text_field( $_GET['simpay_dismiss_notice_nonce'] ) : false; + if ( ! current_user_can( 'manage_options' ) ) { return; } diff --git a/includes/core/admin/functions/notices.php b/includes/core/admin/functions/notices.php index 4893087f..8ff564f2 100644 --- a/includes/core/admin/functions/notices.php +++ b/includes/core/admin/functions/notices.php @@ -115,8 +115,8 @@ function stripe_connect() { * * @return string */ -function php_version_72() { - $future_required_version = 7.2; +function php_version_56() { + $future_required_version = 5.6; if ( ! version_compare( PHP_VERSION, $future_required_version, '<' ) ) { return false; @@ -129,80 +129,80 @@ function php_version_72() {

- ' . $future_required_version . '', - '' . PHP_VERSION . '', - '', - '' - ) - ), - array( - 'code' => true, - 'a' => array( - 'href' => true, - 'target' => true, - 'rel' => true, + __( + 'WP Simple Pay will be increasing its PHP requirement to version %1$s or higher in an upcoming release. It looks like you\'re using version %2$s, which means you will need to upgrade your version of PHP to allow the plugin to continue to function. Newer versions of PHP are both faster and more secure. The version you\'re using %3$sno longer receives security updates%4$s, which is another great reason to update.', + 'stripe' ), + '' . $future_required_version . '', + '' . PHP_VERSION . '', + '', + '' ) - ); - ?> + ), + array( + 'code' => true, + 'a' => array( + 'href' => true, + 'target' => true, + 'rel' => true, + ), + ) +); +?>

- 7.4, or 8.0. On a normal WordPress site, switching to PHP %1$s should never cause issues. We would however actually recommend you switch to PHP 8.0 or higher to receive the full speed and security benefits provided to more modern and fully supported versions of PHP. However, some plugins may not be fully compatible with PHP 8.x, so more testing may be required.', - 'stripe' - ), - '' . $future_required_version . '' + __( + 'In order to be compatible with future versions of WP Simple Pay, you should update your PHP version to %1$s, 7.0, 7.1, or 7.2. On a normal WordPress site, switching to PHP %1$s should never cause issues. We would however actually recommend you switch to PHP 7.1 or higher to receive the full speed and security benefits provided to more modern and fully supported versions of PHP. However, some plugins may not be fully compatible with PHP 7.x, so more testing may be required.', + 'stripe' ), - array( - 'code' => true, - ) + '' . $future_required_version . '' + ), + array( + 'code' => true, ) - ); - ?> + ) +); +?>

- ', - '' + __( + 'Many web hosts can give you instructions on how/where to upgrade your version of PHP through their control panel, or may even be able to do it for you. If you need to change hosts, please see %1$sour hosting recommendations%2$s.', + 'stripe' + ), + '', + '' + ), + array( + 'a' => array( + 'href' => true, + 'target' => true, + 'rel' => true, ), - array( - 'a' => array( - 'href' => true, - 'target' => true, - 'rel' => true, - ), - ) ) - ); - ?> + ) +); +?> *{vertical-align:middle}#simpay-plugin-page-smtp .screenshot .cont{display:inline-block;position:relative;width:315px;padding:5px;background-color:#fff;box-shadow:0px 2px 5px 0px rgba(0,0,0,.05);border-radius:3px}#simpay-plugin-page-smtp .screenshot .cont img{max-width:100%;display:block}#simpay-plugin-page-smtp .screenshot .cont .hover{position:absolute;opacity:0;height:100%;width:100%;top:0;left:0;border:5px solid #fff;background-color:rgba(0,0,0,.15);background-image:url(data:image/svg+xml;base64,PHN2ZyBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjojZmZmZmZmMDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCIgaGVpZ2h0PSIxMDAiPjxwYXRoIGQ9Ik01MCAwYzI3LjYxNCAwIDUwIDIyLjM4NiA1MCA1MHMtMjIuMzg2IDUwLTUwIDUwUzAgNzcuNjE0IDAgNTAgMjIuMzg2IDAgNTAgMHoiIGZpbGw9IiMxNjg1YjciLz48cGF0aCBkPSJNNzMuMDIzIDY3LjA2N2wtOS4zNDQtOS4zNDRhMi4yNDcgMi4yNDcgMCAwMC0xLjU5My0uNjU2aC0xLjUyOGExOS4zOTkgMTkuMzk5IDAgMDA0LjEyNC0xMS45OTZjMC0xMC43Ny04LjcyNS0xOS40OTUtMTkuNDk0LTE5LjQ5NS0xMC43NjggMC0xOS40OTQgOC43MjYtMTkuNDk0IDE5LjQ5NSAwIDEwLjc2OCA4LjcyNiAxOS40OTMgMTkuNDk0IDE5LjQ5M2ExOS40IDE5LjQgMCAwMDExLjk5Ny00LjEyM3YxLjUyN2MwIC42LjIzNCAxLjE3Mi42NTUgMS41OTRsOS4zNDQgOS4zNDRhMi4yNCAyLjI0IDAgMDAzLjE3OCAwbDIuNjUyLTIuNjUzYTIuMjYgMi4yNiAwIDAwLjAxLTMuMTg2em0tMjcuODM1LTEwYy02LjYyNiAwLTExLjk5Ni01LjM2MS0xMS45OTYtMTEuOTk2IDAtNi42MjcgNS4zNi0xMS45OTcgMTEuOTk2LTExLjk5NyA2LjYyNiAwIDExLjk5NyA1LjM2MSAxMS45OTcgMTEuOTk3IDAgNi42MjYtNS4zNjEgMTEuOTk2LTExLjk5NyAxMS45OTZ6IiBmaWxsPSIjZmZmIi8+PC9zdmc+);background-repeat:no-repeat;background-position:center;background-size:50px;transition:all .3s}#simpay-plugin-page-smtp .screenshot .cont:hover .hover{opacity:1;transition:all .3s}#simpay-plugin-page-smtp .screenshot ul{display:inline-block;margin:0 0 0 30px;list-style-type:none;max-width:calc(100% - 350px)}#simpay-plugin-page-smtp .screenshot li{margin:16px 0;padding:0 0 0 24px;font-size:15px;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGQ9Ik0xMy43NzYyIDYuNDU2MDVMOC43MjAzMiAxLjQwMDA1QzguNTc1OTkgMS4yNTU3MiA4LjM4MzY0IDEuMTc2NSA4LjE3ODUzIDEuMTc2NUM3Ljk3MzIgMS4xNzY1IDcuNzgwOTYgMS4yNTU4NCA3LjYzNjY0IDEuNDAwMDVMNy4xNzc2IDEuODU5MkM3LjAzMzM5IDIuMDAzMjkgNi45NTM5NSAyLjE5NTc2IDYuOTUzOTUgMi40MDA5OEM2Ljk1Mzk1IDIuNjA2MDggNy4wMzMzOSAyLjgwNTA0IDcuMTc3NiAyLjk0OTE0TDEwLjEyNzEgNS45MDUxNkgwLjc1NjMzNEMwLjMzMzgzNCA1LjkwNTE2IDAgNi4yMzU5MiAwIDYuNjU4NTRWNy4zMDc2NUMwIDcuNzMwMjcgMC4zMzM4MzQgOC4wOTQzOCAwLjc1NjMzNCA4LjA5NDM4SDEwLjE2MDZMNy4xNzc3MiAxMS4wNjY5QzcuMDMzNTEgMTEuMjExMiA2Ljk1NDA2IDExLjM5ODUgNi45NTQwNiAxMS42MDM3QzYuOTU0MDYgMTEuODA4NyA3LjAzMzUxIDExLjk5ODYgNy4xNzc3MiAxMi4xNDI4TDcuNjM2NzUgMTIuNjAwNUM3Ljc4MTA3IDEyLjc0NDggNy45NzMzMiAxMi44MjM1IDguMTc4NjUgMTIuODIzNUM4LjM4Mzc1IDEyLjgyMzUgOC41NzYxMSAxMi43NDM4IDguNzIwNDMgMTIuNTk5NUwxMy43NzYzIDcuNTQzNkMxMy45MjEgNy4zOTg4MiAxNC4wMDA1IDcuMjA1NTYgMTQgNy4wMDAxMUMxNC4wMDA0IDYuNzkzOTggMTMuOTIxIDYuNjAwNiAxMy43NzYyIDYuNDU2MDVWNi40NTYwNVoiIGZpbGw9IiM0MjhCQ0EiLz4NCjwvc3ZnPg0K);background-position:left 3px;background-repeat:no-repeat;background-size:14px;color:#777}#simpay-plugin-page-smtp .step{background-color:#f9f9f9;box-shadow:0px 2px 5px 0px rgba(0,0,0,.05);border:1px solid #e5e5e5;margin:0 0 25px 0}#simpay-plugin-page-smtp .step>*{vertical-align:middle}#simpay-plugin-page-smtp .step .num{display:inline-block;position:relative;width:100px;height:50px;text-align:center}#simpay-plugin-page-smtp .step .loader{margin-top:-54px;transition:all .3s;opacity:1}#simpay-plugin-page-smtp .step div{display:inline-block;width:calc(100% - 104px);background-color:#fff;padding:30px;border-left:1px solid #eee}#simpay-plugin-page-smtp .step h2{font-size:24px;line-height:22px;margin-top:0;margin-bottom:15px}#simpay-plugin-page-smtp .step p{font-size:16px;color:#777}#simpay-plugin-page-smtp .step .error{font-size:14px;color:#b97474;margin-bottom:0}#simpay-plugin-page-smtp .step .link{text-decoration:none}#simpay-plugin-page-smtp .step .button{font-weight:500;box-shadow:none;padding:12px;min-width:200px;height:auto;line-height:13px;text-align:center;font-size:15px;transition:all .3s}#simpay-plugin-page-smtp .step .button.grey{background:#f6f6f6;border:1px solid #ddd;text-shadow:none;color:#9fa5aa}#simpay-plugin-page-smtp .step .button.disabled{cursor:default}#simpay-plugin-page-smtp .step .hidden{opacity:0;transition:all .3s}#simpay-plugin-page-smtp .grey{opacity:.5}@media(max-width: 767px){#simpay-admin-smtp{width:auto;margin:0 20px}#simpay-admin-smtp .screenshot .cont{width:auto}#simpay-admin-smtp .screenshot ul{margin:20px 0 0 15px;max-width:100%}#simpay-admin-smtp .button{white-space:normal}} +.lity,.lity-container{transition:opacity .5s ease}.lity-active,.lity-active body{overflow:initial}#wpbody-content .notice,#wpbody-content .update-nag{display:none !important}.simpay-plugin-page .notice{display:none !important}.simpay-plugin-page .loader{margin:0 auto;position:relative;text-indent:-9999em;border-top:4px solid #969696;border-right:4px solid #969696;border-bottom:4px solid #969696;border-left:4px solid #404040;transform:translateZ(0);animation:load8 1.1s infinite linear;background-color:rgba(0,0,0,0)}.simpay-plugin-page .loader,.simpay-plugin-page .loader:after{display:block;border-radius:50%;width:50px;height:50px}@keyframes load8{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}#simpay-plugin-page-smtp{width:700px;margin:0 auto}#simpay-plugin-page-smtp *,#simpay-plugin-page-smtp *::before,#simpay-plugin-page-smtp *::after{box-sizing:border-box}#simpay-plugin-page-smtp section{margin:50px 0;text-align:left;clear:both}#simpay-plugin-page-smtp p{font-size:15px}#simpay-plugin-page-smtp .top{text-align:center}#simpay-plugin-page-smtp .top img{margin-bottom:38px}#simpay-plugin-page-smtp .top h1{font-size:26px;font-weight:600;margin-bottom:0;padding:0}#simpay-plugin-page-smtp .top p{font-size:17px;color:#777;margin-top:.5em}#simpay-plugin-page-smtp .top .updated{display:none}#simpay-plugin-page-smtp .screenshot>*{vertical-align:middle}#simpay-plugin-page-smtp .screenshot .cont{display:inline-block;position:relative;width:315px;padding:5px;background-color:#fff;box-shadow:0px 2px 5px 0px rgba(0,0,0,.05);border-radius:3px}#simpay-plugin-page-smtp .screenshot .cont img{max-width:100%;display:block}#simpay-plugin-page-smtp .screenshot .cont .hover{position:absolute;opacity:0;height:100%;width:100%;top:0;left:0;border:5px solid #fff;background-color:rgba(0,0,0,.15);background-image:url(data:image/svg+xml;base64,PHN2ZyBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjojZmZmZmZmMDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCIgaGVpZ2h0PSIxMDAiPjxwYXRoIGQ9Ik01MCAwYzI3LjYxNCAwIDUwIDIyLjM4NiA1MCA1MHMtMjIuMzg2IDUwLTUwIDUwUzAgNzcuNjE0IDAgNTAgMjIuMzg2IDAgNTAgMHoiIGZpbGw9IiMxNjg1YjciLz48cGF0aCBkPSJNNzMuMDIzIDY3LjA2N2wtOS4zNDQtOS4zNDRhMi4yNDcgMi4yNDcgMCAwMC0xLjU5My0uNjU2aC0xLjUyOGExOS4zOTkgMTkuMzk5IDAgMDA0LjEyNC0xMS45OTZjMC0xMC43Ny04LjcyNS0xOS40OTUtMTkuNDk0LTE5LjQ5NS0xMC43NjggMC0xOS40OTQgOC43MjYtMTkuNDk0IDE5LjQ5NSAwIDEwLjc2OCA4LjcyNiAxOS40OTMgMTkuNDk0IDE5LjQ5M2ExOS40IDE5LjQgMCAwMDExLjk5Ny00LjEyM3YxLjUyN2MwIC42LjIzNCAxLjE3Mi42NTUgMS41OTRsOS4zNDQgOS4zNDRhMi4yNCAyLjI0IDAgMDAzLjE3OCAwbDIuNjUyLTIuNjUzYTIuMjYgMi4yNiAwIDAwLjAxLTMuMTg2em0tMjcuODM1LTEwYy02LjYyNiAwLTExLjk5Ni01LjM2MS0xMS45OTYtMTEuOTk2IDAtNi42MjcgNS4zNi0xMS45OTcgMTEuOTk2LTExLjk5NyA2LjYyNiAwIDExLjk5NyA1LjM2MSAxMS45OTcgMTEuOTk3IDAgNi42MjYtNS4zNjEgMTEuOTk2LTExLjk5NyAxMS45OTZ6IiBmaWxsPSIjZmZmIi8+PC9zdmc+);background-repeat:no-repeat;background-position:center;background-size:50px;transition:all .3s}#simpay-plugin-page-smtp .screenshot .cont:hover .hover{opacity:1;transition:all .3s}#simpay-plugin-page-smtp .screenshot ul{display:inline-block;margin:0 0 0 30px;list-style-type:none;max-width:calc(100% - 350px)}#simpay-plugin-page-smtp .screenshot li{margin:16px 0;padding:0 0 0 24px;font-size:15px;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEzLjc3NjIgNi40NTYwNUw4LjcyMDMyIDEuNDAwMDVDOC41NzU5OSAxLjI1NTcyIDguMzgzNjQgMS4xNzY1IDguMTc4NTMgMS4xNzY1QzcuOTczMiAxLjE3NjUgNy43ODA5NiAxLjI1NTg0IDcuNjM2NjQgMS40MDAwNUw3LjE3NzYgMS44NTkyQzcuMDMzMzkgMi4wMDMyOSA2Ljk1Mzk1IDIuMTk1NzYgNi45NTM5NSAyLjQwMDk4QzYuOTUzOTUgMi42MDYwOCA3LjAzMzM5IDIuODA1MDQgNy4xNzc2IDIuOTQ5MTRMMTAuMTI3MSA1LjkwNTE2SDAuNzU2MzM0QzAuMzMzODM0IDUuOTA1MTYgMCA2LjIzNTkyIDAgNi42NTg1NFY3LjMwNzY1QzAgNy43MzAyNyAwLjMzMzgzNCA4LjA5NDM4IDAuNzU2MzM0IDguMDk0MzhIMTAuMTYwNkw3LjE3NzcyIDExLjA2NjlDNy4wMzM1MSAxMS4yMTEyIDYuOTU0MDYgMTEuMzk4NSA2Ljk1NDA2IDExLjYwMzdDNi45NTQwNiAxMS44MDg3IDcuMDMzNTEgMTEuOTk4NiA3LjE3NzcyIDEyLjE0MjhMNy42MzY3NSAxMi42MDA1QzcuNzgxMDcgMTIuNzQ0OCA3Ljk3MzMyIDEyLjgyMzUgOC4xNzg2NSAxMi44MjM1QzguMzgzNzUgMTIuODIzNSA4LjU3NjExIDEyLjc0MzggOC43MjA0MyAxMi41OTk1TDEzLjc3NjMgNy41NDM2QzEzLjkyMSA3LjM5ODgyIDE0LjAwMDUgNy4yMDU1NiAxNCA3LjAwMDExQzE0LjAwMDQgNi43OTM5OCAxMy45MjEgNi42MDA2IDEzLjc3NjIgNi40NTYwNVY2LjQ1NjA1WiIgZmlsbD0iIzQyOEJDQSIvPgo8L3N2Zz4K);background-position:left 3px;background-repeat:no-repeat;background-size:14px;color:#777}#simpay-plugin-page-smtp .step{background-color:#f9f9f9;box-shadow:0px 2px 5px 0px rgba(0,0,0,.05);border:1px solid #e5e5e5;margin:0 0 25px 0}#simpay-plugin-page-smtp .step>*{vertical-align:middle}#simpay-plugin-page-smtp .step .num{display:inline-block;position:relative;width:100px;height:50px;text-align:center}#simpay-plugin-page-smtp .step .loader{margin-top:-54px;transition:all .3s;opacity:1}#simpay-plugin-page-smtp .step div{display:inline-block;width:calc(100% - 104px);background-color:#fff;padding:30px;border-left:1px solid #eee}#simpay-plugin-page-smtp .step h2{font-size:24px;line-height:22px;margin-top:0;margin-bottom:15px}#simpay-plugin-page-smtp .step p{font-size:16px;color:#777}#simpay-plugin-page-smtp .step .error{font-size:14px;color:#b97474;margin-bottom:0}#simpay-plugin-page-smtp .step .link{text-decoration:none}#simpay-plugin-page-smtp .step .button{font-weight:500;box-shadow:none;padding:12px;min-width:200px;height:auto;line-height:13px;text-align:center;font-size:15px;transition:all .3s}#simpay-plugin-page-smtp .step .button.grey{background:#f6f6f6;border:1px solid #ddd;text-shadow:none;color:#9fa5aa}#simpay-plugin-page-smtp .step .button.disabled{cursor:default}#simpay-plugin-page-smtp .step .hidden{opacity:0;transition:all .3s}#simpay-plugin-page-smtp .grey{opacity:.5}@media(max-width: 767px){#simpay-admin-smtp{width:auto;margin:0 20px}#simpay-admin-smtp .screenshot .cont{width:auto}#simpay-admin-smtp .screenshot ul{margin:20px 0 0 15px;max-width:100%}#simpay-admin-smtp .button{white-space:normal}} diff --git a/includes/core/assets/css/simpay-admin.min.css b/includes/core/assets/css/simpay-admin.min.css index 77c3dbb9..a92fba0f 100644 --- a/includes/core/assets/css/simpay-admin.min.css +++ b/includes/core/assets/css/simpay-admin.min.css @@ -1 +1 @@ -.simpay-settings-subsections{display:flex;align-items:center;box-shadow:inset 0 -1px 0 0 #ccc}.simpay-settings-subsections__subsection{font-weight:500;text-decoration:none;padding:15px;display:flex;align-items:center}.simpay-settings-subsections__subsection .dashicons{width:18px;height:18px;font-size:18px;margin-right:4px}.simpay-settings-subsections__subsection.is-active{box-shadow:inset 0 -4px 0 0 currentColor;position:relative;z-index:1}.simpay-settings-subsections__subsection:not(.is-active){color:#23282d}.simpay-settings form>h2:not(.nav-tab-wrapper){clip:rect(1px, 1px, 1px, 1px);height:1px;overflow:hidden;position:absolute !important;width:1px}.simpay-settings .form-table td fieldset+p,.simpay-settings .form-table td label+p,.simpay-settings .form-table td select+p,.simpay-settings .form-table td input+p{color:#666;font-style:italic}.simpay-settings .simpay-settings-subsections__subsection{display:flex;align-items:center}.simpay-settings .simpay-settings-subsections__subsection .simpay-settings-bubble{margin-left:5px}.simpay-settings .simpay-settings-visual-toggles{margin:30px 0 0;display:flex}.simpay-settings .simpay-settings-visual-toggles input[type=radio]{display:none}.simpay-settings .simpay-settings-visual-toggles__toggle{-webkit-user-select:none;-moz-user-select:none;user-select:none;min-width:180px;margin:0 30px 0 0 !important;position:relative;display:block;background-color:#fff;border-radius:4px;border:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04)}.simpay-settings .simpay-settings-visual-toggles__toggle:hover{border:1px solid #999;box-shadow:0 1px 2px rgba(0,0,0,.1)}.simpay-settings .simpay-settings-visual-toggles input[type=radio]:checked+.simpay-settings-visual-toggles__toggle{border-color:#007cba;border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px #007cba;box-shadow:0 0 0 1px var(--wp-admin-theme-color)}.simpay-settings .simpay-settings-visual-toggles__toggle-recommended,.simpay-settings .simpay-settings-visual-toggles__toggle-not-recommended{text-align:center;font-size:12px;text-transform:uppercase;font-weight:bold;margin:0;padding:5px 0;display:block;border-top-right-radius:4px;border-top-left-radius:4px}.simpay-settings .simpay-settings-visual-toggles__toggle-recommended{color:#0f8569;background:#f4f9f7}.simpay-settings .simpay-settings-visual-toggles__toggle-not-recommended{color:#b91c1b;background:#fef2f2}.simpay-settings .simpay-settings-visual-toggles__toggle-icon{margin:20px auto 15px;padding:0 15px;display:block}.simpay-settings .simpay-settings-visual-toggles__toggle-label{line-height:1.5;text-align:center;font-size:16px;font-weight:500;margin:15px;display:block}.simpay-settings .simpay-settings-visual-toggles__toggle-label small{color:#666;font-weight:normal;font-size:13px;line-height:1;display:block;margin:4px 0}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type .simpay-settings-visual-toggles__toggle{min-height:160px}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type .simpay-settings-visual-toggles__toggle-icon{width:80px;height:80px}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type input[type=radio].simpay-settings-captcha-type--is-recommended:checked+.simpay-settings-visual-toggles__toggle{border-color:#0f8569;box-shadow:0 0 0 1px #0f8569}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type input[type=radio].simpay-settings-captcha-type--is-not-recommended:checked+.simpay-settings-visual-toggles__toggle{border-color:#b91c1b;box-shadow:0 0 0 1px #b91c1b}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type label[for=simpay-settings-captcha-type-cloudflare-turnstile] .simpay-settings-visual-toggles__toggle-icon{width:120px}.simpay-settings-general-recaptcha-no_captcha_warning th,.simpay-settings-general-recaptcha-no_captcha_warning td,.simpay-settings-hcaptcha_secret_key th,.simpay-settings-hcaptcha_secret_key td,.simpay-settings-cloudflare_turnstile_secret_key th,.simpay-settings-cloudflare_turnstile_secret_key td,.simpay-settings-recaptcha_score_threshold th,.simpay-settings-recaptcha_score_threshold td{padding-bottom:50px !important}.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-summary-report,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-payment-confirmation,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-payment-notification,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-upcoming-invoice,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-manage-subscriptions,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-payment-processing-confirmation,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-payment-processing-notification,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-payment-refunded-confirmation,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-subscription-cancel-confirmation,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-subscription-cancel-notification,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-invoice-confirmation{display:none}.simpay-settings .simpay-settings-subsection-emails-tools{margin-left:auto}.simpay-admin-charts-period-over-period{position:relative;padding-bottom:12px}.simpay-admin-charts-period-over-period *{box-sizing:border-box}.simpay-admin-charts-period-over-period__tooltip{position:absolute;background:#fff;border:1px solid #c3c3c3;box-shadow:0 2px 6px rgba(0,0,0,.05);border-radius:2px;padding:10px 14px;display:flex;flex-direction:column;z-Index:10000;min-width:175px}.simpay-admin-charts-period-over-period__tooltip-data{white-space:nowrap;margin-bottom:8px;display:grid;grid-template-columns:1fr auto;grid-auto-rows:auto;-moz-column-gap:16px;column-gap:16px}.simpay-admin-charts-period-over-period__tooltip-data:last-child{margin-bottom:0}.simpay-admin-charts-period-over-period__tooltip-data[data-dataset="1"]{opacity:.65}.simpay-admin-charts-period-over-period__tooltip-data em{font-style:normal;text-align:right}.simpay-admin-charts-period-over-period__tooltip-delta{font-size:12px;margin:0 -14px -10px;padding:8px 14px;border-top:1px solid #eee;background:#fdfdfd;border-radius:2px;display:flex;align-items:center;justify-content:center}.simpay-admin-charts-period-over-period__tooltip-delta .simpay-admin-charts-badge{margin-right:4px}.simpay-admin-charts-period-over-period__tooltip-delta strong.is-positive{color:#006908}.simpay-admin-charts-period-over-period__tooltip-delta strong.is-negative{color:#b3093c}.simpay-admin-charts-badge{color:#2f2f2f;font-size:12px;font-weight:500;font-style:normal;line-height:1;padding:3px 6px;display:inline-flex;align-items:center;background:#f0f0f0;border-radius:100px}.simpay-admin-charts-badge.is-positive{color:#006908;background-color:#d7f7c2}.simpay-admin-charts-badge.is-negative{color:#b3093c;background-color:#ffe7f2}.simpay-admin-charts-badge__icon{width:15px;height:15px}.simpay-admin-charts-no-data{position:absolute;top:0;left:0;display:flex;justify-content:center;align-items:center;background:rgba(255,255,255,.5);z-index:2}.simpay-admin-charts-no-data>div{text-align:center;padding:24px;background:#fff;border:1px solid #c3c3c3;box-shadow:0 2px 6px rgba(0,0,0,.1);border-radius:2px;max-width:60%}.simpay-admin-charts-no-data strong{font-size:15px;margin-bottom:8px;display:block}.button.button-large.simpay-button-large{font-size:14px;line-height:30px;padding:4px 12px}.simpay-copy-hidden-input{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}.fixed .column-livemode{width:15%;text-align:right}@media screen and (max-width: 782px){.fixed .column-livemode{text-align:left}}.fixed .column-livemode .simpay-badge{margin-top:3px}.fixed .column-shortcode{width:25%}.fixed .column-shortcode .simpay-shortcode{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}.post-type-simple-pay .misc-pub-curtime,.post-type-simple-pay .misc-pub-visibility{display:none}.simpay-metabox-title{border:1px solid #eee}.simpay-shortcode-section{border-top:1px solid #ddd;border-width:1px 0;padding-top:15px;padding-bottom:15px;position:relative}.simpay-shortcode-section label{display:block;margin-bottom:6px}.simpay-shortcode-section label .dashicons{color:#8c8f94;margin-right:3px}.simpay-shortcode-section .simpay-copy-button{line-height:normal;position:absolute;right:20px;bottom:20px;border:0;background:none;box-shadow:none;padding:0}.simpay-shortcode-section .simpay-copy-button:hover{border:0;background:none;box-shadow:none}.simpay-shortcode-section .simpay-copy-button .dashicons{color:#3c434a}.simpay-shortcode{width:100%;padding:8px;line-height:1;margin:0;height:32px;resize:none}.simpay-badge{color:#3f3f46;text-align:center;line-height:1;padding:5px 7px;border-radius:3px;background:#e4e4e7;border:0;box-shadow:none;display:inline-flex;align-items:center}button.simpay-badge{cursor:pointer}button.simpay-badge:hover{background:#d4d4d8}.simpay-badge__icon{opacity:.8;margin:2px 5px 0 0}.simpay-badge--green{color:#0e6245;background:#cbf4c9}.simpay-badge--yellow{color:#983705;background:#f8e5b9}.simpay-stripe-account-info{display:flex;align-items:center;margin-bottom:8px;position:relative}.simpay-stripe-account-info .spinner{float:none;margin-top:0;margin-left:0}.simple-pay_page_simpay_settings .simpay-settings-upgrade,.post-type-simple-pay .simpay-settings-upgrade{margin-top:20px;padding:1px;position:relative;background:#fff;border-radius:4px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.2),0 5px 10px rgba(0,0,0,.1);max-width:677px}.simple-pay_page_simpay_settings .simpay-settings-upgrade__inner,.post-type-simple-pay .simpay-settings-upgrade__inner{text-align:center;margin:0;padding:30px}.simple-pay_page_simpay_settings .simpay-settings-upgrade h3,.post-type-simple-pay .simpay-settings-upgrade h3{line-height:1.5;font-size:22px;margin:0 0 1.5rem}.simple-pay_page_simpay_settings .simpay-settings-upgrade ul,.post-type-simple-pay .simpay-settings-upgrade ul{margin:1.5rem 0 calc(1.5rem - 6px);display:flex;flex-wrap:wrap;justify-content:center}@media screen and (min-width: 782px){.simple-pay_page_simpay_settings .simpay-settings-upgrade ul,.post-type-simple-pay .simpay-settings-upgrade ul{margin-left:4rem;margin-right:4rem}}.simple-pay_page_simpay_settings .simpay-settings-upgrade li,.post-type-simple-pay .simpay-settings-upgrade li{font-size:15px;margin:6px 0;width:100%}.simple-pay_page_simpay_settings .simpay-settings-upgrade li a,.post-type-simple-pay .simpay-settings-upgrade li a{color:#3c434a;text-decoration:none}.simple-pay_page_simpay_settings .simpay-settings-upgrade li a:hover,.post-type-simple-pay .simpay-settings-upgrade li a:hover{color:var(--wp-admin-theme-color);text-decoration:underline}@media screen and (min-width: 782px){.simple-pay_page_simpay_settings .simpay-settings-upgrade li,.post-type-simple-pay .simpay-settings-upgrade li{text-align:left;width:50%}}.simple-pay_page_simpay_settings .simpay-settings-upgrade .button.button-large,.post-type-simple-pay .simpay-settings-upgrade .button.button-large{font-size:17px;line-height:30px;padding:10px 20px}.simple-pay_page_simpay_settings .simpay-settings-upgrade small,.post-type-simple-pay .simpay-settings-upgrade small{color:#666;margin:15px 0 0;display:block}.simple-pay_page_simpay_settings .simpay-settings-upgrade .dashicons-yes,.post-type-simple-pay .simpay-settings-upgrade .dashicons-yes{color:#428bca}.simple-pay_page_simpay_settings .simpay-settings-upgrade .button-link,.post-type-simple-pay .simpay-settings-upgrade .button-link{position:absolute;top:0;right:0;font-size:20px;color:#666;font-weight:bold;text-decoration:none;margin-left:5px;padding:6px 10px;z-index:2}.simple-pay_page_simpay_settings .simpay-settings-upgrade .button-link:hover,.simple-pay_page_simpay_settings .simpay-settings-upgrade .button-link:active,.simple-pay_page_simpay_settings .simpay-settings-upgrade .button-link:focus,.post-type-simple-pay .simpay-settings-upgrade .button-link:hover,.post-type-simple-pay .simpay-settings-upgrade .button-link:active,.post-type-simple-pay .simpay-settings-upgrade .button-link:focus{color:#666;text-decoration:none}.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext{text-align:center;margin:0;padding:30px 20px 20px;background-color:#fcf9e8;border:1px solid #edeac9;border-width:1px 0 0;position:relative;border-radius:0;border-bottom-left-radius:4px;border-bottom-right-radius:4px}@media screen and (min-width: 782px){.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext{padding-left:4rem;padding-right:4rem}}.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext svg,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext svg{background:#00a32a;fill:#fff;border-radius:50%;border:4px solid #fff;box-shadow:0 0 0 1px #edeac9;width:28px;height:28px;position:absolute;top:-18px;left:50%;margin-left:-18px}.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext u,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext u{text-decoration:none;font-weight:bold;color:#00a32a}.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext a,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext a{font-weight:normal;display:inline-block}#simpay-payment-form-settings table{width:100%;border-collapse:collapse}#simpay-payment-form-settings ::-webkit-input-placeholder{color:#9ba1a9}#simpay-payment-form-settings ::-moz-placeholder{color:#9ba1a9;opacity:1}#simpay-payment-form-settings :-ms-input-placeholder{color:#9ba1a9}#simpay-payment-form-settings .inside{margin:0;padding:0}#simpay-payment-form-settings .simpay-panel-field .toolbar{margin-bottom:-4px}#simpay-payment-form-settings .simpay-panel-field .toolbar .simpay-field-select{margin:0 0 4px;width:auto;max-width:70%}#simpay-payment-form-settings .simpay-tabs{margin:0;padding:0;list-style:none;background:#fafafa;border-right:1px solid #ccd0d4;line-height:1em;position:relative;flex:0 0 25%}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-tabs{flex-basis:100%;flex-grow:1;border-right:0}}#simpay-payment-form-settings .simpay-tabs li{margin:0;padding:0}#simpay-payment-form-settings .simpay-tabs li:first-child{margin-top:12px}#simpay-payment-form-settings .simpay-tabs li:last-child{margin-bottom:20px}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-tabs li:last-child{margin-bottom:0}}#simpay-payment-form-settings .simpay-tabs li.active{margin-left:-1px;box-shadow:0 1px 1px rgba(0,0,0,.04);position:relative}#simpay-payment-form-settings .simpay-tabs li.active:focus:after{display:none}#simpay-payment-form-settings .simpay-tabs li.active:before,#simpay-payment-form-settings .simpay-tabs li.active:after{content:"";width:calc(100% + 1px);height:1px;background:#ccd0d4;position:absolute;top:0;left:0;right:0;z-index:2}#simpay-payment-form-settings .simpay-tabs li.active:after{top:auto;bottom:0}#simpay-payment-form-settings .simpay-tabs li.active a{font-weight:bold;background-color:#fff;position:relative;margin-right:-1px}#simpay-payment-form-settings .simpay-tabs li.active a:before{content:"";position:absolute;top:0;left:0;bottom:0;width:4px;height:100%;background:currentColor;z-index:3}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-tabs li.active a{margin-right:0}}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item{display:flex;align-items:center;line-height:20px;margin:0;padding:8px 10px 8px 14px;text-decoration:none;transition:all .05s ease-in-out}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item svg,#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item .dashicons{margin-right:6px}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item{padding:18px}}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item:focus{outline:0;position:relative;z-index:3;box-shadow:inset 0 0 0 1px currentColor,0 0 0 1px currentColor}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item[href="#purchase-restrictions-settings-panel"],#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item[href="#payment-page-settings-panel"]{margin-bottom:20px;position:relative}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item[href="#purchase-restrictions-settings-panel"]:after,#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item[href="#payment-page-settings-panel"]:after{content:"";position:absolute;left:14px;right:14px;bottom:-10px;width:calc(100% - 28px);height:1px;background:#eaeaea}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item span>span{color:#f18500;font-size:12px;font-weight:600;margin:0 0 0 5px;display:inline-block}#simpay-payment-form-settings .simpay-tabs li:not(.active) .simpay-tab-item{color:inherit}#simpay-payment-form-settings .simpay-panels-wrap{background:#fff;display:flex}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-panels-wrap{flex-direction:column}}#simpay-payment-form-settings .simpay-panels{flex:0 0 75%;display:flex}@media screen and (min-width: 1400px){#simpay-payment-form-settings .simpay-panels{flex-basis:75%}}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-panels{flex-basis:100%}}#simpay-payment-form-settings .simpay-panel,#simpay-payment-form-settings .simpay-panel-section{width:100%}#simpay-payment-form-settings .simpay-panel>table,#simpay-payment-form-settings .simpay-panel>table>tr,#simpay-payment-form-settings .simpay-panel>table>tbody,#simpay-payment-form-settings .simpay-panel>table>tbody>tr,#simpay-payment-form-settings .simpay-panel>table>thead,#simpay-payment-form-settings .simpay-panel>table>thead>tr{display:block;width:100%}#simpay-payment-form-settings .simpay-panel>table:last-child>tbody:last-child>tr:last-child>td{border-bottom:0}#simpay-payment-form-settings .simpay-panel-field--requires-upgrade{position:relative}#simpay-payment-form-settings .simpay-panel-field--requires-upgrade td>div{margin-right:80px}#simpay-payment-form-settings .simpay-panel-field--requires-upgrade td>div .button-small{position:absolute;top:calc(50% - 13px);right:18px}#simpay-payment-form-settings .simpay-panel-field,#simpay-payment-form-settings .simpay-panel-field>td,#simpay-payment-form-settings .simpay-panel-field>th{text-align:left;display:block}#simpay-payment-form-settings .simpay-panel-field>td,#simpay-payment-form-settings .simpay-panel-field>th{width:calc(100% - 36px);margin-left:18px;margin-right:18px}#simpay-payment-form-settings .simpay-panel-field th{font-weight:bold;padding-top:18px;padding-bottom:5px}#simpay-payment-form-settings .simpay-panel-field td{border-bottom:1px solid #ddd;padding-bottom:18px}#simpay-payment-form-settings .simpay-panel-field p.description{margin-top:4px}#simpay-payment-form-settings .simpay-panel-field p.description:last-of-type{margin-bottom:0}#simpay-payment-form-settings .simpay-panel-field .simpay-panel-field__nested{margin-top:18px}#simpay-payment-form-settings .simpay-panel-field .simpay-panel-field__nested label{font-weight:bold;display:block;margin-bottom:4px}#simpay-payment-form-settings .simpay-panel-field .simpay-field-select,#simpay-payment-form-settings .simpay-panel-field .simpay-field-text{min-width:75%;max-width:100%}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-panel-field .simpay-field-select,#simpay-payment-form-settings .simpay-panel-field .simpay-field-text{min-width:0;width:100%}}#simpay-payment-form-settings .simpay-panel-field .simpay-field-textarea{width:100%;max-width:100%}#simpay-payment-form-settings .simpay-panel-field .notice:last-of-type{margin-bottom:0}#simpay-payment-form-settings .simpay-panel-field .error,#simpay-payment-form-settings .simpay-panel-field .simpay-important{color:#a94442;font-weight:normal}#simpay-payment-form-settings .simpay-panel-field .simpay-image-preview-wrap{position:relative;margin-top:12px}#simpay-payment-form-settings .simpay-panel-field .simpay-image-preview-wrap .simpay-remove-image-preview{position:absolute;top:-15px;left:-15px;cursor:pointer;background-color:#fff}#simpay-payment-form-settings .simpay-panel-field .simpay-image-preview-wrap .simpay-remove-image-preview::before{font-size:22px;line-height:26px}#simpay-payment-form-settings .simpay-panel-field .simpay-image-preview-wrap .simpay-image-preview{max-height:128px;max-width:128px;border:1px solid #ddd}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box{background-color:#f4f4f4;border:1px solid #e5e5e5;padding:18px;margin-top:18px;position:relative}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box__dismiss{color:inherit;text-decoration:none;position:absolute;top:8px;right:8px}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box__dismiss .dashicons-dismiss{font-size:16px;width:16px;height:16px}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box h3{font-size:18px;font-weight:600;margin:0;padding:0}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box p{font-size:14px}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box p:last-child{margin-bottom:0}#simpay-payment-form-settings .simpay-metabox-content{margin-bottom:-1px;background-color:#f5f5f5;border:1px solid #c3c4c7;border-width:1px 0;box-shadow:0 1px 1px rgba(0,0,0,.04);position:relative}#simpay-payment-form-settings .simpay-show-if,#simpay-payment-form-settings .simpay-panel-hidden{display:none}#simpay-payment-form-settings .simpay-payment-methods{border:1px solid #ccd0d4;border-radius:4px;box-shadow:0 1px 1px rgba(0,0,0,.04)}#simpay-payment-form-settings .simpay-panel-field-payment-method{display:block;border-top:1px solid #ccd0d4;padding:7px;box-sizing:border-box}#simpay-payment-form-settings .simpay-panel-field-payment-method:first-child{border-top:0;border-top-left-radius:4px;border-top-right-radius:4px}#simpay-payment-form-settings .simpay-panel-field-payment-method__enable{display:flex;align-items:center}#simpay-payment-form-settings .simpay-panel-field-payment-method__enable input[type=checkbox]{margin-top:0;margin-right:8px}#simpay-payment-form-settings .simpay-panel-field-payment-method__help{text-decoration:none}#simpay-payment-form-settings .simpay-panel-field-payment-method__help .dashicons{font-size:18px;width:18px;height:18px}#simpay-payment-form-settings .simpay-panel-field-payment-method__restrictions,#simpay-payment-form-settings .simpay-panel-field-payment-method__restrictions-ach{margin-left:72px}#simpay-payment-form-settings .simpay-panel-field-payment-method__icon{border-radius:3px;overflow:hidden;margin:0 8px 0 5px;width:30px;height:30px;flex-shrink:0}#simpay-payment-form-settings .simpay-panel-field-payment-method__icon svg{width:30px;height:30px}#simpay-payment-form-settings .simpay-panel-field-payment-method__configure{display:flex;align-items:center;justify-content:center}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metaboxes:not(.is-empty),#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metaboxes:not(.is-empty){border:1px solid #ccd0d4;box-shadow:0 1px 1px rgba(0,0,0,.04);border-radius:4px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-handlediv,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-handlediv{display:none;float:right;width:36px;height:36px;margin:0;padding:0;border:0;background:none;cursor:pointer;display:block}#simpay-global-settings .simpay-metaboxes-wrapper .postbox.closed .simpay-handlediv .toggle-indicator:before,#simpay-form-settings .simpay-metaboxes-wrapper .postbox.closed .simpay-handlediv .toggle-indicator:before{content:""}#simpay-global-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv:focus,#simpay-form-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv:focus{outline:0}#simpay-global-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv:focus .toggle-indicator:before,#simpay-form-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv:focus .toggle-indicator:before{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}#simpay-global-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv .toggle-indicator:before,#simpay-form-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv .toggle-indicator:before{margin-top:4px;width:20px;border-radius:50%;text-indent:-1px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox{background:#fff;border:1px solid #ccd0d4;margin:0 -1px -1px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .hndle,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .hndle{border:0}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox select,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox select{font-weight:400}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox:first-of-type,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox:first-of-type{margin-top:-1px;border-top-left-radius:4px;border-top-right-radius:4px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox:last-of-type,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox:last-of-type{margin-bottom:-1px;border-bottom-left-radius:4px;border-bottom-right-radius:4px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox:last-of-type .simpay-metabox-content,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox:last-of-type .simpay-metabox-content{border-bottom-left-radius:4px;border-bottom-right-radius:4px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2{cursor:pointer;display:flex;align-items:center;padding:10px 0 10px 12px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .simpay-field-type,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .simpay-field-type{font-size:90%;color:gray;font-weight:normal;text-decoration:none;margin-left:10px}@media screen and (max-width: 782px){#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .simpay-field-type,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .simpay-field-type{display:none}}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .dashicons-handle,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .dashicons-handle{cursor:move}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 strong,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 strong{font-size:95%;margin-left:8px;display:flex;align-items:center;flex-grow:1}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 svg,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 svg{border-radius:3px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 select,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 select{font-family:sans-serif;max-width:20%;margin:.25em .25em .25em 0}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2.fixed,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2.fixed{cursor:pointer !important}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .dashicons-menu,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .dashicons-menu{cursor:move}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions{padding:9px 18px;justify-content:space-between;display:flex;align-items:center}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id{display:flex;align-items:center}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id input,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id input{margin:0 2px 0 5px;width:50px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id a,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id a{text-decoration:none}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .button-link.simpay-remove-field-link,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .button-link.simpay-remove-field-link{color:#a00}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .button-link.simpay-remove-field-link:hover,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .button-link.simpay-remove-field-link:hover{color:#dc3232}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox table,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox table{border-spacing:0;width:100%}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox table.simpay-inner-table,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox table.simpay-inner-table{border:none;padding:0 1em}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox table tr td,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox table tr td{border-bottom-color:#ccd0d4}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-remove-plan,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-remove-plan{color:#a00}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-custom-field-payment-button .dashicons-menu,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-custom-field-payment-button .dashicons-menu{visibility:hidden}#simpay-global-settings .sortable-placeholder,#simpay-form-settings .sortable-placeholder{margin:5px;display:block;min-height:36px}#simpay-global-settings .chosen-container,#simpay-form-settings .chosen-container{min-width:20em;max-width:30em}#simpay-global-settings .simpay-field.simpay-small-text,#simpay-form-settings .simpay-field.simpay-small-text{width:7em}#simpay-global-settings .simpay-field.simpay-medium-text,#simpay-form-settings .simpay-field.simpay-medium-text{width:15em}#simpay-global-settings .simpay-field-radios ul,#simpay-form-settings .simpay-field-radios ul{margin:0}#simpay-global-settings .simpay-field-radios>i,#simpay-form-settings .simpay-field-radios>i{margin-left:5px;vertical-align:middle}#simpay-global-settings ul.simpay-field-radios-inline,#simpay-form-settings ul.simpay-field-radios-inline{margin:0 0 -10px}#simpay-global-settings ul.simpay-field-radios-inline li,#simpay-form-settings ul.simpay-field-radios-inline li{display:inline-block;margin:0 10px 10px 0}#simpay-global-settings ul.simpay-field-radios-inline li:last-child,#simpay-form-settings ul.simpay-field-radios-inline li:last-child{margin-right:0}#simpay-global-settings .simpay-currency-field,#simpay-form-settings .simpay-currency-field{display:flex;align-items:center}>#simpay-global-settings .simpay-currency-field:focus,>#simpay-form-settings .simpay-currency-field:focus{position:relative;z-index:5}#simpay-global-settings .simpay-currency-symbol,#simpay-form-settings .simpay-currency-symbol{margin:0;padding-left:8px;padding-right:8px;line-height:28px;font-size:14px}@media screen and (max-width: 782px){#simpay-global-settings .simpay-currency-symbol,#simpay-form-settings .simpay-currency-symbol{line-height:38px}}#simpay-global-settings .simpay-currency-symbol-left,#simpay-form-settings .simpay-currency-symbol-left{border-top-left-radius:4px;border-bottom-left-radius:4px}#simpay-global-settings .simpay-currency-symbol-right,#simpay-form-settings .simpay-currency-symbol-right{border-top-right-radius:4px;border-bottom-right-radius:4px}#simpay-global-settings div.simpay-currency-symbol,#simpay-form-settings div.simpay-currency-symbol{border-color:#7e8993;border-style:solid;background-color:#fff}#simpay-global-settings select.simpay-currency-symbol,#simpay-form-settings select.simpay-currency-symbol{padding-right:25px}#simpay-global-settings .simpay-currency-symbol-left,#simpay-form-settings .simpay-currency-symbol-left{border-width:1px 0 1px 1px}#simpay-global-settings .simpay-currency-symbol-left+.simpay-field-amount,#simpay-form-settings .simpay-currency-symbol-left+.simpay-field-amount{border-radius:0 4px 4px 0}#simpay-global-settings .simpay-currency-symbol-right,#simpay-form-settings .simpay-currency-symbol-right{border-width:1px 1px 1px 0}#simpay-global-settings .simpay-field-amount,#simpay-form-settings .simpay-field-amount{margin:0;padding-left:8px;padding-right:8px;font-size:14px;width:6em;position:relative;z-index:2;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px}#simpay-global-settings .simpay-error,#simpay-form-settings .simpay-error{color:red}#simpay-global-settings .simpay-docs-link-wrap,#simpay-form-settings .simpay-docs-link-wrap{position:absolute;right:0;bottom:0;color:#666;font-size:13px;font-style:italic;padding:15px 18px}#simpay-global-settings .simpay-docs-link-wrap a .dashicons-editor-help,#simpay-form-settings .simpay-docs-link-wrap a .dashicons-editor-help{color:#666;text-decoration:none;width:17px;height:17px;font-size:17px;padding-left:4px}#simpay-global-settings .simpay-docs-icon,#simpay-form-settings .simpay-docs-icon{color:#666}#simpay-global-settings .simpay-docs-icon,#simpay-global-settings .simpay-docs-icon .dashicons-editor-help,#simpay-form-settings .simpay-docs-icon,#simpay-form-settings .simpay-docs-icon .dashicons-editor-help{text-decoration:none;width:17px;height:17px;font-size:17px}.button.button-primary.simpay-upgrade-btn{background-color:#428bca;border:1px solid #428bca;color:#fff;display:inline-block}.button.button-primary.simpay-upgrade-btn:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px #2d6ca2}.button.button-primary.simpay-upgrade-btn:hover{background-color:#037ad0;border:1px solid #428bca}.simpay-upgrade-btn-subtext{color:#3c434a;font-size:14px;line-height:1.5;text-align:center;margin:40px 0 0;padding:30px 35px 20px;background-color:#fcf9e8;border:3px solid #ebe29a;border-radius:4px;position:relative}.simpay-upgrade-btn-subtext svg{background:#00a32a;fill:#fff;border-radius:50%;border:3px solid #ebe29a;width:28px;height:28px;position:absolute;top:-14px;left:50%;margin-left:-14px}.simpay-upgrade-btn-subtext u{text-decoration:none;font-weight:bold;color:#00a32a}.simpay-upgrade-btn-subtext a{text-decoration:none;display:block;margin-top:6px;font-weight:bold}.post-type-simple-pay #post-body-content{display:none}.simpay-card{margin:0 0 20px;padding:30px;background:#fff;border:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04)}.simpay-card,.simpay-card p{line-height:1.5;font-size:16px}.simpay-card h3{line-height:1.6;font-size:18px;margin:0 0 20px;color:#23282c}.simpay-card p{margin:0 0 20px}.simpay-card p:last-child,.simpay-card ul:last-child{margin-bottom:0}.simpay-card figure{float:right;margin:0 0 30px 30px;max-width:400px}.simpay-card figure iframe,.simpay-card figure img{max-width:100%}.simpay-card figure figcaption{text-align:center}@media screen and (max-width: 782px){.simpay-card figure{margin:0 0 30px;max-width:100%;float:none}}.simpay-doc-suggestions{width:100%;display:flex;flex-wrap:wrap;padding:0}.simpay-doc-suggestion{text-align:center;display:flex;flex-direction:column;justify-content:center;align-items:center;flex:0 1 33.333%;padding:30px;border-right:1px solid #c3c4c7;box-sizing:border-box}.simpay-doc-suggestion:nth-child(3n){border-right:0}@media screen and (max-width: 782px){.simpay-doc-suggestion{flex:0 1 100%;border-bottom:1px solid #c3c4c7;border-right:0}.simpay-doc-suggestion:last-child{border-bottom:0}}.simpay-doc-suggestion h3{font-size:20px;margin-bottom:10px}.simpay-doc-suggestion p{font-size:15px}.simpay-doc-suggestion .dashicons{font-size:40px;width:40px;height:40px;display:block;margin-bottom:10px}.simpay-doc-suggestion .button-large{font-size:16px}.simpay-addons{display:flex;flex-wrap:wrap;justify-content:space-between;margin:20px 0}.simpay-addon{background:#fff;border:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04);margin-bottom:20px;display:flex;flex-direction:column;flex-basis:calc(33% - 10px);box-sizing:border-box}@media screen and (max-width: 782px){.simpay-addon{flex-basis:100%}}.simpay-addon img{float:left;max-width:75px}.simpay-addon h5{margin:0 0 10px 100px;font-size:16px}.simpay-addon__details{padding:20px;flex:1 0 auto}.simpay-addon__actions{display:flex;align-items:center;justify-content:space-between;flex:0 1 auto;background-color:#f7f7f7;border-top:1px solid #ddd;margin-top:auto;padding:20px;position:relative}.simpay-addon__actions .msg{text-align:center;justify-content:center;display:flex;align-items:center;position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;background-color:#f7f7f7;z-index:3}.simpay-addon .error,.simpay-addon .status-label.status-installed{color:#d63638}.simpay-addon .success,.simpay-addon .status-label.status-active{color:#00a32a}.simpay-addon .addon-desc{margin:0 0 0 100px}.form-table td .simpay-stripe-connect-help{margin:15px 0;display:flex;align-items:center}.form-table td .simpay-stripe-connect-help .dashicons{margin-right:4px}.simpay-currency-field{display:flex;align-items:center}>.simpay-currency-field:focus{position:relative;z-index:5}.simpay-currency-symbol{margin:0;padding-left:8px;padding-right:8px;line-height:28px;font-size:14px}@media screen and (max-width: 782px){.simpay-currency-symbol{line-height:38px}}.simpay-currency-symbol-left{border-top-left-radius:4px;border-bottom-left-radius:4px}.simpay-currency-symbol-right{border-top-right-radius:4px;border-bottom-right-radius:4px}div.simpay-currency-symbol{border-color:#7e8993;border-style:solid;background-color:#fff}select.simpay-currency-symbol{padding-right:25px}.simpay-currency-symbol-left{border-width:1px 0 1px 1px}.simpay-currency-symbol-left+.simpay-field-amount{border-radius:0 4px 4px 0}.simpay-currency-symbol-right{border-width:1px 1px 1px 0}.simpay-field-amount{margin:0;padding-left:8px;padding-right:8px;font-size:14px;width:6em;position:relative;z-index:2;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px}.simpay-template-explorer-open .show-settings{display:none !important}.simpay-branding-bar{margin:0 -20px;padding:14px 22px;background:#fff;border-bottom:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04);width:calc(100% + 20px);display:flex;justify-content:space-between;box-sizing:border-box}.site-health .simpay-branding-bar{display:none}.simpay-branding-bar__title{display:flex;align-items:center;margin:8px 0}.simpay-branding-bar__logo{width:200px}.simpay-branding-bar__divider{color:#dadbdf;font-size:23px;font-weight:400;margin:0 15px}.simpay-branding-bar__actions{display:flex;align-items:center}.simpay-branding-bar__actions>div{margin-left:10px;min-width:40px}.simpay-branding-bar__actions-button{color:#000;cursor:pointer;padding:10px;width:40px;height:40px;background-color:#f3f4f5;border-radius:50%;border:0;box-shadow:none;position:relative;transition:background-color .2s ease;box-sizing:border-box;display:block}.simpay-branding-bar__actions-button:hover{background-color:#e5e5e5}.simpay-branding-bar__actions-button:active,.simpay-branding-bar__actions-button:focus{box-shadow:0 0 0 2px var(--wp-admin-theme-color)}.simpay-branding-bar__actions-button-count{font-weight:600;font-size:10px;line-height:16px;color:#fff;margin:0;background-color:#df2a4a;border-radius:100%;width:16px;height:16px;position:absolute;top:-8px;left:50%;margin-left:-8px}.simpay-branding-bar .wp-heading-inline{font-size:23px;font-weight:400;margin:0}.simpay-branding-bar .page-title-action{font-weight:600;font-size:13px;line-height:normal;cursor:pointer;text-shadow:none;text-decoration:none;margin-left:10px;padding:4px 8px;border:1px solid currentColor;border-radius:2px;background:#f6f7f7}.simpay-landing-zone{text-align:center;max-width:700px;margin:40px auto}.simpay-landing-zone__title{font-size:26px;font-weight:600;margin:0 0 1.5rem;padding:0}.simpay-landing-zone__subtitle{font-size:17px;color:#666;margin:.25rem 0}.simpay-landing-zone__subtitle strong{color:#444}.simpay-landing-zone section{margin:2rem 0}.simpay-landing-zone__empty-state-graphic img{width:425px}.simpay-landing-zone__screenshot>*{vertical-align:middle}.simpay-landing-zone__screenshot-img{display:inline-block;position:relative;width:315px;padding:5px;background-color:#fff;box-shadow:0px 2px 5px 0px rgba(0,0,0,.05);border-radius:3px}.simpay-landing-zone__screenshot-img img{max-width:100%;display:block}.simpay-landing-zone__screenshot-img .hover{position:absolute;opacity:0;height:calc(100% - 10px);width:calc(100% - 10px);top:0;left:0;border:5px solid #fff;background-color:rgba(0,0,0,.15);background-image:url(data:image/svg+xml;base64,PHN2ZyBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjojZmZmZmZmMDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCIgaGVpZ2h0PSIxMDAiPjxwYXRoIGQ9Ik01MCAwYzI3LjYxNCAwIDUwIDIyLjM4NiA1MCA1MHMtMjIuMzg2IDUwLTUwIDUwUzAgNzcuNjE0IDAgNTAgMjIuMzg2IDAgNTAgMHoiIGZpbGw9IiMxNjg1YjciLz48cGF0aCBkPSJNNzMuMDIzIDY3LjA2N2wtOS4zNDQtOS4zNDRhMi4yNDcgMi4yNDcgMCAwMC0xLjU5My0uNjU2aC0xLjUyOGExOS4zOTkgMTkuMzk5IDAgMDA0LjEyNC0xMS45OTZjMC0xMC43Ny04LjcyNS0xOS40OTUtMTkuNDk0LTE5LjQ5NS0xMC43NjggMC0xOS40OTQgOC43MjYtMTkuNDk0IDE5LjQ5NSAwIDEwLjc2OCA4LjcyNiAxOS40OTMgMTkuNDk0IDE5LjQ5M2ExOS40IDE5LjQgMCAwMDExLjk5Ny00LjEyM3YxLjUyN2MwIC42LjIzNCAxLjE3Mi42NTUgMS41OTRsOS4zNDQgOS4zNDRhMi4yNCAyLjI0IDAgMDAzLjE3OCAwbDIuNjUyLTIuNjUzYTIuMjYgMi4yNiAwIDAwLjAxLTMuMTg2em0tMjcuODM1LTEwYy02LjYyNiAwLTExLjk5Ni01LjM2MS0xMS45OTYtMTEuOTk2IDAtNi42MjcgNS4zNi0xMS45OTcgMTEuOTk2LTExLjk5NyA2LjYyNiAwIDExLjk5NyA1LjM2MSAxMS45OTcgMTEuOTk3IDAgNi42MjYtNS4zNjEgMTEuOTk2LTExLjk5NyAxMS45OTZ6IiBmaWxsPSIjZmZmIi8+PC9zdmc+);background-repeat:no-repeat;background-position:center;background-size:50px;transition:all .3s}.simpay-landing-zone__screenshot-img:hover .hover{opacity:1;transition:all .3s}.simpay-landing-zone__screenshot ul{text-align:left;display:inline-block;margin:0 0 0 30px;list-style-type:none;max-width:calc(100% - 350px)}@media screen and (max-width: 782px){.simpay-landing-zone__screenshot ul{text-align:center;margin:30px auto;max-width:100%;display:block}}.simpay-landing-zone__screenshot li{margin:16px 0;padding:0;font-size:15px;color:#777;position:relative}.simpay-landing-zone__screenshot li:before{content:"";background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGQ9Ik0xMy43NzYyIDYuNDU2MDVMOC43MjAzMiAxLjQwMDA1QzguNTc1OTkgMS4yNTU3MiA4LjM4MzY0IDEuMTc2NSA4LjE3ODUzIDEuMTc2NUM3Ljk3MzIgMS4xNzY1IDcuNzgwOTYgMS4yNTU4NCA3LjYzNjY0IDEuNDAwMDVMNy4xNzc2IDEuODU5MkM3LjAzMzM5IDIuMDAzMjkgNi45NTM5NSAyLjE5NTc2IDYuOTUzOTUgMi40MDA5OEM2Ljk1Mzk1IDIuNjA2MDggNy4wMzMzOSAyLjgwNTA0IDcuMTc3NiAyLjk0OTE0TDEwLjEyNzEgNS45MDUxNkgwLjc1NjMzNEMwLjMzMzgzNCA1LjkwNTE2IDAgNi4yMzU5MiAwIDYuNjU4NTRWNy4zMDc2NUMwIDcuNzMwMjcgMC4zMzM4MzQgOC4wOTQzOCAwLjc1NjMzNCA4LjA5NDM4SDEwLjE2MDZMNy4xNzc3MiAxMS4wNjY5QzcuMDMzNTEgMTEuMjExMiA2Ljk1NDA2IDExLjM5ODUgNi45NTQwNiAxMS42MDM3QzYuOTU0MDYgMTEuODA4NyA3LjAzMzUxIDExLjk5ODYgNy4xNzc3MiAxMi4xNDI4TDcuNjM2NzUgMTIuNjAwNUM3Ljc4MTA3IDEyLjc0NDggNy45NzMzMiAxMi44MjM1IDguMTc4NjUgMTIuODIzNUM4LjM4Mzc1IDEyLjgyMzUgOC41NzYxMSAxMi43NDM4IDguNzIwNDMgMTIuNTk5NUwxMy43NzYzIDcuNTQzNkMxMy45MjEgNy4zOTg4MiAxNC4wMDA1IDcuMjA1NTYgMTQgNy4wMDAxMUMxNC4wMDA0IDYuNzkzOTggMTMuOTIxIDYuNjAwNiAxMy43NzYyIDYuNDU2MDVWNi40NTYwNVoiIGZpbGw9IiM0MjhCQ0EiLz4NCjwvc3ZnPg0K);background-position:center;background-repeat:no-repeat;background-size:14px;width:14px;height:14px;display:inline-block;margin:-3px 5px 0 0;vertical-align:middle}.simpay-landing-zone .button.button-large{font-size:17px;line-height:30px;padding:10px 20px}.simpay-landing-zone__purchased{display:block;margin:15px 0 0}.simpay-upgrade-modal,.simpay-upgrade-upe-modal{padding:0 !important}.simpay-upgrade-modal *,.simpay-upgrade-upe-modal *{box-sizing:border-box}.simpay-upgrade-modal__content,.simpay-upgrade-upe-modal__content{text-align:center;display:flex;flex-direction:column;align-items:center;padding:16px 32px 32px}.simpay-upgrade-modal__content>.dashicons,.simpay-upgrade-upe-modal__content>.dashicons{color:#333;font-size:48px;width:48px;height:48px}.simpay-upgrade-modal__title,.simpay-upgrade-upe-modal__title{font-size:22px;line-height:1.5;display:block;margin:12px 0 0}.simpay-upgrade-modal__description,.simpay-upgrade-upe-modal__description{color:#777;font-size:16px;margin:16px 0 24px}.simpay-upgrade-modal__description strong,.simpay-upgrade-upe-modal__description strong{color:#333}.simpay-upgrade-modal__discount,.simpay-upgrade-upe-modal__discount{font-size:15px;text-align:center;margin:32px -32px -32px;padding:24px 40px;background-color:#fcf9e8;position:relative}.simpay-upgrade-modal__discount svg,.simpay-upgrade-upe-modal__discount svg{background:#00a32a;fill:#fff;border-radius:50%;border:4px solid #fff;width:32px;height:32px;position:absolute;top:-16px;left:50%;margin-left:-16px}.simpay-upgrade-modal__discount u,.simpay-upgrade-upe-modal__discount u{text-decoration:none;font-weight:bold;color:#00a32a}.simpay-upgrade-modal .button-large,.simpay-upgrade-upe-modal .button-large{font-size:16px;font-weight:bold;margin:0 0 15px;padding:8px 30px !important;height:auto}.simpay-teaser-float{margin:50px;position:relative}.simpay-teaser-float__card{text-align:center;padding:30px;background:#fff;border-radius:4px;box-shadow:0 0 30px 15px rgba(0,0,0,.18);position:relative;z-index:2}#poststuff .simpay-teaser-float h2,.simpay-teaser-float h2{font-size:24px;font-weight:600;margin:0;padding:0}.simpay-teaser-float p{font-size:15px;line-height:1.35;color:#666}.simpay-teaser-float p strong{color:#444}.simpay-teaser-float ul{text-align:left;display:inline-block;margin:-10px 0 20px;list-style-type:none}.simpay-teaser-float li{margin:16px 0;padding:0 0 0 24px;font-size:15px;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGQ9Ik0xMy43NzYyIDYuNDU2MDVMOC43MjAzMiAxLjQwMDA1QzguNTc1OTkgMS4yNTU3MiA4LjM4MzY0IDEuMTc2NSA4LjE3ODUzIDEuMTc2NUM3Ljk3MzIgMS4xNzY1IDcuNzgwOTYgMS4yNTU4NCA3LjYzNjY0IDEuNDAwMDVMNy4xNzc2IDEuODU5MkM3LjAzMzM5IDIuMDAzMjkgNi45NTM5NSAyLjE5NTc2IDYuOTUzOTUgMi40MDA5OEM2Ljk1Mzk1IDIuNjA2MDggNy4wMzMzOSAyLjgwNTA0IDcuMTc3NiAyLjk0OTE0TDEwLjEyNzEgNS45MDUxNkgwLjc1NjMzNEMwLjMzMzgzNCA1LjkwNTE2IDAgNi4yMzU5MiAwIDYuNjU4NTRWNy4zMDc2NUMwIDcuNzMwMjcgMC4zMzM4MzQgOC4wOTQzOCAwLjc1NjMzNCA4LjA5NDM4SDEwLjE2MDZMNy4xNzc3MiAxMS4wNjY5QzcuMDMzNTEgMTEuMjExMiA2Ljk1NDA2IDExLjM5ODUgNi45NTQwNiAxMS42MDM3QzYuOTU0MDYgMTEuODA4NyA3LjAzMzUxIDExLjk5ODYgNy4xNzc3MiAxMi4xNDI4TDcuNjM2NzUgMTIuNjAwNUM3Ljc4MTA3IDEyLjc0NDggNy45NzMzMiAxMi44MjM1IDguMTc4NjUgMTIuODIzNUM4LjM4Mzc1IDEyLjgyMzUgOC41NzYxMSAxMi43NDM4IDguNzIwNDMgMTIuNTk5NUwxMy43NzYzIDcuNTQzNkMxMy45MjEgNy4zOTg4MiAxNC4wMDA1IDcuMjA1NTYgMTQgNy4wMDAxMUMxNC4wMDA0IDYuNzkzOTggMTMuOTIxIDYuNjAwNiAxMy43NzYyIDYuNDU2MDVWNi40NTYwNVoiIGZpbGw9IiM0MjhCQ0EiLz4NCjwvc3ZnPg0K);background-position:left 3px;background-repeat:no-repeat;background-size:14px;color:#777}.simpay-teaser-float .button.button-large{font-size:17px;line-height:30px;padding:10px 20px}.simpay-teaser-float .simpay-notice-dismiss{position:absolute;top:0;right:0;font-size:20px;color:#666;font-weight:bold;text-decoration:none;margin-left:5px;padding:6px 10px;z-index:2}.simpay-teaser-float .simpay-notice-dismiss:hover,.simpay-teaser-float .simpay-notice-dismiss:active,.simpay-teaser-float .simpay-notice-dismiss:focus{color:#666;text-decoration:none}.simpay-teaser-float:after,.simpay-teaser-float:before{opacity:.75;z-index:0;content:"";position:absolute;left:-30px;right:-30px;top:-35px;width:calc(100% + 60px);height:170px;background-image:linear-gradient(#ddd, #ddd),linear-gradient(#eee, #eee),linear-gradient(#ddd, #ddd),linear-gradient(#eee, #eee);background-repeat:no-repeat;background-size:100% 20px,100% 40px,100% 20px,100% 40px;background-position:0 0,0 30px,0 100px,0 130px}.simpay-teaser-float:before{top:170px}.simpay-teaser-float .simpay-upgrade-btn-subtext{margin:24px -30px -30px;padding:32px 40px;border-bottom-left-radius:2px;border-bottom-right-radius:2px;border:0}.simpay-teaser-float .simpay-upgrade-btn-subtext svg{border-color:#fff}.simpay-teaser-float--inline{margin:40px 30px 30px}.simpay-teaser-float--inline .simpay-teaser-float__card{padding:30px;box-shadow:0 0 12px 6px rgba(0,0,0,.16)}#poststuff .simpay-teaser-float--inline h2,.simpay-teaser-float--inline h2{font-size:20px}.simpay-teaser-float--inline p{font-size:15px;margin:.75rem 0}.simpay-teaser-float--inline .button.button-large{font-size:15px;line-height:24px;margin:1rem 0;padding:8px 14px;display:inline-block}.simpay-teaser-float--inline:before,.simpay-teaser-float--inline:after{opacity:.6}.simpay-teaser-float--inline:before{display:none}.simpay-teaser-float--inline:after{top:15px}.simpay-form-settings-notice{font-weight:normal;color:#1d2327;position:relative;margin:18px 18px 0;padding:14px;border-radius:4px;background:#f5f5ff}.simpay-form-settings-notice a{color:#635aff}.simpay-form-settings-notice .simpay-external-link .dashicons-external{margin:1px 0 0 2px}.simpay-form-settings-notice strong{font-size:14px}.simpay-form-settings-notice p{margin:5px 0 0 23px}.simpay-form-settings-notice .simpay-notice-dismiss{font-size:20px;color:#b0b0f0;font-weight:bold;line-height:1;position:absolute;top:0;right:5px;text-decoration:none;padding:0 5px;z-index:2}.simpay-form-settings-notice .simpay-notice-dismiss:hover,.simpay-form-settings-notice .simpay-notice-dismiss:active,.simpay-form-settings-notice .simpay-notice-dismiss:focus{color:#9191ef;text-decoration:none;background:none}.simpay-settings .simpay-form-settings-notice{border:2px solid #645aff;box-shadow:0 1px 1px rgba(0,0,0,.04)}.post-type-simple-pay .lity{z-index:999999999;padding:20px}.post-type-simple-pay .lity-close{margin:10px}.post-type-simple-pay .lity-content{max-width:80vw;max-height:80vh}.post-type-simple-pay .lity-content img{max-height:80vh !important;max-width:80vw !important}#wpsp-api-keys-row-hide{display:none}.post-type-simple-pay #post-preview:not(.simpay-preview-button){display:none}.simpay-license-field-wrapper{margin:20px 0}#simpay-settings-license-key-license-key{margin:0}#simpay-settings-license-key-license-key[readonly]{background:#fff}.simpay-license-message__loading,.simpay-license-field{display:flex;align-items:center}.wp-core-ui .button.simpay-license-button.button-primary,.wp-core-ui .button.simpay-license-button.button-secondary{font-size:1rem;line-height:1;margin:0 8px;padding:13px}.simpay-license-message{font-size:15px;margin-top:8px}.simpay-license-message--valid{color:#15803d}.simpay-license-message--invalid{color:#b91c1c}.simpay-recaptcha-payment-form-feedback .dashicons{margin-top:-1px;display:inline-block}.simpay-recaptcha-payment-form-feedback .dashicons-update-alt{animation:rotation 2s infinite linear}.simpay-form-builder-inset-settings{margin:3px 0 0 24px}fieldset.simpay-form-builder-inset-settings>*:not(legend){margin:5px 0 8px}.simpay-form-builder-inset-settings>*:last-child{margin-bottom:0}.simpay-form-builder-inventory-control{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;padding:6px 8px;box-shadow:0 0 0 rgba(0,0,0,0);transition:box-shadow .1s linear;border-radius:2px;border:1px solid #757575;font-size:16px;line-height:normal;margin:0;padding:0;width:auto;display:inline-flex;align-items:center}@media(prefers-reduced-motion: reduce){.simpay-form-builder-inventory-control{transition-duration:0s;transition-delay:0s}}@media(min-width: 600px){.simpay-form-builder-inventory-control{font-size:13px;line-height:normal}}.simpay-form-builder-inventory-control:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid rgba(0,0,0,0)}.simpay-form-builder-inventory-control::-webkit-input-placeholder{color:rgba(30,30,30,.62)}.simpay-form-builder-inventory-control::-moz-placeholder{opacity:1;color:rgba(30,30,30,.62)}.simpay-form-builder-inventory-control:-ms-input-placeholder{color:rgba(30,30,30,.62)}.simpay-form-builder-inventory-control:focus-within{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid rgba(0,0,0,0)}.simpay-form-builder-inventory-control input[type=number]{border:0;box-shadow:none;background:none;border-radius:0;width:75px}.simpay-form-builder-inventory-control input[type=number]:focus{border:0;box-shadow:none;outline:0}.simpay-form-builder-inventory-control+label{margin-left:8px}.simpay-form-builder-inventory-control__initial{color:#757575;font-size:16px;line-height:normal;padding-right:8px}@media(min-width: 600px){.simpay-form-builder-inventory-control__initial{font-size:13px;line-height:normal}}.simpay-form-builder-inventory-control__initial:before{content:"/";display:inline-block;vertical-align:top;margin-top:-1px}.simpay-form-builder-purchase-restrictions__restriction-item{display:flex;align-items:center;margin-top:8px;margin-bottom:8px}.simpay-form-builder-purchase-restrictions__restriction-item label{margin-left:8px}.simpay-form-builder-purchase-restrictions__restriction-item-datetime{display:flex;align-items:center}.simpay-form-builder-purchase-restrictions__restriction-item-datetime>*{margin-right:10px}.simpay-form-builder-purchase-restrictions__restriction-item-datetime span{color:#757575}.simpay-form-builder-fee-recovery__amounts{display:flex;align-items:center;margin-top:5px}.simpay-form-builder-fee-recovery ::-webkit-input-placeholder{color:#b7bec7}.simpay-form-builder-fee-recovery ::-moz-placeholder{color:#b7bec7;opacity:1}.simpay-form-builder-fee-recovery :-ms-input-placeholder{color:#b7bec7}.simpay-form-builder-fee-recovery>*{margin-right:8px}.simpay-form-builder-fee-percent-control{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;padding:6px 8px;box-shadow:0 0 0 rgba(0,0,0,0);transition:box-shadow .1s linear;border-radius:2px;border:1px solid #757575;font-size:16px;line-height:normal;margin:0;padding:0;width:auto;display:inline-flex;align-items:center}@media(prefers-reduced-motion: reduce){.simpay-form-builder-fee-percent-control{transition-duration:0s;transition-delay:0s}}@media(min-width: 600px){.simpay-form-builder-fee-percent-control{font-size:13px;line-height:normal}}.simpay-form-builder-fee-percent-control:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid rgba(0,0,0,0)}.simpay-form-builder-fee-percent-control::-webkit-input-placeholder{color:rgba(30,30,30,.62)}.simpay-form-builder-fee-percent-control::-moz-placeholder{opacity:1;color:rgba(30,30,30,.62)}.simpay-form-builder-fee-percent-control:-ms-input-placeholder{color:rgba(30,30,30,.62)}.simpay-form-builder-fee-percent-control:focus-within{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid rgba(0,0,0,0)}.simpay-form-builder-fee-percent-control input[type=number]{border:0;box-shadow:none;background:none;border-radius:0;width:75px}.simpay-form-builder-fee-percent-control input[type=number]:focus{border:0;box-shadow:none;outline:0}.simpay-form-builder-fee-percent-control+label{margin-left:8px}.simpay-form-builder-fee-percent-control__suffix{color:#757575;font-size:16px;line-height:normal;padding-right:8px}@media(min-width: 600px){.simpay-form-builder-fee-percent-control__suffix{font-size:13px;line-height:normal}}.simpay-form-builder-automations__cta{margin:24px 0 6px;text-align:center}.simpay-form-builder-automator{padding:16px 4px 26px !important}.simpay-form-builder-automator,.simpay-form-builder-automator *{box-sizing:border-box}.simpay-form-builder-automator input[type=search]{font-size:15px;padding:2px 8px}.simpay-form-builder-automator__integrations{display:grid;grid-template-columns:repeat(4, minmax(0, 1fr));grid-column-gap:16px;grid-row-gap:16px;margin:18px -18px 0;padding:0 18px 10px;width:calc(100% + 36px);max-height:400px;overflow-y:scroll}.simpay-form-builder-automator__integrations-integration{color:initial;text-align:center;text-decoration:none;background:#fff;border:1px solid #eee;border-radius:4px;box-shadow:0 1px 3px 0 rgba(0,0,0,.03);transition:all ease-in .15s}.simpay-form-builder-automator__integrations-integration img{display:block;margin:16px auto;height:50px}.simpay-form-builder-automator__integrations-integration span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:8px 16px;display:block;border-top:1px solid #eee}.simpay-form-builder-automator__integrations-integration:hover{cursor:pointer;border-color:#ddd;box-shadow:0 2px 4px 0 rgba(0,0,0,.06)}body.site-health #wpbody-content,body.post-type-simple-pay #wpbody-content{padding-bottom:200px}#wpfooter .simpay-footer-promotion{text-align:center;font-weight:400;font-size:13px;line-height:16px;color:#787c82;padding:20px 0 30px 0;margin-bottom:20px}#wpfooter .simpay-footer-promotion p{font-weight:600}#wpfooter .simpay-footer-promotion-links,#wpfooter .simpay-footer-promotion-social{display:flex;justify-content:center;align-items:center}#wpfooter .simpay-footer-promotion-links{margin:9px 0 0}#wpfooter .simpay-footer-promotion-links span{color:#c3c4c7;padding:0 7px}#wpfooter .simpay-footer-promotion-social{margin:10px 0 0 0;gap:10px}#wpfooter .simpay-footer-promotion-social li{margin-bottom:0}#wpfooter .simpay-footer-promotion-social li:hover path{fill:#50575e}#wpfooter .simpay-footer-promotion-social a{display:block;height:16px}.simpay-settings-is_upe td{background:#fff;border:1px solid #c3c4c7;border-left-width:4px;border-left-color:#2271b1;box-shadow:0 1px 1px rgba(0,0,0,.04);padding:12px 18px} +.simpay-settings-subsections{display:flex;align-items:center;box-shadow:inset 0 -1px 0 0 #ccc}.simpay-settings-subsections__subsection{font-weight:500;text-decoration:none;padding:15px;display:flex;align-items:center}.simpay-settings-subsections__subsection .dashicons{width:18px;height:18px;font-size:18px;margin-right:4px}.simpay-settings-subsections__subsection.is-active{box-shadow:inset 0 -4px 0 0 currentColor;position:relative;z-index:1}.simpay-settings-subsections__subsection:not(.is-active){color:#23282d}.simpay-settings form>h2:not(.nav-tab-wrapper){clip:rect(1px, 1px, 1px, 1px);height:1px;overflow:hidden;position:absolute !important;width:1px}.simpay-settings .form-table td fieldset+p,.simpay-settings .form-table td label+p,.simpay-settings .form-table td select+p,.simpay-settings .form-table td input+p{color:#666;font-style:italic}.simpay-settings .simpay-settings-subsections__subsection{display:flex;align-items:center}.simpay-settings .simpay-settings-subsections__subsection .simpay-settings-bubble{margin-left:5px}.simpay-settings .simpay-settings-visual-toggles{margin:30px 0 0;display:flex}.simpay-settings .simpay-settings-visual-toggles input[type=radio]{display:none}.simpay-settings .simpay-settings-visual-toggles__toggle{-webkit-user-select:none;-moz-user-select:none;user-select:none;min-width:180px;margin:0 30px 0 0 !important;position:relative;display:block;background-color:#fff;border-radius:4px;border:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04)}.simpay-settings .simpay-settings-visual-toggles__toggle:hover{border:1px solid #999;box-shadow:0 1px 2px rgba(0,0,0,.1)}.simpay-settings .simpay-settings-visual-toggles input[type=radio]:checked+.simpay-settings-visual-toggles__toggle{border-color:#007cba;border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px #007cba;box-shadow:0 0 0 1px var(--wp-admin-theme-color)}.simpay-settings .simpay-settings-visual-toggles__toggle-recommended,.simpay-settings .simpay-settings-visual-toggles__toggle-not-recommended{text-align:center;font-size:12px;text-transform:uppercase;font-weight:bold;margin:0;padding:5px 0;display:block;border-top-right-radius:4px;border-top-left-radius:4px}.simpay-settings .simpay-settings-visual-toggles__toggle-recommended{color:#0f8569;background:#f4f9f7}.simpay-settings .simpay-settings-visual-toggles__toggle-not-recommended{color:#b91c1b;background:#fef2f2}.simpay-settings .simpay-settings-visual-toggles__toggle-icon{margin:20px auto 15px;padding:0 15px;display:block}.simpay-settings .simpay-settings-visual-toggles__toggle-label{line-height:1.5;text-align:center;font-size:16px;font-weight:500;margin:15px;display:block}.simpay-settings .simpay-settings-visual-toggles__toggle-label small{color:#666;font-weight:normal;font-size:13px;line-height:1;display:block;margin:4px 0}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type .simpay-settings-visual-toggles__toggle{min-height:160px}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type .simpay-settings-visual-toggles__toggle-icon{width:80px;height:80px}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type input[type=radio].simpay-settings-captcha-type--is-recommended:checked+.simpay-settings-visual-toggles__toggle{border-color:#0f8569;box-shadow:0 0 0 1px #0f8569}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type input[type=radio].simpay-settings-captcha-type--is-not-recommended:checked+.simpay-settings-visual-toggles__toggle{border-color:#b91c1b;box-shadow:0 0 0 1px #b91c1b}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type label[for=simpay-settings-captcha-type-cloudflare-turnstile] .simpay-settings-visual-toggles__toggle-icon{width:120px}.simpay-settings-general-recaptcha-no_captcha_warning th,.simpay-settings-general-recaptcha-no_captcha_warning td,.simpay-settings-hcaptcha_secret_key th,.simpay-settings-hcaptcha_secret_key td,.simpay-settings-cloudflare_turnstile_secret_key th,.simpay-settings-cloudflare_turnstile_secret_key td,.simpay-settings-recaptcha_score_threshold th,.simpay-settings-recaptcha_score_threshold td{padding-bottom:50px !important}.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-summary-report,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-payment-confirmation,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-payment-notification,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-upcoming-invoice,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-manage-subscriptions,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-invoice-confirmation{display:none}.simpay-settings .simpay-settings-subsection-emails-tools{margin-left:auto}.simpay-admin-charts-period-over-period{position:relative;padding-bottom:12px}.simpay-admin-charts-period-over-period *{box-sizing:border-box}.simpay-admin-charts-period-over-period__tooltip{position:absolute;background:#fff;border:1px solid #c3c3c3;box-shadow:0 2px 6px rgba(0,0,0,.05);border-radius:2px;padding:10px 14px;display:flex;flex-direction:column;z-Index:10000;min-width:175px}.simpay-admin-charts-period-over-period__tooltip-data{white-space:nowrap;margin-bottom:8px;display:grid;grid-template-columns:1fr auto;grid-auto-rows:auto;-moz-column-gap:16px;column-gap:16px}.simpay-admin-charts-period-over-period__tooltip-data:last-child{margin-bottom:0}.simpay-admin-charts-period-over-period__tooltip-data[data-dataset="1"]{opacity:.65}.simpay-admin-charts-period-over-period__tooltip-data em{font-style:normal;text-align:right}.simpay-admin-charts-period-over-period__tooltip-delta{font-size:12px;margin:0 -14px -10px;padding:8px 14px;border-top:1px solid #eee;background:#fdfdfd;border-radius:2px;display:flex;align-items:center;justify-content:center}.simpay-admin-charts-period-over-period__tooltip-delta .simpay-admin-charts-badge{margin-right:4px}.simpay-admin-charts-period-over-period__tooltip-delta strong.is-positive{color:#006908}.simpay-admin-charts-period-over-period__tooltip-delta strong.is-negative{color:#b3093c}.simpay-admin-charts-badge{color:#2f2f2f;font-size:12px;font-weight:500;font-style:normal;line-height:1;padding:3px 6px;display:inline-flex;align-items:center;background:#f0f0f0;border-radius:100px}.simpay-admin-charts-badge.is-positive{color:#006908;background-color:#d7f7c2}.simpay-admin-charts-badge.is-negative{color:#b3093c;background-color:#ffe7f2}.simpay-admin-charts-badge__icon{width:15px;height:15px}.simpay-admin-charts-no-data{position:absolute;top:0;left:0;display:flex;justify-content:center;align-items:center;background:rgba(255,255,255,.5);z-index:2}.simpay-admin-charts-no-data>div{text-align:center;padding:24px;background:#fff;border:1px solid #c3c3c3;box-shadow:0 2px 6px rgba(0,0,0,.1);border-radius:2px;max-width:60%}.simpay-admin-charts-no-data strong{font-size:15px;margin-bottom:8px;display:block}.button.button-large.simpay-button-large{font-size:14px;line-height:30px;padding:4px 12px}.simpay-copy-hidden-input{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}.fixed .column-livemode{width:15%;text-align:right}@media screen and (max-width: 782px){.fixed .column-livemode{text-align:left}}.fixed .column-livemode .simpay-badge{margin-top:3px}.fixed .column-shortcode{width:25%}.fixed .column-shortcode .simpay-shortcode{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}.post-type-simple-pay .misc-pub-curtime,.post-type-simple-pay .misc-pub-visibility{display:none}.simpay-metabox-title{border:1px solid #eee}.simpay-shortcode-section{border-top:1px solid #ddd;border-width:1px 0;padding-top:15px;padding-bottom:15px;position:relative}.simpay-shortcode-section label{display:block;margin-bottom:6px}.simpay-shortcode-section label .dashicons{color:#8c8f94;margin-right:3px}.simpay-shortcode-section .simpay-copy-button{line-height:normal;position:absolute;right:20px;bottom:20px;border:0;background:none;box-shadow:none;padding:0}.simpay-shortcode-section .simpay-copy-button:hover{border:0;background:none;box-shadow:none}.simpay-shortcode-section .simpay-copy-button .dashicons{color:#3c434a}.simpay-shortcode{width:100%;padding:8px;line-height:1;margin:0;height:32px;resize:none}.simpay-badge{color:#3f3f46;text-align:center;line-height:1;padding:5px 7px;border-radius:3px;background:#e4e4e7;border:0;box-shadow:none;display:inline-flex;align-items:center}button.simpay-badge{cursor:pointer}button.simpay-badge:hover{background:#d4d4d8}.simpay-badge__icon{opacity:.8;margin:2px 5px 0 0}.simpay-badge--green{color:#0e6245;background:#cbf4c9}.simpay-badge--yellow{color:#983705;background:#f8e5b9}.simpay-stripe-account-info{display:flex;align-items:center;margin-bottom:8px;position:relative}.simpay-stripe-account-info .spinner{float:none;margin-top:0;margin-left:0}.simple-pay_page_simpay_settings .simpay-settings-upgrade,.post-type-simple-pay .simpay-settings-upgrade{margin-top:20px;padding:1px;position:relative;background:#fff;border-radius:4px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.2),0 5px 10px rgba(0,0,0,.1);max-width:677px}.simple-pay_page_simpay_settings .simpay-settings-upgrade__inner,.post-type-simple-pay .simpay-settings-upgrade__inner{text-align:center;margin:0;padding:30px}.simple-pay_page_simpay_settings .simpay-settings-upgrade h3,.post-type-simple-pay .simpay-settings-upgrade h3{line-height:1.5;font-size:22px;margin:0 0 1.5rem}.simple-pay_page_simpay_settings .simpay-settings-upgrade ul,.post-type-simple-pay .simpay-settings-upgrade ul{margin:1.5rem 0 calc(1.5rem - 6px);display:flex;flex-wrap:wrap;justify-content:center}@media screen and (min-width: 782px){.simple-pay_page_simpay_settings .simpay-settings-upgrade ul,.post-type-simple-pay .simpay-settings-upgrade ul{margin-left:4rem;margin-right:4rem}}.simple-pay_page_simpay_settings .simpay-settings-upgrade li,.post-type-simple-pay .simpay-settings-upgrade li{font-size:15px;margin:6px 0;width:100%}.simple-pay_page_simpay_settings .simpay-settings-upgrade li a,.post-type-simple-pay .simpay-settings-upgrade li a{color:#3c434a;text-decoration:none}.simple-pay_page_simpay_settings .simpay-settings-upgrade li a:hover,.post-type-simple-pay .simpay-settings-upgrade li a:hover{color:var(--wp-admin-theme-color);text-decoration:underline}@media screen and (min-width: 782px){.simple-pay_page_simpay_settings .simpay-settings-upgrade li,.post-type-simple-pay .simpay-settings-upgrade li{text-align:left;width:50%}}.simple-pay_page_simpay_settings .simpay-settings-upgrade .button.button-large,.post-type-simple-pay .simpay-settings-upgrade .button.button-large{font-size:17px;line-height:30px;padding:10px 20px}.simple-pay_page_simpay_settings .simpay-settings-upgrade small,.post-type-simple-pay .simpay-settings-upgrade small{color:#666;margin:15px 0 0;display:block}.simple-pay_page_simpay_settings .simpay-settings-upgrade .dashicons-yes,.post-type-simple-pay .simpay-settings-upgrade .dashicons-yes{color:#428bca}.simple-pay_page_simpay_settings .simpay-settings-upgrade .button-link,.post-type-simple-pay .simpay-settings-upgrade .button-link{position:absolute;top:0;right:0;font-size:20px;color:#666;font-weight:bold;text-decoration:none;margin-left:5px;padding:6px 10px;z-index:2}.simple-pay_page_simpay_settings .simpay-settings-upgrade .button-link:hover,.simple-pay_page_simpay_settings .simpay-settings-upgrade .button-link:active,.simple-pay_page_simpay_settings .simpay-settings-upgrade .button-link:focus,.post-type-simple-pay .simpay-settings-upgrade .button-link:hover,.post-type-simple-pay .simpay-settings-upgrade .button-link:active,.post-type-simple-pay .simpay-settings-upgrade .button-link:focus{color:#666;text-decoration:none}.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext{text-align:center;margin:0;padding:30px 20px 20px;background-color:#fcf9e8;border:1px solid #edeac9;border-width:1px 0 0;position:relative;border-radius:0;border-bottom-left-radius:4px;border-bottom-right-radius:4px}@media screen and (min-width: 782px){.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext{padding-left:4rem;padding-right:4rem}}.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext svg,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext svg{background:#00a32a;fill:#fff;border-radius:50%;border:4px solid #fff;box-shadow:0 0 0 1px #edeac9;width:28px;height:28px;position:absolute;top:-18px;left:50%;margin-left:-18px}.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext u,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext u{text-decoration:none;font-weight:bold;color:#00a32a}.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext a,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext a{font-weight:normal;display:inline-block}#simpay-payment-form-settings table{width:100%;border-collapse:collapse}#simpay-payment-form-settings ::-webkit-input-placeholder{color:#9ba1a9}#simpay-payment-form-settings ::-moz-placeholder{color:#9ba1a9;opacity:1}#simpay-payment-form-settings :-ms-input-placeholder{color:#9ba1a9}#simpay-payment-form-settings .inside{margin:0;padding:0}#simpay-payment-form-settings .simpay-panel-field .toolbar{margin-bottom:-4px}#simpay-payment-form-settings .simpay-panel-field .toolbar .simpay-field-select{margin:0 0 4px;width:auto;max-width:70%}#simpay-payment-form-settings .simpay-tabs{margin:0;padding:0;list-style:none;background:#fafafa;border-right:1px solid #ccd0d4;line-height:1em;position:relative;flex:0 0 25%}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-tabs{flex-basis:100%;flex-grow:1;border-right:0}}#simpay-payment-form-settings .simpay-tabs li{margin:0;padding:0}#simpay-payment-form-settings .simpay-tabs li:first-child{margin-top:12px}#simpay-payment-form-settings .simpay-tabs li:last-child{margin-bottom:20px}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-tabs li:last-child{margin-bottom:0}}#simpay-payment-form-settings .simpay-tabs li.active{margin-left:-1px;box-shadow:0 1px 1px rgba(0,0,0,.04);position:relative}#simpay-payment-form-settings .simpay-tabs li.active:focus:after{display:none}#simpay-payment-form-settings .simpay-tabs li.active:before,#simpay-payment-form-settings .simpay-tabs li.active:after{content:"";width:calc(100% + 1px);height:1px;background:#ccd0d4;position:absolute;top:0;left:0;right:0;z-index:2}#simpay-payment-form-settings .simpay-tabs li.active:after{top:auto;bottom:0}#simpay-payment-form-settings .simpay-tabs li.active a{font-weight:bold;background-color:#fff;position:relative;margin-right:-1px}#simpay-payment-form-settings .simpay-tabs li.active a:before{content:"";position:absolute;top:0;left:0;bottom:0;width:4px;height:100%;background:currentColor;z-index:3}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-tabs li.active a{margin-right:0}}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item{display:flex;align-items:center;line-height:20px;margin:0;padding:8px 10px 8px 14px;text-decoration:none;transition:all .05s ease-in-out}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item svg,#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item .dashicons{margin-right:6px}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item{padding:18px}}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item:focus{outline:0;position:relative;z-index:3;box-shadow:inset 0 0 0 1px currentColor,0 0 0 1px currentColor}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item[href="#purchase-restrictions-settings-panel"],#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item[href="#payment-page-settings-panel"]{margin-bottom:20px;position:relative}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item[href="#purchase-restrictions-settings-panel"]:after,#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item[href="#payment-page-settings-panel"]:after{content:"";position:absolute;left:14px;right:14px;bottom:-10px;width:calc(100% - 28px);height:1px;background:#eaeaea}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item span>span{color:#f18500;font-size:12px;font-weight:600;margin:0 0 0 5px;display:inline-block}#simpay-payment-form-settings .simpay-tabs li:not(.active) .simpay-tab-item{color:inherit}#simpay-payment-form-settings .simpay-panels-wrap{background:#fff;display:flex}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-panels-wrap{flex-direction:column}}#simpay-payment-form-settings .simpay-panels{flex:0 0 75%;display:flex}@media screen and (min-width: 1400px){#simpay-payment-form-settings .simpay-panels{flex-basis:75%}}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-panels{flex-basis:100%}}#simpay-payment-form-settings .simpay-panel,#simpay-payment-form-settings .simpay-panel-section{width:100%}#simpay-payment-form-settings .simpay-panel>table,#simpay-payment-form-settings .simpay-panel>table>tr,#simpay-payment-form-settings .simpay-panel>table>tbody,#simpay-payment-form-settings .simpay-panel>table>tbody>tr,#simpay-payment-form-settings .simpay-panel>table>thead,#simpay-payment-form-settings .simpay-panel>table>thead>tr{display:block;width:100%}#simpay-payment-form-settings .simpay-panel>table:last-child>tbody:last-child>tr:last-child>td{border-bottom:0}#simpay-payment-form-settings .simpay-panel-field--requires-upgrade{position:relative}#simpay-payment-form-settings .simpay-panel-field--requires-upgrade td>div{margin-right:80px}#simpay-payment-form-settings .simpay-panel-field--requires-upgrade td>div .button-small{position:absolute;top:calc(50% - 13px);right:18px}#simpay-payment-form-settings .simpay-panel-field,#simpay-payment-form-settings .simpay-panel-field>td,#simpay-payment-form-settings .simpay-panel-field>th{text-align:left;display:block}#simpay-payment-form-settings .simpay-panel-field>td,#simpay-payment-form-settings .simpay-panel-field>th{width:calc(100% - 36px);margin-left:18px;margin-right:18px}#simpay-payment-form-settings .simpay-panel-field th{font-weight:bold;padding-top:18px;padding-bottom:5px}#simpay-payment-form-settings .simpay-panel-field td{border-bottom:1px solid #ddd;padding-bottom:18px}#simpay-payment-form-settings .simpay-panel-field p.description{margin-top:4px}#simpay-payment-form-settings .simpay-panel-field p.description:last-of-type{margin-bottom:0}#simpay-payment-form-settings .simpay-panel-field .simpay-panel-field__nested{margin-top:18px}#simpay-payment-form-settings .simpay-panel-field .simpay-panel-field__nested label{font-weight:bold;display:block;margin-bottom:4px}#simpay-payment-form-settings .simpay-panel-field .simpay-field-select,#simpay-payment-form-settings .simpay-panel-field .simpay-field-text{min-width:75%;max-width:100%}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-panel-field .simpay-field-select,#simpay-payment-form-settings .simpay-panel-field .simpay-field-text{min-width:0;width:100%}}#simpay-payment-form-settings .simpay-panel-field .simpay-field-textarea{width:100%;max-width:100%}#simpay-payment-form-settings .simpay-panel-field .notice:last-of-type{margin-bottom:0}#simpay-payment-form-settings .simpay-panel-field .error,#simpay-payment-form-settings .simpay-panel-field .simpay-important{color:#a94442;font-weight:normal}#simpay-payment-form-settings .simpay-panel-field .simpay-image-preview-wrap{position:relative;margin-top:12px}#simpay-payment-form-settings .simpay-panel-field .simpay-image-preview-wrap .simpay-remove-image-preview{position:absolute;top:-15px;left:-15px;cursor:pointer;background-color:#fff}#simpay-payment-form-settings .simpay-panel-field .simpay-image-preview-wrap .simpay-remove-image-preview::before{font-size:22px;line-height:26px}#simpay-payment-form-settings .simpay-panel-field .simpay-image-preview-wrap .simpay-image-preview{max-height:128px;max-width:128px;border:1px solid #ddd}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box{background-color:#f4f4f4;border:1px solid #e5e5e5;padding:18px;margin-top:18px;position:relative}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box__dismiss{color:inherit;text-decoration:none;position:absolute;top:8px;right:8px}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box__dismiss .dashicons-dismiss{font-size:16px;width:16px;height:16px}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box h3{font-size:18px;font-weight:600;margin:0;padding:0}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box p{font-size:14px}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box p:last-child{margin-bottom:0}#simpay-payment-form-settings .simpay-metabox-content{margin-bottom:-1px;background-color:#f5f5f5;border:1px solid #c3c4c7;border-width:1px 0;box-shadow:0 1px 1px rgba(0,0,0,.04);position:relative}#simpay-payment-form-settings .simpay-show-if,#simpay-payment-form-settings .simpay-panel-hidden{display:none}#simpay-payment-form-settings .simpay-payment-methods{border:1px solid #ccd0d4;border-radius:4px;box-shadow:0 1px 1px rgba(0,0,0,.04)}#simpay-payment-form-settings .simpay-panel-field-payment-method{display:block;border-top:1px solid #ccd0d4;padding:7px;box-sizing:border-box}#simpay-payment-form-settings .simpay-panel-field-payment-method:first-child{border-top:0;border-top-left-radius:4px;border-top-right-radius:4px}#simpay-payment-form-settings .simpay-panel-field-payment-method__enable{display:flex;align-items:center}#simpay-payment-form-settings .simpay-panel-field-payment-method__enable input[type=checkbox]{margin-top:0;margin-right:8px}#simpay-payment-form-settings .simpay-panel-field-payment-method__help{text-decoration:none}#simpay-payment-form-settings .simpay-panel-field-payment-method__help .dashicons{font-size:18px;width:18px;height:18px}#simpay-payment-form-settings .simpay-panel-field-payment-method__restrictions,#simpay-payment-form-settings .simpay-panel-field-payment-method__restrictions-ach{margin-left:72px}#simpay-payment-form-settings .simpay-panel-field-payment-method__icon{border-radius:3px;overflow:hidden;margin:0 8px 0 5px;width:30px;height:30px;flex-shrink:0}#simpay-payment-form-settings .simpay-panel-field-payment-method__icon svg{width:30px;height:30px}#simpay-payment-form-settings .simpay-panel-field-payment-method__configure{display:flex;align-items:center;justify-content:center}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metaboxes:not(.is-empty),#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metaboxes:not(.is-empty){border:1px solid #ccd0d4;box-shadow:0 1px 1px rgba(0,0,0,.04);border-radius:4px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-handlediv,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-handlediv{display:none;float:right;width:36px;height:36px;margin:0;padding:0;border:0;background:none;cursor:pointer;display:block}#simpay-global-settings .simpay-metaboxes-wrapper .postbox.closed .simpay-handlediv .toggle-indicator:before,#simpay-form-settings .simpay-metaboxes-wrapper .postbox.closed .simpay-handlediv .toggle-indicator:before{content:""}#simpay-global-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv:focus,#simpay-form-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv:focus{outline:0}#simpay-global-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv:focus .toggle-indicator:before,#simpay-form-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv:focus .toggle-indicator:before{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}#simpay-global-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv .toggle-indicator:before,#simpay-form-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv .toggle-indicator:before{margin-top:4px;width:20px;border-radius:50%;text-indent:-1px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox{background:#fff;border:1px solid #ccd0d4;margin:0 -1px -1px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .hndle,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .hndle{border:0}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox select,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox select{font-weight:400}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox:first-of-type,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox:first-of-type{margin-top:-1px;border-top-left-radius:4px;border-top-right-radius:4px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox:last-of-type,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox:last-of-type{margin-bottom:-1px;border-bottom-left-radius:4px;border-bottom-right-radius:4px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox:last-of-type .simpay-metabox-content,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox:last-of-type .simpay-metabox-content{border-bottom-left-radius:4px;border-bottom-right-radius:4px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2{cursor:pointer;display:flex;align-items:center;padding:10px 0 10px 12px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .simpay-field-type,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .simpay-field-type{font-size:90%;color:gray;font-weight:normal;text-decoration:none;margin-left:10px}@media screen and (max-width: 782px){#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .simpay-field-type,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .simpay-field-type{display:none}}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .dashicons-handle,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .dashicons-handle{cursor:move}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 strong,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 strong{font-size:95%;margin-left:8px;display:flex;align-items:center;flex-grow:1}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 svg,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 svg{border-radius:3px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 select,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 select{font-family:sans-serif;max-width:20%;margin:.25em .25em .25em 0}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2.fixed,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2.fixed{cursor:pointer !important}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .dashicons-menu,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .dashicons-menu{cursor:move}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions{padding:9px 18px;justify-content:space-between;display:flex;align-items:center}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id{display:flex;align-items:center}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id input,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id input{margin:0 2px 0 5px;width:50px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id a,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id a{text-decoration:none}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .button-link.simpay-remove-field-link,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .button-link.simpay-remove-field-link{color:#a00}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .button-link.simpay-remove-field-link:hover,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .button-link.simpay-remove-field-link:hover{color:#dc3232}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox table,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox table{border-spacing:0;width:100%}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox table.simpay-inner-table,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox table.simpay-inner-table{border:none;padding:0 1em}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox table tr td,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox table tr td{border-bottom-color:#ccd0d4}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-remove-plan,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-remove-plan{color:#a00}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-custom-field-payment-button .dashicons-menu,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-custom-field-payment-button .dashicons-menu{visibility:hidden}#simpay-global-settings .sortable-placeholder,#simpay-form-settings .sortable-placeholder{margin:5px;display:block;min-height:36px}#simpay-global-settings .chosen-container,#simpay-form-settings .chosen-container{min-width:20em;max-width:30em}#simpay-global-settings .simpay-field.simpay-small-text,#simpay-form-settings .simpay-field.simpay-small-text{width:7em}#simpay-global-settings .simpay-field.simpay-medium-text,#simpay-form-settings .simpay-field.simpay-medium-text{width:15em}#simpay-global-settings .simpay-field-radios ul,#simpay-form-settings .simpay-field-radios ul{margin:0}#simpay-global-settings .simpay-field-radios>i,#simpay-form-settings .simpay-field-radios>i{margin-left:5px;vertical-align:middle}#simpay-global-settings ul.simpay-field-radios-inline,#simpay-form-settings ul.simpay-field-radios-inline{margin:0 0 -10px}#simpay-global-settings ul.simpay-field-radios-inline li,#simpay-form-settings ul.simpay-field-radios-inline li{display:inline-block;margin:0 10px 10px 0}#simpay-global-settings ul.simpay-field-radios-inline li:last-child,#simpay-form-settings ul.simpay-field-radios-inline li:last-child{margin-right:0}#simpay-global-settings .simpay-currency-field,#simpay-form-settings .simpay-currency-field{display:flex;align-items:center}>#simpay-global-settings .simpay-currency-field:focus,>#simpay-form-settings .simpay-currency-field:focus{position:relative;z-index:5}#simpay-global-settings .simpay-currency-symbol,#simpay-form-settings .simpay-currency-symbol{margin:0;padding-left:8px;padding-right:8px;line-height:28px;font-size:14px}@media screen and (max-width: 782px){#simpay-global-settings .simpay-currency-symbol,#simpay-form-settings .simpay-currency-symbol{line-height:38px}}#simpay-global-settings .simpay-currency-symbol-left,#simpay-form-settings .simpay-currency-symbol-left{border-top-left-radius:4px;border-bottom-left-radius:4px}#simpay-global-settings .simpay-currency-symbol-right,#simpay-form-settings .simpay-currency-symbol-right{border-top-right-radius:4px;border-bottom-right-radius:4px}#simpay-global-settings div.simpay-currency-symbol,#simpay-form-settings div.simpay-currency-symbol{border-color:#7e8993;border-style:solid;background-color:#fff}#simpay-global-settings select.simpay-currency-symbol,#simpay-form-settings select.simpay-currency-symbol{padding-right:25px}#simpay-global-settings .simpay-currency-symbol-left,#simpay-form-settings .simpay-currency-symbol-left{border-width:1px 0 1px 1px}#simpay-global-settings .simpay-currency-symbol-left+.simpay-field-amount,#simpay-form-settings .simpay-currency-symbol-left+.simpay-field-amount{border-radius:0 4px 4px 0}#simpay-global-settings .simpay-currency-symbol-right,#simpay-form-settings .simpay-currency-symbol-right{border-width:1px 1px 1px 0}#simpay-global-settings .simpay-field-amount,#simpay-form-settings .simpay-field-amount{margin:0;padding-left:8px;padding-right:8px;font-size:14px;width:6em;position:relative;z-index:2;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px}#simpay-global-settings .simpay-error,#simpay-form-settings .simpay-error{color:red}#simpay-global-settings .simpay-docs-link-wrap,#simpay-form-settings .simpay-docs-link-wrap{position:absolute;right:0;bottom:0;color:#666;font-size:13px;font-style:italic;padding:15px 18px}#simpay-global-settings .simpay-docs-link-wrap a .dashicons-editor-help,#simpay-form-settings .simpay-docs-link-wrap a .dashicons-editor-help{color:#666;text-decoration:none;width:17px;height:17px;font-size:17px;padding-left:4px}#simpay-global-settings .simpay-docs-icon,#simpay-form-settings .simpay-docs-icon{color:#666}#simpay-global-settings .simpay-docs-icon,#simpay-global-settings .simpay-docs-icon .dashicons-editor-help,#simpay-form-settings .simpay-docs-icon,#simpay-form-settings .simpay-docs-icon .dashicons-editor-help{text-decoration:none;width:17px;height:17px;font-size:17px}.button.button-primary.simpay-upgrade-btn{background-color:#428bca;border:1px solid #428bca;color:#fff;display:inline-block}.button.button-primary.simpay-upgrade-btn:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px #2d6ca2}.button.button-primary.simpay-upgrade-btn:hover{background-color:#037ad0;border:1px solid #428bca}.simpay-upgrade-btn-subtext{color:#3c434a;font-size:14px;line-height:1.5;text-align:center;margin:40px 0 0;padding:30px 35px 20px;background-color:#fcf9e8;border:3px solid #ebe29a;border-radius:4px;position:relative}.simpay-upgrade-btn-subtext svg{background:#00a32a;fill:#fff;border-radius:50%;border:3px solid #ebe29a;width:28px;height:28px;position:absolute;top:-14px;left:50%;margin-left:-14px}.simpay-upgrade-btn-subtext u{text-decoration:none;font-weight:bold;color:#00a32a}.simpay-upgrade-btn-subtext a{text-decoration:none;display:block;margin-top:6px;font-weight:bold}.post-type-simple-pay #post-body-content{display:none}.simpay-card{margin:0 0 20px;padding:30px;background:#fff;border:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04)}.simpay-card,.simpay-card p{line-height:1.5;font-size:16px}.simpay-card h3{line-height:1.6;font-size:18px;margin:0 0 20px;color:#23282c}.simpay-card p{margin:0 0 20px}.simpay-card p:last-child,.simpay-card ul:last-child{margin-bottom:0}.simpay-card figure{float:right;margin:0 0 30px 30px;max-width:400px}.simpay-card figure iframe,.simpay-card figure img{max-width:100%}.simpay-card figure figcaption{text-align:center}@media screen and (max-width: 782px){.simpay-card figure{margin:0 0 30px;max-width:100%;float:none}}.simpay-doc-suggestions{width:100%;display:flex;flex-wrap:wrap;padding:0}.simpay-doc-suggestion{text-align:center;display:flex;flex-direction:column;justify-content:center;align-items:center;flex:0 1 33.333%;padding:30px;border-right:1px solid #c3c4c7;box-sizing:border-box}.simpay-doc-suggestion:nth-child(3n){border-right:0}@media screen and (max-width: 782px){.simpay-doc-suggestion{flex:0 1 100%;border-bottom:1px solid #c3c4c7;border-right:0}.simpay-doc-suggestion:last-child{border-bottom:0}}.simpay-doc-suggestion h3{font-size:20px;margin-bottom:10px}.simpay-doc-suggestion p{font-size:15px}.simpay-doc-suggestion .dashicons{font-size:40px;width:40px;height:40px;display:block;margin-bottom:10px}.simpay-doc-suggestion .button-large{font-size:16px}.simpay-addons{display:flex;flex-wrap:wrap;justify-content:space-between;margin:20px 0}.simpay-addon{background:#fff;border:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04);margin-bottom:20px;display:flex;flex-direction:column;flex-basis:calc(33% - 10px);box-sizing:border-box}@media screen and (max-width: 782px){.simpay-addon{flex-basis:100%}}.simpay-addon img{float:left;max-width:75px}.simpay-addon h5{margin:0 0 10px 100px;font-size:16px}.simpay-addon__details{padding:20px;flex:1 0 auto}.simpay-addon__actions{display:flex;align-items:center;justify-content:space-between;flex:0 1 auto;background-color:#f7f7f7;border-top:1px solid #ddd;margin-top:auto;padding:20px;position:relative}.simpay-addon__actions .msg{text-align:center;justify-content:center;display:flex;align-items:center;position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;background-color:#f7f7f7;z-index:3}.simpay-addon .error,.simpay-addon .status-label.status-installed{color:#d63638}.simpay-addon .success,.simpay-addon .status-label.status-active{color:#00a32a}.simpay-addon .addon-desc{margin:0 0 0 100px}.form-table td .simpay-stripe-connect-help{margin:15px 0;display:flex;align-items:center}.form-table td .simpay-stripe-connect-help .dashicons{margin-right:4px}.simpay-currency-field{display:flex;align-items:center}>.simpay-currency-field:focus{position:relative;z-index:5}.simpay-currency-symbol{margin:0;padding-left:8px;padding-right:8px;line-height:28px;font-size:14px}@media screen and (max-width: 782px){.simpay-currency-symbol{line-height:38px}}.simpay-currency-symbol-left{border-top-left-radius:4px;border-bottom-left-radius:4px}.simpay-currency-symbol-right{border-top-right-radius:4px;border-bottom-right-radius:4px}div.simpay-currency-symbol{border-color:#7e8993;border-style:solid;background-color:#fff}select.simpay-currency-symbol{padding-right:25px}.simpay-currency-symbol-left{border-width:1px 0 1px 1px}.simpay-currency-symbol-left+.simpay-field-amount{border-radius:0 4px 4px 0}.simpay-currency-symbol-right{border-width:1px 1px 1px 0}.simpay-field-amount{margin:0;padding-left:8px;padding-right:8px;font-size:14px;width:6em;position:relative;z-index:2;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px}.simpay-template-explorer-open .show-settings{display:none !important}.simpay-branding-bar{margin:0 -20px;padding:14px 22px;background:#fff;border-bottom:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04);width:calc(100% + 20px);display:flex;justify-content:space-between;box-sizing:border-box}.site-health .simpay-branding-bar{display:none}.simpay-branding-bar__title{display:flex;align-items:center;margin:8px 0}.simpay-branding-bar__logo{width:200px}.simpay-branding-bar__divider{color:#dadbdf;font-size:23px;font-weight:400;margin:0 15px}.simpay-branding-bar__actions{display:flex;align-items:center}.simpay-branding-bar__actions>div{margin-left:10px;min-width:40px}.simpay-branding-bar__actions-button{color:#000;cursor:pointer;padding:10px;width:40px;height:40px;background-color:#f3f4f5;border-radius:50%;border:0;box-shadow:none;position:relative;transition:background-color .2s ease;box-sizing:border-box;display:block}.simpay-branding-bar__actions-button:hover{background-color:#e5e5e5}.simpay-branding-bar__actions-button:active,.simpay-branding-bar__actions-button:focus{box-shadow:0 0 0 2px var(--wp-admin-theme-color)}.simpay-branding-bar__actions-button-count{font-weight:600;font-size:10px;line-height:16px;color:#fff;margin:0;background-color:#df2a4a;border-radius:100%;width:16px;height:16px;position:absolute;top:-8px;left:50%;margin-left:-8px}.simpay-branding-bar .wp-heading-inline{font-size:23px;font-weight:400;margin:0}.simpay-branding-bar .page-title-action{font-weight:600;font-size:13px;line-height:normal;cursor:pointer;text-shadow:none;text-decoration:none;margin-left:10px;padding:4px 8px;border:1px solid currentColor;border-radius:2px;background:#f6f7f7}.simpay-landing-zone{text-align:center;max-width:700px;margin:40px auto}.simpay-landing-zone__title{font-size:26px;font-weight:600;margin:0 0 1.5rem;padding:0}.simpay-landing-zone__subtitle{font-size:17px;color:#666;margin:.25rem 0}.simpay-landing-zone__subtitle strong{color:#444}.simpay-landing-zone section{margin:2rem 0}.simpay-landing-zone__empty-state-graphic img{width:425px}.simpay-landing-zone__screenshot>*{vertical-align:middle}.simpay-landing-zone__screenshot-img{display:inline-block;position:relative;width:315px;padding:5px;background-color:#fff;box-shadow:0px 2px 5px 0px rgba(0,0,0,.05);border-radius:3px}.simpay-landing-zone__screenshot-img img{max-width:100%;display:block}.simpay-landing-zone__screenshot-img .hover{position:absolute;opacity:0;height:calc(100% - 10px);width:calc(100% - 10px);top:0;left:0;border:5px solid #fff;background-color:rgba(0,0,0,.15);background-image:url(data:image/svg+xml;base64,PHN2ZyBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjojZmZmZmZmMDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCIgaGVpZ2h0PSIxMDAiPjxwYXRoIGQ9Ik01MCAwYzI3LjYxNCAwIDUwIDIyLjM4NiA1MCA1MHMtMjIuMzg2IDUwLTUwIDUwUzAgNzcuNjE0IDAgNTAgMjIuMzg2IDAgNTAgMHoiIGZpbGw9IiMxNjg1YjciLz48cGF0aCBkPSJNNzMuMDIzIDY3LjA2N2wtOS4zNDQtOS4zNDRhMi4yNDcgMi4yNDcgMCAwMC0xLjU5My0uNjU2aC0xLjUyOGExOS4zOTkgMTkuMzk5IDAgMDA0LjEyNC0xMS45OTZjMC0xMC43Ny04LjcyNS0xOS40OTUtMTkuNDk0LTE5LjQ5NS0xMC43NjggMC0xOS40OTQgOC43MjYtMTkuNDk0IDE5LjQ5NSAwIDEwLjc2OCA4LjcyNiAxOS40OTMgMTkuNDk0IDE5LjQ5M2ExOS40IDE5LjQgMCAwMDExLjk5Ny00LjEyM3YxLjUyN2MwIC42LjIzNCAxLjE3Mi42NTUgMS41OTRsOS4zNDQgOS4zNDRhMi4yNCAyLjI0IDAgMDAzLjE3OCAwbDIuNjUyLTIuNjUzYTIuMjYgMi4yNiAwIDAwLjAxLTMuMTg2em0tMjcuODM1LTEwYy02LjYyNiAwLTExLjk5Ni01LjM2MS0xMS45OTYtMTEuOTk2IDAtNi42MjcgNS4zNi0xMS45OTcgMTEuOTk2LTExLjk5NyA2LjYyNiAwIDExLjk5NyA1LjM2MSAxMS45OTcgMTEuOTk3IDAgNi42MjYtNS4zNjEgMTEuOTk2LTExLjk5NyAxMS45OTZ6IiBmaWxsPSIjZmZmIi8+PC9zdmc+);background-repeat:no-repeat;background-position:center;background-size:50px;transition:all .3s}.simpay-landing-zone__screenshot-img:hover .hover{opacity:1;transition:all .3s}.simpay-landing-zone__screenshot ul{text-align:left;display:inline-block;margin:0 0 0 30px;list-style-type:none;max-width:calc(100% - 350px)}@media screen and (max-width: 782px){.simpay-landing-zone__screenshot ul{text-align:center;margin:30px auto;max-width:100%;display:block}}.simpay-landing-zone__screenshot li{margin:16px 0;padding:0;font-size:15px;color:#777;position:relative}.simpay-landing-zone__screenshot li:before{content:"";background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEzLjc3NjIgNi40NTYwNUw4LjcyMDMyIDEuNDAwMDVDOC41NzU5OSAxLjI1NTcyIDguMzgzNjQgMS4xNzY1IDguMTc4NTMgMS4xNzY1QzcuOTczMiAxLjE3NjUgNy43ODA5NiAxLjI1NTg0IDcuNjM2NjQgMS40MDAwNUw3LjE3NzYgMS44NTkyQzcuMDMzMzkgMi4wMDMyOSA2Ljk1Mzk1IDIuMTk1NzYgNi45NTM5NSAyLjQwMDk4QzYuOTUzOTUgMi42MDYwOCA3LjAzMzM5IDIuODA1MDQgNy4xNzc2IDIuOTQ5MTRMMTAuMTI3MSA1LjkwNTE2SDAuNzU2MzM0QzAuMzMzODM0IDUuOTA1MTYgMCA2LjIzNTkyIDAgNi42NTg1NFY3LjMwNzY1QzAgNy43MzAyNyAwLjMzMzgzNCA4LjA5NDM4IDAuNzU2MzM0IDguMDk0MzhIMTAuMTYwNkw3LjE3NzcyIDExLjA2NjlDNy4wMzM1MSAxMS4yMTEyIDYuOTU0MDYgMTEuMzk4NSA2Ljk1NDA2IDExLjYwMzdDNi45NTQwNiAxMS44MDg3IDcuMDMzNTEgMTEuOTk4NiA3LjE3NzcyIDEyLjE0MjhMNy42MzY3NSAxMi42MDA1QzcuNzgxMDcgMTIuNzQ0OCA3Ljk3MzMyIDEyLjgyMzUgOC4xNzg2NSAxMi44MjM1QzguMzgzNzUgMTIuODIzNSA4LjU3NjExIDEyLjc0MzggOC43MjA0MyAxMi41OTk1TDEzLjc3NjMgNy41NDM2QzEzLjkyMSA3LjM5ODgyIDE0LjAwMDUgNy4yMDU1NiAxNCA3LjAwMDExQzE0LjAwMDQgNi43OTM5OCAxMy45MjEgNi42MDA2IDEzLjc3NjIgNi40NTYwNVY2LjQ1NjA1WiIgZmlsbD0iIzQyOEJDQSIvPgo8L3N2Zz4K);background-position:center;background-repeat:no-repeat;background-size:14px;width:14px;height:14px;display:inline-block;margin:-3px 5px 0 0;vertical-align:middle}.simpay-landing-zone .button.button-large{font-size:17px;line-height:30px;padding:10px 20px}.simpay-landing-zone__purchased{display:block;margin:15px 0 0}.simpay-upgrade-modal,.simpay-upgrade-upe-modal{padding:0 !important}.simpay-upgrade-modal *,.simpay-upgrade-upe-modal *{box-sizing:border-box}.simpay-upgrade-modal__content,.simpay-upgrade-upe-modal__content{text-align:center;display:flex;flex-direction:column;align-items:center;padding:16px 32px 32px}.simpay-upgrade-modal__content>.dashicons,.simpay-upgrade-upe-modal__content>.dashicons{color:#333;font-size:48px;width:48px;height:48px}.simpay-upgrade-modal__title,.simpay-upgrade-upe-modal__title{font-size:22px;line-height:1.5;display:block;margin:12px 0 0}.simpay-upgrade-modal__description,.simpay-upgrade-upe-modal__description{color:#777;font-size:16px;margin:16px 0 24px}.simpay-upgrade-modal__description strong,.simpay-upgrade-upe-modal__description strong{color:#333}.simpay-upgrade-modal__discount,.simpay-upgrade-upe-modal__discount{font-size:15px;text-align:center;margin:32px -32px -32px;padding:24px 40px;background-color:#fcf9e8;position:relative}.simpay-upgrade-modal__discount svg,.simpay-upgrade-upe-modal__discount svg{background:#00a32a;fill:#fff;border-radius:50%;border:4px solid #fff;width:32px;height:32px;position:absolute;top:-16px;left:50%;margin-left:-16px}.simpay-upgrade-modal__discount u,.simpay-upgrade-upe-modal__discount u{text-decoration:none;font-weight:bold;color:#00a32a}.simpay-upgrade-modal .button-large,.simpay-upgrade-upe-modal .button-large{font-size:16px;font-weight:bold;margin:0 0 15px;padding:8px 30px !important;height:auto}.simpay-teaser-float{margin:50px;position:relative}.simpay-teaser-float__card{text-align:center;padding:30px;background:#fff;border-radius:4px;box-shadow:0 0 30px 15px rgba(0,0,0,.18);position:relative;z-index:2}#poststuff .simpay-teaser-float h2,.simpay-teaser-float h2{font-size:24px;font-weight:600;margin:0;padding:0}.simpay-teaser-float p{font-size:15px;line-height:1.35;color:#666}.simpay-teaser-float p strong{color:#444}.simpay-teaser-float ul{text-align:left;display:inline-block;margin:-10px 0 20px;list-style-type:none}.simpay-teaser-float li{margin:16px 0;padding:0 0 0 24px;font-size:15px;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEzLjc3NjIgNi40NTYwNUw4LjcyMDMyIDEuNDAwMDVDOC41NzU5OSAxLjI1NTcyIDguMzgzNjQgMS4xNzY1IDguMTc4NTMgMS4xNzY1QzcuOTczMiAxLjE3NjUgNy43ODA5NiAxLjI1NTg0IDcuNjM2NjQgMS40MDAwNUw3LjE3NzYgMS44NTkyQzcuMDMzMzkgMi4wMDMyOSA2Ljk1Mzk1IDIuMTk1NzYgNi45NTM5NSAyLjQwMDk4QzYuOTUzOTUgMi42MDYwOCA3LjAzMzM5IDIuODA1MDQgNy4xNzc2IDIuOTQ5MTRMMTAuMTI3MSA1LjkwNTE2SDAuNzU2MzM0QzAuMzMzODM0IDUuOTA1MTYgMCA2LjIzNTkyIDAgNi42NTg1NFY3LjMwNzY1QzAgNy43MzAyNyAwLjMzMzgzNCA4LjA5NDM4IDAuNzU2MzM0IDguMDk0MzhIMTAuMTYwNkw3LjE3NzcyIDExLjA2NjlDNy4wMzM1MSAxMS4yMTEyIDYuOTU0MDYgMTEuMzk4NSA2Ljk1NDA2IDExLjYwMzdDNi45NTQwNiAxMS44MDg3IDcuMDMzNTEgMTEuOTk4NiA3LjE3NzcyIDEyLjE0MjhMNy42MzY3NSAxMi42MDA1QzcuNzgxMDcgMTIuNzQ0OCA3Ljk3MzMyIDEyLjgyMzUgOC4xNzg2NSAxMi44MjM1QzguMzgzNzUgMTIuODIzNSA4LjU3NjExIDEyLjc0MzggOC43MjA0MyAxMi41OTk1TDEzLjc3NjMgNy41NDM2QzEzLjkyMSA3LjM5ODgyIDE0LjAwMDUgNy4yMDU1NiAxNCA3LjAwMDExQzE0LjAwMDQgNi43OTM5OCAxMy45MjEgNi42MDA2IDEzLjc3NjIgNi40NTYwNVY2LjQ1NjA1WiIgZmlsbD0iIzQyOEJDQSIvPgo8L3N2Zz4K);background-position:left 3px;background-repeat:no-repeat;background-size:14px;color:#777}.simpay-teaser-float .button.button-large{font-size:17px;line-height:30px;padding:10px 20px}.simpay-teaser-float .simpay-notice-dismiss{position:absolute;top:0;right:0;font-size:20px;color:#666;font-weight:bold;text-decoration:none;margin-left:5px;padding:6px 10px;z-index:2}.simpay-teaser-float .simpay-notice-dismiss:hover,.simpay-teaser-float .simpay-notice-dismiss:active,.simpay-teaser-float .simpay-notice-dismiss:focus{color:#666;text-decoration:none}.simpay-teaser-float:after,.simpay-teaser-float:before{opacity:.75;z-index:0;content:"";position:absolute;left:-30px;right:-30px;top:-35px;width:calc(100% + 60px);height:170px;background-image:linear-gradient(#ddd, #ddd),linear-gradient(#eee, #eee),linear-gradient(#ddd, #ddd),linear-gradient(#eee, #eee);background-repeat:no-repeat;background-size:100% 20px,100% 40px,100% 20px,100% 40px;background-position:0 0,0 30px,0 100px,0 130px}.simpay-teaser-float:before{top:170px}.simpay-teaser-float .simpay-upgrade-btn-subtext{margin:24px -30px -30px;padding:32px 40px;border-bottom-left-radius:2px;border-bottom-right-radius:2px;border:0}.simpay-teaser-float .simpay-upgrade-btn-subtext svg{border-color:#fff}.simpay-teaser-float--inline{margin:40px 30px 30px}.simpay-teaser-float--inline .simpay-teaser-float__card{padding:30px;box-shadow:0 0 12px 6px rgba(0,0,0,.16)}#poststuff .simpay-teaser-float--inline h2,.simpay-teaser-float--inline h2{font-size:20px}.simpay-teaser-float--inline p{font-size:15px;margin:.75rem 0}.simpay-teaser-float--inline .button.button-large{font-size:15px;line-height:24px;margin:1rem 0;padding:8px 14px;display:inline-block}.simpay-teaser-float--inline:before,.simpay-teaser-float--inline:after{opacity:.6}.simpay-teaser-float--inline:before{display:none}.simpay-teaser-float--inline:after{top:15px}.simpay-form-settings-notice{font-weight:normal;color:#1d2327;position:relative;margin:18px 18px 0;padding:14px;border-radius:4px;background:#f5f5ff}.simpay-form-settings-notice a{color:#635aff}.simpay-form-settings-notice .simpay-external-link .dashicons-external{margin:1px 0 0 2px}.simpay-form-settings-notice strong{font-size:14px}.simpay-form-settings-notice p{margin:5px 0 0 23px}.simpay-form-settings-notice .simpay-notice-dismiss{font-size:20px;color:#b0b0f0;font-weight:bold;line-height:1;position:absolute;top:0;right:5px;text-decoration:none;padding:0 5px;z-index:2}.simpay-form-settings-notice .simpay-notice-dismiss:hover,.simpay-form-settings-notice .simpay-notice-dismiss:active,.simpay-form-settings-notice .simpay-notice-dismiss:focus{color:#9191ef;text-decoration:none;background:none}.simpay-settings .simpay-form-settings-notice{border:2px solid #645aff;box-shadow:0 1px 1px rgba(0,0,0,.04)}.post-type-simple-pay .lity{z-index:999999999;padding:20px}.post-type-simple-pay .lity-close{margin:10px}.post-type-simple-pay .lity-content{max-width:80vw;max-height:80vh}.post-type-simple-pay .lity-content img{max-height:80vh !important;max-width:80vw !important}#wpsp-api-keys-row-hide{display:none}.post-type-simple-pay #post-preview:not(.simpay-preview-button){display:none}.simpay-license-field-wrapper{margin:20px 0}#simpay-settings-license-key-license-key{margin:0}#simpay-settings-license-key-license-key[readonly]{background:#fff}.simpay-license-message__loading,.simpay-license-field{display:flex;align-items:center}.wp-core-ui .button.simpay-license-button.button-primary,.wp-core-ui .button.simpay-license-button.button-secondary{font-size:1rem;line-height:1;margin:0 8px;padding:13px}.simpay-license-message{font-size:15px;margin-top:8px}.simpay-license-message--valid{color:#15803d}.simpay-license-message--invalid{color:#b91c1c}.simpay-recaptcha-payment-form-feedback .dashicons{margin-top:-1px;display:inline-block}.simpay-recaptcha-payment-form-feedback .dashicons-update-alt{animation:rotation 2s infinite linear}.simpay-form-builder-inset-settings{margin:3px 0 0 24px}fieldset.simpay-form-builder-inset-settings>*:not(legend){margin:5px 0 8px}.simpay-form-builder-inset-settings>*:last-child{margin-bottom:0}.simpay-form-builder-inventory-control{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;padding:6px 8px;box-shadow:0 0 0 rgba(0,0,0,0);transition:box-shadow .1s linear;border-radius:2px;border:1px solid #757575;font-size:16px;line-height:normal;margin:0;padding:0;width:auto;display:inline-flex;align-items:center}@media(prefers-reduced-motion: reduce){.simpay-form-builder-inventory-control{transition-duration:0s;transition-delay:0s}}@media(min-width: 600px){.simpay-form-builder-inventory-control{font-size:13px;line-height:normal}}.simpay-form-builder-inventory-control:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid rgba(0,0,0,0)}.simpay-form-builder-inventory-control::-webkit-input-placeholder{color:rgba(30,30,30,.62)}.simpay-form-builder-inventory-control::-moz-placeholder{opacity:1;color:rgba(30,30,30,.62)}.simpay-form-builder-inventory-control:-ms-input-placeholder{color:rgba(30,30,30,.62)}.simpay-form-builder-inventory-control:focus-within{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid rgba(0,0,0,0)}.simpay-form-builder-inventory-control input[type=number]{border:0;box-shadow:none;background:none;border-radius:0;width:75px}.simpay-form-builder-inventory-control input[type=number]:focus{border:0;box-shadow:none;outline:0}.simpay-form-builder-inventory-control+label{margin-left:8px}.simpay-form-builder-inventory-control__initial{color:#757575;font-size:16px;line-height:normal;padding-right:8px}@media(min-width: 600px){.simpay-form-builder-inventory-control__initial{font-size:13px;line-height:normal}}.simpay-form-builder-inventory-control__initial:before{content:"/";display:inline-block;vertical-align:top;margin-top:-1px}.simpay-form-builder-purchase-restrictions__restriction-item{display:flex;align-items:center;margin-top:8px;margin-bottom:8px}.simpay-form-builder-purchase-restrictions__restriction-item label{margin-left:8px}.simpay-form-builder-purchase-restrictions__restriction-item-datetime{display:flex;align-items:center}.simpay-form-builder-purchase-restrictions__restriction-item-datetime>*{margin-right:10px}.simpay-form-builder-purchase-restrictions__restriction-item-datetime span{color:#757575}.simpay-form-builder-fee-recovery__amounts{display:flex;align-items:center;margin-top:5px}.simpay-form-builder-fee-recovery ::-webkit-input-placeholder{color:#b7bec7}.simpay-form-builder-fee-recovery ::-moz-placeholder{color:#b7bec7;opacity:1}.simpay-form-builder-fee-recovery :-ms-input-placeholder{color:#b7bec7}.simpay-form-builder-fee-recovery>*{margin-right:8px}.simpay-form-builder-fee-percent-control{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;padding:6px 8px;box-shadow:0 0 0 rgba(0,0,0,0);transition:box-shadow .1s linear;border-radius:2px;border:1px solid #757575;font-size:16px;line-height:normal;margin:0;padding:0;width:auto;display:inline-flex;align-items:center}@media(prefers-reduced-motion: reduce){.simpay-form-builder-fee-percent-control{transition-duration:0s;transition-delay:0s}}@media(min-width: 600px){.simpay-form-builder-fee-percent-control{font-size:13px;line-height:normal}}.simpay-form-builder-fee-percent-control:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid rgba(0,0,0,0)}.simpay-form-builder-fee-percent-control::-webkit-input-placeholder{color:rgba(30,30,30,.62)}.simpay-form-builder-fee-percent-control::-moz-placeholder{opacity:1;color:rgba(30,30,30,.62)}.simpay-form-builder-fee-percent-control:-ms-input-placeholder{color:rgba(30,30,30,.62)}.simpay-form-builder-fee-percent-control:focus-within{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid rgba(0,0,0,0)}.simpay-form-builder-fee-percent-control input[type=number]{border:0;box-shadow:none;background:none;border-radius:0;width:75px}.simpay-form-builder-fee-percent-control input[type=number]:focus{border:0;box-shadow:none;outline:0}.simpay-form-builder-fee-percent-control+label{margin-left:8px}.simpay-form-builder-fee-percent-control__suffix{color:#757575;font-size:16px;line-height:normal;padding-right:8px}@media(min-width: 600px){.simpay-form-builder-fee-percent-control__suffix{font-size:13px;line-height:normal}}.simpay-form-builder-automations__cta{margin:24px 0 6px;text-align:center}.simpay-form-builder-automator{padding:16px 4px 26px !important}.simpay-form-builder-automator,.simpay-form-builder-automator *{box-sizing:border-box}.simpay-form-builder-automator input[type=search]{font-size:15px;padding:2px 8px}.simpay-form-builder-automator__integrations{display:grid;grid-template-columns:repeat(4, minmax(0, 1fr));grid-column-gap:16px;grid-row-gap:16px;margin:18px -18px 0;padding:0 18px 10px;width:calc(100% + 36px);max-height:400px;overflow-y:scroll}.simpay-form-builder-automator__integrations-integration{color:initial;text-align:center;text-decoration:none;background:#fff;border:1px solid #eee;border-radius:4px;box-shadow:0 1px 3px 0 rgba(0,0,0,.03);transition:all ease-in .15s}.simpay-form-builder-automator__integrations-integration img{display:block;margin:16px auto;height:50px}.simpay-form-builder-automator__integrations-integration span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:8px 16px;display:block;border-top:1px solid #eee}.simpay-form-builder-automator__integrations-integration:hover{cursor:pointer;border-color:#ddd;box-shadow:0 2px 4px 0 rgba(0,0,0,.06)}body.site-health #wpbody-content,body.post-type-simple-pay #wpbody-content{padding-bottom:200px}#wpfooter .simpay-footer-promotion{text-align:center;font-weight:400;font-size:13px;line-height:16px;color:#787c82;padding:20px 0 30px 0;margin-bottom:20px}#wpfooter .simpay-footer-promotion p{font-weight:600}#wpfooter .simpay-footer-promotion-links,#wpfooter .simpay-footer-promotion-social{display:flex;justify-content:center;align-items:center}#wpfooter .simpay-footer-promotion-links{margin:9px 0 0}#wpfooter .simpay-footer-promotion-links span{color:#c3c4c7;padding:0 7px}#wpfooter .simpay-footer-promotion-social{margin:10px 0 0 0;gap:10px}#wpfooter .simpay-footer-promotion-social li{margin-bottom:0}#wpfooter .simpay-footer-promotion-social li:hover path{fill:#50575e}#wpfooter .simpay-footer-promotion-social a{display:block;height:16px}.simpay-settings-is_upe td{background:#fff;border:1px solid #c3c4c7;border-left-width:4px;border-left-color:#2271b1;box-shadow:0 1px 1px rgba(0,0,0,.04);padding:12px 18px} diff --git a/includes/core/assets/js/dist/simpay-admin-dashboard-widget-report-css.asset.php b/includes/core/assets/js/dist/simpay-admin-dashboard-widget-report-css.asset.php index d5f13db7..9781c80d 100644 --- a/includes/core/assets/js/dist/simpay-admin-dashboard-widget-report-css.asset.php +++ b/includes/core/assets/js/dist/simpay-admin-dashboard-widget-report-css.asset.php @@ -1 +1 @@ - array(), 'version' => '2fc5df850afb9619b482b2d36d70211f'); \ No newline at end of file + array(), 'version' => '10e0c9aefff5d3a8302d317cb61bc427'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-dashboard-widget-report.asset.php b/includes/core/assets/js/dist/simpay-admin-dashboard-widget-report.asset.php index 9d17f391..aff448bd 100644 --- a/includes/core/assets/js/dist/simpay-admin-dashboard-widget-report.asset.php +++ b/includes/core/assets/js/dist/simpay-admin-dashboard-widget-report.asset.php @@ -1 +1 @@ - array('lodash', 'react', 'wp-api-fetch', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => 'f514bdccae609dacea820edddfa0180d'); \ No newline at end of file + array('lodash', 'react', 'wp-api-fetch', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => 'af7158193a243840baf147a2c1cd6f5e'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-dashboard-widget-report.js b/includes/core/assets/js/dist/simpay-admin-dashboard-widget-report.js index 86fffe34..20f5f114 100644 --- a/includes/core/assets/js/dist/simpay-admin-dashboard-widget-report.js +++ b/includes/core/assets/js/dist/simpay-admin-dashboard-widget-report.js @@ -1,4 +1,4 @@ -!function(t){var e={};function i(n){if(e[n])return e[n].exports;var s=e[n]={i:n,l:!1,exports:{}};return t[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}i.m=t,i.c=e,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 s in t)i.d(n,s,function(e){return t[e]}.bind(null,s));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="",i(i.s=81)}([function(t,e){t.exports=window.wp.element},,function(t,e){t.exports=window.wp.i18n},function(t,e){t.exports=window.wp.components},function(t,e,i){"use strict";function n(t,e){if(e.length1?"s":"")+" required, but only "+e.length+" present")}i.d(e,"a",(function(){return n}))},function(t,e){t.exports=window.React},function(t,e,i){var n=i(26),s=i(27),r=i(21),o=i(28);t.exports=function(t,e){return n(t)||s(t,e)||r(t,e)||o()},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){"use strict";function n(t){if(null===t||!0===t||!1===t)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}i.d(e,"a",(function(){return n}))},function(t,e,i){"use strict";i.d(e,"a",(function(){return r}));var n=i(4);function s(t){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t){Object(n.a)(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||"object"===s(t)&&"[object Date]"===e?new Date(t.getTime()):"number"==typeof t||"[object Number]"===e?new Date(t):("string"!=typeof t&&"[object String]"!==e||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}},function(t,e){t.exports=window.wp.primitives},function(t,e){t.exports=window.wp.url},function(t,e,i){var n=i(30);t.exports=function(t,e,i){return(e=n(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=window.lodash},function(t,e,i){"use strict";i.d(e,"b",(function(){return Fo})),i.d(e,"e",(function(){return Do})),i.d(e,"d",(function(){return yo})),i.d(e,"c",(function(){return vo})),i.d(e,"a",(function(){return To}));var n=i(15),s=i.n(n),r=i(11),o=i.n(r),a=i(6),l=i.n(a),c=i(0);const h="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function d(t,e,i){const n=i||(t=>Array.prototype.slice.call(t));let s=!1,r=[];return function(...i){r=n(i),s||(s=!0,h.call(window,()=>{s=!1,t.apply(e,r)}))}}const u=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2;function f(){}const g=function(){let t=0;return function(){return t++}}();function p(t){return null==t}function m(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.substr(0,7)&&"Array]"===e.substr(-6)}function b(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}const x=t=>("number"==typeof t||t instanceof Number)&&isFinite(+t);function y(t,e){return x(t)?t:e}function v(t,e){return void 0===t?e:t}const _=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function w(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function M(t,e,i,n){let s,r,o;if(m(t))if(r=t.length,n)for(s=r-1;s>=0;s--)e.call(i,t[s],s);else for(s=0;si;)t=t[e.substr(i,n-i)],i=n+1,n=E(e,i);return t}function A(t){return t.charAt(0).toUpperCase()+t.slice(1)}const L=t=>void 0!==t,R=t=>"function"==typeof t,F=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0},z=Math.PI,I=2*z,N=I+z,V=Number.POSITIVE_INFINITY,W=z/180,B=z/2,H=z/4,U=2*z/3,Y=Math.log10,$=Math.sign;function X(t){const e=Math.round(t);t=G(t,e,t/1e3)?e:t;const i=Math.pow(10,Math.floor(Y(t))),n=t/i;return(n<=1?1:n<=2?2:n<=5?5:10)*i}function q(t){return!isNaN(parseFloat(t))&&isFinite(t)}function G(t,e,i){return Math.abs(t-e)l&&c=Math.min(e,i)-n&&t<=Math.max(e,i)+n}const at=t=>0===t||1===t,lt=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*I/i),ct=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*I/i)+1,ht={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*B),easeOutSine:t=>Math.sin(t*B),easeInOutSine:t=>-.5*(Math.cos(z*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>at(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>at(t)?t:lt(t,.075,.3),easeOutElastic:t=>at(t)?t:ct(t,.075,.3),easeInOutElastic(t){const e=.1125;return at(t)?t:t<.5?.5*lt(2*t,e,.45):.5+.5*ct(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-ht.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*ht.easeInBounce(2*t):.5*ht.easeOutBounce(2*t-1)+.5},dt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},ut="0123456789ABCDEF",ft=t=>ut[15&t],gt=t=>ut[(240&t)>>4]+ut[15&t],pt=t=>(240&t)>>4==(15&t);function mt(t){return t+.5|0}const bt=(t,e,i)=>Math.max(Math.min(t,i),e);function xt(t){return bt(mt(2.55*t),0,255)}function yt(t){return bt(mt(255*t),0,255)}function vt(t){return bt(mt(t/2.55)/100,0,1)}function _t(t){return bt(mt(100*t),0,100)}const wt=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/,Mt=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Ot(t,e,i){const n=e*Math.min(i,1-i),s=(e,s=(e+t/30)%12)=>i-n*Math.max(Math.min(s-3,9-s,1),-1);return[s(0),s(8),s(4)]}function kt(t,e,i){const n=(n,s=(n+t/60)%6)=>i-i*e*Math.max(Math.min(s,4-s,1),0);return[n(5),n(3),n(1)]}function St(t,e,i){const n=Ot(t,1,.5);let s;for(e+i>1&&(s=1/(e+i),e*=s,i*=s),s=0;s<3;s++)n[s]*=1-e-i,n[s]+=e;return n}function Dt(t){const e=t.r/255,i=t.g/255,n=t.b/255,s=Math.max(e,i,n),r=Math.min(e,i,n),o=(s+r)/2;let a,l,c;return s!==r&&(c=s-r,l=o>.5?c/(2-s-r):c/(s+r),a=s===e?(i-n)/c+(i=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=yt(t[3]))):(e=Rt(t,{r:0,g:0,b:0,a:1})).a=yt(e.a),e}function zt(t){return"r"===t.charAt(0)?function(t){const e=wt.exec(t);let i,n,s,r=255;if(e){if(e[7]!==i){const t=+e[7];r=255&(e[8]?xt(t):255*t)}return i=+e[1],n=+e[3],s=+e[5],i=255&(e[2]?xt(i):i),n=255&(e[4]?xt(n):n),s=255&(e[6]?xt(s):s),{r:i,g:n,b:s,a:r}}}(t):function(t){const e=Mt.exec(t);let i,n=255;if(!e)return;e[5]!==i&&(n=e[6]?xt(+e[5]):yt(+e[5]));const s=Tt(+e[2]),r=+e[3]/100,o=+e[4]/100;return i="hwb"===e[1]?function(t,e,i){return Pt(St,t,e,i)}(s,r,o):"hsv"===e[1]?function(t,e,i){return Pt(kt,t,e,i)}(s,r,o):Ct(s,r,o),{r:i[0],g:i[1],b:i[2],a:n}}(t)}class It{constructor(t){if(t instanceof It)return t;const e=typeof t;let i;var n,s,r;"object"===e?i=Ft(t):"string"===e&&(r=(n=t).length,"#"===n[0]&&(4===r||5===r?s={r:255&17*dt[n[1]],g:255&17*dt[n[2]],b:255&17*dt[n[3]],a:5===r?17*dt[n[4]]:255}:7!==r&&9!==r||(s={r:dt[n[1]]<<4|dt[n[2]],g:dt[n[3]]<<4|dt[n[4]],b:dt[n[5]]<<4|dt[n[6]],a:9===r?dt[n[7]]<<4|dt[n[8]]:255})),i=s||function(t){At||(At=function(){const t={},e=Object.keys(jt),i=Object.keys(Et);let n,s,r,o,a;for(n=0;n>16&255,r>>8&255,255&r]}return t}(),At.transparent=[0,0,0,0]);const e=At[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}(t)||zt(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Rt(this._rgb);return t&&(t.a=vt(t.a)),t}set rgb(t){this._rgb=Ft(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${vt(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):this._rgb;var t}hexString(){return this._valid?(t=this._rgb,e=function(t){return pt(t.r)&&pt(t.g)&&pt(t.b)&&pt(t.a)}(t)?ft:gt,t?"#"+e(t.r)+e(t.g)+e(t.b)+(t.a<255?e(t.a):""):t):this._rgb;var t,e}hslString(){return this._valid?function(t){if(!t)return;const e=Dt(t),i=e[0],n=_t(e[1]),s=_t(e[2]);return t.a<255?`hsla(${i}, ${n}%, ${s}%, ${vt(t.a)})`:`hsl(${i}, ${n}%, ${s}%)`}(this._rgb):this._rgb}mix(t,e){const i=this;if(t){const n=i.rgb,s=t.rgb;let r;const o=e===r?.5:e,a=2*o-1,l=n.a-s.a,c=((a*l==-1?a:(a+l)/(1+a*l))+1)/2;r=1-c,n.r=255&c*n.r+r*s.r+.5,n.g=255&c*n.g+r*s.g+.5,n.b=255&c*n.b+r*s.b+.5,n.a=o*n.a+(1-o)*s.a,i.rgb=n}return i}clone(){return new It(this.rgb)}alpha(t){return this._rgb.a=yt(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=mt(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Lt(this._rgb,2,t),this}darken(t){return Lt(this._rgb,2,-t),this}saturate(t){return Lt(this._rgb,1,t),this}desaturate(t){return Lt(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=Dt(t);i[0]=Tt(i[0]+e),i=Ct(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}function Nt(t){return new It(t)}const Vt=t=>t instanceof CanvasGradient||t instanceof CanvasPattern;function Wt(t){return Vt(t)?t:Nt(t)}function Bt(t){return Vt(t)?t:Nt(t).saturate(.5).darken(.1).hexString()}const Ht=Object.create(null),Ut=Object.create(null);function Yt(t,e){if(!e)return t;const i=e.split(".");for(let e=0,n=i.length;et.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>Bt(e.backgroundColor),this.hoverBorderColor=(t,e)=>Bt(e.borderColor),this.hoverColor=(t,e)=>Bt(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t)}set(t,e){return $t(this,t,e)}get(t){return Yt(this,t)}describe(t,e){return $t(Ut,t,e)}override(t,e){return $t(Ht,t,e)}route(t,e,i,n){const s=Yt(this,t),r=Yt(this,i),o="_"+e;Object.defineProperties(s,{[o]:{value:s[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[o],e=r[n];return b(t)?Object.assign({},e,t):v(t,e)},set(t){this[o]=t}}})}}({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function qt(t,e,i,n,s){let r=e[s];return r||(r=e[s]=t.measureText(s).width,i.push(s)),r>n&&(n=r),n}function Gt(t,e,i,n){let s=(n=n||{}).data=n.data||{},r=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(s=n.data={},r=n.garbageCollect=[],n.font=e),t.save(),t.font=e;let o=0;const a=i.length;let l,c,h,d,u;for(l=0;li.length){for(l=0;l0&&t.stroke()}}function Jt(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.xe.top-i&&t.y0&&""!==r.strokeColor;let l,c;for(t.save(),t.font=s.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),p(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,r),l=0;lv(t[i],t[e[i]]):e=>t[e]:()=>t;for(const t of s)i[t]=+r(t)||0;return i}function de(t){return he(t,{top:"y",right:"x",bottom:"y",left:"x"})}function ue(t){return he(t,["topLeft","topRight","bottomLeft","bottomRight"])}function fe(t){const e=de(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function ge(t,e){t=t||{},e=e||Xt.font;let i=v(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let n=v(t.style,e.style);n&&!(""+n).match(le)&&(console.warn('Invalid font style specified: "'+n+'"'),n="");const s={family:v(t.family,e.family),lineHeight:ce(v(t.lineHeight,e.lineHeight),i),size:i,style:n,weight:v(t.weight,e.weight),string:""};return s.string=function(t){return!t||p(t.size)||p(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(s),s}function pe(t,e,i,n){let s,r,o,a=!0;for(s=0,r=t.length;st[i]1;)n=r+s>>1,i(n)?r=n:s=n;return{lo:r,hi:s}}const xe=(t,e,i)=>be(t,i,n=>t[n][e]be(t,i,n=>t[n][e]>=i),ve=["push","pop","shift","splice","unshift"];function _e(t,e){const i=t._chartjs;if(!i)return;const n=i.listeners,s=n.indexOf(e);-1!==s&&n.splice(s,1),n.length>0||(ve.forEach(e=>{delete t[e]}),delete t._chartjs)}function we(t){const e=new Set;let i,n;for(i=0,n=t.length;it[0])){L(n)||(n=Le("_fallback",t));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:i,_fallback:n,_getTarget:s,override:s=>Me([s,...t],e,i,n)};return new Proxy(r,{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,n)=>Pe(i,n,()=>function(t,e,i,n){let s;for(const r of e)if(s=Le(Se(r,t),i),L(s))return De(t,s)?je(i,n,t,s):s}(n,e,t,i)),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>Re(t).includes(e),ownKeys:t=>Re(t),set(t,e,i){const n=t._storage||(t._storage=s());return t[e]=n[e]=i,delete t._keys,!0}})}function Oe(t,e,i,n){const s={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:ke(t,n),setContext:e=>Oe(t,e,i,n),override:s=>Oe(t.override(s),e,i,n)};return new Proxy(s,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>Pe(t,e,()=>function(t,e,i){const{_proxy:n,_context:s,_subProxy:r,_descriptors:o}=t;let a=n[e];return R(a)&&o.isScriptable(e)&&(a=function(t,e,i,n){const{_proxy:s,_context:r,_subProxy:o,_stack:a}=i;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);return a.add(t),e=e(r,o||n),a.delete(t),De(t,e)&&(e=je(s._scopes,s,t,e)),e}(e,a,t,i)),m(a)&&a.length&&(a=function(t,e,i,n){const{_proxy:s,_context:r,_subProxy:o,_descriptors:a}=i;if(L(r.index)&&n(t))e=e[r.index%e.length];else if(b(e[0])){const i=e,n=s._scopes.filter(t=>t!==i);e=[];for(const l of i){const i=je(n,s,t,l);e.push(Oe(i,r,o&&o[t],a))}}return e}(e,a,t,o.isIndexable)),De(e,a)&&(a=Oe(a,s,r&&r[e],o)),a}(t,e,i)),getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,i)=>Reflect.has(t,i),ownKeys:()=>Reflect.ownKeys(t),set:(e,i,n)=>(t[i]=n,delete e[i],!0)})}function ke(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:n=e.indexable,_allKeys:s=e.allKeys}=t;return{allKeys:s,scriptable:i,indexable:n,isScriptable:R(i)?i:()=>i,isIndexable:R(n)?n:()=>n}}const Se=(t,e)=>t?t+A(e):e,De=(t,e)=>b(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function Pe(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const n=i();return t[e]=n,n}function Ce(t,e,i){return R(t)?t(e,i):t}const Te=(t,e)=>!0===t?e:"string"==typeof t?j(e,t):void 0;function Ee(t,e,i,n,s){for(const r of e){const e=Te(i,r);if(e){t.add(e);const r=Ce(e._fallback,i,s);if(L(r)&&r!==i&&r!==n)return r}else if(!1===e&&L(n)&&i!==n)return null}return!1}function je(t,e,i,n){const s=e._rootScopes,r=Ce(e._fallback,i,n),o=[...t,...s],a=new Set;a.add(n);let l=Ae(a,o,i,r||i,n);return null!==l&&(!L(r)||r===i||(l=Ae(a,o,r,l,n),null!==l))&&Me(Array.from(a),[""],s,r,()=>function(t,e,i){const n=t._getTarget();e in n||(n[e]={});const s=n[e];return m(s)&&b(i)?i:s}(e,i,n))}function Ae(t,e,i,n,s){for(;i;)i=Ee(t,e,i,n,s);return i}function Le(t,e){for(const i of e){if(!i)continue;const e=i[t];if(L(e))return e}}function Re(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter(t=>!t.startsWith("_")))e.add(t);return Array.from(e)}(t._scopes)),e}const Fe=Number.EPSILON||1e-14,ze=(t,e)=>e"x"===t?"y":"x";function Ne(t,e,i,n){const s=t.skip?e:t,r=e,o=i.skip?e:i,a=et(r,s),l=et(o,r);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=n*c,u=n*h;return{previous:{x:r.x-d*(o.x-s.x),y:r.y-d*(o.y-s.y)},next:{x:r.x+u*(o.x-s.x),y:r.y+u*(o.y-s.y)}}}function Ve(t,e,i){return Math.max(Math.min(t,i),e)}function We(t,e,i,n,s){let r,o,a,l;if(e.spanGaps&&(t=t.filter(t=>!t.skip)),"monotone"===e.cubicInterpolationMode)!function(t,e="x"){const i=Ie(e),n=t.length,s=Array(n).fill(0),r=Array(n);let o,a,l,c=ze(t,0);for(o=0;owindow.getComputedStyle(t,null),$e=["top","right","bottom","left"];function Xe(t,e,i){const n={};i=i?"-"+i:"";for(let s=0;s<4;s++){const r=$e[s];n[r]=parseFloat(t[e+"-"+r+i])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function qe(t,e){const{canvas:i,currentDevicePixelRatio:n}=e,s=Ye(i),r="border-box"===s.boxSizing,o=Xe(s,"padding"),a=Xe(s,"border","width"),{x:l,y:c,box:h}=function(t,e){const i=t.native||t,n=i.touches,s=n&&n.length?n[0]:i,{offsetX:r,offsetY:o}=s;let a,l,c=!1;if(((t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot))(r,o,i.target))a=r,l=o;else{const t=e.getBoundingClientRect();a=s.clientX-t.left,l=s.clientY-t.top,c=!0}return{x:a,y:l,box:c}}(t,i),d=o.left+(h&&a.left),u=o.top+(h&&a.top);let{width:f,height:g}=e;return r&&(f-=o.width+a.width,g-=o.height+a.height),{x:Math.round((l-d)/f*i.width/n),y:Math.round((c-u)/g*i.height/n)}}const Ge=t=>Math.round(10*t)/10;function Qe(t,e,i){const n=e||1,s=Math.floor(t.height*n),r=Math.floor(t.width*n);t.height=s/n,t.width=r/n;const o=t.canvas;return o.style&&(i||!o.style.height&&!o.style.width)&&(o.style.height=t.height+"px",o.style.width=t.width+"px"),(t.currentDevicePixelRatio!==n||o.height!==s||o.width!==r)&&(t.currentDevicePixelRatio=n,o.height=s,o.width=r,t.ctx.setTransform(n,0,0,n,0,0),!0)}const Ke=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(t){}return t}();function Ze(t,e){const i=function(t,e){return Ye(t).getPropertyValue(e)}(t,e),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function Je(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function ti(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:"middle"===n?i<.5?t.y:e.y:"after"===n?i<1?t.y:e.y:i>0?e.y:t.y}}function ei(t,e,i,n){const s={x:t.cp2x,y:t.cp2y},r={x:e.cp1x,y:e.cp1y},o=Je(t,s,i),a=Je(s,r,i),l=Je(r,e,i),c=Je(o,a,i),h=Je(a,l,i);return Je(c,h,i)}const ii=new Map;function ni(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let n=ii.get(i);return n||(n=new Intl.NumberFormat(t,e),ii.set(i,n)),n}(e,i).format(t)}function si(t,e,i){return t?function(t,e){return{x:i=>t+t+e-i,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,i):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function ri(t){return"angle"===t?{between:st,compare:it,normalize:nt}:{between:ot,compare:(t,e)=>t-e,normalize:t=>t}}function oi({start:t,end:e,count:i,loop:n,style:s}){return{start:t%i,end:e%i,loop:n&&(e-t+1)%i==0,style:s}}function ai(t,e,i){if(!i)return[t];const{property:n,start:s,end:r}=i,o=e.length,{compare:a,between:l,normalize:c}=ri(n),{start:h,end:d,loop:u,style:f}=function(t,e,i){const{property:n,start:s,end:r}=i,{between:o,normalize:a}=ri(n),l=e.length;let c,h,{start:d,end:u,loop:f}=t;if(f){for(d+=l,u+=l,c=0,h=l;cn({chart:t,initial:e.initial,numSteps:r,currentStep:Math.min(i-e.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=h.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,n)=>{if(!i.running||!i.items.length)return;const s=i.items;let r,o=s.length-1,a=!1;for(;o>=0;--o)r=s[o],r._active?(r._total>i.duration&&(i.duration=r._total),r.tick(t),a=!0):(s[o]=s[s.length-1],s.pop());a&&(n.draw(),this._notify(n,i,t,"progress")),s.length||(i.running=!1,this._notify(n,i,t,"complete"),i.initial=!1),e+=s.length}),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((t,e)=>Math.max(t,e._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let n=i.length-1;for(;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}};const ui={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const n=Wt(t||"transparent"),s=n.valid&&Wt(e||"transparent");return s&&s.valid?s.mix(n,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class fi{constructor(t,e,i,n){const s=e[i];n=pe([t.to,n,s,t.from]);const r=pe([t.from,s,n]);this._active=!0,this._fn=t.fn||ui[t.type||typeof r],this._easing=ht[t.easing]||ht.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=r,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const n=this._target[this._prop],s=i-this._start,r=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=s,this._loop=!!t.loop,this._to=pe([t.to,e,n,t.from]),this._from=pe([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,n=this._prop,s=this._from,r=this._loop,o=this._to;let a;if(this._active=s!==o&&(r||e1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[n]=this._fn(s,o,a))}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let t=0;t"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),Xt.set("animations",{colors:{type:"color",properties:["color","borderColor","backgroundColor"]},numbers:{type:"number",properties:["x","y","borderWidth","radius","tension"]}}),Xt.describe("animations",{_fallback:"animation"}),Xt.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}});class pi{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!b(t))return;const e=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const n=t[i];if(!b(n))return;const s={};for(const t of gi)s[t]=n[t];(m(n.properties)&&n.properties||[i]).forEach(t=>{t!==i&&e.has(t)||e.set(t,s)})})}_animateOptions(t,e){const i=e.options,n=function(t,e){if(!e)return;let i=t.options;if(i)return i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i;t.options=e}(t,i);if(!n)return[];const s=this._createAnimations(n,i);return i.$shared&&function(t,e){const i=[],n=Object.keys(e);for(let e=0;e{t.options=i},()=>{}),s}_createAnimations(t,e){const i=this._properties,n=[],s=t.$animations||(t.$animations={}),r=Object.keys(e),o=Date.now();let a;for(a=r.length-1;a>=0;--a){const l=r[a];if("$"===l.charAt(0))continue;if("options"===l){n.push(...this._animateOptions(t,e));continue}const c=e[l];let h=s[l];const d=i.get(l);if(h){if(d&&h.active()){h.update(d,c,o);continue}h.cancel()}d&&d.duration?(s[l]=h=new fi(d,t,l,c),n.push(h)):t[l]=c}return n}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(di.add(this._chart,i),!0):void 0}}function mi(t,e){const i=t&&t.options||{},n=i.reverse,s=void 0===i.min?e:0,r=void 0===i.max?e:0;return{start:n?r:s,end:n?s:r}}function bi(t,e){const i=[],n=t._getSortedDatasetMetas(e);let s,r;for(s=0,r=n.length;s0||!i&&e<0)return s.index}return null}function wi(t,e){const{chart:i,_cachedMeta:n}=t,s=i._stacks||(i._stacks={}),{iScale:r,vScale:o,index:a}=n,l=r.axis,c=o.axis,h=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(r,o,n),d=e.length;let u;for(let t=0;ti[t].axis===e).shift()}function Oi(t,e){const i=t.controller.index,n=t.vScale&&t.vScale.axis;if(n){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[n]||void 0===e[n][i])return;delete e[n][i]}}}const ki=t=>"reset"===t||"none"===t,Si=(t,e)=>e?t:Object.assign({},t);class Di{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=yi(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&Oi(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=(t,e,i,n)=>"x"===t?e:"r"===t?n:i,s=e.xAxisID=v(i.xAxisID,Mi(t,"x")),r=e.yAxisID=v(i.yAxisID,Mi(t,"y")),o=e.rAxisID=v(i.rAxisID,Mi(t,"r")),a=e.indexAxis,l=e.iAxisID=n(a,s,r,o),c=e.vAxisID=n(a,r,s,o);e.xScale=this.getScaleForId(s),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(o),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&_e(this._data,this),t._stacked&&Oi(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(b(e))this._data=function(t){const e=Object.keys(t),i=new Array(e.length);let n,s,r;for(n=0,s=e.length;n{const e="_onData"+A(t),i=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...t){const s=i.apply(this,t);return n._chartjs.listeners.forEach(i=>{"function"==typeof i[e]&&i[e](...t)}),s}})}))),this._syncList=[],this._data=e}var n}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let n=!1;this._dataCheck();const s=e._stacked;e._stacked=yi(e.vScale,e),e.stack!==i.stack&&(n=!0,Oi(e),e.stack=i.stack),this._resyncElements(t),(n||s!==e._stacked)&&wi(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:n}=this,{iScale:s,_stacked:r}=i,o=s.axis;let a,l,c,h=0===t&&e===n.length||i._sorted,d=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=n,i._sorted=!0,c=n;else{c=m(n[t])?this.parseArrayData(i,n,t,e):b(n[t])?this.parseObjectData(i,n,t,e):this.parsePrimitiveData(i,n,t,e);const s=()=>null===l[o]||d&&l[o]t&&!e.hidden&&e._stacked&&{keys:bi(i,!0),values:null})(e,i,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:h}=function(t){const{min:e,max:i,minDefined:n,maxDefined:s}=t.getUserBounds();return{min:n?e:Number.NEGATIVE_INFINITY,max:s?i:Number.POSITIVE_INFINITY}}(o);let d,u;function f(){u=n[d];const e=u[o.axis];return!x(u[t.axis])||c>e||h=0;--d)if(!f()){this.updateRangeFromParsed(l,t,u,a);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let n,s,r;for(n=0,s=e.length;n=0&&tthis.getContext(i,n),h);return f.$shared&&(f.$shared=a,s[r]=Object.freeze(Si(f,a))),f}_resolveAnimations(t,e,i){const n=this.chart,s=this._cachedDataOpts,r="animation-"+e,o=s[r];if(o)return o;let a;if(!1!==n.options.animation){const n=this.chart.config,s=n.datasetAnimationScopeKeys(this._type,e),r=n.getOptionScopes(this.getDataset(),s);a=n.createResolver(r,this.getContext(t,i,e))}const l=new pi(n,a&&a.animations);return a&&a._cacheable&&(s[r]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||ki(t)||this.chart._animationsDisabled}updateElement(t,e,i,n){ki(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!ki(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;const s=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(s)||s})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];const n=i.length,s=e.length,r=Math.min(s,n);r&&this.parse(0,r),s>n?this._insertElements(n,s-n,t):s{for(t.length+=e,o=t.length-1;o>=r;o--)t[o]=t[o-e]};for(a(s),o=t;ot-e))}return t._cache.$bar}(e,t.type);let n,s,r,o,a=e._length;const l=()=>{32767!==r&&-32768!==r&&(L(o)&&(a=Math.min(a,Math.abs(r-o)||a)),o=r)};for(n=0,s=i.length;nMath.abs(a)&&(l=a,c=o),e[i.axis]=c,e._custom={barStart:l,barEnd:c,start:s,end:r,min:o,max:a}}(t,e,i,n):e[i.axis]=i.parse(t,n),e}function Ti(t,e,i,n){const s=t.iScale,r=t.vScale,o=s.getLabels(),a=s===r,l=[];let c,h,d,u;for(c=i,h=i+n;ct.x,i="left",n="right"):(e=t.base=i?1:-1)}(h,e,r)*s,d===r&&(m-=h/2),c=m+h),m===e.getPixelForValue(r)){const t=$(h)*e.getLineWidthForValue(r)/2;m+=t,h-=t}return{size:h,base:m,head:c,center:c+h/2}}_calculateBarIndexPixels(t,e){const i=e.scale,n=this.options,s=n.skipNull,r=v(n.maxBarThickness,1/0);let o,a;if(e.grouped){const i=s?this._getStackCount(t):e.stackCount,l="flex"===n.barThickness?function(t,e,i,n){const s=e.pixels,r=s[t];let o=t>0?s[t-1]:null,a=t=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,{xScale:i,yScale:n}=e,s=this.getParsed(t),r=i.getLabelForValue(s.x),o=n.getLabelForValue(s.y),a=s._custom;return{label:e.label,value:"("+r+", "+o+(a?", "+a:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,n){const s="reset"===n,{iScale:r,vScale:o}=this._cachedMeta,a=this.resolveDataElementOptions(e,n),l=this.getSharedOptions(a),c=this.includeOptions(n,l),h=r.axis,d=o.axis;for(let a=e;a""}}}};class Ii extends Di{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,n=this._cachedMeta;if(!1===this._parsing)n._parsed=i;else{let s,r,o=t=>+i[t];if(b(i[t])){const{key:t="value"}=this._parsing;o=e=>+j(i[e],t)}for(s=t,r=t+e;sst(t,a,l,!0)?1:Math.max(e,e*i,n,n*i),g=(t,e,n)=>st(t,a,l,!0)?-1:Math.min(e,e*i,n,n*i),p=f(0,c,d),m=f(B,h,u),b=g(z,c,d),x=g(z+B,h,u);n=(p-b)/2,s=(m-x)/2,r=-(p+b)/2,o=-(m+x)/2}return{ratioX:n,ratioY:s,offsetX:r,offsetY:o}}(u,d,a),b=(i.width-r)/f,x=(i.height-r)/g,y=Math.max(Math.min(b,x)/2,0),v=_(this.options.radius,y),w=(v-Math.max(v*a,0))/this._getVisibleDatasetWeightTotal();this.offsetX=p*v,this.offsetY=m*v,n.total=this.calculateTotal(),this.outerRadius=v-w*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-w*h,0),this.updateElements(s,0,s.length,t)}_circumference(t,e){const i=this.options,n=this._cachedMeta,s=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===n._parsed[t]||n.data[t].hidden?0:this.calculateCircumference(n._parsed[t]*s/I)}updateElements(t,e,i,n){const s="reset"===n,r=this.chart,o=r.chartArea,a=r.options.animation,l=(o.left+o.right)/2,c=(o.top+o.bottom)/2,h=s&&a.animateScale,d=h?0:this.innerRadius,u=h?0:this.outerRadius,f=this.resolveDataElementOptions(e,n),g=this.getSharedOptions(f),p=this.includeOptions(n,g);let m,b=this._getRotation();for(m=0;m0&&!isNaN(t)?I*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],s=ni(e._parsed[t],i.options.locale);return{label:n[t]||"",value:s}}getMaxBorderWidth(t){let e=0;const i=this.chart;let n,s,r,o,a;if(!t)for(n=0,s=i.data.datasets.length;n"spacing"!==t,_indexable:t=>"spacing"!==t},Ii.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map((e,n)=>{const s=t.getDatasetMeta(0).controller.getStyle(n);return{text:e,fillStyle:s.backgroundColor,strokeStyle:s.borderColor,lineWidth:s.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label(t){let e=t.label;const i=": "+t.formattedValue;return m(e)?(e=e.slice(),e[0]+=i):e+=i,e}}}}};class Ni extends Di{initialize(){this.enableOptionSharing=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:n=[],_dataset:s}=e,r=this.chart._animationsDisabled;let{start:o,count:a}=function(t,e,i){const n=e.length;let s=0,r=n;if(t._sorted){const{iScale:o,_parsed:a}=t,l=o.axis,{min:c,max:h,minDefined:d,maxDefined:u}=o.getUserBounds();d&&(s=rt(Math.min(xe(a,o.axis,c).lo,i?n:xe(e,l,o.getPixelForValue(c)).lo),0,n-1)),r=u?rt(Math.max(xe(a,o.axis,h).hi+1,i?0:xe(e,l,o.getPixelForValue(h)).hi+1),s,n)-s:n-s}return{start:s,count:r}}(e,n,r);this._drawStart=o,this._drawCount=a,function(t){const{xScale:e,yScale:i,_scaleRanges:n}=t,s={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!n)return t._scaleRanges=s,!0;const r=n.xmin!==e.min||n.xmax!==e.max||n.ymin!==i.min||n.ymax!==i.max;return Object.assign(n,s),r}(e)&&(o=0,a=n.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!s._decimated,i.points=n;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!r,options:l},t),this.updateElements(n,o,a,t)}updateElements(t,e,i,n){const s="reset"===n,{iScale:r,vScale:o,_stacked:a,_dataset:l}=this._cachedMeta,c=this.resolveDataElementOptions(e,n),h=this.getSharedOptions(c),d=this.includeOptions(n,h),u=r.axis,f=o.axis,{spanGaps:g,segment:m}=this.options,b=q(g)?g:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||s||"none"===n;let y=e>0&&this.getParsed(e-1);for(let c=e;c0&&i[u]-y[u]>b,m&&(g.parsed=i,g.raw=l.data[c]),d&&(g.options=h||this.resolveDataElementOptions(c,e.active?"active":n)),x||this.updateElement(e,c,g,n),y=i}this.updateSharedOptions(h,n,c)}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return i;const s=n[0].size(this.resolveDataElementOptions(0)),r=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,s,r)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}Ni.id="line",Ni.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},Ni.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class Vi extends Di{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],s=ni(e._parsed[t].r,i.options.locale);return{label:n[t]||"",value:s}}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),s=Math.max(n/2,0),r=(s-Math.max(i.cutoutPercentage?s/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=s-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(t,e,i,n){const s="reset"===n,r=this.chart,o=this.getDataset(),a=r.options.animation,l=this._cachedMeta.rScale,c=l.xCenter,h=l.yCenter,d=l.getIndexAngle(0)-.5*z;let u,f=d;const g=360/this.countVisibleElements();for(u=0;u{!isNaN(t.data[n])&&this.chart.getDataVisibility(n)&&i++}),i}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?K(this.resolveDataElementOptions(t,e).angle||i):0}}Vi.id="polarArea",Vi.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},Vi.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map((e,n)=>{const s=t.getDatasetMeta(0).controller.getStyle(n);return{text:e,fillStyle:s.backgroundColor,strokeStyle:s.borderColor,lineWidth:s.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label:t=>t.chart.data.labels[t.dataIndex]+": "+t.formattedValue}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class Wi extends Ii{}Wi.id="pie",Wi.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Bi extends Di{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}update(t){const e=this._cachedMeta,i=e.dataset,n=e.data||[],s=e.iScale.getLabels();if(i.points=n,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const r={_loop:!0,_fullLoop:s.length===n.length,options:e};this.updateElement(i,void 0,r,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,i,n){const s=this.getDataset(),r=this._cachedMeta.rScale,o="reset"===n;for(let a=e;a"",label:t=>"("+t.label+", "+t.formattedValue+")"}}},scales:{x:{type:"linear"},y:{type:"linear"}}};class Yi{constructor(t){this.options=t||{}}formats(){return Ui()}parse(t,e){return Ui()}format(t,e){return Ui()}add(t,e,i){return Ui()}diff(t,e,i){return Ui()}startOf(t,e,i){return Ui()}endOf(t,e){return Ui()}}Yi.override=function(t){Object.assign(Yi.prototype,t)};var $i={_date:Yi};function Xi(t,e){return"native"in t?{x:t.x,y:t.y}:qe(t,e)}function qi(t,e,i,n){const{controller:s,data:r,_sorted:o}=t,a=s._cachedMeta.iScale;if(a&&e===a.axis&&"r"!==e&&o&&r.length){const t=a._reversePixels?ye:xe;if(!n)return t(r,e,i);if(s._sharedOptions){const n=r[0],s="function"==typeof n.getRange&&n.getRange(e);if(s){const n=t(r,e,i-s),o=t(r,e,i+s);return{lo:n.lo,hi:o.hi}}}}return{lo:0,hi:r.length-1}}function Gi(t,e,i,n,s){const r=t.getSortedVisibleDatasetMetas(),o=i[e];for(let t=0,i=r.length;t{t[a](s[o],n)&&r.push({element:t,datasetIndex:e,index:i}),t.inRange(s.x,s.y,n)&&(l=!0)}),i.intersect&&!l?[]:r}var Ji={modes:{index(t,e,i,n){const s=Xi(e,t),r=i.axis||"x",o=i.intersect?Qi(t,s,r,n):Ki(t,s,r,!1,n),a=[];return o.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{const e=o[0].index,i=t.data[e];i&&!i.skip&&a.push({element:i,datasetIndex:t.index,index:e})}),a):[]},dataset(t,e,i,n){const s=Xi(e,t),r=i.axis||"xy";let o=i.intersect?Qi(t,s,r,n):Ki(t,s,r,!1,n);if(o.length>0){const e=o[0].datasetIndex,i=t.getDatasetMeta(e).data;o=[];for(let t=0;tQi(t,Xi(e,t),i.axis||"xy",n),nearest:(t,e,i,n)=>Ki(t,Xi(e,t),i.axis||"xy",i.intersect,n),x:(t,e,i,n)=>Zi(t,e,{axis:"x",intersect:i.intersect},n),y:(t,e,i,n)=>Zi(t,e,{axis:"y",intersect:i.intersect},n)}};const tn=["left","top","right","bottom"];function en(t,e){return t.filter(t=>t.pos===e)}function nn(t,e){return t.filter(t=>-1===tn.indexOf(t.pos)&&t.box.axis===e)}function sn(t,e){return t.sort((t,i)=>{const n=e?i:t,s=e?t:i;return n.weight===s.weight?n.index-s.index:n.weight-s.weight})}function rn(t,e,i,n){return Math.max(t[i],e[i])+Math.max(t[n],e[n])}function on(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function an(t,e,i,n){const{pos:s,box:r}=i,o=t.maxPadding;if(!b(s)){i.size&&(t[s]-=i.size);const e=n[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?r.height:r.width),i.size=e.size/e.count,t[s]+=i.size}r.getPadding&&on(o,r.getPadding());const a=Math.max(0,e.outerWidth-rn(o,t,"left","right")),l=Math.max(0,e.outerHeight-rn(o,t,"top","bottom")),c=a!==t.w,h=l!==t.h;return t.w=a,t.h=l,i.horizontal?{same:c,other:h}:{same:h,other:c}}function ln(t,e){const i=e.maxPadding;return function(t){const n={left:0,top:0,right:0,bottom:0};return t.forEach(t=>{n[t]=Math.max(e[t],i[t])}),n}(t?["left","right"]:["top","bottom"])}function cn(t,e,i,n){const s=[];let r,o,a,l,c,h;for(r=0,o=t.length,c=0;rt.box.fullSize),!0),n=sn(en(e,"left"),!0),s=sn(en(e,"right")),r=sn(en(e,"top"),!0),o=sn(en(e,"bottom")),a=nn(e,"x"),l=nn(e,"y");return{fullSize:i,leftAndTop:n.concat(r),rightAndBottom:s.concat(l).concat(o).concat(a),chartArea:en(e,"chartArea"),vertical:n.concat(s).concat(l),horizontal:r.concat(o).concat(a)}}(t.boxes),l=a.vertical,c=a.horizontal;M(t.boxes,t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()});const h=l.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1,d=Object.freeze({outerWidth:e,outerHeight:i,padding:s,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/h,hBoxMaxHeight:o/2}),u=Object.assign({},s);on(u,fe(n));const f=Object.assign({maxPadding:u,w:r,h:o,x:s.left,y:s.top},s),g=function(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:n,stackWeight:s}=i;if(!t||!tn.includes(n))continue;const r=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=s}return e}(t),{vBoxMaxWidth:n,hBoxMaxHeight:s}=e;let r,o,a;for(r=0,o=t.length;r{const i=e.box;Object.assign(i,t.chartArea),i.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class fn{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}isAttached(t){return!0}updateConfig(t){}}class gn extends fn{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const pn={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},mn=t=>null===t||""===t,bn=!!Ke&&{passive:!0};function xn(t,e,i){t.canvas.removeEventListener(e,i,bn)}function yn(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function vn(t,e,i){const n=t.canvas,s=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||yn(i.addedNodes,n),e=e&&!yn(i.removedNodes,n);e&&i()});return s.observe(document,{childList:!0,subtree:!0}),s}function wn(t,e,i){const n=t.canvas,s=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||yn(i.removedNodes,n),e=e&&!yn(i.addedNodes,n);e&&i()});return s.observe(document,{childList:!0,subtree:!0}),s}const Mn=new Map;let On=0;function kn(){const t=window.devicePixelRatio;t!==On&&(On=t,Mn.forEach((e,i)=>{i.currentDevicePixelRatio!==t&&e()}))}function Sn(t,e,i){const n=t.canvas,s=n&&He(n);if(!s)return;const r=d((t,e)=>{const n=s.clientWidth;i(t,e),n{const e=t[0],i=e.contentRect.width,n=e.contentRect.height;0===i&&0===n||r(i,n)});return o.observe(s),function(t,e){Mn.size||window.addEventListener("resize",kn),Mn.set(t,e)}(t,r),o}function Dn(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){Mn.delete(t),Mn.size||window.removeEventListener("resize",kn)}(t)}function Pn(t,e,i){const n=t.canvas,s=d(e=>{null!==t.ctx&&i(function(t,e){const i=pn[t.type]||t.type,{x:n,y:s}=qe(t,e);return{type:i,chart:e,native:t,x:void 0!==n?n:null,y:void 0!==s?s:null}}(e,t))},t,t=>{const e=t[0];return[e,e.offsetX,e.offsetY]});return function(t,e,i){t.addEventListener(e,i,bn)}(n,e,s),s}class Cn extends fn{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,n=t.getAttribute("height"),s=t.getAttribute("width");if(t.$chartjs={initial:{height:n,width:s,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",mn(s)){const e=Ze(t,"width");void 0!==e&&(t.width=e)}if(mn(n))if(""===t.style.height)t.height=t.width/(e||2);else{const e=Ze(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e.$chartjs)return!1;const i=e.$chartjs.initial;["height","width"].forEach(t=>{const n=i[t];p(n)?e.removeAttribute(t):e.setAttribute(t,n)});const n=i.style||{};return Object.keys(n).forEach(t=>{e.style[t]=n[t]}),e.width=e.width,delete e.$chartjs,!0}addEventListener(t,e,i){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),s={attach:vn,detach:wn,resize:Sn}[e]||Pn;n[e]=s(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),n=i[e];n&&(({attach:Dn,detach:Dn,resize:Dn}[e]||xn)(t,e,n),i[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return function(t,e,i,n){const s=Ye(t),r=Xe(s,"margin"),o=Ue(s.maxWidth,t,"clientWidth")||V,a=Ue(s.maxHeight,t,"clientHeight")||V,l=function(t,e,i){let n,s;if(void 0===e||void 0===i){const r=He(t);if(r){const t=r.getBoundingClientRect(),o=Ye(r),a=Xe(o,"border","width"),l=Xe(o,"padding");e=t.width-l.width-a.width,i=t.height-l.height-a.height,n=Ue(o.maxWidth,r,"clientWidth"),s=Ue(o.maxHeight,r,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:n||V,maxHeight:s||V}}(t,e,i);let{width:c,height:h}=l;if("content-box"===s.boxSizing){const t=Xe(s,"border","width"),e=Xe(s,"padding");c-=e.width+t.width,h-=e.height+t.height}return c=Math.max(0,c-r.width),h=Math.max(0,n?Math.floor(c/n):h-r.height),c=Ge(Math.min(c,o,l.maxWidth)),h=Ge(Math.min(h,a,l.maxHeight)),c&&!h&&(h=Ge(c/2)),{width:c,height:h}}(t,e,i,n)}isAttached(t){const e=He(t);return!(!e||!e.isConnected)}}class Tn{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return q(this.x)&&q(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const n={};return t.forEach(t=>{n[t]=i[t]&&i[t].active()?i[t]._to:this[t]}),n}}Tn.defaults={},Tn.defaultRoutes=void 0;const En={values:t=>m(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";const n=this.chart.options.locale;let s,r=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(s="scientific"),r=function(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t)),i}(t,i)}const o=Y(Math.abs(r)),a=Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),ni(t,n,l)},logarithmic(t,e,i){if(0===t)return"0";const n=t/Math.pow(10,Math.floor(Y(t)));return 1===n||2===n||5===n?En.numeric.call(this,t,e,i):""}};var jn={formatters:En};function An(t,e,i,n,s){const r=v(n,0),o=Math.min(v(s,t.length),t.length);let a,l,c,h=0;for(i=Math.ceil(i),s&&(a=s-n,i=a/Math.floor(a/i)),c=r;c<0;)h++,c=Math.round(r+h*i);for(l=Math.max(r,0);le.lineWidth,tickColor:(t,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:jn.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),Xt.route("scale.ticks","color","","color"),Xt.route("scale.grid","color","","borderColor"),Xt.route("scale.grid","borderColor","","borderColor"),Xt.route("scale.title","color","","color"),Xt.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t}),Xt.describe("scales",{_fallback:"scale"}),Xt.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t});const Ln=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i;function Rn(t,e){const i=[],n=t.length/e,s=t.length;let r=0;for(;ro+1e-6)))return l}function zn(t){return t.drawTicks?t.tickLength:0}function In(t,e){if(!t.display)return 0;const i=ge(t.font,e),n=fe(t.padding);return(m(t.text)?t.text.length:1)*i.lineHeight+n.height}function Nn(t,e,i){let n=(t=>"start"===t?"left":"end"===t?"right":"center")(t);return(i&&"right"!==e||!i&&"right"===e)&&(n=(t=>"left"===t?"right":"right"===t?"left":t)(n)),n}class Vn extends Tn{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:n}=this;return t=y(t,Number.POSITIVE_INFINITY),e=y(e,Number.NEGATIVE_INFINITY),i=y(i,Number.POSITIVE_INFINITY),n=y(n,Number.NEGATIVE_INFINITY),{min:y(t,i),max:y(e,n),minDefined:x(t),maxDefined:x(e)}}getMinMax(t){let e,{min:i,max:n,minDefined:s,maxDefined:r}=this.getUserBounds();if(s&&r)return{min:i,max:n};const o=this.getMatchingVisibleMetas();for(let a=0,l=o.length;an?n:i,n=s&&i>n?i:n,{min:y(i,y(n,i)),max:y(n,y(i,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){w(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:n,grace:s,ticks:r}=this.options,o=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(t,e,i){const{min:n,max:s}=t,r=_(e,(s-n)/2),o=(t,e)=>i&&0===t?0:t+e;return{min:o(n,-Math.abs(r)),max:o(s,r)}}(this,s,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=on)return function(t,e,i,n){let s,r=0,o=i[0];for(n=Math.ceil(n),s=0;st-e).pop(),e}(n);for(let t=0,e=r.length-1;ts)return e}return Math.max(s,1)}(s,e,n);if(r>0){let t,i;const n=r>1?Math.round((a-o)/(r-1)):null;for(An(e,l,c,p(n)?0:o-n,o),t=0,i=r-1;t=s||i<=1||!this.isHorizontal())return void(this.labelRotation=n);const c=this._getLabelSizes(),h=c.widest.width,d=c.highest.height,u=rt(this.chart.width-h,0,this.maxWidth);r=t.offset?this.maxWidth/i:u/(i-1),h+6>r&&(r=u/(i-(t.offset?.5:1)),o=this.maxHeight-zn(t.grid)-e.padding-In(t.title,this.chart.options.font),a=Math.sqrt(h*h+d*d),l=Z(Math.min(Math.asin(rt((c.highest.height+6)/r,-1,1)),Math.asin(rt(o/a,-1,1))-Math.asin(rt(d/a,-1,1)))),l=Math.max(n,Math.min(s,l))),this.labelRotation=l}afterCalculateLabelRotation(){w(this.options.afterCalculateLabelRotation,[this])}beforeFit(){w(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:n,grid:s}}=this,r=this._isVisible(),o=this.isHorizontal();if(r){const r=In(n,e.options.font);if(o?(t.width=this.maxWidth,t.height=zn(s)+r):(t.height=this.maxHeight,t.width=zn(s)+r),i.display&&this.ticks.length){const{first:e,last:n,widest:s,highest:r}=this._getLabelSizes(),a=2*i.padding,l=K(this.labelRotation),c=Math.cos(l),h=Math.sin(l);if(o){const e=i.mirror?0:h*s.width+c*r.height;t.height=Math.min(this.maxHeight,t.height+e+a)}else{const e=i.mirror?0:c*s.width+h*r.height;t.width=Math.min(this.maxWidth,t.width+e+a)}this._calculatePadding(e,n,h,c)}}this._handleMargins(),o?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,n){const{ticks:{align:s,padding:r},position:o}=this.options,a=0!==this.labelRotation,l="top"!==o&&"x"===this.axis;if(this.isHorizontal()){const o=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,d=0;a?l?(h=n*t.width,d=i*e.height):(h=i*t.height,d=n*e.width):"start"===s?d=e.width:"end"===s?h=t.width:(h=t.width/2,d=e.width/2),this.paddingLeft=Math.max((h-o+r)*this.width/(this.width-o),0),this.paddingRight=Math.max((d-c+r)*this.width/(this.width-c),0)}else{let i=e.height/2,n=t.height/2;"start"===s?(i=0,n=t.height):"end"===s&&(i=e.height,n=0),this.paddingTop=i+r,this.paddingBottom=n+r}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){w(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e{const i=t.gc,n=i.length/2;let s;if(n>e){for(s=0;s({width:s[t]||0,height:r[t]||0});return{first:O(0),last:O(e-1),widest:O(_),highest:O(w),widths:s,heights:r}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return rt(this._alignToPixels?Qt(this.chart,e,0):e,-32768,32767)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&to*n?o/i:a/n:a*n0}_computeGridLineItems(t){const e=this.axis,i=this.chart,n=this.options,{grid:s,position:r}=n,o=s.offset,a=this.isHorizontal(),l=this.ticks.length+(o?1:0),c=zn(s),h=[],d=s.setContext(this.getContext()),u=d.drawBorder?d.borderWidth:0,f=u/2,g=function(t){return Qt(i,t,u)};let p,m,x,y,_,w,M,O,k,S,D,P;if("top"===r)p=g(this.bottom),w=this.bottom-c,O=p-f,S=g(t.top)+f,P=t.bottom;else if("bottom"===r)p=g(this.top),S=t.top,P=g(t.bottom)-f,w=p+f,O=this.top+c;else if("left"===r)p=g(this.right),_=this.right-c,M=p-f,k=g(t.left)+f,D=t.right;else if("right"===r)p=g(this.left),k=t.left,D=g(t.right)-f,_=p+f,M=this.left+c;else if("x"===e){if("center"===r)p=g((t.top+t.bottom)/2+.5);else if(b(r)){const t=Object.keys(r)[0],e=r[t];p=g(this.chart.scales[t].getPixelForValue(e))}S=t.top,P=t.bottom,w=p+f,O=w+c}else if("y"===e){if("center"===r)p=g((t.left+t.right)/2);else if(b(r)){const t=Object.keys(r)[0],e=r[t];p=g(this.chart.scales[t].getPixelForValue(e))}_=p-f,M=_-c,k=t.left,D=t.right}const C=v(n.ticks.maxTicksLimit,l),T=Math.max(1,Math.ceil(l/C));for(m=0;me.value===t);return i>=0?e.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,r;const o=(t,e,n)=>{n.width&&n.color&&(i.save(),i.lineWidth=n.width,i.strokeStyle=n.color,i.setLineDash(n.borderDash||[]),i.lineDashOffset=n.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(s=0,r=n.length;s{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:i+1,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",n=[];let s,r;for(s=0,r=e.length;s{const n=i.split("."),s=n.pop(),r=[t].concat(n).join("."),o=e[i].split("."),a=o.pop(),l=o.join(".");Xt.route(r,s,l,a)})}(e,t.defaultRoutes),t.descriptors&&Xt.describe(e,t.descriptors)}(t,r,i),this.override&&Xt.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,n=this.scope;i in e&&delete e[i],n&&i in Xt[n]&&(delete Xt[n][i],this.override&&delete Ht[i])}}var Bn=new class{constructor(){this.controllers=new Wn(Di,"datasets",!0),this.elements=new Wn(Tn,"elements"),this.plugins=new Wn(Object,"plugins"),this.scales=new Wn(Vn,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(e=>{const n=i||this._getRegistryForType(e);i||n.isForType(e)||n===this.plugins&&e.id?this._exec(t,n,e):M(e,e=>{const n=i||this._getRegistryForType(e);this._exec(t,n,e)})})}_exec(t,e,i){const n=A(t);w(i["before"+n],[],i),e[t](i),w(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;et.filter(t=>!e.some(e=>t.plugin.id===e.plugin.id));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}}function Un(t,e){return e||!1!==t?!0===t?{}:t:null}function Yn(t,e,i,n){const s=t.pluginScopeKeys(e),r=t.getOptionScopes(i,s);return t.createResolver(r,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function $n(t,e){const i=Xt.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function Xn(t,e){return"x"===t||"y"===t?t:e.axis||("top"===(i=e.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0)||t.charAt(0).toLowerCase();var i}function qn(t){const e=t.options||(t.options={});e.plugins=v(e.plugins,{}),e.scales=function(t,e){const i=Ht[t.type]||{scales:{}},n=e.scales||{},s=$n(t.type,e),r=Object.create(null),o=Object.create(null);return Object.keys(n).forEach(t=>{const e=n[t];if(!b(e))return console.error("Invalid scale configuration for scale: "+t);if(e._proxy)return console.warn("Ignoring resolver passed as options for scale: "+t);const a=Xn(t,e),l=function(t,e){return t===e?"_index_":"_value_"}(a,s),c=i.scales||{};r[a]=r[a]||t,o[t]=C(Object.create(null),[{axis:a},e,c[a],c[l]])}),t.data.datasets.forEach(i=>{const s=i.type||t.type,a=i.indexAxis||$n(s,e),l=(Ht[s]||{}).scales||{};Object.keys(l).forEach(t=>{const e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,a),s=i[e+"AxisID"]||r[e]||e;o[s]=o[s]||Object.create(null),C(o[s],[{axis:e},n[s],l[t]])})}),Object.keys(o).forEach(t=>{const e=o[t];C(e,[Xt.scales[e.type],Xt.scale])}),o}(t,e)}function Gn(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const Qn=new Map,Kn=new Set;function Zn(t,e){let i=Qn.get(t);return i||(i=e(),Qn.set(t,i),Kn.add(i)),i}const Jn=(t,e,i)=>{const n=j(e,i);void 0!==n&&t.add(n)};class ts{constructor(t){this._config=function(t){return(t=t||{}).data=Gn(t.data),qn(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Gn(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),qn(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Zn(t,()=>[["datasets."+t,""]])}datasetAnimationScopeKeys(t,e){return Zn(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,"transitions."+e],["datasets."+t,""]])}datasetElementScopeKeys(t,e){return Zn(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,"datasets."+t,"elements."+e,""]])}pluginScopeKeys(t){const e=t.id;return Zn(`${this.type}-plugin-${e}`,()=>[["plugins."+e,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let n=i.get(t);return n&&!e||(n=new Map,i.set(t,n)),n}getOptionScopes(t,e,i){const{options:n,type:s}=this,r=this._cachedScopes(t,i),o=r.get(e);if(o)return o;const a=new Set;e.forEach(e=>{t&&(a.add(t),e.forEach(e=>Jn(a,t,e))),e.forEach(t=>Jn(a,n,t)),e.forEach(t=>Jn(a,Ht[s]||{},t)),e.forEach(t=>Jn(a,Xt,t)),e.forEach(t=>Jn(a,Ut,t))});const l=Array.from(a);return 0===l.length&&l.push(Object.create(null)),Kn.has(e)&&r.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,Ht[e]||{},Xt.datasets[e]||{},{type:e},Xt,Ut]}resolveNamedOptions(t,e,i,n=[""]){const s={$shared:!0},{resolver:r,subPrefixes:o}=es(this._resolverCache,t,n);let a=r;(function(t,e){const{isScriptable:i,isIndexable:n}=ke(t);for(const s of e){const e=i(s),r=n(s),o=(r||e)&&t[s];if(e&&(R(o)||is(o))||r&&m(o))return!0}return!1})(r,e)&&(s.$shared=!1,a=Oe(r,i=R(i)?i():i,this.createResolver(t,i,o)));for(const t of e)s[t]=a[t];return s}createResolver(t,e,i=[""],n){const{resolver:s}=es(this._resolverCache,t,i);return b(e)?Oe(s,e,void 0,n):s}}function es(t,e,i){let n=t.get(e);n||(n=new Map,t.set(e,n));const s=i.join();let r=n.get(s);return r||(r={resolver:Me(e,i),subPrefixes:i.filter(t=>!t.toLowerCase().includes("hover"))},n.set(s,r)),r}const is=t=>b(t)&&Object.getOwnPropertyNames(t).reduce((e,i)=>e||R(t[i]),!1),ns=["top","bottom","left","right","chartArea"];function ss(t,e){return"top"===t||"bottom"===t||-1===ns.indexOf(t)&&"x"===e}function rs(t,e){return function(i,n){return i[t]===n[t]?i[e]-n[e]:i[t]-n[t]}}function os(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),w(i&&i.onComplete,[t],e)}function as(t){const e=t.chart,i=e.options.animation;w(i&&i.onProgress,[t],e)}function ls(t){return Be()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const cs={},hs=t=>{const e=ls(t);return Object.values(cs).filter(t=>t.canvas===e).pop()};function ds(t,e,i){const n=Object.keys(t);for(const s of n){const n=+s;if(n>=e){const r=t[s];delete t[s],(i>0||n>e)&&(t[n+i]=r)}}}class us{constructor(t,e){const i=this.config=new ts(e),n=ls(t),s=hs(n);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas can be reused.");const r=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||function(t){return!Be()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?gn:Cn}(n)),this.platform.updateConfig(i);const o=this.platform.acquireContext(n,r.aspectRatio),a=o&&o.canvas,l=a&&a.height,c=a&&a.width;this.id=g(),this.ctx=o,this.canvas=a,this.width=c,this.height=l,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Hn,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let i;return function(...n){return e?(clearTimeout(i),i=setTimeout(t,e,n)):t.apply(this,n),e}}(t=>this.update(t),r.resizeDelay||0),this._dataChanges=[],cs[this.id]=this,o&&a?(di.listen(this,"complete",os),di.listen(this,"progress",as),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:s}=this;return p(t)?e&&s?s:n?i/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Qe(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Kt(this.canvas,this.ctx),this}stop(){return di.stop(this),this}resize(t,e){di.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,n=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(n,t,e,s),o=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,Qe(this,o,!0)&&(this.notifyPlugins("resize",{size:r}),w(i.onResize,[this,r],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){M(this.options.scales||{},(t,e)=>{t.id=e})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,n=Object.keys(i).reduce((t,e)=>(t[e]=!1,t),{});let s=[];e&&(s=s.concat(Object.keys(e).map(t=>{const i=e[t],n=Xn(t,i),s="r"===n,r="x"===n;return{options:i,dposition:s?"chartArea":r?"bottom":"left",dtype:s?"radialLinear":r?"category":"linear"}}))),M(s,e=>{const s=e.options,r=s.id,o=Xn(r,s),a=v(s.type,e.dtype);void 0!==s.position&&ss(s.position,o)===ss(e.dposition)||(s.position=e.dposition),n[r]=!0;let l=null;r in i&&i[r].type===a?l=i[r]:(l=new(Bn.getScale(a))({id:r,type:a,ctx:this.ctx,chart:this}),i[l.id]=l),l.init(s,t)}),M(n,(t,e)=>{t||delete i[e]}),M(i,t=>{un.configure(this,t,t.options),un.addBox(this,t)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((t,e)=>t.index-e.index),i>e){for(let t=e;te.length&&delete this._stacks,t.forEach((t,i)=>{0===e.filter(e=>e===t._dataset).length&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,n;for(this._removeUnreferencedMetasets(),i=0,n=e.length;i{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let t=0,e=this.data.datasets.length;t{t.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(rs("z","_idx"));const{_active:o,_lastEvent:a}=this;a?this._eventHandler(a,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){M(this.scales,t=>{un.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);F(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:n,count:s}of e)ds(t,n,"_removeElements"===i?-s:s)}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter(t=>t[0]===e).map((t,e)=>e+","+t.splice(1).join(","))),n=i(0);for(let t=1;tt.split(",")).map(t=>({method:t[1],start:+t[2],count:+t[3]}))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;un.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],M(this.boxes,t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))},this),this._layers.forEach((t,e)=>{t._idx=e}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,n=!i.disabled,s=this.chartArea,r={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",r)&&(n&&te(e,{left:!1===i.left?0:s.left-i.left,right:!1===i.right?this.width:s.right+i.right,top:!1===i.top?0:s.top-i.top,bottom:!1===i.bottom?this.height:s.bottom+i.bottom}),t.controller.draw(),n&&ee(e),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}getElementsAtEventForMode(t,e,i,n){const s=Ji.modes[e];return"function"==typeof s?s(this,t,i,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let n=i.filter(t=>t&&t._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(n)),n}getContext(){return this.$context||(this.$context=me(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const n=i?"show":"hide",s=this.getDatasetMeta(t),r=s.controller._resolveAnimations(void 0,n);L(e)?(s.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),r.update(s,{visible:i}),this.update(e=>e.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),di.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,i,n),t[i]=n},n=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};M(this.options.events,t=>i(t,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,n)=>{e.addEventListener(this,i,n),t[i]=n},n=(i,n)=>{t[i]&&(e.removeEventListener(this,i,n),delete t[i])},s=(t,e)=>{this.canvas&&this.resize(t,e)};let r;const o=()=>{n("attach",o),this.attached=!0,this.resize(),i("resize",s),i("detach",r)};r=()=>{this.attached=!1,n("resize",s),this._stop(),this._resize(0,0),i("attach",o)},e.isAttached(this.canvas)?o():r()}unbindEvents(){M(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},M(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const n=i?"set":"remove";let s,r,o,a;for("dataset"===e&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+n+"DatasetHoverStyle"]()),o=0,a=t.length;o{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}});!O(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}_updateHoverStyles(t,e,i){const n=this.options.hover,s=(t,e)=>t.filter(t=>!e.some(e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)),r=s(e,t),o=i?t:s(t,e);r.length&&this.updateHoverStyle(r,n.mode,!1),o.length&&n.mode&&this.updateHoverStyle(o,n.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:Jt(t,this.chartArea,this._minPadding)},n=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,n))return;const s=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(s||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:n=[],options:s}=this,r=e,o=this._getActiveElements(t,n,i,r),a=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}(t),l=function(t,e,i,n){return i&&"mouseout"!==t.type?n?e:t:null}(t,this._lastEvent,i,a);i&&(this._lastEvent=null,w(s.onHover,[t,o,this],this),a&&w(s.onClick,[t,o,this],this));const c=!O(o,n);return(c||e)&&(this._active=o,this._updateHoverStyles(o,n,e)),this._lastEvent=l,c}_getActiveElements(t,e,i,n){if("mouseout"===t.type)return[];if(!i)return e;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,n)}}const fs=()=>M(us.instances,t=>t._plugins.invalidate());function gs(t,e,i){const{startAngle:n,pixelMargin:s,x:r,y:o,outerRadius:a,innerRadius:l}=e;let c=s/a;t.beginPath(),t.arc(r,o,a,n-c,i+c),l>s?(c=s/l,t.arc(r,o,l,i+c,n-c,!0)):t.arc(r,o,s,i+B,n-B),t.closePath(),t.clip()}function ps(t,e,i,n){return{x:i+t*Math.cos(e),y:n+t*Math.sin(e)}}function ms(t,e,i,n,s){const{x:r,y:o,startAngle:a,pixelMargin:l,innerRadius:c}=e,h=Math.max(e.outerRadius+n+i-l,0),d=c>0?c+n+i+l:0;let u=0;const f=s-a;if(n){const t=((c>0?c-n:0)+(h>0?h-n:0))/2;u=(f-(0!==t?f*t/(t+n):f))/2}const g=(f-Math.max(.001,f*h-i/z)/h)/2,p=a+g+u,m=s-g-u,{outerStart:b,outerEnd:x,innerStart:y,innerEnd:v}=function(t,e,i,n){const s=he(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]),r=(i-e)/2,o=Math.min(r,n*e/2),a=t=>{const e=(i-Math.min(r,t))*n/2;return rt(t,0,Math.min(r,e))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:rt(s.innerStart,0,o),innerEnd:rt(s.innerEnd,0,o)}}(e,d,h,m-p),_=h-b,w=h-x,M=p+b/_,O=m-x/w,k=d+y,S=d+v,D=p+y/k,P=m-v/S;if(t.beginPath(),t.arc(r,o,h,M,O),x>0){const e=ps(w,O,r,o);t.arc(e.x,e.y,x,O,m+B)}const C=ps(S,m,r,o);if(t.lineTo(C.x,C.y),v>0){const e=ps(S,P,r,o);t.arc(e.x,e.y,v,m+B,P+Math.PI)}if(t.arc(r,o,d,m-v/d,p+y/d,!0),y>0){const e=ps(k,D,r,o);t.arc(e.x,e.y,y,D+Math.PI,p-B)}const T=ps(_,p,r,o);if(t.lineTo(T.x,T.y),b>0){const e=ps(_,M,r,o);t.arc(e.x,e.y,b,p-B,M)}t.closePath()}Object.defineProperties(us,{defaults:{enumerable:!0,value:Xt},instances:{enumerable:!0,value:cs},overrides:{enumerable:!0,value:Ht},registry:{enumerable:!0,value:Bn},version:{enumerable:!0,value:"3.7.1"},getChart:{enumerable:!0,value:hs},register:{enumerable:!0,value:(...t)=>{Bn.add(...t),fs()}},unregister:{enumerable:!0,value:(...t)=>{Bn.remove(...t),fs()}}});class bs extends Tn{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.getProps(["x","y"],i),{angle:s,distance:r}=tt(n,{x:t,y:e}),{startAngle:o,endAngle:a,innerRadius:l,outerRadius:c,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),d=this.options.spacing/2,u=v(h,a-o)>=I||st(s,o,a),f=ot(r,l+d,c+d);return u&&f}getCenterPoint(t){const{x:e,y:i,startAngle:n,endAngle:s,innerRadius:r,outerRadius:o}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:a,spacing:l}=this.options,c=(n+s)/2,h=(r+o+l+a)/2;return{x:e+Math.cos(c)*h,y:i+Math.sin(c)*h}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,n=(e.offset||0)/2,s=(e.spacing||0)/2;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>I?Math.floor(i/I):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();let r=0;if(n){r=n/2;const e=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(e)*r,Math.sin(e)*r),this.circumference>=z&&(r=n)}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;const o=function(t,e,i,n){const{fullCircles:s,startAngle:r,circumference:o}=e;let a=e.endAngle;if(s){ms(t,e,i,n,r+I);for(let e=0;ea&&r>a;return{count:n,start:l,loop:e.loop,ilen:c(o+(c?a-t:t))%r,y=()=>{f!==g&&(t.lineTo(m,g),t.lineTo(m,f),t.lineTo(m,p))};for(l&&(d=s[x(0)],t.moveTo(d.x,d.y)),h=0;h<=a;++h){if(d=s[x(h)],d.skip)continue;const e=d.x,i=d.y,n=0|e;n===u?(ig&&(g=i),m=(b*m+e)/++b):(y(),t.lineTo(e,i),u=n,b=0,f=g=i),p=i}y()}function Ms(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i?_s:ws}bs.id="arc",bs.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0},bs.defaultRoutes={backgroundColor:"backgroundColor"};const Os="function"==typeof Path2D;class ks extends Tn{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const n=i.spanGaps?this._loop:this._fullLoop;We(this._points,i,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(t,e){const i=t.points,n=t.options.spanGaps,s=i.length;if(!s)return[];const r=!!t._loop,{start:o,end:a}=function(t,e,i,n){let s=0,r=e-1;if(i&&!n)for(;ss&&t[r%e].skip;)r--;return r%=e,{start:s,end:r}}(i,s,r,n);return function(t,e,i,n){return n&&n.setContext&&i?function(t,e,i,n){const s=t._chart.getContext(),r=ci(t.options),{_datasetIndex:o,options:{spanGaps:a}}=t,l=i.length,c=[];let h=r,d=e[0].start,u=d;function f(t,e,n,s){const r=a?-1:1;if(t!==e){for(t+=l;i[t%l].skip;)t-=r;for(;i[e%l].skip;)e+=r;t%l!=e%l&&(c.push({start:t%l,end:e%l,loop:n,style:s}),h=s,d=e%l)}}for(const t of e){d=a?d:t.start;let e,r=i[d%l];for(u=d+1;u<=t.end;u++){const a=i[u%l];e=ci(n.setContext(me(s,{type:"segment",p0:r,p1:a,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:o}))),hi(e,h)&&f(d,u-1,t.loop,h),r=a,h=e}d"borderDash"!==t&&"fill"!==t};class Ds extends Tn{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.options,{x:s,y:r}=this.getProps(["x","y"],i);return Math.pow(t-s,2)+Math.pow(e-r,2)=i)&&s):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}As.id="bar",As.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0},As.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};class Rs{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:n,y:s,radius:r}=this;return e=e||{start:0,end:I},t.arc(n,s,r,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:n}=this,s=t.angle;return{x:e+Math.cos(s)*n,y:i+Math.sin(s)*n,angle:s}}}function Fs(t,e,i){for(;e>t;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function zs(t,e,i){const n=[];for(let s=0;s{e=Fs(t,e,s);const o=s[t],a=s[e];null!==n?(r.push({x:o.x,y:n}),r.push({x:a.x,y:n})):null!==i&&(r.push({x:i,y:o.y}),r.push({x:i,y:a.y}))}),r}(t,e),i.length?new ks({points:i,options:{tension:0},_loop:n,_fullLoop:n}):null}function Ws(t,e,i){let n=t[e].fill;const s=[e];let r;if(!i)return n;for(;!1!==n&&-1===s.indexOf(n);){if(!x(n))return n;if(r=t[n],!r)return!1;if(r.visible)return n;s.push(n),n=r.fill}return!1}function Bs(t,e,i){const{segments:n,points:s}=e;let r=!0,o=!1;t.beginPath();for(const a of n){const{start:n,end:l}=a,c=s[n],h=s[Fs(n,l,s)];r?(t.moveTo(c.x,c.y),r=!1):(t.lineTo(c.x,i),t.lineTo(c.x,c.y)),o=!!e.pathSegment(t,a,{move:o}),o?t.closePath():t.lineTo(h.x,i)}t.lineTo(e.first().x,i),t.closePath(),t.clip()}function Hs(t,e,i,n){if(n)return;let s=e[t],r=i[t];return"angle"===t&&(s=nt(s),r=nt(r)),{property:t,start:s,end:r}}function Us(t,e,i,n){return t&&e?n(t[i],e[i]):t?t[i]:e?e[i]:0}function Ys(t,e,i){const{top:n,bottom:s}=e.chart.chartArea,{property:r,start:o,end:a}=i||{};"x"===r&&(t.beginPath(),t.rect(o,n,a-o,s-n),t.clip())}function $s(t,e,i,n){const s=e.interpolate(i,n);s&&t.lineTo(s.x,s.y)}function Xs(t,e){const{line:i,target:n,property:s,color:r,scale:o}=e,a=function(t,e,i){const n=t.segments,s=t.points,r=e.points,o=[];for(const t of n){let{start:n,end:a}=t;a=Fs(n,a,s);const l=Hs(i,s[n],s[a],t.loop);if(!e.segments){o.push({source:t,target:l,start:s[n],end:s[a]});continue}const c=li(e,l);for(const e of c){const n=Hs(i,r[e.start],r[e.end],e.loop),a=ai(t,s,n);for(const t of a)o.push({source:t,target:e,start:{[i]:Us(l,n,"start",Math.max)},end:{[i]:Us(l,n,"end",Math.min)}})}}return o}(i,n,s);for(const{source:e,target:l,start:c,end:h}of a){const{style:{backgroundColor:a=r}={}}=e,d=!0!==n;t.save(),t.fillStyle=a,Ys(t,o,d&&Hs(s,c,h)),t.beginPath();const u=!!i.pathSegment(t,e);let f;if(d){u?t.closePath():$s(t,n,h,s);const e=!!n.pathSegment(t,l,{move:u,reverse:!0});f=u&&e,f||$s(t,n,c,s)}t.closePath(),t.fill(f?"evenodd":"nonzero"),t.restore()}}function qs(t,e,i){const n=Ns(e),{line:s,scale:r,axis:o}=e,a=s.options,l=a.fill,c=a.backgroundColor,{above:h=c,below:d=c}=l||{};n&&s.points.length&&(te(t,i),function(t,e){const{line:i,target:n,above:s,below:r,area:o,scale:a}=e,l=i._loop?"angle":e.axis;t.save(),"x"===l&&r!==s&&(Bs(t,n,o.top),Xs(t,{line:i,target:n,color:s,scale:a,property:l}),t.restore(),t.save(),Bs(t,n,o.bottom)),Xs(t,{line:i,target:n,color:r,scale:a,property:l}),t.restore()}(t,{line:s,target:n,above:h,below:d,area:i,scale:r,axis:o}),ee(t))}var Gs={id:"filler",afterDatasetsUpdate(t,e,i){const n=(t.data.datasets||[]).length,s=[];let r,o,a,l;for(o=0;o=0;--e){const i=s[e].$filler;i&&(i.line.updateControlPoints(r,i.axis),n&&qs(t.ctx,i,r))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const n=t.getSortedVisibleDatasetMetas();for(let e=n.length-1;e>=0;--e){const i=n[e].$filler;i&&qs(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){const n=e.meta.$filler;n&&!1!==n.fill&&"beforeDatasetDraw"===i.drawTime&&qs(t.ctx,n,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};new WeakMap;const Qs={average(t){if(!t.length)return!1;let e,i,n=0,s=0,r=0;for(e=0,i=t.length;e-1?t.split("\n"):t}function Js(t,e){const{element:i,datasetIndex:n,index:s}=e,r=t.getDatasetMeta(n).controller,{label:o,value:a}=r.getLabelAndValue(s);return{chart:t,label:o,parsed:r.getParsed(s),raw:t.data.datasets[n].data[s],formattedValue:a,dataset:r.getDataset(),dataIndex:s,datasetIndex:n,element:i}}function tr(t,e){const i=t.chart.ctx,{body:n,footer:s,title:r}=t,{boxWidth:o,boxHeight:a}=e,l=ge(e.bodyFont),c=ge(e.titleFont),h=ge(e.footerFont),d=r.length,u=s.length,f=n.length,g=fe(e.padding);let p=g.height,m=0,b=n.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);b+=t.beforeBody.length+t.afterBody.length,d&&(p+=d*c.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),b&&(p+=f*(e.displayColors?Math.max(a,l.lineHeight):l.lineHeight)+(b-f)*l.lineHeight+(b-1)*e.bodySpacing),u&&(p+=e.footerMarginTop+u*h.lineHeight+(u-1)*e.footerSpacing);let x=0;const y=function(t){m=Math.max(m,i.measureText(t).width+x)};return i.save(),i.font=c.string,M(t.title,y),i.font=l.string,M(t.beforeBody.concat(t.afterBody),y),x=e.displayColors?o+2+e.boxPadding:0,M(n,t=>{M(t.before,y),M(t.lines,y),M(t.after,y)}),x=0,i.font=h.string,M(t.footer,y),i.restore(),m+=g.width,{width:m,height:p}}function er(t,e,i,n){const{x:s,width:r}=i,{width:o,chartArea:{left:a,right:l}}=t;let c="center";return"center"===n?c=s<=(a+l)/2?"left":"right":s<=r/2?c="left":s>=o-r/2&&(c="right"),function(t,e,i,n){const{x:s,width:r}=n,o=i.caretSize+i.caretPadding;return"left"===t&&s+r+o>e.width||"right"===t&&s-r-o<0||void 0}(c,t,e,i)&&(c="center"),c}function ir(t,e,i){const n=i.yAlign||e.yAlign||function(t,e){const{y:i,height:n}=e;return it.height-n/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||er(t,e,i,n),yAlign:n}}function nr(t,e,i,n){const{caretSize:s,caretPadding:r,cornerRadius:o}=t,{xAlign:a,yAlign:l}=i,c=s+r,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=ue(o);let g=function(t,e){let{x:i,width:n}=t;return"right"===e?i-=n:"center"===e&&(i-=n/2),i}(e,a);const p=function(t,e,i){let{y:n,height:s}=t;return"top"===e?n+=i:n-="bottom"===e?s+i:s/2,n}(e,l,c);return"center"===l?"left"===a?g+=c:"right"===a&&(g-=c):"left"===a?g-=Math.max(h,u)+s:"right"===a&&(g+=Math.max(d,f)+s),{x:rt(g,0,n.width-e.width),y:rt(p,0,n.height-e.height)}}function sr(t,e,i){const n=fe(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-n.right:t.x+n.left}function rr(t){return Ks([],Zs(t))}function or(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}class ar extends Tn{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart||t._chart,this._chart=this.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),n=i.enabled&&e.options.animation&&i.animations,s=new pi(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=(this,me(this.chart.getContext(),{tooltip:this,tooltipItems:this._tooltipItems,type:"tooltip"})))}getTitle(t,e){const{callbacks:i}=e,n=i.beforeTitle.apply(this,[t]),s=i.title.apply(this,[t]),r=i.afterTitle.apply(this,[t]);let o=[];return o=Ks(o,Zs(n)),o=Ks(o,Zs(s)),o=Ks(o,Zs(r)),o}getBeforeBody(t,e){return rr(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){const{callbacks:i}=e,n=[];return M(t,t=>{const e={before:[],lines:[],after:[]},s=or(i,t);Ks(e.before,Zs(s.beforeLabel.call(this,t))),Ks(e.lines,s.label.call(this,t)),Ks(e.after,Zs(s.afterLabel.call(this,t))),n.push(e)}),n}getAfterBody(t,e){return rr(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){const{callbacks:i}=e,n=i.beforeFooter.apply(this,[t]),s=i.footer.apply(this,[t]),r=i.afterFooter.apply(this,[t]);let o=[];return o=Ks(o,Zs(n)),o=Ks(o,Zs(s)),o=Ks(o,Zs(r)),o}_createItems(t){const e=this._active,i=this.chart.data,n=[],s=[],r=[];let o,a,l=[];for(o=0,a=e.length;ot.filter(e,n,s,i))),t.itemSort&&(l=l.sort((e,n)=>t.itemSort(e,n,i))),M(l,e=>{const i=or(t.callbacks,e);n.push(i.labelColor.call(this,e)),s.push(i.labelPointStyle.call(this,e)),r.push(i.labelTextColor.call(this,e))}),this.labelColors=n,this.labelPointStyles=s,this.labelTextColors=r,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),n=this._active;let s,r=[];if(n.length){const t=Qs[i.position].call(this,n,this._eventPosition);r=this._createItems(i),this.title=this.getTitle(r,i),this.beforeBody=this.getBeforeBody(r,i),this.body=this.getBody(r,i),this.afterBody=this.getAfterBody(r,i),this.footer=this.getFooter(r,i);const e=this._size=tr(this,i),o=Object.assign({},t,e),a=ir(this.chart,i,o),l=nr(i,o,a,this.chart);this.xAlign=a.xAlign,this.yAlign=a.yAlign,s={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(s={opacity:0});this._tooltipItems=r,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,n){const s=this.getCaretPosition(t,i,n);e.lineTo(s.x1,s.y1),e.lineTo(s.x2,s.y2),e.lineTo(s.x3,s.y3)}getCaretPosition(t,e,i){const{xAlign:n,yAlign:s}=this,{caretSize:r,cornerRadius:o}=i,{topLeft:a,topRight:l,bottomLeft:c,bottomRight:h}=ue(o),{x:d,y:u}=t,{width:f,height:g}=e;let p,m,b,x,y,v;return"center"===s?(y=u+g/2,"left"===n?(p=d,m=p-r,x=y+r,v=y-r):(p=d+f,m=p+r,x=y-r,v=y+r),b=p):(m="left"===n?d+Math.max(a,c)+r:"right"===n?d+f-Math.max(l,h)-r:this.caretX,"top"===s?(x=u,y=x-r,p=m-r,b=m+r):(x=u+g,y=x+r,p=m+r,b=m-r),v=x),{x1:p,x2:m,x3:b,y1:x,y2:y,y3:v}}drawTitle(t,e,i){const n=this.title,s=n.length;let r,o,a;if(s){const l=si(i.rtl,this.x,this.width);for(t.x=sr(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",r=ge(i.titleFont),o=i.titleSpacing,e.fillStyle=i.titleColor,e.font=r.string,a=0;a0!==t)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,oe(t,{x:e,y:g,w:l,h:a,radius:o}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),oe(t,{x:i,y:g+1,w:l-2,h:a-2,radius:o}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(e,g,l,a),t.strokeRect(e,g,l,a),t.fillStyle=r.backgroundColor,t.fillRect(i,g+1,l-2,a-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:n}=this,{bodySpacing:s,bodyAlign:r,displayColors:o,boxHeight:a,boxWidth:l,boxPadding:c}=i,h=ge(i.bodyFont);let d=h.lineHeight,u=0;const f=si(i.rtl,this.x,this.width),g=function(i){e.fillText(i,f.x(t.x+u),t.y+d/2),t.y+=d+s},p=f.textAlign(r);let m,b,x,y,v,_,w;for(e.textAlign=r,e.textBaseline="middle",e.font=h.string,t.x=sr(this,p,i),e.fillStyle=i.bodyColor,M(this.beforeBody,g),u=o&&"right"!==p?"center"===r?l/2+c:l+2+c:0,y=0,_=n.length;y<_;++y){for(m=n[y],b=this.labelTextColors[y],e.fillStyle=b,M(m.before,g),x=m.lines,o&&x.length&&(this._drawColorBox(e,t,y,f,i),d=Math.max(h.lineHeight,a)),v=0,w=x.length;v0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,n=i&&i.x,s=i&&i.y;if(n||s){const i=Qs[t.position].call(this,this._active,this._eventPosition);if(!i)return;const r=this._size=tr(this,t),o=Object.assign({},i,this._size),a=ir(e,t,o),l=nr(t,o,a,e);n._to===l.x&&s._to===l.y||(this.xAlign=a.xAlign,this.yAlign=a.yAlign,this.width=r.width,this.height=r.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const r=fe(e.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&o&&(t.save(),t.globalAlpha=i,this.drawBackground(s,t,n,e),function(t,e){let i,n;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,n=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=n)}(t,e.textDirection),s.y+=r.top,this.drawTitle(s,t,e),this.drawBody(s,t,e),this.drawFooter(s,t,e),function(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,n=t.map(({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),s=!O(i,n),r=this._positionChanged(n,e);(s||r)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,s=this._active||[],r=this._getActiveElements(t,s,e,i),o=this._positionChanged(r,t),a=e||!O(r,s)||o;return a&&(this._active=r,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),a}_getActiveElements(t,e,i,n){const s=this.options;if("mouseout"===t.type)return[];if(!n)return e;const r=this.chart.getElementsAtEventForMode(t,s.mode,s,i);return s.reverse&&r.reverse(),r}_positionChanged(t,e){const{caretX:i,caretY:n,options:s}=this,r=Qs[s.position].call(this,t,e);return!1!==r&&(i!==r.x||n!==r.y)}}ar.positioners=Qs;var lr={id:"tooltip",_element:ar,positioners:Qs,afterInit(t,e,i){i&&(t.tooltip=new ar({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip,i={tooltip:e};!1!==t.notifyPlugins("beforeTooltipDraw",i)&&(e&&e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i))},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:f,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,n=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(n>0&&e.dataIndex"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};class cr extends Vn{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:i,label:n}of e)t[i]===n&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(p(t))return null;const i=this.getLabels();return((t,e)=>null===t?null:rt(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:function(t,e,i,n){const s=t.indexOf(e);return-1===s?((t,e,i,n)=>("string"==typeof e?(i=t.push(e)-1,n.unshift({index:i,label:e})):isNaN(e)&&(i=null),i))(t,e,i,n):s!==t.lastIndexOf(e)?i:s}(i,t,v(e,t),this._addedLabels),i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:n}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(n=this.getLabels().length-1)),this.min=i,this.max=n}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,n=[];let s=this.getLabels();s=0===t&&e===s.length-1?s:s.slice(t,e+1),this._valueRange=Math.max(s.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let i=t;i<=e;i++)n.push({value:i});return n}getLabelForValue(t){const e=this.getLabels();return t>=0&&te.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function hr(t,e,{horizontal:i,minRotation:n}){const s=K(n),r=(i?Math.sin(s):Math.cos(s))||.001,o=.75*e*(""+t).length;return Math.min(e/r,o)}cr.id="category",cr.defaults={ticks:{callback:cr.prototype.getLabelForValue}};class dr extends Vn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return p(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:n,max:s}=this;const r=t=>n=e?n:t,o=t=>s=i?s:t;if(t){const t=$(n),e=$(s);t<0&&e<0?o(0):t>0&&e>0&&r(0)}if(n===s){let e=1;(s>=Number.MAX_SAFE_INTEGER||n<=Number.MIN_SAFE_INTEGER)&&(e=Math.abs(.05*s)),o(s+e),t||r(n-e)}this.min=n,this.max=s}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:n}=t;return n?(e=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const n=function(t,e){const i=[],{bounds:n,step:s,min:r,max:o,precision:a,count:l,maxTicks:c,maxDigits:h,includeBounds:d}=t,u=s||1,f=c-1,{min:g,max:m}=e,b=!p(r),x=!p(o),y=!p(l),v=(m-g)/(h+1);let _,w,M,O,k=X((m-g)/f/u)*u;if(k<1e-14&&!b&&!x)return[{value:g},{value:m}];O=Math.ceil(m/k)-Math.floor(g/k),O>f&&(k=X(O*k/f/u)*u),p(a)||(_=Math.pow(10,a),k=Math.ceil(k*_)/_),"ticks"===n?(w=Math.floor(g/k)*k,M=Math.ceil(m/k)*k):(w=g,M=m),b&&x&&s&&function(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}((o-r)/s,k/1e3)?(O=Math.round(Math.min((o-r)/k,c)),k=(o-r)/O,w=r,M=o):y?(w=b?r:w,M=x?o:M,O=l-1,k=(M-w)/O):(O=(M-w)/k,O=G(O,Math.round(O),k/1e3)?Math.round(O):Math.ceil(O));const S=Math.max(J(k),J(w));_=Math.pow(10,p(a)?S:a),w=Math.round(w*_)/_,M=Math.round(M*_)/_;let D=0;for(b&&(d&&w!==r?(i.push({value:r}),w0?i:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=x(t)?Math.max(0,t):null,this.max=x(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,n=this.max;const s=e=>i=t?i:e,r=t=>n=e?n:t,o=(t,e)=>Math.pow(10,Math.floor(Y(t))+e);i===n&&(i<=0?(s(1),r(10)):(s(o(i,-1)),r(o(n,1)))),i<=0&&s(o(n,-1)),n<=0&&r(o(i,1)),this._zero&&this.min!==this._suggestedMin&&i===o(this.min,0)&&s(o(i,-1)),this.min=i,this.max=n}buildTicks(){const t=this.options,e=function(t,e){const i=Math.floor(Y(e.max)),n=Math.ceil(e.max/Math.pow(10,i)),s=[];let r=y(t.min,Math.pow(10,Math.floor(Y(e.min)))),o=Math.floor(Y(r)),a=Math.floor(r/Math.pow(10,o)),l=o<0?Math.pow(10,Math.abs(o)):1;do{s.push({value:r,major:fr(r)}),++a,10===a&&(a=1,++o,l=o>=0?1:l),r=Math.round(a*Math.pow(10,o)*l)/l}while(os?{start:e-i,end:e}:{start:e,end:e+i}}function br(t,e,i,n,s){const r=Math.abs(Math.sin(i)),o=Math.abs(Math.cos(i));let a=0,l=0;n.starte.r&&(a=(n.end-e.r)/r,t.r=Math.max(t.r,e.r+a)),s.starte.b&&(l=(s.end-e.b)/o,t.b=Math.max(t.b,e.b+l))}function xr(t){return 0===t||180===t?"center":t<180?"left":"right"}function yr(t,e,i){return 90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e),t}function vr(t,e,i,n){const{ctx:s}=t;if(i)s.arc(t.xCenter,t.yCenter,e,0,I);else{let i=t.getPointPosition(0,e);s.moveTo(i.x,i.y);for(let r=1;r{const i=w(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""}).filter((t,e)=>this.chart.getDataVisibility(e))}fit(){const t=this.options;t.display&&t.pointLabels.display?function(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),n=[],s=[],r=t._pointLabels.length,o=t.options.pointLabels,a=o.centerPointLabels?z/r:0;for(let d=0;d=0&&t=0;s--){const e=n.setContext(t.getPointLabelContext(s)),r=ge(e.font),{x:o,y:a,textAlign:l,left:c,top:h,right:d,bottom:u}=t._pointLabelItems[s],{backdropColor:f}=e;if(!p(f)){const t=fe(e.backdropPadding);i.fillStyle=f,i.fillRect(c-t.left,h-t.top,d-c+t.width,u-h+t.height)}se(i,t._pointLabels[s],o,a+r.lineHeight/2,r,{color:e.color,textAlign:l,textBaseline:"middle"})}}(this,s),n.display&&this.ticks.forEach((t,e)=>{0!==e&&(o=this.getDistanceFromCenterForValue(t.value),function(t,e,i,n){const s=t.ctx,r=e.circular,{color:o,lineWidth:a}=e;!r&&!n||!o||!a||i<0||(s.save(),s.strokeStyle=o,s.lineWidth=a,s.setLineDash(e.borderDash),s.lineDashOffset=e.borderDashOffset,s.beginPath(),vr(t,i,r,n),s.closePath(),s.stroke(),s.restore())}(this,n.setContext(this.getContext(e-1)),o,s))}),i.display){for(t.save(),r=s-1;r>=0;r--){const n=i.setContext(this.getPointLabelContext(r)),{color:s,lineWidth:l}=n;l&&s&&(t.lineWidth=l,t.strokeStyle=s,t.setLineDash(n.borderDash),t.lineDashOffset=n.borderDashOffset,o=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),a=this.getPointPosition(r,o),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(a.x,a.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const n=this.getIndexAngle(0);let s,r;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(n),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((n,o)=>{if(0===o&&!e.reverse)return;const a=i.setContext(this.getContext(o)),l=ge(a.font);if(s=this.getDistanceFromCenterForValue(this.ticks[o].value),a.showLabelBackdrop){t.font=l.string,r=t.measureText(n.label).width,t.fillStyle=a.backdropColor;const e=fe(a.backdropPadding);t.fillRect(-r/2-e.left,-s-l.size/2-e.top,r+e.width,l.size+e.height)}se(t,n.label,0,-s,l,{color:a.color})}),t.restore()}drawTitle(){}}_r.id="radialLinear",_r.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:jn.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}},_r.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},_r.descriptors={angleLines:{_fallback:"grid"}};const wr={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Mr=Object.keys(wr);function Or(t,e){return t-e}function kr(t,e){if(p(e))return null;const i=t._adapter,{parser:n,round:s,isoWeekday:r}=t._parseOpts;let o=e;return"function"==typeof n&&(o=n(o)),x(o)||(o="string"==typeof n?i.parse(o,n):i.parse(o)),null===o?null:(s&&(o="week"!==s||!q(r)&&!0!==r?i.startOf(o,s):i.startOf(o,"isoWeek",r)),+o)}function Sr(t,e,i,n){const s=Mr.length;for(let r=Mr.indexOf(t);r=e?i[n]:i[s]]=!0}}else t[e]=!0}function Pr(t,e,i){const n=[],s={},r=e.length;let o,a;for(o=0;o=0&&(e[l].major=!0);return e}(t,n,s,i):n}class Cr extends Vn{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e){const i=t.time||(t.time={}),n=this._adapter=new $i._date(t.adapters.date);C(i.displayFormats,n.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:kr(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:n,max:s,minDefined:r,maxDefined:o}=this.getUserBounds();function a(t){r||isNaN(t.min)||(n=Math.min(n,t.min)),o||isNaN(t.max)||(s=Math.max(s,t.max))}r&&o||(a(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||a(this.getMinMax(!1))),n=x(n)&&!isNaN(n)?n:+e.startOf(Date.now(),i),s=x(s)&&!isNaN(s)?s:+e.endOf(Date.now(),i)+1,this.min=Math.min(n,s-1),this.max=Math.max(n+1,s)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,n="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const s=this.min,r=function(t,e,i){let n=0,s=t.length;for(;nn&&t[s-1]>i;)s--;return n>0||s=Mr.indexOf(i);r--){const i=Mr[r];if(wr[i].common&&t._adapter.diff(s,n,i)>=e-1)return i}return Mr[i?Mr.indexOf(i):0]}(this,r.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(let e=Mr.indexOf(t)+1,i=Mr.length;e1e5*o)throw new Error(e+" and "+i+" are too far apart with stepSize of "+o+" "+r);const f="data"===n.ticks.source&&this.getDataTimestamps();for(h=u,d=0;ht-e).map(t=>+t)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}_tickFormatFunction(t,e,i,n){const s=this.options,r=s.time.displayFormats,o=this._unit,a=this._majorUnit,l=o&&r[o],c=a&&r[a],h=i[e],d=a&&c&&h&&h.major,u=this._adapter.format(t,n||(d?c:l)),f=s.ticks.callback;return f?w(f,[u,e,i],this):u}generateTickLabels(t){let e,i,n;for(e=0,i=t.length;e0?o:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(t=0,e=n.length;t=t[a].pos&&e<=t[l].pos&&({lo:a,hi:l}=xe(t,"pos",e)),({pos:n,time:r}=t[a]),({pos:s,time:o}=t[l])):(e>=t[a].time&&e<=t[l].time&&({lo:a,hi:l}=xe(t,"time",e)),({time:n,pos:r}=t[a]),({time:s,pos:o}=t[l]));const c=s-n;return c?r+(o-r)*(e-n)/c:r}Cr.id="time",Cr.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};class Er extends Cr{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Tr(e,this.min),this._tableRange=Tr(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,n=[],s=[];let r,o,a,l,c;for(r=0,o=t.length;r=e&&l<=i&&n.push(l);if(n.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(r=0,o=n.length;r2&&void 0!==arguments[2]?arguments[2]:"label";const n=[];t.datasets=e.map(e=>{const s=t.datasets.find(t=>t[i]===e[i]);return s&&e.data&&!n.includes(s)?(n.push(s),Object.assign(s,e),s):{...e}})}function zr(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"label";const i={labels:[],datasets:[]};return Rr(i,t.labels),Fr(i,t.datasets,e),i}function Ir(t,e){let{height:i=150,width:n=300,redraw:s=!1,datasetIdKey:r,type:o,data:a,options:l,plugins:c=[],fallbackContent:h,...d}=t;const u=Object(jr.useRef)(null),f=Object(jr.useRef)(),g=()=>{u.current&&(f.current=new us(u.current,{type:o,data:zr(a,r),options:l,plugins:c}),Lr(e,f.current))},p=()=>{Lr(e,null),f.current&&(f.current.destroy(),f.current=null)};return Object(jr.useEffect)(()=>{var t,e;!s&&f.current&&l&&(t=f.current,e=l,t.options={...e})},[s,l]),Object(jr.useEffect)(()=>{!s&&f.current&&Rr(f.current.config.data,a.labels)},[s,a.labels]),Object(jr.useEffect)(()=>{!s&&f.current&&a.datasets&&Fr(f.current.config.data,a.datasets,r)},[s,a.datasets]),Object(jr.useEffect)(()=>{f.current&&(s?(p(),setTimeout(g)):f.current.update())},[s,l,a.labels,a.datasets]),Object(jr.useEffect)(()=>(g(),()=>p()),[]),Ar.a.createElement("canvas",Object.assign({ref:u,role:"img",height:i,width:n},d),h)}const Nr=Object(jr.forwardRef)(Ir);var Vr=i(3),Wr=i(16),Br=i(7),Hr=i(8),Ur=i(4);function Yr(t,e){Object(Ur.a)(2,arguments);var i=Object(Hr.a)(t),n=Object(Br.a)(e);return isNaN(n)?new Date(NaN):n?(i.setDate(i.getDate()+n),i):i}function $r(t,e){Object(Ur.a)(2,arguments);var i=Object(Br.a)(e);return Yr(t,-i)}function Xr(t,e){Object(Ur.a)(2,arguments);var i=Object(Hr.a)(t),n=Object(Br.a)(e);if(isNaN(n))return new Date(NaN);if(!n)return i;var s=i.getDate(),r=new Date(i.getTime());r.setMonth(i.getMonth()+n+1,0);var o=r.getDate();return s>=o?r:(i.setFullYear(r.getFullYear(),r.getMonth(),s),i)}function qr(t,e){Object(Ur.a)(2,arguments);var i=Object(Br.a)(e);return Xr(t,-i)}function Gr(t){return(Gr="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 Qr(t,e){if(Object(Ur.a)(2,arguments),!e||"object"!==Gr(e))return new Date(NaN);var i=e.years?Object(Br.a)(e.years):0,n=e.months?Object(Br.a)(e.months):0,s=e.weeks?Object(Br.a)(e.weeks):0,r=e.days?Object(Br.a)(e.days):0,o=e.hours?Object(Br.a)(e.hours):0,a=e.minutes?Object(Br.a)(e.minutes):0,l=e.seconds?Object(Br.a)(e.seconds):0,c=qr(t,n+12*i),h=$r(c,r+7*s),d=a+60*o,u=l+60*d,f=1e3*u,g=new Date(h.getTime()-f);return g}function Kr(t){return(Kr="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 Zr(t,e){if(Object(Ur.a)(2,arguments),!e||"object"!==Kr(e))return new Date(NaN);var i=e.years?Object(Br.a)(e.years):0,n=e.months?Object(Br.a)(e.months):0,s=e.weeks?Object(Br.a)(e.weeks):0,r=e.days?Object(Br.a)(e.days):0,o=e.hours?Object(Br.a)(e.hours):0,a=e.minutes?Object(Br.a)(e.minutes):0,l=e.seconds?Object(Br.a)(e.seconds):0,c=Object(Hr.a)(t),h=n||i?Xr(c,n+12*i):c,d=r||s?Yr(h,r+7*s):h,u=a+60*o,f=l+60*u,g=1e3*f,p=new Date(d.getTime()+g);return p}function Jr(t,e){var i;Object(Ur.a)(1,arguments);var n=Object(Br.a)(null!==(i=null==e?void 0:e.additionalDigits)&&void 0!==i?i:2);if(2!==n&&1!==n&&0!==n)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof t&&"[object String]"!==Object.prototype.toString.call(t))return new Date(NaN);var s,r=so(t);if(r.date){var o=ro(r.date,n);s=oo(o.restDateString,o.year)}if(!s||isNaN(s.getTime()))return new Date(NaN);var a,l=s.getTime(),c=0;if(r.time&&(c=lo(r.time),isNaN(c)))return new Date(NaN);if(!r.timezone){var h=new Date(l+c),d=new Date(0);return d.setFullYear(h.getUTCFullYear(),h.getUTCMonth(),h.getUTCDate()),d.setHours(h.getUTCHours(),h.getUTCMinutes(),h.getUTCSeconds(),h.getUTCMilliseconds()),d}return a=ho(r.timezone),isNaN(a)?new Date(NaN):new Date(l+c+a)}Math.pow(10,8);var to={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},eo=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,io=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,no=/^([+-])(\d{2})(?::?(\d{2}))?$/;function so(t){var e,i={},n=t.split(to.dateTimeDelimiter);if(n.length>2)return i;if(/:/.test(n[0])?e=n[0]:(i.date=n[0],e=n[1],to.timeZoneDelimiter.test(i.date)&&(i.date=t.split(to.timeZoneDelimiter)[0],e=t.substr(i.date.length,t.length))),e){var s=to.timezone.exec(e);s?(i.time=e.replace(s[1],""),i.timezone=s[1]):i.time=e}return i}function ro(t,e){var i=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),n=t.match(i);if(!n)return{year:NaN,restDateString:""};var s=n[1]?parseInt(n[1]):null,r=n[2]?parseInt(n[2]):null;return{year:null===r?s:100*r,restDateString:t.slice((n[1]||n[2]).length)}}function oo(t,e){if(null===e)return new Date(NaN);var i=t.match(eo);if(!i)return new Date(NaN);var n=!!i[4],s=ao(i[1]),r=ao(i[2])-1,o=ao(i[3]),a=ao(i[4]),l=ao(i[5])-1;if(n)return function(t,e,i){return e>=1&&e<=53&&i>=0&&i<=6}(0,a,l)?function(t,e,i){var n=new Date(0);n.setUTCFullYear(t,0,4);var s=7*(e-1)+i+1-(n.getUTCDay()||7);return n.setUTCDate(n.getUTCDate()+s),n}(e,a,l):new Date(NaN);var c=new Date(0);return function(t,e,i){return e>=0&&e<=11&&i>=1&&i<=(uo[e]||(fo(t)?29:28))}(e,r,o)&&function(t,e){return e>=1&&e<=(fo(t)?366:365)}(e,s)?(c.setUTCFullYear(e,r,Math.max(s,o)),c):new Date(NaN)}function ao(t){return t?parseInt(t):1}function lo(t){var e=t.match(io);if(!e)return NaN;var i=co(e[1]),n=co(e[2]),s=co(e[3]);return function(t,e,i){return 24===t?0===e&&0===i:i>=0&&i<60&&e>=0&&e<60&&t>=0&&t<25}(i,n,s)?36e5*i+6e4*n+1e3*s:NaN}function co(t){return t&&parseFloat(t.replace(",","."))||0}function ho(t){if("Z"===t)return 0;var e=t.match(no);if(!e)return 0;var i="+"===e[1]?-1:1,n=parseInt(e[2]),s=e[3]&&parseInt(e[3])||0;return function(t,e){return e>=0&&e<=59}(0,s)?i*(36e5*n+6e4*s):NaN}var uo=[31,null,31,30,31,30,31,31,30,31,30,31];function fo(t){return t%400==0||t%4==0&&t%100!=0}var go=i(76);function po(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function mo(t){for(var e=1;e0,"is-negative":e<0});return Object(c.createElement)("div",{className:r},Object(c.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"simpay-admin-charts-badge__icon",width:"16",height:"16"},e>0?Object(c.createElement)("path",{d:"M16.004 9.414l-8.607 8.607-1.414-1.414L14.589 8H7.004V6h11v11h-2V9.414z"}):Object(c.createElement)("path",{d:"M14.59 16.004L5.982 7.397l1.414-1.414 8.607 8.606V7.004h2v11h-11v-2z"})),!n&&Object(c.createElement)("span",null,Math.abs(e),"%"))},Eo="simpay-admin-charts-period-over-period__tooltip",jo=function(t){var e=t.position,i=t.opacity,n=t.data,s=t.delta,r=t.deltaChangedString;if(!n.length)return null;var o=e.top,a=e.left,l=e.right,h=Co()("simpay-admin-charts-badge",{"is-positive":s>0,"is-negative":s<0});return Object(c.createElement)("div",{className:Eo,style:{top:o,left:a||"auto",right:l||"auto",opacity:i}},n.map((function(t,e){var i=t.label,n=t.value;return Object(c.createElement)("div",{className:"".concat(Eo,"-data"),"data-dataset":e,key:i+Math.random()},Object(c.createElement)("strong",null,i)," ",Object(c.createElement)("em",null,Object(Wr.decodeEntities)(n)))})),0!==s&&Object(c.createElement)("div",{className:"".concat(Eo,"-delta")},Object(c.createElement)("div",{className:h},Object(c.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"simpay-admin-charts-badge__icon"},s>0?Object(c.createElement)("path",{fillRule:"evenodd",d:"M5.22 14.78a.75.75 0 001.06 0l7.22-7.22v5.69a.75.75 0 001.5 0v-7.5a.75.75 0 00-.75-.75h-7.5a.75.75 0 000 1.5h5.69l-7.22 7.22a.75.75 0 000 1.06z",clipRule:"evenodd"}):Object(c.createElement)("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06l7.22 7.22H6.75a.75.75 0 000 1.5h7.5a.747.747 0 00.75-.75v-7.5a.75.75 0 00-1.5 0v5.69L6.28 5.22z"}))),Object(c.createElement)("span",null,r)))},Ao=function(t){var e=t.chart,i=function(t,e){var i=Object(c.useState)({marginTop:0,marginRight:0,marginBottom:0,marginLeft:0}),n=l()(i,2),s=n[0],r=s.marginTop,o=s.marginRight,a=s.marginBottom,h=s.marginLeft,d=n[1];return Object(c.useEffect)((function(){t.current&&d({marginTop:Math.floor(t.current.chartArea.top),marginRight:Math.floor(t.current.width-t.current.chartArea.right),marginBottom:Math.floor(t.current.chartArea.bottom),marginLeft:Math.floor(t.current.chartArea.left)})}),[t,e]),{marginTop:r,marginRight:o,marginBottom:a,marginLeft:h}}(t.chartRef,e),n=i.marginLeft,s=i.marginRight;return Object(c.createElement)("div",{style:{width:"100%",position:"relative",fontSize:"12px",display:"flex",justifyContent:"space-between",marginTop:"-2px"}},Object(c.createElement)("div",{style:{marginLeft:n,textAlign:"left"}},e.datasets[0].data[0].x),Object(c.createElement)("div",{style:{marginRight:s,textAlign:"right"}},e.datasets[0].data[e.datasets[0].data.length-1].x))};function Lo(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Ro(t){for(var e=1;e0}))}));return Object(c.createElement)("div",{className:"simpay-admin-charts-period-over-period",style:r},!O&&Object(c.createElement)("div",{className:"simpay-admin-charts-no-data",style:Ro(Ro({},r),{},{height:"calc(".concat(r.height," + 15px)")})},a),Object(c.createElement)(Nr,{type:"line",ref:p,options:M,plugins:[_o,(_="rgb(".concat(f.primary_color.join(","),")"),{id:"YGridLineHover",afterDraw:function(t){var e;if(null!==(e=t.tooltip)&&void 0!==e&&null!==(e=e._active)&&void 0!==e&&e.length){var i=t.tooltip._active[0].element.x,n=t.scales.yAxis,s=t.ctx;s.save(),s.beginPath(),s.moveTo(i,n.top),s.lineTo(i,n.bottom),s.lineWidth=2,s.strokeStyle=_,s.stroke(),s.restore()}}})],data:{datasets:m}}),Object(c.createElement)(Ao,{chartRef:p,chart:f}),Object(c.createElement)(jo,s()({},y,{deltaChangedString:h(y)})),Object(c.createElement)(Vr.Popover.Slot,null))}},function(t,e,i){var n;!function(){"use strict";var i={}.hasOwnProperty;function s(){for(var t=[],e=0;et.length)&&(e=t.length);for(var i=0,n=new Array(e);i=r.getTime()?i+1:e.getTime()>=l.getTime()?i:i-1}function f(t){Object(n.a)(1,arguments);var e=u(t),i=new Date(0);i.setUTCFullYear(e,0,4),i.setUTCHours(0,0,0,0);var s=d(i);return s}var g={};function p(){return g}function m(t,e){var i,s,r,a,c,h,d,u;Object(n.a)(1,arguments);var f=p(),g=Object(l.a)(null!==(i=null!==(s=null!==(r=null!==(a=null==e?void 0:e.weekStartsOn)&&void 0!==a?a:null==e||null===(c=e.locale)||void 0===c||null===(h=c.options)||void 0===h?void 0:h.weekStartsOn)&&void 0!==r?r:f.weekStartsOn)&&void 0!==s?s:null===(d=f.locale)||void 0===d||null===(u=d.options)||void 0===u?void 0:u.weekStartsOn)&&void 0!==i?i:0);if(!(g>=0&&g<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var m=Object(o.a)(t),b=m.getUTCDay(),x=(b=1&&x<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var y=new Date(0);y.setUTCFullYear(g+1,0,x),y.setUTCHours(0,0,0,0);var v=m(y,e),_=new Date(0);_.setUTCFullYear(g,0,x),_.setUTCHours(0,0,0,0);var w=m(_,e);return f.getTime()>=v.getTime()?g+1:f.getTime()>=w.getTime()?g:g-1}function x(t,e){var i,s,r,o,a,c,h,d;Object(n.a)(1,arguments);var u=p(),f=Object(l.a)(null!==(i=null!==(s=null!==(r=null!==(o=null==e?void 0:e.firstWeekContainsDate)&&void 0!==o?o:null==e||null===(a=e.locale)||void 0===a||null===(c=a.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==r?r:u.firstWeekContainsDate)&&void 0!==s?s:null===(h=u.locale)||void 0===h||null===(d=h.options)||void 0===d?void 0:d.firstWeekContainsDate)&&void 0!==i?i:1),g=b(t,e),x=new Date(0);x.setUTCFullYear(g,0,f),x.setUTCHours(0,0,0,0);var y=m(x,e);return y}function y(t,e){for(var i=t<0?"-":"",n=Math.abs(t).toString();n.length0?i:1-i;return y("yy"===e?n%100:n,e.length)},_=function(t,e){var i=t.getUTCMonth();return"M"===e?String(i+1):y(i+1,2)},w=function(t,e){return y(t.getUTCDate(),e.length)},M=function(t,e){return y(t.getUTCHours()%12||12,e.length)},O=function(t,e){return y(t.getUTCHours(),e.length)},k=function(t,e){return y(t.getUTCMinutes(),e.length)},S=function(t,e){return y(t.getUTCSeconds(),e.length)},D=function(t,e){var i=e.length,n=t.getUTCMilliseconds();return y(Math.floor(n*Math.pow(10,i-3)),e.length)};function P(t,e){var i=t>0?"-":"+",n=Math.abs(t),s=Math.floor(n/60),r=n%60;if(0===r)return i+String(s);var o=e||"";return i+String(s)+o+y(r,2)}function C(t,e){return t%60==0?(t>0?"-":"+")+y(Math.abs(t)/60,2):T(t,e)}function T(t,e){var i=e||"",n=t>0?"-":"+",s=Math.abs(t);return n+y(Math.floor(s/60),2)+i+y(s%60,2)}var E={G:function(t,e,i){var n=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return i.era(n,{width:"abbreviated"});case"GGGGG":return i.era(n,{width:"narrow"});case"GGGG":default:return i.era(n,{width:"wide"})}},y:function(t,e,i){if("yo"===e){var n=t.getUTCFullYear(),s=n>0?n:1-n;return i.ordinalNumber(s,{unit:"year"})}return v(t,e)},Y:function(t,e,i,n){var s=b(t,n),r=s>0?s:1-s;return"YY"===e?y(r%100,2):"Yo"===e?i.ordinalNumber(r,{unit:"year"}):y(r,e.length)},R:function(t,e){return y(u(t),e.length)},u:function(t,e){return y(t.getUTCFullYear(),e.length)},Q:function(t,e,i){var n=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return y(n,2);case"Qo":return i.ordinalNumber(n,{unit:"quarter"});case"QQQ":return i.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return i.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return i.quarter(n,{width:"wide",context:"formatting"})}},q:function(t,e,i){var n=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return y(n,2);case"qo":return i.ordinalNumber(n,{unit:"quarter"});case"qqq":return i.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return i.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return i.quarter(n,{width:"wide",context:"standalone"})}},M:function(t,e,i){var n=t.getUTCMonth();switch(e){case"M":case"MM":return _(t,e);case"Mo":return i.ordinalNumber(n+1,{unit:"month"});case"MMM":return i.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return i.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return i.month(n,{width:"wide",context:"formatting"})}},L:function(t,e,i){var n=t.getUTCMonth();switch(e){case"L":return String(n+1);case"LL":return y(n+1,2);case"Lo":return i.ordinalNumber(n+1,{unit:"month"});case"LLL":return i.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return i.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return i.month(n,{width:"wide",context:"standalone"})}},w:function(t,e,i,s){var r=function(t,e){Object(n.a)(1,arguments);var i=Object(o.a)(t),s=m(i,e).getTime()-x(i,e).getTime();return Math.round(s/6048e5)+1}(t,s);return"wo"===e?i.ordinalNumber(r,{unit:"week"}):y(r,e.length)},I:function(t,e,i){var s=function(t){Object(n.a)(1,arguments);var e=Object(o.a)(t),i=d(e).getTime()-f(e).getTime();return Math.round(i/6048e5)+1}(t);return"Io"===e?i.ordinalNumber(s,{unit:"week"}):y(s,e.length)},d:function(t,e,i){return"do"===e?i.ordinalNumber(t.getUTCDate(),{unit:"date"}):w(t,e)},D:function(t,e,i){var s=function(t){Object(n.a)(1,arguments);var e=Object(o.a)(t),i=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var s=e.getTime(),r=i-s;return Math.floor(r/864e5)+1}(t);return"Do"===e?i.ordinalNumber(s,{unit:"dayOfYear"}):y(s,e.length)},E:function(t,e,i){var n=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return i.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return i.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(n,{width:"short",context:"formatting"});case"EEEE":default:return i.day(n,{width:"wide",context:"formatting"})}},e:function(t,e,i,n){var s=t.getUTCDay(),r=(s-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(r);case"ee":return y(r,2);case"eo":return i.ordinalNumber(r,{unit:"day"});case"eee":return i.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return i.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(s,{width:"short",context:"formatting"});case"eeee":default:return i.day(s,{width:"wide",context:"formatting"})}},c:function(t,e,i,n){var s=t.getUTCDay(),r=(s-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(r);case"cc":return y(r,e.length);case"co":return i.ordinalNumber(r,{unit:"day"});case"ccc":return i.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return i.day(s,{width:"narrow",context:"standalone"});case"cccccc":return i.day(s,{width:"short",context:"standalone"});case"cccc":default:return i.day(s,{width:"wide",context:"standalone"})}},i:function(t,e,i){var n=t.getUTCDay(),s=0===n?7:n;switch(e){case"i":return String(s);case"ii":return y(s,e.length);case"io":return i.ordinalNumber(s,{unit:"day"});case"iii":return i.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return i.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return i.day(n,{width:"short",context:"formatting"});case"iiii":default:return i.day(n,{width:"wide",context:"formatting"})}},a:function(t,e,i){var n=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return i.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return i.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(t,e,i){var n,s=t.getUTCHours();switch(n=12===s?"noon":0===s?"midnight":s/12>=1?"pm":"am",e){case"b":case"bb":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return i.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return i.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(t,e,i){var n,s=t.getUTCHours();switch(n=s>=17?"evening":s>=12?"afternoon":s>=4?"morning":"night",e){case"B":case"BB":case"BBB":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return i.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return i.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(t,e,i){if("ho"===e){var n=t.getUTCHours()%12;return 0===n&&(n=12),i.ordinalNumber(n,{unit:"hour"})}return M(t,e)},H:function(t,e,i){return"Ho"===e?i.ordinalNumber(t.getUTCHours(),{unit:"hour"}):O(t,e)},K:function(t,e,i){var n=t.getUTCHours()%12;return"Ko"===e?i.ordinalNumber(n,{unit:"hour"}):y(n,e.length)},k:function(t,e,i){var n=t.getUTCHours();return 0===n&&(n=24),"ko"===e?i.ordinalNumber(n,{unit:"hour"}):y(n,e.length)},m:function(t,e,i){return"mo"===e?i.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):k(t,e)},s:function(t,e,i){return"so"===e?i.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):S(t,e)},S:function(t,e){return D(t,e)},X:function(t,e,i,n){var s=(n._originalDate||t).getTimezoneOffset();if(0===s)return"Z";switch(e){case"X":return C(s);case"XXXX":case"XX":return T(s);case"XXXXX":case"XXX":default:return T(s,":")}},x:function(t,e,i,n){var s=(n._originalDate||t).getTimezoneOffset();switch(e){case"x":return C(s);case"xxxx":case"xx":return T(s);case"xxxxx":case"xxx":default:return T(s,":")}},O:function(t,e,i,n){var s=(n._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+P(s,":");case"OOOO":default:return"GMT"+T(s,":")}},z:function(t,e,i,n){var s=(n._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+P(s,":");case"zzzz":default:return"GMT"+T(s,":")}},t:function(t,e,i,n){var s=n._originalDate||t;return y(Math.floor(s.getTime()/1e3),e.length)},T:function(t,e,i,n){return y((n._originalDate||t).getTime(),e.length)}},j=function(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},A=function(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},L={p:A,P:function(t,e){var i,n=t.match(/(P+)(p+)?/)||[],s=n[1],r=n[2];if(!r)return j(t,e);switch(s){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"})}return i.replace("{{date}}",j(s,e)).replace("{{time}}",A(r,e))}};function R(t){var e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}var F=["D","DD"],z=["YY","YYYY"];function I(t){return-1!==F.indexOf(t)}function N(t){return-1!==z.indexOf(t)}function V(t,e,i){if("YYYY"===t)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===t)throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===t)throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===t)throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var W={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function B(t){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.width?String(e.width):t.defaultWidth,n=t.formats[i]||t.formats[t.defaultWidth];return n}}var H={date:B({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:B({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:B({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},U={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function Y(t){return function(e,i){var n;if("formatting"===(null!=i&&i.context?String(i.context):"standalone")&&t.formattingValues){var s=t.defaultFormattingWidth||t.defaultWidth,r=null!=i&&i.width?String(i.width):s;n=t.formattingValues[r]||t.formattingValues[s]}else{var o=t.defaultWidth,a=null!=i&&i.width?String(i.width):t.defaultWidth;n=t.values[a]||t.values[o]}return n[t.argumentCallback?t.argumentCallback(e):e]}}function $(t){return function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.width,s=n&&t.matchPatterns[n]||t.matchPatterns[t.defaultMatchWidth],r=e.match(s);if(!r)return null;var o,a=r[0],l=n&&t.parsePatterns[n]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?q(l,(function(t){return t.test(a)})):X(l,(function(t){return t.test(a)}));o=t.valueCallback?t.valueCallback(c):c,o=i.valueCallback?i.valueCallback(o):o;var h=e.slice(a.length);return{value:o,rest:h}}}function X(t,e){for(var i in t)if(t.hasOwnProperty(i)&&e(t[i]))return i}function q(t,e){for(var i=0;i0?"in "+n:n+" ago":n},formatLong:H,formatRelative:function(t,e,i,n){return U[t]},localize:{ordinalNumber:function(t,e){var i=Number(t),n=i%100;if(n>20||n<10)switch(n%10){case 1:return i+"st";case 2:return i+"nd";case 3:return i+"rd"}return i+"th"},era:Y({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Y({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:Y({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:Y({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:Y({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(G={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(t){return parseInt(t,10)}},function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.match(G.matchPattern);if(!i)return null;var n=i[0],s=t.match(G.parsePattern);if(!s)return null;var r=G.valueCallback?G.valueCallback(s[0]):s[0];r=e.valueCallback?e.valueCallback(r):r;var o=t.slice(n.length);return{value:r,rest:o}}),era:$({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:$({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:$({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:$({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:$({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}},K=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Z=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,J=/^'([^]*?)'?$/,tt=/''/g,et=/[a-zA-Z]/;function it(t,e,i){var s,r,c,d,u,f,g,m,b,x,y,v,_,w,M,O,k,S;Object(n.a)(2,arguments);var D=String(e),P=p(),C=null!==(s=null!==(r=null==i?void 0:i.locale)&&void 0!==r?r:P.locale)&&void 0!==s?s:Q,T=Object(l.a)(null!==(c=null!==(d=null!==(u=null!==(f=null==i?void 0:i.firstWeekContainsDate)&&void 0!==f?f:null==i||null===(g=i.locale)||void 0===g||null===(m=g.options)||void 0===m?void 0:m.firstWeekContainsDate)&&void 0!==u?u:P.firstWeekContainsDate)&&void 0!==d?d:null===(b=P.locale)||void 0===b||null===(x=b.options)||void 0===x?void 0:x.firstWeekContainsDate)&&void 0!==c?c:1);if(!(T>=1&&T<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var j=Object(l.a)(null!==(y=null!==(v=null!==(_=null!==(w=null==i?void 0:i.weekStartsOn)&&void 0!==w?w:null==i||null===(M=i.locale)||void 0===M||null===(O=M.options)||void 0===O?void 0:O.weekStartsOn)&&void 0!==_?_:P.weekStartsOn)&&void 0!==v?v:null===(k=P.locale)||void 0===k||null===(S=k.options)||void 0===S?void 0:S.weekStartsOn)&&void 0!==y?y:0);if(!(j>=0&&j<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!C.localize)throw new RangeError("locale must contain localize property");if(!C.formatLong)throw new RangeError("locale must contain formatLong property");var A=Object(o.a)(t);if(!a(A))throw new RangeError("Invalid time value");var F=R(A),z=h(A,F),W={firstWeekContainsDate:T,weekStartsOn:j,locale:C,_originalDate:A},B=D.match(Z).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,L[e])(t,C.formatLong):t})).join("").match(K).map((function(n){if("''"===n)return"'";var s=n[0];if("'"===s)return nt(n);var r=E[s];if(r)return null!=i&&i.useAdditionalWeekYearTokens||!N(n)||V(n,e,String(t)),null!=i&&i.useAdditionalDayOfYearTokens||!I(n)||V(n,e,String(t)),r(z,n,C.localize,W);if(s.match(et))throw new RangeError("Format string contains an unescaped latin alphabet character `"+s+"`");return n})).join("");return B}function nt(t){var e=t.match(J);return e?e[1].replace(tt,"'"):t}},,,,,function(t,e,i){"use strict";i.r(e);var n=i(6),s=i.n(n),r=i(0),o=(i(37),i(10)),a=i(24),l=i.n(a),c=i(2),h=i(11),d=i.n(h);function u(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function f(t){for(var e=1;ewebhooks to be properly configured to populate correctly.","stripe"),{url:Object(r.createElement)("a",{href:y})})),Object(r.createElement)(p.Flex,null,Object(r.createElement)(p.Button,{variant:"link",onClick:function(){return e(!1)}},Object(c.__)("Close","stripe")),Object(r.createElement)(p.Button,{variant:"primary",isPrimary:!0,href:"https://dashboard.stripe.com/reports/hub",target:"_blank"},Object(c.__)("View advanced reports in Stripe →","stripe"))))},w=i(13),M=simpayAdminDashboardWidgetReport.currencies,O=new Date,k=function(t){var e=t.report,i=t.currency,n=t.setCurrency,o=t.range,a=t.setRange,l=e.data.delta,h=Object(r.useState)(!1),d=s()(h,2),u=d[0],f=d[1];return Object(r.createElement)("div",{className:"simpay-admin-dashboard-widget-report__data-filter"},Object(r.createElement)("div",{className:"simpay-admin-dashboard-widget-report__data-filter-title"},Object(r.createElement)("strong",null,Object(c.__)("Top Forms","stripe")),u&&Object(r.createElement)(_,{setIsOpen:f}),Object(r.createElement)(p.Button,{variant:"link",onClick:function(){return f(!0)}},Object(r.createElement)(m.a,{size:20,icon:b.a}))),Object(r.createElement)("div",{className:"simpay-admin-dashboard-widget-report__data-filter-controls"},!e.isLoading&&0!==l&&Object(r.createElement)(w.a,{delta:l}),Object(r.createElement)(p.SelectControl,{label:Object(c.__)("Currency","stripe"),hideLabelFromVision:!0,value:i,onChange:n,options:M.map((function(t){return{label:t,value:t.toLowerCase()}}))}),Object(r.createElement)(p.SelectControl,{label:Object(c.__)("Range","stripe"),hideLabelFromVision:!0,value:o.type,onChange:function(t){return a({type:t,start:Object(w.d)(t,O),end:Object(w.c)(t,o.end)})},options:[{label:"Today",value:"today"},{label:"Last 7 days",value:"7days"},{label:"Last 4 weeks",value:"4weeks"}]})))},S=i(15),D=i.n(S),P=i(16),C=function(t){var e=t.id,i=t.title,n=t.total_formatted,s=Object(o.addQueryArgs)("post.php",{post:e,action:"edit"});return Object(r.createElement)("div",{style:{display:"flex",justifyContent:"space-between"}},Object(r.createElement)("span",null,i?Object(r.createElement)("a",{href:s,target:"_blank",rel:"noreferrer"},i):Object(c.sprintf)(/* translators: %d Form ID. */ +!function(t){var e={};function i(n){if(e[n])return e[n].exports;var s=e[n]={i:n,l:!1,exports:{}};return t[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}i.m=t,i.c=e,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 s in t)i.d(n,s,function(e){return t[e]}.bind(null,s));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="",i(i.s=83)}([function(t,e){t.exports=window.wp.element},,function(t,e){t.exports=window.wp.i18n},function(t,e){t.exports=window.wp.components},function(t,e,i){"use strict";function n(t,e){if(e.length1?"s":"")+" required, but only "+e.length+" present")}i.d(e,"a",(function(){return n}))},function(t,e){t.exports=window.React},function(t,e,i){var n=i(26),s=i(27),r=i(22),o=i(28);t.exports=function(t,e){return n(t)||s(t,e)||r(t,e)||o()},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){"use strict";function n(t){if(null===t||!0===t||!1===t)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}i.d(e,"a",(function(){return n}))},function(t,e,i){"use strict";i.d(e,"a",(function(){return r}));var n=i(4);function s(t){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t){Object(n.a)(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||"object"===s(t)&&"[object Date]"===e?new Date(t.getTime()):"number"==typeof t||"[object Number]"===e?new Date(t):("string"!=typeof t&&"[object String]"!==e||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}},function(t,e){t.exports=window.wp.primitives},function(t,e){t.exports=window.wp.url},function(t,e,i){var n=i(30);t.exports=function(t,e,i){return(e=n(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=window.lodash},function(t,e,i){var n;!function(){"use strict";var i={}.hasOwnProperty;function s(){for(var t=[],e=0;eArray.prototype.slice.call(t));let s=!1,r=[];return function(...i){r=n(i),s||(s=!0,h.call(window,()=>{s=!1,t.apply(e,r)}))}}const u=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2;function f(){}const g=function(){let t=0;return function(){return t++}}();function p(t){return null==t}function m(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.substr(0,7)&&"Array]"===e.substr(-6)}function b(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}const x=t=>("number"==typeof t||t instanceof Number)&&isFinite(+t);function y(t,e){return x(t)?t:e}function v(t,e){return void 0===t?e:t}const _=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function w(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function M(t,e,i,n){let s,r,o;if(m(t))if(r=t.length,n)for(s=r-1;s>=0;s--)e.call(i,t[s],s);else for(s=0;si;)t=t[e.substr(i,n-i)],i=n+1,n=E(e,i);return t}function A(t){return t.charAt(0).toUpperCase()+t.slice(1)}const L=t=>void 0!==t,R=t=>"function"==typeof t,F=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0},z=Math.PI,I=2*z,N=I+z,V=Number.POSITIVE_INFINITY,W=z/180,B=z/2,H=z/4,U=2*z/3,Y=Math.log10,$=Math.sign;function X(t){const e=Math.round(t);t=G(t,e,t/1e3)?e:t;const i=Math.pow(10,Math.floor(Y(t))),n=t/i;return(n<=1?1:n<=2?2:n<=5?5:10)*i}function q(t){return!isNaN(parseFloat(t))&&isFinite(t)}function G(t,e,i){return Math.abs(t-e)l&&c=Math.min(e,i)-n&&t<=Math.max(e,i)+n}const at=t=>0===t||1===t,lt=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*I/i),ct=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*I/i)+1,ht={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*B),easeOutSine:t=>Math.sin(t*B),easeInOutSine:t=>-.5*(Math.cos(z*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>at(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>at(t)?t:lt(t,.075,.3),easeOutElastic:t=>at(t)?t:ct(t,.075,.3),easeInOutElastic(t){const e=.1125;return at(t)?t:t<.5?.5*lt(2*t,e,.45):.5+.5*ct(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-ht.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*ht.easeInBounce(2*t):.5*ht.easeOutBounce(2*t-1)+.5},dt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},ut="0123456789ABCDEF",ft=t=>ut[15&t],gt=t=>ut[(240&t)>>4]+ut[15&t],pt=t=>(240&t)>>4==(15&t);function mt(t){return t+.5|0}const bt=(t,e,i)=>Math.max(Math.min(t,i),e);function xt(t){return bt(mt(2.55*t),0,255)}function yt(t){return bt(mt(255*t),0,255)}function vt(t){return bt(mt(t/2.55)/100,0,1)}function _t(t){return bt(mt(100*t),0,100)}const wt=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/,Mt=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Ot(t,e,i){const n=e*Math.min(i,1-i),s=(e,s=(e+t/30)%12)=>i-n*Math.max(Math.min(s-3,9-s,1),-1);return[s(0),s(8),s(4)]}function kt(t,e,i){const n=(n,s=(n+t/60)%6)=>i-i*e*Math.max(Math.min(s,4-s,1),0);return[n(5),n(3),n(1)]}function St(t,e,i){const n=Ot(t,1,.5);let s;for(e+i>1&&(s=1/(e+i),e*=s,i*=s),s=0;s<3;s++)n[s]*=1-e-i,n[s]+=e;return n}function Dt(t){const e=t.r/255,i=t.g/255,n=t.b/255,s=Math.max(e,i,n),r=Math.min(e,i,n),o=(s+r)/2;let a,l,c;return s!==r&&(c=s-r,l=o>.5?c/(2-s-r):c/(s+r),a=s===e?(i-n)/c+(i=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=yt(t[3]))):(e=Rt(t,{r:0,g:0,b:0,a:1})).a=yt(e.a),e}function zt(t){return"r"===t.charAt(0)?function(t){const e=wt.exec(t);let i,n,s,r=255;if(e){if(e[7]!==i){const t=+e[7];r=255&(e[8]?xt(t):255*t)}return i=+e[1],n=+e[3],s=+e[5],i=255&(e[2]?xt(i):i),n=255&(e[4]?xt(n):n),s=255&(e[6]?xt(s):s),{r:i,g:n,b:s,a:r}}}(t):function(t){const e=Mt.exec(t);let i,n=255;if(!e)return;e[5]!==i&&(n=e[6]?xt(+e[5]):yt(+e[5]));const s=Tt(+e[2]),r=+e[3]/100,o=+e[4]/100;return i="hwb"===e[1]?function(t,e,i){return Pt(St,t,e,i)}(s,r,o):"hsv"===e[1]?function(t,e,i){return Pt(kt,t,e,i)}(s,r,o):Ct(s,r,o),{r:i[0],g:i[1],b:i[2],a:n}}(t)}class It{constructor(t){if(t instanceof It)return t;const e=typeof t;let i;var n,s,r;"object"===e?i=Ft(t):"string"===e&&(r=(n=t).length,"#"===n[0]&&(4===r||5===r?s={r:255&17*dt[n[1]],g:255&17*dt[n[2]],b:255&17*dt[n[3]],a:5===r?17*dt[n[4]]:255}:7!==r&&9!==r||(s={r:dt[n[1]]<<4|dt[n[2]],g:dt[n[3]]<<4|dt[n[4]],b:dt[n[5]]<<4|dt[n[6]],a:9===r?dt[n[7]]<<4|dt[n[8]]:255})),i=s||function(t){At||(At=function(){const t={},e=Object.keys(jt),i=Object.keys(Et);let n,s,r,o,a;for(n=0;n>16&255,r>>8&255,255&r]}return t}(),At.transparent=[0,0,0,0]);const e=At[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}(t)||zt(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Rt(this._rgb);return t&&(t.a=vt(t.a)),t}set rgb(t){this._rgb=Ft(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${vt(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):this._rgb;var t}hexString(){return this._valid?(t=this._rgb,e=function(t){return pt(t.r)&&pt(t.g)&&pt(t.b)&&pt(t.a)}(t)?ft:gt,t?"#"+e(t.r)+e(t.g)+e(t.b)+(t.a<255?e(t.a):""):t):this._rgb;var t,e}hslString(){return this._valid?function(t){if(!t)return;const e=Dt(t),i=e[0],n=_t(e[1]),s=_t(e[2]);return t.a<255?`hsla(${i}, ${n}%, ${s}%, ${vt(t.a)})`:`hsl(${i}, ${n}%, ${s}%)`}(this._rgb):this._rgb}mix(t,e){const i=this;if(t){const n=i.rgb,s=t.rgb;let r;const o=e===r?.5:e,a=2*o-1,l=n.a-s.a,c=((a*l==-1?a:(a+l)/(1+a*l))+1)/2;r=1-c,n.r=255&c*n.r+r*s.r+.5,n.g=255&c*n.g+r*s.g+.5,n.b=255&c*n.b+r*s.b+.5,n.a=o*n.a+(1-o)*s.a,i.rgb=n}return i}clone(){return new It(this.rgb)}alpha(t){return this._rgb.a=yt(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=mt(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Lt(this._rgb,2,t),this}darken(t){return Lt(this._rgb,2,-t),this}saturate(t){return Lt(this._rgb,1,t),this}desaturate(t){return Lt(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=Dt(t);i[0]=Tt(i[0]+e),i=Ct(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}function Nt(t){return new It(t)}const Vt=t=>t instanceof CanvasGradient||t instanceof CanvasPattern;function Wt(t){return Vt(t)?t:Nt(t)}function Bt(t){return Vt(t)?t:Nt(t).saturate(.5).darken(.1).hexString()}const Ht=Object.create(null),Ut=Object.create(null);function Yt(t,e){if(!e)return t;const i=e.split(".");for(let e=0,n=i.length;et.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>Bt(e.backgroundColor),this.hoverBorderColor=(t,e)=>Bt(e.borderColor),this.hoverColor=(t,e)=>Bt(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t)}set(t,e){return $t(this,t,e)}get(t){return Yt(this,t)}describe(t,e){return $t(Ut,t,e)}override(t,e){return $t(Ht,t,e)}route(t,e,i,n){const s=Yt(this,t),r=Yt(this,i),o="_"+e;Object.defineProperties(s,{[o]:{value:s[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[o],e=r[n];return b(t)?Object.assign({},e,t):v(t,e)},set(t){this[o]=t}}})}}({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function qt(t,e,i,n,s){let r=e[s];return r||(r=e[s]=t.measureText(s).width,i.push(s)),r>n&&(n=r),n}function Gt(t,e,i,n){let s=(n=n||{}).data=n.data||{},r=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(s=n.data={},r=n.garbageCollect=[],n.font=e),t.save(),t.font=e;let o=0;const a=i.length;let l,c,h,d,u;for(l=0;li.length){for(l=0;l0&&t.stroke()}}function Jt(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.xe.top-i&&t.y0&&""!==r.strokeColor;let l,c;for(t.save(),t.font=s.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),p(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,r),l=0;lv(t[i],t[e[i]]):e=>t[e]:()=>t;for(const t of s)i[t]=+r(t)||0;return i}function de(t){return he(t,{top:"y",right:"x",bottom:"y",left:"x"})}function ue(t){return he(t,["topLeft","topRight","bottomLeft","bottomRight"])}function fe(t){const e=de(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function ge(t,e){t=t||{},e=e||Xt.font;let i=v(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let n=v(t.style,e.style);n&&!(""+n).match(le)&&(console.warn('Invalid font style specified: "'+n+'"'),n="");const s={family:v(t.family,e.family),lineHeight:ce(v(t.lineHeight,e.lineHeight),i),size:i,style:n,weight:v(t.weight,e.weight),string:""};return s.string=function(t){return!t||p(t.size)||p(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(s),s}function pe(t,e,i,n){let s,r,o,a=!0;for(s=0,r=t.length;st[i]1;)n=r+s>>1,i(n)?r=n:s=n;return{lo:r,hi:s}}const xe=(t,e,i)=>be(t,i,n=>t[n][e]be(t,i,n=>t[n][e]>=i),ve=["push","pop","shift","splice","unshift"];function _e(t,e){const i=t._chartjs;if(!i)return;const n=i.listeners,s=n.indexOf(e);-1!==s&&n.splice(s,1),n.length>0||(ve.forEach(e=>{delete t[e]}),delete t._chartjs)}function we(t){const e=new Set;let i,n;for(i=0,n=t.length;it[0])){L(n)||(n=Le("_fallback",t));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:i,_fallback:n,_getTarget:s,override:s=>Me([s,...t],e,i,n)};return new Proxy(r,{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,n)=>Pe(i,n,()=>function(t,e,i,n){let s;for(const r of e)if(s=Le(Se(r,t),i),L(s))return De(t,s)?je(i,n,t,s):s}(n,e,t,i)),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>Re(t).includes(e),ownKeys:t=>Re(t),set(t,e,i){const n=t._storage||(t._storage=s());return t[e]=n[e]=i,delete t._keys,!0}})}function Oe(t,e,i,n){const s={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:ke(t,n),setContext:e=>Oe(t,e,i,n),override:s=>Oe(t.override(s),e,i,n)};return new Proxy(s,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>Pe(t,e,()=>function(t,e,i){const{_proxy:n,_context:s,_subProxy:r,_descriptors:o}=t;let a=n[e];return R(a)&&o.isScriptable(e)&&(a=function(t,e,i,n){const{_proxy:s,_context:r,_subProxy:o,_stack:a}=i;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);return a.add(t),e=e(r,o||n),a.delete(t),De(t,e)&&(e=je(s._scopes,s,t,e)),e}(e,a,t,i)),m(a)&&a.length&&(a=function(t,e,i,n){const{_proxy:s,_context:r,_subProxy:o,_descriptors:a}=i;if(L(r.index)&&n(t))e=e[r.index%e.length];else if(b(e[0])){const i=e,n=s._scopes.filter(t=>t!==i);e=[];for(const l of i){const i=je(n,s,t,l);e.push(Oe(i,r,o&&o[t],a))}}return e}(e,a,t,o.isIndexable)),De(e,a)&&(a=Oe(a,s,r&&r[e],o)),a}(t,e,i)),getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,i)=>Reflect.has(t,i),ownKeys:()=>Reflect.ownKeys(t),set:(e,i,n)=>(t[i]=n,delete e[i],!0)})}function ke(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:n=e.indexable,_allKeys:s=e.allKeys}=t;return{allKeys:s,scriptable:i,indexable:n,isScriptable:R(i)?i:()=>i,isIndexable:R(n)?n:()=>n}}const Se=(t,e)=>t?t+A(e):e,De=(t,e)=>b(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function Pe(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const n=i();return t[e]=n,n}function Ce(t,e,i){return R(t)?t(e,i):t}const Te=(t,e)=>!0===t?e:"string"==typeof t?j(e,t):void 0;function Ee(t,e,i,n,s){for(const r of e){const e=Te(i,r);if(e){t.add(e);const r=Ce(e._fallback,i,s);if(L(r)&&r!==i&&r!==n)return r}else if(!1===e&&L(n)&&i!==n)return null}return!1}function je(t,e,i,n){const s=e._rootScopes,r=Ce(e._fallback,i,n),o=[...t,...s],a=new Set;a.add(n);let l=Ae(a,o,i,r||i,n);return null!==l&&(!L(r)||r===i||(l=Ae(a,o,r,l,n),null!==l))&&Me(Array.from(a),[""],s,r,()=>function(t,e,i){const n=t._getTarget();e in n||(n[e]={});const s=n[e];return m(s)&&b(i)?i:s}(e,i,n))}function Ae(t,e,i,n,s){for(;i;)i=Ee(t,e,i,n,s);return i}function Le(t,e){for(const i of e){if(!i)continue;const e=i[t];if(L(e))return e}}function Re(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter(t=>!t.startsWith("_")))e.add(t);return Array.from(e)}(t._scopes)),e}const Fe=Number.EPSILON||1e-14,ze=(t,e)=>e"x"===t?"y":"x";function Ne(t,e,i,n){const s=t.skip?e:t,r=e,o=i.skip?e:i,a=et(r,s),l=et(o,r);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=n*c,u=n*h;return{previous:{x:r.x-d*(o.x-s.x),y:r.y-d*(o.y-s.y)},next:{x:r.x+u*(o.x-s.x),y:r.y+u*(o.y-s.y)}}}function Ve(t,e,i){return Math.max(Math.min(t,i),e)}function We(t,e,i,n,s){let r,o,a,l;if(e.spanGaps&&(t=t.filter(t=>!t.skip)),"monotone"===e.cubicInterpolationMode)!function(t,e="x"){const i=Ie(e),n=t.length,s=Array(n).fill(0),r=Array(n);let o,a,l,c=ze(t,0);for(o=0;owindow.getComputedStyle(t,null),$e=["top","right","bottom","left"];function Xe(t,e,i){const n={};i=i?"-"+i:"";for(let s=0;s<4;s++){const r=$e[s];n[r]=parseFloat(t[e+"-"+r+i])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function qe(t,e){const{canvas:i,currentDevicePixelRatio:n}=e,s=Ye(i),r="border-box"===s.boxSizing,o=Xe(s,"padding"),a=Xe(s,"border","width"),{x:l,y:c,box:h}=function(t,e){const i=t.native||t,n=i.touches,s=n&&n.length?n[0]:i,{offsetX:r,offsetY:o}=s;let a,l,c=!1;if(((t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot))(r,o,i.target))a=r,l=o;else{const t=e.getBoundingClientRect();a=s.clientX-t.left,l=s.clientY-t.top,c=!0}return{x:a,y:l,box:c}}(t,i),d=o.left+(h&&a.left),u=o.top+(h&&a.top);let{width:f,height:g}=e;return r&&(f-=o.width+a.width,g-=o.height+a.height),{x:Math.round((l-d)/f*i.width/n),y:Math.round((c-u)/g*i.height/n)}}const Ge=t=>Math.round(10*t)/10;function Qe(t,e,i){const n=e||1,s=Math.floor(t.height*n),r=Math.floor(t.width*n);t.height=s/n,t.width=r/n;const o=t.canvas;return o.style&&(i||!o.style.height&&!o.style.width)&&(o.style.height=t.height+"px",o.style.width=t.width+"px"),(t.currentDevicePixelRatio!==n||o.height!==s||o.width!==r)&&(t.currentDevicePixelRatio=n,o.height=s,o.width=r,t.ctx.setTransform(n,0,0,n,0,0),!0)}const Ke=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(t){}return t}();function Ze(t,e){const i=function(t,e){return Ye(t).getPropertyValue(e)}(t,e),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function Je(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function ti(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:"middle"===n?i<.5?t.y:e.y:"after"===n?i<1?t.y:e.y:i>0?e.y:t.y}}function ei(t,e,i,n){const s={x:t.cp2x,y:t.cp2y},r={x:e.cp1x,y:e.cp1y},o=Je(t,s,i),a=Je(s,r,i),l=Je(r,e,i),c=Je(o,a,i),h=Je(a,l,i);return Je(c,h,i)}const ii=new Map;function ni(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let n=ii.get(i);return n||(n=new Intl.NumberFormat(t,e),ii.set(i,n)),n}(e,i).format(t)}function si(t,e,i){return t?function(t,e){return{x:i=>t+t+e-i,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,i):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function ri(t){return"angle"===t?{between:st,compare:it,normalize:nt}:{between:ot,compare:(t,e)=>t-e,normalize:t=>t}}function oi({start:t,end:e,count:i,loop:n,style:s}){return{start:t%i,end:e%i,loop:n&&(e-t+1)%i==0,style:s}}function ai(t,e,i){if(!i)return[t];const{property:n,start:s,end:r}=i,o=e.length,{compare:a,between:l,normalize:c}=ri(n),{start:h,end:d,loop:u,style:f}=function(t,e,i){const{property:n,start:s,end:r}=i,{between:o,normalize:a}=ri(n),l=e.length;let c,h,{start:d,end:u,loop:f}=t;if(f){for(d+=l,u+=l,c=0,h=l;cn({chart:t,initial:e.initial,numSteps:r,currentStep:Math.min(i-e.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=h.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,n)=>{if(!i.running||!i.items.length)return;const s=i.items;let r,o=s.length-1,a=!1;for(;o>=0;--o)r=s[o],r._active?(r._total>i.duration&&(i.duration=r._total),r.tick(t),a=!0):(s[o]=s[s.length-1],s.pop());a&&(n.draw(),this._notify(n,i,t,"progress")),s.length||(i.running=!1,this._notify(n,i,t,"complete"),i.initial=!1),e+=s.length}),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((t,e)=>Math.max(t,e._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let n=i.length-1;for(;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}};const ui={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const n=Wt(t||"transparent"),s=n.valid&&Wt(e||"transparent");return s&&s.valid?s.mix(n,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class fi{constructor(t,e,i,n){const s=e[i];n=pe([t.to,n,s,t.from]);const r=pe([t.from,s,n]);this._active=!0,this._fn=t.fn||ui[t.type||typeof r],this._easing=ht[t.easing]||ht.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=r,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const n=this._target[this._prop],s=i-this._start,r=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=s,this._loop=!!t.loop,this._to=pe([t.to,e,n,t.from]),this._from=pe([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,n=this._prop,s=this._from,r=this._loop,o=this._to;let a;if(this._active=s!==o&&(r||e1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[n]=this._fn(s,o,a))}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let t=0;t"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),Xt.set("animations",{colors:{type:"color",properties:["color","borderColor","backgroundColor"]},numbers:{type:"number",properties:["x","y","borderWidth","radius","tension"]}}),Xt.describe("animations",{_fallback:"animation"}),Xt.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}});class pi{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!b(t))return;const e=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const n=t[i];if(!b(n))return;const s={};for(const t of gi)s[t]=n[t];(m(n.properties)&&n.properties||[i]).forEach(t=>{t!==i&&e.has(t)||e.set(t,s)})})}_animateOptions(t,e){const i=e.options,n=function(t,e){if(!e)return;let i=t.options;if(i)return i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i;t.options=e}(t,i);if(!n)return[];const s=this._createAnimations(n,i);return i.$shared&&function(t,e){const i=[],n=Object.keys(e);for(let e=0;e{t.options=i},()=>{}),s}_createAnimations(t,e){const i=this._properties,n=[],s=t.$animations||(t.$animations={}),r=Object.keys(e),o=Date.now();let a;for(a=r.length-1;a>=0;--a){const l=r[a];if("$"===l.charAt(0))continue;if("options"===l){n.push(...this._animateOptions(t,e));continue}const c=e[l];let h=s[l];const d=i.get(l);if(h){if(d&&h.active()){h.update(d,c,o);continue}h.cancel()}d&&d.duration?(s[l]=h=new fi(d,t,l,c),n.push(h)):t[l]=c}return n}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(di.add(this._chart,i),!0):void 0}}function mi(t,e){const i=t&&t.options||{},n=i.reverse,s=void 0===i.min?e:0,r=void 0===i.max?e:0;return{start:n?r:s,end:n?s:r}}function bi(t,e){const i=[],n=t._getSortedDatasetMetas(e);let s,r;for(s=0,r=n.length;s0||!i&&e<0)return s.index}return null}function wi(t,e){const{chart:i,_cachedMeta:n}=t,s=i._stacks||(i._stacks={}),{iScale:r,vScale:o,index:a}=n,l=r.axis,c=o.axis,h=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(r,o,n),d=e.length;let u;for(let t=0;ti[t].axis===e).shift()}function Oi(t,e){const i=t.controller.index,n=t.vScale&&t.vScale.axis;if(n){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[n]||void 0===e[n][i])return;delete e[n][i]}}}const ki=t=>"reset"===t||"none"===t,Si=(t,e)=>e?t:Object.assign({},t);class Di{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=yi(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&Oi(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=(t,e,i,n)=>"x"===t?e:"r"===t?n:i,s=e.xAxisID=v(i.xAxisID,Mi(t,"x")),r=e.yAxisID=v(i.yAxisID,Mi(t,"y")),o=e.rAxisID=v(i.rAxisID,Mi(t,"r")),a=e.indexAxis,l=e.iAxisID=n(a,s,r,o),c=e.vAxisID=n(a,r,s,o);e.xScale=this.getScaleForId(s),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(o),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&_e(this._data,this),t._stacked&&Oi(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(b(e))this._data=function(t){const e=Object.keys(t),i=new Array(e.length);let n,s,r;for(n=0,s=e.length;n{const e="_onData"+A(t),i=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...t){const s=i.apply(this,t);return n._chartjs.listeners.forEach(i=>{"function"==typeof i[e]&&i[e](...t)}),s}})}))),this._syncList=[],this._data=e}var n}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let n=!1;this._dataCheck();const s=e._stacked;e._stacked=yi(e.vScale,e),e.stack!==i.stack&&(n=!0,Oi(e),e.stack=i.stack),this._resyncElements(t),(n||s!==e._stacked)&&wi(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:n}=this,{iScale:s,_stacked:r}=i,o=s.axis;let a,l,c,h=0===t&&e===n.length||i._sorted,d=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=n,i._sorted=!0,c=n;else{c=m(n[t])?this.parseArrayData(i,n,t,e):b(n[t])?this.parseObjectData(i,n,t,e):this.parsePrimitiveData(i,n,t,e);const s=()=>null===l[o]||d&&l[o]t&&!e.hidden&&e._stacked&&{keys:bi(i,!0),values:null})(e,i,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:h}=function(t){const{min:e,max:i,minDefined:n,maxDefined:s}=t.getUserBounds();return{min:n?e:Number.NEGATIVE_INFINITY,max:s?i:Number.POSITIVE_INFINITY}}(o);let d,u;function f(){u=n[d];const e=u[o.axis];return!x(u[t.axis])||c>e||h=0;--d)if(!f()){this.updateRangeFromParsed(l,t,u,a);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let n,s,r;for(n=0,s=e.length;n=0&&tthis.getContext(i,n),h);return f.$shared&&(f.$shared=a,s[r]=Object.freeze(Si(f,a))),f}_resolveAnimations(t,e,i){const n=this.chart,s=this._cachedDataOpts,r="animation-"+e,o=s[r];if(o)return o;let a;if(!1!==n.options.animation){const n=this.chart.config,s=n.datasetAnimationScopeKeys(this._type,e),r=n.getOptionScopes(this.getDataset(),s);a=n.createResolver(r,this.getContext(t,i,e))}const l=new pi(n,a&&a.animations);return a&&a._cacheable&&(s[r]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||ki(t)||this.chart._animationsDisabled}updateElement(t,e,i,n){ki(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!ki(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;const s=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(s)||s})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];const n=i.length,s=e.length,r=Math.min(s,n);r&&this.parse(0,r),s>n?this._insertElements(n,s-n,t):s{for(t.length+=e,o=t.length-1;o>=r;o--)t[o]=t[o-e]};for(a(s),o=t;ot-e))}return t._cache.$bar}(e,t.type);let n,s,r,o,a=e._length;const l=()=>{32767!==r&&-32768!==r&&(L(o)&&(a=Math.min(a,Math.abs(r-o)||a)),o=r)};for(n=0,s=i.length;nMath.abs(a)&&(l=a,c=o),e[i.axis]=c,e._custom={barStart:l,barEnd:c,start:s,end:r,min:o,max:a}}(t,e,i,n):e[i.axis]=i.parse(t,n),e}function Ti(t,e,i,n){const s=t.iScale,r=t.vScale,o=s.getLabels(),a=s===r,l=[];let c,h,d,u;for(c=i,h=i+n;ct.x,i="left",n="right"):(e=t.base=i?1:-1)}(h,e,r)*s,d===r&&(m-=h/2),c=m+h),m===e.getPixelForValue(r)){const t=$(h)*e.getLineWidthForValue(r)/2;m+=t,h-=t}return{size:h,base:m,head:c,center:c+h/2}}_calculateBarIndexPixels(t,e){const i=e.scale,n=this.options,s=n.skipNull,r=v(n.maxBarThickness,1/0);let o,a;if(e.grouped){const i=s?this._getStackCount(t):e.stackCount,l="flex"===n.barThickness?function(t,e,i,n){const s=e.pixels,r=s[t];let o=t>0?s[t-1]:null,a=t=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,{xScale:i,yScale:n}=e,s=this.getParsed(t),r=i.getLabelForValue(s.x),o=n.getLabelForValue(s.y),a=s._custom;return{label:e.label,value:"("+r+", "+o+(a?", "+a:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,n){const s="reset"===n,{iScale:r,vScale:o}=this._cachedMeta,a=this.resolveDataElementOptions(e,n),l=this.getSharedOptions(a),c=this.includeOptions(n,l),h=r.axis,d=o.axis;for(let a=e;a""}}}};class Ii extends Di{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,n=this._cachedMeta;if(!1===this._parsing)n._parsed=i;else{let s,r,o=t=>+i[t];if(b(i[t])){const{key:t="value"}=this._parsing;o=e=>+j(i[e],t)}for(s=t,r=t+e;sst(t,a,l,!0)?1:Math.max(e,e*i,n,n*i),g=(t,e,n)=>st(t,a,l,!0)?-1:Math.min(e,e*i,n,n*i),p=f(0,c,d),m=f(B,h,u),b=g(z,c,d),x=g(z+B,h,u);n=(p-b)/2,s=(m-x)/2,r=-(p+b)/2,o=-(m+x)/2}return{ratioX:n,ratioY:s,offsetX:r,offsetY:o}}(u,d,a),b=(i.width-r)/f,x=(i.height-r)/g,y=Math.max(Math.min(b,x)/2,0),v=_(this.options.radius,y),w=(v-Math.max(v*a,0))/this._getVisibleDatasetWeightTotal();this.offsetX=p*v,this.offsetY=m*v,n.total=this.calculateTotal(),this.outerRadius=v-w*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-w*h,0),this.updateElements(s,0,s.length,t)}_circumference(t,e){const i=this.options,n=this._cachedMeta,s=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===n._parsed[t]||n.data[t].hidden?0:this.calculateCircumference(n._parsed[t]*s/I)}updateElements(t,e,i,n){const s="reset"===n,r=this.chart,o=r.chartArea,a=r.options.animation,l=(o.left+o.right)/2,c=(o.top+o.bottom)/2,h=s&&a.animateScale,d=h?0:this.innerRadius,u=h?0:this.outerRadius,f=this.resolveDataElementOptions(e,n),g=this.getSharedOptions(f),p=this.includeOptions(n,g);let m,b=this._getRotation();for(m=0;m0&&!isNaN(t)?I*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],s=ni(e._parsed[t],i.options.locale);return{label:n[t]||"",value:s}}getMaxBorderWidth(t){let e=0;const i=this.chart;let n,s,r,o,a;if(!t)for(n=0,s=i.data.datasets.length;n"spacing"!==t,_indexable:t=>"spacing"!==t},Ii.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map((e,n)=>{const s=t.getDatasetMeta(0).controller.getStyle(n);return{text:e,fillStyle:s.backgroundColor,strokeStyle:s.borderColor,lineWidth:s.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label(t){let e=t.label;const i=": "+t.formattedValue;return m(e)?(e=e.slice(),e[0]+=i):e+=i,e}}}}};class Ni extends Di{initialize(){this.enableOptionSharing=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:n=[],_dataset:s}=e,r=this.chart._animationsDisabled;let{start:o,count:a}=function(t,e,i){const n=e.length;let s=0,r=n;if(t._sorted){const{iScale:o,_parsed:a}=t,l=o.axis,{min:c,max:h,minDefined:d,maxDefined:u}=o.getUserBounds();d&&(s=rt(Math.min(xe(a,o.axis,c).lo,i?n:xe(e,l,o.getPixelForValue(c)).lo),0,n-1)),r=u?rt(Math.max(xe(a,o.axis,h).hi+1,i?0:xe(e,l,o.getPixelForValue(h)).hi+1),s,n)-s:n-s}return{start:s,count:r}}(e,n,r);this._drawStart=o,this._drawCount=a,function(t){const{xScale:e,yScale:i,_scaleRanges:n}=t,s={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!n)return t._scaleRanges=s,!0;const r=n.xmin!==e.min||n.xmax!==e.max||n.ymin!==i.min||n.ymax!==i.max;return Object.assign(n,s),r}(e)&&(o=0,a=n.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!s._decimated,i.points=n;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!r,options:l},t),this.updateElements(n,o,a,t)}updateElements(t,e,i,n){const s="reset"===n,{iScale:r,vScale:o,_stacked:a,_dataset:l}=this._cachedMeta,c=this.resolveDataElementOptions(e,n),h=this.getSharedOptions(c),d=this.includeOptions(n,h),u=r.axis,f=o.axis,{spanGaps:g,segment:m}=this.options,b=q(g)?g:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||s||"none"===n;let y=e>0&&this.getParsed(e-1);for(let c=e;c0&&i[u]-y[u]>b,m&&(g.parsed=i,g.raw=l.data[c]),d&&(g.options=h||this.resolveDataElementOptions(c,e.active?"active":n)),x||this.updateElement(e,c,g,n),y=i}this.updateSharedOptions(h,n,c)}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return i;const s=n[0].size(this.resolveDataElementOptions(0)),r=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,s,r)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}Ni.id="line",Ni.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},Ni.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class Vi extends Di{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],s=ni(e._parsed[t].r,i.options.locale);return{label:n[t]||"",value:s}}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),s=Math.max(n/2,0),r=(s-Math.max(i.cutoutPercentage?s/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=s-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(t,e,i,n){const s="reset"===n,r=this.chart,o=this.getDataset(),a=r.options.animation,l=this._cachedMeta.rScale,c=l.xCenter,h=l.yCenter,d=l.getIndexAngle(0)-.5*z;let u,f=d;const g=360/this.countVisibleElements();for(u=0;u{!isNaN(t.data[n])&&this.chart.getDataVisibility(n)&&i++}),i}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?K(this.resolveDataElementOptions(t,e).angle||i):0}}Vi.id="polarArea",Vi.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},Vi.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map((e,n)=>{const s=t.getDatasetMeta(0).controller.getStyle(n);return{text:e,fillStyle:s.backgroundColor,strokeStyle:s.borderColor,lineWidth:s.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label:t=>t.chart.data.labels[t.dataIndex]+": "+t.formattedValue}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class Wi extends Ii{}Wi.id="pie",Wi.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Bi extends Di{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}update(t){const e=this._cachedMeta,i=e.dataset,n=e.data||[],s=e.iScale.getLabels();if(i.points=n,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const r={_loop:!0,_fullLoop:s.length===n.length,options:e};this.updateElement(i,void 0,r,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,i,n){const s=this.getDataset(),r=this._cachedMeta.rScale,o="reset"===n;for(let a=e;a"",label:t=>"("+t.label+", "+t.formattedValue+")"}}},scales:{x:{type:"linear"},y:{type:"linear"}}};class Yi{constructor(t){this.options=t||{}}formats(){return Ui()}parse(t,e){return Ui()}format(t,e){return Ui()}add(t,e,i){return Ui()}diff(t,e,i){return Ui()}startOf(t,e,i){return Ui()}endOf(t,e){return Ui()}}Yi.override=function(t){Object.assign(Yi.prototype,t)};var $i={_date:Yi};function Xi(t,e){return"native"in t?{x:t.x,y:t.y}:qe(t,e)}function qi(t,e,i,n){const{controller:s,data:r,_sorted:o}=t,a=s._cachedMeta.iScale;if(a&&e===a.axis&&"r"!==e&&o&&r.length){const t=a._reversePixels?ye:xe;if(!n)return t(r,e,i);if(s._sharedOptions){const n=r[0],s="function"==typeof n.getRange&&n.getRange(e);if(s){const n=t(r,e,i-s),o=t(r,e,i+s);return{lo:n.lo,hi:o.hi}}}}return{lo:0,hi:r.length-1}}function Gi(t,e,i,n,s){const r=t.getSortedVisibleDatasetMetas(),o=i[e];for(let t=0,i=r.length;t{t[a](s[o],n)&&r.push({element:t,datasetIndex:e,index:i}),t.inRange(s.x,s.y,n)&&(l=!0)}),i.intersect&&!l?[]:r}var Ji={modes:{index(t,e,i,n){const s=Xi(e,t),r=i.axis||"x",o=i.intersect?Qi(t,s,r,n):Ki(t,s,r,!1,n),a=[];return o.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{const e=o[0].index,i=t.data[e];i&&!i.skip&&a.push({element:i,datasetIndex:t.index,index:e})}),a):[]},dataset(t,e,i,n){const s=Xi(e,t),r=i.axis||"xy";let o=i.intersect?Qi(t,s,r,n):Ki(t,s,r,!1,n);if(o.length>0){const e=o[0].datasetIndex,i=t.getDatasetMeta(e).data;o=[];for(let t=0;tQi(t,Xi(e,t),i.axis||"xy",n),nearest:(t,e,i,n)=>Ki(t,Xi(e,t),i.axis||"xy",i.intersect,n),x:(t,e,i,n)=>Zi(t,e,{axis:"x",intersect:i.intersect},n),y:(t,e,i,n)=>Zi(t,e,{axis:"y",intersect:i.intersect},n)}};const tn=["left","top","right","bottom"];function en(t,e){return t.filter(t=>t.pos===e)}function nn(t,e){return t.filter(t=>-1===tn.indexOf(t.pos)&&t.box.axis===e)}function sn(t,e){return t.sort((t,i)=>{const n=e?i:t,s=e?t:i;return n.weight===s.weight?n.index-s.index:n.weight-s.weight})}function rn(t,e,i,n){return Math.max(t[i],e[i])+Math.max(t[n],e[n])}function on(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function an(t,e,i,n){const{pos:s,box:r}=i,o=t.maxPadding;if(!b(s)){i.size&&(t[s]-=i.size);const e=n[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?r.height:r.width),i.size=e.size/e.count,t[s]+=i.size}r.getPadding&&on(o,r.getPadding());const a=Math.max(0,e.outerWidth-rn(o,t,"left","right")),l=Math.max(0,e.outerHeight-rn(o,t,"top","bottom")),c=a!==t.w,h=l!==t.h;return t.w=a,t.h=l,i.horizontal?{same:c,other:h}:{same:h,other:c}}function ln(t,e){const i=e.maxPadding;return function(t){const n={left:0,top:0,right:0,bottom:0};return t.forEach(t=>{n[t]=Math.max(e[t],i[t])}),n}(t?["left","right"]:["top","bottom"])}function cn(t,e,i,n){const s=[];let r,o,a,l,c,h;for(r=0,o=t.length,c=0;rt.box.fullSize),!0),n=sn(en(e,"left"),!0),s=sn(en(e,"right")),r=sn(en(e,"top"),!0),o=sn(en(e,"bottom")),a=nn(e,"x"),l=nn(e,"y");return{fullSize:i,leftAndTop:n.concat(r),rightAndBottom:s.concat(l).concat(o).concat(a),chartArea:en(e,"chartArea"),vertical:n.concat(s).concat(l),horizontal:r.concat(o).concat(a)}}(t.boxes),l=a.vertical,c=a.horizontal;M(t.boxes,t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()});const h=l.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1,d=Object.freeze({outerWidth:e,outerHeight:i,padding:s,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/h,hBoxMaxHeight:o/2}),u=Object.assign({},s);on(u,fe(n));const f=Object.assign({maxPadding:u,w:r,h:o,x:s.left,y:s.top},s),g=function(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:n,stackWeight:s}=i;if(!t||!tn.includes(n))continue;const r=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=s}return e}(t),{vBoxMaxWidth:n,hBoxMaxHeight:s}=e;let r,o,a;for(r=0,o=t.length;r{const i=e.box;Object.assign(i,t.chartArea),i.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class fn{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}isAttached(t){return!0}updateConfig(t){}}class gn extends fn{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const pn={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},mn=t=>null===t||""===t,bn=!!Ke&&{passive:!0};function xn(t,e,i){t.canvas.removeEventListener(e,i,bn)}function yn(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function vn(t,e,i){const n=t.canvas,s=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||yn(i.addedNodes,n),e=e&&!yn(i.removedNodes,n);e&&i()});return s.observe(document,{childList:!0,subtree:!0}),s}function wn(t,e,i){const n=t.canvas,s=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||yn(i.removedNodes,n),e=e&&!yn(i.addedNodes,n);e&&i()});return s.observe(document,{childList:!0,subtree:!0}),s}const Mn=new Map;let On=0;function kn(){const t=window.devicePixelRatio;t!==On&&(On=t,Mn.forEach((e,i)=>{i.currentDevicePixelRatio!==t&&e()}))}function Sn(t,e,i){const n=t.canvas,s=n&&He(n);if(!s)return;const r=d((t,e)=>{const n=s.clientWidth;i(t,e),n{const e=t[0],i=e.contentRect.width,n=e.contentRect.height;0===i&&0===n||r(i,n)});return o.observe(s),function(t,e){Mn.size||window.addEventListener("resize",kn),Mn.set(t,e)}(t,r),o}function Dn(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){Mn.delete(t),Mn.size||window.removeEventListener("resize",kn)}(t)}function Pn(t,e,i){const n=t.canvas,s=d(e=>{null!==t.ctx&&i(function(t,e){const i=pn[t.type]||t.type,{x:n,y:s}=qe(t,e);return{type:i,chart:e,native:t,x:void 0!==n?n:null,y:void 0!==s?s:null}}(e,t))},t,t=>{const e=t[0];return[e,e.offsetX,e.offsetY]});return function(t,e,i){t.addEventListener(e,i,bn)}(n,e,s),s}class Cn extends fn{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,n=t.getAttribute("height"),s=t.getAttribute("width");if(t.$chartjs={initial:{height:n,width:s,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",mn(s)){const e=Ze(t,"width");void 0!==e&&(t.width=e)}if(mn(n))if(""===t.style.height)t.height=t.width/(e||2);else{const e=Ze(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e.$chartjs)return!1;const i=e.$chartjs.initial;["height","width"].forEach(t=>{const n=i[t];p(n)?e.removeAttribute(t):e.setAttribute(t,n)});const n=i.style||{};return Object.keys(n).forEach(t=>{e.style[t]=n[t]}),e.width=e.width,delete e.$chartjs,!0}addEventListener(t,e,i){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),s={attach:vn,detach:wn,resize:Sn}[e]||Pn;n[e]=s(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),n=i[e];n&&(({attach:Dn,detach:Dn,resize:Dn}[e]||xn)(t,e,n),i[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return function(t,e,i,n){const s=Ye(t),r=Xe(s,"margin"),o=Ue(s.maxWidth,t,"clientWidth")||V,a=Ue(s.maxHeight,t,"clientHeight")||V,l=function(t,e,i){let n,s;if(void 0===e||void 0===i){const r=He(t);if(r){const t=r.getBoundingClientRect(),o=Ye(r),a=Xe(o,"border","width"),l=Xe(o,"padding");e=t.width-l.width-a.width,i=t.height-l.height-a.height,n=Ue(o.maxWidth,r,"clientWidth"),s=Ue(o.maxHeight,r,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:n||V,maxHeight:s||V}}(t,e,i);let{width:c,height:h}=l;if("content-box"===s.boxSizing){const t=Xe(s,"border","width"),e=Xe(s,"padding");c-=e.width+t.width,h-=e.height+t.height}return c=Math.max(0,c-r.width),h=Math.max(0,n?Math.floor(c/n):h-r.height),c=Ge(Math.min(c,o,l.maxWidth)),h=Ge(Math.min(h,a,l.maxHeight)),c&&!h&&(h=Ge(c/2)),{width:c,height:h}}(t,e,i,n)}isAttached(t){const e=He(t);return!(!e||!e.isConnected)}}class Tn{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return q(this.x)&&q(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const n={};return t.forEach(t=>{n[t]=i[t]&&i[t].active()?i[t]._to:this[t]}),n}}Tn.defaults={},Tn.defaultRoutes=void 0;const En={values:t=>m(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";const n=this.chart.options.locale;let s,r=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(s="scientific"),r=function(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t)),i}(t,i)}const o=Y(Math.abs(r)),a=Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),ni(t,n,l)},logarithmic(t,e,i){if(0===t)return"0";const n=t/Math.pow(10,Math.floor(Y(t)));return 1===n||2===n||5===n?En.numeric.call(this,t,e,i):""}};var jn={formatters:En};function An(t,e,i,n,s){const r=v(n,0),o=Math.min(v(s,t.length),t.length);let a,l,c,h=0;for(i=Math.ceil(i),s&&(a=s-n,i=a/Math.floor(a/i)),c=r;c<0;)h++,c=Math.round(r+h*i);for(l=Math.max(r,0);le.lineWidth,tickColor:(t,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:jn.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),Xt.route("scale.ticks","color","","color"),Xt.route("scale.grid","color","","borderColor"),Xt.route("scale.grid","borderColor","","borderColor"),Xt.route("scale.title","color","","color"),Xt.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t}),Xt.describe("scales",{_fallback:"scale"}),Xt.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t});const Ln=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i;function Rn(t,e){const i=[],n=t.length/e,s=t.length;let r=0;for(;ro+1e-6)))return l}function zn(t){return t.drawTicks?t.tickLength:0}function In(t,e){if(!t.display)return 0;const i=ge(t.font,e),n=fe(t.padding);return(m(t.text)?t.text.length:1)*i.lineHeight+n.height}function Nn(t,e,i){let n=(t=>"start"===t?"left":"end"===t?"right":"center")(t);return(i&&"right"!==e||!i&&"right"===e)&&(n=(t=>"left"===t?"right":"right"===t?"left":t)(n)),n}class Vn extends Tn{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:n}=this;return t=y(t,Number.POSITIVE_INFINITY),e=y(e,Number.NEGATIVE_INFINITY),i=y(i,Number.POSITIVE_INFINITY),n=y(n,Number.NEGATIVE_INFINITY),{min:y(t,i),max:y(e,n),minDefined:x(t),maxDefined:x(e)}}getMinMax(t){let e,{min:i,max:n,minDefined:s,maxDefined:r}=this.getUserBounds();if(s&&r)return{min:i,max:n};const o=this.getMatchingVisibleMetas();for(let a=0,l=o.length;an?n:i,n=s&&i>n?i:n,{min:y(i,y(n,i)),max:y(n,y(i,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){w(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:n,grace:s,ticks:r}=this.options,o=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(t,e,i){const{min:n,max:s}=t,r=_(e,(s-n)/2),o=(t,e)=>i&&0===t?0:t+e;return{min:o(n,-Math.abs(r)),max:o(s,r)}}(this,s,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=on)return function(t,e,i,n){let s,r=0,o=i[0];for(n=Math.ceil(n),s=0;st-e).pop(),e}(n);for(let t=0,e=r.length-1;ts)return e}return Math.max(s,1)}(s,e,n);if(r>0){let t,i;const n=r>1?Math.round((a-o)/(r-1)):null;for(An(e,l,c,p(n)?0:o-n,o),t=0,i=r-1;t=s||i<=1||!this.isHorizontal())return void(this.labelRotation=n);const c=this._getLabelSizes(),h=c.widest.width,d=c.highest.height,u=rt(this.chart.width-h,0,this.maxWidth);r=t.offset?this.maxWidth/i:u/(i-1),h+6>r&&(r=u/(i-(t.offset?.5:1)),o=this.maxHeight-zn(t.grid)-e.padding-In(t.title,this.chart.options.font),a=Math.sqrt(h*h+d*d),l=Z(Math.min(Math.asin(rt((c.highest.height+6)/r,-1,1)),Math.asin(rt(o/a,-1,1))-Math.asin(rt(d/a,-1,1)))),l=Math.max(n,Math.min(s,l))),this.labelRotation=l}afterCalculateLabelRotation(){w(this.options.afterCalculateLabelRotation,[this])}beforeFit(){w(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:n,grid:s}}=this,r=this._isVisible(),o=this.isHorizontal();if(r){const r=In(n,e.options.font);if(o?(t.width=this.maxWidth,t.height=zn(s)+r):(t.height=this.maxHeight,t.width=zn(s)+r),i.display&&this.ticks.length){const{first:e,last:n,widest:s,highest:r}=this._getLabelSizes(),a=2*i.padding,l=K(this.labelRotation),c=Math.cos(l),h=Math.sin(l);if(o){const e=i.mirror?0:h*s.width+c*r.height;t.height=Math.min(this.maxHeight,t.height+e+a)}else{const e=i.mirror?0:c*s.width+h*r.height;t.width=Math.min(this.maxWidth,t.width+e+a)}this._calculatePadding(e,n,h,c)}}this._handleMargins(),o?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,n){const{ticks:{align:s,padding:r},position:o}=this.options,a=0!==this.labelRotation,l="top"!==o&&"x"===this.axis;if(this.isHorizontal()){const o=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,d=0;a?l?(h=n*t.width,d=i*e.height):(h=i*t.height,d=n*e.width):"start"===s?d=e.width:"end"===s?h=t.width:(h=t.width/2,d=e.width/2),this.paddingLeft=Math.max((h-o+r)*this.width/(this.width-o),0),this.paddingRight=Math.max((d-c+r)*this.width/(this.width-c),0)}else{let i=e.height/2,n=t.height/2;"start"===s?(i=0,n=t.height):"end"===s&&(i=e.height,n=0),this.paddingTop=i+r,this.paddingBottom=n+r}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){w(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e{const i=t.gc,n=i.length/2;let s;if(n>e){for(s=0;s({width:s[t]||0,height:r[t]||0});return{first:O(0),last:O(e-1),widest:O(_),highest:O(w),widths:s,heights:r}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return rt(this._alignToPixels?Qt(this.chart,e,0):e,-32768,32767)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&to*n?o/i:a/n:a*n0}_computeGridLineItems(t){const e=this.axis,i=this.chart,n=this.options,{grid:s,position:r}=n,o=s.offset,a=this.isHorizontal(),l=this.ticks.length+(o?1:0),c=zn(s),h=[],d=s.setContext(this.getContext()),u=d.drawBorder?d.borderWidth:0,f=u/2,g=function(t){return Qt(i,t,u)};let p,m,x,y,_,w,M,O,k,S,D,P;if("top"===r)p=g(this.bottom),w=this.bottom-c,O=p-f,S=g(t.top)+f,P=t.bottom;else if("bottom"===r)p=g(this.top),S=t.top,P=g(t.bottom)-f,w=p+f,O=this.top+c;else if("left"===r)p=g(this.right),_=this.right-c,M=p-f,k=g(t.left)+f,D=t.right;else if("right"===r)p=g(this.left),k=t.left,D=g(t.right)-f,_=p+f,M=this.left+c;else if("x"===e){if("center"===r)p=g((t.top+t.bottom)/2+.5);else if(b(r)){const t=Object.keys(r)[0],e=r[t];p=g(this.chart.scales[t].getPixelForValue(e))}S=t.top,P=t.bottom,w=p+f,O=w+c}else if("y"===e){if("center"===r)p=g((t.left+t.right)/2);else if(b(r)){const t=Object.keys(r)[0],e=r[t];p=g(this.chart.scales[t].getPixelForValue(e))}_=p-f,M=_-c,k=t.left,D=t.right}const C=v(n.ticks.maxTicksLimit,l),T=Math.max(1,Math.ceil(l/C));for(m=0;me.value===t);return i>=0?e.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,r;const o=(t,e,n)=>{n.width&&n.color&&(i.save(),i.lineWidth=n.width,i.strokeStyle=n.color,i.setLineDash(n.borderDash||[]),i.lineDashOffset=n.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(s=0,r=n.length;s{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:i+1,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",n=[];let s,r;for(s=0,r=e.length;s{const n=i.split("."),s=n.pop(),r=[t].concat(n).join("."),o=e[i].split("."),a=o.pop(),l=o.join(".");Xt.route(r,s,l,a)})}(e,t.defaultRoutes),t.descriptors&&Xt.describe(e,t.descriptors)}(t,r,i),this.override&&Xt.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,n=this.scope;i in e&&delete e[i],n&&i in Xt[n]&&(delete Xt[n][i],this.override&&delete Ht[i])}}var Bn=new class{constructor(){this.controllers=new Wn(Di,"datasets",!0),this.elements=new Wn(Tn,"elements"),this.plugins=new Wn(Object,"plugins"),this.scales=new Wn(Vn,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(e=>{const n=i||this._getRegistryForType(e);i||n.isForType(e)||n===this.plugins&&e.id?this._exec(t,n,e):M(e,e=>{const n=i||this._getRegistryForType(e);this._exec(t,n,e)})})}_exec(t,e,i){const n=A(t);w(i["before"+n],[],i),e[t](i),w(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;et.filter(t=>!e.some(e=>t.plugin.id===e.plugin.id));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}}function Un(t,e){return e||!1!==t?!0===t?{}:t:null}function Yn(t,e,i,n){const s=t.pluginScopeKeys(e),r=t.getOptionScopes(i,s);return t.createResolver(r,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function $n(t,e){const i=Xt.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function Xn(t,e){return"x"===t||"y"===t?t:e.axis||("top"===(i=e.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0)||t.charAt(0).toLowerCase();var i}function qn(t){const e=t.options||(t.options={});e.plugins=v(e.plugins,{}),e.scales=function(t,e){const i=Ht[t.type]||{scales:{}},n=e.scales||{},s=$n(t.type,e),r=Object.create(null),o=Object.create(null);return Object.keys(n).forEach(t=>{const e=n[t];if(!b(e))return console.error("Invalid scale configuration for scale: "+t);if(e._proxy)return console.warn("Ignoring resolver passed as options for scale: "+t);const a=Xn(t,e),l=function(t,e){return t===e?"_index_":"_value_"}(a,s),c=i.scales||{};r[a]=r[a]||t,o[t]=C(Object.create(null),[{axis:a},e,c[a],c[l]])}),t.data.datasets.forEach(i=>{const s=i.type||t.type,a=i.indexAxis||$n(s,e),l=(Ht[s]||{}).scales||{};Object.keys(l).forEach(t=>{const e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,a),s=i[e+"AxisID"]||r[e]||e;o[s]=o[s]||Object.create(null),C(o[s],[{axis:e},n[s],l[t]])})}),Object.keys(o).forEach(t=>{const e=o[t];C(e,[Xt.scales[e.type],Xt.scale])}),o}(t,e)}function Gn(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const Qn=new Map,Kn=new Set;function Zn(t,e){let i=Qn.get(t);return i||(i=e(),Qn.set(t,i),Kn.add(i)),i}const Jn=(t,e,i)=>{const n=j(e,i);void 0!==n&&t.add(n)};class ts{constructor(t){this._config=function(t){return(t=t||{}).data=Gn(t.data),qn(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Gn(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),qn(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Zn(t,()=>[["datasets."+t,""]])}datasetAnimationScopeKeys(t,e){return Zn(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,"transitions."+e],["datasets."+t,""]])}datasetElementScopeKeys(t,e){return Zn(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,"datasets."+t,"elements."+e,""]])}pluginScopeKeys(t){const e=t.id;return Zn(`${this.type}-plugin-${e}`,()=>[["plugins."+e,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let n=i.get(t);return n&&!e||(n=new Map,i.set(t,n)),n}getOptionScopes(t,e,i){const{options:n,type:s}=this,r=this._cachedScopes(t,i),o=r.get(e);if(o)return o;const a=new Set;e.forEach(e=>{t&&(a.add(t),e.forEach(e=>Jn(a,t,e))),e.forEach(t=>Jn(a,n,t)),e.forEach(t=>Jn(a,Ht[s]||{},t)),e.forEach(t=>Jn(a,Xt,t)),e.forEach(t=>Jn(a,Ut,t))});const l=Array.from(a);return 0===l.length&&l.push(Object.create(null)),Kn.has(e)&&r.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,Ht[e]||{},Xt.datasets[e]||{},{type:e},Xt,Ut]}resolveNamedOptions(t,e,i,n=[""]){const s={$shared:!0},{resolver:r,subPrefixes:o}=es(this._resolverCache,t,n);let a=r;(function(t,e){const{isScriptable:i,isIndexable:n}=ke(t);for(const s of e){const e=i(s),r=n(s),o=(r||e)&&t[s];if(e&&(R(o)||is(o))||r&&m(o))return!0}return!1})(r,e)&&(s.$shared=!1,a=Oe(r,i=R(i)?i():i,this.createResolver(t,i,o)));for(const t of e)s[t]=a[t];return s}createResolver(t,e,i=[""],n){const{resolver:s}=es(this._resolverCache,t,i);return b(e)?Oe(s,e,void 0,n):s}}function es(t,e,i){let n=t.get(e);n||(n=new Map,t.set(e,n));const s=i.join();let r=n.get(s);return r||(r={resolver:Me(e,i),subPrefixes:i.filter(t=>!t.toLowerCase().includes("hover"))},n.set(s,r)),r}const is=t=>b(t)&&Object.getOwnPropertyNames(t).reduce((e,i)=>e||R(t[i]),!1),ns=["top","bottom","left","right","chartArea"];function ss(t,e){return"top"===t||"bottom"===t||-1===ns.indexOf(t)&&"x"===e}function rs(t,e){return function(i,n){return i[t]===n[t]?i[e]-n[e]:i[t]-n[t]}}function os(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),w(i&&i.onComplete,[t],e)}function as(t){const e=t.chart,i=e.options.animation;w(i&&i.onProgress,[t],e)}function ls(t){return Be()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const cs={},hs=t=>{const e=ls(t);return Object.values(cs).filter(t=>t.canvas===e).pop()};function ds(t,e,i){const n=Object.keys(t);for(const s of n){const n=+s;if(n>=e){const r=t[s];delete t[s],(i>0||n>e)&&(t[n+i]=r)}}}class us{constructor(t,e){const i=this.config=new ts(e),n=ls(t),s=hs(n);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas can be reused.");const r=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||function(t){return!Be()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?gn:Cn}(n)),this.platform.updateConfig(i);const o=this.platform.acquireContext(n,r.aspectRatio),a=o&&o.canvas,l=a&&a.height,c=a&&a.width;this.id=g(),this.ctx=o,this.canvas=a,this.width=c,this.height=l,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Hn,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let i;return function(...n){return e?(clearTimeout(i),i=setTimeout(t,e,n)):t.apply(this,n),e}}(t=>this.update(t),r.resizeDelay||0),this._dataChanges=[],cs[this.id]=this,o&&a?(di.listen(this,"complete",os),di.listen(this,"progress",as),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:s}=this;return p(t)?e&&s?s:n?i/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Qe(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Kt(this.canvas,this.ctx),this}stop(){return di.stop(this),this}resize(t,e){di.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,n=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(n,t,e,s),o=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,Qe(this,o,!0)&&(this.notifyPlugins("resize",{size:r}),w(i.onResize,[this,r],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){M(this.options.scales||{},(t,e)=>{t.id=e})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,n=Object.keys(i).reduce((t,e)=>(t[e]=!1,t),{});let s=[];e&&(s=s.concat(Object.keys(e).map(t=>{const i=e[t],n=Xn(t,i),s="r"===n,r="x"===n;return{options:i,dposition:s?"chartArea":r?"bottom":"left",dtype:s?"radialLinear":r?"category":"linear"}}))),M(s,e=>{const s=e.options,r=s.id,o=Xn(r,s),a=v(s.type,e.dtype);void 0!==s.position&&ss(s.position,o)===ss(e.dposition)||(s.position=e.dposition),n[r]=!0;let l=null;r in i&&i[r].type===a?l=i[r]:(l=new(Bn.getScale(a))({id:r,type:a,ctx:this.ctx,chart:this}),i[l.id]=l),l.init(s,t)}),M(n,(t,e)=>{t||delete i[e]}),M(i,t=>{un.configure(this,t,t.options),un.addBox(this,t)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((t,e)=>t.index-e.index),i>e){for(let t=e;te.length&&delete this._stacks,t.forEach((t,i)=>{0===e.filter(e=>e===t._dataset).length&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,n;for(this._removeUnreferencedMetasets(),i=0,n=e.length;i{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let t=0,e=this.data.datasets.length;t{t.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(rs("z","_idx"));const{_active:o,_lastEvent:a}=this;a?this._eventHandler(a,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){M(this.scales,t=>{un.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);F(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:n,count:s}of e)ds(t,n,"_removeElements"===i?-s:s)}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter(t=>t[0]===e).map((t,e)=>e+","+t.splice(1).join(","))),n=i(0);for(let t=1;tt.split(",")).map(t=>({method:t[1],start:+t[2],count:+t[3]}))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;un.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],M(this.boxes,t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))},this),this._layers.forEach((t,e)=>{t._idx=e}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,n=!i.disabled,s=this.chartArea,r={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",r)&&(n&&te(e,{left:!1===i.left?0:s.left-i.left,right:!1===i.right?this.width:s.right+i.right,top:!1===i.top?0:s.top-i.top,bottom:!1===i.bottom?this.height:s.bottom+i.bottom}),t.controller.draw(),n&&ee(e),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}getElementsAtEventForMode(t,e,i,n){const s=Ji.modes[e];return"function"==typeof s?s(this,t,i,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let n=i.filter(t=>t&&t._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(n)),n}getContext(){return this.$context||(this.$context=me(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const n=i?"show":"hide",s=this.getDatasetMeta(t),r=s.controller._resolveAnimations(void 0,n);L(e)?(s.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),r.update(s,{visible:i}),this.update(e=>e.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),di.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,i,n),t[i]=n},n=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};M(this.options.events,t=>i(t,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,n)=>{e.addEventListener(this,i,n),t[i]=n},n=(i,n)=>{t[i]&&(e.removeEventListener(this,i,n),delete t[i])},s=(t,e)=>{this.canvas&&this.resize(t,e)};let r;const o=()=>{n("attach",o),this.attached=!0,this.resize(),i("resize",s),i("detach",r)};r=()=>{this.attached=!1,n("resize",s),this._stop(),this._resize(0,0),i("attach",o)},e.isAttached(this.canvas)?o():r()}unbindEvents(){M(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},M(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const n=i?"set":"remove";let s,r,o,a;for("dataset"===e&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+n+"DatasetHoverStyle"]()),o=0,a=t.length;o{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}});!O(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}_updateHoverStyles(t,e,i){const n=this.options.hover,s=(t,e)=>t.filter(t=>!e.some(e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)),r=s(e,t),o=i?t:s(t,e);r.length&&this.updateHoverStyle(r,n.mode,!1),o.length&&n.mode&&this.updateHoverStyle(o,n.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:Jt(t,this.chartArea,this._minPadding)},n=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,n))return;const s=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(s||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:n=[],options:s}=this,r=e,o=this._getActiveElements(t,n,i,r),a=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}(t),l=function(t,e,i,n){return i&&"mouseout"!==t.type?n?e:t:null}(t,this._lastEvent,i,a);i&&(this._lastEvent=null,w(s.onHover,[t,o,this],this),a&&w(s.onClick,[t,o,this],this));const c=!O(o,n);return(c||e)&&(this._active=o,this._updateHoverStyles(o,n,e)),this._lastEvent=l,c}_getActiveElements(t,e,i,n){if("mouseout"===t.type)return[];if(!i)return e;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,n)}}const fs=()=>M(us.instances,t=>t._plugins.invalidate());function gs(t,e,i){const{startAngle:n,pixelMargin:s,x:r,y:o,outerRadius:a,innerRadius:l}=e;let c=s/a;t.beginPath(),t.arc(r,o,a,n-c,i+c),l>s?(c=s/l,t.arc(r,o,l,i+c,n-c,!0)):t.arc(r,o,s,i+B,n-B),t.closePath(),t.clip()}function ps(t,e,i,n){return{x:i+t*Math.cos(e),y:n+t*Math.sin(e)}}function ms(t,e,i,n,s){const{x:r,y:o,startAngle:a,pixelMargin:l,innerRadius:c}=e,h=Math.max(e.outerRadius+n+i-l,0),d=c>0?c+n+i+l:0;let u=0;const f=s-a;if(n){const t=((c>0?c-n:0)+(h>0?h-n:0))/2;u=(f-(0!==t?f*t/(t+n):f))/2}const g=(f-Math.max(.001,f*h-i/z)/h)/2,p=a+g+u,m=s-g-u,{outerStart:b,outerEnd:x,innerStart:y,innerEnd:v}=function(t,e,i,n){const s=he(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]),r=(i-e)/2,o=Math.min(r,n*e/2),a=t=>{const e=(i-Math.min(r,t))*n/2;return rt(t,0,Math.min(r,e))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:rt(s.innerStart,0,o),innerEnd:rt(s.innerEnd,0,o)}}(e,d,h,m-p),_=h-b,w=h-x,M=p+b/_,O=m-x/w,k=d+y,S=d+v,D=p+y/k,P=m-v/S;if(t.beginPath(),t.arc(r,o,h,M,O),x>0){const e=ps(w,O,r,o);t.arc(e.x,e.y,x,O,m+B)}const C=ps(S,m,r,o);if(t.lineTo(C.x,C.y),v>0){const e=ps(S,P,r,o);t.arc(e.x,e.y,v,m+B,P+Math.PI)}if(t.arc(r,o,d,m-v/d,p+y/d,!0),y>0){const e=ps(k,D,r,o);t.arc(e.x,e.y,y,D+Math.PI,p-B)}const T=ps(_,p,r,o);if(t.lineTo(T.x,T.y),b>0){const e=ps(_,M,r,o);t.arc(e.x,e.y,b,p-B,M)}t.closePath()}Object.defineProperties(us,{defaults:{enumerable:!0,value:Xt},instances:{enumerable:!0,value:cs},overrides:{enumerable:!0,value:Ht},registry:{enumerable:!0,value:Bn},version:{enumerable:!0,value:"3.7.1"},getChart:{enumerable:!0,value:hs},register:{enumerable:!0,value:(...t)=>{Bn.add(...t),fs()}},unregister:{enumerable:!0,value:(...t)=>{Bn.remove(...t),fs()}}});class bs extends Tn{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.getProps(["x","y"],i),{angle:s,distance:r}=tt(n,{x:t,y:e}),{startAngle:o,endAngle:a,innerRadius:l,outerRadius:c,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),d=this.options.spacing/2,u=v(h,a-o)>=I||st(s,o,a),f=ot(r,l+d,c+d);return u&&f}getCenterPoint(t){const{x:e,y:i,startAngle:n,endAngle:s,innerRadius:r,outerRadius:o}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:a,spacing:l}=this.options,c=(n+s)/2,h=(r+o+l+a)/2;return{x:e+Math.cos(c)*h,y:i+Math.sin(c)*h}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,n=(e.offset||0)/2,s=(e.spacing||0)/2;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>I?Math.floor(i/I):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();let r=0;if(n){r=n/2;const e=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(e)*r,Math.sin(e)*r),this.circumference>=z&&(r=n)}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;const o=function(t,e,i,n){const{fullCircles:s,startAngle:r,circumference:o}=e;let a=e.endAngle;if(s){ms(t,e,i,n,r+I);for(let e=0;ea&&r>a;return{count:n,start:l,loop:e.loop,ilen:c(o+(c?a-t:t))%r,y=()=>{f!==g&&(t.lineTo(m,g),t.lineTo(m,f),t.lineTo(m,p))};for(l&&(d=s[x(0)],t.moveTo(d.x,d.y)),h=0;h<=a;++h){if(d=s[x(h)],d.skip)continue;const e=d.x,i=d.y,n=0|e;n===u?(ig&&(g=i),m=(b*m+e)/++b):(y(),t.lineTo(e,i),u=n,b=0,f=g=i),p=i}y()}function Ms(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i?_s:ws}bs.id="arc",bs.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0},bs.defaultRoutes={backgroundColor:"backgroundColor"};const Os="function"==typeof Path2D;class ks extends Tn{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const n=i.spanGaps?this._loop:this._fullLoop;We(this._points,i,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(t,e){const i=t.points,n=t.options.spanGaps,s=i.length;if(!s)return[];const r=!!t._loop,{start:o,end:a}=function(t,e,i,n){let s=0,r=e-1;if(i&&!n)for(;ss&&t[r%e].skip;)r--;return r%=e,{start:s,end:r}}(i,s,r,n);return function(t,e,i,n){return n&&n.setContext&&i?function(t,e,i,n){const s=t._chart.getContext(),r=ci(t.options),{_datasetIndex:o,options:{spanGaps:a}}=t,l=i.length,c=[];let h=r,d=e[0].start,u=d;function f(t,e,n,s){const r=a?-1:1;if(t!==e){for(t+=l;i[t%l].skip;)t-=r;for(;i[e%l].skip;)e+=r;t%l!=e%l&&(c.push({start:t%l,end:e%l,loop:n,style:s}),h=s,d=e%l)}}for(const t of e){d=a?d:t.start;let e,r=i[d%l];for(u=d+1;u<=t.end;u++){const a=i[u%l];e=ci(n.setContext(me(s,{type:"segment",p0:r,p1:a,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:o}))),hi(e,h)&&f(d,u-1,t.loop,h),r=a,h=e}d"borderDash"!==t&&"fill"!==t};class Ds extends Tn{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.options,{x:s,y:r}=this.getProps(["x","y"],i);return Math.pow(t-s,2)+Math.pow(e-r,2)=i)&&s):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}As.id="bar",As.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0},As.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};class Rs{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:n,y:s,radius:r}=this;return e=e||{start:0,end:I},t.arc(n,s,r,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:n}=this,s=t.angle;return{x:e+Math.cos(s)*n,y:i+Math.sin(s)*n,angle:s}}}function Fs(t,e,i){for(;e>t;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function zs(t,e,i){const n=[];for(let s=0;s{e=Fs(t,e,s);const o=s[t],a=s[e];null!==n?(r.push({x:o.x,y:n}),r.push({x:a.x,y:n})):null!==i&&(r.push({x:i,y:o.y}),r.push({x:i,y:a.y}))}),r}(t,e),i.length?new ks({points:i,options:{tension:0},_loop:n,_fullLoop:n}):null}function Ws(t,e,i){let n=t[e].fill;const s=[e];let r;if(!i)return n;for(;!1!==n&&-1===s.indexOf(n);){if(!x(n))return n;if(r=t[n],!r)return!1;if(r.visible)return n;s.push(n),n=r.fill}return!1}function Bs(t,e,i){const{segments:n,points:s}=e;let r=!0,o=!1;t.beginPath();for(const a of n){const{start:n,end:l}=a,c=s[n],h=s[Fs(n,l,s)];r?(t.moveTo(c.x,c.y),r=!1):(t.lineTo(c.x,i),t.lineTo(c.x,c.y)),o=!!e.pathSegment(t,a,{move:o}),o?t.closePath():t.lineTo(h.x,i)}t.lineTo(e.first().x,i),t.closePath(),t.clip()}function Hs(t,e,i,n){if(n)return;let s=e[t],r=i[t];return"angle"===t&&(s=nt(s),r=nt(r)),{property:t,start:s,end:r}}function Us(t,e,i,n){return t&&e?n(t[i],e[i]):t?t[i]:e?e[i]:0}function Ys(t,e,i){const{top:n,bottom:s}=e.chart.chartArea,{property:r,start:o,end:a}=i||{};"x"===r&&(t.beginPath(),t.rect(o,n,a-o,s-n),t.clip())}function $s(t,e,i,n){const s=e.interpolate(i,n);s&&t.lineTo(s.x,s.y)}function Xs(t,e){const{line:i,target:n,property:s,color:r,scale:o}=e,a=function(t,e,i){const n=t.segments,s=t.points,r=e.points,o=[];for(const t of n){let{start:n,end:a}=t;a=Fs(n,a,s);const l=Hs(i,s[n],s[a],t.loop);if(!e.segments){o.push({source:t,target:l,start:s[n],end:s[a]});continue}const c=li(e,l);for(const e of c){const n=Hs(i,r[e.start],r[e.end],e.loop),a=ai(t,s,n);for(const t of a)o.push({source:t,target:e,start:{[i]:Us(l,n,"start",Math.max)},end:{[i]:Us(l,n,"end",Math.min)}})}}return o}(i,n,s);for(const{source:e,target:l,start:c,end:h}of a){const{style:{backgroundColor:a=r}={}}=e,d=!0!==n;t.save(),t.fillStyle=a,Ys(t,o,d&&Hs(s,c,h)),t.beginPath();const u=!!i.pathSegment(t,e);let f;if(d){u?t.closePath():$s(t,n,h,s);const e=!!n.pathSegment(t,l,{move:u,reverse:!0});f=u&&e,f||$s(t,n,c,s)}t.closePath(),t.fill(f?"evenodd":"nonzero"),t.restore()}}function qs(t,e,i){const n=Ns(e),{line:s,scale:r,axis:o}=e,a=s.options,l=a.fill,c=a.backgroundColor,{above:h=c,below:d=c}=l||{};n&&s.points.length&&(te(t,i),function(t,e){const{line:i,target:n,above:s,below:r,area:o,scale:a}=e,l=i._loop?"angle":e.axis;t.save(),"x"===l&&r!==s&&(Bs(t,n,o.top),Xs(t,{line:i,target:n,color:s,scale:a,property:l}),t.restore(),t.save(),Bs(t,n,o.bottom)),Xs(t,{line:i,target:n,color:r,scale:a,property:l}),t.restore()}(t,{line:s,target:n,above:h,below:d,area:i,scale:r,axis:o}),ee(t))}var Gs={id:"filler",afterDatasetsUpdate(t,e,i){const n=(t.data.datasets||[]).length,s=[];let r,o,a,l;for(o=0;o=0;--e){const i=s[e].$filler;i&&(i.line.updateControlPoints(r,i.axis),n&&qs(t.ctx,i,r))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const n=t.getSortedVisibleDatasetMetas();for(let e=n.length-1;e>=0;--e){const i=n[e].$filler;i&&qs(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){const n=e.meta.$filler;n&&!1!==n.fill&&"beforeDatasetDraw"===i.drawTime&&qs(t.ctx,n,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};new WeakMap;const Qs={average(t){if(!t.length)return!1;let e,i,n=0,s=0,r=0;for(e=0,i=t.length;e-1?t.split("\n"):t}function Js(t,e){const{element:i,datasetIndex:n,index:s}=e,r=t.getDatasetMeta(n).controller,{label:o,value:a}=r.getLabelAndValue(s);return{chart:t,label:o,parsed:r.getParsed(s),raw:t.data.datasets[n].data[s],formattedValue:a,dataset:r.getDataset(),dataIndex:s,datasetIndex:n,element:i}}function tr(t,e){const i=t.chart.ctx,{body:n,footer:s,title:r}=t,{boxWidth:o,boxHeight:a}=e,l=ge(e.bodyFont),c=ge(e.titleFont),h=ge(e.footerFont),d=r.length,u=s.length,f=n.length,g=fe(e.padding);let p=g.height,m=0,b=n.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);b+=t.beforeBody.length+t.afterBody.length,d&&(p+=d*c.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),b&&(p+=f*(e.displayColors?Math.max(a,l.lineHeight):l.lineHeight)+(b-f)*l.lineHeight+(b-1)*e.bodySpacing),u&&(p+=e.footerMarginTop+u*h.lineHeight+(u-1)*e.footerSpacing);let x=0;const y=function(t){m=Math.max(m,i.measureText(t).width+x)};return i.save(),i.font=c.string,M(t.title,y),i.font=l.string,M(t.beforeBody.concat(t.afterBody),y),x=e.displayColors?o+2+e.boxPadding:0,M(n,t=>{M(t.before,y),M(t.lines,y),M(t.after,y)}),x=0,i.font=h.string,M(t.footer,y),i.restore(),m+=g.width,{width:m,height:p}}function er(t,e,i,n){const{x:s,width:r}=i,{width:o,chartArea:{left:a,right:l}}=t;let c="center";return"center"===n?c=s<=(a+l)/2?"left":"right":s<=r/2?c="left":s>=o-r/2&&(c="right"),function(t,e,i,n){const{x:s,width:r}=n,o=i.caretSize+i.caretPadding;return"left"===t&&s+r+o>e.width||"right"===t&&s-r-o<0||void 0}(c,t,e,i)&&(c="center"),c}function ir(t,e,i){const n=i.yAlign||e.yAlign||function(t,e){const{y:i,height:n}=e;return it.height-n/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||er(t,e,i,n),yAlign:n}}function nr(t,e,i,n){const{caretSize:s,caretPadding:r,cornerRadius:o}=t,{xAlign:a,yAlign:l}=i,c=s+r,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=ue(o);let g=function(t,e){let{x:i,width:n}=t;return"right"===e?i-=n:"center"===e&&(i-=n/2),i}(e,a);const p=function(t,e,i){let{y:n,height:s}=t;return"top"===e?n+=i:n-="bottom"===e?s+i:s/2,n}(e,l,c);return"center"===l?"left"===a?g+=c:"right"===a&&(g-=c):"left"===a?g-=Math.max(h,u)+s:"right"===a&&(g+=Math.max(d,f)+s),{x:rt(g,0,n.width-e.width),y:rt(p,0,n.height-e.height)}}function sr(t,e,i){const n=fe(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-n.right:t.x+n.left}function rr(t){return Ks([],Zs(t))}function or(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}class ar extends Tn{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart||t._chart,this._chart=this.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),n=i.enabled&&e.options.animation&&i.animations,s=new pi(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=(this,me(this.chart.getContext(),{tooltip:this,tooltipItems:this._tooltipItems,type:"tooltip"})))}getTitle(t,e){const{callbacks:i}=e,n=i.beforeTitle.apply(this,[t]),s=i.title.apply(this,[t]),r=i.afterTitle.apply(this,[t]);let o=[];return o=Ks(o,Zs(n)),o=Ks(o,Zs(s)),o=Ks(o,Zs(r)),o}getBeforeBody(t,e){return rr(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){const{callbacks:i}=e,n=[];return M(t,t=>{const e={before:[],lines:[],after:[]},s=or(i,t);Ks(e.before,Zs(s.beforeLabel.call(this,t))),Ks(e.lines,s.label.call(this,t)),Ks(e.after,Zs(s.afterLabel.call(this,t))),n.push(e)}),n}getAfterBody(t,e){return rr(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){const{callbacks:i}=e,n=i.beforeFooter.apply(this,[t]),s=i.footer.apply(this,[t]),r=i.afterFooter.apply(this,[t]);let o=[];return o=Ks(o,Zs(n)),o=Ks(o,Zs(s)),o=Ks(o,Zs(r)),o}_createItems(t){const e=this._active,i=this.chart.data,n=[],s=[],r=[];let o,a,l=[];for(o=0,a=e.length;ot.filter(e,n,s,i))),t.itemSort&&(l=l.sort((e,n)=>t.itemSort(e,n,i))),M(l,e=>{const i=or(t.callbacks,e);n.push(i.labelColor.call(this,e)),s.push(i.labelPointStyle.call(this,e)),r.push(i.labelTextColor.call(this,e))}),this.labelColors=n,this.labelPointStyles=s,this.labelTextColors=r,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),n=this._active;let s,r=[];if(n.length){const t=Qs[i.position].call(this,n,this._eventPosition);r=this._createItems(i),this.title=this.getTitle(r,i),this.beforeBody=this.getBeforeBody(r,i),this.body=this.getBody(r,i),this.afterBody=this.getAfterBody(r,i),this.footer=this.getFooter(r,i);const e=this._size=tr(this,i),o=Object.assign({},t,e),a=ir(this.chart,i,o),l=nr(i,o,a,this.chart);this.xAlign=a.xAlign,this.yAlign=a.yAlign,s={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(s={opacity:0});this._tooltipItems=r,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,n){const s=this.getCaretPosition(t,i,n);e.lineTo(s.x1,s.y1),e.lineTo(s.x2,s.y2),e.lineTo(s.x3,s.y3)}getCaretPosition(t,e,i){const{xAlign:n,yAlign:s}=this,{caretSize:r,cornerRadius:o}=i,{topLeft:a,topRight:l,bottomLeft:c,bottomRight:h}=ue(o),{x:d,y:u}=t,{width:f,height:g}=e;let p,m,b,x,y,v;return"center"===s?(y=u+g/2,"left"===n?(p=d,m=p-r,x=y+r,v=y-r):(p=d+f,m=p+r,x=y-r,v=y+r),b=p):(m="left"===n?d+Math.max(a,c)+r:"right"===n?d+f-Math.max(l,h)-r:this.caretX,"top"===s?(x=u,y=x-r,p=m-r,b=m+r):(x=u+g,y=x+r,p=m+r,b=m-r),v=x),{x1:p,x2:m,x3:b,y1:x,y2:y,y3:v}}drawTitle(t,e,i){const n=this.title,s=n.length;let r,o,a;if(s){const l=si(i.rtl,this.x,this.width);for(t.x=sr(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",r=ge(i.titleFont),o=i.titleSpacing,e.fillStyle=i.titleColor,e.font=r.string,a=0;a0!==t)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,oe(t,{x:e,y:g,w:l,h:a,radius:o}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),oe(t,{x:i,y:g+1,w:l-2,h:a-2,radius:o}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(e,g,l,a),t.strokeRect(e,g,l,a),t.fillStyle=r.backgroundColor,t.fillRect(i,g+1,l-2,a-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:n}=this,{bodySpacing:s,bodyAlign:r,displayColors:o,boxHeight:a,boxWidth:l,boxPadding:c}=i,h=ge(i.bodyFont);let d=h.lineHeight,u=0;const f=si(i.rtl,this.x,this.width),g=function(i){e.fillText(i,f.x(t.x+u),t.y+d/2),t.y+=d+s},p=f.textAlign(r);let m,b,x,y,v,_,w;for(e.textAlign=r,e.textBaseline="middle",e.font=h.string,t.x=sr(this,p,i),e.fillStyle=i.bodyColor,M(this.beforeBody,g),u=o&&"right"!==p?"center"===r?l/2+c:l+2+c:0,y=0,_=n.length;y<_;++y){for(m=n[y],b=this.labelTextColors[y],e.fillStyle=b,M(m.before,g),x=m.lines,o&&x.length&&(this._drawColorBox(e,t,y,f,i),d=Math.max(h.lineHeight,a)),v=0,w=x.length;v0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,n=i&&i.x,s=i&&i.y;if(n||s){const i=Qs[t.position].call(this,this._active,this._eventPosition);if(!i)return;const r=this._size=tr(this,t),o=Object.assign({},i,this._size),a=ir(e,t,o),l=nr(t,o,a,e);n._to===l.x&&s._to===l.y||(this.xAlign=a.xAlign,this.yAlign=a.yAlign,this.width=r.width,this.height=r.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const r=fe(e.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&o&&(t.save(),t.globalAlpha=i,this.drawBackground(s,t,n,e),function(t,e){let i,n;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,n=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=n)}(t,e.textDirection),s.y+=r.top,this.drawTitle(s,t,e),this.drawBody(s,t,e),this.drawFooter(s,t,e),function(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,n=t.map(({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),s=!O(i,n),r=this._positionChanged(n,e);(s||r)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,s=this._active||[],r=this._getActiveElements(t,s,e,i),o=this._positionChanged(r,t),a=e||!O(r,s)||o;return a&&(this._active=r,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),a}_getActiveElements(t,e,i,n){const s=this.options;if("mouseout"===t.type)return[];if(!n)return e;const r=this.chart.getElementsAtEventForMode(t,s.mode,s,i);return s.reverse&&r.reverse(),r}_positionChanged(t,e){const{caretX:i,caretY:n,options:s}=this,r=Qs[s.position].call(this,t,e);return!1!==r&&(i!==r.x||n!==r.y)}}ar.positioners=Qs;var lr={id:"tooltip",_element:ar,positioners:Qs,afterInit(t,e,i){i&&(t.tooltip=new ar({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip,i={tooltip:e};!1!==t.notifyPlugins("beforeTooltipDraw",i)&&(e&&e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i))},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:f,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,n=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(n>0&&e.dataIndex"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};class cr extends Vn{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:i,label:n}of e)t[i]===n&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(p(t))return null;const i=this.getLabels();return((t,e)=>null===t?null:rt(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:function(t,e,i,n){const s=t.indexOf(e);return-1===s?((t,e,i,n)=>("string"==typeof e?(i=t.push(e)-1,n.unshift({index:i,label:e})):isNaN(e)&&(i=null),i))(t,e,i,n):s!==t.lastIndexOf(e)?i:s}(i,t,v(e,t),this._addedLabels),i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:n}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(n=this.getLabels().length-1)),this.min=i,this.max=n}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,n=[];let s=this.getLabels();s=0===t&&e===s.length-1?s:s.slice(t,e+1),this._valueRange=Math.max(s.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let i=t;i<=e;i++)n.push({value:i});return n}getLabelForValue(t){const e=this.getLabels();return t>=0&&te.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function hr(t,e,{horizontal:i,minRotation:n}){const s=K(n),r=(i?Math.sin(s):Math.cos(s))||.001,o=.75*e*(""+t).length;return Math.min(e/r,o)}cr.id="category",cr.defaults={ticks:{callback:cr.prototype.getLabelForValue}};class dr extends Vn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return p(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:n,max:s}=this;const r=t=>n=e?n:t,o=t=>s=i?s:t;if(t){const t=$(n),e=$(s);t<0&&e<0?o(0):t>0&&e>0&&r(0)}if(n===s){let e=1;(s>=Number.MAX_SAFE_INTEGER||n<=Number.MIN_SAFE_INTEGER)&&(e=Math.abs(.05*s)),o(s+e),t||r(n-e)}this.min=n,this.max=s}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:n}=t;return n?(e=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const n=function(t,e){const i=[],{bounds:n,step:s,min:r,max:o,precision:a,count:l,maxTicks:c,maxDigits:h,includeBounds:d}=t,u=s||1,f=c-1,{min:g,max:m}=e,b=!p(r),x=!p(o),y=!p(l),v=(m-g)/(h+1);let _,w,M,O,k=X((m-g)/f/u)*u;if(k<1e-14&&!b&&!x)return[{value:g},{value:m}];O=Math.ceil(m/k)-Math.floor(g/k),O>f&&(k=X(O*k/f/u)*u),p(a)||(_=Math.pow(10,a),k=Math.ceil(k*_)/_),"ticks"===n?(w=Math.floor(g/k)*k,M=Math.ceil(m/k)*k):(w=g,M=m),b&&x&&s&&function(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}((o-r)/s,k/1e3)?(O=Math.round(Math.min((o-r)/k,c)),k=(o-r)/O,w=r,M=o):y?(w=b?r:w,M=x?o:M,O=l-1,k=(M-w)/O):(O=(M-w)/k,O=G(O,Math.round(O),k/1e3)?Math.round(O):Math.ceil(O));const S=Math.max(J(k),J(w));_=Math.pow(10,p(a)?S:a),w=Math.round(w*_)/_,M=Math.round(M*_)/_;let D=0;for(b&&(d&&w!==r?(i.push({value:r}),w0?i:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=x(t)?Math.max(0,t):null,this.max=x(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,n=this.max;const s=e=>i=t?i:e,r=t=>n=e?n:t,o=(t,e)=>Math.pow(10,Math.floor(Y(t))+e);i===n&&(i<=0?(s(1),r(10)):(s(o(i,-1)),r(o(n,1)))),i<=0&&s(o(n,-1)),n<=0&&r(o(i,1)),this._zero&&this.min!==this._suggestedMin&&i===o(this.min,0)&&s(o(i,-1)),this.min=i,this.max=n}buildTicks(){const t=this.options,e=function(t,e){const i=Math.floor(Y(e.max)),n=Math.ceil(e.max/Math.pow(10,i)),s=[];let r=y(t.min,Math.pow(10,Math.floor(Y(e.min)))),o=Math.floor(Y(r)),a=Math.floor(r/Math.pow(10,o)),l=o<0?Math.pow(10,Math.abs(o)):1;do{s.push({value:r,major:fr(r)}),++a,10===a&&(a=1,++o,l=o>=0?1:l),r=Math.round(a*Math.pow(10,o)*l)/l}while(os?{start:e-i,end:e}:{start:e,end:e+i}}function br(t,e,i,n,s){const r=Math.abs(Math.sin(i)),o=Math.abs(Math.cos(i));let a=0,l=0;n.starte.r&&(a=(n.end-e.r)/r,t.r=Math.max(t.r,e.r+a)),s.starte.b&&(l=(s.end-e.b)/o,t.b=Math.max(t.b,e.b+l))}function xr(t){return 0===t||180===t?"center":t<180?"left":"right"}function yr(t,e,i){return 90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e),t}function vr(t,e,i,n){const{ctx:s}=t;if(i)s.arc(t.xCenter,t.yCenter,e,0,I);else{let i=t.getPointPosition(0,e);s.moveTo(i.x,i.y);for(let r=1;r{const i=w(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""}).filter((t,e)=>this.chart.getDataVisibility(e))}fit(){const t=this.options;t.display&&t.pointLabels.display?function(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),n=[],s=[],r=t._pointLabels.length,o=t.options.pointLabels,a=o.centerPointLabels?z/r:0;for(let d=0;d=0&&t=0;s--){const e=n.setContext(t.getPointLabelContext(s)),r=ge(e.font),{x:o,y:a,textAlign:l,left:c,top:h,right:d,bottom:u}=t._pointLabelItems[s],{backdropColor:f}=e;if(!p(f)){const t=fe(e.backdropPadding);i.fillStyle=f,i.fillRect(c-t.left,h-t.top,d-c+t.width,u-h+t.height)}se(i,t._pointLabels[s],o,a+r.lineHeight/2,r,{color:e.color,textAlign:l,textBaseline:"middle"})}}(this,s),n.display&&this.ticks.forEach((t,e)=>{0!==e&&(o=this.getDistanceFromCenterForValue(t.value),function(t,e,i,n){const s=t.ctx,r=e.circular,{color:o,lineWidth:a}=e;!r&&!n||!o||!a||i<0||(s.save(),s.strokeStyle=o,s.lineWidth=a,s.setLineDash(e.borderDash),s.lineDashOffset=e.borderDashOffset,s.beginPath(),vr(t,i,r,n),s.closePath(),s.stroke(),s.restore())}(this,n.setContext(this.getContext(e-1)),o,s))}),i.display){for(t.save(),r=s-1;r>=0;r--){const n=i.setContext(this.getPointLabelContext(r)),{color:s,lineWidth:l}=n;l&&s&&(t.lineWidth=l,t.strokeStyle=s,t.setLineDash(n.borderDash),t.lineDashOffset=n.borderDashOffset,o=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),a=this.getPointPosition(r,o),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(a.x,a.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const n=this.getIndexAngle(0);let s,r;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(n),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((n,o)=>{if(0===o&&!e.reverse)return;const a=i.setContext(this.getContext(o)),l=ge(a.font);if(s=this.getDistanceFromCenterForValue(this.ticks[o].value),a.showLabelBackdrop){t.font=l.string,r=t.measureText(n.label).width,t.fillStyle=a.backdropColor;const e=fe(a.backdropPadding);t.fillRect(-r/2-e.left,-s-l.size/2-e.top,r+e.width,l.size+e.height)}se(t,n.label,0,-s,l,{color:a.color})}),t.restore()}drawTitle(){}}_r.id="radialLinear",_r.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:jn.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}},_r.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},_r.descriptors={angleLines:{_fallback:"grid"}};const wr={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Mr=Object.keys(wr);function Or(t,e){return t-e}function kr(t,e){if(p(e))return null;const i=t._adapter,{parser:n,round:s,isoWeekday:r}=t._parseOpts;let o=e;return"function"==typeof n&&(o=n(o)),x(o)||(o="string"==typeof n?i.parse(o,n):i.parse(o)),null===o?null:(s&&(o="week"!==s||!q(r)&&!0!==r?i.startOf(o,s):i.startOf(o,"isoWeek",r)),+o)}function Sr(t,e,i,n){const s=Mr.length;for(let r=Mr.indexOf(t);r=e?i[n]:i[s]]=!0}}else t[e]=!0}function Pr(t,e,i){const n=[],s={},r=e.length;let o,a;for(o=0;o=0&&(e[l].major=!0);return e}(t,n,s,i):n}class Cr extends Vn{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e){const i=t.time||(t.time={}),n=this._adapter=new $i._date(t.adapters.date);C(i.displayFormats,n.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:kr(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:n,max:s,minDefined:r,maxDefined:o}=this.getUserBounds();function a(t){r||isNaN(t.min)||(n=Math.min(n,t.min)),o||isNaN(t.max)||(s=Math.max(s,t.max))}r&&o||(a(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||a(this.getMinMax(!1))),n=x(n)&&!isNaN(n)?n:+e.startOf(Date.now(),i),s=x(s)&&!isNaN(s)?s:+e.endOf(Date.now(),i)+1,this.min=Math.min(n,s-1),this.max=Math.max(n+1,s)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,n="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const s=this.min,r=function(t,e,i){let n=0,s=t.length;for(;nn&&t[s-1]>i;)s--;return n>0||s=Mr.indexOf(i);r--){const i=Mr[r];if(wr[i].common&&t._adapter.diff(s,n,i)>=e-1)return i}return Mr[i?Mr.indexOf(i):0]}(this,r.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(let e=Mr.indexOf(t)+1,i=Mr.length;e1e5*o)throw new Error(e+" and "+i+" are too far apart with stepSize of "+o+" "+r);const f="data"===n.ticks.source&&this.getDataTimestamps();for(h=u,d=0;ht-e).map(t=>+t)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}_tickFormatFunction(t,e,i,n){const s=this.options,r=s.time.displayFormats,o=this._unit,a=this._majorUnit,l=o&&r[o],c=a&&r[a],h=i[e],d=a&&c&&h&&h.major,u=this._adapter.format(t,n||(d?c:l)),f=s.ticks.callback;return f?w(f,[u,e,i],this):u}generateTickLabels(t){let e,i,n;for(e=0,i=t.length;e0?o:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(t=0,e=n.length;t=t[a].pos&&e<=t[l].pos&&({lo:a,hi:l}=xe(t,"pos",e)),({pos:n,time:r}=t[a]),({pos:s,time:o}=t[l])):(e>=t[a].time&&e<=t[l].time&&({lo:a,hi:l}=xe(t,"time",e)),({time:n,pos:r}=t[a]),({time:s,pos:o}=t[l]));const c=s-n;return c?r+(o-r)*(e-n)/c:r}Cr.id="time",Cr.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};class Er extends Cr{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Tr(e,this.min),this._tableRange=Tr(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,n=[],s=[];let r,o,a,l,c;for(r=0,o=t.length;r=e&&l<=i&&n.push(l);if(n.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(r=0,o=n.length;r2&&void 0!==arguments[2]?arguments[2]:"label";const n=[];t.datasets=e.map(e=>{const s=t.datasets.find(t=>t[i]===e[i]);return s&&e.data&&!n.includes(s)?(n.push(s),Object.assign(s,e),s):{...e}})}function zr(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"label";const i={labels:[],datasets:[]};return Rr(i,t.labels),Fr(i,t.datasets,e),i}function Ir(t,e){let{height:i=150,width:n=300,redraw:s=!1,datasetIdKey:r,type:o,data:a,options:l,plugins:c=[],fallbackContent:h,...d}=t;const u=Object(jr.useRef)(null),f=Object(jr.useRef)(),g=()=>{u.current&&(f.current=new us(u.current,{type:o,data:zr(a,r),options:l,plugins:c}),Lr(e,f.current))},p=()=>{Lr(e,null),f.current&&(f.current.destroy(),f.current=null)};return Object(jr.useEffect)(()=>{var t,e;!s&&f.current&&l&&(t=f.current,e=l,t.options={...e})},[s,l]),Object(jr.useEffect)(()=>{!s&&f.current&&Rr(f.current.config.data,a.labels)},[s,a.labels]),Object(jr.useEffect)(()=>{!s&&f.current&&a.datasets&&Fr(f.current.config.data,a.datasets,r)},[s,a.datasets]),Object(jr.useEffect)(()=>{f.current&&(s?(p(),setTimeout(g)):f.current.update())},[s,l,a.labels,a.datasets]),Object(jr.useEffect)(()=>(g(),()=>p()),[]),Ar.a.createElement("canvas",Object.assign({ref:u,role:"img",height:i,width:n},d),h)}const Nr=Object(jr.forwardRef)(Ir);var Vr=i(3),Wr=i(17),Br=i(7),Hr=i(8),Ur=i(4);function Yr(t,e){Object(Ur.a)(2,arguments);var i=Object(Hr.a)(t),n=Object(Br.a)(e);return isNaN(n)?new Date(NaN):n?(i.setDate(i.getDate()+n),i):i}function $r(t,e){Object(Ur.a)(2,arguments);var i=Object(Br.a)(e);return Yr(t,-i)}function Xr(t,e){Object(Ur.a)(2,arguments);var i=Object(Hr.a)(t),n=Object(Br.a)(e);if(isNaN(n))return new Date(NaN);if(!n)return i;var s=i.getDate(),r=new Date(i.getTime());r.setMonth(i.getMonth()+n+1,0);var o=r.getDate();return s>=o?r:(i.setFullYear(r.getFullYear(),r.getMonth(),s),i)}function qr(t,e){Object(Ur.a)(2,arguments);var i=Object(Br.a)(e);return Xr(t,-i)}function Gr(t){return(Gr="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 Qr(t,e){if(Object(Ur.a)(2,arguments),!e||"object"!==Gr(e))return new Date(NaN);var i=e.years?Object(Br.a)(e.years):0,n=e.months?Object(Br.a)(e.months):0,s=e.weeks?Object(Br.a)(e.weeks):0,r=e.days?Object(Br.a)(e.days):0,o=e.hours?Object(Br.a)(e.hours):0,a=e.minutes?Object(Br.a)(e.minutes):0,l=e.seconds?Object(Br.a)(e.seconds):0,c=qr(t,n+12*i),h=$r(c,r+7*s),d=a+60*o,u=l+60*d,f=1e3*u,g=new Date(h.getTime()-f);return g}function Kr(t){return(Kr="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 Zr(t,e){if(Object(Ur.a)(2,arguments),!e||"object"!==Kr(e))return new Date(NaN);var i=e.years?Object(Br.a)(e.years):0,n=e.months?Object(Br.a)(e.months):0,s=e.weeks?Object(Br.a)(e.weeks):0,r=e.days?Object(Br.a)(e.days):0,o=e.hours?Object(Br.a)(e.hours):0,a=e.minutes?Object(Br.a)(e.minutes):0,l=e.seconds?Object(Br.a)(e.seconds):0,c=Object(Hr.a)(t),h=n||i?Xr(c,n+12*i):c,d=r||s?Yr(h,r+7*s):h,u=a+60*o,f=l+60*u,g=1e3*f,p=new Date(d.getTime()+g);return p}function Jr(t,e){var i;Object(Ur.a)(1,arguments);var n=Object(Br.a)(null!==(i=null==e?void 0:e.additionalDigits)&&void 0!==i?i:2);if(2!==n&&1!==n&&0!==n)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof t&&"[object String]"!==Object.prototype.toString.call(t))return new Date(NaN);var s,r=so(t);if(r.date){var o=ro(r.date,n);s=oo(o.restDateString,o.year)}if(!s||isNaN(s.getTime()))return new Date(NaN);var a,l=s.getTime(),c=0;if(r.time&&(c=lo(r.time),isNaN(c)))return new Date(NaN);if(!r.timezone){var h=new Date(l+c),d=new Date(0);return d.setFullYear(h.getUTCFullYear(),h.getUTCMonth(),h.getUTCDate()),d.setHours(h.getUTCHours(),h.getUTCMinutes(),h.getUTCSeconds(),h.getUTCMilliseconds()),d}return a=ho(r.timezone),isNaN(a)?new Date(NaN):new Date(l+c+a)}Math.pow(10,8);var to={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},eo=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,io=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,no=/^([+-])(\d{2})(?::?(\d{2}))?$/;function so(t){var e,i={},n=t.split(to.dateTimeDelimiter);if(n.length>2)return i;if(/:/.test(n[0])?e=n[0]:(i.date=n[0],e=n[1],to.timeZoneDelimiter.test(i.date)&&(i.date=t.split(to.timeZoneDelimiter)[0],e=t.substr(i.date.length,t.length))),e){var s=to.timezone.exec(e);s?(i.time=e.replace(s[1],""),i.timezone=s[1]):i.time=e}return i}function ro(t,e){var i=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),n=t.match(i);if(!n)return{year:NaN,restDateString:""};var s=n[1]?parseInt(n[1]):null,r=n[2]?parseInt(n[2]):null;return{year:null===r?s:100*r,restDateString:t.slice((n[1]||n[2]).length)}}function oo(t,e){if(null===e)return new Date(NaN);var i=t.match(eo);if(!i)return new Date(NaN);var n=!!i[4],s=ao(i[1]),r=ao(i[2])-1,o=ao(i[3]),a=ao(i[4]),l=ao(i[5])-1;if(n)return function(t,e,i){return e>=1&&e<=53&&i>=0&&i<=6}(0,a,l)?function(t,e,i){var n=new Date(0);n.setUTCFullYear(t,0,4);var s=7*(e-1)+i+1-(n.getUTCDay()||7);return n.setUTCDate(n.getUTCDate()+s),n}(e,a,l):new Date(NaN);var c=new Date(0);return function(t,e,i){return e>=0&&e<=11&&i>=1&&i<=(uo[e]||(fo(t)?29:28))}(e,r,o)&&function(t,e){return e>=1&&e<=(fo(t)?366:365)}(e,s)?(c.setUTCFullYear(e,r,Math.max(s,o)),c):new Date(NaN)}function ao(t){return t?parseInt(t):1}function lo(t){var e=t.match(io);if(!e)return NaN;var i=co(e[1]),n=co(e[2]),s=co(e[3]);return function(t,e,i){return 24===t?0===e&&0===i:i>=0&&i<60&&e>=0&&e<60&&t>=0&&t<25}(i,n,s)?36e5*i+6e4*n+1e3*s:NaN}function co(t){return t&&parseFloat(t.replace(",","."))||0}function ho(t){if("Z"===t)return 0;var e=t.match(no);if(!e)return 0;var i="+"===e[1]?-1:1,n=parseInt(e[2]),s=e[3]&&parseInt(e[3])||0;return function(t,e){return e>=0&&e<=59}(0,s)?i*(36e5*n+6e4*s):NaN}var uo=[31,null,31,30,31,30,31,31,30,31,30,31];function fo(t){return t%400==0||t%4==0&&t%100!=0}var go=i(78);function po(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function mo(t){for(var e=1;e0,"is-negative":e<0});return Object(c.createElement)("div",{className:r},Object(c.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"simpay-admin-charts-badge__icon",width:"16",height:"16"},e>0?Object(c.createElement)("path",{d:"M16.004 9.414l-8.607 8.607-1.414-1.414L14.589 8H7.004V6h11v11h-2V9.414z"}):Object(c.createElement)("path",{d:"M14.59 16.004L5.982 7.397l1.414-1.414 8.607 8.606V7.004h2v11h-11v-2z"})),!n&&Object(c.createElement)("span",null,Math.abs(e),"%"))},Eo="simpay-admin-charts-period-over-period__tooltip",jo=function(t){var e=t.position,i=t.opacity,n=t.data,s=t.delta,r=t.deltaChangedString;if(!n.length)return null;var o=e.top,a=e.left,l=e.right,h=Co()("simpay-admin-charts-badge",{"is-positive":s>0,"is-negative":s<0});return Object(c.createElement)("div",{className:Eo,style:{top:o,left:a||"auto",right:l||"auto",opacity:i}},n.map((function(t,e){var i=t.label,n=t.value;return Object(c.createElement)("div",{className:"".concat(Eo,"-data"),"data-dataset":e,key:i+Math.random()},Object(c.createElement)("strong",null,i)," ",Object(c.createElement)("em",null,Object(Wr.decodeEntities)(n)))})),0!==s&&Object(c.createElement)("div",{className:"".concat(Eo,"-delta")},Object(c.createElement)("div",{className:h},Object(c.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"simpay-admin-charts-badge__icon"},s>0?Object(c.createElement)("path",{fillRule:"evenodd",d:"M5.22 14.78a.75.75 0 001.06 0l7.22-7.22v5.69a.75.75 0 001.5 0v-7.5a.75.75 0 00-.75-.75h-7.5a.75.75 0 000 1.5h5.69l-7.22 7.22a.75.75 0 000 1.06z",clipRule:"evenodd"}):Object(c.createElement)("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06l7.22 7.22H6.75a.75.75 0 000 1.5h7.5a.747.747 0 00.75-.75v-7.5a.75.75 0 00-1.5 0v5.69L6.28 5.22z"}))),Object(c.createElement)("span",null,r)))},Ao=function(t){var e=t.chart,i=function(t,e){var i=Object(c.useState)({marginTop:0,marginRight:0,marginBottom:0,marginLeft:0}),n=l()(i,2),s=n[0],r=s.marginTop,o=s.marginRight,a=s.marginBottom,h=s.marginLeft,d=n[1];return Object(c.useEffect)((function(){t.current&&d({marginTop:Math.floor(t.current.chartArea.top),marginRight:Math.floor(t.current.width-t.current.chartArea.right),marginBottom:Math.floor(t.current.chartArea.bottom),marginLeft:Math.floor(t.current.chartArea.left)})}),[t,e]),{marginTop:r,marginRight:o,marginBottom:a,marginLeft:h}}(t.chartRef,e),n=i.marginLeft,s=i.marginRight;return Object(c.createElement)("div",{style:{width:"100%",position:"relative",fontSize:"12px",display:"flex",justifyContent:"space-between",marginTop:"-2px"}},Object(c.createElement)("div",{style:{marginLeft:n,textAlign:"left"}},e.datasets[0].data[0].x),Object(c.createElement)("div",{style:{marginRight:s,textAlign:"right"}},e.datasets[0].data[e.datasets[0].data.length-1].x))};function Lo(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Ro(t){for(var e=1;e0}))}));return Object(c.createElement)("div",{className:"simpay-admin-charts-period-over-period",style:r},!O&&Object(c.createElement)("div",{className:"simpay-admin-charts-no-data",style:Ro(Ro({},r),{},{height:"calc(".concat(r.height," + 15px)")})},a),Object(c.createElement)(Nr,{type:"line",ref:p,options:M,plugins:[_o,(_="rgb(".concat(f.primary_color.join(","),")"),{id:"YGridLineHover",afterDraw:function(t){var e;if(null!==(e=t.tooltip)&&void 0!==e&&null!==(e=e._active)&&void 0!==e&&e.length){var i=t.tooltip._active[0].element.x,n=t.scales.yAxis,s=t.ctx;s.save(),s.beginPath(),s.moveTo(i,n.top),s.lineTo(i,n.bottom),s.lineWidth=2,s.strokeStyle=_,s.stroke(),s.restore()}}})],data:{datasets:m}}),Object(c.createElement)(Ao,{chartRef:p,chart:f}),Object(c.createElement)(jo,s()({},y,{deltaChangedString:h(y)})),Object(c.createElement)(Vr.Popover.Slot,null))}},function(t,e){function i(){return t.exports=i=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var i=0,n=new Array(e);i=r.getTime()?i+1:e.getTime()>=l.getTime()?i:i-1}function f(t){Object(n.a)(1,arguments);var e=u(t),i=new Date(0);i.setUTCFullYear(e,0,4),i.setUTCHours(0,0,0,0);var s=d(i);return s}var g={};function p(){return g}function m(t,e){var i,s,r,a,c,h,d,u;Object(n.a)(1,arguments);var f=p(),g=Object(l.a)(null!==(i=null!==(s=null!==(r=null!==(a=null==e?void 0:e.weekStartsOn)&&void 0!==a?a:null==e||null===(c=e.locale)||void 0===c||null===(h=c.options)||void 0===h?void 0:h.weekStartsOn)&&void 0!==r?r:f.weekStartsOn)&&void 0!==s?s:null===(d=f.locale)||void 0===d||null===(u=d.options)||void 0===u?void 0:u.weekStartsOn)&&void 0!==i?i:0);if(!(g>=0&&g<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var m=Object(o.a)(t),b=m.getUTCDay(),x=(b=1&&x<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var y=new Date(0);y.setUTCFullYear(g+1,0,x),y.setUTCHours(0,0,0,0);var v=m(y,e),_=new Date(0);_.setUTCFullYear(g,0,x),_.setUTCHours(0,0,0,0);var w=m(_,e);return f.getTime()>=v.getTime()?g+1:f.getTime()>=w.getTime()?g:g-1}function x(t,e){var i,s,r,o,a,c,h,d;Object(n.a)(1,arguments);var u=p(),f=Object(l.a)(null!==(i=null!==(s=null!==(r=null!==(o=null==e?void 0:e.firstWeekContainsDate)&&void 0!==o?o:null==e||null===(a=e.locale)||void 0===a||null===(c=a.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==r?r:u.firstWeekContainsDate)&&void 0!==s?s:null===(h=u.locale)||void 0===h||null===(d=h.options)||void 0===d?void 0:d.firstWeekContainsDate)&&void 0!==i?i:1),g=b(t,e),x=new Date(0);x.setUTCFullYear(g,0,f),x.setUTCHours(0,0,0,0);var y=m(x,e);return y}function y(t,e){for(var i=t<0?"-":"",n=Math.abs(t).toString();n.length0?i:1-i;return y("yy"===e?n%100:n,e.length)},_=function(t,e){var i=t.getUTCMonth();return"M"===e?String(i+1):y(i+1,2)},w=function(t,e){return y(t.getUTCDate(),e.length)},M=function(t,e){return y(t.getUTCHours()%12||12,e.length)},O=function(t,e){return y(t.getUTCHours(),e.length)},k=function(t,e){return y(t.getUTCMinutes(),e.length)},S=function(t,e){return y(t.getUTCSeconds(),e.length)},D=function(t,e){var i=e.length,n=t.getUTCMilliseconds();return y(Math.floor(n*Math.pow(10,i-3)),e.length)};function P(t,e){var i=t>0?"-":"+",n=Math.abs(t),s=Math.floor(n/60),r=n%60;if(0===r)return i+String(s);var o=e||"";return i+String(s)+o+y(r,2)}function C(t,e){return t%60==0?(t>0?"-":"+")+y(Math.abs(t)/60,2):T(t,e)}function T(t,e){var i=e||"",n=t>0?"-":"+",s=Math.abs(t);return n+y(Math.floor(s/60),2)+i+y(s%60,2)}var E={G:function(t,e,i){var n=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return i.era(n,{width:"abbreviated"});case"GGGGG":return i.era(n,{width:"narrow"});case"GGGG":default:return i.era(n,{width:"wide"})}},y:function(t,e,i){if("yo"===e){var n=t.getUTCFullYear(),s=n>0?n:1-n;return i.ordinalNumber(s,{unit:"year"})}return v(t,e)},Y:function(t,e,i,n){var s=b(t,n),r=s>0?s:1-s;return"YY"===e?y(r%100,2):"Yo"===e?i.ordinalNumber(r,{unit:"year"}):y(r,e.length)},R:function(t,e){return y(u(t),e.length)},u:function(t,e){return y(t.getUTCFullYear(),e.length)},Q:function(t,e,i){var n=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return y(n,2);case"Qo":return i.ordinalNumber(n,{unit:"quarter"});case"QQQ":return i.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return i.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return i.quarter(n,{width:"wide",context:"formatting"})}},q:function(t,e,i){var n=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return y(n,2);case"qo":return i.ordinalNumber(n,{unit:"quarter"});case"qqq":return i.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return i.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return i.quarter(n,{width:"wide",context:"standalone"})}},M:function(t,e,i){var n=t.getUTCMonth();switch(e){case"M":case"MM":return _(t,e);case"Mo":return i.ordinalNumber(n+1,{unit:"month"});case"MMM":return i.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return i.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return i.month(n,{width:"wide",context:"formatting"})}},L:function(t,e,i){var n=t.getUTCMonth();switch(e){case"L":return String(n+1);case"LL":return y(n+1,2);case"Lo":return i.ordinalNumber(n+1,{unit:"month"});case"LLL":return i.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return i.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return i.month(n,{width:"wide",context:"standalone"})}},w:function(t,e,i,s){var r=function(t,e){Object(n.a)(1,arguments);var i=Object(o.a)(t),s=m(i,e).getTime()-x(i,e).getTime();return Math.round(s/6048e5)+1}(t,s);return"wo"===e?i.ordinalNumber(r,{unit:"week"}):y(r,e.length)},I:function(t,e,i){var s=function(t){Object(n.a)(1,arguments);var e=Object(o.a)(t),i=d(e).getTime()-f(e).getTime();return Math.round(i/6048e5)+1}(t);return"Io"===e?i.ordinalNumber(s,{unit:"week"}):y(s,e.length)},d:function(t,e,i){return"do"===e?i.ordinalNumber(t.getUTCDate(),{unit:"date"}):w(t,e)},D:function(t,e,i){var s=function(t){Object(n.a)(1,arguments);var e=Object(o.a)(t),i=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var s=e.getTime(),r=i-s;return Math.floor(r/864e5)+1}(t);return"Do"===e?i.ordinalNumber(s,{unit:"dayOfYear"}):y(s,e.length)},E:function(t,e,i){var n=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return i.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return i.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(n,{width:"short",context:"formatting"});case"EEEE":default:return i.day(n,{width:"wide",context:"formatting"})}},e:function(t,e,i,n){var s=t.getUTCDay(),r=(s-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(r);case"ee":return y(r,2);case"eo":return i.ordinalNumber(r,{unit:"day"});case"eee":return i.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return i.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(s,{width:"short",context:"formatting"});case"eeee":default:return i.day(s,{width:"wide",context:"formatting"})}},c:function(t,e,i,n){var s=t.getUTCDay(),r=(s-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(r);case"cc":return y(r,e.length);case"co":return i.ordinalNumber(r,{unit:"day"});case"ccc":return i.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return i.day(s,{width:"narrow",context:"standalone"});case"cccccc":return i.day(s,{width:"short",context:"standalone"});case"cccc":default:return i.day(s,{width:"wide",context:"standalone"})}},i:function(t,e,i){var n=t.getUTCDay(),s=0===n?7:n;switch(e){case"i":return String(s);case"ii":return y(s,e.length);case"io":return i.ordinalNumber(s,{unit:"day"});case"iii":return i.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return i.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return i.day(n,{width:"short",context:"formatting"});case"iiii":default:return i.day(n,{width:"wide",context:"formatting"})}},a:function(t,e,i){var n=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return i.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return i.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(t,e,i){var n,s=t.getUTCHours();switch(n=12===s?"noon":0===s?"midnight":s/12>=1?"pm":"am",e){case"b":case"bb":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return i.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return i.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(t,e,i){var n,s=t.getUTCHours();switch(n=s>=17?"evening":s>=12?"afternoon":s>=4?"morning":"night",e){case"B":case"BB":case"BBB":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return i.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return i.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(t,e,i){if("ho"===e){var n=t.getUTCHours()%12;return 0===n&&(n=12),i.ordinalNumber(n,{unit:"hour"})}return M(t,e)},H:function(t,e,i){return"Ho"===e?i.ordinalNumber(t.getUTCHours(),{unit:"hour"}):O(t,e)},K:function(t,e,i){var n=t.getUTCHours()%12;return"Ko"===e?i.ordinalNumber(n,{unit:"hour"}):y(n,e.length)},k:function(t,e,i){var n=t.getUTCHours();return 0===n&&(n=24),"ko"===e?i.ordinalNumber(n,{unit:"hour"}):y(n,e.length)},m:function(t,e,i){return"mo"===e?i.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):k(t,e)},s:function(t,e,i){return"so"===e?i.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):S(t,e)},S:function(t,e){return D(t,e)},X:function(t,e,i,n){var s=(n._originalDate||t).getTimezoneOffset();if(0===s)return"Z";switch(e){case"X":return C(s);case"XXXX":case"XX":return T(s);case"XXXXX":case"XXX":default:return T(s,":")}},x:function(t,e,i,n){var s=(n._originalDate||t).getTimezoneOffset();switch(e){case"x":return C(s);case"xxxx":case"xx":return T(s);case"xxxxx":case"xxx":default:return T(s,":")}},O:function(t,e,i,n){var s=(n._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+P(s,":");case"OOOO":default:return"GMT"+T(s,":")}},z:function(t,e,i,n){var s=(n._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+P(s,":");case"zzzz":default:return"GMT"+T(s,":")}},t:function(t,e,i,n){var s=n._originalDate||t;return y(Math.floor(s.getTime()/1e3),e.length)},T:function(t,e,i,n){return y((n._originalDate||t).getTime(),e.length)}},j=function(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},A=function(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},L={p:A,P:function(t,e){var i,n=t.match(/(P+)(p+)?/)||[],s=n[1],r=n[2];if(!r)return j(t,e);switch(s){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"})}return i.replace("{{date}}",j(s,e)).replace("{{time}}",A(r,e))}};function R(t){var e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}var F=["D","DD"],z=["YY","YYYY"];function I(t){return-1!==F.indexOf(t)}function N(t){return-1!==z.indexOf(t)}function V(t,e,i){if("YYYY"===t)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===t)throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===t)throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===t)throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var W={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function B(t){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.width?String(e.width):t.defaultWidth,n=t.formats[i]||t.formats[t.defaultWidth];return n}}var H={date:B({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:B({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:B({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},U={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function Y(t){return function(e,i){var n;if("formatting"===(null!=i&&i.context?String(i.context):"standalone")&&t.formattingValues){var s=t.defaultFormattingWidth||t.defaultWidth,r=null!=i&&i.width?String(i.width):s;n=t.formattingValues[r]||t.formattingValues[s]}else{var o=t.defaultWidth,a=null!=i&&i.width?String(i.width):t.defaultWidth;n=t.values[a]||t.values[o]}return n[t.argumentCallback?t.argumentCallback(e):e]}}function $(t){return function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.width,s=n&&t.matchPatterns[n]||t.matchPatterns[t.defaultMatchWidth],r=e.match(s);if(!r)return null;var o,a=r[0],l=n&&t.parsePatterns[n]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?q(l,(function(t){return t.test(a)})):X(l,(function(t){return t.test(a)}));o=t.valueCallback?t.valueCallback(c):c,o=i.valueCallback?i.valueCallback(o):o;var h=e.slice(a.length);return{value:o,rest:h}}}function X(t,e){for(var i in t)if(t.hasOwnProperty(i)&&e(t[i]))return i}function q(t,e){for(var i=0;i0?"in "+n:n+" ago":n},formatLong:H,formatRelative:function(t,e,i,n){return U[t]},localize:{ordinalNumber:function(t,e){var i=Number(t),n=i%100;if(n>20||n<10)switch(n%10){case 1:return i+"st";case 2:return i+"nd";case 3:return i+"rd"}return i+"th"},era:Y({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Y({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:Y({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:Y({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:Y({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(G={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(t){return parseInt(t,10)}},function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.match(G.matchPattern);if(!i)return null;var n=i[0],s=t.match(G.parsePattern);if(!s)return null;var r=G.valueCallback?G.valueCallback(s[0]):s[0];r=e.valueCallback?e.valueCallback(r):r;var o=t.slice(n.length);return{value:r,rest:o}}),era:$({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:$({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:$({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:$({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:$({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}},K=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Z=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,J=/^'([^]*?)'?$/,tt=/''/g,et=/[a-zA-Z]/;function it(t,e,i){var s,r,c,d,u,f,g,m,b,x,y,v,_,w,M,O,k,S;Object(n.a)(2,arguments);var D=String(e),P=p(),C=null!==(s=null!==(r=null==i?void 0:i.locale)&&void 0!==r?r:P.locale)&&void 0!==s?s:Q,T=Object(l.a)(null!==(c=null!==(d=null!==(u=null!==(f=null==i?void 0:i.firstWeekContainsDate)&&void 0!==f?f:null==i||null===(g=i.locale)||void 0===g||null===(m=g.options)||void 0===m?void 0:m.firstWeekContainsDate)&&void 0!==u?u:P.firstWeekContainsDate)&&void 0!==d?d:null===(b=P.locale)||void 0===b||null===(x=b.options)||void 0===x?void 0:x.firstWeekContainsDate)&&void 0!==c?c:1);if(!(T>=1&&T<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var j=Object(l.a)(null!==(y=null!==(v=null!==(_=null!==(w=null==i?void 0:i.weekStartsOn)&&void 0!==w?w:null==i||null===(M=i.locale)||void 0===M||null===(O=M.options)||void 0===O?void 0:O.weekStartsOn)&&void 0!==_?_:P.weekStartsOn)&&void 0!==v?v:null===(k=P.locale)||void 0===k||null===(S=k.options)||void 0===S?void 0:S.weekStartsOn)&&void 0!==y?y:0);if(!(j>=0&&j<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!C.localize)throw new RangeError("locale must contain localize property");if(!C.formatLong)throw new RangeError("locale must contain formatLong property");var A=Object(o.a)(t);if(!a(A))throw new RangeError("Invalid time value");var F=R(A),z=h(A,F),W={firstWeekContainsDate:T,weekStartsOn:j,locale:C,_originalDate:A},B=D.match(Z).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,L[e])(t,C.formatLong):t})).join("").match(K).map((function(n){if("''"===n)return"'";var s=n[0];if("'"===s)return nt(n);var r=E[s];if(r)return null!=i&&i.useAdditionalWeekYearTokens||!N(n)||V(n,e,String(t)),null!=i&&i.useAdditionalDayOfYearTokens||!I(n)||V(n,e,String(t)),r(z,n,C.localize,W);if(s.match(et))throw new RangeError("Format string contains an unescaped latin alphabet character `"+s+"`");return n})).join("");return B}function nt(t){var e=t.match(J);return e?e[1].replace(tt,"'"):t}},,,,,function(t,e,i){"use strict";i.r(e);var n=i(6),s=i.n(n),r=i(0),o=(i(37),i(10)),a=i(25),l=i.n(a),c=i(2),h=i(11),d=i.n(h);function u(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function f(t){for(var e=1;ewebhooks to be properly configured to populate correctly.","stripe"),{url:Object(r.createElement)("a",{href:y})})),Object(r.createElement)(p.Flex,null,Object(r.createElement)(p.Button,{variant:"link",onClick:function(){return e(!1)}},Object(c.__)("Close","stripe")),Object(r.createElement)(p.Button,{variant:"primary",isPrimary:!0,href:"https://dashboard.stripe.com/reports/hub",target:"_blank"},Object(c.__)("View advanced reports in Stripe →","stripe"))))},w=i(14),M=simpayAdminDashboardWidgetReport.currencies,O=new Date,k=function(t){var e=t.report,i=t.currency,n=t.setCurrency,o=t.range,a=t.setRange,l=e.data.delta,h=Object(r.useState)(!1),d=s()(h,2),u=d[0],f=d[1];return Object(r.createElement)("div",{className:"simpay-admin-dashboard-widget-report__data-filter"},Object(r.createElement)("div",{className:"simpay-admin-dashboard-widget-report__data-filter-title"},Object(r.createElement)("strong",null,Object(c.__)("Top Forms","stripe")),u&&Object(r.createElement)(_,{setIsOpen:f}),Object(r.createElement)(p.Button,{variant:"link",onClick:function(){return f(!0)}},Object(r.createElement)(m.a,{size:20,icon:b.a}))),Object(r.createElement)("div",{className:"simpay-admin-dashboard-widget-report__data-filter-controls"},!e.isLoading&&0!==l&&Object(r.createElement)(w.a,{delta:l}),Object(r.createElement)(p.SelectControl,{label:Object(c.__)("Currency","stripe"),hideLabelFromVision:!0,value:i,onChange:n,options:M.map((function(t){return{label:t,value:t.toLowerCase()}}))}),Object(r.createElement)(p.SelectControl,{label:Object(c.__)("Range","stripe"),hideLabelFromVision:!0,value:o.type,onChange:function(t){return a({type:t,start:Object(w.d)(t,O),end:Object(w.c)(t,o.end)})},options:[{label:"Today",value:"today"},{label:"Last 7 days",value:"7days"},{label:"Last 4 weeks",value:"4weeks"}]})))},S=i(15),D=i.n(S),P=i(17),C=function(t){var e=t.id,i=t.title,n=t.total_formatted,s=Object(o.addQueryArgs)("post.php",{post:e,action:"edit"});return Object(r.createElement)("div",{style:{display:"flex",justifyContent:"space-between"}},Object(r.createElement)("span",null,i?Object(r.createElement)("a",{href:s,target:"_blank",rel:"noreferrer"},i):Object(c.sprintf)(/* translators: %d Form ID. */ Object(c.__)("Payment form %d (deleted)","stripe"),e)),Object(r.createElement)("div",null,Object(r.createElement)("strong",null,Object(P.decodeEntities)(n))))},T=function(t){var e=t.report;if(e.isLoading)return Object(r.createElement)("div",{className:"simpay-admin-dashboard-widget-report__data-list"});var i=e.data.top_forms,n=i.top,s=i.remaining;return Object(r.createElement)("div",{className:"simpay-admin-dashboard-widget-report__data-list"},n.map((function(t){return Object(r.createElement)(C,D()({key:t.id},t))})),s.count>0&&Object(r.createElement)("div",{style:{display:"flex",justifyContent:"space-between"}},Object(r.createElement)("div",null,Object(c.sprintf)(/* translators: %d The number of forms included in results that are not shown. */ Object(c.__)("…and %d more","stripe"),s.count)),Object(r.createElement)("div",null,Object(P.decodeEntities)(s.total_formatted))))},E=simpayAdminDashboardWidgetReport,j=E.user_id,A=E.default_range,L=A.type,R=A.start,F=A.end,z=E.default_currency;Object(r.render)(Object(r.createElement)((function(){var t=Object(w.e)(j,"simpay_dashboard_widget_report_range",{start:Object(w.d)(L,R),end:Object(w.c)(L,F),type:L}),e=s()(t,2),i=e[0],n=e[1],a=Object(w.e)(j,"simpay_dashboard_widget_report_currency",z),h=s()(a,2),d=h[0],u=h[1],f=Object(r.useReducer)(g,{data:!1,isLoading:!0}),p=s()(f,2),m=p[0],b=p[1];return Object(r.useEffect)((function(){var t=Object(o.addQueryArgs)("/wpsp/__internal__/report/dashboard-widget",{range:i,currency:d});b({type:"START_RESOLUTION"}),l()({path:t}).then((function(t){b({type:"RECEIVE",data:t}),b({type:"FINISH_RESOLUTION"})}))}),[i,d]),Object(r.createElement)(r.Fragment,null,Object(r.createElement)("div",{className:"simpay-admin-dashboard-widget-report__chart"},Object(r.createElement)(w.b,{report:m,style:{width:"100%",height:"300px"},config:{yAxisIsCurrency:!0},noData:Object(r.createElement)("div",null,Object(r.createElement)("strong",null,Object(c.sprintf)(/* translators: %s Currency code. */ Object(c.__)("No %s transactions found.","stripe"),d.toUpperCase())),Object(r.createElement)("div",null,Object(c.__)("Please select a different currency, date range, or check back later.","stripe"))),deltaChangedString:function(t){return Object(r.createInterpolateElement)(Object(c.sprintf)(/* translators: %s: delta percentage */ diff --git a/includes/core/assets/js/dist/simpay-admin-form-template-explorer-css.asset.php b/includes/core/assets/js/dist/simpay-admin-form-template-explorer-css.asset.php index 80de1957..2cde2dd0 100644 --- a/includes/core/assets/js/dist/simpay-admin-form-template-explorer-css.asset.php +++ b/includes/core/assets/js/dist/simpay-admin-form-template-explorer-css.asset.php @@ -1 +1 @@ - array(), 'version' => '374a19a9c7d1b2e8f63c64cfdc233506'); \ No newline at end of file + array(), 'version' => 'f65ff075fab34cb49b6d582d31577036'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-form-template-explorer.asset.php b/includes/core/assets/js/dist/simpay-admin-form-template-explorer.asset.php index 4a372b96..14a894bd 100644 --- a/includes/core/assets/js/dist/simpay-admin-form-template-explorer.asset.php +++ b/includes/core/assets/js/dist/simpay-admin-form-template-explorer.asset.php @@ -1 +1 @@ - array('lodash', 'wp-a11y', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => 'add823490f99b1581a187fb38a6e7774'); \ No newline at end of file + array('lodash', 'wp-a11y', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => '5dce049d9407deb8d0ff4624ab58bb21'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-form-template-explorer.js b/includes/core/assets/js/dist/simpay-admin-form-template-explorer.js index 3ee0704b..dc41c979 100644 --- a/includes/core/assets/js/dist/simpay-admin-form-template-explorer.js +++ b/includes/core/assets/js/dist/simpay-admin-form-template-explorer.js @@ -1,4 +1,4 @@ -!function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.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 a in e)r.d(n,a,function(t){return e[t]}.bind(null,a));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=79)}([function(e,t){e.exports=window.wp.element},,function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wp.components},,,function(e,t,r){var n=r(26),a=r(27),o=r(21),l=r(28);e.exports=function(e,t){return n(e)||a(e,t)||o(e,t)||l()},e.exports.__esModule=!0,e.exports.default=e.exports},,,function(e,t){e.exports=window.wp.primitives},function(e,t){e.exports=window.wp.url},,function(e,t){e.exports=window.lodash},,function(e,t,r){var n;!function(){"use strict";var r={}.hasOwnProperty;function a(){for(var e=[],t=0;te.length)&&(t=e.length);for(var r=0,n=new Array(t);rbasic form. Have a suggestion for a new template? We'd love to hear it!","stripe"),{blank:Object(o.createElement)("a",{href:b}),suggest:Object(o.createElement)("a",{href:p,target:"_blank",rel:"noopener noreferrer"})})))},O=r(14),_=r.n(O),v="simpay-form-template-explorer-main__sidebar";function h(e){var t=e.selectedCategory,r=e.templateCategories,n=e.onClickCategory;return Object(o.createElement)(l.NavigableMenu,{orientation:"vertical",className:"".concat(v,"-categories")},Object.keys(r).map((function(e){var a=_()("category-".concat(e),"".concat(v,"-categories_category"));return Object(o.createElement)(l.Button,{key:e,label:r[e],className:a,isPressed:t===e,onClick:function(){n(e)}},r[e])})))}function E(e){var t=e.filterValue,r=e.setFilterValue;return Object(o.createElement)("div",{className:"".concat(v,"-search")},Object(o.createElement)(l.SearchControl,{onChange:r,value:t,label:Object(i.__)("Search for templates","stripe"),placeholder:Object(i.__)("Search","stripe")}))}var x=function(e){var t=e.selectedCategory,r=e.templateCategories,n=e.onClickCategory,a=e.filterValue,l=e.setFilterValue;return Object(o.createElement)("div",{className:v},Object(o.createElement)(E,{filterValue:a,setFilterValue:l}),!a&&Object(o.createElement)(h,{selectedCategory:t,templateCategories:r,onClickCategory:n}))},w=r(22),C=r(39),S=r(44),k=r(9),N=Object(o.createElement)(k.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(o.createElement)(k.Path,{d:"M8 5C8 3.34315 9.34315 2 11 2H13C14.6569 2 16 3.34315 16 5V9H18C19.2624 9 20 9.9804 20 11V19C20 20.0196 19.2624 21 18 21H6C4.73763 21 4 20.0196 4 19V11C4 9.9804 4.73763 9 6 9H8V5ZM9.5 9H14.5V5C14.5 4.17157 13.8284 3.5 13 3.5H11C10.1716 3.5 9.5 4.17157 9.5 5V9Z"})),M=r(64),P=simpayFormBuilderTemplateExplorer,V=P.alreadyPurchasedUrl,A=P.licenseLevel,L=P.upgradeUrl,U="simpay-form-template-explorer-upgrade",B=function(e){var t=e.template,r=e.setIsShowingUpgradeModal;return Object(o.createElement)(l.Modal,{title:Object(i.__)("Upgrade Required","stripe"),onRequestClose:function(){return r(!1)},className:U},Object(o.createElement)("div",{className:"".concat(U,"__content")},Object(o.createElement)(S.a,{icon:N,size:"48px"}),Object(o.createElement)("h3",{className:"".concat(U,"__title")},Object(i.sprintf)(/* translators: %s Template name */ -Object(i.__)('Unlock the "%s" Template',"stripe"),t.name)),Object(o.createElement)("p",{className:"".concat(U,"__description")},Object(o.createInterpolateElement)(Object(i.sprintf)(/* translators: %$ss Template name. %2$s Minimum license level. */ -Object(i.__)('We\'re sorry, the "%1$s" template is not available on your plan. Please upgrade to the %2$s plan or higher to unlock this and other awesome features.',"stripe"),t.name,Object(c.upperFirst)(t.license[0])),{strong:Object(o.createElement)("strong",null)})),Object(o.createElement)(l.Button,{isPrimary:!0,variant:"primary",href:Object(s.addQueryArgs)(L,{utm_content:t.name}),target:"_blank",rel:"noopener noreferrer"},"lite"===A?Object(i.__)("Upgrade to Pro","stripe"):Object(i.__)("See Upgrade Options","stripe")),Object(o.createElement)("a",{href:V,target:"_blank",rel:"noopener noreferrer",className:"".concat(U,"__purchased")},Object(i.__)("Already purchased?","stripe")),Object(o.createElement)("p",{className:"".concat(U,"__discount")},Object(o.createElement)(S.a,{icon:M.a}),"lite"===A?Object(o.createInterpolateElement)(Object(i.__)("Bonus: WP Simple Pay Lite users get 50% off regular price, automatically applied at checkout. Upgrade to Pro →","stripe"),{strong:Object(o.createElement)("strong",null),highlight:Object(o.createElement)("u",null),upgrade:Object(o.createElement)("a",{href:Object(s.addQueryArgs)(L,{utm_content:t.name}),target:"_blank",rel:"noopener noreferrer"})}):Object(o.createInterpolateElement)(Object(i.__)("Bonus: WP Simple Pay Pro users get 50% off upgrade pricing, automatically applied at checkout. See Upgrade Options →","stripe"),{strong:Object(o.createElement)("strong",null),highlight:Object(o.createElement)("u",null),upgrade:Object(o.createElement)("a",{href:Object(s.addQueryArgs)(L,{utm_content:t.name}),target:"_blank",rel:"noopener noreferrer"})}))))},F=simpayFormBuilderTemplateExplorer,T=F.licenseLevel,I=F.addNewUrl,H=F.isLite,W="simpay-form-template-explorer-main__content",z=["payment-button","donate-button","payment-form","product-installment-plan-form","product-purchse-form","product-subscription-form","product-subscription-form-coupon","recurring-service-setup-fee-form","recurring-service-trial-period-form","recurring-services-form","alipay-payment-button","giropay-payment-button","ideal-payment-button","przelewy24-payment-button"],Q=function(e){var t=e.template,r=Object(o.useState)(!1),n=a()(r,2),c=n[0],u=n[1],p=!t.license.includes(T),m=Object(s.addQueryArgs)(I,{"simpay-template":t.id}),d=Object(s.addQueryArgs)("https://wpsimplepay.com/templates/".concat(t.slug,"/"),{utm_source:"WordPress",utm_campaign:"1"===H?"lite-plugin":"pro-plugin",utm_medium:"template-explorer",utm_content:t.name});return Object(o.createElement)(o.Fragment,null,c&&Object(o.createElement)(B,{template:t,setIsShowingUpgradeModal:u}),Object(o.createElement)("div",{key:t.id,className:"".concat(W,"-list-item")},p&&Object(o.createElement)("div",{className:"".concat(W,"-list-item__badge")},Object(o.createElement)(S.a,{icon:N,size:"16px"})),Object(o.createElement)("div",{id:t.id,className:"".concat(W,"-list-item__name ").concat(p?"".concat(W,"-list-item__name--is-locked"):"")},t.name),Object(o.createElement)("div",{className:"".concat(W,"-list-item__description")},t.description),Object(o.createElement)("div",{className:"".concat(W,"-list-item__actions")},Object(o.createElement)(l.Button,{isPrimary:!0,variant:"primary",href:p?void 0:m,onClick:function(){return p?u(!0):null}},Object(i.__)("Use Template","stripe")),!z.includes(t.slug)&&Object(o.createElement)(l.Button,{isSecondary:!0,variant:"secondary",href:d,style:{marginLeft:"10px"},target:"_blank"},Object(i.__)("View Demo","stripe")))))},G=Object(o.createElement)(k.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(o.createElement)(k.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M6.68822 16.625L5.5 17.8145L5.5 5.5L18.5 5.5L18.5 16.625L6.68822 16.625ZM7.31 18.125L19 18.125C19.5523 18.125 20 17.6773 20 17.125L20 5C20 4.44772 19.5523 4 19 4H5C4.44772 4 4 4.44772 4 5V19.5247C4 19.8173 4.16123 20.086 4.41935 20.2237C4.72711 20.3878 5.10601 20.3313 5.35252 20.0845L7.31 18.125ZM16 9.99997H8V8.49997H16V9.99997ZM8 14H13V12.5H8V14Z"})),Z=simpayFormBuilderTemplateExplorer.suggestUrl,R=function(){return Object(o.createElement)("div",{className:"".concat("simpay-form-template-explorer-main__content","-suggest")},Object(o.createElement)("div",{style:{flexGrow:0}},Object(o.createElement)(S.a,{icon:G,size:"42px"})),Object(o.createElement)("div",null,Object(o.createElement)("h4",null,Object(i.__)("We need your help!","stripe")),Object(o.createElement)("p",null,Object(o.createInterpolateElement)(Object(i.__)("We're constantly building more pre-made payment form templates to get you up and running even faster. If you have ideas for future templates, please let us know!","stripe"),{suggest:Object(o.createElement)("a",{href:Z,target:"_blank",rel:"noopener noreferrer"})})),Object(o.createElement)(l.Button,{isSecondary:!0,variant:"secondary",isLink:!0,href:Z,target:"_blank"},Object(i.__)("Suggest a Template","stripe"))))},q=simpayFormBuilderTemplateExplorer,D=q.isLite,$=q.upgradeUrl,K=function(){return Object(o.createElement)("div",{className:"".concat("simpay-form-template-explorer-main__content","-upgrade")},Object(o.createElement)("div",null,Object(o.createElement)("h4",null,Object(i.__)("Get Access to All of Our Pre-Made Payment Form Templates","stripe")),Object(o.createElement)("p",null,Object(i.__)("Never start from scratch again! Upgrade to gain access to every payment form template we make and unlock powerful new features.","stripe"))),Object(o.createElement)(l.Button,{isSecondary:!0,variant:"primary",isLink:!0,size:"large",href:$,target:"_blank"},D?Object(i.__)("Upgrade to Pro","stripe"):Object(i.__)("Upgrade Now","stripe")))},J=r(29),X=r.n(J),Y=function(e){return e.name||""},ee=function(e){return e.description||""},te=function(e){return e.keywords||[]},re=function(e){return e.category};function ne(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(e=(e=Object(c.deburr)(e)).replace(/^\//,"")).toLowerCase()}var ae=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Object(c.words)(ne(e))},oe=function(e,t){return Object(c.differenceWith)(e,ae(t),(function(e,t){return t.includes(e)}))};function le(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.getName,a=void 0===n?Y:n,o=r.getDescription,l=void 0===o?ee:o,i=r.getKeywords,s=void 0===i?te:i,u=r.getCategory,p=void 0===u?re:u,m=a(e),d=l(e),f=s(e),b=p(e),g=ne(t),y=ne(m),j=0;if(g===y)j+=30;else if(y.startsWith(g))j+=20;else{var O=[m,d].concat(X()(f),[b]).join(" "),_=Object(c.words)(g),v=oe(_,O);0===v.length&&(j+=10)}return j}var ce=simpayFormBuilderTemplateExplorer,ie=ce.suggestUrl,se=ce.licenseLevel,ue=function(e){var t=e.filterValue,r=e.selectedCategory,n=e.templates,l=Object(w.useDebounce)(C.speak,500),s=Object(o.useMemo)((function(){var e=n;return t?e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=ae(t);if(0===n.length)return e;var o=e.map((function(e){return[e,le(e,t,r)]})).filter((function(e){return a()(e,2)[1]>0}));return o.sort((function(e,t){var r=a()(e,2)[1];return a()(t,2)[1]-r})),o.map((function(e){return a()(e,1)[0]}))}(n,t):""!==r&&(e=n.filter((function(e){return e.categories.includes(r)}))),Object(c.sortBy)(e,(function(e){return!e.license.includes(se)}))}),[t,r,n]);Object(o.useEffect)((function(){if(t){var e=s.length,r=Object(i.sprintf)(/* translators: %d: number of results. */ -Object(i._n)("%d result found.","%d results found.",e,"stripe"),e);l(r)}}),[t,l]);var u=!(null==s||!s.length),p=_()("simpay-form-template-explorer-main__content",{"is-empty":!u});return Object(o.createElement)("div",{className:p},!u&&Object(o.createElement)("p",null,Object(o.createInterpolateElement)(Object(i.__)("No results found. Have a suggestion for a new template? We'd love to hear it!","stripe"),{suggest:Object(o.createElement)("a",{href:ie,target:"_blank",rel:"noopener noreferrer"})})),u&&Object(o.createElement)(o.Fragment,null,s.map((function(e,r){var n=Object(o.createElement)(Q,{key:e.slug,template:e});return""===t&&["lite","personal","plus"].includes(se)&&5===r?Object(o.createElement)(o.Fragment,{key:"upgrade-frag"},n,Object(o.createElement)(K,null)):n})),Object(o.createElement)(R,null)))},pe=simpayFormBuilderTemplateExplorer,me=pe.hasNew,de=pe.templates,fe=pe.categories;Object(o.render)(Object(o.createElement)((function(){var e=Object(o.useState)(""),t=a()(e,2),r=t[0],n=t[1],c=Object(o.useState)(me?"new":""),i=a()(c,2),s=i[0],u=i[1];return Object(o.useEffect)((function(){document.querySelector("body").classList.add("simpay-template-explorer-open")}),[]),Object(o.createElement)(l.SlotFillProvider,null,Object(o.createElement)("div",{className:"simpay-form-template-explorer"},Object(o.createElement)(j,null),Object(o.createElement)("div",{className:"".concat("simpay-form-template-explorer","-main")},Object(o.createElement)(x,{selectedCategory:s,templateCategories:fe,onClickCategory:u,filterValue:r,setFilterValue:function(e){n(e),u("")}}),Object(o.createElement)(ue,{templates:de,templateCategories:fe,selectedCategory:s,filterValue:r}))),Object(o.createElement)(l.Popover.Slot,null))}),null),document.getElementById("simpay-form-template-explorer"))}]); \ No newline at end of file +!function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.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 a in e)r.d(n,a,function(t){return e[t]}.bind(null,a));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=81)}([function(e,t){e.exports=window.wp.element},,function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wp.components},,,function(e,t,r){var n=r(26),a=r(27),o=r(22),l=r(28);e.exports=function(e,t){return n(e)||a(e,t)||o(e,t)||l()},e.exports.__esModule=!0,e.exports.default=e.exports},,,function(e,t){e.exports=window.wp.primitives},function(e,t){e.exports=window.wp.url},,function(e,t){e.exports=window.lodash},function(e,t,r){var n;!function(){"use strict";var r={}.hasOwnProperty;function a(){for(var e=[],t=0;te.length)&&(t=e.length);for(var r=0,n=new Array(t);rbasic form. Have a suggestion for a new template? We'd love to hear it!","stripe"),{blank:Object(o.createElement)("a",{href:b}),suggest:Object(o.createElement)("a",{href:p,target:"_blank",rel:"noopener noreferrer"})})))},O=r(13),_=r.n(O),v=r(20),h=r(66),E=r(44),x=r(67),w=function e(t){var r=t.className,n=t.onChange,a=t.value,c=t.label,s=t.placeholder,u=void 0===s?Object(i.__)("Search"):s,p=t.hideLabelFromVision,m=void 0===p||p,d=t.help,f=Object(v.useInstanceId)(e),b=Object(o.useRef)(),g="components-search-control-".concat(f);return Object(o.createElement)(l.BaseControl,{label:c,id:g,hideLabelFromVision:m,help:d,className:_()(r,"components-search-control")},Object(o.createElement)("div",{className:"components-search-control__input-wrapper"},Object(o.createElement)("input",{ref:b,className:"components-search-control__input",id:g,type:"search",placeholder:u,onChange:function(e){return n(e.target.value)},autoComplete:"off",value:a||""}),Object(o.createElement)("div",{className:"components-search-control__icon"},!!a&&Object(o.createElement)(l.Button,{icon:h.a,label:Object(i.__)("Reset search","stripe"),onClick:function(){n(""),b.current.focus()}}),!a&&Object(o.createElement)(E.a,{icon:x.a}))))},C="simpay-form-template-explorer-main__sidebar";function S(e){var t=e.selectedCategory,r=e.templateCategories,n=e.onClickCategory;return Object(o.createElement)(l.NavigableMenu,{orientation:"vertical",className:"".concat(C,"-categories")},Object.keys(r).map((function(e){var a=_()("category-".concat(e),"".concat(C,"-categories_category"));return Object(o.createElement)(l.Button,{key:e,label:r[e],className:a,isPressed:t===e,onClick:function(){n(e)}},r[e])})))}function k(e){var t=e.filterValue,r=e.setFilterValue;return Object(o.createElement)("div",{className:"".concat(C,"-search")},Object(o.createElement)(w,{onChange:r,value:t,label:Object(i.__)("Search for templates","stripe"),placeholder:Object(i.__)("Search","stripe")}))}var N=function(e){var t=e.selectedCategory,r=e.templateCategories,n=e.onClickCategory,a=e.filterValue,l=e.setFilterValue;return Object(o.createElement)("div",{className:C},Object(o.createElement)(k,{filterValue:a,setFilterValue:l}),!a&&Object(o.createElement)(S,{selectedCategory:t,templateCategories:r,onClickCategory:n}))},M=r(39),P=r(9),V=Object(o.createElement)(P.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(o.createElement)(P.Path,{d:"M8 5C8 3.34315 9.34315 2 11 2H13C14.6569 2 16 3.34315 16 5V9H18C19.2624 9 20 9.9804 20 11V19C20 20.0196 19.2624 21 18 21H6C4.73763 21 4 20.0196 4 19V11C4 9.9804 4.73763 9 6 9H8V5ZM9.5 9H14.5V5C14.5 4.17157 13.8284 3.5 13 3.5H11C10.1716 3.5 9.5 4.17157 9.5 5V9Z"})),L=r(64),B=simpayFormBuilderTemplateExplorer,A=B.alreadyPurchasedUrl,U=B.licenseLevel,F=B.upgradeUrl,I="simpay-form-template-explorer-upgrade",T=function(e){var t=e.template,r=e.setIsShowingUpgradeModal;return Object(o.createElement)(l.Modal,{title:Object(i.__)("Upgrade Required","stripe"),onRequestClose:function(){return r(!1)},className:I},Object(o.createElement)("div",{className:"".concat(I,"__content")},Object(o.createElement)(E.a,{icon:V,size:"48px"}),Object(o.createElement)("h3",{className:"".concat(I,"__title")},Object(i.sprintf)(/* translators: %s Template name */ +Object(i.__)('Unlock the "%s" Template',"stripe"),t.name)),Object(o.createElement)("p",{className:"".concat(I,"__description")},Object(o.createInterpolateElement)(Object(i.sprintf)(/* translators: %$ss Template name. %2$s Minimum license level. */ +Object(i.__)('We\'re sorry, the "%1$s" template is not available on your plan. Please upgrade to the %2$s plan or higher to unlock this and other awesome features.',"stripe"),t.name,Object(c.upperFirst)(t.license[0])),{strong:Object(o.createElement)("strong",null)})),Object(o.createElement)(l.Button,{isPrimary:!0,variant:"primary",href:Object(s.addQueryArgs)(F,{utm_content:t.name}),target:"_blank",rel:"noopener noreferrer"},"lite"===U?Object(i.__)("Upgrade to Pro","stripe"):Object(i.__)("See Upgrade Options","stripe")),Object(o.createElement)("a",{href:A,target:"_blank",rel:"noopener noreferrer",className:"".concat(I,"__purchased")},Object(i.__)("Already purchased?","stripe")),Object(o.createElement)("p",{className:"".concat(I,"__discount")},Object(o.createElement)(E.a,{icon:L.a}),"lite"===U?Object(o.createInterpolateElement)(Object(i.__)("Bonus: WP Simple Pay Lite users get 50% off regular price, automatically applied at checkout. Upgrade to Pro →","stripe"),{strong:Object(o.createElement)("strong",null),highlight:Object(o.createElement)("u",null),upgrade:Object(o.createElement)("a",{href:Object(s.addQueryArgs)(F,{utm_content:t.name}),target:"_blank",rel:"noopener noreferrer"})}):Object(o.createInterpolateElement)(Object(i.__)("Bonus: WP Simple Pay Pro users get 50% off upgrade pricing, automatically applied at checkout. See Upgrade Options →","stripe"),{strong:Object(o.createElement)("strong",null),highlight:Object(o.createElement)("u",null),upgrade:Object(o.createElement)("a",{href:Object(s.addQueryArgs)(F,{utm_content:t.name}),target:"_blank",rel:"noopener noreferrer"})}))))},H=simpayFormBuilderTemplateExplorer,W=H.licenseLevel,z=H.addNewUrl,G=H.isLite,Q="simpay-form-template-explorer-main__content",R=["payment-button","donate-button","payment-form","product-installment-plan-form","product-purchse-form","product-subscription-form","product-subscription-form-coupon","recurring-service-setup-fee-form","recurring-service-trial-period-form","recurring-services-form","alipay-payment-button","giropay-payment-button","ideal-payment-button","przelewy24-payment-button"],Z=function(e){var t=e.template,r=Object(o.useState)(!1),n=a()(r,2),c=n[0],u=n[1],p=!t.license.includes(W),m=Object(s.addQueryArgs)(z,{"simpay-template":t.id}),d=Object(s.addQueryArgs)("https://wpsimplepay.com/templates/".concat(t.slug,"/"),{utm_source:"WordPress",utm_campaign:"1"===G?"lite-plugin":"pro-plugin",utm_medium:"template-explorer",utm_content:t.name});return Object(o.createElement)(o.Fragment,null,c&&Object(o.createElement)(T,{template:t,setIsShowingUpgradeModal:u}),Object(o.createElement)("div",{key:t.id,className:"".concat(Q,"-list-item")},p&&Object(o.createElement)("div",{className:"".concat(Q,"-list-item__badge")},Object(o.createElement)(E.a,{icon:V,size:"16px"})),Object(o.createElement)("div",{id:t.id,className:"".concat(Q,"-list-item__name ").concat(p?"".concat(Q,"-list-item__name--is-locked"):"")},t.name),Object(o.createElement)("div",{className:"".concat(Q,"-list-item__description")},t.description),Object(o.createElement)("div",{className:"".concat(Q,"-list-item__actions")},Object(o.createElement)(l.Button,{isPrimary:!0,variant:"primary",href:p?void 0:m,onClick:function(){return p?u(!0):null}},Object(i.__)("Use Template","stripe")),!R.includes(t.slug)&&Object(o.createElement)(l.Button,{isSecondary:!0,variant:"secondary",href:d,style:{marginLeft:"10px"},target:"_blank"},Object(i.__)("View Demo","stripe")))))},q=Object(o.createElement)(P.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(o.createElement)(P.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M6.68822 16.625L5.5 17.8145L5.5 5.5L18.5 5.5L18.5 16.625L6.68822 16.625ZM7.31 18.125L19 18.125C19.5523 18.125 20 17.6773 20 17.125L20 5C20 4.44772 19.5523 4 19 4H5C4.44772 4 4 4.44772 4 5V19.5247C4 19.8173 4.16123 20.086 4.41935 20.2237C4.72711 20.3878 5.10601 20.3313 5.35252 20.0845L7.31 18.125ZM16 9.99997H8V8.49997H16V9.99997ZM8 14H13V12.5H8V14Z"})),D=simpayFormBuilderTemplateExplorer.suggestUrl,$=function(){return Object(o.createElement)("div",{className:"".concat("simpay-form-template-explorer-main__content","-suggest")},Object(o.createElement)("div",{style:{flexGrow:0}},Object(o.createElement)(E.a,{icon:q,size:"42px"})),Object(o.createElement)("div",null,Object(o.createElement)("h4",null,Object(i.__)("We need your help!","stripe")),Object(o.createElement)("p",null,Object(o.createInterpolateElement)(Object(i.__)("We're constantly building more pre-made payment form templates to get you up and running even faster. If you have ideas for future templates, please let us know!","stripe"),{suggest:Object(o.createElement)("a",{href:D,target:"_blank",rel:"noopener noreferrer"})})),Object(o.createElement)(l.Button,{isSecondary:!0,variant:"secondary",isLink:!0,href:D,target:"_blank"},Object(i.__)("Suggest a Template","stripe"))))},K=simpayFormBuilderTemplateExplorer,J=K.isLite,X=K.upgradeUrl,Y=function(){return Object(o.createElement)("div",{className:"".concat("simpay-form-template-explorer-main__content","-upgrade")},Object(o.createElement)("div",null,Object(o.createElement)("h4",null,Object(i.__)("Get Access to All of Our Pre-Made Payment Form Templates","stripe")),Object(o.createElement)("p",null,Object(i.__)("Never start from scratch again! Upgrade to gain access to every payment form template we make and unlock powerful new features.","stripe"))),Object(o.createElement)(l.Button,{isSecondary:!0,variant:"primary",isLink:!0,size:"large",href:X,target:"_blank"},J?Object(i.__)("Upgrade to Pro","stripe"):Object(i.__)("Upgrade Now","stripe")))},ee=r(29),te=r.n(ee),re=function(e){return e.name||""},ne=function(e){return e.description||""},ae=function(e){return e.keywords||[]},oe=function(e){return e.category};function le(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(e=(e=Object(c.deburr)(e)).replace(/^\//,"")).toLowerCase()}var ce=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Object(c.words)(le(e))},ie=function(e,t){return Object(c.differenceWith)(e,ce(t),(function(e,t){return t.includes(e)}))};function se(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.getName,a=void 0===n?re:n,o=r.getDescription,l=void 0===o?ne:o,i=r.getKeywords,s=void 0===i?ae:i,u=r.getCategory,p=void 0===u?oe:u,m=a(e),d=l(e),f=s(e),b=p(e),g=le(t),y=le(m),j=0;if(g===y)j+=30;else if(y.startsWith(g))j+=20;else{var O=[m,d].concat(te()(f),[b]).join(" "),_=Object(c.words)(g),v=ie(_,O);0===v.length&&(j+=10)}return j}var ue=simpayFormBuilderTemplateExplorer,pe=ue.suggestUrl,me=ue.licenseLevel,de=function(e){var t=e.filterValue,r=e.selectedCategory,n=e.templates,l=Object(v.useDebounce)(M.speak,500),s=Object(o.useMemo)((function(){var e=n;return t?e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=ce(t);if(0===n.length)return e;var o=e.map((function(e){return[e,se(e,t,r)]})).filter((function(e){return a()(e,2)[1]>0}));return o.sort((function(e,t){var r=a()(e,2)[1];return a()(t,2)[1]-r})),o.map((function(e){return a()(e,1)[0]}))}(n,t):""!==r&&(e=n.filter((function(e){return e.categories.includes(r)}))),Object(c.sortBy)(e,(function(e){return!e.license.includes(me)}))}),[t,r,n]);Object(o.useEffect)((function(){if(t){var e=s.length,r=Object(i.sprintf)(/* translators: %d: number of results. */ +Object(i._n)("%d result found.","%d results found.",e,"stripe"),e);l(r)}}),[t,l]);var u=!(null==s||!s.length),p=_()("simpay-form-template-explorer-main__content",{"is-empty":!u});return Object(o.createElement)("div",{className:p},!u&&Object(o.createElement)("p",null,Object(o.createInterpolateElement)(Object(i.__)("No results found. Have a suggestion for a new template? We'd love to hear it!","stripe"),{suggest:Object(o.createElement)("a",{href:pe,target:"_blank",rel:"noopener noreferrer"})})),u&&Object(o.createElement)(o.Fragment,null,s.map((function(e,r){var n=Object(o.createElement)(Z,{key:e.slug,template:e});return""===t&&["lite","personal","plus"].includes(me)&&5===r?Object(o.createElement)(o.Fragment,{key:"upgrade-frag"},n,Object(o.createElement)(Y,null)):n})),Object(o.createElement)($,null)))},fe=simpayFormBuilderTemplateExplorer,be=fe.hasNew,ge=fe.templates,ye=fe.categories;Object(o.render)(Object(o.createElement)((function(){var e=Object(o.useState)(""),t=a()(e,2),r=t[0],n=t[1],c=Object(o.useState)(be?"new":""),i=a()(c,2),s=i[0],u=i[1];return Object(o.useEffect)((function(){document.querySelector("body").classList.add("simpay-template-explorer-open")}),[]),Object(o.createElement)(l.SlotFillProvider,null,Object(o.createElement)("div",{className:"simpay-form-template-explorer"},Object(o.createElement)(j,null),Object(o.createElement)("div",{className:"".concat("simpay-form-template-explorer","-main")},Object(o.createElement)(N,{selectedCategory:s,templateCategories:ye,onClickCategory:u,filterValue:r,setFilterValue:function(e){n(e),u("")}}),Object(o.createElement)(de,{templates:ge,templateCategories:ye,selectedCategory:s,filterValue:r}))),Object(o.createElement)(l.Popover.Slot,null))}),null),document.getElementById("simpay-form-template-explorer"))}]); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-help-css.asset.php b/includes/core/assets/js/dist/simpay-admin-help-css.asset.php index 8639218a..94f97812 100644 --- a/includes/core/assets/js/dist/simpay-admin-help-css.asset.php +++ b/includes/core/assets/js/dist/simpay-admin-help-css.asset.php @@ -1 +1 @@ - array(), 'version' => '410c8f231808c04de36b327b88c79222'); \ No newline at end of file + array(), 'version' => '657fa03a722399c998ae7b0233b5bb8d'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-help.asset.php b/includes/core/assets/js/dist/simpay-admin-help.asset.php index c98f974a..7df9e571 100644 --- a/includes/core/assets/js/dist/simpay-admin-help.asset.php +++ b/includes/core/assets/js/dist/simpay-admin-help.asset.php @@ -1 +1 @@ - array('lodash', 'wp-a11y', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-keycodes', 'wp-primitives', 'wp-url'), 'version' => '9e27307fcbc57bdefdd2b401ec9fa40b'); \ No newline at end of file + array('lodash', 'wp-a11y', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-keycodes', 'wp-primitives', 'wp-url'), 'version' => '340417a4172b75d60d3db387972142da'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-help.js b/includes/core/assets/js/dist/simpay-admin-help.js index e152225b..62736c2a 100644 --- a/includes/core/assets/js/dist/simpay-admin-help.js +++ b/includes/core/assets/js/dist/simpay-admin-help.js @@ -1,2 +1,2 @@ -!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=78)}([function(e,t){e.exports=window.wp.element},,function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wp.components},,,function(e,t,n){var r=n(26),o=n(27),c=n(21),a=n(28);e.exports=function(e,t){return r(e)||o(e,t)||c(e,t)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},,,function(e,t){e.exports=window.wp.primitives},function(e,t){e.exports=window.wp.url},,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;te.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n5&&Object(c.createElement)(a.Button,{variant:"secondary",isSecondary:!0,isSmall:!0,onClick:function(){return m(!0)}},Object(s.__)("View all","stripe"))))},N=simpayHelp,B=N.docs,L=N.docsCategories,R=function(){var e,t=Object(c.useState)("getting-started"),n=o()(t,2),r=n[0],a=n[1];return Object(c.createElement)("div",{className:"simpay-help-panel__categories"},(e=Object(P.groupBy)(B,"categories"),Object(P.map)(e,(function(e,t){return{slug:t,title:L[t]||"",docs:e}}))).map((function(e){return Object(c.createElement)(V,C()({key:e.slug,openCategory:r,setOpenCategory:a},e))})))},I=n(29),G=n.n(I);function D(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(e=(e=Object(P.deburr)(e)).replace(/^\//,"")).toLowerCase()}var W=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Object(P.words)(D(e))};function F(e,t){var n,r,o=e.title||"",c=e.excerpt||"",a=e.categories||[],l=e.tags||[],i=D(t),s=D(o),u=0;if(i===s)u+=30;else if(s.startsWith(i))u+=20;else{var p=[o,c].concat(G()(a),G()(l)).join(" ");0===(n=Object(P.words)(i),r=p,Object(P.differenceWith)(n,W(r),(function(e,t){return t.includes(e)}))).length&&(u+=10)}return u}var U=simpayHelp.docs,Z=function(e){var t=e.searchTerm,n=Object(c.useMemo)((function(){var e=[];return""!==t&&(e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=W(t);if(0===n.length)return e;var r=e.map((function(e){return[e,F(e,t)]})).filter((function(e){return o()(e,2)[1]>0}));return r.sort((function(e,t){var n=o()(e,2)[1];return o()(t,2)[1]-n})),r.map((function(e){return o()(e,1)[0]}))}(U,t)),e}),[t]),r=Object(d.useDebounce)(M.speak,500);Object(c.useEffect)((function(){if(t){var e=n.length,o=Object(s.sprintf)(/* translators: %d: number of results. */ -Object(s._n)("%d result found.","%d results found.",e,"stripe"),e);r(o)}}),[t,r]);var a=!(null==n||!n.length);return Object(c.createElement)("div",{className:"simpay-help-panel__results"},!a&&Object(c.createElement)(R,null),a&&n.map((function(e){return Object(c.createElement)(k,C()({key:e.id,searchTerm:t},e))})))},$=function(e){var t=e.onClose,n=e.onSearch,r=e.searchTerm,o=Object(d.useFocusOnMount)("firstElement"),l=function(e){var t=Object(c.useRef)(),n=Object(c.useRef)(!1),r=Object(c.useRef)([]),o=Object(c.useRef)(e);return o.current=e,Object(c.useLayoutEffect)((function(){!1===n.current&&e.forEach((function(e,n){var o=r.current[n];e!==o&&(h(o,null),h(e,t.current))})),r.current=e}),e),Object(c.useLayoutEffect)((function(){n.current=!1})),Object(c.useCallback)((function(e){h(t,e),n.current=!0;var c,a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return b(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)?b(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,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,c=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw c}}}}(e?o.current:r.current);try{for(a.s();!(c=a.n()).done;)h(c.value,e)}catch(e){a.e(e)}finally{a.f()}}),[])}([Object(d.useConstrainedTabbing)(),Object(d.useFocusReturn)(),o]);return Object(c.createElement)(a.Animate,{type:"slide-in",options:{origin:"left"}},(function(e){var o=e.className,i=m()("simpay-help-panel",o);return Object(c.createElement)("div",{ref:l,className:i},Object(c.createElement)(O,{onClose:t}),Object(c.createElement)("div",{className:"simpay-help-panel__search"},Object(c.createElement)(a.SearchControl,{label:Object(s.__)("Search the documentation","stripe"),placeholder:Object(s.__)("Search","stripe"),onChange:n,value:r}),Object(c.createElement)(Z,{searchTerm:r})),Object(c.createElement)(E,{searchTerm:r}))}))},Q=function(e){var t=e.isOpen,n=e.onClose;return Object(c.useEffect)((function(){return document.body.classList.toggle("simpay-help-body-locked"),function(){document.body.classList.remove("simpay-help-body-locked")}}),[t]),Object(c.createElement)("button",{className:"simpay-help-backdrop",onClick:n})},K=simpayHelp,q=K.docsSearchTerm,J=K.docs;function X(e){var t=Object(i.getFragment)(e),n=q;if(t&&t.includes("/")){var r=t.split("/");t=r[0],n=Object(i.safeDecodeURI)(r[1])}return{hash:t,searchTerm:n}}Object(c.render)(Object(c.createElement)((function(){var e=X(window.location.href),t=e.hash,n=e.searchTerm,r=Object(c.useState)(n),i=o()(r,2),s=i[0],u=i[1],f=Object(c.useState)("#help"===t),m=o()(f,2),d=m[0],b=m[1];function h(){b(!1),window.history.pushState("",document.title,window.location.pathname+window.location.search)}return Object(c.useEffect)((function(){function e(e){var t=X(e.newURL),r=t.hash,o=t.searchTerm;"#help"===r&&b(!0),o!==n&&u(o)}return window.addEventListener("hashchange",e),function(){window.removeEventListener("hashchange",e)}}),[]),Object(c.createElement)("div",{onKeyDown:function(e){e.keyCode!==l.ESCAPE||e.defaultPrevented||(e.preventDefault(),b(!1))},role:"region"},Object(c.createElement)(p,{isOpen:d,onOpen:function(){u(q),b(!0),window.history.pushState("",document.title,window.location.pathname+window.location.search+"#help")}}),d&&Object(c.createElement)(c.Fragment,null,Object(c.createElement)($,{onClose:h,onSearch:u,searchTerm:s,docs:J}),Object(c.createElement)(Q,{onClose:h})),Object(c.createElement)(a.Popover.Slot,null))}),null),document.getElementById("simpay-branding-bar-help"))}]); \ No newline at end of file +!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=80)}([function(e,t){e.exports=window.wp.element},,function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wp.components},,,function(e,t,n){var r=n(26),o=n(27),c=n(22),a=n(28);e.exports=function(e,t){return r(e)||o(e,t)||c(e,t)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},,,function(e,t){e.exports=window.wp.primitives},function(e,t){e.exports=window.wp.url},,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;te.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n5&&Object(c.createElement)(a.Button,{variant:"secondary",isSecondary:!0,isSmall:!0,onClick:function(){return f(!0)}},Object(s.__)("View all","stripe"))))},R=simpayHelp,I=R.docs,G=R.docsCategories,D=function(){var e,t=Object(c.useState)("getting-started"),n=o()(t,2),r=n[0],a=n[1];return Object(c.createElement)("div",{className:"simpay-help-panel__categories"},(e=Object(V.groupBy)(I,"categories"),Object(V.map)(e,(function(e,t){return{slug:t,title:G[t]||"",docs:e}}))).map((function(e){return Object(c.createElement)(H,k()({key:e.slug,openCategory:r,setOpenCategory:a},e))})))},F=n(29),W=n.n(F);function U(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(e=(e=Object(V.deburr)(e)).replace(/^\//,"")).toLowerCase()}var Z=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Object(V.words)(U(e))};function $(e,t){var n,r,o=e.title||"",c=e.excerpt||"",a=e.categories||[],l=e.tags||[],i=U(t),s=U(o),u=0;if(i===s)u+=30;else if(s.startsWith(i))u+=20;else{var p=[o,c].concat(W()(a),W()(l)).join(" ");0===(n=Object(V.words)(i),r=p,Object(V.differenceWith)(n,Z(r),(function(e,t){return t.includes(e)}))).length&&(u+=10)}return u}var Q=simpayHelp.docs,K=function(e){var t=e.searchTerm,n=Object(c.useMemo)((function(){var e=[];return""!==t&&(e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=Z(t);if(0===n.length)return e;var r=e.map((function(e){return[e,$(e,t)]})).filter((function(e){return o()(e,2)[1]>0}));return r.sort((function(e,t){var n=o()(e,2)[1];return o()(t,2)[1]-n})),r.map((function(e){return o()(e,1)[0]}))}(Q,t)),e}),[t]),r=Object(b.useDebounce)(P.speak,500);Object(c.useEffect)((function(){if(t){var e=n.length,o=Object(s.sprintf)(/* translators: %d: number of results. */ +Object(s._n)("%d result found.","%d results found.",e,"stripe"),e);r(o)}}),[t,r]);var a=!(null==n||!n.length);return Object(c.createElement)("div",{className:"simpay-help-panel__results"},!a&&Object(c.createElement)(D,null),a&&n.map((function(e){return Object(c.createElement)(N,k()({key:e.id,searchTerm:t},e))})))},q=function(e){var t=e.onClose,n=e.onSearch,r=e.searchTerm,o=Object(b.useFocusOnMount)("firstElement"),l=function(e){var t=Object(c.useRef)(),n=Object(c.useRef)(!1),r=Object(c.useRef)([]),o=Object(c.useRef)(e);return o.current=e,Object(c.useLayoutEffect)((function(){!1===n.current&&e.forEach((function(e,n){var o=r.current[n];e!==o&&(h(o,null),h(e,t.current))})),r.current=e}),e),Object(c.useLayoutEffect)((function(){n.current=!1})),Object(c.useCallback)((function(e){h(t,e),n.current=!0;var c,a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return 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 c,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,c=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw c}}}}(e?o.current:r.current);try{for(a.s();!(c=a.n()).done;)h(c.value,e)}catch(e){a.e(e)}finally{a.f()}}),[])}([Object(b.useConstrainedTabbing)(),Object(b.useFocusReturn)(),o]);return Object(c.createElement)(a.Animate,{type:"slide-in",options:{origin:"left"}},(function(e){var o=e.className,a=f()("simpay-help-panel",o);return Object(c.createElement)("div",{ref:l,className:a},Object(c.createElement)(v,{onClose:t}),Object(c.createElement)("div",{className:"simpay-help-panel__search"},Object(c.createElement)(M,{label:Object(s.__)("Search the documentation","stripe"),placeholder:Object(s.__)("Search","stripe"),onChange:n,value:r}),Object(c.createElement)(K,{searchTerm:r})),Object(c.createElement)(x,{searchTerm:r}))}))},J=function(e){var t=e.isOpen,n=e.onClose;return Object(c.useEffect)((function(){return document.body.classList.toggle("simpay-help-body-locked"),function(){document.body.classList.remove("simpay-help-body-locked")}}),[t]),Object(c.createElement)("button",{className:"simpay-help-backdrop",onClick:n})},X=simpayHelp,Y=X.docsSearchTerm,ee=X.docs;function te(e){var t=Object(i.getFragment)(e),n=Y;if(t&&t.includes("/")){var r=t.split("/");t=r[0],n=Object(i.safeDecodeURI)(r[1])}return{hash:t,searchTerm:n}}Object(c.render)(Object(c.createElement)((function(){var e=te(window.location.href),t=e.hash,n=e.searchTerm,r=Object(c.useState)(n),i=o()(r,2),s=i[0],u=i[1],m=Object(c.useState)("#help"===t),f=o()(m,2),b=f[0],d=f[1];function h(){d(!1),window.history.pushState("",document.title,window.location.pathname+window.location.search)}return Object(c.useEffect)((function(){function e(e){var t=te(e.newURL),r=t.hash,o=t.searchTerm;"#help"===r&&d(!0),o!==n&&u(o)}return window.addEventListener("hashchange",e),function(){window.removeEventListener("hashchange",e)}}),[]),Object(c.createElement)("div",{onKeyDown:function(e){e.keyCode!==l.ESCAPE||e.defaultPrevented||(e.preventDefault(),d(!1))},role:"region"},Object(c.createElement)(p,{isOpen:b,onOpen:function(){u(Y),d(!0),window.history.pushState("",document.title,window.location.pathname+window.location.search+"#help")}}),b&&Object(c.createElement)(c.Fragment,null,Object(c.createElement)(q,{onClose:h,onSearch:u,searchTerm:s,docs:ee}),Object(c.createElement)(J,{onClose:h})),Object(c.createElement)(a.Popover.Slot,null))}),null),document.getElementById("simpay-branding-bar-help"))}]); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-notifications-css.asset.php b/includes/core/assets/js/dist/simpay-admin-notifications-css.asset.php index 424a7c35..2c15c1b4 100644 --- a/includes/core/assets/js/dist/simpay-admin-notifications-css.asset.php +++ b/includes/core/assets/js/dist/simpay-admin-notifications-css.asset.php @@ -1 +1 @@ - array(), 'version' => 'ccb87477a8bed9b0e8f2ca5242289e30'); \ No newline at end of file + array(), 'version' => '30784043ec33dac042e57124a07cd0aa'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-notifications.asset.php b/includes/core/assets/js/dist/simpay-admin-notifications.asset.php index c4d18091..05a6377e 100644 --- a/includes/core/assets/js/dist/simpay-admin-notifications.asset.php +++ b/includes/core/assets/js/dist/simpay-admin-notifications.asset.php @@ -1 +1 @@ - array('lodash', 'moment', 'react', 'react-dom', 'wp-api-fetch', 'wp-autop', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => 'cdcd4da1e020aec5e51d9de7811f6fdd'); \ No newline at end of file + array('lodash', 'moment', 'react', 'react-dom', 'wp-api-fetch', 'wp-autop', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '7a8f10de49c3453462dd59a8e9f8066f'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-notifications.js b/includes/core/assets/js/dist/simpay-admin-notifications.js index d2b40297..351ccf63 100644 --- a/includes/core/assets/js/dist/simpay-admin-notifications.js +++ b/includes/core/assets/js/dist/simpay-admin-notifications.js @@ -1,3 +1,3 @@ -!function(t){var e={};function n(r){if(e[r])return e[r].exports;var s=e[r]={i:r,l:!1,exports:{}};return t[r].call(s.exports,s,s.exports,n),s.l=!0,s.exports}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 s in t)n.d(r,s,function(e){return t[e]}.bind(null,s));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=80)}([function(t,e){t.exports=window.wp.element},function(t,e,n){"use strict";n.d(e,"w",(function(){return s})),n.d(e,"a",(function(){return Ot})),n.d(e,"b",(function(){return q})),n.d(e,"c",(function(){return jt})),n.d(e,"d",(function(){return yt})),n.d(e,"e",(function(){return H})),n.d(e,"f",(function(){return dt})),n.d(e,"g",(function(){return Rt})),n.d(e,"h",(function(){return _})),n.d(e,"i",(function(){return zt})),n.d(e,"j",(function(){return qt})),n.d(e,"k",(function(){return S})),n.d(e,"l",(function(){return E})),n.d(e,"m",(function(){return M})),n.d(e,"n",(function(){return A})),n.d(e,"o",(function(){return U})),n.d(e,"p",(function(){return gt})),n.d(e,"q",(function(){return bt})),n.d(e,"r",(function(){return mt})),n.d(e,"s",(function(){return x})),n.d(e,"t",(function(){return Lt})),n.d(e,"u",(function(){return k})),n.d(e,"v",(function(){return w})),n.d(e,"x",(function(){return wt})),n.d(e,"y",(function(){return P})),n.d(e,"z",(function(){return Ut})),n.d(e,"A",(function(){return Ft})),n.d(e,"B",(function(){return $t})),n.d(e,"C",(function(){return Qt})),n.d(e,"D",(function(){return Gt}));let r=O();const s=t=>m(t,r);let o=O();s.write=t=>m(t,o);let i=O();s.onStart=t=>m(t,i);let a=O();s.onFrame=t=>m(t,a);let c=O();s.onFinish=t=>m(t,c);let u=[];s.setTimeout=(t,e)=>{let n=s.now()+e,r=()=>{let t=u.findIndex(t=>t.cancel==r);~t&&u.splice(t,1),p-=~t?1:0},o={time:n,handler:t,cancel:r};return u.splice(l(n),0,o),p+=1,b(),o};let l=t=>~(~u.findIndex(e=>e.time>t)||~u.length);s.cancel=t=>{i.delete(t),a.delete(t),r.delete(t),o.delete(t),c.delete(t)},s.sync=t=>{h=!0,s.batchedUpdates(t),h=!1},s.throttle=t=>{let e;function n(){try{t(...e)}finally{e=null}}function r(...t){e=t,s.onStart(n)}return r.handler=t,r.cancel=()=>{i.delete(n),e=null},r};let d="undefined"!=typeof window?window.requestAnimationFrame:()=>{};s.use=t=>d=t,s.now="undefined"!=typeof performance?()=>performance.now():Date.now,s.batchedUpdates=t=>t(),s.catch=console.error,s.frameLoop="always",s.advance=()=>{"demand"!==s.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):y()};let f=-1,p=0,h=!1;function m(t,e){h?(e.delete(t),t(0)):(e.add(t),b())}function b(){f<0&&(f=0,"demand"!==s.frameLoop&&d(g))}function g(){~f&&(d(g),s.batchedUpdates(y))}function y(){let t=f;f=s.now();let e=l(f);e&&(v(u.splice(0,e),t=>t.handler()),p-=e),i.flush(),r.flush(t?Math.min(64,f-t):16.667),a.flush(),o.flush(),c.flush(),p||(f=-1)}function O(){let t=new Set,e=t;return{add(n){p+=e!=t||t.has(n)?0:1,t.add(n)},delete:n=>(p-=e==t&&t.has(n)?1:0,t.delete(n)),flush(n){e.size&&(t=new Set,p-=e.size,v(e,e=>e(n)&&t.add(e)),p+=t.size,e=t)}}}function v(t,e){t.forEach(t=>{try{e(t)}catch(t){s.catch(t)}})}var j=n(5);function w(){}const _=(t,e,n)=>Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0}),x={arr:Array.isArray,obj:t=>!!t&&"Object"===t.constructor.name,fun:t=>"function"==typeof t,str:t=>"string"==typeof t,num:t=>"number"==typeof t,und:t=>void 0===t};function k(t,e){if(x.arr(t)){if(!x.arr(e)||t.length!==e.length)return!1;for(let n=0;nt.forEach(e);function E(t,e,n){if(x.arr(t))for(let r=0;rx.und(t)?[]:x.arr(t)?t:[t];function M(t,e){if(t.size){const n=Array.from(t);t.clear(),S(n,e)}}const A=(t,...e)=>M(t,t=>t(...e)),I=()=>"undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent);let C,R,T=null,N=!1,V=w;var q=Object.freeze({__proto__:null,get createStringInterpolator(){return C},get to(){return R},get colors(){return T},get skipAnimation(){return N},get willAdvance(){return V},assign:t=>{t.to&&(R=t.to),t.now&&(s.now=t.now),void 0!==t.colors&&(T=t.colors),null!=t.skipAnimation&&(N=t.skipAnimation),t.createStringInterpolator&&(C=t.createStringInterpolator),t.requestAnimationFrame&&s.use(t.requestAnimationFrame),t.batchedUpdates&&(s.batchedUpdates=t.batchedUpdates),t.willAdvance&&(V=t.willAdvance),t.frameLoop&&(s.frameLoop=t.frameLoop)}});const D=new Set;let z=[],L=[],F=0;const U={get idle(){return!D.size&&!z.length},start(t){F>t.priority?(D.add(t),s.onStart($)):(Q(t),s(G))},advance:G,sort(t){if(F)s.onFrame(()=>U.sort(t));else{const e=z.indexOf(t);~e&&(z.splice(e,1),B(t))}},clear(){z=[],D.clear()}};function $(){D.forEach(Q),D.clear(),s(G)}function Q(t){z.includes(t)||B(t)}function B(t){z.splice(function(e,n){const r=e.findIndex(e=>e.priority>t.priority);return r<0?e.length:r}(z),0,t)}function G(t){const e=L;for(let n=0;n0}const H={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},W="[-+]?\\d*\\.?\\d+";function Z(...t){return"\\(\\s*("+t.join(")\\s*,\\s*(")+")\\s*\\)"}const Y=new RegExp("rgb"+Z(W,W,W)),J=new RegExp("rgba"+Z(W,W,W,W)),K=new RegExp("hsl"+Z(W,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%")),X=new RegExp("hsla"+Z(W,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%",W)),tt=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,et=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,nt=/^#([0-9a-fA-F]{6})$/,rt=/^#([0-9a-fA-F]{8})$/;function st(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function ot(t,e,n){const r=n<.5?n*(1+e):n+e-n*e,s=2*n-r,o=st(s,r,t+1/3),i=st(s,r,t),a=st(s,r,t-1/3);return Math.round(255*o)<<24|Math.round(255*i)<<16|Math.round(255*a)<<8}function it(t){const e=parseInt(t,10);return e<0?0:e>255?255:e}function at(t){return(parseFloat(t)%360+360)%360/360}function ct(t){const e=parseFloat(t);return e<0?0:e>1?255:Math.round(255*e)}function ut(t){const e=parseFloat(t);return e<0?0:e>100?1:e/100}function lt(t){let e=function(t){let e;return"number"==typeof t?t>>>0===t&&t>=0&&t<=4294967295?t:null:(e=nt.exec(t))?parseInt(e[1]+"ff",16)>>>0:T&&void 0!==T[t]?T[t]:(e=Y.exec(t))?(it(e[1])<<24|it(e[2])<<16|it(e[3])<<8|255)>>>0:(e=J.exec(t))?(it(e[1])<<24|it(e[2])<<16|it(e[3])<<8|ct(e[4]))>>>0:(e=tt.exec(t))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+"ff",16)>>>0:(e=rt.exec(t))?parseInt(e[1],16)>>>0:(e=et.exec(t))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+e[4]+e[4],16)>>>0:(e=K.exec(t))?(255|ot(at(e[1]),ut(e[2]),ut(e[3])))>>>0:(e=X.exec(t))?(ot(at(e[1]),ut(e[2]),ut(e[3]))|ct(e[4]))>>>0:null}(t);return null===e?t:(e=e||0,`rgba(${(4278190080&e)>>>24}, ${(16711680&e)>>>16}, ${(65280&e)>>>8}, ${(255&e)/255})`)}const dt=(t,e,n)=>{if(x.fun(t))return t;if(x.arr(t))return dt({range:t,output:e,extrapolate:n});if(x.str(t.output[0]))return C(t);const r=t,s=r.output,o=r.range||[0,1],i=r.extrapolateLeft||r.extrapolate||"extend",a=r.extrapolateRight||r.extrapolate||"extend",c=r.easing||(t=>t);return t=>{const e=function(t,e){for(var n=1;n=t);++n);return n-1}(t,o);return function(t,e,n,r,s,o,i,a,c){let u=c?c(t):t;if(un){if("identity"===a)return u;"clamp"===a&&(u=n)}return r===s?r:e===n?t<=e?r:s:(e===-1/0?u=-u:n===1/0?u-=e:u=(u-e)/(n-e),u=o(u),r===-1/0?u=-u:s===1/0?u+=r:u=u*(s-r)+r,u)}(t,o[e],o[e+1],s[e],s[e+1],c,i,a,r.map)}};function ft(){return(ft=Object.assign||function(t){for(var e=1;eBoolean(t&&t[pt]),bt=t=>t&&t[pt]?t[pt]():t,gt=t=>t[ht]||null;function yt(t,e){let n=t[ht];n&&n.forEach(t=>{!function(t,e){t.eventObserved?t.eventObserved(e):t(e)}(t,e)})}class Ot{constructor(t){if(this[pt]=void 0,this[ht]=void 0,!t&&!(t=this.get))throw Error("Unknown getter");vt(this,t)}}const vt=(t,e)=>_t(t,pt,e);function jt(t,e){if(t[pt]){let n=t[ht];n||_t(t,ht,n=new Set),n.has(e)||(n.add(e),t.observerAdded&&t.observerAdded(n.size,e))}return e}function wt(t,e){let n=t[ht];if(n&&n.has(e)){const r=n.size-1;r?n.delete(e):t[ht]=null,t.observerRemoved&&t.observerRemoved(r,e)}}const _t=(t,e,n)=>Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0}),xt=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,kt=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,St=new RegExp(`(${xt.source})(%|[a-z]+)`,"i"),Et=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Pt=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,Mt=t=>{const[e,n]=At(t);if(!e||I())return t;const r=window.getComputedStyle(document.documentElement).getPropertyValue(e);if(r)return r.trim();if(n&&n.startsWith("--")){return window.getComputedStyle(document.documentElement).getPropertyValue(n)||t}return n&&Pt.test(n)?Mt(n):n||t},At=t=>{const e=Pt.exec(t);if(!e)return[,];const[,n,r]=e;return[n,r]};let It;const Ct=(t,e,n,r,s)=>`rgba(${Math.round(e)}, ${Math.round(n)}, ${Math.round(r)}, ${s})`,Rt=t=>{It||(It=T?new RegExp(`(${Object.keys(T).join("|")})(?!\\w)`,"g"):/^\b$/);const e=t.output.map(t=>bt(t).replace(Pt,Mt).replace(kt,lt).replace(It,lt)),n=e.map(t=>t.match(xt).map(Number)),r=n[0].map((t,e)=>n.map(t=>{if(!(e in t))throw Error('The arity of each "output" value must be equal');return t[e]})).map(e=>dt(ft({},t,{output:e})));return t=>{var n;const s=!St.test(e[0])&&(null==(n=e.find(t=>St.test(t)))?void 0:n.replace(xt,""));let o=0;return e[0].replace(xt,()=>`${r[o++](t)}${s||""}`).replace(Et,Ct)}},Tt="react-spring: ",Nt=t=>{const e=t;let n=!1;if("function"!=typeof e)throw new TypeError(Tt+"once requires a function parameter");return(...t)=>{n||(e(...t),n=!0)}},Vt=Nt(console.warn);function qt(){Vt(Tt+'The "interpolate" function is deprecated in v9 (use "to" instead)')}const Dt=Nt(console.warn);function zt(){Dt(Tt+'Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions')}function Lt(t){return x.str(t)&&("#"==t[0]||/\d/.test(t)||!I()&&Pt.test(t)||t in(T||{}))}const Ft="undefined"!=typeof window&&window.document&&window.document.createElement?j.useLayoutEffect:j.useEffect;function Ut(){const t=Object(j.useState)()[1],e=(()=>{const t=Object(j.useRef)(!1);return Ft(()=>(t.current=!0,()=>{t.current=!1}),[]),t})();return()=>{e.current&&t(Math.random())}}function $t(t,e){const[n]=Object(j.useState)(()=>({inputs:e,result:t()})),r=Object(j.useRef)(),s=r.current;let o=s;return o?Boolean(e&&o.inputs&&function(t,e){if(t.length!==e.length)return!1;for(let n=0;n{r.current=o,s==n&&(n.inputs=n.result=void 0)},[o]),o.result}const Qt=t=>Object(j.useEffect)(t,Bt),Bt=[];function Gt(t){const e=Object(j.useRef)();return Object(j.useEffect)(()=>{e.current=t}),e.current}},function(t,e){t.exports=window.wp.i18n},function(t,e){t.exports=window.wp.components},,function(t,e){t.exports=window.React},function(t,e,n){var r=n(26),s=n(27),o=n(21),i=n(28);t.exports=function(t,e){return r(t)||s(t,e)||o(t,e)||i()},t.exports.__esModule=!0,t.exports.default=t.exports},,,function(t,e){t.exports=window.wp.primitives},function(t,e){t.exports=window.wp.url},function(t,e,n){var r=n(30);t.exports=function(t,e,n){return(e=r(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=window.lodash},,function(t,e,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function s(){for(var t=[],e=0;et&&t[o],a=(t,e)=>Object(r.h)(t,o,e),c=t=>t&&t[o]&&t[o].getPayload();class u{constructor(){this.payload=void 0,a(this,this)}getPayload(){return this.payload||[]}}class l extends u{constructor(t){super(),this.done=!0,this.elapsedTime=void 0,this.lastPosition=void 0,this.lastVelocity=void 0,this.v0=void 0,this.durationProgress=0,this._value=t,r.s.num(this._value)&&(this.lastPosition=this._value)}static create(t){return new l(t)}getPayload(){return[this]}getValue(){return this._value}setValue(t,e){return r.s.num(t)&&(this.lastPosition=t,e&&(t=Math.round(t/e)*e,this.done&&(this.lastPosition=t))),this._value!==t&&(this._value=t,!0)}reset(){const{done:t}=this;this.done=!1,r.s.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,t&&(this.lastVelocity=null),this.v0=null)}}class d extends l{constructor(t){super(0),this._string=null,this._toString=void 0,this._toString=Object(r.f)({output:[t,t]})}static create(t){return new d(t)}getValue(){let t=this._string;return null==t?this._string=this._toString(this._value):t}setValue(t){if(r.s.str(t)){if(t==this._string)return!1;this._string=t,this._value=1}else{if(!super.setValue(t))return!1;this._string=null}return!0}reset(t){t&&(this._toString=Object(r.f)({output:[this.getValue(),t]})),this._value=0,super.reset()}}const f={dependencies:null};class p extends u{constructor(t){super(),this.source=t,this.setValue(t)}getValue(t){const e={};return Object(r.l)(this.source,(n,s)=>{var i;(i=n)&&i[o]===i?e[s]=n.getValue(t):Object(r.r)(n)?e[s]=Object(r.q)(n):t||(e[s]=n)}),e}setValue(t){this.source=t,this.payload=this._makePayload(t)}reset(){this.payload&&Object(r.k)(this.payload,t=>t.reset())}_makePayload(t){if(t){const e=new Set;return Object(r.l)(t,this._addToPayload,e),Array.from(e)}}_addToPayload(t){f.dependencies&&Object(r.r)(t)&&f.dependencies.add(t);const e=c(t);e&&Object(r.k)(e,t=>this.add(t))}}class h extends p{constructor(t){super(t)}static create(t){return new h(t)}getValue(){return this.source.map(t=>t.getValue())}setValue(t){const e=this.getPayload();return t.length==e.length?e.map((e,n)=>e.setValue(t[n])).some(Boolean):(super.setValue(t.map(m)),!0)}}function m(t){return(Object(r.t)(t)?d:l).create(t)}function b(t){const e=i(t);return e?e.constructor:r.s.arr(t)?h:Object(r.t)(t)?d:l}function g(){return(g=Object.assign||function(t){for(var e=1;e{const n=!r.s.fun(t)||t.prototype&&t.prototype.isReactComponent;return Object(s.forwardRef)((o,i)=>{const a=Object(s.useRef)(null),c=n&&Object(s.useCallback)(t=>{a.current=function(t,e){return t&&(r.s.fun(t)?t(e):t.current=e),e}(i,t)},[i]),[u,l]=function(t,e){const n=new Set;return f.dependencies=n,t.style&&(t=g({},t,{style:e.createAnimatedStyle(t.style)})),t=new p(t),f.dependencies=null,[t,n]}(o,e),d=Object(r.z)(),h=()=>{const t=a.current;n&&!t||!1===(!!t&&e.applyAnimatedValues(t,u.getValue(!0)))&&d()},m=new O(h,l),b=Object(s.useRef)();Object(r.A)(()=>(b.current=m,Object(r.k)(l,t=>Object(r.c)(t,m)),()=>{b.current&&(Object(r.k)(b.current.deps,t=>Object(r.x)(t,b.current)),r.w.cancel(b.current.update))})),Object(s.useEffect)(h,[]),Object(r.C)(()=>()=>{const t=b.current;Object(r.k)(t.deps,e=>Object(r.x)(e,t))});const y=e.getComponentProps(u.getValue());return s.createElement(t,g({},y,{ref:c}))})};class O{constructor(t,e){this.update=t,this.deps=e}eventObserved(t){"change"==t.type&&r.w.write(this.update)}}const v=Symbol.for("AnimatedComponent"),j=(t,{applyAnimatedValues:e=(()=>!1),createAnimatedStyle:n=(t=>new p(t)),getComponentProps:s=(t=>t)}={})=>{const o={applyAnimatedValues:e,createAnimatedStyle:n,getComponentProps:s},i=t=>{const e=w(t)||"Anonymous";return(t=r.s.str(t)?i[t]||(i[t]=y(t,o)):t[v]||(t[v]=y(t,o))).displayName=`Animated(${e})`,t};return Object(r.l)(t,(e,n)=>{r.s.arr(t)&&(n=w(e)),i[n]=i(e)}),{animated:i}},w=t=>r.s.str(t)?t:t&&r.s.str(t.displayName)?t.displayName:r.s.fun(t)&&t.name||null},function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n!0===t||!!(e&&t&&(r.s.fun(t)?t(e):Object(r.y)(t).includes(e))),u=(t,e)=>r.s.obj(t)?e&&t[e]:t,l=(t,e)=>!0===t.default?t[e]:t.default?t.default[e]:void 0,d=t=>t,f=(t,e=d)=>{let n=p;t.default&&!0!==t.default&&(t=t.default,n=Object.keys(t));const s={};for(const o of n){const n=e(t[o],o);r.s.und(n)||(s[o]=n)}return s},p=["config","onProps","onStart","onChange","onPause","onResume","onRest"],h={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function m(t){const e=function(t){const e={};let n=0;if(Object(r.l)(t,(t,r)=>{h[r]||(e[r]=t,n++)}),n)return e}(t);if(e){const n={to:e};return Object(r.l)(t,(t,r)=>r in e||(n[r]=t)),n}return i({},t)}function b(t){return t=Object(r.q)(t),r.s.arr(t)?t.map(b):Object(r.t)(t)?r.b.createStringInterpolator({range:[0,1],output:[t,t]})(1):t}function g(t){for(const e in t)return!0;return!1}function y(t){return r.s.fun(t)||r.s.arr(t)&&r.s.obj(t[0])}function O(t,e){var n;null==(n=t.ref)||n.delete(t),null==e||e.delete(t)}function v(t,e){var n;e&&t.ref!==e&&(null==(n=t.ref)||n.delete(t),e.add(t),t.ref=e)}const j={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}},w=1.70158,_=1.525*w,x=2*Math.PI/3,k=2*Math.PI/4.5,S=t=>{const e=7.5625,n=2.75;return t<1/n?e*t*t:t<2/n?e*(t-=1.5/n)*t+.75:t<2.5/n?e*(t-=2.25/n)*t+.9375:e*(t-=2.625/n)*t+.984375},E={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>1-(1-t)*(1-t),easeInOutQuad:t=>t<.5?2*t*t:1-Math.pow(-2*t+2,2)/2,easeInCubic:t=>t*t*t,easeOutCubic:t=>1-Math.pow(1-t,3),easeInOutCubic:t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2,easeInQuart:t=>t*t*t*t,easeOutQuart:t=>1-Math.pow(1-t,4),easeInOutQuart:t=>t<.5?8*t*t*t*t:1-Math.pow(-2*t+2,4)/2,easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>1-Math.pow(1-t,5),easeInOutQuint:t=>t<.5?16*t*t*t*t*t:1-Math.pow(-2*t+2,5)/2,easeInSine:t=>1-Math.cos(t*Math.PI/2),easeOutSine:t=>Math.sin(t*Math.PI/2),easeInOutSine:t=>-(Math.cos(Math.PI*t)-1)/2,easeInExpo:t=>0===t?0:Math.pow(2,10*t-10),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>0===t?0:1===t?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2,easeInCirc:t=>1-Math.sqrt(1-Math.pow(t,2)),easeOutCirc:t=>Math.sqrt(1-Math.pow(t-1,2)),easeInOutCirc:t=>t<.5?(1-Math.sqrt(1-Math.pow(2*t,2)))/2:(Math.sqrt(1-Math.pow(-2*t+2,2))+1)/2,easeInBack:t=>2.70158*t*t*t-w*t*t,easeOutBack:t=>1+2.70158*Math.pow(t-1,3)+w*Math.pow(t-1,2),easeInOutBack:t=>t<.5?Math.pow(2*t,2)*(7.189819*t-_)/2:(Math.pow(2*t-2,2)*((_+1)*(2*t-2)+_)+2)/2,easeInElastic:t=>0===t?0:1===t?1:-Math.pow(2,10*t-10)*Math.sin((10*t-10.75)*x),easeOutElastic:t=>0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin((10*t-.75)*x)+1,easeInOutElastic:t=>0===t?0:1===t?1:t<.5?-Math.pow(2,20*t-10)*Math.sin((20*t-11.125)*k)/2:Math.pow(2,-20*t+10)*Math.sin((20*t-11.125)*k)/2+1,easeInBounce:t=>1-S(1-t),easeOutBounce:S,easeInOutBounce:t=>t<.5?(1-S(1-2*t))/2:(1+S(2*t-1))/2},P=i({},j.default,{mass:1,damping:1,easing:E.linear,clamp:!1});class M{constructor(){this.tension=void 0,this.friction=void 0,this.frequency=void 0,this.damping=void 0,this.mass=void 0,this.velocity=0,this.restVelocity=void 0,this.precision=void 0,this.progress=void 0,this.duration=void 0,this.easing=void 0,this.clamp=void 0,this.bounce=void 0,this.decay=void 0,this.round=void 0,Object.assign(this,P)}}function A(t,e){if(r.s.und(e.decay)){const n=!r.s.und(e.tension)||!r.s.und(e.friction);!n&&r.s.und(e.frequency)&&r.s.und(e.damping)&&r.s.und(e.mass)||(t.duration=void 0,t.decay=void 0),n&&(t.frequency=void 0)}else t.duration=void 0}const I=[];class C{constructor(){this.changed=!1,this.values=I,this.toValues=null,this.fromValues=I,this.to=void 0,this.from=void 0,this.config=new M,this.immediate=!1}}function R(t,{key:e,props:n,defaultProps:s,state:o,actions:u}){return new Promise((l,d)=>{var f;let p,h,m=c(null!=(f=n.cancel)?f:null==s?void 0:s.cancel,e);if(m)y();else{r.s.und(n.pause)||(o.paused=c(n.pause,e));let t=null==s?void 0:s.pause;!0!==t&&(t=o.paused||c(t,e)),p=a(n.delay||0,e),t?(o.resumeQueue.add(g),u.pause()):(u.resume(),g())}function b(){o.resumeQueue.add(g),o.timeouts.delete(h),h.cancel(),p=h.time-r.w.now()}function g(){p>0&&!r.b.skipAnimation?(o.delayed=!0,h=r.w.setTimeout(y,p),o.pauseQueue.add(b),o.timeouts.add(h)):y()}function y(){o.delayed&&(o.delayed=!1),o.pauseQueue.delete(b),o.timeouts.delete(h),t<=(o.cancelId||0)&&(m=!0);try{u.start(i({},n,{callId:t,cancel:m}),l)}catch(t){d(t)}}})}const T=(t,e)=>1==e.length?e[0]:e.some(t=>t.cancelled)?q(t.get()):e.every(t=>t.noop)?N(t.get()):V(t.get(),e.every(t=>t.finished)),N=t=>({value:t,noop:!0,finished:!0,cancelled:!1}),V=(t,e,n=!1)=>({value:t,finished:e,cancelled:n}),q=t=>({value:t,cancelled:!0,finished:!1});function D(t,e,n,s){const{callId:o,parentId:a,onRest:c}=e,{asyncTo:u,promise:l}=n;return a||t!==u||e.reset?n.promise=(async()=>{n.asyncId=o,n.asyncTo=t;const d=f(e,(t,e)=>"onRest"===e?void 0:t);let p,h;const m=new Promise((t,e)=>(p=t,h=e)),b=t=>{const e=o<=(n.cancelId||0)&&q(s)||o!==n.asyncId&&V(s,!1);if(e)throw t.result=e,h(t),t},g=(t,e)=>{const a=new L,c=new F;return(async()=>{if(r.b.skipAnimation)throw z(n),c.result=V(s,!1),h(c),c;b(a);const u=r.s.obj(t)?i({},t):i({},e,{to:t});u.parentId=o,Object(r.l)(d,(t,e)=>{r.s.und(u[e])&&(u[e]=t)});const l=await s.start(u);return b(a),n.paused&&await new Promise(t=>{n.resumeQueue.add(t)}),l})()};let y;if(r.b.skipAnimation)return z(n),V(s,!1);try{let e;e=r.s.arr(t)?(async t=>{for(const e of t)await g(e)})(t):Promise.resolve(t(g,s.stop.bind(s))),await Promise.all([e.then(p),m]),y=V(s.get(),!0,!1)}catch(t){if(t instanceof L)y=t.result;else{if(!(t instanceof F))throw t;y=t.result}}finally{o==n.asyncId&&(n.asyncId=a,n.asyncTo=a?u:void 0,n.promise=a?l:void 0)}return r.s.fun(c)&&r.w.batchedUpdates(()=>{c(y,s,s.item)}),y})():l}function z(t,e){Object(r.m)(t.timeouts,t=>t.cancel()),t.pauseQueue.clear(),t.resumeQueue.clear(),t.asyncId=t.asyncTo=t.promise=void 0,e&&(t.cancelId=e)}class L extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise."),this.result=void 0}}class F extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const U=t=>t instanceof Q;let $=1;class Q extends r.a{constructor(...t){super(...t),this.id=$++,this.key=void 0,this._priority=0}get priority(){return this._priority}set priority(t){this._priority!=t&&(this._priority=t,this._onPriorityChange(t))}get(){const t=Object(o.e)(this);return t&&t.getValue()}to(...t){return r.b.to(this,t)}interpolate(...t){return Object(r.j)(),r.b.to(this,t)}toJSON(){return this.get()}observerAdded(t){1==t&&this._attach()}observerRemoved(t){0==t&&this._detach()}_attach(){}_detach(){}_onChange(t,e=!1){Object(r.d)(this,{type:"change",parent:this,value:t,idle:e})}_onPriorityChange(t){this.idle||r.o.sort(this),Object(r.d)(this,{type:"priority",parent:this,priority:t})}}const B=Symbol.for("SpringPhase"),G=t=>(1&t[B])>0,H=t=>(2&t[B])>0,W=t=>(4&t[B])>0,Z=(t,e)=>e?t[B]|=3:t[B]&=-3,Y=(t,e)=>e?t[B]|=4:t[B]&=-5;class J extends Q{constructor(t,e){if(super(),this.key=void 0,this.animation=new C,this.queue=void 0,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!r.s.und(t)||!r.s.und(e)){const n=r.s.obj(t)?i({},t):i({},e,{from:t});r.s.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(H(this)||this._state.asyncTo)||W(this)}get goal(){return Object(r.q)(this.animation.to)}get velocity(){const t=Object(o.e)(this);return t instanceof o.c?t.lastVelocity||0:t.getPayload().map(t=>t.lastVelocity||0)}get hasAnimated(){return G(this)}get isAnimating(){return H(this)}get isPaused(){return W(this)}get isDelayed(){return this._state.delayed}advance(t){let e=!0,n=!1;const s=this.animation;let{config:i,toValues:a}=s;const c=Object(o.g)(s.to);!c&&Object(r.r)(s.to)&&(a=Object(r.y)(Object(r.q)(s.to))),s.values.forEach((u,l)=>{if(u.done)return;const d=u.constructor==o.b?1:c?c[l].lastPosition:a[l];let f=s.immediate,p=d;if(!f){if(p=u.lastPosition,i.tension<=0)return void(u.done=!0);let e=u.elapsedTime+=t;const n=s.fromValues[l],o=null!=u.v0?u.v0:u.v0=r.s.arr(i.velocity)?i.velocity[l]:i.velocity;let a;if(r.s.und(i.duration))if(i.decay){const t=!0===i.decay?.998:i.decay,r=Math.exp(-(1-t)*e);p=n+o/(1-t)*(1-r),f=Math.abs(u.lastPosition-p)<.1,a=o*r}else{a=null==u.lastVelocity?o:u.lastVelocity;const e=i.precision||(n==d?.005:Math.min(1,.001*Math.abs(d-n))),s=i.restVelocity||e/10,c=i.clamp?0:i.bounce,l=!r.s.und(c),h=n==d?u.v0>0:ns,m||(f=Math.abs(d-p)<=e,!f));++t)l&&(b=p==d||p>d==h,b&&(a=-a*c,p=d)),a+=(1e-6*-i.tension*(p-d)+.001*-i.friction*a)/i.mass*g,p+=a*g}else{let r=1;i.duration>0&&(this._memoizedDuration!==i.duration&&(this._memoizedDuration=i.duration,u.durationProgress>0&&(u.elapsedTime=i.duration*u.durationProgress,e=u.elapsedTime+=t)),r=(i.progress||0)+e/this._memoizedDuration,r=r>1?1:r<0?0:r,u.durationProgress=r),p=n+i.easing(r)*(d-n),a=(p-u.lastPosition)/t,f=1==r}u.lastVelocity=a,Number.isNaN(p)&&(console.warn("Got NaN while animating:",this),f=!0)}c&&!c[l].done&&(f=!1),f?u.done=!0:e=!1,u.setValue(p,i.round)&&(n=!0)});const u=Object(o.e)(this),l=u.getValue();if(e){const t=Object(r.q)(s.to);l===t&&!n||i.decay?n&&i.decay&&this._onChange(l):(u.setValue(t),this._onChange(t)),this._stop()}else n&&this._onChange(l)}set(t){return r.w.batchedUpdates(()=>{this._stop(),this._focus(t),this._set(t)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(H(this)){const{to:t,config:e}=this.animation;r.w.batchedUpdates(()=>{this._onStart(),e.decay||this._set(t,!1),this._stop()})}return this}update(t){return(this.queue||(this.queue=[])).push(t),this}start(t,e){let n;return r.s.und(t)?(n=this.queue||[],this.queue=[]):n=[r.s.obj(t)?t:i({},e,{to:t})],Promise.all(n.map(t=>this._update(t))).then(t=>T(this,t))}stop(t){const{to:e}=this.animation;return this._focus(this.get()),z(this._state,t&&this._lastCallId),r.w.batchedUpdates(()=>this._stop(e,t)),this}reset(){this._update({reset:!0})}eventObserved(t){"change"==t.type?this._start():"priority"==t.type&&(this.priority=t.priority+1)}_prepareNode(t){const e=this.key||"";let{to:n,from:s}=t;n=r.s.obj(n)?n[e]:n,(null==n||y(n))&&(n=void 0),s=r.s.obj(s)?s[e]:s,null==s&&(s=void 0);const i={to:n,from:s};return G(this)||(t.reverse&&([n,s]=[s,n]),s=Object(r.q)(s),r.s.und(s)?Object(o.e)(this)||this._set(n):this._set(s)),i}_update(t,e){let n=i({},t);const{key:s,defaultProps:o}=this;n.default&&Object.assign(o,f(n,(t,e)=>/^on/.test(e)?u(t,s):t)),st(this,n,"onProps"),ot(this,"onProps",n,this);const a=this._prepareNode(n);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const c=this._state;return R(++this._lastCallId,{key:s,props:n,defaultProps:o,state:c,actions:{pause:()=>{W(this)||(Y(this,!0),Object(r.n)(c.pauseQueue),ot(this,"onPause",V(this,K(this,this.animation.to)),this))},resume:()=>{W(this)&&(Y(this,!1),H(this)&&this._resume(),Object(r.n)(c.resumeQueue),ot(this,"onResume",V(this,K(this,this.animation.to)),this))},start:this._merge.bind(this,a)}}).then(t=>{if(n.loop&&t.finished&&(!e||!t.noop)){const t=X(n);if(t)return this._update(t,!0)}return t})}_merge(t,e,n){if(e.cancel)return this.stop(!0),n(q(this));const s=!r.s.und(t.to),u=!r.s.und(t.from);if(s||u){if(!(e.callId>this._lastToId))return n(q(this));this._lastToId=e.callId}const{key:l,defaultProps:d,animation:f}=this,{to:p,from:h}=f;let{to:m=p,from:g=h}=t;!u||s||e.default&&!r.s.und(m)||(m=g),e.reverse&&([m,g]=[g,m]);const O=!Object(r.u)(g,h);O&&(f.from=g),g=Object(r.q)(g);const v=!Object(r.u)(m,p);v&&this._focus(m);const j=y(e.to),{config:w}=f,{decay:_,velocity:x}=w;(s||u)&&(w.velocity=0),e.config&&!j&&function(t,e,n){n&&(A(n=i({},n),e),e=i({},n,e)),A(t,e),Object.assign(t,e);for(const e in P)null==t[e]&&(t[e]=P[e]);let{mass:s,frequency:o,damping:a}=t;r.s.und(o)||(o<.01&&(o=.01),a<0&&(a=0),t.tension=Math.pow(2*Math.PI/o,2)*s,t.friction=4*Math.PI*a*s/o)}(w,a(e.config,l),e.config!==d.config?a(d.config,l):void 0);let k=Object(o.e)(this);if(!k||r.s.und(m))return n(V(this,!0));const S=r.s.und(e.reset)?u&&!e.default:!r.s.und(g)&&c(e.reset,l),E=S?g:this.get(),M=b(m),I=r.s.num(M)||r.s.arr(M)||Object(r.t)(M),C=!j&&(!I||c(d.immediate||e.immediate,l));if(v){const t=Object(o.f)(m);if(t!==k.constructor){if(!C)throw Error(`Cannot animate between ${k.constructor.name} and ${t.name}, as the "to" prop suggests`);k=this._set(M)}}const R=k.constructor;let T=Object(r.r)(m),z=!1;if(!T){const t=S||!G(this)&&O;(v||t)&&(z=Object(r.u)(b(E),M),T=!z),(Object(r.u)(f.immediate,C)||C)&&Object(r.u)(w.decay,_)&&Object(r.u)(w.velocity,x)||(T=!0)}if(z&&H(this)&&(f.changed&&!S?T=!0:T||this._stop(p)),!j&&((T||Object(r.r)(p))&&(f.values=k.getPayload(),f.toValues=Object(r.r)(m)?null:R==o.b?[1]:Object(r.y)(M)),f.immediate!=C&&(f.immediate=C,C||S||this._set(p)),T)){const{onRest:t}=f;Object(r.k)(rt,t=>st(this,e,t));const s=V(this,K(this,p));Object(r.n)(this._pendingCalls,s),this._pendingCalls.add(n),f.changed&&r.w.batchedUpdates(()=>{f.changed=!S,null==t||t(s,this),S?a(d.onRest,s):null==f.onStart||f.onStart(s,this)})}S&&this._set(E),j?n(D(e.to,e,this._state,this)):T?this._start():H(this)&&!v?this._pendingCalls.add(n):n(N(E))}_focus(t){const e=this.animation;t!==e.to&&(Object(r.p)(this)&&this._detach(),e.to=t,Object(r.p)(this)&&this._attach())}_attach(){let t=0;const{to:e}=this.animation;Object(r.r)(e)&&(Object(r.c)(e,this),U(e)&&(t=e.priority+1)),this.priority=t}_detach(){const{to:t}=this.animation;Object(r.r)(t)&&Object(r.x)(t,this)}_set(t,e=!0){const n=Object(r.q)(t);if(!r.s.und(n)){const t=Object(o.e)(this);if(!t||!Object(r.u)(n,t.getValue())){const s=Object(o.f)(n);t&&t.constructor==s?t.setValue(n):Object(o.h)(this,s.create(n)),t&&r.w.batchedUpdates(()=>{this._onChange(n,e)})}}return Object(o.e)(this)}_onStart(){const t=this.animation;t.changed||(t.changed=!0,ot(this,"onStart",V(this,K(this,t.to)),this))}_onChange(t,e){e||(this._onStart(),a(this.animation.onChange,t,this)),a(this.defaultProps.onChange,t,this),super._onChange(t,e)}_start(){const t=this.animation;Object(o.e)(this).reset(Object(r.q)(t.to)),t.immediate||(t.fromValues=t.values.map(t=>t.lastPosition)),H(this)||(Z(this,!0),W(this)||this._resume())}_resume(){r.b.skipAnimation?this.finish():r.o.start(this)}_stop(t,e){if(H(this)){Z(this,!1);const n=this.animation;Object(r.k)(n.values,t=>{t.done=!0}),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Object(r.d)(this,{type:"idle",parent:this});const s=e?q(this.get()):V(this.get(),K(this,null!=t?t:n.to));Object(r.n)(this._pendingCalls,s),n.changed&&(n.changed=!1,ot(this,"onRest",s,this))}}}function K(t,e){const n=b(e),s=b(t.get());return Object(r.u)(s,n)}function X(t,e=t.loop,n=t.to){let r=a(e);if(r){const s=!0!==r&&m(r),o=(s||t).reverse,a=!s||s.reset;return tt(i({},t,{loop:e,default:!1,pause:void 0,to:!o||y(n)?n:void 0,from:a?t.from:void 0,reset:a},s))}}function tt(t){const{to:e,from:n}=t=m(t),s=new Set;return r.s.obj(e)&&nt(e,s),r.s.obj(n)&&nt(n,s),t.keys=s.size?Array.from(s):null,t}function et(t){const e=tt(t);return r.s.und(e.default)&&(e.default=f(e)),e}function nt(t,e){Object(r.l)(t,(t,n)=>null!=t&&e.add(n))}const rt=["onStart","onRest","onChange","onPause","onResume"];function st(t,e,n){t.animation[n]=e[n]!==l(e,n)?u(e[n],t.key):void 0}function ot(t,e,...n){var r,s,o,i;null==(r=(s=t.animation)[e])||r.call(s,...n),null==(o=(i=t.defaultProps)[e])||o.call(i,...n)}const it=["onStart","onChange","onRest"];let at=1;class ct{constructor(t,e){this.id=at++,this.springs={},this.queue=[],this.ref=void 0,this._flush=void 0,this._initialProps=void 0,this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._item=void 0,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),e&&(this._flush=e),t&&this.start(i({default:!0},t))}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(t=>t.idle&&!t.isDelayed&&!t.isPaused)}get item(){return this._item}set item(t){this._item=t}get(){const t={};return this.each((e,n)=>t[n]=e.get()),t}set(t){for(const e in t){const n=t[e];r.s.und(n)||this.springs[e].set(n)}}update(t){return t&&this.queue.push(tt(t)),this}start(t){let{queue:e}=this;return t?e=Object(r.y)(t).map(tt):this.queue=[],this._flush?this._flush(this,e):(ht(this,e),ut(this,e))}stop(t,e){if(t!==!!t&&(e=t),e){const n=this.springs;Object(r.k)(Object(r.y)(e),e=>n[e].stop(!!t))}else z(this._state,this._lastAsyncId),this.each(e=>e.stop(!!t));return this}pause(t){if(r.s.und(t))this.start({pause:!0});else{const e=this.springs;Object(r.k)(Object(r.y)(t),t=>e[t].pause())}return this}resume(t){if(r.s.und(t))this.start({pause:!1});else{const e=this.springs;Object(r.k)(Object(r.y)(t),t=>e[t].resume())}return this}each(t){Object(r.l)(this.springs,t)}_onFrame(){const{onStart:t,onChange:e,onRest:n}=this._events,s=this._active.size>0,o=this._changed.size>0;(s&&!this._started||o&&!this._started)&&(this._started=!0,Object(r.m)(t,([t,e])=>{e.value=this.get(),t(e,this,this._item)}));const i=!s&&this._started,a=o||i&&n.size?this.get():null;o&&e.size&&Object(r.m)(e,([t,e])=>{e.value=a,t(e,this,this._item)}),i&&(this._started=!1,Object(r.m)(n,([t,e])=>{e.value=a,t(e,this,this._item)}))}eventObserved(t){if("change"==t.type)this._changed.add(t.parent),t.idle||this._active.add(t.parent);else{if("idle"!=t.type)return;this._active.delete(t.parent)}r.w.onFrame(this._onFrame)}}function ut(t,e){return Promise.all(e.map(e=>async function t(e,n,s){const{keys:o,to:i,from:a,loop:c,onRest:u,onResolve:d}=n,f=r.s.obj(n.default)&&n.default;c&&(n.loop=!1),!1===i&&(n.to=null),!1===a&&(n.from=null);const p=r.s.arr(i)||r.s.fun(i)?i:void 0;p?(n.to=void 0,n.onRest=void 0,f&&(f.onRest=void 0)):Object(r.k)(it,t=>{const s=n[t];if(r.s.fun(s)){const r=e._events[t];n[t]=({finished:t,cancelled:e})=>{const n=r.get(s);n?(t||(n.finished=!1),e&&(n.cancelled=!0)):r.set(s,{value:null,finished:t||!1,cancelled:e||!1})},f&&(f[t]=n[t])}});const h=e._state;n.pause===!h.paused?(h.paused=n.pause,Object(r.n)(n.pause?h.pauseQueue:h.resumeQueue)):h.paused&&(n.pause=!0);const m=(o||Object.keys(e.springs)).map(t=>e.springs[t].start(n)),b=!0===n.cancel||!0===l(n,"cancel");(p||b&&h.asyncId)&&m.push(R(++e._lastAsyncId,{props:n,state:h,actions:{pause:r.v,resume:r.v,start(t,n){b?(z(h,e._lastAsyncId),n(q(e))):(t.onRest=u,n(D(p,t,h,e)))}}})),h.paused&&await new Promise(t=>{h.resumeQueue.add(t)});const g=T(e,await Promise.all(m));if(c&&g.finished&&(!s||!g.noop)){const r=X(n,c,i);if(r)return ht(e,[r]),t(e,r,!0)}return d&&r.w.batchedUpdates(()=>d(g,e,e.item)),g}(t,e))).then(e=>T(t,e))}function lt(t,e){const n=i({},t.springs);return e&&Object(r.k)(Object(r.y)(e),t=>{r.s.und(t.keys)&&(t=tt(t)),r.s.obj(t.to)||(t=i({},t,{to:void 0})),pt(n,t,t=>ft(t))}),dt(t,n),n}function dt(t,e){Object(r.l)(e,(e,n)=>{t.springs[n]||(t.springs[n]=e,Object(r.c)(e,t))})}function ft(t,e){const n=new J;return n.key=t,e&&Object(r.c)(n,e),n}function pt(t,e,n){e.keys&&Object(r.k)(e.keys,r=>{(t[r]||(t[r]=n(r)))._prepareNode(e)})}function ht(t,e){Object(r.k)(e,e=>{pt(t.springs,e,e=>ft(e,t))})}const mt=["children"],bt=t=>{let{children:e}=t,n=function(t,e){if(null==t)return{};var n,r,s={},o=Object.keys(t);for(r=0;r=0||(s[n]=t[n]);return s}(t,mt);const o=Object(s.useContext)(gt),i=n.pause||!!o.pause,a=n.immediate||!!o.immediate;n=Object(r.B)(()=>({pause:i,immediate:a}),[i,a]);const{Provider:c}=gt;return s.createElement(c,{value:n},e)},gt=(yt=bt,Ot={},Object.assign(yt,s.createContext(Ot)),yt.Provider._context=yt,yt.Consumer._context=yt,yt);var yt,Ot;bt.Provider=gt.Provider,bt.Consumer=gt.Consumer;const vt=()=>{const t=[],e=function(e){Object(r.i)();const s=[];return Object(r.k)(t,(t,o)=>{if(r.s.und(e))s.push(t.start());else{const r=n(e,t,o);r&&s.push(t.start(r))}}),s};e.current=t,e.add=function(e){t.includes(e)||t.push(e)},e.delete=function(e){const n=t.indexOf(e);~n&&t.splice(n,1)},e.pause=function(){return Object(r.k)(t,t=>t.pause(...arguments)),this},e.resume=function(){return Object(r.k)(t,t=>t.resume(...arguments)),this},e.set=function(e){Object(r.k)(t,t=>t.set(e))},e.start=function(e){const n=[];return Object(r.k)(t,(t,s)=>{if(r.s.und(e))n.push(t.start());else{const r=this._getProps(e,t,s);r&&n.push(t.start(r))}}),n},e.stop=function(){return Object(r.k)(t,t=>t.stop(...arguments)),this},e.update=function(e){return Object(r.k)(t,(t,n)=>t.update(this._getProps(e,t,n))),this};const n=function(t,e,n){return r.s.fun(t)?t(n,e):t};return e._getProps=n,e};function jt(t,e,n){const o=r.s.fun(e)&&e;o&&!n&&(n=[]);const a=Object(s.useMemo)(()=>o||3==arguments.length?vt():void 0,[]),c=Object(s.useRef)(0),u=Object(r.z)(),l=Object(s.useMemo)(()=>({ctrls:[],queue:[],flush(t,e){const n=lt(t,e);return c.current>0&&!l.queue.length&&!Object.keys(n).some(e=>!t.springs[e])?ut(t,e):new Promise(r=>{dt(t,n),l.queue.push(()=>{r(ut(t,e))}),u()})}}),[]),d=Object(s.useRef)([...l.ctrls]),f=[],p=Object(r.D)(t)||0;function h(t,n){for(let r=t;r{Object(r.k)(d.current.slice(t,p),t=>{O(t,a),t.stop(!0)}),d.current.length=t,h(p,t)},[t]),Object(s.useMemo)(()=>{h(0,Math.min(p,t))},n);const m=d.current.map((t,e)=>lt(t,f[e])),b=Object(s.useContext)(bt),y=Object(r.D)(b),j=b!==y&&g(b);Object(r.A)(()=>{c.current++,l.ctrls=d.current;const{queue:t}=l;t.length&&(l.queue=[],Object(r.k)(t,t=>t())),Object(r.k)(d.current,(t,e)=>{null==a||a.add(t),j&&t.start({default:b});const n=f[e];n&&(v(t,n.ref),t.ref?t.queue.push(n):t.start(n))})}),Object(r.C)(()=>()=>{Object(r.k)(l.ctrls,t=>t.stop(!0))});const w=m.map(t=>i({},t));return a?[w,a]:w}function wt(t,e){const n=r.s.fun(t),[[s],o]=jt(1,n?t:[t],n?e||[]:e);return n||2==arguments.length?[s,o]:s}let _t;function xt(t,e,n){const o=r.s.fun(e)&&e,{reset:c,sort:u,trail:l=0,expires:d=!0,exitBeforeEnter:p=!1,onDestroyed:h,ref:b,config:y}=o?o():e,j=Object(s.useMemo)(()=>o||3==arguments.length?vt():void 0,[]),w=Object(r.y)(t),_=[],x=Object(s.useRef)(null),k=c?null:x.current;Object(r.A)(()=>{x.current=_}),Object(r.C)(()=>(Object(r.k)(x.current,t=>{var e;null==(e=t.ctrl.ref)||e.add(t.ctrl);const n=C.get(t);n&&t.ctrl.start(n.payload)}),()=>{Object(r.k)(x.current,t=>{t.expired&&clearTimeout(t.expirationId),O(t.ctrl,j),t.ctrl.stop(!0)})}));const S=St(w,o?o():e,k),E=c&&x.current||[];Object(r.A)(()=>Object(r.k)(E,({ctrl:t,item:e,key:n})=>{O(t,j),a(h,e,n)}));const P=[];if(k&&Object(r.k)(k,(t,e)=>{t.expired?(clearTimeout(t.expirationId),E.push(t)):~(e=P[e]=S.indexOf(t.key))&&(_[e]=t)}),Object(r.k)(w,(t,e)=>{_[e]||(_[e]={key:S[e],item:t,phase:_t.MOUNT,ctrl:new ct},_[e].ctrl.item=t)}),P.length){let t=-1;const{leave:n}=o?o():e;Object(r.k)(P,(e,r)=>{const s=k[r];~e?(t=_.indexOf(s),_[t]=i({},s,{item:w[e]})):n&&_.splice(++t,0,s)})}r.s.fun(u)&&_.sort((t,e)=>u(t.item,e.item));let M=-l;const A=Object(r.z)(),I=f(e),C=new Map,R=Object(s.useRef)(new Map),T=Object(s.useRef)(!1);Object(r.k)(_,(t,n)=>{const s=t.key,c=t.phase,u=o?o():e;let f,h,g=a(u.delay||0,s);if(c==_t.MOUNT)f=u.enter,h=_t.ENTER;else{const t=S.indexOf(s)<0;if(c!=_t.LEAVE)if(t)f=u.leave,h=_t.LEAVE;else{if(!(f=u.update))return;h=_t.UPDATE}else{if(t)return;f=u.enter,h=_t.ENTER}}if(f=a(f,t.item,n),f=r.s.obj(f)?m(f):{to:f},!f.config){const e=y||I.config;f.config=a(e,t.item,n,h)}M+=l;const O=i({},I,{delay:g+M,ref:b,immediate:u.immediate,reset:!1},f);if(h==_t.ENTER&&r.s.und(O.from)){const s=o?o():e,i=r.s.und(s.initial)||k?s.from:s.initial;O.from=a(i,t.item,n)}const{onResolve:v}=O;O.onResolve=t=>{a(v,t);const e=x.current,n=e.find(t=>t.key===s);if(n&&(!t.cancelled||n.phase==_t.UPDATE)&&n.ctrl.idle){const t=e.every(t=>t.ctrl.idle);if(n.phase==_t.LEAVE){const e=a(d,n.item);if(!1!==e){const r=!0===e?0:e;if(n.expired=!0,!t&&r>0)return void(r<=2147483647&&(n.expirationId=setTimeout(A,r)))}}t&&e.some(t=>t.expired)&&(R.current.delete(n),p&&(T.current=!0),A())}};const j=lt(t.ctrl,O);h===_t.LEAVE&&p?R.current.set(t,{phase:h,springs:j,payload:O}):C.set(t,{phase:h,springs:j,payload:O})});const N=Object(s.useContext)(bt),V=Object(r.D)(N),q=N!==V&&g(N);Object(r.A)(()=>{q&&Object(r.k)(_,t=>{t.ctrl.start({default:N})})},[N]),Object(r.k)(C,(t,e)=>{if(R.current.size){const t=_.findIndex(t=>t.key===e.key);_.splice(t,1)}}),Object(r.A)(()=>{Object(r.k)(R.current.size?R.current:C,({phase:t,payload:e},n)=>{const{ctrl:r}=n;n.phase=t,null==j||j.add(r),q&&t==_t.ENTER&&r.start({default:N}),e&&(v(r,e.ref),r.ref&&!T.current?r.update(e):(r.start(e),T.current&&(T.current=!1)))})},c?void 0:n);const D=t=>s.createElement(s.Fragment,null,_.map((e,n)=>{const{springs:o}=C.get(e)||e.ctrl,a=t(i({},o),e.item,e,n);return a&&a.type?s.createElement(a.type,i({},a.props,{key:r.s.str(e.key)||r.s.num(e.key)?e.key:e.ctrl.id,ref:a.ref})):a}));return j?[D,j]:D}!function(t){t.MOUNT="mount",t.ENTER="enter",t.UPDATE="update",t.LEAVE="leave"}(_t||(_t={}));let kt=1;function St(t,{key:e,keys:n=e},s){if(null===n){const e=new Set;return t.map(t=>{const n=s&&s.find(n=>n.item===t&&n.phase!==_t.LEAVE&&!e.has(n));return n?(e.add(n),n.key):kt++})}return r.s.und(n)?t:r.s.fun(n)?t.map(n):Object(r.y)(n)}class Et extends Q{constructor(t,e){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=t,this.calc=Object(r.f)(...e);const n=this._get(),s=Object(o.f)(n);Object(o.h)(this,s.create(n))}advance(t){const e=this._get(),n=this.get();Object(r.u)(e,n)||(Object(o.e)(this).setValue(e),this._onChange(e,this.idle)),!this.idle&&Mt(this._active)&&At(this)}_get(){const t=r.s.arr(this.source)?this.source.map(r.q):Object(r.y)(Object(r.q)(this.source));return this.calc(...t)}_start(){this.idle&&!Mt(this._active)&&(this.idle=!1,Object(r.k)(Object(o.g)(this),t=>{t.done=!1}),r.b.skipAnimation?(r.w.batchedUpdates(()=>this.advance()),At(this)):r.o.start(this))}_attach(){let t=1;Object(r.k)(Object(r.y)(this.source),e=>{Object(r.r)(e)&&Object(r.c)(e,this),U(e)&&(e.idle||this._active.add(e),t=Math.max(t,e.priority+1))}),this.priority=t,this._start()}_detach(){Object(r.k)(Object(r.y)(this.source),t=>{Object(r.r)(t)&&Object(r.x)(t,this)}),this._active.clear(),At(this)}eventObserved(t){"change"==t.type?t.idle?this.advance():(this._active.add(t.parent),this._start()):"idle"==t.type?this._active.delete(t.parent):"priority"==t.type&&(this.priority=Object(r.y)(this.source).reduce((t,e)=>Math.max(t,(U(e)?e.priority:0)+1),0))}}function Pt(t){return!1!==t.idle}function Mt(t){return!t.size||Array.from(t).every(Pt)}function At(t){t.idle||(t.idle=!0,Object(r.k)(Object(o.g)(t),t=>{t.done=!0}),Object(r.d)(t,{type:"idle",parent:t}))}r.b.assign({createStringInterpolator:r.g,to:(t,e)=>new Et(t,e)}),r.o.advance},,function(t,e){t.exports=window.regeneratorRuntime},,,function(t,e,n){"use strict";n.d(e,"animated",(function(){return _}));var r=n(43);n.o(r,"config")&&n.d(e,"config",(function(){return r.config})),n.o(r,"useSpring")&&n.d(e,"useSpring",(function(){return r.useSpring})),n.o(r,"useTransition")&&n.d(e,"useTransition",(function(){return r.useTransition}));var s=n(55),o=n(1),i=n(19);function a(t,e){if(null==t)return{};var n,r,s={},o=Object.keys(t);for(r=0;r=0||(s[n]=t[n]);return s}const c=["style","children","scrollTop","scrollLeft"],u=/^--/;function l(t,e){return null==e||"boolean"==typeof e||""===e?"":"number"!=typeof e||0===e||u.test(t)||f.hasOwnProperty(t)&&f[t]?(""+e).trim():e+"px"}const d={};let f={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};const p=["Webkit","Ms","Moz","O"];f=Object.keys(f).reduce((t,e)=>(p.forEach(n=>t[((t,e)=>t+e.charAt(0).toUpperCase()+e.substring(1))(n,e)]=t[e]),t),f);const h=["x","y","z"],m=/^(matrix|translate|scale|rotate|skew)/,b=/^(translate)/,g=/^(rotate|skew)/,y=(t,e)=>o.s.num(t)&&0!==t?t+e:t,O=(t,e)=>o.s.arr(t)?t.every(t=>O(t,e)):o.s.num(t)?t===e:parseFloat(t)===e;class v extends i.a{constructor(t){let{x:e,y:n,z:r}=t,s=a(t,h);const i=[],c=[];(e||n||r)&&(i.push([e||0,n||0,r||0]),c.push(t=>[`translate3d(${t.map(t=>y(t,"px")).join(",")})`,O(t,0)])),Object(o.l)(s,(t,e)=>{if("transform"===e)i.push([t||""]),c.push(t=>[t,""===t]);else if(m.test(e)){if(delete s[e],o.s.und(t))return;const n=b.test(e)?"px":g.test(e)?"deg":"";i.push(Object(o.y)(t)),c.push("rotate3d"===e?([t,e,r,s])=>[`rotate3d(${t},${e},${r},${y(s,n)})`,O(s,0)]:t=>[`${e}(${t.map(t=>y(t,n)).join(",")})`,O(t,e.startsWith("scale")?1:0)])}}),i.length&&(s.transform=new j(i,c)),super(s)}}class j extends o.a{constructor(t,e){super(),this._value=null,this.inputs=t,this.transforms=e}get(){return this._value||(this._value=this._get())}_get(){let t="",e=!0;return Object(o.k)(this.inputs,(n,r)=>{const s=Object(o.q)(n[0]),[i,a]=this.transforms[r](o.s.arr(s)?s:n.map(o.q));t+=" "+i,e=e&&a}),e?"none":t}observerAdded(t){1==t&&Object(o.k)(this.inputs,t=>Object(o.k)(t,t=>Object(o.r)(t)&&Object(o.c)(t,this)))}observerRemoved(t){0==t&&Object(o.k)(this.inputs,t=>Object(o.k)(t,t=>Object(o.r)(t)&&Object(o.x)(t,this)))}eventObserved(t){"change"==t.type&&(this._value=null),Object(o.d)(this,t)}}const w=["scrollTop","scrollLeft"];r.Globals.assign({batchedUpdates:s.unstable_batchedUpdates,createStringInterpolator:o.g,colors:o.e});const _=Object(i.d)(["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"],{applyAnimatedValues:function(t,e){if(!t.nodeType||!t.setAttribute)return!1;const n="filter"===t.nodeName||t.parentNode&&"filter"===t.parentNode.nodeName,r=e,{style:s,children:o,scrollTop:i,scrollLeft:f}=r,p=a(r,c),h=Object.values(p),m=Object.keys(p).map(e=>n||t.hasAttribute(e)?e:d[e]||(d[e]=e.replace(/([A-Z])/g,t=>"-"+t.toLowerCase())));void 0!==o&&(t.textContent=o);for(let e in s)if(s.hasOwnProperty(e)){const n=l(e,s[e]);u.test(e)?t.style.setProperty(e,n):t.style[e]=n}m.forEach((e,n)=>{t.setAttribute(e,h[n])}),void 0!==i&&(t.scrollTop=i),void 0!==f&&(t.scrollLeft=f)},createAnimatedStyle:t=>new v(t),getComponentProps:t=>a(t,w)}).animated},function(t,e){},function(t,e){},,,,,function(t,e){t.exports=window.ReactDOM},function(t,e){t.exports=window.moment},function(t,e){t.exports=window.wp.autop},function(t,e){function n(t,e,n,r,s,o,i){try{var a=t[o](i),c=a.value}catch(t){return void n(t)}a.done?e(c):Promise.resolve(c).then(r,s)}t.exports=function(t){return function(){var e=this,r=arguments;return new Promise((function(s,o){var i=t.apply(e,r);function a(t){n(i,s,o,a,c,"next",t)}function c(t){n(i,s,o,a,c,"throw",t)}a(void 0)}))}},t.exports.__esModule=!0,t.exports.default=t.exports},,,,,,,,,function(t,e,n){"use strict";var r=n(0),s=n(9);const o=Object(r.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(s.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"}));e.a=o},,,,,,,,,,,,,function(t,e,n){"use strict";n.r(e);var r=n(6),s=n.n(r),o=n(0),i=n(24),a=n.n(i),c=n(41),u=n(10),l=n(11),d=n.n(l);function f(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}function p(t){for(var e=1;e0&&Object(o.createElement)(m.animated.span,{style:r,className:"simpay-branding-bar__actions-button-count","aria-label":Object(b.sprintf)(/* translators: %d Unread notification count. */ -Object(b.__)("%d unread notifications","stripe"),e)},Object(o.createElement)("span",null,e)),Object(o.createElement)("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(o.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.8333 2.5H4.16667C3.25 2.5 2.5 3.25 2.5 4.16667V15.8333c0 .9167.74167 1.6667 1.66667 1.6667H15.8333c.9167 0 1.6667-.75 1.6667-1.6667V4.16667C17.5 3.25 16.75 2.5 15.8333 2.5Zm0 13.3333H4.16667v-2.5h2.96666C7.70833 14.325 8.775 15 10.0083 15c1.2334 0 2.2917-.675 2.875-1.6667h2.95v2.5Zm-4.1583-4.1666h4.1583V4.16667H4.16667v7.50003h4.175c0 .9166.75 1.6666 1.66663 1.6666.9167 0 1.6667-.75 1.6667-1.6666Z",fill:"currentColor"})))},y=n(56),O=n.n(y),v=n(3),j=n(57),w="simpay-notifications-notification",_=simpayNotifications.isLite;function x(t){switch(t){case"warning":return"warning";case"error":return"dismiss";case"info":return"admin-generic";case"success":default:return"yes-alt"}}function k(t){return Object(u.getAuthority)(window.location.href)!==Object(u.getAuthority)(t)}function S(t,e,n){return!1===k(t)?t:Object(u.addQueryArgs)(t.replace(/\/?$/,"/"),{utm_source:"WordPress",utm_campaign:"1"===_?"lite-plugin":"pro-plugin",utm_medium:e,utm_content:n})}var E=function(t){var e=t.notification,n=t.onDismissNotification,r=e.id,s=e.title,i=e.content,a=e.type,c=e.start,u=e.actions,l=e.is_dismissible;return Object(o.createElement)("div",{className:w,style:{backgroundColor:l?"transparent":"#fafafa"}},Object(o.createElement)("div",{className:"".concat(w,"__icon ").concat(w,"__icon-").concat(a||"success")},Object(o.createElement)("span",{className:"dashicons dashicons-".concat(x(a))})),Object(o.createElement)("div",{className:"".concat(w,"__body")},Object(o.createElement)("div",{className:"".concat(w,"__header")},Object(o.createElement)("div",{className:"".concat(w,"__title")},s),l&&Object(o.createElement)("div",{className:"".concat(w,"__date")},O.a.unix(c).fromNow())),Object(o.createElement)("div",{className:"".concat(w,"__content"),dangerouslySetInnerHTML:{__html:Object(j.autop)(i)}}),Object(o.createElement)("div",{className:"".concat(w,"__actions")},u.map((function(t){var e=t.type,n=t.text,r=t.url;return Object(o.createElement)(v.Button,{key:n,href:S(r,"notification-inbox",s),isPrimary:"primary"===e,isSecondary:"secondary"===e,variant:e,target:k(r)?"_blank":"_self"},n)})),l&&Object(o.createElement)(v.Button,{isLink:!0,variant:"link",onClick:function(){return n(r)}},Object(b.__)("Dismiss","stripe")))))},P=n(58),M=n.n(P),A=n(45),I=n.n(A),C=n(14),R=n.n(C),T=n(12),N=n(22);function V(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nm(t,r);let o=O();s.write=t=>m(t,o);let i=O();s.onStart=t=>m(t,i);let a=O();s.onFrame=t=>m(t,a);let c=O();s.onFinish=t=>m(t,c);let u=[];s.setTimeout=(t,e)=>{let n=s.now()+e,r=()=>{let t=u.findIndex(t=>t.cancel==r);~t&&u.splice(t,1),p-=~t?1:0},o={time:n,handler:t,cancel:r};return u.splice(l(n),0,o),p+=1,b(),o};let l=t=>~(~u.findIndex(e=>e.time>t)||~u.length);s.cancel=t=>{i.delete(t),a.delete(t),r.delete(t),o.delete(t),c.delete(t)},s.sync=t=>{h=!0,s.batchedUpdates(t),h=!1},s.throttle=t=>{let e;function n(){try{t(...e)}finally{e=null}}function r(...t){e=t,s.onStart(n)}return r.handler=t,r.cancel=()=>{i.delete(n),e=null},r};let d="undefined"!=typeof window?window.requestAnimationFrame:()=>{};s.use=t=>d=t,s.now="undefined"!=typeof performance?()=>performance.now():Date.now,s.batchedUpdates=t=>t(),s.catch=console.error,s.frameLoop="always",s.advance=()=>{"demand"!==s.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):y()};let f=-1,p=0,h=!1;function m(t,e){h?(e.delete(t),t(0)):(e.add(t),b())}function b(){f<0&&(f=0,"demand"!==s.frameLoop&&d(g))}function g(){~f&&(d(g),s.batchedUpdates(y))}function y(){let t=f;f=s.now();let e=l(f);e&&(v(u.splice(0,e),t=>t.handler()),p-=e),i.flush(),r.flush(t?Math.min(64,f-t):16.667),a.flush(),o.flush(),c.flush(),p||(f=-1)}function O(){let t=new Set,e=t;return{add(n){p+=e!=t||t.has(n)?0:1,t.add(n)},delete:n=>(p-=e==t&&t.has(n)?1:0,t.delete(n)),flush(n){e.size&&(t=new Set,p-=e.size,v(e,e=>e(n)&&t.add(e)),p+=t.size,e=t)}}}function v(t,e){t.forEach(t=>{try{e(t)}catch(t){s.catch(t)}})}var j=n(5);function w(){}const _=(t,e,n)=>Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0}),x={arr:Array.isArray,obj:t=>!!t&&"Object"===t.constructor.name,fun:t=>"function"==typeof t,str:t=>"string"==typeof t,num:t=>"number"==typeof t,und:t=>void 0===t};function k(t,e){if(x.arr(t)){if(!x.arr(e)||t.length!==e.length)return!1;for(let n=0;nt.forEach(e);function E(t,e,n){if(x.arr(t))for(let r=0;rx.und(t)?[]:x.arr(t)?t:[t];function M(t,e){if(t.size){const n=Array.from(t);t.clear(),S(n,e)}}const A=(t,...e)=>M(t,t=>t(...e)),I=()=>"undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent);let C,R,T=null,N=!1,V=w;var q=Object.freeze({__proto__:null,get createStringInterpolator(){return C},get to(){return R},get colors(){return T},get skipAnimation(){return N},get willAdvance(){return V},assign:t=>{t.to&&(R=t.to),t.now&&(s.now=t.now),void 0!==t.colors&&(T=t.colors),null!=t.skipAnimation&&(N=t.skipAnimation),t.createStringInterpolator&&(C=t.createStringInterpolator),t.requestAnimationFrame&&s.use(t.requestAnimationFrame),t.batchedUpdates&&(s.batchedUpdates=t.batchedUpdates),t.willAdvance&&(V=t.willAdvance),t.frameLoop&&(s.frameLoop=t.frameLoop)}});const D=new Set;let z=[],L=[],F=0;const U={get idle(){return!D.size&&!z.length},start(t){F>t.priority?(D.add(t),s.onStart($)):(Q(t),s(G))},advance:G,sort(t){if(F)s.onFrame(()=>U.sort(t));else{const e=z.indexOf(t);~e&&(z.splice(e,1),B(t))}},clear(){z=[],D.clear()}};function $(){D.forEach(Q),D.clear(),s(G)}function Q(t){z.includes(t)||B(t)}function B(t){z.splice(function(e,n){const r=e.findIndex(e=>e.priority>t.priority);return r<0?e.length:r}(z),0,t)}function G(t){const e=L;for(let n=0;n0}const H={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},W="[-+]?\\d*\\.?\\d+";function Z(...t){return"\\(\\s*("+t.join(")\\s*,\\s*(")+")\\s*\\)"}const Y=new RegExp("rgb"+Z(W,W,W)),J=new RegExp("rgba"+Z(W,W,W,W)),K=new RegExp("hsl"+Z(W,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%")),X=new RegExp("hsla"+Z(W,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%",W)),tt=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,et=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,nt=/^#([0-9a-fA-F]{6})$/,rt=/^#([0-9a-fA-F]{8})$/;function st(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function ot(t,e,n){const r=n<.5?n*(1+e):n+e-n*e,s=2*n-r,o=st(s,r,t+1/3),i=st(s,r,t),a=st(s,r,t-1/3);return Math.round(255*o)<<24|Math.round(255*i)<<16|Math.round(255*a)<<8}function it(t){const e=parseInt(t,10);return e<0?0:e>255?255:e}function at(t){return(parseFloat(t)%360+360)%360/360}function ct(t){const e=parseFloat(t);return e<0?0:e>1?255:Math.round(255*e)}function ut(t){const e=parseFloat(t);return e<0?0:e>100?1:e/100}function lt(t){let e=function(t){let e;return"number"==typeof t?t>>>0===t&&t>=0&&t<=4294967295?t:null:(e=nt.exec(t))?parseInt(e[1]+"ff",16)>>>0:T&&void 0!==T[t]?T[t]:(e=Y.exec(t))?(it(e[1])<<24|it(e[2])<<16|it(e[3])<<8|255)>>>0:(e=J.exec(t))?(it(e[1])<<24|it(e[2])<<16|it(e[3])<<8|ct(e[4]))>>>0:(e=tt.exec(t))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+"ff",16)>>>0:(e=rt.exec(t))?parseInt(e[1],16)>>>0:(e=et.exec(t))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+e[4]+e[4],16)>>>0:(e=K.exec(t))?(255|ot(at(e[1]),ut(e[2]),ut(e[3])))>>>0:(e=X.exec(t))?(ot(at(e[1]),ut(e[2]),ut(e[3]))|ct(e[4]))>>>0:null}(t);return null===e?t:(e=e||0,`rgba(${(4278190080&e)>>>24}, ${(16711680&e)>>>16}, ${(65280&e)>>>8}, ${(255&e)/255})`)}const dt=(t,e,n)=>{if(x.fun(t))return t;if(x.arr(t))return dt({range:t,output:e,extrapolate:n});if(x.str(t.output[0]))return C(t);const r=t,s=r.output,o=r.range||[0,1],i=r.extrapolateLeft||r.extrapolate||"extend",a=r.extrapolateRight||r.extrapolate||"extend",c=r.easing||(t=>t);return t=>{const e=function(t,e){for(var n=1;n=t);++n);return n-1}(t,o);return function(t,e,n,r,s,o,i,a,c){let u=c?c(t):t;if(un){if("identity"===a)return u;"clamp"===a&&(u=n)}return r===s?r:e===n?t<=e?r:s:(e===-1/0?u=-u:n===1/0?u-=e:u=(u-e)/(n-e),u=o(u),r===-1/0?u=-u:s===1/0?u+=r:u=u*(s-r)+r,u)}(t,o[e],o[e+1],s[e],s[e+1],c,i,a,r.map)}};function ft(){return(ft=Object.assign||function(t){for(var e=1;eBoolean(t&&t[pt]),bt=t=>t&&t[pt]?t[pt]():t,gt=t=>t[ht]||null;function yt(t,e){let n=t[ht];n&&n.forEach(t=>{!function(t,e){t.eventObserved?t.eventObserved(e):t(e)}(t,e)})}class Ot{constructor(t){if(this[pt]=void 0,this[ht]=void 0,!t&&!(t=this.get))throw Error("Unknown getter");vt(this,t)}}const vt=(t,e)=>_t(t,pt,e);function jt(t,e){if(t[pt]){let n=t[ht];n||_t(t,ht,n=new Set),n.has(e)||(n.add(e),t.observerAdded&&t.observerAdded(n.size,e))}return e}function wt(t,e){let n=t[ht];if(n&&n.has(e)){const r=n.size-1;r?n.delete(e):t[ht]=null,t.observerRemoved&&t.observerRemoved(r,e)}}const _t=(t,e,n)=>Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0}),xt=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,kt=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,St=new RegExp(`(${xt.source})(%|[a-z]+)`,"i"),Et=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Pt=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,Mt=t=>{const[e,n]=At(t);if(!e||I())return t;const r=window.getComputedStyle(document.documentElement).getPropertyValue(e);if(r)return r.trim();if(n&&n.startsWith("--")){return window.getComputedStyle(document.documentElement).getPropertyValue(n)||t}return n&&Pt.test(n)?Mt(n):n||t},At=t=>{const e=Pt.exec(t);if(!e)return[,];const[,n,r]=e;return[n,r]};let It;const Ct=(t,e,n,r,s)=>`rgba(${Math.round(e)}, ${Math.round(n)}, ${Math.round(r)}, ${s})`,Rt=t=>{It||(It=T?new RegExp(`(${Object.keys(T).join("|")})(?!\\w)`,"g"):/^\b$/);const e=t.output.map(t=>bt(t).replace(Pt,Mt).replace(kt,lt).replace(It,lt)),n=e.map(t=>t.match(xt).map(Number)),r=n[0].map((t,e)=>n.map(t=>{if(!(e in t))throw Error('The arity of each "output" value must be equal');return t[e]})).map(e=>dt(ft({},t,{output:e})));return t=>{var n;const s=!St.test(e[0])&&(null==(n=e.find(t=>St.test(t)))?void 0:n.replace(xt,""));let o=0;return e[0].replace(xt,()=>`${r[o++](t)}${s||""}`).replace(Et,Ct)}},Tt="react-spring: ",Nt=t=>{const e=t;let n=!1;if("function"!=typeof e)throw new TypeError(Tt+"once requires a function parameter");return(...t)=>{n||(e(...t),n=!0)}},Vt=Nt(console.warn);function qt(){Vt(Tt+'The "interpolate" function is deprecated in v9 (use "to" instead)')}const Dt=Nt(console.warn);function zt(){Dt(Tt+'Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions')}function Lt(t){return x.str(t)&&("#"==t[0]||/\d/.test(t)||!I()&&Pt.test(t)||t in(T||{}))}const Ft="undefined"!=typeof window&&window.document&&window.document.createElement?j.useLayoutEffect:j.useEffect;function Ut(){const t=Object(j.useState)()[1],e=(()=>{const t=Object(j.useRef)(!1);return Ft(()=>(t.current=!0,()=>{t.current=!1}),[]),t})();return()=>{e.current&&t(Math.random())}}function $t(t,e){const[n]=Object(j.useState)(()=>({inputs:e,result:t()})),r=Object(j.useRef)(),s=r.current;let o=s;return o?Boolean(e&&o.inputs&&function(t,e){if(t.length!==e.length)return!1;for(let n=0;n{r.current=o,s==n&&(n.inputs=n.result=void 0)},[o]),o.result}const Qt=t=>Object(j.useEffect)(t,Bt),Bt=[];function Gt(t){const e=Object(j.useRef)();return Object(j.useEffect)(()=>{e.current=t}),e.current}},function(t,e){t.exports=window.wp.i18n},function(t,e){t.exports=window.wp.components},,function(t,e){t.exports=window.React},function(t,e,n){var r=n(26),s=n(27),o=n(22),i=n(28);t.exports=function(t,e){return r(t)||s(t,e)||o(t,e)||i()},t.exports.__esModule=!0,t.exports.default=t.exports},,,function(t,e){t.exports=window.wp.primitives},function(t,e){t.exports=window.wp.url},function(t,e,n){var r=n(30);t.exports=function(t,e,n){return(e=r(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=window.lodash},function(t,e,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function s(){for(var t=[],e=0;et&&t[o],a=(t,e)=>Object(r.h)(t,o,e),c=t=>t&&t[o]&&t[o].getPayload();class u{constructor(){this.payload=void 0,a(this,this)}getPayload(){return this.payload||[]}}class l extends u{constructor(t){super(),this.done=!0,this.elapsedTime=void 0,this.lastPosition=void 0,this.lastVelocity=void 0,this.v0=void 0,this.durationProgress=0,this._value=t,r.s.num(this._value)&&(this.lastPosition=this._value)}static create(t){return new l(t)}getPayload(){return[this]}getValue(){return this._value}setValue(t,e){return r.s.num(t)&&(this.lastPosition=t,e&&(t=Math.round(t/e)*e,this.done&&(this.lastPosition=t))),this._value!==t&&(this._value=t,!0)}reset(){const{done:t}=this;this.done=!1,r.s.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,t&&(this.lastVelocity=null),this.v0=null)}}class d extends l{constructor(t){super(0),this._string=null,this._toString=void 0,this._toString=Object(r.f)({output:[t,t]})}static create(t){return new d(t)}getValue(){let t=this._string;return null==t?this._string=this._toString(this._value):t}setValue(t){if(r.s.str(t)){if(t==this._string)return!1;this._string=t,this._value=1}else{if(!super.setValue(t))return!1;this._string=null}return!0}reset(t){t&&(this._toString=Object(r.f)({output:[this.getValue(),t]})),this._value=0,super.reset()}}const f={dependencies:null};class p extends u{constructor(t){super(),this.source=t,this.setValue(t)}getValue(t){const e={};return Object(r.l)(this.source,(n,s)=>{var i;(i=n)&&i[o]===i?e[s]=n.getValue(t):Object(r.r)(n)?e[s]=Object(r.q)(n):t||(e[s]=n)}),e}setValue(t){this.source=t,this.payload=this._makePayload(t)}reset(){this.payload&&Object(r.k)(this.payload,t=>t.reset())}_makePayload(t){if(t){const e=new Set;return Object(r.l)(t,this._addToPayload,e),Array.from(e)}}_addToPayload(t){f.dependencies&&Object(r.r)(t)&&f.dependencies.add(t);const e=c(t);e&&Object(r.k)(e,t=>this.add(t))}}class h extends p{constructor(t){super(t)}static create(t){return new h(t)}getValue(){return this.source.map(t=>t.getValue())}setValue(t){const e=this.getPayload();return t.length==e.length?e.map((e,n)=>e.setValue(t[n])).some(Boolean):(super.setValue(t.map(m)),!0)}}function m(t){return(Object(r.t)(t)?d:l).create(t)}function b(t){const e=i(t);return e?e.constructor:r.s.arr(t)?h:Object(r.t)(t)?d:l}function g(){return(g=Object.assign||function(t){for(var e=1;e{const n=!r.s.fun(t)||t.prototype&&t.prototype.isReactComponent;return Object(s.forwardRef)((o,i)=>{const a=Object(s.useRef)(null),c=n&&Object(s.useCallback)(t=>{a.current=function(t,e){return t&&(r.s.fun(t)?t(e):t.current=e),e}(i,t)},[i]),[u,l]=function(t,e){const n=new Set;return f.dependencies=n,t.style&&(t=g({},t,{style:e.createAnimatedStyle(t.style)})),t=new p(t),f.dependencies=null,[t,n]}(o,e),d=Object(r.z)(),h=()=>{const t=a.current;n&&!t||!1===(!!t&&e.applyAnimatedValues(t,u.getValue(!0)))&&d()},m=new O(h,l),b=Object(s.useRef)();Object(r.A)(()=>(b.current=m,Object(r.k)(l,t=>Object(r.c)(t,m)),()=>{b.current&&(Object(r.k)(b.current.deps,t=>Object(r.x)(t,b.current)),r.w.cancel(b.current.update))})),Object(s.useEffect)(h,[]),Object(r.C)(()=>()=>{const t=b.current;Object(r.k)(t.deps,e=>Object(r.x)(e,t))});const y=e.getComponentProps(u.getValue());return s.createElement(t,g({},y,{ref:c}))})};class O{constructor(t,e){this.update=t,this.deps=e}eventObserved(t){"change"==t.type&&r.w.write(this.update)}}const v=Symbol.for("AnimatedComponent"),j=(t,{applyAnimatedValues:e=(()=>!1),createAnimatedStyle:n=(t=>new p(t)),getComponentProps:s=(t=>t)}={})=>{const o={applyAnimatedValues:e,createAnimatedStyle:n,getComponentProps:s},i=t=>{const e=w(t)||"Anonymous";return(t=r.s.str(t)?i[t]||(i[t]=y(t,o)):t[v]||(t[v]=y(t,o))).displayName=`Animated(${e})`,t};return Object(r.l)(t,(e,n)=>{r.s.arr(t)&&(n=w(e)),i[n]=i(e)}),{animated:i}},w=t=>r.s.str(t)?t:t&&r.s.str(t.displayName)?t.displayName:r.s.fun(t)&&t.name||null},function(t,e){t.exports=window.wp.compose},function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n!0===t||!!(e&&t&&(r.s.fun(t)?t(e):Object(r.y)(t).includes(e))),u=(t,e)=>r.s.obj(t)?e&&t[e]:t,l=(t,e)=>!0===t.default?t[e]:t.default?t.default[e]:void 0,d=t=>t,f=(t,e=d)=>{let n=p;t.default&&!0!==t.default&&(t=t.default,n=Object.keys(t));const s={};for(const o of n){const n=e(t[o],o);r.s.und(n)||(s[o]=n)}return s},p=["config","onProps","onStart","onChange","onPause","onResume","onRest"],h={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function m(t){const e=function(t){const e={};let n=0;if(Object(r.l)(t,(t,r)=>{h[r]||(e[r]=t,n++)}),n)return e}(t);if(e){const n={to:e};return Object(r.l)(t,(t,r)=>r in e||(n[r]=t)),n}return i({},t)}function b(t){return t=Object(r.q)(t),r.s.arr(t)?t.map(b):Object(r.t)(t)?r.b.createStringInterpolator({range:[0,1],output:[t,t]})(1):t}function g(t){for(const e in t)return!0;return!1}function y(t){return r.s.fun(t)||r.s.arr(t)&&r.s.obj(t[0])}function O(t,e){var n;null==(n=t.ref)||n.delete(t),null==e||e.delete(t)}function v(t,e){var n;e&&t.ref!==e&&(null==(n=t.ref)||n.delete(t),e.add(t),t.ref=e)}const j={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}},w=1.70158,_=1.525*w,x=2*Math.PI/3,k=2*Math.PI/4.5,S=t=>{const e=7.5625,n=2.75;return t<1/n?e*t*t:t<2/n?e*(t-=1.5/n)*t+.75:t<2.5/n?e*(t-=2.25/n)*t+.9375:e*(t-=2.625/n)*t+.984375},E={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>1-(1-t)*(1-t),easeInOutQuad:t=>t<.5?2*t*t:1-Math.pow(-2*t+2,2)/2,easeInCubic:t=>t*t*t,easeOutCubic:t=>1-Math.pow(1-t,3),easeInOutCubic:t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2,easeInQuart:t=>t*t*t*t,easeOutQuart:t=>1-Math.pow(1-t,4),easeInOutQuart:t=>t<.5?8*t*t*t*t:1-Math.pow(-2*t+2,4)/2,easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>1-Math.pow(1-t,5),easeInOutQuint:t=>t<.5?16*t*t*t*t*t:1-Math.pow(-2*t+2,5)/2,easeInSine:t=>1-Math.cos(t*Math.PI/2),easeOutSine:t=>Math.sin(t*Math.PI/2),easeInOutSine:t=>-(Math.cos(Math.PI*t)-1)/2,easeInExpo:t=>0===t?0:Math.pow(2,10*t-10),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>0===t?0:1===t?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2,easeInCirc:t=>1-Math.sqrt(1-Math.pow(t,2)),easeOutCirc:t=>Math.sqrt(1-Math.pow(t-1,2)),easeInOutCirc:t=>t<.5?(1-Math.sqrt(1-Math.pow(2*t,2)))/2:(Math.sqrt(1-Math.pow(-2*t+2,2))+1)/2,easeInBack:t=>2.70158*t*t*t-w*t*t,easeOutBack:t=>1+2.70158*Math.pow(t-1,3)+w*Math.pow(t-1,2),easeInOutBack:t=>t<.5?Math.pow(2*t,2)*(7.189819*t-_)/2:(Math.pow(2*t-2,2)*((_+1)*(2*t-2)+_)+2)/2,easeInElastic:t=>0===t?0:1===t?1:-Math.pow(2,10*t-10)*Math.sin((10*t-10.75)*x),easeOutElastic:t=>0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin((10*t-.75)*x)+1,easeInOutElastic:t=>0===t?0:1===t?1:t<.5?-Math.pow(2,20*t-10)*Math.sin((20*t-11.125)*k)/2:Math.pow(2,-20*t+10)*Math.sin((20*t-11.125)*k)/2+1,easeInBounce:t=>1-S(1-t),easeOutBounce:S,easeInOutBounce:t=>t<.5?(1-S(1-2*t))/2:(1+S(2*t-1))/2},P=i({},j.default,{mass:1,damping:1,easing:E.linear,clamp:!1});class M{constructor(){this.tension=void 0,this.friction=void 0,this.frequency=void 0,this.damping=void 0,this.mass=void 0,this.velocity=0,this.restVelocity=void 0,this.precision=void 0,this.progress=void 0,this.duration=void 0,this.easing=void 0,this.clamp=void 0,this.bounce=void 0,this.decay=void 0,this.round=void 0,Object.assign(this,P)}}function A(t,e){if(r.s.und(e.decay)){const n=!r.s.und(e.tension)||!r.s.und(e.friction);!n&&r.s.und(e.frequency)&&r.s.und(e.damping)&&r.s.und(e.mass)||(t.duration=void 0,t.decay=void 0),n&&(t.frequency=void 0)}else t.duration=void 0}const I=[];class C{constructor(){this.changed=!1,this.values=I,this.toValues=null,this.fromValues=I,this.to=void 0,this.from=void 0,this.config=new M,this.immediate=!1}}function R(t,{key:e,props:n,defaultProps:s,state:o,actions:u}){return new Promise((l,d)=>{var f;let p,h,m=c(null!=(f=n.cancel)?f:null==s?void 0:s.cancel,e);if(m)y();else{r.s.und(n.pause)||(o.paused=c(n.pause,e));let t=null==s?void 0:s.pause;!0!==t&&(t=o.paused||c(t,e)),p=a(n.delay||0,e),t?(o.resumeQueue.add(g),u.pause()):(u.resume(),g())}function b(){o.resumeQueue.add(g),o.timeouts.delete(h),h.cancel(),p=h.time-r.w.now()}function g(){p>0&&!r.b.skipAnimation?(o.delayed=!0,h=r.w.setTimeout(y,p),o.pauseQueue.add(b),o.timeouts.add(h)):y()}function y(){o.delayed&&(o.delayed=!1),o.pauseQueue.delete(b),o.timeouts.delete(h),t<=(o.cancelId||0)&&(m=!0);try{u.start(i({},n,{callId:t,cancel:m}),l)}catch(t){d(t)}}})}const T=(t,e)=>1==e.length?e[0]:e.some(t=>t.cancelled)?q(t.get()):e.every(t=>t.noop)?N(t.get()):V(t.get(),e.every(t=>t.finished)),N=t=>({value:t,noop:!0,finished:!0,cancelled:!1}),V=(t,e,n=!1)=>({value:t,finished:e,cancelled:n}),q=t=>({value:t,cancelled:!0,finished:!1});function D(t,e,n,s){const{callId:o,parentId:a,onRest:c}=e,{asyncTo:u,promise:l}=n;return a||t!==u||e.reset?n.promise=(async()=>{n.asyncId=o,n.asyncTo=t;const d=f(e,(t,e)=>"onRest"===e?void 0:t);let p,h;const m=new Promise((t,e)=>(p=t,h=e)),b=t=>{const e=o<=(n.cancelId||0)&&q(s)||o!==n.asyncId&&V(s,!1);if(e)throw t.result=e,h(t),t},g=(t,e)=>{const a=new L,c=new F;return(async()=>{if(r.b.skipAnimation)throw z(n),c.result=V(s,!1),h(c),c;b(a);const u=r.s.obj(t)?i({},t):i({},e,{to:t});u.parentId=o,Object(r.l)(d,(t,e)=>{r.s.und(u[e])&&(u[e]=t)});const l=await s.start(u);return b(a),n.paused&&await new Promise(t=>{n.resumeQueue.add(t)}),l})()};let y;if(r.b.skipAnimation)return z(n),V(s,!1);try{let e;e=r.s.arr(t)?(async t=>{for(const e of t)await g(e)})(t):Promise.resolve(t(g,s.stop.bind(s))),await Promise.all([e.then(p),m]),y=V(s.get(),!0,!1)}catch(t){if(t instanceof L)y=t.result;else{if(!(t instanceof F))throw t;y=t.result}}finally{o==n.asyncId&&(n.asyncId=a,n.asyncTo=a?u:void 0,n.promise=a?l:void 0)}return r.s.fun(c)&&r.w.batchedUpdates(()=>{c(y,s,s.item)}),y})():l}function z(t,e){Object(r.m)(t.timeouts,t=>t.cancel()),t.pauseQueue.clear(),t.resumeQueue.clear(),t.asyncId=t.asyncTo=t.promise=void 0,e&&(t.cancelId=e)}class L extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise."),this.result=void 0}}class F extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const U=t=>t instanceof Q;let $=1;class Q extends r.a{constructor(...t){super(...t),this.id=$++,this.key=void 0,this._priority=0}get priority(){return this._priority}set priority(t){this._priority!=t&&(this._priority=t,this._onPriorityChange(t))}get(){const t=Object(o.e)(this);return t&&t.getValue()}to(...t){return r.b.to(this,t)}interpolate(...t){return Object(r.j)(),r.b.to(this,t)}toJSON(){return this.get()}observerAdded(t){1==t&&this._attach()}observerRemoved(t){0==t&&this._detach()}_attach(){}_detach(){}_onChange(t,e=!1){Object(r.d)(this,{type:"change",parent:this,value:t,idle:e})}_onPriorityChange(t){this.idle||r.o.sort(this),Object(r.d)(this,{type:"priority",parent:this,priority:t})}}const B=Symbol.for("SpringPhase"),G=t=>(1&t[B])>0,H=t=>(2&t[B])>0,W=t=>(4&t[B])>0,Z=(t,e)=>e?t[B]|=3:t[B]&=-3,Y=(t,e)=>e?t[B]|=4:t[B]&=-5;class J extends Q{constructor(t,e){if(super(),this.key=void 0,this.animation=new C,this.queue=void 0,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!r.s.und(t)||!r.s.und(e)){const n=r.s.obj(t)?i({},t):i({},e,{from:t});r.s.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(H(this)||this._state.asyncTo)||W(this)}get goal(){return Object(r.q)(this.animation.to)}get velocity(){const t=Object(o.e)(this);return t instanceof o.c?t.lastVelocity||0:t.getPayload().map(t=>t.lastVelocity||0)}get hasAnimated(){return G(this)}get isAnimating(){return H(this)}get isPaused(){return W(this)}get isDelayed(){return this._state.delayed}advance(t){let e=!0,n=!1;const s=this.animation;let{config:i,toValues:a}=s;const c=Object(o.g)(s.to);!c&&Object(r.r)(s.to)&&(a=Object(r.y)(Object(r.q)(s.to))),s.values.forEach((u,l)=>{if(u.done)return;const d=u.constructor==o.b?1:c?c[l].lastPosition:a[l];let f=s.immediate,p=d;if(!f){if(p=u.lastPosition,i.tension<=0)return void(u.done=!0);let e=u.elapsedTime+=t;const n=s.fromValues[l],o=null!=u.v0?u.v0:u.v0=r.s.arr(i.velocity)?i.velocity[l]:i.velocity;let a;if(r.s.und(i.duration))if(i.decay){const t=!0===i.decay?.998:i.decay,r=Math.exp(-(1-t)*e);p=n+o/(1-t)*(1-r),f=Math.abs(u.lastPosition-p)<.1,a=o*r}else{a=null==u.lastVelocity?o:u.lastVelocity;const e=i.precision||(n==d?.005:Math.min(1,.001*Math.abs(d-n))),s=i.restVelocity||e/10,c=i.clamp?0:i.bounce,l=!r.s.und(c),h=n==d?u.v0>0:ns,m||(f=Math.abs(d-p)<=e,!f));++t)l&&(b=p==d||p>d==h,b&&(a=-a*c,p=d)),a+=(1e-6*-i.tension*(p-d)+.001*-i.friction*a)/i.mass*g,p+=a*g}else{let r=1;i.duration>0&&(this._memoizedDuration!==i.duration&&(this._memoizedDuration=i.duration,u.durationProgress>0&&(u.elapsedTime=i.duration*u.durationProgress,e=u.elapsedTime+=t)),r=(i.progress||0)+e/this._memoizedDuration,r=r>1?1:r<0?0:r,u.durationProgress=r),p=n+i.easing(r)*(d-n),a=(p-u.lastPosition)/t,f=1==r}u.lastVelocity=a,Number.isNaN(p)&&(console.warn("Got NaN while animating:",this),f=!0)}c&&!c[l].done&&(f=!1),f?u.done=!0:e=!1,u.setValue(p,i.round)&&(n=!0)});const u=Object(o.e)(this),l=u.getValue();if(e){const t=Object(r.q)(s.to);l===t&&!n||i.decay?n&&i.decay&&this._onChange(l):(u.setValue(t),this._onChange(t)),this._stop()}else n&&this._onChange(l)}set(t){return r.w.batchedUpdates(()=>{this._stop(),this._focus(t),this._set(t)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(H(this)){const{to:t,config:e}=this.animation;r.w.batchedUpdates(()=>{this._onStart(),e.decay||this._set(t,!1),this._stop()})}return this}update(t){return(this.queue||(this.queue=[])).push(t),this}start(t,e){let n;return r.s.und(t)?(n=this.queue||[],this.queue=[]):n=[r.s.obj(t)?t:i({},e,{to:t})],Promise.all(n.map(t=>this._update(t))).then(t=>T(this,t))}stop(t){const{to:e}=this.animation;return this._focus(this.get()),z(this._state,t&&this._lastCallId),r.w.batchedUpdates(()=>this._stop(e,t)),this}reset(){this._update({reset:!0})}eventObserved(t){"change"==t.type?this._start():"priority"==t.type&&(this.priority=t.priority+1)}_prepareNode(t){const e=this.key||"";let{to:n,from:s}=t;n=r.s.obj(n)?n[e]:n,(null==n||y(n))&&(n=void 0),s=r.s.obj(s)?s[e]:s,null==s&&(s=void 0);const i={to:n,from:s};return G(this)||(t.reverse&&([n,s]=[s,n]),s=Object(r.q)(s),r.s.und(s)?Object(o.e)(this)||this._set(n):this._set(s)),i}_update(t,e){let n=i({},t);const{key:s,defaultProps:o}=this;n.default&&Object.assign(o,f(n,(t,e)=>/^on/.test(e)?u(t,s):t)),st(this,n,"onProps"),ot(this,"onProps",n,this);const a=this._prepareNode(n);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const c=this._state;return R(++this._lastCallId,{key:s,props:n,defaultProps:o,state:c,actions:{pause:()=>{W(this)||(Y(this,!0),Object(r.n)(c.pauseQueue),ot(this,"onPause",V(this,K(this,this.animation.to)),this))},resume:()=>{W(this)&&(Y(this,!1),H(this)&&this._resume(),Object(r.n)(c.resumeQueue),ot(this,"onResume",V(this,K(this,this.animation.to)),this))},start:this._merge.bind(this,a)}}).then(t=>{if(n.loop&&t.finished&&(!e||!t.noop)){const t=X(n);if(t)return this._update(t,!0)}return t})}_merge(t,e,n){if(e.cancel)return this.stop(!0),n(q(this));const s=!r.s.und(t.to),u=!r.s.und(t.from);if(s||u){if(!(e.callId>this._lastToId))return n(q(this));this._lastToId=e.callId}const{key:l,defaultProps:d,animation:f}=this,{to:p,from:h}=f;let{to:m=p,from:g=h}=t;!u||s||e.default&&!r.s.und(m)||(m=g),e.reverse&&([m,g]=[g,m]);const O=!Object(r.u)(g,h);O&&(f.from=g),g=Object(r.q)(g);const v=!Object(r.u)(m,p);v&&this._focus(m);const j=y(e.to),{config:w}=f,{decay:_,velocity:x}=w;(s||u)&&(w.velocity=0),e.config&&!j&&function(t,e,n){n&&(A(n=i({},n),e),e=i({},n,e)),A(t,e),Object.assign(t,e);for(const e in P)null==t[e]&&(t[e]=P[e]);let{mass:s,frequency:o,damping:a}=t;r.s.und(o)||(o<.01&&(o=.01),a<0&&(a=0),t.tension=Math.pow(2*Math.PI/o,2)*s,t.friction=4*Math.PI*a*s/o)}(w,a(e.config,l),e.config!==d.config?a(d.config,l):void 0);let k=Object(o.e)(this);if(!k||r.s.und(m))return n(V(this,!0));const S=r.s.und(e.reset)?u&&!e.default:!r.s.und(g)&&c(e.reset,l),E=S?g:this.get(),M=b(m),I=r.s.num(M)||r.s.arr(M)||Object(r.t)(M),C=!j&&(!I||c(d.immediate||e.immediate,l));if(v){const t=Object(o.f)(m);if(t!==k.constructor){if(!C)throw Error(`Cannot animate between ${k.constructor.name} and ${t.name}, as the "to" prop suggests`);k=this._set(M)}}const R=k.constructor;let T=Object(r.r)(m),z=!1;if(!T){const t=S||!G(this)&&O;(v||t)&&(z=Object(r.u)(b(E),M),T=!z),(Object(r.u)(f.immediate,C)||C)&&Object(r.u)(w.decay,_)&&Object(r.u)(w.velocity,x)||(T=!0)}if(z&&H(this)&&(f.changed&&!S?T=!0:T||this._stop(p)),!j&&((T||Object(r.r)(p))&&(f.values=k.getPayload(),f.toValues=Object(r.r)(m)?null:R==o.b?[1]:Object(r.y)(M)),f.immediate!=C&&(f.immediate=C,C||S||this._set(p)),T)){const{onRest:t}=f;Object(r.k)(rt,t=>st(this,e,t));const s=V(this,K(this,p));Object(r.n)(this._pendingCalls,s),this._pendingCalls.add(n),f.changed&&r.w.batchedUpdates(()=>{f.changed=!S,null==t||t(s,this),S?a(d.onRest,s):null==f.onStart||f.onStart(s,this)})}S&&this._set(E),j?n(D(e.to,e,this._state,this)):T?this._start():H(this)&&!v?this._pendingCalls.add(n):n(N(E))}_focus(t){const e=this.animation;t!==e.to&&(Object(r.p)(this)&&this._detach(),e.to=t,Object(r.p)(this)&&this._attach())}_attach(){let t=0;const{to:e}=this.animation;Object(r.r)(e)&&(Object(r.c)(e,this),U(e)&&(t=e.priority+1)),this.priority=t}_detach(){const{to:t}=this.animation;Object(r.r)(t)&&Object(r.x)(t,this)}_set(t,e=!0){const n=Object(r.q)(t);if(!r.s.und(n)){const t=Object(o.e)(this);if(!t||!Object(r.u)(n,t.getValue())){const s=Object(o.f)(n);t&&t.constructor==s?t.setValue(n):Object(o.h)(this,s.create(n)),t&&r.w.batchedUpdates(()=>{this._onChange(n,e)})}}return Object(o.e)(this)}_onStart(){const t=this.animation;t.changed||(t.changed=!0,ot(this,"onStart",V(this,K(this,t.to)),this))}_onChange(t,e){e||(this._onStart(),a(this.animation.onChange,t,this)),a(this.defaultProps.onChange,t,this),super._onChange(t,e)}_start(){const t=this.animation;Object(o.e)(this).reset(Object(r.q)(t.to)),t.immediate||(t.fromValues=t.values.map(t=>t.lastPosition)),H(this)||(Z(this,!0),W(this)||this._resume())}_resume(){r.b.skipAnimation?this.finish():r.o.start(this)}_stop(t,e){if(H(this)){Z(this,!1);const n=this.animation;Object(r.k)(n.values,t=>{t.done=!0}),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Object(r.d)(this,{type:"idle",parent:this});const s=e?q(this.get()):V(this.get(),K(this,null!=t?t:n.to));Object(r.n)(this._pendingCalls,s),n.changed&&(n.changed=!1,ot(this,"onRest",s,this))}}}function K(t,e){const n=b(e),s=b(t.get());return Object(r.u)(s,n)}function X(t,e=t.loop,n=t.to){let r=a(e);if(r){const s=!0!==r&&m(r),o=(s||t).reverse,a=!s||s.reset;return tt(i({},t,{loop:e,default:!1,pause:void 0,to:!o||y(n)?n:void 0,from:a?t.from:void 0,reset:a},s))}}function tt(t){const{to:e,from:n}=t=m(t),s=new Set;return r.s.obj(e)&&nt(e,s),r.s.obj(n)&&nt(n,s),t.keys=s.size?Array.from(s):null,t}function et(t){const e=tt(t);return r.s.und(e.default)&&(e.default=f(e)),e}function nt(t,e){Object(r.l)(t,(t,n)=>null!=t&&e.add(n))}const rt=["onStart","onRest","onChange","onPause","onResume"];function st(t,e,n){t.animation[n]=e[n]!==l(e,n)?u(e[n],t.key):void 0}function ot(t,e,...n){var r,s,o,i;null==(r=(s=t.animation)[e])||r.call(s,...n),null==(o=(i=t.defaultProps)[e])||o.call(i,...n)}const it=["onStart","onChange","onRest"];let at=1;class ct{constructor(t,e){this.id=at++,this.springs={},this.queue=[],this.ref=void 0,this._flush=void 0,this._initialProps=void 0,this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._item=void 0,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),e&&(this._flush=e),t&&this.start(i({default:!0},t))}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(t=>t.idle&&!t.isDelayed&&!t.isPaused)}get item(){return this._item}set item(t){this._item=t}get(){const t={};return this.each((e,n)=>t[n]=e.get()),t}set(t){for(const e in t){const n=t[e];r.s.und(n)||this.springs[e].set(n)}}update(t){return t&&this.queue.push(tt(t)),this}start(t){let{queue:e}=this;return t?e=Object(r.y)(t).map(tt):this.queue=[],this._flush?this._flush(this,e):(ht(this,e),ut(this,e))}stop(t,e){if(t!==!!t&&(e=t),e){const n=this.springs;Object(r.k)(Object(r.y)(e),e=>n[e].stop(!!t))}else z(this._state,this._lastAsyncId),this.each(e=>e.stop(!!t));return this}pause(t){if(r.s.und(t))this.start({pause:!0});else{const e=this.springs;Object(r.k)(Object(r.y)(t),t=>e[t].pause())}return this}resume(t){if(r.s.und(t))this.start({pause:!1});else{const e=this.springs;Object(r.k)(Object(r.y)(t),t=>e[t].resume())}return this}each(t){Object(r.l)(this.springs,t)}_onFrame(){const{onStart:t,onChange:e,onRest:n}=this._events,s=this._active.size>0,o=this._changed.size>0;(s&&!this._started||o&&!this._started)&&(this._started=!0,Object(r.m)(t,([t,e])=>{e.value=this.get(),t(e,this,this._item)}));const i=!s&&this._started,a=o||i&&n.size?this.get():null;o&&e.size&&Object(r.m)(e,([t,e])=>{e.value=a,t(e,this,this._item)}),i&&(this._started=!1,Object(r.m)(n,([t,e])=>{e.value=a,t(e,this,this._item)}))}eventObserved(t){if("change"==t.type)this._changed.add(t.parent),t.idle||this._active.add(t.parent);else{if("idle"!=t.type)return;this._active.delete(t.parent)}r.w.onFrame(this._onFrame)}}function ut(t,e){return Promise.all(e.map(e=>async function t(e,n,s){const{keys:o,to:i,from:a,loop:c,onRest:u,onResolve:d}=n,f=r.s.obj(n.default)&&n.default;c&&(n.loop=!1),!1===i&&(n.to=null),!1===a&&(n.from=null);const p=r.s.arr(i)||r.s.fun(i)?i:void 0;p?(n.to=void 0,n.onRest=void 0,f&&(f.onRest=void 0)):Object(r.k)(it,t=>{const s=n[t];if(r.s.fun(s)){const r=e._events[t];n[t]=({finished:t,cancelled:e})=>{const n=r.get(s);n?(t||(n.finished=!1),e&&(n.cancelled=!0)):r.set(s,{value:null,finished:t||!1,cancelled:e||!1})},f&&(f[t]=n[t])}});const h=e._state;n.pause===!h.paused?(h.paused=n.pause,Object(r.n)(n.pause?h.pauseQueue:h.resumeQueue)):h.paused&&(n.pause=!0);const m=(o||Object.keys(e.springs)).map(t=>e.springs[t].start(n)),b=!0===n.cancel||!0===l(n,"cancel");(p||b&&h.asyncId)&&m.push(R(++e._lastAsyncId,{props:n,state:h,actions:{pause:r.v,resume:r.v,start(t,n){b?(z(h,e._lastAsyncId),n(q(e))):(t.onRest=u,n(D(p,t,h,e)))}}})),h.paused&&await new Promise(t=>{h.resumeQueue.add(t)});const g=T(e,await Promise.all(m));if(c&&g.finished&&(!s||!g.noop)){const r=X(n,c,i);if(r)return ht(e,[r]),t(e,r,!0)}return d&&r.w.batchedUpdates(()=>d(g,e,e.item)),g}(t,e))).then(e=>T(t,e))}function lt(t,e){const n=i({},t.springs);return e&&Object(r.k)(Object(r.y)(e),t=>{r.s.und(t.keys)&&(t=tt(t)),r.s.obj(t.to)||(t=i({},t,{to:void 0})),pt(n,t,t=>ft(t))}),dt(t,n),n}function dt(t,e){Object(r.l)(e,(e,n)=>{t.springs[n]||(t.springs[n]=e,Object(r.c)(e,t))})}function ft(t,e){const n=new J;return n.key=t,e&&Object(r.c)(n,e),n}function pt(t,e,n){e.keys&&Object(r.k)(e.keys,r=>{(t[r]||(t[r]=n(r)))._prepareNode(e)})}function ht(t,e){Object(r.k)(e,e=>{pt(t.springs,e,e=>ft(e,t))})}const mt=["children"],bt=t=>{let{children:e}=t,n=function(t,e){if(null==t)return{};var n,r,s={},o=Object.keys(t);for(r=0;r=0||(s[n]=t[n]);return s}(t,mt);const o=Object(s.useContext)(gt),i=n.pause||!!o.pause,a=n.immediate||!!o.immediate;n=Object(r.B)(()=>({pause:i,immediate:a}),[i,a]);const{Provider:c}=gt;return s.createElement(c,{value:n},e)},gt=(yt=bt,Ot={},Object.assign(yt,s.createContext(Ot)),yt.Provider._context=yt,yt.Consumer._context=yt,yt);var yt,Ot;bt.Provider=gt.Provider,bt.Consumer=gt.Consumer;const vt=()=>{const t=[],e=function(e){Object(r.i)();const s=[];return Object(r.k)(t,(t,o)=>{if(r.s.und(e))s.push(t.start());else{const r=n(e,t,o);r&&s.push(t.start(r))}}),s};e.current=t,e.add=function(e){t.includes(e)||t.push(e)},e.delete=function(e){const n=t.indexOf(e);~n&&t.splice(n,1)},e.pause=function(){return Object(r.k)(t,t=>t.pause(...arguments)),this},e.resume=function(){return Object(r.k)(t,t=>t.resume(...arguments)),this},e.set=function(e){Object(r.k)(t,t=>t.set(e))},e.start=function(e){const n=[];return Object(r.k)(t,(t,s)=>{if(r.s.und(e))n.push(t.start());else{const r=this._getProps(e,t,s);r&&n.push(t.start(r))}}),n},e.stop=function(){return Object(r.k)(t,t=>t.stop(...arguments)),this},e.update=function(e){return Object(r.k)(t,(t,n)=>t.update(this._getProps(e,t,n))),this};const n=function(t,e,n){return r.s.fun(t)?t(n,e):t};return e._getProps=n,e};function jt(t,e,n){const o=r.s.fun(e)&&e;o&&!n&&(n=[]);const a=Object(s.useMemo)(()=>o||3==arguments.length?vt():void 0,[]),c=Object(s.useRef)(0),u=Object(r.z)(),l=Object(s.useMemo)(()=>({ctrls:[],queue:[],flush(t,e){const n=lt(t,e);return c.current>0&&!l.queue.length&&!Object.keys(n).some(e=>!t.springs[e])?ut(t,e):new Promise(r=>{dt(t,n),l.queue.push(()=>{r(ut(t,e))}),u()})}}),[]),d=Object(s.useRef)([...l.ctrls]),f=[],p=Object(r.D)(t)||0;function h(t,n){for(let r=t;r{Object(r.k)(d.current.slice(t,p),t=>{O(t,a),t.stop(!0)}),d.current.length=t,h(p,t)},[t]),Object(s.useMemo)(()=>{h(0,Math.min(p,t))},n);const m=d.current.map((t,e)=>lt(t,f[e])),b=Object(s.useContext)(bt),y=Object(r.D)(b),j=b!==y&&g(b);Object(r.A)(()=>{c.current++,l.ctrls=d.current;const{queue:t}=l;t.length&&(l.queue=[],Object(r.k)(t,t=>t())),Object(r.k)(d.current,(t,e)=>{null==a||a.add(t),j&&t.start({default:b});const n=f[e];n&&(v(t,n.ref),t.ref?t.queue.push(n):t.start(n))})}),Object(r.C)(()=>()=>{Object(r.k)(l.ctrls,t=>t.stop(!0))});const w=m.map(t=>i({},t));return a?[w,a]:w}function wt(t,e){const n=r.s.fun(t),[[s],o]=jt(1,n?t:[t],n?e||[]:e);return n||2==arguments.length?[s,o]:s}let _t;function xt(t,e,n){const o=r.s.fun(e)&&e,{reset:c,sort:u,trail:l=0,expires:d=!0,exitBeforeEnter:p=!1,onDestroyed:h,ref:b,config:y}=o?o():e,j=Object(s.useMemo)(()=>o||3==arguments.length?vt():void 0,[]),w=Object(r.y)(t),_=[],x=Object(s.useRef)(null),k=c?null:x.current;Object(r.A)(()=>{x.current=_}),Object(r.C)(()=>(Object(r.k)(x.current,t=>{var e;null==(e=t.ctrl.ref)||e.add(t.ctrl);const n=C.get(t);n&&t.ctrl.start(n.payload)}),()=>{Object(r.k)(x.current,t=>{t.expired&&clearTimeout(t.expirationId),O(t.ctrl,j),t.ctrl.stop(!0)})}));const S=St(w,o?o():e,k),E=c&&x.current||[];Object(r.A)(()=>Object(r.k)(E,({ctrl:t,item:e,key:n})=>{O(t,j),a(h,e,n)}));const P=[];if(k&&Object(r.k)(k,(t,e)=>{t.expired?(clearTimeout(t.expirationId),E.push(t)):~(e=P[e]=S.indexOf(t.key))&&(_[e]=t)}),Object(r.k)(w,(t,e)=>{_[e]||(_[e]={key:S[e],item:t,phase:_t.MOUNT,ctrl:new ct},_[e].ctrl.item=t)}),P.length){let t=-1;const{leave:n}=o?o():e;Object(r.k)(P,(e,r)=>{const s=k[r];~e?(t=_.indexOf(s),_[t]=i({},s,{item:w[e]})):n&&_.splice(++t,0,s)})}r.s.fun(u)&&_.sort((t,e)=>u(t.item,e.item));let M=-l;const A=Object(r.z)(),I=f(e),C=new Map,R=Object(s.useRef)(new Map),T=Object(s.useRef)(!1);Object(r.k)(_,(t,n)=>{const s=t.key,c=t.phase,u=o?o():e;let f,h,g=a(u.delay||0,s);if(c==_t.MOUNT)f=u.enter,h=_t.ENTER;else{const t=S.indexOf(s)<0;if(c!=_t.LEAVE)if(t)f=u.leave,h=_t.LEAVE;else{if(!(f=u.update))return;h=_t.UPDATE}else{if(t)return;f=u.enter,h=_t.ENTER}}if(f=a(f,t.item,n),f=r.s.obj(f)?m(f):{to:f},!f.config){const e=y||I.config;f.config=a(e,t.item,n,h)}M+=l;const O=i({},I,{delay:g+M,ref:b,immediate:u.immediate,reset:!1},f);if(h==_t.ENTER&&r.s.und(O.from)){const s=o?o():e,i=r.s.und(s.initial)||k?s.from:s.initial;O.from=a(i,t.item,n)}const{onResolve:v}=O;O.onResolve=t=>{a(v,t);const e=x.current,n=e.find(t=>t.key===s);if(n&&(!t.cancelled||n.phase==_t.UPDATE)&&n.ctrl.idle){const t=e.every(t=>t.ctrl.idle);if(n.phase==_t.LEAVE){const e=a(d,n.item);if(!1!==e){const r=!0===e?0:e;if(n.expired=!0,!t&&r>0)return void(r<=2147483647&&(n.expirationId=setTimeout(A,r)))}}t&&e.some(t=>t.expired)&&(R.current.delete(n),p&&(T.current=!0),A())}};const j=lt(t.ctrl,O);h===_t.LEAVE&&p?R.current.set(t,{phase:h,springs:j,payload:O}):C.set(t,{phase:h,springs:j,payload:O})});const N=Object(s.useContext)(bt),V=Object(r.D)(N),q=N!==V&&g(N);Object(r.A)(()=>{q&&Object(r.k)(_,t=>{t.ctrl.start({default:N})})},[N]),Object(r.k)(C,(t,e)=>{if(R.current.size){const t=_.findIndex(t=>t.key===e.key);_.splice(t,1)}}),Object(r.A)(()=>{Object(r.k)(R.current.size?R.current:C,({phase:t,payload:e},n)=>{const{ctrl:r}=n;n.phase=t,null==j||j.add(r),q&&t==_t.ENTER&&r.start({default:N}),e&&(v(r,e.ref),r.ref&&!T.current?r.update(e):(r.start(e),T.current&&(T.current=!1)))})},c?void 0:n);const D=t=>s.createElement(s.Fragment,null,_.map((e,n)=>{const{springs:o}=C.get(e)||e.ctrl,a=t(i({},o),e.item,e,n);return a&&a.type?s.createElement(a.type,i({},a.props,{key:r.s.str(e.key)||r.s.num(e.key)?e.key:e.ctrl.id,ref:a.ref})):a}));return j?[D,j]:D}!function(t){t.MOUNT="mount",t.ENTER="enter",t.UPDATE="update",t.LEAVE="leave"}(_t||(_t={}));let kt=1;function St(t,{key:e,keys:n=e},s){if(null===n){const e=new Set;return t.map(t=>{const n=s&&s.find(n=>n.item===t&&n.phase!==_t.LEAVE&&!e.has(n));return n?(e.add(n),n.key):kt++})}return r.s.und(n)?t:r.s.fun(n)?t.map(n):Object(r.y)(n)}class Et extends Q{constructor(t,e){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=t,this.calc=Object(r.f)(...e);const n=this._get(),s=Object(o.f)(n);Object(o.h)(this,s.create(n))}advance(t){const e=this._get(),n=this.get();Object(r.u)(e,n)||(Object(o.e)(this).setValue(e),this._onChange(e,this.idle)),!this.idle&&Mt(this._active)&&At(this)}_get(){const t=r.s.arr(this.source)?this.source.map(r.q):Object(r.y)(Object(r.q)(this.source));return this.calc(...t)}_start(){this.idle&&!Mt(this._active)&&(this.idle=!1,Object(r.k)(Object(o.g)(this),t=>{t.done=!1}),r.b.skipAnimation?(r.w.batchedUpdates(()=>this.advance()),At(this)):r.o.start(this))}_attach(){let t=1;Object(r.k)(Object(r.y)(this.source),e=>{Object(r.r)(e)&&Object(r.c)(e,this),U(e)&&(e.idle||this._active.add(e),t=Math.max(t,e.priority+1))}),this.priority=t,this._start()}_detach(){Object(r.k)(Object(r.y)(this.source),t=>{Object(r.r)(t)&&Object(r.x)(t,this)}),this._active.clear(),At(this)}eventObserved(t){"change"==t.type?t.idle?this.advance():(this._active.add(t.parent),this._start()):"idle"==t.type?this._active.delete(t.parent):"priority"==t.type&&(this.priority=Object(r.y)(this.source).reduce((t,e)=>Math.max(t,(U(e)?e.priority:0)+1),0))}}function Pt(t){return!1!==t.idle}function Mt(t){return!t.size||Array.from(t).every(Pt)}function At(t){t.idle||(t.idle=!0,Object(r.k)(Object(o.g)(t),t=>{t.done=!0}),Object(r.d)(t,{type:"idle",parent:t}))}r.b.assign({createStringInterpolator:r.g,to:(t,e)=>new Et(t,e)}),r.o.advance},,function(t,e){t.exports=window.regeneratorRuntime},,,function(t,e,n){"use strict";n.d(e,"animated",(function(){return _}));var r=n(43);n.o(r,"config")&&n.d(e,"config",(function(){return r.config})),n.o(r,"useSpring")&&n.d(e,"useSpring",(function(){return r.useSpring})),n.o(r,"useTransition")&&n.d(e,"useTransition",(function(){return r.useTransition}));var s=n(55),o=n(1),i=n(19);function a(t,e){if(null==t)return{};var n,r,s={},o=Object.keys(t);for(r=0;r=0||(s[n]=t[n]);return s}const c=["style","children","scrollTop","scrollLeft"],u=/^--/;function l(t,e){return null==e||"boolean"==typeof e||""===e?"":"number"!=typeof e||0===e||u.test(t)||f.hasOwnProperty(t)&&f[t]?(""+e).trim():e+"px"}const d={};let f={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};const p=["Webkit","Ms","Moz","O"];f=Object.keys(f).reduce((t,e)=>(p.forEach(n=>t[((t,e)=>t+e.charAt(0).toUpperCase()+e.substring(1))(n,e)]=t[e]),t),f);const h=["x","y","z"],m=/^(matrix|translate|scale|rotate|skew)/,b=/^(translate)/,g=/^(rotate|skew)/,y=(t,e)=>o.s.num(t)&&0!==t?t+e:t,O=(t,e)=>o.s.arr(t)?t.every(t=>O(t,e)):o.s.num(t)?t===e:parseFloat(t)===e;class v extends i.a{constructor(t){let{x:e,y:n,z:r}=t,s=a(t,h);const i=[],c=[];(e||n||r)&&(i.push([e||0,n||0,r||0]),c.push(t=>[`translate3d(${t.map(t=>y(t,"px")).join(",")})`,O(t,0)])),Object(o.l)(s,(t,e)=>{if("transform"===e)i.push([t||""]),c.push(t=>[t,""===t]);else if(m.test(e)){if(delete s[e],o.s.und(t))return;const n=b.test(e)?"px":g.test(e)?"deg":"";i.push(Object(o.y)(t)),c.push("rotate3d"===e?([t,e,r,s])=>[`rotate3d(${t},${e},${r},${y(s,n)})`,O(s,0)]:t=>[`${e}(${t.map(t=>y(t,n)).join(",")})`,O(t,e.startsWith("scale")?1:0)])}}),i.length&&(s.transform=new j(i,c)),super(s)}}class j extends o.a{constructor(t,e){super(),this._value=null,this.inputs=t,this.transforms=e}get(){return this._value||(this._value=this._get())}_get(){let t="",e=!0;return Object(o.k)(this.inputs,(n,r)=>{const s=Object(o.q)(n[0]),[i,a]=this.transforms[r](o.s.arr(s)?s:n.map(o.q));t+=" "+i,e=e&&a}),e?"none":t}observerAdded(t){1==t&&Object(o.k)(this.inputs,t=>Object(o.k)(t,t=>Object(o.r)(t)&&Object(o.c)(t,this)))}observerRemoved(t){0==t&&Object(o.k)(this.inputs,t=>Object(o.k)(t,t=>Object(o.r)(t)&&Object(o.x)(t,this)))}eventObserved(t){"change"==t.type&&(this._value=null),Object(o.d)(this,t)}}const w=["scrollTop","scrollLeft"];r.Globals.assign({batchedUpdates:s.unstable_batchedUpdates,createStringInterpolator:o.g,colors:o.e});const _=Object(i.d)(["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"],{applyAnimatedValues:function(t,e){if(!t.nodeType||!t.setAttribute)return!1;const n="filter"===t.nodeName||t.parentNode&&"filter"===t.parentNode.nodeName,r=e,{style:s,children:o,scrollTop:i,scrollLeft:f}=r,p=a(r,c),h=Object.values(p),m=Object.keys(p).map(e=>n||t.hasAttribute(e)?e:d[e]||(d[e]=e.replace(/([A-Z])/g,t=>"-"+t.toLowerCase())));void 0!==o&&(t.textContent=o);for(let e in s)if(s.hasOwnProperty(e)){const n=l(e,s[e]);u.test(e)?t.style.setProperty(e,n):t.style[e]=n}m.forEach((e,n)=>{t.setAttribute(e,h[n])}),void 0!==i&&(t.scrollTop=i),void 0!==f&&(t.scrollLeft=f)},createAnimatedStyle:t=>new v(t),getComponentProps:t=>a(t,w)}).animated},function(t,e){},function(t,e){},,,,,function(t,e){t.exports=window.ReactDOM},function(t,e){t.exports=window.moment},function(t,e){t.exports=window.wp.autop},function(t,e){function n(t,e,n,r,s,o,i){try{var a=t[o](i),c=a.value}catch(t){return void n(t)}a.done?e(c):Promise.resolve(c).then(r,s)}t.exports=function(t){return function(){var e=this,r=arguments;return new Promise((function(s,o){var i=t.apply(e,r);function a(t){n(i,s,o,a,c,"next",t)}function c(t){n(i,s,o,a,c,"throw",t)}a(void 0)}))}},t.exports.__esModule=!0,t.exports.default=t.exports},,,,,,,,,,,function(t,e,n){"use strict";var r=n(0),s=n(9);const o=Object(r.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(s.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"}));e.a=o},,,,,,,,,,,,,function(t,e,n){"use strict";n.r(e);var r=n(6),s=n.n(r),o=n(0),i=n(25),a=n.n(i),c=n(41),u=n(10),l=n(11),d=n.n(l);function f(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}function p(t){for(var e=1;e0&&Object(o.createElement)(m.animated.span,{style:r,className:"simpay-branding-bar__actions-button-count","aria-label":Object(b.sprintf)(/* translators: %d Unread notification count. */ +Object(b.__)("%d unread notifications","stripe"),e)},Object(o.createElement)("span",null,e)),Object(o.createElement)("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(o.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.8333 2.5H4.16667C3.25 2.5 2.5 3.25 2.5 4.16667V15.8333c0 .9167.74167 1.6667 1.66667 1.6667H15.8333c.9167 0 1.6667-.75 1.6667-1.6667V4.16667C17.5 3.25 16.75 2.5 15.8333 2.5Zm0 13.3333H4.16667v-2.5h2.96666C7.70833 14.325 8.775 15 10.0083 15c1.2334 0 2.2917-.675 2.875-1.6667h2.95v2.5Zm-4.1583-4.1666h4.1583V4.16667H4.16667v7.50003h4.175c0 .9166.75 1.6666 1.66663 1.6666.9167 0 1.6667-.75 1.6667-1.6666Z",fill:"currentColor"})))},y=n(56),O=n.n(y),v=n(3),j=n(57),w="simpay-notifications-notification",_=simpayNotifications.isLite;function x(t){switch(t){case"warning":return"warning";case"error":return"dismiss";case"info":return"admin-generic";case"success":default:return"yes-alt"}}function k(t){return Object(u.getAuthority)(window.location.href)!==Object(u.getAuthority)(t)}function S(t,e,n){return!1===k(t)?t:Object(u.addQueryArgs)(t.replace(/\/?$/,"/"),{utm_source:"WordPress",utm_campaign:"1"===_?"lite-plugin":"pro-plugin",utm_medium:e,utm_content:n})}var E=function(t){var e=t.notification,n=t.onDismissNotification,r=e.id,s=e.title,i=e.content,a=e.type,c=e.start,u=e.actions,l=e.is_dismissible;return Object(o.createElement)("div",{className:w,style:{backgroundColor:l?"transparent":"#fafafa"}},Object(o.createElement)("div",{className:"".concat(w,"__icon ").concat(w,"__icon-").concat(a||"success")},Object(o.createElement)("span",{className:"dashicons dashicons-".concat(x(a))})),Object(o.createElement)("div",{className:"".concat(w,"__body")},Object(o.createElement)("div",{className:"".concat(w,"__header")},Object(o.createElement)("div",{className:"".concat(w,"__title")},s),l&&Object(o.createElement)("div",{className:"".concat(w,"__date")},O.a.unix(c).fromNow())),Object(o.createElement)("div",{className:"".concat(w,"__content"),dangerouslySetInnerHTML:{__html:Object(j.autop)(i)}}),Object(o.createElement)("div",{className:"".concat(w,"__actions")},u.map((function(t){var e=t.type,n=t.text,r=t.url;return Object(o.createElement)(v.Button,{key:n,href:S(r,"notification-inbox",s),isPrimary:"primary"===e,isSecondary:"secondary"===e,variant:e,target:k(r)?"_blank":"_self"},n)})),l&&Object(o.createElement)(v.Button,{isLink:!0,variant:"link",onClick:function(){return n(r)}},Object(b.__)("Dismiss","stripe")))))},P=n(58),M=n.n(P),A=n(45),I=n.n(A),C=n(13),R=n.n(C),T=n(12),N=n(20);function V(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:s}}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,i=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return i=t.done,t},e:function(t){a=!0,o=t},f:function(){try{i||null==n.return||n.return()}finally{if(a)throw o}}}}(t?s.current:r.current);try{for(i.s();!(o=i.n()).done;)q(o.value,t)}catch(t){i.e(t)}finally{i.f()}}),[])}([Object(N.useConstrainedTabbing)(),Object(N.useFocusReturn)(),c]),l=Object(o.useState)((function(){return new WeakMap})),d=s()(l,1)[0],f=Object(T.sortBy)(i,"is_dismissible"),p=Object(m.useTransition)(f,{config:m.config.default,enter:function(t){return function(){var e=M()(I.a.mark((function e(n){return I.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n({height:d.get(t).offsetHeight,transform:"translate3d(0%, 0px, 0px)"});case 2:case"end":return e.stop()}}),e)})));return function(_x){return e.apply(this,arguments)}}()},leave:[{transform:"translate3d(150%, 0px, 0px)"},{height:0}],keys:function(t){return t.id},trail:100});return Object(o.createElement)(v.Animate,{type:"slide-in",options:{origin:"left"}},(function(t){var s=t.className,c=R()("simpay-notifications-panel",s);return Object(o.createElement)("div",{ref:u,className:c},Object(o.createElement)(z,{count:e.data.length,onClose:n}),Object(o.createElement)("div",{className:"simpay-notifications-panel__notifications"},a&&Object(o.createElement)("div",{className:"simpay-notifications-panel__none"},Object(o.createElement)(v.Spinner,null)),0===i.length&&!a&&Object(o.createElement)("div",{className:"simpay-notifications-panel__none"},Object(o.createElement)("span",null,Object(b.__)("You have no new notifications.","stripe"))),p((function(t,e){return Object(o.createElement)(m.animated.div,{style:F(F({},t),{},{overflow:"hidden"}),ref:function(t){return t&&d.set(e,t)}},Object(o.createElement)(E,{onDismissNotification:r,notification:e}))}))))}))},$=function(t){var e=t.isOpen,n=t.onClose;return Object(o.useEffect)((function(){return document.body.classList.toggle("simpay-notifications-body-locked"),function(){document.body.classList.remove("simpay-notifications-body-locked")}}),[e]),Object(o.createElement)("button",{className:"simpay-notifications-backdrop",onClick:n})};Object(o.render)(Object(o.createElement)((function(){var t=Object(o.useReducer)(h,{data:[],isLoading:!0}),e=s()(t,2),n=e[0],r=e[1],i=Object(o.useState)("#notifications"===Object(u.getFragment)(window.location.href)),l=s()(i,2),d=l[0],f=l[1];function p(){f(!1),window.history.pushState("",document.title,window.location.pathname+window.location.search)}return Object(o.useEffect)((function(){function t(){"#notifications"===Object(u.getFragment)(window.location.href)&&f(!0)}return window.addEventListener("hashchange",t),function(){window.removeEventListener("hashchange",t)}}),[]),Object(o.useEffect)((function(){if(!n.isLoading){var t=document.querySelector("#wp-admin-bar-simpay-admin-bar-test-mode .wp-ui-notification");if(0===n.data.length){t&&t.remove();var e=document.getElementById("wp-admin-bar-simpay-notifications");e&&e.remove();var r=document.querySelector('#menu-posts-simple-pay .wp-submenu a[href$="#notifications"]');r&&r.remove()}else t&&(t.textContent=n.data.length)}}),[n.data]),Object(o.useEffect)((function(){r({type:"START_RESOLUTION"}),a()({path:"/wpsp/__internal__/notifications"}).then((function(t){var e=t.data;r({type:"SET",notifications:e}),r({type:"FINISH_RESOLUTION"})}))}),[]),Object(o.createElement)("div",{onKeyDown:function(t){t.keyCode!==c.ESCAPE||t.defaultPrevented||(t.preventDefault(),f(!1))},role:"region"},Object(o.createElement)(g,{count:n.data.length,isOpen:d,onOpen:function(){f(!0),window.history.pushState("",document.title,window.location.pathname+window.location.search+"#notifications")}}),d&&Object(o.createElement)(o.Fragment,null,Object(o.createElement)(U,{notifications:n,onDismissNotification:function(t){r({type:"DISMISS",id:t}),a()({path:"/wpsp/__internal__/notifications/"+t,method:"DELETE"})},onClose:p}),Object(o.createElement)($,{onClose:p})))}),null),document.getElementById("simpay-branding-bar-notifications"))}]); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-page-activity-reports-css.asset.php b/includes/core/assets/js/dist/simpay-admin-page-activity-reports-css.asset.php index 85b7af67..43f87d6a 100644 --- a/includes/core/assets/js/dist/simpay-admin-page-activity-reports-css.asset.php +++ b/includes/core/assets/js/dist/simpay-admin-page-activity-reports-css.asset.php @@ -1 +1 @@ - array(), 'version' => 'e9b7cd73b88acda30af513715d29ee94'); \ No newline at end of file + array(), 'version' => '573049bae9275d33a66d652f3a3ff8c7'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-page-activity-reports.asset.php b/includes/core/assets/js/dist/simpay-admin-page-activity-reports.asset.php index 6b760685..8f0ad733 100644 --- a/includes/core/assets/js/dist/simpay-admin-page-activity-reports.asset.php +++ b/includes/core/assets/js/dist/simpay-admin-page-activity-reports.asset.php @@ -1 +1 @@ - array('lodash', 'react', 'wp-api-fetch', 'wp-components', 'wp-core-data', 'wp-data', 'wp-date', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => 'ad02552a44b26c92e9cfba7c85c340fc'); \ No newline at end of file + array('lodash', 'react', 'wp-api-fetch', 'wp-components', 'wp-core-data', 'wp-data', 'wp-date', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => '865904a6360b86b2b48ca786d982c481'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-page-activity-reports.js b/includes/core/assets/js/dist/simpay-admin-page-activity-reports.js index 80255911..4cae676a 100644 --- a/includes/core/assets/js/dist/simpay-admin-page-activity-reports.js +++ b/includes/core/assets/js/dist/simpay-admin-page-activity-reports.js @@ -1,6 +1,6 @@ -!function(t){var e={};function i(n){if(e[n])return e[n].exports;var a=e[n]={i:n,l:!1,exports:{}};return t[n].call(a.exports,a,a.exports,i),a.l=!0,a.exports}i.m=t,i.c=e,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 a in t)i.d(n,a,function(e){return t[e]}.bind(null,a));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="",i(i.s=77)}([function(t,e){t.exports=window.wp.element},,function(t,e){t.exports=window.wp.i18n},function(t,e){t.exports=window.wp.components},function(t,e,i){"use strict";function n(t,e){if(e.length1?"s":"")+" required, but only "+e.length+" present")}i.d(e,"a",(function(){return n}))},function(t,e){t.exports=window.React},function(t,e,i){var n=i(26),a=i(27),s=i(21),r=i(28);t.exports=function(t,e){return n(t)||a(t,e)||s(t,e)||r()},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){"use strict";function n(t){if(null===t||!0===t||!1===t)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}i.d(e,"a",(function(){return n}))},function(t,e,i){"use strict";i.d(e,"a",(function(){return s}));var n=i(4);function a(t){return(a="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 s(t){Object(n.a)(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||"object"===a(t)&&"[object Date]"===e?new Date(t.getTime()):"number"==typeof t||"[object Number]"===e?new Date(t):("string"!=typeof t&&"[object String]"!==e||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}},function(t,e){t.exports=window.wp.primitives},function(t,e){t.exports=window.wp.url},function(t,e,i){var n=i(30);t.exports=function(t,e,i){return(e=n(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=window.lodash},function(t,e,i){"use strict";i.d(e,"b",(function(){return Rr})),i.d(e,"e",(function(){return jr})),i.d(e,"d",(function(){return yr})),i.d(e,"c",(function(){return xr})),i.d(e,"a",(function(){return Pr}));var n=i(15),a=i.n(n),s=i(11),r=i.n(s),o=i(6),l=i.n(o),c=i(0);const h="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function d(t,e,i){const n=i||(t=>Array.prototype.slice.call(t));let a=!1,s=[];return function(...i){s=n(i),a||(a=!0,h.call(window,()=>{a=!1,t.apply(e,s)}))}}const u=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2;function f(){}const p=function(){let t=0;return function(){return t++}}();function g(t){return null==t}function m(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.substr(0,7)&&"Array]"===e.substr(-6)}function b(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}const y=t=>("number"==typeof t||t instanceof Number)&&isFinite(+t);function x(t,e){return y(t)?t:e}function v(t,e){return void 0===t?e:t}const _=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function w(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function O(t,e,i,n){let a,s,r;if(m(t))if(s=t.length,n)for(a=s-1;a>=0;a--)e.call(i,t[a],a);else for(a=0;ai;)t=t[e.substr(i,n-i)],i=n+1,n=C(e,i);return t}function A(t){return t.charAt(0).toUpperCase()+t.slice(1)}const L=t=>void 0!==t,R=t=>"function"==typeof t,N=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0},F=Math.PI,I=2*F,z=I+F,V=Number.POSITIVE_INFINITY,B=F/180,W=F/2,H=F/4,U=2*F/3,Y=Math.log10,$=Math.sign;function X(t){const e=Math.round(t);t=G(t,e,t/1e3)?e:t;const i=Math.pow(10,Math.floor(Y(t))),n=t/i;return(n<=1?1:n<=2?2:n<=5?5:10)*i}function q(t){return!isNaN(parseFloat(t))&&isFinite(t)}function G(t,e,i){return Math.abs(t-e)l&&c=Math.min(e,i)-n&&t<=Math.max(e,i)+n}const ot=t=>0===t||1===t,lt=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*I/i),ct=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*I/i)+1,ht={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*W),easeOutSine:t=>Math.sin(t*W),easeInOutSine:t=>-.5*(Math.cos(F*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>ot(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>ot(t)?t:lt(t,.075,.3),easeOutElastic:t=>ot(t)?t:ct(t,.075,.3),easeInOutElastic(t){const e=.1125;return ot(t)?t:t<.5?.5*lt(2*t,e,.45):.5+.5*ct(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-ht.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*ht.easeInBounce(2*t):.5*ht.easeOutBounce(2*t-1)+.5},dt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},ut="0123456789ABCDEF",ft=t=>ut[15&t],pt=t=>ut[(240&t)>>4]+ut[15&t],gt=t=>(240&t)>>4==(15&t);function mt(t){return t+.5|0}const bt=(t,e,i)=>Math.max(Math.min(t,i),e);function yt(t){return bt(mt(2.55*t),0,255)}function xt(t){return bt(mt(255*t),0,255)}function vt(t){return bt(mt(t/2.55)/100,0,1)}function _t(t){return bt(mt(100*t),0,100)}const wt=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/,Ot=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Mt(t,e,i){const n=e*Math.min(i,1-i),a=(e,a=(e+t/30)%12)=>i-n*Math.max(Math.min(a-3,9-a,1),-1);return[a(0),a(8),a(4)]}function kt(t,e,i){const n=(n,a=(n+t/60)%6)=>i-i*e*Math.max(Math.min(a,4-a,1),0);return[n(5),n(3),n(1)]}function jt(t,e,i){const n=Mt(t,1,.5);let a;for(e+i>1&&(a=1/(e+i),e*=a,i*=a),a=0;a<3;a++)n[a]*=1-e-i,n[a]+=e;return n}function St(t){const e=t.r/255,i=t.g/255,n=t.b/255,a=Math.max(e,i,n),s=Math.min(e,i,n),r=(a+s)/2;let o,l,c;return a!==s&&(c=a-s,l=r>.5?c/(2-a-s):c/(a+s),o=a===e?(i-n)/c+(i=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=xt(t[3]))):(e=Rt(t,{r:0,g:0,b:0,a:1})).a=xt(e.a),e}function Ft(t){return"r"===t.charAt(0)?function(t){const e=wt.exec(t);let i,n,a,s=255;if(e){if(e[7]!==i){const t=+e[7];s=255&(e[8]?yt(t):255*t)}return i=+e[1],n=+e[3],a=+e[5],i=255&(e[2]?yt(i):i),n=255&(e[4]?yt(n):n),a=255&(e[6]?yt(a):a),{r:i,g:n,b:a,a:s}}}(t):function(t){const e=Ot.exec(t);let i,n=255;if(!e)return;e[5]!==i&&(n=e[6]?yt(+e[5]):xt(+e[5]));const a=Et(+e[2]),s=+e[3]/100,r=+e[4]/100;return i="hwb"===e[1]?function(t,e,i){return Dt(jt,t,e,i)}(a,s,r):"hsv"===e[1]?function(t,e,i){return Dt(kt,t,e,i)}(a,s,r):Pt(a,s,r),{r:i[0],g:i[1],b:i[2],a:n}}(t)}class It{constructor(t){if(t instanceof It)return t;const e=typeof t;let i;var n,a,s;"object"===e?i=Nt(t):"string"===e&&(s=(n=t).length,"#"===n[0]&&(4===s||5===s?a={r:255&17*dt[n[1]],g:255&17*dt[n[2]],b:255&17*dt[n[3]],a:5===s?17*dt[n[4]]:255}:7!==s&&9!==s||(a={r:dt[n[1]]<<4|dt[n[2]],g:dt[n[3]]<<4|dt[n[4]],b:dt[n[5]]<<4|dt[n[6]],a:9===s?dt[n[7]]<<4|dt[n[8]]:255})),i=a||function(t){At||(At=function(){const t={},e=Object.keys(Tt),i=Object.keys(Ct);let n,a,s,r,o;for(n=0;n>16&255,s>>8&255,255&s]}return t}(),At.transparent=[0,0,0,0]);const e=At[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}(t)||Ft(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Rt(this._rgb);return t&&(t.a=vt(t.a)),t}set rgb(t){this._rgb=Nt(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${vt(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):this._rgb;var t}hexString(){return this._valid?(t=this._rgb,e=function(t){return gt(t.r)&>(t.g)&>(t.b)&>(t.a)}(t)?ft:pt,t?"#"+e(t.r)+e(t.g)+e(t.b)+(t.a<255?e(t.a):""):t):this._rgb;var t,e}hslString(){return this._valid?function(t){if(!t)return;const e=St(t),i=e[0],n=_t(e[1]),a=_t(e[2]);return t.a<255?`hsla(${i}, ${n}%, ${a}%, ${vt(t.a)})`:`hsl(${i}, ${n}%, ${a}%)`}(this._rgb):this._rgb}mix(t,e){const i=this;if(t){const n=i.rgb,a=t.rgb;let s;const r=e===s?.5:e,o=2*r-1,l=n.a-a.a,c=((o*l==-1?o:(o+l)/(1+o*l))+1)/2;s=1-c,n.r=255&c*n.r+s*a.r+.5,n.g=255&c*n.g+s*a.g+.5,n.b=255&c*n.b+s*a.b+.5,n.a=r*n.a+(1-r)*a.a,i.rgb=n}return i}clone(){return new It(this.rgb)}alpha(t){return this._rgb.a=xt(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=mt(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Lt(this._rgb,2,t),this}darken(t){return Lt(this._rgb,2,-t),this}saturate(t){return Lt(this._rgb,1,t),this}desaturate(t){return Lt(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=St(t);i[0]=Et(i[0]+e),i=Pt(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}function zt(t){return new It(t)}const Vt=t=>t instanceof CanvasGradient||t instanceof CanvasPattern;function Bt(t){return Vt(t)?t:zt(t)}function Wt(t){return Vt(t)?t:zt(t).saturate(.5).darken(.1).hexString()}const Ht=Object.create(null),Ut=Object.create(null);function Yt(t,e){if(!e)return t;const i=e.split(".");for(let e=0,n=i.length;et.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>Wt(e.backgroundColor),this.hoverBorderColor=(t,e)=>Wt(e.borderColor),this.hoverColor=(t,e)=>Wt(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t)}set(t,e){return $t(this,t,e)}get(t){return Yt(this,t)}describe(t,e){return $t(Ut,t,e)}override(t,e){return $t(Ht,t,e)}route(t,e,i,n){const a=Yt(this,t),s=Yt(this,i),r="_"+e;Object.defineProperties(a,{[r]:{value:a[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[r],e=s[n];return b(t)?Object.assign({},e,t):v(t,e)},set(t){this[r]=t}}})}}({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function qt(t,e,i,n,a){let s=e[a];return s||(s=e[a]=t.measureText(a).width,i.push(a)),s>n&&(n=s),n}function Gt(t,e,i,n){let a=(n=n||{}).data=n.data||{},s=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(a=n.data={},s=n.garbageCollect=[],n.font=e),t.save(),t.font=e;let r=0;const o=i.length;let l,c,h,d,u;for(l=0;li.length){for(l=0;l0&&t.stroke()}}function Jt(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.xe.top-i&&t.y0&&""!==s.strokeColor;let l,c;for(t.save(),t.font=a.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),g(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,s),l=0;lv(t[i],t[e[i]]):e=>t[e]:()=>t;for(const t of a)i[t]=+s(t)||0;return i}function de(t){return he(t,{top:"y",right:"x",bottom:"y",left:"x"})}function ue(t){return he(t,["topLeft","topRight","bottomLeft","bottomRight"])}function fe(t){const e=de(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function pe(t,e){t=t||{},e=e||Xt.font;let i=v(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let n=v(t.style,e.style);n&&!(""+n).match(le)&&(console.warn('Invalid font style specified: "'+n+'"'),n="");const a={family:v(t.family,e.family),lineHeight:ce(v(t.lineHeight,e.lineHeight),i),size:i,style:n,weight:v(t.weight,e.weight),string:""};return a.string=function(t){return!t||g(t.size)||g(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(a),a}function ge(t,e,i,n){let a,s,r,o=!0;for(a=0,s=t.length;at[i]1;)n=s+a>>1,i(n)?s=n:a=n;return{lo:s,hi:a}}const ye=(t,e,i)=>be(t,i,n=>t[n][e]be(t,i,n=>t[n][e]>=i),ve=["push","pop","shift","splice","unshift"];function _e(t,e){const i=t._chartjs;if(!i)return;const n=i.listeners,a=n.indexOf(e);-1!==a&&n.splice(a,1),n.length>0||(ve.forEach(e=>{delete t[e]}),delete t._chartjs)}function we(t){const e=new Set;let i,n;for(i=0,n=t.length;it[0])){L(n)||(n=Le("_fallback",t));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:i,_fallback:n,_getTarget:a,override:a=>Oe([a,...t],e,i,n)};return new Proxy(s,{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,n)=>De(i,n,()=>function(t,e,i,n){let a;for(const s of e)if(a=Le(je(s,t),i),L(a))return Se(t,a)?Te(i,n,t,a):a}(n,e,t,i)),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>Re(t).includes(e),ownKeys:t=>Re(t),set(t,e,i){const n=t._storage||(t._storage=a());return t[e]=n[e]=i,delete t._keys,!0}})}function Me(t,e,i,n){const a={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:ke(t,n),setContext:e=>Me(t,e,i,n),override:a=>Me(t.override(a),e,i,n)};return new Proxy(a,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>De(t,e,()=>function(t,e,i){const{_proxy:n,_context:a,_subProxy:s,_descriptors:r}=t;let o=n[e];return R(o)&&r.isScriptable(e)&&(o=function(t,e,i,n){const{_proxy:a,_context:s,_subProxy:r,_stack:o}=i;if(o.has(t))throw new Error("Recursion detected: "+Array.from(o).join("->")+"->"+t);return o.add(t),e=e(s,r||n),o.delete(t),Se(t,e)&&(e=Te(a._scopes,a,t,e)),e}(e,o,t,i)),m(o)&&o.length&&(o=function(t,e,i,n){const{_proxy:a,_context:s,_subProxy:r,_descriptors:o}=i;if(L(s.index)&&n(t))e=e[s.index%e.length];else if(b(e[0])){const i=e,n=a._scopes.filter(t=>t!==i);e=[];for(const l of i){const i=Te(n,a,t,l);e.push(Me(i,s,r&&r[t],o))}}return e}(e,o,t,r.isIndexable)),Se(e,o)&&(o=Me(o,a,s&&s[e],r)),o}(t,e,i)),getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,i)=>Reflect.has(t,i),ownKeys:()=>Reflect.ownKeys(t),set:(e,i,n)=>(t[i]=n,delete e[i],!0)})}function ke(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:n=e.indexable,_allKeys:a=e.allKeys}=t;return{allKeys:a,scriptable:i,indexable:n,isScriptable:R(i)?i:()=>i,isIndexable:R(n)?n:()=>n}}const je=(t,e)=>t?t+A(e):e,Se=(t,e)=>b(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function De(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const n=i();return t[e]=n,n}function Pe(t,e,i){return R(t)?t(e,i):t}const Ee=(t,e)=>!0===t?e:"string"==typeof t?T(e,t):void 0;function Ce(t,e,i,n,a){for(const s of e){const e=Ee(i,s);if(e){t.add(e);const s=Pe(e._fallback,i,a);if(L(s)&&s!==i&&s!==n)return s}else if(!1===e&&L(n)&&i!==n)return null}return!1}function Te(t,e,i,n){const a=e._rootScopes,s=Pe(e._fallback,i,n),r=[...t,...a],o=new Set;o.add(n);let l=Ae(o,r,i,s||i,n);return null!==l&&(!L(s)||s===i||(l=Ae(o,r,s,l,n),null!==l))&&Oe(Array.from(o),[""],a,s,()=>function(t,e,i){const n=t._getTarget();e in n||(n[e]={});const a=n[e];return m(a)&&b(i)?i:a}(e,i,n))}function Ae(t,e,i,n,a){for(;i;)i=Ce(t,e,i,n,a);return i}function Le(t,e){for(const i of e){if(!i)continue;const e=i[t];if(L(e))return e}}function Re(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter(t=>!t.startsWith("_")))e.add(t);return Array.from(e)}(t._scopes)),e}const Ne=Number.EPSILON||1e-14,Fe=(t,e)=>e"x"===t?"y":"x";function ze(t,e,i,n){const a=t.skip?e:t,s=e,r=i.skip?e:i,o=et(s,a),l=et(r,s);let c=o/(o+l),h=l/(o+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=n*c,u=n*h;return{previous:{x:s.x-d*(r.x-a.x),y:s.y-d*(r.y-a.y)},next:{x:s.x+u*(r.x-a.x),y:s.y+u*(r.y-a.y)}}}function Ve(t,e,i){return Math.max(Math.min(t,i),e)}function Be(t,e,i,n,a){let s,r,o,l;if(e.spanGaps&&(t=t.filter(t=>!t.skip)),"monotone"===e.cubicInterpolationMode)!function(t,e="x"){const i=Ie(e),n=t.length,a=Array(n).fill(0),s=Array(n);let r,o,l,c=Fe(t,0);for(r=0;rwindow.getComputedStyle(t,null),$e=["top","right","bottom","left"];function Xe(t,e,i){const n={};i=i?"-"+i:"";for(let a=0;a<4;a++){const s=$e[a];n[s]=parseFloat(t[e+"-"+s+i])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function qe(t,e){const{canvas:i,currentDevicePixelRatio:n}=e,a=Ye(i),s="border-box"===a.boxSizing,r=Xe(a,"padding"),o=Xe(a,"border","width"),{x:l,y:c,box:h}=function(t,e){const i=t.native||t,n=i.touches,a=n&&n.length?n[0]:i,{offsetX:s,offsetY:r}=a;let o,l,c=!1;if(((t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot))(s,r,i.target))o=s,l=r;else{const t=e.getBoundingClientRect();o=a.clientX-t.left,l=a.clientY-t.top,c=!0}return{x:o,y:l,box:c}}(t,i),d=r.left+(h&&o.left),u=r.top+(h&&o.top);let{width:f,height:p}=e;return s&&(f-=r.width+o.width,p-=r.height+o.height),{x:Math.round((l-d)/f*i.width/n),y:Math.round((c-u)/p*i.height/n)}}const Ge=t=>Math.round(10*t)/10;function Qe(t,e,i){const n=e||1,a=Math.floor(t.height*n),s=Math.floor(t.width*n);t.height=a/n,t.width=s/n;const r=t.canvas;return r.style&&(i||!r.style.height&&!r.style.width)&&(r.style.height=t.height+"px",r.style.width=t.width+"px"),(t.currentDevicePixelRatio!==n||r.height!==a||r.width!==s)&&(t.currentDevicePixelRatio=n,r.height=a,r.width=s,t.ctx.setTransform(n,0,0,n,0,0),!0)}const Ze=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(t){}return t}();function Ke(t,e){const i=function(t,e){return Ye(t).getPropertyValue(e)}(t,e),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function Je(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function ti(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:"middle"===n?i<.5?t.y:e.y:"after"===n?i<1?t.y:e.y:i>0?e.y:t.y}}function ei(t,e,i,n){const a={x:t.cp2x,y:t.cp2y},s={x:e.cp1x,y:e.cp1y},r=Je(t,a,i),o=Je(a,s,i),l=Je(s,e,i),c=Je(r,o,i),h=Je(o,l,i);return Je(c,h,i)}const ii=new Map;function ni(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let n=ii.get(i);return n||(n=new Intl.NumberFormat(t,e),ii.set(i,n)),n}(e,i).format(t)}function ai(t,e,i){return t?function(t,e){return{x:i=>t+t+e-i,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,i):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function si(t){return"angle"===t?{between:at,compare:it,normalize:nt}:{between:rt,compare:(t,e)=>t-e,normalize:t=>t}}function ri({start:t,end:e,count:i,loop:n,style:a}){return{start:t%i,end:e%i,loop:n&&(e-t+1)%i==0,style:a}}function oi(t,e,i){if(!i)return[t];const{property:n,start:a,end:s}=i,r=e.length,{compare:o,between:l,normalize:c}=si(n),{start:h,end:d,loop:u,style:f}=function(t,e,i){const{property:n,start:a,end:s}=i,{between:r,normalize:o}=si(n),l=e.length;let c,h,{start:d,end:u,loop:f}=t;if(f){for(d+=l,u+=l,c=0,h=l;cn({chart:t,initial:e.initial,numSteps:s,currentStep:Math.min(i-e.start,s)}))}_refresh(){this._request||(this._running=!0,this._request=h.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,n)=>{if(!i.running||!i.items.length)return;const a=i.items;let s,r=a.length-1,o=!1;for(;r>=0;--r)s=a[r],s._active?(s._total>i.duration&&(i.duration=s._total),s.tick(t),o=!0):(a[r]=a[a.length-1],a.pop());o&&(n.draw(),this._notify(n,i,t,"progress")),a.length||(i.running=!1,this._notify(n,i,t,"complete"),i.initial=!1),e+=a.length}),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((t,e)=>Math.max(t,e._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let n=i.length-1;for(;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}};const ui={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const n=Bt(t||"transparent"),a=n.valid&&Bt(e||"transparent");return a&&a.valid?a.mix(n,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class fi{constructor(t,e,i,n){const a=e[i];n=ge([t.to,n,a,t.from]);const s=ge([t.from,a,n]);this._active=!0,this._fn=t.fn||ui[t.type||typeof s],this._easing=ht[t.easing]||ht.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=s,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const n=this._target[this._prop],a=i-this._start,s=this._duration-a;this._start=i,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=a,this._loop=!!t.loop,this._to=ge([t.to,e,n,t.from]),this._from=ge([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,n=this._prop,a=this._from,s=this._loop,r=this._to;let o;if(this._active=a!==r&&(s||e1?2-o:o,o=this._easing(Math.min(1,Math.max(0,o))),this._target[n]=this._fn(a,r,o))}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let t=0;t"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),Xt.set("animations",{colors:{type:"color",properties:["color","borderColor","backgroundColor"]},numbers:{type:"number",properties:["x","y","borderWidth","radius","tension"]}}),Xt.describe("animations",{_fallback:"animation"}),Xt.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}});class gi{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!b(t))return;const e=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const n=t[i];if(!b(n))return;const a={};for(const t of pi)a[t]=n[t];(m(n.properties)&&n.properties||[i]).forEach(t=>{t!==i&&e.has(t)||e.set(t,a)})})}_animateOptions(t,e){const i=e.options,n=function(t,e){if(!e)return;let i=t.options;if(i)return i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i;t.options=e}(t,i);if(!n)return[];const a=this._createAnimations(n,i);return i.$shared&&function(t,e){const i=[],n=Object.keys(e);for(let e=0;e{t.options=i},()=>{}),a}_createAnimations(t,e){const i=this._properties,n=[],a=t.$animations||(t.$animations={}),s=Object.keys(e),r=Date.now();let o;for(o=s.length-1;o>=0;--o){const l=s[o];if("$"===l.charAt(0))continue;if("options"===l){n.push(...this._animateOptions(t,e));continue}const c=e[l];let h=a[l];const d=i.get(l);if(h){if(d&&h.active()){h.update(d,c,r);continue}h.cancel()}d&&d.duration?(a[l]=h=new fi(d,t,l,c),n.push(h)):t[l]=c}return n}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(di.add(this._chart,i),!0):void 0}}function mi(t,e){const i=t&&t.options||{},n=i.reverse,a=void 0===i.min?e:0,s=void 0===i.max?e:0;return{start:n?s:a,end:n?a:s}}function bi(t,e){const i=[],n=t._getSortedDatasetMetas(e);let a,s;for(a=0,s=n.length;a0||!i&&e<0)return a.index}return null}function wi(t,e){const{chart:i,_cachedMeta:n}=t,a=i._stacks||(i._stacks={}),{iScale:s,vScale:r,index:o}=n,l=s.axis,c=r.axis,h=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(s,r,n),d=e.length;let u;for(let t=0;ti[t].axis===e).shift()}function Mi(t,e){const i=t.controller.index,n=t.vScale&&t.vScale.axis;if(n){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[n]||void 0===e[n][i])return;delete e[n][i]}}}const ki=t=>"reset"===t||"none"===t,ji=(t,e)=>e?t:Object.assign({},t);class Si{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=xi(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&Mi(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=(t,e,i,n)=>"x"===t?e:"r"===t?n:i,a=e.xAxisID=v(i.xAxisID,Oi(t,"x")),s=e.yAxisID=v(i.yAxisID,Oi(t,"y")),r=e.rAxisID=v(i.rAxisID,Oi(t,"r")),o=e.indexAxis,l=e.iAxisID=n(o,a,s,r),c=e.vAxisID=n(o,s,a,r);e.xScale=this.getScaleForId(a),e.yScale=this.getScaleForId(s),e.rScale=this.getScaleForId(r),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&_e(this._data,this),t._stacked&&Mi(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(b(e))this._data=function(t){const e=Object.keys(t),i=new Array(e.length);let n,a,s;for(n=0,a=e.length;n{const e="_onData"+A(t),i=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...t){const a=i.apply(this,t);return n._chartjs.listeners.forEach(i=>{"function"==typeof i[e]&&i[e](...t)}),a}})}))),this._syncList=[],this._data=e}var n}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let n=!1;this._dataCheck();const a=e._stacked;e._stacked=xi(e.vScale,e),e.stack!==i.stack&&(n=!0,Mi(e),e.stack=i.stack),this._resyncElements(t),(n||a!==e._stacked)&&wi(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:n}=this,{iScale:a,_stacked:s}=i,r=a.axis;let o,l,c,h=0===t&&e===n.length||i._sorted,d=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=n,i._sorted=!0,c=n;else{c=m(n[t])?this.parseArrayData(i,n,t,e):b(n[t])?this.parseObjectData(i,n,t,e):this.parsePrimitiveData(i,n,t,e);const a=()=>null===l[r]||d&&l[r]t&&!e.hidden&&e._stacked&&{keys:bi(i,!0),values:null})(e,i,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:h}=function(t){const{min:e,max:i,minDefined:n,maxDefined:a}=t.getUserBounds();return{min:n?e:Number.NEGATIVE_INFINITY,max:a?i:Number.POSITIVE_INFINITY}}(r);let d,u;function f(){u=n[d];const e=u[r.axis];return!y(u[t.axis])||c>e||h=0;--d)if(!f()){this.updateRangeFromParsed(l,t,u,o);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let n,a,s;for(n=0,a=e.length;n=0&&tthis.getContext(i,n),h);return f.$shared&&(f.$shared=o,a[s]=Object.freeze(ji(f,o))),f}_resolveAnimations(t,e,i){const n=this.chart,a=this._cachedDataOpts,s="animation-"+e,r=a[s];if(r)return r;let o;if(!1!==n.options.animation){const n=this.chart.config,a=n.datasetAnimationScopeKeys(this._type,e),s=n.getOptionScopes(this.getDataset(),a);o=n.createResolver(s,this.getContext(t,i,e))}const l=new gi(n,o&&o.animations);return o&&o._cacheable&&(a[s]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||ki(t)||this.chart._animationsDisabled}updateElement(t,e,i,n){ki(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!ki(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;const a=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(a)||a})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];const n=i.length,a=e.length,s=Math.min(a,n);s&&this.parse(0,s),a>n?this._insertElements(n,a-n,t):a{for(t.length+=e,r=t.length-1;r>=s;r--)t[r]=t[r-e]};for(o(a),r=t;rt-e))}return t._cache.$bar}(e,t.type);let n,a,s,r,o=e._length;const l=()=>{32767!==s&&-32768!==s&&(L(r)&&(o=Math.min(o,Math.abs(s-r)||o)),r=s)};for(n=0,a=i.length;nMath.abs(o)&&(l=o,c=r),e[i.axis]=c,e._custom={barStart:l,barEnd:c,start:a,end:s,min:r,max:o}}(t,e,i,n):e[i.axis]=i.parse(t,n),e}function Ei(t,e,i,n){const a=t.iScale,s=t.vScale,r=a.getLabels(),o=a===s,l=[];let c,h,d,u;for(c=i,h=i+n;ct.x,i="left",n="right"):(e=t.base=i?1:-1)}(h,e,s)*a,d===s&&(m-=h/2),c=m+h),m===e.getPixelForValue(s)){const t=$(h)*e.getLineWidthForValue(s)/2;m+=t,h-=t}return{size:h,base:m,head:c,center:c+h/2}}_calculateBarIndexPixels(t,e){const i=e.scale,n=this.options,a=n.skipNull,s=v(n.maxBarThickness,1/0);let r,o;if(e.grouped){const i=a?this._getStackCount(t):e.stackCount,l="flex"===n.barThickness?function(t,e,i,n){const a=e.pixels,s=a[t];let r=t>0?a[t-1]:null,o=t=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,{xScale:i,yScale:n}=e,a=this.getParsed(t),s=i.getLabelForValue(a.x),r=n.getLabelForValue(a.y),o=a._custom;return{label:e.label,value:"("+s+", "+r+(o?", "+o:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,n){const a="reset"===n,{iScale:s,vScale:r}=this._cachedMeta,o=this.resolveDataElementOptions(e,n),l=this.getSharedOptions(o),c=this.includeOptions(n,l),h=s.axis,d=r.axis;for(let o=e;o""}}}};class Ii extends Si{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,n=this._cachedMeta;if(!1===this._parsing)n._parsed=i;else{let a,s,r=t=>+i[t];if(b(i[t])){const{key:t="value"}=this._parsing;r=e=>+T(i[e],t)}for(a=t,s=t+e;aat(t,o,l,!0)?1:Math.max(e,e*i,n,n*i),p=(t,e,n)=>at(t,o,l,!0)?-1:Math.min(e,e*i,n,n*i),g=f(0,c,d),m=f(W,h,u),b=p(F,c,d),y=p(F+W,h,u);n=(g-b)/2,a=(m-y)/2,s=-(g+b)/2,r=-(m+y)/2}return{ratioX:n,ratioY:a,offsetX:s,offsetY:r}}(u,d,o),b=(i.width-s)/f,y=(i.height-s)/p,x=Math.max(Math.min(b,y)/2,0),v=_(this.options.radius,x),w=(v-Math.max(v*o,0))/this._getVisibleDatasetWeightTotal();this.offsetX=g*v,this.offsetY=m*v,n.total=this.calculateTotal(),this.outerRadius=v-w*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-w*h,0),this.updateElements(a,0,a.length,t)}_circumference(t,e){const i=this.options,n=this._cachedMeta,a=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===n._parsed[t]||n.data[t].hidden?0:this.calculateCircumference(n._parsed[t]*a/I)}updateElements(t,e,i,n){const a="reset"===n,s=this.chart,r=s.chartArea,o=s.options.animation,l=(r.left+r.right)/2,c=(r.top+r.bottom)/2,h=a&&o.animateScale,d=h?0:this.innerRadius,u=h?0:this.outerRadius,f=this.resolveDataElementOptions(e,n),p=this.getSharedOptions(f),g=this.includeOptions(n,p);let m,b=this._getRotation();for(m=0;m0&&!isNaN(t)?I*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],a=ni(e._parsed[t],i.options.locale);return{label:n[t]||"",value:a}}getMaxBorderWidth(t){let e=0;const i=this.chart;let n,a,s,r,o;if(!t)for(n=0,a=i.data.datasets.length;n"spacing"!==t,_indexable:t=>"spacing"!==t},Ii.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map((e,n)=>{const a=t.getDatasetMeta(0).controller.getStyle(n);return{text:e,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,lineWidth:a.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label(t){let e=t.label;const i=": "+t.formattedValue;return m(e)?(e=e.slice(),e[0]+=i):e+=i,e}}}}};class zi extends Si{initialize(){this.enableOptionSharing=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:n=[],_dataset:a}=e,s=this.chart._animationsDisabled;let{start:r,count:o}=function(t,e,i){const n=e.length;let a=0,s=n;if(t._sorted){const{iScale:r,_parsed:o}=t,l=r.axis,{min:c,max:h,minDefined:d,maxDefined:u}=r.getUserBounds();d&&(a=st(Math.min(ye(o,r.axis,c).lo,i?n:ye(e,l,r.getPixelForValue(c)).lo),0,n-1)),s=u?st(Math.max(ye(o,r.axis,h).hi+1,i?0:ye(e,l,r.getPixelForValue(h)).hi+1),a,n)-a:n-a}return{start:a,count:s}}(e,n,s);this._drawStart=r,this._drawCount=o,function(t){const{xScale:e,yScale:i,_scaleRanges:n}=t,a={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!n)return t._scaleRanges=a,!0;const s=n.xmin!==e.min||n.xmax!==e.max||n.ymin!==i.min||n.ymax!==i.max;return Object.assign(n,a),s}(e)&&(r=0,o=n.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!a._decimated,i.points=n;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!s,options:l},t),this.updateElements(n,r,o,t)}updateElements(t,e,i,n){const a="reset"===n,{iScale:s,vScale:r,_stacked:o,_dataset:l}=this._cachedMeta,c=this.resolveDataElementOptions(e,n),h=this.getSharedOptions(c),d=this.includeOptions(n,h),u=s.axis,f=r.axis,{spanGaps:p,segment:m}=this.options,b=q(p)?p:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||a||"none"===n;let x=e>0&&this.getParsed(e-1);for(let c=e;c0&&i[u]-x[u]>b,m&&(p.parsed=i,p.raw=l.data[c]),d&&(p.options=h||this.resolveDataElementOptions(c,e.active?"active":n)),y||this.updateElement(e,c,p,n),x=i}this.updateSharedOptions(h,n,c)}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return i;const a=n[0].size(this.resolveDataElementOptions(0)),s=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,a,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}zi.id="line",zi.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},zi.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class Vi extends Si{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],a=ni(e._parsed[t].r,i.options.locale);return{label:n[t]||"",value:a}}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),a=Math.max(n/2,0),s=(a-Math.max(i.cutoutPercentage?a/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=a-s*this.index,this.innerRadius=this.outerRadius-s}updateElements(t,e,i,n){const a="reset"===n,s=this.chart,r=this.getDataset(),o=s.options.animation,l=this._cachedMeta.rScale,c=l.xCenter,h=l.yCenter,d=l.getIndexAngle(0)-.5*F;let u,f=d;const p=360/this.countVisibleElements();for(u=0;u{!isNaN(t.data[n])&&this.chart.getDataVisibility(n)&&i++}),i}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?Z(this.resolveDataElementOptions(t,e).angle||i):0}}Vi.id="polarArea",Vi.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},Vi.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map((e,n)=>{const a=t.getDatasetMeta(0).controller.getStyle(n);return{text:e,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,lineWidth:a.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label:t=>t.chart.data.labels[t.dataIndex]+": "+t.formattedValue}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class Bi extends Ii{}Bi.id="pie",Bi.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Wi extends Si{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}update(t){const e=this._cachedMeta,i=e.dataset,n=e.data||[],a=e.iScale.getLabels();if(i.points=n,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const s={_loop:!0,_fullLoop:a.length===n.length,options:e};this.updateElement(i,void 0,s,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,i,n){const a=this.getDataset(),s=this._cachedMeta.rScale,r="reset"===n;for(let o=e;o"",label:t=>"("+t.label+", "+t.formattedValue+")"}}},scales:{x:{type:"linear"},y:{type:"linear"}}};class Yi{constructor(t){this.options=t||{}}formats(){return Ui()}parse(t,e){return Ui()}format(t,e){return Ui()}add(t,e,i){return Ui()}diff(t,e,i){return Ui()}startOf(t,e,i){return Ui()}endOf(t,e){return Ui()}}Yi.override=function(t){Object.assign(Yi.prototype,t)};var $i={_date:Yi};function Xi(t,e){return"native"in t?{x:t.x,y:t.y}:qe(t,e)}function qi(t,e,i,n){const{controller:a,data:s,_sorted:r}=t,o=a._cachedMeta.iScale;if(o&&e===o.axis&&"r"!==e&&r&&s.length){const t=o._reversePixels?xe:ye;if(!n)return t(s,e,i);if(a._sharedOptions){const n=s[0],a="function"==typeof n.getRange&&n.getRange(e);if(a){const n=t(s,e,i-a),r=t(s,e,i+a);return{lo:n.lo,hi:r.hi}}}}return{lo:0,hi:s.length-1}}function Gi(t,e,i,n,a){const s=t.getSortedVisibleDatasetMetas(),r=i[e];for(let t=0,i=s.length;t{t[o](a[r],n)&&s.push({element:t,datasetIndex:e,index:i}),t.inRange(a.x,a.y,n)&&(l=!0)}),i.intersect&&!l?[]:s}var Ji={modes:{index(t,e,i,n){const a=Xi(e,t),s=i.axis||"x",r=i.intersect?Qi(t,a,s,n):Zi(t,a,s,!1,n),o=[];return r.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{const e=r[0].index,i=t.data[e];i&&!i.skip&&o.push({element:i,datasetIndex:t.index,index:e})}),o):[]},dataset(t,e,i,n){const a=Xi(e,t),s=i.axis||"xy";let r=i.intersect?Qi(t,a,s,n):Zi(t,a,s,!1,n);if(r.length>0){const e=r[0].datasetIndex,i=t.getDatasetMeta(e).data;r=[];for(let t=0;tQi(t,Xi(e,t),i.axis||"xy",n),nearest:(t,e,i,n)=>Zi(t,Xi(e,t),i.axis||"xy",i.intersect,n),x:(t,e,i,n)=>Ki(t,e,{axis:"x",intersect:i.intersect},n),y:(t,e,i,n)=>Ki(t,e,{axis:"y",intersect:i.intersect},n)}};const tn=["left","top","right","bottom"];function en(t,e){return t.filter(t=>t.pos===e)}function nn(t,e){return t.filter(t=>-1===tn.indexOf(t.pos)&&t.box.axis===e)}function an(t,e){return t.sort((t,i)=>{const n=e?i:t,a=e?t:i;return n.weight===a.weight?n.index-a.index:n.weight-a.weight})}function sn(t,e,i,n){return Math.max(t[i],e[i])+Math.max(t[n],e[n])}function rn(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function on(t,e,i,n){const{pos:a,box:s}=i,r=t.maxPadding;if(!b(a)){i.size&&(t[a]-=i.size);const e=n[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?s.height:s.width),i.size=e.size/e.count,t[a]+=i.size}s.getPadding&&rn(r,s.getPadding());const o=Math.max(0,e.outerWidth-sn(r,t,"left","right")),l=Math.max(0,e.outerHeight-sn(r,t,"top","bottom")),c=o!==t.w,h=l!==t.h;return t.w=o,t.h=l,i.horizontal?{same:c,other:h}:{same:h,other:c}}function ln(t,e){const i=e.maxPadding;return function(t){const n={left:0,top:0,right:0,bottom:0};return t.forEach(t=>{n[t]=Math.max(e[t],i[t])}),n}(t?["left","right"]:["top","bottom"])}function cn(t,e,i,n){const a=[];let s,r,o,l,c,h;for(s=0,r=t.length,c=0;st.box.fullSize),!0),n=an(en(e,"left"),!0),a=an(en(e,"right")),s=an(en(e,"top"),!0),r=an(en(e,"bottom")),o=nn(e,"x"),l=nn(e,"y");return{fullSize:i,leftAndTop:n.concat(s),rightAndBottom:a.concat(l).concat(r).concat(o),chartArea:en(e,"chartArea"),vertical:n.concat(a).concat(l),horizontal:s.concat(r).concat(o)}}(t.boxes),l=o.vertical,c=o.horizontal;O(t.boxes,t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()});const h=l.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1,d=Object.freeze({outerWidth:e,outerHeight:i,padding:a,availableWidth:s,availableHeight:r,vBoxMaxWidth:s/2/h,hBoxMaxHeight:r/2}),u=Object.assign({},a);rn(u,fe(n));const f=Object.assign({maxPadding:u,w:s,h:r,x:a.left,y:a.top},a),p=function(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:n,stackWeight:a}=i;if(!t||!tn.includes(n))continue;const s=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=a}return e}(t),{vBoxMaxWidth:n,hBoxMaxHeight:a}=e;let s,r,o;for(s=0,r=t.length;s{const i=e.box;Object.assign(i,t.chartArea),i.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class fn{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}isAttached(t){return!0}updateConfig(t){}}class pn extends fn{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const gn={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},mn=t=>null===t||""===t,bn=!!Ze&&{passive:!0};function yn(t,e,i){t.canvas.removeEventListener(e,i,bn)}function xn(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function vn(t,e,i){const n=t.canvas,a=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||xn(i.addedNodes,n),e=e&&!xn(i.removedNodes,n);e&&i()});return a.observe(document,{childList:!0,subtree:!0}),a}function wn(t,e,i){const n=t.canvas,a=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||xn(i.removedNodes,n),e=e&&!xn(i.addedNodes,n);e&&i()});return a.observe(document,{childList:!0,subtree:!0}),a}const On=new Map;let Mn=0;function kn(){const t=window.devicePixelRatio;t!==Mn&&(Mn=t,On.forEach((e,i)=>{i.currentDevicePixelRatio!==t&&e()}))}function jn(t,e,i){const n=t.canvas,a=n&&He(n);if(!a)return;const s=d((t,e)=>{const n=a.clientWidth;i(t,e),n{const e=t[0],i=e.contentRect.width,n=e.contentRect.height;0===i&&0===n||s(i,n)});return r.observe(a),function(t,e){On.size||window.addEventListener("resize",kn),On.set(t,e)}(t,s),r}function Sn(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){On.delete(t),On.size||window.removeEventListener("resize",kn)}(t)}function Dn(t,e,i){const n=t.canvas,a=d(e=>{null!==t.ctx&&i(function(t,e){const i=gn[t.type]||t.type,{x:n,y:a}=qe(t,e);return{type:i,chart:e,native:t,x:void 0!==n?n:null,y:void 0!==a?a:null}}(e,t))},t,t=>{const e=t[0];return[e,e.offsetX,e.offsetY]});return function(t,e,i){t.addEventListener(e,i,bn)}(n,e,a),a}class Pn extends fn{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,n=t.getAttribute("height"),a=t.getAttribute("width");if(t.$chartjs={initial:{height:n,width:a,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",mn(a)){const e=Ke(t,"width");void 0!==e&&(t.width=e)}if(mn(n))if(""===t.style.height)t.height=t.width/(e||2);else{const e=Ke(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e.$chartjs)return!1;const i=e.$chartjs.initial;["height","width"].forEach(t=>{const n=i[t];g(n)?e.removeAttribute(t):e.setAttribute(t,n)});const n=i.style||{};return Object.keys(n).forEach(t=>{e.style[t]=n[t]}),e.width=e.width,delete e.$chartjs,!0}addEventListener(t,e,i){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),a={attach:vn,detach:wn,resize:jn}[e]||Dn;n[e]=a(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),n=i[e];n&&(({attach:Sn,detach:Sn,resize:Sn}[e]||yn)(t,e,n),i[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return function(t,e,i,n){const a=Ye(t),s=Xe(a,"margin"),r=Ue(a.maxWidth,t,"clientWidth")||V,o=Ue(a.maxHeight,t,"clientHeight")||V,l=function(t,e,i){let n,a;if(void 0===e||void 0===i){const s=He(t);if(s){const t=s.getBoundingClientRect(),r=Ye(s),o=Xe(r,"border","width"),l=Xe(r,"padding");e=t.width-l.width-o.width,i=t.height-l.height-o.height,n=Ue(r.maxWidth,s,"clientWidth"),a=Ue(r.maxHeight,s,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:n||V,maxHeight:a||V}}(t,e,i);let{width:c,height:h}=l;if("content-box"===a.boxSizing){const t=Xe(a,"border","width"),e=Xe(a,"padding");c-=e.width+t.width,h-=e.height+t.height}return c=Math.max(0,c-s.width),h=Math.max(0,n?Math.floor(c/n):h-s.height),c=Ge(Math.min(c,r,l.maxWidth)),h=Ge(Math.min(h,o,l.maxHeight)),c&&!h&&(h=Ge(c/2)),{width:c,height:h}}(t,e,i,n)}isAttached(t){const e=He(t);return!(!e||!e.isConnected)}}class En{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return q(this.x)&&q(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const n={};return t.forEach(t=>{n[t]=i[t]&&i[t].active()?i[t]._to:this[t]}),n}}En.defaults={},En.defaultRoutes=void 0;const Cn={values:t=>m(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";const n=this.chart.options.locale;let a,s=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(a="scientific"),s=function(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t)),i}(t,i)}const r=Y(Math.abs(s)),o=Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:a,minimumFractionDigits:o,maximumFractionDigits:o};return Object.assign(l,this.options.ticks.format),ni(t,n,l)},logarithmic(t,e,i){if(0===t)return"0";const n=t/Math.pow(10,Math.floor(Y(t)));return 1===n||2===n||5===n?Cn.numeric.call(this,t,e,i):""}};var Tn={formatters:Cn};function An(t,e,i,n,a){const s=v(n,0),r=Math.min(v(a,t.length),t.length);let o,l,c,h=0;for(i=Math.ceil(i),a&&(o=a-n,i=o/Math.floor(o/i)),c=s;c<0;)h++,c=Math.round(s+h*i);for(l=Math.max(s,0);le.lineWidth,tickColor:(t,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Tn.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),Xt.route("scale.ticks","color","","color"),Xt.route("scale.grid","color","","borderColor"),Xt.route("scale.grid","borderColor","","borderColor"),Xt.route("scale.title","color","","color"),Xt.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t}),Xt.describe("scales",{_fallback:"scale"}),Xt.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t});const Ln=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i;function Rn(t,e){const i=[],n=t.length/e,a=t.length;let s=0;for(;sr+1e-6)))return l}function Fn(t){return t.drawTicks?t.tickLength:0}function In(t,e){if(!t.display)return 0;const i=pe(t.font,e),n=fe(t.padding);return(m(t.text)?t.text.length:1)*i.lineHeight+n.height}function zn(t,e,i){let n=(t=>"start"===t?"left":"end"===t?"right":"center")(t);return(i&&"right"!==e||!i&&"right"===e)&&(n=(t=>"left"===t?"right":"right"===t?"left":t)(n)),n}class Vn extends En{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:n}=this;return t=x(t,Number.POSITIVE_INFINITY),e=x(e,Number.NEGATIVE_INFINITY),i=x(i,Number.POSITIVE_INFINITY),n=x(n,Number.NEGATIVE_INFINITY),{min:x(t,i),max:x(e,n),minDefined:y(t),maxDefined:y(e)}}getMinMax(t){let e,{min:i,max:n,minDefined:a,maxDefined:s}=this.getUserBounds();if(a&&s)return{min:i,max:n};const r=this.getMatchingVisibleMetas();for(let o=0,l=r.length;on?n:i,n=a&&i>n?i:n,{min:x(i,x(n,i)),max:x(n,x(i,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){w(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:n,grace:a,ticks:s}=this.options,r=s.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(t,e,i){const{min:n,max:a}=t,s=_(e,(a-n)/2),r=(t,e)=>i&&0===t?0:t+e;return{min:r(n,-Math.abs(s)),max:r(a,s)}}(this,a,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const o=rn)return function(t,e,i,n){let a,s=0,r=i[0];for(n=Math.ceil(n),a=0;at-e).pop(),e}(n);for(let t=0,e=s.length-1;ta)return e}return Math.max(a,1)}(a,e,n);if(s>0){let t,i;const n=s>1?Math.round((o-r)/(s-1)):null;for(An(e,l,c,g(n)?0:r-n,r),t=0,i=s-1;t=a||i<=1||!this.isHorizontal())return void(this.labelRotation=n);const c=this._getLabelSizes(),h=c.widest.width,d=c.highest.height,u=st(this.chart.width-h,0,this.maxWidth);s=t.offset?this.maxWidth/i:u/(i-1),h+6>s&&(s=u/(i-(t.offset?.5:1)),r=this.maxHeight-Fn(t.grid)-e.padding-In(t.title,this.chart.options.font),o=Math.sqrt(h*h+d*d),l=K(Math.min(Math.asin(st((c.highest.height+6)/s,-1,1)),Math.asin(st(r/o,-1,1))-Math.asin(st(d/o,-1,1)))),l=Math.max(n,Math.min(a,l))),this.labelRotation=l}afterCalculateLabelRotation(){w(this.options.afterCalculateLabelRotation,[this])}beforeFit(){w(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:n,grid:a}}=this,s=this._isVisible(),r=this.isHorizontal();if(s){const s=In(n,e.options.font);if(r?(t.width=this.maxWidth,t.height=Fn(a)+s):(t.height=this.maxHeight,t.width=Fn(a)+s),i.display&&this.ticks.length){const{first:e,last:n,widest:a,highest:s}=this._getLabelSizes(),o=2*i.padding,l=Z(this.labelRotation),c=Math.cos(l),h=Math.sin(l);if(r){const e=i.mirror?0:h*a.width+c*s.height;t.height=Math.min(this.maxHeight,t.height+e+o)}else{const e=i.mirror?0:c*a.width+h*s.height;t.width=Math.min(this.maxWidth,t.width+e+o)}this._calculatePadding(e,n,h,c)}}this._handleMargins(),r?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,n){const{ticks:{align:a,padding:s},position:r}=this.options,o=0!==this.labelRotation,l="top"!==r&&"x"===this.axis;if(this.isHorizontal()){const r=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,d=0;o?l?(h=n*t.width,d=i*e.height):(h=i*t.height,d=n*e.width):"start"===a?d=e.width:"end"===a?h=t.width:(h=t.width/2,d=e.width/2),this.paddingLeft=Math.max((h-r+s)*this.width/(this.width-r),0),this.paddingRight=Math.max((d-c+s)*this.width/(this.width-c),0)}else{let i=e.height/2,n=t.height/2;"start"===a?(i=0,n=t.height):"end"===a&&(i=e.height,n=0),this.paddingTop=i+s,this.paddingBottom=n+s}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){w(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e{const i=t.gc,n=i.length/2;let a;if(n>e){for(a=0;a({width:a[t]||0,height:s[t]||0});return{first:M(0),last:M(e-1),widest:M(_),highest:M(w),widths:a,heights:s}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return st(this._alignToPixels?Qt(this.chart,e,0):e,-32768,32767)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&tr*n?r/i:o/n:o*n0}_computeGridLineItems(t){const e=this.axis,i=this.chart,n=this.options,{grid:a,position:s}=n,r=a.offset,o=this.isHorizontal(),l=this.ticks.length+(r?1:0),c=Fn(a),h=[],d=a.setContext(this.getContext()),u=d.drawBorder?d.borderWidth:0,f=u/2,p=function(t){return Qt(i,t,u)};let g,m,y,x,_,w,O,M,k,j,S,D;if("top"===s)g=p(this.bottom),w=this.bottom-c,M=g-f,j=p(t.top)+f,D=t.bottom;else if("bottom"===s)g=p(this.top),j=t.top,D=p(t.bottom)-f,w=g+f,M=this.top+c;else if("left"===s)g=p(this.right),_=this.right-c,O=g-f,k=p(t.left)+f,S=t.right;else if("right"===s)g=p(this.left),k=t.left,S=p(t.right)-f,_=g+f,O=this.left+c;else if("x"===e){if("center"===s)g=p((t.top+t.bottom)/2+.5);else if(b(s)){const t=Object.keys(s)[0],e=s[t];g=p(this.chart.scales[t].getPixelForValue(e))}j=t.top,D=t.bottom,w=g+f,M=w+c}else if("y"===e){if("center"===s)g=p((t.left+t.right)/2);else if(b(s)){const t=Object.keys(s)[0],e=s[t];g=p(this.chart.scales[t].getPixelForValue(e))}_=g-f,O=_-c,k=t.left,S=t.right}const P=v(n.ticks.maxTicksLimit,l),E=Math.max(1,Math.ceil(l/P));for(m=0;me.value===t);return i>=0?e.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let a,s;const r=(t,e,n)=>{n.width&&n.color&&(i.save(),i.lineWidth=n.width,i.strokeStyle=n.color,i.setLineDash(n.borderDash||[]),i.lineDashOffset=n.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(a=0,s=n.length;a{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:i+1,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",n=[];let a,s;for(a=0,s=e.length;a{const n=i.split("."),a=n.pop(),s=[t].concat(n).join("."),r=e[i].split("."),o=r.pop(),l=r.join(".");Xt.route(s,a,l,o)})}(e,t.defaultRoutes),t.descriptors&&Xt.describe(e,t.descriptors)}(t,s,i),this.override&&Xt.override(t.id,t.overrides)),s}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,n=this.scope;i in e&&delete e[i],n&&i in Xt[n]&&(delete Xt[n][i],this.override&&delete Ht[i])}}var Wn=new class{constructor(){this.controllers=new Bn(Si,"datasets",!0),this.elements=new Bn(En,"elements"),this.plugins=new Bn(Object,"plugins"),this.scales=new Bn(Vn,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(e=>{const n=i||this._getRegistryForType(e);i||n.isForType(e)||n===this.plugins&&e.id?this._exec(t,n,e):O(e,e=>{const n=i||this._getRegistryForType(e);this._exec(t,n,e)})})}_exec(t,e,i){const n=A(t);w(i["before"+n],[],i),e[t](i),w(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;et.filter(t=>!e.some(e=>t.plugin.id===e.plugin.id));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}}function Un(t,e){return e||!1!==t?!0===t?{}:t:null}function Yn(t,e,i,n){const a=t.pluginScopeKeys(e),s=t.getOptionScopes(i,a);return t.createResolver(s,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function $n(t,e){const i=Xt.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function Xn(t,e){return"x"===t||"y"===t?t:e.axis||("top"===(i=e.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0)||t.charAt(0).toLowerCase();var i}function qn(t){const e=t.options||(t.options={});e.plugins=v(e.plugins,{}),e.scales=function(t,e){const i=Ht[t.type]||{scales:{}},n=e.scales||{},a=$n(t.type,e),s=Object.create(null),r=Object.create(null);return Object.keys(n).forEach(t=>{const e=n[t];if(!b(e))return console.error("Invalid scale configuration for scale: "+t);if(e._proxy)return console.warn("Ignoring resolver passed as options for scale: "+t);const o=Xn(t,e),l=function(t,e){return t===e?"_index_":"_value_"}(o,a),c=i.scales||{};s[o]=s[o]||t,r[t]=P(Object.create(null),[{axis:o},e,c[o],c[l]])}),t.data.datasets.forEach(i=>{const a=i.type||t.type,o=i.indexAxis||$n(a,e),l=(Ht[a]||{}).scales||{};Object.keys(l).forEach(t=>{const e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,o),a=i[e+"AxisID"]||s[e]||e;r[a]=r[a]||Object.create(null),P(r[a],[{axis:e},n[a],l[t]])})}),Object.keys(r).forEach(t=>{const e=r[t];P(e,[Xt.scales[e.type],Xt.scale])}),r}(t,e)}function Gn(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const Qn=new Map,Zn=new Set;function Kn(t,e){let i=Qn.get(t);return i||(i=e(),Qn.set(t,i),Zn.add(i)),i}const Jn=(t,e,i)=>{const n=T(e,i);void 0!==n&&t.add(n)};class ta{constructor(t){this._config=function(t){return(t=t||{}).data=Gn(t.data),qn(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Gn(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),qn(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Kn(t,()=>[["datasets."+t,""]])}datasetAnimationScopeKeys(t,e){return Kn(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,"transitions."+e],["datasets."+t,""]])}datasetElementScopeKeys(t,e){return Kn(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,"datasets."+t,"elements."+e,""]])}pluginScopeKeys(t){const e=t.id;return Kn(`${this.type}-plugin-${e}`,()=>[["plugins."+e,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let n=i.get(t);return n&&!e||(n=new Map,i.set(t,n)),n}getOptionScopes(t,e,i){const{options:n,type:a}=this,s=this._cachedScopes(t,i),r=s.get(e);if(r)return r;const o=new Set;e.forEach(e=>{t&&(o.add(t),e.forEach(e=>Jn(o,t,e))),e.forEach(t=>Jn(o,n,t)),e.forEach(t=>Jn(o,Ht[a]||{},t)),e.forEach(t=>Jn(o,Xt,t)),e.forEach(t=>Jn(o,Ut,t))});const l=Array.from(o);return 0===l.length&&l.push(Object.create(null)),Zn.has(e)&&s.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,Ht[e]||{},Xt.datasets[e]||{},{type:e},Xt,Ut]}resolveNamedOptions(t,e,i,n=[""]){const a={$shared:!0},{resolver:s,subPrefixes:r}=ea(this._resolverCache,t,n);let o=s;(function(t,e){const{isScriptable:i,isIndexable:n}=ke(t);for(const a of e){const e=i(a),s=n(a),r=(s||e)&&t[a];if(e&&(R(r)||ia(r))||s&&m(r))return!0}return!1})(s,e)&&(a.$shared=!1,o=Me(s,i=R(i)?i():i,this.createResolver(t,i,r)));for(const t of e)a[t]=o[t];return a}createResolver(t,e,i=[""],n){const{resolver:a}=ea(this._resolverCache,t,i);return b(e)?Me(a,e,void 0,n):a}}function ea(t,e,i){let n=t.get(e);n||(n=new Map,t.set(e,n));const a=i.join();let s=n.get(a);return s||(s={resolver:Oe(e,i),subPrefixes:i.filter(t=>!t.toLowerCase().includes("hover"))},n.set(a,s)),s}const ia=t=>b(t)&&Object.getOwnPropertyNames(t).reduce((e,i)=>e||R(t[i]),!1),na=["top","bottom","left","right","chartArea"];function aa(t,e){return"top"===t||"bottom"===t||-1===na.indexOf(t)&&"x"===e}function sa(t,e){return function(i,n){return i[t]===n[t]?i[e]-n[e]:i[t]-n[t]}}function ra(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),w(i&&i.onComplete,[t],e)}function oa(t){const e=t.chart,i=e.options.animation;w(i&&i.onProgress,[t],e)}function la(t){return We()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const ca={},ha=t=>{const e=la(t);return Object.values(ca).filter(t=>t.canvas===e).pop()};function da(t,e,i){const n=Object.keys(t);for(const a of n){const n=+a;if(n>=e){const s=t[a];delete t[a],(i>0||n>e)&&(t[n+i]=s)}}}class ua{constructor(t,e){const i=this.config=new ta(e),n=la(t),a=ha(n);if(a)throw new Error("Canvas is already in use. Chart with ID '"+a.id+"' must be destroyed before the canvas can be reused.");const s=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||function(t){return!We()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?pn:Pn}(n)),this.platform.updateConfig(i);const r=this.platform.acquireContext(n,s.aspectRatio),o=r&&r.canvas,l=o&&o.height,c=o&&o.width;this.id=p(),this.ctx=r,this.canvas=o,this.width=c,this.height=l,this._options=s,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Hn,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let i;return function(...n){return e?(clearTimeout(i),i=setTimeout(t,e,n)):t.apply(this,n),e}}(t=>this.update(t),s.resizeDelay||0),this._dataChanges=[],ca[this.id]=this,r&&o?(di.listen(this,"complete",ra),di.listen(this,"progress",oa),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:a}=this;return g(t)?e&&a?a:n?i/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Qe(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Zt(this.canvas,this.ctx),this}stop(){return di.stop(this),this}resize(t,e){di.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,n=this.canvas,a=i.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(n,t,e,a),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),o=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,Qe(this,r,!0)&&(this.notifyPlugins("resize",{size:s}),w(i.onResize,[this,s],this),this.attached&&this._doResize(o)&&this.render())}ensureScalesHaveIDs(){O(this.options.scales||{},(t,e)=>{t.id=e})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,n=Object.keys(i).reduce((t,e)=>(t[e]=!1,t),{});let a=[];e&&(a=a.concat(Object.keys(e).map(t=>{const i=e[t],n=Xn(t,i),a="r"===n,s="x"===n;return{options:i,dposition:a?"chartArea":s?"bottom":"left",dtype:a?"radialLinear":s?"category":"linear"}}))),O(a,e=>{const a=e.options,s=a.id,r=Xn(s,a),o=v(a.type,e.dtype);void 0!==a.position&&aa(a.position,r)===aa(e.dposition)||(a.position=e.dposition),n[s]=!0;let l=null;s in i&&i[s].type===o?l=i[s]:(l=new(Wn.getScale(o))({id:s,type:o,ctx:this.ctx,chart:this}),i[l.id]=l),l.init(a,t)}),O(n,(t,e)=>{t||delete i[e]}),O(i,t=>{un.configure(this,t,t.options),un.addBox(this,t)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((t,e)=>t.index-e.index),i>e){for(let t=e;te.length&&delete this._stacks,t.forEach((t,i)=>{0===e.filter(e=>e===t._dataset).length&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,n;for(this._removeUnreferencedMetasets(),i=0,n=e.length;i{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const a=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let t=0,e=this.data.datasets.length;t{t.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(sa("z","_idx"));const{_active:r,_lastEvent:o}=this;o?this._eventHandler(o,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){O(this.scales,t=>{un.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);N(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:n,count:a}of e)da(t,n,"_removeElements"===i?-a:a)}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter(t=>t[0]===e).map((t,e)=>e+","+t.splice(1).join(","))),n=i(0);for(let t=1;tt.split(",")).map(t=>({method:t[1],start:+t[2],count:+t[3]}))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;un.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],O(this.boxes,t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))},this),this._layers.forEach((t,e)=>{t._idx=e}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,n=!i.disabled,a=this.chartArea,s={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",s)&&(n&&te(e,{left:!1===i.left?0:a.left-i.left,right:!1===i.right?this.width:a.right+i.right,top:!1===i.top?0:a.top-i.top,bottom:!1===i.bottom?this.height:a.bottom+i.bottom}),t.controller.draw(),n&&ee(e),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}getElementsAtEventForMode(t,e,i,n){const a=Ji.modes[e];return"function"==typeof a?a(this,t,i,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let n=i.filter(t=>t&&t._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(n)),n}getContext(){return this.$context||(this.$context=me(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const n=i?"show":"hide",a=this.getDatasetMeta(t),s=a.controller._resolveAnimations(void 0,n);L(e)?(a.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),s.update(a,{visible:i}),this.update(e=>e.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),di.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,i,n),t[i]=n},n=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};O(this.options.events,t=>i(t,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,n)=>{e.addEventListener(this,i,n),t[i]=n},n=(i,n)=>{t[i]&&(e.removeEventListener(this,i,n),delete t[i])},a=(t,e)=>{this.canvas&&this.resize(t,e)};let s;const r=()=>{n("attach",r),this.attached=!0,this.resize(),i("resize",a),i("detach",s)};s=()=>{this.attached=!1,n("resize",a),this._stop(),this._resize(0,0),i("attach",r)},e.isAttached(this.canvas)?r():s()}unbindEvents(){O(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},O(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const n=i?"set":"remove";let a,s,r,o;for("dataset"===e&&(a=this.getDatasetMeta(t[0].datasetIndex),a.controller["_"+n+"DatasetHoverStyle"]()),r=0,o=t.length;r{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}});!M(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}_updateHoverStyles(t,e,i){const n=this.options.hover,a=(t,e)=>t.filter(t=>!e.some(e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)),s=a(e,t),r=i?t:a(t,e);s.length&&this.updateHoverStyle(s,n.mode,!1),r.length&&n.mode&&this.updateHoverStyle(r,n.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:Jt(t,this.chartArea,this._minPadding)},n=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,n))return;const a=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(a||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:n=[],options:a}=this,s=e,r=this._getActiveElements(t,n,i,s),o=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}(t),l=function(t,e,i,n){return i&&"mouseout"!==t.type?n?e:t:null}(t,this._lastEvent,i,o);i&&(this._lastEvent=null,w(a.onHover,[t,r,this],this),o&&w(a.onClick,[t,r,this],this));const c=!M(r,n);return(c||e)&&(this._active=r,this._updateHoverStyles(r,n,e)),this._lastEvent=l,c}_getActiveElements(t,e,i,n){if("mouseout"===t.type)return[];if(!i)return e;const a=this.options.hover;return this.getElementsAtEventForMode(t,a.mode,a,n)}}const fa=()=>O(ua.instances,t=>t._plugins.invalidate());function pa(t,e,i){const{startAngle:n,pixelMargin:a,x:s,y:r,outerRadius:o,innerRadius:l}=e;let c=a/o;t.beginPath(),t.arc(s,r,o,n-c,i+c),l>a?(c=a/l,t.arc(s,r,l,i+c,n-c,!0)):t.arc(s,r,a,i+W,n-W),t.closePath(),t.clip()}function ga(t,e,i,n){return{x:i+t*Math.cos(e),y:n+t*Math.sin(e)}}function ma(t,e,i,n,a){const{x:s,y:r,startAngle:o,pixelMargin:l,innerRadius:c}=e,h=Math.max(e.outerRadius+n+i-l,0),d=c>0?c+n+i+l:0;let u=0;const f=a-o;if(n){const t=((c>0?c-n:0)+(h>0?h-n:0))/2;u=(f-(0!==t?f*t/(t+n):f))/2}const p=(f-Math.max(.001,f*h-i/F)/h)/2,g=o+p+u,m=a-p-u,{outerStart:b,outerEnd:y,innerStart:x,innerEnd:v}=function(t,e,i,n){const a=he(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]),s=(i-e)/2,r=Math.min(s,n*e/2),o=t=>{const e=(i-Math.min(s,t))*n/2;return st(t,0,Math.min(s,e))};return{outerStart:o(a.outerStart),outerEnd:o(a.outerEnd),innerStart:st(a.innerStart,0,r),innerEnd:st(a.innerEnd,0,r)}}(e,d,h,m-g),_=h-b,w=h-y,O=g+b/_,M=m-y/w,k=d+x,j=d+v,S=g+x/k,D=m-v/j;if(t.beginPath(),t.arc(s,r,h,O,M),y>0){const e=ga(w,M,s,r);t.arc(e.x,e.y,y,M,m+W)}const P=ga(j,m,s,r);if(t.lineTo(P.x,P.y),v>0){const e=ga(j,D,s,r);t.arc(e.x,e.y,v,m+W,D+Math.PI)}if(t.arc(s,r,d,m-v/d,g+x/d,!0),x>0){const e=ga(k,S,s,r);t.arc(e.x,e.y,x,S+Math.PI,g-W)}const E=ga(_,g,s,r);if(t.lineTo(E.x,E.y),b>0){const e=ga(_,O,s,r);t.arc(e.x,e.y,b,g-W,O)}t.closePath()}Object.defineProperties(ua,{defaults:{enumerable:!0,value:Xt},instances:{enumerable:!0,value:ca},overrides:{enumerable:!0,value:Ht},registry:{enumerable:!0,value:Wn},version:{enumerable:!0,value:"3.7.1"},getChart:{enumerable:!0,value:ha},register:{enumerable:!0,value:(...t)=>{Wn.add(...t),fa()}},unregister:{enumerable:!0,value:(...t)=>{Wn.remove(...t),fa()}}});class ba extends En{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.getProps(["x","y"],i),{angle:a,distance:s}=tt(n,{x:t,y:e}),{startAngle:r,endAngle:o,innerRadius:l,outerRadius:c,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),d=this.options.spacing/2,u=v(h,o-r)>=I||at(a,r,o),f=rt(s,l+d,c+d);return u&&f}getCenterPoint(t){const{x:e,y:i,startAngle:n,endAngle:a,innerRadius:s,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:o,spacing:l}=this.options,c=(n+a)/2,h=(s+r+l+o)/2;return{x:e+Math.cos(c)*h,y:i+Math.sin(c)*h}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,n=(e.offset||0)/2,a=(e.spacing||0)/2;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>I?Math.floor(i/I):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();let s=0;if(n){s=n/2;const e=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(e)*s,Math.sin(e)*s),this.circumference>=F&&(s=n)}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;const r=function(t,e,i,n){const{fullCircles:a,startAngle:s,circumference:r}=e;let o=e.endAngle;if(a){ma(t,e,i,n,s+I);for(let e=0;eo&&s>o;return{count:n,start:l,loop:e.loop,ilen:c(r+(c?o-t:t))%s,x=()=>{f!==p&&(t.lineTo(m,p),t.lineTo(m,f),t.lineTo(m,g))};for(l&&(d=a[y(0)],t.moveTo(d.x,d.y)),h=0;h<=o;++h){if(d=a[y(h)],d.skip)continue;const e=d.x,i=d.y,n=0|e;n===u?(ip&&(p=i),m=(b*m+e)/++b):(x(),t.lineTo(e,i),u=n,b=0,f=p=i),g=i}x()}function Oa(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i?_a:wa}ba.id="arc",ba.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0},ba.defaultRoutes={backgroundColor:"backgroundColor"};const Ma="function"==typeof Path2D;class ka extends En{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const n=i.spanGaps?this._loop:this._fullLoop;Be(this._points,i,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(t,e){const i=t.points,n=t.options.spanGaps,a=i.length;if(!a)return[];const s=!!t._loop,{start:r,end:o}=function(t,e,i,n){let a=0,s=e-1;if(i&&!n)for(;aa&&t[s%e].skip;)s--;return s%=e,{start:a,end:s}}(i,a,s,n);return function(t,e,i,n){return n&&n.setContext&&i?function(t,e,i,n){const a=t._chart.getContext(),s=ci(t.options),{_datasetIndex:r,options:{spanGaps:o}}=t,l=i.length,c=[];let h=s,d=e[0].start,u=d;function f(t,e,n,a){const s=o?-1:1;if(t!==e){for(t+=l;i[t%l].skip;)t-=s;for(;i[e%l].skip;)e+=s;t%l!=e%l&&(c.push({start:t%l,end:e%l,loop:n,style:a}),h=a,d=e%l)}}for(const t of e){d=o?d:t.start;let e,s=i[d%l];for(u=d+1;u<=t.end;u++){const o=i[u%l];e=ci(n.setContext(me(a,{type:"segment",p0:s,p1:o,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:r}))),hi(e,h)&&f(d,u-1,t.loop,h),s=o,h=e}d"borderDash"!==t&&"fill"!==t};class Sa extends En{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.options,{x:a,y:s}=this.getProps(["x","y"],i);return Math.pow(t-a,2)+Math.pow(e-s,2)=i)&&a):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}Aa.id="bar",Aa.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0},Aa.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};class Ra{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:n,y:a,radius:s}=this;return e=e||{start:0,end:I},t.arc(n,a,s,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:n}=this,a=t.angle;return{x:e+Math.cos(a)*n,y:i+Math.sin(a)*n,angle:a}}}function Na(t,e,i){for(;e>t;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function Fa(t,e,i){const n=[];for(let a=0;a{e=Na(t,e,a);const r=a[t],o=a[e];null!==n?(s.push({x:r.x,y:n}),s.push({x:o.x,y:n})):null!==i&&(s.push({x:i,y:r.y}),s.push({x:i,y:o.y}))}),s}(t,e),i.length?new ka({points:i,options:{tension:0},_loop:n,_fullLoop:n}):null}function Ba(t,e,i){let n=t[e].fill;const a=[e];let s;if(!i)return n;for(;!1!==n&&-1===a.indexOf(n);){if(!y(n))return n;if(s=t[n],!s)return!1;if(s.visible)return n;a.push(n),n=s.fill}return!1}function Wa(t,e,i){const{segments:n,points:a}=e;let s=!0,r=!1;t.beginPath();for(const o of n){const{start:n,end:l}=o,c=a[n],h=a[Na(n,l,a)];s?(t.moveTo(c.x,c.y),s=!1):(t.lineTo(c.x,i),t.lineTo(c.x,c.y)),r=!!e.pathSegment(t,o,{move:r}),r?t.closePath():t.lineTo(h.x,i)}t.lineTo(e.first().x,i),t.closePath(),t.clip()}function Ha(t,e,i,n){if(n)return;let a=e[t],s=i[t];return"angle"===t&&(a=nt(a),s=nt(s)),{property:t,start:a,end:s}}function Ua(t,e,i,n){return t&&e?n(t[i],e[i]):t?t[i]:e?e[i]:0}function Ya(t,e,i){const{top:n,bottom:a}=e.chart.chartArea,{property:s,start:r,end:o}=i||{};"x"===s&&(t.beginPath(),t.rect(r,n,o-r,a-n),t.clip())}function $a(t,e,i,n){const a=e.interpolate(i,n);a&&t.lineTo(a.x,a.y)}function Xa(t,e){const{line:i,target:n,property:a,color:s,scale:r}=e,o=function(t,e,i){const n=t.segments,a=t.points,s=e.points,r=[];for(const t of n){let{start:n,end:o}=t;o=Na(n,o,a);const l=Ha(i,a[n],a[o],t.loop);if(!e.segments){r.push({source:t,target:l,start:a[n],end:a[o]});continue}const c=li(e,l);for(const e of c){const n=Ha(i,s[e.start],s[e.end],e.loop),o=oi(t,a,n);for(const t of o)r.push({source:t,target:e,start:{[i]:Ua(l,n,"start",Math.max)},end:{[i]:Ua(l,n,"end",Math.min)}})}}return r}(i,n,a);for(const{source:e,target:l,start:c,end:h}of o){const{style:{backgroundColor:o=s}={}}=e,d=!0!==n;t.save(),t.fillStyle=o,Ya(t,r,d&&Ha(a,c,h)),t.beginPath();const u=!!i.pathSegment(t,e);let f;if(d){u?t.closePath():$a(t,n,h,a);const e=!!n.pathSegment(t,l,{move:u,reverse:!0});f=u&&e,f||$a(t,n,c,a)}t.closePath(),t.fill(f?"evenodd":"nonzero"),t.restore()}}function qa(t,e,i){const n=za(e),{line:a,scale:s,axis:r}=e,o=a.options,l=o.fill,c=o.backgroundColor,{above:h=c,below:d=c}=l||{};n&&a.points.length&&(te(t,i),function(t,e){const{line:i,target:n,above:a,below:s,area:r,scale:o}=e,l=i._loop?"angle":e.axis;t.save(),"x"===l&&s!==a&&(Wa(t,n,r.top),Xa(t,{line:i,target:n,color:a,scale:o,property:l}),t.restore(),t.save(),Wa(t,n,r.bottom)),Xa(t,{line:i,target:n,color:s,scale:o,property:l}),t.restore()}(t,{line:a,target:n,above:h,below:d,area:i,scale:s,axis:r}),ee(t))}var Ga={id:"filler",afterDatasetsUpdate(t,e,i){const n=(t.data.datasets||[]).length,a=[];let s,r,o,l;for(r=0;r=0;--e){const i=a[e].$filler;i&&(i.line.updateControlPoints(s,i.axis),n&&qa(t.ctx,i,s))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const n=t.getSortedVisibleDatasetMetas();for(let e=n.length-1;e>=0;--e){const i=n[e].$filler;i&&qa(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){const n=e.meta.$filler;n&&!1!==n.fill&&"beforeDatasetDraw"===i.drawTime&&qa(t.ctx,n,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};new WeakMap;const Qa={average(t){if(!t.length)return!1;let e,i,n=0,a=0,s=0;for(e=0,i=t.length;e-1?t.split("\n"):t}function Ja(t,e){const{element:i,datasetIndex:n,index:a}=e,s=t.getDatasetMeta(n).controller,{label:r,value:o}=s.getLabelAndValue(a);return{chart:t,label:r,parsed:s.getParsed(a),raw:t.data.datasets[n].data[a],formattedValue:o,dataset:s.getDataset(),dataIndex:a,datasetIndex:n,element:i}}function ts(t,e){const i=t.chart.ctx,{body:n,footer:a,title:s}=t,{boxWidth:r,boxHeight:o}=e,l=pe(e.bodyFont),c=pe(e.titleFont),h=pe(e.footerFont),d=s.length,u=a.length,f=n.length,p=fe(e.padding);let g=p.height,m=0,b=n.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);b+=t.beforeBody.length+t.afterBody.length,d&&(g+=d*c.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),b&&(g+=f*(e.displayColors?Math.max(o,l.lineHeight):l.lineHeight)+(b-f)*l.lineHeight+(b-1)*e.bodySpacing),u&&(g+=e.footerMarginTop+u*h.lineHeight+(u-1)*e.footerSpacing);let y=0;const x=function(t){m=Math.max(m,i.measureText(t).width+y)};return i.save(),i.font=c.string,O(t.title,x),i.font=l.string,O(t.beforeBody.concat(t.afterBody),x),y=e.displayColors?r+2+e.boxPadding:0,O(n,t=>{O(t.before,x),O(t.lines,x),O(t.after,x)}),y=0,i.font=h.string,O(t.footer,x),i.restore(),m+=p.width,{width:m,height:g}}function es(t,e,i,n){const{x:a,width:s}=i,{width:r,chartArea:{left:o,right:l}}=t;let c="center";return"center"===n?c=a<=(o+l)/2?"left":"right":a<=s/2?c="left":a>=r-s/2&&(c="right"),function(t,e,i,n){const{x:a,width:s}=n,r=i.caretSize+i.caretPadding;return"left"===t&&a+s+r>e.width||"right"===t&&a-s-r<0||void 0}(c,t,e,i)&&(c="center"),c}function is(t,e,i){const n=i.yAlign||e.yAlign||function(t,e){const{y:i,height:n}=e;return it.height-n/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||es(t,e,i,n),yAlign:n}}function ns(t,e,i,n){const{caretSize:a,caretPadding:s,cornerRadius:r}=t,{xAlign:o,yAlign:l}=i,c=a+s,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=ue(r);let p=function(t,e){let{x:i,width:n}=t;return"right"===e?i-=n:"center"===e&&(i-=n/2),i}(e,o);const g=function(t,e,i){let{y:n,height:a}=t;return"top"===e?n+=i:n-="bottom"===e?a+i:a/2,n}(e,l,c);return"center"===l?"left"===o?p+=c:"right"===o&&(p-=c):"left"===o?p-=Math.max(h,u)+a:"right"===o&&(p+=Math.max(d,f)+a),{x:st(p,0,n.width-e.width),y:st(g,0,n.height-e.height)}}function as(t,e,i){const n=fe(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-n.right:t.x+n.left}function ss(t){return Za([],Ka(t))}function rs(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}class os extends En{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart||t._chart,this._chart=this.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),n=i.enabled&&e.options.animation&&i.animations,a=new gi(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(a)),a}getContext(){return this.$context||(this.$context=(this,me(this.chart.getContext(),{tooltip:this,tooltipItems:this._tooltipItems,type:"tooltip"})))}getTitle(t,e){const{callbacks:i}=e,n=i.beforeTitle.apply(this,[t]),a=i.title.apply(this,[t]),s=i.afterTitle.apply(this,[t]);let r=[];return r=Za(r,Ka(n)),r=Za(r,Ka(a)),r=Za(r,Ka(s)),r}getBeforeBody(t,e){return ss(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){const{callbacks:i}=e,n=[];return O(t,t=>{const e={before:[],lines:[],after:[]},a=rs(i,t);Za(e.before,Ka(a.beforeLabel.call(this,t))),Za(e.lines,a.label.call(this,t)),Za(e.after,Ka(a.afterLabel.call(this,t))),n.push(e)}),n}getAfterBody(t,e){return ss(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){const{callbacks:i}=e,n=i.beforeFooter.apply(this,[t]),a=i.footer.apply(this,[t]),s=i.afterFooter.apply(this,[t]);let r=[];return r=Za(r,Ka(n)),r=Za(r,Ka(a)),r=Za(r,Ka(s)),r}_createItems(t){const e=this._active,i=this.chart.data,n=[],a=[],s=[];let r,o,l=[];for(r=0,o=e.length;rt.filter(e,n,a,i))),t.itemSort&&(l=l.sort((e,n)=>t.itemSort(e,n,i))),O(l,e=>{const i=rs(t.callbacks,e);n.push(i.labelColor.call(this,e)),a.push(i.labelPointStyle.call(this,e)),s.push(i.labelTextColor.call(this,e))}),this.labelColors=n,this.labelPointStyles=a,this.labelTextColors=s,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),n=this._active;let a,s=[];if(n.length){const t=Qa[i.position].call(this,n,this._eventPosition);s=this._createItems(i),this.title=this.getTitle(s,i),this.beforeBody=this.getBeforeBody(s,i),this.body=this.getBody(s,i),this.afterBody=this.getAfterBody(s,i),this.footer=this.getFooter(s,i);const e=this._size=ts(this,i),r=Object.assign({},t,e),o=is(this.chart,i,r),l=ns(i,r,o,this.chart);this.xAlign=o.xAlign,this.yAlign=o.yAlign,a={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(a={opacity:0});this._tooltipItems=s,this.$context=void 0,a&&this._resolveAnimations().update(this,a),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,n){const a=this.getCaretPosition(t,i,n);e.lineTo(a.x1,a.y1),e.lineTo(a.x2,a.y2),e.lineTo(a.x3,a.y3)}getCaretPosition(t,e,i){const{xAlign:n,yAlign:a}=this,{caretSize:s,cornerRadius:r}=i,{topLeft:o,topRight:l,bottomLeft:c,bottomRight:h}=ue(r),{x:d,y:u}=t,{width:f,height:p}=e;let g,m,b,y,x,v;return"center"===a?(x=u+p/2,"left"===n?(g=d,m=g-s,y=x+s,v=x-s):(g=d+f,m=g+s,y=x-s,v=x+s),b=g):(m="left"===n?d+Math.max(o,c)+s:"right"===n?d+f-Math.max(l,h)-s:this.caretX,"top"===a?(y=u,x=y-s,g=m-s,b=m+s):(y=u+p,x=y+s,g=m+s,b=m-s),v=y),{x1:g,x2:m,x3:b,y1:y,y2:x,y3:v}}drawTitle(t,e,i){const n=this.title,a=n.length;let s,r,o;if(a){const l=ai(i.rtl,this.x,this.width);for(t.x=as(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",s=pe(i.titleFont),r=i.titleSpacing,e.fillStyle=i.titleColor,e.font=s.string,o=0;o0!==t)?(t.beginPath(),t.fillStyle=a.multiKeyBackground,re(t,{x:e,y:p,w:l,h:o,radius:r}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),re(t,{x:i,y:p+1,w:l-2,h:o-2,radius:r}),t.fill()):(t.fillStyle=a.multiKeyBackground,t.fillRect(e,p,l,o),t.strokeRect(e,p,l,o),t.fillStyle=s.backgroundColor,t.fillRect(i,p+1,l-2,o-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:n}=this,{bodySpacing:a,bodyAlign:s,displayColors:r,boxHeight:o,boxWidth:l,boxPadding:c}=i,h=pe(i.bodyFont);let d=h.lineHeight,u=0;const f=ai(i.rtl,this.x,this.width),p=function(i){e.fillText(i,f.x(t.x+u),t.y+d/2),t.y+=d+a},g=f.textAlign(s);let m,b,y,x,v,_,w;for(e.textAlign=s,e.textBaseline="middle",e.font=h.string,t.x=as(this,g,i),e.fillStyle=i.bodyColor,O(this.beforeBody,p),u=r&&"right"!==g?"center"===s?l/2+c:l+2+c:0,x=0,_=n.length;x<_;++x){for(m=n[x],b=this.labelTextColors[x],e.fillStyle=b,O(m.before,p),y=m.lines,r&&y.length&&(this._drawColorBox(e,t,x,f,i),d=Math.max(h.lineHeight,o)),v=0,w=y.length;v0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,n=i&&i.x,a=i&&i.y;if(n||a){const i=Qa[t.position].call(this,this._active,this._eventPosition);if(!i)return;const s=this._size=ts(this,t),r=Object.assign({},i,this._size),o=is(e,t,r),l=ns(t,r,o,e);n._to===l.x&&a._to===l.y||(this.xAlign=o.xAlign,this.yAlign=o.yAlign,this.width=s.width,this.height=s.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},a={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const s=fe(e.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&r&&(t.save(),t.globalAlpha=i,this.drawBackground(a,t,n,e),function(t,e){let i,n;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,n=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=n)}(t,e.textDirection),a.y+=s.top,this.drawTitle(a,t,e),this.drawBody(a,t,e),this.drawFooter(a,t,e),function(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,n=t.map(({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),a=!M(i,n),s=this._positionChanged(n,e);(a||s)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,a=this._active||[],s=this._getActiveElements(t,a,e,i),r=this._positionChanged(s,t),o=e||!M(s,a)||r;return o&&(this._active=s,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),o}_getActiveElements(t,e,i,n){const a=this.options;if("mouseout"===t.type)return[];if(!n)return e;const s=this.chart.getElementsAtEventForMode(t,a.mode,a,i);return a.reverse&&s.reverse(),s}_positionChanged(t,e){const{caretX:i,caretY:n,options:a}=this,s=Qa[a.position].call(this,t,e);return!1!==s&&(i!==s.x||n!==s.y)}}os.positioners=Qa;var ls={id:"tooltip",_element:os,positioners:Qa,afterInit(t,e,i){i&&(t.tooltip=new os({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip,i={tooltip:e};!1!==t.notifyPlugins("beforeTooltipDraw",i)&&(e&&e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i))},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:f,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,n=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(n>0&&e.dataIndex"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};class cs extends Vn{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:i,label:n}of e)t[i]===n&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(g(t))return null;const i=this.getLabels();return((t,e)=>null===t?null:st(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:function(t,e,i,n){const a=t.indexOf(e);return-1===a?((t,e,i,n)=>("string"==typeof e?(i=t.push(e)-1,n.unshift({index:i,label:e})):isNaN(e)&&(i=null),i))(t,e,i,n):a!==t.lastIndexOf(e)?i:a}(i,t,v(e,t),this._addedLabels),i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:n}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(n=this.getLabels().length-1)),this.min=i,this.max=n}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,n=[];let a=this.getLabels();a=0===t&&e===a.length-1?a:a.slice(t,e+1),this._valueRange=Math.max(a.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let i=t;i<=e;i++)n.push({value:i});return n}getLabelForValue(t){const e=this.getLabels();return t>=0&&te.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function hs(t,e,{horizontal:i,minRotation:n}){const a=Z(n),s=(i?Math.sin(a):Math.cos(a))||.001,r=.75*e*(""+t).length;return Math.min(e/s,r)}cs.id="category",cs.defaults={ticks:{callback:cs.prototype.getLabelForValue}};class ds extends Vn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return g(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:n,max:a}=this;const s=t=>n=e?n:t,r=t=>a=i?a:t;if(t){const t=$(n),e=$(a);t<0&&e<0?r(0):t>0&&e>0&&s(0)}if(n===a){let e=1;(a>=Number.MAX_SAFE_INTEGER||n<=Number.MIN_SAFE_INTEGER)&&(e=Math.abs(.05*a)),r(a+e),t||s(n-e)}this.min=n,this.max=a}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:n}=t;return n?(e=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const n=function(t,e){const i=[],{bounds:n,step:a,min:s,max:r,precision:o,count:l,maxTicks:c,maxDigits:h,includeBounds:d}=t,u=a||1,f=c-1,{min:p,max:m}=e,b=!g(s),y=!g(r),x=!g(l),v=(m-p)/(h+1);let _,w,O,M,k=X((m-p)/f/u)*u;if(k<1e-14&&!b&&!y)return[{value:p},{value:m}];M=Math.ceil(m/k)-Math.floor(p/k),M>f&&(k=X(M*k/f/u)*u),g(o)||(_=Math.pow(10,o),k=Math.ceil(k*_)/_),"ticks"===n?(w=Math.floor(p/k)*k,O=Math.ceil(m/k)*k):(w=p,O=m),b&&y&&a&&function(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}((r-s)/a,k/1e3)?(M=Math.round(Math.min((r-s)/k,c)),k=(r-s)/M,w=s,O=r):x?(w=b?s:w,O=y?r:O,M=l-1,k=(O-w)/M):(M=(O-w)/k,M=G(M,Math.round(M),k/1e3)?Math.round(M):Math.ceil(M));const j=Math.max(J(k),J(w));_=Math.pow(10,g(o)?j:o),w=Math.round(w*_)/_,O=Math.round(O*_)/_;let S=0;for(b&&(d&&w!==s?(i.push({value:s}),w0?i:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=y(t)?Math.max(0,t):null,this.max=y(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,n=this.max;const a=e=>i=t?i:e,s=t=>n=e?n:t,r=(t,e)=>Math.pow(10,Math.floor(Y(t))+e);i===n&&(i<=0?(a(1),s(10)):(a(r(i,-1)),s(r(n,1)))),i<=0&&a(r(n,-1)),n<=0&&s(r(i,1)),this._zero&&this.min!==this._suggestedMin&&i===r(this.min,0)&&a(r(i,-1)),this.min=i,this.max=n}buildTicks(){const t=this.options,e=function(t,e){const i=Math.floor(Y(e.max)),n=Math.ceil(e.max/Math.pow(10,i)),a=[];let s=x(t.min,Math.pow(10,Math.floor(Y(e.min)))),r=Math.floor(Y(s)),o=Math.floor(s/Math.pow(10,r)),l=r<0?Math.pow(10,Math.abs(r)):1;do{a.push({value:s,major:fs(s)}),++o,10===o&&(o=1,++r,l=r>=0?1:l),s=Math.round(o*Math.pow(10,r)*l)/l}while(ra?{start:e-i,end:e}:{start:e,end:e+i}}function bs(t,e,i,n,a){const s=Math.abs(Math.sin(i)),r=Math.abs(Math.cos(i));let o=0,l=0;n.starte.r&&(o=(n.end-e.r)/s,t.r=Math.max(t.r,e.r+o)),a.starte.b&&(l=(a.end-e.b)/r,t.b=Math.max(t.b,e.b+l))}function ys(t){return 0===t||180===t?"center":t<180?"left":"right"}function xs(t,e,i){return 90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e),t}function vs(t,e,i,n){const{ctx:a}=t;if(i)a.arc(t.xCenter,t.yCenter,e,0,I);else{let i=t.getPointPosition(0,e);a.moveTo(i.x,i.y);for(let s=1;s{const i=w(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""}).filter((t,e)=>this.chart.getDataVisibility(e))}fit(){const t=this.options;t.display&&t.pointLabels.display?function(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),n=[],a=[],s=t._pointLabels.length,r=t.options.pointLabels,o=r.centerPointLabels?F/s:0;for(let d=0;d=0&&t=0;a--){const e=n.setContext(t.getPointLabelContext(a)),s=pe(e.font),{x:r,y:o,textAlign:l,left:c,top:h,right:d,bottom:u}=t._pointLabelItems[a],{backdropColor:f}=e;if(!g(f)){const t=fe(e.backdropPadding);i.fillStyle=f,i.fillRect(c-t.left,h-t.top,d-c+t.width,u-h+t.height)}ae(i,t._pointLabels[a],r,o+s.lineHeight/2,s,{color:e.color,textAlign:l,textBaseline:"middle"})}}(this,a),n.display&&this.ticks.forEach((t,e)=>{0!==e&&(r=this.getDistanceFromCenterForValue(t.value),function(t,e,i,n){const a=t.ctx,s=e.circular,{color:r,lineWidth:o}=e;!s&&!n||!r||!o||i<0||(a.save(),a.strokeStyle=r,a.lineWidth=o,a.setLineDash(e.borderDash),a.lineDashOffset=e.borderDashOffset,a.beginPath(),vs(t,i,s,n),a.closePath(),a.stroke(),a.restore())}(this,n.setContext(this.getContext(e-1)),r,a))}),i.display){for(t.save(),s=a-1;s>=0;s--){const n=i.setContext(this.getPointLabelContext(s)),{color:a,lineWidth:l}=n;l&&a&&(t.lineWidth=l,t.strokeStyle=a,t.setLineDash(n.borderDash),t.lineDashOffset=n.borderDashOffset,r=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),o=this.getPointPosition(s,r),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(o.x,o.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const n=this.getIndexAngle(0);let a,s;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(n),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((n,r)=>{if(0===r&&!e.reverse)return;const o=i.setContext(this.getContext(r)),l=pe(o.font);if(a=this.getDistanceFromCenterForValue(this.ticks[r].value),o.showLabelBackdrop){t.font=l.string,s=t.measureText(n.label).width,t.fillStyle=o.backdropColor;const e=fe(o.backdropPadding);t.fillRect(-s/2-e.left,-a-l.size/2-e.top,s+e.width,l.size+e.height)}ae(t,n.label,0,-a,l,{color:o.color})}),t.restore()}drawTitle(){}}_s.id="radialLinear",_s.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Tn.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}},_s.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},_s.descriptors={angleLines:{_fallback:"grid"}};const ws={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Os=Object.keys(ws);function Ms(t,e){return t-e}function ks(t,e){if(g(e))return null;const i=t._adapter,{parser:n,round:a,isoWeekday:s}=t._parseOpts;let r=e;return"function"==typeof n&&(r=n(r)),y(r)||(r="string"==typeof n?i.parse(r,n):i.parse(r)),null===r?null:(a&&(r="week"!==a||!q(s)&&!0!==s?i.startOf(r,a):i.startOf(r,"isoWeek",s)),+r)}function js(t,e,i,n){const a=Os.length;for(let s=Os.indexOf(t);s=e?i[n]:i[a]]=!0}}else t[e]=!0}function Ds(t,e,i){const n=[],a={},s=e.length;let r,o;for(r=0;r=0&&(e[l].major=!0);return e}(t,n,a,i):n}class Ps extends Vn{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e){const i=t.time||(t.time={}),n=this._adapter=new $i._date(t.adapters.date);P(i.displayFormats,n.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:ks(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:n,max:a,minDefined:s,maxDefined:r}=this.getUserBounds();function o(t){s||isNaN(t.min)||(n=Math.min(n,t.min)),r||isNaN(t.max)||(a=Math.max(a,t.max))}s&&r||(o(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||o(this.getMinMax(!1))),n=y(n)&&!isNaN(n)?n:+e.startOf(Date.now(),i),a=y(a)&&!isNaN(a)?a:+e.endOf(Date.now(),i)+1,this.min=Math.min(n,a-1),this.max=Math.max(n+1,a)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,n="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const a=this.min,s=function(t,e,i){let n=0,a=t.length;for(;nn&&t[a-1]>i;)a--;return n>0||a=Os.indexOf(i);s--){const i=Os[s];if(ws[i].common&&t._adapter.diff(a,n,i)>=e-1)return i}return Os[i?Os.indexOf(i):0]}(this,s.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(let e=Os.indexOf(t)+1,i=Os.length;e1e5*r)throw new Error(e+" and "+i+" are too far apart with stepSize of "+r+" "+s);const f="data"===n.ticks.source&&this.getDataTimestamps();for(h=u,d=0;ht-e).map(t=>+t)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}_tickFormatFunction(t,e,i,n){const a=this.options,s=a.time.displayFormats,r=this._unit,o=this._majorUnit,l=r&&s[r],c=o&&s[o],h=i[e],d=o&&c&&h&&h.major,u=this._adapter.format(t,n||(d?c:l)),f=a.ticks.callback;return f?w(f,[u,e,i],this):u}generateTickLabels(t){let e,i,n;for(e=0,i=t.length;e0?r:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(t=0,e=n.length;t=t[o].pos&&e<=t[l].pos&&({lo:o,hi:l}=ye(t,"pos",e)),({pos:n,time:s}=t[o]),({pos:a,time:r}=t[l])):(e>=t[o].time&&e<=t[l].time&&({lo:o,hi:l}=ye(t,"time",e)),({time:n,pos:s}=t[o]),({time:a,pos:r}=t[l]));const c=a-n;return c?s+(r-s)*(e-n)/c:s}Ps.id="time",Ps.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};class Cs extends Ps{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Es(e,this.min),this._tableRange=Es(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,n=[],a=[];let s,r,o,l,c;for(s=0,r=t.length;s=e&&l<=i&&n.push(l);if(n.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(s=0,r=n.length;s2&&void 0!==arguments[2]?arguments[2]:"label";const n=[];t.datasets=e.map(e=>{const a=t.datasets.find(t=>t[i]===e[i]);return a&&e.data&&!n.includes(a)?(n.push(a),Object.assign(a,e),a):{...e}})}function Fs(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"label";const i={labels:[],datasets:[]};return Rs(i,t.labels),Ns(i,t.datasets,e),i}function Is(t,e){let{height:i=150,width:n=300,redraw:a=!1,datasetIdKey:s,type:r,data:o,options:l,plugins:c=[],fallbackContent:h,...d}=t;const u=Object(Ts.useRef)(null),f=Object(Ts.useRef)(),p=()=>{u.current&&(f.current=new ua(u.current,{type:r,data:Fs(o,s),options:l,plugins:c}),Ls(e,f.current))},g=()=>{Ls(e,null),f.current&&(f.current.destroy(),f.current=null)};return Object(Ts.useEffect)(()=>{var t,e;!a&&f.current&&l&&(t=f.current,e=l,t.options={...e})},[a,l]),Object(Ts.useEffect)(()=>{!a&&f.current&&Rs(f.current.config.data,o.labels)},[a,o.labels]),Object(Ts.useEffect)(()=>{!a&&f.current&&o.datasets&&Ns(f.current.config.data,o.datasets,s)},[a,o.datasets]),Object(Ts.useEffect)(()=>{f.current&&(a?(g(),setTimeout(p)):f.current.update())},[a,l,o.labels,o.datasets]),Object(Ts.useEffect)(()=>(p(),()=>g()),[]),As.a.createElement("canvas",Object.assign({ref:u,role:"img",height:i,width:n},d),h)}const zs=Object(Ts.forwardRef)(Is);var Vs=i(3),Bs=i(16),Ws=i(7),Hs=i(8),Us=i(4);function Ys(t,e){Object(Us.a)(2,arguments);var i=Object(Hs.a)(t),n=Object(Ws.a)(e);return isNaN(n)?new Date(NaN):n?(i.setDate(i.getDate()+n),i):i}function $s(t,e){Object(Us.a)(2,arguments);var i=Object(Ws.a)(e);return Ys(t,-i)}function Xs(t,e){Object(Us.a)(2,arguments);var i=Object(Hs.a)(t),n=Object(Ws.a)(e);if(isNaN(n))return new Date(NaN);if(!n)return i;var a=i.getDate(),s=new Date(i.getTime());s.setMonth(i.getMonth()+n+1,0);var r=s.getDate();return a>=r?s:(i.setFullYear(s.getFullYear(),s.getMonth(),a),i)}function qs(t,e){Object(Us.a)(2,arguments);var i=Object(Ws.a)(e);return Xs(t,-i)}function Gs(t){return(Gs="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 Qs(t,e){if(Object(Us.a)(2,arguments),!e||"object"!==Gs(e))return new Date(NaN);var i=e.years?Object(Ws.a)(e.years):0,n=e.months?Object(Ws.a)(e.months):0,a=e.weeks?Object(Ws.a)(e.weeks):0,s=e.days?Object(Ws.a)(e.days):0,r=e.hours?Object(Ws.a)(e.hours):0,o=e.minutes?Object(Ws.a)(e.minutes):0,l=e.seconds?Object(Ws.a)(e.seconds):0,c=qs(t,n+12*i),h=$s(c,s+7*a),d=o+60*r,u=l+60*d,f=1e3*u,p=new Date(h.getTime()-f);return p}function Zs(t){return(Zs="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 Ks(t,e){if(Object(Us.a)(2,arguments),!e||"object"!==Zs(e))return new Date(NaN);var i=e.years?Object(Ws.a)(e.years):0,n=e.months?Object(Ws.a)(e.months):0,a=e.weeks?Object(Ws.a)(e.weeks):0,s=e.days?Object(Ws.a)(e.days):0,r=e.hours?Object(Ws.a)(e.hours):0,o=e.minutes?Object(Ws.a)(e.minutes):0,l=e.seconds?Object(Ws.a)(e.seconds):0,c=Object(Hs.a)(t),h=n||i?Xs(c,n+12*i):c,d=s||a?Ys(h,s+7*a):h,u=o+60*r,f=l+60*u,p=1e3*f,g=new Date(d.getTime()+p);return g}function Js(t,e){var i;Object(Us.a)(1,arguments);var n=Object(Ws.a)(null!==(i=null==e?void 0:e.additionalDigits)&&void 0!==i?i:2);if(2!==n&&1!==n&&0!==n)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof t&&"[object String]"!==Object.prototype.toString.call(t))return new Date(NaN);var a,s=ar(t);if(s.date){var r=sr(s.date,n);a=rr(r.restDateString,r.year)}if(!a||isNaN(a.getTime()))return new Date(NaN);var o,l=a.getTime(),c=0;if(s.time&&(c=lr(s.time),isNaN(c)))return new Date(NaN);if(!s.timezone){var h=new Date(l+c),d=new Date(0);return d.setFullYear(h.getUTCFullYear(),h.getUTCMonth(),h.getUTCDate()),d.setHours(h.getUTCHours(),h.getUTCMinutes(),h.getUTCSeconds(),h.getUTCMilliseconds()),d}return o=hr(s.timezone),isNaN(o)?new Date(NaN):new Date(l+c+o)}Math.pow(10,8);var tr={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},er=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,ir=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,nr=/^([+-])(\d{2})(?::?(\d{2}))?$/;function ar(t){var e,i={},n=t.split(tr.dateTimeDelimiter);if(n.length>2)return i;if(/:/.test(n[0])?e=n[0]:(i.date=n[0],e=n[1],tr.timeZoneDelimiter.test(i.date)&&(i.date=t.split(tr.timeZoneDelimiter)[0],e=t.substr(i.date.length,t.length))),e){var a=tr.timezone.exec(e);a?(i.time=e.replace(a[1],""),i.timezone=a[1]):i.time=e}return i}function sr(t,e){var i=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),n=t.match(i);if(!n)return{year:NaN,restDateString:""};var a=n[1]?parseInt(n[1]):null,s=n[2]?parseInt(n[2]):null;return{year:null===s?a:100*s,restDateString:t.slice((n[1]||n[2]).length)}}function rr(t,e){if(null===e)return new Date(NaN);var i=t.match(er);if(!i)return new Date(NaN);var n=!!i[4],a=or(i[1]),s=or(i[2])-1,r=or(i[3]),o=or(i[4]),l=or(i[5])-1;if(n)return function(t,e,i){return e>=1&&e<=53&&i>=0&&i<=6}(0,o,l)?function(t,e,i){var n=new Date(0);n.setUTCFullYear(t,0,4);var a=7*(e-1)+i+1-(n.getUTCDay()||7);return n.setUTCDate(n.getUTCDate()+a),n}(e,o,l):new Date(NaN);var c=new Date(0);return function(t,e,i){return e>=0&&e<=11&&i>=1&&i<=(dr[e]||(ur(t)?29:28))}(e,s,r)&&function(t,e){return e>=1&&e<=(ur(t)?366:365)}(e,a)?(c.setUTCFullYear(e,s,Math.max(a,r)),c):new Date(NaN)}function or(t){return t?parseInt(t):1}function lr(t){var e=t.match(ir);if(!e)return NaN;var i=cr(e[1]),n=cr(e[2]),a=cr(e[3]);return function(t,e,i){return 24===t?0===e&&0===i:i>=0&&i<60&&e>=0&&e<60&&t>=0&&t<25}(i,n,a)?36e5*i+6e4*n+1e3*a:NaN}function cr(t){return t&&parseFloat(t.replace(",","."))||0}function hr(t){if("Z"===t)return 0;var e=t.match(nr);if(!e)return 0;var i="+"===e[1]?-1:1,n=parseInt(e[2]),a=e[3]&&parseInt(e[3])||0;return function(t,e){return e>=0&&e<=59}(0,a)?i*(36e5*n+6e4*a):NaN}var dr=[31,null,31,30,31,30,31,31,30,31,30,31];function ur(t){return t%400==0||t%4==0&&t%100!=0}var fr=i(76);function pr(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function gr(t){for(var e=1;e0,"is-negative":e<0});return Object(c.createElement)("div",{className:s},Object(c.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"simpay-admin-charts-badge__icon",width:"16",height:"16"},e>0?Object(c.createElement)("path",{d:"M16.004 9.414l-8.607 8.607-1.414-1.414L14.589 8H7.004V6h11v11h-2V9.414z"}):Object(c.createElement)("path",{d:"M14.59 16.004L5.982 7.397l1.414-1.414 8.607 8.606V7.004h2v11h-11v-2z"})),!n&&Object(c.createElement)("span",null,Math.abs(e),"%"))},Er="simpay-admin-charts-period-over-period__tooltip",Cr=function(t){var e=t.position,i=t.opacity,n=t.data,a=t.delta,s=t.deltaChangedString;if(!n.length)return null;var r=e.top,o=e.left,l=e.right,h=Dr()("simpay-admin-charts-badge",{"is-positive":a>0,"is-negative":a<0});return Object(c.createElement)("div",{className:Er,style:{top:r,left:o||"auto",right:l||"auto",opacity:i}},n.map((function(t,e){var i=t.label,n=t.value;return Object(c.createElement)("div",{className:"".concat(Er,"-data"),"data-dataset":e,key:i+Math.random()},Object(c.createElement)("strong",null,i)," ",Object(c.createElement)("em",null,Object(Bs.decodeEntities)(n)))})),0!==a&&Object(c.createElement)("div",{className:"".concat(Er,"-delta")},Object(c.createElement)("div",{className:h},Object(c.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"simpay-admin-charts-badge__icon"},a>0?Object(c.createElement)("path",{fillRule:"evenodd",d:"M5.22 14.78a.75.75 0 001.06 0l7.22-7.22v5.69a.75.75 0 001.5 0v-7.5a.75.75 0 00-.75-.75h-7.5a.75.75 0 000 1.5h5.69l-7.22 7.22a.75.75 0 000 1.06z",clipRule:"evenodd"}):Object(c.createElement)("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06l7.22 7.22H6.75a.75.75 0 000 1.5h7.5a.747.747 0 00.75-.75v-7.5a.75.75 0 00-1.5 0v5.69L6.28 5.22z"}))),Object(c.createElement)("span",null,s)))},Tr=function(t){var e=t.chart,i=function(t,e){var i=Object(c.useState)({marginTop:0,marginRight:0,marginBottom:0,marginLeft:0}),n=l()(i,2),a=n[0],s=a.marginTop,r=a.marginRight,o=a.marginBottom,h=a.marginLeft,d=n[1];return Object(c.useEffect)((function(){t.current&&d({marginTop:Math.floor(t.current.chartArea.top),marginRight:Math.floor(t.current.width-t.current.chartArea.right),marginBottom:Math.floor(t.current.chartArea.bottom),marginLeft:Math.floor(t.current.chartArea.left)})}),[t,e]),{marginTop:s,marginRight:r,marginBottom:o,marginLeft:h}}(t.chartRef,e),n=i.marginLeft,a=i.marginRight;return Object(c.createElement)("div",{style:{width:"100%",position:"relative",fontSize:"12px",display:"flex",justifyContent:"space-between",marginTop:"-2px"}},Object(c.createElement)("div",{style:{marginLeft:n,textAlign:"left"}},e.datasets[0].data[0].x),Object(c.createElement)("div",{style:{marginRight:a,textAlign:"right"}},e.datasets[0].data[e.datasets[0].data.length-1].x))};function Ar(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Lr(t){for(var e=1;e0}))}));return Object(c.createElement)("div",{className:"simpay-admin-charts-period-over-period",style:s},!M&&Object(c.createElement)("div",{className:"simpay-admin-charts-no-data",style:Lr(Lr({},s),{},{height:"calc(".concat(s.height," + 15px)")})},o),Object(c.createElement)(zs,{type:"line",ref:g,options:O,plugins:[vr,(_="rgb(".concat(f.primary_color.join(","),")"),{id:"YGridLineHover",afterDraw:function(t){var e;if(null!==(e=t.tooltip)&&void 0!==e&&null!==(e=e._active)&&void 0!==e&&e.length){var i=t.tooltip._active[0].element.x,n=t.scales.yAxis,a=t.ctx;a.save(),a.beginPath(),a.moveTo(i,n.top),a.lineTo(i,n.bottom),a.lineWidth=2,a.strokeStyle=_,a.stroke(),a.restore()}}})],data:{datasets:m}}),Object(c.createElement)(Tr,{chartRef:g,chart:f}),Object(c.createElement)(Cr,a()({},x,{deltaChangedString:h(x)})),Object(c.createElement)(Vs.Popover.Slot,null))}},function(t,e,i){var n;!function(){"use strict";var i={}.hasOwnProperty;function a(){for(var t=[],e=0;et.length)&&(e=t.length);for(var i=0,n=new Array(e);i=s.getTime()?i+1:e.getTime()>=l.getTime()?i:i-1}function f(t){Object(n.a)(1,arguments);var e=u(t),i=new Date(0);i.setUTCFullYear(e,0,4),i.setUTCHours(0,0,0,0);var a=d(i);return a}var p={};function g(){return p}function m(t,e){var i,a,s,o,c,h,d,u;Object(n.a)(1,arguments);var f=g(),p=Object(l.a)(null!==(i=null!==(a=null!==(s=null!==(o=null==e?void 0:e.weekStartsOn)&&void 0!==o?o:null==e||null===(c=e.locale)||void 0===c||null===(h=c.options)||void 0===h?void 0:h.weekStartsOn)&&void 0!==s?s:f.weekStartsOn)&&void 0!==a?a:null===(d=f.locale)||void 0===d||null===(u=d.options)||void 0===u?void 0:u.weekStartsOn)&&void 0!==i?i:0);if(!(p>=0&&p<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var m=Object(r.a)(t),b=m.getUTCDay(),y=(b=1&&y<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var x=new Date(0);x.setUTCFullYear(p+1,0,y),x.setUTCHours(0,0,0,0);var v=m(x,e),_=new Date(0);_.setUTCFullYear(p,0,y),_.setUTCHours(0,0,0,0);var w=m(_,e);return f.getTime()>=v.getTime()?p+1:f.getTime()>=w.getTime()?p:p-1}function y(t,e){var i,a,s,r,o,c,h,d;Object(n.a)(1,arguments);var u=g(),f=Object(l.a)(null!==(i=null!==(a=null!==(s=null!==(r=null==e?void 0:e.firstWeekContainsDate)&&void 0!==r?r:null==e||null===(o=e.locale)||void 0===o||null===(c=o.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==s?s:u.firstWeekContainsDate)&&void 0!==a?a:null===(h=u.locale)||void 0===h||null===(d=h.options)||void 0===d?void 0:d.firstWeekContainsDate)&&void 0!==i?i:1),p=b(t,e),y=new Date(0);y.setUTCFullYear(p,0,f),y.setUTCHours(0,0,0,0);var x=m(y,e);return x}function x(t,e){for(var i=t<0?"-":"",n=Math.abs(t).toString();n.length0?i:1-i;return x("yy"===e?n%100:n,e.length)},_=function(t,e){var i=t.getUTCMonth();return"M"===e?String(i+1):x(i+1,2)},w=function(t,e){return x(t.getUTCDate(),e.length)},O=function(t,e){return x(t.getUTCHours()%12||12,e.length)},M=function(t,e){return x(t.getUTCHours(),e.length)},k=function(t,e){return x(t.getUTCMinutes(),e.length)},j=function(t,e){return x(t.getUTCSeconds(),e.length)},S=function(t,e){var i=e.length,n=t.getUTCMilliseconds();return x(Math.floor(n*Math.pow(10,i-3)),e.length)};function D(t,e){var i=t>0?"-":"+",n=Math.abs(t),a=Math.floor(n/60),s=n%60;if(0===s)return i+String(a);var r=e||"";return i+String(a)+r+x(s,2)}function P(t,e){return t%60==0?(t>0?"-":"+")+x(Math.abs(t)/60,2):E(t,e)}function E(t,e){var i=e||"",n=t>0?"-":"+",a=Math.abs(t);return n+x(Math.floor(a/60),2)+i+x(a%60,2)}var C={G:function(t,e,i){var n=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return i.era(n,{width:"abbreviated"});case"GGGGG":return i.era(n,{width:"narrow"});case"GGGG":default:return i.era(n,{width:"wide"})}},y:function(t,e,i){if("yo"===e){var n=t.getUTCFullYear(),a=n>0?n:1-n;return i.ordinalNumber(a,{unit:"year"})}return v(t,e)},Y:function(t,e,i,n){var a=b(t,n),s=a>0?a:1-a;return"YY"===e?x(s%100,2):"Yo"===e?i.ordinalNumber(s,{unit:"year"}):x(s,e.length)},R:function(t,e){return x(u(t),e.length)},u:function(t,e){return x(t.getUTCFullYear(),e.length)},Q:function(t,e,i){var n=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return x(n,2);case"Qo":return i.ordinalNumber(n,{unit:"quarter"});case"QQQ":return i.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return i.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return i.quarter(n,{width:"wide",context:"formatting"})}},q:function(t,e,i){var n=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return x(n,2);case"qo":return i.ordinalNumber(n,{unit:"quarter"});case"qqq":return i.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return i.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return i.quarter(n,{width:"wide",context:"standalone"})}},M:function(t,e,i){var n=t.getUTCMonth();switch(e){case"M":case"MM":return _(t,e);case"Mo":return i.ordinalNumber(n+1,{unit:"month"});case"MMM":return i.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return i.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return i.month(n,{width:"wide",context:"formatting"})}},L:function(t,e,i){var n=t.getUTCMonth();switch(e){case"L":return String(n+1);case"LL":return x(n+1,2);case"Lo":return i.ordinalNumber(n+1,{unit:"month"});case"LLL":return i.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return i.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return i.month(n,{width:"wide",context:"standalone"})}},w:function(t,e,i,a){var s=function(t,e){Object(n.a)(1,arguments);var i=Object(r.a)(t),a=m(i,e).getTime()-y(i,e).getTime();return Math.round(a/6048e5)+1}(t,a);return"wo"===e?i.ordinalNumber(s,{unit:"week"}):x(s,e.length)},I:function(t,e,i){var a=function(t){Object(n.a)(1,arguments);var e=Object(r.a)(t),i=d(e).getTime()-f(e).getTime();return Math.round(i/6048e5)+1}(t);return"Io"===e?i.ordinalNumber(a,{unit:"week"}):x(a,e.length)},d:function(t,e,i){return"do"===e?i.ordinalNumber(t.getUTCDate(),{unit:"date"}):w(t,e)},D:function(t,e,i){var a=function(t){Object(n.a)(1,arguments);var e=Object(r.a)(t),i=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var a=e.getTime(),s=i-a;return Math.floor(s/864e5)+1}(t);return"Do"===e?i.ordinalNumber(a,{unit:"dayOfYear"}):x(a,e.length)},E:function(t,e,i){var n=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return i.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return i.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(n,{width:"short",context:"formatting"});case"EEEE":default:return i.day(n,{width:"wide",context:"formatting"})}},e:function(t,e,i,n){var a=t.getUTCDay(),s=(a-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return x(s,2);case"eo":return i.ordinalNumber(s,{unit:"day"});case"eee":return i.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return i.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(a,{width:"short",context:"formatting"});case"eeee":default:return i.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,i,n){var a=t.getUTCDay(),s=(a-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return x(s,e.length);case"co":return i.ordinalNumber(s,{unit:"day"});case"ccc":return i.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return i.day(a,{width:"narrow",context:"standalone"});case"cccccc":return i.day(a,{width:"short",context:"standalone"});case"cccc":default:return i.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,i){var n=t.getUTCDay(),a=0===n?7:n;switch(e){case"i":return String(a);case"ii":return x(a,e.length);case"io":return i.ordinalNumber(a,{unit:"day"});case"iii":return i.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return i.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return i.day(n,{width:"short",context:"formatting"});case"iiii":default:return i.day(n,{width:"wide",context:"formatting"})}},a:function(t,e,i){var n=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return i.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return i.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(t,e,i){var n,a=t.getUTCHours();switch(n=12===a?"noon":0===a?"midnight":a/12>=1?"pm":"am",e){case"b":case"bb":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return i.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return i.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(t,e,i){var n,a=t.getUTCHours();switch(n=a>=17?"evening":a>=12?"afternoon":a>=4?"morning":"night",e){case"B":case"BB":case"BBB":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return i.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return i.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(t,e,i){if("ho"===e){var n=t.getUTCHours()%12;return 0===n&&(n=12),i.ordinalNumber(n,{unit:"hour"})}return O(t,e)},H:function(t,e,i){return"Ho"===e?i.ordinalNumber(t.getUTCHours(),{unit:"hour"}):M(t,e)},K:function(t,e,i){var n=t.getUTCHours()%12;return"Ko"===e?i.ordinalNumber(n,{unit:"hour"}):x(n,e.length)},k:function(t,e,i){var n=t.getUTCHours();return 0===n&&(n=24),"ko"===e?i.ordinalNumber(n,{unit:"hour"}):x(n,e.length)},m:function(t,e,i){return"mo"===e?i.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):k(t,e)},s:function(t,e,i){return"so"===e?i.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):j(t,e)},S:function(t,e){return S(t,e)},X:function(t,e,i,n){var a=(n._originalDate||t).getTimezoneOffset();if(0===a)return"Z";switch(e){case"X":return P(a);case"XXXX":case"XX":return E(a);case"XXXXX":case"XXX":default:return E(a,":")}},x:function(t,e,i,n){var a=(n._originalDate||t).getTimezoneOffset();switch(e){case"x":return P(a);case"xxxx":case"xx":return E(a);case"xxxxx":case"xxx":default:return E(a,":")}},O:function(t,e,i,n){var a=(n._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+D(a,":");case"OOOO":default:return"GMT"+E(a,":")}},z:function(t,e,i,n){var a=(n._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+D(a,":");case"zzzz":default:return"GMT"+E(a,":")}},t:function(t,e,i,n){var a=n._originalDate||t;return x(Math.floor(a.getTime()/1e3),e.length)},T:function(t,e,i,n){return x((n._originalDate||t).getTime(),e.length)}},T=function(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},A=function(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},L={p:A,P:function(t,e){var i,n=t.match(/(P+)(p+)?/)||[],a=n[1],s=n[2];if(!s)return T(t,e);switch(a){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"})}return i.replace("{{date}}",T(a,e)).replace("{{time}}",A(s,e))}};function R(t){var e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}var N=["D","DD"],F=["YY","YYYY"];function I(t){return-1!==N.indexOf(t)}function z(t){return-1!==F.indexOf(t)}function V(t,e,i){if("YYYY"===t)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===t)throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===t)throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===t)throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var B={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function W(t){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.width?String(e.width):t.defaultWidth,n=t.formats[i]||t.formats[t.defaultWidth];return n}}var H={date:W({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:W({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:W({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},U={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function Y(t){return function(e,i){var n;if("formatting"===(null!=i&&i.context?String(i.context):"standalone")&&t.formattingValues){var a=t.defaultFormattingWidth||t.defaultWidth,s=null!=i&&i.width?String(i.width):a;n=t.formattingValues[s]||t.formattingValues[a]}else{var r=t.defaultWidth,o=null!=i&&i.width?String(i.width):t.defaultWidth;n=t.values[o]||t.values[r]}return n[t.argumentCallback?t.argumentCallback(e):e]}}function $(t){return function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.width,a=n&&t.matchPatterns[n]||t.matchPatterns[t.defaultMatchWidth],s=e.match(a);if(!s)return null;var r,o=s[0],l=n&&t.parsePatterns[n]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?q(l,(function(t){return t.test(o)})):X(l,(function(t){return t.test(o)}));r=t.valueCallback?t.valueCallback(c):c,r=i.valueCallback?i.valueCallback(r):r;var h=e.slice(o.length);return{value:r,rest:h}}}function X(t,e){for(var i in t)if(t.hasOwnProperty(i)&&e(t[i]))return i}function q(t,e){for(var i=0;i0?"in "+n:n+" ago":n},formatLong:H,formatRelative:function(t,e,i,n){return U[t]},localize:{ordinalNumber:function(t,e){var i=Number(t),n=i%100;if(n>20||n<10)switch(n%10){case 1:return i+"st";case 2:return i+"nd";case 3:return i+"rd"}return i+"th"},era:Y({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Y({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:Y({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:Y({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:Y({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(G={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(t){return parseInt(t,10)}},function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.match(G.matchPattern);if(!i)return null;var n=i[0],a=t.match(G.parsePattern);if(!a)return null;var s=G.valueCallback?G.valueCallback(a[0]):a[0];s=e.valueCallback?e.valueCallback(s):s;var r=t.slice(n.length);return{value:s,rest:r}}),era:$({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:$({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:$({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:$({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:$({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}},Z=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,K=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,J=/^'([^]*?)'?$/,tt=/''/g,et=/[a-zA-Z]/;function it(t,e,i){var a,s,c,d,u,f,p,m,b,y,x,v,_,w,O,M,k,j;Object(n.a)(2,arguments);var S=String(e),D=g(),P=null!==(a=null!==(s=null==i?void 0:i.locale)&&void 0!==s?s:D.locale)&&void 0!==a?a:Q,E=Object(l.a)(null!==(c=null!==(d=null!==(u=null!==(f=null==i?void 0:i.firstWeekContainsDate)&&void 0!==f?f:null==i||null===(p=i.locale)||void 0===p||null===(m=p.options)||void 0===m?void 0:m.firstWeekContainsDate)&&void 0!==u?u:D.firstWeekContainsDate)&&void 0!==d?d:null===(b=D.locale)||void 0===b||null===(y=b.options)||void 0===y?void 0:y.firstWeekContainsDate)&&void 0!==c?c:1);if(!(E>=1&&E<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var T=Object(l.a)(null!==(x=null!==(v=null!==(_=null!==(w=null==i?void 0:i.weekStartsOn)&&void 0!==w?w:null==i||null===(O=i.locale)||void 0===O||null===(M=O.options)||void 0===M?void 0:M.weekStartsOn)&&void 0!==_?_:D.weekStartsOn)&&void 0!==v?v:null===(k=D.locale)||void 0===k||null===(j=k.options)||void 0===j?void 0:j.weekStartsOn)&&void 0!==x?x:0);if(!(T>=0&&T<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!P.localize)throw new RangeError("locale must contain localize property");if(!P.formatLong)throw new RangeError("locale must contain formatLong property");var A=Object(r.a)(t);if(!o(A))throw new RangeError("Invalid time value");var N=R(A),F=h(A,N),B={firstWeekContainsDate:E,weekStartsOn:T,locale:P,_originalDate:A},W=S.match(K).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,L[e])(t,P.formatLong):t})).join("").match(Z).map((function(n){if("''"===n)return"'";var a=n[0];if("'"===a)return nt(n);var s=C[a];if(s)return null!=i&&i.useAdditionalWeekYearTokens||!z(n)||V(n,e,String(t)),null!=i&&i.useAdditionalDayOfYearTokens||!I(n)||V(n,e,String(t)),s(F,n,P.localize,B);if(a.match(et))throw new RangeError("Format string contains an unescaped latin alphabet character `"+a+"`");return n})).join("");return W}function nt(t){var e=t.match(J);return e?e[1].replace(tt,"'"):t}},function(t,e,i){"use strict";i.r(e);var n=i(0),a=(i(37),i(3)),s=i(6),r=i.n(s),o=i(2),l=i(9),c=Object(n.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(l.Path,{fillRule:"evenodd",d:"M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z",clipRule:"evenodd"})),h=i(10),d=i(13),u=simpayAdminPageActivityReports,f=u.user_id,p=u.currencies,g=u.default_currency,m=i(15),b=i.n(m),y=i(16),x=i(11),v=i.n(x),_=i(24),w=i.n(_);function O(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function M(t){for(var e=1;e0&&Object(n.createElement)(n.Fragment,null,Object(n.createElement)(a.CardDivider,null),Object(n.createElement)("h3",{className:"".concat("simpay-activity-reports-card-today","-today-misc-title")},Object(o.__)("Top Forms","stripe")),Object(n.createElement)("div",{className:"".concat("simpay-activity-reports-card-today","-forms")},s.map((function(t){return Object(n.createElement)(D,b()({key:t.id},t))})))),r&&Object(n.createElement)("div",{className:"".concat("simpay-activity-reports-card-today","-tip")},Object(n.createElement)("strong",null,Object(n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{d:"M11.7 2.805a.75.75 0 01.6 0A60.65 60.65 0 0122.83 8.72a.75.75 0 01-.231 1.337 49.949 49.949 0 00-9.902 3.912l-.003.002-.34.18a.75.75 0 01-.707 0A50.009 50.009 0 007.5 12.174v-.224c0-.131.067-.248.172-.311a54.614 54.614 0 014.653-2.52.75.75 0 00-.65-1.352 56.129 56.129 0 00-4.78 2.589 1.858 1.858 0 00-.859 1.228 49.803 49.803 0 00-4.634-1.527.75.75 0 01-.231-1.337A60.653 60.653 0 0111.7 2.805z"}),Object(n.createElement)("path",{d:"M13.06 15.473a48.45 48.45 0 017.666-3.282c.134 1.414.22 2.843.255 4.285a.75.75 0 01-.46.71 47.878 47.878 0 00-8.105 4.342.75.75 0 01-.832 0 47.877 47.877 0 00-8.104-4.342.75.75 0 01-.461-.71c.035-1.442.121-2.87.255-4.286A48.4 48.4 0 016 13.18v1.27a1.5 1.5 0 00-.14 2.508c-.09.38-.222.753-.397 1.11.452.213.901.434 1.346.661a6.729 6.729 0 00.551-1.608 1.5 1.5 0 00.14-2.67v-.645a48.549 48.549 0 013.44 1.668 2.25 2.25 0 002.12 0z"}),Object(n.createElement)("path",{d:"M4.462 19.462c.42-.419.753-.89 1-1.394.453.213.902.434 1.347.661a6.743 6.743 0 01-1.286 1.794.75.75 0 11-1.06-1.06z"})),r.title),Object(n.createElement)("p",null,r.text," ",Object(n.createElement)("a",{href:Object(y.decodeEntities)(r.href),target:"_blank",rel:"noreferrer"},Object(o.__)("Learn More →","stripe")))))))},C=function(t){var e=t.currency;return Object(n.createElement)("div",{className:"simpay-admin-charts-no-data",style:{width:"100%",height:"100%"}},Object(n.createElement)("div",null,Object(n.createElement)("strong",null,Object(o.sprintf)(/* translators: %s Currency code. */ -Object(o.__)("No %s transactions found.","stripe"),e.toUpperCase())),Object(n.createElement)("div",null,Object(o.__)("Please select a different currency or check back later.","stripe"))))},T=i(14),A=i.n(T),L=function(t){var e=t.currency,i=t.amount_total_formatted,s=t.status,r=t.status_formatted,l=t.email,c=t.payment_method_type_icon,h=t.date_created_human_time_diff,d=t.links,u=d.customer,f=d.payment,p="simpay-activity-reports-card-latest-payment",g=A()("simpay-activity-reports-badge",{"is-succeeded":"succeeded"===s,"is-failed":"failed"===s}),m=function(){return"refunded"===s&&t.amount_refunded!==t.amount_total};return Object(n.createElement)("tr",{className:p},Object(n.createElement)("td",{className:"".concat(p,"__amount")},Object(y.decodeEntities)(i)," ",Object(n.createElement)("small",{style:{fontWeight:"normal"}},e.toUpperCase())),Object(n.createElement)("td",{className:"".concat(p,"__type")},""!==c&&Object(n.createElement)("span",{dangerouslySetInnerHTML:{__html:c}})),Object(n.createElement)("td",{className:"".concat(p,"__status")},Object(n.createElement)(a.Tooltip,{text:function(){if(m()&&"refunded"===s)return Object(o.sprintf)(Object(o.__)("%s refund was initiated","stripe"),Object(y.decodeEntities)(t.amount_refunded_formatted))}()},Object(n.createElement)("div",{className:g},Object(n.createElement)("span",null,r),Object(n.createElement)("svg",{"aria-hidden":"true",className:"simpay-activity-reports-badge__icon",height:"12",width:"12",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",style:{marginLeft:"4px"}},"succeeded"===s?Object(n.createElement)("path",{d:"M5.297 13.213.293 8.255c-.39-.394-.39-1.033 0-1.426s1.024-.394 1.414 0l4.294 4.224 8.288-8.258c.39-.393 1.024-.393 1.414 0s.39 1.033 0 1.426L6.7 13.208a.994.994 0 0 1-1.402.005z",fillRule:"evenodd"}):"refunded"===s&&m()?Object(n.createElement)(n.Fragment,null,Object(n.createElement)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11 2.5H5A2.5 2.5 0 0 0 2.5 5v6A2.5 2.5 0 0 0 5 13.5h6a2.5 2.5 0 0 0 2.5-2.5V5A2.5 2.5 0 0 0 11 2.5ZM5 1a4 4 0 0 0-4 4v6a4 4 0 0 0 4 4h6a4 4 0 0 0 4-4V5a4 4 0 0 0-4-4H5Z"}),Object(n.createElement)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M6.25 8A.75.75 0 0 1 7 7.25h1.25A.75.75 0 0 1 9 8v3.5a.75.75 0 0 1-1.5 0V8.75H7A.75.75 0 0 1 6.25 8Z"}),Object(n.createElement)("path",{d:"M6.75 5a1.25 1.25 0 1 1 2.5 0 1.25 1.25 0 0 1-2.5 0Z"})):"refunded"!==s||m()?Object(n.createElement)("path",{d:"m8 6.585 4.593-4.592a1 1 0 0 1 1.415 1.416L9.417 8l4.591 4.591a1 1 0 0 1-1.415 1.416L8 9.415l-4.592 4.592a1 1 0 0 1-1.416-1.416L6.584 8l-4.59-4.591a1 1 0 1 1 1.415-1.416z",fillRule:"evenodd"}):Object(n.createElement)(n.Fragment,null,Object(n.createElement)("path",{d:"M5.994 2.38a.875.875 0 1 0-1.238-1.238l-4.25 4.25A.849.849 0 0 0 .25 6c0 .232.093.466.257.63l4.25 4.24a.875.875 0 1 0 1.236-1.24L3.238 6.875h7.387C12.492 6.875 14 8.271 14 10c0 1.797-1.578 3.375-3.375 3.375a.875.875 0 0 0 0 1.75c2.763 0 5.125-2.362 5.125-5.125 0-2.83-2.43-4.872-5.12-4.875H3.24l2.754-2.746Z",fillRule:"evenodd"})))))),Object(n.createElement)("td",{className:"".concat(p,"__email")},Object(n.createElement)(a.Tooltip,{text:Object(o.__)("View customer records","stripe")},Object(n.createElement)("a",{href:u,target:"_blank",rel:"noreferrer noopener"},l))),Object(n.createElement)("td",{className:"".concat(p,"__date")},Object(n.createElement)(a.Tooltip,{text:Object(o.__)("View payment record","stripe")},Object(n.createElement)("a",{href:f,target:"_blank",rel:"noreferrer noopener"},h))))},R=simpayAdminPageActivityReports,N=R.default_currency,F=R.links.all_payments,I=function(){var t=j("/wpsp/__internal__/report/latest-payments",{currency:N},[]),e=t.data.payments;return Object(n.createElement)(a.Card,{elevation:2,className:"simpay-activity-reports-card-latest"},Object(n.createElement)(a.CardHeader,null,Object(n.createElement)("h2",{className:"simpay-activity-reports-card-title"},Object(o.__)("Latest Payments","stripe")),Object(n.createElement)(a.Button,{className:"simpay-activity-reports-card-title-link",href:F,variant:"link",isSmall:!0,target:"_blank"},Object(o.__)("View More →","stripe"))),Object(n.createElement)(a.CardBody,null,t.isLoading&&Object(n.createElement)(a.Spinner,null),!t.isLoading&&e.length>0&&Object(n.createElement)("table",{className:"".concat("simpay-activity-reports-card-latest","-payments")},Object(n.createElement)("tbody",null,e.map((function(t){return Object(n.createElement)(L,b()({key:t.id},t))})))),!t.isLoading&&0===e.length&&Object(n.createElement)(C,{currency:N})))},z=i(8),V=i(4);function B(t,e){Object(V.a)(2,arguments);var i=Object(z.a)(t),n=Object(z.a)(e),a=i.getFullYear()-n.getFullYear(),s=i.getMonth()-n.getMonth();return 12*a+s}function W(t,e){Object(V.a)(2,arguments);var i=Object(z.a)(t),n=Object(z.a)(e),a=i.getTime()-n.getTime();return a<0?-1:a>0?1:a}function H(t){Object(V.a)(1,arguments);var e=Object(z.a)(t);return e.setHours(23,59,59,999),e}function U(t){Object(V.a)(1,arguments);var e=Object(z.a)(t),i=e.getMonth();return e.setFullYear(e.getFullYear(),i+1,0),e.setHours(23,59,59,999),e}function Y(t){Object(V.a)(1,arguments);var e=Object(z.a)(t);return H(e).getTime()===U(e).getTime()}var $=i(76),X=i(33);function q(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function G(t){for(var e=1;e27&&n.setDate(30),n.setMonth(n.getMonth()-s*r);var o=W(n,a)===-s;Y(Object(z.a)(t))&&1===r&&1===W(t,a)&&(o=!1),i=s*(r-Number(o))}return 0===i?0:i}(new Date(s.end),new Date(s.start))>12?(e=Object(X.dateI18n)("F Y",s.start),i=Object(X.dateI18n)("F Y",s.end)):"today"===s.type?(e=Object(X.dateI18n)(l.formats.date,Z),i=e):(e=Object(X.dateI18n)(l.formats.date,s.start),i=Object(X.dateI18n)(l.formats.date,s.end)),Object(n.createElement)("div",{className:"simpay-activity-reports-card-reports-date-range"},Object(n.createElement)(a.SelectControl,{label:Object(o.__)("Report range","stripe"),value:s.type,options:"custom"===s.type?[].concat(c,[{label:Object(o.__)("Custom","stripe"),value:"custom"}]):c,onChange:function(t){r(G(G({},s),{},{type:t,start:Object(d.d)(t,Z),end:Object(d.c)(t,s.end)}))},hideLabelFromVision:!0}),Object(n.createElement)(a.Dropdown,{position:"bottom center",popoverProps:{noArrow:!1},renderToggle:function(t){var i=t.isOpen,s=t.onToggle;return Object(n.createElement)(a.Button,{variant:"tertiary",onClick:s,"aria-expanded":i},e)},renderContent:function(t){var e=t.onToggle;return Object(n.createElement)(a.DatePicker,{currentDate:new Date(s.start),onChange:function(t){r(G(G({},s),{},{start:Object($.a)(new Date(t),"yyyy-MM-dd 00:00:00"),type:"custom"})),e()},startOfWeek:l.l10n.startOfWeek,isInvalidDate:function(t){return t>new Date(s.end)}})}}),Object(n.createElement)("span",{style:{color:"#ccc"}},"–"),Object(n.createElement)(a.Dropdown,{position:"bottom center",popoverProps:{noArrow:!1},renderToggle:function(t){var e=t.isOpen,s=t.onToggle;return Object(n.createElement)(a.Button,{variant:"tertiary",onClick:s,"aria-expanded":e},i)},renderContent:function(t){var e=t.onToggle;return Object(n.createElement)(a.DatePicker,{currentDate:new Date(s.end),onChange:function(t){r(G(G({},s),{},{end:Object($.a)(new Date(t),"yyyy-MM-dd 23:59:59"),type:"custom"})),e()},startOfWeek:l.l10n.startOfWeek,isInvalidDate:function(t){return tnew Date}})}}))},J="simpay-activity-reports-data-bar",tt=function(t){var e=t.isLoading,i=t.label,s=t.data;return Object(n.createElement)("div",{className:J},Object(n.createElement)("div",{className:"".concat(J,"__header")},Object(n.createElement)("h3",{className:"".concat(J,"__label")},i),!e&&Object(n.createElement)("div",{className:"".concat(J,"__legend")},s.map((function(t){var e=t.label,i=t.color;return Object(n.createElement)("div",{key:e,className:"".concat(J,"__legend-item"),style:{color:i}},Object(n.createElement)("span",null,e))})))),Object(n.createElement)("div",{className:"".concat(J,"__bar")},!e&&s.length>0&&s.map((function(t){return Object(n.createElement)(a.Button,{key:t.label,label:"".concat(t.label,": ").concat(t.value,"%"),showTooltip:!0,className:"".concat(J,"__bar-item"),style:{backgroundColor:t.color,flexBasis:"".concat(t.value,"%"),flexGrow:1}},Object(n.createElement)("div",{className:"screen-reader-text"},t.label))})),!e&&0===s.length&&Object(n.createElement)("div",{className:"".concat(J,"__bar-item-none")},Object(o.__)("n/a","stripe"))))},et=function(t){var e=t.currency,i=t.range,a=j("/wpsp/__internal__/report/payment-info",{range:i,currency:e},[i]),s=a.data,r=s.payment_method_types,l=s.payment_statuses;return Object(n.createElement)("div",{className:"".concat("simpay-activity-reports-card-reports","-payment-breakdown")},Object(n.createElement)(tt,{label:Object(o.__)("Payment Methods","stripe"),data:r,isLoading:a.isLoading}),Object(n.createElement)(tt,{label:Object(o.__)("Payments","stripe"),data:l,isLoading:a.isLoading}))},it=function(t){var e=t.currency,i=t.range,a=j("/wpsp/__internal__/report/gross-volume-period-over-period",{range:i,currency:e},[i]),s=a.data,r=s.delta,l=s.total_formatted;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)("div",{className:"".concat("simpay-activity-reports-card-reports","-report-title")},Object(n.createElement)("h3",null,Object(o.__)("Gross Volume","stripe"),!a.isLoading&&Object(n.createElement)(n.Fragment,null,": ",Object(n.createElement)("em",null,Object(y.decodeEntities)(l)))),!a.isLoading&&Object(n.createElement)(d.a,{delta:r})),Object(n.createElement)(d.b,{report:a,style:{width:"100%",height:"300px"},config:{yAxisIsCurrency:!0},noData:Object(n.createElement)("div",null,Object(n.createElement)("strong",null,Object(o.sprintf)(/* translators: %s Currency code. */ +!function(t){var e={};function i(n){if(e[n])return e[n].exports;var a=e[n]={i:n,l:!1,exports:{}};return t[n].call(a.exports,a,a.exports,i),a.l=!0,a.exports}i.m=t,i.c=e,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 a in t)i.d(n,a,function(e){return t[e]}.bind(null,a));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="",i(i.s=79)}([function(t,e){t.exports=window.wp.element},,function(t,e){t.exports=window.wp.i18n},function(t,e){t.exports=window.wp.components},function(t,e,i){"use strict";function n(t,e){if(e.length1?"s":"")+" required, but only "+e.length+" present")}i.d(e,"a",(function(){return n}))},function(t,e){t.exports=window.React},function(t,e,i){var n=i(26),a=i(27),s=i(22),r=i(28);t.exports=function(t,e){return n(t)||a(t,e)||s(t,e)||r()},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){"use strict";function n(t){if(null===t||!0===t||!1===t)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}i.d(e,"a",(function(){return n}))},function(t,e,i){"use strict";i.d(e,"a",(function(){return s}));var n=i(4);function a(t){return(a="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 s(t){Object(n.a)(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||"object"===a(t)&&"[object Date]"===e?new Date(t.getTime()):"number"==typeof t||"[object Number]"===e?new Date(t):("string"!=typeof t&&"[object String]"!==e||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}},function(t,e){t.exports=window.wp.primitives},function(t,e){t.exports=window.wp.url},function(t,e,i){var n=i(30);t.exports=function(t,e,i){return(e=n(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=window.lodash},function(t,e,i){var n;!function(){"use strict";var i={}.hasOwnProperty;function a(){for(var t=[],e=0;eArray.prototype.slice.call(t));let a=!1,s=[];return function(...i){s=n(i),a||(a=!0,h.call(window,()=>{a=!1,t.apply(e,s)}))}}const u=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2;function f(){}const p=function(){let t=0;return function(){return t++}}();function g(t){return null==t}function m(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.substr(0,7)&&"Array]"===e.substr(-6)}function b(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}const y=t=>("number"==typeof t||t instanceof Number)&&isFinite(+t);function x(t,e){return y(t)?t:e}function v(t,e){return void 0===t?e:t}const _=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function w(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function O(t,e,i,n){let a,s,r;if(m(t))if(s=t.length,n)for(a=s-1;a>=0;a--)e.call(i,t[a],a);else for(a=0;ai;)t=t[e.substr(i,n-i)],i=n+1,n=C(e,i);return t}function A(t){return t.charAt(0).toUpperCase()+t.slice(1)}const L=t=>void 0!==t,R=t=>"function"==typeof t,N=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0},F=Math.PI,I=2*F,z=I+F,B=Number.POSITIVE_INFINITY,V=F/180,W=F/2,H=F/4,U=2*F/3,Y=Math.log10,$=Math.sign;function X(t){const e=Math.round(t);t=G(t,e,t/1e3)?e:t;const i=Math.pow(10,Math.floor(Y(t))),n=t/i;return(n<=1?1:n<=2?2:n<=5?5:10)*i}function q(t){return!isNaN(parseFloat(t))&&isFinite(t)}function G(t,e,i){return Math.abs(t-e)l&&c=Math.min(e,i)-n&&t<=Math.max(e,i)+n}const ot=t=>0===t||1===t,lt=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*I/i),ct=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*I/i)+1,ht={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*W),easeOutSine:t=>Math.sin(t*W),easeInOutSine:t=>-.5*(Math.cos(F*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>ot(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>ot(t)?t:lt(t,.075,.3),easeOutElastic:t=>ot(t)?t:ct(t,.075,.3),easeInOutElastic(t){const e=.1125;return ot(t)?t:t<.5?.5*lt(2*t,e,.45):.5+.5*ct(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-ht.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*ht.easeInBounce(2*t):.5*ht.easeOutBounce(2*t-1)+.5},dt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},ut="0123456789ABCDEF",ft=t=>ut[15&t],pt=t=>ut[(240&t)>>4]+ut[15&t],gt=t=>(240&t)>>4==(15&t);function mt(t){return t+.5|0}const bt=(t,e,i)=>Math.max(Math.min(t,i),e);function yt(t){return bt(mt(2.55*t),0,255)}function xt(t){return bt(mt(255*t),0,255)}function vt(t){return bt(mt(t/2.55)/100,0,1)}function _t(t){return bt(mt(100*t),0,100)}const wt=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/,Ot=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Mt(t,e,i){const n=e*Math.min(i,1-i),a=(e,a=(e+t/30)%12)=>i-n*Math.max(Math.min(a-3,9-a,1),-1);return[a(0),a(8),a(4)]}function kt(t,e,i){const n=(n,a=(n+t/60)%6)=>i-i*e*Math.max(Math.min(a,4-a,1),0);return[n(5),n(3),n(1)]}function jt(t,e,i){const n=Mt(t,1,.5);let a;for(e+i>1&&(a=1/(e+i),e*=a,i*=a),a=0;a<3;a++)n[a]*=1-e-i,n[a]+=e;return n}function St(t){const e=t.r/255,i=t.g/255,n=t.b/255,a=Math.max(e,i,n),s=Math.min(e,i,n),r=(a+s)/2;let o,l,c;return a!==s&&(c=a-s,l=r>.5?c/(2-a-s):c/(a+s),o=a===e?(i-n)/c+(i=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=xt(t[3]))):(e=Rt(t,{r:0,g:0,b:0,a:1})).a=xt(e.a),e}function Ft(t){return"r"===t.charAt(0)?function(t){const e=wt.exec(t);let i,n,a,s=255;if(e){if(e[7]!==i){const t=+e[7];s=255&(e[8]?yt(t):255*t)}return i=+e[1],n=+e[3],a=+e[5],i=255&(e[2]?yt(i):i),n=255&(e[4]?yt(n):n),a=255&(e[6]?yt(a):a),{r:i,g:n,b:a,a:s}}}(t):function(t){const e=Ot.exec(t);let i,n=255;if(!e)return;e[5]!==i&&(n=e[6]?yt(+e[5]):xt(+e[5]));const a=Et(+e[2]),s=+e[3]/100,r=+e[4]/100;return i="hwb"===e[1]?function(t,e,i){return Dt(jt,t,e,i)}(a,s,r):"hsv"===e[1]?function(t,e,i){return Dt(kt,t,e,i)}(a,s,r):Pt(a,s,r),{r:i[0],g:i[1],b:i[2],a:n}}(t)}class It{constructor(t){if(t instanceof It)return t;const e=typeof t;let i;var n,a,s;"object"===e?i=Nt(t):"string"===e&&(s=(n=t).length,"#"===n[0]&&(4===s||5===s?a={r:255&17*dt[n[1]],g:255&17*dt[n[2]],b:255&17*dt[n[3]],a:5===s?17*dt[n[4]]:255}:7!==s&&9!==s||(a={r:dt[n[1]]<<4|dt[n[2]],g:dt[n[3]]<<4|dt[n[4]],b:dt[n[5]]<<4|dt[n[6]],a:9===s?dt[n[7]]<<4|dt[n[8]]:255})),i=a||function(t){At||(At=function(){const t={},e=Object.keys(Tt),i=Object.keys(Ct);let n,a,s,r,o;for(n=0;n>16&255,s>>8&255,255&s]}return t}(),At.transparent=[0,0,0,0]);const e=At[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}(t)||Ft(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Rt(this._rgb);return t&&(t.a=vt(t.a)),t}set rgb(t){this._rgb=Nt(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${vt(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):this._rgb;var t}hexString(){return this._valid?(t=this._rgb,e=function(t){return gt(t.r)&>(t.g)&>(t.b)&>(t.a)}(t)?ft:pt,t?"#"+e(t.r)+e(t.g)+e(t.b)+(t.a<255?e(t.a):""):t):this._rgb;var t,e}hslString(){return this._valid?function(t){if(!t)return;const e=St(t),i=e[0],n=_t(e[1]),a=_t(e[2]);return t.a<255?`hsla(${i}, ${n}%, ${a}%, ${vt(t.a)})`:`hsl(${i}, ${n}%, ${a}%)`}(this._rgb):this._rgb}mix(t,e){const i=this;if(t){const n=i.rgb,a=t.rgb;let s;const r=e===s?.5:e,o=2*r-1,l=n.a-a.a,c=((o*l==-1?o:(o+l)/(1+o*l))+1)/2;s=1-c,n.r=255&c*n.r+s*a.r+.5,n.g=255&c*n.g+s*a.g+.5,n.b=255&c*n.b+s*a.b+.5,n.a=r*n.a+(1-r)*a.a,i.rgb=n}return i}clone(){return new It(this.rgb)}alpha(t){return this._rgb.a=xt(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=mt(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Lt(this._rgb,2,t),this}darken(t){return Lt(this._rgb,2,-t),this}saturate(t){return Lt(this._rgb,1,t),this}desaturate(t){return Lt(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=St(t);i[0]=Et(i[0]+e),i=Pt(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}function zt(t){return new It(t)}const Bt=t=>t instanceof CanvasGradient||t instanceof CanvasPattern;function Vt(t){return Bt(t)?t:zt(t)}function Wt(t){return Bt(t)?t:zt(t).saturate(.5).darken(.1).hexString()}const Ht=Object.create(null),Ut=Object.create(null);function Yt(t,e){if(!e)return t;const i=e.split(".");for(let e=0,n=i.length;et.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>Wt(e.backgroundColor),this.hoverBorderColor=(t,e)=>Wt(e.borderColor),this.hoverColor=(t,e)=>Wt(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t)}set(t,e){return $t(this,t,e)}get(t){return Yt(this,t)}describe(t,e){return $t(Ut,t,e)}override(t,e){return $t(Ht,t,e)}route(t,e,i,n){const a=Yt(this,t),s=Yt(this,i),r="_"+e;Object.defineProperties(a,{[r]:{value:a[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[r],e=s[n];return b(t)?Object.assign({},e,t):v(t,e)},set(t){this[r]=t}}})}}({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function qt(t,e,i,n,a){let s=e[a];return s||(s=e[a]=t.measureText(a).width,i.push(a)),s>n&&(n=s),n}function Gt(t,e,i,n){let a=(n=n||{}).data=n.data||{},s=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(a=n.data={},s=n.garbageCollect=[],n.font=e),t.save(),t.font=e;let r=0;const o=i.length;let l,c,h,d,u;for(l=0;li.length){for(l=0;l0&&t.stroke()}}function Jt(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.xe.top-i&&t.y0&&""!==s.strokeColor;let l,c;for(t.save(),t.font=a.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),g(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,s),l=0;lv(t[i],t[e[i]]):e=>t[e]:()=>t;for(const t of a)i[t]=+s(t)||0;return i}function de(t){return he(t,{top:"y",right:"x",bottom:"y",left:"x"})}function ue(t){return he(t,["topLeft","topRight","bottomLeft","bottomRight"])}function fe(t){const e=de(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function pe(t,e){t=t||{},e=e||Xt.font;let i=v(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let n=v(t.style,e.style);n&&!(""+n).match(le)&&(console.warn('Invalid font style specified: "'+n+'"'),n="");const a={family:v(t.family,e.family),lineHeight:ce(v(t.lineHeight,e.lineHeight),i),size:i,style:n,weight:v(t.weight,e.weight),string:""};return a.string=function(t){return!t||g(t.size)||g(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(a),a}function ge(t,e,i,n){let a,s,r,o=!0;for(a=0,s=t.length;at[i]1;)n=s+a>>1,i(n)?s=n:a=n;return{lo:s,hi:a}}const ye=(t,e,i)=>be(t,i,n=>t[n][e]be(t,i,n=>t[n][e]>=i),ve=["push","pop","shift","splice","unshift"];function _e(t,e){const i=t._chartjs;if(!i)return;const n=i.listeners,a=n.indexOf(e);-1!==a&&n.splice(a,1),n.length>0||(ve.forEach(e=>{delete t[e]}),delete t._chartjs)}function we(t){const e=new Set;let i,n;for(i=0,n=t.length;it[0])){L(n)||(n=Le("_fallback",t));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:i,_fallback:n,_getTarget:a,override:a=>Oe([a,...t],e,i,n)};return new Proxy(s,{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,n)=>De(i,n,()=>function(t,e,i,n){let a;for(const s of e)if(a=Le(je(s,t),i),L(a))return Se(t,a)?Te(i,n,t,a):a}(n,e,t,i)),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>Re(t).includes(e),ownKeys:t=>Re(t),set(t,e,i){const n=t._storage||(t._storage=a());return t[e]=n[e]=i,delete t._keys,!0}})}function Me(t,e,i,n){const a={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:ke(t,n),setContext:e=>Me(t,e,i,n),override:a=>Me(t.override(a),e,i,n)};return new Proxy(a,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>De(t,e,()=>function(t,e,i){const{_proxy:n,_context:a,_subProxy:s,_descriptors:r}=t;let o=n[e];return R(o)&&r.isScriptable(e)&&(o=function(t,e,i,n){const{_proxy:a,_context:s,_subProxy:r,_stack:o}=i;if(o.has(t))throw new Error("Recursion detected: "+Array.from(o).join("->")+"->"+t);return o.add(t),e=e(s,r||n),o.delete(t),Se(t,e)&&(e=Te(a._scopes,a,t,e)),e}(e,o,t,i)),m(o)&&o.length&&(o=function(t,e,i,n){const{_proxy:a,_context:s,_subProxy:r,_descriptors:o}=i;if(L(s.index)&&n(t))e=e[s.index%e.length];else if(b(e[0])){const i=e,n=a._scopes.filter(t=>t!==i);e=[];for(const l of i){const i=Te(n,a,t,l);e.push(Me(i,s,r&&r[t],o))}}return e}(e,o,t,r.isIndexable)),Se(e,o)&&(o=Me(o,a,s&&s[e],r)),o}(t,e,i)),getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,i)=>Reflect.has(t,i),ownKeys:()=>Reflect.ownKeys(t),set:(e,i,n)=>(t[i]=n,delete e[i],!0)})}function ke(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:n=e.indexable,_allKeys:a=e.allKeys}=t;return{allKeys:a,scriptable:i,indexable:n,isScriptable:R(i)?i:()=>i,isIndexable:R(n)?n:()=>n}}const je=(t,e)=>t?t+A(e):e,Se=(t,e)=>b(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function De(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const n=i();return t[e]=n,n}function Pe(t,e,i){return R(t)?t(e,i):t}const Ee=(t,e)=>!0===t?e:"string"==typeof t?T(e,t):void 0;function Ce(t,e,i,n,a){for(const s of e){const e=Ee(i,s);if(e){t.add(e);const s=Pe(e._fallback,i,a);if(L(s)&&s!==i&&s!==n)return s}else if(!1===e&&L(n)&&i!==n)return null}return!1}function Te(t,e,i,n){const a=e._rootScopes,s=Pe(e._fallback,i,n),r=[...t,...a],o=new Set;o.add(n);let l=Ae(o,r,i,s||i,n);return null!==l&&(!L(s)||s===i||(l=Ae(o,r,s,l,n),null!==l))&&Oe(Array.from(o),[""],a,s,()=>function(t,e,i){const n=t._getTarget();e in n||(n[e]={});const a=n[e];return m(a)&&b(i)?i:a}(e,i,n))}function Ae(t,e,i,n,a){for(;i;)i=Ce(t,e,i,n,a);return i}function Le(t,e){for(const i of e){if(!i)continue;const e=i[t];if(L(e))return e}}function Re(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter(t=>!t.startsWith("_")))e.add(t);return Array.from(e)}(t._scopes)),e}const Ne=Number.EPSILON||1e-14,Fe=(t,e)=>e"x"===t?"y":"x";function ze(t,e,i,n){const a=t.skip?e:t,s=e,r=i.skip?e:i,o=et(s,a),l=et(r,s);let c=o/(o+l),h=l/(o+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=n*c,u=n*h;return{previous:{x:s.x-d*(r.x-a.x),y:s.y-d*(r.y-a.y)},next:{x:s.x+u*(r.x-a.x),y:s.y+u*(r.y-a.y)}}}function Be(t,e,i){return Math.max(Math.min(t,i),e)}function Ve(t,e,i,n,a){let s,r,o,l;if(e.spanGaps&&(t=t.filter(t=>!t.skip)),"monotone"===e.cubicInterpolationMode)!function(t,e="x"){const i=Ie(e),n=t.length,a=Array(n).fill(0),s=Array(n);let r,o,l,c=Fe(t,0);for(r=0;rwindow.getComputedStyle(t,null),$e=["top","right","bottom","left"];function Xe(t,e,i){const n={};i=i?"-"+i:"";for(let a=0;a<4;a++){const s=$e[a];n[s]=parseFloat(t[e+"-"+s+i])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function qe(t,e){const{canvas:i,currentDevicePixelRatio:n}=e,a=Ye(i),s="border-box"===a.boxSizing,r=Xe(a,"padding"),o=Xe(a,"border","width"),{x:l,y:c,box:h}=function(t,e){const i=t.native||t,n=i.touches,a=n&&n.length?n[0]:i,{offsetX:s,offsetY:r}=a;let o,l,c=!1;if(((t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot))(s,r,i.target))o=s,l=r;else{const t=e.getBoundingClientRect();o=a.clientX-t.left,l=a.clientY-t.top,c=!0}return{x:o,y:l,box:c}}(t,i),d=r.left+(h&&o.left),u=r.top+(h&&o.top);let{width:f,height:p}=e;return s&&(f-=r.width+o.width,p-=r.height+o.height),{x:Math.round((l-d)/f*i.width/n),y:Math.round((c-u)/p*i.height/n)}}const Ge=t=>Math.round(10*t)/10;function Qe(t,e,i){const n=e||1,a=Math.floor(t.height*n),s=Math.floor(t.width*n);t.height=a/n,t.width=s/n;const r=t.canvas;return r.style&&(i||!r.style.height&&!r.style.width)&&(r.style.height=t.height+"px",r.style.width=t.width+"px"),(t.currentDevicePixelRatio!==n||r.height!==a||r.width!==s)&&(t.currentDevicePixelRatio=n,r.height=a,r.width=s,t.ctx.setTransform(n,0,0,n,0,0),!0)}const Ke=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(t){}return t}();function Ze(t,e){const i=function(t,e){return Ye(t).getPropertyValue(e)}(t,e),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function Je(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function ti(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:"middle"===n?i<.5?t.y:e.y:"after"===n?i<1?t.y:e.y:i>0?e.y:t.y}}function ei(t,e,i,n){const a={x:t.cp2x,y:t.cp2y},s={x:e.cp1x,y:e.cp1y},r=Je(t,a,i),o=Je(a,s,i),l=Je(s,e,i),c=Je(r,o,i),h=Je(o,l,i);return Je(c,h,i)}const ii=new Map;function ni(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let n=ii.get(i);return n||(n=new Intl.NumberFormat(t,e),ii.set(i,n)),n}(e,i).format(t)}function ai(t,e,i){return t?function(t,e){return{x:i=>t+t+e-i,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,i):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function si(t){return"angle"===t?{between:at,compare:it,normalize:nt}:{between:rt,compare:(t,e)=>t-e,normalize:t=>t}}function ri({start:t,end:e,count:i,loop:n,style:a}){return{start:t%i,end:e%i,loop:n&&(e-t+1)%i==0,style:a}}function oi(t,e,i){if(!i)return[t];const{property:n,start:a,end:s}=i,r=e.length,{compare:o,between:l,normalize:c}=si(n),{start:h,end:d,loop:u,style:f}=function(t,e,i){const{property:n,start:a,end:s}=i,{between:r,normalize:o}=si(n),l=e.length;let c,h,{start:d,end:u,loop:f}=t;if(f){for(d+=l,u+=l,c=0,h=l;cn({chart:t,initial:e.initial,numSteps:s,currentStep:Math.min(i-e.start,s)}))}_refresh(){this._request||(this._running=!0,this._request=h.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,n)=>{if(!i.running||!i.items.length)return;const a=i.items;let s,r=a.length-1,o=!1;for(;r>=0;--r)s=a[r],s._active?(s._total>i.duration&&(i.duration=s._total),s.tick(t),o=!0):(a[r]=a[a.length-1],a.pop());o&&(n.draw(),this._notify(n,i,t,"progress")),a.length||(i.running=!1,this._notify(n,i,t,"complete"),i.initial=!1),e+=a.length}),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((t,e)=>Math.max(t,e._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let n=i.length-1;for(;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}};const ui={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const n=Vt(t||"transparent"),a=n.valid&&Vt(e||"transparent");return a&&a.valid?a.mix(n,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class fi{constructor(t,e,i,n){const a=e[i];n=ge([t.to,n,a,t.from]);const s=ge([t.from,a,n]);this._active=!0,this._fn=t.fn||ui[t.type||typeof s],this._easing=ht[t.easing]||ht.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=s,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const n=this._target[this._prop],a=i-this._start,s=this._duration-a;this._start=i,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=a,this._loop=!!t.loop,this._to=ge([t.to,e,n,t.from]),this._from=ge([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,n=this._prop,a=this._from,s=this._loop,r=this._to;let o;if(this._active=a!==r&&(s||e1?2-o:o,o=this._easing(Math.min(1,Math.max(0,o))),this._target[n]=this._fn(a,r,o))}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let t=0;t"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),Xt.set("animations",{colors:{type:"color",properties:["color","borderColor","backgroundColor"]},numbers:{type:"number",properties:["x","y","borderWidth","radius","tension"]}}),Xt.describe("animations",{_fallback:"animation"}),Xt.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}});class gi{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!b(t))return;const e=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const n=t[i];if(!b(n))return;const a={};for(const t of pi)a[t]=n[t];(m(n.properties)&&n.properties||[i]).forEach(t=>{t!==i&&e.has(t)||e.set(t,a)})})}_animateOptions(t,e){const i=e.options,n=function(t,e){if(!e)return;let i=t.options;if(i)return i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i;t.options=e}(t,i);if(!n)return[];const a=this._createAnimations(n,i);return i.$shared&&function(t,e){const i=[],n=Object.keys(e);for(let e=0;e{t.options=i},()=>{}),a}_createAnimations(t,e){const i=this._properties,n=[],a=t.$animations||(t.$animations={}),s=Object.keys(e),r=Date.now();let o;for(o=s.length-1;o>=0;--o){const l=s[o];if("$"===l.charAt(0))continue;if("options"===l){n.push(...this._animateOptions(t,e));continue}const c=e[l];let h=a[l];const d=i.get(l);if(h){if(d&&h.active()){h.update(d,c,r);continue}h.cancel()}d&&d.duration?(a[l]=h=new fi(d,t,l,c),n.push(h)):t[l]=c}return n}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(di.add(this._chart,i),!0):void 0}}function mi(t,e){const i=t&&t.options||{},n=i.reverse,a=void 0===i.min?e:0,s=void 0===i.max?e:0;return{start:n?s:a,end:n?a:s}}function bi(t,e){const i=[],n=t._getSortedDatasetMetas(e);let a,s;for(a=0,s=n.length;a0||!i&&e<0)return a.index}return null}function wi(t,e){const{chart:i,_cachedMeta:n}=t,a=i._stacks||(i._stacks={}),{iScale:s,vScale:r,index:o}=n,l=s.axis,c=r.axis,h=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(s,r,n),d=e.length;let u;for(let t=0;ti[t].axis===e).shift()}function Mi(t,e){const i=t.controller.index,n=t.vScale&&t.vScale.axis;if(n){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[n]||void 0===e[n][i])return;delete e[n][i]}}}const ki=t=>"reset"===t||"none"===t,ji=(t,e)=>e?t:Object.assign({},t);class Si{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=xi(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&Mi(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=(t,e,i,n)=>"x"===t?e:"r"===t?n:i,a=e.xAxisID=v(i.xAxisID,Oi(t,"x")),s=e.yAxisID=v(i.yAxisID,Oi(t,"y")),r=e.rAxisID=v(i.rAxisID,Oi(t,"r")),o=e.indexAxis,l=e.iAxisID=n(o,a,s,r),c=e.vAxisID=n(o,s,a,r);e.xScale=this.getScaleForId(a),e.yScale=this.getScaleForId(s),e.rScale=this.getScaleForId(r),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&_e(this._data,this),t._stacked&&Mi(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(b(e))this._data=function(t){const e=Object.keys(t),i=new Array(e.length);let n,a,s;for(n=0,a=e.length;n{const e="_onData"+A(t),i=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...t){const a=i.apply(this,t);return n._chartjs.listeners.forEach(i=>{"function"==typeof i[e]&&i[e](...t)}),a}})}))),this._syncList=[],this._data=e}var n}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let n=!1;this._dataCheck();const a=e._stacked;e._stacked=xi(e.vScale,e),e.stack!==i.stack&&(n=!0,Mi(e),e.stack=i.stack),this._resyncElements(t),(n||a!==e._stacked)&&wi(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:n}=this,{iScale:a,_stacked:s}=i,r=a.axis;let o,l,c,h=0===t&&e===n.length||i._sorted,d=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=n,i._sorted=!0,c=n;else{c=m(n[t])?this.parseArrayData(i,n,t,e):b(n[t])?this.parseObjectData(i,n,t,e):this.parsePrimitiveData(i,n,t,e);const a=()=>null===l[r]||d&&l[r]t&&!e.hidden&&e._stacked&&{keys:bi(i,!0),values:null})(e,i,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:h}=function(t){const{min:e,max:i,minDefined:n,maxDefined:a}=t.getUserBounds();return{min:n?e:Number.NEGATIVE_INFINITY,max:a?i:Number.POSITIVE_INFINITY}}(r);let d,u;function f(){u=n[d];const e=u[r.axis];return!y(u[t.axis])||c>e||h=0;--d)if(!f()){this.updateRangeFromParsed(l,t,u,o);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let n,a,s;for(n=0,a=e.length;n=0&&tthis.getContext(i,n),h);return f.$shared&&(f.$shared=o,a[s]=Object.freeze(ji(f,o))),f}_resolveAnimations(t,e,i){const n=this.chart,a=this._cachedDataOpts,s="animation-"+e,r=a[s];if(r)return r;let o;if(!1!==n.options.animation){const n=this.chart.config,a=n.datasetAnimationScopeKeys(this._type,e),s=n.getOptionScopes(this.getDataset(),a);o=n.createResolver(s,this.getContext(t,i,e))}const l=new gi(n,o&&o.animations);return o&&o._cacheable&&(a[s]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||ki(t)||this.chart._animationsDisabled}updateElement(t,e,i,n){ki(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!ki(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;const a=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(a)||a})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];const n=i.length,a=e.length,s=Math.min(a,n);s&&this.parse(0,s),a>n?this._insertElements(n,a-n,t):a{for(t.length+=e,r=t.length-1;r>=s;r--)t[r]=t[r-e]};for(o(a),r=t;rt-e))}return t._cache.$bar}(e,t.type);let n,a,s,r,o=e._length;const l=()=>{32767!==s&&-32768!==s&&(L(r)&&(o=Math.min(o,Math.abs(s-r)||o)),r=s)};for(n=0,a=i.length;nMath.abs(o)&&(l=o,c=r),e[i.axis]=c,e._custom={barStart:l,barEnd:c,start:a,end:s,min:r,max:o}}(t,e,i,n):e[i.axis]=i.parse(t,n),e}function Ei(t,e,i,n){const a=t.iScale,s=t.vScale,r=a.getLabels(),o=a===s,l=[];let c,h,d,u;for(c=i,h=i+n;ct.x,i="left",n="right"):(e=t.base=i?1:-1)}(h,e,s)*a,d===s&&(m-=h/2),c=m+h),m===e.getPixelForValue(s)){const t=$(h)*e.getLineWidthForValue(s)/2;m+=t,h-=t}return{size:h,base:m,head:c,center:c+h/2}}_calculateBarIndexPixels(t,e){const i=e.scale,n=this.options,a=n.skipNull,s=v(n.maxBarThickness,1/0);let r,o;if(e.grouped){const i=a?this._getStackCount(t):e.stackCount,l="flex"===n.barThickness?function(t,e,i,n){const a=e.pixels,s=a[t];let r=t>0?a[t-1]:null,o=t=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,{xScale:i,yScale:n}=e,a=this.getParsed(t),s=i.getLabelForValue(a.x),r=n.getLabelForValue(a.y),o=a._custom;return{label:e.label,value:"("+s+", "+r+(o?", "+o:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,n){const a="reset"===n,{iScale:s,vScale:r}=this._cachedMeta,o=this.resolveDataElementOptions(e,n),l=this.getSharedOptions(o),c=this.includeOptions(n,l),h=s.axis,d=r.axis;for(let o=e;o""}}}};class Ii extends Si{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,n=this._cachedMeta;if(!1===this._parsing)n._parsed=i;else{let a,s,r=t=>+i[t];if(b(i[t])){const{key:t="value"}=this._parsing;r=e=>+T(i[e],t)}for(a=t,s=t+e;aat(t,o,l,!0)?1:Math.max(e,e*i,n,n*i),p=(t,e,n)=>at(t,o,l,!0)?-1:Math.min(e,e*i,n,n*i),g=f(0,c,d),m=f(W,h,u),b=p(F,c,d),y=p(F+W,h,u);n=(g-b)/2,a=(m-y)/2,s=-(g+b)/2,r=-(m+y)/2}return{ratioX:n,ratioY:a,offsetX:s,offsetY:r}}(u,d,o),b=(i.width-s)/f,y=(i.height-s)/p,x=Math.max(Math.min(b,y)/2,0),v=_(this.options.radius,x),w=(v-Math.max(v*o,0))/this._getVisibleDatasetWeightTotal();this.offsetX=g*v,this.offsetY=m*v,n.total=this.calculateTotal(),this.outerRadius=v-w*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-w*h,0),this.updateElements(a,0,a.length,t)}_circumference(t,e){const i=this.options,n=this._cachedMeta,a=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===n._parsed[t]||n.data[t].hidden?0:this.calculateCircumference(n._parsed[t]*a/I)}updateElements(t,e,i,n){const a="reset"===n,s=this.chart,r=s.chartArea,o=s.options.animation,l=(r.left+r.right)/2,c=(r.top+r.bottom)/2,h=a&&o.animateScale,d=h?0:this.innerRadius,u=h?0:this.outerRadius,f=this.resolveDataElementOptions(e,n),p=this.getSharedOptions(f),g=this.includeOptions(n,p);let m,b=this._getRotation();for(m=0;m0&&!isNaN(t)?I*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],a=ni(e._parsed[t],i.options.locale);return{label:n[t]||"",value:a}}getMaxBorderWidth(t){let e=0;const i=this.chart;let n,a,s,r,o;if(!t)for(n=0,a=i.data.datasets.length;n"spacing"!==t,_indexable:t=>"spacing"!==t},Ii.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map((e,n)=>{const a=t.getDatasetMeta(0).controller.getStyle(n);return{text:e,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,lineWidth:a.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label(t){let e=t.label;const i=": "+t.formattedValue;return m(e)?(e=e.slice(),e[0]+=i):e+=i,e}}}}};class zi extends Si{initialize(){this.enableOptionSharing=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:n=[],_dataset:a}=e,s=this.chart._animationsDisabled;let{start:r,count:o}=function(t,e,i){const n=e.length;let a=0,s=n;if(t._sorted){const{iScale:r,_parsed:o}=t,l=r.axis,{min:c,max:h,minDefined:d,maxDefined:u}=r.getUserBounds();d&&(a=st(Math.min(ye(o,r.axis,c).lo,i?n:ye(e,l,r.getPixelForValue(c)).lo),0,n-1)),s=u?st(Math.max(ye(o,r.axis,h).hi+1,i?0:ye(e,l,r.getPixelForValue(h)).hi+1),a,n)-a:n-a}return{start:a,count:s}}(e,n,s);this._drawStart=r,this._drawCount=o,function(t){const{xScale:e,yScale:i,_scaleRanges:n}=t,a={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!n)return t._scaleRanges=a,!0;const s=n.xmin!==e.min||n.xmax!==e.max||n.ymin!==i.min||n.ymax!==i.max;return Object.assign(n,a),s}(e)&&(r=0,o=n.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!a._decimated,i.points=n;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!s,options:l},t),this.updateElements(n,r,o,t)}updateElements(t,e,i,n){const a="reset"===n,{iScale:s,vScale:r,_stacked:o,_dataset:l}=this._cachedMeta,c=this.resolveDataElementOptions(e,n),h=this.getSharedOptions(c),d=this.includeOptions(n,h),u=s.axis,f=r.axis,{spanGaps:p,segment:m}=this.options,b=q(p)?p:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||a||"none"===n;let x=e>0&&this.getParsed(e-1);for(let c=e;c0&&i[u]-x[u]>b,m&&(p.parsed=i,p.raw=l.data[c]),d&&(p.options=h||this.resolveDataElementOptions(c,e.active?"active":n)),y||this.updateElement(e,c,p,n),x=i}this.updateSharedOptions(h,n,c)}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return i;const a=n[0].size(this.resolveDataElementOptions(0)),s=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,a,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}zi.id="line",zi.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},zi.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class Bi extends Si{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],a=ni(e._parsed[t].r,i.options.locale);return{label:n[t]||"",value:a}}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),a=Math.max(n/2,0),s=(a-Math.max(i.cutoutPercentage?a/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=a-s*this.index,this.innerRadius=this.outerRadius-s}updateElements(t,e,i,n){const a="reset"===n,s=this.chart,r=this.getDataset(),o=s.options.animation,l=this._cachedMeta.rScale,c=l.xCenter,h=l.yCenter,d=l.getIndexAngle(0)-.5*F;let u,f=d;const p=360/this.countVisibleElements();for(u=0;u{!isNaN(t.data[n])&&this.chart.getDataVisibility(n)&&i++}),i}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?K(this.resolveDataElementOptions(t,e).angle||i):0}}Bi.id="polarArea",Bi.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},Bi.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map((e,n)=>{const a=t.getDatasetMeta(0).controller.getStyle(n);return{text:e,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,lineWidth:a.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label:t=>t.chart.data.labels[t.dataIndex]+": "+t.formattedValue}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class Vi extends Ii{}Vi.id="pie",Vi.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Wi extends Si{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}update(t){const e=this._cachedMeta,i=e.dataset,n=e.data||[],a=e.iScale.getLabels();if(i.points=n,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const s={_loop:!0,_fullLoop:a.length===n.length,options:e};this.updateElement(i,void 0,s,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,i,n){const a=this.getDataset(),s=this._cachedMeta.rScale,r="reset"===n;for(let o=e;o"",label:t=>"("+t.label+", "+t.formattedValue+")"}}},scales:{x:{type:"linear"},y:{type:"linear"}}};class Yi{constructor(t){this.options=t||{}}formats(){return Ui()}parse(t,e){return Ui()}format(t,e){return Ui()}add(t,e,i){return Ui()}diff(t,e,i){return Ui()}startOf(t,e,i){return Ui()}endOf(t,e){return Ui()}}Yi.override=function(t){Object.assign(Yi.prototype,t)};var $i={_date:Yi};function Xi(t,e){return"native"in t?{x:t.x,y:t.y}:qe(t,e)}function qi(t,e,i,n){const{controller:a,data:s,_sorted:r}=t,o=a._cachedMeta.iScale;if(o&&e===o.axis&&"r"!==e&&r&&s.length){const t=o._reversePixels?xe:ye;if(!n)return t(s,e,i);if(a._sharedOptions){const n=s[0],a="function"==typeof n.getRange&&n.getRange(e);if(a){const n=t(s,e,i-a),r=t(s,e,i+a);return{lo:n.lo,hi:r.hi}}}}return{lo:0,hi:s.length-1}}function Gi(t,e,i,n,a){const s=t.getSortedVisibleDatasetMetas(),r=i[e];for(let t=0,i=s.length;t{t[o](a[r],n)&&s.push({element:t,datasetIndex:e,index:i}),t.inRange(a.x,a.y,n)&&(l=!0)}),i.intersect&&!l?[]:s}var Ji={modes:{index(t,e,i,n){const a=Xi(e,t),s=i.axis||"x",r=i.intersect?Qi(t,a,s,n):Ki(t,a,s,!1,n),o=[];return r.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{const e=r[0].index,i=t.data[e];i&&!i.skip&&o.push({element:i,datasetIndex:t.index,index:e})}),o):[]},dataset(t,e,i,n){const a=Xi(e,t),s=i.axis||"xy";let r=i.intersect?Qi(t,a,s,n):Ki(t,a,s,!1,n);if(r.length>0){const e=r[0].datasetIndex,i=t.getDatasetMeta(e).data;r=[];for(let t=0;tQi(t,Xi(e,t),i.axis||"xy",n),nearest:(t,e,i,n)=>Ki(t,Xi(e,t),i.axis||"xy",i.intersect,n),x:(t,e,i,n)=>Zi(t,e,{axis:"x",intersect:i.intersect},n),y:(t,e,i,n)=>Zi(t,e,{axis:"y",intersect:i.intersect},n)}};const tn=["left","top","right","bottom"];function en(t,e){return t.filter(t=>t.pos===e)}function nn(t,e){return t.filter(t=>-1===tn.indexOf(t.pos)&&t.box.axis===e)}function an(t,e){return t.sort((t,i)=>{const n=e?i:t,a=e?t:i;return n.weight===a.weight?n.index-a.index:n.weight-a.weight})}function sn(t,e,i,n){return Math.max(t[i],e[i])+Math.max(t[n],e[n])}function rn(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function on(t,e,i,n){const{pos:a,box:s}=i,r=t.maxPadding;if(!b(a)){i.size&&(t[a]-=i.size);const e=n[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?s.height:s.width),i.size=e.size/e.count,t[a]+=i.size}s.getPadding&&rn(r,s.getPadding());const o=Math.max(0,e.outerWidth-sn(r,t,"left","right")),l=Math.max(0,e.outerHeight-sn(r,t,"top","bottom")),c=o!==t.w,h=l!==t.h;return t.w=o,t.h=l,i.horizontal?{same:c,other:h}:{same:h,other:c}}function ln(t,e){const i=e.maxPadding;return function(t){const n={left:0,top:0,right:0,bottom:0};return t.forEach(t=>{n[t]=Math.max(e[t],i[t])}),n}(t?["left","right"]:["top","bottom"])}function cn(t,e,i,n){const a=[];let s,r,o,l,c,h;for(s=0,r=t.length,c=0;st.box.fullSize),!0),n=an(en(e,"left"),!0),a=an(en(e,"right")),s=an(en(e,"top"),!0),r=an(en(e,"bottom")),o=nn(e,"x"),l=nn(e,"y");return{fullSize:i,leftAndTop:n.concat(s),rightAndBottom:a.concat(l).concat(r).concat(o),chartArea:en(e,"chartArea"),vertical:n.concat(a).concat(l),horizontal:s.concat(r).concat(o)}}(t.boxes),l=o.vertical,c=o.horizontal;O(t.boxes,t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()});const h=l.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1,d=Object.freeze({outerWidth:e,outerHeight:i,padding:a,availableWidth:s,availableHeight:r,vBoxMaxWidth:s/2/h,hBoxMaxHeight:r/2}),u=Object.assign({},a);rn(u,fe(n));const f=Object.assign({maxPadding:u,w:s,h:r,x:a.left,y:a.top},a),p=function(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:n,stackWeight:a}=i;if(!t||!tn.includes(n))continue;const s=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=a}return e}(t),{vBoxMaxWidth:n,hBoxMaxHeight:a}=e;let s,r,o;for(s=0,r=t.length;s{const i=e.box;Object.assign(i,t.chartArea),i.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class fn{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}isAttached(t){return!0}updateConfig(t){}}class pn extends fn{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const gn={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},mn=t=>null===t||""===t,bn=!!Ke&&{passive:!0};function yn(t,e,i){t.canvas.removeEventListener(e,i,bn)}function xn(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function vn(t,e,i){const n=t.canvas,a=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||xn(i.addedNodes,n),e=e&&!xn(i.removedNodes,n);e&&i()});return a.observe(document,{childList:!0,subtree:!0}),a}function wn(t,e,i){const n=t.canvas,a=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||xn(i.removedNodes,n),e=e&&!xn(i.addedNodes,n);e&&i()});return a.observe(document,{childList:!0,subtree:!0}),a}const On=new Map;let Mn=0;function kn(){const t=window.devicePixelRatio;t!==Mn&&(Mn=t,On.forEach((e,i)=>{i.currentDevicePixelRatio!==t&&e()}))}function jn(t,e,i){const n=t.canvas,a=n&&He(n);if(!a)return;const s=d((t,e)=>{const n=a.clientWidth;i(t,e),n{const e=t[0],i=e.contentRect.width,n=e.contentRect.height;0===i&&0===n||s(i,n)});return r.observe(a),function(t,e){On.size||window.addEventListener("resize",kn),On.set(t,e)}(t,s),r}function Sn(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){On.delete(t),On.size||window.removeEventListener("resize",kn)}(t)}function Dn(t,e,i){const n=t.canvas,a=d(e=>{null!==t.ctx&&i(function(t,e){const i=gn[t.type]||t.type,{x:n,y:a}=qe(t,e);return{type:i,chart:e,native:t,x:void 0!==n?n:null,y:void 0!==a?a:null}}(e,t))},t,t=>{const e=t[0];return[e,e.offsetX,e.offsetY]});return function(t,e,i){t.addEventListener(e,i,bn)}(n,e,a),a}class Pn extends fn{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,n=t.getAttribute("height"),a=t.getAttribute("width");if(t.$chartjs={initial:{height:n,width:a,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",mn(a)){const e=Ze(t,"width");void 0!==e&&(t.width=e)}if(mn(n))if(""===t.style.height)t.height=t.width/(e||2);else{const e=Ze(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e.$chartjs)return!1;const i=e.$chartjs.initial;["height","width"].forEach(t=>{const n=i[t];g(n)?e.removeAttribute(t):e.setAttribute(t,n)});const n=i.style||{};return Object.keys(n).forEach(t=>{e.style[t]=n[t]}),e.width=e.width,delete e.$chartjs,!0}addEventListener(t,e,i){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),a={attach:vn,detach:wn,resize:jn}[e]||Dn;n[e]=a(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),n=i[e];n&&(({attach:Sn,detach:Sn,resize:Sn}[e]||yn)(t,e,n),i[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return function(t,e,i,n){const a=Ye(t),s=Xe(a,"margin"),r=Ue(a.maxWidth,t,"clientWidth")||B,o=Ue(a.maxHeight,t,"clientHeight")||B,l=function(t,e,i){let n,a;if(void 0===e||void 0===i){const s=He(t);if(s){const t=s.getBoundingClientRect(),r=Ye(s),o=Xe(r,"border","width"),l=Xe(r,"padding");e=t.width-l.width-o.width,i=t.height-l.height-o.height,n=Ue(r.maxWidth,s,"clientWidth"),a=Ue(r.maxHeight,s,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:n||B,maxHeight:a||B}}(t,e,i);let{width:c,height:h}=l;if("content-box"===a.boxSizing){const t=Xe(a,"border","width"),e=Xe(a,"padding");c-=e.width+t.width,h-=e.height+t.height}return c=Math.max(0,c-s.width),h=Math.max(0,n?Math.floor(c/n):h-s.height),c=Ge(Math.min(c,r,l.maxWidth)),h=Ge(Math.min(h,o,l.maxHeight)),c&&!h&&(h=Ge(c/2)),{width:c,height:h}}(t,e,i,n)}isAttached(t){const e=He(t);return!(!e||!e.isConnected)}}class En{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return q(this.x)&&q(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const n={};return t.forEach(t=>{n[t]=i[t]&&i[t].active()?i[t]._to:this[t]}),n}}En.defaults={},En.defaultRoutes=void 0;const Cn={values:t=>m(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";const n=this.chart.options.locale;let a,s=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(a="scientific"),s=function(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t)),i}(t,i)}const r=Y(Math.abs(s)),o=Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:a,minimumFractionDigits:o,maximumFractionDigits:o};return Object.assign(l,this.options.ticks.format),ni(t,n,l)},logarithmic(t,e,i){if(0===t)return"0";const n=t/Math.pow(10,Math.floor(Y(t)));return 1===n||2===n||5===n?Cn.numeric.call(this,t,e,i):""}};var Tn={formatters:Cn};function An(t,e,i,n,a){const s=v(n,0),r=Math.min(v(a,t.length),t.length);let o,l,c,h=0;for(i=Math.ceil(i),a&&(o=a-n,i=o/Math.floor(o/i)),c=s;c<0;)h++,c=Math.round(s+h*i);for(l=Math.max(s,0);le.lineWidth,tickColor:(t,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Tn.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),Xt.route("scale.ticks","color","","color"),Xt.route("scale.grid","color","","borderColor"),Xt.route("scale.grid","borderColor","","borderColor"),Xt.route("scale.title","color","","color"),Xt.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t}),Xt.describe("scales",{_fallback:"scale"}),Xt.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t});const Ln=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i;function Rn(t,e){const i=[],n=t.length/e,a=t.length;let s=0;for(;sr+1e-6)))return l}function Fn(t){return t.drawTicks?t.tickLength:0}function In(t,e){if(!t.display)return 0;const i=pe(t.font,e),n=fe(t.padding);return(m(t.text)?t.text.length:1)*i.lineHeight+n.height}function zn(t,e,i){let n=(t=>"start"===t?"left":"end"===t?"right":"center")(t);return(i&&"right"!==e||!i&&"right"===e)&&(n=(t=>"left"===t?"right":"right"===t?"left":t)(n)),n}class Bn extends En{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:n}=this;return t=x(t,Number.POSITIVE_INFINITY),e=x(e,Number.NEGATIVE_INFINITY),i=x(i,Number.POSITIVE_INFINITY),n=x(n,Number.NEGATIVE_INFINITY),{min:x(t,i),max:x(e,n),minDefined:y(t),maxDefined:y(e)}}getMinMax(t){let e,{min:i,max:n,minDefined:a,maxDefined:s}=this.getUserBounds();if(a&&s)return{min:i,max:n};const r=this.getMatchingVisibleMetas();for(let o=0,l=r.length;on?n:i,n=a&&i>n?i:n,{min:x(i,x(n,i)),max:x(n,x(i,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){w(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:n,grace:a,ticks:s}=this.options,r=s.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(t,e,i){const{min:n,max:a}=t,s=_(e,(a-n)/2),r=(t,e)=>i&&0===t?0:t+e;return{min:r(n,-Math.abs(s)),max:r(a,s)}}(this,a,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const o=rn)return function(t,e,i,n){let a,s=0,r=i[0];for(n=Math.ceil(n),a=0;at-e).pop(),e}(n);for(let t=0,e=s.length-1;ta)return e}return Math.max(a,1)}(a,e,n);if(s>0){let t,i;const n=s>1?Math.round((o-r)/(s-1)):null;for(An(e,l,c,g(n)?0:r-n,r),t=0,i=s-1;t=a||i<=1||!this.isHorizontal())return void(this.labelRotation=n);const c=this._getLabelSizes(),h=c.widest.width,d=c.highest.height,u=st(this.chart.width-h,0,this.maxWidth);s=t.offset?this.maxWidth/i:u/(i-1),h+6>s&&(s=u/(i-(t.offset?.5:1)),r=this.maxHeight-Fn(t.grid)-e.padding-In(t.title,this.chart.options.font),o=Math.sqrt(h*h+d*d),l=Z(Math.min(Math.asin(st((c.highest.height+6)/s,-1,1)),Math.asin(st(r/o,-1,1))-Math.asin(st(d/o,-1,1)))),l=Math.max(n,Math.min(a,l))),this.labelRotation=l}afterCalculateLabelRotation(){w(this.options.afterCalculateLabelRotation,[this])}beforeFit(){w(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:n,grid:a}}=this,s=this._isVisible(),r=this.isHorizontal();if(s){const s=In(n,e.options.font);if(r?(t.width=this.maxWidth,t.height=Fn(a)+s):(t.height=this.maxHeight,t.width=Fn(a)+s),i.display&&this.ticks.length){const{first:e,last:n,widest:a,highest:s}=this._getLabelSizes(),o=2*i.padding,l=K(this.labelRotation),c=Math.cos(l),h=Math.sin(l);if(r){const e=i.mirror?0:h*a.width+c*s.height;t.height=Math.min(this.maxHeight,t.height+e+o)}else{const e=i.mirror?0:c*a.width+h*s.height;t.width=Math.min(this.maxWidth,t.width+e+o)}this._calculatePadding(e,n,h,c)}}this._handleMargins(),r?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,n){const{ticks:{align:a,padding:s},position:r}=this.options,o=0!==this.labelRotation,l="top"!==r&&"x"===this.axis;if(this.isHorizontal()){const r=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,d=0;o?l?(h=n*t.width,d=i*e.height):(h=i*t.height,d=n*e.width):"start"===a?d=e.width:"end"===a?h=t.width:(h=t.width/2,d=e.width/2),this.paddingLeft=Math.max((h-r+s)*this.width/(this.width-r),0),this.paddingRight=Math.max((d-c+s)*this.width/(this.width-c),0)}else{let i=e.height/2,n=t.height/2;"start"===a?(i=0,n=t.height):"end"===a&&(i=e.height,n=0),this.paddingTop=i+s,this.paddingBottom=n+s}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){w(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e{const i=t.gc,n=i.length/2;let a;if(n>e){for(a=0;a({width:a[t]||0,height:s[t]||0});return{first:M(0),last:M(e-1),widest:M(_),highest:M(w),widths:a,heights:s}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return st(this._alignToPixels?Qt(this.chart,e,0):e,-32768,32767)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&tr*n?r/i:o/n:o*n0}_computeGridLineItems(t){const e=this.axis,i=this.chart,n=this.options,{grid:a,position:s}=n,r=a.offset,o=this.isHorizontal(),l=this.ticks.length+(r?1:0),c=Fn(a),h=[],d=a.setContext(this.getContext()),u=d.drawBorder?d.borderWidth:0,f=u/2,p=function(t){return Qt(i,t,u)};let g,m,y,x,_,w,O,M,k,j,S,D;if("top"===s)g=p(this.bottom),w=this.bottom-c,M=g-f,j=p(t.top)+f,D=t.bottom;else if("bottom"===s)g=p(this.top),j=t.top,D=p(t.bottom)-f,w=g+f,M=this.top+c;else if("left"===s)g=p(this.right),_=this.right-c,O=g-f,k=p(t.left)+f,S=t.right;else if("right"===s)g=p(this.left),k=t.left,S=p(t.right)-f,_=g+f,O=this.left+c;else if("x"===e){if("center"===s)g=p((t.top+t.bottom)/2+.5);else if(b(s)){const t=Object.keys(s)[0],e=s[t];g=p(this.chart.scales[t].getPixelForValue(e))}j=t.top,D=t.bottom,w=g+f,M=w+c}else if("y"===e){if("center"===s)g=p((t.left+t.right)/2);else if(b(s)){const t=Object.keys(s)[0],e=s[t];g=p(this.chart.scales[t].getPixelForValue(e))}_=g-f,O=_-c,k=t.left,S=t.right}const P=v(n.ticks.maxTicksLimit,l),E=Math.max(1,Math.ceil(l/P));for(m=0;me.value===t);return i>=0?e.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let a,s;const r=(t,e,n)=>{n.width&&n.color&&(i.save(),i.lineWidth=n.width,i.strokeStyle=n.color,i.setLineDash(n.borderDash||[]),i.lineDashOffset=n.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(a=0,s=n.length;a{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:i+1,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",n=[];let a,s;for(a=0,s=e.length;a{const n=i.split("."),a=n.pop(),s=[t].concat(n).join("."),r=e[i].split("."),o=r.pop(),l=r.join(".");Xt.route(s,a,l,o)})}(e,t.defaultRoutes),t.descriptors&&Xt.describe(e,t.descriptors)}(t,s,i),this.override&&Xt.override(t.id,t.overrides)),s}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,n=this.scope;i in e&&delete e[i],n&&i in Xt[n]&&(delete Xt[n][i],this.override&&delete Ht[i])}}var Wn=new class{constructor(){this.controllers=new Vn(Si,"datasets",!0),this.elements=new Vn(En,"elements"),this.plugins=new Vn(Object,"plugins"),this.scales=new Vn(Bn,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(e=>{const n=i||this._getRegistryForType(e);i||n.isForType(e)||n===this.plugins&&e.id?this._exec(t,n,e):O(e,e=>{const n=i||this._getRegistryForType(e);this._exec(t,n,e)})})}_exec(t,e,i){const n=A(t);w(i["before"+n],[],i),e[t](i),w(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;et.filter(t=>!e.some(e=>t.plugin.id===e.plugin.id));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}}function Un(t,e){return e||!1!==t?!0===t?{}:t:null}function Yn(t,e,i,n){const a=t.pluginScopeKeys(e),s=t.getOptionScopes(i,a);return t.createResolver(s,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function $n(t,e){const i=Xt.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function Xn(t,e){return"x"===t||"y"===t?t:e.axis||("top"===(i=e.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0)||t.charAt(0).toLowerCase();var i}function qn(t){const e=t.options||(t.options={});e.plugins=v(e.plugins,{}),e.scales=function(t,e){const i=Ht[t.type]||{scales:{}},n=e.scales||{},a=$n(t.type,e),s=Object.create(null),r=Object.create(null);return Object.keys(n).forEach(t=>{const e=n[t];if(!b(e))return console.error("Invalid scale configuration for scale: "+t);if(e._proxy)return console.warn("Ignoring resolver passed as options for scale: "+t);const o=Xn(t,e),l=function(t,e){return t===e?"_index_":"_value_"}(o,a),c=i.scales||{};s[o]=s[o]||t,r[t]=P(Object.create(null),[{axis:o},e,c[o],c[l]])}),t.data.datasets.forEach(i=>{const a=i.type||t.type,o=i.indexAxis||$n(a,e),l=(Ht[a]||{}).scales||{};Object.keys(l).forEach(t=>{const e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,o),a=i[e+"AxisID"]||s[e]||e;r[a]=r[a]||Object.create(null),P(r[a],[{axis:e},n[a],l[t]])})}),Object.keys(r).forEach(t=>{const e=r[t];P(e,[Xt.scales[e.type],Xt.scale])}),r}(t,e)}function Gn(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const Qn=new Map,Kn=new Set;function Zn(t,e){let i=Qn.get(t);return i||(i=e(),Qn.set(t,i),Kn.add(i)),i}const Jn=(t,e,i)=>{const n=T(e,i);void 0!==n&&t.add(n)};class ta{constructor(t){this._config=function(t){return(t=t||{}).data=Gn(t.data),qn(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Gn(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),qn(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Zn(t,()=>[["datasets."+t,""]])}datasetAnimationScopeKeys(t,e){return Zn(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,"transitions."+e],["datasets."+t,""]])}datasetElementScopeKeys(t,e){return Zn(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,"datasets."+t,"elements."+e,""]])}pluginScopeKeys(t){const e=t.id;return Zn(`${this.type}-plugin-${e}`,()=>[["plugins."+e,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let n=i.get(t);return n&&!e||(n=new Map,i.set(t,n)),n}getOptionScopes(t,e,i){const{options:n,type:a}=this,s=this._cachedScopes(t,i),r=s.get(e);if(r)return r;const o=new Set;e.forEach(e=>{t&&(o.add(t),e.forEach(e=>Jn(o,t,e))),e.forEach(t=>Jn(o,n,t)),e.forEach(t=>Jn(o,Ht[a]||{},t)),e.forEach(t=>Jn(o,Xt,t)),e.forEach(t=>Jn(o,Ut,t))});const l=Array.from(o);return 0===l.length&&l.push(Object.create(null)),Kn.has(e)&&s.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,Ht[e]||{},Xt.datasets[e]||{},{type:e},Xt,Ut]}resolveNamedOptions(t,e,i,n=[""]){const a={$shared:!0},{resolver:s,subPrefixes:r}=ea(this._resolverCache,t,n);let o=s;(function(t,e){const{isScriptable:i,isIndexable:n}=ke(t);for(const a of e){const e=i(a),s=n(a),r=(s||e)&&t[a];if(e&&(R(r)||ia(r))||s&&m(r))return!0}return!1})(s,e)&&(a.$shared=!1,o=Me(s,i=R(i)?i():i,this.createResolver(t,i,r)));for(const t of e)a[t]=o[t];return a}createResolver(t,e,i=[""],n){const{resolver:a}=ea(this._resolverCache,t,i);return b(e)?Me(a,e,void 0,n):a}}function ea(t,e,i){let n=t.get(e);n||(n=new Map,t.set(e,n));const a=i.join();let s=n.get(a);return s||(s={resolver:Oe(e,i),subPrefixes:i.filter(t=>!t.toLowerCase().includes("hover"))},n.set(a,s)),s}const ia=t=>b(t)&&Object.getOwnPropertyNames(t).reduce((e,i)=>e||R(t[i]),!1),na=["top","bottom","left","right","chartArea"];function aa(t,e){return"top"===t||"bottom"===t||-1===na.indexOf(t)&&"x"===e}function sa(t,e){return function(i,n){return i[t]===n[t]?i[e]-n[e]:i[t]-n[t]}}function ra(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),w(i&&i.onComplete,[t],e)}function oa(t){const e=t.chart,i=e.options.animation;w(i&&i.onProgress,[t],e)}function la(t){return We()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const ca={},ha=t=>{const e=la(t);return Object.values(ca).filter(t=>t.canvas===e).pop()};function da(t,e,i){const n=Object.keys(t);for(const a of n){const n=+a;if(n>=e){const s=t[a];delete t[a],(i>0||n>e)&&(t[n+i]=s)}}}class ua{constructor(t,e){const i=this.config=new ta(e),n=la(t),a=ha(n);if(a)throw new Error("Canvas is already in use. Chart with ID '"+a.id+"' must be destroyed before the canvas can be reused.");const s=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||function(t){return!We()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?pn:Pn}(n)),this.platform.updateConfig(i);const r=this.platform.acquireContext(n,s.aspectRatio),o=r&&r.canvas,l=o&&o.height,c=o&&o.width;this.id=p(),this.ctx=r,this.canvas=o,this.width=c,this.height=l,this._options=s,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Hn,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let i;return function(...n){return e?(clearTimeout(i),i=setTimeout(t,e,n)):t.apply(this,n),e}}(t=>this.update(t),s.resizeDelay||0),this._dataChanges=[],ca[this.id]=this,r&&o?(di.listen(this,"complete",ra),di.listen(this,"progress",oa),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:a}=this;return g(t)?e&&a?a:n?i/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Qe(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Kt(this.canvas,this.ctx),this}stop(){return di.stop(this),this}resize(t,e){di.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,n=this.canvas,a=i.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(n,t,e,a),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),o=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,Qe(this,r,!0)&&(this.notifyPlugins("resize",{size:s}),w(i.onResize,[this,s],this),this.attached&&this._doResize(o)&&this.render())}ensureScalesHaveIDs(){O(this.options.scales||{},(t,e)=>{t.id=e})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,n=Object.keys(i).reduce((t,e)=>(t[e]=!1,t),{});let a=[];e&&(a=a.concat(Object.keys(e).map(t=>{const i=e[t],n=Xn(t,i),a="r"===n,s="x"===n;return{options:i,dposition:a?"chartArea":s?"bottom":"left",dtype:a?"radialLinear":s?"category":"linear"}}))),O(a,e=>{const a=e.options,s=a.id,r=Xn(s,a),o=v(a.type,e.dtype);void 0!==a.position&&aa(a.position,r)===aa(e.dposition)||(a.position=e.dposition),n[s]=!0;let l=null;s in i&&i[s].type===o?l=i[s]:(l=new(Wn.getScale(o))({id:s,type:o,ctx:this.ctx,chart:this}),i[l.id]=l),l.init(a,t)}),O(n,(t,e)=>{t||delete i[e]}),O(i,t=>{un.configure(this,t,t.options),un.addBox(this,t)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((t,e)=>t.index-e.index),i>e){for(let t=e;te.length&&delete this._stacks,t.forEach((t,i)=>{0===e.filter(e=>e===t._dataset).length&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,n;for(this._removeUnreferencedMetasets(),i=0,n=e.length;i{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const a=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let t=0,e=this.data.datasets.length;t{t.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(sa("z","_idx"));const{_active:r,_lastEvent:o}=this;o?this._eventHandler(o,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){O(this.scales,t=>{un.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);N(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:n,count:a}of e)da(t,n,"_removeElements"===i?-a:a)}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter(t=>t[0]===e).map((t,e)=>e+","+t.splice(1).join(","))),n=i(0);for(let t=1;tt.split(",")).map(t=>({method:t[1],start:+t[2],count:+t[3]}))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;un.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],O(this.boxes,t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))},this),this._layers.forEach((t,e)=>{t._idx=e}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,n=!i.disabled,a=this.chartArea,s={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",s)&&(n&&te(e,{left:!1===i.left?0:a.left-i.left,right:!1===i.right?this.width:a.right+i.right,top:!1===i.top?0:a.top-i.top,bottom:!1===i.bottom?this.height:a.bottom+i.bottom}),t.controller.draw(),n&&ee(e),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}getElementsAtEventForMode(t,e,i,n){const a=Ji.modes[e];return"function"==typeof a?a(this,t,i,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let n=i.filter(t=>t&&t._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(n)),n}getContext(){return this.$context||(this.$context=me(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const n=i?"show":"hide",a=this.getDatasetMeta(t),s=a.controller._resolveAnimations(void 0,n);L(e)?(a.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),s.update(a,{visible:i}),this.update(e=>e.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),di.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,i,n),t[i]=n},n=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};O(this.options.events,t=>i(t,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,n)=>{e.addEventListener(this,i,n),t[i]=n},n=(i,n)=>{t[i]&&(e.removeEventListener(this,i,n),delete t[i])},a=(t,e)=>{this.canvas&&this.resize(t,e)};let s;const r=()=>{n("attach",r),this.attached=!0,this.resize(),i("resize",a),i("detach",s)};s=()=>{this.attached=!1,n("resize",a),this._stop(),this._resize(0,0),i("attach",r)},e.isAttached(this.canvas)?r():s()}unbindEvents(){O(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},O(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const n=i?"set":"remove";let a,s,r,o;for("dataset"===e&&(a=this.getDatasetMeta(t[0].datasetIndex),a.controller["_"+n+"DatasetHoverStyle"]()),r=0,o=t.length;r{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}});!M(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}_updateHoverStyles(t,e,i){const n=this.options.hover,a=(t,e)=>t.filter(t=>!e.some(e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)),s=a(e,t),r=i?t:a(t,e);s.length&&this.updateHoverStyle(s,n.mode,!1),r.length&&n.mode&&this.updateHoverStyle(r,n.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:Jt(t,this.chartArea,this._minPadding)},n=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,n))return;const a=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(a||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:n=[],options:a}=this,s=e,r=this._getActiveElements(t,n,i,s),o=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}(t),l=function(t,e,i,n){return i&&"mouseout"!==t.type?n?e:t:null}(t,this._lastEvent,i,o);i&&(this._lastEvent=null,w(a.onHover,[t,r,this],this),o&&w(a.onClick,[t,r,this],this));const c=!M(r,n);return(c||e)&&(this._active=r,this._updateHoverStyles(r,n,e)),this._lastEvent=l,c}_getActiveElements(t,e,i,n){if("mouseout"===t.type)return[];if(!i)return e;const a=this.options.hover;return this.getElementsAtEventForMode(t,a.mode,a,n)}}const fa=()=>O(ua.instances,t=>t._plugins.invalidate());function pa(t,e,i){const{startAngle:n,pixelMargin:a,x:s,y:r,outerRadius:o,innerRadius:l}=e;let c=a/o;t.beginPath(),t.arc(s,r,o,n-c,i+c),l>a?(c=a/l,t.arc(s,r,l,i+c,n-c,!0)):t.arc(s,r,a,i+W,n-W),t.closePath(),t.clip()}function ga(t,e,i,n){return{x:i+t*Math.cos(e),y:n+t*Math.sin(e)}}function ma(t,e,i,n,a){const{x:s,y:r,startAngle:o,pixelMargin:l,innerRadius:c}=e,h=Math.max(e.outerRadius+n+i-l,0),d=c>0?c+n+i+l:0;let u=0;const f=a-o;if(n){const t=((c>0?c-n:0)+(h>0?h-n:0))/2;u=(f-(0!==t?f*t/(t+n):f))/2}const p=(f-Math.max(.001,f*h-i/F)/h)/2,g=o+p+u,m=a-p-u,{outerStart:b,outerEnd:y,innerStart:x,innerEnd:v}=function(t,e,i,n){const a=he(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]),s=(i-e)/2,r=Math.min(s,n*e/2),o=t=>{const e=(i-Math.min(s,t))*n/2;return st(t,0,Math.min(s,e))};return{outerStart:o(a.outerStart),outerEnd:o(a.outerEnd),innerStart:st(a.innerStart,0,r),innerEnd:st(a.innerEnd,0,r)}}(e,d,h,m-g),_=h-b,w=h-y,O=g+b/_,M=m-y/w,k=d+x,j=d+v,S=g+x/k,D=m-v/j;if(t.beginPath(),t.arc(s,r,h,O,M),y>0){const e=ga(w,M,s,r);t.arc(e.x,e.y,y,M,m+W)}const P=ga(j,m,s,r);if(t.lineTo(P.x,P.y),v>0){const e=ga(j,D,s,r);t.arc(e.x,e.y,v,m+W,D+Math.PI)}if(t.arc(s,r,d,m-v/d,g+x/d,!0),x>0){const e=ga(k,S,s,r);t.arc(e.x,e.y,x,S+Math.PI,g-W)}const E=ga(_,g,s,r);if(t.lineTo(E.x,E.y),b>0){const e=ga(_,O,s,r);t.arc(e.x,e.y,b,g-W,O)}t.closePath()}Object.defineProperties(ua,{defaults:{enumerable:!0,value:Xt},instances:{enumerable:!0,value:ca},overrides:{enumerable:!0,value:Ht},registry:{enumerable:!0,value:Wn},version:{enumerable:!0,value:"3.7.1"},getChart:{enumerable:!0,value:ha},register:{enumerable:!0,value:(...t)=>{Wn.add(...t),fa()}},unregister:{enumerable:!0,value:(...t)=>{Wn.remove(...t),fa()}}});class ba extends En{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.getProps(["x","y"],i),{angle:a,distance:s}=tt(n,{x:t,y:e}),{startAngle:r,endAngle:o,innerRadius:l,outerRadius:c,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),d=this.options.spacing/2,u=v(h,o-r)>=I||at(a,r,o),f=rt(s,l+d,c+d);return u&&f}getCenterPoint(t){const{x:e,y:i,startAngle:n,endAngle:a,innerRadius:s,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:o,spacing:l}=this.options,c=(n+a)/2,h=(s+r+l+o)/2;return{x:e+Math.cos(c)*h,y:i+Math.sin(c)*h}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,n=(e.offset||0)/2,a=(e.spacing||0)/2;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>I?Math.floor(i/I):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();let s=0;if(n){s=n/2;const e=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(e)*s,Math.sin(e)*s),this.circumference>=F&&(s=n)}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;const r=function(t,e,i,n){const{fullCircles:a,startAngle:s,circumference:r}=e;let o=e.endAngle;if(a){ma(t,e,i,n,s+I);for(let e=0;eo&&s>o;return{count:n,start:l,loop:e.loop,ilen:c(r+(c?o-t:t))%s,x=()=>{f!==p&&(t.lineTo(m,p),t.lineTo(m,f),t.lineTo(m,g))};for(l&&(d=a[y(0)],t.moveTo(d.x,d.y)),h=0;h<=o;++h){if(d=a[y(h)],d.skip)continue;const e=d.x,i=d.y,n=0|e;n===u?(ip&&(p=i),m=(b*m+e)/++b):(x(),t.lineTo(e,i),u=n,b=0,f=p=i),g=i}x()}function Oa(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i?_a:wa}ba.id="arc",ba.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0},ba.defaultRoutes={backgroundColor:"backgroundColor"};const Ma="function"==typeof Path2D;class ka extends En{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const n=i.spanGaps?this._loop:this._fullLoop;Ve(this._points,i,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(t,e){const i=t.points,n=t.options.spanGaps,a=i.length;if(!a)return[];const s=!!t._loop,{start:r,end:o}=function(t,e,i,n){let a=0,s=e-1;if(i&&!n)for(;aa&&t[s%e].skip;)s--;return s%=e,{start:a,end:s}}(i,a,s,n);return function(t,e,i,n){return n&&n.setContext&&i?function(t,e,i,n){const a=t._chart.getContext(),s=ci(t.options),{_datasetIndex:r,options:{spanGaps:o}}=t,l=i.length,c=[];let h=s,d=e[0].start,u=d;function f(t,e,n,a){const s=o?-1:1;if(t!==e){for(t+=l;i[t%l].skip;)t-=s;for(;i[e%l].skip;)e+=s;t%l!=e%l&&(c.push({start:t%l,end:e%l,loop:n,style:a}),h=a,d=e%l)}}for(const t of e){d=o?d:t.start;let e,s=i[d%l];for(u=d+1;u<=t.end;u++){const o=i[u%l];e=ci(n.setContext(me(a,{type:"segment",p0:s,p1:o,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:r}))),hi(e,h)&&f(d,u-1,t.loop,h),s=o,h=e}d"borderDash"!==t&&"fill"!==t};class Sa extends En{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.options,{x:a,y:s}=this.getProps(["x","y"],i);return Math.pow(t-a,2)+Math.pow(e-s,2)=i)&&a):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}Aa.id="bar",Aa.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0},Aa.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};class Ra{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:n,y:a,radius:s}=this;return e=e||{start:0,end:I},t.arc(n,a,s,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:n}=this,a=t.angle;return{x:e+Math.cos(a)*n,y:i+Math.sin(a)*n,angle:a}}}function Na(t,e,i){for(;e>t;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function Fa(t,e,i){const n=[];for(let a=0;a{e=Na(t,e,a);const r=a[t],o=a[e];null!==n?(s.push({x:r.x,y:n}),s.push({x:o.x,y:n})):null!==i&&(s.push({x:i,y:r.y}),s.push({x:i,y:o.y}))}),s}(t,e),i.length?new ka({points:i,options:{tension:0},_loop:n,_fullLoop:n}):null}function Va(t,e,i){let n=t[e].fill;const a=[e];let s;if(!i)return n;for(;!1!==n&&-1===a.indexOf(n);){if(!y(n))return n;if(s=t[n],!s)return!1;if(s.visible)return n;a.push(n),n=s.fill}return!1}function Wa(t,e,i){const{segments:n,points:a}=e;let s=!0,r=!1;t.beginPath();for(const o of n){const{start:n,end:l}=o,c=a[n],h=a[Na(n,l,a)];s?(t.moveTo(c.x,c.y),s=!1):(t.lineTo(c.x,i),t.lineTo(c.x,c.y)),r=!!e.pathSegment(t,o,{move:r}),r?t.closePath():t.lineTo(h.x,i)}t.lineTo(e.first().x,i),t.closePath(),t.clip()}function Ha(t,e,i,n){if(n)return;let a=e[t],s=i[t];return"angle"===t&&(a=nt(a),s=nt(s)),{property:t,start:a,end:s}}function Ua(t,e,i,n){return t&&e?n(t[i],e[i]):t?t[i]:e?e[i]:0}function Ya(t,e,i){const{top:n,bottom:a}=e.chart.chartArea,{property:s,start:r,end:o}=i||{};"x"===s&&(t.beginPath(),t.rect(r,n,o-r,a-n),t.clip())}function $a(t,e,i,n){const a=e.interpolate(i,n);a&&t.lineTo(a.x,a.y)}function Xa(t,e){const{line:i,target:n,property:a,color:s,scale:r}=e,o=function(t,e,i){const n=t.segments,a=t.points,s=e.points,r=[];for(const t of n){let{start:n,end:o}=t;o=Na(n,o,a);const l=Ha(i,a[n],a[o],t.loop);if(!e.segments){r.push({source:t,target:l,start:a[n],end:a[o]});continue}const c=li(e,l);for(const e of c){const n=Ha(i,s[e.start],s[e.end],e.loop),o=oi(t,a,n);for(const t of o)r.push({source:t,target:e,start:{[i]:Ua(l,n,"start",Math.max)},end:{[i]:Ua(l,n,"end",Math.min)}})}}return r}(i,n,a);for(const{source:e,target:l,start:c,end:h}of o){const{style:{backgroundColor:o=s}={}}=e,d=!0!==n;t.save(),t.fillStyle=o,Ya(t,r,d&&Ha(a,c,h)),t.beginPath();const u=!!i.pathSegment(t,e);let f;if(d){u?t.closePath():$a(t,n,h,a);const e=!!n.pathSegment(t,l,{move:u,reverse:!0});f=u&&e,f||$a(t,n,c,a)}t.closePath(),t.fill(f?"evenodd":"nonzero"),t.restore()}}function qa(t,e,i){const n=za(e),{line:a,scale:s,axis:r}=e,o=a.options,l=o.fill,c=o.backgroundColor,{above:h=c,below:d=c}=l||{};n&&a.points.length&&(te(t,i),function(t,e){const{line:i,target:n,above:a,below:s,area:r,scale:o}=e,l=i._loop?"angle":e.axis;t.save(),"x"===l&&s!==a&&(Wa(t,n,r.top),Xa(t,{line:i,target:n,color:a,scale:o,property:l}),t.restore(),t.save(),Wa(t,n,r.bottom)),Xa(t,{line:i,target:n,color:s,scale:o,property:l}),t.restore()}(t,{line:a,target:n,above:h,below:d,area:i,scale:s,axis:r}),ee(t))}var Ga={id:"filler",afterDatasetsUpdate(t,e,i){const n=(t.data.datasets||[]).length,a=[];let s,r,o,l;for(r=0;r=0;--e){const i=a[e].$filler;i&&(i.line.updateControlPoints(s,i.axis),n&&qa(t.ctx,i,s))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const n=t.getSortedVisibleDatasetMetas();for(let e=n.length-1;e>=0;--e){const i=n[e].$filler;i&&qa(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){const n=e.meta.$filler;n&&!1!==n.fill&&"beforeDatasetDraw"===i.drawTime&&qa(t.ctx,n,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};new WeakMap;const Qa={average(t){if(!t.length)return!1;let e,i,n=0,a=0,s=0;for(e=0,i=t.length;e-1?t.split("\n"):t}function Ja(t,e){const{element:i,datasetIndex:n,index:a}=e,s=t.getDatasetMeta(n).controller,{label:r,value:o}=s.getLabelAndValue(a);return{chart:t,label:r,parsed:s.getParsed(a),raw:t.data.datasets[n].data[a],formattedValue:o,dataset:s.getDataset(),dataIndex:a,datasetIndex:n,element:i}}function ts(t,e){const i=t.chart.ctx,{body:n,footer:a,title:s}=t,{boxWidth:r,boxHeight:o}=e,l=pe(e.bodyFont),c=pe(e.titleFont),h=pe(e.footerFont),d=s.length,u=a.length,f=n.length,p=fe(e.padding);let g=p.height,m=0,b=n.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);b+=t.beforeBody.length+t.afterBody.length,d&&(g+=d*c.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),b&&(g+=f*(e.displayColors?Math.max(o,l.lineHeight):l.lineHeight)+(b-f)*l.lineHeight+(b-1)*e.bodySpacing),u&&(g+=e.footerMarginTop+u*h.lineHeight+(u-1)*e.footerSpacing);let y=0;const x=function(t){m=Math.max(m,i.measureText(t).width+y)};return i.save(),i.font=c.string,O(t.title,x),i.font=l.string,O(t.beforeBody.concat(t.afterBody),x),y=e.displayColors?r+2+e.boxPadding:0,O(n,t=>{O(t.before,x),O(t.lines,x),O(t.after,x)}),y=0,i.font=h.string,O(t.footer,x),i.restore(),m+=p.width,{width:m,height:g}}function es(t,e,i,n){const{x:a,width:s}=i,{width:r,chartArea:{left:o,right:l}}=t;let c="center";return"center"===n?c=a<=(o+l)/2?"left":"right":a<=s/2?c="left":a>=r-s/2&&(c="right"),function(t,e,i,n){const{x:a,width:s}=n,r=i.caretSize+i.caretPadding;return"left"===t&&a+s+r>e.width||"right"===t&&a-s-r<0||void 0}(c,t,e,i)&&(c="center"),c}function is(t,e,i){const n=i.yAlign||e.yAlign||function(t,e){const{y:i,height:n}=e;return it.height-n/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||es(t,e,i,n),yAlign:n}}function ns(t,e,i,n){const{caretSize:a,caretPadding:s,cornerRadius:r}=t,{xAlign:o,yAlign:l}=i,c=a+s,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=ue(r);let p=function(t,e){let{x:i,width:n}=t;return"right"===e?i-=n:"center"===e&&(i-=n/2),i}(e,o);const g=function(t,e,i){let{y:n,height:a}=t;return"top"===e?n+=i:n-="bottom"===e?a+i:a/2,n}(e,l,c);return"center"===l?"left"===o?p+=c:"right"===o&&(p-=c):"left"===o?p-=Math.max(h,u)+a:"right"===o&&(p+=Math.max(d,f)+a),{x:st(p,0,n.width-e.width),y:st(g,0,n.height-e.height)}}function as(t,e,i){const n=fe(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-n.right:t.x+n.left}function ss(t){return Ka([],Za(t))}function rs(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}class os extends En{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart||t._chart,this._chart=this.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),n=i.enabled&&e.options.animation&&i.animations,a=new gi(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(a)),a}getContext(){return this.$context||(this.$context=(this,me(this.chart.getContext(),{tooltip:this,tooltipItems:this._tooltipItems,type:"tooltip"})))}getTitle(t,e){const{callbacks:i}=e,n=i.beforeTitle.apply(this,[t]),a=i.title.apply(this,[t]),s=i.afterTitle.apply(this,[t]);let r=[];return r=Ka(r,Za(n)),r=Ka(r,Za(a)),r=Ka(r,Za(s)),r}getBeforeBody(t,e){return ss(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){const{callbacks:i}=e,n=[];return O(t,t=>{const e={before:[],lines:[],after:[]},a=rs(i,t);Ka(e.before,Za(a.beforeLabel.call(this,t))),Ka(e.lines,a.label.call(this,t)),Ka(e.after,Za(a.afterLabel.call(this,t))),n.push(e)}),n}getAfterBody(t,e){return ss(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){const{callbacks:i}=e,n=i.beforeFooter.apply(this,[t]),a=i.footer.apply(this,[t]),s=i.afterFooter.apply(this,[t]);let r=[];return r=Ka(r,Za(n)),r=Ka(r,Za(a)),r=Ka(r,Za(s)),r}_createItems(t){const e=this._active,i=this.chart.data,n=[],a=[],s=[];let r,o,l=[];for(r=0,o=e.length;rt.filter(e,n,a,i))),t.itemSort&&(l=l.sort((e,n)=>t.itemSort(e,n,i))),O(l,e=>{const i=rs(t.callbacks,e);n.push(i.labelColor.call(this,e)),a.push(i.labelPointStyle.call(this,e)),s.push(i.labelTextColor.call(this,e))}),this.labelColors=n,this.labelPointStyles=a,this.labelTextColors=s,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),n=this._active;let a,s=[];if(n.length){const t=Qa[i.position].call(this,n,this._eventPosition);s=this._createItems(i),this.title=this.getTitle(s,i),this.beforeBody=this.getBeforeBody(s,i),this.body=this.getBody(s,i),this.afterBody=this.getAfterBody(s,i),this.footer=this.getFooter(s,i);const e=this._size=ts(this,i),r=Object.assign({},t,e),o=is(this.chart,i,r),l=ns(i,r,o,this.chart);this.xAlign=o.xAlign,this.yAlign=o.yAlign,a={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(a={opacity:0});this._tooltipItems=s,this.$context=void 0,a&&this._resolveAnimations().update(this,a),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,n){const a=this.getCaretPosition(t,i,n);e.lineTo(a.x1,a.y1),e.lineTo(a.x2,a.y2),e.lineTo(a.x3,a.y3)}getCaretPosition(t,e,i){const{xAlign:n,yAlign:a}=this,{caretSize:s,cornerRadius:r}=i,{topLeft:o,topRight:l,bottomLeft:c,bottomRight:h}=ue(r),{x:d,y:u}=t,{width:f,height:p}=e;let g,m,b,y,x,v;return"center"===a?(x=u+p/2,"left"===n?(g=d,m=g-s,y=x+s,v=x-s):(g=d+f,m=g+s,y=x-s,v=x+s),b=g):(m="left"===n?d+Math.max(o,c)+s:"right"===n?d+f-Math.max(l,h)-s:this.caretX,"top"===a?(y=u,x=y-s,g=m-s,b=m+s):(y=u+p,x=y+s,g=m+s,b=m-s),v=y),{x1:g,x2:m,x3:b,y1:y,y2:x,y3:v}}drawTitle(t,e,i){const n=this.title,a=n.length;let s,r,o;if(a){const l=ai(i.rtl,this.x,this.width);for(t.x=as(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",s=pe(i.titleFont),r=i.titleSpacing,e.fillStyle=i.titleColor,e.font=s.string,o=0;o0!==t)?(t.beginPath(),t.fillStyle=a.multiKeyBackground,re(t,{x:e,y:p,w:l,h:o,radius:r}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),re(t,{x:i,y:p+1,w:l-2,h:o-2,radius:r}),t.fill()):(t.fillStyle=a.multiKeyBackground,t.fillRect(e,p,l,o),t.strokeRect(e,p,l,o),t.fillStyle=s.backgroundColor,t.fillRect(i,p+1,l-2,o-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:n}=this,{bodySpacing:a,bodyAlign:s,displayColors:r,boxHeight:o,boxWidth:l,boxPadding:c}=i,h=pe(i.bodyFont);let d=h.lineHeight,u=0;const f=ai(i.rtl,this.x,this.width),p=function(i){e.fillText(i,f.x(t.x+u),t.y+d/2),t.y+=d+a},g=f.textAlign(s);let m,b,y,x,v,_,w;for(e.textAlign=s,e.textBaseline="middle",e.font=h.string,t.x=as(this,g,i),e.fillStyle=i.bodyColor,O(this.beforeBody,p),u=r&&"right"!==g?"center"===s?l/2+c:l+2+c:0,x=0,_=n.length;x<_;++x){for(m=n[x],b=this.labelTextColors[x],e.fillStyle=b,O(m.before,p),y=m.lines,r&&y.length&&(this._drawColorBox(e,t,x,f,i),d=Math.max(h.lineHeight,o)),v=0,w=y.length;v0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,n=i&&i.x,a=i&&i.y;if(n||a){const i=Qa[t.position].call(this,this._active,this._eventPosition);if(!i)return;const s=this._size=ts(this,t),r=Object.assign({},i,this._size),o=is(e,t,r),l=ns(t,r,o,e);n._to===l.x&&a._to===l.y||(this.xAlign=o.xAlign,this.yAlign=o.yAlign,this.width=s.width,this.height=s.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},a={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const s=fe(e.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&r&&(t.save(),t.globalAlpha=i,this.drawBackground(a,t,n,e),function(t,e){let i,n;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,n=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=n)}(t,e.textDirection),a.y+=s.top,this.drawTitle(a,t,e),this.drawBody(a,t,e),this.drawFooter(a,t,e),function(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,n=t.map(({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),a=!M(i,n),s=this._positionChanged(n,e);(a||s)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,a=this._active||[],s=this._getActiveElements(t,a,e,i),r=this._positionChanged(s,t),o=e||!M(s,a)||r;return o&&(this._active=s,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),o}_getActiveElements(t,e,i,n){const a=this.options;if("mouseout"===t.type)return[];if(!n)return e;const s=this.chart.getElementsAtEventForMode(t,a.mode,a,i);return a.reverse&&s.reverse(),s}_positionChanged(t,e){const{caretX:i,caretY:n,options:a}=this,s=Qa[a.position].call(this,t,e);return!1!==s&&(i!==s.x||n!==s.y)}}os.positioners=Qa;var ls={id:"tooltip",_element:os,positioners:Qa,afterInit(t,e,i){i&&(t.tooltip=new os({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip,i={tooltip:e};!1!==t.notifyPlugins("beforeTooltipDraw",i)&&(e&&e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i))},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:f,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,n=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(n>0&&e.dataIndex"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};class cs extends Bn{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:i,label:n}of e)t[i]===n&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(g(t))return null;const i=this.getLabels();return((t,e)=>null===t?null:st(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:function(t,e,i,n){const a=t.indexOf(e);return-1===a?((t,e,i,n)=>("string"==typeof e?(i=t.push(e)-1,n.unshift({index:i,label:e})):isNaN(e)&&(i=null),i))(t,e,i,n):a!==t.lastIndexOf(e)?i:a}(i,t,v(e,t),this._addedLabels),i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:n}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(n=this.getLabels().length-1)),this.min=i,this.max=n}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,n=[];let a=this.getLabels();a=0===t&&e===a.length-1?a:a.slice(t,e+1),this._valueRange=Math.max(a.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let i=t;i<=e;i++)n.push({value:i});return n}getLabelForValue(t){const e=this.getLabels();return t>=0&&te.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function hs(t,e,{horizontal:i,minRotation:n}){const a=K(n),s=(i?Math.sin(a):Math.cos(a))||.001,r=.75*e*(""+t).length;return Math.min(e/s,r)}cs.id="category",cs.defaults={ticks:{callback:cs.prototype.getLabelForValue}};class ds extends Bn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return g(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:n,max:a}=this;const s=t=>n=e?n:t,r=t=>a=i?a:t;if(t){const t=$(n),e=$(a);t<0&&e<0?r(0):t>0&&e>0&&s(0)}if(n===a){let e=1;(a>=Number.MAX_SAFE_INTEGER||n<=Number.MIN_SAFE_INTEGER)&&(e=Math.abs(.05*a)),r(a+e),t||s(n-e)}this.min=n,this.max=a}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:n}=t;return n?(e=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const n=function(t,e){const i=[],{bounds:n,step:a,min:s,max:r,precision:o,count:l,maxTicks:c,maxDigits:h,includeBounds:d}=t,u=a||1,f=c-1,{min:p,max:m}=e,b=!g(s),y=!g(r),x=!g(l),v=(m-p)/(h+1);let _,w,O,M,k=X((m-p)/f/u)*u;if(k<1e-14&&!b&&!y)return[{value:p},{value:m}];M=Math.ceil(m/k)-Math.floor(p/k),M>f&&(k=X(M*k/f/u)*u),g(o)||(_=Math.pow(10,o),k=Math.ceil(k*_)/_),"ticks"===n?(w=Math.floor(p/k)*k,O=Math.ceil(m/k)*k):(w=p,O=m),b&&y&&a&&function(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}((r-s)/a,k/1e3)?(M=Math.round(Math.min((r-s)/k,c)),k=(r-s)/M,w=s,O=r):x?(w=b?s:w,O=y?r:O,M=l-1,k=(O-w)/M):(M=(O-w)/k,M=G(M,Math.round(M),k/1e3)?Math.round(M):Math.ceil(M));const j=Math.max(J(k),J(w));_=Math.pow(10,g(o)?j:o),w=Math.round(w*_)/_,O=Math.round(O*_)/_;let S=0;for(b&&(d&&w!==s?(i.push({value:s}),w0?i:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=y(t)?Math.max(0,t):null,this.max=y(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,n=this.max;const a=e=>i=t?i:e,s=t=>n=e?n:t,r=(t,e)=>Math.pow(10,Math.floor(Y(t))+e);i===n&&(i<=0?(a(1),s(10)):(a(r(i,-1)),s(r(n,1)))),i<=0&&a(r(n,-1)),n<=0&&s(r(i,1)),this._zero&&this.min!==this._suggestedMin&&i===r(this.min,0)&&a(r(i,-1)),this.min=i,this.max=n}buildTicks(){const t=this.options,e=function(t,e){const i=Math.floor(Y(e.max)),n=Math.ceil(e.max/Math.pow(10,i)),a=[];let s=x(t.min,Math.pow(10,Math.floor(Y(e.min)))),r=Math.floor(Y(s)),o=Math.floor(s/Math.pow(10,r)),l=r<0?Math.pow(10,Math.abs(r)):1;do{a.push({value:s,major:fs(s)}),++o,10===o&&(o=1,++r,l=r>=0?1:l),s=Math.round(o*Math.pow(10,r)*l)/l}while(ra?{start:e-i,end:e}:{start:e,end:e+i}}function bs(t,e,i,n,a){const s=Math.abs(Math.sin(i)),r=Math.abs(Math.cos(i));let o=0,l=0;n.starte.r&&(o=(n.end-e.r)/s,t.r=Math.max(t.r,e.r+o)),a.starte.b&&(l=(a.end-e.b)/r,t.b=Math.max(t.b,e.b+l))}function ys(t){return 0===t||180===t?"center":t<180?"left":"right"}function xs(t,e,i){return 90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e),t}function vs(t,e,i,n){const{ctx:a}=t;if(i)a.arc(t.xCenter,t.yCenter,e,0,I);else{let i=t.getPointPosition(0,e);a.moveTo(i.x,i.y);for(let s=1;s{const i=w(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""}).filter((t,e)=>this.chart.getDataVisibility(e))}fit(){const t=this.options;t.display&&t.pointLabels.display?function(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),n=[],a=[],s=t._pointLabels.length,r=t.options.pointLabels,o=r.centerPointLabels?F/s:0;for(let d=0;d=0&&t=0;a--){const e=n.setContext(t.getPointLabelContext(a)),s=pe(e.font),{x:r,y:o,textAlign:l,left:c,top:h,right:d,bottom:u}=t._pointLabelItems[a],{backdropColor:f}=e;if(!g(f)){const t=fe(e.backdropPadding);i.fillStyle=f,i.fillRect(c-t.left,h-t.top,d-c+t.width,u-h+t.height)}ae(i,t._pointLabels[a],r,o+s.lineHeight/2,s,{color:e.color,textAlign:l,textBaseline:"middle"})}}(this,a),n.display&&this.ticks.forEach((t,e)=>{0!==e&&(r=this.getDistanceFromCenterForValue(t.value),function(t,e,i,n){const a=t.ctx,s=e.circular,{color:r,lineWidth:o}=e;!s&&!n||!r||!o||i<0||(a.save(),a.strokeStyle=r,a.lineWidth=o,a.setLineDash(e.borderDash),a.lineDashOffset=e.borderDashOffset,a.beginPath(),vs(t,i,s,n),a.closePath(),a.stroke(),a.restore())}(this,n.setContext(this.getContext(e-1)),r,a))}),i.display){for(t.save(),s=a-1;s>=0;s--){const n=i.setContext(this.getPointLabelContext(s)),{color:a,lineWidth:l}=n;l&&a&&(t.lineWidth=l,t.strokeStyle=a,t.setLineDash(n.borderDash),t.lineDashOffset=n.borderDashOffset,r=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),o=this.getPointPosition(s,r),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(o.x,o.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const n=this.getIndexAngle(0);let a,s;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(n),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((n,r)=>{if(0===r&&!e.reverse)return;const o=i.setContext(this.getContext(r)),l=pe(o.font);if(a=this.getDistanceFromCenterForValue(this.ticks[r].value),o.showLabelBackdrop){t.font=l.string,s=t.measureText(n.label).width,t.fillStyle=o.backdropColor;const e=fe(o.backdropPadding);t.fillRect(-s/2-e.left,-a-l.size/2-e.top,s+e.width,l.size+e.height)}ae(t,n.label,0,-a,l,{color:o.color})}),t.restore()}drawTitle(){}}_s.id="radialLinear",_s.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Tn.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}},_s.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},_s.descriptors={angleLines:{_fallback:"grid"}};const ws={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Os=Object.keys(ws);function Ms(t,e){return t-e}function ks(t,e){if(g(e))return null;const i=t._adapter,{parser:n,round:a,isoWeekday:s}=t._parseOpts;let r=e;return"function"==typeof n&&(r=n(r)),y(r)||(r="string"==typeof n?i.parse(r,n):i.parse(r)),null===r?null:(a&&(r="week"!==a||!q(s)&&!0!==s?i.startOf(r,a):i.startOf(r,"isoWeek",s)),+r)}function js(t,e,i,n){const a=Os.length;for(let s=Os.indexOf(t);s=e?i[n]:i[a]]=!0}}else t[e]=!0}function Ds(t,e,i){const n=[],a={},s=e.length;let r,o;for(r=0;r=0&&(e[l].major=!0);return e}(t,n,a,i):n}class Ps extends Bn{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e){const i=t.time||(t.time={}),n=this._adapter=new $i._date(t.adapters.date);P(i.displayFormats,n.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:ks(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:n,max:a,minDefined:s,maxDefined:r}=this.getUserBounds();function o(t){s||isNaN(t.min)||(n=Math.min(n,t.min)),r||isNaN(t.max)||(a=Math.max(a,t.max))}s&&r||(o(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||o(this.getMinMax(!1))),n=y(n)&&!isNaN(n)?n:+e.startOf(Date.now(),i),a=y(a)&&!isNaN(a)?a:+e.endOf(Date.now(),i)+1,this.min=Math.min(n,a-1),this.max=Math.max(n+1,a)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,n="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const a=this.min,s=function(t,e,i){let n=0,a=t.length;for(;nn&&t[a-1]>i;)a--;return n>0||a=Os.indexOf(i);s--){const i=Os[s];if(ws[i].common&&t._adapter.diff(a,n,i)>=e-1)return i}return Os[i?Os.indexOf(i):0]}(this,s.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(let e=Os.indexOf(t)+1,i=Os.length;e1e5*r)throw new Error(e+" and "+i+" are too far apart with stepSize of "+r+" "+s);const f="data"===n.ticks.source&&this.getDataTimestamps();for(h=u,d=0;ht-e).map(t=>+t)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}_tickFormatFunction(t,e,i,n){const a=this.options,s=a.time.displayFormats,r=this._unit,o=this._majorUnit,l=r&&s[r],c=o&&s[o],h=i[e],d=o&&c&&h&&h.major,u=this._adapter.format(t,n||(d?c:l)),f=a.ticks.callback;return f?w(f,[u,e,i],this):u}generateTickLabels(t){let e,i,n;for(e=0,i=t.length;e0?r:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(t=0,e=n.length;t=t[o].pos&&e<=t[l].pos&&({lo:o,hi:l}=ye(t,"pos",e)),({pos:n,time:s}=t[o]),({pos:a,time:r}=t[l])):(e>=t[o].time&&e<=t[l].time&&({lo:o,hi:l}=ye(t,"time",e)),({time:n,pos:s}=t[o]),({time:a,pos:r}=t[l]));const c=a-n;return c?s+(r-s)*(e-n)/c:s}Ps.id="time",Ps.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};class Cs extends Ps{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Es(e,this.min),this._tableRange=Es(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,n=[],a=[];let s,r,o,l,c;for(s=0,r=t.length;s=e&&l<=i&&n.push(l);if(n.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(s=0,r=n.length;s2&&void 0!==arguments[2]?arguments[2]:"label";const n=[];t.datasets=e.map(e=>{const a=t.datasets.find(t=>t[i]===e[i]);return a&&e.data&&!n.includes(a)?(n.push(a),Object.assign(a,e),a):{...e}})}function Fs(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"label";const i={labels:[],datasets:[]};return Rs(i,t.labels),Ns(i,t.datasets,e),i}function Is(t,e){let{height:i=150,width:n=300,redraw:a=!1,datasetIdKey:s,type:r,data:o,options:l,plugins:c=[],fallbackContent:h,...d}=t;const u=Object(Ts.useRef)(null),f=Object(Ts.useRef)(),p=()=>{u.current&&(f.current=new ua(u.current,{type:r,data:Fs(o,s),options:l,plugins:c}),Ls(e,f.current))},g=()=>{Ls(e,null),f.current&&(f.current.destroy(),f.current=null)};return Object(Ts.useEffect)(()=>{var t,e;!a&&f.current&&l&&(t=f.current,e=l,t.options={...e})},[a,l]),Object(Ts.useEffect)(()=>{!a&&f.current&&Rs(f.current.config.data,o.labels)},[a,o.labels]),Object(Ts.useEffect)(()=>{!a&&f.current&&o.datasets&&Ns(f.current.config.data,o.datasets,s)},[a,o.datasets]),Object(Ts.useEffect)(()=>{f.current&&(a?(g(),setTimeout(p)):f.current.update())},[a,l,o.labels,o.datasets]),Object(Ts.useEffect)(()=>(p(),()=>g()),[]),As.a.createElement("canvas",Object.assign({ref:u,role:"img",height:i,width:n},d),h)}const zs=Object(Ts.forwardRef)(Is);var Bs=i(3),Vs=i(17),Ws=i(7),Hs=i(8),Us=i(4);function Ys(t,e){Object(Us.a)(2,arguments);var i=Object(Hs.a)(t),n=Object(Ws.a)(e);return isNaN(n)?new Date(NaN):n?(i.setDate(i.getDate()+n),i):i}function $s(t,e){Object(Us.a)(2,arguments);var i=Object(Ws.a)(e);return Ys(t,-i)}function Xs(t,e){Object(Us.a)(2,arguments);var i=Object(Hs.a)(t),n=Object(Ws.a)(e);if(isNaN(n))return new Date(NaN);if(!n)return i;var a=i.getDate(),s=new Date(i.getTime());s.setMonth(i.getMonth()+n+1,0);var r=s.getDate();return a>=r?s:(i.setFullYear(s.getFullYear(),s.getMonth(),a),i)}function qs(t,e){Object(Us.a)(2,arguments);var i=Object(Ws.a)(e);return Xs(t,-i)}function Gs(t){return(Gs="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 Qs(t,e){if(Object(Us.a)(2,arguments),!e||"object"!==Gs(e))return new Date(NaN);var i=e.years?Object(Ws.a)(e.years):0,n=e.months?Object(Ws.a)(e.months):0,a=e.weeks?Object(Ws.a)(e.weeks):0,s=e.days?Object(Ws.a)(e.days):0,r=e.hours?Object(Ws.a)(e.hours):0,o=e.minutes?Object(Ws.a)(e.minutes):0,l=e.seconds?Object(Ws.a)(e.seconds):0,c=qs(t,n+12*i),h=$s(c,s+7*a),d=o+60*r,u=l+60*d,f=1e3*u,p=new Date(h.getTime()-f);return p}function Ks(t){return(Ks="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 Zs(t,e){if(Object(Us.a)(2,arguments),!e||"object"!==Ks(e))return new Date(NaN);var i=e.years?Object(Ws.a)(e.years):0,n=e.months?Object(Ws.a)(e.months):0,a=e.weeks?Object(Ws.a)(e.weeks):0,s=e.days?Object(Ws.a)(e.days):0,r=e.hours?Object(Ws.a)(e.hours):0,o=e.minutes?Object(Ws.a)(e.minutes):0,l=e.seconds?Object(Ws.a)(e.seconds):0,c=Object(Hs.a)(t),h=n||i?Xs(c,n+12*i):c,d=s||a?Ys(h,s+7*a):h,u=o+60*r,f=l+60*u,p=1e3*f,g=new Date(d.getTime()+p);return g}function Js(t,e){var i;Object(Us.a)(1,arguments);var n=Object(Ws.a)(null!==(i=null==e?void 0:e.additionalDigits)&&void 0!==i?i:2);if(2!==n&&1!==n&&0!==n)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof t&&"[object String]"!==Object.prototype.toString.call(t))return new Date(NaN);var a,s=ar(t);if(s.date){var r=sr(s.date,n);a=rr(r.restDateString,r.year)}if(!a||isNaN(a.getTime()))return new Date(NaN);var o,l=a.getTime(),c=0;if(s.time&&(c=lr(s.time),isNaN(c)))return new Date(NaN);if(!s.timezone){var h=new Date(l+c),d=new Date(0);return d.setFullYear(h.getUTCFullYear(),h.getUTCMonth(),h.getUTCDate()),d.setHours(h.getUTCHours(),h.getUTCMinutes(),h.getUTCSeconds(),h.getUTCMilliseconds()),d}return o=hr(s.timezone),isNaN(o)?new Date(NaN):new Date(l+c+o)}Math.pow(10,8);var tr={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},er=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,ir=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,nr=/^([+-])(\d{2})(?::?(\d{2}))?$/;function ar(t){var e,i={},n=t.split(tr.dateTimeDelimiter);if(n.length>2)return i;if(/:/.test(n[0])?e=n[0]:(i.date=n[0],e=n[1],tr.timeZoneDelimiter.test(i.date)&&(i.date=t.split(tr.timeZoneDelimiter)[0],e=t.substr(i.date.length,t.length))),e){var a=tr.timezone.exec(e);a?(i.time=e.replace(a[1],""),i.timezone=a[1]):i.time=e}return i}function sr(t,e){var i=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),n=t.match(i);if(!n)return{year:NaN,restDateString:""};var a=n[1]?parseInt(n[1]):null,s=n[2]?parseInt(n[2]):null;return{year:null===s?a:100*s,restDateString:t.slice((n[1]||n[2]).length)}}function rr(t,e){if(null===e)return new Date(NaN);var i=t.match(er);if(!i)return new Date(NaN);var n=!!i[4],a=or(i[1]),s=or(i[2])-1,r=or(i[3]),o=or(i[4]),l=or(i[5])-1;if(n)return function(t,e,i){return e>=1&&e<=53&&i>=0&&i<=6}(0,o,l)?function(t,e,i){var n=new Date(0);n.setUTCFullYear(t,0,4);var a=7*(e-1)+i+1-(n.getUTCDay()||7);return n.setUTCDate(n.getUTCDate()+a),n}(e,o,l):new Date(NaN);var c=new Date(0);return function(t,e,i){return e>=0&&e<=11&&i>=1&&i<=(dr[e]||(ur(t)?29:28))}(e,s,r)&&function(t,e){return e>=1&&e<=(ur(t)?366:365)}(e,a)?(c.setUTCFullYear(e,s,Math.max(a,r)),c):new Date(NaN)}function or(t){return t?parseInt(t):1}function lr(t){var e=t.match(ir);if(!e)return NaN;var i=cr(e[1]),n=cr(e[2]),a=cr(e[3]);return function(t,e,i){return 24===t?0===e&&0===i:i>=0&&i<60&&e>=0&&e<60&&t>=0&&t<25}(i,n,a)?36e5*i+6e4*n+1e3*a:NaN}function cr(t){return t&&parseFloat(t.replace(",","."))||0}function hr(t){if("Z"===t)return 0;var e=t.match(nr);if(!e)return 0;var i="+"===e[1]?-1:1,n=parseInt(e[2]),a=e[3]&&parseInt(e[3])||0;return function(t,e){return e>=0&&e<=59}(0,a)?i*(36e5*n+6e4*a):NaN}var dr=[31,null,31,30,31,30,31,31,30,31,30,31];function ur(t){return t%400==0||t%4==0&&t%100!=0}var fr=i(78);function pr(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function gr(t){for(var e=1;e0,"is-negative":e<0});return Object(c.createElement)("div",{className:s},Object(c.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"simpay-admin-charts-badge__icon",width:"16",height:"16"},e>0?Object(c.createElement)("path",{d:"M16.004 9.414l-8.607 8.607-1.414-1.414L14.589 8H7.004V6h11v11h-2V9.414z"}):Object(c.createElement)("path",{d:"M14.59 16.004L5.982 7.397l1.414-1.414 8.607 8.606V7.004h2v11h-11v-2z"})),!n&&Object(c.createElement)("span",null,Math.abs(e),"%"))},Er="simpay-admin-charts-period-over-period__tooltip",Cr=function(t){var e=t.position,i=t.opacity,n=t.data,a=t.delta,s=t.deltaChangedString;if(!n.length)return null;var r=e.top,o=e.left,l=e.right,h=Dr()("simpay-admin-charts-badge",{"is-positive":a>0,"is-negative":a<0});return Object(c.createElement)("div",{className:Er,style:{top:r,left:o||"auto",right:l||"auto",opacity:i}},n.map((function(t,e){var i=t.label,n=t.value;return Object(c.createElement)("div",{className:"".concat(Er,"-data"),"data-dataset":e,key:i+Math.random()},Object(c.createElement)("strong",null,i)," ",Object(c.createElement)("em",null,Object(Vs.decodeEntities)(n)))})),0!==a&&Object(c.createElement)("div",{className:"".concat(Er,"-delta")},Object(c.createElement)("div",{className:h},Object(c.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"simpay-admin-charts-badge__icon"},a>0?Object(c.createElement)("path",{fillRule:"evenodd",d:"M5.22 14.78a.75.75 0 001.06 0l7.22-7.22v5.69a.75.75 0 001.5 0v-7.5a.75.75 0 00-.75-.75h-7.5a.75.75 0 000 1.5h5.69l-7.22 7.22a.75.75 0 000 1.06z",clipRule:"evenodd"}):Object(c.createElement)("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06l7.22 7.22H6.75a.75.75 0 000 1.5h7.5a.747.747 0 00.75-.75v-7.5a.75.75 0 00-1.5 0v5.69L6.28 5.22z"}))),Object(c.createElement)("span",null,s)))},Tr=function(t){var e=t.chart,i=function(t,e){var i=Object(c.useState)({marginTop:0,marginRight:0,marginBottom:0,marginLeft:0}),n=l()(i,2),a=n[0],s=a.marginTop,r=a.marginRight,o=a.marginBottom,h=a.marginLeft,d=n[1];return Object(c.useEffect)((function(){t.current&&d({marginTop:Math.floor(t.current.chartArea.top),marginRight:Math.floor(t.current.width-t.current.chartArea.right),marginBottom:Math.floor(t.current.chartArea.bottom),marginLeft:Math.floor(t.current.chartArea.left)})}),[t,e]),{marginTop:s,marginRight:r,marginBottom:o,marginLeft:h}}(t.chartRef,e),n=i.marginLeft,a=i.marginRight;return Object(c.createElement)("div",{style:{width:"100%",position:"relative",fontSize:"12px",display:"flex",justifyContent:"space-between",marginTop:"-2px"}},Object(c.createElement)("div",{style:{marginLeft:n,textAlign:"left"}},e.datasets[0].data[0].x),Object(c.createElement)("div",{style:{marginRight:a,textAlign:"right"}},e.datasets[0].data[e.datasets[0].data.length-1].x))};function Ar(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Lr(t){for(var e=1;e0}))}));return Object(c.createElement)("div",{className:"simpay-admin-charts-period-over-period",style:s},!M&&Object(c.createElement)("div",{className:"simpay-admin-charts-no-data",style:Lr(Lr({},s),{},{height:"calc(".concat(s.height," + 15px)")})},o),Object(c.createElement)(zs,{type:"line",ref:g,options:O,plugins:[vr,(_="rgb(".concat(f.primary_color.join(","),")"),{id:"YGridLineHover",afterDraw:function(t){var e;if(null!==(e=t.tooltip)&&void 0!==e&&null!==(e=e._active)&&void 0!==e&&e.length){var i=t.tooltip._active[0].element.x,n=t.scales.yAxis,a=t.ctx;a.save(),a.beginPath(),a.moveTo(i,n.top),a.lineTo(i,n.bottom),a.lineWidth=2,a.strokeStyle=_,a.stroke(),a.restore()}}})],data:{datasets:m}}),Object(c.createElement)(Tr,{chartRef:g,chart:f}),Object(c.createElement)(Cr,a()({},x,{deltaChangedString:h(x)})),Object(c.createElement)(Bs.Popover.Slot,null))}},function(t,e){function i(){return t.exports=i=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var i=0,n=new Array(e);i=s.getTime()?i+1:e.getTime()>=l.getTime()?i:i-1}function f(t){Object(n.a)(1,arguments);var e=u(t),i=new Date(0);i.setUTCFullYear(e,0,4),i.setUTCHours(0,0,0,0);var a=d(i);return a}var p={};function g(){return p}function m(t,e){var i,a,s,o,c,h,d,u;Object(n.a)(1,arguments);var f=g(),p=Object(l.a)(null!==(i=null!==(a=null!==(s=null!==(o=null==e?void 0:e.weekStartsOn)&&void 0!==o?o:null==e||null===(c=e.locale)||void 0===c||null===(h=c.options)||void 0===h?void 0:h.weekStartsOn)&&void 0!==s?s:f.weekStartsOn)&&void 0!==a?a:null===(d=f.locale)||void 0===d||null===(u=d.options)||void 0===u?void 0:u.weekStartsOn)&&void 0!==i?i:0);if(!(p>=0&&p<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var m=Object(r.a)(t),b=m.getUTCDay(),y=(b=1&&y<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var x=new Date(0);x.setUTCFullYear(p+1,0,y),x.setUTCHours(0,0,0,0);var v=m(x,e),_=new Date(0);_.setUTCFullYear(p,0,y),_.setUTCHours(0,0,0,0);var w=m(_,e);return f.getTime()>=v.getTime()?p+1:f.getTime()>=w.getTime()?p:p-1}function y(t,e){var i,a,s,r,o,c,h,d;Object(n.a)(1,arguments);var u=g(),f=Object(l.a)(null!==(i=null!==(a=null!==(s=null!==(r=null==e?void 0:e.firstWeekContainsDate)&&void 0!==r?r:null==e||null===(o=e.locale)||void 0===o||null===(c=o.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==s?s:u.firstWeekContainsDate)&&void 0!==a?a:null===(h=u.locale)||void 0===h||null===(d=h.options)||void 0===d?void 0:d.firstWeekContainsDate)&&void 0!==i?i:1),p=b(t,e),y=new Date(0);y.setUTCFullYear(p,0,f),y.setUTCHours(0,0,0,0);var x=m(y,e);return x}function x(t,e){for(var i=t<0?"-":"",n=Math.abs(t).toString();n.length0?i:1-i;return x("yy"===e?n%100:n,e.length)},_=function(t,e){var i=t.getUTCMonth();return"M"===e?String(i+1):x(i+1,2)},w=function(t,e){return x(t.getUTCDate(),e.length)},O=function(t,e){return x(t.getUTCHours()%12||12,e.length)},M=function(t,e){return x(t.getUTCHours(),e.length)},k=function(t,e){return x(t.getUTCMinutes(),e.length)},j=function(t,e){return x(t.getUTCSeconds(),e.length)},S=function(t,e){var i=e.length,n=t.getUTCMilliseconds();return x(Math.floor(n*Math.pow(10,i-3)),e.length)};function D(t,e){var i=t>0?"-":"+",n=Math.abs(t),a=Math.floor(n/60),s=n%60;if(0===s)return i+String(a);var r=e||"";return i+String(a)+r+x(s,2)}function P(t,e){return t%60==0?(t>0?"-":"+")+x(Math.abs(t)/60,2):E(t,e)}function E(t,e){var i=e||"",n=t>0?"-":"+",a=Math.abs(t);return n+x(Math.floor(a/60),2)+i+x(a%60,2)}var C={G:function(t,e,i){var n=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return i.era(n,{width:"abbreviated"});case"GGGGG":return i.era(n,{width:"narrow"});case"GGGG":default:return i.era(n,{width:"wide"})}},y:function(t,e,i){if("yo"===e){var n=t.getUTCFullYear(),a=n>0?n:1-n;return i.ordinalNumber(a,{unit:"year"})}return v(t,e)},Y:function(t,e,i,n){var a=b(t,n),s=a>0?a:1-a;return"YY"===e?x(s%100,2):"Yo"===e?i.ordinalNumber(s,{unit:"year"}):x(s,e.length)},R:function(t,e){return x(u(t),e.length)},u:function(t,e){return x(t.getUTCFullYear(),e.length)},Q:function(t,e,i){var n=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return x(n,2);case"Qo":return i.ordinalNumber(n,{unit:"quarter"});case"QQQ":return i.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return i.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return i.quarter(n,{width:"wide",context:"formatting"})}},q:function(t,e,i){var n=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return x(n,2);case"qo":return i.ordinalNumber(n,{unit:"quarter"});case"qqq":return i.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return i.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return i.quarter(n,{width:"wide",context:"standalone"})}},M:function(t,e,i){var n=t.getUTCMonth();switch(e){case"M":case"MM":return _(t,e);case"Mo":return i.ordinalNumber(n+1,{unit:"month"});case"MMM":return i.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return i.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return i.month(n,{width:"wide",context:"formatting"})}},L:function(t,e,i){var n=t.getUTCMonth();switch(e){case"L":return String(n+1);case"LL":return x(n+1,2);case"Lo":return i.ordinalNumber(n+1,{unit:"month"});case"LLL":return i.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return i.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return i.month(n,{width:"wide",context:"standalone"})}},w:function(t,e,i,a){var s=function(t,e){Object(n.a)(1,arguments);var i=Object(r.a)(t),a=m(i,e).getTime()-y(i,e).getTime();return Math.round(a/6048e5)+1}(t,a);return"wo"===e?i.ordinalNumber(s,{unit:"week"}):x(s,e.length)},I:function(t,e,i){var a=function(t){Object(n.a)(1,arguments);var e=Object(r.a)(t),i=d(e).getTime()-f(e).getTime();return Math.round(i/6048e5)+1}(t);return"Io"===e?i.ordinalNumber(a,{unit:"week"}):x(a,e.length)},d:function(t,e,i){return"do"===e?i.ordinalNumber(t.getUTCDate(),{unit:"date"}):w(t,e)},D:function(t,e,i){var a=function(t){Object(n.a)(1,arguments);var e=Object(r.a)(t),i=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var a=e.getTime(),s=i-a;return Math.floor(s/864e5)+1}(t);return"Do"===e?i.ordinalNumber(a,{unit:"dayOfYear"}):x(a,e.length)},E:function(t,e,i){var n=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return i.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return i.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(n,{width:"short",context:"formatting"});case"EEEE":default:return i.day(n,{width:"wide",context:"formatting"})}},e:function(t,e,i,n){var a=t.getUTCDay(),s=(a-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return x(s,2);case"eo":return i.ordinalNumber(s,{unit:"day"});case"eee":return i.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return i.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(a,{width:"short",context:"formatting"});case"eeee":default:return i.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,i,n){var a=t.getUTCDay(),s=(a-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return x(s,e.length);case"co":return i.ordinalNumber(s,{unit:"day"});case"ccc":return i.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return i.day(a,{width:"narrow",context:"standalone"});case"cccccc":return i.day(a,{width:"short",context:"standalone"});case"cccc":default:return i.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,i){var n=t.getUTCDay(),a=0===n?7:n;switch(e){case"i":return String(a);case"ii":return x(a,e.length);case"io":return i.ordinalNumber(a,{unit:"day"});case"iii":return i.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return i.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return i.day(n,{width:"short",context:"formatting"});case"iiii":default:return i.day(n,{width:"wide",context:"formatting"})}},a:function(t,e,i){var n=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return i.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return i.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(t,e,i){var n,a=t.getUTCHours();switch(n=12===a?"noon":0===a?"midnight":a/12>=1?"pm":"am",e){case"b":case"bb":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return i.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return i.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(t,e,i){var n,a=t.getUTCHours();switch(n=a>=17?"evening":a>=12?"afternoon":a>=4?"morning":"night",e){case"B":case"BB":case"BBB":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return i.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return i.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(t,e,i){if("ho"===e){var n=t.getUTCHours()%12;return 0===n&&(n=12),i.ordinalNumber(n,{unit:"hour"})}return O(t,e)},H:function(t,e,i){return"Ho"===e?i.ordinalNumber(t.getUTCHours(),{unit:"hour"}):M(t,e)},K:function(t,e,i){var n=t.getUTCHours()%12;return"Ko"===e?i.ordinalNumber(n,{unit:"hour"}):x(n,e.length)},k:function(t,e,i){var n=t.getUTCHours();return 0===n&&(n=24),"ko"===e?i.ordinalNumber(n,{unit:"hour"}):x(n,e.length)},m:function(t,e,i){return"mo"===e?i.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):k(t,e)},s:function(t,e,i){return"so"===e?i.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):j(t,e)},S:function(t,e){return S(t,e)},X:function(t,e,i,n){var a=(n._originalDate||t).getTimezoneOffset();if(0===a)return"Z";switch(e){case"X":return P(a);case"XXXX":case"XX":return E(a);case"XXXXX":case"XXX":default:return E(a,":")}},x:function(t,e,i,n){var a=(n._originalDate||t).getTimezoneOffset();switch(e){case"x":return P(a);case"xxxx":case"xx":return E(a);case"xxxxx":case"xxx":default:return E(a,":")}},O:function(t,e,i,n){var a=(n._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+D(a,":");case"OOOO":default:return"GMT"+E(a,":")}},z:function(t,e,i,n){var a=(n._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+D(a,":");case"zzzz":default:return"GMT"+E(a,":")}},t:function(t,e,i,n){var a=n._originalDate||t;return x(Math.floor(a.getTime()/1e3),e.length)},T:function(t,e,i,n){return x((n._originalDate||t).getTime(),e.length)}},T=function(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},A=function(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},L={p:A,P:function(t,e){var i,n=t.match(/(P+)(p+)?/)||[],a=n[1],s=n[2];if(!s)return T(t,e);switch(a){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"})}return i.replace("{{date}}",T(a,e)).replace("{{time}}",A(s,e))}};function R(t){var e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}var N=["D","DD"],F=["YY","YYYY"];function I(t){return-1!==N.indexOf(t)}function z(t){return-1!==F.indexOf(t)}function B(t,e,i){if("YYYY"===t)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===t)throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===t)throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===t)throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var V={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function W(t){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.width?String(e.width):t.defaultWidth,n=t.formats[i]||t.formats[t.defaultWidth];return n}}var H={date:W({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:W({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:W({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},U={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function Y(t){return function(e,i){var n;if("formatting"===(null!=i&&i.context?String(i.context):"standalone")&&t.formattingValues){var a=t.defaultFormattingWidth||t.defaultWidth,s=null!=i&&i.width?String(i.width):a;n=t.formattingValues[s]||t.formattingValues[a]}else{var r=t.defaultWidth,o=null!=i&&i.width?String(i.width):t.defaultWidth;n=t.values[o]||t.values[r]}return n[t.argumentCallback?t.argumentCallback(e):e]}}function $(t){return function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.width,a=n&&t.matchPatterns[n]||t.matchPatterns[t.defaultMatchWidth],s=e.match(a);if(!s)return null;var r,o=s[0],l=n&&t.parsePatterns[n]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?q(l,(function(t){return t.test(o)})):X(l,(function(t){return t.test(o)}));r=t.valueCallback?t.valueCallback(c):c,r=i.valueCallback?i.valueCallback(r):r;var h=e.slice(o.length);return{value:r,rest:h}}}function X(t,e){for(var i in t)if(t.hasOwnProperty(i)&&e(t[i]))return i}function q(t,e){for(var i=0;i0?"in "+n:n+" ago":n},formatLong:H,formatRelative:function(t,e,i,n){return U[t]},localize:{ordinalNumber:function(t,e){var i=Number(t),n=i%100;if(n>20||n<10)switch(n%10){case 1:return i+"st";case 2:return i+"nd";case 3:return i+"rd"}return i+"th"},era:Y({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Y({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:Y({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:Y({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:Y({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(G={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(t){return parseInt(t,10)}},function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.match(G.matchPattern);if(!i)return null;var n=i[0],a=t.match(G.parsePattern);if(!a)return null;var s=G.valueCallback?G.valueCallback(a[0]):a[0];s=e.valueCallback?e.valueCallback(s):s;var r=t.slice(n.length);return{value:s,rest:r}}),era:$({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:$({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:$({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:$({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:$({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}},K=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Z=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,J=/^'([^]*?)'?$/,tt=/''/g,et=/[a-zA-Z]/;function it(t,e,i){var a,s,c,d,u,f,p,m,b,y,x,v,_,w,O,M,k,j;Object(n.a)(2,arguments);var S=String(e),D=g(),P=null!==(a=null!==(s=null==i?void 0:i.locale)&&void 0!==s?s:D.locale)&&void 0!==a?a:Q,E=Object(l.a)(null!==(c=null!==(d=null!==(u=null!==(f=null==i?void 0:i.firstWeekContainsDate)&&void 0!==f?f:null==i||null===(p=i.locale)||void 0===p||null===(m=p.options)||void 0===m?void 0:m.firstWeekContainsDate)&&void 0!==u?u:D.firstWeekContainsDate)&&void 0!==d?d:null===(b=D.locale)||void 0===b||null===(y=b.options)||void 0===y?void 0:y.firstWeekContainsDate)&&void 0!==c?c:1);if(!(E>=1&&E<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var T=Object(l.a)(null!==(x=null!==(v=null!==(_=null!==(w=null==i?void 0:i.weekStartsOn)&&void 0!==w?w:null==i||null===(O=i.locale)||void 0===O||null===(M=O.options)||void 0===M?void 0:M.weekStartsOn)&&void 0!==_?_:D.weekStartsOn)&&void 0!==v?v:null===(k=D.locale)||void 0===k||null===(j=k.options)||void 0===j?void 0:j.weekStartsOn)&&void 0!==x?x:0);if(!(T>=0&&T<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!P.localize)throw new RangeError("locale must contain localize property");if(!P.formatLong)throw new RangeError("locale must contain formatLong property");var A=Object(r.a)(t);if(!o(A))throw new RangeError("Invalid time value");var N=R(A),F=h(A,N),V={firstWeekContainsDate:E,weekStartsOn:T,locale:P,_originalDate:A},W=S.match(Z).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,L[e])(t,P.formatLong):t})).join("").match(K).map((function(n){if("''"===n)return"'";var a=n[0];if("'"===a)return nt(n);var s=C[a];if(s)return null!=i&&i.useAdditionalWeekYearTokens||!z(n)||B(n,e,String(t)),null!=i&&i.useAdditionalDayOfYearTokens||!I(n)||B(n,e,String(t)),s(F,n,P.localize,V);if(a.match(et))throw new RangeError("Format string contains an unescaped latin alphabet character `"+a+"`");return n})).join("");return W}function nt(t){var e=t.match(J);return e?e[1].replace(tt,"'"):t}},function(t,e,i){"use strict";i.r(e);var n=i(0),a=(i(37),i(3)),s=i(6),r=i.n(s),o=i(2),l=i(9),c=Object(n.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(l.Path,{fillRule:"evenodd",d:"M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z",clipRule:"evenodd"})),h=i(10),d=i(14),u=simpayAdminPageActivityReports,f=u.user_id,p=u.currencies,g=u.default_currency,m=i(15),b=i.n(m),y=i(17),x=i(11),v=i.n(x),_=i(25),w=i.n(_);function O(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function M(t){for(var e=1;e0&&Object(n.createElement)(n.Fragment,null,Object(n.createElement)(a.CardDivider,null),Object(n.createElement)("h3",{className:"".concat("simpay-activity-reports-card-today","-today-misc-title")},Object(o.__)("Top Forms","stripe")),Object(n.createElement)("div",{className:"".concat("simpay-activity-reports-card-today","-forms")},s.map((function(t){return Object(n.createElement)(D,b()({key:t.id},t))})))),r&&Object(n.createElement)("div",{className:"".concat("simpay-activity-reports-card-today","-tip")},Object(n.createElement)("strong",null,Object(n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{d:"M11.7 2.805a.75.75 0 01.6 0A60.65 60.65 0 0122.83 8.72a.75.75 0 01-.231 1.337 49.949 49.949 0 00-9.902 3.912l-.003.002-.34.18a.75.75 0 01-.707 0A50.009 50.009 0 007.5 12.174v-.224c0-.131.067-.248.172-.311a54.614 54.614 0 014.653-2.52.75.75 0 00-.65-1.352 56.129 56.129 0 00-4.78 2.589 1.858 1.858 0 00-.859 1.228 49.803 49.803 0 00-4.634-1.527.75.75 0 01-.231-1.337A60.653 60.653 0 0111.7 2.805z"}),Object(n.createElement)("path",{d:"M13.06 15.473a48.45 48.45 0 017.666-3.282c.134 1.414.22 2.843.255 4.285a.75.75 0 01-.46.71 47.878 47.878 0 00-8.105 4.342.75.75 0 01-.832 0 47.877 47.877 0 00-8.104-4.342.75.75 0 01-.461-.71c.035-1.442.121-2.87.255-4.286A48.4 48.4 0 016 13.18v1.27a1.5 1.5 0 00-.14 2.508c-.09.38-.222.753-.397 1.11.452.213.901.434 1.346.661a6.729 6.729 0 00.551-1.608 1.5 1.5 0 00.14-2.67v-.645a48.549 48.549 0 013.44 1.668 2.25 2.25 0 002.12 0z"}),Object(n.createElement)("path",{d:"M4.462 19.462c.42-.419.753-.89 1-1.394.453.213.902.434 1.347.661a6.743 6.743 0 01-1.286 1.794.75.75 0 11-1.06-1.06z"})),r.title),Object(n.createElement)("p",null,r.text," ",Object(n.createElement)("a",{href:Object(y.decodeEntities)(r.href),target:"_blank",rel:"noreferrer"},Object(o.__)("Learn More →","stripe")))))))},C=function(t){var e=t.currency;return Object(n.createElement)("div",{className:"simpay-admin-charts-no-data",style:{width:"100%",height:"100%"}},Object(n.createElement)("div",null,Object(n.createElement)("strong",null,Object(o.sprintf)(/* translators: %s Currency code. */ +Object(o.__)("No %s transactions found.","stripe"),e.toUpperCase())),Object(n.createElement)("div",null,Object(o.__)("Please select a different currency or check back later.","stripe"))))},T=i(13),A=i.n(T),L=function(t){var e=t.currency,i=t.amount_total_formatted,s=t.status,r=t.status_formatted,l=t.email,c=t.payment_method_type_icon,h=t.date_created_human_time_diff,d=t.links,u=d.customer,f=d.payment,p="simpay-activity-reports-card-latest-payment",g=A()("simpay-activity-reports-badge",{"is-succeeded":"succeeded"===s,"is-failed":"failed"===s});return Object(n.createElement)("tr",{className:p},Object(n.createElement)("td",{className:"".concat(p,"__amount")},Object(y.decodeEntities)(i)," ",Object(n.createElement)("small",{style:{fontWeight:"normal"}},e.toUpperCase())),Object(n.createElement)("td",{className:"".concat(p,"__type")},""!==c&&Object(n.createElement)("span",{dangerouslySetInnerHTML:{__html:c}})),Object(n.createElement)("td",{className:"".concat(p,"__status")},Object(n.createElement)("div",{className:g},Object(n.createElement)("span",null,r),Object(n.createElement)("svg",{"aria-hidden":"true",className:"simpay-activity-reports-badge__icon",height:"12",width:"12",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",style:{marginLeft:"4px"}},"succeeded"===s?Object(n.createElement)("path",{d:"M5.297 13.213.293 8.255c-.39-.394-.39-1.033 0-1.426s1.024-.394 1.414 0l4.294 4.224 8.288-8.258c.39-.393 1.024-.393 1.414 0s.39 1.033 0 1.426L6.7 13.208a.994.994 0 0 1-1.402.005z",fillRule:"evenodd"}):Object(n.createElement)("path",{d:"m8 6.585 4.593-4.592a1 1 0 0 1 1.415 1.416L9.417 8l4.591 4.591a1 1 0 0 1-1.415 1.416L8 9.415l-4.592 4.592a1 1 0 0 1-1.416-1.416L6.584 8l-4.59-4.591a1 1 0 1 1 1.415-1.416z",fillRule:"evenodd"})))),Object(n.createElement)("td",{className:"".concat(p,"__email")},Object(n.createElement)(a.Tooltip,{text:Object(o.__)("View customer records","stripe")},Object(n.createElement)("a",{href:u,target:"_blank",rel:"noreferrer noopener"},l))),Object(n.createElement)("td",{className:"".concat(p,"__date")},Object(n.createElement)(a.Tooltip,{text:Object(o.__)("View payment record","stripe")},Object(n.createElement)("a",{href:f,target:"_blank",rel:"noreferrer noopener"},h))))},R=simpayAdminPageActivityReports,N=R.default_currency,F=R.links.all_payments,I=function(){var t=j("/wpsp/__internal__/report/latest-payments",{currency:N},[]),e=t.data.payments;return Object(n.createElement)(a.Card,{elevation:2,className:"simpay-activity-reports-card-latest"},Object(n.createElement)(a.CardHeader,null,Object(n.createElement)("h2",{className:"simpay-activity-reports-card-title"},Object(o.__)("Latest Payments","stripe")),Object(n.createElement)(a.Button,{className:"simpay-activity-reports-card-title-link",href:F,variant:"link",isSmall:!0,target:"_blank"},Object(o.__)("View More →","stripe"))),Object(n.createElement)(a.CardBody,null,t.isLoading&&Object(n.createElement)(a.Spinner,null),!t.isLoading&&e.length>0&&Object(n.createElement)("table",{className:"".concat("simpay-activity-reports-card-latest","-payments")},Object(n.createElement)("tbody",null,e.map((function(t){return Object(n.createElement)(L,b()({key:t.id},t))})))),!t.isLoading&&0===e.length&&Object(n.createElement)(C,{currency:N})))},z=i(8),B=i(4);function V(t,e){Object(B.a)(2,arguments);var i=Object(z.a)(t),n=Object(z.a)(e),a=i.getFullYear()-n.getFullYear(),s=i.getMonth()-n.getMonth();return 12*a+s}function W(t,e){Object(B.a)(2,arguments);var i=Object(z.a)(t),n=Object(z.a)(e),a=i.getTime()-n.getTime();return a<0?-1:a>0?1:a}function H(t){Object(B.a)(1,arguments);var e=Object(z.a)(t);return e.setHours(23,59,59,999),e}function U(t){Object(B.a)(1,arguments);var e=Object(z.a)(t),i=e.getMonth();return e.setFullYear(e.getFullYear(),i+1,0),e.setHours(23,59,59,999),e}function Y(t){Object(B.a)(1,arguments);var e=Object(z.a)(t);return H(e).getTime()===U(e).getTime()}var $=i(78),X=i(33);function q(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function G(t){for(var e=1;e27&&n.setDate(30),n.setMonth(n.getMonth()-s*r);var o=W(n,a)===-s;Y(Object(z.a)(t))&&1===r&&1===W(t,a)&&(o=!1),i=s*(r-Number(o))}return 0===i?0:i}(new Date(s.end),new Date(s.start))>12?(e=Object(X.dateI18n)("F Y",s.start),i=Object(X.dateI18n)("F Y",s.end)):"today"===s.type?(e=Object(X.dateI18n)(l.formats.date,K),i=e):(e=Object(X.dateI18n)(l.formats.date,s.start),i=Object(X.dateI18n)(l.formats.date,s.end)),Object(n.createElement)("div",{className:"simpay-activity-reports-card-reports-date-range"},Object(n.createElement)(a.SelectControl,{label:Object(o.__)("Report range","stripe"),value:s.type,options:"custom"===s.type?[].concat(c,[{label:Object(o.__)("Custom","stripe"),value:"custom"}]):c,onChange:function(t){r(G(G({},s),{},{type:t,start:Object(d.d)(t,K),end:Object(d.c)(t,s.end)}))},hideLabelFromVision:!0}),Object(n.createElement)(a.Dropdown,{position:"bottom center",popoverProps:{noArrow:!1},renderToggle:function(t){var i=t.isOpen,s=t.onToggle;return Object(n.createElement)(a.Button,{variant:"tertiary",onClick:s,"aria-expanded":i},e)},renderContent:function(t){var e=t.onToggle;return Object(n.createElement)(a.DatePicker,{currentDate:new Date(s.start),onChange:function(t){r(G(G({},s),{},{start:Object($.a)(new Date(t),"yyyy-MM-dd 00:00:00"),type:"custom"})),e()},startOfWeek:l.l10n.startOfWeek,isInvalidDate:function(t){return t>new Date(s.end)}})}}),Object(n.createElement)("span",{style:{color:"#ccc"}},"–"),Object(n.createElement)(a.Dropdown,{position:"bottom center",popoverProps:{noArrow:!1},renderToggle:function(t){var e=t.isOpen,s=t.onToggle;return Object(n.createElement)(a.Button,{variant:"tertiary",onClick:s,"aria-expanded":e},i)},renderContent:function(t){var e=t.onToggle;return Object(n.createElement)(a.DatePicker,{currentDate:new Date(s.end),onChange:function(t){r(G(G({},s),{},{end:Object($.a)(new Date(t),"yyyy-MM-dd 23:59:59"),type:"custom"})),e()},startOfWeek:l.l10n.startOfWeek,isInvalidDate:function(t){return tnew Date}})}}))},J="simpay-activity-reports-data-bar",tt=function(t){var e=t.isLoading,i=t.label,s=t.data;return Object(n.createElement)("div",{className:J},Object(n.createElement)("div",{className:"".concat(J,"__header")},Object(n.createElement)("h3",{className:"".concat(J,"__label")},i),!e&&Object(n.createElement)("div",{className:"".concat(J,"__legend")},s.map((function(t){var e=t.label,i=t.color;return Object(n.createElement)("div",{key:e,className:"".concat(J,"__legend-item"),style:{color:i}},Object(n.createElement)("span",null,e))})))),Object(n.createElement)("div",{className:"".concat(J,"__bar")},!e&&s.length>0&&s.map((function(t){return Object(n.createElement)(a.Button,{key:t.label,label:"".concat(t.label,": ").concat(t.value,"%"),showTooltip:!0,className:"".concat(J,"__bar-item"),style:{backgroundColor:t.color,flexBasis:"".concat(t.value,"%"),flexGrow:1}},Object(n.createElement)("div",{className:"screen-reader-text"},t.label))})),!e&&0===s.length&&Object(n.createElement)("div",{className:"".concat(J,"__bar-item-none")},Object(o.__)("n/a","stripe"))))},et=function(t){var e=t.currency,i=t.range,a=j("/wpsp/__internal__/report/payment-info",{range:i,currency:e},[i]),s=a.data,r=s.payment_method_types,l=s.payment_statuses;return Object(n.createElement)("div",{className:"".concat("simpay-activity-reports-card-reports","-payment-breakdown")},Object(n.createElement)(tt,{label:Object(o.__)("Payment Methods","stripe"),data:r,isLoading:a.isLoading}),Object(n.createElement)(tt,{label:Object(o.__)("Payments","stripe"),data:l,isLoading:a.isLoading}))},it=function(t){var e=t.currency,i=t.range,a=j("/wpsp/__internal__/report/gross-volume-period-over-period",{range:i,currency:e},[i]),s=a.data,r=s.delta,l=s.total_formatted;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)("div",{className:"".concat("simpay-activity-reports-card-reports","-report-title")},Object(n.createElement)("h3",null,Object(o.__)("Gross Volume","stripe"),!a.isLoading&&Object(n.createElement)(n.Fragment,null,": ",Object(n.createElement)("em",null,Object(y.decodeEntities)(l)))),!a.isLoading&&Object(n.createElement)(d.a,{delta:r})),Object(n.createElement)(d.b,{report:a,style:{width:"100%",height:"300px"},config:{yAxisIsCurrency:!0},noData:Object(n.createElement)("div",null,Object(n.createElement)("strong",null,Object(o.sprintf)(/* translators: %s Currency code. */ Object(o.__)("No %s transactions found.","stripe"),e.toUpperCase())),Object(n.createElement)("div",null,Object(o.__)("Please select a different currency, date range, or check back later.","stripe"))),deltaChangedString:function(t){return Object(n.createInterpolateElement)(Object(o.sprintf)(/* translators: %s: delta percentage */ Object(o.__)("%1$s%% vs. previous period","stripe"),Math.abs(t.delta)),{delta:Object(n.createElement)("strong",{className:t.delta>0?"is-positive":"is-negative"})})}}))},nt=simpayAdminPageActivityReports.default_currency,at=function(t){var e=t.range,i=j("/wpsp/__internal__/report/successful-payments-period-over-period",{range:e,currency:nt},[e]),a=i.data,s=a.delta,r=a.total_formatted;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)("div",{className:"".concat("simpay-activity-reports-card-reports","-report-title")},Object(n.createElement)("h3",null,Object(o.__)("Successful Payments","stripe"),!i.isLoading&&Object(n.createElement)(n.Fragment,null,": ",Object(n.createElement)("em",null,r))),!i.isLoading&&Object(n.createElement)(d.a,{delta:s})),Object(n.createElement)(d.b,{report:i,style:{width:"100%",height:"300px"},config:{yAxisIsCurrency:!1},noData:Object(n.createElement)("div",null,Object(n.createElement)("strong",null,Object(o.sprintf)(/* translators: %s Currency code. */ Object(o.__)("No %s transactions found.","stripe"),nt.toUpperCase())),Object(n.createElement)("div",null,Object(o.__)("Please select a different currency, date range, or check back later.","stripe"))),deltaChangedString:function(t){return Object(n.createInterpolateElement)(Object(o.sprintf)(/* translators: %s: delta percentage */ -Object(o.__)("%1$s%% vs. previous period","stripe"),Math.abs(t.delta)),{delta:Object(n.createElement)("strong",{className:t.delta>0?"is-positive":"is-negative"})})}}))},st=simpayAdminPageActivityReports,rt=st.user_id,ot=st.default_range,lt=ot.start,ct=ot.end,ht=ot.type,dt=st.default_currency,ut=function(){var t=Object(d.e)(rt,"simpay_activity_reports_range",{start:Object(d.d)(ht,lt),end:Object(d.c)(ht,ct),type:ht}),e=r()(t,2),i=e[0],s=e[1];return Object(n.createElement)(a.Card,{elevation:2,className:"simpay-activity-reports-card-reports"},Object(n.createElement)(a.CardHeader,{className:"".concat("simpay-activity-reports-card-reports","-header")},Object(n.createElement)("h2",{className:"simpay-activity-reports-card-title"},Object(o.__)("Reports","stripe")),Object(n.createElement)(K,{range:i,setRange:s})),Object(n.createElement)(a.CardBody,null,Object(n.createElement)(et,{range:i,currency:dt}),Object(n.createElement)(a.CardDivider,null),Object(n.createElement)(it,{range:i,currency:dt}),Object(n.createElement)(a.CardDivider,null),Object(n.createElement)(at,{range:i,currency:dt})))};Object(n.render)(Object(n.createElement)((function(){var t=Object(d.e)(f,"simpay_activity_reports_currency",g),e=r()(t,3),i=e[0],s=e[1],l=e[2];function u(){var t=Object(h.addQueryArgs)(window.location.href,{currency:i});window.location.href=t}return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(a.Dropdown,{position:"bottom center",popoverProps:{noArrow:!1},renderToggle:function(t){var e=t.isOpen,i=t.onToggle;return Object(n.createElement)(a.Button,{variant:"secondary",onClick:i,"aria-expanded":e,icon:c,tooltip:Object(o.__)("Settings","stripe")})},renderContent:function(){return Object(n.createElement)("div",{style:{width:"200px",padding:"8px"}},Object(n.createElement)(a.SelectControl,{label:Object(o.__)("Currency","stripe"),value:i,onChange:s,options:p.map((function(t){return{label:t,value:t.toLowerCase()}})),help:Object(o.__)("Activity with the selected currency and global payment mode will be shown.","stripe")}),Object(n.createElement)(a.Button,{type:"submit",variant:"primary",onClick:u,isBusy:l,disabled:l},Object(o.__)("Update","stripe")))}}),Object(n.createElement)(a.Popover.Slot,null))}),null),document.getElementById("simpay-admin-page-activity-reports-config")),Object(n.render)(Object(n.createElement)((function(){return Object(n.createElement)("div",{className:"simpay-activity-reports"},Object(n.createElement)(E,null),Object(n.createElement)(I,null),Object(n.createElement)(ut,null),Object(n.createElement)(a.Popover.Slot,null))}),null),document.getElementById("simpay-admin-page-activity-reports"))}]); \ No newline at end of file +Object(o.__)("%1$s%% vs. previous period","stripe"),Math.abs(t.delta)),{delta:Object(n.createElement)("strong",{className:t.delta>0?"is-positive":"is-negative"})})}}))},st=simpayAdminPageActivityReports,rt=st.user_id,ot=st.default_range,lt=ot.start,ct=ot.end,ht=ot.type,dt=st.default_currency,ut=function(){var t=Object(d.e)(rt,"simpay_activity_reports_range",{start:Object(d.d)(ht,lt),end:Object(d.c)(ht,ct),type:ht}),e=r()(t,2),i=e[0],s=e[1];return Object(n.createElement)(a.Card,{elevation:2,className:"simpay-activity-reports-card-reports"},Object(n.createElement)(a.CardHeader,{className:"".concat("simpay-activity-reports-card-reports","-header")},Object(n.createElement)("h2",{className:"simpay-activity-reports-card-title"},Object(o.__)("Reports","stripe")),Object(n.createElement)(Z,{range:i,setRange:s})),Object(n.createElement)(a.CardBody,null,Object(n.createElement)(et,{range:i,currency:dt}),Object(n.createElement)(a.CardDivider,null),Object(n.createElement)(it,{range:i,currency:dt}),Object(n.createElement)(a.CardDivider,null),Object(n.createElement)(at,{range:i,currency:dt})))};Object(n.render)(Object(n.createElement)((function(){var t=Object(d.e)(f,"simpay_activity_reports_currency",g),e=r()(t,3),i=e[0],s=e[1],l=e[2];function u(){var t=Object(h.addQueryArgs)(window.location.href,{currency:i});window.location.href=t}return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(a.Dropdown,{position:"bottom center",popoverProps:{noArrow:!1},renderToggle:function(t){var e=t.isOpen,i=t.onToggle;return Object(n.createElement)(a.Button,{variant:"secondary",onClick:i,"aria-expanded":e,icon:c,tooltip:Object(o.__)("Settings","stripe")})},renderContent:function(){return Object(n.createElement)("div",{style:{width:"200px",padding:"8px"}},Object(n.createElement)(a.SelectControl,{label:Object(o.__)("Currency","stripe"),value:i,onChange:s,options:p.map((function(t){return{label:t,value:t.toLowerCase()}})),help:Object(o.__)("Activity with the selected currency and global payment mode will be shown.","stripe")}),Object(n.createElement)(a.Button,{type:"submit",variant:"primary",onClick:u,isBusy:l,disabled:l},Object(o.__)("Update","stripe")))}}),Object(n.createElement)(a.Popover.Slot,null))}),null),document.getElementById("simpay-admin-page-activity-reports-config")),Object(n.render)(Object(n.createElement)((function(){return Object(n.createElement)("div",{className:"simpay-activity-reports"},Object(n.createElement)(E,null),Object(n.createElement)(I,null),Object(n.createElement)(ut,null),Object(n.createElement)(a.Popover.Slot,null))}),null),document.getElementById("simpay-admin-page-activity-reports"))}]); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-page-setup-wizard-css.asset.php b/includes/core/assets/js/dist/simpay-admin-page-setup-wizard-css.asset.php index b71491df..bb8b4ef8 100644 --- a/includes/core/assets/js/dist/simpay-admin-page-setup-wizard-css.asset.php +++ b/includes/core/assets/js/dist/simpay-admin-page-setup-wizard-css.asset.php @@ -1 +1 @@ - array(), 'version' => 'fffb1affd7c46d59ca8858785f26ba36'); \ No newline at end of file + array(), 'version' => 'd99dc49f938c91cae2684bcc17849259'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-page-setup-wizard.asset.php b/includes/core/assets/js/dist/simpay-admin-page-setup-wizard.asset.php index c9a7fad6..15e647bb 100644 --- a/includes/core/assets/js/dist/simpay-admin-page-setup-wizard.asset.php +++ b/includes/core/assets/js/dist/simpay-admin-page-setup-wizard.asset.php @@ -1 +1 @@ - array('lodash', 'react', 'wp-api-fetch', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-primitives', 'wp-url'), 'version' => '460aeaabd1d5ec4ac3dfda45048d8c3b'); \ No newline at end of file + array('lodash', 'react', 'wp-api-fetch', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-primitives', 'wp-url'), 'version' => '579b9765c204b25653135173b92b4236'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-page-setup-wizard.js b/includes/core/assets/js/dist/simpay-admin-page-setup-wizard.js index 08b72398..b515d6a7 100644 --- a/includes/core/assets/js/dist/simpay-admin-page-setup-wizard.js +++ b/includes/core/assets/js/dist/simpay-admin-page-setup-wizard.js @@ -1,2 +1,2 @@ -!function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.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 a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));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=75)}([function(e,t){e.exports=window.wp.element},,function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wp.components},,function(e,t){e.exports=window.React},function(e,t,n){var r=n(26),a=n(27),i=n(21),c=n(28);e.exports=function(e,t){return r(e)||a(e,t)||i(e,t)||c()},e.exports.__esModule=!0,e.exports.default=e.exports},,,function(e,t){e.exports=window.wp.primitives},function(e,t){e.exports=window.wp.url},function(e,t,n){var r=n(30);e.exports=function(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=window.lodash},,function(e,t,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function a(){for(var e=[],t=0;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i},e.exports.__esModule=!0,e.exports.default=e.exports},,,,,,,,function(e,t){e.exports=window.wp.notices},function(e,t,n){"use strict";e.exports=n(62)},function(e,t,n){"use strict";var r="function"==typeof Symbol&&Symbol.for,a=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,c=r?Symbol.for("react.fragment"):60107,o=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,p=r?Symbol.for("react.async_mode"):60111,m=r?Symbol.for("react.concurrent_mode"):60111,f=r?Symbol.for("react.forward_ref"):60112,d=r?Symbol.for("react.suspense"):60113,b=r?Symbol.for("react.suspense_list"):60120,y=r?Symbol.for("react.memo"):60115,h=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,j=r?Symbol.for("react.scope"):60119;function _(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case a:switch(e=e.type){case p:case m:case c:case s:case o:case d:return e;default:switch(e=e&&e.$$typeof){case u:case f:case h:case y:case l:return e;default:return t}}case i:return t}}}function x(e){return _(e)===m}t.AsyncMode=p,t.ConcurrentMode=m,t.ContextConsumer=u,t.ContextProvider=l,t.Element=a,t.ForwardRef=f,t.Fragment=c,t.Lazy=h,t.Memo=y,t.Portal=i,t.Profiler=s,t.StrictMode=o,t.Suspense=d,t.isAsyncMode=function(e){return x(e)||_(e)===p},t.isConcurrentMode=x,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===a},t.isForwardRef=function(e){return _(e)===f},t.isFragment=function(e){return _(e)===c},t.isLazy=function(e){return _(e)===h},t.isMemo=function(e){return _(e)===y},t.isPortal=function(e){return _(e)===i},t.isProfiler=function(e){return _(e)===s},t.isStrictMode=function(e){return _(e)===o},t.isSuspense=function(e){return _(e)===d},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===c||e===m||e===s||e===o||e===d||e===b||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===y||e.$$typeof===l||e.$$typeof===u||e.$$typeof===f||e.$$typeof===v||e.$$typeof===O||e.$$typeof===j||e.$$typeof===g)},t.typeOf=_},function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r=0||(a[n]=e[n]);return a},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";var r=n(0),a=n(9);const i=Object(r.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(a.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}));t.a=i},function(e,t,n){"use strict";var r=n(0),a=n(9);const i=Object(r.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(a.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"}));t.a=i},,,,,,,,,,function(e,t,n){"use strict";n.r(t);var r=n(6),a=n.n(r),i=n(0),c=(n(60),n(3)),o=n(2),s=n(10),l=n(37),u=n(12),p=n(24),m=n.n(p),f=n(44),d=n(65),b=n(18),y=n.n(b),h=n(15),g=n.n(h),v=n(5);function O(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var j=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|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|enterKeyHint|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|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|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)-.*))$/,_=O((function(e){return j.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}));function x(){return(x=Object.assign?Object.assign.bind():function(e){for(var t=1;t2||J(V)>3?"":" "}function ae(e,t){for(;--t&&Y()&&!(V<48||V>102||V>57&&V<65||V>70&&V<97););return K(e,Q()+(t<6&&32==X()&&32==Y()))}function ie(e,t){for(;Y()&&e+V!==57&&(e+V!==84||47!==X()););return"/*"+K(t,Z-1)+"*"+A(47===e?e:Y())}function ce(e){for(;!J(X());)Y();return K(e,Z)}function oe(e,t,n,r,a,i,c,o,s,l,u){for(var p=a-1,m=0===a?i:[""],f=D(m),d=0,b=0,y=0;d0?m[h]+" "+g:$(g,/&\f/g,m[h])))&&(s[y++]=v);return G(e,t,n,0===a?k:o,s,l,u)}function se(e,t,n){return G(e,t,n,S,A(V),F(e,2,-2),0)}function le(e,t,n,r){return G(e,t,n,C,F(e,0,r),F(e,r+1,-1),r)}function ue(e,t){for(var n="",r=D(e),a=0;a-1&&!e.return)switch(e.type){case C:e.return=function e(t,n){switch(a=n,45^T(r=t,0)?(((a<<2^T(r,0))<<2^T(r,1))<<2^T(r,2))<<2^T(r,3):0){case 5103:return E+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return E+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return E+t+"-moz-"+t+"-ms-"+t+t;case 6828:case 4268:return E+t+"-ms-"+t+t;case 6165:return E+t+"-ms-flex-"+t+t;case 5187:return E+t+$(t,/(\w+).+(:[^]+)/,E+"box-$1$2-ms-flex-$1$2")+t;case 5443:return E+t+"-ms-flex-item-"+$(t,/flex-|-self/,"")+t;case 4675:return E+t+"-ms-flex-line-pack"+$(t,/align-content|flex-|-self/,"")+t;case 5548:return E+t+"-ms-"+$(t,"shrink","negative")+t;case 5292:return E+t+"-ms-"+$(t,"basis","preferred-size")+t;case 6060:return E+"box-"+$(t,"-grow","")+E+t+"-ms-"+$(t,"grow","positive")+t;case 4554:return E+$(t,/([^-])(transform)/g,"$1"+E+"$2")+t;case 6187:return $($($(t,/(zoom-|grab)/,E+"$1"),/(image-set)/,E+"$1"),t,"")+t;case 5495:case 3959:return $(t,/(image-set\([^]*)/,E+"$1$`$1");case 4968:return $($(t,/(.+:)(flex-)?(.*)/,E+"box-pack:$3-ms-flex-pack:$3"),/s.+-b[^;]+/,"justify")+E+t+t;case 4095:case 3583:case 4068:case 2532:return $(t,/(.+)-inline(.+)/,E+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(L(t)-1-n>6)switch(T(t,n+1)){case 109:if(45!==T(t,n+4))break;case 102:return $(t,/(.+:)(.+)-([^]+)/,"$1"+E+"$2-$3$1-moz-"+(108==T(t,n+3)?"$3":"$2-$3"))+t;case 115:return~R(t,"stretch")?e($(t,"stretch","fill-available"),n)+t:t}break;case 4949:if(115!==T(t,n+1))break;case 6444:switch(T(t,L(t)-3-(~R(t,"!important")&&10))){case 107:return $(t,":",":"+E)+t;case 101:return $(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+E+(45===T(t,14)?"inline-":"")+"box$3$1"+E+"$2$3$1-ms-$2box$3")+t}break;case 5936:switch(T(t,n+11)){case 114:return E+t+"-ms-"+$(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return E+t+"-ms-"+$(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return E+t+"-ms-"+$(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return E+t+"-ms-"+t+t}var r,a;return t}(e.value,e.length);break;case P:return ue([q(e,{value:$(e.value,"@","@"+E)})],r);case k:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch((n=/(::plac\w+|:read-\w+)/.exec(n=t))?n[0]:n){case":read-only":case":read-write":return ue([q(e,{props:[$(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return ue([q(e,{props:[$(t,/:(plac\w+)/,":"+E+"input-$1")]}),q(e,{props:[$(t,/:(plac\w+)/,":-moz-$1")]}),q(e,{props:[$(t,/:(plac\w+)/,"-ms-input-$1")]})],r)}var n;return""}))}}],ge=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var r,a,i=e.stylisPlugins||he,c={},o=[];r=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n0&&L(w)-m&&B(d>32?le(w+";",a,r,m-1):le($(w," ","")+";",a,r,m-2),l);break;case 59:w+=";";default:if(B(x=oe(w,n,r,u,p,i,s,O,j=[],_=[],m),c),123===v)if(0===p)e(w,n,x,x,j,c,m,s,_);else switch(99===f&&110===T(w,3)?100:f){case 100:case 108:case 109:case 115:e(t,x,x,a&&B(oe(t,x,x,0,0,i,s,O,i,j=[],m),_),i,_,m,s,a?j:_);break;default:e(w,x,x,x,[""],_,0,s,_)}}u=p=d=0,y=g=1,O=w="",m=o;break;case 58:m=1+L(w),d=b;default:if(y<1)if(123==v)--y;else if(125==v&&0==y++&&125==(V=Z>0?T(H,--Z):0,W--,10===V&&(W=1,U--),V))continue;switch(w+=A(v),v*y){case 38:g=p>0?1:(w+="\f",-1);break;case 44:s[u++]=(L(w)-1)*g,g=1;break;case 64:45===X()&&(w+=ne(Y())),f=X(),p=m=L(O=w+=ce(Q())),v++;break;case 45:45===b&&2==L(w)&&(y=0)}}return c}("",null,null,null,[""],e=ee(e),0,[0],e))}(e?e+"{"+t.styles+"}":t.styles),p),r&&(m.inserted[t.name]=!0)};var m={key:t,sheet:new w({key:t,container:r,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:c,registered:{},insert:a};return m.sheet.hydrate(o),m};function ve(e,t,n){var r="";return n.split(" ").forEach((function(n){void 0!==e[n]?t.push(e[n]+";"):r+=n+" "})),r}n(51);var Oe=function(e,t,n){!function(e,t,n){var r=e.key+"-"+t.name;!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles)}(e,t,n);var r=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var a=t;do{e.insert(t===a?"."+r:"",a,e.sheet,!0),a=a.next}while(void 0!==a)}},je={animationIterationCount:1,aspectRatio: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},_e=/[A-Z]|^ms/g,xe=/_EMO_([^_]+?)_([^]*?)_EMO_/g,we=function(e){return 45===e.charCodeAt(1)},Ee=function(e){return null!=e&&"boolean"!=typeof e},Se=O((function(e){return we(e)?e:e.replace(_e,"-$&").toLowerCase()})),ke=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(xe,(function(e,t,n){return Pe={name:t,styles:n,next:Pe},t}))}return 1===je[e]||we(e)||"number"!=typeof t||0===t?t:t+"px"};function Ce(e,t,n){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 Pe={name:n.name,styles:n.styles,next:Pe},n.name;if(void 0!==n.styles){var r=n.next;if(void 0!==r)for(;void 0!==r;)Pe={name:r.name,styles:r.styles,next:Pe},r=r.next;return n.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var a=0;a=4;++r,a-=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(a){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)}(a)+s,styles:a,next:Pe}},Me=(!!v.useInsertionEffect&&v.useInsertionEffect||v.useLayoutEffect,v.createContext("undefined"!=typeof HTMLElement?ge({key:"css"}):null));Me.Provider;var Ne=function(e){return Object(v.forwardRef)((function(t,n){var r=Object(v.useContext)(Me);return e(t,r,n)}))},$e=v.createContext({}),Re=_,Te=function(e){return"theme"!==e},Fe=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?Re:Te},Le=function(e,t,n){var r;if(t){var a=t.shouldForwardProp;r=e.__emotion_forwardProp&&a?function(t){return e.__emotion_forwardProp(t)&&a(t)}:a}return"function"!=typeof r&&n&&(r=e.__emotion_forwardProp),r},De=function(){return null},Be=function e(t,n){var r,a,i=t.__emotion_real===t,c=i&&t.__emotion_base||t;void 0!==n&&(r=n.label,a=n.target);var o=Le(t,n,i),s=o||Fe(c),l=!s("as");return function(){var u=arguments,p=i&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==r&&p.push("label:"+r+";"),null==u[0]||void 0===u[0].raw)p.push.apply(p,u);else{p.push(u[0][0]);for(var m=u.length,f=1;f div {\n\t\tmargin-left: 8px;\n\t}\n\n\tsvg {\n\t\tdisplay: block;\n\n\t\t&:hover {\n\t\t\tcursor: pointer;\n\t\t}\n\t}\n"]))),Ke=Ye(c.Popover)(Ie||(Ie=y()(["\n\t.components-popover__content {\n\t\tpadding: 20px;\n\t\twidth: 200px;\n\t}\n"]))),Je=Ye(c.ToggleControl)(Ze||(Ze=y()(["\n\t&& {\n\t\t.components-base-control__field {\n\t\t\tmargin-bottom: 0;\n\t\t}\n\t}\n"]))),et=n(52),tt=n.n(et),nt=Ye(c.Card)(Ve||(Ve=y()(["\n\tpadding: 30px;\n\n\t&& {\n\t\tbox-shadow: 0 2px 6px 0 rgba( 0, 0, 0, 0.05 );\n\t\tborder: 1px solid #ccc;\n\t\twidth: 100%;\n\t}\n"]))),rt=Ye(c.CardHeader)(He||(He=y()(["\n\t&&& {\n\t\tpadding: 0 0 30px;\n\t}\n\n\th1 {\n\t\tfont-size: 26px;\n\t\tline-height: 1;\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t}\n\n\tsmall {\n\t\tcolor: #c0c0c0;\n\t\tfont-size: 13px;\n\t\tfont-weight: normal;\n\t\tdisplay: block;\n\t\tmargin: 0 0 3px;\n\t}\n"]))),at=Ye(c.CardFooter)(Ge||(Ge=y()(["\n\t&&& {\n\t\tpadding: 30px 0 0;\n\t}\n"]))),it=Ye(c.CardBody)(qe||(qe=y()(["\n\t&&& {\n\t\tpadding: 30px 0;\n\t}\n\n\t> * {\n\t\tmargin: 0 0 2rem;\n\n\t\t&:last-child {\n\t\t\tmargin-bottom: 0;\n\t\t}\n\t}\n\n\t> p {\n\t\tcolor: #555555;\n\t\tfont-size: 15px;\n\t}\n"]))),ct=["title","supTitle","children"];function ot(e){return Object(i.createElement)(nt,e)}function st(e){var t=e.title,n=e.supTitle,r=e.children,a=tt()(e,ct);return Object(i.createElement)(rt,a,Object(i.createElement)("div",null,n&&Object(i.createElement)("small",null,n),t&&Object(i.createElement)("h1",null,t)),r)}function lt(e){return Object(i.createElement)(at,e)}function ut(e){return Object(i.createElement)(it,e)}var pt,mt=simpaySetupWizard.adminUrl;function ft(e){var t=e.isFirst,n=Object(i.useState)(!1),r=a()(n,2),s=r[0],l=r[1];return Object(i.createElement)(c.Flex,{justify:"center"},s&&Object(i.createElement)(c.Modal,{title:Object(o.__)("Are you sure you want to exit the wizard?","stripe"),onRequestClose:function(){return l(!1)}},Object(i.createElement)("p",{style:{marginBottom:"2rem"}},Object(o.__)("Manual setup is only recommended for experienced users.","stripe")),Object(i.createElement)(c.Flex,null,Object(i.createElement)(c.Button,{href:mt,isDestructive:!0,variant:"destructive"},Object(o.__)("Exit Setup Wizard","stripe")),Object(i.createElement)(c.Button,{variant:"primary",isPrimary:!0,onClick:function(){return l(!1)}},Object(o.__)("Continue Setup","stripe")))),Object(i.createElement)(c.Button,{isLink:!0,variant:"link",className:"simpay-setup-wizard-subtle-link",onClick:function(){return l(!0)}},t?Object(o.__)("Go back to the Dashboard","stripe"):Object(o.__)("Close and exit the Setup Wizard","stripe")))}var dt=Ye(c.Button)(pt||(pt=y()(["\n\t&& {\n\t\tfont-size: 16px;\n\t\tfont-weight: bold;\n\t\tpadding: 15px 30px !important;\n\t\theight: auto;\n\t}\n"]))),bt=Object(i.forwardRef)((function(e,t){return Object(i.createElement)(dt,g()({isPrimary:!0,variant:"primary"},e,{ref:t}))}));function yt(e){return e.width,Object(i.createElement)("svg",{width:"311",height:"41",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(i.createElement)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.352 0C1.052 0 0 1.02 0 2.277v30.746C0 34.281 1.053 35.3 2.352 35.3h28.806c.975 0 1.764-.764 1.764-1.708 0-.943-.79-1.708-1.763-1.708H5.29c-.974 0-1.764-.765-1.764-1.708v-17.08c0-.944.79-1.709 1.764-1.709h44.092c1.299 0 2.352-1.02 2.352-2.277V2.277C51.735 1.02 50.682 0 49.383 0H2.352Zm55.262 24.198h-1.47v-1.993c0-4.088-3.422-7.402-7.643-7.402-4.22 0-7.642 3.314-7.642 7.402v1.993H38.8c-1.299 0-2.352 1.02-2.352 2.277v11.387c0 1.258 1.053 2.278 2.352 2.278h18.813c1.299 0 2.351-1.02 2.351-2.278V26.475c0-1.258-1.053-2.277-2.351-2.277Zm-4.997-1.993v1.993h-8.23v-1.993c0-2.201 1.842-3.985 4.114-3.985 2.273 0 4.116 1.784 4.116 3.985ZM8.23 20.497c0-.629.526-1.139 1.175-1.139H28.22c.65 0 1.176.51 1.176 1.139s-.527 1.139-1.176 1.139H9.406c-.649 0-1.175-.51-1.175-1.139Zm0 5.124c0-.629.526-1.138 1.175-1.138h7.055c.65 0 1.176.51 1.176 1.138 0 .63-.527 1.139-1.176 1.139H9.406c-.649 0-1.175-.51-1.175-1.139Zm31.158 11.672V27.045h17.637v10.248H39.389Z",fill:"#428BCA"}),Object(i.createElement)("path",{d:"M81.08 30.745h5.288l5.41-17.186 5.596 17.187h5.289l7.84-24.29h-5.288l-5.289 17.956L94.7 6.457h-5.842L83.785 24.38 78.528 6.457h-5.289l7.84 24.288Zm31.511 0h4.796v-8.793h6.456c5.319 0 8.302-3.228 8.302-7.963 0-4.735-2.983-7.532-8.302-7.532h-11.252v24.288Zm4.796-13.405V11.1h5.288c2.952 0 4.52 1.168 4.52 3.104 0 1.968-1.507 3.136-4.366 3.136h-5.442Zm35.473 13.897c6.303 0 10.023-3.197 10.023-7.747 0-10.3-14.789-4.581-14.789-10.085 0-1.906 1.599-3.013 4.52-3.013 2.859 0 4.519 1.322 4.704 3.567h5.288c0-4.92-4.089-7.994-9.9-7.994-5.872 0-9.562 2.89-9.562 7.502 0 10.268 14.758 4.642 14.758 10.084 0 1.998-1.752 3.26-4.919 3.26-3.228 0-5.073-1.6-5.165-4.305h-5.381c0 5.503 4.274 8.731 10.423 8.731Zm15.137-18.447c1.66 0 2.89-1.23 2.89-2.89 0-1.66-1.23-2.829-2.89-2.829-1.691 0-2.921 1.169-2.921 2.83 0 1.66 1.23 2.89 2.921 2.89Zm-2.306 17.956h4.581V14.758h-4.581v15.988Zm7.696-.001h4.55v-8.178c0-2.644 1.384-4.366 3.597-4.366 1.968 0 3.136 1.415 3.136 3.751v8.793h4.612v-8.178c0-2.644 1.384-4.366 3.597-4.366 1.968 0 3.136 1.415 3.136 3.751v8.793h4.643v-9.039c0-4.888-1.968-7.44-5.965-7.44-2.459 0-4.642.86-6.21 3.044-.892-2.03-2.583-3.044-5.135-3.044-2.552 0-4.335 1.076-5.411 2.798v-2.306h-4.55v15.988Zm30.183 6.15h4.551v-8.24c1.106 1.63 2.859 2.582 5.38 2.582 4.028 0 6.887-3.504 6.887-8.424 0-5.011-2.859-8.547-6.887-8.547-2.521 0-4.274.953-5.38 2.583v-2.091h-4.551v22.137Zm8.363-9.593c-2.244 0-3.843-1.875-3.843-4.52 0-2.674 1.599-4.58 3.843-4.58 2.275 0 3.874 1.906 3.874 4.58 0 2.645-1.599 4.52-3.874 4.52Zm10.651 3.443h4.551V6.457h-4.551v24.288Zm15.443.492c3.905 0 6.918-2.213 7.41-5.688h-4.551c-.184 1.107-1.229 1.968-2.828 1.968-2.368 0-3.536-1.353-3.751-3.412h11.222v-1.476c0-5.104-3.259-8.363-7.502-8.363-4.919 0-8.363 3.505-8.363 8.455 0 4.98 3.444 8.516 8.363 8.516Zm-3.689-9.93c.276-1.845 1.352-3.106 3.505-3.106 1.937 0 3.013 1.322 3.105 3.106h-6.61Zm22.358 9.438h4.796v-8.793h6.457c5.319 0 8.301-3.228 8.301-7.963 0-4.735-2.982-7.532-8.301-7.532h-11.253v24.288Zm4.796-13.405V11.1h5.288c2.952 0 4.52 1.168 4.52 3.104 0 1.968-1.507 3.136-4.366 3.136h-5.442Zm20.704 13.897c2.736 0 4.458-1.23 5.257-3.228.4 2.183 2.152 3.413 5.688 2.613v-3.259c-1.261.123-1.507-.338-1.507-1.66v-5.411c0-3.782-2.644-6.026-7.317-6.026-4.612 0-7.317 2.275-7.317 6.118h4.488c0-1.383 1.015-2.183 2.768-2.183 1.906 0 2.859.769 2.828 2.091v.492l-3.659.43c-4.519.523-7.071 2.368-7.071 5.258 0 2.429 1.722 4.765 5.842 4.765Zm.922-3.382c-1.414 0-2.183-.645-2.183-1.63 0-1.167 1.507-1.629 4.397-1.998l1.568-.153c-.277 2.152-1.599 3.781-3.782 3.781Zm11.126 9.04h1.967c3.936 0 6.641-1.077 8.271-4.981L311 14.758h-4.766l-3.996 10.669-4.797-10.67h-4.796l7.225 16.234c-1.014 1.446-2.06 1.907-4.058 1.876h-1.568v4.028Z",fill:"#428BCA"}))}var ht=n(17);function gt(e){var t=Object(ht.useSelect)((function(e){return Object(u.filter)(e("core/notices").getNotices(),{type:"snackbar"})}),[]),n=Object(ht.useDispatch)("core/notices").removeNotice;return 0===t.length?null:Object(i.createElement)(c.SnackbarList,g()({onRemove:n,notices:t},e))}var vt,Ot,jt,_t,xt,wt=n(64),Et=Ye.div(vt||(vt=y()(["\n\tmax-width: 80%;\n\tdisplay: flex;\n\talign-items: center;\n\n\t> * {\n\t\tmargin-right: 8px;\n\n\t\t&:last-child {\n\t\t\tmargin-right: 0;\n\t\t}\n\t}\n"]))),St={current:"var(--wp-admin-theme-color)",complete:"var(--wp-admin-theme-color)",incomplete:"#c0c0c0"},kt=Ye.div(Ot||(Ot=y()(["\n\twidth: 16px;\n\theight: 16px;\n\tborder-radius: 50%;\n\tbackground-color: ",";\n\tflex-shrink: 0;\n\tposition: relative;\n\ttransition: backgroundColor 0.2s ease-in-out;\n\n\tsvg {\n\t\tfill: #fff;\n\t\tposition: absolute;\n\t\tleft: -1px;\n\t\ttop: -1px;\n\t\ttransition: opacity 0.2s ease-in-out;\n\t\topacity: ",";\n\t}\n\n\tdiv {\n\t\topacity: ",";\n\t}\n\n\tpath {\n\t\tstroke: #fff;\n\t}\n"])),(function(e){return St[e.status]}),(function(e){return e.isComplete?"1":"0"}),(function(e){var t=e.isCurrent,n=e.isComplete;return t&&!n?"1":"0"})),Ct=Ye.div(jt||(jt=y()(["\n\twidth: 6px;\n\theight: 6px;\n\tbackground-color: #f0f0f1;\n\tborder-radius: 50%;\n\tposition: absolute;\n\ttop: 5px;\n\tleft: 5px;\n\ttransition: opacity 0.2s ease-in-out;\n"]))),Pt=Ye.div(_t||(_t=y()(["\n\twidth: 100%;\n\theight: 2px;\n\tbackground-color: rgba( 192, 192, 192, 0.5 );\n\twidth: 100px;\n"])));function zt(e){for(var t=e.current,n=e.total,r=[],a=1;a<=n;a++){var c="incomplete";a * {\n\t\tmargin: 25px 0;\n\t}\n"])));function Nt(e){return Object(i.createElement)(Mt,e)}var $t=Ye(c.Button)(At||(At=y()(["\n\t&&&& {\n\t\tfont-size: 16px;\n\t\tfont-weight: bold;\n\t\tpadding: 13px 30px 12px !important;\n\t\theight: auto;\n\t\tbackground-color: #635bff;\n\n\t\t&:focus {\n\t\t\tbackground-color: #635bff;\n\t\t\tbox-shadow: inset 0 0 0 1px #fff,\n\t\t\t\t0 0 0 var( --wp-admin-border-width-focus ) #635bff;\n\t\t}\n\n\t\t&:hover {\n\t\t\tbackground-color: #0a2540 !important;\n\t\t}\n\n\t\t&:focus:hover {\n\t\t\tbox-shadow: inset 0 0 0 1px #fff,\n\t\t\t\t0 0 0 var( --wp-admin-border-width-focus ) #0a2540;\n\t\t}\n\n\t\tsvg {\n\t\t\tmargin-left: 5px;\n\t\t}\n\t}\n"]))),Rt=Object(i.forwardRef)((function(e,t){return Object(i.createElement)($t,g()({isPrimary:!0,variant:"primary"},e,{ref:t}))}));function Tt(){return Object(i.createElement)("svg",{width:56,height:23,fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(i.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M55.742 11.884c0-3.93-1.92-7.032-5.59-7.032-3.684 0-5.914 3.101-5.914 7.001 0 4.622 2.632 6.955 6.41 6.955 1.843 0 3.236-.414 4.29-.998v-3.07c-1.053.522-2.261.844-3.794.844-1.502 0-2.834-.522-3.004-2.334h7.572c0-.2.03-.998.03-1.366Zm-7.649-1.459c0-1.735 1.069-2.456 2.044-2.456.945 0 1.951.721 1.951 2.456h-3.995Zm-9.832-5.573c-1.517 0-2.493.706-3.035 1.197l-.201-.952h-3.407V23l3.871-.814.016-4.345c.557.4 1.378.967 2.74.967 2.772 0 5.296-2.21 5.296-7.078-.015-4.452-2.57-6.878-5.28-6.878Zm-.929 10.579c-.913 0-1.456-.323-1.827-.722l-.016-5.696c.403-.446.96-.753 1.843-.753 1.41 0 2.385 1.566 2.385 3.578 0 2.057-.96 3.593-2.385 3.593ZM26.292 3.946l3.886-.83V0l-3.886.814v3.132Zm0 1.167h3.886v13.434h-3.886V5.113Zm-4.165 1.136-.248-1.136h-3.345v13.434h3.871V9.443c.914-1.183 2.462-.968 2.942-.799V5.113c-.495-.184-2.307-.522-3.22 1.136Zm-7.742-4.468-3.778.798-.016 12.299c0 2.272 1.719 3.946 4.01 3.946 1.27 0 2.2-.23 2.71-.507V15.2c-.495.2-2.942.906-2.942-1.366v-5.45h2.942V5.112H14.37l.016-3.332ZM3.917 9.013c0-.6.496-.83 1.317-.83 1.176 0 2.663.354 3.84.983V5.558c-1.286-.507-2.555-.706-3.84-.706C2.09 4.852 0 6.479 0 9.197c0 4.238 5.884 3.562 5.884 5.39 0 .705-.62.936-1.487.936-1.285 0-2.926-.522-4.227-1.229v3.655c1.44.614 2.896.875 4.227.875 3.221 0 5.435-1.582 5.435-4.33-.015-4.575-5.915-3.762-5.915-5.481Z",fill:"#fff"}))}var Ft=n(11),Lt=n.n(Ft);function Dt(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 Bt(e){for(var t=1;tWP Simple Pay account or purchase receipt email.","stripe"),{strong:Object(i.createElement)("strong",null),a:Object(i.createElement)("a",{href:Jt,target:"_blank",rel:"noopener noreferrer"})})),Object(i.createElement)(c.TextControl,{label:Object(o.__)("License Key","stripe"),value:l,className:_,onChange:function(e){return u(e)},disabled:d,help:g||Object(o.__)("An active license ensures automatic updates and the latest features.","stripe"),ref:j})),Object(i.createElement)(lt,{justify:"flex-end",align:"center"},Object(i.createElement)(bt,{onClick:function(){b(!0);var e=new FormData;e.append("action","simpay_activate_license"),e.append("nonce",en),e.append("license",l),m()({url:Kt,method:"POST",body:e}).then((function(e){var r=e.success,a=e.data,i=a.message,c=a.license;if(!r)throw{message:i};n(c),O(Object(o.__)("License activated","stripe"),{type:"snackbar"}),b(!1),t()})).catch((function(e){var t=e.message;v(t),b(!1)}))},disabled:""===l||d,isBusy:d},Object(o.__)("Activate and Continue →","stripe"))))}},{id:"stripe",title:Object(o.__)("Connect to Stripe","stripe"),content:wn},{id:"emails",title:Object(o.__)("Configure Emails","stripe"),content:function(e){var t=e.goPrev,n=e.goNext,r=e.licenseData,a=Wt(),s=a.settings,l=a.rawSettings,p=a.discardChanges,m=a.editSettings,f=a.saveSettings,d=Object(i.useRef)();if(Object(i.useLayoutEffect)((function(){d.current&&d.current.focus()}),[l]),Object(u.isEmpty)(s))return Object(i.createElement)(ut,null,Object(i.createElement)(c.Spinner,null));var b=s["email_payment-confirmation"],y=s["email_payment-notification"],h=s["email_payment-notification_to"],g=s["email_upcoming-invoice"],v=s["email_invoice-confirmation"],O=r.features,j=O.subscriptions,_=O.enhanced_subscriptions;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(ut,null,Object(i.createElement)("ul",{className:"simpay-setup-wizard-toggle-list"},Object(i.createElement)("li",null,Object(i.createElement)("label",{htmlFor:"email_payment-confirmation"},Object(i.createElement)("h3",null,Object(o.__)("Payment Receipt","stripe")),Object(i.createElement)("p",null,Object(o.__)("Send a payment receipt email to the customer upon successful payment.","stripe"))),Object(i.createElement)(c.FormToggle,{id:"email_payment-confirmation",checked:"no"!==b,onChange:function(e){var t=e.target;return m({"email_payment-confirmation":t.checked?"yes":"no"})}})),Object(i.createElement)("li",null,Object(i.createElement)("label",{htmlFor:"email_payment-notification"},Object(i.createElement)("h3",null,Object(o.__)("Payment Notification","stripe")),Object(i.createElement)("p",null,Object(o.__)("Receive an email notification when a new payment is made.","stripe"))),Object(i.createElement)(c.FormToggle,{id:"email_payment-notification",checked:"no"!==y,onChange:function(e){var t=e.target;return m({"email_payment-notification":t.checked?"yes":"no"})}})),"no"!==y&&Object(i.createElement)("li",{className:"simpay-setup-wizard-toggle-list__child"},Object(i.createElement)(c.TextControl,{label:Object(o.__)("Send to:","stripe"),value:h,onChange:function(e){return m({"email_payment-notification_to":e})}})),_&&Object(i.createElement)("li",null,Object(i.createElement)("label",{htmlFor:"email_invoice-confirmation"},Object(i.createElement)("h3",null,Object(o.__)("Invoice Receipt","stripe")),Object(i.createElement)("p",null,Object(o.__)("Send a payment receipt email to the customer upon successful invoice.","stripe"))),Object(i.createElement)(c.FormToggle,{id:"email_payment-confirmation",checked:"no"!==v,onChange:function(e){var t=e.target;return m({"email_invoice-confirmation":t.checked?"yes":"no"})}})),j&&Object(i.createElement)("li",null,Object(i.createElement)("label",{htmlFor:"email_upcoming-invoice"},Object(i.createElement)("h3",null,Object(o.__)("Upcoming Invoice","stripe")),Object(i.createElement)("p",null,Object(o.__)("Remind customers of upcoming invoices and allow payment method changes.","stripe"))),Object(i.createElement)(c.FormToggle,{id:"email_upcoming-invoice",checked:"no"!==g,onChange:function(e){var t=e.target;return m({"email_upcoming-invoice":t.checked?"yes":"no"})}})))),Object(i.createElement)(lt,{justify:"space-between",align:"center"},Object(i.createElement)("div",null,Object(i.createElement)(c.Button,{isLink:!0,variant:"link",onClick:t,className:"simpay-setup-wizard-subtle-link"},Object(o.__)("← Previous Step","stripe"))),Object(i.createElement)("div",{style:{display:"flex",justifyContent:"center"}},Object(i.createElement)(c.Button,{isLink:!0,variant:"link",onClick:function(){p(),n()},style:{marginRight:"16px"},className:"simpay-setup-wizard-subtle-link"},Object(o.__)("Skip Step","stripe")),Object(i.createElement)(bt,{onClick:function(){f(),n()},ref:d},Object(o.__)("Save and Continue →","stripe")))))}},{id:"next-steps",title:Object(o.__)("🎉 Setup Complete","stripe"),content:function(){return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(ut,null,Object(i.createElement)("div",{className:"simpay-setup-wizard-content-list"},Object(i.createElement)("div",{className:"simpay-setup-wizard-content-list__content"},Object(i.createElement)("p",null,Object(o.__)("Congratulations, you’re ready to start accepting payments!","stripe")),Object(i.createElement)("p",null,Object(o.__)("WP Simple Pay is just that: simple. Create your first payment form below to start collecting payments, or fine-tune your setup through some of these suggestions:","stripe"))),Object(i.createElement)("div",{className:"simpay-setup-wizard-content-list__list"},Object(i.createElement)("ul",{className:"simpay-setup-wizard-bullet-list"},Object(i.createElement)("li",null,Object(i.createElement)("a",{href:bn,target:"_blank",rel:"noopener noreferrer"},Object(o.__)("Collect tax or GST","stripe"))),Object(i.createElement)("li",null,Object(i.createElement)("a",{href:yn,target:"_blank",rel:"noopener noreferrer"},Object(o.__)("Add anti-spam protection","stripe"))),Object(i.createElement)("li",null,Object(i.createElement)("a",{href:hn,target:"_blank",rel:"noopener noreferrer"},Object(o.__)("Change the default currency","stripe"))),Object(i.createElement)("li",null,Object(i.createElement)("a",{href:gn,target:"_blank",rel:"noopener noreferrer"},Object(o.__)("Customize receipts","stripe")))))),Object(i.createElement)("hr",null),Object(i.createElement)("div",{className:"simpay-setup-wizard-doc-suggestions"},Object(i.createElement)("div",null,Object(i.createElement)("h3",null,Object(o.__)("Accept Donations","stripe")),Object(i.createElement)("p",null,Object(o.__)("Easily fundraise or accept donations online via 135+ supported currencies. Offer one-time or recurring donations of fixed or user-defined amounts.","stripe")),Object(i.createElement)(c.Button,{href:vn,variant:"secondary",isSecondary:!0,target:"_blank",rel:"noopener noreferrer"},Object(o.__)("View Walkthrough","stripe"))),Object(i.createElement)("div",null,Object(i.createElement)("h3",null,Object(o.__)("Reconcile Invoices","stripe")),Object(i.createElement)("p",null,Object(o.__)("Collect additional custom data on your payment forms such as an Invoice ID to reconcile invoices against your own invoicing system.","stripe")),Object(i.createElement)(c.Button,{href:On,variant:"secondary",isSecondary:!0,target:"_blank",rel:"noopener noreferrer"},Object(o.__)("View Walkthrough","stripe"))))),Object(i.createElement)(lt,{justify:"space-between",align:"center"},Object(i.createElement)("div",{style:{flexBasis:"100%"}},Object(i.createElement)(c.Button,{isLink:!0,variant:"link",href:fn,className:"simpay-setup-wizard-subtle-link",icon:Object(i.createElement)(f.a,{icon:rn})},Object(o.__)("Return to Dashboard","stripe"))),Object(i.createElement)(c.Flex,{justify:"flex-end",gap:4},Object(i.createElement)(bt,{href:dn},Object(o.__)("Create a Payment Form →","stripe")))))}}],lite:[{id:"stripe",title:Object(o.__)("Connect to Stripe","stripe"),content:wn},{id:"analytics",title:Object(o.__)("Help Improve WP Simple Pay + Smart Recommendations","stripe"),content:function(e){var t=e.goPrev,n=e.goNext,r=Wt(),s=r.settings,l=r.rawSettings,p=r.discardChanges,b=r.editSettings,y=r.saveSettings,h=Object(i.useState)(!0),g=a()(h,2),v=g[0],O=g[1],j=Object(i.useState)(Ht),_=a()(j,2),x=_[0],w=_[1],E=Object(i.useState)(!1),S=a()(E,2),k=S[0],C=S[1],P=Object(i.useState)(!1),z=a()(P,2),A=z[0],M=z[1],N=Object(i.useRef)();return Object(i.useLayoutEffect)((function(){N.current&&N.current.focus()}),[l]),Object(u.isEmpty)(s)?Object(i.createElement)(ut,null,Object(i.createElement)(c.Spinner,null)):Object(i.createElement)(i.Fragment,null,Object(i.createElement)(ut,null,Object(i.createElement)("p",null,Object(o.__)("Get helpful suggestions from WP Simple Pay on how to optimize your payment forms and grow your business or increase donations.","stripe")),Object(i.createElement)(c.TextControl,{label:Object(o.__)("Your Email Address:","stripe"),value:x,className:"simpay-setup-wizard-large-input",onChange:function(e){return w(e)},help:Object(o.__)("Your email is needed so you receive recommendations.","stripe"),ref:N,disabled:k}),Object(i.createElement)("hr",null),Object(i.createElement)(Xe,null,Object(i.createElement)(Qe,null,Object(o.__)("Help make WP Simple Pay better for everyone","stripe"),Object(i.createElement)("div",null,A&&Object(i.createElement)(Ke,{position:"top center"},Object(o.__)("By allowing us to track usage data we can better help you because we know which WordPress configurations, themes, and plugins we should test.","stripe")),Object(i.createElement)(f.a,{size:20,icon:d.a,onMouseEnter:function(){return M(!0)},onMouseLeave:function(){return M(!1)}}))),Object(i.createElement)(Je,{label:Object(o.__)("Yes, count me in","stripe"),id:"email_payment-confirmation",checked:v,disabled:k,onChange:function(e){O(e)}}))),Object(i.createElement)(lt,{justify:"space-between",align:"center"},Object(i.createElement)("div",null,Object(i.createElement)(c.Button,{isLink:!0,variant:"link",onClick:t,className:"simpay-setup-wizard-subtle-link",disabled:k},Object(o.__)("← Previous Step","stripe"))),Object(i.createElement)("div",{style:{display:"flex",justifyContent:"center"}},Object(i.createElement)(c.Button,{isLink:!0,variant:"link",onClick:function(){p(),n()},style:{marginRight:"16px"},className:"simpay-setup-wizard-subtle-link",disabled:k},Object(o.__)("Skip Step","stripe")),Object(i.createElement)(bt,{onClick:function(){C(!0),b({usage_tracking_opt_in:v?"yes":"no"}),y();var e=new FormData;e.append("action","simpay_setup_wizard_subscribe_email"),e.append("nonce",Gt),e.append("email",x),m()({url:qt,method:"POST",body:e}).finally((function(){C(!1),n()}))},isBusy:k,disabled:k},Object(o.__)("Save and Continue →","stripe")))))}},{id:"next-steps",title:Object(o.__)("🎉 Setup Complete","stripe"),content:function(){return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(ut,null,Object(i.createElement)(c.Flex,{justify:"space-between",align:"center",className:"simpay-setup-wizard-content-list"},Object(i.createElement)("div",{className:"simpay-setup-wizard-content-list__content"},Object(i.createElement)("p",null,Object(o.__)("Congratulations, you’re ready to start easily and securely accepting payments with WP Simple Pay!","stripe"))),Object(i.createElement)("div",null,Object(i.createElement)(bt,{href:ln},Object(o.__)("Create a Payment Form →","stripe")))),Object(i.createElement)("hr",null),Object(i.createElement)(an,null,Object(i.createElement)("h4",null,Object(o.__)("Special Upgrade Offer - Save 50%","stripe")),Object(i.createElement)("h3",null,Object(o.__)("Upgrade to WP Simple Pay Pro Today and Save","stripe")),Object(i.createElement)(cn,{className:"simpay-setup-wizard-check-list"},pn.map((function(e){return Object(i.createElement)("li",{key:e},Object(i.createElement)(f.a,{icon:wt.a}),e)}))),Object(i.createElement)(c.Button,{isLarge:!0,isSecondary:!0,variant:"secondary",href:un,target:"_blank",rel:"noopener noreferrer"},Object(o.__)("Upgrade to WP Simple Pay Pro","stripe")))),Object(i.createElement)(lt,{justify:"center"},Object(i.createElement)(c.Button,{isLink:!0,variant:"link",href:sn,className:"simpay-setup-wizard-subtle-link",icon:Object(i.createElement)(f.a,{icon:rn})},Object(o.__)("Return to Dashboard","stripe"))))}}]},Cn=simpaySetupWizard,Pn=Cn.license,zn=Cn.adminUrl,An=Pn.is_lite;Object(i.render)(Object(i.createElement)((function(){var e=kn[!0===An?"lite":"pro"],t=Object(s.getQueryArg)(window.location.href,"step"),n=Object(i.useState)(Pn),r=a()(n,2),u=r[0],p=r[1],m=function(e){var t=e.steps,n=e.currentStepId,r=t.findIndex((function(e){return e.id===n}))||0,c=Object(i.useState)(r),o=a()(c,2),l=o[0],u=o[1];function p(e){u(e),window.history.pushState({},"",Object(s.addQueryArgs)(window.location.href,{step:t[e].id}))}return Object(i.useEffect)((function(){var e=function(){var e=Object(s.getQueryArg)(window.location.search,"step"),n=t.findIndex((function(t){return t.id===e}))||0;u(n)};return window.addEventListener("popstate",e),window.addEventListener("pushstate",e),function(){window.removeEventListener("popstate",e),window.removeEventListener("pushstate",e)}}),[]),{currentStep:l,setCurrentStep:u,hasNext:l0}}({steps:e,currentStepId:t}),f=m.currentStep,d=m.goNext,b=m.goPrev,y=m.hasNext,h=m.hasPrev;if(-1===f)return Object(i.createElement)(Sn,{steps:e,goNext:d});var g=e[f],v=g.content;return Object(i.createElement)(c.SlotFillProvider,null,Object(i.createElement)(l.EntityProvider,{kind:"root",type:"site"},Object(i.createElement)(Nt,null,Object(i.createElement)("a",{href:zn},Object(i.createElement)(yt,{width:"250px"})),Object(i.createElement)(zt,{current:f+1,total:e.length}),Object(i.createElement)(ot,{isRounded:!0},Object(i.createElement)(st,{supTitle:Object(o.sprintf)(/* translators: %1$d current step count. %2$d total step count*/ +!function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.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 a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));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=77)}([function(e,t){e.exports=window.wp.element},,function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wp.components},,function(e,t){e.exports=window.React},function(e,t,n){var r=n(26),a=n(27),i=n(22),c=n(28);e.exports=function(e,t){return r(e)||a(e,t)||i(e,t)||c()},e.exports.__esModule=!0,e.exports.default=e.exports},,,function(e,t){e.exports=window.wp.primitives},function(e,t){e.exports=window.wp.url},function(e,t,n){var r=n(30);e.exports=function(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=window.lodash},function(e,t,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function a(){for(var e=[],t=0;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i},e.exports.__esModule=!0,e.exports.default=e.exports},,,,,,,,function(e,t){e.exports=window.wp.notices},function(e,t,n){"use strict";e.exports=n(62)},function(e,t,n){"use strict";var r="function"==typeof Symbol&&Symbol.for,a=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,c=r?Symbol.for("react.fragment"):60107,o=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,p=r?Symbol.for("react.async_mode"):60111,m=r?Symbol.for("react.concurrent_mode"):60111,f=r?Symbol.for("react.forward_ref"):60112,d=r?Symbol.for("react.suspense"):60113,b=r?Symbol.for("react.suspense_list"):60120,y=r?Symbol.for("react.memo"):60115,h=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,j=r?Symbol.for("react.scope"):60119;function _(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case a:switch(e=e.type){case p:case m:case c:case s:case o:case d:return e;default:switch(e=e&&e.$$typeof){case u:case f:case h:case y:case l:return e;default:return t}}case i:return t}}}function x(e){return _(e)===m}t.AsyncMode=p,t.ConcurrentMode=m,t.ContextConsumer=u,t.ContextProvider=l,t.Element=a,t.ForwardRef=f,t.Fragment=c,t.Lazy=h,t.Memo=y,t.Portal=i,t.Profiler=s,t.StrictMode=o,t.Suspense=d,t.isAsyncMode=function(e){return x(e)||_(e)===p},t.isConcurrentMode=x,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===a},t.isForwardRef=function(e){return _(e)===f},t.isFragment=function(e){return _(e)===c},t.isLazy=function(e){return _(e)===h},t.isMemo=function(e){return _(e)===y},t.isPortal=function(e){return _(e)===i},t.isProfiler=function(e){return _(e)===s},t.isStrictMode=function(e){return _(e)===o},t.isSuspense=function(e){return _(e)===d},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===c||e===m||e===s||e===o||e===d||e===b||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===y||e.$$typeof===l||e.$$typeof===u||e.$$typeof===f||e.$$typeof===v||e.$$typeof===O||e.$$typeof===j||e.$$typeof===g)},t.typeOf=_},function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r=0||(a[n]=e[n]);return a},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";var r=n(0),a=n(9);const i=Object(r.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(a.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}));t.a=i},function(e,t,n){"use strict";var r=n(0),a=n(9);const i=Object(r.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(a.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"}));t.a=i},,,,,,,,,,,,function(e,t,n){"use strict";n.r(t);var r=n(6),a=n.n(r),i=n(0),c=(n(60),n(3)),o=n(2),s=n(10),l=n(37),u=n(12),p=n(25),m=n.n(p),f=n(44),d=n(65),b=n(18),y=n.n(b),h=n(15),g=n.n(h),v=n(5);function O(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var j=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|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|enterKeyHint|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|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|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)-.*))$/,_=O((function(e){return j.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}));function x(){return(x=Object.assign?Object.assign.bind():function(e){for(var t=1;t2||J(V)>3?"":" "}function ae(e,t){for(;--t&&Y()&&!(V<48||V>102||V>57&&V<65||V>70&&V<97););return K(e,Q()+(t<6&&32==X()&&32==Y()))}function ie(e,t){for(;Y()&&e+V!==57&&(e+V!==84||47!==X()););return"/*"+K(t,Z-1)+"*"+A(47===e?e:Y())}function ce(e){for(;!J(X());)Y();return K(e,Z)}function oe(e,t,n,r,a,i,c,o,s,l,u){for(var p=a-1,m=0===a?i:[""],f=D(m),d=0,b=0,y=0;d0?m[h]+" "+g:$(g,/&\f/g,m[h])))&&(s[y++]=v);return G(e,t,n,0===a?k:o,s,l,u)}function se(e,t,n){return G(e,t,n,S,A(V),F(e,2,-2),0)}function le(e,t,n,r){return G(e,t,n,C,F(e,0,r),F(e,r+1,-1),r)}function ue(e,t){for(var n="",r=D(e),a=0;a-1&&!e.return)switch(e.type){case C:e.return=function e(t,n){switch(a=n,45^T(r=t,0)?(((a<<2^T(r,0))<<2^T(r,1))<<2^T(r,2))<<2^T(r,3):0){case 5103:return E+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return E+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return E+t+"-moz-"+t+"-ms-"+t+t;case 6828:case 4268:return E+t+"-ms-"+t+t;case 6165:return E+t+"-ms-flex-"+t+t;case 5187:return E+t+$(t,/(\w+).+(:[^]+)/,E+"box-$1$2-ms-flex-$1$2")+t;case 5443:return E+t+"-ms-flex-item-"+$(t,/flex-|-self/,"")+t;case 4675:return E+t+"-ms-flex-line-pack"+$(t,/align-content|flex-|-self/,"")+t;case 5548:return E+t+"-ms-"+$(t,"shrink","negative")+t;case 5292:return E+t+"-ms-"+$(t,"basis","preferred-size")+t;case 6060:return E+"box-"+$(t,"-grow","")+E+t+"-ms-"+$(t,"grow","positive")+t;case 4554:return E+$(t,/([^-])(transform)/g,"$1"+E+"$2")+t;case 6187:return $($($(t,/(zoom-|grab)/,E+"$1"),/(image-set)/,E+"$1"),t,"")+t;case 5495:case 3959:return $(t,/(image-set\([^]*)/,E+"$1$`$1");case 4968:return $($(t,/(.+:)(flex-)?(.*)/,E+"box-pack:$3-ms-flex-pack:$3"),/s.+-b[^;]+/,"justify")+E+t+t;case 4095:case 3583:case 4068:case 2532:return $(t,/(.+)-inline(.+)/,E+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(L(t)-1-n>6)switch(T(t,n+1)){case 109:if(45!==T(t,n+4))break;case 102:return $(t,/(.+:)(.+)-([^]+)/,"$1"+E+"$2-$3$1-moz-"+(108==T(t,n+3)?"$3":"$2-$3"))+t;case 115:return~R(t,"stretch")?e($(t,"stretch","fill-available"),n)+t:t}break;case 4949:if(115!==T(t,n+1))break;case 6444:switch(T(t,L(t)-3-(~R(t,"!important")&&10))){case 107:return $(t,":",":"+E)+t;case 101:return $(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+E+(45===T(t,14)?"inline-":"")+"box$3$1"+E+"$2$3$1-ms-$2box$3")+t}break;case 5936:switch(T(t,n+11)){case 114:return E+t+"-ms-"+$(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return E+t+"-ms-"+$(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return E+t+"-ms-"+$(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return E+t+"-ms-"+t+t}var r,a;return t}(e.value,e.length);break;case P:return ue([q(e,{value:$(e.value,"@","@"+E)})],r);case k:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch((n=/(::plac\w+|:read-\w+)/.exec(n=t))?n[0]:n){case":read-only":case":read-write":return ue([q(e,{props:[$(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return ue([q(e,{props:[$(t,/:(plac\w+)/,":"+E+"input-$1")]}),q(e,{props:[$(t,/:(plac\w+)/,":-moz-$1")]}),q(e,{props:[$(t,/:(plac\w+)/,"-ms-input-$1")]})],r)}var n;return""}))}}],ge=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var r,a,i=e.stylisPlugins||he,c={},o=[];r=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n0&&L(w)-m&&B(d>32?le(w+";",a,r,m-1):le($(w," ","")+";",a,r,m-2),l);break;case 59:w+=";";default:if(B(x=oe(w,n,r,u,p,i,s,O,j=[],_=[],m),c),123===v)if(0===p)e(w,n,x,x,j,c,m,s,_);else switch(99===f&&110===T(w,3)?100:f){case 100:case 108:case 109:case 115:e(t,x,x,a&&B(oe(t,x,x,0,0,i,s,O,i,j=[],m),_),i,_,m,s,a?j:_);break;default:e(w,x,x,x,[""],_,0,s,_)}}u=p=d=0,y=g=1,O=w="",m=o;break;case 58:m=1+L(w),d=b;default:if(y<1)if(123==v)--y;else if(125==v&&0==y++&&125==(V=Z>0?T(H,--Z):0,W--,10===V&&(W=1,U--),V))continue;switch(w+=A(v),v*y){case 38:g=p>0?1:(w+="\f",-1);break;case 44:s[u++]=(L(w)-1)*g,g=1;break;case 64:45===X()&&(w+=ne(Y())),f=X(),p=m=L(O=w+=ce(Q())),v++;break;case 45:45===b&&2==L(w)&&(y=0)}}return c}("",null,null,null,[""],e=ee(e),0,[0],e))}(e?e+"{"+t.styles+"}":t.styles),p),r&&(m.inserted[t.name]=!0)};var m={key:t,sheet:new w({key:t,container:r,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:c,registered:{},insert:a};return m.sheet.hydrate(o),m};function ve(e,t,n){var r="";return n.split(" ").forEach((function(n){void 0!==e[n]?t.push(e[n]+";"):r+=n+" "})),r}n(51);var Oe=function(e,t,n){!function(e,t,n){var r=e.key+"-"+t.name;!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles)}(e,t,n);var r=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var a=t;do{e.insert(t===a?"."+r:"",a,e.sheet,!0),a=a.next}while(void 0!==a)}},je={animationIterationCount:1,aspectRatio: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},_e=/[A-Z]|^ms/g,xe=/_EMO_([^_]+?)_([^]*?)_EMO_/g,we=function(e){return 45===e.charCodeAt(1)},Ee=function(e){return null!=e&&"boolean"!=typeof e},Se=O((function(e){return we(e)?e:e.replace(_e,"-$&").toLowerCase()})),ke=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(xe,(function(e,t,n){return Pe={name:t,styles:n,next:Pe},t}))}return 1===je[e]||we(e)||"number"!=typeof t||0===t?t:t+"px"};function Ce(e,t,n){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 Pe={name:n.name,styles:n.styles,next:Pe},n.name;if(void 0!==n.styles){var r=n.next;if(void 0!==r)for(;void 0!==r;)Pe={name:r.name,styles:r.styles,next:Pe},r=r.next;return n.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var a=0;a=4;++r,a-=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(a){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)}(a)+s,styles:a,next:Pe}},Me=(!!v.useInsertionEffect&&v.useInsertionEffect||v.useLayoutEffect,v.createContext("undefined"!=typeof HTMLElement?ge({key:"css"}):null));Me.Provider;var Ne=function(e){return Object(v.forwardRef)((function(t,n){var r=Object(v.useContext)(Me);return e(t,r,n)}))},$e=v.createContext({}),Re=_,Te=function(e){return"theme"!==e},Fe=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?Re:Te},Le=function(e,t,n){var r;if(t){var a=t.shouldForwardProp;r=e.__emotion_forwardProp&&a?function(t){return e.__emotion_forwardProp(t)&&a(t)}:a}return"function"!=typeof r&&n&&(r=e.__emotion_forwardProp),r},De=function(){return null},Be=function e(t,n){var r,a,i=t.__emotion_real===t,c=i&&t.__emotion_base||t;void 0!==n&&(r=n.label,a=n.target);var o=Le(t,n,i),s=o||Fe(c),l=!s("as");return function(){var u=arguments,p=i&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==r&&p.push("label:"+r+";"),null==u[0]||void 0===u[0].raw)p.push.apply(p,u);else{p.push(u[0][0]);for(var m=u.length,f=1;f div {\n\t\tmargin-left: 8px;\n\t}\n\n\tsvg {\n\t\tdisplay: block;\n\n\t\t&:hover {\n\t\t\tcursor: pointer;\n\t\t}\n\t}\n"]))),Ke=Ye(c.Popover)(Ie||(Ie=y()(["\n\t.components-popover__content {\n\t\tpadding: 20px;\n\t\twidth: 200px;\n\t}\n"]))),Je=Ye(c.ToggleControl)(Ze||(Ze=y()(["\n\t&& {\n\t\t.components-base-control__field {\n\t\t\tmargin-bottom: 0;\n\t\t}\n\t}\n"]))),et=n(52),tt=n.n(et),nt=Ye(c.Card)(Ve||(Ve=y()(["\n\tpadding: 30px;\n\n\t&& {\n\t\tbox-shadow: 0 2px 6px 0 rgba( 0, 0, 0, 0.05 );\n\t\tborder: 1px solid #ccc;\n\t\twidth: 100%;\n\t}\n"]))),rt=Ye(c.CardHeader)(He||(He=y()(["\n\t&&& {\n\t\tpadding: 0 0 30px;\n\t}\n\n\th1 {\n\t\tfont-size: 26px;\n\t\tline-height: 1;\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t}\n\n\tsmall {\n\t\tcolor: #c0c0c0;\n\t\tfont-size: 13px;\n\t\tfont-weight: normal;\n\t\tdisplay: block;\n\t\tmargin: 0 0 3px;\n\t}\n"]))),at=Ye(c.CardFooter)(Ge||(Ge=y()(["\n\t&&& {\n\t\tpadding: 30px 0 0;\n\t}\n"]))),it=Ye(c.CardBody)(qe||(qe=y()(["\n\t&&& {\n\t\tpadding: 30px 0;\n\t}\n\n\t> * {\n\t\tmargin: 0 0 2rem;\n\n\t\t&:last-child {\n\t\t\tmargin-bottom: 0;\n\t\t}\n\t}\n\n\t> p {\n\t\tcolor: #555555;\n\t\tfont-size: 15px;\n\t}\n"]))),ct=["title","supTitle","children"];function ot(e){return Object(i.createElement)(nt,e)}function st(e){var t=e.title,n=e.supTitle,r=e.children,a=tt()(e,ct);return Object(i.createElement)(rt,a,Object(i.createElement)("div",null,n&&Object(i.createElement)("small",null,n),t&&Object(i.createElement)("h1",null,t)),r)}function lt(e){return Object(i.createElement)(at,e)}function ut(e){return Object(i.createElement)(it,e)}var pt,mt=simpaySetupWizard.adminUrl;function ft(e){var t=e.isFirst,n=Object(i.useState)(!1),r=a()(n,2),s=r[0],l=r[1];return Object(i.createElement)(c.Flex,{justify:"center"},s&&Object(i.createElement)(c.Modal,{title:Object(o.__)("Are you sure you want to exit the wizard?","stripe"),onRequestClose:function(){return l(!1)}},Object(i.createElement)("p",{style:{marginBottom:"2rem"}},Object(o.__)("Manual setup is only recommended for experienced users.","stripe")),Object(i.createElement)(c.Flex,null,Object(i.createElement)(c.Button,{href:mt,isDestructive:!0,variant:"destructive"},Object(o.__)("Exit Setup Wizard","stripe")),Object(i.createElement)(c.Button,{variant:"primary",isPrimary:!0,onClick:function(){return l(!1)}},Object(o.__)("Continue Setup","stripe")))),Object(i.createElement)(c.Button,{isLink:!0,variant:"link",className:"simpay-setup-wizard-subtle-link",onClick:function(){return l(!0)}},t?Object(o.__)("Go back to the Dashboard","stripe"):Object(o.__)("Close and exit the Setup Wizard","stripe")))}var dt=Ye(c.Button)(pt||(pt=y()(["\n\t&& {\n\t\tfont-size: 16px;\n\t\tfont-weight: bold;\n\t\tpadding: 15px 30px !important;\n\t\theight: auto;\n\t}\n"]))),bt=Object(i.forwardRef)((function(e,t){return Object(i.createElement)(dt,g()({isPrimary:!0,variant:"primary"},e,{ref:t}))}));function yt(e){return e.width,Object(i.createElement)("svg",{width:"311",height:"41",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(i.createElement)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.352 0C1.052 0 0 1.02 0 2.277v30.746C0 34.281 1.053 35.3 2.352 35.3h28.806c.975 0 1.764-.764 1.764-1.708 0-.943-.79-1.708-1.763-1.708H5.29c-.974 0-1.764-.765-1.764-1.708v-17.08c0-.944.79-1.709 1.764-1.709h44.092c1.299 0 2.352-1.02 2.352-2.277V2.277C51.735 1.02 50.682 0 49.383 0H2.352Zm55.262 24.198h-1.47v-1.993c0-4.088-3.422-7.402-7.643-7.402-4.22 0-7.642 3.314-7.642 7.402v1.993H38.8c-1.299 0-2.352 1.02-2.352 2.277v11.387c0 1.258 1.053 2.278 2.352 2.278h18.813c1.299 0 2.351-1.02 2.351-2.278V26.475c0-1.258-1.053-2.277-2.351-2.277Zm-4.997-1.993v1.993h-8.23v-1.993c0-2.201 1.842-3.985 4.114-3.985 2.273 0 4.116 1.784 4.116 3.985ZM8.23 20.497c0-.629.526-1.139 1.175-1.139H28.22c.65 0 1.176.51 1.176 1.139s-.527 1.139-1.176 1.139H9.406c-.649 0-1.175-.51-1.175-1.139Zm0 5.124c0-.629.526-1.138 1.175-1.138h7.055c.65 0 1.176.51 1.176 1.138 0 .63-.527 1.139-1.176 1.139H9.406c-.649 0-1.175-.51-1.175-1.139Zm31.158 11.672V27.045h17.637v10.248H39.389Z",fill:"#428BCA"}),Object(i.createElement)("path",{d:"M81.08 30.745h5.288l5.41-17.186 5.596 17.187h5.289l7.84-24.29h-5.288l-5.289 17.956L94.7 6.457h-5.842L83.785 24.38 78.528 6.457h-5.289l7.84 24.288Zm31.511 0h4.796v-8.793h6.456c5.319 0 8.302-3.228 8.302-7.963 0-4.735-2.983-7.532-8.302-7.532h-11.252v24.288Zm4.796-13.405V11.1h5.288c2.952 0 4.52 1.168 4.52 3.104 0 1.968-1.507 3.136-4.366 3.136h-5.442Zm35.473 13.897c6.303 0 10.023-3.197 10.023-7.747 0-10.3-14.789-4.581-14.789-10.085 0-1.906 1.599-3.013 4.52-3.013 2.859 0 4.519 1.322 4.704 3.567h5.288c0-4.92-4.089-7.994-9.9-7.994-5.872 0-9.562 2.89-9.562 7.502 0 10.268 14.758 4.642 14.758 10.084 0 1.998-1.752 3.26-4.919 3.26-3.228 0-5.073-1.6-5.165-4.305h-5.381c0 5.503 4.274 8.731 10.423 8.731Zm15.137-18.447c1.66 0 2.89-1.23 2.89-2.89 0-1.66-1.23-2.829-2.89-2.829-1.691 0-2.921 1.169-2.921 2.83 0 1.66 1.23 2.89 2.921 2.89Zm-2.306 17.956h4.581V14.758h-4.581v15.988Zm7.696-.001h4.55v-8.178c0-2.644 1.384-4.366 3.597-4.366 1.968 0 3.136 1.415 3.136 3.751v8.793h4.612v-8.178c0-2.644 1.384-4.366 3.597-4.366 1.968 0 3.136 1.415 3.136 3.751v8.793h4.643v-9.039c0-4.888-1.968-7.44-5.965-7.44-2.459 0-4.642.86-6.21 3.044-.892-2.03-2.583-3.044-5.135-3.044-2.552 0-4.335 1.076-5.411 2.798v-2.306h-4.55v15.988Zm30.183 6.15h4.551v-8.24c1.106 1.63 2.859 2.582 5.38 2.582 4.028 0 6.887-3.504 6.887-8.424 0-5.011-2.859-8.547-6.887-8.547-2.521 0-4.274.953-5.38 2.583v-2.091h-4.551v22.137Zm8.363-9.593c-2.244 0-3.843-1.875-3.843-4.52 0-2.674 1.599-4.58 3.843-4.58 2.275 0 3.874 1.906 3.874 4.58 0 2.645-1.599 4.52-3.874 4.52Zm10.651 3.443h4.551V6.457h-4.551v24.288Zm15.443.492c3.905 0 6.918-2.213 7.41-5.688h-4.551c-.184 1.107-1.229 1.968-2.828 1.968-2.368 0-3.536-1.353-3.751-3.412h11.222v-1.476c0-5.104-3.259-8.363-7.502-8.363-4.919 0-8.363 3.505-8.363 8.455 0 4.98 3.444 8.516 8.363 8.516Zm-3.689-9.93c.276-1.845 1.352-3.106 3.505-3.106 1.937 0 3.013 1.322 3.105 3.106h-6.61Zm22.358 9.438h4.796v-8.793h6.457c5.319 0 8.301-3.228 8.301-7.963 0-4.735-2.982-7.532-8.301-7.532h-11.253v24.288Zm4.796-13.405V11.1h5.288c2.952 0 4.52 1.168 4.52 3.104 0 1.968-1.507 3.136-4.366 3.136h-5.442Zm20.704 13.897c2.736 0 4.458-1.23 5.257-3.228.4 2.183 2.152 3.413 5.688 2.613v-3.259c-1.261.123-1.507-.338-1.507-1.66v-5.411c0-3.782-2.644-6.026-7.317-6.026-4.612 0-7.317 2.275-7.317 6.118h4.488c0-1.383 1.015-2.183 2.768-2.183 1.906 0 2.859.769 2.828 2.091v.492l-3.659.43c-4.519.523-7.071 2.368-7.071 5.258 0 2.429 1.722 4.765 5.842 4.765Zm.922-3.382c-1.414 0-2.183-.645-2.183-1.63 0-1.167 1.507-1.629 4.397-1.998l1.568-.153c-.277 2.152-1.599 3.781-3.782 3.781Zm11.126 9.04h1.967c3.936 0 6.641-1.077 8.271-4.981L311 14.758h-4.766l-3.996 10.669-4.797-10.67h-4.796l7.225 16.234c-1.014 1.446-2.06 1.907-4.058 1.876h-1.568v4.028Z",fill:"#428BCA"}))}var ht=n(16);function gt(e){var t=Object(ht.useSelect)((function(e){return Object(u.filter)(e("core/notices").getNotices(),{type:"snackbar"})}),[]),n=Object(ht.useDispatch)("core/notices").removeNotice;return 0===t.length?null:Object(i.createElement)(c.SnackbarList,g()({onRemove:n,notices:t},e))}var vt,Ot,jt,_t,xt,wt=n(64),Et=Ye.div(vt||(vt=y()(["\n\tmax-width: 80%;\n\tdisplay: flex;\n\talign-items: center;\n\n\t> * {\n\t\tmargin-right: 8px;\n\n\t\t&:last-child {\n\t\t\tmargin-right: 0;\n\t\t}\n\t}\n"]))),St={current:"var(--wp-admin-theme-color)",complete:"var(--wp-admin-theme-color)",incomplete:"#c0c0c0"},kt=Ye.div(Ot||(Ot=y()(["\n\twidth: 16px;\n\theight: 16px;\n\tborder-radius: 50%;\n\tbackground-color: ",";\n\tflex-shrink: 0;\n\tposition: relative;\n\ttransition: backgroundColor 0.2s ease-in-out;\n\n\tsvg {\n\t\tfill: #fff;\n\t\tposition: absolute;\n\t\tleft: -1px;\n\t\ttop: -1px;\n\t\ttransition: opacity 0.2s ease-in-out;\n\t\topacity: ",";\n\t}\n\n\tdiv {\n\t\topacity: ",";\n\t}\n\n\tpath {\n\t\tstroke: #fff;\n\t}\n"])),(function(e){return St[e.status]}),(function(e){return e.isComplete?"1":"0"}),(function(e){var t=e.isCurrent,n=e.isComplete;return t&&!n?"1":"0"})),Ct=Ye.div(jt||(jt=y()(["\n\twidth: 6px;\n\theight: 6px;\n\tbackground-color: #f0f0f1;\n\tborder-radius: 50%;\n\tposition: absolute;\n\ttop: 5px;\n\tleft: 5px;\n\ttransition: opacity 0.2s ease-in-out;\n"]))),Pt=Ye.div(_t||(_t=y()(["\n\twidth: 100%;\n\theight: 2px;\n\tbackground-color: rgba( 192, 192, 192, 0.5 );\n\twidth: 100px;\n"])));function zt(e){for(var t=e.current,n=e.total,r=[],a=1;a<=n;a++){var c="incomplete";a * {\n\t\tmargin: 25px 0;\n\t}\n"])));function Nt(e){return Object(i.createElement)(Mt,e)}var $t=Ye(c.Button)(At||(At=y()(["\n\t&&&& {\n\t\tfont-size: 16px;\n\t\tfont-weight: bold;\n\t\tpadding: 13px 30px 12px !important;\n\t\theight: auto;\n\t\tbackground-color: #635bff;\n\n\t\t&:focus {\n\t\t\tbackground-color: #635bff;\n\t\t\tbox-shadow: inset 0 0 0 1px #fff,\n\t\t\t\t0 0 0 var( --wp-admin-border-width-focus ) #635bff;\n\t\t}\n\n\t\t&:hover {\n\t\t\tbackground-color: #0a2540 !important;\n\t\t}\n\n\t\t&:focus:hover {\n\t\t\tbox-shadow: inset 0 0 0 1px #fff,\n\t\t\t\t0 0 0 var( --wp-admin-border-width-focus ) #0a2540;\n\t\t}\n\n\t\tsvg {\n\t\t\tmargin-left: 5px;\n\t\t}\n\t}\n"]))),Rt=Object(i.forwardRef)((function(e,t){return Object(i.createElement)($t,g()({isPrimary:!0,variant:"primary"},e,{ref:t}))}));function Tt(){return Object(i.createElement)("svg",{width:56,height:23,fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(i.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M55.742 11.884c0-3.93-1.92-7.032-5.59-7.032-3.684 0-5.914 3.101-5.914 7.001 0 4.622 2.632 6.955 6.41 6.955 1.843 0 3.236-.414 4.29-.998v-3.07c-1.053.522-2.261.844-3.794.844-1.502 0-2.834-.522-3.004-2.334h7.572c0-.2.03-.998.03-1.366Zm-7.649-1.459c0-1.735 1.069-2.456 2.044-2.456.945 0 1.951.721 1.951 2.456h-3.995Zm-9.832-5.573c-1.517 0-2.493.706-3.035 1.197l-.201-.952h-3.407V23l3.871-.814.016-4.345c.557.4 1.378.967 2.74.967 2.772 0 5.296-2.21 5.296-7.078-.015-4.452-2.57-6.878-5.28-6.878Zm-.929 10.579c-.913 0-1.456-.323-1.827-.722l-.016-5.696c.403-.446.96-.753 1.843-.753 1.41 0 2.385 1.566 2.385 3.578 0 2.057-.96 3.593-2.385 3.593ZM26.292 3.946l3.886-.83V0l-3.886.814v3.132Zm0 1.167h3.886v13.434h-3.886V5.113Zm-4.165 1.136-.248-1.136h-3.345v13.434h3.871V9.443c.914-1.183 2.462-.968 2.942-.799V5.113c-.495-.184-2.307-.522-3.22 1.136Zm-7.742-4.468-3.778.798-.016 12.299c0 2.272 1.719 3.946 4.01 3.946 1.27 0 2.2-.23 2.71-.507V15.2c-.495.2-2.942.906-2.942-1.366v-5.45h2.942V5.112H14.37l.016-3.332ZM3.917 9.013c0-.6.496-.83 1.317-.83 1.176 0 2.663.354 3.84.983V5.558c-1.286-.507-2.555-.706-3.84-.706C2.09 4.852 0 6.479 0 9.197c0 4.238 5.884 3.562 5.884 5.39 0 .705-.62.936-1.487.936-1.285 0-2.926-.522-4.227-1.229v3.655c1.44.614 2.896.875 4.227.875 3.221 0 5.435-1.582 5.435-4.33-.015-4.575-5.915-3.762-5.915-5.481Z",fill:"#fff"}))}var Ft=n(11),Lt=n.n(Ft);function Dt(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 Bt(e){for(var t=1;tWP Simple Pay account or purchase receipt email.","stripe"),{strong:Object(i.createElement)("strong",null),a:Object(i.createElement)("a",{href:Jt,target:"_blank",rel:"noopener noreferrer"})})),Object(i.createElement)(c.TextControl,{label:Object(o.__)("License Key","stripe"),value:l,className:_,onChange:function(e){return u(e)},disabled:d,help:g||Object(o.__)("An active license ensures automatic updates and the latest features.","stripe"),ref:j})),Object(i.createElement)(lt,{justify:"flex-end",align:"center"},Object(i.createElement)(bt,{onClick:function(){b(!0);var e=new FormData;e.append("action","simpay_activate_license"),e.append("nonce",en),e.append("license",l),m()({url:Kt,method:"POST",body:e}).then((function(e){var r=e.success,a=e.data,i=a.message,c=a.license;if(!r)throw{message:i};n(c),O(Object(o.__)("License activated","stripe"),{type:"snackbar"}),b(!1),t()})).catch((function(e){var t=e.message;v(t),b(!1)}))},disabled:""===l||d,isBusy:d},Object(o.__)("Activate and Continue →","stripe"))))}},{id:"stripe",title:Object(o.__)("Connect to Stripe","stripe"),content:wn},{id:"emails",title:Object(o.__)("Configure Emails","stripe"),content:function(e){var t=e.goPrev,n=e.goNext,r=e.licenseData,a=Wt(),s=a.settings,l=a.rawSettings,p=a.discardChanges,m=a.editSettings,f=a.saveSettings,d=Object(i.useRef)();if(Object(i.useLayoutEffect)((function(){d.current&&d.current.focus()}),[l]),Object(u.isEmpty)(s))return Object(i.createElement)(ut,null,Object(i.createElement)(c.Spinner,null));var b=s["email_payment-confirmation"],y=s["email_payment-notification"],h=s["email_payment-notification_to"],g=s["email_upcoming-invoice"],v=s["email_invoice-confirmation"],O=r.features,j=O.subscriptions,_=O.enhanced_subscriptions;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(ut,null,Object(i.createElement)("ul",{className:"simpay-setup-wizard-toggle-list"},Object(i.createElement)("li",null,Object(i.createElement)("label",{htmlFor:"email_payment-confirmation"},Object(i.createElement)("h3",null,Object(o.__)("Payment Receipt","stripe")),Object(i.createElement)("p",null,Object(o.__)("Send a payment receipt email to the customer upon successful payment.","stripe"))),Object(i.createElement)(c.FormToggle,{id:"email_payment-confirmation",checked:"no"!==b,onChange:function(e){var t=e.target;return m({"email_payment-confirmation":t.checked?"yes":"no"})}})),Object(i.createElement)("li",null,Object(i.createElement)("label",{htmlFor:"email_payment-notification"},Object(i.createElement)("h3",null,Object(o.__)("Payment Notification","stripe")),Object(i.createElement)("p",null,Object(o.__)("Receive an email notification when a new payment is made.","stripe"))),Object(i.createElement)(c.FormToggle,{id:"email_payment-notification",checked:"no"!==y,onChange:function(e){var t=e.target;return m({"email_payment-notification":t.checked?"yes":"no"})}})),"no"!==y&&Object(i.createElement)("li",{className:"simpay-setup-wizard-toggle-list__child"},Object(i.createElement)(c.TextControl,{label:Object(o.__)("Send to:","stripe"),value:h,onChange:function(e){return m({"email_payment-notification_to":e})}})),_&&Object(i.createElement)("li",null,Object(i.createElement)("label",{htmlFor:"email_invoice-confirmation"},Object(i.createElement)("h3",null,Object(o.__)("Invoice Receipt","stripe")),Object(i.createElement)("p",null,Object(o.__)("Send a payment receipt email to the customer upon successful invoice.","stripe"))),Object(i.createElement)(c.FormToggle,{id:"email_payment-confirmation",checked:"no"!==v,onChange:function(e){var t=e.target;return m({"email_invoice-confirmation":t.checked?"yes":"no"})}})),j&&Object(i.createElement)("li",null,Object(i.createElement)("label",{htmlFor:"email_upcoming-invoice"},Object(i.createElement)("h3",null,Object(o.__)("Upcoming Invoice","stripe")),Object(i.createElement)("p",null,Object(o.__)("Remind customers of upcoming invoices and allow payment method changes.","stripe"))),Object(i.createElement)(c.FormToggle,{id:"email_upcoming-invoice",checked:"no"!==g,onChange:function(e){var t=e.target;return m({"email_upcoming-invoice":t.checked?"yes":"no"})}})))),Object(i.createElement)(lt,{justify:"space-between",align:"center"},Object(i.createElement)("div",null,Object(i.createElement)(c.Button,{isLink:!0,variant:"link",onClick:t,className:"simpay-setup-wizard-subtle-link"},Object(o.__)("← Previous Step","stripe"))),Object(i.createElement)("div",{style:{display:"flex",justifyContent:"center"}},Object(i.createElement)(c.Button,{isLink:!0,variant:"link",onClick:function(){p(),n()},style:{marginRight:"16px"},className:"simpay-setup-wizard-subtle-link"},Object(o.__)("Skip Step","stripe")),Object(i.createElement)(bt,{onClick:function(){f(),n()},ref:d},Object(o.__)("Save and Continue →","stripe")))))}},{id:"next-steps",title:Object(o.__)("🎉 Setup Complete","stripe"),content:function(){return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(ut,null,Object(i.createElement)("div",{className:"simpay-setup-wizard-content-list"},Object(i.createElement)("div",{className:"simpay-setup-wizard-content-list__content"},Object(i.createElement)("p",null,Object(o.__)("Congratulations, you’re ready to start accepting payments!","stripe")),Object(i.createElement)("p",null,Object(o.__)("WP Simple Pay is just that: simple. Create your first payment form below to start collecting payments, or fine-tune your setup through some of these suggestions:","stripe"))),Object(i.createElement)("div",{className:"simpay-setup-wizard-content-list__list"},Object(i.createElement)("ul",{className:"simpay-setup-wizard-bullet-list"},Object(i.createElement)("li",null,Object(i.createElement)("a",{href:bn,target:"_blank",rel:"noopener noreferrer"},Object(o.__)("Collect tax or GST","stripe"))),Object(i.createElement)("li",null,Object(i.createElement)("a",{href:yn,target:"_blank",rel:"noopener noreferrer"},Object(o.__)("Add anti-spam protection","stripe"))),Object(i.createElement)("li",null,Object(i.createElement)("a",{href:hn,target:"_blank",rel:"noopener noreferrer"},Object(o.__)("Change the default currency","stripe"))),Object(i.createElement)("li",null,Object(i.createElement)("a",{href:gn,target:"_blank",rel:"noopener noreferrer"},Object(o.__)("Customize receipts","stripe")))))),Object(i.createElement)("hr",null),Object(i.createElement)("div",{className:"simpay-setup-wizard-doc-suggestions"},Object(i.createElement)("div",null,Object(i.createElement)("h3",null,Object(o.__)("Accept Donations","stripe")),Object(i.createElement)("p",null,Object(o.__)("Easily fundraise or accept donations online via 135+ supported currencies. Offer one-time or recurring donations of fixed or user-defined amounts.","stripe")),Object(i.createElement)(c.Button,{href:vn,variant:"secondary",isSecondary:!0,target:"_blank",rel:"noopener noreferrer"},Object(o.__)("View Walkthrough","stripe"))),Object(i.createElement)("div",null,Object(i.createElement)("h3",null,Object(o.__)("Reconcile Invoices","stripe")),Object(i.createElement)("p",null,Object(o.__)("Collect additional custom data on your payment forms such as an Invoice ID to reconcile invoices against your own invoicing system.","stripe")),Object(i.createElement)(c.Button,{href:On,variant:"secondary",isSecondary:!0,target:"_blank",rel:"noopener noreferrer"},Object(o.__)("View Walkthrough","stripe"))))),Object(i.createElement)(lt,{justify:"space-between",align:"center"},Object(i.createElement)("div",{style:{flexBasis:"100%"}},Object(i.createElement)(c.Button,{isLink:!0,variant:"link",href:fn,className:"simpay-setup-wizard-subtle-link",icon:Object(i.createElement)(f.a,{icon:rn})},Object(o.__)("Return to Dashboard","stripe"))),Object(i.createElement)(c.Flex,{justify:"flex-end",gap:4},Object(i.createElement)(bt,{href:dn},Object(o.__)("Create a Payment Form →","stripe")))))}}],lite:[{id:"stripe",title:Object(o.__)("Connect to Stripe","stripe"),content:wn},{id:"analytics",title:Object(o.__)("Help Improve WP Simple Pay + Smart Recommendations","stripe"),content:function(e){var t=e.goPrev,n=e.goNext,r=Wt(),s=r.settings,l=r.rawSettings,p=r.discardChanges,b=r.editSettings,y=r.saveSettings,h=Object(i.useState)(!0),g=a()(h,2),v=g[0],O=g[1],j=Object(i.useState)(Ht),_=a()(j,2),x=_[0],w=_[1],E=Object(i.useState)(!1),S=a()(E,2),k=S[0],C=S[1],P=Object(i.useState)(!1),z=a()(P,2),A=z[0],M=z[1],N=Object(i.useRef)();return Object(i.useLayoutEffect)((function(){N.current&&N.current.focus()}),[l]),Object(u.isEmpty)(s)?Object(i.createElement)(ut,null,Object(i.createElement)(c.Spinner,null)):Object(i.createElement)(i.Fragment,null,Object(i.createElement)(ut,null,Object(i.createElement)("p",null,Object(o.__)("Get helpful suggestions from WP Simple Pay on how to optimize your payment forms and grow your business or increase donations.","stripe")),Object(i.createElement)(c.TextControl,{label:Object(o.__)("Your Email Address:","stripe"),value:x,className:"simpay-setup-wizard-large-input",onChange:function(e){return w(e)},help:Object(o.__)("Your email is needed so you receive recommendations.","stripe"),ref:N,disabled:k}),Object(i.createElement)("hr",null),Object(i.createElement)(Xe,null,Object(i.createElement)(Qe,null,Object(o.__)("Help make WP Simple Pay better for everyone","stripe"),Object(i.createElement)("div",null,A&&Object(i.createElement)(Ke,{position:"top center"},Object(o.__)("By allowing us to track usage data we can better help you because we know which WordPress configurations, themes, and plugins we should test.","stripe")),Object(i.createElement)(f.a,{size:20,icon:d.a,onMouseEnter:function(){return M(!0)},onMouseLeave:function(){return M(!1)}}))),Object(i.createElement)(Je,{label:Object(o.__)("Yes, count me in","stripe"),id:"email_payment-confirmation",checked:v,disabled:k,onChange:function(e){O(e)}}))),Object(i.createElement)(lt,{justify:"space-between",align:"center"},Object(i.createElement)("div",null,Object(i.createElement)(c.Button,{isLink:!0,variant:"link",onClick:t,className:"simpay-setup-wizard-subtle-link",disabled:k},Object(o.__)("← Previous Step","stripe"))),Object(i.createElement)("div",{style:{display:"flex",justifyContent:"center"}},Object(i.createElement)(c.Button,{isLink:!0,variant:"link",onClick:function(){p(),n()},style:{marginRight:"16px"},className:"simpay-setup-wizard-subtle-link",disabled:k},Object(o.__)("Skip Step","stripe")),Object(i.createElement)(bt,{onClick:function(){C(!0),b({usage_tracking_opt_in:v?"yes":"no"}),y();var e=new FormData;e.append("action","simpay_setup_wizard_subscribe_email"),e.append("nonce",Gt),e.append("email",x),m()({url:qt,method:"POST",body:e}).finally((function(){C(!1),n()}))},isBusy:k,disabled:k},Object(o.__)("Save and Continue →","stripe")))))}},{id:"next-steps",title:Object(o.__)("🎉 Setup Complete","stripe"),content:function(){return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(ut,null,Object(i.createElement)(c.Flex,{justify:"space-between",align:"center",className:"simpay-setup-wizard-content-list"},Object(i.createElement)("div",{className:"simpay-setup-wizard-content-list__content"},Object(i.createElement)("p",null,Object(o.__)("Congratulations, you’re ready to start easily and securely accepting payments with WP Simple Pay!","stripe"))),Object(i.createElement)("div",null,Object(i.createElement)(bt,{href:ln},Object(o.__)("Create a Payment Form →","stripe")))),Object(i.createElement)("hr",null),Object(i.createElement)(an,null,Object(i.createElement)("h4",null,Object(o.__)("Special Upgrade Offer - Save 50%","stripe")),Object(i.createElement)("h3",null,Object(o.__)("Upgrade to WP Simple Pay Pro Today and Save","stripe")),Object(i.createElement)(cn,{className:"simpay-setup-wizard-check-list"},pn.map((function(e){return Object(i.createElement)("li",{key:e},Object(i.createElement)(f.a,{icon:wt.a}),e)}))),Object(i.createElement)(c.Button,{isLarge:!0,isSecondary:!0,variant:"secondary",href:un,target:"_blank",rel:"noopener noreferrer"},Object(o.__)("Upgrade to WP Simple Pay Pro","stripe")))),Object(i.createElement)(lt,{justify:"center"},Object(i.createElement)(c.Button,{isLink:!0,variant:"link",href:sn,className:"simpay-setup-wizard-subtle-link",icon:Object(i.createElement)(f.a,{icon:rn})},Object(o.__)("Return to Dashboard","stripe"))))}}]},Cn=simpaySetupWizard,Pn=Cn.license,zn=Cn.adminUrl,An=Pn.is_lite;Object(i.render)(Object(i.createElement)((function(){var e=kn[!0===An?"lite":"pro"],t=Object(s.getQueryArg)(window.location.href,"step"),n=Object(i.useState)(Pn),r=a()(n,2),u=r[0],p=r[1],m=function(e){var t=e.steps,n=e.currentStepId,r=t.findIndex((function(e){return e.id===n}))||0,c=Object(i.useState)(r),o=a()(c,2),l=o[0],u=o[1];function p(e){u(e),window.history.pushState({},"",Object(s.addQueryArgs)(window.location.href,{step:t[e].id}))}return Object(i.useEffect)((function(){var e=function(){var e=Object(s.getQueryArg)(window.location.search,"step"),n=t.findIndex((function(t){return t.id===e}))||0;u(n)};return window.addEventListener("popstate",e),window.addEventListener("pushstate",e),function(){window.removeEventListener("popstate",e),window.removeEventListener("pushstate",e)}}),[]),{currentStep:l,setCurrentStep:u,hasNext:l0}}({steps:e,currentStepId:t}),f=m.currentStep,d=m.goNext,b=m.goPrev,y=m.hasNext,h=m.hasPrev;if(-1===f)return Object(i.createElement)(Sn,{steps:e,goNext:d});var g=e[f],v=g.content;return Object(i.createElement)(c.SlotFillProvider,null,Object(i.createElement)(l.EntityProvider,{kind:"root",type:"site"},Object(i.createElement)(Nt,null,Object(i.createElement)("a",{href:zn},Object(i.createElement)(yt,{width:"250px"})),Object(i.createElement)(zt,{current:f+1,total:e.length}),Object(i.createElement)(ot,{isRounded:!0},Object(i.createElement)(st,{supTitle:Object(o.sprintf)(/* translators: %1$d current step count. %2$d total step count*/ Object(o.__)("Step %1$d of %2$d","stripe"),f+1,e.length),title:g.title}),Object(i.createElement)(v,{steps:e,currentStep:f,goPrev:b,goNext:d,hasNext:y,hasPrev:h,licenseData:u,setLicenseData:p})),y&&Object(i.createElement)(ft,null)),Object(i.createElement)(gt,{className:"simpay-setup-wizard-toasts"}),Object(i.createElement)(c.Popover.Slot,null)))}),null),document.getElementById("simpay-setup-wizard"))}]); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin.js b/includes/core/assets/js/dist/simpay-admin.js index e98243df..2e7940ca 100644 --- a/includes/core/assets/js/dist/simpay-admin.js +++ b/includes/core/assets/js/dist/simpay-admin.js @@ -1 +1 @@ -!function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.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 a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));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=32)}([function(e,t,n){"use strict";function r(e){"complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",e):e()}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return c}));var r=n(9),a=n.n(r),i=n(5),o=n.n(i);function c(_x,e){return s.apply(this,arguments)}function s(){return(s=a()(o.a.mark((function t(n,r){return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.ajax({data:r,method:"POST",url:"".concat(wpApiSettings.root,"wpsp/").concat(n),beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",wpApiSettings.nonce)}});case 3:return t.abrupt("return",t.sent);case 6:throw t.prev=6,t.t0=t.catch(0),t.t0.responseJSON;case 10:case"end":return t.stop()}}),t,null,[[0,6]])})))).apply(this,arguments)}}).call(this,n(7))},function(e,t,n){var r=n(18);e.exports=function(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";var r=n(27);n.o(r,"maybeBlockButtonWithUpgradeModal")&&n.d(t,"maybeBlockButtonWithUpgradeModal",(function(){return r.maybeBlockButtonWithUpgradeModal})),n.o(r,"maybeBlockCheckboxWithUpgradeModal")&&n.d(t,"maybeBlockCheckboxWithUpgradeModal",(function(){return r.maybeBlockCheckboxWithUpgradeModal})),n.o(r,"maybeBlockSelectWithUpgradeModal")&&n.d(t,"maybeBlockSelectWithUpgradeModal",(function(){return r.maybeBlockSelectWithUpgradeModal})),n.o(r,"upgradeModal")&&n.d(t,"upgradeModal",(function(){return r.upgradeModal})),n(15);var a=n(28);n.d(t,"maybeBlockButtonWithUpgradeModal",(function(){return a.a})),n.d(t,"maybeBlockCheckboxWithUpgradeModal",(function(){return a.b})),n.d(t,"maybeBlockSelectWithUpgradeModal",(function(){return a.c})),n.d(t,"upgradeModal",(function(){return a.d}))},function(e,t){var n=/^(?:submit|button|image|reset|file)$/i,r=/^(?:input|select|textarea|keygen)/i,a=/(\[[^\[\]]*\])/g;function i(e,t,n){if(t.match(a))!function e(t,n,r){if(0===n.length)return r;var a=n.shift(),i=a.match(/^\[(.+?)\]$/);if("[]"===a)return t=t||[],Array.isArray(t)?t.push(e(null,n,r)):(t._values=t._values||[],t._values.push(e(null,n,r))),t;if(i){var o=i[1],c=+o;isNaN(c)?(t=t||{})[o]=e(t[o],n,r):(t=t||[])[c]=e(t[c],n,r)}else t[a]=e(t[a],n,r);return t}(e,function(e){var t=[],n=new RegExp(a),r=/^([^\[\]]*)/.exec(e);for(r[1]&&t.push(r[1]);null!==(r=n.exec(e));)t.push(r[1]);return t}(t),n);else{var r=e[t];r?(Array.isArray(r)||(e[t]=[r]),e[t].push(n)):e[t]=n}return e}function o(e,t,n){return n=n.replace(/(\r)?\n/g,"\r\n"),n=(n=encodeURIComponent(n)).replace(/%20/g,"+"),e+(e?"&":"")+encodeURIComponent(t)+"="+n}e.exports=function(e,t){"object"!=typeof t?t={hash:!!t}:void 0===t.hash&&(t.hash=!0);for(var a=t.hash?{}:"",c=t.serializer||(t.hash?i:o),s=e&&e.elements?e.elements:[],l=Object.create(null),u=0;u3&&void 0!==arguments[3]?arguments[3]:10;if(a(t)&&r(n))if("function"==typeof i)if("number"==typeof o){var c={callback:i,priority:o,namespace:n};if(e[t]){var s,l=e[t].handlers;for(s=l.length;s>0&&!(o>=l[s-1].priority);s--);s===l.length?l[s]=c:l.splice(s,0,c),(e.__current||[]).forEach((function(e){e.name===t&&e.currentIndex>=s&&e.currentIndex++}))}else e[t]={handlers:[c],runs:0};"hookAdded"!==t&&f("hookAdded",t,n,i,o)}else console.error("If specified, the hook priority must be a number.");else console.error("The hook callback must be a function.")}},o=function(e,t){return function(n,i){if(a(n)&&(t||r(i))){if(!e[n])return 0;var o=0;if(t)o=e[n].handlers.length,e[n]={runs:e[n].runs,handlers:[]};else for(var c=e[n].handlers,s=function(t){c[t].namespace===i&&(c.splice(t,1),o++,(e.__current||[]).forEach((function(e){e.name===n&&e.currentIndex>=t&&e.currentIndex--})))},l=c.length-1;l>=0;l--)s(l);return"hookRemoved"!==n&&f("hookRemoved",n,i),o}}},c=function(e){return function(t,n){return void 0!==n?t in e&&e[t].handlers.some((function(e){return e.namespace===n})):t in e}},s=function(e,t){return function(n){e[n]||(e[n]={handlers:[],runs:0}),e[n].runs++;for(var r=e[n].handlers,a=arguments.length,i=new Array(a>1?a-1:0),o=1;o0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=t.id,r=t.getFormData;return Object(i.a)("v2/customer",d({form_values:l()(t[0],{hash:!0}),form_data:r(),form_id:n},e))}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;t0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=t.id,r=t.getFormData;return Object(i.a)("v2/checkout-session",f({form_values:l()(t[0],{hash:!0}),form_data:r(),form_id:n},e))}n(9),n(5),n(11)},,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=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),l=o.call(i,"finallyLoc");if(s&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),q(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;q(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:M(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},n}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){var r=n(6).default;e.exports=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,t||"default");if("object"!=r(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){Number.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},Number.isSafeInteger=Number.isSafeInteger||function(e){return Number.isInteger(e)&&Math.abs(e)<=Number.MAX_SAFE_INTEGER},Number.MAX_SAFE_INTEGER||(Number.MAX_SAFE_INTEGER=9007199254740991)},function(e,t,n){"use strict";(function(e){n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return s})),n.d(t,"c",(function(){return l})),n.d(t,"d",(function(){return u}));var r=n(2),a=n.n(r);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 o(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};e(".simpay-upgrade-modal").dialog(o({position:{my:"center",at:"center",of:window},modal:!0,width:600,resizable:!1,draggable:!1,open:function(){var t=e(this);t.parent().find(".ui-dialog-titlebar").css({borderBottom:0}),t.find(".simpay-upgrade-modal__title").html(n),t.find(".simpay-upgrade-modal__description").html(r),t.find(".simpay-upgrade-modal__upgrade-url").attr("href",a),t.find(".simpay-upgrade-modal__upgrade-purchased-url").attr("href",i)}},c))}}).call(this,n(7))},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return a}));var r=n(0);function a(e,t){var n=document.getElementById("simpay-test-mode-toggle-notice");if(n)if(e!==t){var r=document.getElementById("simpay-toggle-notice-status"),a=document.getElementById("simpay-toggle-notice-status-link");n.style.display="block",r&&a&&(r.innerHTML=""+r.dataset[e]+"",a.href=a.dataset[e])}else n.style.display="none"}function i(){var t=document.querySelectorAll(".simpay-disconnect-link");if(t){var n=simpayAdmin.i18n,r=n.disconnectConfirm,a=n.disconnectCancel;t.forEach((function(t){t.addEventListener("click",(function(n){n.preventDefault(),e(".simpay-disconnect-confirm").dialog({resizable:!1,height:"auto",width:400,modal:!0,draggable:!1,open:function(){e(".ui-dialog-buttonset .ui-button").removeClass("ui-button").last().css({marginLeft:"10px"}).focus()},buttons:[{text:a,click:function(){e(this).dialog("close")},class:"button button-secondary"},{text:r,click:function(){window.location.href=t.href},class:"button button-primary"}]})}))}))}}Object(r.a)((function(){var e;(e=document.getElementById("simpay-stripe-account-info"))&&wp.ajax.send("simpay_stripe_connect_account_information",{data:{nonce:e.dataset.nonce},success:function(t){e.querySelector("p").innerHTML=t.message,e.style.display="block","simpay-stripe-activated-account-actions"===t.actions?e.classList.add("notice-info"):e.classList.add("notice-warning");var n=document.getElementById(t.actions);n&&(n.style.display="block"),i()},error:function(t){e.querySelector("p").innerHTML=t.message,e.style.display="block",e.classList.add("notice-error");var n=document.getElementById(t.actions);n&&(n.style.display="block",i())}})}))}).call(this,n(7))},,,function(e,t,n){"use strict";n.r(t),function(e){var t=n(10),r=n.n(t),a=n(8),i=(n(33),n(34),n(35),n(29));n(36),n(37),n(59),n(42),n(43),window.wpsp=window.wpsp||{hooks:a.b};var o,c,s,l=simpayAdmin,u=l.licenseLevel,d=l.i18n.trashFormConfirm,p={};p={init:function(){c=o(document.body),s=c.find("#simpay-form-settings"),this.handleMetaboxTabClick(),window.postboxes&&window.postboxes.handle_click&&s.on("click",".postbox .simpay-hndle, .postbox .simpay-handlediv",window.postboxes.handle_click),a.b.addAction("settings.toggleTestMode","wpsp/settings/stripe-connect",i.a),this.handleFormBuilderSettingToggles(),a.b.addAction("customFieldAdded","wpsp/payment-form",this.handleFormBuilderSettingToggles),s.on("click.simpayTabLink",".simpay-tab-link",(function(e){e.preventDefault(),p.handleInternalLinkToTabClicks(o(this))})),o(document).on("click.simpayImagePreview",".simpay-remove-image-preview",(function(e){p.handleRemoveImagePreviewClick(e)})),this.setupChosen(),this.addMediaFields(),this.stripeConnect(),this.initSortableFields(s.find(".simpay-custom-fields")),s.find(".add-field").on("click.simpayAddField",this.addField),s.find(".simpay-custom-fields").on("click",".simpay-remove-field-link",this.removeField);var e=o(".simpay-payment-modes");e.length&&e.find("input").each((function(){var t=o(this);e.hasClass("simpay-payment-mode--"+t.val())||t.attr("disabled",!0)})),this.bindTrashWarning(),c.trigger("simpayAdminInit"),o(".show-settings").detach().prependTo(".simpay-branding-bar__actions").removeClass().addClass("simpay-branding-bar__actions-button").html('').on("click",window.screenMeta.toggleEvent)},handleFormBuilderSettingToggles:function(){["_amount_type","_success_redirect_type","_subscription_type","_subscription_custom_amount","_form_type","_tax_status","_enable_payment_page","_inventory","_inventory_behavior","_schedule_start","_schedule_end",".simpay-total-amount-label-recurring",".simpay-total-amount-label-tax",".simpay-shipping-address",".simpay-text-multiline",".simpay-dropdown-type",".simpay-radio-type",".simpay-price-enable-custom",".simpay-price-type input",".simpay-email-link-enabled",".simpay-phone-smart-enabled"].forEach((function(e){var t=o(e),n=!1;"."!==e.substring(0,1)?t='[name="'.concat(e,'"]'):(t=e,n=!0),o("#simpay-form-settings").on("change",t,(function(){var t=o("#simpay-form-settings");!0===n&&(t=o(this).closest(".simpay-field-data"));var r=o(this).val();o(this).is(":checkbox")&&(r=o(this).is(":checked")?"yes":"no"),t.find(o('.simpay-show-if[data-if="'.concat(e,'"]'))).each((function(){var e=o(this),t=e.data("is");e.hide(),t.includes(r)&&e.show().css("display","block")}))})),o(t).filter(":checkbox").trigger("change"),o(t).filter(":checked").trigger("change"),o(t).is("select")&&o(t).trigger("change")}))},handleRemoveImagePreviewClick:function(e){e.preventDefault(),o(e.target).parents("td").find(".simpay-image-preview-wrap").val("").hide(),o(e.target).parents("td").find(".simpay-field-image-url").val(""),o(e.target).parents("td").find(".simpay-remove-image-preview").hide()},addMediaFields:function(){o(".simpay-media-uploader").on("click",(function(e){e.preventDefault();var t=wp.media.frames.file_frame=wp.media({title:simpayAdmin.i18n.mediaTitle,button:{text:simpayAdmin.i18n.mediaButtonText},multiple:!1}),n=o(this);t.on("select",(function(){var e=t.state().get("selection").first().toJSON(),r=n.parents("td").find(".simpay-field-image-url"),a="id"===r.data("fvalue")?e.id:e.url;n.parents("td").find(".simpay-image-preview-wrap").show(),n.parents("td").find(".simpay-remove-image-preview").show(),n.parents("td").find(".simpay-image-preview").prop("src",a),r.val(a)})),t.open()}))},setupChosen:function(){var e=o(".simpay-chosen-select, .simpay-chosen-search");e.chosen({disable_search_threshold:20}),e.chosen()},handleMetaboxTabClick:function(){var e=o('ul.simpay-tabs li:not([data-available="no"]) a'),t=o("div.simpay-panel"),n=e.parents("li");e.on("click",(function(e){e.preventDefault();var r=o(this).parent(),a=o(o(this).attr("href")),i=o(this).attr("href");history.pushState(null,null,i),setTimeout((function(){window.scrollTo(0,0)}),1),o('[name="simpay_form_settings_tab"]').val(i),o(".simpay-panels > .spinner").hide(),n.removeClass("active"),r.addClass("active"),t.addClass("simpay-panel-hidden"),a.removeClass("simpay-panel-hidden")}));var r="#form-display-options-settings-panel";location.hash.length&&(r=location.hash);var a=o('ul.simpay-tabs a[href="'+r+'"]');o('[name="simpay_form_settings_tab"]').val(r),a.length&&a.click()},stripeConnect:function(){var e="tr:nth-child(2), tr:nth-child(3), tr:nth-child(4), tr:nth-child(5)";o(".simpay-settings.stripe-account .form-table").find(e).hide(),o("#wpsp-api-keys-row-reveal button").on("click",(function(t){t.preventDefault(),o(".simpay-settings.stripe-account .form-table").find(e).show(),o("#wpsp-api-keys-row-hide").show(),o(this).parent().hide(),o(".wpsp-manual-key-warning").show()})),o("#wpsp-api-keys-row-hide button").on("click",(function(t){t.preventDefault(),o(".simpay-settings.stripe-account .form-table").find(e).hide(),o("#wpsp-api-keys-row-reveal").show(),o(this).parent().hide(),o(".wpsp-manual-key-warning").hide()}))},handleInternalLinkToTabClicks:function(e){var t=e.data("show-tab");c.find("."+t+"-tab a").click()},bindTrashWarning:function(){["plus","professional","elite","ultimate"].includes(u)&&(o(".post-type-simple-pay .submitdelete").click((function(e){confirm(d)||e.preventDefault()})),o(".post-type-simple-pay #posts-filter").submit((function(e){"trash"===o(this).find('select[name="action"]').val()&&(confirm(d)||e.preventDefault())})))},initSortableFields:function(e){e.sortable({items:".simpay-field-metabox:not(.simpay-custom-field-payment-button):not(.simpay-custom-field-checkout-button)",containment:"#simpay-form-settings",handle:".simpay-hndle",placeholder:"sortable-placeholder",cursor:"move",delay:o(document.body).hasClass("mobile")?200:0,distance:2,tolerance:"pointer",forcePlaceholderSize:!0,opacity:.65,stop:function(e,t){p.orderFields()},helper:function(e,t){return t.clone().find(":input").attr("name",(function(e,t){return"sort_"+parseInt(1e5*Math.random(),10).toString()+"_"+t})).end()}})},addField:function(e){var t=s.find(".simpay-custom-fields .simpay-field-metabox").length,n=o("#simpay-custom-fields-wrap").find(".simpay-metaboxes"),i=s.find("#custom-field-select"),c=i.val(),l=r()(document.querySelectorAll(".field-uid")).map((function(e){return parseInt(e.value)})),u={action:"simpay_add_field",post_id:o("#post_ID").val(),fieldType:c,counter:parseInt(t)+1,nextUid:parseInt(_.max(l))+1,addFieldNonce:s.find("#simpay_custom_fields_nonce").val()};e.preventDefault(),s.find(".postbox").each((function(){o(this).is(":visible")&&o(this).addClass("closed")})),o.ajax({url:ajaxurl,method:"POST",data:u,success:function(e){var t=o("
").append(e);["payment_button","checkout_button"].includes(c)?n.append(t.html()):n.prepend(t.html()),i.prop("selectedIndex",0),p.orderFields(),a.b.doAction("customFieldAdded",e)},error:function(e){window.spShared.debugLog(e)}})},removeField:function(e){if(e.preventDefault(),s.find("#custom-field-select"),window.confirm("Are you sure you want to remove this field?")){var t=o(this).closest(".simpay-field-metabox");t.data("type"),t.remove(),a.b.doAction("customFieldRemoved")}},orderFields:function(){o(".simpay-custom-fields .simpay-field-metabox").each((function(e,t){var n=parseInt(o(t).index(".simpay-custom-fields .simpay-field-metabox"));o(".field-order",t).val(n+1)}))}},(o=e)(document).ready((function(e){p.init()}))}.call(this,n(7))},function(e,t,n){"use strict";var r=n(10),a=n.n(r),i=n(0),o=simpayAdminSettingToggles||[];function c(e){var t=e.id,n=document.querySelector(".simpay-settings-".concat(t));if(!n)return{};var r=n.querySelectorAll('input[name="simpay_settings['.concat(t,']"]'));0===r.length&&(r=n.querySelectorAll('select[name="'.concat(t,'"]')));var i=r[0].value;if(["radio","checkbox"].includes(r[0].type)){var o=a()(r).filter((function(e){return e.checked}));i=0===o.length?"no":o[0].value}return{setting:r,currentValue:i}}function s(e){var t=e.id,n=e.value,r=e.toggles,a=e.compare;if("none"!==document.querySelector(".simpay-settings-".concat(t)).style.display){var i=c(e).currentValue;r.map((function(e){return document.querySelector(".simpay-settings-".concat(e))})).forEach((function(e){e&&(e.style.display="IS NOT"===a?i===n?"none":"table-row":i===n?"table-row":"none")})),r.forEach((function(e){var t=_.find(o,{id:e});t&&s(t)}))}}Object(i.a)((function(){o.forEach((function(e){s(e),c(e).setting.forEach((function(t){t.addEventListener("change",(function(){s(e)}))}))}))}))},function(e,t,n){"use strict";var r=n(0);Object(r.a)((function(){var e=window.wpsp.hooks,t=document.querySelectorAll('[name="simpay_settings[test_mode]"]');if(0!==t.length){var n="enabled"===document.querySelector('[name="simpay_settings[test_mode]"]:checked').value?"test":"live";e.doAction("settings.toggleTestMode",n,n),_.each(t,(function(t){return t.addEventListener("change",(function(t){var r="enabled"===t.target.value?"test":"live";e.doAction("settings.toggleTestMode",r,n)}))}))}}))},function(e,t,n){"use strict";var r=n(0);function a(e){var t=document.getElementById("simpay-connect-license-feedback"),n=document.getElementById("simpay-connect-license-submit");e.message?(t.innerText=e.message,t.classList.remove("simpay-license-message--valid"),t.classList.add("simpay-license-message--invalid"),t.style.display="block"):t.style.display="none",e.reload?setTimeout((function(){window.location.reload()}),2e3):(n.disabled=!1,n.innerText=n.dataset.connect)}function i(e){var t=document.getElementById("simpay-connect-license-feedback");e.message?(t.innerText=e.message,t.classList.remove("simpay-license-message--invalid"),t.classList.add("simpay-license-message--valid"),t.style.display="block"):t.style.display="none",e.reload?setTimeout((function(){window.location.reload()}),2e3):window.location=e.url}function o(){var e=document.getElementById("simpay-connect-license-key"),t=document.getElementById("simpay-connect-license-nonce"),n=document.getElementById("simpay-connect-license-submit");n.disabled=!0,n.innerText=n.dataset.connecting,wp.ajax.send("simpay_get_connect_url",{data:{nonce:t.value,key:e.value},success:i,error:a})}Object(r.a)((function(){var e=document.getElementById("simpay-connect-license-key");if(e){var t=document.getElementById("simpay-connect-license-submit");e.addEventListener("keypress",(function(e){"Enter"===e.key&&(e.preventDefault(),o())})),t.addEventListener("click",(function(e){e.preventDefault(),t.disabled=!0,o()}))}}))},function(e,t,n){"use strict";var r=n(0),a=[".simpay-settings-hcaptcha_setup",".simpay-settings-hcaptcha_site_key",".simpay-settings-hcaptcha_secret_key",".simpay-settings-recaptcha_setup",".simpay-settings-recaptcha_site_key",".simpay-settings-recaptcha_secret_key",".simpay-settings-recaptcha_score_threshold",".simpay-settings-cloudflare_turnstile_setup",".simpay-settings-cloudflare_turnstile_site_key",".simpay-settings-cloudflare_turnstile_secret_key",".simpay-settings-no_captcha_warning"];function i(e){var t,n=e.target.value;switch(n){case"none":t="no_captcha";break;case"recaptcha-v3":t="recaptcha";break;case"cloudflare-turnstile":t="cloudflare_turnstile";break;default:t=n}a.forEach((function(e){var n=document.querySelector(e);n&&(n.style.display=e.includes(t)?"table-row":"none")}))}Object(r.a)((function(){var e=document.querySelectorAll('input[name="simpay_settings[captcha_type]"]');if(0!==e.length){a.forEach((function(e){var t=document.querySelector(e);t&&(t.style.display="none")})),e.forEach((function(e){return e.addEventListener("change",i)}));var t=document.querySelector('input[name="simpay_settings[captcha_type]"]:checked');t&&t.dispatchEvent(new Event("change")),function(){var e=document.querySelector(".simpay-recaptcha-feedback");if(e){var t=simpayGoogleRecaptcha,n=t.siteKey,r=t.i18n;""!==n&&grecaptcha.ready((function(){var e=document.querySelector(".grecaptcha-badge");e&&(e.style.display="none");try{grecaptcha.execute(n,{action:"simple_pay_admin_test"}).then((function(e){wp.ajax.send("simpay_validate_recaptcha_source",{data:{token:e,recaptcha_action:"simple_pay_admin_test"},error:a})})).catch(a)}catch(e){a()}}))}function a(){e.style.display="block",e.classList.add("notice-error"),e.innerHTML="";var t=document.createElement("p");t.innerText=r.invalid,e.appendChild(t)}}()}}))},function(e,t,n){"use strict";var r=n(0),a=n(3);Object(r.a)((function(){var e=document.querySelector(".simpay-settings-emails-configure");e&&(document.querySelector(".simpay-settings-subsection-delivery").after(e),function(e){var t=e.querySelector("select");t&&t.addEventListener("change",(function(e){var n=e.target,r=n.options[n.selectedIndex].dataset,i=r.available,o=r.upgradeTitle,c=r.upgradeDescription,s=r.upgradeUrl,l=r.upgradePurchasedUrl;"no"===i&&(Object(a.upgradeModal)({title:o,description:c,url:s,purchasedUrl:l}),t.value="",t.selectedIndex=0)}))}(e))}))},function(e,t,n){"use strict";(function(e){var t=n(4),r=n.n(t),a=n(0),i=n(3);Object(a.a)((function(){var t,n,a,o,c=document.querySelector(".post-type-simple-pay #post");if(c){var s=r()(c,{hash:!0});delete s.simpay_form_settings_tab,function(t){function n(e){var n=r()(document.querySelector(".post-type-simple-pay form#post"),{hash:!0});if(delete n.simpay_form_settings_tab,delete n.simpay_save_preview,JSON.stringify(n)!==t)return e.preventDefault(),simpayAdmin.i18n.leavePageConfirm}window.addEventListener("beforeunload",n),window.onbeforeunload=n,e(".post-type-simple-pay form#post").off("submit").on("submit",(function(){window.removeEventListener("beforeunload",n),window.onbeforeunload=null}))}(JSON.stringify(s)),a=document.getElementById("form-type-select"),o=document.getElementById("is-overlay"),a.addEventListener("change",(function(e){var t=e.target,n=t.options[t.selectedIndex],r=n.value;"on-site"===r&&Object(i.maybeBlockSelectWithUpgradeModal)(e),"off-site"===r&&(o.querySelector("input").checked=!1),o.style.display="yes"===n.dataset.available&&"on-site"===r?"block":"none"})),(n=document.getElementById("_recaptcha"))&&n.addEventListener("change",(function(e){e.preventDefault(),e.target.checked=!e.target.checked,window.open(e.target.dataset.settingsUrl,"_blank")})),function(){var e=document.getElementById("_email_verification");e&&e.addEventListener("change",(function(e){e.preventDefault(),e.target.checked=!e.target.checked,window.open(e.target.dataset.settingsUrl,"_blank")}))}(),(t=document.querySelector("#_company_name"))&&(t.addEventListener("blur",(function(){0===t.value.length?(t.nextElementSibling.classList.remove("hidden"),t.value=simpayAdmin.siteTitle):t.nextElementSibling.classList.add("hidden")})),t.addEventListener("focus",(function(){0!==t.value.length&&t.nextElementSibling.classList.add("hidden")})))}}))}).call(this,n(7))},function(e,t,n){"use strict";(function(e){var t=n(10),r=n.n(t),a=n(0),i=n(8),o=n(3);function c(){var e=document.getElementById("simpay-prices");if(e){var t=e.querySelectorAll(".simpay-price").length;document.querySelectorAll(".simpay-price-label-default").forEach((function(e){return e.style.display=t>1?"none":"block"})),document.querySelectorAll(".simpay-price-label-display").forEach((function(e){return e.style.display=t>1?"block":"none"})),document.querySelectorAll(".simpay-price-option-label").forEach((function(e){if(t>1)e.style.display="block";else{var n=e.querySelector("input");n&&""!==n.value.trim()?e.style.display="block":e.style.display="none"}})),document.querySelectorAll(".simpay-price-default-check").forEach((function(e){return e.style.display=t>1?"block":"none"}));var n=document.querySelector(".simpay-custom-field-plan-select");n&&(n.style.display=t>1?"block":"none")}}function s(e){var t,n=e.querySelector(".simpay-price-label-display"),r=e.querySelector(".simpay-price-label"),a=simpayAdmin,o=a.currencyPosition,c=a.i18n,s=c.recurringIntervals,l=c.recurringIntervalDisplay,u=c.customAmountLabel;if(""!==r.value)t=r.value;else{var d=e.querySelector(".simpay-price-currency"),p=e.querySelector(".simpay-price-amount"),m=e.querySelector(".simpay-price-amount-type"),f=e.querySelector(".simpay-price-custom-amount input"),y=e.querySelector(".simpay-price-enable-custom-amount"),h=d.options[d.selectedIndex].dataset.symbol;switch(t=!0===y.checked?f.value:p.value,o){case"left":t="".concat(h).concat(t);break;case"left_space":t="".concat(h," ").concat(t);break;case"right":t="".concat(t).concat(h);break;case"right_space":t="".concat(t," ").concat(h)}if(!0===y.checked&&(t=u.replace("%s",t)),"recurring"===m.value){var v=e.querySelector(".simpay-price-recurring-interval"),g=e.querySelector(".simpay-price-recurring-interval-count"),b=s[v.options[v.selectedIndex].value];t=l.replace("%1$s",t).replace("%2$s",g.value).replace("%3$s","1"===g.value?b[0]:b[1])}}n.innerHTML=t,Object(i.c)("simpayFormBuilderPriceOptionLabelUpdated",t,e)}function l(e,t){e.querySelector(".simpay-price-recurring-settings").style.display=t.checked?"table":"none"}function u(e){var t=e.querySelector(".simpay-price-recurring-interval"),n=e.querySelector(".simpay-price-recurring-interval-count"),a=parseInt(n.value);switch(t.options[t.selectedIndex].value){case"day":a>365&&(n.value=365);break;case"week":a>52&&(n.value=52);break;case"month":a>12&&(n.value=12);break;case"year":a>1&&(n.value=1)}var i=JSON.parse(t.dataset.intervals);r()(t.options).forEach((function(e,r){var a=e.value;t.options[r].text=1===parseInt(n.value)?i[a][0]:i[a][1]}))}function d(){document.querySelectorAll(".simpay-price").forEach((function(e){var t=e.querySelector(".simpay-price-amount-type").value;e.querySelector(".simpay-price-label").addEventListener("keyup",(function(){return s(e)})),s(e),e.querySelector(".simpay-price-currency").addEventListener("change",(function(){!function(e){var t=e.querySelector(".simpay-price-currency"),n=t.options[t.selectedIndex].dataset.symbol;e.querySelectorAll(".simpay-price-currency-symbol").forEach((function(e){return e.innerText=n}))}(e),s(e)}));var n=e.querySelectorAll(".simpay-price-amount-type .button");n.length>0&&n.forEach((function(t){return t.addEventListener("click",(function(t){t.preventDefault();var n=t.target.dataset,r=n.available,a=n.upgradeTitle,i=n.upgradeDescription,c=n.upgradeUrl,l=n.upgradePurchasedUrl;"no"===r?Object(o.upgradeModal)({title:a,description:i,url:c,purchasedUrl:l}):(function(e,t){e.querySelectorAll(".simpay-price-amount-type .button").forEach((function(e){return e.classList.remove("button-primary")}));var n=t.dataset.amountType,r=e.querySelector(".simpay-price-recurring-settings");t.classList.add("button-primary"),r.style.display="recurring"===n?"table":"none";var a=e.querySelector(".simpay-price-recurring-amount-toggle"),i=e.querySelector(".simpay-price-enable-optional-subscription");a.style.display="recurring"===n?"none":"block",i.checked=!1,e.querySelector(".simpay-price-amount-type").value=n}(e,t.target),s(e))}))})),e.querySelector(".simpay-price-amount").addEventListener("keyup",(function(){return s(e)}));var r=e.querySelector(".simpay-price-enable-optional-subscription");r&&(r.addEventListener("click",(function(t){var n=t.target,r=n.dataset,a=r.available,i=r.upgradeTitle,c=r.upgradeDescription,u=r.upgradeUrl,d=r.upgradePurchasedUrl;"no"===a?(n.checked=!1,t.preventDefault(),Object(o.upgradeModal)({title:i,description:c,url:u,purchasedUrl:d})):(l(e,n),s(e))})),"recurring"!==t&&l(e,r));var a=e.querySelector(".simpay-price-enable-custom-amount");a.addEventListener("change",(function(){!function(e,t){e.querySelector(".simpay-price-custom-amount").style.display=t.checked?"table":"none"}(e,a),s(e)})),e.querySelector(".simpay-price-recurring-interval").addEventListener("change",(function(){s(e),u(e)}));var d=e.querySelector(".simpay-price-recurring-interval-count");u(e),d.addEventListener("keyup",(function(){u(e),s(e)})),d.addEventListener("change",(function(){u(e),s(e)}));var m=e.querySelector(".simpay-price-legacy-setting-toggle");m&&m.addEventListener("click",(function(t){t.preventDefault(),function(e){e.querySelectorAll(".simpay-price-legacy-setting").forEach((function(e){return e.style.display="block"===e.style.display?"none":"block"}))}(e)})),e.querySelector(".simpay-price-default").addEventListener("change",(function(){return function(e){document.querySelectorAll(".simpay-price-default").forEach((function(e){return e.checked=!1})),e.querySelector(".simpay-price-default").checked=!0}(e)})),e.querySelector(".simpay-price-remove").addEventListener("click",(function(t){t.preventDefault(),function(e){e.remove(),p(),c(),Object(i.c)("simpayFormBuilderPriceRemoved",e.id)}(e)}))})),c()}function p(){var e=document.querySelectorAll(".simpay-price");document.querySelector(".simpay-price-default:checked")||(e[0].querySelector(".simpay-price-default").checked=!0)}Object(a.a)((function(){var t,n,r,a,s,l,u;e(".simpay-prices").sortable({items:".simpay-field-metabox",containment:"#simpay-prices",handle:".simpay-hndle",placeholder:"sortable-placeholder",cursor:"move",delay:e(document.body).hasClass("mobile")?200:0,distance:2,tolerance:"pointer",forcePlaceholderSize:!0,opacity:.65,helper:function(e,t){return t.clone().find(":input").attr("name",(function(e,t){return"sort_"+parseInt(1e5*Math.random(),10).toString()+"_"+t})).end()}}),d(),t=document.getElementById("simpay-prices-advanced-toggle"),n=document.getElementById("simpay-prices-advanced"),t&&n&&t.addEventListener("click",(function(e){e.preventDefault(),n.style.display="block"===n.style.display?"none":"block"})),(u=document.getElementById("simpay-prices-advanced-add"))&&u.addEventListener("click",(function(t){var n,r,a,i,o,s;t.preventDefault(),a=(r=(n=u).dataset).nonce,i=r.formId,o=document.getElementById("simpay-prices"),s=document.getElementById("simpay-prices-advanced-plan-id"),n.classList.add("disabled"),wp.ajax.send("simpay_add_plan",{data:{_wpnonce:a,form_id:i,plan_id:s.value},success:function(t){e(o).append(t),d(),document.getElementById("simpay-prices-advanced").style.display="none",s.value="",n.classList.remove("disabled"),c()},error:function(e){var t=e.message;window.alert(t),n.classList.remove("disabled")}})})),function(){var t=document.getElementById("simpay-add-price");t&&t.addEventListener("click",(function(n){var r,a,o,s,l;n.preventDefault(),o=(a=(r=t).dataset).nonce,s=a.formId,l=document.getElementById("simpay-prices"),r.classList.add("disabled"),wp.ajax.send("simpay_add_price",{data:{_wpnonce:o,form_id:s},success:function(t){e(l).append(t),d(),p(),r.classList.remove("disabled"),c(),Object(i.c)("simpayFormBuilderPriceAdded",t)},error:function(e){var t=e.message;window.alert(t),r.classList.remove("disabled")}})}))}(),(r=document.getElementById("simpay-add-price-lite"))&&r.addEventListener("click",o.maybeBlockButtonWithUpgradeModal),(a=document.getElementById("simpay-amount-type-lite"))&&a.addEventListener("click",o.maybeBlockButtonWithUpgradeModal),(s=document.getElementById("simpay-can-recur-lite"))&&s.addEventListener("click",o.maybeBlockButtonWithUpgradeModal),(l=document.getElementById("simpay-custom-lite"))&&l.addEventListener("click",o.maybeBlockButtonWithUpgradeModal)}))}).call(this,n(7))},function(e,t,n){"use strict";(function(e){var t=n(0),r=n(3);Object(t.a)((function(){var t;document.querySelector(".post-type-simple-pay #post")&&(t=e("#simpay-form-settings").find("#lite-add-field"))&&t.on("click.simpayAddField",(function(e){var t=e,n=document.querySelectorAll(".simpay-custom-fields > div").length;t.target.dataset.available=n>=3?"no":"yes",Object(r.maybeBlockButtonWithUpgradeModal)(t)&&e.stopImmediatePropagation()}))}))}).call(this,n(7))},function(e,t,n){"use strict";(function(e){var t=n(0),r=n(3);Object(t.a)((function(){var t,n,a;(t=document.querySelector('[name="_enable_payment_page"]'))&&t.addEventListener("change",r.maybeBlockCheckboxWithUpgradeModal),(n=document.querySelector('[name="_payment_page_powered_by"]'))&&n.addEventListener("change",r.maybeBlockCheckboxWithUpgradeModal),function(){if(document.getElementById("payment-page-background-color-custom")){e("#payment-page-background-color-custom").wpColorPicker();var t=document.querySelector(".simpay-payment-page-background-color .wp-color-result"),n=document.querySelectorAll(".simpay-payment-page-background-color");t.addEventListener("click",(function(t){n.forEach((function(e){e.querySelector("input").checked=!1})),t.target.classList.add("is-selected"),e(t.target).parent().find("input").prop("checked",!0)})),n.forEach((function(e){e.querySelector("input").addEventListener("change",(function(){t.classList.remove("is-selected")}))}))}}(),(a=document.querySelector('[name="_payment_page_slug"]'))&&a.addEventListener("keyup",(function(e){var t=document.querySelector(".simpay-payment-page-url");t&&(t.dataset.clipboardText="".concat(window.location.origin,"/").concat(e.target.value))}))}))}).call(this,n(7))},function(e,t,n){"use strict";(function(e){var t=n(6),r=n.n(t),a=n(0),i='',o='',c=simpayAdmin,s=c.nonce,l=c.ajaxUrl,u=c.i18n,d=u.addonActivated,p=u.addonActivate,m=u.addonActive,f=u.addonDeactivate,y=u.addonInactive,h=u.addonInstall,v=u.addonError,g=u.pluginError;function b(t){t.preventDefault();var n,a,c,u,b,_,k=e(t.target);if(k.hasClass("status-go-to-url"))window.open(k.attr("data-plugin"),"_blank");else{var w=k.attr("data-type");if(k.prop("disabled",!0).addClass("loading"),k.html(''),k.hasClass("status-active"))n="deactivate",a="status-installed","plugin"===w&&(a+=" button button-secondary"),c=y,u=p,b=f,"addon"===w&&(u=i+u,b=o+b);else if(k.hasClass("status-installed"))n="activate",a="status-active","plugin"===w&&(a+=" button button-secondary disabled"),c=m,u=f,"addon"===w?(u=o+u,b=i+p):"plugin"===w&&(u=d,b=p);else{if(!k.hasClass("status-missing"))return;n="install",a="status-active","plugin"===w&&(a+=" button disabled"),c=m,u=d,b='',"addon"===w&&(u=i+f,b+=h)}var x=k.closest(".simpay-addon");!function(t,n,r,a){var i={activate:"simpay_activate_addon",install:"simpay_install_addon",deactivate:"simpay_deactivate_addon"}[n];if(i){var o={action:i,nonce:s,plugin:t,type:r};e.post(l,o,a).fail((function(e){console.log(e.responseText)}))}}(k.attr("data-plugin"),n,w,(function(e){e.success?("install"===n?(k.attr("data-plugin",e.data.basename),_=e.data.msg,e.data.is_activated||(c=y,u="plugin"===w?p:i+p,a="plugin"===w?"status-installed button button-secondary":"status-installed")):_=e.data,x.find(".simpay-addon__actions").append('
'+_+"
"),x.find("span.status-label").removeClass("status-active status-installed status-missing").addClass(a).removeClass("button button-primary button-secondary disabled").text(c),k.removeClass("status-active status-installed status-missing").removeClass("button button-primary button-secondary disabled").addClass(a).html(u)):("object"===r()(e.data)?"addon"===w?x.find(".simpay-addon__actions").append('
'+v+"
"):x.find(".simpay-addon__actions").append('
'+g+"
"):x.find(".simpay-addon__actions").append('
'+e.data+"
"),"install"===n&&"plugin"===w&&k.addClass("status-go-to-url").removeClass("status-missing"),k.html(b)),k.prop("disabled",!1).removeClass("loading"),setTimeout((function(){x.find(".msg").remove()}),3e3)}))}}Object(a.a)((function(){document.querySelector(".simpay-addons")&&document.querySelectorAll(".simpay-addon").forEach((function(e){e.querySelector("button").addEventListener("click",b)}))}))}).call(this,n(7))},function(e,t,n){"use strict";var r=n(0);Object(r.a)((function(){var e=new ClipboardJS(".simpay-copy-button");e.on("success",(function(t){var n=t.trigger,r=n.dataset.copied,a=n.innerHTML;clearTimeout(i),n.innerHTML=r,n.classList.contains("button-secondary")&&(n.style.color="green",n.style.borderColor="green"),t.clearSelection();var i=setTimeout((function(){n.innerHTML=a,n.classList.contains("button-secondary")&&(n.style.color="",n.style.borderColor=""),e.clipboardAction.fakeElem&&e.clipboardAction.removeFake&&e.clipboardAction.removeFake()}),3e3);wp.a11y.speak(r)}))}))},,,,,,,,,,,,,,,,function(e,t,n){"use strict";n(38),n(39);var r=n(10),a=n.n(r),i=n(0),o=n(3);function c(e){var t=e.target,n=t.options[t.selectedIndex].value,r=document.querySelectorAll(".simpay-panel-field-payment-method[data-payment-method]");a()(r).forEach((function(e){var t="popular"===JSON.parse(e.dataset.paymentMethod).scope?"block":"none";e.style.display="all"===n?"block":t}))}Object(i.a)((function(){var e=document.querySelectorAll(".simpay-panel-field-payment-method-filter");0!==e.length&&a()(e).forEach((function(e){e.addEventListener("change",c)}));var t=document.querySelectorAll(".simpay-payment-method-lite");t&&t.forEach((function(e){return e.addEventListener("change",o.maybeBlockCheckboxWithUpgradeModal)}));var n=document.querySelectorAll(".simpay-payment-method-fee-recovery-lite");n&&n.forEach((function(e){return e.addEventListener("click",o.maybeBlockButtonWithUpgradeModal)}))})),Object(i.a)((function(){var e=document.getElementById("_tax_status_lite");e&&e.addEventListener("change",o.maybeBlockSelectWithUpgradeModal)})),n(40),Object(i.a)((function(){var e,t;(e=document.getElementById("_enable_tax_id"))&&e.addEventListener("change",o.maybeBlockCheckboxWithUpgradeModal),(t=document.getElementById("_enable_promotion_codes"))&&t.addEventListener("change",o.maybeBlockCheckboxWithUpgradeModal)})),n(41),Object(i.a)((function(){var e=document.getElementById("_inventory");e&&e.addEventListener("change",o.maybeBlockCheckboxWithUpgradeModal);var t=document.getElementById("_inventory_behavior_individual");t&&t.addEventListener("change",o.maybeBlockCheckboxWithUpgradeModal);var n=document.getElementById("_schedule_start");n&&n.addEventListener("change",o.maybeBlockCheckboxWithUpgradeModal);var r=document.getElementById("_schedule_end");r&&r.addEventListener("change",o.maybeBlockCheckboxWithUpgradeModal)})),Object(i.a)((function(){var e=document.getElementById("automations-search");if(e){var t=document.querySelectorAll(".simpay-form-builder-automator__integrations-integration");e.addEventListener("input",(function(){var n=e.value.toLowerCase();t.forEach((function(e){for(var t=Object.values(e.dataset),r=0;r3&&void 0!==arguments[3]?arguments[3]:10;if(a(t)&&r(n))if("function"==typeof i)if("number"==typeof o){var c={callback:i,priority:o,namespace:n};if(e[t]){var s,l=e[t].handlers;for(s=l.length;s>0&&!(o>=l[s-1].priority);s--);s===l.length?l[s]=c:l.splice(s,0,c),(e.__current||[]).forEach((function(e){e.name===t&&e.currentIndex>=s&&e.currentIndex++}))}else e[t]={handlers:[c],runs:0};"hookAdded"!==t&&f("hookAdded",t,n,i,o)}else console.error("If specified, the hook priority must be a number.");else console.error("The hook callback must be a function.")}},o=function(e,t){return function(n,i){if(a(n)&&(t||r(i))){if(!e[n])return 0;var o=0;if(t)o=e[n].handlers.length,e[n]={runs:e[n].runs,handlers:[]};else for(var c=e[n].handlers,s=function(t){c[t].namespace===i&&(c.splice(t,1),o++,(e.__current||[]).forEach((function(e){e.name===n&&e.currentIndex>=t&&e.currentIndex--})))},l=c.length-1;l>=0;l--)s(l);return"hookRemoved"!==n&&f("hookRemoved",n,i),o}}},c=function(e){return function(t,n){return void 0!==n?t in e&&e[t].handlers.some((function(e){return e.namespace===n})):t in e}},s=function(e,t){return function(n){e[n]||(e[n]={handlers:[],runs:0}),e[n].runs++;for(var r=e[n].handlers,a=arguments.length,i=new Array(a>1?a-1:0),o=1;o0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=t.id,r=t.getFormData;return Object(i.a)("v2/customer",d({form_values:l()(t[0],{hash:!0}),form_data:r(),form_id:n},e))}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;t0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=t.id,r=t.getFormData;return Object(i.a)("v2/checkout-session",f({form_values:l()(t[0],{hash:!0}),form_data:r(),form_id:n},e))}n(9),n(5),n(11)},,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=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),l=o.call(i,"finallyLoc");if(s&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),q(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;q(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:M(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},n}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){var r=n(6).default;e.exports=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,t||"default");if("object"!=r(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){Number.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},Number.isSafeInteger=Number.isSafeInteger||function(e){return Number.isInteger(e)&&Math.abs(e)<=Number.MAX_SAFE_INTEGER},Number.MAX_SAFE_INTEGER||(Number.MAX_SAFE_INTEGER=9007199254740991)},function(e,t,n){"use strict";(function(e){n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return s})),n.d(t,"c",(function(){return l})),n.d(t,"d",(function(){return u}));var r=n(2),a=n.n(r);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 o(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};e(".simpay-upgrade-modal").dialog(o({position:{my:"center",at:"center",of:window},modal:!0,width:600,resizable:!1,draggable:!1,open:function(){var t=e(this);t.parent().find(".ui-dialog-titlebar").css({borderBottom:0}),t.find(".simpay-upgrade-modal__title").html(n),t.find(".simpay-upgrade-modal__description").html(r),t.find(".simpay-upgrade-modal__upgrade-url").attr("href",a),t.find(".simpay-upgrade-modal__upgrade-purchased-url").attr("href",i)}},c))}}).call(this,n(7))},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return a}));var r=n(0);function a(e,t){var n=document.getElementById("simpay-test-mode-toggle-notice");if(n)if(e!==t){var r=document.getElementById("simpay-toggle-notice-status"),a=document.getElementById("simpay-toggle-notice-status-link");n.style.display="block",r&&a&&(r.innerHTML=""+r.dataset[e]+"",a.href=a.dataset[e])}else n.style.display="none"}function i(){var t=document.querySelectorAll(".simpay-disconnect-link");if(t){var n=simpayAdmin.i18n,r=n.disconnectConfirm,a=n.disconnectCancel;t.forEach((function(t){t.addEventListener("click",(function(n){n.preventDefault(),e(".simpay-disconnect-confirm").dialog({resizable:!1,height:"auto",width:400,modal:!0,draggable:!1,open:function(){e(".ui-dialog-buttonset .ui-button").removeClass("ui-button").last().css({marginLeft:"10px"}).focus()},buttons:[{text:a,click:function(){e(this).dialog("close")},class:"button button-secondary"},{text:r,click:function(){window.location.href=t.href},class:"button button-primary"}]})}))}))}}Object(r.a)((function(){var e;(e=document.getElementById("simpay-stripe-account-info"))&&wp.ajax.send("simpay_stripe_connect_account_information",{data:{nonce:e.dataset.nonce},success:function(t){e.querySelector("p").innerHTML=t.message,e.style.display="block","simpay-stripe-activated-account-actions"===t.actions?e.classList.add("notice-info"):e.classList.add("notice-warning");var n=document.getElementById(t.actions);n&&(n.style.display="block"),i()},error:function(t){e.querySelector("p").innerHTML=t.message,e.style.display="block",e.classList.add("notice-error");var n=document.getElementById(t.actions);n&&(n.style.display="block",i())}})}))}).call(this,n(7))},,,function(e,t,n){"use strict";n.r(t),function(e){var t=n(10),r=n.n(t),a=n(8),i=(n(33),n(34),n(35),n(29));n(36),n(37),n(59),n(42),n(43),window.wpsp=window.wpsp||{hooks:a.b};var o,c,s,l=simpayAdmin,u=l.licenseLevel,d=l.i18n.trashFormConfirm,p={};p={init:function(){c=o(document.body),s=c.find("#simpay-form-settings"),this.handleMetaboxTabClick(),window.postboxes&&window.postboxes.handle_click&&s.on("click",".postbox .simpay-hndle, .postbox .simpay-handlediv",window.postboxes.handle_click),a.b.addAction("settings.toggleTestMode","wpsp/settings/stripe-connect",i.a),this.handleFormBuilderSettingToggles(),a.b.addAction("customFieldAdded","wpsp/payment-form",this.handleFormBuilderSettingToggles),s.on("click.simpayTabLink",".simpay-tab-link",(function(e){e.preventDefault(),p.handleInternalLinkToTabClicks(o(this))})),o(document).on("click.simpayImagePreview",".simpay-remove-image-preview",(function(e){p.handleRemoveImagePreviewClick(e)})),this.setupChosen(),this.addMediaFields(),this.stripeConnect(),this.initSortableFields(s.find(".simpay-custom-fields")),s.find(".add-field").on("click.simpayAddField",this.addField),s.find(".simpay-custom-fields").on("click",".simpay-remove-field-link",this.removeField);var e=o(".simpay-payment-modes");e.length&&e.find("input").each((function(){var t=o(this);e.hasClass("simpay-payment-mode--"+t.val())||t.attr("disabled",!0)})),this.bindTrashWarning(),c.trigger("simpayAdminInit"),o(".show-settings").detach().prependTo(".simpay-branding-bar__actions").removeClass().addClass("simpay-branding-bar__actions-button").html('').on("click",window.screenMeta.toggleEvent)},handleFormBuilderSettingToggles:function(){["_amount_type","_success_redirect_type","_subscription_type","_subscription_custom_amount","_form_type","_tax_status","_enable_payment_page","_inventory","_inventory_behavior","_schedule_start","_schedule_end",".simpay-total-amount-label-recurring",".simpay-total-amount-label-tax",".simpay-shipping-address",".simpay-text-multiline",".simpay-dropdown-type",".simpay-radio-type",".simpay-price-enable-custom",".simpay-price-type input",".simpay-email-link-enabled",".simpay-phone-smart-enabled"].forEach((function(e){var t=o(e),n=!1;"."!==e.substring(0,1)?t='[name="'.concat(e,'"]'):(t=e,n=!0),o("#simpay-form-settings").on("change",t,(function(){var t=o("#simpay-form-settings");!0===n&&(t=o(this).closest(".simpay-field-data"));var r=o(this).val();o(this).is(":checkbox")&&(r=o(this).is(":checked")?"yes":"no"),t.find(o('.simpay-show-if[data-if="'.concat(e,'"]'))).each((function(){var e=o(this),t=e.data("is");e.hide(),t.includes(r)&&e.show().css("display","block")}))})),o(t).filter(":checkbox").trigger("change"),o(t).filter(":checked").trigger("change"),o(t).is("select")&&o(t).trigger("change")}))},handleRemoveImagePreviewClick:function(e){e.preventDefault(),o(e.target).parents("td").find(".simpay-image-preview-wrap").val("").hide(),o(e.target).parents("td").find(".simpay-field-image-url").val(""),o(e.target).parents("td").find(".simpay-remove-image-preview").hide()},addMediaFields:function(){o(".simpay-media-uploader").on("click",(function(e){e.preventDefault();var t=wp.media.frames.file_frame=wp.media({title:simpayAdmin.i18n.mediaTitle,button:{text:simpayAdmin.i18n.mediaButtonText},multiple:!1}),n=o(this);t.on("select",(function(){var e=t.state().get("selection").first().toJSON(),r=n.parents("td").find(".simpay-field-image-url"),a="id"===r.data("fvalue")?e.id:e.url;n.parents("td").find(".simpay-image-preview-wrap").show(),n.parents("td").find(".simpay-remove-image-preview").show(),n.parents("td").find(".simpay-image-preview").prop("src",a),r.val(a)})),t.open()}))},setupChosen:function(){var e=o(".simpay-chosen-select, .simpay-chosen-search");e.chosen({disable_search_threshold:20}),e.chosen()},handleMetaboxTabClick:function(){var e=o('ul.simpay-tabs li:not([data-available="no"]) a'),t=o("div.simpay-panel"),n=e.parents("li");e.on("click",(function(e){e.preventDefault();var r=o(this).parent(),a=o(o(this).attr("href")),i=o(this).attr("href");history.pushState(null,null,i),setTimeout((function(){window.scrollTo(0,0)}),1),o('[name="simpay_form_settings_tab"]').val(i),o(".simpay-panels > .spinner").hide(),n.removeClass("active"),r.addClass("active"),t.addClass("simpay-panel-hidden"),a.removeClass("simpay-panel-hidden")}));var r="#form-display-options-settings-panel";location.hash.length&&(r=location.hash);var a=o('ul.simpay-tabs a[href="'+r+'"]');o('[name="simpay_form_settings_tab"]').val(r),a.length&&a.click()},stripeConnect:function(){var e="tr:nth-child(2), tr:nth-child(3), tr:nth-child(4), tr:nth-child(5)";o(".simpay-settings.stripe-account .form-table").find(e).hide(),o("#wpsp-api-keys-row-reveal button").on("click",(function(t){t.preventDefault(),o(".simpay-settings.stripe-account .form-table").find(e).show(),o("#wpsp-api-keys-row-hide").show(),o(this).parent().hide(),o(".wpsp-manual-key-warning").show()})),o("#wpsp-api-keys-row-hide button").on("click",(function(t){t.preventDefault(),o(".simpay-settings.stripe-account .form-table").find(e).hide(),o("#wpsp-api-keys-row-reveal").show(),o(this).parent().hide(),o(".wpsp-manual-key-warning").hide()}))},handleInternalLinkToTabClicks:function(e){var t=e.data("show-tab");c.find("."+t+"-tab a").click()},bindTrashWarning:function(){["plus","professional","elite","ultimate"].includes(u)&&(o(".post-type-simple-pay .submitdelete").click((function(e){confirm(d)||e.preventDefault()})),o(".post-type-simple-pay #posts-filter").submit((function(e){"trash"===o(this).find('select[name="action"]').val()&&(confirm(d)||e.preventDefault())})))},initSortableFields:function(e){e.sortable({items:".simpay-field-metabox:not(.simpay-custom-field-payment-button):not(.simpay-custom-field-checkout-button)",containment:"#simpay-form-settings",handle:".simpay-hndle",placeholder:"sortable-placeholder",cursor:"move",delay:o(document.body).hasClass("mobile")?200:0,distance:2,tolerance:"pointer",forcePlaceholderSize:!0,opacity:.65,stop:function(e,t){p.orderFields()},helper:function(e,t){return t.clone().find(":input").attr("name",(function(e,t){return"sort_"+parseInt(1e5*Math.random(),10).toString()+"_"+t})).end()}})},addField:function(e){var t=s.find(".simpay-custom-fields .simpay-field-metabox").length,n=o("#simpay-custom-fields-wrap").find(".simpay-metaboxes"),i=s.find("#custom-field-select"),c=i.val(),l=r()(document.querySelectorAll(".field-uid")).map((function(e){return parseInt(e.value)})),u={action:"simpay_add_field",post_id:o("#post_ID").val(),fieldType:c,counter:parseInt(t)+1,nextUid:parseInt(_.max(l))+1,addFieldNonce:s.find("#simpay_custom_fields_nonce").val()};e.preventDefault(),s.find(".simpay-field-data").each((function(){o(this).is(":visible")&&(o(this).hide(),o(this).addClass("closed"))})),o.ajax({url:ajaxurl,method:"POST",data:u,success:function(e){var t=o("
").append(e);["payment_button","checkout_button"].includes(c)?n.append(t.html()):n.prepend(t.html()),i.prop("selectedIndex",0),p.orderFields(),a.b.doAction("customFieldAdded",e)},error:function(e){window.spShared.debugLog(e)}})},removeField:function(e){if(e.preventDefault(),s.find("#custom-field-select"),window.confirm("Are you sure you want to remove this field?")){var t=o(this).closest(".simpay-field-metabox");t.data("type"),t.remove(),a.b.doAction("customFieldRemoved")}},orderFields:function(){o(".simpay-custom-fields .simpay-field-metabox").each((function(e,t){var n=parseInt(o(t).index(".simpay-custom-fields .simpay-field-metabox"));o(".field-order",t).val(n+1)}))}},(o=e)(document).ready((function(e){p.init()}))}.call(this,n(7))},function(e,t,n){"use strict";var r=n(10),a=n.n(r),i=n(0),o=simpayAdminSettingToggles||[];function c(e){var t=e.id,n=document.querySelector(".simpay-settings-".concat(t));if(!n)return{};var r=n.querySelectorAll('input[name="simpay_settings['.concat(t,']"]'));0===r.length&&(r=n.querySelectorAll('select[name="'.concat(t,'"]')));var i=r[0].value;if(["radio","checkbox"].includes(r[0].type)){var o=a()(r).filter((function(e){return e.checked}));i=0===o.length?"no":o[0].value}return{setting:r,currentValue:i}}function s(e){var t=e.id,n=e.value,r=e.toggles,a=e.compare;if("none"!==document.querySelector(".simpay-settings-".concat(t)).style.display){var i=c(e).currentValue;r.map((function(e){return document.querySelector(".simpay-settings-".concat(e))})).forEach((function(e){e&&(e.style.display="IS NOT"===a?i===n?"none":"table-row":i===n?"table-row":"none")})),r.forEach((function(e){var t=_.find(o,{id:e});t&&s(t)}))}}Object(i.a)((function(){o.forEach((function(e){s(e),c(e).setting.forEach((function(t){t.addEventListener("change",(function(){s(e)}))}))}))}))},function(e,t,n){"use strict";var r=n(0);Object(r.a)((function(){var e=window.wpsp.hooks,t=document.querySelectorAll('[name="simpay_settings[test_mode]"]');if(0!==t.length){var n="enabled"===document.querySelector('[name="simpay_settings[test_mode]"]:checked').value?"test":"live";e.doAction("settings.toggleTestMode",n,n),_.each(t,(function(t){return t.addEventListener("change",(function(t){var r="enabled"===t.target.value?"test":"live";e.doAction("settings.toggleTestMode",r,n)}))}))}}))},function(e,t,n){"use strict";var r=n(0);function a(e){var t=document.getElementById("simpay-connect-license-feedback"),n=document.getElementById("simpay-connect-license-submit");e.message?(t.innerText=e.message,t.classList.remove("simpay-license-message--valid"),t.classList.add("simpay-license-message--invalid"),t.style.display="block"):t.style.display="none",e.reload?setTimeout((function(){window.location.reload()}),2e3):(n.disabled=!1,n.innerText=n.dataset.connect)}function i(e){var t=document.getElementById("simpay-connect-license-feedback");e.message?(t.innerText=e.message,t.classList.remove("simpay-license-message--invalid"),t.classList.add("simpay-license-message--valid"),t.style.display="block"):t.style.display="none",e.reload?setTimeout((function(){window.location.reload()}),2e3):window.location=e.url}function o(){var e=document.getElementById("simpay-connect-license-key"),t=document.getElementById("simpay-connect-license-nonce"),n=document.getElementById("simpay-connect-license-submit");n.disabled=!0,n.innerText=n.dataset.connecting,wp.ajax.send("simpay_get_connect_url",{data:{nonce:t.value,key:e.value},success:i,error:a})}Object(r.a)((function(){var e=document.getElementById("simpay-connect-license-key");if(e){var t=document.getElementById("simpay-connect-license-submit");e.addEventListener("keypress",(function(e){"Enter"===e.key&&(e.preventDefault(),o())})),t.addEventListener("click",(function(e){e.preventDefault(),t.disabled=!0,o()}))}}))},function(e,t,n){"use strict";var r=n(0),a=[".simpay-settings-hcaptcha_setup",".simpay-settings-hcaptcha_site_key",".simpay-settings-hcaptcha_secret_key",".simpay-settings-recaptcha_setup",".simpay-settings-recaptcha_site_key",".simpay-settings-recaptcha_secret_key",".simpay-settings-recaptcha_score_threshold",".simpay-settings-cloudflare_turnstile_setup",".simpay-settings-cloudflare_turnstile_site_key",".simpay-settings-cloudflare_turnstile_secret_key",".simpay-settings-no_captcha_warning"];function i(e){var t,n=e.target.value;switch(n){case"none":t="no_captcha";break;case"recaptcha-v3":t="recaptcha";break;case"cloudflare-turnstile":t="cloudflare_turnstile";break;default:t=n}a.forEach((function(e){var n=document.querySelector(e);n&&(n.style.display=e.includes(t)?"table-row":"none")}))}Object(r.a)((function(){var e=document.querySelectorAll('input[name="simpay_settings[captcha_type]"]');if(0!==e.length){a.forEach((function(e){var t=document.querySelector(e);t&&(t.style.display="none")})),e.forEach((function(e){return e.addEventListener("change",i)}));var t=document.querySelector('input[name="simpay_settings[captcha_type]"]:checked');t&&t.dispatchEvent(new Event("change")),function(){var e=document.querySelector(".simpay-recaptcha-feedback");if(e){var t=simpayGoogleRecaptcha,n=t.siteKey,r=t.i18n;""!==n&&grecaptcha.ready((function(){var e=document.querySelector(".grecaptcha-badge");e&&(e.style.display="none");try{grecaptcha.execute(n,{action:"simple_pay_admin_test"}).then((function(e){wp.ajax.send("simpay_validate_recaptcha_source",{data:{token:e,recaptcha_action:"simple_pay_admin_test"},error:a})})).catch(a)}catch(e){a()}}))}function a(){e.style.display="block",e.classList.add("notice-error"),e.innerHTML="";var t=document.createElement("p");t.innerText=r.invalid,e.appendChild(t)}}()}}))},function(e,t,n){"use strict";var r=n(0),a=n(3);Object(r.a)((function(){var e=document.querySelector(".simpay-settings-emails-configure");e&&(document.querySelector(".simpay-settings-subsection-delivery").after(e),function(e){var t=e.querySelector("select");t&&t.addEventListener("change",(function(e){var n=e.target,r=n.options[n.selectedIndex].dataset,i=r.available,o=r.upgradeTitle,c=r.upgradeDescription,s=r.upgradeUrl,l=r.upgradePurchasedUrl;"no"===i&&(Object(a.upgradeModal)({title:o,description:c,url:s,purchasedUrl:l}),t.value="",t.selectedIndex=0)}))}(e))}))},function(e,t,n){"use strict";(function(e){var t=n(4),r=n.n(t),a=n(0),i=n(3);Object(a.a)((function(){var t,n,a,o,c=document.querySelector(".post-type-simple-pay #post");if(c){var s=r()(c,{hash:!0});delete s.simpay_form_settings_tab,function(t){function n(e){var n=r()(document.querySelector(".post-type-simple-pay form#post"),{hash:!0});if(delete n.simpay_form_settings_tab,delete n.simpay_save_preview,JSON.stringify(n)!==t)return e.preventDefault(),simpayAdmin.i18n.leavePageConfirm}window.addEventListener("beforeunload",n),window.onbeforeunload=n,e(".post-type-simple-pay form#post").off("submit").on("submit",(function(){window.removeEventListener("beforeunload",n),window.onbeforeunload=null}))}(JSON.stringify(s)),a=document.getElementById("form-type-select"),o=document.getElementById("is-overlay"),a.addEventListener("change",(function(e){var t=e.target,n=t.options[t.selectedIndex],r=n.value;"on-site"===r&&Object(i.maybeBlockSelectWithUpgradeModal)(e),"off-site"===r&&(o.querySelector("input").checked=!1),o.style.display="yes"===n.dataset.available&&"on-site"===r?"block":"none"})),(n=document.getElementById("_recaptcha"))&&n.addEventListener("change",(function(e){e.preventDefault(),e.target.checked=!e.target.checked,window.open(e.target.dataset.settingsUrl,"_blank")})),function(){var e=document.getElementById("_email_verification");e&&e.addEventListener("change",(function(e){e.preventDefault(),e.target.checked=!e.target.checked,window.open(e.target.dataset.settingsUrl,"_blank")}))}(),(t=document.querySelector("#_company_name"))&&(t.addEventListener("blur",(function(){0===t.value.length?(t.nextElementSibling.classList.remove("hidden"),t.value=simpayAdmin.siteTitle):t.nextElementSibling.classList.add("hidden")})),t.addEventListener("focus",(function(){0!==t.value.length&&t.nextElementSibling.classList.add("hidden")})))}}))}).call(this,n(7))},function(e,t,n){"use strict";(function(e){var t=n(10),r=n.n(t),a=n(0),i=n(8),o=n(3);function c(){var e=document.getElementById("simpay-prices");if(e){var t=e.querySelectorAll(".simpay-price").length;document.querySelectorAll(".simpay-price-label-default").forEach((function(e){return e.style.display=t>1?"none":"block"})),document.querySelectorAll(".simpay-price-label-display").forEach((function(e){return e.style.display=t>1?"block":"none"})),document.querySelectorAll(".simpay-price-option-label").forEach((function(e){if(t>1)e.style.display="block";else{var n=e.querySelector("input");n&&""!==n.value.trim()?e.style.display="block":e.style.display="none"}})),document.querySelectorAll(".simpay-price-default-check").forEach((function(e){return e.style.display=t>1?"block":"none"}));var n=document.querySelector(".simpay-custom-field-plan-select");n&&(n.style.display=t>1?"block":"none")}}function s(e){var t,n=e.querySelector(".simpay-price-label-display"),r=e.querySelector(".simpay-price-label"),a=simpayAdmin,o=a.currencyPosition,c=a.i18n,s=c.recurringIntervals,l=c.recurringIntervalDisplay,u=c.customAmountLabel;if(""!==r.value)t=r.value;else{var d=e.querySelector(".simpay-price-currency"),p=e.querySelector(".simpay-price-amount"),m=e.querySelector(".simpay-price-amount-type"),f=e.querySelector(".simpay-price-custom-amount input"),y=e.querySelector(".simpay-price-enable-custom-amount"),h=d.options[d.selectedIndex].dataset.symbol;switch(t=!0===y.checked?f.value:p.value,o){case"left":t="".concat(h).concat(t);break;case"left_space":t="".concat(h," ").concat(t);break;case"right":t="".concat(t).concat(h);break;case"right_space":t="".concat(t," ").concat(h)}if(!0===y.checked&&(t=u.replace("%s",t)),"recurring"===m.value){var v=e.querySelector(".simpay-price-recurring-interval"),g=e.querySelector(".simpay-price-recurring-interval-count"),b=s[v.options[v.selectedIndex].value];t=l.replace("%1$s",t).replace("%2$s",g.value).replace("%3$s","1"===g.value?b[0]:b[1])}}n.innerHTML=t,Object(i.c)("simpayFormBuilderPriceOptionLabelUpdated",t,e)}function l(e,t){e.querySelector(".simpay-price-recurring-settings").style.display=t.checked?"table":"none"}function u(e){var t=e.querySelector(".simpay-price-recurring-interval"),n=e.querySelector(".simpay-price-recurring-interval-count"),a=parseInt(n.value);switch(t.options[t.selectedIndex].value){case"day":a>365&&(n.value=365);break;case"week":a>52&&(n.value=52);break;case"month":a>12&&(n.value=12);break;case"year":a>1&&(n.value=1)}var i=JSON.parse(t.dataset.intervals);r()(t.options).forEach((function(e,r){var a=e.value;t.options[r].text=1===parseInt(n.value)?i[a][0]:i[a][1]}))}function d(){document.querySelectorAll(".simpay-price").forEach((function(e){var t=e.querySelector(".simpay-price-amount-type").value;e.querySelector(".simpay-price-label").addEventListener("keyup",(function(){return s(e)})),s(e),e.querySelector(".simpay-price-currency").addEventListener("change",(function(){!function(e){var t=e.querySelector(".simpay-price-currency"),n=t.options[t.selectedIndex].dataset.symbol;e.querySelectorAll(".simpay-price-currency-symbol").forEach((function(e){return e.innerText=n}))}(e),s(e)}));var n=e.querySelectorAll(".simpay-price-amount-type .button");n.length>0&&n.forEach((function(t){return t.addEventListener("click",(function(t){t.preventDefault();var n=t.target.dataset,r=n.available,a=n.upgradeTitle,i=n.upgradeDescription,c=n.upgradeUrl,l=n.upgradePurchasedUrl;"no"===r?Object(o.upgradeModal)({title:a,description:i,url:c,purchasedUrl:l}):(function(e,t){e.querySelectorAll(".simpay-price-amount-type .button").forEach((function(e){return e.classList.remove("button-primary")}));var n=t.dataset.amountType,r=e.querySelector(".simpay-price-recurring-settings");t.classList.add("button-primary"),r.style.display="recurring"===n?"table":"none";var a=e.querySelector(".simpay-price-recurring-amount-toggle"),i=e.querySelector(".simpay-price-enable-optional-subscription");a.style.display="recurring"===n?"none":"block",i.checked=!1,e.querySelector(".simpay-price-amount-type").value=n}(e,t.target),s(e))}))})),e.querySelector(".simpay-price-amount").addEventListener("keyup",(function(){return s(e)}));var r=e.querySelector(".simpay-price-enable-optional-subscription");r&&(r.addEventListener("click",(function(t){var n=t.target,r=n.dataset,a=r.available,i=r.upgradeTitle,c=r.upgradeDescription,u=r.upgradeUrl,d=r.upgradePurchasedUrl;"no"===a?(n.checked=!1,t.preventDefault(),Object(o.upgradeModal)({title:i,description:c,url:u,purchasedUrl:d})):(l(e,n),s(e))})),"recurring"!==t&&l(e,r));var a=e.querySelector(".simpay-price-enable-custom-amount");a.addEventListener("change",(function(){!function(e,t){e.querySelector(".simpay-price-custom-amount").style.display=t.checked?"table":"none"}(e,a),s(e)})),e.querySelector(".simpay-price-recurring-interval").addEventListener("change",(function(){s(e),u(e)}));var d=e.querySelector(".simpay-price-recurring-interval-count");u(e),d.addEventListener("keyup",(function(){u(e),s(e)})),d.addEventListener("change",(function(){u(e),s(e)}));var m=e.querySelector(".simpay-price-legacy-setting-toggle");m&&m.addEventListener("click",(function(t){t.preventDefault(),function(e){e.querySelectorAll(".simpay-price-legacy-setting").forEach((function(e){return e.style.display="block"===e.style.display?"none":"block"}))}(e)})),e.querySelector(".simpay-price-default").addEventListener("change",(function(){return function(e){document.querySelectorAll(".simpay-price-default").forEach((function(e){return e.checked=!1})),e.querySelector(".simpay-price-default").checked=!0}(e)})),e.querySelector(".simpay-price-remove").addEventListener("click",(function(t){t.preventDefault(),function(e){e.remove(),p(),c(),Object(i.c)("simpayFormBuilderPriceRemoved",e.id)}(e)}))})),c()}function p(){var e=document.querySelectorAll(".simpay-price");document.querySelector(".simpay-price-default:checked")||(e[0].querySelector(".simpay-price-default").checked=!0)}Object(a.a)((function(){var t,n,r,a,s,l,u;e(".simpay-prices").sortable({items:".simpay-field-metabox",containment:"#simpay-prices",handle:".simpay-hndle",placeholder:"sortable-placeholder",cursor:"move",delay:e(document.body).hasClass("mobile")?200:0,distance:2,tolerance:"pointer",forcePlaceholderSize:!0,opacity:.65,helper:function(e,t){return t.clone().find(":input").attr("name",(function(e,t){return"sort_"+parseInt(1e5*Math.random(),10).toString()+"_"+t})).end()}}),d(),t=document.getElementById("simpay-prices-advanced-toggle"),n=document.getElementById("simpay-prices-advanced"),t&&n&&t.addEventListener("click",(function(e){e.preventDefault(),n.style.display="block"===n.style.display?"none":"block"})),(u=document.getElementById("simpay-prices-advanced-add"))&&u.addEventListener("click",(function(t){var n,r,a,i,o,s;t.preventDefault(),a=(r=(n=u).dataset).nonce,i=r.formId,o=document.getElementById("simpay-prices"),s=document.getElementById("simpay-prices-advanced-plan-id"),n.classList.add("disabled"),wp.ajax.send("simpay_add_plan",{data:{_wpnonce:a,form_id:i,plan_id:s.value},success:function(t){e(o).append(t),d(),document.getElementById("simpay-prices-advanced").style.display="none",s.value="",n.classList.remove("disabled"),c()},error:function(e){var t=e.message;window.alert(t),n.classList.remove("disabled")}})})),function(){var t=document.getElementById("simpay-add-price");t&&t.addEventListener("click",(function(n){var r,a,o,s,l;n.preventDefault(),o=(a=(r=t).dataset).nonce,s=a.formId,l=document.getElementById("simpay-prices"),r.classList.add("disabled"),wp.ajax.send("simpay_add_price",{data:{_wpnonce:o,form_id:s},success:function(t){e(l).append(t),d(),p(),r.classList.remove("disabled"),c(),Object(i.c)("simpayFormBuilderPriceAdded",t)},error:function(e){var t=e.message;window.alert(t),r.classList.remove("disabled")}})}))}(),(r=document.getElementById("simpay-add-price-lite"))&&r.addEventListener("click",o.maybeBlockButtonWithUpgradeModal),(a=document.getElementById("simpay-amount-type-lite"))&&a.addEventListener("click",o.maybeBlockButtonWithUpgradeModal),(s=document.getElementById("simpay-can-recur-lite"))&&s.addEventListener("click",o.maybeBlockButtonWithUpgradeModal),(l=document.getElementById("simpay-custom-lite"))&&l.addEventListener("click",o.maybeBlockButtonWithUpgradeModal)}))}).call(this,n(7))},function(e,t,n){"use strict";(function(e){var t=n(0),r=n(3);Object(t.a)((function(){var t;document.querySelector(".post-type-simple-pay #post")&&(t=e("#simpay-form-settings").find("#lite-add-field"))&&t.on("click.simpayAddField",(function(e){var t=e,n=document.querySelectorAll(".simpay-custom-fields > div").length;t.target.dataset.available=n>=3?"no":"yes",Object(r.maybeBlockButtonWithUpgradeModal)(t)&&e.stopImmediatePropagation()}))}))}).call(this,n(7))},function(e,t,n){"use strict";(function(e){var t=n(0),r=n(3);Object(t.a)((function(){var t,n,a;(t=document.querySelector('[name="_enable_payment_page"]'))&&t.addEventListener("change",r.maybeBlockCheckboxWithUpgradeModal),(n=document.querySelector('[name="_payment_page_powered_by"]'))&&n.addEventListener("change",r.maybeBlockCheckboxWithUpgradeModal),function(){if(document.getElementById("payment-page-background-color-custom")){e("#payment-page-background-color-custom").wpColorPicker();var t=document.querySelector(".simpay-payment-page-background-color .wp-color-result"),n=document.querySelectorAll(".simpay-payment-page-background-color");t.addEventListener("click",(function(t){n.forEach((function(e){e.querySelector("input").checked=!1})),t.target.classList.add("is-selected"),e(t.target).parent().find("input").prop("checked",!0)})),n.forEach((function(e){e.querySelector("input").addEventListener("change",(function(){t.classList.remove("is-selected")}))}))}}(),(a=document.querySelector('[name="_payment_page_slug"]'))&&a.addEventListener("keyup",(function(e){var t=document.querySelector(".simpay-payment-page-url");t&&(t.dataset.clipboardText="".concat(window.location.origin,"/").concat(e.target.value))}))}))}).call(this,n(7))},function(e,t,n){"use strict";(function(e){var t=n(6),r=n.n(t),a=n(0),i='',o='',c=simpayAdmin,s=c.nonce,l=c.ajaxUrl,u=c.i18n,d=u.addonActivated,p=u.addonActivate,m=u.addonActive,f=u.addonDeactivate,y=u.addonInactive,h=u.addonInstall,v=u.addonError,g=u.pluginError;function b(t){t.preventDefault();var n,a,c,u,b,_,k=e(t.target);if(k.hasClass("status-go-to-url"))window.open(k.attr("data-plugin"),"_blank");else{var w=k.attr("data-type");if(k.prop("disabled",!0).addClass("loading"),k.html(''),k.hasClass("status-active"))n="deactivate",a="status-installed","plugin"===w&&(a+=" button button-secondary"),c=y,u=p,b=f,"addon"===w&&(u=i+u,b=o+b);else if(k.hasClass("status-installed"))n="activate",a="status-active","plugin"===w&&(a+=" button button-secondary disabled"),c=m,u=f,"addon"===w?(u=o+u,b=i+p):"plugin"===w&&(u=d,b=p);else{if(!k.hasClass("status-missing"))return;n="install",a="status-active","plugin"===w&&(a+=" button disabled"),c=m,u=d,b='',"addon"===w&&(u=i+f,b+=h)}var x=k.closest(".simpay-addon");!function(t,n,r,a){var i={activate:"simpay_activate_addon",install:"simpay_install_addon",deactivate:"simpay_deactivate_addon"}[n];if(i){var o={action:i,nonce:s,plugin:t,type:r};e.post(l,o,a).fail((function(e){console.log(e.responseText)}))}}(k.attr("data-plugin"),n,w,(function(e){e.success?("install"===n?(k.attr("data-plugin",e.data.basename),_=e.data.msg,e.data.is_activated||(c=y,u="plugin"===w?p:i+p,a="plugin"===w?"status-installed button button-secondary":"status-installed")):_=e.data,x.find(".simpay-addon__actions").append('
'+_+"
"),x.find("span.status-label").removeClass("status-active status-installed status-missing").addClass(a).removeClass("button button-primary button-secondary disabled").text(c),k.removeClass("status-active status-installed status-missing").removeClass("button button-primary button-secondary disabled").addClass(a).html(u)):("object"===r()(e.data)?"addon"===w?x.find(".simpay-addon__actions").append('
'+v+"
"):x.find(".simpay-addon__actions").append('
'+g+"
"):x.find(".simpay-addon__actions").append('
'+e.data+"
"),"install"===n&&"plugin"===w&&k.addClass("status-go-to-url").removeClass("status-missing"),k.html(b)),k.prop("disabled",!1).removeClass("loading"),setTimeout((function(){x.find(".msg").remove()}),3e3)}))}}Object(a.a)((function(){document.querySelector(".simpay-addons")&&document.querySelectorAll(".simpay-addon").forEach((function(e){e.querySelector("button").addEventListener("click",b)}))}))}).call(this,n(7))},function(e,t,n){"use strict";var r=n(0);Object(r.a)((function(){var e=new ClipboardJS(".simpay-copy-button");e.on("success",(function(t){var n=t.trigger,r=n.dataset.copied,a=n.innerHTML;clearTimeout(i),n.innerHTML=r,n.classList.contains("button-secondary")&&(n.style.color="green",n.style.borderColor="green"),t.clearSelection();var i=setTimeout((function(){n.innerHTML=a,n.classList.contains("button-secondary")&&(n.style.color="",n.style.borderColor=""),e.clipboardAction.fakeElem&&e.clipboardAction.removeFake&&e.clipboardAction.removeFake()}),3e3);wp.a11y.speak(r)}))}))},,,,,,,,,,,,,,,,function(e,t,n){"use strict";n(38),n(39);var r=n(10),a=n.n(r),i=n(0),o=n(3);function c(e){var t=e.target,n=t.options[t.selectedIndex].value,r=document.querySelectorAll(".simpay-panel-field-payment-method[data-payment-method]");a()(r).forEach((function(e){var t="popular"===JSON.parse(e.dataset.paymentMethod).scope?"block":"none";e.style.display="all"===n?"block":t}))}Object(i.a)((function(){var e=document.querySelectorAll(".simpay-panel-field-payment-method-filter");0!==e.length&&a()(e).forEach((function(e){e.addEventListener("change",c)}));var t=document.querySelectorAll(".simpay-payment-method-lite");t&&t.forEach((function(e){return e.addEventListener("change",o.maybeBlockCheckboxWithUpgradeModal)}));var n=document.querySelectorAll(".simpay-payment-method-fee-recovery-lite");n&&n.forEach((function(e){return e.addEventListener("click",o.maybeBlockButtonWithUpgradeModal)}))})),Object(i.a)((function(){var e=document.getElementById("_tax_status_lite");e&&e.addEventListener("change",o.maybeBlockSelectWithUpgradeModal)})),n(40),Object(i.a)((function(){var e,t;(e=document.getElementById("_enable_tax_id"))&&e.addEventListener("change",o.maybeBlockCheckboxWithUpgradeModal),(t=document.getElementById("_enable_promotion_codes"))&&t.addEventListener("change",o.maybeBlockCheckboxWithUpgradeModal)})),n(41),Object(i.a)((function(){var e=document.getElementById("_inventory");e&&e.addEventListener("change",o.maybeBlockCheckboxWithUpgradeModal);var t=document.getElementById("_inventory_behavior_individual");t&&t.addEventListener("change",o.maybeBlockCheckboxWithUpgradeModal);var n=document.getElementById("_schedule_start");n&&n.addEventListener("change",o.maybeBlockCheckboxWithUpgradeModal);var r=document.getElementById("_schedule_end");r&&r.addEventListener("change",o.maybeBlockCheckboxWithUpgradeModal)})),Object(i.a)((function(){var e=document.getElementById("automations-search");if(e){var t=document.querySelectorAll(".simpay-form-builder-automator__integrations-integration");e.addEventListener("input",(function(){var n=e.value.toLowerCase();t.forEach((function(e){for(var t=Object.values(e.dataset),r=0;r array('wp-block-editor', 'wp-components', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-primitives'), 'version' => 'b18683d83e7524462f85ba4914d1391f'); \ No newline at end of file + array('wp-block-editor', 'wp-components', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-primitives'), 'version' => 'f832a397ccab62027d2aab6dcfeae955'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-block-button.js b/includes/core/assets/js/dist/simpay-block-button.js index c1ea774e..3d964eed 100644 --- a/includes/core/assets/js/dist/simpay-block-button.js +++ b/includes/core/assets/js/dist/simpay-block-button.js @@ -1 +1 @@ -!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}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=83)}({0:function(e,t){e.exports=window.wp.element},11:function(e,t,r){var o=r(30);e.exports=function(e,t,r){return(t=o(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},2:function(e,t){e.exports=window.wp.i18n},20:function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);re.length)&&(t=e.length);for(var r=0,o=new Array(t);r array(), 'version' => '91ece58c7a9ea4949d4f311a542142fc'); \ No newline at end of file + array(), 'version' => '1334fe88e4b24843d98aa4ae04c0275a'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-block-payment-form.asset.php b/includes/core/assets/js/dist/simpay-block-payment-form.asset.php index 3a808135..6e425254 100644 --- a/includes/core/assets/js/dist/simpay-block-payment-form.asset.php +++ b/includes/core/assets/js/dist/simpay-block-payment-form.asset.php @@ -1 +1 @@ - array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-server-side-render'), 'version' => 'f4d7ea43f1839a3ab7a2f8eb25fc66bb'); \ No newline at end of file + array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-server-side-render'), 'version' => '0e00c2ad55cf5fb0e7e38ffbc8efe143'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-block-payment-form.js b/includes/core/assets/js/dist/simpay-block-payment-form.js index 58d5f6e0..92e5fdf8 100644 --- a/includes/core/assets/js/dist/simpay-block-payment-form.js +++ b/includes/core/assets/js/dist/simpay-block-payment-form.js @@ -1 +1 @@ -!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=82)}({0:function(e,t){e.exports=window.wp.element},17:function(e,t){e.exports=window.wp.data},2:function(e,t){e.exports=window.wp.i18n},20:function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r compat for WordPress 5.6-5.8 + +/** + * External dependencies + */ +import classnames from 'classnames'; + +/** + * WordPress dependencies + */ +import { useInstanceId } from '@wordpress/compose'; +import { __ } from '@wordpress/i18n'; +import { Icon, search, closeSmall } from '@wordpress/icons'; +import { useRef } from '@wordpress/element'; +import { BaseControl, Button } from '@wordpress/components'; + +function SearchControl( { + className, + onChange, + value, + label, + placeholder = __( 'Search' ), + hideLabelFromVision = true, + help, +} ) { + const instanceId = useInstanceId( SearchControl ); + const searchInput = useRef(); + const id = `components-search-control-${ instanceId }`; + + return ( + +
+ onChange( event.target.value ) } + autoComplete="off" + value={ value || '' } + /> +
+ { !! value && ( +
+
+
+ ); +} + +export default SearchControl; diff --git a/includes/core/assets/js/src/admin/index.js b/includes/core/assets/js/src/admin/index.js index 89a3df97..fc13003d 100644 --- a/includes/core/assets/js/src/admin/index.js +++ b/includes/core/assets/js/src/admin/index.js @@ -554,8 +554,9 @@ let spAdmin = {}; e.preventDefault(); - spFormSettings.find( '.postbox' ).each( function () { + spFormSettings.find( '.simpay-field-data' ).each( function () { if ( $( this ).is( ':visible' ) ) { + $( this ).hide(); $( this ).addClass( 'closed' ); } } ); diff --git a/includes/core/assets/js/src/admin/pages/activity-reports/components/card-latest-payments/payment.js b/includes/core/assets/js/src/admin/pages/activity-reports/components/card-latest-payments/payment.js index 7c600dbf..02d3167d 100644 --- a/includes/core/assets/js/src/admin/pages/activity-reports/components/card-latest-payments/payment.js +++ b/includes/core/assets/js/src/admin/pages/activity-reports/components/card-latest-payments/payment.js @@ -7,7 +7,7 @@ import classnames from 'classnames'; * WordPress dependencies */ import { Tooltip } from '@wordpress/components'; -import { __ , sprintf } from '@wordpress/i18n'; +import { __ } from '@wordpress/i18n'; import { decodeEntities } from '@wordpress/html-entities'; function Payment( payment ) { @@ -27,27 +27,6 @@ function Payment( payment ) { 'is-failed': 'failed' === status, } ); - - const getTooltipText = () => { - if ( isPartialRefund() && 'refunded' === status ) { - return sprintf( - __('%s refund was initiated', 'simple-pay'), - decodeEntities(payment.amount_refunded_formatted) - ); - } - }; - - const isPartialRefund = () => { - if ( - status === 'refunded' && - payment.amount_refunded !== payment.amount_total - ) { - return true; - } - - return false; - }; - return ( @@ -66,58 +45,32 @@ function Payment( payment ) { ) } - -
- - { statusFormatted } - +
+ { statusFormatted } - -
- + +
diff --git a/includes/core/assets/js/src/admin/payment-form/template-explorer/search-control.js b/includes/core/assets/js/src/admin/payment-form/template-explorer/search-control.js new file mode 100644 index 00000000..bca5b427 --- /dev/null +++ b/includes/core/assets/js/src/admin/payment-form/template-explorer/search-control.js @@ -0,0 +1,67 @@ +// compat for WordPress 5.6-5.8 + +/** + * External dependencies + */ +import classnames from 'classnames'; + +/** + * WordPress dependencies + */ +import { useInstanceId } from '@wordpress/compose'; +import { __ } from '@wordpress/i18n'; +import { Icon, search, closeSmall } from '@wordpress/icons'; +import { useRef } from '@wordpress/element'; +import { BaseControl, Button } from '@wordpress/components'; + +function SearchControl( { + className, + onChange, + value, + label, + placeholder = __( 'Search' ), + hideLabelFromVision = true, + help, +} ) { + const instanceId = useInstanceId( SearchControl ); + const searchInput = useRef(); + const id = `components-search-control-${ instanceId }`; + + return ( + +
+ onChange( event.target.value ) } + autoComplete="off" + value={ value || '' } + /> +
+ { !! value && ( +
+
+
+ ); +} + +export default SearchControl; diff --git a/includes/core/assets/js/src/admin/payment-form/template-explorer/sidebar.js b/includes/core/assets/js/src/admin/payment-form/template-explorer/sidebar.js index f72fe6f0..f70f43de 100644 --- a/includes/core/assets/js/src/admin/payment-form/template-explorer/sidebar.js +++ b/includes/core/assets/js/src/admin/payment-form/template-explorer/sidebar.js @@ -6,10 +6,13 @@ import classnames from 'classnames'; /** * WordPress dependencies */ -import { Button, NavigableMenu , SearchControl } from '@wordpress/components'; +import { Button, NavigableMenu } from '@wordpress/components'; import { __ } from '@wordpress/i18n'; - +/** + * Internal dependencies + */ +import SearchControl from './search-control.js'; const baseClassName = 'simpay-form-template-explorer-main__sidebar'; diff --git a/includes/core/bootstrap/compatibility.php b/includes/core/bootstrap/compatibility.php index c3e3f9a6..935a5e8a 100644 --- a/includes/core/bootstrap/compatibility.php +++ b/includes/core/bootstrap/compatibility.php @@ -33,8 +33,8 @@ function get_requirements_list() { return array( 'wp' => array( 'name' => 'WordPress', - 'requires' => '5.9', - 'met' => version_compare( get_bloginfo( 'version' ), '5.9', '>=' ), + 'requires' => '5.2', + 'met' => version_compare( get_bloginfo( 'version' ), '5.2', '>=' ), ), 'php' => array( 'name' => 'PHP', @@ -97,7 +97,7 @@ function show_admin_notices() { */ add_action( 'admin_notices', - function () use ( $requirement ) { + function() use ( $requirement ) { ?>
diff --git a/includes/core/forms/functions.php b/includes/core/forms/functions.php index b8a17da3..25d41f8c 100644 --- a/includes/core/forms/functions.php +++ b/includes/core/forms/functions.php @@ -577,7 +577,7 @@ function simpay_payment_form_add_missing_custom_fields( } elseif ( false === $has_custom_amount ) { if ( isset( $fields['custom_amount'] ) ) { unset( $fields['custom_amount'] ); - $changes[] = __( 'Custom Amount Input has been removed from the payment form. A price option that allows user-defined amounts is required. ', 'stripe' ); + $changes[] = __( 'Custom Amount Input has been removed from the payment form. A price option with that allows user-defined amounts is required. ', 'stripe' ); } } diff --git a/includes/core/payments/payment-confirmation-template-tags.php b/includes/core/payments/payment-confirmation-template-tags.php index cdce7992..2b8da8db 100644 --- a/includes/core/payments/payment-confirmation-template-tags.php +++ b/includes/core/payments/payment-confirmation-template-tags.php @@ -102,10 +102,6 @@ function parse_content( $content, $payment_confirmation_data ) { if ( has_filter( sprintf( 'simpay_payment_confirmation_template_tag_%s', $tag ) ) ) { foreach ( $tags_with_keys as $tag_with_keys ) { - $keys = explode( '|', $tag_with_keys ); - - $fallback_value = isset( $keys[1] ) ? trim( trim( substr( $keys[1], 1, -1 ), '"' ) ) : ''; - /** * Filters the value used to replace the smart tag with. * @@ -125,7 +121,6 @@ function parse_content( $content, $payment_confirmation_data ) { * @param string $tag Payment confirmation smart tag name, excluding curly braces. * @param array $tags_with_keys Payment confirmation smart tags including keys, excluding curly braces. */ - $value = apply_filters( sprintf( 'simpay_payment_confirmation_template_tag_%s', $tag ), // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores $value, @@ -134,10 +129,6 @@ function parse_content( $content, $payment_confirmation_data ) { $tag_with_keys ); - if ( empty( $value ) ) { - $value = $fallback_value; - } - $content = replace_tag( $tag_with_keys, $value, $content ); } } @@ -158,30 +149,7 @@ function parse_content( $content, $payment_confirmation_data ) { * @return string */ function replace_tag( $tag, $value, $content ) { - // Remove non-breaking spaces for tag only. - $content = preg_replace_callback( - '/\{([^}]*)\}/', - function ( $matches ) { - return str_replace( "\xC2\xA0", '', $matches[0] ); - }, - $content - ); - $pattern = '/{(' . $tag . '(?::\w+)*)(?:\s*\|\s*"((?:\\"|[^"])*?)")?\}/U'; - $content = preg_replace( '/\{\s*(.*?)\s*\}/', '{$1}', $content ); - preg_match_all( $pattern, $content, $matches, PREG_SET_ORDER ); - - if ( ! empty( $matches ) ) { - foreach ( $matches as $match ) { - // If value is empty, use the fallback value. - if ( empty( $value ) ) { - $value = isset( $match[2] ) ? $match[2] : $value; - } - // $match[0] is the full tag. Example: {form-details}. - $content = str_replace( $match[0], $value, $content ); - } - } - - return $content; + return str_replace( '{' . $tag . '}', $value, $content ); } /** @@ -196,31 +164,16 @@ function ( $matches ) { * @return string $tags_with_keys Tag including keys, excluding curly braces. */ function get_tags_with_keys( $tag, $content ) { - // Remove non-breaking spaces for tag only. - $content = preg_replace_callback( - '/\{([^}]*)\}/', - function ( $matches ) { - return str_replace( "\xC2\xA0", '', $matches[0] ); - }, - $content - ); $tags_with_keys = array(); - $pattern = '/{(' . $tag . '(?::\w+)*)(?:\s*\|\s*"((?:\\"|[^"])*?)")?\}/U'; - $content = preg_replace( '/\{\s*(.*?)\s*\}/', '{$1}', $content ); - preg_match_all( $pattern, $content, $matches, PREG_SET_ORDER ); + preg_match_all( '/{' . $tag . '(:.*)?}/U', $content, $matches ); if ( ! empty( $matches ) ) { + $full_matches = $matches[0]; - foreach ( $matches as $match ) { - $tag_with_key = $match[1]; - $key = isset( $match[2] ) ? stripcslashes( $match[2] ) : ''; - - $unique_key = $tag_with_key . ( $key ? " | \"$key\"" : '' ); - - if ( ! in_array( $unique_key, $tags_with_keys, true ) ) { - $tags_with_keys[] = $unique_key; - } + foreach ( $full_matches as $match ) { + // Remove { from start and } from end. + $tags_with_keys[] = substr( $match, 1, -1 ); } } @@ -781,10 +734,6 @@ function __unstable_get_tags_and_descriptions() { // phpcs:ignore PHPCompatibili 'The unique charge ID returned from Stripe.', 'stripe' ), - 'subtotal-amount' => esc_html__( - 'The cumulative cost of selected items.', - 'stripe' - ), ); if ( simpay_is_upe() ) { diff --git a/includes/core/settings/register-emails.php b/includes/core/settings/register-emails.php index 440a06fa..aec4da5c 100644 --- a/includes/core/settings/register-emails.php +++ b/includes/core/settings/register-emails.php @@ -438,11 +438,6 @@ function add_email_selector() { Emails\Email\UpcomingInvoiceEmail::class, Emails\Email\InvoiceConfirmationEmail::class, Emails\Email\ManageSubscriptionsEmail::class, - Emails\Email\PaymentProcessingConfirmationEmail::class, - Emails\Email\PaymentProcessingNotificationEmail::class, - Emails\Email\PaymentRefundedConfirmationEmail::class, - Emails\Email\SubscriptionCancellationConfirmation::class, - Emails\Email\SubscriptionCancellationNotification::class, ), ), 'general' => array( diff --git a/languages/stripe.pot b/languages/stripe.pot index d56c5adb..45715d42 100644 --- a/languages/stripe.pot +++ b/languages/stripe.pot @@ -9,7 +9,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2024-05-03T12:05:38+00:00\n" +"POT-Creation-Date: 2024-05-08T14:57:08+00:00\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "X-Generator: WP-CLI 2.9.0\n" "X-Domain: stripe\n" @@ -280,7 +280,7 @@ msgstr "" #. translators: %1$s Future PHP version requirement. #: includes/core/admin/functions/notices.php:167 -msgid "In order to be compatible with future versions of WP Simple Pay, you should update your PHP version to %1$s, 7.4, or 8.0. On a normal WordPress site, switching to PHP %1$s should never cause issues. We would however actually recommend you switch to PHP 8.0 or higher to receive the full speed and security benefits provided to more modern and fully supported versions of PHP. However, some plugins may not be fully compatible with PHP 8.x, so more testing may be required." +msgid "In order to be compatible with future versions of WP Simple Pay, you should update your PHP version to %1$s, 7.0, 7.1, or 7.2. On a normal WordPress site, switching to PHP %1$s should never cause issues. We would however actually recommend you switch to PHP 7.1 or higher to receive the full speed and security benefits provided to more modern and fully supported versions of PHP. However, some plugins may not be fully compatible with PHP 7.x, so more testing may be required." msgstr "" #: includes/core/admin/functions/notices.php:181 @@ -605,7 +605,7 @@ msgid "The Custom Amount Input field is required because you have set a custom a msgstr "" #: includes/core/forms/functions.php:580 -msgid "Custom Amount Input has been removed from the payment form. A price option that allows user-defined amounts is required. " +msgid "Custom Amount Input has been removed from the payment form. A price option with that allows user-defined amounts is required. " msgstr "" #: includes/core/forms/functions.php:594 @@ -10317,77 +10317,75 @@ msgid "" msgstr "" #: includes/core/payments/customer.php:213 -#: src/RestApi/Internal/Payment/TaxCalculationRoute.php:162 #: src/RestApi/Internal/Payment/Traits/CustomerTrait.php:219 msgid "Please select a valid Tax ID type." msgstr "" -#: includes/core/payments/payment-confirmation-template-tags.php:694 +#: includes/core/payments/payment-confirmation-template-tags.php:647 #: includes/core/post-types/simple-pay/edit-form-payment-options.php:490 #: includes/core/post-types/simple-pay/edit-form-payment-options.php:498 msgid "Subscription" msgstr "" -#: includes/core/payments/payment-confirmation-template-tags.php:696 +#: includes/core/payments/payment-confirmation-template-tags.php:649 #: includes/core/post-types/simple-pay/edit-form-payment-options.php:481 #: includes/core/post-types/simple-pay/edit-form-payment-options.php:485 msgid "One time" msgstr "" -#: includes/core/payments/payment-confirmation-template-tags.php:760 +#: includes/core/payments/payment-confirmation-template-tags.php:713 msgid "The form's title." msgstr "" -#: includes/core/payments/payment-confirmation-template-tags.php:764 +#: includes/core/payments/payment-confirmation-template-tags.php:717 msgid "The form's description." msgstr "" -#: includes/core/payments/payment-confirmation-template-tags.php:768 +#: includes/core/payments/payment-confirmation-template-tags.php:721 msgid "The total price of the payment." msgstr "" -#: includes/core/payments/payment-confirmation-template-tags.php:772 +#: includes/core/payments/payment-confirmation-template-tags.php:725 msgid "The value of the Name form field." msgstr "" -#: includes/core/payments/payment-confirmation-template-tags.php:776 +#: includes/core/payments/payment-confirmation-template-tags.php:729 msgid "The charge date returned from Stripe." msgstr "" -#: includes/core/payments/payment-confirmation-template-tags.php:780 +#: includes/core/payments/payment-confirmation-template-tags.php:733 msgid "The unique charge ID returned from Stripe." msgstr "" -#: includes/core/payments/payment-confirmation-template-tags.php:784 -#: includes/core/payments/payment-confirmation-template-tags.php:791 +#: includes/core/payments/payment-confirmation-template-tags.php:740 msgid "The cumulative cost of selected items." msgstr "" -#: includes/core/payments/payment-confirmation-template-tags.php:798 +#: includes/core/payments/payment-confirmation-template-tags.php:747 msgid "The type of payment (one-time or recurring)." msgstr "" -#: includes/core/payments/payment-confirmation-template-tags.php:803 +#: includes/core/payments/payment-confirmation-template-tags.php:752 msgid "The brand of the card used. Visa, Amex, etc." msgstr "" -#: includes/core/payments/payment-confirmation-template-tags.php:808 +#: includes/core/payments/payment-confirmation-template-tags.php:757 msgid "The last four digits of the card used." msgstr "" -#: includes/core/payments/payment-confirmation-template-tags.php:813 +#: includes/core/payments/payment-confirmation-template-tags.php:762 msgid "The calculated tax amount based on the total and the tax percent setting." msgstr "" -#: includes/core/payments/payment-confirmation-template-tags.php:818 +#: includes/core/payments/payment-confirmation-template-tags.php:767 msgid "The calculated fee recovery amount based on the total and the fee recovery percent setting." msgstr "" -#: includes/core/payments/payment-confirmation-template-tags.php:824 +#: includes/core/payments/payment-confirmation-template-tags.php:773 msgid "The amount of the coupon applied to the payment." msgstr "" -#: includes/core/payments/payment-confirmation-template-tags.php:852 +#: includes/core/payments/payment-confirmation-template-tags.php:801 msgid "Available smart tags:" msgstr "" @@ -11056,7 +11054,7 @@ msgid "Learn more" msgstr "" #: includes/core/post-types/simple-pay/edit-form-stripe-checkout.php:288 -#: includes/core/settings/register-emails.php:449 +#: includes/core/settings/register-emails.php:444 msgid "Other" msgstr "" @@ -11650,8 +11648,6 @@ msgstr "" #: includes/core/rest-api/class-controller.php:104 #: src/RestApi/Internal/Payment/LitePaymentCreateRoute.php:72 -#: src/RestApi/Internal/Payment/ProPaymentCreateRoute.php:88 -#: src/RestApi/Internal/Payment/UpdatePaymentMethodRoute.php:147 msgid "Sorry, you have made too many requests. Please try again later." msgstr "" @@ -11661,8 +11657,6 @@ msgstr "" #: includes/core/rest-api/v2/class-paymentintent-controller.php:143 #: src/AntiSpam/EmailVerification.php:578 #: src/AntiSpam/EmailVerification.php:672 -#: src/RestApi/Internal/Payment/ProPaymentCreateRoute.php:136 -#: src/RestApi/Internal/Payment/TaxCalculationRoute.php:108 #: src/RestApi/Internal/Payment/Traits/PaymentIntentTrait.php:142 #: src/RestApi/Internal/Payment/Utils/CouponUtils.php:119 msgid "Invalid request. Please try again." @@ -11829,21 +11823,21 @@ msgstr "" msgid "Payments" msgstr "" -#: includes/core/settings/register-emails.php:466 +#: includes/core/settings/register-emails.php:461 msgid "Select an email to configure…" msgstr "" #. translators: Email label. -#: includes/core/settings/register-emails.php:476 +#: includes/core/settings/register-emails.php:471 msgid "Unlock \"%s\" Email" msgstr "" #. translators: %1$s Email label. %2$s License level required. -#: includes/core/settings/register-emails.php:485 +#: includes/core/settings/register-emails.php:480 msgid "We're sorry, sending and customizing the \"%1$s\" email is not available on your plan. Please upgrade to the %2$s plan or higher to unlock this and other awesome features." msgstr "" -#: includes/core/settings/register-emails.php:539 +#: includes/core/settings/register-emails.php:534 msgid "Configure" msgstr "" @@ -12798,7 +12792,6 @@ msgstr "" #: src/Block/ManageSubscriptionsBlock.php:63 #: src/RestApi/Internal/Payment/LitePaymentCreateRoute.php:82 -#: src/RestApi/Internal/Payment/ProPaymentCreateRoute.php:109 #: src/RestApi/Internal/SubscriptionsManagement/SendSubscriptions.php:146 msgid "Invalid CAPTCHA. Please try again." msgstr "" @@ -12948,71 +12941,6 @@ msgstr "" msgid "View %s in Stripe →" msgstr "" -#: src/Emails/Email/PaymentProcessingConfirmationEmail.php:44 -msgid "Payment Processing Confirmation" -msgstr "" - -#: src/Emails/Email/PaymentProcessingConfirmationEmail.php:51 -msgid "Send a payment processing confirmation email to the customer upon successful payment" -msgstr "" - -#. translators: %s Site name -#: src/Emails/Email/PaymentProcessingConfirmationEmail.php:71 -msgid "Payment Processing Confirmation for %s" -msgstr "" - -#: src/Emails/Email/PaymentProcessingNotificationEmail.php:44 -msgid "Payment Processing Notification" -msgstr "" - -#: src/Emails/Email/PaymentProcessingNotificationEmail.php:51 -msgid "Send a payment processing notification email to the merchant upon successful payment" -msgstr "" - -#. translators: %s Site name -#: src/Emails/Email/PaymentProcessingNotificationEmail.php:88 -msgid "Payment Processing Notification for %s" -msgstr "" - -#: src/Emails/Email/PaymentRefundedConfirmationEmail.php:44 -msgid "Payment Refunded Confirmation" -msgstr "" - -#: src/Emails/Email/PaymentRefundedConfirmationEmail.php:51 -msgid "Send a confirmation email for a payment refund" -msgstr "" - -#. translators: %s Site name -#: src/Emails/Email/PaymentRefundedConfirmationEmail.php:87 -msgid "Payment refunded on %s" -msgstr "" - -#: src/Emails/Email/SubscriptionCancellationConfirmation.php:53 -msgid "Subscription Cancellation Confirmation" -msgstr "" - -#: src/Emails/Email/SubscriptionCancellationConfirmation.php:60 -msgid "Email sent to users when their subscription is cancelled." -msgstr "" - -#. translators: %s Site name -#: src/Emails/Email/SubscriptionCancellationConfirmation.php:80 -msgid "Subscription Cancelled for %s" -msgstr "" - -#: src/Emails/Email/SubscriptionCancellationNotification.php:53 -msgid "Subscription Cancellation Notification" -msgstr "" - -#: src/Emails/Email/SubscriptionCancellationNotification.php:60 -msgid "Email sent to merchants when a subscription is cancelled." -msgstr "" - -#. translators: %s Site name -#: src/Emails/Email/SubscriptionCancellationNotification.php:97 -msgid "Subscription Cancellation Notification for %s" -msgstr "" - #: src/Emails/Email/SummaryReportEmail.php:47 msgid "Summary Report" msgstr "" @@ -13242,18 +13170,6 @@ msgstr "" msgid "Counting results via a query is not allowed. Use the ::count() method." msgstr "" -#: src/RestApi/Internal/Payment/PaymentUpdateRoute.php:114 -#: src/RestApi/Internal/Payment/PaymentUpdateRoute.php:149 -#: src/RestApi/Internal/Payment/PaymentUpdateRoute.php:159 -#: src/RestApi/Internal/Payment/PaymentUpdateRoute.php:169 -#: src/RestApi/Internal/Payment/PaymentUpdateRoute.php:196 -msgid "Invalid request. Please try again" -msgstr "" - -#: src/RestApi/Internal/Payment/TaxCalculationRoute.php:133 -msgid "Please enter a valid address to calculate tax." -msgstr "" - #: src/RestApi/Internal/Payment/Traits/SubscriptionTrait.php:407 msgid "Plan Setup Fee" msgstr "" @@ -13449,14 +13365,6 @@ msgstr "" msgid "The %s field can not be empty." msgstr "" -#: src/RestApi/Internal/Payment/ValidateCouponRoute.php:103 -msgid "Please enter a coupon code." -msgstr "" - -#: src/RestApi/Internal/Payment/ValidateCouponRoute.php:133 -msgid "Coupon is invalid." -msgstr "" - #: src/RestApi/Internal/Report/GrossVolumePeriodOverPeriodReport.php:152 #: src/RestApi/Internal/Report/SuccessfulPaymentsPeriodOverPeriodReport.php:142 msgid "Current period" @@ -13468,29 +13376,21 @@ msgid "Previous period" msgstr "" #. translators: %s Payment created date. -#: src/RestApi/Internal/Report/LatestPaymentsReport.php:160 +#: src/RestApi/Internal/Report/LatestPaymentsReport.php:155 msgid "%s ago" msgstr "" -#: src/RestApi/Internal/Report/LatestPaymentsReport.php:194 +#: src/RestApi/Internal/Report/LatestPaymentsReport.php:188 #: src/RestApi/Internal/Report/PaymentInfoReport.php:356 msgid "Succeeded" msgstr "" -#: src/RestApi/Internal/Report/LatestPaymentsReport.php:196 +#: src/RestApi/Internal/Report/LatestPaymentsReport.php:190 #: src/RestApi/Internal/Report/PaymentInfoReport.php:354 msgid "Failed" msgstr "" -#: src/RestApi/Internal/Report/LatestPaymentsReport.php:198 -msgid "Refunded" -msgstr "" - -#: src/RestApi/Internal/Report/LatestPaymentsReport.php:200 -msgid "Partially Refunded" -msgstr "" - -#: src/RestApi/Internal/Report/LatestPaymentsReport.php:202 +#: src/RestApi/Internal/Report/LatestPaymentsReport.php:192 #: src/RestApi/Internal/Report/PaymentInfoReport.php:358 msgid "Incomplete" msgstr "" @@ -14279,6 +14179,11 @@ msgstr "" msgid "To speed up the process you can select from one of our pre-made templates or start with a basic form. Have a suggestion for a new template? We'd love to hear it!" msgstr "" +#: includes/core/assets/js/dist/simpay-admin-form-template-explorer.js:1 +#: includes/core/assets/js/dist/simpay-admin-help.js:1 +msgid "Reset search" +msgstr "" + #: includes/core/assets/js/dist/simpay-admin-form-template-explorer.js:1 msgid "Search for templates" msgstr "" @@ -14435,10 +14340,6 @@ msgstr "" msgid "Please select a different currency or check back later." msgstr "" -#: includes/core/assets/js/dist/simpay-admin-page-activity-reports.js:2 -msgid "%s refund was initiated" -msgstr "" - #: includes/core/assets/js/dist/simpay-admin-page-activity-reports.js:2 msgid "View customer records" msgstr "" diff --git a/lib/Symfony/Component/CssSelector/CHANGELOG.md b/lib/Symfony/Component/CssSelector/CHANGELOG.md index de81fa2e..4061ff20 100644 --- a/lib/Symfony/Component/CssSelector/CHANGELOG.md +++ b/lib/Symfony/Component/CssSelector/CHANGELOG.md @@ -1,11 +1,6 @@ CHANGELOG ========= -4.4.0 ------ - - * Added support for `*:only-of-type` - 2.8.0 ----- diff --git a/lib/Symfony/Component/CssSelector/CssSelectorConverter.php b/lib/Symfony/Component/CssSelector/CssSelectorConverter.php index 3a62cc43..ffd641e8 100644 --- a/lib/Symfony/Component/CssSelector/CssSelectorConverter.php +++ b/lib/Symfony/Component/CssSelector/CssSelectorConverter.php @@ -27,23 +27,16 @@ class CssSelectorConverter { private $translator; - private $cache; - - private static $xmlCache = []; - private static $htmlCache = []; /** * @param bool $html Whether HTML support should be enabled. Disable it for XML documents */ - public function __construct(bool $html = true) + public function __construct($html = true) { $this->translator = new Translator(); if ($html) { $this->translator->registerExtension(new HtmlExtension($this->translator)); - $this->cache = &self::$htmlCache; - } else { - $this->cache = &self::$xmlCache; } $this->translator @@ -60,10 +53,13 @@ public function __construct(bool $html = true) * Optionally, a prefix can be added to the resulting XPath * expression with the $prefix parameter. * + * @param string $cssExpr The CSS expression + * @param string $prefix An optional prefix for the XPath expression + * * @return string */ - public function toXPath(string $cssExpr, string $prefix = 'descendant-or-self::') + public function toXPath($cssExpr, $prefix = 'descendant-or-self::') { - return $this->cache[$prefix][$cssExpr] ?? $this->cache[$prefix][$cssExpr] = $this->translator->cssToXPath($cssExpr, $prefix); + return $this->translator->cssToXPath($cssExpr, $prefix); } } diff --git a/lib/Symfony/Component/CssSelector/Exception/ExceptionInterface.php b/lib/Symfony/Component/CssSelector/Exception/ExceptionInterface.php index 8c8c825e..649216a0 100644 --- a/lib/Symfony/Component/CssSelector/Exception/ExceptionInterface.php +++ b/lib/Symfony/Component/CssSelector/Exception/ExceptionInterface.php @@ -19,6 +19,6 @@ * * @author Jean-François Simon */ -interface ExceptionInterface extends \Throwable +interface ExceptionInterface { } diff --git a/lib/Symfony/Component/CssSelector/Exception/SyntaxErrorException.php b/lib/Symfony/Component/CssSelector/Exception/SyntaxErrorException.php index 1a5e279c..081a164e 100644 --- a/lib/Symfony/Component/CssSelector/Exception/SyntaxErrorException.php +++ b/lib/Symfony/Component/CssSelector/Exception/SyntaxErrorException.php @@ -24,25 +24,32 @@ class SyntaxErrorException extends ParseException { /** + * @param string $expectedValue + * * @return self */ - public static function unexpectedToken(string $expectedValue, Token $foundToken) + public static function unexpectedToken($expectedValue, Token $foundToken) { return new self(sprintf('Expected %s, but %s found.', $expectedValue, $foundToken)); } /** + * @param string $pseudoElement + * @param string $unexpectedLocation + * * @return self */ - public static function pseudoElementFound(string $pseudoElement, string $unexpectedLocation) + public static function pseudoElementFound($pseudoElement, $unexpectedLocation) { return new self(sprintf('Unexpected pseudo-element "::%s" found %s.', $pseudoElement, $unexpectedLocation)); } /** + * @param int $position + * * @return self */ - public static function unclosedString(int $position) + public static function unclosedString($position) { return new self(sprintf('Unclosed/invalid string at %s.', $position)); } diff --git a/lib/Symfony/Component/CssSelector/LICENSE b/lib/Symfony/Component/CssSelector/LICENSE index 0138f8f0..9e936ec0 100644 --- a/lib/Symfony/Component/CssSelector/LICENSE +++ b/lib/Symfony/Component/CssSelector/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-present Fabien Potencier +Copyright (c) 2004-2020 Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/lib/Symfony/Component/CssSelector/Node/AbstractNode.php b/lib/Symfony/Component/CssSelector/Node/AbstractNode.php index ce8fc043..0046a613 100644 --- a/lib/Symfony/Component/CssSelector/Node/AbstractNode.php +++ b/lib/Symfony/Component/CssSelector/Node/AbstractNode.php @@ -28,7 +28,10 @@ abstract class AbstractNode implements NodeInterface */ private $nodeName; - public function getNodeName(): string + /** + * @return string + */ + public function getNodeName() { if (null === $this->nodeName) { $this->nodeName = preg_replace('~.*\\\\([^\\\\]+)Node$~', '$1', static::class); diff --git a/lib/Symfony/Component/CssSelector/Node/AttributeNode.php b/lib/Symfony/Component/CssSelector/Node/AttributeNode.php index 5587ff0c..3fbccdfb 100644 --- a/lib/Symfony/Component/CssSelector/Node/AttributeNode.php +++ b/lib/Symfony/Component/CssSelector/Node/AttributeNode.php @@ -29,7 +29,13 @@ class AttributeNode extends AbstractNode private $operator; private $value; - public function __construct(NodeInterface $selector, ?string $namespace, string $attribute, string $operator, ?string $value) + /** + * @param string $namespace + * @param string $attribute + * @param string $operator + * @param string $value + */ + public function __construct(NodeInterface $selector, $namespace, $attribute, $operator, $value) { $this->selector = $selector; $this->namespace = $namespace; @@ -38,27 +44,42 @@ public function __construct(NodeInterface $selector, ?string $namespace, string $this->value = $value; } - public function getSelector(): NodeInterface + /** + * @return NodeInterface + */ + public function getSelector() { return $this->selector; } - public function getNamespace(): ?string + /** + * @return string + */ + public function getNamespace() { return $this->namespace; } - public function getAttribute(): string + /** + * @return string + */ + public function getAttribute() { return $this->attribute; } - public function getOperator(): string + /** + * @return string + */ + public function getOperator() { return $this->operator; } - public function getValue(): ?string + /** + * @return string + */ + public function getValue() { return $this->value; } @@ -66,12 +87,15 @@ public function getValue(): ?string /** * {@inheritdoc} */ - public function getSpecificity(): Specificity + public function getSpecificity() { return $this->selector->getSpecificity()->plus(new Specificity(0, 1, 0)); } - public function __toString(): string + /** + * {@inheritdoc} + */ + public function __toString() { $attribute = $this->namespace ? $this->namespace.'|'.$this->attribute : $this->attribute; diff --git a/lib/Symfony/Component/CssSelector/Node/ClassNode.php b/lib/Symfony/Component/CssSelector/Node/ClassNode.php index d03ea954..aa1e7603 100644 --- a/lib/Symfony/Component/CssSelector/Node/ClassNode.php +++ b/lib/Symfony/Component/CssSelector/Node/ClassNode.php @@ -26,18 +26,27 @@ class ClassNode extends AbstractNode private $selector; private $name; - public function __construct(NodeInterface $selector, string $name) + /** + * @param string $name + */ + public function __construct(NodeInterface $selector, $name) { $this->selector = $selector; $this->name = $name; } - public function getSelector(): NodeInterface + /** + * @return NodeInterface + */ + public function getSelector() { return $this->selector; } - public function getName(): string + /** + * @return string + */ + public function getName() { return $this->name; } @@ -45,12 +54,15 @@ public function getName(): string /** * {@inheritdoc} */ - public function getSpecificity(): Specificity + public function getSpecificity() { return $this->selector->getSpecificity()->plus(new Specificity(0, 1, 0)); } - public function __toString(): string + /** + * {@inheritdoc} + */ + public function __toString() { return sprintf('%s[%s.%s]', $this->getNodeName(), $this->selector, $this->name); } diff --git a/lib/Symfony/Component/CssSelector/Node/CombinedSelectorNode.php b/lib/Symfony/Component/CssSelector/Node/CombinedSelectorNode.php index 09832c16..964659c6 100644 --- a/lib/Symfony/Component/CssSelector/Node/CombinedSelectorNode.php +++ b/lib/Symfony/Component/CssSelector/Node/CombinedSelectorNode.php @@ -27,24 +27,36 @@ class CombinedSelectorNode extends AbstractNode private $combinator; private $subSelector; - public function __construct(NodeInterface $selector, string $combinator, NodeInterface $subSelector) + /** + * @param string $combinator + */ + public function __construct(NodeInterface $selector, $combinator, NodeInterface $subSelector) { $this->selector = $selector; $this->combinator = $combinator; $this->subSelector = $subSelector; } - public function getSelector(): NodeInterface + /** + * @return NodeInterface + */ + public function getSelector() { return $this->selector; } - public function getCombinator(): string + /** + * @return string + */ + public function getCombinator() { return $this->combinator; } - public function getSubSelector(): NodeInterface + /** + * @return NodeInterface + */ + public function getSubSelector() { return $this->subSelector; } @@ -52,12 +64,15 @@ public function getSubSelector(): NodeInterface /** * {@inheritdoc} */ - public function getSpecificity(): Specificity + public function getSpecificity() { return $this->selector->getSpecificity()->plus($this->subSelector->getSpecificity()); } - public function __toString(): string + /** + * {@inheritdoc} + */ + public function __toString() { $combinator = ' ' === $this->combinator ? '' : $this->combinator; diff --git a/lib/Symfony/Component/CssSelector/Node/ElementNode.php b/lib/Symfony/Component/CssSelector/Node/ElementNode.php index a68b629b..ce28f31b 100644 --- a/lib/Symfony/Component/CssSelector/Node/ElementNode.php +++ b/lib/Symfony/Component/CssSelector/Node/ElementNode.php @@ -26,18 +26,28 @@ class ElementNode extends AbstractNode private $namespace; private $element; - public function __construct(?string $namespace = null, ?string $element = null) + /** + * @param string|null $namespace + * @param string|null $element + */ + public function __construct($namespace = null, $element = null) { $this->namespace = $namespace; $this->element = $element; } - public function getNamespace(): ?string + /** + * @return string|null + */ + public function getNamespace() { return $this->namespace; } - public function getElement(): ?string + /** + * @return string|null + */ + public function getElement() { return $this->element; } @@ -45,12 +55,15 @@ public function getElement(): ?string /** * {@inheritdoc} */ - public function getSpecificity(): Specificity + public function getSpecificity() { return new Specificity(0, 0, $this->element ? 1 : 0); } - public function __toString(): string + /** + * {@inheritdoc} + */ + public function __toString() { $element = $this->element ?: '*'; diff --git a/lib/Symfony/Component/CssSelector/Node/FunctionNode.php b/lib/Symfony/Component/CssSelector/Node/FunctionNode.php index 14d07b1c..311fc648 100644 --- a/lib/Symfony/Component/CssSelector/Node/FunctionNode.php +++ b/lib/Symfony/Component/CssSelector/Node/FunctionNode.php @@ -30,21 +30,28 @@ class FunctionNode extends AbstractNode private $arguments; /** + * @param string $name * @param Token[] $arguments */ - public function __construct(NodeInterface $selector, string $name, array $arguments = []) + public function __construct(NodeInterface $selector, $name, array $arguments = []) { $this->selector = $selector; $this->name = strtolower($name); $this->arguments = $arguments; } - public function getSelector(): NodeInterface + /** + * @return NodeInterface + */ + public function getSelector() { return $this->selector; } - public function getName(): string + /** + * @return string + */ + public function getName() { return $this->name; } @@ -52,7 +59,7 @@ public function getName(): string /** * @return Token[] */ - public function getArguments(): array + public function getArguments() { return $this->arguments; } @@ -60,12 +67,15 @@ public function getArguments(): array /** * {@inheritdoc} */ - public function getSpecificity(): Specificity + public function getSpecificity() { return $this->selector->getSpecificity()->plus(new Specificity(0, 1, 0)); } - public function __toString(): string + /** + * {@inheritdoc} + */ + public function __toString() { $arguments = implode(', ', array_map(function (Token $token) { return "'".$token->getValue()."'"; diff --git a/lib/Symfony/Component/CssSelector/Node/HashNode.php b/lib/Symfony/Component/CssSelector/Node/HashNode.php index 524ac76a..a6bd2394 100644 --- a/lib/Symfony/Component/CssSelector/Node/HashNode.php +++ b/lib/Symfony/Component/CssSelector/Node/HashNode.php @@ -26,18 +26,27 @@ class HashNode extends AbstractNode private $selector; private $id; - public function __construct(NodeInterface $selector, string $id) + /** + * @param string $id + */ + public function __construct(NodeInterface $selector, $id) { $this->selector = $selector; $this->id = $id; } - public function getSelector(): NodeInterface + /** + * @return NodeInterface + */ + public function getSelector() { return $this->selector; } - public function getId(): string + /** + * @return string + */ + public function getId() { return $this->id; } @@ -45,12 +54,15 @@ public function getId(): string /** * {@inheritdoc} */ - public function getSpecificity(): Specificity + public function getSpecificity() { return $this->selector->getSpecificity()->plus(new Specificity(1, 0, 0)); } - public function __toString(): string + /** + * {@inheritdoc} + */ + public function __toString() { return sprintf('%s[%s#%s]', $this->getNodeName(), $this->selector, $this->id); } diff --git a/lib/Symfony/Component/CssSelector/Node/NegationNode.php b/lib/Symfony/Component/CssSelector/Node/NegationNode.php index 39010ca6..d014c76d 100644 --- a/lib/Symfony/Component/CssSelector/Node/NegationNode.php +++ b/lib/Symfony/Component/CssSelector/Node/NegationNode.php @@ -32,12 +32,18 @@ public function __construct(NodeInterface $selector, NodeInterface $subSelector) $this->subSelector = $subSelector; } - public function getSelector(): NodeInterface + /** + * @return NodeInterface + */ + public function getSelector() { return $this->selector; } - public function getSubSelector(): NodeInterface + /** + * @return NodeInterface + */ + public function getSubSelector() { return $this->subSelector; } @@ -45,12 +51,15 @@ public function getSubSelector(): NodeInterface /** * {@inheritdoc} */ - public function getSpecificity(): Specificity + public function getSpecificity() { return $this->selector->getSpecificity()->plus($this->subSelector->getSpecificity()); } - public function __toString(): string + /** + * {@inheritdoc} + */ + public function __toString() { return sprintf('%s[%s:not(%s)]', $this->getNodeName(), $this->selector, $this->subSelector); } diff --git a/lib/Symfony/Component/CssSelector/Node/NodeInterface.php b/lib/Symfony/Component/CssSelector/Node/NodeInterface.php index e2eb3b22..4ceafd24 100644 --- a/lib/Symfony/Component/CssSelector/Node/NodeInterface.php +++ b/lib/Symfony/Component/CssSelector/Node/NodeInterface.php @@ -23,9 +23,24 @@ */ interface NodeInterface { - public function getNodeName(): string; + /** + * Returns node's name. + * + * @return string + */ + public function getNodeName(); - public function getSpecificity(): Specificity; + /** + * Returns node's specificity. + * + * @return Specificity + */ + public function getSpecificity(); - public function __toString(): string; + /** + * Returns node's string representation. + * + * @return string + */ + public function __toString(); } diff --git a/lib/Symfony/Component/CssSelector/Node/PseudoNode.php b/lib/Symfony/Component/CssSelector/Node/PseudoNode.php index 4a20145c..6772b0db 100644 --- a/lib/Symfony/Component/CssSelector/Node/PseudoNode.php +++ b/lib/Symfony/Component/CssSelector/Node/PseudoNode.php @@ -26,18 +26,27 @@ class PseudoNode extends AbstractNode private $selector; private $identifier; - public function __construct(NodeInterface $selector, string $identifier) + /** + * @param string $identifier + */ + public function __construct(NodeInterface $selector, $identifier) { $this->selector = $selector; $this->identifier = strtolower($identifier); } - public function getSelector(): NodeInterface + /** + * @return NodeInterface + */ + public function getSelector() { return $this->selector; } - public function getIdentifier(): string + /** + * @return string + */ + public function getIdentifier() { return $this->identifier; } @@ -45,12 +54,15 @@ public function getIdentifier(): string /** * {@inheritdoc} */ - public function getSpecificity(): Specificity + public function getSpecificity() { return $this->selector->getSpecificity()->plus(new Specificity(0, 1, 0)); } - public function __toString(): string + /** + * {@inheritdoc} + */ + public function __toString() { return sprintf('%s[%s:%s]', $this->getNodeName(), $this->selector, $this->identifier); } diff --git a/lib/Symfony/Component/CssSelector/Node/SelectorNode.php b/lib/Symfony/Component/CssSelector/Node/SelectorNode.php index c9b30c41..8f7807ab 100644 --- a/lib/Symfony/Component/CssSelector/Node/SelectorNode.php +++ b/lib/Symfony/Component/CssSelector/Node/SelectorNode.php @@ -26,18 +26,27 @@ class SelectorNode extends AbstractNode private $tree; private $pseudoElement; - public function __construct(NodeInterface $tree, ?string $pseudoElement = null) + /** + * @param string|null $pseudoElement + */ + public function __construct(NodeInterface $tree, $pseudoElement = null) { $this->tree = $tree; $this->pseudoElement = $pseudoElement ? strtolower($pseudoElement) : null; } - public function getTree(): NodeInterface + /** + * @return NodeInterface + */ + public function getTree() { return $this->tree; } - public function getPseudoElement(): ?string + /** + * @return string|null + */ + public function getPseudoElement() { return $this->pseudoElement; } @@ -45,12 +54,15 @@ public function getPseudoElement(): ?string /** * {@inheritdoc} */ - public function getSpecificity(): Specificity + public function getSpecificity() { return $this->tree->getSpecificity()->plus(new Specificity(0, 0, $this->pseudoElement ? 1 : 0)); } - public function __toString(): string + /** + * {@inheritdoc} + */ + public function __toString() { return sprintf('%s[%s%s]', $this->getNodeName(), $this->tree, $this->pseudoElement ? '::'.$this->pseudoElement : ''); } diff --git a/lib/Symfony/Component/CssSelector/Node/Specificity.php b/lib/Symfony/Component/CssSelector/Node/Specificity.php index 3dcf7ab4..a473dd7f 100644 --- a/lib/Symfony/Component/CssSelector/Node/Specificity.php +++ b/lib/Symfony/Component/CssSelector/Node/Specificity.php @@ -25,27 +25,40 @@ */ class Specificity { - public const A_FACTOR = 100; - public const B_FACTOR = 10; - public const C_FACTOR = 1; + const A_FACTOR = 100; + const B_FACTOR = 10; + const C_FACTOR = 1; private $a; private $b; private $c; - public function __construct(int $a, int $b, int $c) + /** + * @param int $a + * @param int $b + * @param int $c + */ + public function __construct($a, $b, $c) { $this->a = $a; $this->b = $b; $this->c = $c; } - public function plus(self $specificity): self + /** + * @return self + */ + public function plus(self $specificity) { return new self($this->a + $specificity->a, $this->b + $specificity->b, $this->c + $specificity->c); } - public function getValue(): int + /** + * Returns global specificity value. + * + * @return int + */ + public function getValue() { return $this->a * self::A_FACTOR + $this->b * self::B_FACTOR + $this->c * self::C_FACTOR; } @@ -53,8 +66,10 @@ public function getValue(): int /** * Returns -1 if the object specificity is lower than the argument, * 0 if they are equal, and 1 if the argument is lower. + * + * @return int */ - public function compareTo(self $specificity): int + public function compareTo(self $specificity) { if ($this->a !== $specificity->a) { return $this->a > $specificity->a ? 1 : -1; diff --git a/lib/Symfony/Component/CssSelector/Parser/Handler/CommentHandler.php b/lib/Symfony/Component/CssSelector/Parser/Handler/CommentHandler.php index fefe062f..1d3feb7a 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Handler/CommentHandler.php +++ b/lib/Symfony/Component/CssSelector/Parser/Handler/CommentHandler.php @@ -29,7 +29,7 @@ class CommentHandler implements HandlerInterface /** * {@inheritdoc} */ - public function handle(Reader $reader, TokenStream $stream): bool + public function handle(Reader $reader, TokenStream $stream) { if ('/*' !== $reader->getSubstring(2)) { return false; diff --git a/lib/Symfony/Component/CssSelector/Parser/Handler/HandlerInterface.php b/lib/Symfony/Component/CssSelector/Parser/Handler/HandlerInterface.php index 53889e4a..6716e91b 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Handler/HandlerInterface.php +++ b/lib/Symfony/Component/CssSelector/Parser/Handler/HandlerInterface.php @@ -26,5 +26,8 @@ */ interface HandlerInterface { - public function handle(Reader $reader, TokenStream $stream): bool; + /** + * @return bool + */ + public function handle(Reader $reader, TokenStream $stream); } diff --git a/lib/Symfony/Component/CssSelector/Parser/Handler/HashHandler.php b/lib/Symfony/Component/CssSelector/Parser/Handler/HashHandler.php index 2730de70..87d2f57e 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Handler/HashHandler.php +++ b/lib/Symfony/Component/CssSelector/Parser/Handler/HashHandler.php @@ -41,7 +41,7 @@ public function __construct(TokenizerPatterns $patterns, TokenizerEscaping $esca /** * {@inheritdoc} */ - public function handle(Reader $reader, TokenStream $stream): bool + public function handle(Reader $reader, TokenStream $stream) { $match = $reader->findPattern($this->patterns->getHashPattern()); diff --git a/lib/Symfony/Component/CssSelector/Parser/Handler/IdentifierHandler.php b/lib/Symfony/Component/CssSelector/Parser/Handler/IdentifierHandler.php index 1744e421..5146fb6d 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Handler/IdentifierHandler.php +++ b/lib/Symfony/Component/CssSelector/Parser/Handler/IdentifierHandler.php @@ -41,7 +41,7 @@ public function __construct(TokenizerPatterns $patterns, TokenizerEscaping $esca /** * {@inheritdoc} */ - public function handle(Reader $reader, TokenStream $stream): bool + public function handle(Reader $reader, TokenStream $stream) { $match = $reader->findPattern($this->patterns->getIdentifierPattern()); diff --git a/lib/Symfony/Component/CssSelector/Parser/Handler/NumberHandler.php b/lib/Symfony/Component/CssSelector/Parser/Handler/NumberHandler.php index 8c831035..6bf8355a 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Handler/NumberHandler.php +++ b/lib/Symfony/Component/CssSelector/Parser/Handler/NumberHandler.php @@ -38,7 +38,7 @@ public function __construct(TokenizerPatterns $patterns) /** * {@inheritdoc} */ - public function handle(Reader $reader, TokenStream $stream): bool + public function handle(Reader $reader, TokenStream $stream) { $match = $reader->findPattern($this->patterns->getNumberPattern()); diff --git a/lib/Symfony/Component/CssSelector/Parser/Handler/StringHandler.php b/lib/Symfony/Component/CssSelector/Parser/Handler/StringHandler.php index 89a331b6..10efd0f1 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Handler/StringHandler.php +++ b/lib/Symfony/Component/CssSelector/Parser/Handler/StringHandler.php @@ -43,7 +43,7 @@ public function __construct(TokenizerPatterns $patterns, TokenizerEscaping $esca /** * {@inheritdoc} */ - public function handle(Reader $reader, TokenStream $stream): bool + public function handle(Reader $reader, TokenStream $stream) { $quote = $reader->getSubstring(1); diff --git a/lib/Symfony/Component/CssSelector/Parser/Handler/WhitespaceHandler.php b/lib/Symfony/Component/CssSelector/Parser/Handler/WhitespaceHandler.php index bae5c97c..2c712021 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Handler/WhitespaceHandler.php +++ b/lib/Symfony/Component/CssSelector/Parser/Handler/WhitespaceHandler.php @@ -30,7 +30,7 @@ class WhitespaceHandler implements HandlerInterface /** * {@inheritdoc} */ - public function handle(Reader $reader, TokenStream $stream): bool + public function handle(Reader $reader, TokenStream $stream) { $match = $reader->findPattern('~^[ \t\r\n\f]+~'); diff --git a/lib/Symfony/Component/CssSelector/Parser/Parser.php b/lib/Symfony/Component/CssSelector/Parser/Parser.php index 5cd87d55..dc6e2b92 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Parser.php +++ b/lib/Symfony/Component/CssSelector/Parser/Parser.php @@ -29,15 +29,15 @@ class Parser implements ParserInterface { private $tokenizer; - public function __construct(?Tokenizer $tokenizer = null) + public function __construct(Tokenizer $tokenizer = null) { - $this->tokenizer = $tokenizer ?? new Tokenizer(); + $this->tokenizer = $tokenizer ?: new Tokenizer(); } /** * {@inheritdoc} */ - public function parse(string $source): array + public function parse($source) { $reader = new Reader($source); $stream = $this->tokenizer->tokenize($reader); @@ -50,9 +50,11 @@ public function parse(string $source): array * * @param Token[] $tokens * + * @return array + * * @throws SyntaxErrorException */ - public static function parseSeries(array $tokens): array + public static function parseSeries(array $tokens) { foreach ($tokens as $token) { if ($token->isString()) { @@ -79,12 +81,12 @@ public static function parseSeries(array $tokens): array return [2, 0]; case 'n' === $joined: return [1, 0]; - case !str_contains($joined, 'n'): + case false === strpos($joined, 'n'): return [0, $int($joined)]; } $split = explode('n', $joined); - $first = $split[0] ?? null; + $first = isset($split[0]) ? $split[0] : null; return [ $first ? ('-' === $first || '+' === $first ? $int($first.'1') : $int($first)) : 1, @@ -92,7 +94,12 @@ public static function parseSeries(array $tokens): array ]; } - private function parseSelectorList(TokenStream $stream): array + /** + * Parses selector nodes. + * + * @return array + */ + private function parseSelectorList(TokenStream $stream) { $stream->skipWhitespace(); $selectors = []; @@ -111,9 +118,16 @@ private function parseSelectorList(TokenStream $stream): array return $selectors; } - private function parserSelectorNode(TokenStream $stream): Node\SelectorNode + /** + * Parses next selector or combined node. + * + * @return Node\SelectorNode + * + * @throws SyntaxErrorException + */ + private function parserSelectorNode(TokenStream $stream) { - [$result, $pseudoElement] = $this->parseSimpleSelector($stream); + list($result, $pseudoElement) = $this->parseSimpleSelector($stream); while (true) { $stream->skipWhitespace(); @@ -134,7 +148,7 @@ private function parserSelectorNode(TokenStream $stream): Node\SelectorNode $combinator = ' '; } - [$nextSelector, $pseudoElement] = $this->parseSimpleSelector($stream); + list($nextSelector, $pseudoElement) = $this->parseSimpleSelector($stream); $result = new Node\CombinedSelectorNode($result, $combinator, $nextSelector); } @@ -144,9 +158,13 @@ private function parserSelectorNode(TokenStream $stream): Node\SelectorNode /** * Parses next simple node (hash, class, pseudo, negation). * + * @param bool $insideNegation + * + * @return array + * * @throws SyntaxErrorException */ - private function parseSimpleSelector(TokenStream $stream, bool $insideNegation = false): array + private function parseSimpleSelector(TokenStream $stream, $insideNegation = false) { $stream->skipWhitespace(); @@ -209,7 +227,7 @@ private function parseSimpleSelector(TokenStream $stream, bool $insideNegation = throw SyntaxErrorException::nestedNot(); } - [$argument, $argumentPseudoElement] = $this->parseSimpleSelector($stream, true); + list($argument, $argumentPseudoElement) = $this->parseSimpleSelector($stream, true); $next = $stream->getNext(); if (null !== $argumentPseudoElement) { @@ -260,7 +278,12 @@ private function parseSimpleSelector(TokenStream $stream, bool $insideNegation = return [$result, $pseudoElement]; } - private function parseElementNode(TokenStream $stream): Node\ElementNode + /** + * Parses next element node. + * + * @return Node\ElementNode + */ + private function parseElementNode(TokenStream $stream) { $peek = $stream->getPeek(); @@ -286,7 +309,14 @@ private function parseElementNode(TokenStream $stream): Node\ElementNode return new Node\ElementNode($namespace, $element); } - private function parseAttributeNode(Node\NodeInterface $selector, TokenStream $stream): Node\AttributeNode + /** + * Parses next attribute node. + * + * @return Node\AttributeNode + * + * @throws SyntaxErrorException + */ + private function parseAttributeNode(Node\NodeInterface $selector, TokenStream $stream) { $stream->skipWhitespace(); $attribute = $stream->getNextIdentifierOrStar(); diff --git a/lib/Symfony/Component/CssSelector/Parser/ParserInterface.php b/lib/Symfony/Component/CssSelector/Parser/ParserInterface.php index d693befa..0690f95f 100644 --- a/lib/Symfony/Component/CssSelector/Parser/ParserInterface.php +++ b/lib/Symfony/Component/CssSelector/Parser/ParserInterface.php @@ -28,7 +28,9 @@ interface ParserInterface /** * Parses given selector source into an array of tokens. * + * @param string $source + * * @return SelectorNode[] */ - public function parse(string $source): array; + public function parse($source); } diff --git a/lib/Symfony/Component/CssSelector/Parser/Reader.php b/lib/Symfony/Component/CssSelector/Parser/Reader.php index b04a6c07..ebd5fc51 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Reader.php +++ b/lib/Symfony/Component/CssSelector/Parser/Reader.php @@ -27,33 +27,56 @@ class Reader private $length; private $position = 0; - public function __construct(string $source) + /** + * @param string $source + */ + public function __construct($source) { $this->source = $source; $this->length = \strlen($source); } - public function isEOF(): bool + /** + * @return bool + */ + public function isEOF() { return $this->position >= $this->length; } - public function getPosition(): int + /** + * @return int + */ + public function getPosition() { return $this->position; } - public function getRemainingLength(): int + /** + * @return int + */ + public function getRemainingLength() { return $this->length - $this->position; } - public function getSubstring(int $length, int $offset = 0): string + /** + * @param int $length + * @param int $offset + * + * @return string + */ + public function getSubstring($length, $offset = 0) { return substr($this->source, $this->position + $offset, $length); } - public function getOffset(string $string) + /** + * @param string $string + * + * @return int + */ + public function getOffset($string) { $position = strpos($this->source, $string, $this->position); @@ -61,9 +84,11 @@ public function getOffset(string $string) } /** + * @param string $pattern + * * @return array|false */ - public function findPattern(string $pattern) + public function findPattern($pattern) { $source = substr($this->source, $this->position); @@ -74,7 +99,10 @@ public function findPattern(string $pattern) return false; } - public function moveForward(int $length) + /** + * @param int $length + */ + public function moveForward($length) { $this->position += $length; } diff --git a/lib/Symfony/Component/CssSelector/Parser/Shortcut/ClassParser.php b/lib/Symfony/Component/CssSelector/Parser/Shortcut/ClassParser.php index a026faa7..985baec8 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Shortcut/ClassParser.php +++ b/lib/Symfony/Component/CssSelector/Parser/Shortcut/ClassParser.php @@ -31,7 +31,7 @@ class ClassParser implements ParserInterface /** * {@inheritdoc} */ - public function parse(string $source): array + public function parse($source) { // Matches an optional namespace, optional element, and required class // $source = 'test|input.ab6bd_field'; diff --git a/lib/Symfony/Component/CssSelector/Parser/Shortcut/ElementParser.php b/lib/Symfony/Component/CssSelector/Parser/Shortcut/ElementParser.php index a0c4afaa..97bf6de3 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Shortcut/ElementParser.php +++ b/lib/Symfony/Component/CssSelector/Parser/Shortcut/ElementParser.php @@ -30,7 +30,7 @@ class ElementParser implements ParserInterface /** * {@inheritdoc} */ - public function parse(string $source): array + public function parse($source) { // Matches an optional namespace, required element or `*` // $source = 'testns|testel'; diff --git a/lib/Symfony/Component/CssSelector/Parser/Shortcut/EmptyStringParser.php b/lib/Symfony/Component/CssSelector/Parser/Shortcut/EmptyStringParser.php index c5c82a9b..24f9a459 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Shortcut/EmptyStringParser.php +++ b/lib/Symfony/Component/CssSelector/Parser/Shortcut/EmptyStringParser.php @@ -34,7 +34,7 @@ class EmptyStringParser implements ParserInterface /** * {@inheritdoc} */ - public function parse(string $source): array + public function parse($source) { // Matches an empty string if ('' == $source) { diff --git a/lib/Symfony/Component/CssSelector/Parser/Shortcut/HashParser.php b/lib/Symfony/Component/CssSelector/Parser/Shortcut/HashParser.php index bcab6fe8..f65a2587 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Shortcut/HashParser.php +++ b/lib/Symfony/Component/CssSelector/Parser/Shortcut/HashParser.php @@ -31,7 +31,7 @@ class HashParser implements ParserInterface /** * {@inheritdoc} */ - public function parse(string $source): array + public function parse($source) { // Matches an optional namespace, optional element, and required id // $source = 'test|input#ab6bd_field'; diff --git a/lib/Symfony/Component/CssSelector/Parser/Token.php b/lib/Symfony/Component/CssSelector/Parser/Token.php index 735cf47d..f647e103 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Token.php +++ b/lib/Symfony/Component/CssSelector/Parser/Token.php @@ -23,46 +23,66 @@ */ class Token { - public const TYPE_FILE_END = 'eof'; - public const TYPE_DELIMITER = 'delimiter'; - public const TYPE_WHITESPACE = 'whitespace'; - public const TYPE_IDENTIFIER = 'identifier'; - public const TYPE_HASH = 'hash'; - public const TYPE_NUMBER = 'number'; - public const TYPE_STRING = 'string'; + const TYPE_FILE_END = 'eof'; + const TYPE_DELIMITER = 'delimiter'; + const TYPE_WHITESPACE = 'whitespace'; + const TYPE_IDENTIFIER = 'identifier'; + const TYPE_HASH = 'hash'; + const TYPE_NUMBER = 'number'; + const TYPE_STRING = 'string'; private $type; private $value; private $position; - public function __construct(?string $type, ?string $value, ?int $position) + /** + * @param int $type + * @param string $value + * @param int $position + */ + public function __construct($type, $value, $position) { $this->type = $type; $this->value = $value; $this->position = $position; } - public function getType(): ?int + /** + * @return int + */ + public function getType() { return $this->type; } - public function getValue(): ?string + /** + * @return string + */ + public function getValue() { return $this->value; } - public function getPosition(): ?int + /** + * @return int + */ + public function getPosition() { return $this->position; } - public function isFileEnd(): bool + /** + * @return bool + */ + public function isFileEnd() { return self::TYPE_FILE_END === $this->type; } - public function isDelimiter(array $values = []): bool + /** + * @return bool + */ + public function isDelimiter(array $values = []) { if (self::TYPE_DELIMITER !== $this->type) { return false; @@ -75,32 +95,50 @@ public function isDelimiter(array $values = []): bool return \in_array($this->value, $values); } - public function isWhitespace(): bool + /** + * @return bool + */ + public function isWhitespace() { return self::TYPE_WHITESPACE === $this->type; } - public function isIdentifier(): bool + /** + * @return bool + */ + public function isIdentifier() { return self::TYPE_IDENTIFIER === $this->type; } - public function isHash(): bool + /** + * @return bool + */ + public function isHash() { return self::TYPE_HASH === $this->type; } - public function isNumber(): bool + /** + * @return bool + */ + public function isNumber() { return self::TYPE_NUMBER === $this->type; } - public function isString(): bool + /** + * @return bool + */ + public function isString() { return self::TYPE_STRING === $this->type; } - public function __toString(): string + /** + * @return string + */ + public function __toString() { if ($this->value) { return sprintf('<%s "%s" at %s>', $this->type, $this->value, $this->position); diff --git a/lib/Symfony/Component/CssSelector/Parser/TokenStream.php b/lib/Symfony/Component/CssSelector/Parser/TokenStream.php index 28af1ca1..e8cbbb61 100644 --- a/lib/Symfony/Component/CssSelector/Parser/TokenStream.php +++ b/lib/Symfony/Component/CssSelector/Parser/TokenStream.php @@ -56,7 +56,7 @@ class TokenStream * * @return $this */ - public function push(Token $token): self + public function push(Token $token) { $this->tokens[] = $token; @@ -68,7 +68,7 @@ public function push(Token $token): self * * @return $this */ - public function freeze(): self + public function freeze() { return $this; } @@ -76,9 +76,11 @@ public function freeze(): self /** * Returns next token. * + * @return Token + * * @throws InternalErrorException If there is no more token */ - public function getNext(): Token + public function getNext() { if ($this->peeking) { $this->peeking = false; @@ -96,8 +98,10 @@ public function getNext(): Token /** * Returns peeked token. + * + * @return Token */ - public function getPeek(): Token + public function getPeek() { if (!$this->peeking) { $this->peeked = $this->getNext(); @@ -112,17 +116,19 @@ public function getPeek(): Token * * @return Token[] */ - public function getUsed(): array + public function getUsed() { return $this->used; } /** - * Returns next identifier token. + * Returns nex identifier token. + * + * @return string The identifier token value * * @throws SyntaxErrorException If next token is not an identifier */ - public function getNextIdentifier(): string + public function getNextIdentifier() { $next = $this->getNext(); @@ -134,11 +140,13 @@ public function getNextIdentifier(): string } /** - * Returns next identifier or null if star delimiter token is found. + * Returns nex identifier or star delimiter token. + * + * @return string|null The identifier token value or null if star found * * @throws SyntaxErrorException If next token is not an identifier or a star delimiter */ - public function getNextIdentifierOrStar(): ?string + public function getNextIdentifierOrStar() { $next = $this->getNext(); diff --git a/lib/Symfony/Component/CssSelector/Parser/Tokenizer/Tokenizer.php b/lib/Symfony/Component/CssSelector/Parser/Tokenizer/Tokenizer.php index 643cc8e5..adfd3d55 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Tokenizer/Tokenizer.php +++ b/lib/Symfony/Component/CssSelector/Parser/Tokenizer/Tokenizer.php @@ -50,8 +50,10 @@ public function __construct() /** * Tokenize selector source code. + * + * @return TokenStream */ - public function tokenize(Reader $reader): TokenStream + public function tokenize(Reader $reader) { $stream = new TokenStream(); diff --git a/lib/Symfony/Component/CssSelector/Parser/Tokenizer/TokenizerEscaping.php b/lib/Symfony/Component/CssSelector/Parser/Tokenizer/TokenizerEscaping.php index b476fbbd..4dd83403 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Tokenizer/TokenizerEscaping.php +++ b/lib/Symfony/Component/CssSelector/Parser/Tokenizer/TokenizerEscaping.php @@ -30,21 +30,36 @@ public function __construct(TokenizerPatterns $patterns) $this->patterns = $patterns; } - public function escapeUnicode(string $value): string + /** + * @param string $value + * + * @return string + */ + public function escapeUnicode($value) { $value = $this->replaceUnicodeSequences($value); return preg_replace($this->patterns->getSimpleEscapePattern(), '$1', $value); } - public function escapeUnicodeAndNewLine(string $value): string + /** + * @param string $value + * + * @return string + */ + public function escapeUnicodeAndNewLine($value) { $value = preg_replace($this->patterns->getNewLineEscapePattern(), '', $value); return $this->escapeUnicode($value); } - private function replaceUnicodeSequences(string $value): string + /** + * @param string $value + * + * @return string + */ + private function replaceUnicodeSequences($value) { return preg_replace_callback($this->patterns->getUnicodeEscapePattern(), function ($match) { $c = hexdec($match[1]); diff --git a/lib/Symfony/Component/CssSelector/Parser/Tokenizer/TokenizerPatterns.php b/lib/Symfony/Component/CssSelector/Parser/Tokenizer/TokenizerPatterns.php index a3f91c8e..fec6d044 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Tokenizer/TokenizerPatterns.php +++ b/lib/Symfony/Component/CssSelector/Parser/Tokenizer/TokenizerPatterns.php @@ -49,40 +49,63 @@ public function __construct() $this->identifierPattern = '-?(?:'.$this->nmStartPattern.')(?:'.$this->nmCharPattern.')*'; $this->hashPattern = '#((?:'.$this->nmCharPattern.')+)'; $this->numberPattern = '[+-]?(?:[0-9]*\.[0-9]+|[0-9]+)'; - $this->quotedStringPattern = '([^\n\r\f\\\\%s]|'.$this->stringEscapePattern.')*'; + $this->quotedStringPattern = '([^\n\r\f%s]|'.$this->stringEscapePattern.')*'; } - public function getNewLineEscapePattern(): string + /** + * @return string + */ + public function getNewLineEscapePattern() { - return '~'.$this->newLineEscapePattern.'~'; + return '~^'.$this->newLineEscapePattern.'~'; } - public function getSimpleEscapePattern(): string + /** + * @return string + */ + public function getSimpleEscapePattern() { - return '~'.$this->simpleEscapePattern.'~'; + return '~^'.$this->simpleEscapePattern.'~'; } - public function getUnicodeEscapePattern(): string + /** + * @return string + */ + public function getUnicodeEscapePattern() { - return '~'.$this->unicodeEscapePattern.'~i'; + return '~^'.$this->unicodeEscapePattern.'~i'; } - public function getIdentifierPattern(): string + /** + * @return string + */ + public function getIdentifierPattern() { return '~^'.$this->identifierPattern.'~i'; } - public function getHashPattern(): string + /** + * @return string + */ + public function getHashPattern() { return '~^'.$this->hashPattern.'~i'; } - public function getNumberPattern(): string + /** + * @return string + */ + public function getNumberPattern() { return '~^'.$this->numberPattern.'~'; } - public function getQuotedStringPattern(string $quote): string + /** + * @param string $quote + * + * @return string + */ + public function getQuotedStringPattern($quote) { return '~^'.sprintf($this->quotedStringPattern, $quote).'~i'; } diff --git a/lib/Symfony/Component/CssSelector/README.md b/lib/Symfony/Component/CssSelector/README.md index ede4a3ac..7c4c4116 100644 --- a/lib/Symfony/Component/CssSelector/README.md +++ b/lib/Symfony/Component/CssSelector/README.md @@ -6,11 +6,11 @@ The CssSelector component converts CSS selectors to XPath expressions. Resources --------- - * [Documentation](https://symfony.com/doc/current/components/css_selector.html) - * [Contributing](https://symfony.com/doc/current/contributing/index.html) - * [Report issues](https://github.com/symfony/symfony/issues) and - [send Pull Requests](https://github.com/symfony/symfony/pulls) - in the [main Symfony repository](https://github.com/symfony/symfony) + * [Documentation](https://symfony.com/doc/current/components/css_selector.html) + * [Contributing](https://symfony.com/doc/current/contributing/index.html) + * [Report issues](https://github.com/symfony/symfony/issues) and + [send Pull Requests](https://github.com/symfony/symfony/pulls) + in the [main Symfony repository](https://github.com/symfony/symfony) Credits ------- diff --git a/lib/Symfony/Component/CssSelector/Tests/CssSelectorConverterTest.php b/lib/Symfony/Component/CssSelector/Tests/CssSelectorConverterTest.php new file mode 100644 index 00000000..68e98c4f --- /dev/null +++ b/lib/Symfony/Component/CssSelector/Tests/CssSelectorConverterTest.php @@ -0,0 +1,74 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests; + +use PHPUnit\Framework\TestCase; +use SimplePay\Vendor\Symfony\Component\CssSelector\CssSelectorConverter; + +class CssSelectorConverterTest extends TestCase +{ + public function testCssToXPath() + { + $converter = new CssSelectorConverter(); + + $this->assertEquals('descendant-or-self::*', $converter->toXPath('')); + $this->assertEquals('descendant-or-self::h1', $converter->toXPath('h1')); + $this->assertEquals("descendant-or-self::h1[@id = 'foo']", $converter->toXPath('h1#foo')); + $this->assertEquals("descendant-or-self::h1[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]", $converter->toXPath('h1.foo')); + $this->assertEquals('descendant-or-self::foo:h1', $converter->toXPath('foo|h1')); + $this->assertEquals('descendant-or-self::h1', $converter->toXPath('H1')); + } + + public function testCssToXPathXml() + { + $converter = new CssSelectorConverter(false); + + $this->assertEquals('descendant-or-self::H1', $converter->toXPath('H1')); + } + + public function testParseExceptions() + { + $this->expectException('SimplePay\Vendor\Symfony\Component\CssSelector\Exception\ParseException'); + $this->expectExceptionMessage('Expected identifier, but found.'); + $converter = new CssSelectorConverter(); + $converter->toXPath('h1:'); + } + + /** @dataProvider getCssToXPathWithoutPrefixTestData */ + public function testCssToXPathWithoutPrefix($css, $xpath) + { + $converter = new CssSelectorConverter(); + + $this->assertEquals($xpath, $converter->toXPath($css, ''), '->parse() parses an input string and returns a node'); + } + + public function getCssToXPathWithoutPrefixTestData() + { + return [ + ['h1', 'h1'], + ['foo|h1', 'foo:h1'], + ['h1, h2, h3', 'h1 | h2 | h3'], + ['h1:nth-child(3n+1)', "*/*[(name() = 'h1') and (position() - 1 >= 0 and (position() - 1) mod 3 = 0)]"], + ['h1 > p', 'h1/p'], + ['h1#foo', "h1[@id = 'foo']"], + ['h1.foo', "h1[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"], + ['h1[class*="foo bar"]', "h1[@class and contains(@class, 'foo bar')]"], + ['h1[foo|class*="foo bar"]', "h1[@foo:class and contains(@foo:class, 'foo bar')]"], + ['h1[class]', 'h1[@class]'], + ['h1 .foo', "h1/descendant-or-self::*/*[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"], + ['h1 #foo', "h1/descendant-or-self::*/*[@id = 'foo']"], + ['h1 [class*=foo]', "h1/descendant-or-self::*/*[@class and contains(@class, 'foo')]"], + ['div>.foo', "div/*[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"], + ['div > .foo', "div/*[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"], + ]; + } +} diff --git a/lib/Symfony/Component/CssSelector/Tests/Node/AbstractNodeTest.php b/lib/Symfony/Component/CssSelector/Tests/Node/AbstractNodeTest.php new file mode 100644 index 00000000..834f8a88 --- /dev/null +++ b/lib/Symfony/Component/CssSelector/Tests/Node/AbstractNodeTest.php @@ -0,0 +1,34 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Node; + +use PHPUnit\Framework\TestCase; +use SimplePay\Vendor\Symfony\Component\CssSelector\Node\NodeInterface; + +abstract class AbstractNodeTest extends TestCase +{ + /** @dataProvider getToStringConversionTestData */ + public function testToStringConversion(NodeInterface $node, $representation) + { + $this->assertEquals($representation, (string) $node); + } + + /** @dataProvider getSpecificityValueTestData */ + public function testSpecificityValue(NodeInterface $node, $value) + { + $this->assertEquals($value, $node->getSpecificity()->getValue()); + } + + abstract public function getToStringConversionTestData(); + + abstract public function getSpecificityValueTestData(); +} diff --git a/lib/Symfony/Component/CssSelector/Tests/Node/AttributeNodeTest.php b/lib/Symfony/Component/CssSelector/Tests/Node/AttributeNodeTest.php new file mode 100644 index 00000000..0e7ca0ac --- /dev/null +++ b/lib/Symfony/Component/CssSelector/Tests/Node/AttributeNodeTest.php @@ -0,0 +1,37 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Node; + +use SimplePay\Vendor\Symfony\Component\CssSelector\Node\AttributeNode; +use SimplePay\Vendor\Symfony\Component\CssSelector\Node\ElementNode; + +class AttributeNodeTest extends AbstractNodeTest +{ + public function getToStringConversionTestData() + { + return [ + [new AttributeNode(new ElementNode(), null, 'attribute', 'exists', null), 'Attribute[Element[*][attribute]]'], + [new AttributeNode(new ElementNode(), null, 'attribute', '$=', 'value'), "Attribute[Element[*][attribute $= 'value']]"], + [new AttributeNode(new ElementNode(), 'namespace', 'attribute', '$=', 'value'), "Attribute[Element[*][namespace|attribute $= 'value']]"], + ]; + } + + public function getSpecificityValueTestData() + { + return [ + [new AttributeNode(new ElementNode(), null, 'attribute', 'exists', null), 10], + [new AttributeNode(new ElementNode(null, 'element'), null, 'attribute', 'exists', null), 11], + [new AttributeNode(new ElementNode(), null, 'attribute', '$=', 'value'), 10], + [new AttributeNode(new ElementNode(), 'namespace', 'attribute', '$=', 'value'), 10], + ]; + } +} diff --git a/lib/Symfony/Component/CssSelector/Tests/Node/ClassNodeTest.php b/lib/Symfony/Component/CssSelector/Tests/Node/ClassNodeTest.php new file mode 100644 index 00000000..d988e4a4 --- /dev/null +++ b/lib/Symfony/Component/CssSelector/Tests/Node/ClassNodeTest.php @@ -0,0 +1,33 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Node; + +use SimplePay\Vendor\Symfony\Component\CssSelector\Node\ClassNode; +use SimplePay\Vendor\Symfony\Component\CssSelector\Node\ElementNode; + +class ClassNodeTest extends AbstractNodeTest +{ + public function getToStringConversionTestData() + { + return [ + [new ClassNode(new ElementNode(), 'class'), 'Class[Element[*].class]'], + ]; + } + + public function getSpecificityValueTestData() + { + return [ + [new ClassNode(new ElementNode(), 'class'), 10], + [new ClassNode(new ElementNode(null, 'element'), 'class'), 11], + ]; + } +} diff --git a/lib/Symfony/Component/CssSelector/Tests/Node/CombinedSelectorNodeTest.php b/lib/Symfony/Component/CssSelector/Tests/Node/CombinedSelectorNodeTest.php new file mode 100644 index 00000000..9de72bde --- /dev/null +++ b/lib/Symfony/Component/CssSelector/Tests/Node/CombinedSelectorNodeTest.php @@ -0,0 +1,35 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Node; + +use SimplePay\Vendor\Symfony\Component\CssSelector\Node\CombinedSelectorNode; +use SimplePay\Vendor\Symfony\Component\CssSelector\Node\ElementNode; + +class CombinedSelectorNodeTest extends AbstractNodeTest +{ + public function getToStringConversionTestData() + { + return [ + [new CombinedSelectorNode(new ElementNode(), '>', new ElementNode()), 'CombinedSelector[Element[*] > Element[*]]'], + [new CombinedSelectorNode(new ElementNode(), ' ', new ElementNode()), 'CombinedSelector[Element[*] Element[*]]'], + ]; + } + + public function getSpecificityValueTestData() + { + return [ + [new CombinedSelectorNode(new ElementNode(), '>', new ElementNode()), 0], + [new CombinedSelectorNode(new ElementNode(null, 'element'), '>', new ElementNode()), 1], + [new CombinedSelectorNode(new ElementNode(null, 'element'), '>', new ElementNode(null, 'element')), 2], + ]; + } +} diff --git a/lib/Symfony/Component/CssSelector/Tests/Node/ElementNodeTest.php b/lib/Symfony/Component/CssSelector/Tests/Node/ElementNodeTest.php new file mode 100644 index 00000000..0f4984ee --- /dev/null +++ b/lib/Symfony/Component/CssSelector/Tests/Node/ElementNodeTest.php @@ -0,0 +1,35 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Node; + +use SimplePay\Vendor\Symfony\Component\CssSelector\Node\ElementNode; + +class ElementNodeTest extends AbstractNodeTest +{ + public function getToStringConversionTestData() + { + return [ + [new ElementNode(), 'Element[*]'], + [new ElementNode(null, 'element'), 'Element[element]'], + [new ElementNode('namespace', 'element'), 'Element[namespace|element]'], + ]; + } + + public function getSpecificityValueTestData() + { + return [ + [new ElementNode(), 0], + [new ElementNode(null, 'element'), 1], + [new ElementNode('namespace', 'element'), 1], + ]; + } +} diff --git a/lib/Symfony/Component/CssSelector/Tests/Node/FunctionNodeTest.php b/lib/Symfony/Component/CssSelector/Tests/Node/FunctionNodeTest.php new file mode 100644 index 00000000..9d389eed --- /dev/null +++ b/lib/Symfony/Component/CssSelector/Tests/Node/FunctionNodeTest.php @@ -0,0 +1,47 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Node; + +use SimplePay\Vendor\Symfony\Component\CssSelector\Node\ElementNode; +use SimplePay\Vendor\Symfony\Component\CssSelector\Node\FunctionNode; +use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Token; + +class FunctionNodeTest extends AbstractNodeTest +{ + public function getToStringConversionTestData() + { + return [ + [new FunctionNode(new ElementNode(), 'function'), 'Function[Element[*]:function()]'], + [new FunctionNode(new ElementNode(), 'function', [ + new Token(Token::TYPE_IDENTIFIER, 'value', 0), + ]), "Function[Element[*]:function(['value'])]"], + [new FunctionNode(new ElementNode(), 'function', [ + new Token(Token::TYPE_STRING, 'value1', 0), + new Token(Token::TYPE_NUMBER, 'value2', 0), + ]), "Function[Element[*]:function(['value1', 'value2'])]"], + ]; + } + + public function getSpecificityValueTestData() + { + return [ + [new FunctionNode(new ElementNode(), 'function'), 10], + [new FunctionNode(new ElementNode(), 'function', [ + new Token(Token::TYPE_IDENTIFIER, 'value', 0), + ]), 10], + [new FunctionNode(new ElementNode(), 'function', [ + new Token(Token::TYPE_STRING, 'value1', 0), + new Token(Token::TYPE_NUMBER, 'value2', 0), + ]), 10], + ]; + } +} diff --git a/lib/Symfony/Component/CssSelector/Tests/Node/HashNodeTest.php b/lib/Symfony/Component/CssSelector/Tests/Node/HashNodeTest.php new file mode 100644 index 00000000..88382c39 --- /dev/null +++ b/lib/Symfony/Component/CssSelector/Tests/Node/HashNodeTest.php @@ -0,0 +1,33 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Node; + +use SimplePay\Vendor\Symfony\Component\CssSelector\Node\ElementNode; +use SimplePay\Vendor\Symfony\Component\CssSelector\Node\HashNode; + +class HashNodeTest extends AbstractNodeTest +{ + public function getToStringConversionTestData() + { + return [ + [new HashNode(new ElementNode(), 'id'), 'Hash[Element[*]#id]'], + ]; + } + + public function getSpecificityValueTestData() + { + return [ + [new HashNode(new ElementNode(), 'id'), 100], + [new HashNode(new ElementNode(null, 'id'), 'class'), 101], + ]; + } +} diff --git a/lib/Symfony/Component/CssSelector/Tests/Node/NegationNodeTest.php b/lib/Symfony/Component/CssSelector/Tests/Node/NegationNodeTest.php new file mode 100644 index 00000000..b0798f5a --- /dev/null +++ b/lib/Symfony/Component/CssSelector/Tests/Node/NegationNodeTest.php @@ -0,0 +1,33 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Node; + +use SimplePay\Vendor\Symfony\Component\CssSelector\Node\ClassNode; +use SimplePay\Vendor\Symfony\Component\CssSelector\Node\ElementNode; +use SimplePay\Vendor\Symfony\Component\CssSelector\Node\NegationNode; + +class NegationNodeTest extends AbstractNodeTest +{ + public function getToStringConversionTestData() + { + return [ + [new NegationNode(new ElementNode(), new ClassNode(new ElementNode(), 'class')), 'Negation[Element[*]:not(Class[Element[*].class])]'], + ]; + } + + public function getSpecificityValueTestData() + { + return [ + [new NegationNode(new ElementNode(), new ClassNode(new ElementNode(), 'class')), 10], + ]; + } +} diff --git a/lib/Symfony/Component/CssSelector/Tests/Node/PseudoNodeTest.php b/lib/Symfony/Component/CssSelector/Tests/Node/PseudoNodeTest.php new file mode 100644 index 00000000..81f169f1 --- /dev/null +++ b/lib/Symfony/Component/CssSelector/Tests/Node/PseudoNodeTest.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Node; + +use SimplePay\Vendor\Symfony\Component\CssSelector\Node\ElementNode; +use SimplePay\Vendor\Symfony\Component\CssSelector\Node\PseudoNode; + +class PseudoNodeTest extends AbstractNodeTest +{ + public function getToStringConversionTestData() + { + return [ + [new PseudoNode(new ElementNode(), 'pseudo'), 'Pseudo[Element[*]:pseudo]'], + ]; + } + + public function getSpecificityValueTestData() + { + return [ + [new PseudoNode(new ElementNode(), 'pseudo'), 10], + ]; + } +} diff --git a/lib/Symfony/Component/CssSelector/Tests/Node/SelectorNodeTest.php b/lib/Symfony/Component/CssSelector/Tests/Node/SelectorNodeTest.php new file mode 100644 index 00000000..6ca772f8 --- /dev/null +++ b/lib/Symfony/Component/CssSelector/Tests/Node/SelectorNodeTest.php @@ -0,0 +1,34 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Node; + +use SimplePay\Vendor\Symfony\Component\CssSelector\Node\ElementNode; +use SimplePay\Vendor\Symfony\Component\CssSelector\Node\SelectorNode; + +class SelectorNodeTest extends AbstractNodeTest +{ + public function getToStringConversionTestData() + { + return [ + [new SelectorNode(new ElementNode()), 'Selector[Element[*]]'], + [new SelectorNode(new ElementNode(), 'pseudo'), 'Selector[Element[*]::pseudo]'], + ]; + } + + public function getSpecificityValueTestData() + { + return [ + [new SelectorNode(new ElementNode()), 0], + [new SelectorNode(new ElementNode(), 'pseudo'), 1], + ]; + } +} diff --git a/lib/Symfony/Component/CssSelector/Tests/Node/SpecificityTest.php b/lib/Symfony/Component/CssSelector/Tests/Node/SpecificityTest.php new file mode 100644 index 00000000..8c5cd9a4 --- /dev/null +++ b/lib/Symfony/Component/CssSelector/Tests/Node/SpecificityTest.php @@ -0,0 +1,63 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Node; + +use PHPUnit\Framework\TestCase; +use SimplePay\Vendor\Symfony\Component\CssSelector\Node\Specificity; + +class SpecificityTest extends TestCase +{ + /** @dataProvider getValueTestData */ + public function testValue(Specificity $specificity, $value) + { + $this->assertEquals($value, $specificity->getValue()); + } + + /** @dataProvider getValueTestData */ + public function testPlusValue(Specificity $specificity, $value) + { + $this->assertEquals($value + 123, $specificity->plus(new Specificity(1, 2, 3))->getValue()); + } + + public function getValueTestData() + { + return [ + [new Specificity(0, 0, 0), 0], + [new Specificity(0, 0, 2), 2], + [new Specificity(0, 3, 0), 30], + [new Specificity(4, 0, 0), 400], + [new Specificity(4, 3, 2), 432], + ]; + } + + /** @dataProvider getCompareTestData */ + public function testCompareTo(Specificity $a, Specificity $b, $result) + { + $this->assertEquals($result, $a->compareTo($b)); + } + + public function getCompareTestData() + { + return [ + [new Specificity(0, 0, 0), new Specificity(0, 0, 0), 0], + [new Specificity(0, 0, 1), new Specificity(0, 0, 1), 0], + [new Specificity(0, 0, 2), new Specificity(0, 0, 1), 1], + [new Specificity(0, 0, 2), new Specificity(0, 0, 3), -1], + [new Specificity(0, 4, 0), new Specificity(0, 4, 0), 0], + [new Specificity(0, 6, 0), new Specificity(0, 5, 11), 1], + [new Specificity(0, 7, 0), new Specificity(0, 8, 0), -1], + [new Specificity(9, 0, 0), new Specificity(9, 0, 0), 0], + [new Specificity(11, 0, 0), new Specificity(10, 11, 0), 1], + [new Specificity(12, 11, 0), new Specificity(13, 0, 0), -1], + ]; + } +} diff --git a/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/AbstractHandlerTest.php b/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/AbstractHandlerTest.php new file mode 100644 index 00000000..9de6f0e4 --- /dev/null +++ b/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/AbstractHandlerTest.php @@ -0,0 +1,70 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Parser\Handler; + +use PHPUnit\Framework\TestCase; +use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Reader; +use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Token; +use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\TokenStream; + +/** + * @author Jean-François Simon + */ +abstract class AbstractHandlerTest extends TestCase +{ + /** @dataProvider getHandleValueTestData */ + public function testHandleValue($value, Token $expectedToken, $remainingContent) + { + $reader = new Reader($value); + $stream = new TokenStream(); + + $this->assertTrue($this->generateHandler()->handle($reader, $stream)); + $this->assertEquals($expectedToken, $stream->getNext()); + $this->assertRemainingContent($reader, $remainingContent); + } + + /** @dataProvider getDontHandleValueTestData */ + public function testDontHandleValue($value) + { + $reader = new Reader($value); + $stream = new TokenStream(); + + $this->assertFalse($this->generateHandler()->handle($reader, $stream)); + $this->assertStreamEmpty($stream); + $this->assertRemainingContent($reader, $value); + } + + abstract public function getHandleValueTestData(); + + abstract public function getDontHandleValueTestData(); + + abstract protected function generateHandler(); + + protected function assertStreamEmpty(TokenStream $stream) + { + $property = new \ReflectionProperty($stream, 'tokens'); + $property->setAccessible(true); + + $this->assertEquals([], $property->getValue($stream)); + } + + protected function assertRemainingContent(Reader $reader, $remainingContent) + { + if ('' === $remainingContent) { + $this->assertEquals(0, $reader->getRemainingLength()); + $this->assertTrue($reader->isEOF()); + } else { + $this->assertEquals(\strlen($remainingContent), $reader->getRemainingLength()); + $this->assertEquals(0, $reader->getOffset($remainingContent)); + } + } +} diff --git a/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/CommentHandlerTest.php b/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/CommentHandlerTest.php new file mode 100644 index 00000000..fc621278 --- /dev/null +++ b/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/CommentHandlerTest.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Parser\Handler; + +use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Handler\CommentHandler; +use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Reader; +use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Token; +use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\TokenStream; + +class CommentHandlerTest extends AbstractHandlerTest +{ + /** @dataProvider getHandleValueTestData */ + public function testHandleValue($value, Token $unusedArgument, $remainingContent) + { + $reader = new Reader($value); + $stream = new TokenStream(); + + $this->assertTrue($this->generateHandler()->handle($reader, $stream)); + // comments are ignored (not pushed as token in stream) + $this->assertStreamEmpty($stream); + $this->assertRemainingContent($reader, $remainingContent); + } + + public function getHandleValueTestData() + { + return [ + // 2nd argument only exists for inherited method compatibility + ['/* comment */', new Token(null, null, null), ''], + ['/* comment */foo', new Token(null, null, null), 'foo'], + ]; + } + + public function getDontHandleValueTestData() + { + return [ + ['>'], + ['+'], + [' '], + ]; + } + + protected function generateHandler() + { + return new CommentHandler(); + } +} diff --git a/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/HashHandlerTest.php b/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/HashHandlerTest.php new file mode 100644 index 00000000..eeafa65f --- /dev/null +++ b/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/HashHandlerTest.php @@ -0,0 +1,49 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Parser\Handler; + +use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Handler\HashHandler; +use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Token; +use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerEscaping; +use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns; + +class HashHandlerTest extends AbstractHandlerTest +{ + public function getHandleValueTestData() + { + return [ + ['#id', new Token(Token::TYPE_HASH, 'id', 0), ''], + ['#123', new Token(Token::TYPE_HASH, '123', 0), ''], + + ['#id.class', new Token(Token::TYPE_HASH, 'id', 0), '.class'], + ['#id element', new Token(Token::TYPE_HASH, 'id', 0), ' element'], + ]; + } + + public function getDontHandleValueTestData() + { + return [ + ['id'], + ['123'], + ['<'], + ['<'], + ['#'], + ]; + } + + protected function generateHandler() + { + $patterns = new TokenizerPatterns(); + + return new HashHandler($patterns, new TokenizerEscaping($patterns)); + } +} diff --git a/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/IdentifierHandlerTest.php b/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/IdentifierHandlerTest.php new file mode 100644 index 00000000..678defe1 --- /dev/null +++ b/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/IdentifierHandlerTest.php @@ -0,0 +1,49 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Parser\Handler; + +use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Handler\IdentifierHandler; +use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Token; +use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerEscaping; +use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns; + +class IdentifierHandlerTest extends AbstractHandlerTest +{ + public function getHandleValueTestData() + { + return [ + ['foo', new Token(Token::TYPE_IDENTIFIER, 'foo', 0), ''], + ['foo|bar', new Token(Token::TYPE_IDENTIFIER, 'foo', 0), '|bar'], + ['foo.class', new Token(Token::TYPE_IDENTIFIER, 'foo', 0), '.class'], + ['foo[attr]', new Token(Token::TYPE_IDENTIFIER, 'foo', 0), '[attr]'], + ['foo bar', new Token(Token::TYPE_IDENTIFIER, 'foo', 0), ' bar'], + ]; + } + + public function getDontHandleValueTestData() + { + return [ + ['>'], + ['+'], + [' '], + ['*|foo'], + ['/* comment */'], + ]; + } + + protected function generateHandler() + { + $patterns = new TokenizerPatterns(); + + return new IdentifierHandler($patterns, new TokenizerEscaping($patterns)); + } +} diff --git a/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/NumberHandlerTest.php b/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/NumberHandlerTest.php new file mode 100644 index 00000000..f57fbb1c --- /dev/null +++ b/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/NumberHandlerTest.php @@ -0,0 +1,50 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Parser\Handler; + +use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Handler\NumberHandler; +use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Token; +use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns; + +class NumberHandlerTest extends AbstractHandlerTest +{ + public function getHandleValueTestData() + { + return [ + ['12', new Token(Token::TYPE_NUMBER, '12', 0), ''], + ['12.34', new Token(Token::TYPE_NUMBER, '12.34', 0), ''], + ['+12.34', new Token(Token::TYPE_NUMBER, '+12.34', 0), ''], + ['-12.34', new Token(Token::TYPE_NUMBER, '-12.34', 0), ''], + + ['12 arg', new Token(Token::TYPE_NUMBER, '12', 0), ' arg'], + ['12]', new Token(Token::TYPE_NUMBER, '12', 0), ']'], + ]; + } + + public function getDontHandleValueTestData() + { + return [ + ['hello'], + ['>'], + ['+'], + [' '], + ['/* comment */'], + ]; + } + + protected function generateHandler() + { + $patterns = new TokenizerPatterns(); + + return new NumberHandler($patterns); + } +} diff --git a/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/StringHandlerTest.php b/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/StringHandlerTest.php new file mode 100644 index 00000000..a7707525 --- /dev/null +++ b/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/StringHandlerTest.php @@ -0,0 +1,50 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Parser\Handler; + +use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Handler\StringHandler; +use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Token; +use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerEscaping; +use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns; + +class StringHandlerTest extends AbstractHandlerTest +{ + public function getHandleValueTestData() + { + return [ + ['"hello"', new Token(Token::TYPE_STRING, 'hello', 1), ''], + ['"1"', new Token(Token::TYPE_STRING, '1', 1), ''], + ['" "', new Token(Token::TYPE_STRING, ' ', 1), ''], + ['""', new Token(Token::TYPE_STRING, '', 1), ''], + ["'hello'", new Token(Token::TYPE_STRING, 'hello', 1), ''], + + ["'foo'bar", new Token(Token::TYPE_STRING, 'foo', 1), 'bar'], + ]; + } + + public function getDontHandleValueTestData() + { + return [ + ['hello'], + ['>'], + ['1'], + [' '], + ]; + } + + protected function generateHandler() + { + $patterns = new TokenizerPatterns(); + + return new StringHandler($patterns, new TokenizerEscaping($patterns)); + } +} diff --git a/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/WhitespaceHandlerTest.php b/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/WhitespaceHandlerTest.php new file mode 100644 index 00000000..2b05aeca --- /dev/null +++ b/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/WhitespaceHandlerTest.php @@ -0,0 +1,44 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Parser\Handler; + +use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Handler\WhitespaceHandler; +use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Token; + +class WhitespaceHandlerTest extends AbstractHandlerTest +{ + public function getHandleValueTestData() + { + return [ + [' ', new Token(Token::TYPE_WHITESPACE, ' ', 0), ''], + ["\n", new Token(Token::TYPE_WHITESPACE, "\n", 0), ''], + ["\t", new Token(Token::TYPE_WHITESPACE, "\t", 0), ''], + + [' foo', new Token(Token::TYPE_WHITESPACE, ' ', 0), 'foo'], + [' .foo', new Token(Token::TYPE_WHITESPACE, ' ', 0), '.foo'], + ]; + } + + public function getDontHandleValueTestData() + { + return [ + ['>'], + ['1'], + ['a'], + ]; + } + + protected function generateHandler() + { + return new WhitespaceHandler(); + } +} diff --git a/lib/Symfony/Component/CssSelector/Tests/Parser/ParserTest.php b/lib/Symfony/Component/CssSelector/Tests/Parser/ParserTest.php new file mode 100644 index 00000000..030ce734 --- /dev/null +++ b/lib/Symfony/Component/CssSelector/Tests/Parser/ParserTest.php @@ -0,0 +1,253 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Parser; + +use PHPUnit\Framework\TestCase; +use SimplePay\Vendor\Symfony\Component\CssSelector\Exception\SyntaxErrorException; +use SimplePay\Vendor\Symfony\Component\CssSelector\Node\FunctionNode; +use SimplePay\Vendor\Symfony\Component\CssSelector\Node\SelectorNode; +use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Parser; +use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Token; + +class ParserTest extends TestCase +{ + /** @dataProvider getParserTestData */ + public function testParser($source, $representation) + { + $parser = new Parser(); + + $this->assertEquals($representation, array_map(function (SelectorNode $node) { + return (string) $node->getTree(); + }, $parser->parse($source))); + } + + /** @dataProvider getParserExceptionTestData */ + public function testParserException($source, $message) + { + $parser = new Parser(); + + try { + $parser->parse($source); + $this->fail('Parser should throw a SyntaxErrorException.'); + } catch (SyntaxErrorException $e) { + $this->assertEquals($message, $e->getMessage()); + } + } + + /** @dataProvider getPseudoElementsTestData */ + public function testPseudoElements($source, $element, $pseudo) + { + $parser = new Parser(); + $selectors = $parser->parse($source); + $this->assertCount(1, $selectors); + + /** @var SelectorNode $selector */ + $selector = $selectors[0]; + $this->assertEquals($element, (string) $selector->getTree()); + $this->assertEquals($pseudo, (string) $selector->getPseudoElement()); + } + + /** @dataProvider getSpecificityTestData */ + public function testSpecificity($source, $value) + { + $parser = new Parser(); + $selectors = $parser->parse($source); + $this->assertCount(1, $selectors); + + /** @var SelectorNode $selector */ + $selector = $selectors[0]; + $this->assertEquals($value, $selector->getSpecificity()->getValue()); + } + + /** @dataProvider getParseSeriesTestData */ + public function testParseSeries($series, $a, $b) + { + $parser = new Parser(); + $selectors = $parser->parse(sprintf(':nth-child(%s)', $series)); + $this->assertCount(1, $selectors); + + /** @var FunctionNode $function */ + $function = $selectors[0]->getTree(); + $this->assertEquals([$a, $b], Parser::parseSeries($function->getArguments())); + } + + /** @dataProvider getParseSeriesExceptionTestData */ + public function testParseSeriesException($series) + { + $parser = new Parser(); + $selectors = $parser->parse(sprintf(':nth-child(%s)', $series)); + $this->assertCount(1, $selectors); + + /** @var FunctionNode $function */ + $function = $selectors[0]->getTree(); + $this->expectException('SimplePay\Vendor\Symfony\Component\CssSelector\Exception\SyntaxErrorException'); + Parser::parseSeries($function->getArguments()); + } + + public function getParserTestData() + { + return [ + ['*', ['Element[*]']], + ['*|*', ['Element[*]']], + ['*|foo', ['Element[foo]']], + ['foo|*', ['Element[foo|*]']], + ['foo|bar', ['Element[foo|bar]']], + ['#foo#bar', ['Hash[Hash[Element[*]#foo]#bar]']], + ['div>.foo', ['CombinedSelector[Element[div] > Class[Element[*].foo]]']], + ['div> .foo', ['CombinedSelector[Element[div] > Class[Element[*].foo]]']], + ['div >.foo', ['CombinedSelector[Element[div] > Class[Element[*].foo]]']], + ['div > .foo', ['CombinedSelector[Element[div] > Class[Element[*].foo]]']], + ["div \n> \t \t .foo", ['CombinedSelector[Element[div] > Class[Element[*].foo]]']], + ['td.foo,.bar', ['Class[Element[td].foo]', 'Class[Element[*].bar]']], + ['td.foo, .bar', ['Class[Element[td].foo]', 'Class[Element[*].bar]']], + ["td.foo\t\r\n\f ,\t\r\n\f .bar", ['Class[Element[td].foo]', 'Class[Element[*].bar]']], + ['td.foo,.bar', ['Class[Element[td].foo]', 'Class[Element[*].bar]']], + ['td.foo, .bar', ['Class[Element[td].foo]', 'Class[Element[*].bar]']], + ["td.foo\t\r\n\f ,\t\r\n\f .bar", ['Class[Element[td].foo]', 'Class[Element[*].bar]']], + ['div, td.foo, div.bar span', ['Element[div]', 'Class[Element[td].foo]', 'CombinedSelector[Class[Element[div].bar] Element[span]]']], + ['div > p', ['CombinedSelector[Element[div] > Element[p]]']], + ['td:first', ['Pseudo[Element[td]:first]']], + ['td :first', ['CombinedSelector[Element[td] Pseudo[Element[*]:first]]']], + ['a[name]', ['Attribute[Element[a][name]]']], + ["a[ name\t]", ['Attribute[Element[a][name]]']], + ['a [name]', ['CombinedSelector[Element[a] Attribute[Element[*][name]]]']], + ['[name="foo"]', ["Attribute[Element[*][name = 'foo']]"]], + ["[name='foo[1]']", ["Attribute[Element[*][name = 'foo[1]']]"]], + ["[name='foo[0][bar]']", ["Attribute[Element[*][name = 'foo[0][bar]']]"]], + ['a[rel="include"]', ["Attribute[Element[a][rel = 'include']]"]], + ['a[rel = include]', ["Attribute[Element[a][rel = 'include']]"]], + ["a[hreflang |= 'en']", ["Attribute[Element[a][hreflang |= 'en']]"]], + ['a[hreflang|=en]', ["Attribute[Element[a][hreflang |= 'en']]"]], + ['div:nth-child(10)', ["Function[Element[div]:nth-child(['10'])]"]], + [':nth-child(2n+2)', ["Function[Element[*]:nth-child(['2', 'n', '+2'])]"]], + ['div:nth-of-type(10)', ["Function[Element[div]:nth-of-type(['10'])]"]], + ['div div:nth-of-type(10) .aclass', ["CombinedSelector[CombinedSelector[Element[div] Function[Element[div]:nth-of-type(['10'])]] Class[Element[*].aclass]]"]], + ['label:only', ['Pseudo[Element[label]:only]']], + ['a:lang(fr)', ["Function[Element[a]:lang(['fr'])]"]], + ['div:contains("foo")', ["Function[Element[div]:contains(['foo'])]"]], + ['div#foobar', ['Hash[Element[div]#foobar]']], + ['div:not(div.foo)', ['Negation[Element[div]:not(Class[Element[div].foo])]']], + ['td ~ th', ['CombinedSelector[Element[td] ~ Element[th]]']], + ['.foo[data-bar][data-baz=0]', ["Attribute[Attribute[Class[Element[*].foo][data-bar]][data-baz = '0']]"]], + ]; + } + + public function getParserExceptionTestData() + { + return [ + ['attributes(href)/html/body/a', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '(', 10))->getMessage()], + ['attributes(href)', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '(', 10))->getMessage()], + ['html/body/a', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '/', 4))->getMessage()], + [' ', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_FILE_END, '', 1))->getMessage()], + ['div, ', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_FILE_END, '', 5))->getMessage()], + [' , div', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, ',', 1))->getMessage()], + ['p, , div', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, ',', 3))->getMessage()], + ['div > ', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_FILE_END, '', 6))->getMessage()], + [' > div', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '>', 2))->getMessage()], + ['foo|#bar', SyntaxErrorException::unexpectedToken('identifier or "*"', new Token(Token::TYPE_HASH, 'bar', 4))->getMessage()], + ['#.foo', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '#', 0))->getMessage()], + ['.#foo', SyntaxErrorException::unexpectedToken('identifier', new Token(Token::TYPE_HASH, 'foo', 1))->getMessage()], + [':#foo', SyntaxErrorException::unexpectedToken('identifier', new Token(Token::TYPE_HASH, 'foo', 1))->getMessage()], + ['[*]', SyntaxErrorException::unexpectedToken('"|"', new Token(Token::TYPE_DELIMITER, ']', 2))->getMessage()], + ['[foo|]', SyntaxErrorException::unexpectedToken('identifier', new Token(Token::TYPE_DELIMITER, ']', 5))->getMessage()], + ['[#]', SyntaxErrorException::unexpectedToken('identifier or "*"', new Token(Token::TYPE_DELIMITER, '#', 1))->getMessage()], + ['[foo=#]', SyntaxErrorException::unexpectedToken('string or identifier', new Token(Token::TYPE_DELIMITER, '#', 5))->getMessage()], + [':nth-child()', SyntaxErrorException::unexpectedToken('at least one argument', new Token(Token::TYPE_DELIMITER, ')', 11))->getMessage()], + ['[href]a', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_IDENTIFIER, 'a', 6))->getMessage()], + ['[rel:stylesheet]', SyntaxErrorException::unexpectedToken('operator', new Token(Token::TYPE_DELIMITER, ':', 4))->getMessage()], + ['[rel=stylesheet', SyntaxErrorException::unexpectedToken('"]"', new Token(Token::TYPE_FILE_END, '', 15))->getMessage()], + [':lang(fr', SyntaxErrorException::unexpectedToken('an argument', new Token(Token::TYPE_FILE_END, '', 8))->getMessage()], + [':contains("foo', SyntaxErrorException::unclosedString(10)->getMessage()], + ['foo!', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '!', 3))->getMessage()], + ]; + } + + public function getPseudoElementsTestData() + { + return [ + ['foo', 'Element[foo]', ''], + ['*', 'Element[*]', ''], + [':empty', 'Pseudo[Element[*]:empty]', ''], + [':BEfore', 'Element[*]', 'before'], + [':aftER', 'Element[*]', 'after'], + [':First-Line', 'Element[*]', 'first-line'], + [':First-Letter', 'Element[*]', 'first-letter'], + ['::befoRE', 'Element[*]', 'before'], + ['::AFter', 'Element[*]', 'after'], + ['::firsT-linE', 'Element[*]', 'first-line'], + ['::firsT-letteR', 'Element[*]', 'first-letter'], + ['::Selection', 'Element[*]', 'selection'], + ['foo:after', 'Element[foo]', 'after'], + ['foo::selection', 'Element[foo]', 'selection'], + ['lorem#ipsum ~ a#b.c[href]:empty::selection', 'CombinedSelector[Hash[Element[lorem]#ipsum] ~ Pseudo[Attribute[Class[Hash[Element[a]#b].c][href]]:empty]]', 'selection'], + ['video::-webkit-media-controls', 'Element[video]', '-webkit-media-controls'], + ]; + } + + public function getSpecificityTestData() + { + return [ + ['*', 0], + [' foo', 1], + [':empty ', 10], + [':before', 1], + ['*:before', 1], + [':nth-child(2)', 10], + ['.bar', 10], + ['[baz]', 10], + ['[baz="4"]', 10], + ['[baz^="4"]', 10], + ['#lipsum', 100], + [':not(*)', 0], + [':not(foo)', 1], + [':not(.foo)', 10], + [':not([foo])', 10], + [':not(:empty)', 10], + [':not(#foo)', 100], + ['foo:empty', 11], + ['foo:before', 2], + ['foo::before', 2], + ['foo:empty::before', 12], + ['#lorem + foo#ipsum:first-child > bar:first-line', 213], + ]; + } + + public function getParseSeriesTestData() + { + return [ + ['1n+3', 1, 3], + ['1n +3', 1, 3], + ['1n + 3', 1, 3], + ['1n+ 3', 1, 3], + ['1n-3', 1, -3], + ['1n -3', 1, -3], + ['1n - 3', 1, -3], + ['1n- 3', 1, -3], + ['n-5', 1, -5], + ['odd', 2, 1], + ['even', 2, 0], + ['3n', 3, 0], + ['n', 1, 0], + ['+n', 1, 0], + ['-n', -1, 0], + ['5', 0, 5], + ]; + } + + public function getParseSeriesExceptionTestData() + { + return [ + ['foo'], + ['n+'], + ]; + } +} diff --git a/lib/Symfony/Component/CssSelector/Tests/Parser/ReaderTest.php b/lib/Symfony/Component/CssSelector/Tests/Parser/ReaderTest.php new file mode 100644 index 00000000..72c04698 --- /dev/null +++ b/lib/Symfony/Component/CssSelector/Tests/Parser/ReaderTest.php @@ -0,0 +1,102 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Parser; + +use PHPUnit\Framework\TestCase; +use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Reader; + +class ReaderTest extends TestCase +{ + public function testIsEOF() + { + $reader = new Reader(''); + $this->assertTrue($reader->isEOF()); + + $reader = new Reader('hello'); + $this->assertFalse($reader->isEOF()); + + $this->assignPosition($reader, 2); + $this->assertFalse($reader->isEOF()); + + $this->assignPosition($reader, 5); + $this->assertTrue($reader->isEOF()); + } + + public function testGetRemainingLength() + { + $reader = new Reader('hello'); + $this->assertEquals(5, $reader->getRemainingLength()); + + $this->assignPosition($reader, 2); + $this->assertEquals(3, $reader->getRemainingLength()); + + $this->assignPosition($reader, 5); + $this->assertEquals(0, $reader->getRemainingLength()); + } + + public function testGetSubstring() + { + $reader = new Reader('hello'); + $this->assertEquals('he', $reader->getSubstring(2)); + $this->assertEquals('el', $reader->getSubstring(2, 1)); + + $this->assignPosition($reader, 2); + $this->assertEquals('ll', $reader->getSubstring(2)); + $this->assertEquals('lo', $reader->getSubstring(2, 1)); + } + + public function testGetOffset() + { + $reader = new Reader('hello'); + $this->assertEquals(2, $reader->getOffset('ll')); + $this->assertFalse($reader->getOffset('w')); + + $this->assignPosition($reader, 2); + $this->assertEquals(0, $reader->getOffset('ll')); + $this->assertFalse($reader->getOffset('he')); + } + + public function testFindPattern() + { + $reader = new Reader('hello'); + + $this->assertFalse($reader->findPattern('/world/')); + $this->assertEquals(['hello', 'h'], $reader->findPattern('/^([a-z]).*/')); + + $this->assignPosition($reader, 2); + $this->assertFalse($reader->findPattern('/^h.*/')); + $this->assertEquals(['llo'], $reader->findPattern('/^llo$/')); + } + + public function testMoveForward() + { + $reader = new Reader('hello'); + $this->assertEquals(0, $reader->getPosition()); + + $reader->moveForward(2); + $this->assertEquals(2, $reader->getPosition()); + } + + public function testToEnd() + { + $reader = new Reader('hello'); + $reader->moveToEnd(); + $this->assertTrue($reader->isEOF()); + } + + private function assignPosition(Reader $reader, $value) + { + $position = new \ReflectionProperty($reader, 'position'); + $position->setAccessible(true); + $position->setValue($reader, $value); + } +} diff --git a/lib/Symfony/Component/CssSelector/Tests/Parser/Shortcut/ClassParserTest.php b/lib/Symfony/Component/CssSelector/Tests/Parser/Shortcut/ClassParserTest.php new file mode 100644 index 00000000..c0cbc60c --- /dev/null +++ b/lib/Symfony/Component/CssSelector/Tests/Parser/Shortcut/ClassParserTest.php @@ -0,0 +1,45 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Parser\Shortcut; + +use PHPUnit\Framework\TestCase; +use SimplePay\Vendor\Symfony\Component\CssSelector\Node\SelectorNode; +use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Shortcut\ClassParser; + +/** + * @author Jean-François Simon + */ +class ClassParserTest extends TestCase +{ + /** @dataProvider getParseTestData */ + public function testParse($source, $representation) + { + $parser = new ClassParser(); + $selectors = $parser->parse($source); + $this->assertCount(1, $selectors); + + /** @var SelectorNode $selector */ + $selector = $selectors[0]; + $this->assertEquals($representation, (string) $selector->getTree()); + } + + public function getParseTestData() + { + return [ + ['.testclass', 'Class[Element[*].testclass]'], + ['testel.testclass', 'Class[Element[testel].testclass]'], + ['testns|.testclass', 'Class[Element[testns|*].testclass]'], + ['testns|*.testclass', 'Class[Element[testns|*].testclass]'], + ['testns|testel.testclass', 'Class[Element[testns|testel].testclass]'], + ]; + } +} diff --git a/lib/Symfony/Component/CssSelector/Tests/Parser/Shortcut/ElementParserTest.php b/lib/Symfony/Component/CssSelector/Tests/Parser/Shortcut/ElementParserTest.php new file mode 100644 index 00000000..71cda4ae --- /dev/null +++ b/lib/Symfony/Component/CssSelector/Tests/Parser/Shortcut/ElementParserTest.php @@ -0,0 +1,44 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Parser\Shortcut; + +use PHPUnit\Framework\TestCase; +use SimplePay\Vendor\Symfony\Component\CssSelector\Node\SelectorNode; +use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Shortcut\ElementParser; + +/** + * @author Jean-François Simon + */ +class ElementParserTest extends TestCase +{ + /** @dataProvider getParseTestData */ + public function testParse($source, $representation) + { + $parser = new ElementParser(); + $selectors = $parser->parse($source); + $this->assertCount(1, $selectors); + + /** @var SelectorNode $selector */ + $selector = $selectors[0]; + $this->assertEquals($representation, (string) $selector->getTree()); + } + + public function getParseTestData() + { + return [ + ['*', 'Element[*]'], + ['testel', 'Element[testel]'], + ['testns|*', 'Element[testns|*]'], + ['testns|testel', 'Element[testns|testel]'], + ]; + } +} diff --git a/lib/Symfony/Component/CssSelector/Tests/Parser/Shortcut/EmptyStringParserTest.php b/lib/Symfony/Component/CssSelector/Tests/Parser/Shortcut/EmptyStringParserTest.php new file mode 100644 index 00000000..638d8fb8 --- /dev/null +++ b/lib/Symfony/Component/CssSelector/Tests/Parser/Shortcut/EmptyStringParserTest.php @@ -0,0 +1,36 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Parser\Shortcut; + +use PHPUnit\Framework\TestCase; +use SimplePay\Vendor\Symfony\Component\CssSelector\Node\SelectorNode; +use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Shortcut\EmptyStringParser; + +/** + * @author Jean-François Simon + */ +class EmptyStringParserTest extends TestCase +{ + public function testParse() + { + $parser = new EmptyStringParser(); + $selectors = $parser->parse(''); + $this->assertCount(1, $selectors); + + /** @var SelectorNode $selector */ + $selector = $selectors[0]; + $this->assertEquals('Element[*]', (string) $selector->getTree()); + + $selectors = $parser->parse('this will produce an empty array'); + $this->assertCount(0, $selectors); + } +} diff --git a/lib/Symfony/Component/CssSelector/Tests/Parser/Shortcut/HashParserTest.php b/lib/Symfony/Component/CssSelector/Tests/Parser/Shortcut/HashParserTest.php new file mode 100644 index 00000000..f86bf8d9 --- /dev/null +++ b/lib/Symfony/Component/CssSelector/Tests/Parser/Shortcut/HashParserTest.php @@ -0,0 +1,45 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Parser\Shortcut; + +use PHPUnit\Framework\TestCase; +use SimplePay\Vendor\Symfony\Component\CssSelector\Node\SelectorNode; +use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Shortcut\HashParser; + +/** + * @author Jean-François Simon + */ +class HashParserTest extends TestCase +{ + /** @dataProvider getParseTestData */ + public function testParse($source, $representation) + { + $parser = new HashParser(); + $selectors = $parser->parse($source); + $this->assertCount(1, $selectors); + + /** @var SelectorNode $selector */ + $selector = $selectors[0]; + $this->assertEquals($representation, (string) $selector->getTree()); + } + + public function getParseTestData() + { + return [ + ['#testid', 'Hash[Element[*]#testid]'], + ['testel#testid', 'Hash[Element[testel]#testid]'], + ['testns|#testid', 'Hash[Element[testns|*]#testid]'], + ['testns|*#testid', 'Hash[Element[testns|*]#testid]'], + ['testns|testel#testid', 'Hash[Element[testns|testel]#testid]'], + ]; + } +} diff --git a/lib/Symfony/Component/CssSelector/Tests/Parser/TokenStreamTest.php b/lib/Symfony/Component/CssSelector/Tests/Parser/TokenStreamTest.php new file mode 100644 index 00000000..c5917981 --- /dev/null +++ b/lib/Symfony/Component/CssSelector/Tests/Parser/TokenStreamTest.php @@ -0,0 +1,96 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Parser; + +use PHPUnit\Framework\TestCase; +use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Token; +use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\TokenStream; + +class TokenStreamTest extends TestCase +{ + public function testGetNext() + { + $stream = new TokenStream(); + $stream->push($t1 = new Token(Token::TYPE_IDENTIFIER, 'h1', 0)); + $stream->push($t2 = new Token(Token::TYPE_DELIMITER, '.', 2)); + $stream->push($t3 = new Token(Token::TYPE_IDENTIFIER, 'title', 3)); + + $this->assertSame($t1, $stream->getNext()); + $this->assertSame($t2, $stream->getNext()); + $this->assertSame($t3, $stream->getNext()); + } + + public function testGetPeek() + { + $stream = new TokenStream(); + $stream->push($t1 = new Token(Token::TYPE_IDENTIFIER, 'h1', 0)); + $stream->push($t2 = new Token(Token::TYPE_DELIMITER, '.', 2)); + $stream->push($t3 = new Token(Token::TYPE_IDENTIFIER, 'title', 3)); + + $this->assertSame($t1, $stream->getPeek()); + $this->assertSame($t1, $stream->getNext()); + $this->assertSame($t2, $stream->getPeek()); + $this->assertSame($t2, $stream->getPeek()); + $this->assertSame($t2, $stream->getNext()); + } + + public function testGetNextIdentifier() + { + $stream = new TokenStream(); + $stream->push(new Token(Token::TYPE_IDENTIFIER, 'h1', 0)); + + $this->assertEquals('h1', $stream->getNextIdentifier()); + } + + public function testFailToGetNextIdentifier() + { + $this->expectException('SimplePay\Vendor\Symfony\Component\CssSelector\Exception\SyntaxErrorException'); + + $stream = new TokenStream(); + $stream->push(new Token(Token::TYPE_DELIMITER, '.', 2)); + $stream->getNextIdentifier(); + } + + public function testGetNextIdentifierOrStar() + { + $stream = new TokenStream(); + + $stream->push(new Token(Token::TYPE_IDENTIFIER, 'h1', 0)); + $this->assertEquals('h1', $stream->getNextIdentifierOrStar()); + + $stream->push(new Token(Token::TYPE_DELIMITER, '*', 0)); + $this->assertNull($stream->getNextIdentifierOrStar()); + } + + public function testFailToGetNextIdentifierOrStar() + { + $this->expectException('SimplePay\Vendor\Symfony\Component\CssSelector\Exception\SyntaxErrorException'); + + $stream = new TokenStream(); + $stream->push(new Token(Token::TYPE_DELIMITER, '.', 2)); + $stream->getNextIdentifierOrStar(); + } + + public function testSkipWhitespace() + { + $stream = new TokenStream(); + $stream->push($t1 = new Token(Token::TYPE_IDENTIFIER, 'h1', 0)); + $stream->push($t2 = new Token(Token::TYPE_WHITESPACE, ' ', 2)); + $stream->push($t3 = new Token(Token::TYPE_IDENTIFIER, 'h1', 3)); + + $stream->skipWhitespace(); + $this->assertSame($t1, $stream->getNext()); + + $stream->skipWhitespace(); + $this->assertSame($t3, $stream->getNext()); + } +} diff --git a/lib/Symfony/Component/CssSelector/Tests/XPath/Fixtures/ids.html b/lib/Symfony/Component/CssSelector/Tests/XPath/Fixtures/ids.html new file mode 100644 index 00000000..5799fad2 --- /dev/null +++ b/lib/Symfony/Component/CssSelector/Tests/XPath/Fixtures/ids.html @@ -0,0 +1,48 @@ + + + + +
+ + + + link +
    +
  1. content
  2. +
  3. +
    +
    +
  4. +
  5. +
  6. +
  7. +
  8. +
  9. +
+

+ hi there + guy + + + + + + + +

+ + +
+

+
    +
+ + + + +
+
+ diff --git a/lib/Symfony/Component/CssSelector/Tests/XPath/Fixtures/lang.xml b/lib/Symfony/Component/CssSelector/Tests/XPath/Fixtures/lang.xml new file mode 100644 index 00000000..14f8dbed --- /dev/null +++ b/lib/Symfony/Component/CssSelector/Tests/XPath/Fixtures/lang.xml @@ -0,0 +1,11 @@ + + a + b + c + d + e + f + + + + diff --git a/lib/Symfony/Component/CssSelector/Tests/XPath/Fixtures/shakespear.html b/lib/Symfony/Component/CssSelector/Tests/XPath/Fixtures/shakespear.html new file mode 100644 index 00000000..15d1ad33 --- /dev/null +++ b/lib/Symfony/Component/CssSelector/Tests/XPath/Fixtures/shakespear.html @@ -0,0 +1,308 @@ + + + + + + +
+
+

As You Like It

+
+ by William Shakespeare +
+
+

ACT I, SCENE III. A room in the palace.

+
+
Enter CELIA and ROSALIND
+
+
CELIA
+
+
Why, cousin! why, Rosalind! Cupid have mercy! not a word?
+
+
ROSALIND
+
+
Not one to throw at a dog.
+
+
CELIA
+
+
No, thy words are too precious to be cast away upon
+
curs; throw some of them at me; come, lame me with reasons.
+
+
ROSALIND
+
CELIA
+
+
But is all this for your father?
+
+
+
Then there were two cousins laid up; when the one
+
should be lamed with reasons and the other mad
+
without any.
+
+
ROSALIND
+
+
No, some of it is for my child's father. O, how
+
full of briers is this working-day world!
+
+
CELIA
+
+
They are but burs, cousin, thrown upon thee in
+
holiday foolery: if we walk not in the trodden
+
paths our very petticoats will catch them.
+
+
ROSALIND
+
+
I could shake them off my coat: these burs are in my heart.
+
+
CELIA
+
+
Hem them away.
+
+
ROSALIND
+
+
I would try, if I could cry 'hem' and have him.
+
+
CELIA
+
+
Come, come, wrestle with thy affections.
+
+
ROSALIND
+
+
O, they take the part of a better wrestler than myself!
+
+
CELIA
+
+
O, a good wish upon you! you will try in time, in
+
despite of a fall. But, turning these jests out of
+
service, let us talk in good earnest: is it
+
possible, on such a sudden, you should fall into so
+
strong a liking with old Sir Rowland's youngest son?
+
+
ROSALIND
+
+
The duke my father loved his father dearly.
+
+
CELIA
+
+
Doth it therefore ensue that you should love his son
+
dearly? By this kind of chase, I should hate him,
+
for my father hated his father dearly; yet I hate
+
not Orlando.
+
+
ROSALIND
+
+
No, faith, hate him not, for my sake.
+
+
CELIA
+
+
Why should I not? doth he not deserve well?
+
+
ROSALIND
+
+
Let me love him for that, and do you love him
+
because I do. Look, here comes the duke.
+
+
CELIA
+
+
With his eyes full of anger.
+
Enter DUKE FREDERICK, with Lords
+
+
DUKE FREDERICK
+
+
Mistress, dispatch you with your safest haste
+
And get you from our court.
+
+
ROSALIND
+
+
Me, uncle?
+
+
DUKE FREDERICK
+
+
You, cousin
+
Within these ten days if that thou be'st found
+
So near our public court as twenty miles,
+
Thou diest for it.
+
+
ROSALIND
+
+
I do beseech your grace,
+
Let me the knowledge of my fault bear with me:
+
If with myself I hold intelligence
+
Or have acquaintance with mine own desires,
+
If that I do not dream or be not frantic,--
+
As I do trust I am not--then, dear uncle,
+
Never so much as in a thought unborn
+
Did I offend your highness.
+
+
DUKE FREDERICK
+
+
Thus do all traitors:
+
If their purgation did consist in words,
+
They are as innocent as grace itself:
+
Let it suffice thee that I trust thee not.
+
+
ROSALIND
+
+
Yet your mistrust cannot make me a traitor:
+
Tell me whereon the likelihood depends.
+
+
DUKE FREDERICK
+
+
Thou art thy father's daughter; there's enough.
+
+
ROSALIND
+
+
So was I when your highness took his dukedom;
+
So was I when your highness banish'd him:
+
Treason is not inherited, my lord;
+
Or, if we did derive it from our friends,
+
What's that to me? my father was no traitor:
+
Then, good my liege, mistake me not so much
+
To think my poverty is treacherous.
+
+
CELIA
+
+
Dear sovereign, hear me speak.
+
+
DUKE FREDERICK
+
+
Ay, Celia; we stay'd her for your sake,
+
Else had she with her father ranged along.
+
+
CELIA
+
+
I did not then entreat to have her stay;
+
It was your pleasure and your own remorse:
+
I was too young that time to value her;
+
But now I know her: if she be a traitor,
+
Why so am I; we still have slept together,
+
Rose at an instant, learn'd, play'd, eat together,
+
And wheresoever we went, like Juno's swans,
+
Still we went coupled and inseparable.
+
+
DUKE FREDERICK
+
+
She is too subtle for thee; and her smoothness,
+
Her very silence and her patience
+
Speak to the people, and they pity her.
+
Thou art a fool: she robs thee of thy name;
+
And thou wilt show more bright and seem more virtuous
+
When she is gone. Then open not thy lips:
+
Firm and irrevocable is my doom
+
Which I have pass'd upon her; she is banish'd.
+
+
CELIA
+
+
Pronounce that sentence then on me, my liege:
+
I cannot live out of her company.
+
+
DUKE FREDERICK
+
+
You are a fool. You, niece, provide yourself:
+
If you outstay the time, upon mine honour,
+
And in the greatness of my word, you die.
+
Exeunt DUKE FREDERICK and Lords
+
+
CELIA
+
+
O my poor Rosalind, whither wilt thou go?
+
Wilt thou change fathers? I will give thee mine.
+
I charge thee, be not thou more grieved than I am.
+
+
ROSALIND
+
+
I have more cause.
+
+
CELIA
+
+
Thou hast not, cousin;
+
Prithee be cheerful: know'st thou not, the duke
+
Hath banish'd me, his daughter?
+
+
ROSALIND
+
+
That he hath not.
+
+
CELIA
+
+
No, hath not? Rosalind lacks then the love
+
Which teacheth thee that thou and I am one:
+
Shall we be sunder'd? shall we part, sweet girl?
+
No: let my father seek another heir.
+
Therefore devise with me how we may fly,
+
Whither to go and what to bear with us;
+
And do not seek to take your change upon you,
+
To bear your griefs yourself and leave me out;
+
For, by this heaven, now at our sorrows pale,
+
Say what thou canst, I'll go along with thee.
+
+
ROSALIND
+
+
Why, whither shall we go?
+
+
CELIA
+
+
To seek my uncle in the forest of Arden.
+
+
ROSALIND
+
+
Alas, what danger will it be to us,
+
Maids as we are, to travel forth so far!
+
Beauty provoketh thieves sooner than gold.
+
+
CELIA
+
+
I'll put myself in poor and mean attire
+
And with a kind of umber smirch my face;
+
The like do you: so shall we pass along
+
And never stir assailants.
+
+
ROSALIND
+
+
Were it not better,
+
Because that I am more than common tall,
+
That I did suit me all points like a man?
+
A gallant curtle-axe upon my thigh,
+
A boar-spear in my hand; and--in my heart
+
Lie there what hidden woman's fear there will--
+
We'll have a swashing and a martial outside,
+
As many other mannish cowards have
+
That do outface it with their semblances.
+
+
CELIA
+
+
What shall I call thee when thou art a man?
+
+
ROSALIND
+
+
I'll have no worse a name than Jove's own page;
+
And therefore look you call me Ganymede.
+
But what will you be call'd?
+
+
CELIA
+
+
Something that hath a reference to my state
+
No longer Celia, but Aliena.
+
+
ROSALIND
+
+
But, cousin, what if we assay'd to steal
+
The clownish fool out of your father's court?
+
Would he not be a comfort to our travel?
+
+
CELIA
+
+
He'll go along o'er the wide world with me;
+
Leave me alone to woo him. Let's away,
+
And get our jewels and our wealth together,
+
Devise the fittest time and safest way
+
To hide us from pursuit that will be made
+
After my flight. Now go we in content
+
To liberty and not to banishment.
+
Exeunt
+
+
+
+
+ + diff --git a/lib/Symfony/Component/CssSelector/Tests/XPath/TranslatorTest.php b/lib/Symfony/Component/CssSelector/Tests/XPath/TranslatorTest.php new file mode 100644 index 00000000..66c8f8b0 --- /dev/null +++ b/lib/Symfony/Component/CssSelector/Tests/XPath/TranslatorTest.php @@ -0,0 +1,413 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\XPath; + +use PHPUnit\Framework\TestCase; +use SimplePay\Vendor\Symfony\Component\CssSelector\Node\ElementNode; +use SimplePay\Vendor\Symfony\Component\CssSelector\Node\FunctionNode; +use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Parser; +use SimplePay\Vendor\Symfony\Component\CssSelector\XPath\Extension\HtmlExtension; +use SimplePay\Vendor\Symfony\Component\CssSelector\XPath\Translator; +use SimplePay\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr; + +class TranslatorTest extends TestCase +{ + /** @dataProvider getXpathLiteralTestData */ + public function testXpathLiteral($value, $literal) + { + $this->assertEquals($literal, Translator::getXpathLiteral($value)); + } + + /** @dataProvider getCssToXPathTestData */ + public function testCssToXPath($css, $xpath) + { + $translator = new Translator(); + $translator->registerExtension(new HtmlExtension($translator)); + $this->assertEquals($xpath, $translator->cssToXPath($css, '')); + } + + public function testCssToXPathPseudoElement() + { + $this->expectException('SimplePay\Vendor\Symfony\Component\CssSelector\Exception\ExpressionErrorException'); + $translator = new Translator(); + $translator->registerExtension(new HtmlExtension($translator)); + $translator->cssToXPath('e::first-line'); + } + + public function testGetExtensionNotExistsExtension() + { + $this->expectException('SimplePay\Vendor\Symfony\Component\CssSelector\Exception\ExpressionErrorException'); + $translator = new Translator(); + $translator->registerExtension(new HtmlExtension($translator)); + $translator->getExtension('fake'); + } + + public function testAddCombinationNotExistsExtension() + { + $this->expectException('SimplePay\Vendor\Symfony\Component\CssSelector\Exception\ExpressionErrorException'); + $translator = new Translator(); + $translator->registerExtension(new HtmlExtension($translator)); + $parser = new Parser(); + $xpath = $parser->parse('*')[0]; + $combinedXpath = $parser->parse('*')[0]; + $translator->addCombination('fake', $xpath, $combinedXpath); + } + + public function testAddFunctionNotExistsFunction() + { + $this->expectException('SimplePay\Vendor\Symfony\Component\CssSelector\Exception\ExpressionErrorException'); + $translator = new Translator(); + $translator->registerExtension(new HtmlExtension($translator)); + $xpath = new XPathExpr(); + $function = new FunctionNode(new ElementNode(), 'fake'); + $translator->addFunction($xpath, $function); + } + + public function testAddPseudoClassNotExistsClass() + { + $this->expectException('SimplePay\Vendor\Symfony\Component\CssSelector\Exception\ExpressionErrorException'); + $translator = new Translator(); + $translator->registerExtension(new HtmlExtension($translator)); + $xpath = new XPathExpr(); + $translator->addPseudoClass($xpath, 'fake'); + } + + public function testAddAttributeMatchingClassNotExistsClass() + { + $this->expectException('SimplePay\Vendor\Symfony\Component\CssSelector\Exception\ExpressionErrorException'); + $translator = new Translator(); + $translator->registerExtension(new HtmlExtension($translator)); + $xpath = new XPathExpr(); + $translator->addAttributeMatching($xpath, '', '', ''); + } + + /** @dataProvider getXmlLangTestData */ + public function testXmlLang($css, array $elementsId) + { + $translator = new Translator(); + $document = new \SimpleXMLElement(file_get_contents(__DIR__.'/Fixtures/lang.xml')); + $elements = $document->xpath($translator->cssToXPath($css)); + $this->assertCount(\count($elementsId), $elements); + foreach ($elements as $element) { + $this->assertContains((string) $element->attributes()->id, $elementsId); + } + } + + /** @dataProvider getHtmlIdsTestData */ + public function testHtmlIds($css, array $elementsId) + { + $translator = new Translator(); + $translator->registerExtension(new HtmlExtension($translator)); + $document = new \DOMDocument(); + $document->strictErrorChecking = false; + $internalErrors = libxml_use_internal_errors(true); + $document->loadHTMLFile(__DIR__.'/Fixtures/ids.html'); + $document = simplexml_import_dom($document); + $elements = $document->xpath($translator->cssToXPath($css)); + $this->assertCount(\count($elementsId), $elementsId); + foreach ($elements as $element) { + if (null !== $element->attributes()->id) { + $this->assertContains((string) $element->attributes()->id, $elementsId); + } + } + libxml_clear_errors(); + libxml_use_internal_errors($internalErrors); + } + + /** @dataProvider getHtmlShakespearTestData */ + public function testHtmlShakespear($css, $count) + { + $translator = new Translator(); + $translator->registerExtension(new HtmlExtension($translator)); + $document = new \DOMDocument(); + $document->strictErrorChecking = false; + $document->loadHTMLFile(__DIR__.'/Fixtures/shakespear.html'); + $document = simplexml_import_dom($document); + $bodies = $document->xpath('//body'); + $elements = $bodies[0]->xpath($translator->cssToXPath($css)); + $this->assertCount($count, $elements); + } + + public function testOnlyOfTypeFindsSingleChildrenOfGivenType() + { + $translator = new Translator(); + $translator->registerExtension(new HtmlExtension($translator)); + $document = new \DOMDocument(); + $document->loadHTML(<<<'HTML' + + +

+ A +

+

+ B + C +

+ + +HTML +); + + $xpath = new \DOMXPath($document); + $nodeList = $xpath->query($translator->cssToXPath('span:only-of-type')); + + $this->assertSame(1, $nodeList->length); + $this->assertSame('A', $nodeList->item(0)->textContent); + } + + public function getXpathLiteralTestData() + { + return [ + ['foo', "'foo'"], + ["foo's bar", '"foo\'s bar"'], + ["foo's \"middle\" bar", 'concat(\'foo\', "\'", \'s "middle" bar\')'], + ["foo's 'middle' \"bar\"", 'concat(\'foo\', "\'", \'s \', "\'", \'middle\', "\'", \' "bar"\')'], + ]; + } + + public function getCssToXPathTestData() + { + return [ + ['*', '*'], + ['e', 'e'], + ['*|e', 'e'], + ['e|f', 'e:f'], + ['e[foo]', 'e[@foo]'], + ['e[foo|bar]', 'e[@foo:bar]'], + ['e[foo="bar"]', "e[@foo = 'bar']"], + ['e[foo~="bar"]', "e[@foo and contains(concat(' ', normalize-space(@foo), ' '), ' bar ')]"], + ['e[foo^="bar"]', "e[@foo and starts-with(@foo, 'bar')]"], + ['e[foo$="bar"]', "e[@foo and substring(@foo, string-length(@foo)-2) = 'bar']"], + ['e[foo*="bar"]', "e[@foo and contains(@foo, 'bar')]"], + ['e[foo!="bar"]', "e[not(@foo) or @foo != 'bar']"], + ['e[foo!="bar"][foo!="baz"]', "e[(not(@foo) or @foo != 'bar') and (not(@foo) or @foo != 'baz')]"], + ['e[hreflang|="en"]', "e[@hreflang and (@hreflang = 'en' or starts-with(@hreflang, 'en-'))]"], + ['e:nth-child(1)', "*/*[(name() = 'e') and (position() = 1)]"], + ['e:nth-last-child(1)', "*/*[(name() = 'e') and (position() = last() - 0)]"], + ['e:nth-last-child(2n+2)', "*/*[(name() = 'e') and (last() - position() - 1 >= 0 and (last() - position() - 1) mod 2 = 0)]"], + ['e:nth-of-type(1)', '*/e[position() = 1]'], + ['e:nth-last-of-type(1)', '*/e[position() = last() - 0]'], + ['div e:nth-last-of-type(1) .aclass', "div/descendant-or-self::*/e[position() = last() - 0]/descendant-or-self::*/*[@class and contains(concat(' ', normalize-space(@class), ' '), ' aclass ')]"], + ['e:first-child', "*/*[(name() = 'e') and (position() = 1)]"], + ['e:last-child', "*/*[(name() = 'e') and (position() = last())]"], + ['e:first-of-type', '*/e[position() = 1]'], + ['e:last-of-type', '*/e[position() = last()]'], + ['e:only-child', "*/*[(name() = 'e') and (last() = 1)]"], + ['e:only-of-type', 'e[count(preceding-sibling::e)=0 and count(following-sibling::e)=0]'], + ['e:empty', 'e[not(*) and not(string-length())]'], + ['e:EmPTY', 'e[not(*) and not(string-length())]'], + ['e:root', 'e[not(parent::*)]'], + ['e:hover', 'e[0]'], + ['e:contains("foo")', "e[contains(string(.), 'foo')]"], + ['e:ConTains(foo)', "e[contains(string(.), 'foo')]"], + ['e.warning', "e[@class and contains(concat(' ', normalize-space(@class), ' '), ' warning ')]"], + ['e#myid', "e[@id = 'myid']"], + ['e:not(:nth-child(odd))', 'e[not(position() - 1 >= 0 and (position() - 1) mod 2 = 0)]'], + ['e:nOT(*)', 'e[0]'], + ['e f', 'e/descendant-or-self::*/f'], + ['e > f', 'e/f'], + ['e + f', "e/following-sibling::*[(name() = 'f') and (position() = 1)]"], + ['e ~ f', 'e/following-sibling::f'], + ['div#container p', "div[@id = 'container']/descendant-or-self::*/p"], + ]; + } + + public function getXmlLangTestData() + { + return [ + [':lang("EN")', ['first', 'second', 'third', 'fourth']], + [':lang("en-us")', ['second', 'fourth']], + [':lang(en-nz)', ['third']], + [':lang(fr)', ['fifth']], + [':lang(ru)', ['sixth']], + [":lang('ZH')", ['eighth']], + [':lang(de) :lang(zh)', ['eighth']], + [':lang(en), :lang(zh)', ['first', 'second', 'third', 'fourth', 'eighth']], + [':lang(es)', []], + ]; + } + + public function getHtmlIdsTestData() + { + return [ + ['div', ['outer-div', 'li-div', 'foobar-div']], + ['DIV', ['outer-div', 'li-div', 'foobar-div']], // case-insensitive in HTML + ['div div', ['li-div']], + ['div, div div', ['outer-div', 'li-div', 'foobar-div']], + ['a[name]', ['name-anchor']], + ['a[NAme]', ['name-anchor']], // case-insensitive in HTML: + ['a[rel]', ['tag-anchor', 'nofollow-anchor']], + ['a[rel="tag"]', ['tag-anchor']], + ['a[href*="localhost"]', ['tag-anchor']], + ['a[href*=""]', []], + ['a[href^="http"]', ['tag-anchor', 'nofollow-anchor']], + ['a[href^="http:"]', ['tag-anchor']], + ['a[href^=""]', []], + ['a[href$="org"]', ['nofollow-anchor']], + ['a[href$=""]', []], + ['div[foobar~="bc"]', ['foobar-div']], + ['div[foobar~="cde"]', ['foobar-div']], + ['[foobar~="ab bc"]', ['foobar-div']], + ['[foobar~=""]', []], + ['[foobar~=" \t"]', []], + ['div[foobar~="cd"]', []], + ['*[lang|="En"]', ['second-li']], + ['[lang|="En-us"]', ['second-li']], + // Attribute values are case sensitive + ['*[lang|="en"]', []], + ['[lang|="en-US"]', []], + ['*[lang|="e"]', []], + // ... :lang() is not. + [':lang("EN")', ['second-li', 'li-div']], + ['*:lang(en-US)', ['second-li', 'li-div']], + [':lang("e")', []], + ['li:nth-child(3)', ['third-li']], + ['li:nth-child(10)', []], + ['li:nth-child(2n)', ['second-li', 'fourth-li', 'sixth-li']], + ['li:nth-child(even)', ['second-li', 'fourth-li', 'sixth-li']], + ['li:nth-child(2n+0)', ['second-li', 'fourth-li', 'sixth-li']], + ['li:nth-child(+2n+1)', ['first-li', 'third-li', 'fifth-li', 'seventh-li']], + ['li:nth-child(odd)', ['first-li', 'third-li', 'fifth-li', 'seventh-li']], + ['li:nth-child(2n+4)', ['fourth-li', 'sixth-li']], + ['li:nth-child(3n+1)', ['first-li', 'fourth-li', 'seventh-li']], + ['li:nth-child(n)', ['first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li']], + ['li:nth-child(n-1)', ['first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li']], + ['li:nth-child(n+1)', ['first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li']], + ['li:nth-child(n+3)', ['third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li']], + ['li:nth-child(-n)', []], + ['li:nth-child(-n-1)', []], + ['li:nth-child(-n+1)', ['first-li']], + ['li:nth-child(-n+3)', ['first-li', 'second-li', 'third-li']], + ['li:nth-last-child(0)', []], + ['li:nth-last-child(2n)', ['second-li', 'fourth-li', 'sixth-li']], + ['li:nth-last-child(even)', ['second-li', 'fourth-li', 'sixth-li']], + ['li:nth-last-child(2n+2)', ['second-li', 'fourth-li', 'sixth-li']], + ['li:nth-last-child(n)', ['first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li']], + ['li:nth-last-child(n-1)', ['first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li']], + ['li:nth-last-child(n-3)', ['first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li']], + ['li:nth-last-child(n+1)', ['first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li']], + ['li:nth-last-child(n+3)', ['first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li']], + ['li:nth-last-child(-n)', []], + ['li:nth-last-child(-n-1)', []], + ['li:nth-last-child(-n+1)', ['seventh-li']], + ['li:nth-last-child(-n+3)', ['fifth-li', 'sixth-li', 'seventh-li']], + ['ol:first-of-type', ['first-ol']], + ['ol:nth-child(1)', ['first-ol']], + ['ol:nth-of-type(2)', ['second-ol']], + ['ol:nth-last-of-type(1)', ['second-ol']], + ['span:only-child', ['foobar-span']], + ['li div:only-child', ['li-div']], + ['div *:only-child', ['li-div', 'foobar-span']], + ['p:only-of-type', ['paragraph']], + ['a:empty', ['name-anchor']], + ['a:EMpty', ['name-anchor']], + ['li:empty', ['third-li', 'fourth-li', 'fifth-li', 'sixth-li']], + [':root', ['html']], + ['html:root', ['html']], + ['li:root', []], + ['* :root', []], + ['*:contains("link")', ['html', 'outer-div', 'tag-anchor', 'nofollow-anchor']], + [':CONtains("link")', ['html', 'outer-div', 'tag-anchor', 'nofollow-anchor']], + ['*:contains("LInk")', []], // case sensitive + ['*:contains("e")', ['html', 'nil', 'outer-div', 'first-ol', 'first-li', 'paragraph', 'p-em']], + ['*:contains("E")', []], // case-sensitive + ['.a', ['first-ol']], + ['.b', ['first-ol']], + ['*.a', ['first-ol']], + ['ol.a', ['first-ol']], + ['.c', ['first-ol', 'third-li', 'fourth-li']], + ['*.c', ['first-ol', 'third-li', 'fourth-li']], + ['ol *.c', ['third-li', 'fourth-li']], + ['ol li.c', ['third-li', 'fourth-li']], + ['li ~ li.c', ['third-li', 'fourth-li']], + ['ol > li.c', ['third-li', 'fourth-li']], + ['#first-li', ['first-li']], + ['li#first-li', ['first-li']], + ['*#first-li', ['first-li']], + ['li div', ['li-div']], + ['li > div', ['li-div']], + ['div div', ['li-div']], + ['div > div', []], + ['div>.c', ['first-ol']], + ['div > .c', ['first-ol']], + ['div + div', ['foobar-div']], + ['a ~ a', ['tag-anchor', 'nofollow-anchor']], + ['a[rel="tag"] ~ a', ['nofollow-anchor']], + ['ol#first-ol li:last-child', ['seventh-li']], + ['ol#first-ol *:last-child', ['li-div', 'seventh-li']], + ['#outer-div:first-child', ['outer-div']], + ['#outer-div :first-child', ['name-anchor', 'first-li', 'li-div', 'p-b', 'checkbox-fieldset-disabled', 'area-href']], + ['a[href]', ['tag-anchor', 'nofollow-anchor']], + [':not(*)', []], + ['a:not([href])', ['name-anchor']], + ['ol :Not(li[class])', ['first-li', 'second-li', 'li-div', 'fifth-li', 'sixth-li', 'seventh-li']], + // HTML-specific + [':link', ['link-href', 'tag-anchor', 'nofollow-anchor', 'area-href']], + [':visited', []], + [':enabled', ['link-href', 'tag-anchor', 'nofollow-anchor', 'checkbox-unchecked', 'text-checked', 'checkbox-checked', 'area-href']], + [':disabled', ['checkbox-disabled', 'checkbox-disabled-checked', 'fieldset', 'checkbox-fieldset-disabled']], + [':checked', ['checkbox-checked', 'checkbox-disabled-checked']], + ]; + } + + public function getHtmlShakespearTestData() + { + return [ + ['*', 246], + ['div:contains(CELIA)', 26], + ['div:only-child', 22], // ? + ['div:nth-child(even)', 106], + ['div:nth-child(2n)', 106], + ['div:nth-child(odd)', 137], + ['div:nth-child(2n+1)', 137], + ['div:nth-child(n)', 243], + ['div:last-child', 53], + ['div:first-child', 51], + ['div > div', 242], + ['div + div', 190], + ['div ~ div', 190], + ['body', 1], + ['body div', 243], + ['div', 243], + ['div div', 242], + ['div div div', 241], + ['div, div, div', 243], + ['div, a, span', 243], + ['.dialog', 51], + ['div.dialog', 51], + ['div .dialog', 51], + ['div.character, div.dialog', 99], + ['div.direction.dialog', 0], + ['div.dialog.direction', 0], + ['div.dialog.scene', 1], + ['div.scene.scene', 1], + ['div.scene .scene', 0], + ['div.direction .dialog ', 0], + ['div .dialog .direction', 4], + ['div.dialog .dialog .direction', 4], + ['#speech5', 1], + ['div#speech5', 1], + ['div #speech5', 1], + ['div.scene div.dialog', 49], + ['div#scene1 div.dialog div', 142], + ['#scene1 #speech1', 1], + ['div[class]', 103], + ['div[class=dialog]', 50], + ['div[class^=dia]', 51], + ['div[class$=log]', 50], + ['div[class*=sce]', 1], + ['div[class|=dialog]', 50], // ? Seems right + ['div[class!=madeup]', 243], // ? Seems right + ['div[class~=dialog]', 51], // ? Seems right + ]; + } +} diff --git a/lib/Symfony/Component/CssSelector/XPath/Extension/AbstractExtension.php b/lib/Symfony/Component/CssSelector/XPath/Extension/AbstractExtension.php index 9db3fdc9..c7483c74 100644 --- a/lib/Symfony/Component/CssSelector/XPath/Extension/AbstractExtension.php +++ b/lib/Symfony/Component/CssSelector/XPath/Extension/AbstractExtension.php @@ -26,7 +26,7 @@ abstract class AbstractExtension implements ExtensionInterface /** * {@inheritdoc} */ - public function getNodeTranslators(): array + public function getNodeTranslators() { return []; } @@ -34,7 +34,7 @@ public function getNodeTranslators(): array /** * {@inheritdoc} */ - public function getCombinationTranslators(): array + public function getCombinationTranslators() { return []; } @@ -42,7 +42,7 @@ public function getCombinationTranslators(): array /** * {@inheritdoc} */ - public function getFunctionTranslators(): array + public function getFunctionTranslators() { return []; } @@ -50,7 +50,7 @@ public function getFunctionTranslators(): array /** * {@inheritdoc} */ - public function getPseudoClassTranslators(): array + public function getPseudoClassTranslators() { return []; } @@ -58,7 +58,7 @@ public function getPseudoClassTranslators(): array /** * {@inheritdoc} */ - public function getAttributeMatchingTranslators(): array + public function getAttributeMatchingTranslators() { return []; } diff --git a/lib/Symfony/Component/CssSelector/XPath/Extension/AttributeMatchingExtension.php b/lib/Symfony/Component/CssSelector/XPath/Extension/AttributeMatchingExtension.php index 70d3c331..6b555a31 100644 --- a/lib/Symfony/Component/CssSelector/XPath/Extension/AttributeMatchingExtension.php +++ b/lib/Symfony/Component/CssSelector/XPath/Extension/AttributeMatchingExtension.php @@ -29,7 +29,7 @@ class AttributeMatchingExtension extends AbstractExtension /** * {@inheritdoc} */ - public function getAttributeMatchingTranslators(): array + public function getAttributeMatchingTranslators() { return [ 'exists' => [$this, 'translateExists'], @@ -43,17 +43,35 @@ public function getAttributeMatchingTranslators(): array ]; } - public function translateExists(XPathExpr $xpath, string $attribute, ?string $value): XPathExpr + /** + * @param string $attribute + * @param string $value + * + * @return XPathExpr + */ + public function translateExists(XPathExpr $xpath, $attribute, $value) { return $xpath->addCondition($attribute); } - public function translateEquals(XPathExpr $xpath, string $attribute, ?string $value): XPathExpr + /** + * @param string $attribute + * @param string $value + * + * @return XPathExpr + */ + public function translateEquals(XPathExpr $xpath, $attribute, $value) { return $xpath->addCondition(sprintf('%s = %s', $attribute, Translator::getXpathLiteral($value))); } - public function translateIncludes(XPathExpr $xpath, string $attribute, ?string $value): XPathExpr + /** + * @param string $attribute + * @param string $value + * + * @return XPathExpr + */ + public function translateIncludes(XPathExpr $xpath, $attribute, $value) { return $xpath->addCondition($value ? sprintf( '%1$s and contains(concat(\' \', normalize-space(%1$s), \' \'), %2$s)', @@ -62,7 +80,13 @@ public function translateIncludes(XPathExpr $xpath, string $attribute, ?string $ ) : '0'); } - public function translateDashMatch(XPathExpr $xpath, string $attribute, ?string $value): XPathExpr + /** + * @param string $attribute + * @param string $value + * + * @return XPathExpr + */ + public function translateDashMatch(XPathExpr $xpath, $attribute, $value) { return $xpath->addCondition(sprintf( '%1$s and (%1$s = %2$s or starts-with(%1$s, %3$s))', @@ -72,7 +96,13 @@ public function translateDashMatch(XPathExpr $xpath, string $attribute, ?string )); } - public function translatePrefixMatch(XPathExpr $xpath, string $attribute, ?string $value): XPathExpr + /** + * @param string $attribute + * @param string $value + * + * @return XPathExpr + */ + public function translatePrefixMatch(XPathExpr $xpath, $attribute, $value) { return $xpath->addCondition($value ? sprintf( '%1$s and starts-with(%1$s, %2$s)', @@ -81,7 +111,13 @@ public function translatePrefixMatch(XPathExpr $xpath, string $attribute, ?strin ) : '0'); } - public function translateSuffixMatch(XPathExpr $xpath, string $attribute, ?string $value): XPathExpr + /** + * @param string $attribute + * @param string $value + * + * @return XPathExpr + */ + public function translateSuffixMatch(XPathExpr $xpath, $attribute, $value) { return $xpath->addCondition($value ? sprintf( '%1$s and substring(%1$s, string-length(%1$s)-%2$s) = %3$s', @@ -91,7 +127,13 @@ public function translateSuffixMatch(XPathExpr $xpath, string $attribute, ?strin ) : '0'); } - public function translateSubstringMatch(XPathExpr $xpath, string $attribute, ?string $value): XPathExpr + /** + * @param string $attribute + * @param string $value + * + * @return XPathExpr + */ + public function translateSubstringMatch(XPathExpr $xpath, $attribute, $value) { return $xpath->addCondition($value ? sprintf( '%1$s and contains(%1$s, %2$s)', @@ -100,7 +142,13 @@ public function translateSubstringMatch(XPathExpr $xpath, string $attribute, ?st ) : '0'); } - public function translateDifferent(XPathExpr $xpath, string $attribute, ?string $value): XPathExpr + /** + * @param string $attribute + * @param string $value + * + * @return XPathExpr + */ + public function translateDifferent(XPathExpr $xpath, $attribute, $value) { return $xpath->addCondition(sprintf( $value ? 'not(%1$s) or %1$s != %2$s' : '%s != %s', @@ -112,7 +160,7 @@ public function translateDifferent(XPathExpr $xpath, string $attribute, ?string /** * {@inheritdoc} */ - public function getName(): string + public function getName() { return 'attribute-matching'; } diff --git a/lib/Symfony/Component/CssSelector/XPath/Extension/CombinationExtension.php b/lib/Symfony/Component/CssSelector/XPath/Extension/CombinationExtension.php index 7e589c58..75207ad3 100644 --- a/lib/Symfony/Component/CssSelector/XPath/Extension/CombinationExtension.php +++ b/lib/Symfony/Component/CssSelector/XPath/Extension/CombinationExtension.php @@ -28,7 +28,7 @@ class CombinationExtension extends AbstractExtension /** * {@inheritdoc} */ - public function getCombinationTranslators(): array + public function getCombinationTranslators() { return [ ' ' => [$this, 'translateDescendant'], @@ -38,17 +38,26 @@ public function getCombinationTranslators(): array ]; } - public function translateDescendant(XPathExpr $xpath, XPathExpr $combinedXpath): XPathExpr + /** + * @return XPathExpr + */ + public function translateDescendant(XPathExpr $xpath, XPathExpr $combinedXpath) { return $xpath->join('/descendant-or-self::*/', $combinedXpath); } - public function translateChild(XPathExpr $xpath, XPathExpr $combinedXpath): XPathExpr + /** + * @return XPathExpr + */ + public function translateChild(XPathExpr $xpath, XPathExpr $combinedXpath) { return $xpath->join('/', $combinedXpath); } - public function translateDirectAdjacent(XPathExpr $xpath, XPathExpr $combinedXpath): XPathExpr + /** + * @return XPathExpr + */ + public function translateDirectAdjacent(XPathExpr $xpath, XPathExpr $combinedXpath) { return $xpath ->join('/following-sibling::', $combinedXpath) @@ -56,7 +65,10 @@ public function translateDirectAdjacent(XPathExpr $xpath, XPathExpr $combinedXpa ->addCondition('position() = 1'); } - public function translateIndirectAdjacent(XPathExpr $xpath, XPathExpr $combinedXpath): XPathExpr + /** + * @return XPathExpr + */ + public function translateIndirectAdjacent(XPathExpr $xpath, XPathExpr $combinedXpath) { return $xpath->join('/following-sibling::', $combinedXpath); } @@ -64,7 +76,7 @@ public function translateIndirectAdjacent(XPathExpr $xpath, XPathExpr $combinedX /** * {@inheritdoc} */ - public function getName(): string + public function getName() { return 'combination'; } diff --git a/lib/Symfony/Component/CssSelector/XPath/Extension/ExtensionInterface.php b/lib/Symfony/Component/CssSelector/XPath/Extension/ExtensionInterface.php index 0dc17426..11ac5734 100644 --- a/lib/Symfony/Component/CssSelector/XPath/Extension/ExtensionInterface.php +++ b/lib/Symfony/Component/CssSelector/XPath/Extension/ExtensionInterface.php @@ -30,38 +30,40 @@ interface ExtensionInterface * * @return callable[] */ - public function getNodeTranslators(): array; + public function getNodeTranslators(); /** * Returns combination translators. * * @return callable[] */ - public function getCombinationTranslators(): array; + public function getCombinationTranslators(); /** * Returns function translators. * * @return callable[] */ - public function getFunctionTranslators(): array; + public function getFunctionTranslators(); /** * Returns pseudo-class translators. * * @return callable[] */ - public function getPseudoClassTranslators(): array; + public function getPseudoClassTranslators(); /** * Returns attribute operation translators. * * @return callable[] */ - public function getAttributeMatchingTranslators(): array; + public function getAttributeMatchingTranslators(); /** * Returns extension name. + * + * @return string */ - public function getName(): string; + public function getName(); } diff --git a/lib/Symfony/Component/CssSelector/XPath/Extension/FunctionExtension.php b/lib/Symfony/Component/CssSelector/XPath/Extension/FunctionExtension.php index ba398238..0afaaccd 100644 --- a/lib/Symfony/Component/CssSelector/XPath/Extension/FunctionExtension.php +++ b/lib/Symfony/Component/CssSelector/XPath/Extension/FunctionExtension.php @@ -33,7 +33,7 @@ class FunctionExtension extends AbstractExtension /** * {@inheritdoc} */ - public function getFunctionTranslators(): array + public function getFunctionTranslators() { return [ 'nth-child' => [$this, 'translateNthChild'], @@ -46,12 +46,17 @@ public function getFunctionTranslators(): array } /** + * @param bool $last + * @param bool $addNameTest + * + * @return XPathExpr + * * @throws ExpressionErrorException */ - public function translateNthChild(XPathExpr $xpath, FunctionNode $function, bool $last = false, bool $addNameTest = true): XPathExpr + public function translateNthChild(XPathExpr $xpath, FunctionNode $function, $last = false, $addNameTest = true) { try { - [$a, $b] = Parser::parseSeries($function->getArguments()); + list($a, $b) = Parser::parseSeries($function->getArguments()); } catch (SyntaxErrorException $e) { throw new ExpressionErrorException(sprintf('Invalid series: "%s".', implode('", "', $function->getArguments())), 0, $e); } @@ -103,20 +108,28 @@ public function translateNthChild(XPathExpr $xpath, FunctionNode $function, bool // -1n+6 means elements 6 and previous } - public function translateNthLastChild(XPathExpr $xpath, FunctionNode $function): XPathExpr + /** + * @return XPathExpr + */ + public function translateNthLastChild(XPathExpr $xpath, FunctionNode $function) { return $this->translateNthChild($xpath, $function, true); } - public function translateNthOfType(XPathExpr $xpath, FunctionNode $function): XPathExpr + /** + * @return XPathExpr + */ + public function translateNthOfType(XPathExpr $xpath, FunctionNode $function) { return $this->translateNthChild($xpath, $function, false, false); } /** + * @return XPathExpr + * * @throws ExpressionErrorException */ - public function translateNthLastOfType(XPathExpr $xpath, FunctionNode $function): XPathExpr + public function translateNthLastOfType(XPathExpr $xpath, FunctionNode $function) { if ('*' === $xpath->getElement()) { throw new ExpressionErrorException('"*:nth-of-type()" is not implemented.'); @@ -126,9 +139,11 @@ public function translateNthLastOfType(XPathExpr $xpath, FunctionNode $function) } /** + * @return XPathExpr + * * @throws ExpressionErrorException */ - public function translateContains(XPathExpr $xpath, FunctionNode $function): XPathExpr + public function translateContains(XPathExpr $xpath, FunctionNode $function) { $arguments = $function->getArguments(); foreach ($arguments as $token) { @@ -144,9 +159,11 @@ public function translateContains(XPathExpr $xpath, FunctionNode $function): XPa } /** + * @return XPathExpr + * * @throws ExpressionErrorException */ - public function translateLang(XPathExpr $xpath, FunctionNode $function): XPathExpr + public function translateLang(XPathExpr $xpath, FunctionNode $function) { $arguments = $function->getArguments(); foreach ($arguments as $token) { @@ -164,7 +181,7 @@ public function translateLang(XPathExpr $xpath, FunctionNode $function): XPathEx /** * {@inheritdoc} */ - public function getName(): string + public function getName() { return 'function'; } diff --git a/lib/Symfony/Component/CssSelector/XPath/Extension/HtmlExtension.php b/lib/Symfony/Component/CssSelector/XPath/Extension/HtmlExtension.php index 64dc3871..58a0c5d5 100644 --- a/lib/Symfony/Component/CssSelector/XPath/Extension/HtmlExtension.php +++ b/lib/Symfony/Component/CssSelector/XPath/Extension/HtmlExtension.php @@ -39,7 +39,7 @@ public function __construct(Translator $translator) /** * {@inheritdoc} */ - public function getPseudoClassTranslators(): array + public function getPseudoClassTranslators() { return [ 'checked' => [$this, 'translateChecked'], @@ -56,14 +56,17 @@ public function getPseudoClassTranslators(): array /** * {@inheritdoc} */ - public function getFunctionTranslators(): array + public function getFunctionTranslators() { return [ 'lang' => [$this, 'translateLang'], ]; } - public function translateChecked(XPathExpr $xpath): XPathExpr + /** + * @return XPathExpr + */ + public function translateChecked(XPathExpr $xpath) { return $xpath->addCondition( '(@checked ' @@ -72,12 +75,18 @@ public function translateChecked(XPathExpr $xpath): XPathExpr ); } - public function translateLink(XPathExpr $xpath): XPathExpr + /** + * @return XPathExpr + */ + public function translateLink(XPathExpr $xpath) { return $xpath->addCondition("@href and (name(.) = 'a' or name(.) = 'link' or name(.) = 'area')"); } - public function translateDisabled(XPathExpr $xpath): XPathExpr + /** + * @return XPathExpr + */ + public function translateDisabled(XPathExpr $xpath) { return $xpath->addCondition( '(' @@ -103,7 +112,10 @@ public function translateDisabled(XPathExpr $xpath): XPathExpr // todo: in the second half, add "and is not a descendant of that fieldset element's first legend element child, if any." } - public function translateEnabled(XPathExpr $xpath): XPathExpr + /** + * @return XPathExpr + */ + public function translateEnabled(XPathExpr $xpath) { return $xpath->addCondition( '(' @@ -137,9 +149,11 @@ public function translateEnabled(XPathExpr $xpath): XPathExpr } /** + * @return XPathExpr + * * @throws ExpressionErrorException */ - public function translateLang(XPathExpr $xpath, FunctionNode $function): XPathExpr + public function translateLang(XPathExpr $xpath, FunctionNode $function) { $arguments = $function->getArguments(); foreach ($arguments as $token) { @@ -157,22 +171,34 @@ public function translateLang(XPathExpr $xpath, FunctionNode $function): XPathEx )); } - public function translateSelected(XPathExpr $xpath): XPathExpr + /** + * @return XPathExpr + */ + public function translateSelected(XPathExpr $xpath) { return $xpath->addCondition("(@selected and name(.) = 'option')"); } - public function translateInvalid(XPathExpr $xpath): XPathExpr + /** + * @return XPathExpr + */ + public function translateInvalid(XPathExpr $xpath) { return $xpath->addCondition('0'); } - public function translateHover(XPathExpr $xpath): XPathExpr + /** + * @return XPathExpr + */ + public function translateHover(XPathExpr $xpath) { return $xpath->addCondition('0'); } - public function translateVisited(XPathExpr $xpath): XPathExpr + /** + * @return XPathExpr + */ + public function translateVisited(XPathExpr $xpath) { return $xpath->addCondition('0'); } @@ -180,7 +206,7 @@ public function translateVisited(XPathExpr $xpath): XPathExpr /** * {@inheritdoc} */ - public function getName(): string + public function getName() { return 'html'; } diff --git a/lib/Symfony/Component/CssSelector/XPath/Extension/NodeExtension.php b/lib/Symfony/Component/CssSelector/XPath/Extension/NodeExtension.php index 6628c0fa..4034b315 100644 --- a/lib/Symfony/Component/CssSelector/XPath/Extension/NodeExtension.php +++ b/lib/Symfony/Component/CssSelector/XPath/Extension/NodeExtension.php @@ -27,21 +27,27 @@ */ class NodeExtension extends AbstractExtension { - public const ELEMENT_NAME_IN_LOWER_CASE = 1; - public const ATTRIBUTE_NAME_IN_LOWER_CASE = 2; - public const ATTRIBUTE_VALUE_IN_LOWER_CASE = 4; + const ELEMENT_NAME_IN_LOWER_CASE = 1; + const ATTRIBUTE_NAME_IN_LOWER_CASE = 2; + const ATTRIBUTE_VALUE_IN_LOWER_CASE = 4; private $flags; - public function __construct(int $flags = 0) + /** + * @param int $flags + */ + public function __construct($flags = 0) { $this->flags = $flags; } /** + * @param int $flag + * @param bool $on + * * @return $this */ - public function setFlag(int $flag, bool $on): self + public function setFlag($flag, $on) { if ($on && !$this->hasFlag($flag)) { $this->flags += $flag; @@ -54,7 +60,12 @@ public function setFlag(int $flag, bool $on): self return $this; } - public function hasFlag(int $flag): bool + /** + * @param int $flag + * + * @return bool + */ + public function hasFlag($flag) { return (bool) ($this->flags & $flag); } @@ -62,7 +73,7 @@ public function hasFlag(int $flag): bool /** * {@inheritdoc} */ - public function getNodeTranslators(): array + public function getNodeTranslators() { return [ 'Selector' => [$this, 'translateSelector'], @@ -70,24 +81,33 @@ public function getNodeTranslators(): array 'Negation' => [$this, 'translateNegation'], 'Function' => [$this, 'translateFunction'], 'Pseudo' => [$this, 'translatePseudo'], - 'SimplePay_Attribute' => [$this, 'translateAttribute'], + 'Attribute' => [$this, 'translateAttribute'], 'Class' => [$this, 'translateClass'], 'Hash' => [$this, 'translateHash'], 'Element' => [$this, 'translateElement'], ]; } - public function translateSelector(Node\SelectorNode $node, Translator $translator): XPathExpr + /** + * @return XPathExpr + */ + public function translateSelector(Node\SelectorNode $node, Translator $translator) { return $translator->nodeToXPath($node->getTree()); } - public function translateCombinedSelector(Node\CombinedSelectorNode $node, Translator $translator): XPathExpr + /** + * @return XPathExpr + */ + public function translateCombinedSelector(Node\CombinedSelectorNode $node, Translator $translator) { return $translator->addCombination($node->getCombinator(), $node->getSelector(), $node->getSubSelector()); } - public function translateNegation(Node\NegationNode $node, Translator $translator): XPathExpr + /** + * @return XPathExpr + */ + public function translateNegation(Node\NegationNode $node, Translator $translator) { $xpath = $translator->nodeToXPath($node->getSelector()); $subXpath = $translator->nodeToXPath($node->getSubSelector()); @@ -100,21 +120,30 @@ public function translateNegation(Node\NegationNode $node, Translator $translato return $xpath->addCondition('0'); } - public function translateFunction(Node\FunctionNode $node, Translator $translator): XPathExpr + /** + * @return XPathExpr + */ + public function translateFunction(Node\FunctionNode $node, Translator $translator) { $xpath = $translator->nodeToXPath($node->getSelector()); return $translator->addFunction($xpath, $node); } - public function translatePseudo(Node\PseudoNode $node, Translator $translator): XPathExpr + /** + * @return XPathExpr + */ + public function translatePseudo(Node\PseudoNode $node, Translator $translator) { $xpath = $translator->nodeToXPath($node->getSelector()); return $translator->addPseudoClass($xpath, $node->getIdentifier()); } - public function translateAttribute(Node\AttributeNode $node, Translator $translator): XPathExpr + /** + * @return XPathExpr + */ + public function translateAttribute(Node\AttributeNode $node, Translator $translator) { $name = $node->getAttribute(); $safe = $this->isSafeName($name); @@ -139,25 +168,34 @@ public function translateAttribute(Node\AttributeNode $node, Translator $transla return $translator->addAttributeMatching($xpath, $node->getOperator(), $attribute, $value); } - public function translateClass(Node\ClassNode $node, Translator $translator): XPathExpr + /** + * @return XPathExpr + */ + public function translateClass(Node\ClassNode $node, Translator $translator) { $xpath = $translator->nodeToXPath($node->getSelector()); return $translator->addAttributeMatching($xpath, '~=', '@class', $node->getName()); } - public function translateHash(Node\HashNode $node, Translator $translator): XPathExpr + /** + * @return XPathExpr + */ + public function translateHash(Node\HashNode $node, Translator $translator) { $xpath = $translator->nodeToXPath($node->getSelector()); return $translator->addAttributeMatching($xpath, '=', '@id', $node->getId()); } - public function translateElement(Node\ElementNode $node): XPathExpr + /** + * @return XPathExpr + */ + public function translateElement(Node\ElementNode $node) { $element = $node->getElement(); - if ($element && $this->hasFlag(self::ELEMENT_NAME_IN_LOWER_CASE)) { + if ($this->hasFlag(self::ELEMENT_NAME_IN_LOWER_CASE)) { $element = strtolower($element); } @@ -185,12 +223,19 @@ public function translateElement(Node\ElementNode $node): XPathExpr /** * {@inheritdoc} */ - public function getName(): string + public function getName() { return 'node'; } - private function isSafeName(string $name): bool + /** + * Tests if given name is safe. + * + * @param string $name + * + * @return bool + */ + private function isSafeName($name) { return 0 < preg_match('~^[a-zA-Z_][a-zA-Z0-9_.-]*$~', $name); } diff --git a/lib/Symfony/Component/CssSelector/XPath/Extension/PseudoClassExtension.php b/lib/Symfony/Component/CssSelector/XPath/Extension/PseudoClassExtension.php index 32a8a065..30c13f70 100644 --- a/lib/Symfony/Component/CssSelector/XPath/Extension/PseudoClassExtension.php +++ b/lib/Symfony/Component/CssSelector/XPath/Extension/PseudoClassExtension.php @@ -29,7 +29,7 @@ class PseudoClassExtension extends AbstractExtension /** * {@inheritdoc} */ - public function getPseudoClassTranslators(): array + public function getPseudoClassTranslators() { return [ 'root' => [$this, 'translateRoot'], @@ -43,12 +43,18 @@ public function getPseudoClassTranslators(): array ]; } - public function translateRoot(XPathExpr $xpath): XPathExpr + /** + * @return XPathExpr + */ + public function translateRoot(XPathExpr $xpath) { return $xpath->addCondition('not(parent::*)'); } - public function translateFirstChild(XPathExpr $xpath): XPathExpr + /** + * @return XPathExpr + */ + public function translateFirstChild(XPathExpr $xpath) { return $xpath ->addStarPrefix() @@ -56,7 +62,10 @@ public function translateFirstChild(XPathExpr $xpath): XPathExpr ->addCondition('position() = 1'); } - public function translateLastChild(XPathExpr $xpath): XPathExpr + /** + * @return XPathExpr + */ + public function translateLastChild(XPathExpr $xpath) { return $xpath ->addStarPrefix() @@ -65,9 +74,11 @@ public function translateLastChild(XPathExpr $xpath): XPathExpr } /** + * @return XPathExpr + * * @throws ExpressionErrorException */ - public function translateFirstOfType(XPathExpr $xpath): XPathExpr + public function translateFirstOfType(XPathExpr $xpath) { if ('*' === $xpath->getElement()) { throw new ExpressionErrorException('"*:first-of-type" is not implemented.'); @@ -79,9 +90,11 @@ public function translateFirstOfType(XPathExpr $xpath): XPathExpr } /** + * @return XPathExpr + * * @throws ExpressionErrorException */ - public function translateLastOfType(XPathExpr $xpath): XPathExpr + public function translateLastOfType(XPathExpr $xpath) { if ('*' === $xpath->getElement()) { throw new ExpressionErrorException('"*:last-of-type" is not implemented.'); @@ -92,7 +105,10 @@ public function translateLastOfType(XPathExpr $xpath): XPathExpr ->addCondition('position() = last()'); } - public function translateOnlyChild(XPathExpr $xpath): XPathExpr + /** + * @return XPathExpr + */ + public function translateOnlyChild(XPathExpr $xpath) { return $xpath ->addStarPrefix() @@ -100,14 +116,26 @@ public function translateOnlyChild(XPathExpr $xpath): XPathExpr ->addCondition('last() = 1'); } - public function translateOnlyOfType(XPathExpr $xpath): XPathExpr + /** + * @return XPathExpr + * + * @throws ExpressionErrorException + */ + public function translateOnlyOfType(XPathExpr $xpath) { $element = $xpath->getElement(); + if ('*' === $element) { + throw new ExpressionErrorException('"*:only-of-type" is not implemented.'); + } + return $xpath->addCondition(sprintf('count(preceding-sibling::%s)=0 and count(following-sibling::%s)=0', $element, $element)); } - public function translateEmpty(XPathExpr $xpath): XPathExpr + /** + * @return XPathExpr + */ + public function translateEmpty(XPathExpr $xpath) { return $xpath->addCondition('not(*) and not(string-length())'); } @@ -115,7 +143,7 @@ public function translateEmpty(XPathExpr $xpath): XPathExpr /** * {@inheritdoc} */ - public function getName(): string + public function getName() { return 'pseudo-class'; } diff --git a/lib/Symfony/Component/CssSelector/XPath/Translator.php b/lib/Symfony/Component/CssSelector/XPath/Translator.php index 2150cfaa..e910035a 100644 --- a/lib/Symfony/Component/CssSelector/XPath/Translator.php +++ b/lib/Symfony/Component/CssSelector/XPath/Translator.php @@ -48,9 +48,9 @@ class Translator implements TranslatorInterface private $pseudoClassTranslators = []; private $attributeMatchingTranslators = []; - public function __construct(?ParserInterface $parser = null) + public function __construct(ParserInterface $parser = null) { - $this->mainParser = $parser ?? new Parser(); + $this->mainParser = $parser ?: new Parser(); $this ->registerExtension(new Extension\NodeExtension()) @@ -61,13 +61,18 @@ public function __construct(?ParserInterface $parser = null) ; } - public static function getXpathLiteral(string $element): string + /** + * @param string $element + * + * @return string + */ + public static function getXpathLiteral($element) { - if (!str_contains($element, "'")) { + if (false === strpos($element, "'")) { return "'".$element."'"; } - if (!str_contains($element, '"')) { + if (false === strpos($element, '"')) { return '"'.$element.'"'; } @@ -90,7 +95,7 @@ public static function getXpathLiteral(string $element): string /** * {@inheritdoc} */ - public function cssToXPath(string $cssExpr, string $prefix = 'descendant-or-self::'): string + public function cssToXPath($cssExpr, $prefix = 'descendant-or-self::') { $selectors = $this->parseSelectors($cssExpr); @@ -109,15 +114,17 @@ public function cssToXPath(string $cssExpr, string $prefix = 'descendant-or-self /** * {@inheritdoc} */ - public function selectorToXPath(SelectorNode $selector, string $prefix = 'descendant-or-self::'): string + public function selectorToXPath(SelectorNode $selector, $prefix = 'descendant-or-self::') { return ($prefix ?: '').$this->nodeToXPath($selector); } /** + * Registers an extension. + * * @return $this */ - public function registerExtension(Extension\ExtensionInterface $extension): self + public function registerExtension(Extension\ExtensionInterface $extension) { $this->extensions[$extension->getName()] = $extension; @@ -131,9 +138,13 @@ public function registerExtension(Extension\ExtensionInterface $extension): self } /** + * @param string $name + * + * @return Extension\ExtensionInterface + * * @throws ExpressionErrorException */ - public function getExtension(string $name): Extension\ExtensionInterface + public function getExtension($name) { if (!isset($this->extensions[$name])) { throw new ExpressionErrorException(sprintf('Extension "%s" not registered.', $name)); @@ -143,9 +154,11 @@ public function getExtension(string $name): Extension\ExtensionInterface } /** + * Registers a shortcut parser. + * * @return $this */ - public function registerParserShortcut(ParserInterface $shortcut): self + public function registerParserShortcut(ParserInterface $shortcut) { $this->shortcutParsers[] = $shortcut; @@ -153,69 +166,89 @@ public function registerParserShortcut(ParserInterface $shortcut): self } /** + * @return XPathExpr + * * @throws ExpressionErrorException */ - public function nodeToXPath(NodeInterface $node): XPathExpr + public function nodeToXPath(NodeInterface $node) { if (!isset($this->nodeTranslators[$node->getNodeName()])) { throw new ExpressionErrorException(sprintf('Node "%s" not supported.', $node->getNodeName())); } - return $this->nodeTranslators[$node->getNodeName()]($node, $this); + return \call_user_func($this->nodeTranslators[$node->getNodeName()], $node, $this); } /** + * @param string $combiner + * + * @return XPathExpr + * * @throws ExpressionErrorException */ - public function addCombination(string $combiner, NodeInterface $xpath, NodeInterface $combinedXpath): XPathExpr + public function addCombination($combiner, NodeInterface $xpath, NodeInterface $combinedXpath) { if (!isset($this->combinationTranslators[$combiner])) { throw new ExpressionErrorException(sprintf('Combiner "%s" not supported.', $combiner)); } - return $this->combinationTranslators[$combiner]($this->nodeToXPath($xpath), $this->nodeToXPath($combinedXpath)); + return \call_user_func($this->combinationTranslators[$combiner], $this->nodeToXPath($xpath), $this->nodeToXPath($combinedXpath)); } /** + * @return XPathExpr + * * @throws ExpressionErrorException */ - public function addFunction(XPathExpr $xpath, FunctionNode $function): XPathExpr + public function addFunction(XPathExpr $xpath, FunctionNode $function) { if (!isset($this->functionTranslators[$function->getName()])) { throw new ExpressionErrorException(sprintf('Function "%s" not supported.', $function->getName())); } - return $this->functionTranslators[$function->getName()]($xpath, $function); + return \call_user_func($this->functionTranslators[$function->getName()], $xpath, $function); } /** + * @param string $pseudoClass + * + * @return XPathExpr + * * @throws ExpressionErrorException */ - public function addPseudoClass(XPathExpr $xpath, string $pseudoClass): XPathExpr + public function addPseudoClass(XPathExpr $xpath, $pseudoClass) { if (!isset($this->pseudoClassTranslators[$pseudoClass])) { throw new ExpressionErrorException(sprintf('Pseudo-class "%s" not supported.', $pseudoClass)); } - return $this->pseudoClassTranslators[$pseudoClass]($xpath); + return \call_user_func($this->pseudoClassTranslators[$pseudoClass], $xpath); } /** + * @param string $operator + * @param string $attribute + * @param string $value + * + * @return XPathExpr + * * @throws ExpressionErrorException */ - public function addAttributeMatching(XPathExpr $xpath, string $operator, string $attribute, ?string $value): XPathExpr + public function addAttributeMatching(XPathExpr $xpath, $operator, $attribute, $value) { if (!isset($this->attributeMatchingTranslators[$operator])) { - throw new ExpressionErrorException(sprintf('SimplePay_Attribute matcher operator "%s" not supported.', $operator)); + throw new ExpressionErrorException(sprintf('Attribute matcher operator "%s" not supported.', $operator)); } - return $this->attributeMatchingTranslators[$operator]($xpath, $attribute, $value); + return \call_user_func($this->attributeMatchingTranslators[$operator], $xpath, $attribute, $value); } /** + * @param string $css + * * @return SelectorNode[] */ - private function parseSelectors(string $css): array + private function parseSelectors($css) { foreach ($this->shortcutParsers as $shortcut) { $tokens = $shortcut->parse($css); diff --git a/lib/Symfony/Component/CssSelector/XPath/TranslatorInterface.php b/lib/Symfony/Component/CssSelector/XPath/TranslatorInterface.php index b956fb79..f2613206 100644 --- a/lib/Symfony/Component/CssSelector/XPath/TranslatorInterface.php +++ b/lib/Symfony/Component/CssSelector/XPath/TranslatorInterface.php @@ -27,11 +27,20 @@ interface TranslatorInterface { /** * Translates a CSS selector to an XPath expression. + * + * @param string $cssExpr + * @param string $prefix + * + * @return string */ - public function cssToXPath(string $cssExpr, string $prefix = 'descendant-or-self::'): string; + public function cssToXPath($cssExpr, $prefix = 'descendant-or-self::'); /** * Translates a parsed selector node to an XPath expression. + * + * @param string $prefix + * + * @return string */ - public function selectorToXPath(SelectorNode $selector, string $prefix = 'descendant-or-self::'): string; + public function selectorToXPath(SelectorNode $selector, $prefix = 'descendant-or-self::'); } diff --git a/lib/Symfony/Component/CssSelector/XPath/XPathExpr.php b/lib/Symfony/Component/CssSelector/XPath/XPathExpr.php index 613025e8..89a3e742 100644 --- a/lib/Symfony/Component/CssSelector/XPath/XPathExpr.php +++ b/lib/Symfony/Component/CssSelector/XPath/XPathExpr.php @@ -27,7 +27,13 @@ class XPathExpr private $element; private $condition; - public function __construct(string $path = '', string $element = '*', string $condition = '', bool $starPrefix = false) + /** + * @param string $path + * @param string $element + * @param string $condition + * @param bool $starPrefix + */ + public function __construct($path = '', $element = '*', $condition = '', $starPrefix = false) { $this->path = $path; $this->element = $element; @@ -38,7 +44,10 @@ public function __construct(string $path = '', string $element = '*', string $co } } - public function getElement(): string + /** + * @return string + */ + public function getElement() { return $this->element; } @@ -46,14 +55,17 @@ public function getElement(): string /** * @return $this */ - public function addCondition(string $condition): self + public function addCondition($condition) { $this->condition = $this->condition ? sprintf('(%s) and (%s)', $this->condition, $condition) : $condition; return $this; } - public function getCondition(): string + /** + * @return string + */ + public function getCondition() { return $this->condition; } @@ -61,7 +73,7 @@ public function getCondition(): string /** * @return $this */ - public function addNameTest(): self + public function addNameTest() { if ('*' !== $this->element) { $this->addCondition('name() = '.Translator::getXpathLiteral($this->element)); @@ -74,7 +86,7 @@ public function addNameTest(): self /** * @return $this */ - public function addStarPrefix(): self + public function addStarPrefix() { $this->path .= '*/'; @@ -84,9 +96,12 @@ public function addStarPrefix(): self /** * Joins another XPathExpr with a combiner. * + * @param string $combiner + * @param XPathExpr $expr + * * @return $this */ - public function join(string $combiner, self $expr): self + public function join($combiner, self $expr) { $path = $this->__toString().$combiner; @@ -101,7 +116,10 @@ public function join(string $combiner, self $expr): self return $this; } - public function __toString(): string + /** + * @return string + */ + public function __toString() { $path = $this->path.$this->element; $condition = null === $this->condition || '' === $this->condition ? '' : '['.$this->condition.']'; diff --git a/lib/Symfony/Component/CssSelector/composer.json b/lib/Symfony/Component/CssSelector/composer.json index f0b71249..435063fd 100644 --- a/lib/Symfony/Component/CssSelector/composer.json +++ b/lib/Symfony/Component/CssSelector/composer.json @@ -1,7 +1,7 @@ { "name": "symfony/css-selector", "type": "library", - "description": "Converts CSS selectors to XPath expressions", + "description": "Symfony CssSelector Component", "keywords": [], "homepage": "https://symfony.com", "license": "MIT", @@ -20,8 +20,7 @@ } ], "require": { - "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.16" + "php": "^5.5.9|>=7.0.8" }, "autoload": { "psr-4": { "Symfony\\Component\\CssSelector\\": "" }, diff --git a/lib/Symfony/Component/CssSelector/phpunit.xml.dist b/lib/Symfony/Component/CssSelector/phpunit.xml.dist new file mode 100644 index 00000000..a8e537ef --- /dev/null +++ b/lib/Symfony/Component/CssSelector/phpunit.xml.dist @@ -0,0 +1,31 @@ + + + + + + + + + + ./Tests/ + + + + + + ./ + + ./Resources + ./Tests + ./vendor + + + + diff --git a/lib/Symfony/Polyfill/Php80/LICENSE b/lib/Symfony/Polyfill/Php80/LICENSE deleted file mode 100644 index 0ed3a246..00000000 --- a/lib/Symfony/Polyfill/Php80/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020-present Fabien Potencier - -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. diff --git a/lib/Symfony/Polyfill/Php80/Php80.php b/lib/Symfony/Polyfill/Php80/Php80.php deleted file mode 100644 index 97dce9e5..00000000 --- a/lib/Symfony/Polyfill/Php80/Php80.php +++ /dev/null @@ -1,115 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Polyfill\Php80; - -/** - * @author Ion Bazan - * @author Nico Oelgart - * @author Nicolas Grekas - * - * @internal - */ -final class Php80 -{ - public static function fdiv(float $dividend, float $divisor): float - { - return @($dividend / $divisor); - } - - public static function get_debug_type($value): string - { - switch (true) { - case null === $value: return 'null'; - case \is_bool($value): return 'bool'; - case \is_string($value): return 'string'; - case \is_array($value): return 'array'; - case \is_int($value): return 'int'; - case \is_float($value): return 'float'; - case \is_object($value): break; - case $value instanceof \__PHP_Incomplete_Class: return '__PHP_Incomplete_Class'; - default: - if (null === $type = @get_resource_type($value)) { - return 'unknown'; - } - - if ('Unknown' === $type) { - $type = 'closed'; - } - - return "resource ($type)"; - } - - $class = \get_class($value); - - if (false === strpos($class, '@')) { - return $class; - } - - return (get_parent_class($class) ?: key(class_implements($class)) ?: 'class').'@anonymous'; - } - - public static function get_resource_id($res): int - { - if (!\is_resource($res) && null === @get_resource_type($res)) { - throw new \TypeError(sprintf('Argument 1 passed to get_resource_id() must be of the type resource, %s given', get_debug_type($res))); - } - - return (int) $res; - } - - public static function preg_last_error_msg(): string - { - switch (preg_last_error()) { - case \PREG_INTERNAL_ERROR: - return 'Internal error'; - case \PREG_BAD_UTF8_ERROR: - return 'Malformed UTF-8 characters, possibly incorrectly encoded'; - case \PREG_BAD_UTF8_OFFSET_ERROR: - return 'The offset did not correspond to the beginning of a valid UTF-8 code point'; - case \PREG_BACKTRACK_LIMIT_ERROR: - return 'Backtrack limit exhausted'; - case \PREG_RECURSION_LIMIT_ERROR: - return 'Recursion limit exhausted'; - case \PREG_JIT_STACKLIMIT_ERROR: - return 'JIT stack limit exhausted'; - case \PREG_NO_ERROR: - return 'No error'; - default: - return 'Unknown error'; - } - } - - public static function str_contains(string $haystack, string $needle): bool - { - return '' === $needle || false !== strpos($haystack, $needle); - } - - public static function str_starts_with(string $haystack, string $needle): bool - { - return 0 === strncmp($haystack, $needle, \strlen($needle)); - } - - public static function str_ends_with(string $haystack, string $needle): bool - { - if ('' === $needle || $needle === $haystack) { - return true; - } - - if ('' === $haystack) { - return false; - } - - $needleLength = \strlen($needle); - - return $needleLength <= \strlen($haystack) && 0 === substr_compare($haystack, $needle, -$needleLength); - } -} diff --git a/lib/Symfony/Polyfill/Php80/PhpToken.php b/lib/Symfony/Polyfill/Php80/PhpToken.php deleted file mode 100644 index 81bf6fc9..00000000 --- a/lib/Symfony/Polyfill/Php80/PhpToken.php +++ /dev/null @@ -1,103 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Polyfill\Php80; - -/** - * @author Fedonyuk Anton - * - * @internal - */ -class SimplePay_PhpToken implements \SimplePay_Stringable -{ - /** - * @var int - */ - public $id; - - /** - * @var string - */ - public $text; - - /** - * @var int - */ - public $line; - - /** - * @var int - */ - public $pos; - - public function __construct(int $id, string $text, int $line = -1, int $position = -1) - { - $this->id = $id; - $this->text = $text; - $this->line = $line; - $this->pos = $position; - } - - public function getTokenName(): ?string - { - if ('UNKNOWN' === $name = token_name($this->id)) { - $name = \strlen($this->text) > 1 || \ord($this->text) < 32 ? null : $this->text; - } - - return $name; - } - - /** - * @param int|string|array $kind - */ - public function is($kind): bool - { - foreach ((array) $kind as $value) { - if (\in_array($value, [$this->id, $this->text], true)) { - return true; - } - } - - return false; - } - - public function isIgnorable(): bool - { - return \in_array($this->id, [\T_WHITESPACE, \T_COMMENT, \T_DOC_COMMENT, \T_OPEN_TAG], true); - } - - public function __toString(): string - { - return (string) $this->text; - } - - /** - * @return static[] - */ - public static function tokenize(string $code, int $flags = 0): array - { - $line = 1; - $position = 0; - $tokens = token_get_all($code, $flags); - foreach ($tokens as $index => $token) { - if (\is_string($token)) { - $id = \ord($token); - $text = $token; - } else { - [$id, $text, $line] = $token; - } - $tokens[$index] = new static($id, $text, $line, $position); - $position += \strlen($text); - } - - return $tokens; - } -} diff --git a/lib/Symfony/Polyfill/Php80/README.md b/lib/Symfony/Polyfill/Php80/README.md deleted file mode 100644 index 3816c559..00000000 --- a/lib/Symfony/Polyfill/Php80/README.md +++ /dev/null @@ -1,25 +0,0 @@ -Symfony Polyfill / Php80 -======================== - -This component provides features added to PHP 8.0 core: - -- [`Stringable`](https://php.net/stringable) interface -- [`fdiv`](https://php.net/fdiv) -- [`ValueError`](https://php.net/valueerror) class -- [`UnhandledMatchError`](https://php.net/unhandledmatcherror) class -- `FILTER_VALIDATE_BOOL` constant -- [`get_debug_type`](https://php.net/get_debug_type) -- [`PhpToken`](https://php.net/phptoken) class -- [`preg_last_error_msg`](https://php.net/preg_last_error_msg) -- [`str_contains`](https://php.net/str_contains) -- [`str_starts_with`](https://php.net/str_starts_with) -- [`str_ends_with`](https://php.net/str_ends_with) -- [`get_resource_id`](https://php.net/get_resource_id) - -More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). - -License -======= - -This library is released under the [MIT license](LICENSE). diff --git a/lib/Symfony/Polyfill/Php80/Resources/stubs/Attribute.php b/lib/Symfony/Polyfill/Php80/Resources/stubs/Attribute.php deleted file mode 100644 index 3cb3a2a1..00000000 --- a/lib/Symfony/Polyfill/Php80/Resources/stubs/Attribute.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#[SimplePay_Attribute(Attribute::TARGET_CLASS)] -final class SimplePay_Attribute -{ - public const TARGET_CLASS = 1; - public const TARGET_FUNCTION = 2; - public const TARGET_METHOD = 4; - public const TARGET_PROPERTY = 8; - public const TARGET_CLASS_CONSTANT = 16; - public const TARGET_PARAMETER = 32; - public const TARGET_ALL = 63; - public const IS_REPEATABLE = 64; - - /** @var int */ - public $flags; - - public function __construct(int $flags = self::TARGET_ALL) - { - $this->flags = $flags; - } -} diff --git a/lib/Symfony/Polyfill/Php80/Resources/stubs/PhpToken.php b/lib/Symfony/Polyfill/Php80/Resources/stubs/PhpToken.php deleted file mode 100644 index 2d8fa240..00000000 --- a/lib/Symfony/Polyfill/Php80/Resources/stubs/PhpToken.php +++ /dev/null @@ -1,16 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (\PHP_VERSION_ID < 80000 && extension_loaded('tokenizer')) { - class SimplePay_PhpToken extends SimplePay\Vendor\Symfony\Polyfill\Php80\SimplePay_PhpToken - { - } -} diff --git a/lib/Symfony/Polyfill/Php80/Resources/stubs/Stringable.php b/lib/Symfony/Polyfill/Php80/Resources/stubs/Stringable.php deleted file mode 100644 index 3d6cb5bb..00000000 --- a/lib/Symfony/Polyfill/Php80/Resources/stubs/Stringable.php +++ /dev/null @@ -1,20 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (\PHP_VERSION_ID < 80000) { - interface SimplePay_Stringable - { - /** - * @return string - */ - public function __toString(); - } -} diff --git a/lib/Symfony/Polyfill/Php80/Resources/stubs/UnhandledMatchError.php b/lib/Symfony/Polyfill/Php80/Resources/stubs/UnhandledMatchError.php deleted file mode 100644 index 1a48aee8..00000000 --- a/lib/Symfony/Polyfill/Php80/Resources/stubs/UnhandledMatchError.php +++ /dev/null @@ -1,16 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (\PHP_VERSION_ID < 80000) { - class SimplePay_UnhandledMatchError extends Error - { - } -} diff --git a/lib/Symfony/Polyfill/Php80/Resources/stubs/ValueError.php b/lib/Symfony/Polyfill/Php80/Resources/stubs/ValueError.php deleted file mode 100644 index 9ee29b14..00000000 --- a/lib/Symfony/Polyfill/Php80/Resources/stubs/ValueError.php +++ /dev/null @@ -1,16 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (\PHP_VERSION_ID < 80000) { - class SimplePay_ValueError extends Error - { - } -} diff --git a/lib/Symfony/Polyfill/Php80/bootstrap.php b/lib/Symfony/Polyfill/Php80/bootstrap.php deleted file mode 100644 index e441add4..00000000 --- a/lib/Symfony/Polyfill/Php80/bootstrap.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use SimplePay\Vendor\Symfony\Polyfill\Php80 as p; - -if (\PHP_VERSION_ID >= 80000) { - return; -} - -if (!defined('FILTER_VALIDATE_BOOL') && defined('FILTER_VALIDATE_BOOLEAN')) { - define('FILTER_VALIDATE_BOOL', \FILTER_VALIDATE_BOOLEAN); -} - -if (!function_exists('fdiv')) { - function fdiv(float $num1, float $num2): float { return p\Php80::fdiv($num1, $num2); } -} -if (!function_exists('preg_last_error_msg')) { - function preg_last_error_msg(): string { return p\Php80::preg_last_error_msg(); } -} -if (!function_exists('str_contains')) { - function str_contains(?string $haystack, ?string $needle): bool { return p\Php80::str_contains($haystack ?? '', $needle ?? ''); } -} -if (!function_exists('str_starts_with')) { - function str_starts_with(?string $haystack, ?string $needle): bool { return p\Php80::str_starts_with($haystack ?? '', $needle ?? ''); } -} -if (!function_exists('str_ends_with')) { - function str_ends_with(?string $haystack, ?string $needle): bool { return p\Php80::str_ends_with($haystack ?? '', $needle ?? ''); } -} -if (!function_exists('get_debug_type')) { - function get_debug_type($value): string { return p\Php80::get_debug_type($value); } -} -if (!function_exists('get_resource_id')) { - function get_resource_id($resource): int { return p\Php80::get_resource_id($resource); } -} diff --git a/lib/Symfony/Polyfill/Php80/composer.json b/lib/Symfony/Polyfill/Php80/composer.json deleted file mode 100644 index 46ccde20..00000000 --- a/lib/Symfony/Polyfill/Php80/composer.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "symfony/polyfill-php80", - "type": "library", - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "keywords": ["polyfill", "shim", "compatibility", "portable"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.1" - }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Php80\\": "" }, - "files": [ "bootstrap.php" ], - "classmap": [ "Resources/stubs" ] - }, - "minimum-stability": "dev", - "extra": { - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - } -} diff --git a/lib/TijsVerkoyen/CssToInlineStyles/Css/Processor.php b/lib/TijsVerkoyen/CssToInlineStyles/Css/Processor.php index f19c6a9d..88bf0fd0 100644 --- a/lib/TijsVerkoyen/CssToInlineStyles/Css/Processor.php +++ b/lib/TijsVerkoyen/CssToInlineStyles/Css/Processor.php @@ -11,8 +11,7 @@ class Processor * Get the rules from a given CSS-string * * @param string $css - * @param Rule[] $existingRules - * + * @param array $existingRules * @return Rule[] */ public function getRules($css, $existingRules = array()) @@ -28,15 +27,13 @@ public function getRules($css, $existingRules = array()) * Get the CSS from the style-tags in the given HTML-string * * @param string $html - * * @return string */ public function getCssFromStyleTags($html) { $css = ''; $matches = array(); - $htmlNoComments = preg_replace('||s', '', $html); - preg_match_all('|(.*)|isU', $htmlNoComments, $matches); + preg_match_all('|(.*)|isU', $html, $matches); if (!empty($matches[1])) { foreach ($matches[1] as $match) { @@ -49,7 +46,6 @@ public function getCssFromStyleTags($html) /** * @param string $css - * * @return string */ private function doCleanup($css) diff --git a/lib/TijsVerkoyen/CssToInlineStyles/Css/Property/Processor.php b/lib/TijsVerkoyen/CssToInlineStyles/Css/Property/Processor.php index 27fe4b3a..3830e2a2 100644 --- a/lib/TijsVerkoyen/CssToInlineStyles/Css/Property/Processor.php +++ b/lib/TijsVerkoyen/CssToInlineStyles/Css/Property/Processor.php @@ -7,11 +7,10 @@ class Processor { /** - * Split a string into separate properties + * Split a string into seperate properties * * @param string $propertiesString - * - * @return string[] + * @return array */ public function splitIntoSeparateProperties($propertiesString) { @@ -41,9 +40,8 @@ public function splitIntoSeparateProperties($propertiesString) } /** - * @param string $string - * - * @return string + * @param $string + * @return mixed|string */ private function cleanup($string) { @@ -60,10 +58,9 @@ private function cleanup($string) } /** - * Converts a property-string into an object + * Convert a property-string into an object * * @param string $property - * * @return Property|null */ public function convertToObject($property, Specificity $specificity = null) @@ -85,10 +82,9 @@ public function convertToObject($property, Specificity $specificity = null) } /** - * Converts an array of property-strings into objects - * - * @param string[] $properties + * Convert an array of property-strings into objects * + * @param array $properties * @return Property[] */ public function convertArrayToObjects(array $properties, Specificity $specificity = null) @@ -110,8 +106,7 @@ public function convertArrayToObjects(array $properties, Specificity $specificit /** * Build the property-string for multiple properties * - * @param Property[] $properties - * + * @param array $properties * @return string */ public function buildPropertiesString(array $properties) diff --git a/lib/TijsVerkoyen/CssToInlineStyles/Css/Property/Property.php b/lib/TijsVerkoyen/CssToInlineStyles/Css/Property/Property.php index ff31b90c..22bd371f 100644 --- a/lib/TijsVerkoyen/CssToInlineStyles/Css/Property/Property.php +++ b/lib/TijsVerkoyen/CssToInlineStyles/Css/Property/Property.php @@ -23,8 +23,8 @@ final class Property /** * Property constructor. - * @param string $name - * @param string $value + * @param $name + * @param $value * @param Specificity|null $specificity */ public function __construct($name, $value, Specificity $specificity = null) diff --git a/lib/TijsVerkoyen/CssToInlineStyles/Css/Rule/Processor.php b/lib/TijsVerkoyen/CssToInlineStyles/Css/Rule/Processor.php index b16fed2a..9cb2142d 100644 --- a/lib/TijsVerkoyen/CssToInlineStyles/Css/Rule/Processor.php +++ b/lib/TijsVerkoyen/CssToInlineStyles/Css/Rule/Processor.php @@ -8,11 +8,10 @@ class Processor { /** - * Splits a string into separate rules + * Split a string into seperate rules * * @param string $rulesString - * - * @return string[] + * @return array */ public function splitIntoSeparateRules($rulesString) { @@ -23,7 +22,6 @@ public function splitIntoSeparateRules($rulesString) /** * @param string $string - * * @return string */ private function cleanup($string) @@ -41,12 +39,11 @@ private function cleanup($string) } /** - * Converts a rule-string into an object + * Convert a rule-string into an object * * @param string $rule * @param int $originalOrder - * - * @return Rule[] + * @return array */ public function convertToObjects($rule, $originalOrder) { @@ -77,13 +74,11 @@ public function convertToObjects($rule, $originalOrder) } /** - * Calculates the specificity based on a CSS Selector string, + * Calculate the specificity based on a CSS Selector string, * Based on the patterns from premailer/css_parser by Alex Dunae * * @see https://github.com/premailer/css_parser/blob/master/lib/css_parser/regexps.rb - * * @param string $selector - * * @return Specificity */ public function calculateSpecificityBasedOnASelector($selector) @@ -123,9 +118,7 @@ public function calculateSpecificityBasedOnASelector($selector) } /** - * @param string[] $rules - * @param Rule[] $objects - * + * @param array $rules * @return Rule[] */ public function convertArrayToObjects(array $rules, array $objects = array()) @@ -140,13 +133,12 @@ public function convertArrayToObjects(array $rules, array $objects = array()) } /** - * Sorts an array on the specificity element in an ascending way + * Sort an array on the specificity element in an ascending way * Lower specificity will be sorted to the beginning of the array * - * @param Rule $e1 The first element. - * @param Rule $e2 The second element. - * * @return int + * @param Rule $e1 The first element. + * @param Rule $e2 The second element. */ public static function sortOnSpecificity(Rule $e1, Rule $e2) { diff --git a/lib/TijsVerkoyen/CssToInlineStyles/Css/Rule/Rule.php b/lib/TijsVerkoyen/CssToInlineStyles/Css/Rule/Rule.php index 6d4ae802..9ab5ff54 100644 --- a/lib/TijsVerkoyen/CssToInlineStyles/Css/Rule/Rule.php +++ b/lib/TijsVerkoyen/CssToInlineStyles/Css/Rule/Rule.php @@ -3,7 +3,6 @@ namespace SimplePay\Vendor\TijsVerkoyen\CssToInlineStyles\Css\Rule; use SimplePay\Vendor\Symfony\Component\CssSelector\Node\Specificity; -use SimplePay\Vendor\TijsVerkoyen\CssToInlineStyles\Css\Property\Property; final class Rule { @@ -13,7 +12,7 @@ final class Rule private $selector; /** - * @var Property[] + * @var array */ private $properties; @@ -56,7 +55,7 @@ public function getSelector() /** * Get properties * - * @return Property[] + * @return array */ public function getProperties() { diff --git a/lib/TijsVerkoyen/CssToInlineStyles/CssToInlineStyles.php b/lib/TijsVerkoyen/CssToInlineStyles/CssToInlineStyles.php index dca3dde1..bc017d97 100644 --- a/lib/TijsVerkoyen/CssToInlineStyles/CssToInlineStyles.php +++ b/lib/TijsVerkoyen/CssToInlineStyles/CssToInlineStyles.php @@ -8,6 +8,7 @@ use SimplePay\Vendor\TijsVerkoyen\CssToInlineStyles\Css\Processor; use SimplePay\Vendor\TijsVerkoyen\CssToInlineStyles\Css\Property\Processor as PropertyProcessor; use SimplePay\Vendor\TijsVerkoyen\CssToInlineStyles\Css\Rule\Processor as RuleProcessor; +use SimplePay\Vendor\TijsVerkoyen\CssToInlineStyles\Css\Rule\Rule; class CssToInlineStyles { @@ -28,7 +29,6 @@ public function __construct() * * @param string $html * @param string $css - * * @return string */ public function convert($html, $css = null) @@ -55,7 +55,6 @@ public function convert($html, $css = null) * * @param \DOMElement $element * @param Css\Property\Property[] $properties - * * @return \DOMElement */ public function inlineCssOnElement(\DOMElement $element, array $properties) @@ -90,7 +89,6 @@ public function inlineCssOnElement(\DOMElement $element, array $properties) * Get the current inline styles for a given DOMElement * * @param \DOMElement $element - * * @return Css\Property\Property[] */ public function getInlineStyles(\DOMElement $element) @@ -106,14 +104,13 @@ public function getInlineStyles(\DOMElement $element) /** * @param string $html - * * @return \DOMDocument */ protected function createDomDocumentFromHtml($html) { $document = new \DOMDocument('1.0', 'UTF-8'); $internalErrors = libxml_use_internal_errors(true); - $document->loadHTML(mb_encode_numericentity($html, [0x80, 0x10FFFF, 0, 0x1FFFFF], 'UTF-8')); + $document->loadHTML(mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8')); libxml_use_internal_errors($internalErrors); $document->formatOutput = true; @@ -122,7 +119,6 @@ protected function createDomDocumentFromHtml($html) /** * @param \DOMDocument $document - * * @return string */ protected function getHtmlFromDocument(\DOMDocument $document) @@ -149,7 +145,6 @@ protected function getHtmlFromDocument(\DOMDocument $document) /** * @param \DOMDocument $document * @param Css\Rule\Rule[] $rules - * * @return \DOMDocument */ protected function inline(\DOMDocument $document, array $rules) diff --git a/src/Emails/Email/PaymentProcessingConfirmationEmail.php b/src/Emails/Email/PaymentProcessingConfirmationEmail.php deleted file mode 100644 index fd04363b..00000000 --- a/src/Emails/Email/PaymentProcessingConfirmationEmail.php +++ /dev/null @@ -1,90 +0,0 @@ -get_id() ), - esc_html( - sprintf( - /* translators: %s Site name */ - __( 'Payment Processing Confirmation for %s', 'stripe' ), - get_bloginfo( 'name' ) - ) - ) - ); - - return $subject; - } - - /** - * Returns the body (content) of the email. - * - * @since 4.10.0 - * - * @return string - */ - public function get_body() { - return Settings\Emails\PaymentProcessingConfirmation\get_body_setting_or_default(); - } -} diff --git a/src/Emails/Email/PaymentProcessingNotificationEmail.php b/src/Emails/Email/PaymentProcessingNotificationEmail.php deleted file mode 100644 index 7efd9b1c..00000000 --- a/src/Emails/Email/PaymentProcessingNotificationEmail.php +++ /dev/null @@ -1,107 +0,0 @@ -get_id() ), - get_bloginfo( 'admin_email' ) - ); - - return $to_address; - } - - /** - * Returns the subject of the email. - * - * @since 4.10.0 - * - * @return string - */ - public function get_subject() { - /** @var string $subject */ - $subject = simpay_get_setting( - sprintf( 'email_%s_subject', $this->get_id() ), - esc_html( - sprintf( - /* translators: %s Site name */ - __( 'Payment Processing Notification for %s', 'stripe' ), - get_bloginfo( 'name' ) - ) - ) - ); - - return $subject; - } - - /** - * Returns the body (content) of the email. - * - * @since 4.10.0 - * - * @return string - */ - public function get_body() { - return Settings\Emails\PaymentProcessingNotification\get_body_setting_or_default(); - } -} diff --git a/src/Emails/Email/PaymentRefundedConfirmationEmail.php b/src/Emails/Email/PaymentRefundedConfirmationEmail.php deleted file mode 100644 index 6d7b4d21..00000000 --- a/src/Emails/Email/PaymentRefundedConfirmationEmail.php +++ /dev/null @@ -1,105 +0,0 @@ -get_id() ), - get_bloginfo( 'admin_email' ) - ); - - return $to_address; - } - - /** - * Returns the subject of the email. - * - * @since 4.10.0 - * - * @return string - */ - public function get_subject() { - /** @var string $subject */ - $subject = simpay_get_setting( - sprintf( 'email_%s_subject', $this->get_id() ), - sprintf( - /* translators: %s Site name */ - __( 'Payment refunded on %s', 'stripe' ), - get_bloginfo( 'name' ) - ) - ); - - return $subject; - } - - /** - * Returns the body (content) of the email. - * - * @since 4.10.0 - * - * @return string - */ - public function get_body() { - return Settings\Emails\PaymentRefundedConfirmation\get_body_setting_or_default(); - } -} diff --git a/src/Emails/Email/SubscriptionCancellationConfirmation.php b/src/Emails/Email/SubscriptionCancellationConfirmation.php deleted file mode 100644 index 84e8bd76..00000000 --- a/src/Emails/Email/SubscriptionCancellationConfirmation.php +++ /dev/null @@ -1,99 +0,0 @@ -get_id() ), - esc_html( - sprintf( - /* translators: %s Site name */ - __( 'Subscription Cancelled for %s', 'stripe' ), - get_bloginfo( 'name' ) - ) - ) - ); - - return $subject; - } - - /** - * Returns the body (content) of the email. - * - * @since 4.10.0 - * - * @return string - */ - public function get_body() { - return Settings\Emails\SubscriptionCancellationConfirmation\get_body_setting_or_default(); - } -} diff --git a/src/Emails/Email/SubscriptionCancellationNotification.php b/src/Emails/Email/SubscriptionCancellationNotification.php deleted file mode 100644 index 8c0d9ac2..00000000 --- a/src/Emails/Email/SubscriptionCancellationNotification.php +++ /dev/null @@ -1,116 +0,0 @@ -get_id() ), - get_bloginfo( 'admin_email' ) - ); - - return $to_address; - } - - /** - * Returns the subject of the email. - * - * @since 4.10.0 - * - * @return string - */ - public function get_subject() { - /** @var string $subject */ - $subject = simpay_get_setting( - sprintf( 'email_%s_subject', $this->get_id() ), - esc_html( - sprintf( - /* translators: %s Site name */ - __( 'Subscription Cancellation Notification for %s', 'stripe' ), - get_bloginfo( 'name' ) - ) - ) - ); - - return $subject; - } - - /** - * Returns the body (content) of the email. - * - * @since 4.10.0 - * - * @return string - */ - public function get_body() { - return Settings\Emails\SubscriptionCancellationNotification\get_body_setting_or_default(); - } -} diff --git a/src/Emails/EmailServiceProvider.php b/src/Emails/EmailServiceProvider.php index 0ab04a23..e12dee0d 100644 --- a/src/Emails/EmailServiceProvider.php +++ b/src/Emails/EmailServiceProvider.php @@ -32,10 +32,6 @@ public function get_services() { 'email-upcoming-invoice', 'email-summary-report', 'email-manage-subscriptions', - 'email-payment-processing-confirmation', - 'email-payment-processing-notification', - 'email-payment-refunded-confirmation', - 'email-subscription-cancel', ); } @@ -89,31 +85,6 @@ public function register() { Email\ManageSubscriptionsEmail::class ); - $container->add( - 'email-payment-processing-confirmation', - Email\PaymentProcessingConfirmationEmail::class - ); - - $container->add( - 'email-payment-processing-notification', - Email\PaymentProcessingNotificationEmail::class - ); - - $container->add( - 'email-payment-refunded-confirmation', - Email\PaymentRefundedConfirmationEmail::class - ); - - $container->add( - 'email-subscription-cancel-confirmation', - Email\SubscriptionCancellationConfirmation::class - ); - - $container->add( - 'email-subscription-cancel-notification', - Email\SubscriptionCancellationNotification::class - ); - // Summary report scheduler. $container->add( 'email-summary-report-scheduler', @@ -130,17 +101,12 @@ public function register() { $container->share( 'email-subscriber', EmailSubscriber::class ) ->withArgument( array( - 'invoice-confirmation' => $container->get( 'email-invoice-confirmation' ), - 'payment-confirmation' => $container->get( 'email-payment-confirmation' ), - 'payment-notification' => $container->get( 'email-payment-notification' ), - 'upcoming-invoice' => $container->get( 'email-upcoming-invoice' ), - 'summary-report' => $container->get( 'email-summary-report' ), - 'manage-subscriptions' => $container->get( 'email-manage-subscriptions' ), - 'subscription-cancel-confirmation' => $container->get( 'email-subscription-cancel-confirmation' ), - 'subscription-cancel-notification' => $container->get( 'email-subscription-cancel-notification' ), - 'payment-processing-confirmation' => $container->get( 'email-payment-processing-confirmation' ), - 'payment-processing-notification' => $container->get( 'email-payment-processing-notification' ), - 'payment-refunded-confirmation' => $container->get( 'email-payment-refunded-confirmation' ), + 'invoice-confirmation' => $container->get( 'email-invoice-confirmation' ), + 'payment-confirmation' => $container->get( 'email-payment-confirmation' ), + 'payment-notification' => $container->get( 'email-payment-notification' ), + 'upcoming-invoice' => $container->get( 'email-upcoming-invoice' ), + 'summary-report' => $container->get( 'email-summary-report' ), + 'manage-subscriptions' => $container->get( 'email-manage-subscriptions' ), ) ); } diff --git a/src/Emails/EmailSubscriber.php b/src/Emails/EmailSubscriber.php index 47936204..3c718c12 100644 --- a/src/Emails/EmailSubscriber.php +++ b/src/Emails/EmailSubscriber.php @@ -104,20 +104,6 @@ public function get_subscribed_events() { 3, ); - // Payment processing. - $subscribers['simpay_webhook_payment_intent_processing'] = array( - 'payment_processing', - 10, - 3, - ); - - // Refunded payment confirmation. - $subscribers['simpay_webhook_charge_refunded'] = array( - 'payment_refunded_confirmation', - 10, - 3, - ); - // Legacy. // These aren't used anymore, but we'll keep it here for backwards compatibility. // `simpay_webhook_payment_intent_succeeded` is used instead instead. @@ -126,12 +112,6 @@ public function get_subscribed_events() { $payment_confirmation, ); - $subscribers['simpay_webhook_subscription_cancel'] = array( - 'subscription_cancel', - 10, - 3, - ); - return $subscribers; } @@ -531,164 +511,4 @@ public function summary_report() { add_filter( 'simpay_emails_autop', '__return_true' ); } - /** - * Mails the "Payment Refunded Confirmation" email. - * - * @since 4.10.0 - * @param \SimplePay\Vendor\Stripe\Event $event Stripe Event object. - * @param \SimplePay\Vendor\Stripe\Charge $charge Stripe Charge object. - * @param \SimplePay\Core\Abstracts\Form $form Form object. - * - * @return void - */ - public function payment_refunded_confirmation( $event, $charge, $form ) { - /** @var \SimplePay\Core\Emails\Email\PaymentRefundedConfirmationEmail $email */ - $email = $this->emails['payment-refunded-confirmation']; - - // If the email is not enabled, do nothing. - if ( ! $email->is_enabled() ) { - return; - } - - // Ensure we have data before proceeding. - $payment_refund_data = Payment_Confirmation\get_confirmation_data( - $charge->customer->id, // @phpstan-ignore-line - false, - $form->id - ); - - // Setup the mailer. - $mailer = new Mailer( $email ); - - // Set data. - - $mailer->set_data( $payment_refund_data ); - - // ...then set the address(es). - $mailer->set_to( $payment_refund_data['customer']->email ); - - // ...then set the subject. - $mailer->set_subject( $email->get_subject() ); - - // ...then parse and set the body. - $mailer->set_body( $email->get_body() ); - - // Finally, send the email. - $mailer->send(); - } - - /** - * Mails the 'Subscription Cancel' email . - * - * @since 4.10.0 - * - * @param \SimplePay\Vendor\Stripe\Event $event Stripe Event object . - * @param \SimplePay\Vendor\Stripe\Subscription $subscription Stripe Subscription object . - * @return void - */ - public function subscription_cancel( $event, $subscription ) { - if ( null === $subscription->canceled_at ) { - return; - } - - if ( 'customer.subscription.deleted' === $event->type - && $subscription->cancel_at_period_end ) { - return; - } - - /** @var \SimplePay\Core\Emails\Email\SubscriptionCancellationNotification $subscription_cancel_confirmation_email */ - $subscription_cancel_confirmation_email = $this->emails['subscription-cancel-confirmation']; - - /** @var \SimplePay\Core\Emails\Email\SubscriptionCancellationNotification $subscription_cancel_notification_email */ - $subscription_cancel_notification_email = $this->emails['subscription-cancel-notification']; - - $notification_mailer = new Mailer( $subscription_cancel_notification_email ); - $confirmation_mailer = new Mailer( $subscription_cancel_confirmation_email ); - - // Retrieve the payment confirmation data. - /** @var \SimplePay\Vendor\Stripe\Customer $customer */ - $customer = $subscription->customer; - - // Ensure we have data before proceeding. - $payment_confirmation_data = Payment_Confirmation\get_confirmation_data( - $customer->id, - false, - $subscription->metadata->simpay_form_id // @phpstan-ignore-line - ); - - // Set email for merchant. - $notification_mailer->set_data( $payment_confirmation_data ); - $notification_mailer->set_to( $subscription_cancel_notification_email->get_to() ); - $notification_mailer->set_subject( $subscription_cancel_notification_email->get_subject() ); - $notification_mailer->set_body( $subscription_cancel_notification_email->get_body() ); - - // Set email for customer. - $confirmation_mailer->set_data( $payment_confirmation_data ); - $confirmation_mailer->set_to( $subscription->customer->email ); /** @phpstan-ignore-line */ - $confirmation_mailer->set_subject( $subscription_cancel_confirmation_email->get_subject() ); - $confirmation_mailer->set_body( $subscription_cancel_confirmation_email->get_body() ); - - // Send emails. - if ( $subscription_cancel_notification_email->is_enabled() ) { - $notification_mailer->send(); - } - - if ( $subscription_cancel_confirmation_email->is_enabled() ) { - $confirmation_mailer->send(); - } - } - - /** - * Mails the "Payment Processing" email. - * - * @since 4.10.0 - * - * @param \SimplePay\Vendor\Stripe\Event $event Stripe webhook event. - * @param \SimplePay\Vendor\Stripe\PaymentIntent $payment_intent Stripe PaymentIntent. - * @param \SimplePay\Core\Abstracts\Form $form Form object. - * @return void - */ - public function payment_processing( $event, $payment_intent, $form ) { - // Retrieve the payment confirmation data. - /** @var \SimplePay\Vendor\Stripe\Customer $customer */ - $customer = $payment_intent->customer; - - // Ensure we have data before proceeding. - $payment_confirmation_data = Payment_Confirmation\get_confirmation_data( - $customer->id, - false, - $form->id - ); - - // if there is no data, do nothing. - if ( empty( $payment_confirmation_data ) ) { - return; - } - - /** @var \SimplePay\Core\Emails\Email\PaymentProcessingConfirmationEmail $payment_processing_confirmation_email */ - $payment_processing_confirmation_email = $this->emails['payment-processing-confirmation']; - - /** @var \SimplePay\Core\Emails\Email\PaymentProcessingNotificationEmail $payment_processing_notification_email */ - $payment_processing_notification_email = $this->emails['payment-processing-notification']; - - // Send confirmation email if enabled. - if ( $payment_processing_confirmation_email->is_enabled() ) { - $confirmation_mailer = new Mailer( $payment_processing_confirmation_email ); - $confirmation_mailer->set_data( $payment_confirmation_data ); - $confirmation_mailer->set_to( $customer->email ); // @phpstan-ignore-line - $confirmation_mailer->set_subject( $payment_processing_confirmation_email->get_subject() ); - $confirmation_mailer->set_body( $payment_processing_confirmation_email->get_body() ); - $confirmation_mailer->send(); - } - - // Send notification email if enabled. - if ( $payment_processing_notification_email->is_enabled() ) { - $notification_mailer = new Mailer( $payment_processing_notification_email ); - $notification_mailer->set_data( $payment_confirmation_data ); - $notification_mailer->set_to( $payment_processing_notification_email->get_to() ); - $notification_mailer->set_subject( $payment_processing_notification_email->get_subject() ); - $notification_mailer->set_body( $payment_processing_notification_email->get_body() ); - $notification_mailer->send(); - } - } } diff --git a/src/Plugin.php b/src/Plugin.php index b9c8cabf..d3eaa7c1 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -81,7 +81,7 @@ public function load() { * @return \SimplePay\Core\PluginContainer */ public function setup_container() { - $this->container = new PluginContainer(); + $this->container = new PluginContainer; // Event management. $this->container->share( @@ -92,7 +92,7 @@ public function setup_container() { // Scheduler. $this->container->share( 'scheduler', - function () { + function() { $events = $this->container->get( 'event-manager' ); if ( ! $events instanceof EventManager ) { @@ -108,7 +108,7 @@ function () { return new Scheduler\WpCronScheduler( $events ); } - return new Scheduler\ActionScheduler(); + return new Scheduler\ActionScheduler; } ); @@ -200,42 +200,57 @@ private function get_service_providers() { global $wp_version; $service_providers = array( - new AdminBar\AdminBarServiceProvider(), - new AntiSpam\AntiSpamServiceProvider(), - new Block\BlockServiceProvider(), - new Connect\ConnectServiceProvider(), - new CustomerSuccess\CustomerSuccessServiceProvider(), - new Emails\EmailServiceProvider(), - new FormPreview\FormPreviewServiceProvider(), - new Help\HelpServiceProvider(), - new Integration\IntegrationServiceProvider(), - new License\LicenseServiceProvider(), - new NotificationInbox\NotificationInboxServiceProvider(), - new PaymentPage\PaymentPageServiceProvider(), - new Report\ReportServiceProvider(), - new RestApi\RestApiServiceProvider(), - new StripeConnect\StripeConnectServiceProvider(), - new Transaction\TransactionServiceProvider(), - new Webhook\WebhookServiceProvider(), + new AdminBar\AdminBarServiceProvider, + new AntiSpam\AntiSpamServiceProvider, + new CustomerSuccess\CustomerSuccessServiceProvider, + new Emails\EmailServiceProvider, + new FormPreview\FormPreviewServiceProvider, + new Integration\IntegrationServiceProvider, + new License\LicenseServiceProvider, + new Connect\ConnectServiceProvider, + new PaymentPage\PaymentPageServiceProvider, + new Report\ReportServiceProvider, + new RestApi\RestApiServiceProvider, + new StripeConnect\StripeConnectServiceProvider, + new Transaction\TransactionServiceProvider, + new Webhook\WebhookServiceProvider, ); + if ( version_compare( $wp_version, '5.6', '>=' ) ) { + $service_providers[] = new Block\BlockServiceProvider; + } + + if ( version_compare( $wp_version, '5.7', '>=' ) ) { + $service_providers[] = new Help\HelpServiceProvider; + $service_providers[] = new NotificationInbox\NotificationInboxServiceProvider; + } + if ( is_admin() ) { global $wp_version; $admin_service_providers = array( - new Admin\AdminServiceProvider(), - new Admin\Addon\AddonServiceProvider(), - new Admin\DashboardWidget\DashboardWidgetServiceProvider(), - new Admin\Education\EducationServiceProvider(), - new Admin\FormBuilder\FormBuilderServiceProvider(), - new Admin\SetupWizard\SetupWizardServiceProvider(), - new Admin\SiteHealth\SiteHealthServiceProvider(), - new Admin\Translations\TranslationsServiceProvider(), + new Admin\AdminServiceProvider, + new Admin\Addon\AddonServiceProvider, + new Admin\DashboardWidget\DashboardWidgetServiceProvider, + new Admin\Education\EducationServiceProvider, + new Admin\SiteHealth\SiteHealthServiceProvider, + new Admin\Translations\TranslationsServiceProvider, ); + if ( version_compare( $wp_version, '5.5', '>=' ) ) { + $admin_service_providers[] = + new Admin\SetupWizard\SetupWizardServiceProvider; + } + + if ( version_compare( $wp_version, '5.6', '>=' ) ) { + $admin_service_providers[] = + new Admin\FormBuilder\FormBuilderServiceProvider; + } + return array_merge( $admin_service_providers, $service_providers ); } return $service_providers; } + } diff --git a/src/RestApi/Internal/Payment/PaymentUpdateRoute.php b/src/RestApi/Internal/Payment/PaymentUpdateRoute.php deleted file mode 100644 index 54ea6f6d..00000000 --- a/src/RestApi/Internal/Payment/PaymentUpdateRoute.php +++ /dev/null @@ -1,456 +0,0 @@ - SchemaUtils::get_form_id_schema(), - 'object_id' => SchemaUtils::get_object_id_schema(), - 'customer_id' => SchemaUtils::get_customer_id_schema(), - 'price_id' => SchemaUtils::get_price_id_schema(), - 'custom_amount' => SchemaUtils::get_custom_amount_schema(), - 'payment_method_type' => SchemaUtils::get_payment_method_type_schema(), - 'is_covering_fees' => SchemaUtils::get_is_covering_fees_schema(), - ); - - $update_item_route = array( - 'methods' => WP_REST_Server::EDITABLE, - 'callback' => array( $this, 'update_payment' ), - 'permission_callback' => array( $this, 'update_payment_permissions_check' ), - 'args' => $update_args, - ); - - register_rest_route( - $this->namespace, - 'payment/update', - $update_item_route - ); - } - - /** - * Determines if the current request should be able to create a payment. - * - * @since 4.7.0 - * - * @param \WP_REST_Request $request The payment request. - * @return bool - */ - public function update_payment_permissions_check( $request ) { - return true; - } - - /** - * Updates a payment amount when the payment method changes, to account for - * new fee recovery amounts. - * - * This works by retrieving the payment intent or subscription, and then - * using the stored sipmay_fee_recovery_unit_amount metadata to calculate - * the original price so we can add the new fee recovery amount. - * - * With payment intents this is done simply by updating the existing payment intent. - * With subscriptions the finalized (but not collected) invoice must be voided and - * a new subscription created (voiding the first invoice cancels the subscription). - * - * @since 4.7.0 - * - * @param \WP_REST_Request $request The payment request. - * @return \WP_REST_Response The response object. - * @throws \Exception If the payment does not need to be updated. - */ - public function update_payment( $request ) { - $form = PaymentRequestUtils::get_form( $request ); - - /** @var string $object_id */ - $object_id = $request->get_param( 'object_id' ); - - /** @var string $customer_id */ - $customer_id = $request->get_param( 'customer_id' ); - - /** @var bool $is_covering_fees */ - $is_covering_fees = $request->get_param( 'is_covering_fees' ); - - try { - // Ensure fee recovery is enabled on at least one payment method, and - // if fee recovery is optional, that it is opted-in. - if ( - ! $form->has_fee_recovery() || - ( ! $form->has_forced_fee_recovery() && ! $is_covering_fees ) - ) { - throw new Exception( - __( 'Invalid request. Please try again', 'stripe' ) - ); - } - - // If the payment ID starts with pi_, then it is a PaymentIntent, retrieve it. - if ( 0 === strpos( $object_id, 'pi_' ) ) { - $object = API\PaymentIntents\retrieve( - array( - 'id' => $object_id, - 'expand' => array( - 'customer', - ), - ), - $form->get_api_request_args() - ); - - $object_type = 'payment_intent'; - - // If it starts with sub_, then it is a Subscription, retrieve it. - } elseif ( 0 === strpos( $object_id, 'sub_' ) ) { - $object = API\Subscriptions\retrieve( - array( - 'id' => $object_id, - 'expand' => array( - 'latest_invoice.payment_intent', - 'customer', - 'pending_setup_intent', - ), - ), - $form->get_api_request_args() - ); - - $object_type = 'subscription'; - } else { - throw new Exception( - __( 'Invalid request. Please try again', 'stripe' ) - ); - } - - // Double check that the customer ID in the request matches the customer ID on the object. - /** @var \SimplePay\Vendor\Stripe\Customer $customer */ - $customer = $object->customer; - - if ( $customer->id !== $customer_id ) { - throw new Exception( - __( 'Invalid request. Please try again', 'stripe' ) - ); - } - - // Objects can only be updated if they were created with fee recovery. - /** @var \SimplePay\Vendor\Stripe\StripeObject $metadata */ - $metadata = $object->metadata; - - if ( ! isset( $metadata->simpay_fee_recovery_unit_amount ) ) { - throw new Exception( - __( 'Invalid request. Please try again', 'stripe' ) - ); - } - - // Create a new object and return a relevant intent. - switch ( $object_type ) { - case 'payment_intent': - /** @var \SimplePay\Vendor\Stripe\PaymentIntent $object */ - $intent = $this->update_payment_intent( $request, $object ); - $object_id = $intent->id; - - break; - case 'subscription': - /** @var \SimplePay\Vendor\Stripe\Subscription $object */ - $subscription = $this->update_subscription( $request, $object ); - $object_id = $subscription->id; - - if ( isset( $subscription->pending_setup_intent ) ) { - $intent = $subscription->pending_setup_intent; - } else { - /** @var \SimplePay\Vendor\Stripe\Invoice $invoice */ - $invoice = $subscription->latest_invoice; - $intent = $invoice->payment_intent; - } - break; - default: - throw new Exception( - __( 'Invalid request. Please try again', 'stripe' ) - ); - } - - /** @var \SimplePay\Vendor\Stripe\PaymentIntent $intent */ - - return new WP_REST_Response( - array( - 'object_id' => $object_id, - 'client_secret' => $intent->client_secret, - 'changed' => $object->id !== $object_id, - ) - ); - } catch ( Exception $e ) { - return new WP_REST_Response( - array( - 'message' => Utils\handle_exception_message( $e ), - ), - 400 - ); - } - } - - /** - * Updates a payment intent's amount to include the fee recovery amount - * for the current payment method. - * - * @since 4.7.0 - * - * @param \WP_REST_Request $request The payment request. - * @param \SimplePay\Vendor\Stripe\PaymentIntent $payment_intent Payment intent. - * @return \SimplePay\Vendor\Stripe\PaymentIntent - */ - private function update_payment_intent( $request, $payment_intent ) { - /** @var \SimplePay\Vendor\Stripe\StripeObject $metadata */ - $metadata = $payment_intent->metadata; - - if ( ! isset( $metadata->simpay_fee_recovery_unit_amount ) ) { - return $payment_intent; - } - - $form = PaymentRequestUtils::get_form( $request ); - $fee_recovery_amount = intval( - $metadata->simpay_fee_recovery_unit_amount - ); - $total_amount = intval( $payment_intent->amount ); - $base_amount = $total_amount - $fee_recovery_amount; - $new_fee_recovery_amount = FeeRecoveryUtils::get_fee_recovery_unit_amount( - $request, - $base_amount - ); - - // Do not update the intent if the recovery amount has not changed. - if ( (int) $fee_recovery_amount === (int) $new_fee_recovery_amount ) { - return $payment_intent; - } - - return API\PaymentIntents\update( - $payment_intent->id, - array( - 'amount' => $base_amount + $new_fee_recovery_amount, - 'metadata' => array( - 'simpay_fee_recovery_unit_amount' => $new_fee_recovery_amount, - ), - 'expand' => array( - 'customer', - ), - ), - $form->get_api_request_args() - ); - } - - /** - * Updates a subscription's initial amount to include the fee recovery amount - * for the current payment method. - * - * To to this we must gather the line items from the current subscription object - * and discard the line item that matches the amount of the recorded fee recovery - * amount. Then, we void the initial invoice which in turn cancels the current - * incomplete subscription. Finally, we create a new subscription with the new - * fee recovery line item and the remaining line items from the original subscription. - * - * @since 4.7.0 - * - * @param \WP_REST_Request $request The payment request. - * @param \SimplePay\Vendor\Stripe\Subscription $subscription Subscription. - * @return \SimplePay\Vendor\Stripe\Subscription - */ - private function update_subscription( $request, $subscription ) { - $form = PaymentRequestUtils::get_form( $request ); - $price = PaymentRequestUtils::get_price( $request ); - $invoice = $subscription->latest_invoice; - - // Copy the base arguments from the current subscription. - /** @var \SimplePay\Vendor\Stripe\StripeObject $metadata */ - $metadata = $subscription->metadata; - $metadata = $metadata->toArray(); - - $original_metadata = $metadata; - unset( $metadata['simpay_fee_recovery_unit_amount'] ); - unset( $metadata['simpay_subscription_key'] ); - - /** @var \SimplePay\Vendor\Stripe\StripeObject $automatic_tax */ - $automatic_tax = $subscription->automatic_tax; - - /** @var \SimplePay\Vendor\Stripe\StripeObject $payment_settings */ - $payment_settings = $subscription->payment_settings; - - $new_subscription_args = array( - 'customer' => $subscription->customer, - 'metadata' => array_merge( - $metadata, - array( - 'simpay_subscription_key' => $this->get_subscription_key(), - ) - ), - 'trial_period_days' => $price->recurring && isset( $price->recurring['trial_period_days'] ) - ? $price->recurring['trial_period_days'] - : null, - 'automatic_tax' => $automatic_tax->toArray(), - 'payment_behavior' => 'default_incomplete', - 'off_session' => true, - 'payment_settings' => $payment_settings->toArray(), - 'expand' => array( - 'latest_invoice.payment_intent', - 'customer', - 'pending_setup_intent', - ), - ); - - // Find the non-fee recovery line items from the current subscription. - $setup_fee_amounts = ! empty( $price->line_items ) - ? wp_list_pluck( $price->line_items, 'unit_amount' ) - : array(); - - $price_amounts = array_merge( - array( PaymentRequestUtils::get_unit_amount( $request ) ), - $setup_fee_amounts - ); - - /** @var \SimplePay\Vendor\Stripe\Invoice $invoice */ - - $non_fee_recovery_line_items = array_filter( - $invoice->lines->data, - function ( $line_item ) use ( $price_amounts ) { - return in_array( $line_item->amount, $price_amounts, true ); - } - ); - - $one_time_line_items = array_filter( - $non_fee_recovery_line_items, - function ( $line_item ) { - /** @var \SimplePay\Vendor\Stripe\Price $price */ - $price = $line_item->price; - - return 'one_time' === $price->type; - } - ); - - $one_time_line_items = array_map( - array( $this, 'recreate_line_item' ), - $one_time_line_items - ); - - $recurring_line_items = array_filter( - $non_fee_recovery_line_items, - function ( $line_item ) { - /** @var \SimplePay\Vendor\Stripe\Price $price */ - $price = $line_item->price; - - return 'recurring' === $price->type; - } - ); - - $recurring_line_items = array_map( - array( $this, 'recreate_line_item' ), - $recurring_line_items - ); - - // Add the found line items to the new subscription arguments. - $new_subscription_args['items'] = array_values( - $recurring_line_items - ); - - $new_subscription_args['add_invoice_items'] = array_values( - $one_time_line_items - ); - - // Add the fee recovery line items, if needed. - // Instead of running this in `self::get_subscription_recurring_line_items()` - // and `self::get_subscription_additional_invoice_line_items()`, we run it here - // so we have access to all of the line items at once. - $new_subscription_args = FeeRecoveryUtils::add_subscription_fee_recovery_line_items( - $request, - $new_subscription_args - ); - - // Do not update void and recreate a subscription if the fee recovery amount has not changed. - - /** @var int $original_fee_recovery_amount */ - $original_fee_recovery_amount = $original_metadata['simpay_fee_recovery_unit_amount']; - - /** @var array $metadata */ - $metadata = $new_subscription_args['metadata']; - $new_fee_recovery_amount = $metadata['simpay_fee_recovery_unit_amount']; - - if ( (int) $original_fee_recovery_amount === (int) $new_fee_recovery_amount ) { - return $subscription; - } - - // Void the previous Invoice. - $invoice->voidInvoice( $invoice->id, $form->get_api_request_args() ); // @phpstan-ignore-line - - // Return the new Subscription. - return API\Subscriptions\create( - $new_subscription_args, - $form->get_api_request_args() - ); - } - - /** - * Returns line item data from a Stripe line item object that can be used to - * create a new line item. - * - * @since 4.7.0 - * - * @param \SimplePay\Vendor\Stripe\InvoiceLineItem $line_item Line item object. - * @return array Line item data. - */ - private function recreate_line_item( $line_item ) { - /** @var \SimplePay\Vendor\Stripe\Price $price */ - $price = $line_item->price; - - if ( $price->active ) { - return array( - 'price' => $price->id, - 'quantity' => $line_item->quantity, - ); - } - - return array( - 'quantity' => $line_item->quantity, - 'price_data' => array( - 'unit_amount' => $line_item->amount, - 'currency' => $line_item->currency, - 'product' => $price->product, - 'recurring' => isset( $price->recurring ) - ? array( - 'interval' => isset( $price->recurring->interval ) - ? $price->recurring->interval - : null, - 'interval_count' => isset( $price->recurring->interval_count ) - ? $price->recurring->interval_count - : null, - ) - : null, - ), - ); - } - -} diff --git a/src/RestApi/Internal/Payment/ProPaymentCreateRoute.php b/src/RestApi/Internal/Payment/ProPaymentCreateRoute.php deleted file mode 100644 index ae788883..00000000 --- a/src/RestApi/Internal/Payment/ProPaymentCreateRoute.php +++ /dev/null @@ -1,384 +0,0 @@ - SchemaUtils::get_form_id_schema(), - 'form_values' => SchemaUtils::get_form_values_schema(), - 'price_id' => SchemaUtils::get_price_id_schema(), - 'quantity' => SchemaUtils::get_quantity_schema(), - 'custom_amount' => SchemaUtils::get_custom_amount_schema(), - 'payment_method_type' => SchemaUtils::get_payment_method_type_schema(), - 'is_optionally_recurring' => SchemaUtils::get_is_optionally_recurring_schema(), - 'is_covering_fees' => SchemaUtils::get_is_covering_fees_schema(), - 'coupon_code' => SchemaUtils::get_coupon_code_schema(), - 'billing_address' => SchemaUtils::get_billing_address_schema(), - 'shipping_address' => SchemaUtils::get_shipping_address_schema(), - 'token' => SchemaUtils::get_token_schema(), - ); - - $create_item_route = array( - 'methods' => WP_REST_Server::CREATABLE, - 'callback' => array( $this, 'create_payment' ), - 'permission_callback' => array( $this, 'create_payment_permissions_check' ), - 'args' => $create_args, - ); - - register_rest_route( - $this->namespace, - $this->route, - $create_item_route - ); - } - - /** - * {@inheritdoc} - * - * @throws \Exception If the payment could not be created. - * @throws \Simplepay\Core\RestApi\Internal\Payment\Exception\ValidationException If a validation error occurs. - */ - public function create_payment( $request ) { - try { - // Check rate limit. - // This is done here to avoid double increments (in authorization callback) - // and more human-friendly error messages. - if ( false === $this->validate_rate_limit( $request ) ) { - throw new ValidationException( - __( - 'Sorry, you have made too many requests. Please try again later.', - 'stripe' - ) - ); - } - - /** - * Allows processing before a payment is created. - * - * @since 4.7.x - * - * @param \WP_REST_Request $request The request object. - */ - do_action( 'simpay_before_payment_create', $request ); - - // Check form token. - // This is done here to avoid double increments (in authorization callback) - // and more human-friendly error messages. - if ( false === TokenValidationUtils::validate_token( $request ) ) { - throw new ValidationException( - __( 'Invalid CAPTCHA. Please try again.', 'stripe' ) - ); - } - - // Add a Customer, if needed. - $customer = $this->get_customer( $request ); - - // Handle the payment based on the form type. - $form = PaymentRequestUtils::get_form( $request ); - - // Handle an off-site Checkout Session form. - if ( 'stripe_checkout' === $form->get_display_type() ) { - $payment = $this->create_checkout_session( - $request, - $this->get_checkout_session_args( $request, $customer ) - ); - - return new WP_REST_Response( - array( - 'redirect' => $payment->url, - ) - ); - - // Handle an on-site Elements form. - } else { - if ( ! $customer instanceof Customer ) { - throw new Exception( - __( 'Invalid request. Please try again.', 'stripe' ) - ); - } - - if ( PaymentRequestUtils::is_recurring( $request ) ) { - $object = $this->create_subscription( $request, $customer ); - - if ( isset( $object->pending_setup_intent ) ) { - $intent = $object->pending_setup_intent; - } else { - /** @var \SimplePay\Vendor\Stripe\Invoice $latest_invoice */ - $latest_invoice = $object->latest_invoice; - $intent = $latest_invoice->payment_intent; - } - } else { - $object = $this->create_payment_intent( $request, $customer ); - $intent = $object; - } - - /** @var \SimplePay\Vendor\Stripe\PaymentIntent|\SimplePay\Vendor\Stripe\SetupIntent $intent */ - - return new WP_REST_Response( - array( - // Send back the parent object ID. This is may be used - // in subsequent requests to retrieve the object and - // update the payment intent being used. - 'object_id' => $object->id, - 'customer_id' => $customer->id, - 'client_secret' => $intent->client_secret, - 'return_url' => esc_url( - add_query_arg( - array( - 'customer_id' => $customer->id, - ), - $form->payment_success_page - ) - ), - ) - ); - } - } catch ( ValidationException $e ) { - return new WP_REST_Response( - array( - 'message' => Utils\handle_exception_message( $e ), - ), - rest_authorization_required_code() - ); - } catch ( Exception $e ) { - return new WP_REST_Response( - array( - 'message' => Utils\handle_exception_message( $e ), - ), - 400 - ); - } - } - - /** - * Overrides the Checkout Session arguments used in Lite, adding additional - * for the given request. - * - * @since 4.7.0 - * - * @param \WP_REST_Request $request The payment request. - * @param \SimplePay\Vendor\Stripe\Customer|null $customer Customer, if one was created. - * @return array - * @throws \Exception If the custom amount is not valid. - */ - protected function get_checkout_session_args( $request, $customer ) { - $form = PaymentRequestUtils::get_form( $request ); - $tax_status = get_post_meta( $form->id, '_tax_status', true ); - $tax_behavior = get_post_meta( $form->id, '_tax_behavior', true ); - - // Pull the base Checkout Session arguments used in Lite. - $session_args = parent::get_checkout_session_args( $request, $customer ); - - // Remove custom fields from the Checkout Session arguments as those fields - // are collected on-site in Pro. - unset( $session_args['custom_fields'] ); - - // Update the application fee to account for discounts and taxes, if needed. - if ( isset( - $session_args['payment_intent_data'], - $session_args['payment_intent_data']['application_fee_amount'] // @phpstan-ignore-line - ) ) { - $unit_amount = PaymentRequestUtils::get_unit_amount( $request ); - - // Remove the coupon amount, if needed. - $discount = CouponUtils::get_discount_unit_amount( - $request, - $unit_amount, - $customer ? $customer->id : null - ); - - if ( 0 !== $discount ) { - $unit_amount = $unit_amount - $discount; - } - - // Add the tax amount, if needed. - $tax = TaxUtils::get_tax_unit_amount( $request, $unit_amount ); - - if ( 0 !== $tax ) { - // Automatic tax, and exclusive, so add the amount. - if ( 'automatic' === $tax_status && 'exclusive' === $tax_behavior ) { - $unit_amount = $unit_amount + $tax; - - // Fixed global, add the amount (accounts for inclusive) in calculatinos. - } elseif ( empty( $tax_behavior ) || 'fixed-global' === $tax_behavior ) { - $unit_amount = $unit_amount + $tax; - } - } - - $session_args['payment_intent_data']['application_fee_amount'] = - $this->application_fee->get_application_fee_amount( $unit_amount ); - } - - // Add the customer, if needed. - if ( $customer instanceof Customer ) { - $session_args['customer'] = $customer->id; - $session_args['customer_update'] = array( - 'name' => 'auto', - 'address' => 'auto', - 'shipping' => 'auto', - ); - - // You may only specify one of these parameters: customer, customer_creation. - unset( $session_args['customer_creation'] ); - } - - // Merge in additional top level metadata. - $session_args['metadata'] = array_merge( - $session_args['metadata'], // @phpstan-ignore-line - $session_args['payment_intent_data']['metadata'] // @phpstan-ignore-line - ); - - // Set the allowed payment method types. - $session_args['payment_method_types'] = PaymentRequestUtils::get_payment_method_types( - $request - ); - - // Set the payment method options. - $session_args['payment_method_options'] = PaymentRequestUtils::get_payment_method_options( - $request - ); - - // Add a discount, if needed. - $coupon = PaymentRequestUtils::get_coupon_code( $request ); - - if ( ! empty( $coupon ) ) { - $session_args['discounts'] = array( - array( - 'coupon' => $coupon, - ), - ); - } - - // Allow promotion codes, if needed. - $enable_coupons = 'yes' === simpay_get_saved_meta( - $form->id, - '_enable_promotion_codes', - 'no' - ); - - if ( true === $enable_coupons && empty( $coupon ) ) { - $session_args['allow_promotion_codes'] = true; - } - - // Collect the Customer Tax ID, if needed. - $enable_tax_id = 'yes' === simpay_get_saved_meta( - $form->id, - '_enable_tax_id', - 'no' - ); - - if ( true === $enable_tax_id ) { - $session_args['tax_id_collection'] = array( - 'enabled' => true, - ); - } - - // Update the line items, if needed (due to a custom amount). - $price = PaymentRequestUtils::get_price( $request ); - - if ( false === simpay_payment_form_prices_is_defined_price( $price->id ) ) { - $custom_amount = PaymentRequestUtils::get_custom_unit_amount( $request ); - - $price_data = array( - 'currency' => $price->currency, - 'unit_amount' => $custom_amount, - 'product' => $price->product_id, - ); - - // Remove defined price and add custom price data. - unset( $session_args['line_items'][0]['price'] ); // @phpstan-ignore-line - $session_args['line_items'][0]['price_data'] = $price_data; // @phpstan-ignore-line - } - - // Make adjustments to the arguments if a subscription is being created. - if ( PaymentRequestUtils::is_recurring( $request ) ) { - // Remove unsupported arguments. - unset( $session_args['payment_intent_data'] ); - unset( $session_args['submit_type'] ); - unset( $session_args['customer_creation'] ); - - // Set the mode to Subscription. - $session_args['mode'] = 'subscription'; - - // Set the subscription data. - $session_args['subscription_data'] = $this->get_subscription_args( - $request - ); - - // Merge subscription data metadata into the top level metadata. - if ( isset( $session_args['subscription_data']['metadata'] ) ) { - $session_args['metadata'] = array_merge( - $session_args['metadata'], // @phpstan-ignore-line - $session_args['subscription_data']['metadata'] // @phpstan-ignore-line - ); - } - - // Set the line items. - // Checkout Sessions use a singular `line_items` argument. - $session_args['line_items'] = array_merge( - $this->get_subscription_recurring_line_items( $request ), - $this->get_subscription_additional_invoice_line_items( $request ) - ); - - if ( $this->application_fee->has_application_fee() ) { - $session_args['subscription_data']['application_fee_percent'] = - $this->application_fee->get_application_fee_percentage(); - } - } - - // Add tax rates to line items, if needed. - $session_args['line_items'] = TaxUtils::add_tax_rates_to_line_items( - $request, - $session_args['line_items'] // @phpstan-ignore-line - ); - - // Add automatic tax collection, if needed. - $session_args = TaxUtils::add_automatic_tax_args( - $request, - $session_args - ); - - return $session_args; - } - -} diff --git a/src/RestApi/Internal/Payment/TaxCalculationRoute.php b/src/RestApi/Internal/Payment/TaxCalculationRoute.php deleted file mode 100644 index 8d2d0748..00000000 --- a/src/RestApi/Internal/Payment/TaxCalculationRoute.php +++ /dev/null @@ -1,385 +0,0 @@ - SchemaUtils::get_form_id_schema(), - // Form values aren't required, but we check for the Customer Tax ID - // if it is available. - 'form_values' => SchemaUtils::get_form_values_schema( - array( - 'required' => false, - 'validate_callback' => 'rest_validate_request_arg', - ) - ), - 'price_id' => SchemaUtils::get_price_id_schema(), - 'quantity' => SchemaUtils::get_quantity_schema(), - 'custom_amount' => SchemaUtils::get_custom_amount_schema(), - 'billing_address' => SchemaUtils::get_billing_address_schema(), - 'shipping_address' => SchemaUtils::get_shipping_address_schema(), - 'coupon_code' => SchemaUtils::get_coupon_code_schema(), - 'is_covering_fees' => SchemaUtils::get_is_covering_fees_schema(), - 'is_optionally_recurring' => SchemaUtils::get_is_optionally_recurring_schema(), - ); - - $create_item_route = array( - 'methods' => WP_REST_Server::CREATABLE, - 'callback' => array( $this, 'create_calculation' ), - 'permission_callback' => array( $this, 'create_calculation_permissions_check' ), - 'args' => $create_args, - ); - - register_rest_route( - $this->namespace, - 'payment/calculate-tax', - $create_item_route - ); - } - - /** - * Determines if the current request should be able to create a tax calculation. - * - * @since 4.7.0 - * - * @param \WP_REST_Request $request The payment request. - * @return bool - */ - public function create_calculation_permissions_check( $request ) { - return true; - } - - /** - * Creates a tax calculation for the given request. - * - * @since 4.7.0 - * - * @param \WP_REST_Request $request The payment request. - * @return \WP_REST_Response The calculation response. - * @throws \Exception If the request does not need a tax calculation. - */ - public function create_calculation( $request ) { - $form = PaymentRequestUtils::get_form( $request ); - $price = PaymentRequestUtils::get_price( $request ); - $form_values = PaymentRequestUtils::get_form_values( $request ); - $is_recurring = PaymentRequestUtils::is_recurring( $request ); - $tax_status = get_post_meta( $form->id, '_tax_status', true ); - $tax_behavior = get_post_meta( $form->id, '_tax_behavior', true ); - - try { - if ( 'automatic' !== $tax_status ) { - throw new Exception( - __( 'Invalid request. Please try again.', 'stripe' ) - ); - } - - $args = array( - 'currency' => $price->currency, - 'customer_details' => array(), - 'tax_date' => time(), - ); - - // Add the provided billing or shipping adddress. - if ( $request->get_param( 'billing_address' ) ) { - $args['customer_details']['address_source'] = 'billing'; - $args['customer_details']['address'] = $request->get_param( - 'billing_address' - ); - } elseif ( $request->get_param( 'shipping_address' ) ) { - $args['customer_details']['address_source'] = 'shipping'; - $args['customer_details']['address'] = $request->get_param( - 'shipping_address' - ); - } - - if ( ! isset( $args['customer_details']['address'] ) ) { - throw new Exception( - __( - 'Please enter a valid address to calculate tax.', - 'stripe' - ) - ); - } - - // Remove empty values. - /** @var array $address */ - $address = $args['customer_details']['address']; - - $args['customer_details']['address'] = array_filter( - $address, - function ( $value ) { - return ! empty( $value ); - } - ); - - // Add the tax ID, if provided. - if ( isset( $form_values['simpay_tax_id'] ) ) { - /** @var string $tax_id_type */ - $tax_id_type = isset( $form_values['simpay_tax_id_type'] ) - ? $form_values['simpay_tax_id_type'] - : ''; - - $valid_tax_id_types = i18n\get_stripe_tax_id_types(); - - if ( false === array_key_exists( $tax_id_type, $valid_tax_id_types ) ) { - throw new Exception( - esc_html__( - 'Please select a valid Tax ID type.', - 'stripe' - ) - ); - } - - /** @var string $tax_id */ - $tax_id = $form_values['simpay_tax_id']; - $tax_id = sanitize_text_field( $tax_id ); - - $args['customer_details']['tax_ids'] = array( - array( - 'type' => $tax_id_type, - 'value' => $tax_id, - ), - ); - } - - // @todo These aren't the best names, but it requires less refactoring - // of the client Cart. - $total_details = array( - 'amount_discount' => 0, - 'amount_shipping' => 0, - 'amount_tax' => 0, - ); - $upcoming_invoice = $total_details; - - $today_line_items = $this->get_tax_today_line_items( - $request - ); - - if ( ! empty( $today_line_items ) ) { - $today_tax_calculation = Stripe_API::request( - 'Tax\Calculation', - 'create', - array_merge( - $args, - array( - 'line_items' => $today_line_items, - ) - ), - $form->get_api_request_args() - ); - - $total_details['amount_tax'] = 'exclusive' === $tax_behavior - ? $today_tax_calculation->tax_amount_exclusive - : $today_tax_calculation->tax_amount_inclusive; - } else { - $total_details['amount_tax'] = 0; - } - - if ( $is_recurring ) { - $upcoming_line_items = $this->get_tax_upcoming_line_items( - $request - ); - - if ( ! empty( $upcoming_line_items ) ) { - $upcoming_tax_calculation = Stripe_API::request( - 'Tax\Calculation', - 'create', - array_merge( - $args, - array( - 'line_items' => $upcoming_line_items, - ) - ), - $form->get_api_request_args() - ); - - $upcoming_invoice['amount_tax'] = 'exclusive' === $tax_behavior - ? $upcoming_tax_calculation->tax_amount_exclusive - : $upcoming_tax_calculation->tax_amount_inclusive; - } else { - $upcoming_invoice['amount_tax'] = 0; - } - } - - return new WP_REST_Response( - array( - 'id' => ! empty( $today_tax_calculation ) - ? $today_tax_calculation->id - : null, - 'tax' => array( - 'behavior' => $tax_behavior, - ), - 'total_details' => $total_details, - 'upcoming_invoice' => $upcoming_invoice, - ) - ); - } catch ( Exception $e ) { - return new WP_REST_Response( - array( - 'message' => Utils\handle_exception_message( $e ), - ), - 400 - ); - } - } - - /** - * Returns the line items for the tax due today for the given request. - * - * Plan and Setup Fees are added to a singular line item so the discount amount - * can be easily calculated. When automatic tax is used with Billing, they - * are added as separate line items. - * - * @since 4.7.0 - * - * @param \WP_REST_Request $request The payment request. - * @return array> The line items. - */ - private function get_tax_today_line_items( $request ) { - $form = PaymentRequestUtils::get_form( $request ); - $price = PaymentRequestUtils::get_price( $request ); - $base_unit_amount = PaymentRequestUtils::get_unit_amount( $request ); - $quantity = PaymentRequestUtils::get_quantity( $request ); - $tax_code = get_post_meta( $form->id, '_tax_code', true ); - $tax_behavior = get_post_meta( $form->id, '_tax_behavior', true ); - - // If there is a trial period, reset the amount to 0. - if ( - $price->recurring && - isset( $price->recurring['trial_period_days'] ) - ) { - $base_unit_amount = 0; - } - - // Add the setup (and plan) fee, if needed. - if ( ! empty( $price->line_items ) ) { - $setup_fee_unit_amount = array_reduce( - $price->line_items, - function ( $carry, $item ) { - $carry = $carry + $item['unit_amount']; - return $carry; - }, - 0 - ); - - $base_unit_amount = $base_unit_amount + $setup_fee_unit_amount; - } - - // Remove the coupon amount, if needed. - $discount = CouponUtils::get_discount_unit_amount( - $request, - $base_unit_amount - ); - - if ( 0 !== $discount ) { - $base_unit_amount = $base_unit_amount - $discount; - } - - // If the amount is 0, there is no tax due. - if ( 0 === $base_unit_amount ) { - return array(); - } - - return array( - array( - 'amount' => $base_unit_amount, - 'product' => $price->product_id, - 'quantity' => $quantity, - 'tax_behavior' => $tax_behavior, - 'tax_code' => $tax_code, - 'reference' => $price->id, - ), - ); - } - - /** - * Returns the line items for the tax due on the next invoice for the given request. - * - * @since 4.7.0 - * - * @param \WP_REST_Request $request The payment request. - * @return array> The line items. - */ - private function get_tax_upcoming_line_items( $request ) { - $form = PaymentRequestUtils::get_form( $request ); - $price = PaymentRequestUtils::get_price( $request ); - $base_unit_amount = PaymentRequestUtils::get_unit_amount( $request ); - $quantity = PaymentRequestUtils::get_quantity( $request ); - $tax_code = get_post_meta( $form->id, '_tax_code', true ); - $tax_behavior = get_post_meta( $form->id, '_tax_behavior', true ); - $coupon_code = PaymentRequestUtils::get_coupon_code( $request ); - - // Remove the coupon amount, if needed. - // We need to ensure the coupon is valid for the next invoice. - if ( $coupon_code ) { - $coupon = API\Coupons\retrieve( - $coupon_code, - $form->get_api_request_args() - ); - - if ( 'once' !== $coupon->duration ) { - $discount = CouponUtils::get_discount_unit_amount( - $request, - $base_unit_amount - ); - - if ( 0 !== $discount ) { - $base_unit_amount = $base_unit_amount - $discount; - } - } - } - - // If the amount is 0, there is no tax due. - if ( 0 === $base_unit_amount ) { - return array(); - } - - return array( - array( - 'amount' => $base_unit_amount, - 'product' => $price->product_id, - 'quantity' => $quantity, - 'tax_behavior' => $tax_behavior, - 'tax_code' => $tax_code, - 'reference' => wp_generate_uuid4(), - ), - ); - } - -} diff --git a/src/RestApi/Internal/Payment/UpdatePaymentMethodRoute.php b/src/RestApi/Internal/Payment/UpdatePaymentMethodRoute.php deleted file mode 100644 index a97a86b9..00000000 --- a/src/RestApi/Internal/Payment/UpdatePaymentMethodRoute.php +++ /dev/null @@ -1,179 +0,0 @@ - SchemaUtils::get_form_id_schema(), - 'customer_id' => SchemaUtils::get_customer_id_schema(), - 'setup_intent_id' => SchemaUtils::get_setup_intent_id_schema(), - 'payment_method_id' => SchemaUtils::get_payment_method_id_schema(), - 'subscription_id' => SchemaUtils::get_subscription_id_schema(), - 'subscription_key' => SchemaUtils::get_subscription_key_schema(), - ); - - $update_item_route = array( - 'methods' => WP_REST_Server::EDITABLE, - 'callback' => array( $this, 'update_payment_method' ), - 'permission_callback' => array( $this, 'update_payment_method_permissions_check' ), - 'args' => $update_args, - ); - - register_rest_route( - $this->namespace, - 'payment/update-payment-method', - $update_item_route - ); - } - - /** - * Determines if the current request should be able to update the payment method. - * - * @since 4.7.0 - * - * @param \WP_REST_Request $request The update payment method request. - * @return bool - */ - public function update_payment_method_permissions_check( $request ) { - // Next, validate that the form exists. - // When using a parameter inside of a validation function, we do not know - // if it has been validated yet. So we need to validate it again. - /** @var int $form_id */ - $form_id = $request->get_param( 'form_id' ); - $form_id = intval( $form_id ); - $form = simpay_get_form( $form_id ); - - if ( false === $form ) { - return false; - } - - /** @var string $customer_id */ - $customer_id = $request->get_param( 'customer_id' ); - $customer_id = sanitize_text_field( $customer_id ); - - /** @var string $subscription_id */ - $subscription_id = $request->get_param( 'subscription_id' ); - $subscription_id = sanitize_text_field( $subscription_id ); - - /** @var string $subscription_key */ - $subscription_key = $request->get_param( 'subscription_key' ); - $subscription_key = sanitize_text_field( $subscription_key ); - - try { - $subscription = API\Subscriptions\retrieve( - $subscription_id, - $form->get_api_request_args() - ); - - // Ensure customers match. - if ( $subscription->customer !== $customer_id ) { - return false; - } - - // Ensure keys match. - if ( - ! isset( $subscription->metadata->simpay_subscription_key ) || - $subscription->metadata->simpay_subscription_key !== $subscription_key - ) { - return false; - } - - /** @var string $setup_intent_id */ - $setup_intent_id = $request->get_param( 'setup_intent_id' ); - - $setup_intent = API\SetupIntents\retrieve( - $setup_intent_id, - $form->get_api_request_args() - ); - - if ( $setup_intent->customer !== $customer_id ) { - return false; - } - - // Something went wrong. - } catch ( Exception $e ) { - return false; - } - - return true; - } - - /** - * Updates a Subscription's payment method. - * - * @since 4.7.0 - * - * @param \WP_REST_Request $request The update payment method request. - * @throws \SimplePay\Core\RestApi\Internal\Payment\Exception\ValidationException When the request is invalid. - * @return \WP_REST_Response - */ - public function update_payment_method( $request ) { - try { - // Check rate limit. - // This is done here to avoid double increments (in authorization callback) - // or non-human-friendly error messages (in API argument validation). - if ( false === $this->validate_rate_limit( $request ) ) { - throw new ValidationException( - __( - 'Sorry, you have made too many requests. Please try again later.', - 'stripe' - ) - ); - } - - /** @var string $subscription_id */ - $subscription_id = $request->get_param( 'subscription_id' ); - - /** @var string $payment_method_id */ - $payment_method_id = $request->get_param( 'payment_method_id' ); - - API\Subscriptions\update( - $subscription_id, - array( - 'default_payment_method' => $payment_method_id, - 'cancel_at_period_end' => false, - ) - ); - - return new WP_REST_Response( array() ); - } catch ( Exception $e ) { - return new WP_REST_Response( - array( - 'message' => $e->getMessage(), - ), - 400 - ); - } - } - -} diff --git a/src/RestApi/Internal/Payment/ValidateCouponRoute.php b/src/RestApi/Internal/Payment/ValidateCouponRoute.php deleted file mode 100644 index de73f450..00000000 --- a/src/RestApi/Internal/Payment/ValidateCouponRoute.php +++ /dev/null @@ -1,148 +0,0 @@ - SchemaUtils::get_form_id_schema(), - 'currency' => SchemaUtils::get_currency_schema( - array( - 'required' => true, - ) - ), - 'subtotal' => SchemaUtils::get_subtotal_schema( - array( - 'required' => true, - ) - ), - 'coupon_code' => SchemaUtils::get_coupon_code_schema(), - ); - - $create_item_route = array( - 'methods' => WP_REST_Server::CREATABLE, - 'callback' => array( - $this, - 'create_coupon_validation', - ), - 'permission_callback' => array( - $this, - 'create_coupon_validation_permissions_check', - ), - 'args' => $create_args, - ); - - register_rest_route( - $this->namespace, - 'payment/validate-coupon', - $create_item_route - ); - } - - /** - * Determines who can validate a coupon using this route. - * - * @since 4.7.0 - * - * @return bool - */ - public function create_coupon_validation_permissions_check() { - return true; - } - - /** - * Validates a coupon code for the given request. - * - * @since 4.7.0 - * - * @param \WP_REST_Request $request The coupon validation request. - * @return \WP_REST_Response The coupon validation response. - * @throws \Exception If the coupon code is invalid. - */ - public function create_coupon_validation( $request ) { - $form = PaymentRequestUtils::get_form( $request ); - $coupon_code = PaymentRequestUtils::get_coupon_code( $request ); - - /** @var string $currency */ - $currency = $request->get_param( 'currency' ); - - /** @var int $subtotal */ - $subtotal = $request->get_param( 'subtotal' ); - - try { - if ( empty( $coupon_code ) ) { - throw new Exception( - __( 'Please enter a coupon code.', 'stripe' ) - ); - } - - $coupon_data = CouponUtils::get_coupon_data( - $request, - $coupon_code, - $subtotal, - $currency - ); - - if ( isset( $coupon_data['error'] ) ) { - /** @var string $error_message */ - $error_message = $coupon_data['error']; - throw new Exception( $error_message ); - } - - $api_args = $form->get_api_request_args(); - $coupons = new Coupon_Query( - $form->is_livemode(), - $api_args['api_key'] - ); - - $simpay_coupon = $coupons->get_by_name( $coupon_code ); - - if ( - $simpay_coupon instanceof \SimplePay\Pro\Coupons\Coupon && - false === $simpay_coupon->applies_to_form( $form->id ) - ) { - throw new Exception( - __( 'Coupon is invalid.', 'stripe' ) - ); - } - - return new WP_REST_Response( $coupon_data ); - } catch ( Exception $e ) { - return new WP_REST_Response( - array( - 'message' => Utils\handle_exception_message( $e ), - ), - 400 - ); - } - } - -} diff --git a/src/RestApi/Internal/Report/LatestPaymentsReport.php b/src/RestApi/Internal/Report/LatestPaymentsReport.php index 986a0972..7bf2bb06 100644 --- a/src/RestApi/Internal/Report/LatestPaymentsReport.php +++ b/src/RestApi/Internal/Report/LatestPaymentsReport.php @@ -114,7 +114,7 @@ private function get_results( $currency ) { $results = $wpdb->get_results( // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared $wpdb->prepare( - "SELECT * FROM {$wpdb->prefix}wpsp_transactions WHERE livemode = %d AND currency = %s AND status IN ( 'succeeded', 'failed', 'requires_payment_method', 'refunded') AND object IN ('payment_intent', 'setup_intent') ORDER BY date_created DESC LIMIT 0, 10", + "SELECT * FROM {$wpdb->prefix}wpsp_transactions WHERE livemode = %d AND currency = %s AND status IN ( 'succeeded', 'failed', 'requires_payment_method') AND object IN ('payment_intent', 'setup_intent') ORDER BY date_created DESC LIMIT 0, 10", simpay_is_test_mode() ? 0 : 1, $currency ), @@ -144,16 +144,11 @@ private function format_result( $result ) { $result->currency ); - $result->amount_refunded_formatted = simpay_format_currency( - $result->amount_refunded, - $result->currency - ); - $result->payment_method_type_icon = $this->get_payment_method_type_icon( $result->payment_method_type ); - $result->status_formatted = $this->format_status( $result ); + $result->status_formatted = $this->format_status( $result->status ); $result->date_created_human_time_diff = sprintf( /* translators: %s Payment created date. */ @@ -184,41 +179,20 @@ private function format_result( $result ) { * * @since 4.6.7 * - * @param \stdClass $result Result object. + * @param string $status Status. * @return string */ - private function format_status( $result ) { - $status = $this->get_status( $result ); + private function format_status( $status ) { switch ( $status ) { case 'succeeded': return __( 'Succeeded', 'stripe' ); case 'failed': return __( 'Failed', 'stripe' ); - case 'refunded': - return __( 'Refunded', 'stripe' ); - case 'partial_refund': - return __( 'Partially Refunded', 'stripe' ); default: return __( 'Incomplete', 'stripe' ); } } - /** - * Formats status for the Latest Payments report. - * - * @since 4.10.0 - * - * @param \stdClass $result Result object. - * @return string - */ - private function get_status( $result ) { - if ( $result->amount_refunded !== $result->amount_total && 'refunded' === $result->status ) { - return 'partial_refund'; - } - - return $result->status; - } - /** * Returns an icon for a given payment method type from the Payment Method registry. * @@ -262,4 +236,5 @@ private function get_payment_method_type_icon( $payment_method_type ) { return $payment_method->icon_sm; } } + } diff --git a/src/Transaction/Database/Schema.php b/src/Transaction/Database/Schema.php index a17d874c..2c0b0ddc 100644 --- a/src/Transaction/Database/Schema.php +++ b/src/Transaction/Database/Schema.php @@ -104,16 +104,6 @@ class Schema extends BerlinDBSchema { 'validate' => 'intval', ), - // amount_refunded. - array( - 'name' => 'amount_refunded', - 'type' => 'bigint', - 'length' => '20', - 'default' => 0, - 'allow_null' => false, - 'validate' => 'intval', - ), - // amount_tax. array( 'name' => 'amount_tax', diff --git a/src/Transaction/Database/Table.php b/src/Transaction/Database/Table.php index f2daf97f..8d93328d 100644 --- a/src/Transaction/Database/Table.php +++ b/src/Transaction/Database/Table.php @@ -42,7 +42,7 @@ class Table extends BerlinDBTable { * * @var int */ - protected $version = 202404230001; + protected $version = 202301090001; /** * {@inheritdoc} @@ -59,7 +59,6 @@ class Table extends BerlinDBTable { protected $upgrades = array( // @phpstan-ignore-line '202206170001' => 202206170001, '202301090001' => 202301090001, - '202404230001' => 202404230001, ); /** @@ -78,7 +77,6 @@ protected function set_schema() { amount_subtotal bigint(20) NOT NULL, amount_shipping bigint(20) NOT NULL, amount_discount bigint(20) NOT NULL, - amount_refunded bigint(20) NOT NULL DEFAULT 0, amount_tax bigint(20) NOT NULL, currency varchar(3) NOT NULL, payment_method_type varchar(50) DEFAULT NULL, @@ -153,20 +151,4 @@ protected function __202301090001() { return $this->is_success( true ); } - /** - * Upgrade to version 202404230001. - * - Add a new `amount_refunded` column. - * - * @since 4.10.0 - * - * @return bool - */ - protected function __202404230001() { - // Add the `amount_refunded` column after `amount_discount`. - $this->get_db()->query( - "ALTER TABLE {$this->table_name} ADD COLUMN `amount_refunded` bigint(20) NOT NULL DEFAULT 0 AFTER `amount_discount`" - ); - - return $this->is_success( true ); - } } diff --git a/src/Transaction/TransactionObserver.php b/src/Transaction/TransactionObserver.php index 8fd45997..b3987d23 100644 --- a/src/Transaction/TransactionObserver.php +++ b/src/Transaction/TransactionObserver.php @@ -106,7 +106,6 @@ public function get_subscribed_events() { array( 'update_on_failed', 10, 2 ), array( 'maybe_increment_stock', 10, 2 ), ), - 'simpay_webhook_charge_refunded' => array( 'add_refund_log', 10, 3 ), ); // Update Checkout Session in Lite when viewing confirmation. @@ -118,60 +117,6 @@ public function get_subscribed_events() { return $observe; } - /** - * Logs a transaction when a refund is created. - * - * @since 4.10.0 - * - * @param \SimplePay\Vendor\Stripe\Event $event Stripe Event object. - * @param \SimplePay\Vendor\Stripe\Charge $charge Stripe Charge object. - * @param \SimplePay\Core\Abstracts\Form $form Payment Form. - * @return void - */ - public function add_refund_log( $event, $charge, $form ) { - // Check if the payment made form WP Simple Pay. - if ( ! isset( $charge->payment_intent->metadata->simpay_form_id ) ) { - return; - } - - $transaction = $this->transactions->get_by_object_id( - $charge->payment_intent->id - ); - - // Update the transaction status if it exists. - if ( $transaction instanceof Transaction ) { - $this->transactions->update( - $transaction->id, - array( - 'status' => 'refunded', - 'amount_refunded' => $charge->amount_refunded, - ) - ); - } else { - // Create a new transaction log if it doesn't exist. - $this->transactions->add( - array( - 'form_id' => $charge->payment_intent->metadata->simpay_form_id, - 'object' => 'payment_intent', - 'object_id' => $charge->payment_intent->id, - 'livemode' => (bool) $charge->livemode, - 'amount_total' => $charge->amount, - 'amount_subtotal' => $charge->amount_refunded, - 'amount_shipping' => 0, - 'amount_discount' => 0, - 'amount_refunded' => $charge->amount_refunded, - 'currency' => $charge->currency, - 'payment_method_type' => null, - 'email' => $charge->billing_details->email, // @phpstan-ignore-line - 'customer_id' => $charge->customer->id, // @phpstan-ignore-line - 'subscription_id' => null, - 'status' => 'refunded', - 'application_fee' => $this->application_fee->has_application_fee(), - ) - ); - } - } - /** * Logs a transaction when a PaymentIntent is created. * @@ -346,7 +291,7 @@ public function add_on_invoice( $event, $invoice, $subscription ) { * @param int $total_discount Total discount, so far. * @param \stdClass $discount Discount object. */ - function ( $total_discount, $discount ) { + function( $total_discount, $discount ) { /** @var \stdClass $discount */ return $total_discount + $discount->amount; }, @@ -542,7 +487,7 @@ public function update_on_checkout_session( $event, $customer, $payment_intent, * @property int $amount_discount * @property int $amount_tax */ - $default_totals = new stdClass(); + $default_totals = new stdClass; $default_totals->amount_shipping = 0; $default_totals->amount_discount = 0; $default_totals->amount_tax = 0; @@ -634,7 +579,7 @@ public function update_on_checkout_session_lite( $payment_confirmation_data ) { * @property int $amount_discount * @property int $amount_tax */ - $default_totals = new stdClass(); + $default_totals = new stdClass; $default_totals->amount_shipping = 0; $default_totals->amount_discount = 0; $default_totals->amount_tax = 0; @@ -726,7 +671,7 @@ public function update_on_invoice( $event, $invoice, $subscription ) { * @param int $total_discount Total discount, so far. * @param \stdClass $discount Discount object. */ - function ( $total_discount, $discount ) { + function( $total_discount, $discount ) { /** @var \stdClass $discount */ return $total_discount + $discount->amount; }, @@ -907,4 +852,5 @@ public function maybe_increment_stock( $event, $charge ) { $form->adjust_inventory( 'increment', $quantity, $instance_id ); } } + } diff --git a/vendor/autoload.php b/vendor/autoload.php index d2e743f5..db60b171 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -22,4 +22,4 @@ require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInitc67ad27e892acdfcae5f60503f3a27f3::getLoader(); +return ComposerAutoloaderInit314dd3482abd4cc1454cdb0e133d5085::getLoader(); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 7f0fe8ec..a1c492d7 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInitc67ad27e892acdfcae5f60503f3a27f3 +class ComposerAutoloaderInit314dd3482abd4cc1454cdb0e133d5085 { private static $loader; @@ -22,12 +22,12 @@ public static function getLoader() return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInitc67ad27e892acdfcae5f60503f3a27f3', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit314dd3482abd4cc1454cdb0e133d5085', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); - spl_autoload_unregister(array('ComposerAutoloaderInitc67ad27e892acdfcae5f60503f3a27f3', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit314dd3482abd4cc1454cdb0e133d5085', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInitc67ad27e892acdfcae5f60503f3a27f3::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInit314dd3482abd4cc1454cdb0e133d5085::getInitializer($loader)); $loader->register(true); diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index c07e354d..9f9557ae 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInitc67ad27e892acdfcae5f60503f3a27f3 +class ComposerStaticInit314dd3482abd4cc1454cdb0e133d5085 { public static $prefixLengthsPsr4 = array ( 'S' => @@ -37,9 +37,9 @@ class ComposerStaticInitc67ad27e892acdfcae5f60503f3a27f3 public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInitc67ad27e892acdfcae5f60503f3a27f3::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInitc67ad27e892acdfcae5f60503f3a27f3::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInitc67ad27e892acdfcae5f60503f3a27f3::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInit314dd3482abd4cc1454cdb0e133d5085::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit314dd3482abd4cc1454cdb0e133d5085::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInit314dd3482abd4cc1454cdb0e133d5085::$classMap; }, null, ClassLoader::class); } diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 7e6e744e..4d6dc29a 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -272,24 +272,23 @@ }, { "name": "symfony/css-selector", - "version": "v5.4.39", - "version_normalized": "5.4.39.0", + "version": "v3.4.47", + "version_normalized": "3.4.47.0", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "0934c9f1d433776f25c629bdc93f3e157d139e08" + "reference": "da3d9da2ce0026771f5fe64cb332158f1bd2bc33" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/0934c9f1d433776f25c629bdc93f3e157d139e08", - "reference": "0934c9f1d433776f25c629bdc93f3e157d139e08", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/da3d9da2ce0026771f5fe64cb332158f1bd2bc33", + "reference": "da3d9da2ce0026771f5fe64cb332158f1bd2bc33", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.16" + "php": "^5.5.9|>=7.0.8" }, - "time": "2024-04-18T08:26:06+00:00", + "time": "2020-10-24T10:57:07+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -318,10 +317,10 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Converts CSS selectors to XPath expressions", + "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/css-selector/tree/v5.4.39" + "source": "https://github.com/symfony/css-selector/tree/v3.4.47" }, "funding": [ { @@ -339,118 +338,33 @@ ], "install-path": "../symfony/css-selector" }, - { - "name": "symfony/polyfill-php80", - "version": "v1.29.0", - "version_normalized": "1.29.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", - "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "time": "2024-01-29T20:11:03+00:00", - "type": "library", - "extra": { - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.29.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/polyfill-php80" - }, { "name": "tijsverkoyen/css-to-inline-styles", - "version": "v2.2.7", - "version_normalized": "2.2.7.0", + "version": "2.2.0", + "version_normalized": "2.2.0.0", "source": { "type": "git", "url": "https://github.com/tijsverkoyen/CssToInlineStyles.git", - "reference": "83ee6f38df0a63106a9e4536e3060458b74ccedb" + "reference": "ab03919dfd85a74ae0372f8baf9f3c7d5c03b04b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/tijsverkoyen/CssToInlineStyles/zipball/83ee6f38df0a63106a9e4536e3060458b74ccedb", - "reference": "83ee6f38df0a63106a9e4536e3060458b74ccedb", + "url": "https://api.github.com/repos/tijsverkoyen/CssToInlineStyles/zipball/ab03919dfd85a74ae0372f8baf9f3c7d5c03b04b", + "reference": "ab03919dfd85a74ae0372f8baf9f3c7d5c03b04b", "shasum": "" }, "require": { - "ext-dom": "*", - "ext-libxml": "*", - "php": "^5.5 || ^7.0 || ^8.0", - "symfony/css-selector": "^2.7 || ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0" + "php": "^5.5 || ^7", + "symfony/css-selector": "^2.7|~3.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0 || ^7.5 || ^8.5.21 || ^9.5.10" + "phpunit/phpunit": "~4.8|5.1.*" }, - "time": "2023-12-08T13:03:43+00:00", + "time": "2016-09-20T12:50:39+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "2.2.x-dev" + "dev-master": "2.0.x-dev" } }, "installation-source": "dist", @@ -474,7 +388,7 @@ "homepage": "https://github.com/tijsverkoyen/CssToInlineStyles", "support": { "issues": "https://github.com/tijsverkoyen/CssToInlineStyles/issues", - "source": "https://github.com/tijsverkoyen/CssToInlineStyles/tree/v2.2.7" + "source": "https://github.com/tijsverkoyen/CssToInlineStyles/tree/master" }, "install-path": "../tijsverkoyen/css-to-inline-styles" }, diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 2c11e5d4..2b6541b9 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => 'wpsimplepay/wp-simple-pay-pro-3', 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => 'bde3ced4ecdb11b86f94860a8f145c92ef7d30e4', + 'reference' => '3473178cf524568b73c5a652692feed0ea69ecef', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -74,27 +74,18 @@ 'dev_requirement' => false, ), 'symfony/css-selector' => array( - 'pretty_version' => 'v5.4.39', - 'version' => '5.4.39.0', - 'reference' => '0934c9f1d433776f25c629bdc93f3e157d139e08', + 'pretty_version' => 'v3.4.47', + 'version' => '3.4.47.0', + 'reference' => 'da3d9da2ce0026771f5fe64cb332158f1bd2bc33', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/css-selector', 'aliases' => array(), 'dev_requirement' => false, ), - 'symfony/polyfill-php80' => array( - 'pretty_version' => 'v1.29.0', - 'version' => '1.29.0.0', - 'reference' => '87b68208d5c1188808dd7839ee1e6c8ec3b02f1b', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-php80', - 'aliases' => array(), - 'dev_requirement' => false, - ), 'tijsverkoyen/css-to-inline-styles' => array( - 'pretty_version' => 'v2.2.7', - 'version' => '2.2.7.0', - 'reference' => '83ee6f38df0a63106a9e4536e3060458b74ccedb', + 'pretty_version' => '2.2.0', + 'version' => '2.2.0.0', + 'reference' => 'ab03919dfd85a74ae0372f8baf9f3c7d5c03b04b', 'type' => 'library', 'install_path' => __DIR__ . '/../tijsverkoyen/css-to-inline-styles', 'aliases' => array(), @@ -112,7 +103,7 @@ 'wpsimplepay/wp-simple-pay-pro-3' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => 'bde3ced4ecdb11b86f94860a8f145c92ef7d30e4', + 'reference' => '3473178cf524568b73c5a652692feed0ea69ecef', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), From fa54a48adce07f9b85487b6ce6007da026271232 Mon Sep 17 00:00:00 2001 From: Prappo Prince Date: Wed, 8 May 2024 21:01:29 +0600 Subject: [PATCH 07/11] Bump version --- package.json | 2 +- stripe-checkout.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 9bf1363e..ab6aa628 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "wp-simple-pay-lite", "title": "WP Simple Pay Lite for Stripe", "description": "Add high conversion Stripe Checkout forms to your WordPress site and start accepting payments in minutes. **Lite Version**", - "version": "4.10.0-beta-2", + "version": "4.10.0", "license": "GPL-2.0-or-later", "homepage": "https://wpsimplepay.com/", "repository": { diff --git a/stripe-checkout.php b/stripe-checkout.php index 5a562d6f..5e83dc97 100644 --- a/stripe-checkout.php +++ b/stripe-checkout.php @@ -5,7 +5,7 @@ * Description: Add high conversion Stripe payment forms to your WordPress site in minutes. * Author: WP Simple Pay * Author URI: https://wpsimplepay.com - * Version: 4.10.0-beta-2 + * Version: 4.10.0 * Text Domain: stripe * Domain Path: /languages */ @@ -54,7 +54,7 @@ // // Lite/Pro-specific. // - define( 'SIMPLE_PAY_VERSION', '4.10.0-beta-2' ); + define( 'SIMPLE_PAY_VERSION', '4.10.0' ); if ( ! defined( 'SIMPLE_PAY_PLUGIN_NAME' ) ) { define( 'SIMPLE_PAY_PLUGIN_NAME', 'WP Simple Pay Lite' ); From 8a7f2dfcddc5b00483beeabfce0eb77145e2cbee Mon Sep 17 00:00:00 2001 From: Prappo Date: Mon, 13 May 2024 16:52:52 +0600 Subject: [PATCH 08/11] sync with pro --- includes/core/admin/class-notice-manager.php | 13 +- includes/core/admin/functions/notices.php | 114 ++--- includes/core/assets/css/admin/settings.scss | 5 + .../assets/css/simpay-admin-page-smtp.min.css | 2 +- includes/core/assets/css/simpay-admin.min.css | 2 +- ...dmin-dashboard-widget-report-css.asset.php | 2 +- ...ay-admin-dashboard-widget-report.asset.php | 2 +- .../simpay-admin-dashboard-widget-report.js | 2 +- ...admin-form-template-explorer-css.asset.php | 2 +- ...pay-admin-form-template-explorer.asset.php | 2 +- .../simpay-admin-form-template-explorer.js | 8 +- .../js/dist/simpay-admin-help-css.asset.php | 2 +- .../js/dist/simpay-admin-help.asset.php | 2 +- .../core/assets/js/dist/simpay-admin-help.js | 4 +- .../simpay-admin-notifications-css.asset.php | 2 +- .../dist/simpay-admin-notifications.asset.php | 2 +- .../js/dist/simpay-admin-notifications.js | 4 +- ...-admin-page-activity-reports-css.asset.php | 2 +- ...mpay-admin-page-activity-reports.asset.php | 2 +- .../simpay-admin-page-activity-reports.js | 6 +- ...mpay-admin-page-setup-wizard-css.asset.php | 2 +- .../simpay-admin-page-setup-wizard.asset.php | 2 +- .../js/dist/simpay-admin-page-setup-wizard.js | 2 +- includes/core/assets/js/dist/simpay-admin.js | 2 +- .../js/dist/simpay-block-button.asset.php | 2 +- .../assets/js/dist/simpay-block-button.js | 2 +- .../simpay-block-payment-form-css.asset.php | 2 +- .../dist/simpay-block-payment-form.asset.php | 2 +- .../js/dist/simpay-block-payment-form.js | 2 +- .../src/admin/help/components/panel/panel.js | 3 +- .../help/components/panel/search-control.js | 67 --- includes/core/assets/js/src/admin/index.js | 3 +- .../card-latest-payments/payment.js | 99 +++-- .../template-explorer/search-control.js | 67 --- .../payment-form/template-explorer/sidebar.js | 7 +- includes/core/bootstrap/compatibility.php | 6 +- includes/core/forms/functions.php | 2 +- .../payment-confirmation-template-tags.php | 59 ++- includes/core/settings/register-emails.php | 5 + .../Component/CssSelector/CHANGELOG.md | 5 + .../CssSelector/CssSelectorConverter.php | 16 +- .../Exception/ExceptionInterface.php | 2 +- .../Exception/SyntaxErrorException.php | 13 +- lib/Symfony/Component/CssSelector/LICENSE | 2 +- .../CssSelector/Node/AbstractNode.php | 5 +- .../CssSelector/Node/AttributeNode.php | 40 +- .../Component/CssSelector/Node/ClassNode.php | 22 +- .../CssSelector/Node/CombinedSelectorNode.php | 27 +- .../CssSelector/Node/ElementNode.php | 23 +- .../CssSelector/Node/FunctionNode.php | 22 +- .../Component/CssSelector/Node/HashNode.php | 22 +- .../CssSelector/Node/NegationNode.php | 17 +- .../CssSelector/Node/NodeInterface.php | 21 +- .../Component/CssSelector/Node/PseudoNode.php | 22 +- .../CssSelector/Node/SelectorNode.php | 22 +- .../CssSelector/Node/Specificity.php | 29 +- .../Parser/Handler/CommentHandler.php | 2 +- .../Parser/Handler/HandlerInterface.php | 5 +- .../Parser/Handler/HashHandler.php | 2 +- .../Parser/Handler/IdentifierHandler.php | 2 +- .../Parser/Handler/NumberHandler.php | 2 +- .../Parser/Handler/StringHandler.php | 2 +- .../Parser/Handler/WhitespaceHandler.php | 2 +- .../Component/CssSelector/Parser/Parser.php | 58 +-- .../CssSelector/Parser/ParserInterface.php | 4 +- .../Component/CssSelector/Parser/Reader.php | 44 +- .../Parser/Shortcut/ClassParser.php | 2 +- .../Parser/Shortcut/ElementParser.php | 2 +- .../Parser/Shortcut/EmptyStringParser.php | 2 +- .../Parser/Shortcut/HashParser.php | 2 +- .../Component/CssSelector/Parser/Token.php | 76 +--- .../CssSelector/Parser/TokenStream.php | 26 +- .../Parser/Tokenizer/Tokenizer.php | 4 +- .../Parser/Tokenizer/TokenizerEscaping.php | 21 +- .../Parser/Tokenizer/TokenizerPatterns.php | 45 +- lib/Symfony/Component/CssSelector/README.md | 10 +- .../Tests/CssSelectorConverterTest.php | 74 ---- .../Tests/Node/AbstractNodeTest.php | 34 -- .../Tests/Node/AttributeNodeTest.php | 37 -- .../CssSelector/Tests/Node/ClassNodeTest.php | 33 -- .../Tests/Node/CombinedSelectorNodeTest.php | 35 -- .../Tests/Node/ElementNodeTest.php | 35 -- .../Tests/Node/FunctionNodeTest.php | 47 -- .../CssSelector/Tests/Node/HashNodeTest.php | 33 -- .../Tests/Node/NegationNodeTest.php | 33 -- .../CssSelector/Tests/Node/PseudoNodeTest.php | 32 -- .../Tests/Node/SelectorNodeTest.php | 34 -- .../Tests/Node/SpecificityTest.php | 63 --- .../Parser/Handler/AbstractHandlerTest.php | 70 --- .../Parser/Handler/CommentHandlerTest.php | 55 --- .../Tests/Parser/Handler/HashHandlerTest.php | 49 --- .../Parser/Handler/IdentifierHandlerTest.php | 49 --- .../Parser/Handler/NumberHandlerTest.php | 50 --- .../Parser/Handler/StringHandlerTest.php | 50 --- .../Parser/Handler/WhitespaceHandlerTest.php | 44 -- .../CssSelector/Tests/Parser/ParserTest.php | 253 ----------- .../CssSelector/Tests/Parser/ReaderTest.php | 102 ----- .../Tests/Parser/Shortcut/ClassParserTest.php | 45 -- .../Parser/Shortcut/ElementParserTest.php | 44 -- .../Parser/Shortcut/EmptyStringParserTest.php | 36 -- .../Tests/Parser/Shortcut/HashParserTest.php | 45 -- .../Tests/Parser/TokenStreamTest.php | 96 ---- .../CssSelector/Tests/XPath/Fixtures/ids.html | 48 -- .../CssSelector/Tests/XPath/Fixtures/lang.xml | 11 - .../Tests/XPath/Fixtures/shakespear.html | 308 ------------- .../Tests/XPath/TranslatorTest.php | 413 ------------------ .../XPath/Extension/AbstractExtension.php | 10 +- .../Extension/AttributeMatchingExtension.php | 68 +-- .../XPath/Extension/CombinationExtension.php | 24 +- .../XPath/Extension/ExtensionInterface.php | 14 +- .../XPath/Extension/FunctionExtension.php | 35 +- .../XPath/Extension/HtmlExtension.php | 50 +-- .../XPath/Extension/NodeExtension.php | 85 +--- .../XPath/Extension/PseudoClassExtension.php | 48 +- .../CssSelector/XPath/Translator.php | 77 +--- .../CssSelector/XPath/TranslatorInterface.php | 13 +- .../Component/CssSelector/XPath/XPathExpr.php | 34 +- .../Component/CssSelector/composer.json | 5 +- .../Component/CssSelector/phpunit.xml.dist | 31 -- lib/Symfony/Polyfill/Php80/LICENSE | 19 + lib/Symfony/Polyfill/Php80/Php80.php | 115 +++++ lib/Symfony/Polyfill/Php80/PhpToken.php | 103 +++++ lib/Symfony/Polyfill/Php80/README.md | 25 ++ .../Php80/Resources/stubs/Attribute.php | 31 ++ .../Php80/Resources/stubs/PhpToken.php | 16 + .../Php80/Resources/stubs/Stringable.php | 20 + .../Resources/stubs/UnhandledMatchError.php | 16 + .../Php80/Resources/stubs/ValueError.php | 16 + lib/Symfony/Polyfill/Php80/bootstrap.php | 42 ++ lib/Symfony/Polyfill/Php80/composer.json | 37 ++ .../CssToInlineStyles/Css/Processor.php | 8 +- .../Css/Property/Processor.php | 21 +- .../Css/Property/Property.php | 4 +- .../CssToInlineStyles/Css/Rule/Processor.php | 26 +- .../CssToInlineStyles/Css/Rule/Rule.php | 5 +- .../CssToInlineStyles/CssToInlineStyles.php | 9 +- .../PaymentProcessingConfirmationEmail.php | 90 ++++ .../PaymentProcessingNotificationEmail.php | 107 +++++ .../PaymentRefundedConfirmationEmail.php | 105 +++++ .../SubscriptionCancellationConfirmation.php | 99 +++++ .../SubscriptionCancellationNotification.php | 116 +++++ src/Emails/EmailServiceProvider.php | 46 +- src/Emails/EmailSubscriber.php | 180 ++++++++ src/NotificationInbox/Database/Query.php | 0 src/NotificationInbox/Database/Schema.php | 0 src/NotificationInbox/Database/Table.php | 0 src/Plugin.php | 71 ++- .../Internal/Report/LatestPaymentsReport.php | 35 +- src/Transaction/Database/Query.php | 0 src/Transaction/Database/Schema.php | 10 + src/Transaction/Database/Table.php | 20 +- src/Transaction/TransactionObserver.php | 64 ++- vendor/autoload.php | 2 +- vendor/composer/autoload_real.php | 8 +- vendor/composer/autoload_static.php | 8 +- vendor/composer/installed.json | 126 +++++- vendor/composer/installed.php | 25 +- 157 files changed, 2018 insertions(+), 3498 deletions(-) delete mode 100644 includes/core/assets/js/src/admin/help/components/panel/search-control.js delete mode 100644 includes/core/assets/js/src/admin/payment-form/template-explorer/search-control.js delete mode 100644 lib/Symfony/Component/CssSelector/Tests/CssSelectorConverterTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Node/AbstractNodeTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Node/AttributeNodeTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Node/ClassNodeTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Node/CombinedSelectorNodeTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Node/ElementNodeTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Node/FunctionNodeTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Node/HashNodeTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Node/NegationNodeTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Node/PseudoNodeTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Node/SelectorNodeTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Node/SpecificityTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Parser/Handler/AbstractHandlerTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Parser/Handler/CommentHandlerTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Parser/Handler/HashHandlerTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Parser/Handler/IdentifierHandlerTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Parser/Handler/NumberHandlerTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Parser/Handler/StringHandlerTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Parser/Handler/WhitespaceHandlerTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Parser/ParserTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Parser/ReaderTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Parser/Shortcut/ClassParserTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Parser/Shortcut/ElementParserTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Parser/Shortcut/EmptyStringParserTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Parser/Shortcut/HashParserTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/Parser/TokenStreamTest.php delete mode 100644 lib/Symfony/Component/CssSelector/Tests/XPath/Fixtures/ids.html delete mode 100644 lib/Symfony/Component/CssSelector/Tests/XPath/Fixtures/lang.xml delete mode 100644 lib/Symfony/Component/CssSelector/Tests/XPath/Fixtures/shakespear.html delete mode 100644 lib/Symfony/Component/CssSelector/Tests/XPath/TranslatorTest.php delete mode 100644 lib/Symfony/Component/CssSelector/phpunit.xml.dist create mode 100644 lib/Symfony/Polyfill/Php80/LICENSE create mode 100644 lib/Symfony/Polyfill/Php80/Php80.php create mode 100644 lib/Symfony/Polyfill/Php80/PhpToken.php create mode 100644 lib/Symfony/Polyfill/Php80/README.md create mode 100644 lib/Symfony/Polyfill/Php80/Resources/stubs/Attribute.php create mode 100644 lib/Symfony/Polyfill/Php80/Resources/stubs/PhpToken.php create mode 100644 lib/Symfony/Polyfill/Php80/Resources/stubs/Stringable.php create mode 100644 lib/Symfony/Polyfill/Php80/Resources/stubs/UnhandledMatchError.php create mode 100644 lib/Symfony/Polyfill/Php80/Resources/stubs/ValueError.php create mode 100644 lib/Symfony/Polyfill/Php80/bootstrap.php create mode 100644 lib/Symfony/Polyfill/Php80/composer.json create mode 100644 src/Emails/Email/PaymentProcessingConfirmationEmail.php create mode 100644 src/Emails/Email/PaymentProcessingNotificationEmail.php create mode 100644 src/Emails/Email/PaymentRefundedConfirmationEmail.php create mode 100644 src/Emails/Email/SubscriptionCancellationConfirmation.php create mode 100644 src/Emails/Email/SubscriptionCancellationNotification.php mode change 100644 => 100755 src/NotificationInbox/Database/Query.php mode change 100644 => 100755 src/NotificationInbox/Database/Schema.php mode change 100644 => 100755 src/NotificationInbox/Database/Table.php mode change 100644 => 100755 src/Transaction/Database/Query.php mode change 100644 => 100755 src/Transaction/Database/Schema.php mode change 100644 => 100755 src/Transaction/Database/Table.php diff --git a/includes/core/admin/class-notice-manager.php b/includes/core/admin/class-notice-manager.php index 1d5ad6b4..fbb63508 100644 --- a/includes/core/admin/class-notice-manager.php +++ b/includes/core/admin/class-notice-manager.php @@ -44,22 +44,22 @@ class Notice_Manager { */ public function __construct() { self::$core_notices = array( - 'rest_api_error' => array( + 'rest_api_error' => array( 'dismissible' => false, 'type' => 'error', 'callback' => 'SimplePay\Core\Admin\Notices\no_rest_api', ), - 'ssl_error' => array( + 'ssl_error' => array( 'dismissible' => false, 'type' => 'error', 'callback' => 'SimplePay\Core\Admin\Notices\no_ssl', ), - 'php_version_56' => array( + 'php_version_72' => array( 'dismissible' => false, 'type' => 'error', - 'callback' => 'SimplePay\Core\Admin\Notices\php_version_56', + 'callback' => 'SimplePay\Core\Admin\Notices\php_version_72', ), - 'stripe_connect' => array( + 'stripe_connect' => array( 'dismissible' => true, 'type' => 'info', 'callback' => 'SimplePay\Core\Admin\Notices\stripe_connect', @@ -217,7 +217,7 @@ public static function ajax_dismiss_notice() { return wp_send_json_error(); } - $lifespan = isset( $_POST['lifespan'] ) + $lifespan = isset( $_POST['lifespan'] ) ? sanitize_text_field( $_POST['lifespan'] ) : ''; @@ -240,7 +240,6 @@ public static function link_dismiss_notice() { ? sanitize_text_field( $_GET['simpay_dismiss_notice_nonce'] ) : false; - if ( ! current_user_can( 'manage_options' ) ) { return; } diff --git a/includes/core/admin/functions/notices.php b/includes/core/admin/functions/notices.php index 8ff564f2..4893087f 100644 --- a/includes/core/admin/functions/notices.php +++ b/includes/core/admin/functions/notices.php @@ -115,8 +115,8 @@ function stripe_connect() { * * @return string */ -function php_version_56() { - $future_required_version = 5.6; +function php_version_72() { + $future_required_version = 7.2; if ( ! version_compare( PHP_VERSION, $future_required_version, '<' ) ) { return false; @@ -129,80 +129,80 @@ function php_version_56() {

-' . $future_required_version . '', + '' . PHP_VERSION . '', + '', + '' + ) + ), + array( + 'code' => true, + 'a' => array( + 'href' => true, + 'target' => true, + 'rel' => true, ), - '' . $future_required_version . '', - '' . PHP_VERSION . '', - '', - '' ) - ), - array( - 'code' => true, - 'a' => array( - 'href' => true, - 'target' => true, - 'rel' => true, - ), - ) -); -?> + ); + ?>

-7.0, 7.1, or 7.2. On a normal WordPress site, switching to PHP %1$s should never cause issues. We would however actually recommend you switch to PHP 7.1 or higher to receive the full speed and security benefits provided to more modern and fully supported versions of PHP. However, some plugins may not be fully compatible with PHP 7.x, so more testing may be required.', - 'stripe' + __( + 'In order to be compatible with future versions of WP Simple Pay, you should update your PHP version to %1$s, 7.4, or 8.0. On a normal WordPress site, switching to PHP %1$s should never cause issues. We would however actually recommend you switch to PHP 8.0 or higher to receive the full speed and security benefits provided to more modern and fully supported versions of PHP. However, some plugins may not be fully compatible with PHP 8.x, so more testing may be required.', + 'stripe' + ), + '' . $future_required_version . '' ), - '' . $future_required_version . '' - ), - array( - 'code' => true, + array( + 'code' => true, + ) ) - ) -); -?> + ); + ?>

-', - '' - ), - array( - 'a' => array( - 'href' => true, - 'target' => true, - 'rel' => true, + __( + 'Many web hosts can give you instructions on how/where to upgrade your version of PHP through their control panel, or may even be able to do it for you. If you need to change hosts, please see %1$sour hosting recommendations%2$s.', + 'stripe' + ), + '', + '' ), + array( + 'a' => array( + 'href' => true, + 'target' => true, + 'rel' => true, + ), + ) ) - ) -); -?> + ); + ?> *{vertical-align:middle}#simpay-plugin-page-smtp .screenshot .cont{display:inline-block;position:relative;width:315px;padding:5px;background-color:#fff;box-shadow:0px 2px 5px 0px rgba(0,0,0,.05);border-radius:3px}#simpay-plugin-page-smtp .screenshot .cont img{max-width:100%;display:block}#simpay-plugin-page-smtp .screenshot .cont .hover{position:absolute;opacity:0;height:100%;width:100%;top:0;left:0;border:5px solid #fff;background-color:rgba(0,0,0,.15);background-image:url(data:image/svg+xml;base64,PHN2ZyBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjojZmZmZmZmMDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCIgaGVpZ2h0PSIxMDAiPjxwYXRoIGQ9Ik01MCAwYzI3LjYxNCAwIDUwIDIyLjM4NiA1MCA1MHMtMjIuMzg2IDUwLTUwIDUwUzAgNzcuNjE0IDAgNTAgMjIuMzg2IDAgNTAgMHoiIGZpbGw9IiMxNjg1YjciLz48cGF0aCBkPSJNNzMuMDIzIDY3LjA2N2wtOS4zNDQtOS4zNDRhMi4yNDcgMi4yNDcgMCAwMC0xLjU5My0uNjU2aC0xLjUyOGExOS4zOTkgMTkuMzk5IDAgMDA0LjEyNC0xMS45OTZjMC0xMC43Ny04LjcyNS0xOS40OTUtMTkuNDk0LTE5LjQ5NS0xMC43NjggMC0xOS40OTQgOC43MjYtMTkuNDk0IDE5LjQ5NSAwIDEwLjc2OCA4LjcyNiAxOS40OTMgMTkuNDk0IDE5LjQ5M2ExOS40IDE5LjQgMCAwMDExLjk5Ny00LjEyM3YxLjUyN2MwIC42LjIzNCAxLjE3Mi42NTUgMS41OTRsOS4zNDQgOS4zNDRhMi4yNCAyLjI0IDAgMDAzLjE3OCAwbDIuNjUyLTIuNjUzYTIuMjYgMi4yNiAwIDAwLjAxLTMuMTg2em0tMjcuODM1LTEwYy02LjYyNiAwLTExLjk5Ni01LjM2MS0xMS45OTYtMTEuOTk2IDAtNi42MjcgNS4zNi0xMS45OTcgMTEuOTk2LTExLjk5NyA2LjYyNiAwIDExLjk5NyA1LjM2MSAxMS45OTcgMTEuOTk3IDAgNi42MjYtNS4zNjEgMTEuOTk2LTExLjk5NyAxMS45OTZ6IiBmaWxsPSIjZmZmIi8+PC9zdmc+);background-repeat:no-repeat;background-position:center;background-size:50px;transition:all .3s}#simpay-plugin-page-smtp .screenshot .cont:hover .hover{opacity:1;transition:all .3s}#simpay-plugin-page-smtp .screenshot ul{display:inline-block;margin:0 0 0 30px;list-style-type:none;max-width:calc(100% - 350px)}#simpay-plugin-page-smtp .screenshot li{margin:16px 0;padding:0 0 0 24px;font-size:15px;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEzLjc3NjIgNi40NTYwNUw4LjcyMDMyIDEuNDAwMDVDOC41NzU5OSAxLjI1NTcyIDguMzgzNjQgMS4xNzY1IDguMTc4NTMgMS4xNzY1QzcuOTczMiAxLjE3NjUgNy43ODA5NiAxLjI1NTg0IDcuNjM2NjQgMS40MDAwNUw3LjE3NzYgMS44NTkyQzcuMDMzMzkgMi4wMDMyOSA2Ljk1Mzk1IDIuMTk1NzYgNi45NTM5NSAyLjQwMDk4QzYuOTUzOTUgMi42MDYwOCA3LjAzMzM5IDIuODA1MDQgNy4xNzc2IDIuOTQ5MTRMMTAuMTI3MSA1LjkwNTE2SDAuNzU2MzM0QzAuMzMzODM0IDUuOTA1MTYgMCA2LjIzNTkyIDAgNi42NTg1NFY3LjMwNzY1QzAgNy43MzAyNyAwLjMzMzgzNCA4LjA5NDM4IDAuNzU2MzM0IDguMDk0MzhIMTAuMTYwNkw3LjE3NzcyIDExLjA2NjlDNy4wMzM1MSAxMS4yMTEyIDYuOTU0MDYgMTEuMzk4NSA2Ljk1NDA2IDExLjYwMzdDNi45NTQwNiAxMS44MDg3IDcuMDMzNTEgMTEuOTk4NiA3LjE3NzcyIDEyLjE0MjhMNy42MzY3NSAxMi42MDA1QzcuNzgxMDcgMTIuNzQ0OCA3Ljk3MzMyIDEyLjgyMzUgOC4xNzg2NSAxMi44MjM1QzguMzgzNzUgMTIuODIzNSA4LjU3NjExIDEyLjc0MzggOC43MjA0MyAxMi41OTk1TDEzLjc3NjMgNy41NDM2QzEzLjkyMSA3LjM5ODgyIDE0LjAwMDUgNy4yMDU1NiAxNCA3LjAwMDExQzE0LjAwMDQgNi43OTM5OCAxMy45MjEgNi42MDA2IDEzLjc3NjIgNi40NTYwNVY2LjQ1NjA1WiIgZmlsbD0iIzQyOEJDQSIvPgo8L3N2Zz4K);background-position:left 3px;background-repeat:no-repeat;background-size:14px;color:#777}#simpay-plugin-page-smtp .step{background-color:#f9f9f9;box-shadow:0px 2px 5px 0px rgba(0,0,0,.05);border:1px solid #e5e5e5;margin:0 0 25px 0}#simpay-plugin-page-smtp .step>*{vertical-align:middle}#simpay-plugin-page-smtp .step .num{display:inline-block;position:relative;width:100px;height:50px;text-align:center}#simpay-plugin-page-smtp .step .loader{margin-top:-54px;transition:all .3s;opacity:1}#simpay-plugin-page-smtp .step div{display:inline-block;width:calc(100% - 104px);background-color:#fff;padding:30px;border-left:1px solid #eee}#simpay-plugin-page-smtp .step h2{font-size:24px;line-height:22px;margin-top:0;margin-bottom:15px}#simpay-plugin-page-smtp .step p{font-size:16px;color:#777}#simpay-plugin-page-smtp .step .error{font-size:14px;color:#b97474;margin-bottom:0}#simpay-plugin-page-smtp .step .link{text-decoration:none}#simpay-plugin-page-smtp .step .button{font-weight:500;box-shadow:none;padding:12px;min-width:200px;height:auto;line-height:13px;text-align:center;font-size:15px;transition:all .3s}#simpay-plugin-page-smtp .step .button.grey{background:#f6f6f6;border:1px solid #ddd;text-shadow:none;color:#9fa5aa}#simpay-plugin-page-smtp .step .button.disabled{cursor:default}#simpay-plugin-page-smtp .step .hidden{opacity:0;transition:all .3s}#simpay-plugin-page-smtp .grey{opacity:.5}@media(max-width: 767px){#simpay-admin-smtp{width:auto;margin:0 20px}#simpay-admin-smtp .screenshot .cont{width:auto}#simpay-admin-smtp .screenshot ul{margin:20px 0 0 15px;max-width:100%}#simpay-admin-smtp .button{white-space:normal}} +.lity,.lity-container{transition:opacity .5s ease}.lity-active,.lity-active body{overflow:initial}#wpbody-content .notice,#wpbody-content .update-nag{display:none !important}.simpay-plugin-page .notice{display:none !important}.simpay-plugin-page .loader{margin:0 auto;position:relative;text-indent:-9999em;border-top:4px solid #969696;border-right:4px solid #969696;border-bottom:4px solid #969696;border-left:4px solid #404040;transform:translateZ(0);animation:load8 1.1s infinite linear;background-color:rgba(0,0,0,0)}.simpay-plugin-page .loader,.simpay-plugin-page .loader:after{display:block;border-radius:50%;width:50px;height:50px}@keyframes load8{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}#simpay-plugin-page-smtp{width:700px;margin:0 auto}#simpay-plugin-page-smtp *,#simpay-plugin-page-smtp *::before,#simpay-plugin-page-smtp *::after{box-sizing:border-box}#simpay-plugin-page-smtp section{margin:50px 0;text-align:left;clear:both}#simpay-plugin-page-smtp p{font-size:15px}#simpay-plugin-page-smtp .top{text-align:center}#simpay-plugin-page-smtp .top img{margin-bottom:38px}#simpay-plugin-page-smtp .top h1{font-size:26px;font-weight:600;margin-bottom:0;padding:0}#simpay-plugin-page-smtp .top p{font-size:17px;color:#777;margin-top:.5em}#simpay-plugin-page-smtp .top .updated{display:none}#simpay-plugin-page-smtp .screenshot>*{vertical-align:middle}#simpay-plugin-page-smtp .screenshot .cont{display:inline-block;position:relative;width:315px;padding:5px;background-color:#fff;box-shadow:0px 2px 5px 0px rgba(0,0,0,.05);border-radius:3px}#simpay-plugin-page-smtp .screenshot .cont img{max-width:100%;display:block}#simpay-plugin-page-smtp .screenshot .cont .hover{position:absolute;opacity:0;height:100%;width:100%;top:0;left:0;border:5px solid #fff;background-color:rgba(0,0,0,.15);background-image:url(data:image/svg+xml;base64,PHN2ZyBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjojZmZmZmZmMDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCIgaGVpZ2h0PSIxMDAiPjxwYXRoIGQ9Ik01MCAwYzI3LjYxNCAwIDUwIDIyLjM4NiA1MCA1MHMtMjIuMzg2IDUwLTUwIDUwUzAgNzcuNjE0IDAgNTAgMjIuMzg2IDAgNTAgMHoiIGZpbGw9IiMxNjg1YjciLz48cGF0aCBkPSJNNzMuMDIzIDY3LjA2N2wtOS4zNDQtOS4zNDRhMi4yNDcgMi4yNDcgMCAwMC0xLjU5My0uNjU2aC0xLjUyOGExOS4zOTkgMTkuMzk5IDAgMDA0LjEyNC0xMS45OTZjMC0xMC43Ny04LjcyNS0xOS40OTUtMTkuNDk0LTE5LjQ5NS0xMC43NjggMC0xOS40OTQgOC43MjYtMTkuNDk0IDE5LjQ5NSAwIDEwLjc2OCA4LjcyNiAxOS40OTMgMTkuNDk0IDE5LjQ5M2ExOS40IDE5LjQgMCAwMDExLjk5Ny00LjEyM3YxLjUyN2MwIC42LjIzNCAxLjE3Mi42NTUgMS41OTRsOS4zNDQgOS4zNDRhMi4yNCAyLjI0IDAgMDAzLjE3OCAwbDIuNjUyLTIuNjUzYTIuMjYgMi4yNiAwIDAwLjAxLTMuMTg2em0tMjcuODM1LTEwYy02LjYyNiAwLTExLjk5Ni01LjM2MS0xMS45OTYtMTEuOTk2IDAtNi42MjcgNS4zNi0xMS45OTcgMTEuOTk2LTExLjk5NyA2LjYyNiAwIDExLjk5NyA1LjM2MSAxMS45OTcgMTEuOTk3IDAgNi42MjYtNS4zNjEgMTEuOTk2LTExLjk5NyAxMS45OTZ6IiBmaWxsPSIjZmZmIi8+PC9zdmc+);background-repeat:no-repeat;background-position:center;background-size:50px;transition:all .3s}#simpay-plugin-page-smtp .screenshot .cont:hover .hover{opacity:1;transition:all .3s}#simpay-plugin-page-smtp .screenshot ul{display:inline-block;margin:0 0 0 30px;list-style-type:none;max-width:calc(100% - 350px)}#simpay-plugin-page-smtp .screenshot li{margin:16px 0;padding:0 0 0 24px;font-size:15px;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGQ9Ik0xMy43NzYyIDYuNDU2MDVMOC43MjAzMiAxLjQwMDA1QzguNTc1OTkgMS4yNTU3MiA4LjM4MzY0IDEuMTc2NSA4LjE3ODUzIDEuMTc2NUM3Ljk3MzIgMS4xNzY1IDcuNzgwOTYgMS4yNTU4NCA3LjYzNjY0IDEuNDAwMDVMNy4xNzc2IDEuODU5MkM3LjAzMzM5IDIuMDAzMjkgNi45NTM5NSAyLjE5NTc2IDYuOTUzOTUgMi40MDA5OEM2Ljk1Mzk1IDIuNjA2MDggNy4wMzMzOSAyLjgwNTA0IDcuMTc3NiAyLjk0OTE0TDEwLjEyNzEgNS45MDUxNkgwLjc1NjMzNEMwLjMzMzgzNCA1LjkwNTE2IDAgNi4yMzU5MiAwIDYuNjU4NTRWNy4zMDc2NUMwIDcuNzMwMjcgMC4zMzM4MzQgOC4wOTQzOCAwLjc1NjMzNCA4LjA5NDM4SDEwLjE2MDZMNy4xNzc3MiAxMS4wNjY5QzcuMDMzNTEgMTEuMjExMiA2Ljk1NDA2IDExLjM5ODUgNi45NTQwNiAxMS42MDM3QzYuOTU0MDYgMTEuODA4NyA3LjAzMzUxIDExLjk5ODYgNy4xNzc3MiAxMi4xNDI4TDcuNjM2NzUgMTIuNjAwNUM3Ljc4MTA3IDEyLjc0NDggNy45NzMzMiAxMi44MjM1IDguMTc4NjUgMTIuODIzNUM4LjM4Mzc1IDEyLjgyMzUgOC41NzYxMSAxMi43NDM4IDguNzIwNDMgMTIuNTk5NUwxMy43NzYzIDcuNTQzNkMxMy45MjEgNy4zOTg4MiAxNC4wMDA1IDcuMjA1NTYgMTQgNy4wMDAxMUMxNC4wMDA0IDYuNzkzOTggMTMuOTIxIDYuNjAwNiAxMy43NzYyIDYuNDU2MDVWNi40NTYwNVoiIGZpbGw9IiM0MjhCQ0EiLz4NCjwvc3ZnPg0K);background-position:left 3px;background-repeat:no-repeat;background-size:14px;color:#777}#simpay-plugin-page-smtp .step{background-color:#f9f9f9;box-shadow:0px 2px 5px 0px rgba(0,0,0,.05);border:1px solid #e5e5e5;margin:0 0 25px 0}#simpay-plugin-page-smtp .step>*{vertical-align:middle}#simpay-plugin-page-smtp .step .num{display:inline-block;position:relative;width:100px;height:50px;text-align:center}#simpay-plugin-page-smtp .step .loader{margin-top:-54px;transition:all .3s;opacity:1}#simpay-plugin-page-smtp .step div{display:inline-block;width:calc(100% - 104px);background-color:#fff;padding:30px;border-left:1px solid #eee}#simpay-plugin-page-smtp .step h2{font-size:24px;line-height:22px;margin-top:0;margin-bottom:15px}#simpay-plugin-page-smtp .step p{font-size:16px;color:#777}#simpay-plugin-page-smtp .step .error{font-size:14px;color:#b97474;margin-bottom:0}#simpay-plugin-page-smtp .step .link{text-decoration:none}#simpay-plugin-page-smtp .step .button{font-weight:500;box-shadow:none;padding:12px;min-width:200px;height:auto;line-height:13px;text-align:center;font-size:15px;transition:all .3s}#simpay-plugin-page-smtp .step .button.grey{background:#f6f6f6;border:1px solid #ddd;text-shadow:none;color:#9fa5aa}#simpay-plugin-page-smtp .step .button.disabled{cursor:default}#simpay-plugin-page-smtp .step .hidden{opacity:0;transition:all .3s}#simpay-plugin-page-smtp .grey{opacity:.5}@media(max-width: 767px){#simpay-admin-smtp{width:auto;margin:0 20px}#simpay-admin-smtp .screenshot .cont{width:auto}#simpay-admin-smtp .screenshot ul{margin:20px 0 0 15px;max-width:100%}#simpay-admin-smtp .button{white-space:normal}} diff --git a/includes/core/assets/css/simpay-admin.min.css b/includes/core/assets/css/simpay-admin.min.css index a92fba0f..77c3dbb9 100644 --- a/includes/core/assets/css/simpay-admin.min.css +++ b/includes/core/assets/css/simpay-admin.min.css @@ -1 +1 @@ -.simpay-settings-subsections{display:flex;align-items:center;box-shadow:inset 0 -1px 0 0 #ccc}.simpay-settings-subsections__subsection{font-weight:500;text-decoration:none;padding:15px;display:flex;align-items:center}.simpay-settings-subsections__subsection .dashicons{width:18px;height:18px;font-size:18px;margin-right:4px}.simpay-settings-subsections__subsection.is-active{box-shadow:inset 0 -4px 0 0 currentColor;position:relative;z-index:1}.simpay-settings-subsections__subsection:not(.is-active){color:#23282d}.simpay-settings form>h2:not(.nav-tab-wrapper){clip:rect(1px, 1px, 1px, 1px);height:1px;overflow:hidden;position:absolute !important;width:1px}.simpay-settings .form-table td fieldset+p,.simpay-settings .form-table td label+p,.simpay-settings .form-table td select+p,.simpay-settings .form-table td input+p{color:#666;font-style:italic}.simpay-settings .simpay-settings-subsections__subsection{display:flex;align-items:center}.simpay-settings .simpay-settings-subsections__subsection .simpay-settings-bubble{margin-left:5px}.simpay-settings .simpay-settings-visual-toggles{margin:30px 0 0;display:flex}.simpay-settings .simpay-settings-visual-toggles input[type=radio]{display:none}.simpay-settings .simpay-settings-visual-toggles__toggle{-webkit-user-select:none;-moz-user-select:none;user-select:none;min-width:180px;margin:0 30px 0 0 !important;position:relative;display:block;background-color:#fff;border-radius:4px;border:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04)}.simpay-settings .simpay-settings-visual-toggles__toggle:hover{border:1px solid #999;box-shadow:0 1px 2px rgba(0,0,0,.1)}.simpay-settings .simpay-settings-visual-toggles input[type=radio]:checked+.simpay-settings-visual-toggles__toggle{border-color:#007cba;border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px #007cba;box-shadow:0 0 0 1px var(--wp-admin-theme-color)}.simpay-settings .simpay-settings-visual-toggles__toggle-recommended,.simpay-settings .simpay-settings-visual-toggles__toggle-not-recommended{text-align:center;font-size:12px;text-transform:uppercase;font-weight:bold;margin:0;padding:5px 0;display:block;border-top-right-radius:4px;border-top-left-radius:4px}.simpay-settings .simpay-settings-visual-toggles__toggle-recommended{color:#0f8569;background:#f4f9f7}.simpay-settings .simpay-settings-visual-toggles__toggle-not-recommended{color:#b91c1b;background:#fef2f2}.simpay-settings .simpay-settings-visual-toggles__toggle-icon{margin:20px auto 15px;padding:0 15px;display:block}.simpay-settings .simpay-settings-visual-toggles__toggle-label{line-height:1.5;text-align:center;font-size:16px;font-weight:500;margin:15px;display:block}.simpay-settings .simpay-settings-visual-toggles__toggle-label small{color:#666;font-weight:normal;font-size:13px;line-height:1;display:block;margin:4px 0}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type .simpay-settings-visual-toggles__toggle{min-height:160px}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type .simpay-settings-visual-toggles__toggle-icon{width:80px;height:80px}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type input[type=radio].simpay-settings-captcha-type--is-recommended:checked+.simpay-settings-visual-toggles__toggle{border-color:#0f8569;box-shadow:0 0 0 1px #0f8569}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type input[type=radio].simpay-settings-captcha-type--is-not-recommended:checked+.simpay-settings-visual-toggles__toggle{border-color:#b91c1b;box-shadow:0 0 0 1px #b91c1b}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type label[for=simpay-settings-captcha-type-cloudflare-turnstile] .simpay-settings-visual-toggles__toggle-icon{width:120px}.simpay-settings-general-recaptcha-no_captcha_warning th,.simpay-settings-general-recaptcha-no_captcha_warning td,.simpay-settings-hcaptcha_secret_key th,.simpay-settings-hcaptcha_secret_key td,.simpay-settings-cloudflare_turnstile_secret_key th,.simpay-settings-cloudflare_turnstile_secret_key td,.simpay-settings-recaptcha_score_threshold th,.simpay-settings-recaptcha_score_threshold td{padding-bottom:50px !important}.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-summary-report,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-payment-confirmation,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-payment-notification,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-upcoming-invoice,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-manage-subscriptions,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-invoice-confirmation{display:none}.simpay-settings .simpay-settings-subsection-emails-tools{margin-left:auto}.simpay-admin-charts-period-over-period{position:relative;padding-bottom:12px}.simpay-admin-charts-period-over-period *{box-sizing:border-box}.simpay-admin-charts-period-over-period__tooltip{position:absolute;background:#fff;border:1px solid #c3c3c3;box-shadow:0 2px 6px rgba(0,0,0,.05);border-radius:2px;padding:10px 14px;display:flex;flex-direction:column;z-Index:10000;min-width:175px}.simpay-admin-charts-period-over-period__tooltip-data{white-space:nowrap;margin-bottom:8px;display:grid;grid-template-columns:1fr auto;grid-auto-rows:auto;-moz-column-gap:16px;column-gap:16px}.simpay-admin-charts-period-over-period__tooltip-data:last-child{margin-bottom:0}.simpay-admin-charts-period-over-period__tooltip-data[data-dataset="1"]{opacity:.65}.simpay-admin-charts-period-over-period__tooltip-data em{font-style:normal;text-align:right}.simpay-admin-charts-period-over-period__tooltip-delta{font-size:12px;margin:0 -14px -10px;padding:8px 14px;border-top:1px solid #eee;background:#fdfdfd;border-radius:2px;display:flex;align-items:center;justify-content:center}.simpay-admin-charts-period-over-period__tooltip-delta .simpay-admin-charts-badge{margin-right:4px}.simpay-admin-charts-period-over-period__tooltip-delta strong.is-positive{color:#006908}.simpay-admin-charts-period-over-period__tooltip-delta strong.is-negative{color:#b3093c}.simpay-admin-charts-badge{color:#2f2f2f;font-size:12px;font-weight:500;font-style:normal;line-height:1;padding:3px 6px;display:inline-flex;align-items:center;background:#f0f0f0;border-radius:100px}.simpay-admin-charts-badge.is-positive{color:#006908;background-color:#d7f7c2}.simpay-admin-charts-badge.is-negative{color:#b3093c;background-color:#ffe7f2}.simpay-admin-charts-badge__icon{width:15px;height:15px}.simpay-admin-charts-no-data{position:absolute;top:0;left:0;display:flex;justify-content:center;align-items:center;background:rgba(255,255,255,.5);z-index:2}.simpay-admin-charts-no-data>div{text-align:center;padding:24px;background:#fff;border:1px solid #c3c3c3;box-shadow:0 2px 6px rgba(0,0,0,.1);border-radius:2px;max-width:60%}.simpay-admin-charts-no-data strong{font-size:15px;margin-bottom:8px;display:block}.button.button-large.simpay-button-large{font-size:14px;line-height:30px;padding:4px 12px}.simpay-copy-hidden-input{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}.fixed .column-livemode{width:15%;text-align:right}@media screen and (max-width: 782px){.fixed .column-livemode{text-align:left}}.fixed .column-livemode .simpay-badge{margin-top:3px}.fixed .column-shortcode{width:25%}.fixed .column-shortcode .simpay-shortcode{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}.post-type-simple-pay .misc-pub-curtime,.post-type-simple-pay .misc-pub-visibility{display:none}.simpay-metabox-title{border:1px solid #eee}.simpay-shortcode-section{border-top:1px solid #ddd;border-width:1px 0;padding-top:15px;padding-bottom:15px;position:relative}.simpay-shortcode-section label{display:block;margin-bottom:6px}.simpay-shortcode-section label .dashicons{color:#8c8f94;margin-right:3px}.simpay-shortcode-section .simpay-copy-button{line-height:normal;position:absolute;right:20px;bottom:20px;border:0;background:none;box-shadow:none;padding:0}.simpay-shortcode-section .simpay-copy-button:hover{border:0;background:none;box-shadow:none}.simpay-shortcode-section .simpay-copy-button .dashicons{color:#3c434a}.simpay-shortcode{width:100%;padding:8px;line-height:1;margin:0;height:32px;resize:none}.simpay-badge{color:#3f3f46;text-align:center;line-height:1;padding:5px 7px;border-radius:3px;background:#e4e4e7;border:0;box-shadow:none;display:inline-flex;align-items:center}button.simpay-badge{cursor:pointer}button.simpay-badge:hover{background:#d4d4d8}.simpay-badge__icon{opacity:.8;margin:2px 5px 0 0}.simpay-badge--green{color:#0e6245;background:#cbf4c9}.simpay-badge--yellow{color:#983705;background:#f8e5b9}.simpay-stripe-account-info{display:flex;align-items:center;margin-bottom:8px;position:relative}.simpay-stripe-account-info .spinner{float:none;margin-top:0;margin-left:0}.simple-pay_page_simpay_settings .simpay-settings-upgrade,.post-type-simple-pay .simpay-settings-upgrade{margin-top:20px;padding:1px;position:relative;background:#fff;border-radius:4px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.2),0 5px 10px rgba(0,0,0,.1);max-width:677px}.simple-pay_page_simpay_settings .simpay-settings-upgrade__inner,.post-type-simple-pay .simpay-settings-upgrade__inner{text-align:center;margin:0;padding:30px}.simple-pay_page_simpay_settings .simpay-settings-upgrade h3,.post-type-simple-pay .simpay-settings-upgrade h3{line-height:1.5;font-size:22px;margin:0 0 1.5rem}.simple-pay_page_simpay_settings .simpay-settings-upgrade ul,.post-type-simple-pay .simpay-settings-upgrade ul{margin:1.5rem 0 calc(1.5rem - 6px);display:flex;flex-wrap:wrap;justify-content:center}@media screen and (min-width: 782px){.simple-pay_page_simpay_settings .simpay-settings-upgrade ul,.post-type-simple-pay .simpay-settings-upgrade ul{margin-left:4rem;margin-right:4rem}}.simple-pay_page_simpay_settings .simpay-settings-upgrade li,.post-type-simple-pay .simpay-settings-upgrade li{font-size:15px;margin:6px 0;width:100%}.simple-pay_page_simpay_settings .simpay-settings-upgrade li a,.post-type-simple-pay .simpay-settings-upgrade li a{color:#3c434a;text-decoration:none}.simple-pay_page_simpay_settings .simpay-settings-upgrade li a:hover,.post-type-simple-pay .simpay-settings-upgrade li a:hover{color:var(--wp-admin-theme-color);text-decoration:underline}@media screen and (min-width: 782px){.simple-pay_page_simpay_settings .simpay-settings-upgrade li,.post-type-simple-pay .simpay-settings-upgrade li{text-align:left;width:50%}}.simple-pay_page_simpay_settings .simpay-settings-upgrade .button.button-large,.post-type-simple-pay .simpay-settings-upgrade .button.button-large{font-size:17px;line-height:30px;padding:10px 20px}.simple-pay_page_simpay_settings .simpay-settings-upgrade small,.post-type-simple-pay .simpay-settings-upgrade small{color:#666;margin:15px 0 0;display:block}.simple-pay_page_simpay_settings .simpay-settings-upgrade .dashicons-yes,.post-type-simple-pay .simpay-settings-upgrade .dashicons-yes{color:#428bca}.simple-pay_page_simpay_settings .simpay-settings-upgrade .button-link,.post-type-simple-pay .simpay-settings-upgrade .button-link{position:absolute;top:0;right:0;font-size:20px;color:#666;font-weight:bold;text-decoration:none;margin-left:5px;padding:6px 10px;z-index:2}.simple-pay_page_simpay_settings .simpay-settings-upgrade .button-link:hover,.simple-pay_page_simpay_settings .simpay-settings-upgrade .button-link:active,.simple-pay_page_simpay_settings .simpay-settings-upgrade .button-link:focus,.post-type-simple-pay .simpay-settings-upgrade .button-link:hover,.post-type-simple-pay .simpay-settings-upgrade .button-link:active,.post-type-simple-pay .simpay-settings-upgrade .button-link:focus{color:#666;text-decoration:none}.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext{text-align:center;margin:0;padding:30px 20px 20px;background-color:#fcf9e8;border:1px solid #edeac9;border-width:1px 0 0;position:relative;border-radius:0;border-bottom-left-radius:4px;border-bottom-right-radius:4px}@media screen and (min-width: 782px){.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext{padding-left:4rem;padding-right:4rem}}.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext svg,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext svg{background:#00a32a;fill:#fff;border-radius:50%;border:4px solid #fff;box-shadow:0 0 0 1px #edeac9;width:28px;height:28px;position:absolute;top:-18px;left:50%;margin-left:-18px}.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext u,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext u{text-decoration:none;font-weight:bold;color:#00a32a}.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext a,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext a{font-weight:normal;display:inline-block}#simpay-payment-form-settings table{width:100%;border-collapse:collapse}#simpay-payment-form-settings ::-webkit-input-placeholder{color:#9ba1a9}#simpay-payment-form-settings ::-moz-placeholder{color:#9ba1a9;opacity:1}#simpay-payment-form-settings :-ms-input-placeholder{color:#9ba1a9}#simpay-payment-form-settings .inside{margin:0;padding:0}#simpay-payment-form-settings .simpay-panel-field .toolbar{margin-bottom:-4px}#simpay-payment-form-settings .simpay-panel-field .toolbar .simpay-field-select{margin:0 0 4px;width:auto;max-width:70%}#simpay-payment-form-settings .simpay-tabs{margin:0;padding:0;list-style:none;background:#fafafa;border-right:1px solid #ccd0d4;line-height:1em;position:relative;flex:0 0 25%}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-tabs{flex-basis:100%;flex-grow:1;border-right:0}}#simpay-payment-form-settings .simpay-tabs li{margin:0;padding:0}#simpay-payment-form-settings .simpay-tabs li:first-child{margin-top:12px}#simpay-payment-form-settings .simpay-tabs li:last-child{margin-bottom:20px}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-tabs li:last-child{margin-bottom:0}}#simpay-payment-form-settings .simpay-tabs li.active{margin-left:-1px;box-shadow:0 1px 1px rgba(0,0,0,.04);position:relative}#simpay-payment-form-settings .simpay-tabs li.active:focus:after{display:none}#simpay-payment-form-settings .simpay-tabs li.active:before,#simpay-payment-form-settings .simpay-tabs li.active:after{content:"";width:calc(100% + 1px);height:1px;background:#ccd0d4;position:absolute;top:0;left:0;right:0;z-index:2}#simpay-payment-form-settings .simpay-tabs li.active:after{top:auto;bottom:0}#simpay-payment-form-settings .simpay-tabs li.active a{font-weight:bold;background-color:#fff;position:relative;margin-right:-1px}#simpay-payment-form-settings .simpay-tabs li.active a:before{content:"";position:absolute;top:0;left:0;bottom:0;width:4px;height:100%;background:currentColor;z-index:3}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-tabs li.active a{margin-right:0}}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item{display:flex;align-items:center;line-height:20px;margin:0;padding:8px 10px 8px 14px;text-decoration:none;transition:all .05s ease-in-out}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item svg,#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item .dashicons{margin-right:6px}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item{padding:18px}}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item:focus{outline:0;position:relative;z-index:3;box-shadow:inset 0 0 0 1px currentColor,0 0 0 1px currentColor}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item[href="#purchase-restrictions-settings-panel"],#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item[href="#payment-page-settings-panel"]{margin-bottom:20px;position:relative}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item[href="#purchase-restrictions-settings-panel"]:after,#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item[href="#payment-page-settings-panel"]:after{content:"";position:absolute;left:14px;right:14px;bottom:-10px;width:calc(100% - 28px);height:1px;background:#eaeaea}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item span>span{color:#f18500;font-size:12px;font-weight:600;margin:0 0 0 5px;display:inline-block}#simpay-payment-form-settings .simpay-tabs li:not(.active) .simpay-tab-item{color:inherit}#simpay-payment-form-settings .simpay-panels-wrap{background:#fff;display:flex}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-panels-wrap{flex-direction:column}}#simpay-payment-form-settings .simpay-panels{flex:0 0 75%;display:flex}@media screen and (min-width: 1400px){#simpay-payment-form-settings .simpay-panels{flex-basis:75%}}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-panels{flex-basis:100%}}#simpay-payment-form-settings .simpay-panel,#simpay-payment-form-settings .simpay-panel-section{width:100%}#simpay-payment-form-settings .simpay-panel>table,#simpay-payment-form-settings .simpay-panel>table>tr,#simpay-payment-form-settings .simpay-panel>table>tbody,#simpay-payment-form-settings .simpay-panel>table>tbody>tr,#simpay-payment-form-settings .simpay-panel>table>thead,#simpay-payment-form-settings .simpay-panel>table>thead>tr{display:block;width:100%}#simpay-payment-form-settings .simpay-panel>table:last-child>tbody:last-child>tr:last-child>td{border-bottom:0}#simpay-payment-form-settings .simpay-panel-field--requires-upgrade{position:relative}#simpay-payment-form-settings .simpay-panel-field--requires-upgrade td>div{margin-right:80px}#simpay-payment-form-settings .simpay-panel-field--requires-upgrade td>div .button-small{position:absolute;top:calc(50% - 13px);right:18px}#simpay-payment-form-settings .simpay-panel-field,#simpay-payment-form-settings .simpay-panel-field>td,#simpay-payment-form-settings .simpay-panel-field>th{text-align:left;display:block}#simpay-payment-form-settings .simpay-panel-field>td,#simpay-payment-form-settings .simpay-panel-field>th{width:calc(100% - 36px);margin-left:18px;margin-right:18px}#simpay-payment-form-settings .simpay-panel-field th{font-weight:bold;padding-top:18px;padding-bottom:5px}#simpay-payment-form-settings .simpay-panel-field td{border-bottom:1px solid #ddd;padding-bottom:18px}#simpay-payment-form-settings .simpay-panel-field p.description{margin-top:4px}#simpay-payment-form-settings .simpay-panel-field p.description:last-of-type{margin-bottom:0}#simpay-payment-form-settings .simpay-panel-field .simpay-panel-field__nested{margin-top:18px}#simpay-payment-form-settings .simpay-panel-field .simpay-panel-field__nested label{font-weight:bold;display:block;margin-bottom:4px}#simpay-payment-form-settings .simpay-panel-field .simpay-field-select,#simpay-payment-form-settings .simpay-panel-field .simpay-field-text{min-width:75%;max-width:100%}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-panel-field .simpay-field-select,#simpay-payment-form-settings .simpay-panel-field .simpay-field-text{min-width:0;width:100%}}#simpay-payment-form-settings .simpay-panel-field .simpay-field-textarea{width:100%;max-width:100%}#simpay-payment-form-settings .simpay-panel-field .notice:last-of-type{margin-bottom:0}#simpay-payment-form-settings .simpay-panel-field .error,#simpay-payment-form-settings .simpay-panel-field .simpay-important{color:#a94442;font-weight:normal}#simpay-payment-form-settings .simpay-panel-field .simpay-image-preview-wrap{position:relative;margin-top:12px}#simpay-payment-form-settings .simpay-panel-field .simpay-image-preview-wrap .simpay-remove-image-preview{position:absolute;top:-15px;left:-15px;cursor:pointer;background-color:#fff}#simpay-payment-form-settings .simpay-panel-field .simpay-image-preview-wrap .simpay-remove-image-preview::before{font-size:22px;line-height:26px}#simpay-payment-form-settings .simpay-panel-field .simpay-image-preview-wrap .simpay-image-preview{max-height:128px;max-width:128px;border:1px solid #ddd}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box{background-color:#f4f4f4;border:1px solid #e5e5e5;padding:18px;margin-top:18px;position:relative}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box__dismiss{color:inherit;text-decoration:none;position:absolute;top:8px;right:8px}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box__dismiss .dashicons-dismiss{font-size:16px;width:16px;height:16px}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box h3{font-size:18px;font-weight:600;margin:0;padding:0}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box p{font-size:14px}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box p:last-child{margin-bottom:0}#simpay-payment-form-settings .simpay-metabox-content{margin-bottom:-1px;background-color:#f5f5f5;border:1px solid #c3c4c7;border-width:1px 0;box-shadow:0 1px 1px rgba(0,0,0,.04);position:relative}#simpay-payment-form-settings .simpay-show-if,#simpay-payment-form-settings .simpay-panel-hidden{display:none}#simpay-payment-form-settings .simpay-payment-methods{border:1px solid #ccd0d4;border-radius:4px;box-shadow:0 1px 1px rgba(0,0,0,.04)}#simpay-payment-form-settings .simpay-panel-field-payment-method{display:block;border-top:1px solid #ccd0d4;padding:7px;box-sizing:border-box}#simpay-payment-form-settings .simpay-panel-field-payment-method:first-child{border-top:0;border-top-left-radius:4px;border-top-right-radius:4px}#simpay-payment-form-settings .simpay-panel-field-payment-method__enable{display:flex;align-items:center}#simpay-payment-form-settings .simpay-panel-field-payment-method__enable input[type=checkbox]{margin-top:0;margin-right:8px}#simpay-payment-form-settings .simpay-panel-field-payment-method__help{text-decoration:none}#simpay-payment-form-settings .simpay-panel-field-payment-method__help .dashicons{font-size:18px;width:18px;height:18px}#simpay-payment-form-settings .simpay-panel-field-payment-method__restrictions,#simpay-payment-form-settings .simpay-panel-field-payment-method__restrictions-ach{margin-left:72px}#simpay-payment-form-settings .simpay-panel-field-payment-method__icon{border-radius:3px;overflow:hidden;margin:0 8px 0 5px;width:30px;height:30px;flex-shrink:0}#simpay-payment-form-settings .simpay-panel-field-payment-method__icon svg{width:30px;height:30px}#simpay-payment-form-settings .simpay-panel-field-payment-method__configure{display:flex;align-items:center;justify-content:center}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metaboxes:not(.is-empty),#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metaboxes:not(.is-empty){border:1px solid #ccd0d4;box-shadow:0 1px 1px rgba(0,0,0,.04);border-radius:4px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-handlediv,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-handlediv{display:none;float:right;width:36px;height:36px;margin:0;padding:0;border:0;background:none;cursor:pointer;display:block}#simpay-global-settings .simpay-metaboxes-wrapper .postbox.closed .simpay-handlediv .toggle-indicator:before,#simpay-form-settings .simpay-metaboxes-wrapper .postbox.closed .simpay-handlediv .toggle-indicator:before{content:""}#simpay-global-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv:focus,#simpay-form-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv:focus{outline:0}#simpay-global-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv:focus .toggle-indicator:before,#simpay-form-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv:focus .toggle-indicator:before{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}#simpay-global-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv .toggle-indicator:before,#simpay-form-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv .toggle-indicator:before{margin-top:4px;width:20px;border-radius:50%;text-indent:-1px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox{background:#fff;border:1px solid #ccd0d4;margin:0 -1px -1px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .hndle,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .hndle{border:0}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox select,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox select{font-weight:400}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox:first-of-type,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox:first-of-type{margin-top:-1px;border-top-left-radius:4px;border-top-right-radius:4px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox:last-of-type,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox:last-of-type{margin-bottom:-1px;border-bottom-left-radius:4px;border-bottom-right-radius:4px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox:last-of-type .simpay-metabox-content,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox:last-of-type .simpay-metabox-content{border-bottom-left-radius:4px;border-bottom-right-radius:4px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2{cursor:pointer;display:flex;align-items:center;padding:10px 0 10px 12px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .simpay-field-type,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .simpay-field-type{font-size:90%;color:gray;font-weight:normal;text-decoration:none;margin-left:10px}@media screen and (max-width: 782px){#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .simpay-field-type,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .simpay-field-type{display:none}}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .dashicons-handle,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .dashicons-handle{cursor:move}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 strong,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 strong{font-size:95%;margin-left:8px;display:flex;align-items:center;flex-grow:1}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 svg,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 svg{border-radius:3px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 select,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 select{font-family:sans-serif;max-width:20%;margin:.25em .25em .25em 0}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2.fixed,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2.fixed{cursor:pointer !important}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .dashicons-menu,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .dashicons-menu{cursor:move}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions{padding:9px 18px;justify-content:space-between;display:flex;align-items:center}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id{display:flex;align-items:center}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id input,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id input{margin:0 2px 0 5px;width:50px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id a,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id a{text-decoration:none}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .button-link.simpay-remove-field-link,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .button-link.simpay-remove-field-link{color:#a00}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .button-link.simpay-remove-field-link:hover,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .button-link.simpay-remove-field-link:hover{color:#dc3232}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox table,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox table{border-spacing:0;width:100%}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox table.simpay-inner-table,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox table.simpay-inner-table{border:none;padding:0 1em}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox table tr td,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox table tr td{border-bottom-color:#ccd0d4}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-remove-plan,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-remove-plan{color:#a00}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-custom-field-payment-button .dashicons-menu,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-custom-field-payment-button .dashicons-menu{visibility:hidden}#simpay-global-settings .sortable-placeholder,#simpay-form-settings .sortable-placeholder{margin:5px;display:block;min-height:36px}#simpay-global-settings .chosen-container,#simpay-form-settings .chosen-container{min-width:20em;max-width:30em}#simpay-global-settings .simpay-field.simpay-small-text,#simpay-form-settings .simpay-field.simpay-small-text{width:7em}#simpay-global-settings .simpay-field.simpay-medium-text,#simpay-form-settings .simpay-field.simpay-medium-text{width:15em}#simpay-global-settings .simpay-field-radios ul,#simpay-form-settings .simpay-field-radios ul{margin:0}#simpay-global-settings .simpay-field-radios>i,#simpay-form-settings .simpay-field-radios>i{margin-left:5px;vertical-align:middle}#simpay-global-settings ul.simpay-field-radios-inline,#simpay-form-settings ul.simpay-field-radios-inline{margin:0 0 -10px}#simpay-global-settings ul.simpay-field-radios-inline li,#simpay-form-settings ul.simpay-field-radios-inline li{display:inline-block;margin:0 10px 10px 0}#simpay-global-settings ul.simpay-field-radios-inline li:last-child,#simpay-form-settings ul.simpay-field-radios-inline li:last-child{margin-right:0}#simpay-global-settings .simpay-currency-field,#simpay-form-settings .simpay-currency-field{display:flex;align-items:center}>#simpay-global-settings .simpay-currency-field:focus,>#simpay-form-settings .simpay-currency-field:focus{position:relative;z-index:5}#simpay-global-settings .simpay-currency-symbol,#simpay-form-settings .simpay-currency-symbol{margin:0;padding-left:8px;padding-right:8px;line-height:28px;font-size:14px}@media screen and (max-width: 782px){#simpay-global-settings .simpay-currency-symbol,#simpay-form-settings .simpay-currency-symbol{line-height:38px}}#simpay-global-settings .simpay-currency-symbol-left,#simpay-form-settings .simpay-currency-symbol-left{border-top-left-radius:4px;border-bottom-left-radius:4px}#simpay-global-settings .simpay-currency-symbol-right,#simpay-form-settings .simpay-currency-symbol-right{border-top-right-radius:4px;border-bottom-right-radius:4px}#simpay-global-settings div.simpay-currency-symbol,#simpay-form-settings div.simpay-currency-symbol{border-color:#7e8993;border-style:solid;background-color:#fff}#simpay-global-settings select.simpay-currency-symbol,#simpay-form-settings select.simpay-currency-symbol{padding-right:25px}#simpay-global-settings .simpay-currency-symbol-left,#simpay-form-settings .simpay-currency-symbol-left{border-width:1px 0 1px 1px}#simpay-global-settings .simpay-currency-symbol-left+.simpay-field-amount,#simpay-form-settings .simpay-currency-symbol-left+.simpay-field-amount{border-radius:0 4px 4px 0}#simpay-global-settings .simpay-currency-symbol-right,#simpay-form-settings .simpay-currency-symbol-right{border-width:1px 1px 1px 0}#simpay-global-settings .simpay-field-amount,#simpay-form-settings .simpay-field-amount{margin:0;padding-left:8px;padding-right:8px;font-size:14px;width:6em;position:relative;z-index:2;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px}#simpay-global-settings .simpay-error,#simpay-form-settings .simpay-error{color:red}#simpay-global-settings .simpay-docs-link-wrap,#simpay-form-settings .simpay-docs-link-wrap{position:absolute;right:0;bottom:0;color:#666;font-size:13px;font-style:italic;padding:15px 18px}#simpay-global-settings .simpay-docs-link-wrap a .dashicons-editor-help,#simpay-form-settings .simpay-docs-link-wrap a .dashicons-editor-help{color:#666;text-decoration:none;width:17px;height:17px;font-size:17px;padding-left:4px}#simpay-global-settings .simpay-docs-icon,#simpay-form-settings .simpay-docs-icon{color:#666}#simpay-global-settings .simpay-docs-icon,#simpay-global-settings .simpay-docs-icon .dashicons-editor-help,#simpay-form-settings .simpay-docs-icon,#simpay-form-settings .simpay-docs-icon .dashicons-editor-help{text-decoration:none;width:17px;height:17px;font-size:17px}.button.button-primary.simpay-upgrade-btn{background-color:#428bca;border:1px solid #428bca;color:#fff;display:inline-block}.button.button-primary.simpay-upgrade-btn:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px #2d6ca2}.button.button-primary.simpay-upgrade-btn:hover{background-color:#037ad0;border:1px solid #428bca}.simpay-upgrade-btn-subtext{color:#3c434a;font-size:14px;line-height:1.5;text-align:center;margin:40px 0 0;padding:30px 35px 20px;background-color:#fcf9e8;border:3px solid #ebe29a;border-radius:4px;position:relative}.simpay-upgrade-btn-subtext svg{background:#00a32a;fill:#fff;border-radius:50%;border:3px solid #ebe29a;width:28px;height:28px;position:absolute;top:-14px;left:50%;margin-left:-14px}.simpay-upgrade-btn-subtext u{text-decoration:none;font-weight:bold;color:#00a32a}.simpay-upgrade-btn-subtext a{text-decoration:none;display:block;margin-top:6px;font-weight:bold}.post-type-simple-pay #post-body-content{display:none}.simpay-card{margin:0 0 20px;padding:30px;background:#fff;border:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04)}.simpay-card,.simpay-card p{line-height:1.5;font-size:16px}.simpay-card h3{line-height:1.6;font-size:18px;margin:0 0 20px;color:#23282c}.simpay-card p{margin:0 0 20px}.simpay-card p:last-child,.simpay-card ul:last-child{margin-bottom:0}.simpay-card figure{float:right;margin:0 0 30px 30px;max-width:400px}.simpay-card figure iframe,.simpay-card figure img{max-width:100%}.simpay-card figure figcaption{text-align:center}@media screen and (max-width: 782px){.simpay-card figure{margin:0 0 30px;max-width:100%;float:none}}.simpay-doc-suggestions{width:100%;display:flex;flex-wrap:wrap;padding:0}.simpay-doc-suggestion{text-align:center;display:flex;flex-direction:column;justify-content:center;align-items:center;flex:0 1 33.333%;padding:30px;border-right:1px solid #c3c4c7;box-sizing:border-box}.simpay-doc-suggestion:nth-child(3n){border-right:0}@media screen and (max-width: 782px){.simpay-doc-suggestion{flex:0 1 100%;border-bottom:1px solid #c3c4c7;border-right:0}.simpay-doc-suggestion:last-child{border-bottom:0}}.simpay-doc-suggestion h3{font-size:20px;margin-bottom:10px}.simpay-doc-suggestion p{font-size:15px}.simpay-doc-suggestion .dashicons{font-size:40px;width:40px;height:40px;display:block;margin-bottom:10px}.simpay-doc-suggestion .button-large{font-size:16px}.simpay-addons{display:flex;flex-wrap:wrap;justify-content:space-between;margin:20px 0}.simpay-addon{background:#fff;border:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04);margin-bottom:20px;display:flex;flex-direction:column;flex-basis:calc(33% - 10px);box-sizing:border-box}@media screen and (max-width: 782px){.simpay-addon{flex-basis:100%}}.simpay-addon img{float:left;max-width:75px}.simpay-addon h5{margin:0 0 10px 100px;font-size:16px}.simpay-addon__details{padding:20px;flex:1 0 auto}.simpay-addon__actions{display:flex;align-items:center;justify-content:space-between;flex:0 1 auto;background-color:#f7f7f7;border-top:1px solid #ddd;margin-top:auto;padding:20px;position:relative}.simpay-addon__actions .msg{text-align:center;justify-content:center;display:flex;align-items:center;position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;background-color:#f7f7f7;z-index:3}.simpay-addon .error,.simpay-addon .status-label.status-installed{color:#d63638}.simpay-addon .success,.simpay-addon .status-label.status-active{color:#00a32a}.simpay-addon .addon-desc{margin:0 0 0 100px}.form-table td .simpay-stripe-connect-help{margin:15px 0;display:flex;align-items:center}.form-table td .simpay-stripe-connect-help .dashicons{margin-right:4px}.simpay-currency-field{display:flex;align-items:center}>.simpay-currency-field:focus{position:relative;z-index:5}.simpay-currency-symbol{margin:0;padding-left:8px;padding-right:8px;line-height:28px;font-size:14px}@media screen and (max-width: 782px){.simpay-currency-symbol{line-height:38px}}.simpay-currency-symbol-left{border-top-left-radius:4px;border-bottom-left-radius:4px}.simpay-currency-symbol-right{border-top-right-radius:4px;border-bottom-right-radius:4px}div.simpay-currency-symbol{border-color:#7e8993;border-style:solid;background-color:#fff}select.simpay-currency-symbol{padding-right:25px}.simpay-currency-symbol-left{border-width:1px 0 1px 1px}.simpay-currency-symbol-left+.simpay-field-amount{border-radius:0 4px 4px 0}.simpay-currency-symbol-right{border-width:1px 1px 1px 0}.simpay-field-amount{margin:0;padding-left:8px;padding-right:8px;font-size:14px;width:6em;position:relative;z-index:2;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px}.simpay-template-explorer-open .show-settings{display:none !important}.simpay-branding-bar{margin:0 -20px;padding:14px 22px;background:#fff;border-bottom:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04);width:calc(100% + 20px);display:flex;justify-content:space-between;box-sizing:border-box}.site-health .simpay-branding-bar{display:none}.simpay-branding-bar__title{display:flex;align-items:center;margin:8px 0}.simpay-branding-bar__logo{width:200px}.simpay-branding-bar__divider{color:#dadbdf;font-size:23px;font-weight:400;margin:0 15px}.simpay-branding-bar__actions{display:flex;align-items:center}.simpay-branding-bar__actions>div{margin-left:10px;min-width:40px}.simpay-branding-bar__actions-button{color:#000;cursor:pointer;padding:10px;width:40px;height:40px;background-color:#f3f4f5;border-radius:50%;border:0;box-shadow:none;position:relative;transition:background-color .2s ease;box-sizing:border-box;display:block}.simpay-branding-bar__actions-button:hover{background-color:#e5e5e5}.simpay-branding-bar__actions-button:active,.simpay-branding-bar__actions-button:focus{box-shadow:0 0 0 2px var(--wp-admin-theme-color)}.simpay-branding-bar__actions-button-count{font-weight:600;font-size:10px;line-height:16px;color:#fff;margin:0;background-color:#df2a4a;border-radius:100%;width:16px;height:16px;position:absolute;top:-8px;left:50%;margin-left:-8px}.simpay-branding-bar .wp-heading-inline{font-size:23px;font-weight:400;margin:0}.simpay-branding-bar .page-title-action{font-weight:600;font-size:13px;line-height:normal;cursor:pointer;text-shadow:none;text-decoration:none;margin-left:10px;padding:4px 8px;border:1px solid currentColor;border-radius:2px;background:#f6f7f7}.simpay-landing-zone{text-align:center;max-width:700px;margin:40px auto}.simpay-landing-zone__title{font-size:26px;font-weight:600;margin:0 0 1.5rem;padding:0}.simpay-landing-zone__subtitle{font-size:17px;color:#666;margin:.25rem 0}.simpay-landing-zone__subtitle strong{color:#444}.simpay-landing-zone section{margin:2rem 0}.simpay-landing-zone__empty-state-graphic img{width:425px}.simpay-landing-zone__screenshot>*{vertical-align:middle}.simpay-landing-zone__screenshot-img{display:inline-block;position:relative;width:315px;padding:5px;background-color:#fff;box-shadow:0px 2px 5px 0px rgba(0,0,0,.05);border-radius:3px}.simpay-landing-zone__screenshot-img img{max-width:100%;display:block}.simpay-landing-zone__screenshot-img .hover{position:absolute;opacity:0;height:calc(100% - 10px);width:calc(100% - 10px);top:0;left:0;border:5px solid #fff;background-color:rgba(0,0,0,.15);background-image:url(data:image/svg+xml;base64,PHN2ZyBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjojZmZmZmZmMDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCIgaGVpZ2h0PSIxMDAiPjxwYXRoIGQ9Ik01MCAwYzI3LjYxNCAwIDUwIDIyLjM4NiA1MCA1MHMtMjIuMzg2IDUwLTUwIDUwUzAgNzcuNjE0IDAgNTAgMjIuMzg2IDAgNTAgMHoiIGZpbGw9IiMxNjg1YjciLz48cGF0aCBkPSJNNzMuMDIzIDY3LjA2N2wtOS4zNDQtOS4zNDRhMi4yNDcgMi4yNDcgMCAwMC0xLjU5My0uNjU2aC0xLjUyOGExOS4zOTkgMTkuMzk5IDAgMDA0LjEyNC0xMS45OTZjMC0xMC43Ny04LjcyNS0xOS40OTUtMTkuNDk0LTE5LjQ5NS0xMC43NjggMC0xOS40OTQgOC43MjYtMTkuNDk0IDE5LjQ5NSAwIDEwLjc2OCA4LjcyNiAxOS40OTMgMTkuNDk0IDE5LjQ5M2ExOS40IDE5LjQgMCAwMDExLjk5Ny00LjEyM3YxLjUyN2MwIC42LjIzNCAxLjE3Mi42NTUgMS41OTRsOS4zNDQgOS4zNDRhMi4yNCAyLjI0IDAgMDAzLjE3OCAwbDIuNjUyLTIuNjUzYTIuMjYgMi4yNiAwIDAwLjAxLTMuMTg2em0tMjcuODM1LTEwYy02LjYyNiAwLTExLjk5Ni01LjM2MS0xMS45OTYtMTEuOTk2IDAtNi42MjcgNS4zNi0xMS45OTcgMTEuOTk2LTExLjk5NyA2LjYyNiAwIDExLjk5NyA1LjM2MSAxMS45OTcgMTEuOTk3IDAgNi42MjYtNS4zNjEgMTEuOTk2LTExLjk5NyAxMS45OTZ6IiBmaWxsPSIjZmZmIi8+PC9zdmc+);background-repeat:no-repeat;background-position:center;background-size:50px;transition:all .3s}.simpay-landing-zone__screenshot-img:hover .hover{opacity:1;transition:all .3s}.simpay-landing-zone__screenshot ul{text-align:left;display:inline-block;margin:0 0 0 30px;list-style-type:none;max-width:calc(100% - 350px)}@media screen and (max-width: 782px){.simpay-landing-zone__screenshot ul{text-align:center;margin:30px auto;max-width:100%;display:block}}.simpay-landing-zone__screenshot li{margin:16px 0;padding:0;font-size:15px;color:#777;position:relative}.simpay-landing-zone__screenshot li:before{content:"";background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEzLjc3NjIgNi40NTYwNUw4LjcyMDMyIDEuNDAwMDVDOC41NzU5OSAxLjI1NTcyIDguMzgzNjQgMS4xNzY1IDguMTc4NTMgMS4xNzY1QzcuOTczMiAxLjE3NjUgNy43ODA5NiAxLjI1NTg0IDcuNjM2NjQgMS40MDAwNUw3LjE3NzYgMS44NTkyQzcuMDMzMzkgMi4wMDMyOSA2Ljk1Mzk1IDIuMTk1NzYgNi45NTM5NSAyLjQwMDk4QzYuOTUzOTUgMi42MDYwOCA3LjAzMzM5IDIuODA1MDQgNy4xNzc2IDIuOTQ5MTRMMTAuMTI3MSA1LjkwNTE2SDAuNzU2MzM0QzAuMzMzODM0IDUuOTA1MTYgMCA2LjIzNTkyIDAgNi42NTg1NFY3LjMwNzY1QzAgNy43MzAyNyAwLjMzMzgzNCA4LjA5NDM4IDAuNzU2MzM0IDguMDk0MzhIMTAuMTYwNkw3LjE3NzcyIDExLjA2NjlDNy4wMzM1MSAxMS4yMTEyIDYuOTU0MDYgMTEuMzk4NSA2Ljk1NDA2IDExLjYwMzdDNi45NTQwNiAxMS44MDg3IDcuMDMzNTEgMTEuOTk4NiA3LjE3NzcyIDEyLjE0MjhMNy42MzY3NSAxMi42MDA1QzcuNzgxMDcgMTIuNzQ0OCA3Ljk3MzMyIDEyLjgyMzUgOC4xNzg2NSAxMi44MjM1QzguMzgzNzUgMTIuODIzNSA4LjU3NjExIDEyLjc0MzggOC43MjA0MyAxMi41OTk1TDEzLjc3NjMgNy41NDM2QzEzLjkyMSA3LjM5ODgyIDE0LjAwMDUgNy4yMDU1NiAxNCA3LjAwMDExQzE0LjAwMDQgNi43OTM5OCAxMy45MjEgNi42MDA2IDEzLjc3NjIgNi40NTYwNVY2LjQ1NjA1WiIgZmlsbD0iIzQyOEJDQSIvPgo8L3N2Zz4K);background-position:center;background-repeat:no-repeat;background-size:14px;width:14px;height:14px;display:inline-block;margin:-3px 5px 0 0;vertical-align:middle}.simpay-landing-zone .button.button-large{font-size:17px;line-height:30px;padding:10px 20px}.simpay-landing-zone__purchased{display:block;margin:15px 0 0}.simpay-upgrade-modal,.simpay-upgrade-upe-modal{padding:0 !important}.simpay-upgrade-modal *,.simpay-upgrade-upe-modal *{box-sizing:border-box}.simpay-upgrade-modal__content,.simpay-upgrade-upe-modal__content{text-align:center;display:flex;flex-direction:column;align-items:center;padding:16px 32px 32px}.simpay-upgrade-modal__content>.dashicons,.simpay-upgrade-upe-modal__content>.dashicons{color:#333;font-size:48px;width:48px;height:48px}.simpay-upgrade-modal__title,.simpay-upgrade-upe-modal__title{font-size:22px;line-height:1.5;display:block;margin:12px 0 0}.simpay-upgrade-modal__description,.simpay-upgrade-upe-modal__description{color:#777;font-size:16px;margin:16px 0 24px}.simpay-upgrade-modal__description strong,.simpay-upgrade-upe-modal__description strong{color:#333}.simpay-upgrade-modal__discount,.simpay-upgrade-upe-modal__discount{font-size:15px;text-align:center;margin:32px -32px -32px;padding:24px 40px;background-color:#fcf9e8;position:relative}.simpay-upgrade-modal__discount svg,.simpay-upgrade-upe-modal__discount svg{background:#00a32a;fill:#fff;border-radius:50%;border:4px solid #fff;width:32px;height:32px;position:absolute;top:-16px;left:50%;margin-left:-16px}.simpay-upgrade-modal__discount u,.simpay-upgrade-upe-modal__discount u{text-decoration:none;font-weight:bold;color:#00a32a}.simpay-upgrade-modal .button-large,.simpay-upgrade-upe-modal .button-large{font-size:16px;font-weight:bold;margin:0 0 15px;padding:8px 30px !important;height:auto}.simpay-teaser-float{margin:50px;position:relative}.simpay-teaser-float__card{text-align:center;padding:30px;background:#fff;border-radius:4px;box-shadow:0 0 30px 15px rgba(0,0,0,.18);position:relative;z-index:2}#poststuff .simpay-teaser-float h2,.simpay-teaser-float h2{font-size:24px;font-weight:600;margin:0;padding:0}.simpay-teaser-float p{font-size:15px;line-height:1.35;color:#666}.simpay-teaser-float p strong{color:#444}.simpay-teaser-float ul{text-align:left;display:inline-block;margin:-10px 0 20px;list-style-type:none}.simpay-teaser-float li{margin:16px 0;padding:0 0 0 24px;font-size:15px;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEzLjc3NjIgNi40NTYwNUw4LjcyMDMyIDEuNDAwMDVDOC41NzU5OSAxLjI1NTcyIDguMzgzNjQgMS4xNzY1IDguMTc4NTMgMS4xNzY1QzcuOTczMiAxLjE3NjUgNy43ODA5NiAxLjI1NTg0IDcuNjM2NjQgMS40MDAwNUw3LjE3NzYgMS44NTkyQzcuMDMzMzkgMi4wMDMyOSA2Ljk1Mzk1IDIuMTk1NzYgNi45NTM5NSAyLjQwMDk4QzYuOTUzOTUgMi42MDYwOCA3LjAzMzM5IDIuODA1MDQgNy4xNzc2IDIuOTQ5MTRMMTAuMTI3MSA1LjkwNTE2SDAuNzU2MzM0QzAuMzMzODM0IDUuOTA1MTYgMCA2LjIzNTkyIDAgNi42NTg1NFY3LjMwNzY1QzAgNy43MzAyNyAwLjMzMzgzNCA4LjA5NDM4IDAuNzU2MzM0IDguMDk0MzhIMTAuMTYwNkw3LjE3NzcyIDExLjA2NjlDNy4wMzM1MSAxMS4yMTEyIDYuOTU0MDYgMTEuMzk4NSA2Ljk1NDA2IDExLjYwMzdDNi45NTQwNiAxMS44MDg3IDcuMDMzNTEgMTEuOTk4NiA3LjE3NzcyIDEyLjE0MjhMNy42MzY3NSAxMi42MDA1QzcuNzgxMDcgMTIuNzQ0OCA3Ljk3MzMyIDEyLjgyMzUgOC4xNzg2NSAxMi44MjM1QzguMzgzNzUgMTIuODIzNSA4LjU3NjExIDEyLjc0MzggOC43MjA0MyAxMi41OTk1TDEzLjc3NjMgNy41NDM2QzEzLjkyMSA3LjM5ODgyIDE0LjAwMDUgNy4yMDU1NiAxNCA3LjAwMDExQzE0LjAwMDQgNi43OTM5OCAxMy45MjEgNi42MDA2IDEzLjc3NjIgNi40NTYwNVY2LjQ1NjA1WiIgZmlsbD0iIzQyOEJDQSIvPgo8L3N2Zz4K);background-position:left 3px;background-repeat:no-repeat;background-size:14px;color:#777}.simpay-teaser-float .button.button-large{font-size:17px;line-height:30px;padding:10px 20px}.simpay-teaser-float .simpay-notice-dismiss{position:absolute;top:0;right:0;font-size:20px;color:#666;font-weight:bold;text-decoration:none;margin-left:5px;padding:6px 10px;z-index:2}.simpay-teaser-float .simpay-notice-dismiss:hover,.simpay-teaser-float .simpay-notice-dismiss:active,.simpay-teaser-float .simpay-notice-dismiss:focus{color:#666;text-decoration:none}.simpay-teaser-float:after,.simpay-teaser-float:before{opacity:.75;z-index:0;content:"";position:absolute;left:-30px;right:-30px;top:-35px;width:calc(100% + 60px);height:170px;background-image:linear-gradient(#ddd, #ddd),linear-gradient(#eee, #eee),linear-gradient(#ddd, #ddd),linear-gradient(#eee, #eee);background-repeat:no-repeat;background-size:100% 20px,100% 40px,100% 20px,100% 40px;background-position:0 0,0 30px,0 100px,0 130px}.simpay-teaser-float:before{top:170px}.simpay-teaser-float .simpay-upgrade-btn-subtext{margin:24px -30px -30px;padding:32px 40px;border-bottom-left-radius:2px;border-bottom-right-radius:2px;border:0}.simpay-teaser-float .simpay-upgrade-btn-subtext svg{border-color:#fff}.simpay-teaser-float--inline{margin:40px 30px 30px}.simpay-teaser-float--inline .simpay-teaser-float__card{padding:30px;box-shadow:0 0 12px 6px rgba(0,0,0,.16)}#poststuff .simpay-teaser-float--inline h2,.simpay-teaser-float--inline h2{font-size:20px}.simpay-teaser-float--inline p{font-size:15px;margin:.75rem 0}.simpay-teaser-float--inline .button.button-large{font-size:15px;line-height:24px;margin:1rem 0;padding:8px 14px;display:inline-block}.simpay-teaser-float--inline:before,.simpay-teaser-float--inline:after{opacity:.6}.simpay-teaser-float--inline:before{display:none}.simpay-teaser-float--inline:after{top:15px}.simpay-form-settings-notice{font-weight:normal;color:#1d2327;position:relative;margin:18px 18px 0;padding:14px;border-radius:4px;background:#f5f5ff}.simpay-form-settings-notice a{color:#635aff}.simpay-form-settings-notice .simpay-external-link .dashicons-external{margin:1px 0 0 2px}.simpay-form-settings-notice strong{font-size:14px}.simpay-form-settings-notice p{margin:5px 0 0 23px}.simpay-form-settings-notice .simpay-notice-dismiss{font-size:20px;color:#b0b0f0;font-weight:bold;line-height:1;position:absolute;top:0;right:5px;text-decoration:none;padding:0 5px;z-index:2}.simpay-form-settings-notice .simpay-notice-dismiss:hover,.simpay-form-settings-notice .simpay-notice-dismiss:active,.simpay-form-settings-notice .simpay-notice-dismiss:focus{color:#9191ef;text-decoration:none;background:none}.simpay-settings .simpay-form-settings-notice{border:2px solid #645aff;box-shadow:0 1px 1px rgba(0,0,0,.04)}.post-type-simple-pay .lity{z-index:999999999;padding:20px}.post-type-simple-pay .lity-close{margin:10px}.post-type-simple-pay .lity-content{max-width:80vw;max-height:80vh}.post-type-simple-pay .lity-content img{max-height:80vh !important;max-width:80vw !important}#wpsp-api-keys-row-hide{display:none}.post-type-simple-pay #post-preview:not(.simpay-preview-button){display:none}.simpay-license-field-wrapper{margin:20px 0}#simpay-settings-license-key-license-key{margin:0}#simpay-settings-license-key-license-key[readonly]{background:#fff}.simpay-license-message__loading,.simpay-license-field{display:flex;align-items:center}.wp-core-ui .button.simpay-license-button.button-primary,.wp-core-ui .button.simpay-license-button.button-secondary{font-size:1rem;line-height:1;margin:0 8px;padding:13px}.simpay-license-message{font-size:15px;margin-top:8px}.simpay-license-message--valid{color:#15803d}.simpay-license-message--invalid{color:#b91c1c}.simpay-recaptcha-payment-form-feedback .dashicons{margin-top:-1px;display:inline-block}.simpay-recaptcha-payment-form-feedback .dashicons-update-alt{animation:rotation 2s infinite linear}.simpay-form-builder-inset-settings{margin:3px 0 0 24px}fieldset.simpay-form-builder-inset-settings>*:not(legend){margin:5px 0 8px}.simpay-form-builder-inset-settings>*:last-child{margin-bottom:0}.simpay-form-builder-inventory-control{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;padding:6px 8px;box-shadow:0 0 0 rgba(0,0,0,0);transition:box-shadow .1s linear;border-radius:2px;border:1px solid #757575;font-size:16px;line-height:normal;margin:0;padding:0;width:auto;display:inline-flex;align-items:center}@media(prefers-reduced-motion: reduce){.simpay-form-builder-inventory-control{transition-duration:0s;transition-delay:0s}}@media(min-width: 600px){.simpay-form-builder-inventory-control{font-size:13px;line-height:normal}}.simpay-form-builder-inventory-control:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid rgba(0,0,0,0)}.simpay-form-builder-inventory-control::-webkit-input-placeholder{color:rgba(30,30,30,.62)}.simpay-form-builder-inventory-control::-moz-placeholder{opacity:1;color:rgba(30,30,30,.62)}.simpay-form-builder-inventory-control:-ms-input-placeholder{color:rgba(30,30,30,.62)}.simpay-form-builder-inventory-control:focus-within{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid rgba(0,0,0,0)}.simpay-form-builder-inventory-control input[type=number]{border:0;box-shadow:none;background:none;border-radius:0;width:75px}.simpay-form-builder-inventory-control input[type=number]:focus{border:0;box-shadow:none;outline:0}.simpay-form-builder-inventory-control+label{margin-left:8px}.simpay-form-builder-inventory-control__initial{color:#757575;font-size:16px;line-height:normal;padding-right:8px}@media(min-width: 600px){.simpay-form-builder-inventory-control__initial{font-size:13px;line-height:normal}}.simpay-form-builder-inventory-control__initial:before{content:"/";display:inline-block;vertical-align:top;margin-top:-1px}.simpay-form-builder-purchase-restrictions__restriction-item{display:flex;align-items:center;margin-top:8px;margin-bottom:8px}.simpay-form-builder-purchase-restrictions__restriction-item label{margin-left:8px}.simpay-form-builder-purchase-restrictions__restriction-item-datetime{display:flex;align-items:center}.simpay-form-builder-purchase-restrictions__restriction-item-datetime>*{margin-right:10px}.simpay-form-builder-purchase-restrictions__restriction-item-datetime span{color:#757575}.simpay-form-builder-fee-recovery__amounts{display:flex;align-items:center;margin-top:5px}.simpay-form-builder-fee-recovery ::-webkit-input-placeholder{color:#b7bec7}.simpay-form-builder-fee-recovery ::-moz-placeholder{color:#b7bec7;opacity:1}.simpay-form-builder-fee-recovery :-ms-input-placeholder{color:#b7bec7}.simpay-form-builder-fee-recovery>*{margin-right:8px}.simpay-form-builder-fee-percent-control{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;padding:6px 8px;box-shadow:0 0 0 rgba(0,0,0,0);transition:box-shadow .1s linear;border-radius:2px;border:1px solid #757575;font-size:16px;line-height:normal;margin:0;padding:0;width:auto;display:inline-flex;align-items:center}@media(prefers-reduced-motion: reduce){.simpay-form-builder-fee-percent-control{transition-duration:0s;transition-delay:0s}}@media(min-width: 600px){.simpay-form-builder-fee-percent-control{font-size:13px;line-height:normal}}.simpay-form-builder-fee-percent-control:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid rgba(0,0,0,0)}.simpay-form-builder-fee-percent-control::-webkit-input-placeholder{color:rgba(30,30,30,.62)}.simpay-form-builder-fee-percent-control::-moz-placeholder{opacity:1;color:rgba(30,30,30,.62)}.simpay-form-builder-fee-percent-control:-ms-input-placeholder{color:rgba(30,30,30,.62)}.simpay-form-builder-fee-percent-control:focus-within{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid rgba(0,0,0,0)}.simpay-form-builder-fee-percent-control input[type=number]{border:0;box-shadow:none;background:none;border-radius:0;width:75px}.simpay-form-builder-fee-percent-control input[type=number]:focus{border:0;box-shadow:none;outline:0}.simpay-form-builder-fee-percent-control+label{margin-left:8px}.simpay-form-builder-fee-percent-control__suffix{color:#757575;font-size:16px;line-height:normal;padding-right:8px}@media(min-width: 600px){.simpay-form-builder-fee-percent-control__suffix{font-size:13px;line-height:normal}}.simpay-form-builder-automations__cta{margin:24px 0 6px;text-align:center}.simpay-form-builder-automator{padding:16px 4px 26px !important}.simpay-form-builder-automator,.simpay-form-builder-automator *{box-sizing:border-box}.simpay-form-builder-automator input[type=search]{font-size:15px;padding:2px 8px}.simpay-form-builder-automator__integrations{display:grid;grid-template-columns:repeat(4, minmax(0, 1fr));grid-column-gap:16px;grid-row-gap:16px;margin:18px -18px 0;padding:0 18px 10px;width:calc(100% + 36px);max-height:400px;overflow-y:scroll}.simpay-form-builder-automator__integrations-integration{color:initial;text-align:center;text-decoration:none;background:#fff;border:1px solid #eee;border-radius:4px;box-shadow:0 1px 3px 0 rgba(0,0,0,.03);transition:all ease-in .15s}.simpay-form-builder-automator__integrations-integration img{display:block;margin:16px auto;height:50px}.simpay-form-builder-automator__integrations-integration span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:8px 16px;display:block;border-top:1px solid #eee}.simpay-form-builder-automator__integrations-integration:hover{cursor:pointer;border-color:#ddd;box-shadow:0 2px 4px 0 rgba(0,0,0,.06)}body.site-health #wpbody-content,body.post-type-simple-pay #wpbody-content{padding-bottom:200px}#wpfooter .simpay-footer-promotion{text-align:center;font-weight:400;font-size:13px;line-height:16px;color:#787c82;padding:20px 0 30px 0;margin-bottom:20px}#wpfooter .simpay-footer-promotion p{font-weight:600}#wpfooter .simpay-footer-promotion-links,#wpfooter .simpay-footer-promotion-social{display:flex;justify-content:center;align-items:center}#wpfooter .simpay-footer-promotion-links{margin:9px 0 0}#wpfooter .simpay-footer-promotion-links span{color:#c3c4c7;padding:0 7px}#wpfooter .simpay-footer-promotion-social{margin:10px 0 0 0;gap:10px}#wpfooter .simpay-footer-promotion-social li{margin-bottom:0}#wpfooter .simpay-footer-promotion-social li:hover path{fill:#50575e}#wpfooter .simpay-footer-promotion-social a{display:block;height:16px}.simpay-settings-is_upe td{background:#fff;border:1px solid #c3c4c7;border-left-width:4px;border-left-color:#2271b1;box-shadow:0 1px 1px rgba(0,0,0,.04);padding:12px 18px} +.simpay-settings-subsections{display:flex;align-items:center;box-shadow:inset 0 -1px 0 0 #ccc}.simpay-settings-subsections__subsection{font-weight:500;text-decoration:none;padding:15px;display:flex;align-items:center}.simpay-settings-subsections__subsection .dashicons{width:18px;height:18px;font-size:18px;margin-right:4px}.simpay-settings-subsections__subsection.is-active{box-shadow:inset 0 -4px 0 0 currentColor;position:relative;z-index:1}.simpay-settings-subsections__subsection:not(.is-active){color:#23282d}.simpay-settings form>h2:not(.nav-tab-wrapper){clip:rect(1px, 1px, 1px, 1px);height:1px;overflow:hidden;position:absolute !important;width:1px}.simpay-settings .form-table td fieldset+p,.simpay-settings .form-table td label+p,.simpay-settings .form-table td select+p,.simpay-settings .form-table td input+p{color:#666;font-style:italic}.simpay-settings .simpay-settings-subsections__subsection{display:flex;align-items:center}.simpay-settings .simpay-settings-subsections__subsection .simpay-settings-bubble{margin-left:5px}.simpay-settings .simpay-settings-visual-toggles{margin:30px 0 0;display:flex}.simpay-settings .simpay-settings-visual-toggles input[type=radio]{display:none}.simpay-settings .simpay-settings-visual-toggles__toggle{-webkit-user-select:none;-moz-user-select:none;user-select:none;min-width:180px;margin:0 30px 0 0 !important;position:relative;display:block;background-color:#fff;border-radius:4px;border:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04)}.simpay-settings .simpay-settings-visual-toggles__toggle:hover{border:1px solid #999;box-shadow:0 1px 2px rgba(0,0,0,.1)}.simpay-settings .simpay-settings-visual-toggles input[type=radio]:checked+.simpay-settings-visual-toggles__toggle{border-color:#007cba;border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px #007cba;box-shadow:0 0 0 1px var(--wp-admin-theme-color)}.simpay-settings .simpay-settings-visual-toggles__toggle-recommended,.simpay-settings .simpay-settings-visual-toggles__toggle-not-recommended{text-align:center;font-size:12px;text-transform:uppercase;font-weight:bold;margin:0;padding:5px 0;display:block;border-top-right-radius:4px;border-top-left-radius:4px}.simpay-settings .simpay-settings-visual-toggles__toggle-recommended{color:#0f8569;background:#f4f9f7}.simpay-settings .simpay-settings-visual-toggles__toggle-not-recommended{color:#b91c1b;background:#fef2f2}.simpay-settings .simpay-settings-visual-toggles__toggle-icon{margin:20px auto 15px;padding:0 15px;display:block}.simpay-settings .simpay-settings-visual-toggles__toggle-label{line-height:1.5;text-align:center;font-size:16px;font-weight:500;margin:15px;display:block}.simpay-settings .simpay-settings-visual-toggles__toggle-label small{color:#666;font-weight:normal;font-size:13px;line-height:1;display:block;margin:4px 0}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type .simpay-settings-visual-toggles__toggle{min-height:160px}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type .simpay-settings-visual-toggles__toggle-icon{width:80px;height:80px}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type input[type=radio].simpay-settings-captcha-type--is-recommended:checked+.simpay-settings-visual-toggles__toggle{border-color:#0f8569;box-shadow:0 0 0 1px #0f8569}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type input[type=radio].simpay-settings-captcha-type--is-not-recommended:checked+.simpay-settings-visual-toggles__toggle{border-color:#b91c1b;box-shadow:0 0 0 1px #b91c1b}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type label[for=simpay-settings-captcha-type-cloudflare-turnstile] .simpay-settings-visual-toggles__toggle-icon{width:120px}.simpay-settings-general-recaptcha-no_captcha_warning th,.simpay-settings-general-recaptcha-no_captcha_warning td,.simpay-settings-hcaptcha_secret_key th,.simpay-settings-hcaptcha_secret_key td,.simpay-settings-cloudflare_turnstile_secret_key th,.simpay-settings-cloudflare_turnstile_secret_key td,.simpay-settings-recaptcha_score_threshold th,.simpay-settings-recaptcha_score_threshold td{padding-bottom:50px !important}.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-summary-report,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-payment-confirmation,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-payment-notification,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-upcoming-invoice,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-manage-subscriptions,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-payment-processing-confirmation,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-payment-processing-notification,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-payment-refunded-confirmation,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-subscription-cancel-confirmation,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-subscription-cancel-notification,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-invoice-confirmation{display:none}.simpay-settings .simpay-settings-subsection-emails-tools{margin-left:auto}.simpay-admin-charts-period-over-period{position:relative;padding-bottom:12px}.simpay-admin-charts-period-over-period *{box-sizing:border-box}.simpay-admin-charts-period-over-period__tooltip{position:absolute;background:#fff;border:1px solid #c3c3c3;box-shadow:0 2px 6px rgba(0,0,0,.05);border-radius:2px;padding:10px 14px;display:flex;flex-direction:column;z-Index:10000;min-width:175px}.simpay-admin-charts-period-over-period__tooltip-data{white-space:nowrap;margin-bottom:8px;display:grid;grid-template-columns:1fr auto;grid-auto-rows:auto;-moz-column-gap:16px;column-gap:16px}.simpay-admin-charts-period-over-period__tooltip-data:last-child{margin-bottom:0}.simpay-admin-charts-period-over-period__tooltip-data[data-dataset="1"]{opacity:.65}.simpay-admin-charts-period-over-period__tooltip-data em{font-style:normal;text-align:right}.simpay-admin-charts-period-over-period__tooltip-delta{font-size:12px;margin:0 -14px -10px;padding:8px 14px;border-top:1px solid #eee;background:#fdfdfd;border-radius:2px;display:flex;align-items:center;justify-content:center}.simpay-admin-charts-period-over-period__tooltip-delta .simpay-admin-charts-badge{margin-right:4px}.simpay-admin-charts-period-over-period__tooltip-delta strong.is-positive{color:#006908}.simpay-admin-charts-period-over-period__tooltip-delta strong.is-negative{color:#b3093c}.simpay-admin-charts-badge{color:#2f2f2f;font-size:12px;font-weight:500;font-style:normal;line-height:1;padding:3px 6px;display:inline-flex;align-items:center;background:#f0f0f0;border-radius:100px}.simpay-admin-charts-badge.is-positive{color:#006908;background-color:#d7f7c2}.simpay-admin-charts-badge.is-negative{color:#b3093c;background-color:#ffe7f2}.simpay-admin-charts-badge__icon{width:15px;height:15px}.simpay-admin-charts-no-data{position:absolute;top:0;left:0;display:flex;justify-content:center;align-items:center;background:rgba(255,255,255,.5);z-index:2}.simpay-admin-charts-no-data>div{text-align:center;padding:24px;background:#fff;border:1px solid #c3c3c3;box-shadow:0 2px 6px rgba(0,0,0,.1);border-radius:2px;max-width:60%}.simpay-admin-charts-no-data strong{font-size:15px;margin-bottom:8px;display:block}.button.button-large.simpay-button-large{font-size:14px;line-height:30px;padding:4px 12px}.simpay-copy-hidden-input{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}.fixed .column-livemode{width:15%;text-align:right}@media screen and (max-width: 782px){.fixed .column-livemode{text-align:left}}.fixed .column-livemode .simpay-badge{margin-top:3px}.fixed .column-shortcode{width:25%}.fixed .column-shortcode .simpay-shortcode{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}.post-type-simple-pay .misc-pub-curtime,.post-type-simple-pay .misc-pub-visibility{display:none}.simpay-metabox-title{border:1px solid #eee}.simpay-shortcode-section{border-top:1px solid #ddd;border-width:1px 0;padding-top:15px;padding-bottom:15px;position:relative}.simpay-shortcode-section label{display:block;margin-bottom:6px}.simpay-shortcode-section label .dashicons{color:#8c8f94;margin-right:3px}.simpay-shortcode-section .simpay-copy-button{line-height:normal;position:absolute;right:20px;bottom:20px;border:0;background:none;box-shadow:none;padding:0}.simpay-shortcode-section .simpay-copy-button:hover{border:0;background:none;box-shadow:none}.simpay-shortcode-section .simpay-copy-button .dashicons{color:#3c434a}.simpay-shortcode{width:100%;padding:8px;line-height:1;margin:0;height:32px;resize:none}.simpay-badge{color:#3f3f46;text-align:center;line-height:1;padding:5px 7px;border-radius:3px;background:#e4e4e7;border:0;box-shadow:none;display:inline-flex;align-items:center}button.simpay-badge{cursor:pointer}button.simpay-badge:hover{background:#d4d4d8}.simpay-badge__icon{opacity:.8;margin:2px 5px 0 0}.simpay-badge--green{color:#0e6245;background:#cbf4c9}.simpay-badge--yellow{color:#983705;background:#f8e5b9}.simpay-stripe-account-info{display:flex;align-items:center;margin-bottom:8px;position:relative}.simpay-stripe-account-info .spinner{float:none;margin-top:0;margin-left:0}.simple-pay_page_simpay_settings .simpay-settings-upgrade,.post-type-simple-pay .simpay-settings-upgrade{margin-top:20px;padding:1px;position:relative;background:#fff;border-radius:4px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.2),0 5px 10px rgba(0,0,0,.1);max-width:677px}.simple-pay_page_simpay_settings .simpay-settings-upgrade__inner,.post-type-simple-pay .simpay-settings-upgrade__inner{text-align:center;margin:0;padding:30px}.simple-pay_page_simpay_settings .simpay-settings-upgrade h3,.post-type-simple-pay .simpay-settings-upgrade h3{line-height:1.5;font-size:22px;margin:0 0 1.5rem}.simple-pay_page_simpay_settings .simpay-settings-upgrade ul,.post-type-simple-pay .simpay-settings-upgrade ul{margin:1.5rem 0 calc(1.5rem - 6px);display:flex;flex-wrap:wrap;justify-content:center}@media screen and (min-width: 782px){.simple-pay_page_simpay_settings .simpay-settings-upgrade ul,.post-type-simple-pay .simpay-settings-upgrade ul{margin-left:4rem;margin-right:4rem}}.simple-pay_page_simpay_settings .simpay-settings-upgrade li,.post-type-simple-pay .simpay-settings-upgrade li{font-size:15px;margin:6px 0;width:100%}.simple-pay_page_simpay_settings .simpay-settings-upgrade li a,.post-type-simple-pay .simpay-settings-upgrade li a{color:#3c434a;text-decoration:none}.simple-pay_page_simpay_settings .simpay-settings-upgrade li a:hover,.post-type-simple-pay .simpay-settings-upgrade li a:hover{color:var(--wp-admin-theme-color);text-decoration:underline}@media screen and (min-width: 782px){.simple-pay_page_simpay_settings .simpay-settings-upgrade li,.post-type-simple-pay .simpay-settings-upgrade li{text-align:left;width:50%}}.simple-pay_page_simpay_settings .simpay-settings-upgrade .button.button-large,.post-type-simple-pay .simpay-settings-upgrade .button.button-large{font-size:17px;line-height:30px;padding:10px 20px}.simple-pay_page_simpay_settings .simpay-settings-upgrade small,.post-type-simple-pay .simpay-settings-upgrade small{color:#666;margin:15px 0 0;display:block}.simple-pay_page_simpay_settings .simpay-settings-upgrade .dashicons-yes,.post-type-simple-pay .simpay-settings-upgrade .dashicons-yes{color:#428bca}.simple-pay_page_simpay_settings .simpay-settings-upgrade .button-link,.post-type-simple-pay .simpay-settings-upgrade .button-link{position:absolute;top:0;right:0;font-size:20px;color:#666;font-weight:bold;text-decoration:none;margin-left:5px;padding:6px 10px;z-index:2}.simple-pay_page_simpay_settings .simpay-settings-upgrade .button-link:hover,.simple-pay_page_simpay_settings .simpay-settings-upgrade .button-link:active,.simple-pay_page_simpay_settings .simpay-settings-upgrade .button-link:focus,.post-type-simple-pay .simpay-settings-upgrade .button-link:hover,.post-type-simple-pay .simpay-settings-upgrade .button-link:active,.post-type-simple-pay .simpay-settings-upgrade .button-link:focus{color:#666;text-decoration:none}.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext{text-align:center;margin:0;padding:30px 20px 20px;background-color:#fcf9e8;border:1px solid #edeac9;border-width:1px 0 0;position:relative;border-radius:0;border-bottom-left-radius:4px;border-bottom-right-radius:4px}@media screen and (min-width: 782px){.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext{padding-left:4rem;padding-right:4rem}}.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext svg,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext svg{background:#00a32a;fill:#fff;border-radius:50%;border:4px solid #fff;box-shadow:0 0 0 1px #edeac9;width:28px;height:28px;position:absolute;top:-18px;left:50%;margin-left:-18px}.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext u,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext u{text-decoration:none;font-weight:bold;color:#00a32a}.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext a,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext a{font-weight:normal;display:inline-block}#simpay-payment-form-settings table{width:100%;border-collapse:collapse}#simpay-payment-form-settings ::-webkit-input-placeholder{color:#9ba1a9}#simpay-payment-form-settings ::-moz-placeholder{color:#9ba1a9;opacity:1}#simpay-payment-form-settings :-ms-input-placeholder{color:#9ba1a9}#simpay-payment-form-settings .inside{margin:0;padding:0}#simpay-payment-form-settings .simpay-panel-field .toolbar{margin-bottom:-4px}#simpay-payment-form-settings .simpay-panel-field .toolbar .simpay-field-select{margin:0 0 4px;width:auto;max-width:70%}#simpay-payment-form-settings .simpay-tabs{margin:0;padding:0;list-style:none;background:#fafafa;border-right:1px solid #ccd0d4;line-height:1em;position:relative;flex:0 0 25%}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-tabs{flex-basis:100%;flex-grow:1;border-right:0}}#simpay-payment-form-settings .simpay-tabs li{margin:0;padding:0}#simpay-payment-form-settings .simpay-tabs li:first-child{margin-top:12px}#simpay-payment-form-settings .simpay-tabs li:last-child{margin-bottom:20px}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-tabs li:last-child{margin-bottom:0}}#simpay-payment-form-settings .simpay-tabs li.active{margin-left:-1px;box-shadow:0 1px 1px rgba(0,0,0,.04);position:relative}#simpay-payment-form-settings .simpay-tabs li.active:focus:after{display:none}#simpay-payment-form-settings .simpay-tabs li.active:before,#simpay-payment-form-settings .simpay-tabs li.active:after{content:"";width:calc(100% + 1px);height:1px;background:#ccd0d4;position:absolute;top:0;left:0;right:0;z-index:2}#simpay-payment-form-settings .simpay-tabs li.active:after{top:auto;bottom:0}#simpay-payment-form-settings .simpay-tabs li.active a{font-weight:bold;background-color:#fff;position:relative;margin-right:-1px}#simpay-payment-form-settings .simpay-tabs li.active a:before{content:"";position:absolute;top:0;left:0;bottom:0;width:4px;height:100%;background:currentColor;z-index:3}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-tabs li.active a{margin-right:0}}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item{display:flex;align-items:center;line-height:20px;margin:0;padding:8px 10px 8px 14px;text-decoration:none;transition:all .05s ease-in-out}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item svg,#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item .dashicons{margin-right:6px}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item{padding:18px}}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item:focus{outline:0;position:relative;z-index:3;box-shadow:inset 0 0 0 1px currentColor,0 0 0 1px currentColor}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item[href="#purchase-restrictions-settings-panel"],#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item[href="#payment-page-settings-panel"]{margin-bottom:20px;position:relative}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item[href="#purchase-restrictions-settings-panel"]:after,#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item[href="#payment-page-settings-panel"]:after{content:"";position:absolute;left:14px;right:14px;bottom:-10px;width:calc(100% - 28px);height:1px;background:#eaeaea}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item span>span{color:#f18500;font-size:12px;font-weight:600;margin:0 0 0 5px;display:inline-block}#simpay-payment-form-settings .simpay-tabs li:not(.active) .simpay-tab-item{color:inherit}#simpay-payment-form-settings .simpay-panels-wrap{background:#fff;display:flex}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-panels-wrap{flex-direction:column}}#simpay-payment-form-settings .simpay-panels{flex:0 0 75%;display:flex}@media screen and (min-width: 1400px){#simpay-payment-form-settings .simpay-panels{flex-basis:75%}}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-panels{flex-basis:100%}}#simpay-payment-form-settings .simpay-panel,#simpay-payment-form-settings .simpay-panel-section{width:100%}#simpay-payment-form-settings .simpay-panel>table,#simpay-payment-form-settings .simpay-panel>table>tr,#simpay-payment-form-settings .simpay-panel>table>tbody,#simpay-payment-form-settings .simpay-panel>table>tbody>tr,#simpay-payment-form-settings .simpay-panel>table>thead,#simpay-payment-form-settings .simpay-panel>table>thead>tr{display:block;width:100%}#simpay-payment-form-settings .simpay-panel>table:last-child>tbody:last-child>tr:last-child>td{border-bottom:0}#simpay-payment-form-settings .simpay-panel-field--requires-upgrade{position:relative}#simpay-payment-form-settings .simpay-panel-field--requires-upgrade td>div{margin-right:80px}#simpay-payment-form-settings .simpay-panel-field--requires-upgrade td>div .button-small{position:absolute;top:calc(50% - 13px);right:18px}#simpay-payment-form-settings .simpay-panel-field,#simpay-payment-form-settings .simpay-panel-field>td,#simpay-payment-form-settings .simpay-panel-field>th{text-align:left;display:block}#simpay-payment-form-settings .simpay-panel-field>td,#simpay-payment-form-settings .simpay-panel-field>th{width:calc(100% - 36px);margin-left:18px;margin-right:18px}#simpay-payment-form-settings .simpay-panel-field th{font-weight:bold;padding-top:18px;padding-bottom:5px}#simpay-payment-form-settings .simpay-panel-field td{border-bottom:1px solid #ddd;padding-bottom:18px}#simpay-payment-form-settings .simpay-panel-field p.description{margin-top:4px}#simpay-payment-form-settings .simpay-panel-field p.description:last-of-type{margin-bottom:0}#simpay-payment-form-settings .simpay-panel-field .simpay-panel-field__nested{margin-top:18px}#simpay-payment-form-settings .simpay-panel-field .simpay-panel-field__nested label{font-weight:bold;display:block;margin-bottom:4px}#simpay-payment-form-settings .simpay-panel-field .simpay-field-select,#simpay-payment-form-settings .simpay-panel-field .simpay-field-text{min-width:75%;max-width:100%}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-panel-field .simpay-field-select,#simpay-payment-form-settings .simpay-panel-field .simpay-field-text{min-width:0;width:100%}}#simpay-payment-form-settings .simpay-panel-field .simpay-field-textarea{width:100%;max-width:100%}#simpay-payment-form-settings .simpay-panel-field .notice:last-of-type{margin-bottom:0}#simpay-payment-form-settings .simpay-panel-field .error,#simpay-payment-form-settings .simpay-panel-field .simpay-important{color:#a94442;font-weight:normal}#simpay-payment-form-settings .simpay-panel-field .simpay-image-preview-wrap{position:relative;margin-top:12px}#simpay-payment-form-settings .simpay-panel-field .simpay-image-preview-wrap .simpay-remove-image-preview{position:absolute;top:-15px;left:-15px;cursor:pointer;background-color:#fff}#simpay-payment-form-settings .simpay-panel-field .simpay-image-preview-wrap .simpay-remove-image-preview::before{font-size:22px;line-height:26px}#simpay-payment-form-settings .simpay-panel-field .simpay-image-preview-wrap .simpay-image-preview{max-height:128px;max-width:128px;border:1px solid #ddd}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box{background-color:#f4f4f4;border:1px solid #e5e5e5;padding:18px;margin-top:18px;position:relative}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box__dismiss{color:inherit;text-decoration:none;position:absolute;top:8px;right:8px}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box__dismiss .dashicons-dismiss{font-size:16px;width:16px;height:16px}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box h3{font-size:18px;font-weight:600;margin:0;padding:0}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box p{font-size:14px}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box p:last-child{margin-bottom:0}#simpay-payment-form-settings .simpay-metabox-content{margin-bottom:-1px;background-color:#f5f5f5;border:1px solid #c3c4c7;border-width:1px 0;box-shadow:0 1px 1px rgba(0,0,0,.04);position:relative}#simpay-payment-form-settings .simpay-show-if,#simpay-payment-form-settings .simpay-panel-hidden{display:none}#simpay-payment-form-settings .simpay-payment-methods{border:1px solid #ccd0d4;border-radius:4px;box-shadow:0 1px 1px rgba(0,0,0,.04)}#simpay-payment-form-settings .simpay-panel-field-payment-method{display:block;border-top:1px solid #ccd0d4;padding:7px;box-sizing:border-box}#simpay-payment-form-settings .simpay-panel-field-payment-method:first-child{border-top:0;border-top-left-radius:4px;border-top-right-radius:4px}#simpay-payment-form-settings .simpay-panel-field-payment-method__enable{display:flex;align-items:center}#simpay-payment-form-settings .simpay-panel-field-payment-method__enable input[type=checkbox]{margin-top:0;margin-right:8px}#simpay-payment-form-settings .simpay-panel-field-payment-method__help{text-decoration:none}#simpay-payment-form-settings .simpay-panel-field-payment-method__help .dashicons{font-size:18px;width:18px;height:18px}#simpay-payment-form-settings .simpay-panel-field-payment-method__restrictions,#simpay-payment-form-settings .simpay-panel-field-payment-method__restrictions-ach{margin-left:72px}#simpay-payment-form-settings .simpay-panel-field-payment-method__icon{border-radius:3px;overflow:hidden;margin:0 8px 0 5px;width:30px;height:30px;flex-shrink:0}#simpay-payment-form-settings .simpay-panel-field-payment-method__icon svg{width:30px;height:30px}#simpay-payment-form-settings .simpay-panel-field-payment-method__configure{display:flex;align-items:center;justify-content:center}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metaboxes:not(.is-empty),#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metaboxes:not(.is-empty){border:1px solid #ccd0d4;box-shadow:0 1px 1px rgba(0,0,0,.04);border-radius:4px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-handlediv,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-handlediv{display:none;float:right;width:36px;height:36px;margin:0;padding:0;border:0;background:none;cursor:pointer;display:block}#simpay-global-settings .simpay-metaboxes-wrapper .postbox.closed .simpay-handlediv .toggle-indicator:before,#simpay-form-settings .simpay-metaboxes-wrapper .postbox.closed .simpay-handlediv .toggle-indicator:before{content:""}#simpay-global-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv:focus,#simpay-form-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv:focus{outline:0}#simpay-global-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv:focus .toggle-indicator:before,#simpay-form-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv:focus .toggle-indicator:before{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}#simpay-global-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv .toggle-indicator:before,#simpay-form-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv .toggle-indicator:before{margin-top:4px;width:20px;border-radius:50%;text-indent:-1px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox{background:#fff;border:1px solid #ccd0d4;margin:0 -1px -1px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .hndle,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .hndle{border:0}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox select,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox select{font-weight:400}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox:first-of-type,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox:first-of-type{margin-top:-1px;border-top-left-radius:4px;border-top-right-radius:4px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox:last-of-type,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox:last-of-type{margin-bottom:-1px;border-bottom-left-radius:4px;border-bottom-right-radius:4px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox:last-of-type .simpay-metabox-content,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox:last-of-type .simpay-metabox-content{border-bottom-left-radius:4px;border-bottom-right-radius:4px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2{cursor:pointer;display:flex;align-items:center;padding:10px 0 10px 12px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .simpay-field-type,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .simpay-field-type{font-size:90%;color:gray;font-weight:normal;text-decoration:none;margin-left:10px}@media screen and (max-width: 782px){#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .simpay-field-type,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .simpay-field-type{display:none}}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .dashicons-handle,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .dashicons-handle{cursor:move}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 strong,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 strong{font-size:95%;margin-left:8px;display:flex;align-items:center;flex-grow:1}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 svg,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 svg{border-radius:3px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 select,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 select{font-family:sans-serif;max-width:20%;margin:.25em .25em .25em 0}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2.fixed,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2.fixed{cursor:pointer !important}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .dashicons-menu,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .dashicons-menu{cursor:move}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions{padding:9px 18px;justify-content:space-between;display:flex;align-items:center}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id{display:flex;align-items:center}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id input,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id input{margin:0 2px 0 5px;width:50px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id a,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id a{text-decoration:none}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .button-link.simpay-remove-field-link,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .button-link.simpay-remove-field-link{color:#a00}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .button-link.simpay-remove-field-link:hover,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .button-link.simpay-remove-field-link:hover{color:#dc3232}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox table,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox table{border-spacing:0;width:100%}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox table.simpay-inner-table,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox table.simpay-inner-table{border:none;padding:0 1em}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox table tr td,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox table tr td{border-bottom-color:#ccd0d4}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-remove-plan,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-remove-plan{color:#a00}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-custom-field-payment-button .dashicons-menu,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-custom-field-payment-button .dashicons-menu{visibility:hidden}#simpay-global-settings .sortable-placeholder,#simpay-form-settings .sortable-placeholder{margin:5px;display:block;min-height:36px}#simpay-global-settings .chosen-container,#simpay-form-settings .chosen-container{min-width:20em;max-width:30em}#simpay-global-settings .simpay-field.simpay-small-text,#simpay-form-settings .simpay-field.simpay-small-text{width:7em}#simpay-global-settings .simpay-field.simpay-medium-text,#simpay-form-settings .simpay-field.simpay-medium-text{width:15em}#simpay-global-settings .simpay-field-radios ul,#simpay-form-settings .simpay-field-radios ul{margin:0}#simpay-global-settings .simpay-field-radios>i,#simpay-form-settings .simpay-field-radios>i{margin-left:5px;vertical-align:middle}#simpay-global-settings ul.simpay-field-radios-inline,#simpay-form-settings ul.simpay-field-radios-inline{margin:0 0 -10px}#simpay-global-settings ul.simpay-field-radios-inline li,#simpay-form-settings ul.simpay-field-radios-inline li{display:inline-block;margin:0 10px 10px 0}#simpay-global-settings ul.simpay-field-radios-inline li:last-child,#simpay-form-settings ul.simpay-field-radios-inline li:last-child{margin-right:0}#simpay-global-settings .simpay-currency-field,#simpay-form-settings .simpay-currency-field{display:flex;align-items:center}>#simpay-global-settings .simpay-currency-field:focus,>#simpay-form-settings .simpay-currency-field:focus{position:relative;z-index:5}#simpay-global-settings .simpay-currency-symbol,#simpay-form-settings .simpay-currency-symbol{margin:0;padding-left:8px;padding-right:8px;line-height:28px;font-size:14px}@media screen and (max-width: 782px){#simpay-global-settings .simpay-currency-symbol,#simpay-form-settings .simpay-currency-symbol{line-height:38px}}#simpay-global-settings .simpay-currency-symbol-left,#simpay-form-settings .simpay-currency-symbol-left{border-top-left-radius:4px;border-bottom-left-radius:4px}#simpay-global-settings .simpay-currency-symbol-right,#simpay-form-settings .simpay-currency-symbol-right{border-top-right-radius:4px;border-bottom-right-radius:4px}#simpay-global-settings div.simpay-currency-symbol,#simpay-form-settings div.simpay-currency-symbol{border-color:#7e8993;border-style:solid;background-color:#fff}#simpay-global-settings select.simpay-currency-symbol,#simpay-form-settings select.simpay-currency-symbol{padding-right:25px}#simpay-global-settings .simpay-currency-symbol-left,#simpay-form-settings .simpay-currency-symbol-left{border-width:1px 0 1px 1px}#simpay-global-settings .simpay-currency-symbol-left+.simpay-field-amount,#simpay-form-settings .simpay-currency-symbol-left+.simpay-field-amount{border-radius:0 4px 4px 0}#simpay-global-settings .simpay-currency-symbol-right,#simpay-form-settings .simpay-currency-symbol-right{border-width:1px 1px 1px 0}#simpay-global-settings .simpay-field-amount,#simpay-form-settings .simpay-field-amount{margin:0;padding-left:8px;padding-right:8px;font-size:14px;width:6em;position:relative;z-index:2;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px}#simpay-global-settings .simpay-error,#simpay-form-settings .simpay-error{color:red}#simpay-global-settings .simpay-docs-link-wrap,#simpay-form-settings .simpay-docs-link-wrap{position:absolute;right:0;bottom:0;color:#666;font-size:13px;font-style:italic;padding:15px 18px}#simpay-global-settings .simpay-docs-link-wrap a .dashicons-editor-help,#simpay-form-settings .simpay-docs-link-wrap a .dashicons-editor-help{color:#666;text-decoration:none;width:17px;height:17px;font-size:17px;padding-left:4px}#simpay-global-settings .simpay-docs-icon,#simpay-form-settings .simpay-docs-icon{color:#666}#simpay-global-settings .simpay-docs-icon,#simpay-global-settings .simpay-docs-icon .dashicons-editor-help,#simpay-form-settings .simpay-docs-icon,#simpay-form-settings .simpay-docs-icon .dashicons-editor-help{text-decoration:none;width:17px;height:17px;font-size:17px}.button.button-primary.simpay-upgrade-btn{background-color:#428bca;border:1px solid #428bca;color:#fff;display:inline-block}.button.button-primary.simpay-upgrade-btn:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px #2d6ca2}.button.button-primary.simpay-upgrade-btn:hover{background-color:#037ad0;border:1px solid #428bca}.simpay-upgrade-btn-subtext{color:#3c434a;font-size:14px;line-height:1.5;text-align:center;margin:40px 0 0;padding:30px 35px 20px;background-color:#fcf9e8;border:3px solid #ebe29a;border-radius:4px;position:relative}.simpay-upgrade-btn-subtext svg{background:#00a32a;fill:#fff;border-radius:50%;border:3px solid #ebe29a;width:28px;height:28px;position:absolute;top:-14px;left:50%;margin-left:-14px}.simpay-upgrade-btn-subtext u{text-decoration:none;font-weight:bold;color:#00a32a}.simpay-upgrade-btn-subtext a{text-decoration:none;display:block;margin-top:6px;font-weight:bold}.post-type-simple-pay #post-body-content{display:none}.simpay-card{margin:0 0 20px;padding:30px;background:#fff;border:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04)}.simpay-card,.simpay-card p{line-height:1.5;font-size:16px}.simpay-card h3{line-height:1.6;font-size:18px;margin:0 0 20px;color:#23282c}.simpay-card p{margin:0 0 20px}.simpay-card p:last-child,.simpay-card ul:last-child{margin-bottom:0}.simpay-card figure{float:right;margin:0 0 30px 30px;max-width:400px}.simpay-card figure iframe,.simpay-card figure img{max-width:100%}.simpay-card figure figcaption{text-align:center}@media screen and (max-width: 782px){.simpay-card figure{margin:0 0 30px;max-width:100%;float:none}}.simpay-doc-suggestions{width:100%;display:flex;flex-wrap:wrap;padding:0}.simpay-doc-suggestion{text-align:center;display:flex;flex-direction:column;justify-content:center;align-items:center;flex:0 1 33.333%;padding:30px;border-right:1px solid #c3c4c7;box-sizing:border-box}.simpay-doc-suggestion:nth-child(3n){border-right:0}@media screen and (max-width: 782px){.simpay-doc-suggestion{flex:0 1 100%;border-bottom:1px solid #c3c4c7;border-right:0}.simpay-doc-suggestion:last-child{border-bottom:0}}.simpay-doc-suggestion h3{font-size:20px;margin-bottom:10px}.simpay-doc-suggestion p{font-size:15px}.simpay-doc-suggestion .dashicons{font-size:40px;width:40px;height:40px;display:block;margin-bottom:10px}.simpay-doc-suggestion .button-large{font-size:16px}.simpay-addons{display:flex;flex-wrap:wrap;justify-content:space-between;margin:20px 0}.simpay-addon{background:#fff;border:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04);margin-bottom:20px;display:flex;flex-direction:column;flex-basis:calc(33% - 10px);box-sizing:border-box}@media screen and (max-width: 782px){.simpay-addon{flex-basis:100%}}.simpay-addon img{float:left;max-width:75px}.simpay-addon h5{margin:0 0 10px 100px;font-size:16px}.simpay-addon__details{padding:20px;flex:1 0 auto}.simpay-addon__actions{display:flex;align-items:center;justify-content:space-between;flex:0 1 auto;background-color:#f7f7f7;border-top:1px solid #ddd;margin-top:auto;padding:20px;position:relative}.simpay-addon__actions .msg{text-align:center;justify-content:center;display:flex;align-items:center;position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;background-color:#f7f7f7;z-index:3}.simpay-addon .error,.simpay-addon .status-label.status-installed{color:#d63638}.simpay-addon .success,.simpay-addon .status-label.status-active{color:#00a32a}.simpay-addon .addon-desc{margin:0 0 0 100px}.form-table td .simpay-stripe-connect-help{margin:15px 0;display:flex;align-items:center}.form-table td .simpay-stripe-connect-help .dashicons{margin-right:4px}.simpay-currency-field{display:flex;align-items:center}>.simpay-currency-field:focus{position:relative;z-index:5}.simpay-currency-symbol{margin:0;padding-left:8px;padding-right:8px;line-height:28px;font-size:14px}@media screen and (max-width: 782px){.simpay-currency-symbol{line-height:38px}}.simpay-currency-symbol-left{border-top-left-radius:4px;border-bottom-left-radius:4px}.simpay-currency-symbol-right{border-top-right-radius:4px;border-bottom-right-radius:4px}div.simpay-currency-symbol{border-color:#7e8993;border-style:solid;background-color:#fff}select.simpay-currency-symbol{padding-right:25px}.simpay-currency-symbol-left{border-width:1px 0 1px 1px}.simpay-currency-symbol-left+.simpay-field-amount{border-radius:0 4px 4px 0}.simpay-currency-symbol-right{border-width:1px 1px 1px 0}.simpay-field-amount{margin:0;padding-left:8px;padding-right:8px;font-size:14px;width:6em;position:relative;z-index:2;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px}.simpay-template-explorer-open .show-settings{display:none !important}.simpay-branding-bar{margin:0 -20px;padding:14px 22px;background:#fff;border-bottom:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04);width:calc(100% + 20px);display:flex;justify-content:space-between;box-sizing:border-box}.site-health .simpay-branding-bar{display:none}.simpay-branding-bar__title{display:flex;align-items:center;margin:8px 0}.simpay-branding-bar__logo{width:200px}.simpay-branding-bar__divider{color:#dadbdf;font-size:23px;font-weight:400;margin:0 15px}.simpay-branding-bar__actions{display:flex;align-items:center}.simpay-branding-bar__actions>div{margin-left:10px;min-width:40px}.simpay-branding-bar__actions-button{color:#000;cursor:pointer;padding:10px;width:40px;height:40px;background-color:#f3f4f5;border-radius:50%;border:0;box-shadow:none;position:relative;transition:background-color .2s ease;box-sizing:border-box;display:block}.simpay-branding-bar__actions-button:hover{background-color:#e5e5e5}.simpay-branding-bar__actions-button:active,.simpay-branding-bar__actions-button:focus{box-shadow:0 0 0 2px var(--wp-admin-theme-color)}.simpay-branding-bar__actions-button-count{font-weight:600;font-size:10px;line-height:16px;color:#fff;margin:0;background-color:#df2a4a;border-radius:100%;width:16px;height:16px;position:absolute;top:-8px;left:50%;margin-left:-8px}.simpay-branding-bar .wp-heading-inline{font-size:23px;font-weight:400;margin:0}.simpay-branding-bar .page-title-action{font-weight:600;font-size:13px;line-height:normal;cursor:pointer;text-shadow:none;text-decoration:none;margin-left:10px;padding:4px 8px;border:1px solid currentColor;border-radius:2px;background:#f6f7f7}.simpay-landing-zone{text-align:center;max-width:700px;margin:40px auto}.simpay-landing-zone__title{font-size:26px;font-weight:600;margin:0 0 1.5rem;padding:0}.simpay-landing-zone__subtitle{font-size:17px;color:#666;margin:.25rem 0}.simpay-landing-zone__subtitle strong{color:#444}.simpay-landing-zone section{margin:2rem 0}.simpay-landing-zone__empty-state-graphic img{width:425px}.simpay-landing-zone__screenshot>*{vertical-align:middle}.simpay-landing-zone__screenshot-img{display:inline-block;position:relative;width:315px;padding:5px;background-color:#fff;box-shadow:0px 2px 5px 0px rgba(0,0,0,.05);border-radius:3px}.simpay-landing-zone__screenshot-img img{max-width:100%;display:block}.simpay-landing-zone__screenshot-img .hover{position:absolute;opacity:0;height:calc(100% - 10px);width:calc(100% - 10px);top:0;left:0;border:5px solid #fff;background-color:rgba(0,0,0,.15);background-image:url(data:image/svg+xml;base64,PHN2ZyBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjojZmZmZmZmMDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCIgaGVpZ2h0PSIxMDAiPjxwYXRoIGQ9Ik01MCAwYzI3LjYxNCAwIDUwIDIyLjM4NiA1MCA1MHMtMjIuMzg2IDUwLTUwIDUwUzAgNzcuNjE0IDAgNTAgMjIuMzg2IDAgNTAgMHoiIGZpbGw9IiMxNjg1YjciLz48cGF0aCBkPSJNNzMuMDIzIDY3LjA2N2wtOS4zNDQtOS4zNDRhMi4yNDcgMi4yNDcgMCAwMC0xLjU5My0uNjU2aC0xLjUyOGExOS4zOTkgMTkuMzk5IDAgMDA0LjEyNC0xMS45OTZjMC0xMC43Ny04LjcyNS0xOS40OTUtMTkuNDk0LTE5LjQ5NS0xMC43NjggMC0xOS40OTQgOC43MjYtMTkuNDk0IDE5LjQ5NSAwIDEwLjc2OCA4LjcyNiAxOS40OTMgMTkuNDk0IDE5LjQ5M2ExOS40IDE5LjQgMCAwMDExLjk5Ny00LjEyM3YxLjUyN2MwIC42LjIzNCAxLjE3Mi42NTUgMS41OTRsOS4zNDQgOS4zNDRhMi4yNCAyLjI0IDAgMDAzLjE3OCAwbDIuNjUyLTIuNjUzYTIuMjYgMi4yNiAwIDAwLjAxLTMuMTg2em0tMjcuODM1LTEwYy02LjYyNiAwLTExLjk5Ni01LjM2MS0xMS45OTYtMTEuOTk2IDAtNi42MjcgNS4zNi0xMS45OTcgMTEuOTk2LTExLjk5NyA2LjYyNiAwIDExLjk5NyA1LjM2MSAxMS45OTcgMTEuOTk3IDAgNi42MjYtNS4zNjEgMTEuOTk2LTExLjk5NyAxMS45OTZ6IiBmaWxsPSIjZmZmIi8+PC9zdmc+);background-repeat:no-repeat;background-position:center;background-size:50px;transition:all .3s}.simpay-landing-zone__screenshot-img:hover .hover{opacity:1;transition:all .3s}.simpay-landing-zone__screenshot ul{text-align:left;display:inline-block;margin:0 0 0 30px;list-style-type:none;max-width:calc(100% - 350px)}@media screen and (max-width: 782px){.simpay-landing-zone__screenshot ul{text-align:center;margin:30px auto;max-width:100%;display:block}}.simpay-landing-zone__screenshot li{margin:16px 0;padding:0;font-size:15px;color:#777;position:relative}.simpay-landing-zone__screenshot li:before{content:"";background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGQ9Ik0xMy43NzYyIDYuNDU2MDVMOC43MjAzMiAxLjQwMDA1QzguNTc1OTkgMS4yNTU3MiA4LjM4MzY0IDEuMTc2NSA4LjE3ODUzIDEuMTc2NUM3Ljk3MzIgMS4xNzY1IDcuNzgwOTYgMS4yNTU4NCA3LjYzNjY0IDEuNDAwMDVMNy4xNzc2IDEuODU5MkM3LjAzMzM5IDIuMDAzMjkgNi45NTM5NSAyLjE5NTc2IDYuOTUzOTUgMi40MDA5OEM2Ljk1Mzk1IDIuNjA2MDggNy4wMzMzOSAyLjgwNTA0IDcuMTc3NiAyLjk0OTE0TDEwLjEyNzEgNS45MDUxNkgwLjc1NjMzNEMwLjMzMzgzNCA1LjkwNTE2IDAgNi4yMzU5MiAwIDYuNjU4NTRWNy4zMDc2NUMwIDcuNzMwMjcgMC4zMzM4MzQgOC4wOTQzOCAwLjc1NjMzNCA4LjA5NDM4SDEwLjE2MDZMNy4xNzc3MiAxMS4wNjY5QzcuMDMzNTEgMTEuMjExMiA2Ljk1NDA2IDExLjM5ODUgNi45NTQwNiAxMS42MDM3QzYuOTU0MDYgMTEuODA4NyA3LjAzMzUxIDExLjk5ODYgNy4xNzc3MiAxMi4xNDI4TDcuNjM2NzUgMTIuNjAwNUM3Ljc4MTA3IDEyLjc0NDggNy45NzMzMiAxMi44MjM1IDguMTc4NjUgMTIuODIzNUM4LjM4Mzc1IDEyLjgyMzUgOC41NzYxMSAxMi43NDM4IDguNzIwNDMgMTIuNTk5NUwxMy43NzYzIDcuNTQzNkMxMy45MjEgNy4zOTg4MiAxNC4wMDA1IDcuMjA1NTYgMTQgNy4wMDAxMUMxNC4wMDA0IDYuNzkzOTggMTMuOTIxIDYuNjAwNiAxMy43NzYyIDYuNDU2MDVWNi40NTYwNVoiIGZpbGw9IiM0MjhCQ0EiLz4NCjwvc3ZnPg0K);background-position:center;background-repeat:no-repeat;background-size:14px;width:14px;height:14px;display:inline-block;margin:-3px 5px 0 0;vertical-align:middle}.simpay-landing-zone .button.button-large{font-size:17px;line-height:30px;padding:10px 20px}.simpay-landing-zone__purchased{display:block;margin:15px 0 0}.simpay-upgrade-modal,.simpay-upgrade-upe-modal{padding:0 !important}.simpay-upgrade-modal *,.simpay-upgrade-upe-modal *{box-sizing:border-box}.simpay-upgrade-modal__content,.simpay-upgrade-upe-modal__content{text-align:center;display:flex;flex-direction:column;align-items:center;padding:16px 32px 32px}.simpay-upgrade-modal__content>.dashicons,.simpay-upgrade-upe-modal__content>.dashicons{color:#333;font-size:48px;width:48px;height:48px}.simpay-upgrade-modal__title,.simpay-upgrade-upe-modal__title{font-size:22px;line-height:1.5;display:block;margin:12px 0 0}.simpay-upgrade-modal__description,.simpay-upgrade-upe-modal__description{color:#777;font-size:16px;margin:16px 0 24px}.simpay-upgrade-modal__description strong,.simpay-upgrade-upe-modal__description strong{color:#333}.simpay-upgrade-modal__discount,.simpay-upgrade-upe-modal__discount{font-size:15px;text-align:center;margin:32px -32px -32px;padding:24px 40px;background-color:#fcf9e8;position:relative}.simpay-upgrade-modal__discount svg,.simpay-upgrade-upe-modal__discount svg{background:#00a32a;fill:#fff;border-radius:50%;border:4px solid #fff;width:32px;height:32px;position:absolute;top:-16px;left:50%;margin-left:-16px}.simpay-upgrade-modal__discount u,.simpay-upgrade-upe-modal__discount u{text-decoration:none;font-weight:bold;color:#00a32a}.simpay-upgrade-modal .button-large,.simpay-upgrade-upe-modal .button-large{font-size:16px;font-weight:bold;margin:0 0 15px;padding:8px 30px !important;height:auto}.simpay-teaser-float{margin:50px;position:relative}.simpay-teaser-float__card{text-align:center;padding:30px;background:#fff;border-radius:4px;box-shadow:0 0 30px 15px rgba(0,0,0,.18);position:relative;z-index:2}#poststuff .simpay-teaser-float h2,.simpay-teaser-float h2{font-size:24px;font-weight:600;margin:0;padding:0}.simpay-teaser-float p{font-size:15px;line-height:1.35;color:#666}.simpay-teaser-float p strong{color:#444}.simpay-teaser-float ul{text-align:left;display:inline-block;margin:-10px 0 20px;list-style-type:none}.simpay-teaser-float li{margin:16px 0;padding:0 0 0 24px;font-size:15px;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGQ9Ik0xMy43NzYyIDYuNDU2MDVMOC43MjAzMiAxLjQwMDA1QzguNTc1OTkgMS4yNTU3MiA4LjM4MzY0IDEuMTc2NSA4LjE3ODUzIDEuMTc2NUM3Ljk3MzIgMS4xNzY1IDcuNzgwOTYgMS4yNTU4NCA3LjYzNjY0IDEuNDAwMDVMNy4xNzc2IDEuODU5MkM3LjAzMzM5IDIuMDAzMjkgNi45NTM5NSAyLjE5NTc2IDYuOTUzOTUgMi40MDA5OEM2Ljk1Mzk1IDIuNjA2MDggNy4wMzMzOSAyLjgwNTA0IDcuMTc3NiAyLjk0OTE0TDEwLjEyNzEgNS45MDUxNkgwLjc1NjMzNEMwLjMzMzgzNCA1LjkwNTE2IDAgNi4yMzU5MiAwIDYuNjU4NTRWNy4zMDc2NUMwIDcuNzMwMjcgMC4zMzM4MzQgOC4wOTQzOCAwLjc1NjMzNCA4LjA5NDM4SDEwLjE2MDZMNy4xNzc3MiAxMS4wNjY5QzcuMDMzNTEgMTEuMjExMiA2Ljk1NDA2IDExLjM5ODUgNi45NTQwNiAxMS42MDM3QzYuOTU0MDYgMTEuODA4NyA3LjAzMzUxIDExLjk5ODYgNy4xNzc3MiAxMi4xNDI4TDcuNjM2NzUgMTIuNjAwNUM3Ljc4MTA3IDEyLjc0NDggNy45NzMzMiAxMi44MjM1IDguMTc4NjUgMTIuODIzNUM4LjM4Mzc1IDEyLjgyMzUgOC41NzYxMSAxMi43NDM4IDguNzIwNDMgMTIuNTk5NUwxMy43NzYzIDcuNTQzNkMxMy45MjEgNy4zOTg4MiAxNC4wMDA1IDcuMjA1NTYgMTQgNy4wMDAxMUMxNC4wMDA0IDYuNzkzOTggMTMuOTIxIDYuNjAwNiAxMy43NzYyIDYuNDU2MDVWNi40NTYwNVoiIGZpbGw9IiM0MjhCQ0EiLz4NCjwvc3ZnPg0K);background-position:left 3px;background-repeat:no-repeat;background-size:14px;color:#777}.simpay-teaser-float .button.button-large{font-size:17px;line-height:30px;padding:10px 20px}.simpay-teaser-float .simpay-notice-dismiss{position:absolute;top:0;right:0;font-size:20px;color:#666;font-weight:bold;text-decoration:none;margin-left:5px;padding:6px 10px;z-index:2}.simpay-teaser-float .simpay-notice-dismiss:hover,.simpay-teaser-float .simpay-notice-dismiss:active,.simpay-teaser-float .simpay-notice-dismiss:focus{color:#666;text-decoration:none}.simpay-teaser-float:after,.simpay-teaser-float:before{opacity:.75;z-index:0;content:"";position:absolute;left:-30px;right:-30px;top:-35px;width:calc(100% + 60px);height:170px;background-image:linear-gradient(#ddd, #ddd),linear-gradient(#eee, #eee),linear-gradient(#ddd, #ddd),linear-gradient(#eee, #eee);background-repeat:no-repeat;background-size:100% 20px,100% 40px,100% 20px,100% 40px;background-position:0 0,0 30px,0 100px,0 130px}.simpay-teaser-float:before{top:170px}.simpay-teaser-float .simpay-upgrade-btn-subtext{margin:24px -30px -30px;padding:32px 40px;border-bottom-left-radius:2px;border-bottom-right-radius:2px;border:0}.simpay-teaser-float .simpay-upgrade-btn-subtext svg{border-color:#fff}.simpay-teaser-float--inline{margin:40px 30px 30px}.simpay-teaser-float--inline .simpay-teaser-float__card{padding:30px;box-shadow:0 0 12px 6px rgba(0,0,0,.16)}#poststuff .simpay-teaser-float--inline h2,.simpay-teaser-float--inline h2{font-size:20px}.simpay-teaser-float--inline p{font-size:15px;margin:.75rem 0}.simpay-teaser-float--inline .button.button-large{font-size:15px;line-height:24px;margin:1rem 0;padding:8px 14px;display:inline-block}.simpay-teaser-float--inline:before,.simpay-teaser-float--inline:after{opacity:.6}.simpay-teaser-float--inline:before{display:none}.simpay-teaser-float--inline:after{top:15px}.simpay-form-settings-notice{font-weight:normal;color:#1d2327;position:relative;margin:18px 18px 0;padding:14px;border-radius:4px;background:#f5f5ff}.simpay-form-settings-notice a{color:#635aff}.simpay-form-settings-notice .simpay-external-link .dashicons-external{margin:1px 0 0 2px}.simpay-form-settings-notice strong{font-size:14px}.simpay-form-settings-notice p{margin:5px 0 0 23px}.simpay-form-settings-notice .simpay-notice-dismiss{font-size:20px;color:#b0b0f0;font-weight:bold;line-height:1;position:absolute;top:0;right:5px;text-decoration:none;padding:0 5px;z-index:2}.simpay-form-settings-notice .simpay-notice-dismiss:hover,.simpay-form-settings-notice .simpay-notice-dismiss:active,.simpay-form-settings-notice .simpay-notice-dismiss:focus{color:#9191ef;text-decoration:none;background:none}.simpay-settings .simpay-form-settings-notice{border:2px solid #645aff;box-shadow:0 1px 1px rgba(0,0,0,.04)}.post-type-simple-pay .lity{z-index:999999999;padding:20px}.post-type-simple-pay .lity-close{margin:10px}.post-type-simple-pay .lity-content{max-width:80vw;max-height:80vh}.post-type-simple-pay .lity-content img{max-height:80vh !important;max-width:80vw !important}#wpsp-api-keys-row-hide{display:none}.post-type-simple-pay #post-preview:not(.simpay-preview-button){display:none}.simpay-license-field-wrapper{margin:20px 0}#simpay-settings-license-key-license-key{margin:0}#simpay-settings-license-key-license-key[readonly]{background:#fff}.simpay-license-message__loading,.simpay-license-field{display:flex;align-items:center}.wp-core-ui .button.simpay-license-button.button-primary,.wp-core-ui .button.simpay-license-button.button-secondary{font-size:1rem;line-height:1;margin:0 8px;padding:13px}.simpay-license-message{font-size:15px;margin-top:8px}.simpay-license-message--valid{color:#15803d}.simpay-license-message--invalid{color:#b91c1c}.simpay-recaptcha-payment-form-feedback .dashicons{margin-top:-1px;display:inline-block}.simpay-recaptcha-payment-form-feedback .dashicons-update-alt{animation:rotation 2s infinite linear}.simpay-form-builder-inset-settings{margin:3px 0 0 24px}fieldset.simpay-form-builder-inset-settings>*:not(legend){margin:5px 0 8px}.simpay-form-builder-inset-settings>*:last-child{margin-bottom:0}.simpay-form-builder-inventory-control{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;padding:6px 8px;box-shadow:0 0 0 rgba(0,0,0,0);transition:box-shadow .1s linear;border-radius:2px;border:1px solid #757575;font-size:16px;line-height:normal;margin:0;padding:0;width:auto;display:inline-flex;align-items:center}@media(prefers-reduced-motion: reduce){.simpay-form-builder-inventory-control{transition-duration:0s;transition-delay:0s}}@media(min-width: 600px){.simpay-form-builder-inventory-control{font-size:13px;line-height:normal}}.simpay-form-builder-inventory-control:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid rgba(0,0,0,0)}.simpay-form-builder-inventory-control::-webkit-input-placeholder{color:rgba(30,30,30,.62)}.simpay-form-builder-inventory-control::-moz-placeholder{opacity:1;color:rgba(30,30,30,.62)}.simpay-form-builder-inventory-control:-ms-input-placeholder{color:rgba(30,30,30,.62)}.simpay-form-builder-inventory-control:focus-within{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid rgba(0,0,0,0)}.simpay-form-builder-inventory-control input[type=number]{border:0;box-shadow:none;background:none;border-radius:0;width:75px}.simpay-form-builder-inventory-control input[type=number]:focus{border:0;box-shadow:none;outline:0}.simpay-form-builder-inventory-control+label{margin-left:8px}.simpay-form-builder-inventory-control__initial{color:#757575;font-size:16px;line-height:normal;padding-right:8px}@media(min-width: 600px){.simpay-form-builder-inventory-control__initial{font-size:13px;line-height:normal}}.simpay-form-builder-inventory-control__initial:before{content:"/";display:inline-block;vertical-align:top;margin-top:-1px}.simpay-form-builder-purchase-restrictions__restriction-item{display:flex;align-items:center;margin-top:8px;margin-bottom:8px}.simpay-form-builder-purchase-restrictions__restriction-item label{margin-left:8px}.simpay-form-builder-purchase-restrictions__restriction-item-datetime{display:flex;align-items:center}.simpay-form-builder-purchase-restrictions__restriction-item-datetime>*{margin-right:10px}.simpay-form-builder-purchase-restrictions__restriction-item-datetime span{color:#757575}.simpay-form-builder-fee-recovery__amounts{display:flex;align-items:center;margin-top:5px}.simpay-form-builder-fee-recovery ::-webkit-input-placeholder{color:#b7bec7}.simpay-form-builder-fee-recovery ::-moz-placeholder{color:#b7bec7;opacity:1}.simpay-form-builder-fee-recovery :-ms-input-placeholder{color:#b7bec7}.simpay-form-builder-fee-recovery>*{margin-right:8px}.simpay-form-builder-fee-percent-control{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;padding:6px 8px;box-shadow:0 0 0 rgba(0,0,0,0);transition:box-shadow .1s linear;border-radius:2px;border:1px solid #757575;font-size:16px;line-height:normal;margin:0;padding:0;width:auto;display:inline-flex;align-items:center}@media(prefers-reduced-motion: reduce){.simpay-form-builder-fee-percent-control{transition-duration:0s;transition-delay:0s}}@media(min-width: 600px){.simpay-form-builder-fee-percent-control{font-size:13px;line-height:normal}}.simpay-form-builder-fee-percent-control:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid rgba(0,0,0,0)}.simpay-form-builder-fee-percent-control::-webkit-input-placeholder{color:rgba(30,30,30,.62)}.simpay-form-builder-fee-percent-control::-moz-placeholder{opacity:1;color:rgba(30,30,30,.62)}.simpay-form-builder-fee-percent-control:-ms-input-placeholder{color:rgba(30,30,30,.62)}.simpay-form-builder-fee-percent-control:focus-within{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid rgba(0,0,0,0)}.simpay-form-builder-fee-percent-control input[type=number]{border:0;box-shadow:none;background:none;border-radius:0;width:75px}.simpay-form-builder-fee-percent-control input[type=number]:focus{border:0;box-shadow:none;outline:0}.simpay-form-builder-fee-percent-control+label{margin-left:8px}.simpay-form-builder-fee-percent-control__suffix{color:#757575;font-size:16px;line-height:normal;padding-right:8px}@media(min-width: 600px){.simpay-form-builder-fee-percent-control__suffix{font-size:13px;line-height:normal}}.simpay-form-builder-automations__cta{margin:24px 0 6px;text-align:center}.simpay-form-builder-automator{padding:16px 4px 26px !important}.simpay-form-builder-automator,.simpay-form-builder-automator *{box-sizing:border-box}.simpay-form-builder-automator input[type=search]{font-size:15px;padding:2px 8px}.simpay-form-builder-automator__integrations{display:grid;grid-template-columns:repeat(4, minmax(0, 1fr));grid-column-gap:16px;grid-row-gap:16px;margin:18px -18px 0;padding:0 18px 10px;width:calc(100% + 36px);max-height:400px;overflow-y:scroll}.simpay-form-builder-automator__integrations-integration{color:initial;text-align:center;text-decoration:none;background:#fff;border:1px solid #eee;border-radius:4px;box-shadow:0 1px 3px 0 rgba(0,0,0,.03);transition:all ease-in .15s}.simpay-form-builder-automator__integrations-integration img{display:block;margin:16px auto;height:50px}.simpay-form-builder-automator__integrations-integration span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:8px 16px;display:block;border-top:1px solid #eee}.simpay-form-builder-automator__integrations-integration:hover{cursor:pointer;border-color:#ddd;box-shadow:0 2px 4px 0 rgba(0,0,0,.06)}body.site-health #wpbody-content,body.post-type-simple-pay #wpbody-content{padding-bottom:200px}#wpfooter .simpay-footer-promotion{text-align:center;font-weight:400;font-size:13px;line-height:16px;color:#787c82;padding:20px 0 30px 0;margin-bottom:20px}#wpfooter .simpay-footer-promotion p{font-weight:600}#wpfooter .simpay-footer-promotion-links,#wpfooter .simpay-footer-promotion-social{display:flex;justify-content:center;align-items:center}#wpfooter .simpay-footer-promotion-links{margin:9px 0 0}#wpfooter .simpay-footer-promotion-links span{color:#c3c4c7;padding:0 7px}#wpfooter .simpay-footer-promotion-social{margin:10px 0 0 0;gap:10px}#wpfooter .simpay-footer-promotion-social li{margin-bottom:0}#wpfooter .simpay-footer-promotion-social li:hover path{fill:#50575e}#wpfooter .simpay-footer-promotion-social a{display:block;height:16px}.simpay-settings-is_upe td{background:#fff;border:1px solid #c3c4c7;border-left-width:4px;border-left-color:#2271b1;box-shadow:0 1px 1px rgba(0,0,0,.04);padding:12px 18px} diff --git a/includes/core/assets/js/dist/simpay-admin-dashboard-widget-report-css.asset.php b/includes/core/assets/js/dist/simpay-admin-dashboard-widget-report-css.asset.php index 9781c80d..d5f13db7 100644 --- a/includes/core/assets/js/dist/simpay-admin-dashboard-widget-report-css.asset.php +++ b/includes/core/assets/js/dist/simpay-admin-dashboard-widget-report-css.asset.php @@ -1 +1 @@ - array(), 'version' => '10e0c9aefff5d3a8302d317cb61bc427'); \ No newline at end of file + array(), 'version' => '2fc5df850afb9619b482b2d36d70211f'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-dashboard-widget-report.asset.php b/includes/core/assets/js/dist/simpay-admin-dashboard-widget-report.asset.php index aff448bd..9d17f391 100644 --- a/includes/core/assets/js/dist/simpay-admin-dashboard-widget-report.asset.php +++ b/includes/core/assets/js/dist/simpay-admin-dashboard-widget-report.asset.php @@ -1 +1 @@ - array('lodash', 'react', 'wp-api-fetch', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => 'af7158193a243840baf147a2c1cd6f5e'); \ No newline at end of file + array('lodash', 'react', 'wp-api-fetch', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => 'f514bdccae609dacea820edddfa0180d'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-dashboard-widget-report.js b/includes/core/assets/js/dist/simpay-admin-dashboard-widget-report.js index 20f5f114..86fffe34 100644 --- a/includes/core/assets/js/dist/simpay-admin-dashboard-widget-report.js +++ b/includes/core/assets/js/dist/simpay-admin-dashboard-widget-report.js @@ -1,4 +1,4 @@ -!function(t){var e={};function i(n){if(e[n])return e[n].exports;var s=e[n]={i:n,l:!1,exports:{}};return t[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}i.m=t,i.c=e,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 s in t)i.d(n,s,function(e){return t[e]}.bind(null,s));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="",i(i.s=83)}([function(t,e){t.exports=window.wp.element},,function(t,e){t.exports=window.wp.i18n},function(t,e){t.exports=window.wp.components},function(t,e,i){"use strict";function n(t,e){if(e.length1?"s":"")+" required, but only "+e.length+" present")}i.d(e,"a",(function(){return n}))},function(t,e){t.exports=window.React},function(t,e,i){var n=i(26),s=i(27),r=i(22),o=i(28);t.exports=function(t,e){return n(t)||s(t,e)||r(t,e)||o()},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){"use strict";function n(t){if(null===t||!0===t||!1===t)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}i.d(e,"a",(function(){return n}))},function(t,e,i){"use strict";i.d(e,"a",(function(){return r}));var n=i(4);function s(t){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t){Object(n.a)(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||"object"===s(t)&&"[object Date]"===e?new Date(t.getTime()):"number"==typeof t||"[object Number]"===e?new Date(t):("string"!=typeof t&&"[object String]"!==e||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}},function(t,e){t.exports=window.wp.primitives},function(t,e){t.exports=window.wp.url},function(t,e,i){var n=i(30);t.exports=function(t,e,i){return(e=n(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=window.lodash},function(t,e,i){var n;!function(){"use strict";var i={}.hasOwnProperty;function s(){for(var t=[],e=0;eArray.prototype.slice.call(t));let s=!1,r=[];return function(...i){r=n(i),s||(s=!0,h.call(window,()=>{s=!1,t.apply(e,r)}))}}const u=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2;function f(){}const g=function(){let t=0;return function(){return t++}}();function p(t){return null==t}function m(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.substr(0,7)&&"Array]"===e.substr(-6)}function b(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}const x=t=>("number"==typeof t||t instanceof Number)&&isFinite(+t);function y(t,e){return x(t)?t:e}function v(t,e){return void 0===t?e:t}const _=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function w(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function M(t,e,i,n){let s,r,o;if(m(t))if(r=t.length,n)for(s=r-1;s>=0;s--)e.call(i,t[s],s);else for(s=0;si;)t=t[e.substr(i,n-i)],i=n+1,n=E(e,i);return t}function A(t){return t.charAt(0).toUpperCase()+t.slice(1)}const L=t=>void 0!==t,R=t=>"function"==typeof t,F=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0},z=Math.PI,I=2*z,N=I+z,V=Number.POSITIVE_INFINITY,W=z/180,B=z/2,H=z/4,U=2*z/3,Y=Math.log10,$=Math.sign;function X(t){const e=Math.round(t);t=G(t,e,t/1e3)?e:t;const i=Math.pow(10,Math.floor(Y(t))),n=t/i;return(n<=1?1:n<=2?2:n<=5?5:10)*i}function q(t){return!isNaN(parseFloat(t))&&isFinite(t)}function G(t,e,i){return Math.abs(t-e)l&&c=Math.min(e,i)-n&&t<=Math.max(e,i)+n}const at=t=>0===t||1===t,lt=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*I/i),ct=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*I/i)+1,ht={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*B),easeOutSine:t=>Math.sin(t*B),easeInOutSine:t=>-.5*(Math.cos(z*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>at(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>at(t)?t:lt(t,.075,.3),easeOutElastic:t=>at(t)?t:ct(t,.075,.3),easeInOutElastic(t){const e=.1125;return at(t)?t:t<.5?.5*lt(2*t,e,.45):.5+.5*ct(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-ht.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*ht.easeInBounce(2*t):.5*ht.easeOutBounce(2*t-1)+.5},dt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},ut="0123456789ABCDEF",ft=t=>ut[15&t],gt=t=>ut[(240&t)>>4]+ut[15&t],pt=t=>(240&t)>>4==(15&t);function mt(t){return t+.5|0}const bt=(t,e,i)=>Math.max(Math.min(t,i),e);function xt(t){return bt(mt(2.55*t),0,255)}function yt(t){return bt(mt(255*t),0,255)}function vt(t){return bt(mt(t/2.55)/100,0,1)}function _t(t){return bt(mt(100*t),0,100)}const wt=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/,Mt=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Ot(t,e,i){const n=e*Math.min(i,1-i),s=(e,s=(e+t/30)%12)=>i-n*Math.max(Math.min(s-3,9-s,1),-1);return[s(0),s(8),s(4)]}function kt(t,e,i){const n=(n,s=(n+t/60)%6)=>i-i*e*Math.max(Math.min(s,4-s,1),0);return[n(5),n(3),n(1)]}function St(t,e,i){const n=Ot(t,1,.5);let s;for(e+i>1&&(s=1/(e+i),e*=s,i*=s),s=0;s<3;s++)n[s]*=1-e-i,n[s]+=e;return n}function Dt(t){const e=t.r/255,i=t.g/255,n=t.b/255,s=Math.max(e,i,n),r=Math.min(e,i,n),o=(s+r)/2;let a,l,c;return s!==r&&(c=s-r,l=o>.5?c/(2-s-r):c/(s+r),a=s===e?(i-n)/c+(i=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=yt(t[3]))):(e=Rt(t,{r:0,g:0,b:0,a:1})).a=yt(e.a),e}function zt(t){return"r"===t.charAt(0)?function(t){const e=wt.exec(t);let i,n,s,r=255;if(e){if(e[7]!==i){const t=+e[7];r=255&(e[8]?xt(t):255*t)}return i=+e[1],n=+e[3],s=+e[5],i=255&(e[2]?xt(i):i),n=255&(e[4]?xt(n):n),s=255&(e[6]?xt(s):s),{r:i,g:n,b:s,a:r}}}(t):function(t){const e=Mt.exec(t);let i,n=255;if(!e)return;e[5]!==i&&(n=e[6]?xt(+e[5]):yt(+e[5]));const s=Tt(+e[2]),r=+e[3]/100,o=+e[4]/100;return i="hwb"===e[1]?function(t,e,i){return Pt(St,t,e,i)}(s,r,o):"hsv"===e[1]?function(t,e,i){return Pt(kt,t,e,i)}(s,r,o):Ct(s,r,o),{r:i[0],g:i[1],b:i[2],a:n}}(t)}class It{constructor(t){if(t instanceof It)return t;const e=typeof t;let i;var n,s,r;"object"===e?i=Ft(t):"string"===e&&(r=(n=t).length,"#"===n[0]&&(4===r||5===r?s={r:255&17*dt[n[1]],g:255&17*dt[n[2]],b:255&17*dt[n[3]],a:5===r?17*dt[n[4]]:255}:7!==r&&9!==r||(s={r:dt[n[1]]<<4|dt[n[2]],g:dt[n[3]]<<4|dt[n[4]],b:dt[n[5]]<<4|dt[n[6]],a:9===r?dt[n[7]]<<4|dt[n[8]]:255})),i=s||function(t){At||(At=function(){const t={},e=Object.keys(jt),i=Object.keys(Et);let n,s,r,o,a;for(n=0;n>16&255,r>>8&255,255&r]}return t}(),At.transparent=[0,0,0,0]);const e=At[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}(t)||zt(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Rt(this._rgb);return t&&(t.a=vt(t.a)),t}set rgb(t){this._rgb=Ft(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${vt(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):this._rgb;var t}hexString(){return this._valid?(t=this._rgb,e=function(t){return pt(t.r)&&pt(t.g)&&pt(t.b)&&pt(t.a)}(t)?ft:gt,t?"#"+e(t.r)+e(t.g)+e(t.b)+(t.a<255?e(t.a):""):t):this._rgb;var t,e}hslString(){return this._valid?function(t){if(!t)return;const e=Dt(t),i=e[0],n=_t(e[1]),s=_t(e[2]);return t.a<255?`hsla(${i}, ${n}%, ${s}%, ${vt(t.a)})`:`hsl(${i}, ${n}%, ${s}%)`}(this._rgb):this._rgb}mix(t,e){const i=this;if(t){const n=i.rgb,s=t.rgb;let r;const o=e===r?.5:e,a=2*o-1,l=n.a-s.a,c=((a*l==-1?a:(a+l)/(1+a*l))+1)/2;r=1-c,n.r=255&c*n.r+r*s.r+.5,n.g=255&c*n.g+r*s.g+.5,n.b=255&c*n.b+r*s.b+.5,n.a=o*n.a+(1-o)*s.a,i.rgb=n}return i}clone(){return new It(this.rgb)}alpha(t){return this._rgb.a=yt(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=mt(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Lt(this._rgb,2,t),this}darken(t){return Lt(this._rgb,2,-t),this}saturate(t){return Lt(this._rgb,1,t),this}desaturate(t){return Lt(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=Dt(t);i[0]=Tt(i[0]+e),i=Ct(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}function Nt(t){return new It(t)}const Vt=t=>t instanceof CanvasGradient||t instanceof CanvasPattern;function Wt(t){return Vt(t)?t:Nt(t)}function Bt(t){return Vt(t)?t:Nt(t).saturate(.5).darken(.1).hexString()}const Ht=Object.create(null),Ut=Object.create(null);function Yt(t,e){if(!e)return t;const i=e.split(".");for(let e=0,n=i.length;et.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>Bt(e.backgroundColor),this.hoverBorderColor=(t,e)=>Bt(e.borderColor),this.hoverColor=(t,e)=>Bt(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t)}set(t,e){return $t(this,t,e)}get(t){return Yt(this,t)}describe(t,e){return $t(Ut,t,e)}override(t,e){return $t(Ht,t,e)}route(t,e,i,n){const s=Yt(this,t),r=Yt(this,i),o="_"+e;Object.defineProperties(s,{[o]:{value:s[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[o],e=r[n];return b(t)?Object.assign({},e,t):v(t,e)},set(t){this[o]=t}}})}}({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function qt(t,e,i,n,s){let r=e[s];return r||(r=e[s]=t.measureText(s).width,i.push(s)),r>n&&(n=r),n}function Gt(t,e,i,n){let s=(n=n||{}).data=n.data||{},r=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(s=n.data={},r=n.garbageCollect=[],n.font=e),t.save(),t.font=e;let o=0;const a=i.length;let l,c,h,d,u;for(l=0;li.length){for(l=0;l0&&t.stroke()}}function Jt(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.xe.top-i&&t.y0&&""!==r.strokeColor;let l,c;for(t.save(),t.font=s.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),p(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,r),l=0;lv(t[i],t[e[i]]):e=>t[e]:()=>t;for(const t of s)i[t]=+r(t)||0;return i}function de(t){return he(t,{top:"y",right:"x",bottom:"y",left:"x"})}function ue(t){return he(t,["topLeft","topRight","bottomLeft","bottomRight"])}function fe(t){const e=de(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function ge(t,e){t=t||{},e=e||Xt.font;let i=v(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let n=v(t.style,e.style);n&&!(""+n).match(le)&&(console.warn('Invalid font style specified: "'+n+'"'),n="");const s={family:v(t.family,e.family),lineHeight:ce(v(t.lineHeight,e.lineHeight),i),size:i,style:n,weight:v(t.weight,e.weight),string:""};return s.string=function(t){return!t||p(t.size)||p(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(s),s}function pe(t,e,i,n){let s,r,o,a=!0;for(s=0,r=t.length;st[i]1;)n=r+s>>1,i(n)?r=n:s=n;return{lo:r,hi:s}}const xe=(t,e,i)=>be(t,i,n=>t[n][e]be(t,i,n=>t[n][e]>=i),ve=["push","pop","shift","splice","unshift"];function _e(t,e){const i=t._chartjs;if(!i)return;const n=i.listeners,s=n.indexOf(e);-1!==s&&n.splice(s,1),n.length>0||(ve.forEach(e=>{delete t[e]}),delete t._chartjs)}function we(t){const e=new Set;let i,n;for(i=0,n=t.length;it[0])){L(n)||(n=Le("_fallback",t));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:i,_fallback:n,_getTarget:s,override:s=>Me([s,...t],e,i,n)};return new Proxy(r,{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,n)=>Pe(i,n,()=>function(t,e,i,n){let s;for(const r of e)if(s=Le(Se(r,t),i),L(s))return De(t,s)?je(i,n,t,s):s}(n,e,t,i)),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>Re(t).includes(e),ownKeys:t=>Re(t),set(t,e,i){const n=t._storage||(t._storage=s());return t[e]=n[e]=i,delete t._keys,!0}})}function Oe(t,e,i,n){const s={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:ke(t,n),setContext:e=>Oe(t,e,i,n),override:s=>Oe(t.override(s),e,i,n)};return new Proxy(s,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>Pe(t,e,()=>function(t,e,i){const{_proxy:n,_context:s,_subProxy:r,_descriptors:o}=t;let a=n[e];return R(a)&&o.isScriptable(e)&&(a=function(t,e,i,n){const{_proxy:s,_context:r,_subProxy:o,_stack:a}=i;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);return a.add(t),e=e(r,o||n),a.delete(t),De(t,e)&&(e=je(s._scopes,s,t,e)),e}(e,a,t,i)),m(a)&&a.length&&(a=function(t,e,i,n){const{_proxy:s,_context:r,_subProxy:o,_descriptors:a}=i;if(L(r.index)&&n(t))e=e[r.index%e.length];else if(b(e[0])){const i=e,n=s._scopes.filter(t=>t!==i);e=[];for(const l of i){const i=je(n,s,t,l);e.push(Oe(i,r,o&&o[t],a))}}return e}(e,a,t,o.isIndexable)),De(e,a)&&(a=Oe(a,s,r&&r[e],o)),a}(t,e,i)),getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,i)=>Reflect.has(t,i),ownKeys:()=>Reflect.ownKeys(t),set:(e,i,n)=>(t[i]=n,delete e[i],!0)})}function ke(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:n=e.indexable,_allKeys:s=e.allKeys}=t;return{allKeys:s,scriptable:i,indexable:n,isScriptable:R(i)?i:()=>i,isIndexable:R(n)?n:()=>n}}const Se=(t,e)=>t?t+A(e):e,De=(t,e)=>b(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function Pe(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const n=i();return t[e]=n,n}function Ce(t,e,i){return R(t)?t(e,i):t}const Te=(t,e)=>!0===t?e:"string"==typeof t?j(e,t):void 0;function Ee(t,e,i,n,s){for(const r of e){const e=Te(i,r);if(e){t.add(e);const r=Ce(e._fallback,i,s);if(L(r)&&r!==i&&r!==n)return r}else if(!1===e&&L(n)&&i!==n)return null}return!1}function je(t,e,i,n){const s=e._rootScopes,r=Ce(e._fallback,i,n),o=[...t,...s],a=new Set;a.add(n);let l=Ae(a,o,i,r||i,n);return null!==l&&(!L(r)||r===i||(l=Ae(a,o,r,l,n),null!==l))&&Me(Array.from(a),[""],s,r,()=>function(t,e,i){const n=t._getTarget();e in n||(n[e]={});const s=n[e];return m(s)&&b(i)?i:s}(e,i,n))}function Ae(t,e,i,n,s){for(;i;)i=Ee(t,e,i,n,s);return i}function Le(t,e){for(const i of e){if(!i)continue;const e=i[t];if(L(e))return e}}function Re(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter(t=>!t.startsWith("_")))e.add(t);return Array.from(e)}(t._scopes)),e}const Fe=Number.EPSILON||1e-14,ze=(t,e)=>e"x"===t?"y":"x";function Ne(t,e,i,n){const s=t.skip?e:t,r=e,o=i.skip?e:i,a=et(r,s),l=et(o,r);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=n*c,u=n*h;return{previous:{x:r.x-d*(o.x-s.x),y:r.y-d*(o.y-s.y)},next:{x:r.x+u*(o.x-s.x),y:r.y+u*(o.y-s.y)}}}function Ve(t,e,i){return Math.max(Math.min(t,i),e)}function We(t,e,i,n,s){let r,o,a,l;if(e.spanGaps&&(t=t.filter(t=>!t.skip)),"monotone"===e.cubicInterpolationMode)!function(t,e="x"){const i=Ie(e),n=t.length,s=Array(n).fill(0),r=Array(n);let o,a,l,c=ze(t,0);for(o=0;owindow.getComputedStyle(t,null),$e=["top","right","bottom","left"];function Xe(t,e,i){const n={};i=i?"-"+i:"";for(let s=0;s<4;s++){const r=$e[s];n[r]=parseFloat(t[e+"-"+r+i])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function qe(t,e){const{canvas:i,currentDevicePixelRatio:n}=e,s=Ye(i),r="border-box"===s.boxSizing,o=Xe(s,"padding"),a=Xe(s,"border","width"),{x:l,y:c,box:h}=function(t,e){const i=t.native||t,n=i.touches,s=n&&n.length?n[0]:i,{offsetX:r,offsetY:o}=s;let a,l,c=!1;if(((t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot))(r,o,i.target))a=r,l=o;else{const t=e.getBoundingClientRect();a=s.clientX-t.left,l=s.clientY-t.top,c=!0}return{x:a,y:l,box:c}}(t,i),d=o.left+(h&&a.left),u=o.top+(h&&a.top);let{width:f,height:g}=e;return r&&(f-=o.width+a.width,g-=o.height+a.height),{x:Math.round((l-d)/f*i.width/n),y:Math.round((c-u)/g*i.height/n)}}const Ge=t=>Math.round(10*t)/10;function Qe(t,e,i){const n=e||1,s=Math.floor(t.height*n),r=Math.floor(t.width*n);t.height=s/n,t.width=r/n;const o=t.canvas;return o.style&&(i||!o.style.height&&!o.style.width)&&(o.style.height=t.height+"px",o.style.width=t.width+"px"),(t.currentDevicePixelRatio!==n||o.height!==s||o.width!==r)&&(t.currentDevicePixelRatio=n,o.height=s,o.width=r,t.ctx.setTransform(n,0,0,n,0,0),!0)}const Ke=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(t){}return t}();function Ze(t,e){const i=function(t,e){return Ye(t).getPropertyValue(e)}(t,e),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function Je(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function ti(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:"middle"===n?i<.5?t.y:e.y:"after"===n?i<1?t.y:e.y:i>0?e.y:t.y}}function ei(t,e,i,n){const s={x:t.cp2x,y:t.cp2y},r={x:e.cp1x,y:e.cp1y},o=Je(t,s,i),a=Je(s,r,i),l=Je(r,e,i),c=Je(o,a,i),h=Je(a,l,i);return Je(c,h,i)}const ii=new Map;function ni(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let n=ii.get(i);return n||(n=new Intl.NumberFormat(t,e),ii.set(i,n)),n}(e,i).format(t)}function si(t,e,i){return t?function(t,e){return{x:i=>t+t+e-i,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,i):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function ri(t){return"angle"===t?{between:st,compare:it,normalize:nt}:{between:ot,compare:(t,e)=>t-e,normalize:t=>t}}function oi({start:t,end:e,count:i,loop:n,style:s}){return{start:t%i,end:e%i,loop:n&&(e-t+1)%i==0,style:s}}function ai(t,e,i){if(!i)return[t];const{property:n,start:s,end:r}=i,o=e.length,{compare:a,between:l,normalize:c}=ri(n),{start:h,end:d,loop:u,style:f}=function(t,e,i){const{property:n,start:s,end:r}=i,{between:o,normalize:a}=ri(n),l=e.length;let c,h,{start:d,end:u,loop:f}=t;if(f){for(d+=l,u+=l,c=0,h=l;cn({chart:t,initial:e.initial,numSteps:r,currentStep:Math.min(i-e.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=h.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,n)=>{if(!i.running||!i.items.length)return;const s=i.items;let r,o=s.length-1,a=!1;for(;o>=0;--o)r=s[o],r._active?(r._total>i.duration&&(i.duration=r._total),r.tick(t),a=!0):(s[o]=s[s.length-1],s.pop());a&&(n.draw(),this._notify(n,i,t,"progress")),s.length||(i.running=!1,this._notify(n,i,t,"complete"),i.initial=!1),e+=s.length}),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((t,e)=>Math.max(t,e._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let n=i.length-1;for(;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}};const ui={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const n=Wt(t||"transparent"),s=n.valid&&Wt(e||"transparent");return s&&s.valid?s.mix(n,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class fi{constructor(t,e,i,n){const s=e[i];n=pe([t.to,n,s,t.from]);const r=pe([t.from,s,n]);this._active=!0,this._fn=t.fn||ui[t.type||typeof r],this._easing=ht[t.easing]||ht.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=r,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const n=this._target[this._prop],s=i-this._start,r=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=s,this._loop=!!t.loop,this._to=pe([t.to,e,n,t.from]),this._from=pe([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,n=this._prop,s=this._from,r=this._loop,o=this._to;let a;if(this._active=s!==o&&(r||e1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[n]=this._fn(s,o,a))}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let t=0;t"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),Xt.set("animations",{colors:{type:"color",properties:["color","borderColor","backgroundColor"]},numbers:{type:"number",properties:["x","y","borderWidth","radius","tension"]}}),Xt.describe("animations",{_fallback:"animation"}),Xt.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}});class pi{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!b(t))return;const e=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const n=t[i];if(!b(n))return;const s={};for(const t of gi)s[t]=n[t];(m(n.properties)&&n.properties||[i]).forEach(t=>{t!==i&&e.has(t)||e.set(t,s)})})}_animateOptions(t,e){const i=e.options,n=function(t,e){if(!e)return;let i=t.options;if(i)return i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i;t.options=e}(t,i);if(!n)return[];const s=this._createAnimations(n,i);return i.$shared&&function(t,e){const i=[],n=Object.keys(e);for(let e=0;e{t.options=i},()=>{}),s}_createAnimations(t,e){const i=this._properties,n=[],s=t.$animations||(t.$animations={}),r=Object.keys(e),o=Date.now();let a;for(a=r.length-1;a>=0;--a){const l=r[a];if("$"===l.charAt(0))continue;if("options"===l){n.push(...this._animateOptions(t,e));continue}const c=e[l];let h=s[l];const d=i.get(l);if(h){if(d&&h.active()){h.update(d,c,o);continue}h.cancel()}d&&d.duration?(s[l]=h=new fi(d,t,l,c),n.push(h)):t[l]=c}return n}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(di.add(this._chart,i),!0):void 0}}function mi(t,e){const i=t&&t.options||{},n=i.reverse,s=void 0===i.min?e:0,r=void 0===i.max?e:0;return{start:n?r:s,end:n?s:r}}function bi(t,e){const i=[],n=t._getSortedDatasetMetas(e);let s,r;for(s=0,r=n.length;s0||!i&&e<0)return s.index}return null}function wi(t,e){const{chart:i,_cachedMeta:n}=t,s=i._stacks||(i._stacks={}),{iScale:r,vScale:o,index:a}=n,l=r.axis,c=o.axis,h=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(r,o,n),d=e.length;let u;for(let t=0;ti[t].axis===e).shift()}function Oi(t,e){const i=t.controller.index,n=t.vScale&&t.vScale.axis;if(n){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[n]||void 0===e[n][i])return;delete e[n][i]}}}const ki=t=>"reset"===t||"none"===t,Si=(t,e)=>e?t:Object.assign({},t);class Di{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=yi(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&Oi(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=(t,e,i,n)=>"x"===t?e:"r"===t?n:i,s=e.xAxisID=v(i.xAxisID,Mi(t,"x")),r=e.yAxisID=v(i.yAxisID,Mi(t,"y")),o=e.rAxisID=v(i.rAxisID,Mi(t,"r")),a=e.indexAxis,l=e.iAxisID=n(a,s,r,o),c=e.vAxisID=n(a,r,s,o);e.xScale=this.getScaleForId(s),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(o),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&_e(this._data,this),t._stacked&&Oi(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(b(e))this._data=function(t){const e=Object.keys(t),i=new Array(e.length);let n,s,r;for(n=0,s=e.length;n{const e="_onData"+A(t),i=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...t){const s=i.apply(this,t);return n._chartjs.listeners.forEach(i=>{"function"==typeof i[e]&&i[e](...t)}),s}})}))),this._syncList=[],this._data=e}var n}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let n=!1;this._dataCheck();const s=e._stacked;e._stacked=yi(e.vScale,e),e.stack!==i.stack&&(n=!0,Oi(e),e.stack=i.stack),this._resyncElements(t),(n||s!==e._stacked)&&wi(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:n}=this,{iScale:s,_stacked:r}=i,o=s.axis;let a,l,c,h=0===t&&e===n.length||i._sorted,d=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=n,i._sorted=!0,c=n;else{c=m(n[t])?this.parseArrayData(i,n,t,e):b(n[t])?this.parseObjectData(i,n,t,e):this.parsePrimitiveData(i,n,t,e);const s=()=>null===l[o]||d&&l[o]t&&!e.hidden&&e._stacked&&{keys:bi(i,!0),values:null})(e,i,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:h}=function(t){const{min:e,max:i,minDefined:n,maxDefined:s}=t.getUserBounds();return{min:n?e:Number.NEGATIVE_INFINITY,max:s?i:Number.POSITIVE_INFINITY}}(o);let d,u;function f(){u=n[d];const e=u[o.axis];return!x(u[t.axis])||c>e||h=0;--d)if(!f()){this.updateRangeFromParsed(l,t,u,a);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let n,s,r;for(n=0,s=e.length;n=0&&tthis.getContext(i,n),h);return f.$shared&&(f.$shared=a,s[r]=Object.freeze(Si(f,a))),f}_resolveAnimations(t,e,i){const n=this.chart,s=this._cachedDataOpts,r="animation-"+e,o=s[r];if(o)return o;let a;if(!1!==n.options.animation){const n=this.chart.config,s=n.datasetAnimationScopeKeys(this._type,e),r=n.getOptionScopes(this.getDataset(),s);a=n.createResolver(r,this.getContext(t,i,e))}const l=new pi(n,a&&a.animations);return a&&a._cacheable&&(s[r]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||ki(t)||this.chart._animationsDisabled}updateElement(t,e,i,n){ki(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!ki(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;const s=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(s)||s})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];const n=i.length,s=e.length,r=Math.min(s,n);r&&this.parse(0,r),s>n?this._insertElements(n,s-n,t):s{for(t.length+=e,o=t.length-1;o>=r;o--)t[o]=t[o-e]};for(a(s),o=t;ot-e))}return t._cache.$bar}(e,t.type);let n,s,r,o,a=e._length;const l=()=>{32767!==r&&-32768!==r&&(L(o)&&(a=Math.min(a,Math.abs(r-o)||a)),o=r)};for(n=0,s=i.length;nMath.abs(a)&&(l=a,c=o),e[i.axis]=c,e._custom={barStart:l,barEnd:c,start:s,end:r,min:o,max:a}}(t,e,i,n):e[i.axis]=i.parse(t,n),e}function Ti(t,e,i,n){const s=t.iScale,r=t.vScale,o=s.getLabels(),a=s===r,l=[];let c,h,d,u;for(c=i,h=i+n;ct.x,i="left",n="right"):(e=t.base=i?1:-1)}(h,e,r)*s,d===r&&(m-=h/2),c=m+h),m===e.getPixelForValue(r)){const t=$(h)*e.getLineWidthForValue(r)/2;m+=t,h-=t}return{size:h,base:m,head:c,center:c+h/2}}_calculateBarIndexPixels(t,e){const i=e.scale,n=this.options,s=n.skipNull,r=v(n.maxBarThickness,1/0);let o,a;if(e.grouped){const i=s?this._getStackCount(t):e.stackCount,l="flex"===n.barThickness?function(t,e,i,n){const s=e.pixels,r=s[t];let o=t>0?s[t-1]:null,a=t=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,{xScale:i,yScale:n}=e,s=this.getParsed(t),r=i.getLabelForValue(s.x),o=n.getLabelForValue(s.y),a=s._custom;return{label:e.label,value:"("+r+", "+o+(a?", "+a:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,n){const s="reset"===n,{iScale:r,vScale:o}=this._cachedMeta,a=this.resolveDataElementOptions(e,n),l=this.getSharedOptions(a),c=this.includeOptions(n,l),h=r.axis,d=o.axis;for(let a=e;a""}}}};class Ii extends Di{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,n=this._cachedMeta;if(!1===this._parsing)n._parsed=i;else{let s,r,o=t=>+i[t];if(b(i[t])){const{key:t="value"}=this._parsing;o=e=>+j(i[e],t)}for(s=t,r=t+e;sst(t,a,l,!0)?1:Math.max(e,e*i,n,n*i),g=(t,e,n)=>st(t,a,l,!0)?-1:Math.min(e,e*i,n,n*i),p=f(0,c,d),m=f(B,h,u),b=g(z,c,d),x=g(z+B,h,u);n=(p-b)/2,s=(m-x)/2,r=-(p+b)/2,o=-(m+x)/2}return{ratioX:n,ratioY:s,offsetX:r,offsetY:o}}(u,d,a),b=(i.width-r)/f,x=(i.height-r)/g,y=Math.max(Math.min(b,x)/2,0),v=_(this.options.radius,y),w=(v-Math.max(v*a,0))/this._getVisibleDatasetWeightTotal();this.offsetX=p*v,this.offsetY=m*v,n.total=this.calculateTotal(),this.outerRadius=v-w*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-w*h,0),this.updateElements(s,0,s.length,t)}_circumference(t,e){const i=this.options,n=this._cachedMeta,s=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===n._parsed[t]||n.data[t].hidden?0:this.calculateCircumference(n._parsed[t]*s/I)}updateElements(t,e,i,n){const s="reset"===n,r=this.chart,o=r.chartArea,a=r.options.animation,l=(o.left+o.right)/2,c=(o.top+o.bottom)/2,h=s&&a.animateScale,d=h?0:this.innerRadius,u=h?0:this.outerRadius,f=this.resolveDataElementOptions(e,n),g=this.getSharedOptions(f),p=this.includeOptions(n,g);let m,b=this._getRotation();for(m=0;m0&&!isNaN(t)?I*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],s=ni(e._parsed[t],i.options.locale);return{label:n[t]||"",value:s}}getMaxBorderWidth(t){let e=0;const i=this.chart;let n,s,r,o,a;if(!t)for(n=0,s=i.data.datasets.length;n"spacing"!==t,_indexable:t=>"spacing"!==t},Ii.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map((e,n)=>{const s=t.getDatasetMeta(0).controller.getStyle(n);return{text:e,fillStyle:s.backgroundColor,strokeStyle:s.borderColor,lineWidth:s.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label(t){let e=t.label;const i=": "+t.formattedValue;return m(e)?(e=e.slice(),e[0]+=i):e+=i,e}}}}};class Ni extends Di{initialize(){this.enableOptionSharing=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:n=[],_dataset:s}=e,r=this.chart._animationsDisabled;let{start:o,count:a}=function(t,e,i){const n=e.length;let s=0,r=n;if(t._sorted){const{iScale:o,_parsed:a}=t,l=o.axis,{min:c,max:h,minDefined:d,maxDefined:u}=o.getUserBounds();d&&(s=rt(Math.min(xe(a,o.axis,c).lo,i?n:xe(e,l,o.getPixelForValue(c)).lo),0,n-1)),r=u?rt(Math.max(xe(a,o.axis,h).hi+1,i?0:xe(e,l,o.getPixelForValue(h)).hi+1),s,n)-s:n-s}return{start:s,count:r}}(e,n,r);this._drawStart=o,this._drawCount=a,function(t){const{xScale:e,yScale:i,_scaleRanges:n}=t,s={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!n)return t._scaleRanges=s,!0;const r=n.xmin!==e.min||n.xmax!==e.max||n.ymin!==i.min||n.ymax!==i.max;return Object.assign(n,s),r}(e)&&(o=0,a=n.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!s._decimated,i.points=n;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!r,options:l},t),this.updateElements(n,o,a,t)}updateElements(t,e,i,n){const s="reset"===n,{iScale:r,vScale:o,_stacked:a,_dataset:l}=this._cachedMeta,c=this.resolveDataElementOptions(e,n),h=this.getSharedOptions(c),d=this.includeOptions(n,h),u=r.axis,f=o.axis,{spanGaps:g,segment:m}=this.options,b=q(g)?g:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||s||"none"===n;let y=e>0&&this.getParsed(e-1);for(let c=e;c0&&i[u]-y[u]>b,m&&(g.parsed=i,g.raw=l.data[c]),d&&(g.options=h||this.resolveDataElementOptions(c,e.active?"active":n)),x||this.updateElement(e,c,g,n),y=i}this.updateSharedOptions(h,n,c)}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return i;const s=n[0].size(this.resolveDataElementOptions(0)),r=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,s,r)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}Ni.id="line",Ni.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},Ni.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class Vi extends Di{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],s=ni(e._parsed[t].r,i.options.locale);return{label:n[t]||"",value:s}}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),s=Math.max(n/2,0),r=(s-Math.max(i.cutoutPercentage?s/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=s-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(t,e,i,n){const s="reset"===n,r=this.chart,o=this.getDataset(),a=r.options.animation,l=this._cachedMeta.rScale,c=l.xCenter,h=l.yCenter,d=l.getIndexAngle(0)-.5*z;let u,f=d;const g=360/this.countVisibleElements();for(u=0;u{!isNaN(t.data[n])&&this.chart.getDataVisibility(n)&&i++}),i}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?K(this.resolveDataElementOptions(t,e).angle||i):0}}Vi.id="polarArea",Vi.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},Vi.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map((e,n)=>{const s=t.getDatasetMeta(0).controller.getStyle(n);return{text:e,fillStyle:s.backgroundColor,strokeStyle:s.borderColor,lineWidth:s.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label:t=>t.chart.data.labels[t.dataIndex]+": "+t.formattedValue}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class Wi extends Ii{}Wi.id="pie",Wi.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Bi extends Di{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}update(t){const e=this._cachedMeta,i=e.dataset,n=e.data||[],s=e.iScale.getLabels();if(i.points=n,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const r={_loop:!0,_fullLoop:s.length===n.length,options:e};this.updateElement(i,void 0,r,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,i,n){const s=this.getDataset(),r=this._cachedMeta.rScale,o="reset"===n;for(let a=e;a"",label:t=>"("+t.label+", "+t.formattedValue+")"}}},scales:{x:{type:"linear"},y:{type:"linear"}}};class Yi{constructor(t){this.options=t||{}}formats(){return Ui()}parse(t,e){return Ui()}format(t,e){return Ui()}add(t,e,i){return Ui()}diff(t,e,i){return Ui()}startOf(t,e,i){return Ui()}endOf(t,e){return Ui()}}Yi.override=function(t){Object.assign(Yi.prototype,t)};var $i={_date:Yi};function Xi(t,e){return"native"in t?{x:t.x,y:t.y}:qe(t,e)}function qi(t,e,i,n){const{controller:s,data:r,_sorted:o}=t,a=s._cachedMeta.iScale;if(a&&e===a.axis&&"r"!==e&&o&&r.length){const t=a._reversePixels?ye:xe;if(!n)return t(r,e,i);if(s._sharedOptions){const n=r[0],s="function"==typeof n.getRange&&n.getRange(e);if(s){const n=t(r,e,i-s),o=t(r,e,i+s);return{lo:n.lo,hi:o.hi}}}}return{lo:0,hi:r.length-1}}function Gi(t,e,i,n,s){const r=t.getSortedVisibleDatasetMetas(),o=i[e];for(let t=0,i=r.length;t{t[a](s[o],n)&&r.push({element:t,datasetIndex:e,index:i}),t.inRange(s.x,s.y,n)&&(l=!0)}),i.intersect&&!l?[]:r}var Ji={modes:{index(t,e,i,n){const s=Xi(e,t),r=i.axis||"x",o=i.intersect?Qi(t,s,r,n):Ki(t,s,r,!1,n),a=[];return o.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{const e=o[0].index,i=t.data[e];i&&!i.skip&&a.push({element:i,datasetIndex:t.index,index:e})}),a):[]},dataset(t,e,i,n){const s=Xi(e,t),r=i.axis||"xy";let o=i.intersect?Qi(t,s,r,n):Ki(t,s,r,!1,n);if(o.length>0){const e=o[0].datasetIndex,i=t.getDatasetMeta(e).data;o=[];for(let t=0;tQi(t,Xi(e,t),i.axis||"xy",n),nearest:(t,e,i,n)=>Ki(t,Xi(e,t),i.axis||"xy",i.intersect,n),x:(t,e,i,n)=>Zi(t,e,{axis:"x",intersect:i.intersect},n),y:(t,e,i,n)=>Zi(t,e,{axis:"y",intersect:i.intersect},n)}};const tn=["left","top","right","bottom"];function en(t,e){return t.filter(t=>t.pos===e)}function nn(t,e){return t.filter(t=>-1===tn.indexOf(t.pos)&&t.box.axis===e)}function sn(t,e){return t.sort((t,i)=>{const n=e?i:t,s=e?t:i;return n.weight===s.weight?n.index-s.index:n.weight-s.weight})}function rn(t,e,i,n){return Math.max(t[i],e[i])+Math.max(t[n],e[n])}function on(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function an(t,e,i,n){const{pos:s,box:r}=i,o=t.maxPadding;if(!b(s)){i.size&&(t[s]-=i.size);const e=n[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?r.height:r.width),i.size=e.size/e.count,t[s]+=i.size}r.getPadding&&on(o,r.getPadding());const a=Math.max(0,e.outerWidth-rn(o,t,"left","right")),l=Math.max(0,e.outerHeight-rn(o,t,"top","bottom")),c=a!==t.w,h=l!==t.h;return t.w=a,t.h=l,i.horizontal?{same:c,other:h}:{same:h,other:c}}function ln(t,e){const i=e.maxPadding;return function(t){const n={left:0,top:0,right:0,bottom:0};return t.forEach(t=>{n[t]=Math.max(e[t],i[t])}),n}(t?["left","right"]:["top","bottom"])}function cn(t,e,i,n){const s=[];let r,o,a,l,c,h;for(r=0,o=t.length,c=0;rt.box.fullSize),!0),n=sn(en(e,"left"),!0),s=sn(en(e,"right")),r=sn(en(e,"top"),!0),o=sn(en(e,"bottom")),a=nn(e,"x"),l=nn(e,"y");return{fullSize:i,leftAndTop:n.concat(r),rightAndBottom:s.concat(l).concat(o).concat(a),chartArea:en(e,"chartArea"),vertical:n.concat(s).concat(l),horizontal:r.concat(o).concat(a)}}(t.boxes),l=a.vertical,c=a.horizontal;M(t.boxes,t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()});const h=l.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1,d=Object.freeze({outerWidth:e,outerHeight:i,padding:s,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/h,hBoxMaxHeight:o/2}),u=Object.assign({},s);on(u,fe(n));const f=Object.assign({maxPadding:u,w:r,h:o,x:s.left,y:s.top},s),g=function(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:n,stackWeight:s}=i;if(!t||!tn.includes(n))continue;const r=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=s}return e}(t),{vBoxMaxWidth:n,hBoxMaxHeight:s}=e;let r,o,a;for(r=0,o=t.length;r{const i=e.box;Object.assign(i,t.chartArea),i.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class fn{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}isAttached(t){return!0}updateConfig(t){}}class gn extends fn{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const pn={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},mn=t=>null===t||""===t,bn=!!Ke&&{passive:!0};function xn(t,e,i){t.canvas.removeEventListener(e,i,bn)}function yn(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function vn(t,e,i){const n=t.canvas,s=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||yn(i.addedNodes,n),e=e&&!yn(i.removedNodes,n);e&&i()});return s.observe(document,{childList:!0,subtree:!0}),s}function wn(t,e,i){const n=t.canvas,s=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||yn(i.removedNodes,n),e=e&&!yn(i.addedNodes,n);e&&i()});return s.observe(document,{childList:!0,subtree:!0}),s}const Mn=new Map;let On=0;function kn(){const t=window.devicePixelRatio;t!==On&&(On=t,Mn.forEach((e,i)=>{i.currentDevicePixelRatio!==t&&e()}))}function Sn(t,e,i){const n=t.canvas,s=n&&He(n);if(!s)return;const r=d((t,e)=>{const n=s.clientWidth;i(t,e),n{const e=t[0],i=e.contentRect.width,n=e.contentRect.height;0===i&&0===n||r(i,n)});return o.observe(s),function(t,e){Mn.size||window.addEventListener("resize",kn),Mn.set(t,e)}(t,r),o}function Dn(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){Mn.delete(t),Mn.size||window.removeEventListener("resize",kn)}(t)}function Pn(t,e,i){const n=t.canvas,s=d(e=>{null!==t.ctx&&i(function(t,e){const i=pn[t.type]||t.type,{x:n,y:s}=qe(t,e);return{type:i,chart:e,native:t,x:void 0!==n?n:null,y:void 0!==s?s:null}}(e,t))},t,t=>{const e=t[0];return[e,e.offsetX,e.offsetY]});return function(t,e,i){t.addEventListener(e,i,bn)}(n,e,s),s}class Cn extends fn{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,n=t.getAttribute("height"),s=t.getAttribute("width");if(t.$chartjs={initial:{height:n,width:s,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",mn(s)){const e=Ze(t,"width");void 0!==e&&(t.width=e)}if(mn(n))if(""===t.style.height)t.height=t.width/(e||2);else{const e=Ze(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e.$chartjs)return!1;const i=e.$chartjs.initial;["height","width"].forEach(t=>{const n=i[t];p(n)?e.removeAttribute(t):e.setAttribute(t,n)});const n=i.style||{};return Object.keys(n).forEach(t=>{e.style[t]=n[t]}),e.width=e.width,delete e.$chartjs,!0}addEventListener(t,e,i){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),s={attach:vn,detach:wn,resize:Sn}[e]||Pn;n[e]=s(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),n=i[e];n&&(({attach:Dn,detach:Dn,resize:Dn}[e]||xn)(t,e,n),i[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return function(t,e,i,n){const s=Ye(t),r=Xe(s,"margin"),o=Ue(s.maxWidth,t,"clientWidth")||V,a=Ue(s.maxHeight,t,"clientHeight")||V,l=function(t,e,i){let n,s;if(void 0===e||void 0===i){const r=He(t);if(r){const t=r.getBoundingClientRect(),o=Ye(r),a=Xe(o,"border","width"),l=Xe(o,"padding");e=t.width-l.width-a.width,i=t.height-l.height-a.height,n=Ue(o.maxWidth,r,"clientWidth"),s=Ue(o.maxHeight,r,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:n||V,maxHeight:s||V}}(t,e,i);let{width:c,height:h}=l;if("content-box"===s.boxSizing){const t=Xe(s,"border","width"),e=Xe(s,"padding");c-=e.width+t.width,h-=e.height+t.height}return c=Math.max(0,c-r.width),h=Math.max(0,n?Math.floor(c/n):h-r.height),c=Ge(Math.min(c,o,l.maxWidth)),h=Ge(Math.min(h,a,l.maxHeight)),c&&!h&&(h=Ge(c/2)),{width:c,height:h}}(t,e,i,n)}isAttached(t){const e=He(t);return!(!e||!e.isConnected)}}class Tn{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return q(this.x)&&q(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const n={};return t.forEach(t=>{n[t]=i[t]&&i[t].active()?i[t]._to:this[t]}),n}}Tn.defaults={},Tn.defaultRoutes=void 0;const En={values:t=>m(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";const n=this.chart.options.locale;let s,r=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(s="scientific"),r=function(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t)),i}(t,i)}const o=Y(Math.abs(r)),a=Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),ni(t,n,l)},logarithmic(t,e,i){if(0===t)return"0";const n=t/Math.pow(10,Math.floor(Y(t)));return 1===n||2===n||5===n?En.numeric.call(this,t,e,i):""}};var jn={formatters:En};function An(t,e,i,n,s){const r=v(n,0),o=Math.min(v(s,t.length),t.length);let a,l,c,h=0;for(i=Math.ceil(i),s&&(a=s-n,i=a/Math.floor(a/i)),c=r;c<0;)h++,c=Math.round(r+h*i);for(l=Math.max(r,0);le.lineWidth,tickColor:(t,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:jn.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),Xt.route("scale.ticks","color","","color"),Xt.route("scale.grid","color","","borderColor"),Xt.route("scale.grid","borderColor","","borderColor"),Xt.route("scale.title","color","","color"),Xt.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t}),Xt.describe("scales",{_fallback:"scale"}),Xt.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t});const Ln=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i;function Rn(t,e){const i=[],n=t.length/e,s=t.length;let r=0;for(;ro+1e-6)))return l}function zn(t){return t.drawTicks?t.tickLength:0}function In(t,e){if(!t.display)return 0;const i=ge(t.font,e),n=fe(t.padding);return(m(t.text)?t.text.length:1)*i.lineHeight+n.height}function Nn(t,e,i){let n=(t=>"start"===t?"left":"end"===t?"right":"center")(t);return(i&&"right"!==e||!i&&"right"===e)&&(n=(t=>"left"===t?"right":"right"===t?"left":t)(n)),n}class Vn extends Tn{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:n}=this;return t=y(t,Number.POSITIVE_INFINITY),e=y(e,Number.NEGATIVE_INFINITY),i=y(i,Number.POSITIVE_INFINITY),n=y(n,Number.NEGATIVE_INFINITY),{min:y(t,i),max:y(e,n),minDefined:x(t),maxDefined:x(e)}}getMinMax(t){let e,{min:i,max:n,minDefined:s,maxDefined:r}=this.getUserBounds();if(s&&r)return{min:i,max:n};const o=this.getMatchingVisibleMetas();for(let a=0,l=o.length;an?n:i,n=s&&i>n?i:n,{min:y(i,y(n,i)),max:y(n,y(i,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){w(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:n,grace:s,ticks:r}=this.options,o=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(t,e,i){const{min:n,max:s}=t,r=_(e,(s-n)/2),o=(t,e)=>i&&0===t?0:t+e;return{min:o(n,-Math.abs(r)),max:o(s,r)}}(this,s,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=on)return function(t,e,i,n){let s,r=0,o=i[0];for(n=Math.ceil(n),s=0;st-e).pop(),e}(n);for(let t=0,e=r.length-1;ts)return e}return Math.max(s,1)}(s,e,n);if(r>0){let t,i;const n=r>1?Math.round((a-o)/(r-1)):null;for(An(e,l,c,p(n)?0:o-n,o),t=0,i=r-1;t=s||i<=1||!this.isHorizontal())return void(this.labelRotation=n);const c=this._getLabelSizes(),h=c.widest.width,d=c.highest.height,u=rt(this.chart.width-h,0,this.maxWidth);r=t.offset?this.maxWidth/i:u/(i-1),h+6>r&&(r=u/(i-(t.offset?.5:1)),o=this.maxHeight-zn(t.grid)-e.padding-In(t.title,this.chart.options.font),a=Math.sqrt(h*h+d*d),l=Z(Math.min(Math.asin(rt((c.highest.height+6)/r,-1,1)),Math.asin(rt(o/a,-1,1))-Math.asin(rt(d/a,-1,1)))),l=Math.max(n,Math.min(s,l))),this.labelRotation=l}afterCalculateLabelRotation(){w(this.options.afterCalculateLabelRotation,[this])}beforeFit(){w(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:n,grid:s}}=this,r=this._isVisible(),o=this.isHorizontal();if(r){const r=In(n,e.options.font);if(o?(t.width=this.maxWidth,t.height=zn(s)+r):(t.height=this.maxHeight,t.width=zn(s)+r),i.display&&this.ticks.length){const{first:e,last:n,widest:s,highest:r}=this._getLabelSizes(),a=2*i.padding,l=K(this.labelRotation),c=Math.cos(l),h=Math.sin(l);if(o){const e=i.mirror?0:h*s.width+c*r.height;t.height=Math.min(this.maxHeight,t.height+e+a)}else{const e=i.mirror?0:c*s.width+h*r.height;t.width=Math.min(this.maxWidth,t.width+e+a)}this._calculatePadding(e,n,h,c)}}this._handleMargins(),o?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,n){const{ticks:{align:s,padding:r},position:o}=this.options,a=0!==this.labelRotation,l="top"!==o&&"x"===this.axis;if(this.isHorizontal()){const o=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,d=0;a?l?(h=n*t.width,d=i*e.height):(h=i*t.height,d=n*e.width):"start"===s?d=e.width:"end"===s?h=t.width:(h=t.width/2,d=e.width/2),this.paddingLeft=Math.max((h-o+r)*this.width/(this.width-o),0),this.paddingRight=Math.max((d-c+r)*this.width/(this.width-c),0)}else{let i=e.height/2,n=t.height/2;"start"===s?(i=0,n=t.height):"end"===s&&(i=e.height,n=0),this.paddingTop=i+r,this.paddingBottom=n+r}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){w(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e{const i=t.gc,n=i.length/2;let s;if(n>e){for(s=0;s({width:s[t]||0,height:r[t]||0});return{first:O(0),last:O(e-1),widest:O(_),highest:O(w),widths:s,heights:r}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return rt(this._alignToPixels?Qt(this.chart,e,0):e,-32768,32767)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&to*n?o/i:a/n:a*n0}_computeGridLineItems(t){const e=this.axis,i=this.chart,n=this.options,{grid:s,position:r}=n,o=s.offset,a=this.isHorizontal(),l=this.ticks.length+(o?1:0),c=zn(s),h=[],d=s.setContext(this.getContext()),u=d.drawBorder?d.borderWidth:0,f=u/2,g=function(t){return Qt(i,t,u)};let p,m,x,y,_,w,M,O,k,S,D,P;if("top"===r)p=g(this.bottom),w=this.bottom-c,O=p-f,S=g(t.top)+f,P=t.bottom;else if("bottom"===r)p=g(this.top),S=t.top,P=g(t.bottom)-f,w=p+f,O=this.top+c;else if("left"===r)p=g(this.right),_=this.right-c,M=p-f,k=g(t.left)+f,D=t.right;else if("right"===r)p=g(this.left),k=t.left,D=g(t.right)-f,_=p+f,M=this.left+c;else if("x"===e){if("center"===r)p=g((t.top+t.bottom)/2+.5);else if(b(r)){const t=Object.keys(r)[0],e=r[t];p=g(this.chart.scales[t].getPixelForValue(e))}S=t.top,P=t.bottom,w=p+f,O=w+c}else if("y"===e){if("center"===r)p=g((t.left+t.right)/2);else if(b(r)){const t=Object.keys(r)[0],e=r[t];p=g(this.chart.scales[t].getPixelForValue(e))}_=p-f,M=_-c,k=t.left,D=t.right}const C=v(n.ticks.maxTicksLimit,l),T=Math.max(1,Math.ceil(l/C));for(m=0;me.value===t);return i>=0?e.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,r;const o=(t,e,n)=>{n.width&&n.color&&(i.save(),i.lineWidth=n.width,i.strokeStyle=n.color,i.setLineDash(n.borderDash||[]),i.lineDashOffset=n.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(s=0,r=n.length;s{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:i+1,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",n=[];let s,r;for(s=0,r=e.length;s{const n=i.split("."),s=n.pop(),r=[t].concat(n).join("."),o=e[i].split("."),a=o.pop(),l=o.join(".");Xt.route(r,s,l,a)})}(e,t.defaultRoutes),t.descriptors&&Xt.describe(e,t.descriptors)}(t,r,i),this.override&&Xt.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,n=this.scope;i in e&&delete e[i],n&&i in Xt[n]&&(delete Xt[n][i],this.override&&delete Ht[i])}}var Bn=new class{constructor(){this.controllers=new Wn(Di,"datasets",!0),this.elements=new Wn(Tn,"elements"),this.plugins=new Wn(Object,"plugins"),this.scales=new Wn(Vn,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(e=>{const n=i||this._getRegistryForType(e);i||n.isForType(e)||n===this.plugins&&e.id?this._exec(t,n,e):M(e,e=>{const n=i||this._getRegistryForType(e);this._exec(t,n,e)})})}_exec(t,e,i){const n=A(t);w(i["before"+n],[],i),e[t](i),w(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;et.filter(t=>!e.some(e=>t.plugin.id===e.plugin.id));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}}function Un(t,e){return e||!1!==t?!0===t?{}:t:null}function Yn(t,e,i,n){const s=t.pluginScopeKeys(e),r=t.getOptionScopes(i,s);return t.createResolver(r,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function $n(t,e){const i=Xt.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function Xn(t,e){return"x"===t||"y"===t?t:e.axis||("top"===(i=e.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0)||t.charAt(0).toLowerCase();var i}function qn(t){const e=t.options||(t.options={});e.plugins=v(e.plugins,{}),e.scales=function(t,e){const i=Ht[t.type]||{scales:{}},n=e.scales||{},s=$n(t.type,e),r=Object.create(null),o=Object.create(null);return Object.keys(n).forEach(t=>{const e=n[t];if(!b(e))return console.error("Invalid scale configuration for scale: "+t);if(e._proxy)return console.warn("Ignoring resolver passed as options for scale: "+t);const a=Xn(t,e),l=function(t,e){return t===e?"_index_":"_value_"}(a,s),c=i.scales||{};r[a]=r[a]||t,o[t]=C(Object.create(null),[{axis:a},e,c[a],c[l]])}),t.data.datasets.forEach(i=>{const s=i.type||t.type,a=i.indexAxis||$n(s,e),l=(Ht[s]||{}).scales||{};Object.keys(l).forEach(t=>{const e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,a),s=i[e+"AxisID"]||r[e]||e;o[s]=o[s]||Object.create(null),C(o[s],[{axis:e},n[s],l[t]])})}),Object.keys(o).forEach(t=>{const e=o[t];C(e,[Xt.scales[e.type],Xt.scale])}),o}(t,e)}function Gn(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const Qn=new Map,Kn=new Set;function Zn(t,e){let i=Qn.get(t);return i||(i=e(),Qn.set(t,i),Kn.add(i)),i}const Jn=(t,e,i)=>{const n=j(e,i);void 0!==n&&t.add(n)};class ts{constructor(t){this._config=function(t){return(t=t||{}).data=Gn(t.data),qn(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Gn(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),qn(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Zn(t,()=>[["datasets."+t,""]])}datasetAnimationScopeKeys(t,e){return Zn(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,"transitions."+e],["datasets."+t,""]])}datasetElementScopeKeys(t,e){return Zn(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,"datasets."+t,"elements."+e,""]])}pluginScopeKeys(t){const e=t.id;return Zn(`${this.type}-plugin-${e}`,()=>[["plugins."+e,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let n=i.get(t);return n&&!e||(n=new Map,i.set(t,n)),n}getOptionScopes(t,e,i){const{options:n,type:s}=this,r=this._cachedScopes(t,i),o=r.get(e);if(o)return o;const a=new Set;e.forEach(e=>{t&&(a.add(t),e.forEach(e=>Jn(a,t,e))),e.forEach(t=>Jn(a,n,t)),e.forEach(t=>Jn(a,Ht[s]||{},t)),e.forEach(t=>Jn(a,Xt,t)),e.forEach(t=>Jn(a,Ut,t))});const l=Array.from(a);return 0===l.length&&l.push(Object.create(null)),Kn.has(e)&&r.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,Ht[e]||{},Xt.datasets[e]||{},{type:e},Xt,Ut]}resolveNamedOptions(t,e,i,n=[""]){const s={$shared:!0},{resolver:r,subPrefixes:o}=es(this._resolverCache,t,n);let a=r;(function(t,e){const{isScriptable:i,isIndexable:n}=ke(t);for(const s of e){const e=i(s),r=n(s),o=(r||e)&&t[s];if(e&&(R(o)||is(o))||r&&m(o))return!0}return!1})(r,e)&&(s.$shared=!1,a=Oe(r,i=R(i)?i():i,this.createResolver(t,i,o)));for(const t of e)s[t]=a[t];return s}createResolver(t,e,i=[""],n){const{resolver:s}=es(this._resolverCache,t,i);return b(e)?Oe(s,e,void 0,n):s}}function es(t,e,i){let n=t.get(e);n||(n=new Map,t.set(e,n));const s=i.join();let r=n.get(s);return r||(r={resolver:Me(e,i),subPrefixes:i.filter(t=>!t.toLowerCase().includes("hover"))},n.set(s,r)),r}const is=t=>b(t)&&Object.getOwnPropertyNames(t).reduce((e,i)=>e||R(t[i]),!1),ns=["top","bottom","left","right","chartArea"];function ss(t,e){return"top"===t||"bottom"===t||-1===ns.indexOf(t)&&"x"===e}function rs(t,e){return function(i,n){return i[t]===n[t]?i[e]-n[e]:i[t]-n[t]}}function os(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),w(i&&i.onComplete,[t],e)}function as(t){const e=t.chart,i=e.options.animation;w(i&&i.onProgress,[t],e)}function ls(t){return Be()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const cs={},hs=t=>{const e=ls(t);return Object.values(cs).filter(t=>t.canvas===e).pop()};function ds(t,e,i){const n=Object.keys(t);for(const s of n){const n=+s;if(n>=e){const r=t[s];delete t[s],(i>0||n>e)&&(t[n+i]=r)}}}class us{constructor(t,e){const i=this.config=new ts(e),n=ls(t),s=hs(n);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas can be reused.");const r=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||function(t){return!Be()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?gn:Cn}(n)),this.platform.updateConfig(i);const o=this.platform.acquireContext(n,r.aspectRatio),a=o&&o.canvas,l=a&&a.height,c=a&&a.width;this.id=g(),this.ctx=o,this.canvas=a,this.width=c,this.height=l,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Hn,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let i;return function(...n){return e?(clearTimeout(i),i=setTimeout(t,e,n)):t.apply(this,n),e}}(t=>this.update(t),r.resizeDelay||0),this._dataChanges=[],cs[this.id]=this,o&&a?(di.listen(this,"complete",os),di.listen(this,"progress",as),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:s}=this;return p(t)?e&&s?s:n?i/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Qe(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Kt(this.canvas,this.ctx),this}stop(){return di.stop(this),this}resize(t,e){di.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,n=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(n,t,e,s),o=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,Qe(this,o,!0)&&(this.notifyPlugins("resize",{size:r}),w(i.onResize,[this,r],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){M(this.options.scales||{},(t,e)=>{t.id=e})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,n=Object.keys(i).reduce((t,e)=>(t[e]=!1,t),{});let s=[];e&&(s=s.concat(Object.keys(e).map(t=>{const i=e[t],n=Xn(t,i),s="r"===n,r="x"===n;return{options:i,dposition:s?"chartArea":r?"bottom":"left",dtype:s?"radialLinear":r?"category":"linear"}}))),M(s,e=>{const s=e.options,r=s.id,o=Xn(r,s),a=v(s.type,e.dtype);void 0!==s.position&&ss(s.position,o)===ss(e.dposition)||(s.position=e.dposition),n[r]=!0;let l=null;r in i&&i[r].type===a?l=i[r]:(l=new(Bn.getScale(a))({id:r,type:a,ctx:this.ctx,chart:this}),i[l.id]=l),l.init(s,t)}),M(n,(t,e)=>{t||delete i[e]}),M(i,t=>{un.configure(this,t,t.options),un.addBox(this,t)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((t,e)=>t.index-e.index),i>e){for(let t=e;te.length&&delete this._stacks,t.forEach((t,i)=>{0===e.filter(e=>e===t._dataset).length&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,n;for(this._removeUnreferencedMetasets(),i=0,n=e.length;i{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let t=0,e=this.data.datasets.length;t{t.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(rs("z","_idx"));const{_active:o,_lastEvent:a}=this;a?this._eventHandler(a,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){M(this.scales,t=>{un.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);F(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:n,count:s}of e)ds(t,n,"_removeElements"===i?-s:s)}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter(t=>t[0]===e).map((t,e)=>e+","+t.splice(1).join(","))),n=i(0);for(let t=1;tt.split(",")).map(t=>({method:t[1],start:+t[2],count:+t[3]}))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;un.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],M(this.boxes,t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))},this),this._layers.forEach((t,e)=>{t._idx=e}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,n=!i.disabled,s=this.chartArea,r={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",r)&&(n&&te(e,{left:!1===i.left?0:s.left-i.left,right:!1===i.right?this.width:s.right+i.right,top:!1===i.top?0:s.top-i.top,bottom:!1===i.bottom?this.height:s.bottom+i.bottom}),t.controller.draw(),n&&ee(e),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}getElementsAtEventForMode(t,e,i,n){const s=Ji.modes[e];return"function"==typeof s?s(this,t,i,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let n=i.filter(t=>t&&t._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(n)),n}getContext(){return this.$context||(this.$context=me(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const n=i?"show":"hide",s=this.getDatasetMeta(t),r=s.controller._resolveAnimations(void 0,n);L(e)?(s.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),r.update(s,{visible:i}),this.update(e=>e.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),di.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,i,n),t[i]=n},n=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};M(this.options.events,t=>i(t,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,n)=>{e.addEventListener(this,i,n),t[i]=n},n=(i,n)=>{t[i]&&(e.removeEventListener(this,i,n),delete t[i])},s=(t,e)=>{this.canvas&&this.resize(t,e)};let r;const o=()=>{n("attach",o),this.attached=!0,this.resize(),i("resize",s),i("detach",r)};r=()=>{this.attached=!1,n("resize",s),this._stop(),this._resize(0,0),i("attach",o)},e.isAttached(this.canvas)?o():r()}unbindEvents(){M(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},M(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const n=i?"set":"remove";let s,r,o,a;for("dataset"===e&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+n+"DatasetHoverStyle"]()),o=0,a=t.length;o{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}});!O(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}_updateHoverStyles(t,e,i){const n=this.options.hover,s=(t,e)=>t.filter(t=>!e.some(e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)),r=s(e,t),o=i?t:s(t,e);r.length&&this.updateHoverStyle(r,n.mode,!1),o.length&&n.mode&&this.updateHoverStyle(o,n.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:Jt(t,this.chartArea,this._minPadding)},n=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,n))return;const s=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(s||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:n=[],options:s}=this,r=e,o=this._getActiveElements(t,n,i,r),a=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}(t),l=function(t,e,i,n){return i&&"mouseout"!==t.type?n?e:t:null}(t,this._lastEvent,i,a);i&&(this._lastEvent=null,w(s.onHover,[t,o,this],this),a&&w(s.onClick,[t,o,this],this));const c=!O(o,n);return(c||e)&&(this._active=o,this._updateHoverStyles(o,n,e)),this._lastEvent=l,c}_getActiveElements(t,e,i,n){if("mouseout"===t.type)return[];if(!i)return e;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,n)}}const fs=()=>M(us.instances,t=>t._plugins.invalidate());function gs(t,e,i){const{startAngle:n,pixelMargin:s,x:r,y:o,outerRadius:a,innerRadius:l}=e;let c=s/a;t.beginPath(),t.arc(r,o,a,n-c,i+c),l>s?(c=s/l,t.arc(r,o,l,i+c,n-c,!0)):t.arc(r,o,s,i+B,n-B),t.closePath(),t.clip()}function ps(t,e,i,n){return{x:i+t*Math.cos(e),y:n+t*Math.sin(e)}}function ms(t,e,i,n,s){const{x:r,y:o,startAngle:a,pixelMargin:l,innerRadius:c}=e,h=Math.max(e.outerRadius+n+i-l,0),d=c>0?c+n+i+l:0;let u=0;const f=s-a;if(n){const t=((c>0?c-n:0)+(h>0?h-n:0))/2;u=(f-(0!==t?f*t/(t+n):f))/2}const g=(f-Math.max(.001,f*h-i/z)/h)/2,p=a+g+u,m=s-g-u,{outerStart:b,outerEnd:x,innerStart:y,innerEnd:v}=function(t,e,i,n){const s=he(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]),r=(i-e)/2,o=Math.min(r,n*e/2),a=t=>{const e=(i-Math.min(r,t))*n/2;return rt(t,0,Math.min(r,e))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:rt(s.innerStart,0,o),innerEnd:rt(s.innerEnd,0,o)}}(e,d,h,m-p),_=h-b,w=h-x,M=p+b/_,O=m-x/w,k=d+y,S=d+v,D=p+y/k,P=m-v/S;if(t.beginPath(),t.arc(r,o,h,M,O),x>0){const e=ps(w,O,r,o);t.arc(e.x,e.y,x,O,m+B)}const C=ps(S,m,r,o);if(t.lineTo(C.x,C.y),v>0){const e=ps(S,P,r,o);t.arc(e.x,e.y,v,m+B,P+Math.PI)}if(t.arc(r,o,d,m-v/d,p+y/d,!0),y>0){const e=ps(k,D,r,o);t.arc(e.x,e.y,y,D+Math.PI,p-B)}const T=ps(_,p,r,o);if(t.lineTo(T.x,T.y),b>0){const e=ps(_,M,r,o);t.arc(e.x,e.y,b,p-B,M)}t.closePath()}Object.defineProperties(us,{defaults:{enumerable:!0,value:Xt},instances:{enumerable:!0,value:cs},overrides:{enumerable:!0,value:Ht},registry:{enumerable:!0,value:Bn},version:{enumerable:!0,value:"3.7.1"},getChart:{enumerable:!0,value:hs},register:{enumerable:!0,value:(...t)=>{Bn.add(...t),fs()}},unregister:{enumerable:!0,value:(...t)=>{Bn.remove(...t),fs()}}});class bs extends Tn{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.getProps(["x","y"],i),{angle:s,distance:r}=tt(n,{x:t,y:e}),{startAngle:o,endAngle:a,innerRadius:l,outerRadius:c,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),d=this.options.spacing/2,u=v(h,a-o)>=I||st(s,o,a),f=ot(r,l+d,c+d);return u&&f}getCenterPoint(t){const{x:e,y:i,startAngle:n,endAngle:s,innerRadius:r,outerRadius:o}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:a,spacing:l}=this.options,c=(n+s)/2,h=(r+o+l+a)/2;return{x:e+Math.cos(c)*h,y:i+Math.sin(c)*h}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,n=(e.offset||0)/2,s=(e.spacing||0)/2;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>I?Math.floor(i/I):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();let r=0;if(n){r=n/2;const e=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(e)*r,Math.sin(e)*r),this.circumference>=z&&(r=n)}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;const o=function(t,e,i,n){const{fullCircles:s,startAngle:r,circumference:o}=e;let a=e.endAngle;if(s){ms(t,e,i,n,r+I);for(let e=0;ea&&r>a;return{count:n,start:l,loop:e.loop,ilen:c(o+(c?a-t:t))%r,y=()=>{f!==g&&(t.lineTo(m,g),t.lineTo(m,f),t.lineTo(m,p))};for(l&&(d=s[x(0)],t.moveTo(d.x,d.y)),h=0;h<=a;++h){if(d=s[x(h)],d.skip)continue;const e=d.x,i=d.y,n=0|e;n===u?(ig&&(g=i),m=(b*m+e)/++b):(y(),t.lineTo(e,i),u=n,b=0,f=g=i),p=i}y()}function Ms(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i?_s:ws}bs.id="arc",bs.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0},bs.defaultRoutes={backgroundColor:"backgroundColor"};const Os="function"==typeof Path2D;class ks extends Tn{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const n=i.spanGaps?this._loop:this._fullLoop;We(this._points,i,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(t,e){const i=t.points,n=t.options.spanGaps,s=i.length;if(!s)return[];const r=!!t._loop,{start:o,end:a}=function(t,e,i,n){let s=0,r=e-1;if(i&&!n)for(;ss&&t[r%e].skip;)r--;return r%=e,{start:s,end:r}}(i,s,r,n);return function(t,e,i,n){return n&&n.setContext&&i?function(t,e,i,n){const s=t._chart.getContext(),r=ci(t.options),{_datasetIndex:o,options:{spanGaps:a}}=t,l=i.length,c=[];let h=r,d=e[0].start,u=d;function f(t,e,n,s){const r=a?-1:1;if(t!==e){for(t+=l;i[t%l].skip;)t-=r;for(;i[e%l].skip;)e+=r;t%l!=e%l&&(c.push({start:t%l,end:e%l,loop:n,style:s}),h=s,d=e%l)}}for(const t of e){d=a?d:t.start;let e,r=i[d%l];for(u=d+1;u<=t.end;u++){const a=i[u%l];e=ci(n.setContext(me(s,{type:"segment",p0:r,p1:a,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:o}))),hi(e,h)&&f(d,u-1,t.loop,h),r=a,h=e}d"borderDash"!==t&&"fill"!==t};class Ds extends Tn{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.options,{x:s,y:r}=this.getProps(["x","y"],i);return Math.pow(t-s,2)+Math.pow(e-r,2)=i)&&s):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}As.id="bar",As.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0},As.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};class Rs{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:n,y:s,radius:r}=this;return e=e||{start:0,end:I},t.arc(n,s,r,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:n}=this,s=t.angle;return{x:e+Math.cos(s)*n,y:i+Math.sin(s)*n,angle:s}}}function Fs(t,e,i){for(;e>t;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function zs(t,e,i){const n=[];for(let s=0;s{e=Fs(t,e,s);const o=s[t],a=s[e];null!==n?(r.push({x:o.x,y:n}),r.push({x:a.x,y:n})):null!==i&&(r.push({x:i,y:o.y}),r.push({x:i,y:a.y}))}),r}(t,e),i.length?new ks({points:i,options:{tension:0},_loop:n,_fullLoop:n}):null}function Ws(t,e,i){let n=t[e].fill;const s=[e];let r;if(!i)return n;for(;!1!==n&&-1===s.indexOf(n);){if(!x(n))return n;if(r=t[n],!r)return!1;if(r.visible)return n;s.push(n),n=r.fill}return!1}function Bs(t,e,i){const{segments:n,points:s}=e;let r=!0,o=!1;t.beginPath();for(const a of n){const{start:n,end:l}=a,c=s[n],h=s[Fs(n,l,s)];r?(t.moveTo(c.x,c.y),r=!1):(t.lineTo(c.x,i),t.lineTo(c.x,c.y)),o=!!e.pathSegment(t,a,{move:o}),o?t.closePath():t.lineTo(h.x,i)}t.lineTo(e.first().x,i),t.closePath(),t.clip()}function Hs(t,e,i,n){if(n)return;let s=e[t],r=i[t];return"angle"===t&&(s=nt(s),r=nt(r)),{property:t,start:s,end:r}}function Us(t,e,i,n){return t&&e?n(t[i],e[i]):t?t[i]:e?e[i]:0}function Ys(t,e,i){const{top:n,bottom:s}=e.chart.chartArea,{property:r,start:o,end:a}=i||{};"x"===r&&(t.beginPath(),t.rect(o,n,a-o,s-n),t.clip())}function $s(t,e,i,n){const s=e.interpolate(i,n);s&&t.lineTo(s.x,s.y)}function Xs(t,e){const{line:i,target:n,property:s,color:r,scale:o}=e,a=function(t,e,i){const n=t.segments,s=t.points,r=e.points,o=[];for(const t of n){let{start:n,end:a}=t;a=Fs(n,a,s);const l=Hs(i,s[n],s[a],t.loop);if(!e.segments){o.push({source:t,target:l,start:s[n],end:s[a]});continue}const c=li(e,l);for(const e of c){const n=Hs(i,r[e.start],r[e.end],e.loop),a=ai(t,s,n);for(const t of a)o.push({source:t,target:e,start:{[i]:Us(l,n,"start",Math.max)},end:{[i]:Us(l,n,"end",Math.min)}})}}return o}(i,n,s);for(const{source:e,target:l,start:c,end:h}of a){const{style:{backgroundColor:a=r}={}}=e,d=!0!==n;t.save(),t.fillStyle=a,Ys(t,o,d&&Hs(s,c,h)),t.beginPath();const u=!!i.pathSegment(t,e);let f;if(d){u?t.closePath():$s(t,n,h,s);const e=!!n.pathSegment(t,l,{move:u,reverse:!0});f=u&&e,f||$s(t,n,c,s)}t.closePath(),t.fill(f?"evenodd":"nonzero"),t.restore()}}function qs(t,e,i){const n=Ns(e),{line:s,scale:r,axis:o}=e,a=s.options,l=a.fill,c=a.backgroundColor,{above:h=c,below:d=c}=l||{};n&&s.points.length&&(te(t,i),function(t,e){const{line:i,target:n,above:s,below:r,area:o,scale:a}=e,l=i._loop?"angle":e.axis;t.save(),"x"===l&&r!==s&&(Bs(t,n,o.top),Xs(t,{line:i,target:n,color:s,scale:a,property:l}),t.restore(),t.save(),Bs(t,n,o.bottom)),Xs(t,{line:i,target:n,color:r,scale:a,property:l}),t.restore()}(t,{line:s,target:n,above:h,below:d,area:i,scale:r,axis:o}),ee(t))}var Gs={id:"filler",afterDatasetsUpdate(t,e,i){const n=(t.data.datasets||[]).length,s=[];let r,o,a,l;for(o=0;o=0;--e){const i=s[e].$filler;i&&(i.line.updateControlPoints(r,i.axis),n&&qs(t.ctx,i,r))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const n=t.getSortedVisibleDatasetMetas();for(let e=n.length-1;e>=0;--e){const i=n[e].$filler;i&&qs(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){const n=e.meta.$filler;n&&!1!==n.fill&&"beforeDatasetDraw"===i.drawTime&&qs(t.ctx,n,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};new WeakMap;const Qs={average(t){if(!t.length)return!1;let e,i,n=0,s=0,r=0;for(e=0,i=t.length;e-1?t.split("\n"):t}function Js(t,e){const{element:i,datasetIndex:n,index:s}=e,r=t.getDatasetMeta(n).controller,{label:o,value:a}=r.getLabelAndValue(s);return{chart:t,label:o,parsed:r.getParsed(s),raw:t.data.datasets[n].data[s],formattedValue:a,dataset:r.getDataset(),dataIndex:s,datasetIndex:n,element:i}}function tr(t,e){const i=t.chart.ctx,{body:n,footer:s,title:r}=t,{boxWidth:o,boxHeight:a}=e,l=ge(e.bodyFont),c=ge(e.titleFont),h=ge(e.footerFont),d=r.length,u=s.length,f=n.length,g=fe(e.padding);let p=g.height,m=0,b=n.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);b+=t.beforeBody.length+t.afterBody.length,d&&(p+=d*c.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),b&&(p+=f*(e.displayColors?Math.max(a,l.lineHeight):l.lineHeight)+(b-f)*l.lineHeight+(b-1)*e.bodySpacing),u&&(p+=e.footerMarginTop+u*h.lineHeight+(u-1)*e.footerSpacing);let x=0;const y=function(t){m=Math.max(m,i.measureText(t).width+x)};return i.save(),i.font=c.string,M(t.title,y),i.font=l.string,M(t.beforeBody.concat(t.afterBody),y),x=e.displayColors?o+2+e.boxPadding:0,M(n,t=>{M(t.before,y),M(t.lines,y),M(t.after,y)}),x=0,i.font=h.string,M(t.footer,y),i.restore(),m+=g.width,{width:m,height:p}}function er(t,e,i,n){const{x:s,width:r}=i,{width:o,chartArea:{left:a,right:l}}=t;let c="center";return"center"===n?c=s<=(a+l)/2?"left":"right":s<=r/2?c="left":s>=o-r/2&&(c="right"),function(t,e,i,n){const{x:s,width:r}=n,o=i.caretSize+i.caretPadding;return"left"===t&&s+r+o>e.width||"right"===t&&s-r-o<0||void 0}(c,t,e,i)&&(c="center"),c}function ir(t,e,i){const n=i.yAlign||e.yAlign||function(t,e){const{y:i,height:n}=e;return it.height-n/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||er(t,e,i,n),yAlign:n}}function nr(t,e,i,n){const{caretSize:s,caretPadding:r,cornerRadius:o}=t,{xAlign:a,yAlign:l}=i,c=s+r,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=ue(o);let g=function(t,e){let{x:i,width:n}=t;return"right"===e?i-=n:"center"===e&&(i-=n/2),i}(e,a);const p=function(t,e,i){let{y:n,height:s}=t;return"top"===e?n+=i:n-="bottom"===e?s+i:s/2,n}(e,l,c);return"center"===l?"left"===a?g+=c:"right"===a&&(g-=c):"left"===a?g-=Math.max(h,u)+s:"right"===a&&(g+=Math.max(d,f)+s),{x:rt(g,0,n.width-e.width),y:rt(p,0,n.height-e.height)}}function sr(t,e,i){const n=fe(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-n.right:t.x+n.left}function rr(t){return Ks([],Zs(t))}function or(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}class ar extends Tn{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart||t._chart,this._chart=this.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),n=i.enabled&&e.options.animation&&i.animations,s=new pi(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=(this,me(this.chart.getContext(),{tooltip:this,tooltipItems:this._tooltipItems,type:"tooltip"})))}getTitle(t,e){const{callbacks:i}=e,n=i.beforeTitle.apply(this,[t]),s=i.title.apply(this,[t]),r=i.afterTitle.apply(this,[t]);let o=[];return o=Ks(o,Zs(n)),o=Ks(o,Zs(s)),o=Ks(o,Zs(r)),o}getBeforeBody(t,e){return rr(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){const{callbacks:i}=e,n=[];return M(t,t=>{const e={before:[],lines:[],after:[]},s=or(i,t);Ks(e.before,Zs(s.beforeLabel.call(this,t))),Ks(e.lines,s.label.call(this,t)),Ks(e.after,Zs(s.afterLabel.call(this,t))),n.push(e)}),n}getAfterBody(t,e){return rr(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){const{callbacks:i}=e,n=i.beforeFooter.apply(this,[t]),s=i.footer.apply(this,[t]),r=i.afterFooter.apply(this,[t]);let o=[];return o=Ks(o,Zs(n)),o=Ks(o,Zs(s)),o=Ks(o,Zs(r)),o}_createItems(t){const e=this._active,i=this.chart.data,n=[],s=[],r=[];let o,a,l=[];for(o=0,a=e.length;ot.filter(e,n,s,i))),t.itemSort&&(l=l.sort((e,n)=>t.itemSort(e,n,i))),M(l,e=>{const i=or(t.callbacks,e);n.push(i.labelColor.call(this,e)),s.push(i.labelPointStyle.call(this,e)),r.push(i.labelTextColor.call(this,e))}),this.labelColors=n,this.labelPointStyles=s,this.labelTextColors=r,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),n=this._active;let s,r=[];if(n.length){const t=Qs[i.position].call(this,n,this._eventPosition);r=this._createItems(i),this.title=this.getTitle(r,i),this.beforeBody=this.getBeforeBody(r,i),this.body=this.getBody(r,i),this.afterBody=this.getAfterBody(r,i),this.footer=this.getFooter(r,i);const e=this._size=tr(this,i),o=Object.assign({},t,e),a=ir(this.chart,i,o),l=nr(i,o,a,this.chart);this.xAlign=a.xAlign,this.yAlign=a.yAlign,s={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(s={opacity:0});this._tooltipItems=r,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,n){const s=this.getCaretPosition(t,i,n);e.lineTo(s.x1,s.y1),e.lineTo(s.x2,s.y2),e.lineTo(s.x3,s.y3)}getCaretPosition(t,e,i){const{xAlign:n,yAlign:s}=this,{caretSize:r,cornerRadius:o}=i,{topLeft:a,topRight:l,bottomLeft:c,bottomRight:h}=ue(o),{x:d,y:u}=t,{width:f,height:g}=e;let p,m,b,x,y,v;return"center"===s?(y=u+g/2,"left"===n?(p=d,m=p-r,x=y+r,v=y-r):(p=d+f,m=p+r,x=y-r,v=y+r),b=p):(m="left"===n?d+Math.max(a,c)+r:"right"===n?d+f-Math.max(l,h)-r:this.caretX,"top"===s?(x=u,y=x-r,p=m-r,b=m+r):(x=u+g,y=x+r,p=m+r,b=m-r),v=x),{x1:p,x2:m,x3:b,y1:x,y2:y,y3:v}}drawTitle(t,e,i){const n=this.title,s=n.length;let r,o,a;if(s){const l=si(i.rtl,this.x,this.width);for(t.x=sr(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",r=ge(i.titleFont),o=i.titleSpacing,e.fillStyle=i.titleColor,e.font=r.string,a=0;a0!==t)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,oe(t,{x:e,y:g,w:l,h:a,radius:o}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),oe(t,{x:i,y:g+1,w:l-2,h:a-2,radius:o}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(e,g,l,a),t.strokeRect(e,g,l,a),t.fillStyle=r.backgroundColor,t.fillRect(i,g+1,l-2,a-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:n}=this,{bodySpacing:s,bodyAlign:r,displayColors:o,boxHeight:a,boxWidth:l,boxPadding:c}=i,h=ge(i.bodyFont);let d=h.lineHeight,u=0;const f=si(i.rtl,this.x,this.width),g=function(i){e.fillText(i,f.x(t.x+u),t.y+d/2),t.y+=d+s},p=f.textAlign(r);let m,b,x,y,v,_,w;for(e.textAlign=r,e.textBaseline="middle",e.font=h.string,t.x=sr(this,p,i),e.fillStyle=i.bodyColor,M(this.beforeBody,g),u=o&&"right"!==p?"center"===r?l/2+c:l+2+c:0,y=0,_=n.length;y<_;++y){for(m=n[y],b=this.labelTextColors[y],e.fillStyle=b,M(m.before,g),x=m.lines,o&&x.length&&(this._drawColorBox(e,t,y,f,i),d=Math.max(h.lineHeight,a)),v=0,w=x.length;v0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,n=i&&i.x,s=i&&i.y;if(n||s){const i=Qs[t.position].call(this,this._active,this._eventPosition);if(!i)return;const r=this._size=tr(this,t),o=Object.assign({},i,this._size),a=ir(e,t,o),l=nr(t,o,a,e);n._to===l.x&&s._to===l.y||(this.xAlign=a.xAlign,this.yAlign=a.yAlign,this.width=r.width,this.height=r.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const r=fe(e.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&o&&(t.save(),t.globalAlpha=i,this.drawBackground(s,t,n,e),function(t,e){let i,n;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,n=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=n)}(t,e.textDirection),s.y+=r.top,this.drawTitle(s,t,e),this.drawBody(s,t,e),this.drawFooter(s,t,e),function(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,n=t.map(({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),s=!O(i,n),r=this._positionChanged(n,e);(s||r)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,s=this._active||[],r=this._getActiveElements(t,s,e,i),o=this._positionChanged(r,t),a=e||!O(r,s)||o;return a&&(this._active=r,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),a}_getActiveElements(t,e,i,n){const s=this.options;if("mouseout"===t.type)return[];if(!n)return e;const r=this.chart.getElementsAtEventForMode(t,s.mode,s,i);return s.reverse&&r.reverse(),r}_positionChanged(t,e){const{caretX:i,caretY:n,options:s}=this,r=Qs[s.position].call(this,t,e);return!1!==r&&(i!==r.x||n!==r.y)}}ar.positioners=Qs;var lr={id:"tooltip",_element:ar,positioners:Qs,afterInit(t,e,i){i&&(t.tooltip=new ar({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip,i={tooltip:e};!1!==t.notifyPlugins("beforeTooltipDraw",i)&&(e&&e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i))},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:f,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,n=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(n>0&&e.dataIndex"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};class cr extends Vn{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:i,label:n}of e)t[i]===n&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(p(t))return null;const i=this.getLabels();return((t,e)=>null===t?null:rt(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:function(t,e,i,n){const s=t.indexOf(e);return-1===s?((t,e,i,n)=>("string"==typeof e?(i=t.push(e)-1,n.unshift({index:i,label:e})):isNaN(e)&&(i=null),i))(t,e,i,n):s!==t.lastIndexOf(e)?i:s}(i,t,v(e,t),this._addedLabels),i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:n}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(n=this.getLabels().length-1)),this.min=i,this.max=n}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,n=[];let s=this.getLabels();s=0===t&&e===s.length-1?s:s.slice(t,e+1),this._valueRange=Math.max(s.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let i=t;i<=e;i++)n.push({value:i});return n}getLabelForValue(t){const e=this.getLabels();return t>=0&&te.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function hr(t,e,{horizontal:i,minRotation:n}){const s=K(n),r=(i?Math.sin(s):Math.cos(s))||.001,o=.75*e*(""+t).length;return Math.min(e/r,o)}cr.id="category",cr.defaults={ticks:{callback:cr.prototype.getLabelForValue}};class dr extends Vn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return p(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:n,max:s}=this;const r=t=>n=e?n:t,o=t=>s=i?s:t;if(t){const t=$(n),e=$(s);t<0&&e<0?o(0):t>0&&e>0&&r(0)}if(n===s){let e=1;(s>=Number.MAX_SAFE_INTEGER||n<=Number.MIN_SAFE_INTEGER)&&(e=Math.abs(.05*s)),o(s+e),t||r(n-e)}this.min=n,this.max=s}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:n}=t;return n?(e=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const n=function(t,e){const i=[],{bounds:n,step:s,min:r,max:o,precision:a,count:l,maxTicks:c,maxDigits:h,includeBounds:d}=t,u=s||1,f=c-1,{min:g,max:m}=e,b=!p(r),x=!p(o),y=!p(l),v=(m-g)/(h+1);let _,w,M,O,k=X((m-g)/f/u)*u;if(k<1e-14&&!b&&!x)return[{value:g},{value:m}];O=Math.ceil(m/k)-Math.floor(g/k),O>f&&(k=X(O*k/f/u)*u),p(a)||(_=Math.pow(10,a),k=Math.ceil(k*_)/_),"ticks"===n?(w=Math.floor(g/k)*k,M=Math.ceil(m/k)*k):(w=g,M=m),b&&x&&s&&function(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}((o-r)/s,k/1e3)?(O=Math.round(Math.min((o-r)/k,c)),k=(o-r)/O,w=r,M=o):y?(w=b?r:w,M=x?o:M,O=l-1,k=(M-w)/O):(O=(M-w)/k,O=G(O,Math.round(O),k/1e3)?Math.round(O):Math.ceil(O));const S=Math.max(J(k),J(w));_=Math.pow(10,p(a)?S:a),w=Math.round(w*_)/_,M=Math.round(M*_)/_;let D=0;for(b&&(d&&w!==r?(i.push({value:r}),w0?i:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=x(t)?Math.max(0,t):null,this.max=x(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,n=this.max;const s=e=>i=t?i:e,r=t=>n=e?n:t,o=(t,e)=>Math.pow(10,Math.floor(Y(t))+e);i===n&&(i<=0?(s(1),r(10)):(s(o(i,-1)),r(o(n,1)))),i<=0&&s(o(n,-1)),n<=0&&r(o(i,1)),this._zero&&this.min!==this._suggestedMin&&i===o(this.min,0)&&s(o(i,-1)),this.min=i,this.max=n}buildTicks(){const t=this.options,e=function(t,e){const i=Math.floor(Y(e.max)),n=Math.ceil(e.max/Math.pow(10,i)),s=[];let r=y(t.min,Math.pow(10,Math.floor(Y(e.min)))),o=Math.floor(Y(r)),a=Math.floor(r/Math.pow(10,o)),l=o<0?Math.pow(10,Math.abs(o)):1;do{s.push({value:r,major:fr(r)}),++a,10===a&&(a=1,++o,l=o>=0?1:l),r=Math.round(a*Math.pow(10,o)*l)/l}while(os?{start:e-i,end:e}:{start:e,end:e+i}}function br(t,e,i,n,s){const r=Math.abs(Math.sin(i)),o=Math.abs(Math.cos(i));let a=0,l=0;n.starte.r&&(a=(n.end-e.r)/r,t.r=Math.max(t.r,e.r+a)),s.starte.b&&(l=(s.end-e.b)/o,t.b=Math.max(t.b,e.b+l))}function xr(t){return 0===t||180===t?"center":t<180?"left":"right"}function yr(t,e,i){return 90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e),t}function vr(t,e,i,n){const{ctx:s}=t;if(i)s.arc(t.xCenter,t.yCenter,e,0,I);else{let i=t.getPointPosition(0,e);s.moveTo(i.x,i.y);for(let r=1;r{const i=w(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""}).filter((t,e)=>this.chart.getDataVisibility(e))}fit(){const t=this.options;t.display&&t.pointLabels.display?function(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),n=[],s=[],r=t._pointLabels.length,o=t.options.pointLabels,a=o.centerPointLabels?z/r:0;for(let d=0;d=0&&t=0;s--){const e=n.setContext(t.getPointLabelContext(s)),r=ge(e.font),{x:o,y:a,textAlign:l,left:c,top:h,right:d,bottom:u}=t._pointLabelItems[s],{backdropColor:f}=e;if(!p(f)){const t=fe(e.backdropPadding);i.fillStyle=f,i.fillRect(c-t.left,h-t.top,d-c+t.width,u-h+t.height)}se(i,t._pointLabels[s],o,a+r.lineHeight/2,r,{color:e.color,textAlign:l,textBaseline:"middle"})}}(this,s),n.display&&this.ticks.forEach((t,e)=>{0!==e&&(o=this.getDistanceFromCenterForValue(t.value),function(t,e,i,n){const s=t.ctx,r=e.circular,{color:o,lineWidth:a}=e;!r&&!n||!o||!a||i<0||(s.save(),s.strokeStyle=o,s.lineWidth=a,s.setLineDash(e.borderDash),s.lineDashOffset=e.borderDashOffset,s.beginPath(),vr(t,i,r,n),s.closePath(),s.stroke(),s.restore())}(this,n.setContext(this.getContext(e-1)),o,s))}),i.display){for(t.save(),r=s-1;r>=0;r--){const n=i.setContext(this.getPointLabelContext(r)),{color:s,lineWidth:l}=n;l&&s&&(t.lineWidth=l,t.strokeStyle=s,t.setLineDash(n.borderDash),t.lineDashOffset=n.borderDashOffset,o=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),a=this.getPointPosition(r,o),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(a.x,a.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const n=this.getIndexAngle(0);let s,r;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(n),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((n,o)=>{if(0===o&&!e.reverse)return;const a=i.setContext(this.getContext(o)),l=ge(a.font);if(s=this.getDistanceFromCenterForValue(this.ticks[o].value),a.showLabelBackdrop){t.font=l.string,r=t.measureText(n.label).width,t.fillStyle=a.backdropColor;const e=fe(a.backdropPadding);t.fillRect(-r/2-e.left,-s-l.size/2-e.top,r+e.width,l.size+e.height)}se(t,n.label,0,-s,l,{color:a.color})}),t.restore()}drawTitle(){}}_r.id="radialLinear",_r.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:jn.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}},_r.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},_r.descriptors={angleLines:{_fallback:"grid"}};const wr={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Mr=Object.keys(wr);function Or(t,e){return t-e}function kr(t,e){if(p(e))return null;const i=t._adapter,{parser:n,round:s,isoWeekday:r}=t._parseOpts;let o=e;return"function"==typeof n&&(o=n(o)),x(o)||(o="string"==typeof n?i.parse(o,n):i.parse(o)),null===o?null:(s&&(o="week"!==s||!q(r)&&!0!==r?i.startOf(o,s):i.startOf(o,"isoWeek",r)),+o)}function Sr(t,e,i,n){const s=Mr.length;for(let r=Mr.indexOf(t);r=e?i[n]:i[s]]=!0}}else t[e]=!0}function Pr(t,e,i){const n=[],s={},r=e.length;let o,a;for(o=0;o=0&&(e[l].major=!0);return e}(t,n,s,i):n}class Cr extends Vn{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e){const i=t.time||(t.time={}),n=this._adapter=new $i._date(t.adapters.date);C(i.displayFormats,n.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:kr(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:n,max:s,minDefined:r,maxDefined:o}=this.getUserBounds();function a(t){r||isNaN(t.min)||(n=Math.min(n,t.min)),o||isNaN(t.max)||(s=Math.max(s,t.max))}r&&o||(a(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||a(this.getMinMax(!1))),n=x(n)&&!isNaN(n)?n:+e.startOf(Date.now(),i),s=x(s)&&!isNaN(s)?s:+e.endOf(Date.now(),i)+1,this.min=Math.min(n,s-1),this.max=Math.max(n+1,s)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,n="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const s=this.min,r=function(t,e,i){let n=0,s=t.length;for(;nn&&t[s-1]>i;)s--;return n>0||s=Mr.indexOf(i);r--){const i=Mr[r];if(wr[i].common&&t._adapter.diff(s,n,i)>=e-1)return i}return Mr[i?Mr.indexOf(i):0]}(this,r.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(let e=Mr.indexOf(t)+1,i=Mr.length;e1e5*o)throw new Error(e+" and "+i+" are too far apart with stepSize of "+o+" "+r);const f="data"===n.ticks.source&&this.getDataTimestamps();for(h=u,d=0;ht-e).map(t=>+t)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}_tickFormatFunction(t,e,i,n){const s=this.options,r=s.time.displayFormats,o=this._unit,a=this._majorUnit,l=o&&r[o],c=a&&r[a],h=i[e],d=a&&c&&h&&h.major,u=this._adapter.format(t,n||(d?c:l)),f=s.ticks.callback;return f?w(f,[u,e,i],this):u}generateTickLabels(t){let e,i,n;for(e=0,i=t.length;e0?o:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(t=0,e=n.length;t=t[a].pos&&e<=t[l].pos&&({lo:a,hi:l}=xe(t,"pos",e)),({pos:n,time:r}=t[a]),({pos:s,time:o}=t[l])):(e>=t[a].time&&e<=t[l].time&&({lo:a,hi:l}=xe(t,"time",e)),({time:n,pos:r}=t[a]),({time:s,pos:o}=t[l]));const c=s-n;return c?r+(o-r)*(e-n)/c:r}Cr.id="time",Cr.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};class Er extends Cr{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Tr(e,this.min),this._tableRange=Tr(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,n=[],s=[];let r,o,a,l,c;for(r=0,o=t.length;r=e&&l<=i&&n.push(l);if(n.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(r=0,o=n.length;r2&&void 0!==arguments[2]?arguments[2]:"label";const n=[];t.datasets=e.map(e=>{const s=t.datasets.find(t=>t[i]===e[i]);return s&&e.data&&!n.includes(s)?(n.push(s),Object.assign(s,e),s):{...e}})}function zr(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"label";const i={labels:[],datasets:[]};return Rr(i,t.labels),Fr(i,t.datasets,e),i}function Ir(t,e){let{height:i=150,width:n=300,redraw:s=!1,datasetIdKey:r,type:o,data:a,options:l,plugins:c=[],fallbackContent:h,...d}=t;const u=Object(jr.useRef)(null),f=Object(jr.useRef)(),g=()=>{u.current&&(f.current=new us(u.current,{type:o,data:zr(a,r),options:l,plugins:c}),Lr(e,f.current))},p=()=>{Lr(e,null),f.current&&(f.current.destroy(),f.current=null)};return Object(jr.useEffect)(()=>{var t,e;!s&&f.current&&l&&(t=f.current,e=l,t.options={...e})},[s,l]),Object(jr.useEffect)(()=>{!s&&f.current&&Rr(f.current.config.data,a.labels)},[s,a.labels]),Object(jr.useEffect)(()=>{!s&&f.current&&a.datasets&&Fr(f.current.config.data,a.datasets,r)},[s,a.datasets]),Object(jr.useEffect)(()=>{f.current&&(s?(p(),setTimeout(g)):f.current.update())},[s,l,a.labels,a.datasets]),Object(jr.useEffect)(()=>(g(),()=>p()),[]),Ar.a.createElement("canvas",Object.assign({ref:u,role:"img",height:i,width:n},d),h)}const Nr=Object(jr.forwardRef)(Ir);var Vr=i(3),Wr=i(17),Br=i(7),Hr=i(8),Ur=i(4);function Yr(t,e){Object(Ur.a)(2,arguments);var i=Object(Hr.a)(t),n=Object(Br.a)(e);return isNaN(n)?new Date(NaN):n?(i.setDate(i.getDate()+n),i):i}function $r(t,e){Object(Ur.a)(2,arguments);var i=Object(Br.a)(e);return Yr(t,-i)}function Xr(t,e){Object(Ur.a)(2,arguments);var i=Object(Hr.a)(t),n=Object(Br.a)(e);if(isNaN(n))return new Date(NaN);if(!n)return i;var s=i.getDate(),r=new Date(i.getTime());r.setMonth(i.getMonth()+n+1,0);var o=r.getDate();return s>=o?r:(i.setFullYear(r.getFullYear(),r.getMonth(),s),i)}function qr(t,e){Object(Ur.a)(2,arguments);var i=Object(Br.a)(e);return Xr(t,-i)}function Gr(t){return(Gr="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 Qr(t,e){if(Object(Ur.a)(2,arguments),!e||"object"!==Gr(e))return new Date(NaN);var i=e.years?Object(Br.a)(e.years):0,n=e.months?Object(Br.a)(e.months):0,s=e.weeks?Object(Br.a)(e.weeks):0,r=e.days?Object(Br.a)(e.days):0,o=e.hours?Object(Br.a)(e.hours):0,a=e.minutes?Object(Br.a)(e.minutes):0,l=e.seconds?Object(Br.a)(e.seconds):0,c=qr(t,n+12*i),h=$r(c,r+7*s),d=a+60*o,u=l+60*d,f=1e3*u,g=new Date(h.getTime()-f);return g}function Kr(t){return(Kr="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 Zr(t,e){if(Object(Ur.a)(2,arguments),!e||"object"!==Kr(e))return new Date(NaN);var i=e.years?Object(Br.a)(e.years):0,n=e.months?Object(Br.a)(e.months):0,s=e.weeks?Object(Br.a)(e.weeks):0,r=e.days?Object(Br.a)(e.days):0,o=e.hours?Object(Br.a)(e.hours):0,a=e.minutes?Object(Br.a)(e.minutes):0,l=e.seconds?Object(Br.a)(e.seconds):0,c=Object(Hr.a)(t),h=n||i?Xr(c,n+12*i):c,d=r||s?Yr(h,r+7*s):h,u=a+60*o,f=l+60*u,g=1e3*f,p=new Date(d.getTime()+g);return p}function Jr(t,e){var i;Object(Ur.a)(1,arguments);var n=Object(Br.a)(null!==(i=null==e?void 0:e.additionalDigits)&&void 0!==i?i:2);if(2!==n&&1!==n&&0!==n)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof t&&"[object String]"!==Object.prototype.toString.call(t))return new Date(NaN);var s,r=so(t);if(r.date){var o=ro(r.date,n);s=oo(o.restDateString,o.year)}if(!s||isNaN(s.getTime()))return new Date(NaN);var a,l=s.getTime(),c=0;if(r.time&&(c=lo(r.time),isNaN(c)))return new Date(NaN);if(!r.timezone){var h=new Date(l+c),d=new Date(0);return d.setFullYear(h.getUTCFullYear(),h.getUTCMonth(),h.getUTCDate()),d.setHours(h.getUTCHours(),h.getUTCMinutes(),h.getUTCSeconds(),h.getUTCMilliseconds()),d}return a=ho(r.timezone),isNaN(a)?new Date(NaN):new Date(l+c+a)}Math.pow(10,8);var to={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},eo=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,io=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,no=/^([+-])(\d{2})(?::?(\d{2}))?$/;function so(t){var e,i={},n=t.split(to.dateTimeDelimiter);if(n.length>2)return i;if(/:/.test(n[0])?e=n[0]:(i.date=n[0],e=n[1],to.timeZoneDelimiter.test(i.date)&&(i.date=t.split(to.timeZoneDelimiter)[0],e=t.substr(i.date.length,t.length))),e){var s=to.timezone.exec(e);s?(i.time=e.replace(s[1],""),i.timezone=s[1]):i.time=e}return i}function ro(t,e){var i=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),n=t.match(i);if(!n)return{year:NaN,restDateString:""};var s=n[1]?parseInt(n[1]):null,r=n[2]?parseInt(n[2]):null;return{year:null===r?s:100*r,restDateString:t.slice((n[1]||n[2]).length)}}function oo(t,e){if(null===e)return new Date(NaN);var i=t.match(eo);if(!i)return new Date(NaN);var n=!!i[4],s=ao(i[1]),r=ao(i[2])-1,o=ao(i[3]),a=ao(i[4]),l=ao(i[5])-1;if(n)return function(t,e,i){return e>=1&&e<=53&&i>=0&&i<=6}(0,a,l)?function(t,e,i){var n=new Date(0);n.setUTCFullYear(t,0,4);var s=7*(e-1)+i+1-(n.getUTCDay()||7);return n.setUTCDate(n.getUTCDate()+s),n}(e,a,l):new Date(NaN);var c=new Date(0);return function(t,e,i){return e>=0&&e<=11&&i>=1&&i<=(uo[e]||(fo(t)?29:28))}(e,r,o)&&function(t,e){return e>=1&&e<=(fo(t)?366:365)}(e,s)?(c.setUTCFullYear(e,r,Math.max(s,o)),c):new Date(NaN)}function ao(t){return t?parseInt(t):1}function lo(t){var e=t.match(io);if(!e)return NaN;var i=co(e[1]),n=co(e[2]),s=co(e[3]);return function(t,e,i){return 24===t?0===e&&0===i:i>=0&&i<60&&e>=0&&e<60&&t>=0&&t<25}(i,n,s)?36e5*i+6e4*n+1e3*s:NaN}function co(t){return t&&parseFloat(t.replace(",","."))||0}function ho(t){if("Z"===t)return 0;var e=t.match(no);if(!e)return 0;var i="+"===e[1]?-1:1,n=parseInt(e[2]),s=e[3]&&parseInt(e[3])||0;return function(t,e){return e>=0&&e<=59}(0,s)?i*(36e5*n+6e4*s):NaN}var uo=[31,null,31,30,31,30,31,31,30,31,30,31];function fo(t){return t%400==0||t%4==0&&t%100!=0}var go=i(78);function po(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function mo(t){for(var e=1;e0,"is-negative":e<0});return Object(c.createElement)("div",{className:r},Object(c.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"simpay-admin-charts-badge__icon",width:"16",height:"16"},e>0?Object(c.createElement)("path",{d:"M16.004 9.414l-8.607 8.607-1.414-1.414L14.589 8H7.004V6h11v11h-2V9.414z"}):Object(c.createElement)("path",{d:"M14.59 16.004L5.982 7.397l1.414-1.414 8.607 8.606V7.004h2v11h-11v-2z"})),!n&&Object(c.createElement)("span",null,Math.abs(e),"%"))},Eo="simpay-admin-charts-period-over-period__tooltip",jo=function(t){var e=t.position,i=t.opacity,n=t.data,s=t.delta,r=t.deltaChangedString;if(!n.length)return null;var o=e.top,a=e.left,l=e.right,h=Co()("simpay-admin-charts-badge",{"is-positive":s>0,"is-negative":s<0});return Object(c.createElement)("div",{className:Eo,style:{top:o,left:a||"auto",right:l||"auto",opacity:i}},n.map((function(t,e){var i=t.label,n=t.value;return Object(c.createElement)("div",{className:"".concat(Eo,"-data"),"data-dataset":e,key:i+Math.random()},Object(c.createElement)("strong",null,i)," ",Object(c.createElement)("em",null,Object(Wr.decodeEntities)(n)))})),0!==s&&Object(c.createElement)("div",{className:"".concat(Eo,"-delta")},Object(c.createElement)("div",{className:h},Object(c.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"simpay-admin-charts-badge__icon"},s>0?Object(c.createElement)("path",{fillRule:"evenodd",d:"M5.22 14.78a.75.75 0 001.06 0l7.22-7.22v5.69a.75.75 0 001.5 0v-7.5a.75.75 0 00-.75-.75h-7.5a.75.75 0 000 1.5h5.69l-7.22 7.22a.75.75 0 000 1.06z",clipRule:"evenodd"}):Object(c.createElement)("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06l7.22 7.22H6.75a.75.75 0 000 1.5h7.5a.747.747 0 00.75-.75v-7.5a.75.75 0 00-1.5 0v5.69L6.28 5.22z"}))),Object(c.createElement)("span",null,r)))},Ao=function(t){var e=t.chart,i=function(t,e){var i=Object(c.useState)({marginTop:0,marginRight:0,marginBottom:0,marginLeft:0}),n=l()(i,2),s=n[0],r=s.marginTop,o=s.marginRight,a=s.marginBottom,h=s.marginLeft,d=n[1];return Object(c.useEffect)((function(){t.current&&d({marginTop:Math.floor(t.current.chartArea.top),marginRight:Math.floor(t.current.width-t.current.chartArea.right),marginBottom:Math.floor(t.current.chartArea.bottom),marginLeft:Math.floor(t.current.chartArea.left)})}),[t,e]),{marginTop:r,marginRight:o,marginBottom:a,marginLeft:h}}(t.chartRef,e),n=i.marginLeft,s=i.marginRight;return Object(c.createElement)("div",{style:{width:"100%",position:"relative",fontSize:"12px",display:"flex",justifyContent:"space-between",marginTop:"-2px"}},Object(c.createElement)("div",{style:{marginLeft:n,textAlign:"left"}},e.datasets[0].data[0].x),Object(c.createElement)("div",{style:{marginRight:s,textAlign:"right"}},e.datasets[0].data[e.datasets[0].data.length-1].x))};function Lo(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Ro(t){for(var e=1;e0}))}));return Object(c.createElement)("div",{className:"simpay-admin-charts-period-over-period",style:r},!O&&Object(c.createElement)("div",{className:"simpay-admin-charts-no-data",style:Ro(Ro({},r),{},{height:"calc(".concat(r.height," + 15px)")})},a),Object(c.createElement)(Nr,{type:"line",ref:p,options:M,plugins:[_o,(_="rgb(".concat(f.primary_color.join(","),")"),{id:"YGridLineHover",afterDraw:function(t){var e;if(null!==(e=t.tooltip)&&void 0!==e&&null!==(e=e._active)&&void 0!==e&&e.length){var i=t.tooltip._active[0].element.x,n=t.scales.yAxis,s=t.ctx;s.save(),s.beginPath(),s.moveTo(i,n.top),s.lineTo(i,n.bottom),s.lineWidth=2,s.strokeStyle=_,s.stroke(),s.restore()}}})],data:{datasets:m}}),Object(c.createElement)(Ao,{chartRef:p,chart:f}),Object(c.createElement)(jo,s()({},y,{deltaChangedString:h(y)})),Object(c.createElement)(Vr.Popover.Slot,null))}},function(t,e){function i(){return t.exports=i=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var i=0,n=new Array(e);i=r.getTime()?i+1:e.getTime()>=l.getTime()?i:i-1}function f(t){Object(n.a)(1,arguments);var e=u(t),i=new Date(0);i.setUTCFullYear(e,0,4),i.setUTCHours(0,0,0,0);var s=d(i);return s}var g={};function p(){return g}function m(t,e){var i,s,r,a,c,h,d,u;Object(n.a)(1,arguments);var f=p(),g=Object(l.a)(null!==(i=null!==(s=null!==(r=null!==(a=null==e?void 0:e.weekStartsOn)&&void 0!==a?a:null==e||null===(c=e.locale)||void 0===c||null===(h=c.options)||void 0===h?void 0:h.weekStartsOn)&&void 0!==r?r:f.weekStartsOn)&&void 0!==s?s:null===(d=f.locale)||void 0===d||null===(u=d.options)||void 0===u?void 0:u.weekStartsOn)&&void 0!==i?i:0);if(!(g>=0&&g<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var m=Object(o.a)(t),b=m.getUTCDay(),x=(b=1&&x<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var y=new Date(0);y.setUTCFullYear(g+1,0,x),y.setUTCHours(0,0,0,0);var v=m(y,e),_=new Date(0);_.setUTCFullYear(g,0,x),_.setUTCHours(0,0,0,0);var w=m(_,e);return f.getTime()>=v.getTime()?g+1:f.getTime()>=w.getTime()?g:g-1}function x(t,e){var i,s,r,o,a,c,h,d;Object(n.a)(1,arguments);var u=p(),f=Object(l.a)(null!==(i=null!==(s=null!==(r=null!==(o=null==e?void 0:e.firstWeekContainsDate)&&void 0!==o?o:null==e||null===(a=e.locale)||void 0===a||null===(c=a.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==r?r:u.firstWeekContainsDate)&&void 0!==s?s:null===(h=u.locale)||void 0===h||null===(d=h.options)||void 0===d?void 0:d.firstWeekContainsDate)&&void 0!==i?i:1),g=b(t,e),x=new Date(0);x.setUTCFullYear(g,0,f),x.setUTCHours(0,0,0,0);var y=m(x,e);return y}function y(t,e){for(var i=t<0?"-":"",n=Math.abs(t).toString();n.length0?i:1-i;return y("yy"===e?n%100:n,e.length)},_=function(t,e){var i=t.getUTCMonth();return"M"===e?String(i+1):y(i+1,2)},w=function(t,e){return y(t.getUTCDate(),e.length)},M=function(t,e){return y(t.getUTCHours()%12||12,e.length)},O=function(t,e){return y(t.getUTCHours(),e.length)},k=function(t,e){return y(t.getUTCMinutes(),e.length)},S=function(t,e){return y(t.getUTCSeconds(),e.length)},D=function(t,e){var i=e.length,n=t.getUTCMilliseconds();return y(Math.floor(n*Math.pow(10,i-3)),e.length)};function P(t,e){var i=t>0?"-":"+",n=Math.abs(t),s=Math.floor(n/60),r=n%60;if(0===r)return i+String(s);var o=e||"";return i+String(s)+o+y(r,2)}function C(t,e){return t%60==0?(t>0?"-":"+")+y(Math.abs(t)/60,2):T(t,e)}function T(t,e){var i=e||"",n=t>0?"-":"+",s=Math.abs(t);return n+y(Math.floor(s/60),2)+i+y(s%60,2)}var E={G:function(t,e,i){var n=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return i.era(n,{width:"abbreviated"});case"GGGGG":return i.era(n,{width:"narrow"});case"GGGG":default:return i.era(n,{width:"wide"})}},y:function(t,e,i){if("yo"===e){var n=t.getUTCFullYear(),s=n>0?n:1-n;return i.ordinalNumber(s,{unit:"year"})}return v(t,e)},Y:function(t,e,i,n){var s=b(t,n),r=s>0?s:1-s;return"YY"===e?y(r%100,2):"Yo"===e?i.ordinalNumber(r,{unit:"year"}):y(r,e.length)},R:function(t,e){return y(u(t),e.length)},u:function(t,e){return y(t.getUTCFullYear(),e.length)},Q:function(t,e,i){var n=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return y(n,2);case"Qo":return i.ordinalNumber(n,{unit:"quarter"});case"QQQ":return i.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return i.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return i.quarter(n,{width:"wide",context:"formatting"})}},q:function(t,e,i){var n=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return y(n,2);case"qo":return i.ordinalNumber(n,{unit:"quarter"});case"qqq":return i.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return i.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return i.quarter(n,{width:"wide",context:"standalone"})}},M:function(t,e,i){var n=t.getUTCMonth();switch(e){case"M":case"MM":return _(t,e);case"Mo":return i.ordinalNumber(n+1,{unit:"month"});case"MMM":return i.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return i.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return i.month(n,{width:"wide",context:"formatting"})}},L:function(t,e,i){var n=t.getUTCMonth();switch(e){case"L":return String(n+1);case"LL":return y(n+1,2);case"Lo":return i.ordinalNumber(n+1,{unit:"month"});case"LLL":return i.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return i.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return i.month(n,{width:"wide",context:"standalone"})}},w:function(t,e,i,s){var r=function(t,e){Object(n.a)(1,arguments);var i=Object(o.a)(t),s=m(i,e).getTime()-x(i,e).getTime();return Math.round(s/6048e5)+1}(t,s);return"wo"===e?i.ordinalNumber(r,{unit:"week"}):y(r,e.length)},I:function(t,e,i){var s=function(t){Object(n.a)(1,arguments);var e=Object(o.a)(t),i=d(e).getTime()-f(e).getTime();return Math.round(i/6048e5)+1}(t);return"Io"===e?i.ordinalNumber(s,{unit:"week"}):y(s,e.length)},d:function(t,e,i){return"do"===e?i.ordinalNumber(t.getUTCDate(),{unit:"date"}):w(t,e)},D:function(t,e,i){var s=function(t){Object(n.a)(1,arguments);var e=Object(o.a)(t),i=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var s=e.getTime(),r=i-s;return Math.floor(r/864e5)+1}(t);return"Do"===e?i.ordinalNumber(s,{unit:"dayOfYear"}):y(s,e.length)},E:function(t,e,i){var n=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return i.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return i.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(n,{width:"short",context:"formatting"});case"EEEE":default:return i.day(n,{width:"wide",context:"formatting"})}},e:function(t,e,i,n){var s=t.getUTCDay(),r=(s-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(r);case"ee":return y(r,2);case"eo":return i.ordinalNumber(r,{unit:"day"});case"eee":return i.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return i.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(s,{width:"short",context:"formatting"});case"eeee":default:return i.day(s,{width:"wide",context:"formatting"})}},c:function(t,e,i,n){var s=t.getUTCDay(),r=(s-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(r);case"cc":return y(r,e.length);case"co":return i.ordinalNumber(r,{unit:"day"});case"ccc":return i.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return i.day(s,{width:"narrow",context:"standalone"});case"cccccc":return i.day(s,{width:"short",context:"standalone"});case"cccc":default:return i.day(s,{width:"wide",context:"standalone"})}},i:function(t,e,i){var n=t.getUTCDay(),s=0===n?7:n;switch(e){case"i":return String(s);case"ii":return y(s,e.length);case"io":return i.ordinalNumber(s,{unit:"day"});case"iii":return i.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return i.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return i.day(n,{width:"short",context:"formatting"});case"iiii":default:return i.day(n,{width:"wide",context:"formatting"})}},a:function(t,e,i){var n=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return i.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return i.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(t,e,i){var n,s=t.getUTCHours();switch(n=12===s?"noon":0===s?"midnight":s/12>=1?"pm":"am",e){case"b":case"bb":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return i.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return i.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(t,e,i){var n,s=t.getUTCHours();switch(n=s>=17?"evening":s>=12?"afternoon":s>=4?"morning":"night",e){case"B":case"BB":case"BBB":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return i.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return i.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(t,e,i){if("ho"===e){var n=t.getUTCHours()%12;return 0===n&&(n=12),i.ordinalNumber(n,{unit:"hour"})}return M(t,e)},H:function(t,e,i){return"Ho"===e?i.ordinalNumber(t.getUTCHours(),{unit:"hour"}):O(t,e)},K:function(t,e,i){var n=t.getUTCHours()%12;return"Ko"===e?i.ordinalNumber(n,{unit:"hour"}):y(n,e.length)},k:function(t,e,i){var n=t.getUTCHours();return 0===n&&(n=24),"ko"===e?i.ordinalNumber(n,{unit:"hour"}):y(n,e.length)},m:function(t,e,i){return"mo"===e?i.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):k(t,e)},s:function(t,e,i){return"so"===e?i.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):S(t,e)},S:function(t,e){return D(t,e)},X:function(t,e,i,n){var s=(n._originalDate||t).getTimezoneOffset();if(0===s)return"Z";switch(e){case"X":return C(s);case"XXXX":case"XX":return T(s);case"XXXXX":case"XXX":default:return T(s,":")}},x:function(t,e,i,n){var s=(n._originalDate||t).getTimezoneOffset();switch(e){case"x":return C(s);case"xxxx":case"xx":return T(s);case"xxxxx":case"xxx":default:return T(s,":")}},O:function(t,e,i,n){var s=(n._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+P(s,":");case"OOOO":default:return"GMT"+T(s,":")}},z:function(t,e,i,n){var s=(n._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+P(s,":");case"zzzz":default:return"GMT"+T(s,":")}},t:function(t,e,i,n){var s=n._originalDate||t;return y(Math.floor(s.getTime()/1e3),e.length)},T:function(t,e,i,n){return y((n._originalDate||t).getTime(),e.length)}},j=function(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},A=function(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},L={p:A,P:function(t,e){var i,n=t.match(/(P+)(p+)?/)||[],s=n[1],r=n[2];if(!r)return j(t,e);switch(s){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"})}return i.replace("{{date}}",j(s,e)).replace("{{time}}",A(r,e))}};function R(t){var e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}var F=["D","DD"],z=["YY","YYYY"];function I(t){return-1!==F.indexOf(t)}function N(t){return-1!==z.indexOf(t)}function V(t,e,i){if("YYYY"===t)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===t)throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===t)throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===t)throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var W={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function B(t){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.width?String(e.width):t.defaultWidth,n=t.formats[i]||t.formats[t.defaultWidth];return n}}var H={date:B({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:B({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:B({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},U={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function Y(t){return function(e,i){var n;if("formatting"===(null!=i&&i.context?String(i.context):"standalone")&&t.formattingValues){var s=t.defaultFormattingWidth||t.defaultWidth,r=null!=i&&i.width?String(i.width):s;n=t.formattingValues[r]||t.formattingValues[s]}else{var o=t.defaultWidth,a=null!=i&&i.width?String(i.width):t.defaultWidth;n=t.values[a]||t.values[o]}return n[t.argumentCallback?t.argumentCallback(e):e]}}function $(t){return function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.width,s=n&&t.matchPatterns[n]||t.matchPatterns[t.defaultMatchWidth],r=e.match(s);if(!r)return null;var o,a=r[0],l=n&&t.parsePatterns[n]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?q(l,(function(t){return t.test(a)})):X(l,(function(t){return t.test(a)}));o=t.valueCallback?t.valueCallback(c):c,o=i.valueCallback?i.valueCallback(o):o;var h=e.slice(a.length);return{value:o,rest:h}}}function X(t,e){for(var i in t)if(t.hasOwnProperty(i)&&e(t[i]))return i}function q(t,e){for(var i=0;i0?"in "+n:n+" ago":n},formatLong:H,formatRelative:function(t,e,i,n){return U[t]},localize:{ordinalNumber:function(t,e){var i=Number(t),n=i%100;if(n>20||n<10)switch(n%10){case 1:return i+"st";case 2:return i+"nd";case 3:return i+"rd"}return i+"th"},era:Y({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Y({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:Y({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:Y({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:Y({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(G={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(t){return parseInt(t,10)}},function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.match(G.matchPattern);if(!i)return null;var n=i[0],s=t.match(G.parsePattern);if(!s)return null;var r=G.valueCallback?G.valueCallback(s[0]):s[0];r=e.valueCallback?e.valueCallback(r):r;var o=t.slice(n.length);return{value:r,rest:o}}),era:$({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:$({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:$({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:$({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:$({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}},K=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Z=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,J=/^'([^]*?)'?$/,tt=/''/g,et=/[a-zA-Z]/;function it(t,e,i){var s,r,c,d,u,f,g,m,b,x,y,v,_,w,M,O,k,S;Object(n.a)(2,arguments);var D=String(e),P=p(),C=null!==(s=null!==(r=null==i?void 0:i.locale)&&void 0!==r?r:P.locale)&&void 0!==s?s:Q,T=Object(l.a)(null!==(c=null!==(d=null!==(u=null!==(f=null==i?void 0:i.firstWeekContainsDate)&&void 0!==f?f:null==i||null===(g=i.locale)||void 0===g||null===(m=g.options)||void 0===m?void 0:m.firstWeekContainsDate)&&void 0!==u?u:P.firstWeekContainsDate)&&void 0!==d?d:null===(b=P.locale)||void 0===b||null===(x=b.options)||void 0===x?void 0:x.firstWeekContainsDate)&&void 0!==c?c:1);if(!(T>=1&&T<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var j=Object(l.a)(null!==(y=null!==(v=null!==(_=null!==(w=null==i?void 0:i.weekStartsOn)&&void 0!==w?w:null==i||null===(M=i.locale)||void 0===M||null===(O=M.options)||void 0===O?void 0:O.weekStartsOn)&&void 0!==_?_:P.weekStartsOn)&&void 0!==v?v:null===(k=P.locale)||void 0===k||null===(S=k.options)||void 0===S?void 0:S.weekStartsOn)&&void 0!==y?y:0);if(!(j>=0&&j<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!C.localize)throw new RangeError("locale must contain localize property");if(!C.formatLong)throw new RangeError("locale must contain formatLong property");var A=Object(o.a)(t);if(!a(A))throw new RangeError("Invalid time value");var F=R(A),z=h(A,F),W={firstWeekContainsDate:T,weekStartsOn:j,locale:C,_originalDate:A},B=D.match(Z).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,L[e])(t,C.formatLong):t})).join("").match(K).map((function(n){if("''"===n)return"'";var s=n[0];if("'"===s)return nt(n);var r=E[s];if(r)return null!=i&&i.useAdditionalWeekYearTokens||!N(n)||V(n,e,String(t)),null!=i&&i.useAdditionalDayOfYearTokens||!I(n)||V(n,e,String(t)),r(z,n,C.localize,W);if(s.match(et))throw new RangeError("Format string contains an unescaped latin alphabet character `"+s+"`");return n})).join("");return B}function nt(t){var e=t.match(J);return e?e[1].replace(tt,"'"):t}},,,,,function(t,e,i){"use strict";i.r(e);var n=i(6),s=i.n(n),r=i(0),o=(i(37),i(10)),a=i(25),l=i.n(a),c=i(2),h=i(11),d=i.n(h);function u(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function f(t){for(var e=1;ewebhooks to be properly configured to populate correctly.","stripe"),{url:Object(r.createElement)("a",{href:y})})),Object(r.createElement)(p.Flex,null,Object(r.createElement)(p.Button,{variant:"link",onClick:function(){return e(!1)}},Object(c.__)("Close","stripe")),Object(r.createElement)(p.Button,{variant:"primary",isPrimary:!0,href:"https://dashboard.stripe.com/reports/hub",target:"_blank"},Object(c.__)("View advanced reports in Stripe →","stripe"))))},w=i(14),M=simpayAdminDashboardWidgetReport.currencies,O=new Date,k=function(t){var e=t.report,i=t.currency,n=t.setCurrency,o=t.range,a=t.setRange,l=e.data.delta,h=Object(r.useState)(!1),d=s()(h,2),u=d[0],f=d[1];return Object(r.createElement)("div",{className:"simpay-admin-dashboard-widget-report__data-filter"},Object(r.createElement)("div",{className:"simpay-admin-dashboard-widget-report__data-filter-title"},Object(r.createElement)("strong",null,Object(c.__)("Top Forms","stripe")),u&&Object(r.createElement)(_,{setIsOpen:f}),Object(r.createElement)(p.Button,{variant:"link",onClick:function(){return f(!0)}},Object(r.createElement)(m.a,{size:20,icon:b.a}))),Object(r.createElement)("div",{className:"simpay-admin-dashboard-widget-report__data-filter-controls"},!e.isLoading&&0!==l&&Object(r.createElement)(w.a,{delta:l}),Object(r.createElement)(p.SelectControl,{label:Object(c.__)("Currency","stripe"),hideLabelFromVision:!0,value:i,onChange:n,options:M.map((function(t){return{label:t,value:t.toLowerCase()}}))}),Object(r.createElement)(p.SelectControl,{label:Object(c.__)("Range","stripe"),hideLabelFromVision:!0,value:o.type,onChange:function(t){return a({type:t,start:Object(w.d)(t,O),end:Object(w.c)(t,o.end)})},options:[{label:"Today",value:"today"},{label:"Last 7 days",value:"7days"},{label:"Last 4 weeks",value:"4weeks"}]})))},S=i(15),D=i.n(S),P=i(17),C=function(t){var e=t.id,i=t.title,n=t.total_formatted,s=Object(o.addQueryArgs)("post.php",{post:e,action:"edit"});return Object(r.createElement)("div",{style:{display:"flex",justifyContent:"space-between"}},Object(r.createElement)("span",null,i?Object(r.createElement)("a",{href:s,target:"_blank",rel:"noreferrer"},i):Object(c.sprintf)(/* translators: %d Form ID. */ +!function(t){var e={};function i(n){if(e[n])return e[n].exports;var s=e[n]={i:n,l:!1,exports:{}};return t[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}i.m=t,i.c=e,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 s in t)i.d(n,s,function(e){return t[e]}.bind(null,s));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="",i(i.s=81)}([function(t,e){t.exports=window.wp.element},,function(t,e){t.exports=window.wp.i18n},function(t,e){t.exports=window.wp.components},function(t,e,i){"use strict";function n(t,e){if(e.length1?"s":"")+" required, but only "+e.length+" present")}i.d(e,"a",(function(){return n}))},function(t,e){t.exports=window.React},function(t,e,i){var n=i(26),s=i(27),r=i(21),o=i(28);t.exports=function(t,e){return n(t)||s(t,e)||r(t,e)||o()},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){"use strict";function n(t){if(null===t||!0===t||!1===t)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}i.d(e,"a",(function(){return n}))},function(t,e,i){"use strict";i.d(e,"a",(function(){return r}));var n=i(4);function s(t){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t){Object(n.a)(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||"object"===s(t)&&"[object Date]"===e?new Date(t.getTime()):"number"==typeof t||"[object Number]"===e?new Date(t):("string"!=typeof t&&"[object String]"!==e||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}},function(t,e){t.exports=window.wp.primitives},function(t,e){t.exports=window.wp.url},function(t,e,i){var n=i(30);t.exports=function(t,e,i){return(e=n(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=window.lodash},function(t,e,i){"use strict";i.d(e,"b",(function(){return Fo})),i.d(e,"e",(function(){return Do})),i.d(e,"d",(function(){return yo})),i.d(e,"c",(function(){return vo})),i.d(e,"a",(function(){return To}));var n=i(15),s=i.n(n),r=i(11),o=i.n(r),a=i(6),l=i.n(a),c=i(0);const h="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function d(t,e,i){const n=i||(t=>Array.prototype.slice.call(t));let s=!1,r=[];return function(...i){r=n(i),s||(s=!0,h.call(window,()=>{s=!1,t.apply(e,r)}))}}const u=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2;function f(){}const g=function(){let t=0;return function(){return t++}}();function p(t){return null==t}function m(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.substr(0,7)&&"Array]"===e.substr(-6)}function b(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}const x=t=>("number"==typeof t||t instanceof Number)&&isFinite(+t);function y(t,e){return x(t)?t:e}function v(t,e){return void 0===t?e:t}const _=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function w(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function M(t,e,i,n){let s,r,o;if(m(t))if(r=t.length,n)for(s=r-1;s>=0;s--)e.call(i,t[s],s);else for(s=0;si;)t=t[e.substr(i,n-i)],i=n+1,n=E(e,i);return t}function A(t){return t.charAt(0).toUpperCase()+t.slice(1)}const L=t=>void 0!==t,R=t=>"function"==typeof t,F=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0},z=Math.PI,I=2*z,N=I+z,V=Number.POSITIVE_INFINITY,W=z/180,B=z/2,H=z/4,U=2*z/3,Y=Math.log10,$=Math.sign;function X(t){const e=Math.round(t);t=G(t,e,t/1e3)?e:t;const i=Math.pow(10,Math.floor(Y(t))),n=t/i;return(n<=1?1:n<=2?2:n<=5?5:10)*i}function q(t){return!isNaN(parseFloat(t))&&isFinite(t)}function G(t,e,i){return Math.abs(t-e)l&&c=Math.min(e,i)-n&&t<=Math.max(e,i)+n}const at=t=>0===t||1===t,lt=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*I/i),ct=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*I/i)+1,ht={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*B),easeOutSine:t=>Math.sin(t*B),easeInOutSine:t=>-.5*(Math.cos(z*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>at(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>at(t)?t:lt(t,.075,.3),easeOutElastic:t=>at(t)?t:ct(t,.075,.3),easeInOutElastic(t){const e=.1125;return at(t)?t:t<.5?.5*lt(2*t,e,.45):.5+.5*ct(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-ht.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*ht.easeInBounce(2*t):.5*ht.easeOutBounce(2*t-1)+.5},dt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},ut="0123456789ABCDEF",ft=t=>ut[15&t],gt=t=>ut[(240&t)>>4]+ut[15&t],pt=t=>(240&t)>>4==(15&t);function mt(t){return t+.5|0}const bt=(t,e,i)=>Math.max(Math.min(t,i),e);function xt(t){return bt(mt(2.55*t),0,255)}function yt(t){return bt(mt(255*t),0,255)}function vt(t){return bt(mt(t/2.55)/100,0,1)}function _t(t){return bt(mt(100*t),0,100)}const wt=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/,Mt=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Ot(t,e,i){const n=e*Math.min(i,1-i),s=(e,s=(e+t/30)%12)=>i-n*Math.max(Math.min(s-3,9-s,1),-1);return[s(0),s(8),s(4)]}function kt(t,e,i){const n=(n,s=(n+t/60)%6)=>i-i*e*Math.max(Math.min(s,4-s,1),0);return[n(5),n(3),n(1)]}function St(t,e,i){const n=Ot(t,1,.5);let s;for(e+i>1&&(s=1/(e+i),e*=s,i*=s),s=0;s<3;s++)n[s]*=1-e-i,n[s]+=e;return n}function Dt(t){const e=t.r/255,i=t.g/255,n=t.b/255,s=Math.max(e,i,n),r=Math.min(e,i,n),o=(s+r)/2;let a,l,c;return s!==r&&(c=s-r,l=o>.5?c/(2-s-r):c/(s+r),a=s===e?(i-n)/c+(i=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=yt(t[3]))):(e=Rt(t,{r:0,g:0,b:0,a:1})).a=yt(e.a),e}function zt(t){return"r"===t.charAt(0)?function(t){const e=wt.exec(t);let i,n,s,r=255;if(e){if(e[7]!==i){const t=+e[7];r=255&(e[8]?xt(t):255*t)}return i=+e[1],n=+e[3],s=+e[5],i=255&(e[2]?xt(i):i),n=255&(e[4]?xt(n):n),s=255&(e[6]?xt(s):s),{r:i,g:n,b:s,a:r}}}(t):function(t){const e=Mt.exec(t);let i,n=255;if(!e)return;e[5]!==i&&(n=e[6]?xt(+e[5]):yt(+e[5]));const s=Tt(+e[2]),r=+e[3]/100,o=+e[4]/100;return i="hwb"===e[1]?function(t,e,i){return Pt(St,t,e,i)}(s,r,o):"hsv"===e[1]?function(t,e,i){return Pt(kt,t,e,i)}(s,r,o):Ct(s,r,o),{r:i[0],g:i[1],b:i[2],a:n}}(t)}class It{constructor(t){if(t instanceof It)return t;const e=typeof t;let i;var n,s,r;"object"===e?i=Ft(t):"string"===e&&(r=(n=t).length,"#"===n[0]&&(4===r||5===r?s={r:255&17*dt[n[1]],g:255&17*dt[n[2]],b:255&17*dt[n[3]],a:5===r?17*dt[n[4]]:255}:7!==r&&9!==r||(s={r:dt[n[1]]<<4|dt[n[2]],g:dt[n[3]]<<4|dt[n[4]],b:dt[n[5]]<<4|dt[n[6]],a:9===r?dt[n[7]]<<4|dt[n[8]]:255})),i=s||function(t){At||(At=function(){const t={},e=Object.keys(jt),i=Object.keys(Et);let n,s,r,o,a;for(n=0;n>16&255,r>>8&255,255&r]}return t}(),At.transparent=[0,0,0,0]);const e=At[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}(t)||zt(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Rt(this._rgb);return t&&(t.a=vt(t.a)),t}set rgb(t){this._rgb=Ft(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${vt(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):this._rgb;var t}hexString(){return this._valid?(t=this._rgb,e=function(t){return pt(t.r)&&pt(t.g)&&pt(t.b)&&pt(t.a)}(t)?ft:gt,t?"#"+e(t.r)+e(t.g)+e(t.b)+(t.a<255?e(t.a):""):t):this._rgb;var t,e}hslString(){return this._valid?function(t){if(!t)return;const e=Dt(t),i=e[0],n=_t(e[1]),s=_t(e[2]);return t.a<255?`hsla(${i}, ${n}%, ${s}%, ${vt(t.a)})`:`hsl(${i}, ${n}%, ${s}%)`}(this._rgb):this._rgb}mix(t,e){const i=this;if(t){const n=i.rgb,s=t.rgb;let r;const o=e===r?.5:e,a=2*o-1,l=n.a-s.a,c=((a*l==-1?a:(a+l)/(1+a*l))+1)/2;r=1-c,n.r=255&c*n.r+r*s.r+.5,n.g=255&c*n.g+r*s.g+.5,n.b=255&c*n.b+r*s.b+.5,n.a=o*n.a+(1-o)*s.a,i.rgb=n}return i}clone(){return new It(this.rgb)}alpha(t){return this._rgb.a=yt(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=mt(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Lt(this._rgb,2,t),this}darken(t){return Lt(this._rgb,2,-t),this}saturate(t){return Lt(this._rgb,1,t),this}desaturate(t){return Lt(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=Dt(t);i[0]=Tt(i[0]+e),i=Ct(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}function Nt(t){return new It(t)}const Vt=t=>t instanceof CanvasGradient||t instanceof CanvasPattern;function Wt(t){return Vt(t)?t:Nt(t)}function Bt(t){return Vt(t)?t:Nt(t).saturate(.5).darken(.1).hexString()}const Ht=Object.create(null),Ut=Object.create(null);function Yt(t,e){if(!e)return t;const i=e.split(".");for(let e=0,n=i.length;et.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>Bt(e.backgroundColor),this.hoverBorderColor=(t,e)=>Bt(e.borderColor),this.hoverColor=(t,e)=>Bt(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t)}set(t,e){return $t(this,t,e)}get(t){return Yt(this,t)}describe(t,e){return $t(Ut,t,e)}override(t,e){return $t(Ht,t,e)}route(t,e,i,n){const s=Yt(this,t),r=Yt(this,i),o="_"+e;Object.defineProperties(s,{[o]:{value:s[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[o],e=r[n];return b(t)?Object.assign({},e,t):v(t,e)},set(t){this[o]=t}}})}}({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function qt(t,e,i,n,s){let r=e[s];return r||(r=e[s]=t.measureText(s).width,i.push(s)),r>n&&(n=r),n}function Gt(t,e,i,n){let s=(n=n||{}).data=n.data||{},r=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(s=n.data={},r=n.garbageCollect=[],n.font=e),t.save(),t.font=e;let o=0;const a=i.length;let l,c,h,d,u;for(l=0;li.length){for(l=0;l0&&t.stroke()}}function Jt(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.xe.top-i&&t.y0&&""!==r.strokeColor;let l,c;for(t.save(),t.font=s.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),p(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,r),l=0;lv(t[i],t[e[i]]):e=>t[e]:()=>t;for(const t of s)i[t]=+r(t)||0;return i}function de(t){return he(t,{top:"y",right:"x",bottom:"y",left:"x"})}function ue(t){return he(t,["topLeft","topRight","bottomLeft","bottomRight"])}function fe(t){const e=de(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function ge(t,e){t=t||{},e=e||Xt.font;let i=v(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let n=v(t.style,e.style);n&&!(""+n).match(le)&&(console.warn('Invalid font style specified: "'+n+'"'),n="");const s={family:v(t.family,e.family),lineHeight:ce(v(t.lineHeight,e.lineHeight),i),size:i,style:n,weight:v(t.weight,e.weight),string:""};return s.string=function(t){return!t||p(t.size)||p(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(s),s}function pe(t,e,i,n){let s,r,o,a=!0;for(s=0,r=t.length;st[i]1;)n=r+s>>1,i(n)?r=n:s=n;return{lo:r,hi:s}}const xe=(t,e,i)=>be(t,i,n=>t[n][e]be(t,i,n=>t[n][e]>=i),ve=["push","pop","shift","splice","unshift"];function _e(t,e){const i=t._chartjs;if(!i)return;const n=i.listeners,s=n.indexOf(e);-1!==s&&n.splice(s,1),n.length>0||(ve.forEach(e=>{delete t[e]}),delete t._chartjs)}function we(t){const e=new Set;let i,n;for(i=0,n=t.length;it[0])){L(n)||(n=Le("_fallback",t));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:i,_fallback:n,_getTarget:s,override:s=>Me([s,...t],e,i,n)};return new Proxy(r,{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,n)=>Pe(i,n,()=>function(t,e,i,n){let s;for(const r of e)if(s=Le(Se(r,t),i),L(s))return De(t,s)?je(i,n,t,s):s}(n,e,t,i)),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>Re(t).includes(e),ownKeys:t=>Re(t),set(t,e,i){const n=t._storage||(t._storage=s());return t[e]=n[e]=i,delete t._keys,!0}})}function Oe(t,e,i,n){const s={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:ke(t,n),setContext:e=>Oe(t,e,i,n),override:s=>Oe(t.override(s),e,i,n)};return new Proxy(s,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>Pe(t,e,()=>function(t,e,i){const{_proxy:n,_context:s,_subProxy:r,_descriptors:o}=t;let a=n[e];return R(a)&&o.isScriptable(e)&&(a=function(t,e,i,n){const{_proxy:s,_context:r,_subProxy:o,_stack:a}=i;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);return a.add(t),e=e(r,o||n),a.delete(t),De(t,e)&&(e=je(s._scopes,s,t,e)),e}(e,a,t,i)),m(a)&&a.length&&(a=function(t,e,i,n){const{_proxy:s,_context:r,_subProxy:o,_descriptors:a}=i;if(L(r.index)&&n(t))e=e[r.index%e.length];else if(b(e[0])){const i=e,n=s._scopes.filter(t=>t!==i);e=[];for(const l of i){const i=je(n,s,t,l);e.push(Oe(i,r,o&&o[t],a))}}return e}(e,a,t,o.isIndexable)),De(e,a)&&(a=Oe(a,s,r&&r[e],o)),a}(t,e,i)),getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,i)=>Reflect.has(t,i),ownKeys:()=>Reflect.ownKeys(t),set:(e,i,n)=>(t[i]=n,delete e[i],!0)})}function ke(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:n=e.indexable,_allKeys:s=e.allKeys}=t;return{allKeys:s,scriptable:i,indexable:n,isScriptable:R(i)?i:()=>i,isIndexable:R(n)?n:()=>n}}const Se=(t,e)=>t?t+A(e):e,De=(t,e)=>b(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function Pe(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const n=i();return t[e]=n,n}function Ce(t,e,i){return R(t)?t(e,i):t}const Te=(t,e)=>!0===t?e:"string"==typeof t?j(e,t):void 0;function Ee(t,e,i,n,s){for(const r of e){const e=Te(i,r);if(e){t.add(e);const r=Ce(e._fallback,i,s);if(L(r)&&r!==i&&r!==n)return r}else if(!1===e&&L(n)&&i!==n)return null}return!1}function je(t,e,i,n){const s=e._rootScopes,r=Ce(e._fallback,i,n),o=[...t,...s],a=new Set;a.add(n);let l=Ae(a,o,i,r||i,n);return null!==l&&(!L(r)||r===i||(l=Ae(a,o,r,l,n),null!==l))&&Me(Array.from(a),[""],s,r,()=>function(t,e,i){const n=t._getTarget();e in n||(n[e]={});const s=n[e];return m(s)&&b(i)?i:s}(e,i,n))}function Ae(t,e,i,n,s){for(;i;)i=Ee(t,e,i,n,s);return i}function Le(t,e){for(const i of e){if(!i)continue;const e=i[t];if(L(e))return e}}function Re(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter(t=>!t.startsWith("_")))e.add(t);return Array.from(e)}(t._scopes)),e}const Fe=Number.EPSILON||1e-14,ze=(t,e)=>e"x"===t?"y":"x";function Ne(t,e,i,n){const s=t.skip?e:t,r=e,o=i.skip?e:i,a=et(r,s),l=et(o,r);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=n*c,u=n*h;return{previous:{x:r.x-d*(o.x-s.x),y:r.y-d*(o.y-s.y)},next:{x:r.x+u*(o.x-s.x),y:r.y+u*(o.y-s.y)}}}function Ve(t,e,i){return Math.max(Math.min(t,i),e)}function We(t,e,i,n,s){let r,o,a,l;if(e.spanGaps&&(t=t.filter(t=>!t.skip)),"monotone"===e.cubicInterpolationMode)!function(t,e="x"){const i=Ie(e),n=t.length,s=Array(n).fill(0),r=Array(n);let o,a,l,c=ze(t,0);for(o=0;owindow.getComputedStyle(t,null),$e=["top","right","bottom","left"];function Xe(t,e,i){const n={};i=i?"-"+i:"";for(let s=0;s<4;s++){const r=$e[s];n[r]=parseFloat(t[e+"-"+r+i])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function qe(t,e){const{canvas:i,currentDevicePixelRatio:n}=e,s=Ye(i),r="border-box"===s.boxSizing,o=Xe(s,"padding"),a=Xe(s,"border","width"),{x:l,y:c,box:h}=function(t,e){const i=t.native||t,n=i.touches,s=n&&n.length?n[0]:i,{offsetX:r,offsetY:o}=s;let a,l,c=!1;if(((t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot))(r,o,i.target))a=r,l=o;else{const t=e.getBoundingClientRect();a=s.clientX-t.left,l=s.clientY-t.top,c=!0}return{x:a,y:l,box:c}}(t,i),d=o.left+(h&&a.left),u=o.top+(h&&a.top);let{width:f,height:g}=e;return r&&(f-=o.width+a.width,g-=o.height+a.height),{x:Math.round((l-d)/f*i.width/n),y:Math.round((c-u)/g*i.height/n)}}const Ge=t=>Math.round(10*t)/10;function Qe(t,e,i){const n=e||1,s=Math.floor(t.height*n),r=Math.floor(t.width*n);t.height=s/n,t.width=r/n;const o=t.canvas;return o.style&&(i||!o.style.height&&!o.style.width)&&(o.style.height=t.height+"px",o.style.width=t.width+"px"),(t.currentDevicePixelRatio!==n||o.height!==s||o.width!==r)&&(t.currentDevicePixelRatio=n,o.height=s,o.width=r,t.ctx.setTransform(n,0,0,n,0,0),!0)}const Ke=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(t){}return t}();function Ze(t,e){const i=function(t,e){return Ye(t).getPropertyValue(e)}(t,e),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function Je(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function ti(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:"middle"===n?i<.5?t.y:e.y:"after"===n?i<1?t.y:e.y:i>0?e.y:t.y}}function ei(t,e,i,n){const s={x:t.cp2x,y:t.cp2y},r={x:e.cp1x,y:e.cp1y},o=Je(t,s,i),a=Je(s,r,i),l=Je(r,e,i),c=Je(o,a,i),h=Je(a,l,i);return Je(c,h,i)}const ii=new Map;function ni(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let n=ii.get(i);return n||(n=new Intl.NumberFormat(t,e),ii.set(i,n)),n}(e,i).format(t)}function si(t,e,i){return t?function(t,e){return{x:i=>t+t+e-i,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,i):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function ri(t){return"angle"===t?{between:st,compare:it,normalize:nt}:{between:ot,compare:(t,e)=>t-e,normalize:t=>t}}function oi({start:t,end:e,count:i,loop:n,style:s}){return{start:t%i,end:e%i,loop:n&&(e-t+1)%i==0,style:s}}function ai(t,e,i){if(!i)return[t];const{property:n,start:s,end:r}=i,o=e.length,{compare:a,between:l,normalize:c}=ri(n),{start:h,end:d,loop:u,style:f}=function(t,e,i){const{property:n,start:s,end:r}=i,{between:o,normalize:a}=ri(n),l=e.length;let c,h,{start:d,end:u,loop:f}=t;if(f){for(d+=l,u+=l,c=0,h=l;cn({chart:t,initial:e.initial,numSteps:r,currentStep:Math.min(i-e.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=h.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,n)=>{if(!i.running||!i.items.length)return;const s=i.items;let r,o=s.length-1,a=!1;for(;o>=0;--o)r=s[o],r._active?(r._total>i.duration&&(i.duration=r._total),r.tick(t),a=!0):(s[o]=s[s.length-1],s.pop());a&&(n.draw(),this._notify(n,i,t,"progress")),s.length||(i.running=!1,this._notify(n,i,t,"complete"),i.initial=!1),e+=s.length}),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((t,e)=>Math.max(t,e._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let n=i.length-1;for(;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}};const ui={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const n=Wt(t||"transparent"),s=n.valid&&Wt(e||"transparent");return s&&s.valid?s.mix(n,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class fi{constructor(t,e,i,n){const s=e[i];n=pe([t.to,n,s,t.from]);const r=pe([t.from,s,n]);this._active=!0,this._fn=t.fn||ui[t.type||typeof r],this._easing=ht[t.easing]||ht.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=r,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const n=this._target[this._prop],s=i-this._start,r=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=s,this._loop=!!t.loop,this._to=pe([t.to,e,n,t.from]),this._from=pe([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,n=this._prop,s=this._from,r=this._loop,o=this._to;let a;if(this._active=s!==o&&(r||e1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[n]=this._fn(s,o,a))}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let t=0;t"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),Xt.set("animations",{colors:{type:"color",properties:["color","borderColor","backgroundColor"]},numbers:{type:"number",properties:["x","y","borderWidth","radius","tension"]}}),Xt.describe("animations",{_fallback:"animation"}),Xt.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}});class pi{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!b(t))return;const e=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const n=t[i];if(!b(n))return;const s={};for(const t of gi)s[t]=n[t];(m(n.properties)&&n.properties||[i]).forEach(t=>{t!==i&&e.has(t)||e.set(t,s)})})}_animateOptions(t,e){const i=e.options,n=function(t,e){if(!e)return;let i=t.options;if(i)return i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i;t.options=e}(t,i);if(!n)return[];const s=this._createAnimations(n,i);return i.$shared&&function(t,e){const i=[],n=Object.keys(e);for(let e=0;e{t.options=i},()=>{}),s}_createAnimations(t,e){const i=this._properties,n=[],s=t.$animations||(t.$animations={}),r=Object.keys(e),o=Date.now();let a;for(a=r.length-1;a>=0;--a){const l=r[a];if("$"===l.charAt(0))continue;if("options"===l){n.push(...this._animateOptions(t,e));continue}const c=e[l];let h=s[l];const d=i.get(l);if(h){if(d&&h.active()){h.update(d,c,o);continue}h.cancel()}d&&d.duration?(s[l]=h=new fi(d,t,l,c),n.push(h)):t[l]=c}return n}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(di.add(this._chart,i),!0):void 0}}function mi(t,e){const i=t&&t.options||{},n=i.reverse,s=void 0===i.min?e:0,r=void 0===i.max?e:0;return{start:n?r:s,end:n?s:r}}function bi(t,e){const i=[],n=t._getSortedDatasetMetas(e);let s,r;for(s=0,r=n.length;s0||!i&&e<0)return s.index}return null}function wi(t,e){const{chart:i,_cachedMeta:n}=t,s=i._stacks||(i._stacks={}),{iScale:r,vScale:o,index:a}=n,l=r.axis,c=o.axis,h=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(r,o,n),d=e.length;let u;for(let t=0;ti[t].axis===e).shift()}function Oi(t,e){const i=t.controller.index,n=t.vScale&&t.vScale.axis;if(n){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[n]||void 0===e[n][i])return;delete e[n][i]}}}const ki=t=>"reset"===t||"none"===t,Si=(t,e)=>e?t:Object.assign({},t);class Di{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=yi(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&Oi(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=(t,e,i,n)=>"x"===t?e:"r"===t?n:i,s=e.xAxisID=v(i.xAxisID,Mi(t,"x")),r=e.yAxisID=v(i.yAxisID,Mi(t,"y")),o=e.rAxisID=v(i.rAxisID,Mi(t,"r")),a=e.indexAxis,l=e.iAxisID=n(a,s,r,o),c=e.vAxisID=n(a,r,s,o);e.xScale=this.getScaleForId(s),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(o),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&_e(this._data,this),t._stacked&&Oi(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(b(e))this._data=function(t){const e=Object.keys(t),i=new Array(e.length);let n,s,r;for(n=0,s=e.length;n{const e="_onData"+A(t),i=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...t){const s=i.apply(this,t);return n._chartjs.listeners.forEach(i=>{"function"==typeof i[e]&&i[e](...t)}),s}})}))),this._syncList=[],this._data=e}var n}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let n=!1;this._dataCheck();const s=e._stacked;e._stacked=yi(e.vScale,e),e.stack!==i.stack&&(n=!0,Oi(e),e.stack=i.stack),this._resyncElements(t),(n||s!==e._stacked)&&wi(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:n}=this,{iScale:s,_stacked:r}=i,o=s.axis;let a,l,c,h=0===t&&e===n.length||i._sorted,d=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=n,i._sorted=!0,c=n;else{c=m(n[t])?this.parseArrayData(i,n,t,e):b(n[t])?this.parseObjectData(i,n,t,e):this.parsePrimitiveData(i,n,t,e);const s=()=>null===l[o]||d&&l[o]t&&!e.hidden&&e._stacked&&{keys:bi(i,!0),values:null})(e,i,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:h}=function(t){const{min:e,max:i,minDefined:n,maxDefined:s}=t.getUserBounds();return{min:n?e:Number.NEGATIVE_INFINITY,max:s?i:Number.POSITIVE_INFINITY}}(o);let d,u;function f(){u=n[d];const e=u[o.axis];return!x(u[t.axis])||c>e||h=0;--d)if(!f()){this.updateRangeFromParsed(l,t,u,a);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let n,s,r;for(n=0,s=e.length;n=0&&tthis.getContext(i,n),h);return f.$shared&&(f.$shared=a,s[r]=Object.freeze(Si(f,a))),f}_resolveAnimations(t,e,i){const n=this.chart,s=this._cachedDataOpts,r="animation-"+e,o=s[r];if(o)return o;let a;if(!1!==n.options.animation){const n=this.chart.config,s=n.datasetAnimationScopeKeys(this._type,e),r=n.getOptionScopes(this.getDataset(),s);a=n.createResolver(r,this.getContext(t,i,e))}const l=new pi(n,a&&a.animations);return a&&a._cacheable&&(s[r]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||ki(t)||this.chart._animationsDisabled}updateElement(t,e,i,n){ki(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!ki(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;const s=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(s)||s})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];const n=i.length,s=e.length,r=Math.min(s,n);r&&this.parse(0,r),s>n?this._insertElements(n,s-n,t):s{for(t.length+=e,o=t.length-1;o>=r;o--)t[o]=t[o-e]};for(a(s),o=t;ot-e))}return t._cache.$bar}(e,t.type);let n,s,r,o,a=e._length;const l=()=>{32767!==r&&-32768!==r&&(L(o)&&(a=Math.min(a,Math.abs(r-o)||a)),o=r)};for(n=0,s=i.length;nMath.abs(a)&&(l=a,c=o),e[i.axis]=c,e._custom={barStart:l,barEnd:c,start:s,end:r,min:o,max:a}}(t,e,i,n):e[i.axis]=i.parse(t,n),e}function Ti(t,e,i,n){const s=t.iScale,r=t.vScale,o=s.getLabels(),a=s===r,l=[];let c,h,d,u;for(c=i,h=i+n;ct.x,i="left",n="right"):(e=t.base=i?1:-1)}(h,e,r)*s,d===r&&(m-=h/2),c=m+h),m===e.getPixelForValue(r)){const t=$(h)*e.getLineWidthForValue(r)/2;m+=t,h-=t}return{size:h,base:m,head:c,center:c+h/2}}_calculateBarIndexPixels(t,e){const i=e.scale,n=this.options,s=n.skipNull,r=v(n.maxBarThickness,1/0);let o,a;if(e.grouped){const i=s?this._getStackCount(t):e.stackCount,l="flex"===n.barThickness?function(t,e,i,n){const s=e.pixels,r=s[t];let o=t>0?s[t-1]:null,a=t=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,{xScale:i,yScale:n}=e,s=this.getParsed(t),r=i.getLabelForValue(s.x),o=n.getLabelForValue(s.y),a=s._custom;return{label:e.label,value:"("+r+", "+o+(a?", "+a:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,n){const s="reset"===n,{iScale:r,vScale:o}=this._cachedMeta,a=this.resolveDataElementOptions(e,n),l=this.getSharedOptions(a),c=this.includeOptions(n,l),h=r.axis,d=o.axis;for(let a=e;a""}}}};class Ii extends Di{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,n=this._cachedMeta;if(!1===this._parsing)n._parsed=i;else{let s,r,o=t=>+i[t];if(b(i[t])){const{key:t="value"}=this._parsing;o=e=>+j(i[e],t)}for(s=t,r=t+e;sst(t,a,l,!0)?1:Math.max(e,e*i,n,n*i),g=(t,e,n)=>st(t,a,l,!0)?-1:Math.min(e,e*i,n,n*i),p=f(0,c,d),m=f(B,h,u),b=g(z,c,d),x=g(z+B,h,u);n=(p-b)/2,s=(m-x)/2,r=-(p+b)/2,o=-(m+x)/2}return{ratioX:n,ratioY:s,offsetX:r,offsetY:o}}(u,d,a),b=(i.width-r)/f,x=(i.height-r)/g,y=Math.max(Math.min(b,x)/2,0),v=_(this.options.radius,y),w=(v-Math.max(v*a,0))/this._getVisibleDatasetWeightTotal();this.offsetX=p*v,this.offsetY=m*v,n.total=this.calculateTotal(),this.outerRadius=v-w*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-w*h,0),this.updateElements(s,0,s.length,t)}_circumference(t,e){const i=this.options,n=this._cachedMeta,s=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===n._parsed[t]||n.data[t].hidden?0:this.calculateCircumference(n._parsed[t]*s/I)}updateElements(t,e,i,n){const s="reset"===n,r=this.chart,o=r.chartArea,a=r.options.animation,l=(o.left+o.right)/2,c=(o.top+o.bottom)/2,h=s&&a.animateScale,d=h?0:this.innerRadius,u=h?0:this.outerRadius,f=this.resolveDataElementOptions(e,n),g=this.getSharedOptions(f),p=this.includeOptions(n,g);let m,b=this._getRotation();for(m=0;m0&&!isNaN(t)?I*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],s=ni(e._parsed[t],i.options.locale);return{label:n[t]||"",value:s}}getMaxBorderWidth(t){let e=0;const i=this.chart;let n,s,r,o,a;if(!t)for(n=0,s=i.data.datasets.length;n"spacing"!==t,_indexable:t=>"spacing"!==t},Ii.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map((e,n)=>{const s=t.getDatasetMeta(0).controller.getStyle(n);return{text:e,fillStyle:s.backgroundColor,strokeStyle:s.borderColor,lineWidth:s.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label(t){let e=t.label;const i=": "+t.formattedValue;return m(e)?(e=e.slice(),e[0]+=i):e+=i,e}}}}};class Ni extends Di{initialize(){this.enableOptionSharing=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:n=[],_dataset:s}=e,r=this.chart._animationsDisabled;let{start:o,count:a}=function(t,e,i){const n=e.length;let s=0,r=n;if(t._sorted){const{iScale:o,_parsed:a}=t,l=o.axis,{min:c,max:h,minDefined:d,maxDefined:u}=o.getUserBounds();d&&(s=rt(Math.min(xe(a,o.axis,c).lo,i?n:xe(e,l,o.getPixelForValue(c)).lo),0,n-1)),r=u?rt(Math.max(xe(a,o.axis,h).hi+1,i?0:xe(e,l,o.getPixelForValue(h)).hi+1),s,n)-s:n-s}return{start:s,count:r}}(e,n,r);this._drawStart=o,this._drawCount=a,function(t){const{xScale:e,yScale:i,_scaleRanges:n}=t,s={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!n)return t._scaleRanges=s,!0;const r=n.xmin!==e.min||n.xmax!==e.max||n.ymin!==i.min||n.ymax!==i.max;return Object.assign(n,s),r}(e)&&(o=0,a=n.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!s._decimated,i.points=n;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!r,options:l},t),this.updateElements(n,o,a,t)}updateElements(t,e,i,n){const s="reset"===n,{iScale:r,vScale:o,_stacked:a,_dataset:l}=this._cachedMeta,c=this.resolveDataElementOptions(e,n),h=this.getSharedOptions(c),d=this.includeOptions(n,h),u=r.axis,f=o.axis,{spanGaps:g,segment:m}=this.options,b=q(g)?g:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||s||"none"===n;let y=e>0&&this.getParsed(e-1);for(let c=e;c0&&i[u]-y[u]>b,m&&(g.parsed=i,g.raw=l.data[c]),d&&(g.options=h||this.resolveDataElementOptions(c,e.active?"active":n)),x||this.updateElement(e,c,g,n),y=i}this.updateSharedOptions(h,n,c)}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return i;const s=n[0].size(this.resolveDataElementOptions(0)),r=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,s,r)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}Ni.id="line",Ni.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},Ni.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class Vi extends Di{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],s=ni(e._parsed[t].r,i.options.locale);return{label:n[t]||"",value:s}}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),s=Math.max(n/2,0),r=(s-Math.max(i.cutoutPercentage?s/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=s-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(t,e,i,n){const s="reset"===n,r=this.chart,o=this.getDataset(),a=r.options.animation,l=this._cachedMeta.rScale,c=l.xCenter,h=l.yCenter,d=l.getIndexAngle(0)-.5*z;let u,f=d;const g=360/this.countVisibleElements();for(u=0;u{!isNaN(t.data[n])&&this.chart.getDataVisibility(n)&&i++}),i}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?K(this.resolveDataElementOptions(t,e).angle||i):0}}Vi.id="polarArea",Vi.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},Vi.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map((e,n)=>{const s=t.getDatasetMeta(0).controller.getStyle(n);return{text:e,fillStyle:s.backgroundColor,strokeStyle:s.borderColor,lineWidth:s.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label:t=>t.chart.data.labels[t.dataIndex]+": "+t.formattedValue}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class Wi extends Ii{}Wi.id="pie",Wi.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Bi extends Di{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}update(t){const e=this._cachedMeta,i=e.dataset,n=e.data||[],s=e.iScale.getLabels();if(i.points=n,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const r={_loop:!0,_fullLoop:s.length===n.length,options:e};this.updateElement(i,void 0,r,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,i,n){const s=this.getDataset(),r=this._cachedMeta.rScale,o="reset"===n;for(let a=e;a"",label:t=>"("+t.label+", "+t.formattedValue+")"}}},scales:{x:{type:"linear"},y:{type:"linear"}}};class Yi{constructor(t){this.options=t||{}}formats(){return Ui()}parse(t,e){return Ui()}format(t,e){return Ui()}add(t,e,i){return Ui()}diff(t,e,i){return Ui()}startOf(t,e,i){return Ui()}endOf(t,e){return Ui()}}Yi.override=function(t){Object.assign(Yi.prototype,t)};var $i={_date:Yi};function Xi(t,e){return"native"in t?{x:t.x,y:t.y}:qe(t,e)}function qi(t,e,i,n){const{controller:s,data:r,_sorted:o}=t,a=s._cachedMeta.iScale;if(a&&e===a.axis&&"r"!==e&&o&&r.length){const t=a._reversePixels?ye:xe;if(!n)return t(r,e,i);if(s._sharedOptions){const n=r[0],s="function"==typeof n.getRange&&n.getRange(e);if(s){const n=t(r,e,i-s),o=t(r,e,i+s);return{lo:n.lo,hi:o.hi}}}}return{lo:0,hi:r.length-1}}function Gi(t,e,i,n,s){const r=t.getSortedVisibleDatasetMetas(),o=i[e];for(let t=0,i=r.length;t{t[a](s[o],n)&&r.push({element:t,datasetIndex:e,index:i}),t.inRange(s.x,s.y,n)&&(l=!0)}),i.intersect&&!l?[]:r}var Ji={modes:{index(t,e,i,n){const s=Xi(e,t),r=i.axis||"x",o=i.intersect?Qi(t,s,r,n):Ki(t,s,r,!1,n),a=[];return o.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{const e=o[0].index,i=t.data[e];i&&!i.skip&&a.push({element:i,datasetIndex:t.index,index:e})}),a):[]},dataset(t,e,i,n){const s=Xi(e,t),r=i.axis||"xy";let o=i.intersect?Qi(t,s,r,n):Ki(t,s,r,!1,n);if(o.length>0){const e=o[0].datasetIndex,i=t.getDatasetMeta(e).data;o=[];for(let t=0;tQi(t,Xi(e,t),i.axis||"xy",n),nearest:(t,e,i,n)=>Ki(t,Xi(e,t),i.axis||"xy",i.intersect,n),x:(t,e,i,n)=>Zi(t,e,{axis:"x",intersect:i.intersect},n),y:(t,e,i,n)=>Zi(t,e,{axis:"y",intersect:i.intersect},n)}};const tn=["left","top","right","bottom"];function en(t,e){return t.filter(t=>t.pos===e)}function nn(t,e){return t.filter(t=>-1===tn.indexOf(t.pos)&&t.box.axis===e)}function sn(t,e){return t.sort((t,i)=>{const n=e?i:t,s=e?t:i;return n.weight===s.weight?n.index-s.index:n.weight-s.weight})}function rn(t,e,i,n){return Math.max(t[i],e[i])+Math.max(t[n],e[n])}function on(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function an(t,e,i,n){const{pos:s,box:r}=i,o=t.maxPadding;if(!b(s)){i.size&&(t[s]-=i.size);const e=n[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?r.height:r.width),i.size=e.size/e.count,t[s]+=i.size}r.getPadding&&on(o,r.getPadding());const a=Math.max(0,e.outerWidth-rn(o,t,"left","right")),l=Math.max(0,e.outerHeight-rn(o,t,"top","bottom")),c=a!==t.w,h=l!==t.h;return t.w=a,t.h=l,i.horizontal?{same:c,other:h}:{same:h,other:c}}function ln(t,e){const i=e.maxPadding;return function(t){const n={left:0,top:0,right:0,bottom:0};return t.forEach(t=>{n[t]=Math.max(e[t],i[t])}),n}(t?["left","right"]:["top","bottom"])}function cn(t,e,i,n){const s=[];let r,o,a,l,c,h;for(r=0,o=t.length,c=0;rt.box.fullSize),!0),n=sn(en(e,"left"),!0),s=sn(en(e,"right")),r=sn(en(e,"top"),!0),o=sn(en(e,"bottom")),a=nn(e,"x"),l=nn(e,"y");return{fullSize:i,leftAndTop:n.concat(r),rightAndBottom:s.concat(l).concat(o).concat(a),chartArea:en(e,"chartArea"),vertical:n.concat(s).concat(l),horizontal:r.concat(o).concat(a)}}(t.boxes),l=a.vertical,c=a.horizontal;M(t.boxes,t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()});const h=l.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1,d=Object.freeze({outerWidth:e,outerHeight:i,padding:s,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/h,hBoxMaxHeight:o/2}),u=Object.assign({},s);on(u,fe(n));const f=Object.assign({maxPadding:u,w:r,h:o,x:s.left,y:s.top},s),g=function(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:n,stackWeight:s}=i;if(!t||!tn.includes(n))continue;const r=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=s}return e}(t),{vBoxMaxWidth:n,hBoxMaxHeight:s}=e;let r,o,a;for(r=0,o=t.length;r{const i=e.box;Object.assign(i,t.chartArea),i.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class fn{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}isAttached(t){return!0}updateConfig(t){}}class gn extends fn{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const pn={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},mn=t=>null===t||""===t,bn=!!Ke&&{passive:!0};function xn(t,e,i){t.canvas.removeEventListener(e,i,bn)}function yn(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function vn(t,e,i){const n=t.canvas,s=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||yn(i.addedNodes,n),e=e&&!yn(i.removedNodes,n);e&&i()});return s.observe(document,{childList:!0,subtree:!0}),s}function wn(t,e,i){const n=t.canvas,s=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||yn(i.removedNodes,n),e=e&&!yn(i.addedNodes,n);e&&i()});return s.observe(document,{childList:!0,subtree:!0}),s}const Mn=new Map;let On=0;function kn(){const t=window.devicePixelRatio;t!==On&&(On=t,Mn.forEach((e,i)=>{i.currentDevicePixelRatio!==t&&e()}))}function Sn(t,e,i){const n=t.canvas,s=n&&He(n);if(!s)return;const r=d((t,e)=>{const n=s.clientWidth;i(t,e),n{const e=t[0],i=e.contentRect.width,n=e.contentRect.height;0===i&&0===n||r(i,n)});return o.observe(s),function(t,e){Mn.size||window.addEventListener("resize",kn),Mn.set(t,e)}(t,r),o}function Dn(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){Mn.delete(t),Mn.size||window.removeEventListener("resize",kn)}(t)}function Pn(t,e,i){const n=t.canvas,s=d(e=>{null!==t.ctx&&i(function(t,e){const i=pn[t.type]||t.type,{x:n,y:s}=qe(t,e);return{type:i,chart:e,native:t,x:void 0!==n?n:null,y:void 0!==s?s:null}}(e,t))},t,t=>{const e=t[0];return[e,e.offsetX,e.offsetY]});return function(t,e,i){t.addEventListener(e,i,bn)}(n,e,s),s}class Cn extends fn{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,n=t.getAttribute("height"),s=t.getAttribute("width");if(t.$chartjs={initial:{height:n,width:s,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",mn(s)){const e=Ze(t,"width");void 0!==e&&(t.width=e)}if(mn(n))if(""===t.style.height)t.height=t.width/(e||2);else{const e=Ze(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e.$chartjs)return!1;const i=e.$chartjs.initial;["height","width"].forEach(t=>{const n=i[t];p(n)?e.removeAttribute(t):e.setAttribute(t,n)});const n=i.style||{};return Object.keys(n).forEach(t=>{e.style[t]=n[t]}),e.width=e.width,delete e.$chartjs,!0}addEventListener(t,e,i){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),s={attach:vn,detach:wn,resize:Sn}[e]||Pn;n[e]=s(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),n=i[e];n&&(({attach:Dn,detach:Dn,resize:Dn}[e]||xn)(t,e,n),i[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return function(t,e,i,n){const s=Ye(t),r=Xe(s,"margin"),o=Ue(s.maxWidth,t,"clientWidth")||V,a=Ue(s.maxHeight,t,"clientHeight")||V,l=function(t,e,i){let n,s;if(void 0===e||void 0===i){const r=He(t);if(r){const t=r.getBoundingClientRect(),o=Ye(r),a=Xe(o,"border","width"),l=Xe(o,"padding");e=t.width-l.width-a.width,i=t.height-l.height-a.height,n=Ue(o.maxWidth,r,"clientWidth"),s=Ue(o.maxHeight,r,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:n||V,maxHeight:s||V}}(t,e,i);let{width:c,height:h}=l;if("content-box"===s.boxSizing){const t=Xe(s,"border","width"),e=Xe(s,"padding");c-=e.width+t.width,h-=e.height+t.height}return c=Math.max(0,c-r.width),h=Math.max(0,n?Math.floor(c/n):h-r.height),c=Ge(Math.min(c,o,l.maxWidth)),h=Ge(Math.min(h,a,l.maxHeight)),c&&!h&&(h=Ge(c/2)),{width:c,height:h}}(t,e,i,n)}isAttached(t){const e=He(t);return!(!e||!e.isConnected)}}class Tn{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return q(this.x)&&q(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const n={};return t.forEach(t=>{n[t]=i[t]&&i[t].active()?i[t]._to:this[t]}),n}}Tn.defaults={},Tn.defaultRoutes=void 0;const En={values:t=>m(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";const n=this.chart.options.locale;let s,r=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(s="scientific"),r=function(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t)),i}(t,i)}const o=Y(Math.abs(r)),a=Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),ni(t,n,l)},logarithmic(t,e,i){if(0===t)return"0";const n=t/Math.pow(10,Math.floor(Y(t)));return 1===n||2===n||5===n?En.numeric.call(this,t,e,i):""}};var jn={formatters:En};function An(t,e,i,n,s){const r=v(n,0),o=Math.min(v(s,t.length),t.length);let a,l,c,h=0;for(i=Math.ceil(i),s&&(a=s-n,i=a/Math.floor(a/i)),c=r;c<0;)h++,c=Math.round(r+h*i);for(l=Math.max(r,0);le.lineWidth,tickColor:(t,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:jn.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),Xt.route("scale.ticks","color","","color"),Xt.route("scale.grid","color","","borderColor"),Xt.route("scale.grid","borderColor","","borderColor"),Xt.route("scale.title","color","","color"),Xt.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t}),Xt.describe("scales",{_fallback:"scale"}),Xt.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t});const Ln=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i;function Rn(t,e){const i=[],n=t.length/e,s=t.length;let r=0;for(;ro+1e-6)))return l}function zn(t){return t.drawTicks?t.tickLength:0}function In(t,e){if(!t.display)return 0;const i=ge(t.font,e),n=fe(t.padding);return(m(t.text)?t.text.length:1)*i.lineHeight+n.height}function Nn(t,e,i){let n=(t=>"start"===t?"left":"end"===t?"right":"center")(t);return(i&&"right"!==e||!i&&"right"===e)&&(n=(t=>"left"===t?"right":"right"===t?"left":t)(n)),n}class Vn extends Tn{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:n}=this;return t=y(t,Number.POSITIVE_INFINITY),e=y(e,Number.NEGATIVE_INFINITY),i=y(i,Number.POSITIVE_INFINITY),n=y(n,Number.NEGATIVE_INFINITY),{min:y(t,i),max:y(e,n),minDefined:x(t),maxDefined:x(e)}}getMinMax(t){let e,{min:i,max:n,minDefined:s,maxDefined:r}=this.getUserBounds();if(s&&r)return{min:i,max:n};const o=this.getMatchingVisibleMetas();for(let a=0,l=o.length;an?n:i,n=s&&i>n?i:n,{min:y(i,y(n,i)),max:y(n,y(i,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){w(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:n,grace:s,ticks:r}=this.options,o=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(t,e,i){const{min:n,max:s}=t,r=_(e,(s-n)/2),o=(t,e)=>i&&0===t?0:t+e;return{min:o(n,-Math.abs(r)),max:o(s,r)}}(this,s,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=on)return function(t,e,i,n){let s,r=0,o=i[0];for(n=Math.ceil(n),s=0;st-e).pop(),e}(n);for(let t=0,e=r.length-1;ts)return e}return Math.max(s,1)}(s,e,n);if(r>0){let t,i;const n=r>1?Math.round((a-o)/(r-1)):null;for(An(e,l,c,p(n)?0:o-n,o),t=0,i=r-1;t=s||i<=1||!this.isHorizontal())return void(this.labelRotation=n);const c=this._getLabelSizes(),h=c.widest.width,d=c.highest.height,u=rt(this.chart.width-h,0,this.maxWidth);r=t.offset?this.maxWidth/i:u/(i-1),h+6>r&&(r=u/(i-(t.offset?.5:1)),o=this.maxHeight-zn(t.grid)-e.padding-In(t.title,this.chart.options.font),a=Math.sqrt(h*h+d*d),l=Z(Math.min(Math.asin(rt((c.highest.height+6)/r,-1,1)),Math.asin(rt(o/a,-1,1))-Math.asin(rt(d/a,-1,1)))),l=Math.max(n,Math.min(s,l))),this.labelRotation=l}afterCalculateLabelRotation(){w(this.options.afterCalculateLabelRotation,[this])}beforeFit(){w(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:n,grid:s}}=this,r=this._isVisible(),o=this.isHorizontal();if(r){const r=In(n,e.options.font);if(o?(t.width=this.maxWidth,t.height=zn(s)+r):(t.height=this.maxHeight,t.width=zn(s)+r),i.display&&this.ticks.length){const{first:e,last:n,widest:s,highest:r}=this._getLabelSizes(),a=2*i.padding,l=K(this.labelRotation),c=Math.cos(l),h=Math.sin(l);if(o){const e=i.mirror?0:h*s.width+c*r.height;t.height=Math.min(this.maxHeight,t.height+e+a)}else{const e=i.mirror?0:c*s.width+h*r.height;t.width=Math.min(this.maxWidth,t.width+e+a)}this._calculatePadding(e,n,h,c)}}this._handleMargins(),o?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,n){const{ticks:{align:s,padding:r},position:o}=this.options,a=0!==this.labelRotation,l="top"!==o&&"x"===this.axis;if(this.isHorizontal()){const o=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,d=0;a?l?(h=n*t.width,d=i*e.height):(h=i*t.height,d=n*e.width):"start"===s?d=e.width:"end"===s?h=t.width:(h=t.width/2,d=e.width/2),this.paddingLeft=Math.max((h-o+r)*this.width/(this.width-o),0),this.paddingRight=Math.max((d-c+r)*this.width/(this.width-c),0)}else{let i=e.height/2,n=t.height/2;"start"===s?(i=0,n=t.height):"end"===s&&(i=e.height,n=0),this.paddingTop=i+r,this.paddingBottom=n+r}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){w(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e{const i=t.gc,n=i.length/2;let s;if(n>e){for(s=0;s({width:s[t]||0,height:r[t]||0});return{first:O(0),last:O(e-1),widest:O(_),highest:O(w),widths:s,heights:r}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return rt(this._alignToPixels?Qt(this.chart,e,0):e,-32768,32767)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&to*n?o/i:a/n:a*n0}_computeGridLineItems(t){const e=this.axis,i=this.chart,n=this.options,{grid:s,position:r}=n,o=s.offset,a=this.isHorizontal(),l=this.ticks.length+(o?1:0),c=zn(s),h=[],d=s.setContext(this.getContext()),u=d.drawBorder?d.borderWidth:0,f=u/2,g=function(t){return Qt(i,t,u)};let p,m,x,y,_,w,M,O,k,S,D,P;if("top"===r)p=g(this.bottom),w=this.bottom-c,O=p-f,S=g(t.top)+f,P=t.bottom;else if("bottom"===r)p=g(this.top),S=t.top,P=g(t.bottom)-f,w=p+f,O=this.top+c;else if("left"===r)p=g(this.right),_=this.right-c,M=p-f,k=g(t.left)+f,D=t.right;else if("right"===r)p=g(this.left),k=t.left,D=g(t.right)-f,_=p+f,M=this.left+c;else if("x"===e){if("center"===r)p=g((t.top+t.bottom)/2+.5);else if(b(r)){const t=Object.keys(r)[0],e=r[t];p=g(this.chart.scales[t].getPixelForValue(e))}S=t.top,P=t.bottom,w=p+f,O=w+c}else if("y"===e){if("center"===r)p=g((t.left+t.right)/2);else if(b(r)){const t=Object.keys(r)[0],e=r[t];p=g(this.chart.scales[t].getPixelForValue(e))}_=p-f,M=_-c,k=t.left,D=t.right}const C=v(n.ticks.maxTicksLimit,l),T=Math.max(1,Math.ceil(l/C));for(m=0;me.value===t);return i>=0?e.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,r;const o=(t,e,n)=>{n.width&&n.color&&(i.save(),i.lineWidth=n.width,i.strokeStyle=n.color,i.setLineDash(n.borderDash||[]),i.lineDashOffset=n.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(s=0,r=n.length;s{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:i+1,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",n=[];let s,r;for(s=0,r=e.length;s{const n=i.split("."),s=n.pop(),r=[t].concat(n).join("."),o=e[i].split("."),a=o.pop(),l=o.join(".");Xt.route(r,s,l,a)})}(e,t.defaultRoutes),t.descriptors&&Xt.describe(e,t.descriptors)}(t,r,i),this.override&&Xt.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,n=this.scope;i in e&&delete e[i],n&&i in Xt[n]&&(delete Xt[n][i],this.override&&delete Ht[i])}}var Bn=new class{constructor(){this.controllers=new Wn(Di,"datasets",!0),this.elements=new Wn(Tn,"elements"),this.plugins=new Wn(Object,"plugins"),this.scales=new Wn(Vn,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(e=>{const n=i||this._getRegistryForType(e);i||n.isForType(e)||n===this.plugins&&e.id?this._exec(t,n,e):M(e,e=>{const n=i||this._getRegistryForType(e);this._exec(t,n,e)})})}_exec(t,e,i){const n=A(t);w(i["before"+n],[],i),e[t](i),w(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;et.filter(t=>!e.some(e=>t.plugin.id===e.plugin.id));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}}function Un(t,e){return e||!1!==t?!0===t?{}:t:null}function Yn(t,e,i,n){const s=t.pluginScopeKeys(e),r=t.getOptionScopes(i,s);return t.createResolver(r,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function $n(t,e){const i=Xt.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function Xn(t,e){return"x"===t||"y"===t?t:e.axis||("top"===(i=e.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0)||t.charAt(0).toLowerCase();var i}function qn(t){const e=t.options||(t.options={});e.plugins=v(e.plugins,{}),e.scales=function(t,e){const i=Ht[t.type]||{scales:{}},n=e.scales||{},s=$n(t.type,e),r=Object.create(null),o=Object.create(null);return Object.keys(n).forEach(t=>{const e=n[t];if(!b(e))return console.error("Invalid scale configuration for scale: "+t);if(e._proxy)return console.warn("Ignoring resolver passed as options for scale: "+t);const a=Xn(t,e),l=function(t,e){return t===e?"_index_":"_value_"}(a,s),c=i.scales||{};r[a]=r[a]||t,o[t]=C(Object.create(null),[{axis:a},e,c[a],c[l]])}),t.data.datasets.forEach(i=>{const s=i.type||t.type,a=i.indexAxis||$n(s,e),l=(Ht[s]||{}).scales||{};Object.keys(l).forEach(t=>{const e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,a),s=i[e+"AxisID"]||r[e]||e;o[s]=o[s]||Object.create(null),C(o[s],[{axis:e},n[s],l[t]])})}),Object.keys(o).forEach(t=>{const e=o[t];C(e,[Xt.scales[e.type],Xt.scale])}),o}(t,e)}function Gn(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const Qn=new Map,Kn=new Set;function Zn(t,e){let i=Qn.get(t);return i||(i=e(),Qn.set(t,i),Kn.add(i)),i}const Jn=(t,e,i)=>{const n=j(e,i);void 0!==n&&t.add(n)};class ts{constructor(t){this._config=function(t){return(t=t||{}).data=Gn(t.data),qn(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Gn(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),qn(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Zn(t,()=>[["datasets."+t,""]])}datasetAnimationScopeKeys(t,e){return Zn(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,"transitions."+e],["datasets."+t,""]])}datasetElementScopeKeys(t,e){return Zn(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,"datasets."+t,"elements."+e,""]])}pluginScopeKeys(t){const e=t.id;return Zn(`${this.type}-plugin-${e}`,()=>[["plugins."+e,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let n=i.get(t);return n&&!e||(n=new Map,i.set(t,n)),n}getOptionScopes(t,e,i){const{options:n,type:s}=this,r=this._cachedScopes(t,i),o=r.get(e);if(o)return o;const a=new Set;e.forEach(e=>{t&&(a.add(t),e.forEach(e=>Jn(a,t,e))),e.forEach(t=>Jn(a,n,t)),e.forEach(t=>Jn(a,Ht[s]||{},t)),e.forEach(t=>Jn(a,Xt,t)),e.forEach(t=>Jn(a,Ut,t))});const l=Array.from(a);return 0===l.length&&l.push(Object.create(null)),Kn.has(e)&&r.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,Ht[e]||{},Xt.datasets[e]||{},{type:e},Xt,Ut]}resolveNamedOptions(t,e,i,n=[""]){const s={$shared:!0},{resolver:r,subPrefixes:o}=es(this._resolverCache,t,n);let a=r;(function(t,e){const{isScriptable:i,isIndexable:n}=ke(t);for(const s of e){const e=i(s),r=n(s),o=(r||e)&&t[s];if(e&&(R(o)||is(o))||r&&m(o))return!0}return!1})(r,e)&&(s.$shared=!1,a=Oe(r,i=R(i)?i():i,this.createResolver(t,i,o)));for(const t of e)s[t]=a[t];return s}createResolver(t,e,i=[""],n){const{resolver:s}=es(this._resolverCache,t,i);return b(e)?Oe(s,e,void 0,n):s}}function es(t,e,i){let n=t.get(e);n||(n=new Map,t.set(e,n));const s=i.join();let r=n.get(s);return r||(r={resolver:Me(e,i),subPrefixes:i.filter(t=>!t.toLowerCase().includes("hover"))},n.set(s,r)),r}const is=t=>b(t)&&Object.getOwnPropertyNames(t).reduce((e,i)=>e||R(t[i]),!1),ns=["top","bottom","left","right","chartArea"];function ss(t,e){return"top"===t||"bottom"===t||-1===ns.indexOf(t)&&"x"===e}function rs(t,e){return function(i,n){return i[t]===n[t]?i[e]-n[e]:i[t]-n[t]}}function os(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),w(i&&i.onComplete,[t],e)}function as(t){const e=t.chart,i=e.options.animation;w(i&&i.onProgress,[t],e)}function ls(t){return Be()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const cs={},hs=t=>{const e=ls(t);return Object.values(cs).filter(t=>t.canvas===e).pop()};function ds(t,e,i){const n=Object.keys(t);for(const s of n){const n=+s;if(n>=e){const r=t[s];delete t[s],(i>0||n>e)&&(t[n+i]=r)}}}class us{constructor(t,e){const i=this.config=new ts(e),n=ls(t),s=hs(n);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas can be reused.");const r=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||function(t){return!Be()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?gn:Cn}(n)),this.platform.updateConfig(i);const o=this.platform.acquireContext(n,r.aspectRatio),a=o&&o.canvas,l=a&&a.height,c=a&&a.width;this.id=g(),this.ctx=o,this.canvas=a,this.width=c,this.height=l,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Hn,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let i;return function(...n){return e?(clearTimeout(i),i=setTimeout(t,e,n)):t.apply(this,n),e}}(t=>this.update(t),r.resizeDelay||0),this._dataChanges=[],cs[this.id]=this,o&&a?(di.listen(this,"complete",os),di.listen(this,"progress",as),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:s}=this;return p(t)?e&&s?s:n?i/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Qe(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Kt(this.canvas,this.ctx),this}stop(){return di.stop(this),this}resize(t,e){di.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,n=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(n,t,e,s),o=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,Qe(this,o,!0)&&(this.notifyPlugins("resize",{size:r}),w(i.onResize,[this,r],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){M(this.options.scales||{},(t,e)=>{t.id=e})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,n=Object.keys(i).reduce((t,e)=>(t[e]=!1,t),{});let s=[];e&&(s=s.concat(Object.keys(e).map(t=>{const i=e[t],n=Xn(t,i),s="r"===n,r="x"===n;return{options:i,dposition:s?"chartArea":r?"bottom":"left",dtype:s?"radialLinear":r?"category":"linear"}}))),M(s,e=>{const s=e.options,r=s.id,o=Xn(r,s),a=v(s.type,e.dtype);void 0!==s.position&&ss(s.position,o)===ss(e.dposition)||(s.position=e.dposition),n[r]=!0;let l=null;r in i&&i[r].type===a?l=i[r]:(l=new(Bn.getScale(a))({id:r,type:a,ctx:this.ctx,chart:this}),i[l.id]=l),l.init(s,t)}),M(n,(t,e)=>{t||delete i[e]}),M(i,t=>{un.configure(this,t,t.options),un.addBox(this,t)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((t,e)=>t.index-e.index),i>e){for(let t=e;te.length&&delete this._stacks,t.forEach((t,i)=>{0===e.filter(e=>e===t._dataset).length&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,n;for(this._removeUnreferencedMetasets(),i=0,n=e.length;i{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let t=0,e=this.data.datasets.length;t{t.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(rs("z","_idx"));const{_active:o,_lastEvent:a}=this;a?this._eventHandler(a,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){M(this.scales,t=>{un.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);F(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:n,count:s}of e)ds(t,n,"_removeElements"===i?-s:s)}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter(t=>t[0]===e).map((t,e)=>e+","+t.splice(1).join(","))),n=i(0);for(let t=1;tt.split(",")).map(t=>({method:t[1],start:+t[2],count:+t[3]}))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;un.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],M(this.boxes,t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))},this),this._layers.forEach((t,e)=>{t._idx=e}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,n=!i.disabled,s=this.chartArea,r={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",r)&&(n&&te(e,{left:!1===i.left?0:s.left-i.left,right:!1===i.right?this.width:s.right+i.right,top:!1===i.top?0:s.top-i.top,bottom:!1===i.bottom?this.height:s.bottom+i.bottom}),t.controller.draw(),n&&ee(e),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}getElementsAtEventForMode(t,e,i,n){const s=Ji.modes[e];return"function"==typeof s?s(this,t,i,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let n=i.filter(t=>t&&t._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(n)),n}getContext(){return this.$context||(this.$context=me(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const n=i?"show":"hide",s=this.getDatasetMeta(t),r=s.controller._resolveAnimations(void 0,n);L(e)?(s.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),r.update(s,{visible:i}),this.update(e=>e.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),di.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,i,n),t[i]=n},n=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};M(this.options.events,t=>i(t,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,n)=>{e.addEventListener(this,i,n),t[i]=n},n=(i,n)=>{t[i]&&(e.removeEventListener(this,i,n),delete t[i])},s=(t,e)=>{this.canvas&&this.resize(t,e)};let r;const o=()=>{n("attach",o),this.attached=!0,this.resize(),i("resize",s),i("detach",r)};r=()=>{this.attached=!1,n("resize",s),this._stop(),this._resize(0,0),i("attach",o)},e.isAttached(this.canvas)?o():r()}unbindEvents(){M(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},M(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const n=i?"set":"remove";let s,r,o,a;for("dataset"===e&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+n+"DatasetHoverStyle"]()),o=0,a=t.length;o{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}});!O(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}_updateHoverStyles(t,e,i){const n=this.options.hover,s=(t,e)=>t.filter(t=>!e.some(e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)),r=s(e,t),o=i?t:s(t,e);r.length&&this.updateHoverStyle(r,n.mode,!1),o.length&&n.mode&&this.updateHoverStyle(o,n.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:Jt(t,this.chartArea,this._minPadding)},n=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,n))return;const s=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(s||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:n=[],options:s}=this,r=e,o=this._getActiveElements(t,n,i,r),a=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}(t),l=function(t,e,i,n){return i&&"mouseout"!==t.type?n?e:t:null}(t,this._lastEvent,i,a);i&&(this._lastEvent=null,w(s.onHover,[t,o,this],this),a&&w(s.onClick,[t,o,this],this));const c=!O(o,n);return(c||e)&&(this._active=o,this._updateHoverStyles(o,n,e)),this._lastEvent=l,c}_getActiveElements(t,e,i,n){if("mouseout"===t.type)return[];if(!i)return e;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,n)}}const fs=()=>M(us.instances,t=>t._plugins.invalidate());function gs(t,e,i){const{startAngle:n,pixelMargin:s,x:r,y:o,outerRadius:a,innerRadius:l}=e;let c=s/a;t.beginPath(),t.arc(r,o,a,n-c,i+c),l>s?(c=s/l,t.arc(r,o,l,i+c,n-c,!0)):t.arc(r,o,s,i+B,n-B),t.closePath(),t.clip()}function ps(t,e,i,n){return{x:i+t*Math.cos(e),y:n+t*Math.sin(e)}}function ms(t,e,i,n,s){const{x:r,y:o,startAngle:a,pixelMargin:l,innerRadius:c}=e,h=Math.max(e.outerRadius+n+i-l,0),d=c>0?c+n+i+l:0;let u=0;const f=s-a;if(n){const t=((c>0?c-n:0)+(h>0?h-n:0))/2;u=(f-(0!==t?f*t/(t+n):f))/2}const g=(f-Math.max(.001,f*h-i/z)/h)/2,p=a+g+u,m=s-g-u,{outerStart:b,outerEnd:x,innerStart:y,innerEnd:v}=function(t,e,i,n){const s=he(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]),r=(i-e)/2,o=Math.min(r,n*e/2),a=t=>{const e=(i-Math.min(r,t))*n/2;return rt(t,0,Math.min(r,e))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:rt(s.innerStart,0,o),innerEnd:rt(s.innerEnd,0,o)}}(e,d,h,m-p),_=h-b,w=h-x,M=p+b/_,O=m-x/w,k=d+y,S=d+v,D=p+y/k,P=m-v/S;if(t.beginPath(),t.arc(r,o,h,M,O),x>0){const e=ps(w,O,r,o);t.arc(e.x,e.y,x,O,m+B)}const C=ps(S,m,r,o);if(t.lineTo(C.x,C.y),v>0){const e=ps(S,P,r,o);t.arc(e.x,e.y,v,m+B,P+Math.PI)}if(t.arc(r,o,d,m-v/d,p+y/d,!0),y>0){const e=ps(k,D,r,o);t.arc(e.x,e.y,y,D+Math.PI,p-B)}const T=ps(_,p,r,o);if(t.lineTo(T.x,T.y),b>0){const e=ps(_,M,r,o);t.arc(e.x,e.y,b,p-B,M)}t.closePath()}Object.defineProperties(us,{defaults:{enumerable:!0,value:Xt},instances:{enumerable:!0,value:cs},overrides:{enumerable:!0,value:Ht},registry:{enumerable:!0,value:Bn},version:{enumerable:!0,value:"3.7.1"},getChart:{enumerable:!0,value:hs},register:{enumerable:!0,value:(...t)=>{Bn.add(...t),fs()}},unregister:{enumerable:!0,value:(...t)=>{Bn.remove(...t),fs()}}});class bs extends Tn{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.getProps(["x","y"],i),{angle:s,distance:r}=tt(n,{x:t,y:e}),{startAngle:o,endAngle:a,innerRadius:l,outerRadius:c,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),d=this.options.spacing/2,u=v(h,a-o)>=I||st(s,o,a),f=ot(r,l+d,c+d);return u&&f}getCenterPoint(t){const{x:e,y:i,startAngle:n,endAngle:s,innerRadius:r,outerRadius:o}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:a,spacing:l}=this.options,c=(n+s)/2,h=(r+o+l+a)/2;return{x:e+Math.cos(c)*h,y:i+Math.sin(c)*h}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,n=(e.offset||0)/2,s=(e.spacing||0)/2;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>I?Math.floor(i/I):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();let r=0;if(n){r=n/2;const e=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(e)*r,Math.sin(e)*r),this.circumference>=z&&(r=n)}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;const o=function(t,e,i,n){const{fullCircles:s,startAngle:r,circumference:o}=e;let a=e.endAngle;if(s){ms(t,e,i,n,r+I);for(let e=0;ea&&r>a;return{count:n,start:l,loop:e.loop,ilen:c(o+(c?a-t:t))%r,y=()=>{f!==g&&(t.lineTo(m,g),t.lineTo(m,f),t.lineTo(m,p))};for(l&&(d=s[x(0)],t.moveTo(d.x,d.y)),h=0;h<=a;++h){if(d=s[x(h)],d.skip)continue;const e=d.x,i=d.y,n=0|e;n===u?(ig&&(g=i),m=(b*m+e)/++b):(y(),t.lineTo(e,i),u=n,b=0,f=g=i),p=i}y()}function Ms(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i?_s:ws}bs.id="arc",bs.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0},bs.defaultRoutes={backgroundColor:"backgroundColor"};const Os="function"==typeof Path2D;class ks extends Tn{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const n=i.spanGaps?this._loop:this._fullLoop;We(this._points,i,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(t,e){const i=t.points,n=t.options.spanGaps,s=i.length;if(!s)return[];const r=!!t._loop,{start:o,end:a}=function(t,e,i,n){let s=0,r=e-1;if(i&&!n)for(;ss&&t[r%e].skip;)r--;return r%=e,{start:s,end:r}}(i,s,r,n);return function(t,e,i,n){return n&&n.setContext&&i?function(t,e,i,n){const s=t._chart.getContext(),r=ci(t.options),{_datasetIndex:o,options:{spanGaps:a}}=t,l=i.length,c=[];let h=r,d=e[0].start,u=d;function f(t,e,n,s){const r=a?-1:1;if(t!==e){for(t+=l;i[t%l].skip;)t-=r;for(;i[e%l].skip;)e+=r;t%l!=e%l&&(c.push({start:t%l,end:e%l,loop:n,style:s}),h=s,d=e%l)}}for(const t of e){d=a?d:t.start;let e,r=i[d%l];for(u=d+1;u<=t.end;u++){const a=i[u%l];e=ci(n.setContext(me(s,{type:"segment",p0:r,p1:a,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:o}))),hi(e,h)&&f(d,u-1,t.loop,h),r=a,h=e}d"borderDash"!==t&&"fill"!==t};class Ds extends Tn{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.options,{x:s,y:r}=this.getProps(["x","y"],i);return Math.pow(t-s,2)+Math.pow(e-r,2)=i)&&s):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}As.id="bar",As.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0},As.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};class Rs{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:n,y:s,radius:r}=this;return e=e||{start:0,end:I},t.arc(n,s,r,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:n}=this,s=t.angle;return{x:e+Math.cos(s)*n,y:i+Math.sin(s)*n,angle:s}}}function Fs(t,e,i){for(;e>t;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function zs(t,e,i){const n=[];for(let s=0;s{e=Fs(t,e,s);const o=s[t],a=s[e];null!==n?(r.push({x:o.x,y:n}),r.push({x:a.x,y:n})):null!==i&&(r.push({x:i,y:o.y}),r.push({x:i,y:a.y}))}),r}(t,e),i.length?new ks({points:i,options:{tension:0},_loop:n,_fullLoop:n}):null}function Ws(t,e,i){let n=t[e].fill;const s=[e];let r;if(!i)return n;for(;!1!==n&&-1===s.indexOf(n);){if(!x(n))return n;if(r=t[n],!r)return!1;if(r.visible)return n;s.push(n),n=r.fill}return!1}function Bs(t,e,i){const{segments:n,points:s}=e;let r=!0,o=!1;t.beginPath();for(const a of n){const{start:n,end:l}=a,c=s[n],h=s[Fs(n,l,s)];r?(t.moveTo(c.x,c.y),r=!1):(t.lineTo(c.x,i),t.lineTo(c.x,c.y)),o=!!e.pathSegment(t,a,{move:o}),o?t.closePath():t.lineTo(h.x,i)}t.lineTo(e.first().x,i),t.closePath(),t.clip()}function Hs(t,e,i,n){if(n)return;let s=e[t],r=i[t];return"angle"===t&&(s=nt(s),r=nt(r)),{property:t,start:s,end:r}}function Us(t,e,i,n){return t&&e?n(t[i],e[i]):t?t[i]:e?e[i]:0}function Ys(t,e,i){const{top:n,bottom:s}=e.chart.chartArea,{property:r,start:o,end:a}=i||{};"x"===r&&(t.beginPath(),t.rect(o,n,a-o,s-n),t.clip())}function $s(t,e,i,n){const s=e.interpolate(i,n);s&&t.lineTo(s.x,s.y)}function Xs(t,e){const{line:i,target:n,property:s,color:r,scale:o}=e,a=function(t,e,i){const n=t.segments,s=t.points,r=e.points,o=[];for(const t of n){let{start:n,end:a}=t;a=Fs(n,a,s);const l=Hs(i,s[n],s[a],t.loop);if(!e.segments){o.push({source:t,target:l,start:s[n],end:s[a]});continue}const c=li(e,l);for(const e of c){const n=Hs(i,r[e.start],r[e.end],e.loop),a=ai(t,s,n);for(const t of a)o.push({source:t,target:e,start:{[i]:Us(l,n,"start",Math.max)},end:{[i]:Us(l,n,"end",Math.min)}})}}return o}(i,n,s);for(const{source:e,target:l,start:c,end:h}of a){const{style:{backgroundColor:a=r}={}}=e,d=!0!==n;t.save(),t.fillStyle=a,Ys(t,o,d&&Hs(s,c,h)),t.beginPath();const u=!!i.pathSegment(t,e);let f;if(d){u?t.closePath():$s(t,n,h,s);const e=!!n.pathSegment(t,l,{move:u,reverse:!0});f=u&&e,f||$s(t,n,c,s)}t.closePath(),t.fill(f?"evenodd":"nonzero"),t.restore()}}function qs(t,e,i){const n=Ns(e),{line:s,scale:r,axis:o}=e,a=s.options,l=a.fill,c=a.backgroundColor,{above:h=c,below:d=c}=l||{};n&&s.points.length&&(te(t,i),function(t,e){const{line:i,target:n,above:s,below:r,area:o,scale:a}=e,l=i._loop?"angle":e.axis;t.save(),"x"===l&&r!==s&&(Bs(t,n,o.top),Xs(t,{line:i,target:n,color:s,scale:a,property:l}),t.restore(),t.save(),Bs(t,n,o.bottom)),Xs(t,{line:i,target:n,color:r,scale:a,property:l}),t.restore()}(t,{line:s,target:n,above:h,below:d,area:i,scale:r,axis:o}),ee(t))}var Gs={id:"filler",afterDatasetsUpdate(t,e,i){const n=(t.data.datasets||[]).length,s=[];let r,o,a,l;for(o=0;o=0;--e){const i=s[e].$filler;i&&(i.line.updateControlPoints(r,i.axis),n&&qs(t.ctx,i,r))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const n=t.getSortedVisibleDatasetMetas();for(let e=n.length-1;e>=0;--e){const i=n[e].$filler;i&&qs(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){const n=e.meta.$filler;n&&!1!==n.fill&&"beforeDatasetDraw"===i.drawTime&&qs(t.ctx,n,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};new WeakMap;const Qs={average(t){if(!t.length)return!1;let e,i,n=0,s=0,r=0;for(e=0,i=t.length;e-1?t.split("\n"):t}function Js(t,e){const{element:i,datasetIndex:n,index:s}=e,r=t.getDatasetMeta(n).controller,{label:o,value:a}=r.getLabelAndValue(s);return{chart:t,label:o,parsed:r.getParsed(s),raw:t.data.datasets[n].data[s],formattedValue:a,dataset:r.getDataset(),dataIndex:s,datasetIndex:n,element:i}}function tr(t,e){const i=t.chart.ctx,{body:n,footer:s,title:r}=t,{boxWidth:o,boxHeight:a}=e,l=ge(e.bodyFont),c=ge(e.titleFont),h=ge(e.footerFont),d=r.length,u=s.length,f=n.length,g=fe(e.padding);let p=g.height,m=0,b=n.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);b+=t.beforeBody.length+t.afterBody.length,d&&(p+=d*c.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),b&&(p+=f*(e.displayColors?Math.max(a,l.lineHeight):l.lineHeight)+(b-f)*l.lineHeight+(b-1)*e.bodySpacing),u&&(p+=e.footerMarginTop+u*h.lineHeight+(u-1)*e.footerSpacing);let x=0;const y=function(t){m=Math.max(m,i.measureText(t).width+x)};return i.save(),i.font=c.string,M(t.title,y),i.font=l.string,M(t.beforeBody.concat(t.afterBody),y),x=e.displayColors?o+2+e.boxPadding:0,M(n,t=>{M(t.before,y),M(t.lines,y),M(t.after,y)}),x=0,i.font=h.string,M(t.footer,y),i.restore(),m+=g.width,{width:m,height:p}}function er(t,e,i,n){const{x:s,width:r}=i,{width:o,chartArea:{left:a,right:l}}=t;let c="center";return"center"===n?c=s<=(a+l)/2?"left":"right":s<=r/2?c="left":s>=o-r/2&&(c="right"),function(t,e,i,n){const{x:s,width:r}=n,o=i.caretSize+i.caretPadding;return"left"===t&&s+r+o>e.width||"right"===t&&s-r-o<0||void 0}(c,t,e,i)&&(c="center"),c}function ir(t,e,i){const n=i.yAlign||e.yAlign||function(t,e){const{y:i,height:n}=e;return it.height-n/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||er(t,e,i,n),yAlign:n}}function nr(t,e,i,n){const{caretSize:s,caretPadding:r,cornerRadius:o}=t,{xAlign:a,yAlign:l}=i,c=s+r,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=ue(o);let g=function(t,e){let{x:i,width:n}=t;return"right"===e?i-=n:"center"===e&&(i-=n/2),i}(e,a);const p=function(t,e,i){let{y:n,height:s}=t;return"top"===e?n+=i:n-="bottom"===e?s+i:s/2,n}(e,l,c);return"center"===l?"left"===a?g+=c:"right"===a&&(g-=c):"left"===a?g-=Math.max(h,u)+s:"right"===a&&(g+=Math.max(d,f)+s),{x:rt(g,0,n.width-e.width),y:rt(p,0,n.height-e.height)}}function sr(t,e,i){const n=fe(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-n.right:t.x+n.left}function rr(t){return Ks([],Zs(t))}function or(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}class ar extends Tn{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart||t._chart,this._chart=this.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),n=i.enabled&&e.options.animation&&i.animations,s=new pi(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=(this,me(this.chart.getContext(),{tooltip:this,tooltipItems:this._tooltipItems,type:"tooltip"})))}getTitle(t,e){const{callbacks:i}=e,n=i.beforeTitle.apply(this,[t]),s=i.title.apply(this,[t]),r=i.afterTitle.apply(this,[t]);let o=[];return o=Ks(o,Zs(n)),o=Ks(o,Zs(s)),o=Ks(o,Zs(r)),o}getBeforeBody(t,e){return rr(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){const{callbacks:i}=e,n=[];return M(t,t=>{const e={before:[],lines:[],after:[]},s=or(i,t);Ks(e.before,Zs(s.beforeLabel.call(this,t))),Ks(e.lines,s.label.call(this,t)),Ks(e.after,Zs(s.afterLabel.call(this,t))),n.push(e)}),n}getAfterBody(t,e){return rr(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){const{callbacks:i}=e,n=i.beforeFooter.apply(this,[t]),s=i.footer.apply(this,[t]),r=i.afterFooter.apply(this,[t]);let o=[];return o=Ks(o,Zs(n)),o=Ks(o,Zs(s)),o=Ks(o,Zs(r)),o}_createItems(t){const e=this._active,i=this.chart.data,n=[],s=[],r=[];let o,a,l=[];for(o=0,a=e.length;ot.filter(e,n,s,i))),t.itemSort&&(l=l.sort((e,n)=>t.itemSort(e,n,i))),M(l,e=>{const i=or(t.callbacks,e);n.push(i.labelColor.call(this,e)),s.push(i.labelPointStyle.call(this,e)),r.push(i.labelTextColor.call(this,e))}),this.labelColors=n,this.labelPointStyles=s,this.labelTextColors=r,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),n=this._active;let s,r=[];if(n.length){const t=Qs[i.position].call(this,n,this._eventPosition);r=this._createItems(i),this.title=this.getTitle(r,i),this.beforeBody=this.getBeforeBody(r,i),this.body=this.getBody(r,i),this.afterBody=this.getAfterBody(r,i),this.footer=this.getFooter(r,i);const e=this._size=tr(this,i),o=Object.assign({},t,e),a=ir(this.chart,i,o),l=nr(i,o,a,this.chart);this.xAlign=a.xAlign,this.yAlign=a.yAlign,s={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(s={opacity:0});this._tooltipItems=r,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,n){const s=this.getCaretPosition(t,i,n);e.lineTo(s.x1,s.y1),e.lineTo(s.x2,s.y2),e.lineTo(s.x3,s.y3)}getCaretPosition(t,e,i){const{xAlign:n,yAlign:s}=this,{caretSize:r,cornerRadius:o}=i,{topLeft:a,topRight:l,bottomLeft:c,bottomRight:h}=ue(o),{x:d,y:u}=t,{width:f,height:g}=e;let p,m,b,x,y,v;return"center"===s?(y=u+g/2,"left"===n?(p=d,m=p-r,x=y+r,v=y-r):(p=d+f,m=p+r,x=y-r,v=y+r),b=p):(m="left"===n?d+Math.max(a,c)+r:"right"===n?d+f-Math.max(l,h)-r:this.caretX,"top"===s?(x=u,y=x-r,p=m-r,b=m+r):(x=u+g,y=x+r,p=m+r,b=m-r),v=x),{x1:p,x2:m,x3:b,y1:x,y2:y,y3:v}}drawTitle(t,e,i){const n=this.title,s=n.length;let r,o,a;if(s){const l=si(i.rtl,this.x,this.width);for(t.x=sr(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",r=ge(i.titleFont),o=i.titleSpacing,e.fillStyle=i.titleColor,e.font=r.string,a=0;a0!==t)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,oe(t,{x:e,y:g,w:l,h:a,radius:o}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),oe(t,{x:i,y:g+1,w:l-2,h:a-2,radius:o}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(e,g,l,a),t.strokeRect(e,g,l,a),t.fillStyle=r.backgroundColor,t.fillRect(i,g+1,l-2,a-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:n}=this,{bodySpacing:s,bodyAlign:r,displayColors:o,boxHeight:a,boxWidth:l,boxPadding:c}=i,h=ge(i.bodyFont);let d=h.lineHeight,u=0;const f=si(i.rtl,this.x,this.width),g=function(i){e.fillText(i,f.x(t.x+u),t.y+d/2),t.y+=d+s},p=f.textAlign(r);let m,b,x,y,v,_,w;for(e.textAlign=r,e.textBaseline="middle",e.font=h.string,t.x=sr(this,p,i),e.fillStyle=i.bodyColor,M(this.beforeBody,g),u=o&&"right"!==p?"center"===r?l/2+c:l+2+c:0,y=0,_=n.length;y<_;++y){for(m=n[y],b=this.labelTextColors[y],e.fillStyle=b,M(m.before,g),x=m.lines,o&&x.length&&(this._drawColorBox(e,t,y,f,i),d=Math.max(h.lineHeight,a)),v=0,w=x.length;v0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,n=i&&i.x,s=i&&i.y;if(n||s){const i=Qs[t.position].call(this,this._active,this._eventPosition);if(!i)return;const r=this._size=tr(this,t),o=Object.assign({},i,this._size),a=ir(e,t,o),l=nr(t,o,a,e);n._to===l.x&&s._to===l.y||(this.xAlign=a.xAlign,this.yAlign=a.yAlign,this.width=r.width,this.height=r.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const r=fe(e.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&o&&(t.save(),t.globalAlpha=i,this.drawBackground(s,t,n,e),function(t,e){let i,n;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,n=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=n)}(t,e.textDirection),s.y+=r.top,this.drawTitle(s,t,e),this.drawBody(s,t,e),this.drawFooter(s,t,e),function(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,n=t.map(({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),s=!O(i,n),r=this._positionChanged(n,e);(s||r)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,s=this._active||[],r=this._getActiveElements(t,s,e,i),o=this._positionChanged(r,t),a=e||!O(r,s)||o;return a&&(this._active=r,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),a}_getActiveElements(t,e,i,n){const s=this.options;if("mouseout"===t.type)return[];if(!n)return e;const r=this.chart.getElementsAtEventForMode(t,s.mode,s,i);return s.reverse&&r.reverse(),r}_positionChanged(t,e){const{caretX:i,caretY:n,options:s}=this,r=Qs[s.position].call(this,t,e);return!1!==r&&(i!==r.x||n!==r.y)}}ar.positioners=Qs;var lr={id:"tooltip",_element:ar,positioners:Qs,afterInit(t,e,i){i&&(t.tooltip=new ar({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip,i={tooltip:e};!1!==t.notifyPlugins("beforeTooltipDraw",i)&&(e&&e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i))},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:f,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,n=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(n>0&&e.dataIndex"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};class cr extends Vn{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:i,label:n}of e)t[i]===n&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(p(t))return null;const i=this.getLabels();return((t,e)=>null===t?null:rt(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:function(t,e,i,n){const s=t.indexOf(e);return-1===s?((t,e,i,n)=>("string"==typeof e?(i=t.push(e)-1,n.unshift({index:i,label:e})):isNaN(e)&&(i=null),i))(t,e,i,n):s!==t.lastIndexOf(e)?i:s}(i,t,v(e,t),this._addedLabels),i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:n}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(n=this.getLabels().length-1)),this.min=i,this.max=n}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,n=[];let s=this.getLabels();s=0===t&&e===s.length-1?s:s.slice(t,e+1),this._valueRange=Math.max(s.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let i=t;i<=e;i++)n.push({value:i});return n}getLabelForValue(t){const e=this.getLabels();return t>=0&&te.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function hr(t,e,{horizontal:i,minRotation:n}){const s=K(n),r=(i?Math.sin(s):Math.cos(s))||.001,o=.75*e*(""+t).length;return Math.min(e/r,o)}cr.id="category",cr.defaults={ticks:{callback:cr.prototype.getLabelForValue}};class dr extends Vn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return p(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:n,max:s}=this;const r=t=>n=e?n:t,o=t=>s=i?s:t;if(t){const t=$(n),e=$(s);t<0&&e<0?o(0):t>0&&e>0&&r(0)}if(n===s){let e=1;(s>=Number.MAX_SAFE_INTEGER||n<=Number.MIN_SAFE_INTEGER)&&(e=Math.abs(.05*s)),o(s+e),t||r(n-e)}this.min=n,this.max=s}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:n}=t;return n?(e=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const n=function(t,e){const i=[],{bounds:n,step:s,min:r,max:o,precision:a,count:l,maxTicks:c,maxDigits:h,includeBounds:d}=t,u=s||1,f=c-1,{min:g,max:m}=e,b=!p(r),x=!p(o),y=!p(l),v=(m-g)/(h+1);let _,w,M,O,k=X((m-g)/f/u)*u;if(k<1e-14&&!b&&!x)return[{value:g},{value:m}];O=Math.ceil(m/k)-Math.floor(g/k),O>f&&(k=X(O*k/f/u)*u),p(a)||(_=Math.pow(10,a),k=Math.ceil(k*_)/_),"ticks"===n?(w=Math.floor(g/k)*k,M=Math.ceil(m/k)*k):(w=g,M=m),b&&x&&s&&function(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}((o-r)/s,k/1e3)?(O=Math.round(Math.min((o-r)/k,c)),k=(o-r)/O,w=r,M=o):y?(w=b?r:w,M=x?o:M,O=l-1,k=(M-w)/O):(O=(M-w)/k,O=G(O,Math.round(O),k/1e3)?Math.round(O):Math.ceil(O));const S=Math.max(J(k),J(w));_=Math.pow(10,p(a)?S:a),w=Math.round(w*_)/_,M=Math.round(M*_)/_;let D=0;for(b&&(d&&w!==r?(i.push({value:r}),w0?i:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=x(t)?Math.max(0,t):null,this.max=x(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,n=this.max;const s=e=>i=t?i:e,r=t=>n=e?n:t,o=(t,e)=>Math.pow(10,Math.floor(Y(t))+e);i===n&&(i<=0?(s(1),r(10)):(s(o(i,-1)),r(o(n,1)))),i<=0&&s(o(n,-1)),n<=0&&r(o(i,1)),this._zero&&this.min!==this._suggestedMin&&i===o(this.min,0)&&s(o(i,-1)),this.min=i,this.max=n}buildTicks(){const t=this.options,e=function(t,e){const i=Math.floor(Y(e.max)),n=Math.ceil(e.max/Math.pow(10,i)),s=[];let r=y(t.min,Math.pow(10,Math.floor(Y(e.min)))),o=Math.floor(Y(r)),a=Math.floor(r/Math.pow(10,o)),l=o<0?Math.pow(10,Math.abs(o)):1;do{s.push({value:r,major:fr(r)}),++a,10===a&&(a=1,++o,l=o>=0?1:l),r=Math.round(a*Math.pow(10,o)*l)/l}while(os?{start:e-i,end:e}:{start:e,end:e+i}}function br(t,e,i,n,s){const r=Math.abs(Math.sin(i)),o=Math.abs(Math.cos(i));let a=0,l=0;n.starte.r&&(a=(n.end-e.r)/r,t.r=Math.max(t.r,e.r+a)),s.starte.b&&(l=(s.end-e.b)/o,t.b=Math.max(t.b,e.b+l))}function xr(t){return 0===t||180===t?"center":t<180?"left":"right"}function yr(t,e,i){return 90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e),t}function vr(t,e,i,n){const{ctx:s}=t;if(i)s.arc(t.xCenter,t.yCenter,e,0,I);else{let i=t.getPointPosition(0,e);s.moveTo(i.x,i.y);for(let r=1;r{const i=w(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""}).filter((t,e)=>this.chart.getDataVisibility(e))}fit(){const t=this.options;t.display&&t.pointLabels.display?function(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),n=[],s=[],r=t._pointLabels.length,o=t.options.pointLabels,a=o.centerPointLabels?z/r:0;for(let d=0;d=0&&t=0;s--){const e=n.setContext(t.getPointLabelContext(s)),r=ge(e.font),{x:o,y:a,textAlign:l,left:c,top:h,right:d,bottom:u}=t._pointLabelItems[s],{backdropColor:f}=e;if(!p(f)){const t=fe(e.backdropPadding);i.fillStyle=f,i.fillRect(c-t.left,h-t.top,d-c+t.width,u-h+t.height)}se(i,t._pointLabels[s],o,a+r.lineHeight/2,r,{color:e.color,textAlign:l,textBaseline:"middle"})}}(this,s),n.display&&this.ticks.forEach((t,e)=>{0!==e&&(o=this.getDistanceFromCenterForValue(t.value),function(t,e,i,n){const s=t.ctx,r=e.circular,{color:o,lineWidth:a}=e;!r&&!n||!o||!a||i<0||(s.save(),s.strokeStyle=o,s.lineWidth=a,s.setLineDash(e.borderDash),s.lineDashOffset=e.borderDashOffset,s.beginPath(),vr(t,i,r,n),s.closePath(),s.stroke(),s.restore())}(this,n.setContext(this.getContext(e-1)),o,s))}),i.display){for(t.save(),r=s-1;r>=0;r--){const n=i.setContext(this.getPointLabelContext(r)),{color:s,lineWidth:l}=n;l&&s&&(t.lineWidth=l,t.strokeStyle=s,t.setLineDash(n.borderDash),t.lineDashOffset=n.borderDashOffset,o=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),a=this.getPointPosition(r,o),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(a.x,a.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const n=this.getIndexAngle(0);let s,r;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(n),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((n,o)=>{if(0===o&&!e.reverse)return;const a=i.setContext(this.getContext(o)),l=ge(a.font);if(s=this.getDistanceFromCenterForValue(this.ticks[o].value),a.showLabelBackdrop){t.font=l.string,r=t.measureText(n.label).width,t.fillStyle=a.backdropColor;const e=fe(a.backdropPadding);t.fillRect(-r/2-e.left,-s-l.size/2-e.top,r+e.width,l.size+e.height)}se(t,n.label,0,-s,l,{color:a.color})}),t.restore()}drawTitle(){}}_r.id="radialLinear",_r.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:jn.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}},_r.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},_r.descriptors={angleLines:{_fallback:"grid"}};const wr={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Mr=Object.keys(wr);function Or(t,e){return t-e}function kr(t,e){if(p(e))return null;const i=t._adapter,{parser:n,round:s,isoWeekday:r}=t._parseOpts;let o=e;return"function"==typeof n&&(o=n(o)),x(o)||(o="string"==typeof n?i.parse(o,n):i.parse(o)),null===o?null:(s&&(o="week"!==s||!q(r)&&!0!==r?i.startOf(o,s):i.startOf(o,"isoWeek",r)),+o)}function Sr(t,e,i,n){const s=Mr.length;for(let r=Mr.indexOf(t);r=e?i[n]:i[s]]=!0}}else t[e]=!0}function Pr(t,e,i){const n=[],s={},r=e.length;let o,a;for(o=0;o=0&&(e[l].major=!0);return e}(t,n,s,i):n}class Cr extends Vn{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e){const i=t.time||(t.time={}),n=this._adapter=new $i._date(t.adapters.date);C(i.displayFormats,n.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:kr(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:n,max:s,minDefined:r,maxDefined:o}=this.getUserBounds();function a(t){r||isNaN(t.min)||(n=Math.min(n,t.min)),o||isNaN(t.max)||(s=Math.max(s,t.max))}r&&o||(a(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||a(this.getMinMax(!1))),n=x(n)&&!isNaN(n)?n:+e.startOf(Date.now(),i),s=x(s)&&!isNaN(s)?s:+e.endOf(Date.now(),i)+1,this.min=Math.min(n,s-1),this.max=Math.max(n+1,s)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,n="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const s=this.min,r=function(t,e,i){let n=0,s=t.length;for(;nn&&t[s-1]>i;)s--;return n>0||s=Mr.indexOf(i);r--){const i=Mr[r];if(wr[i].common&&t._adapter.diff(s,n,i)>=e-1)return i}return Mr[i?Mr.indexOf(i):0]}(this,r.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(let e=Mr.indexOf(t)+1,i=Mr.length;e1e5*o)throw new Error(e+" and "+i+" are too far apart with stepSize of "+o+" "+r);const f="data"===n.ticks.source&&this.getDataTimestamps();for(h=u,d=0;ht-e).map(t=>+t)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}_tickFormatFunction(t,e,i,n){const s=this.options,r=s.time.displayFormats,o=this._unit,a=this._majorUnit,l=o&&r[o],c=a&&r[a],h=i[e],d=a&&c&&h&&h.major,u=this._adapter.format(t,n||(d?c:l)),f=s.ticks.callback;return f?w(f,[u,e,i],this):u}generateTickLabels(t){let e,i,n;for(e=0,i=t.length;e0?o:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(t=0,e=n.length;t=t[a].pos&&e<=t[l].pos&&({lo:a,hi:l}=xe(t,"pos",e)),({pos:n,time:r}=t[a]),({pos:s,time:o}=t[l])):(e>=t[a].time&&e<=t[l].time&&({lo:a,hi:l}=xe(t,"time",e)),({time:n,pos:r}=t[a]),({time:s,pos:o}=t[l]));const c=s-n;return c?r+(o-r)*(e-n)/c:r}Cr.id="time",Cr.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};class Er extends Cr{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Tr(e,this.min),this._tableRange=Tr(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,n=[],s=[];let r,o,a,l,c;for(r=0,o=t.length;r=e&&l<=i&&n.push(l);if(n.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(r=0,o=n.length;r2&&void 0!==arguments[2]?arguments[2]:"label";const n=[];t.datasets=e.map(e=>{const s=t.datasets.find(t=>t[i]===e[i]);return s&&e.data&&!n.includes(s)?(n.push(s),Object.assign(s,e),s):{...e}})}function zr(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"label";const i={labels:[],datasets:[]};return Rr(i,t.labels),Fr(i,t.datasets,e),i}function Ir(t,e){let{height:i=150,width:n=300,redraw:s=!1,datasetIdKey:r,type:o,data:a,options:l,plugins:c=[],fallbackContent:h,...d}=t;const u=Object(jr.useRef)(null),f=Object(jr.useRef)(),g=()=>{u.current&&(f.current=new us(u.current,{type:o,data:zr(a,r),options:l,plugins:c}),Lr(e,f.current))},p=()=>{Lr(e,null),f.current&&(f.current.destroy(),f.current=null)};return Object(jr.useEffect)(()=>{var t,e;!s&&f.current&&l&&(t=f.current,e=l,t.options={...e})},[s,l]),Object(jr.useEffect)(()=>{!s&&f.current&&Rr(f.current.config.data,a.labels)},[s,a.labels]),Object(jr.useEffect)(()=>{!s&&f.current&&a.datasets&&Fr(f.current.config.data,a.datasets,r)},[s,a.datasets]),Object(jr.useEffect)(()=>{f.current&&(s?(p(),setTimeout(g)):f.current.update())},[s,l,a.labels,a.datasets]),Object(jr.useEffect)(()=>(g(),()=>p()),[]),Ar.a.createElement("canvas",Object.assign({ref:u,role:"img",height:i,width:n},d),h)}const Nr=Object(jr.forwardRef)(Ir);var Vr=i(3),Wr=i(16),Br=i(7),Hr=i(8),Ur=i(4);function Yr(t,e){Object(Ur.a)(2,arguments);var i=Object(Hr.a)(t),n=Object(Br.a)(e);return isNaN(n)?new Date(NaN):n?(i.setDate(i.getDate()+n),i):i}function $r(t,e){Object(Ur.a)(2,arguments);var i=Object(Br.a)(e);return Yr(t,-i)}function Xr(t,e){Object(Ur.a)(2,arguments);var i=Object(Hr.a)(t),n=Object(Br.a)(e);if(isNaN(n))return new Date(NaN);if(!n)return i;var s=i.getDate(),r=new Date(i.getTime());r.setMonth(i.getMonth()+n+1,0);var o=r.getDate();return s>=o?r:(i.setFullYear(r.getFullYear(),r.getMonth(),s),i)}function qr(t,e){Object(Ur.a)(2,arguments);var i=Object(Br.a)(e);return Xr(t,-i)}function Gr(t){return(Gr="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 Qr(t,e){if(Object(Ur.a)(2,arguments),!e||"object"!==Gr(e))return new Date(NaN);var i=e.years?Object(Br.a)(e.years):0,n=e.months?Object(Br.a)(e.months):0,s=e.weeks?Object(Br.a)(e.weeks):0,r=e.days?Object(Br.a)(e.days):0,o=e.hours?Object(Br.a)(e.hours):0,a=e.minutes?Object(Br.a)(e.minutes):0,l=e.seconds?Object(Br.a)(e.seconds):0,c=qr(t,n+12*i),h=$r(c,r+7*s),d=a+60*o,u=l+60*d,f=1e3*u,g=new Date(h.getTime()-f);return g}function Kr(t){return(Kr="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 Zr(t,e){if(Object(Ur.a)(2,arguments),!e||"object"!==Kr(e))return new Date(NaN);var i=e.years?Object(Br.a)(e.years):0,n=e.months?Object(Br.a)(e.months):0,s=e.weeks?Object(Br.a)(e.weeks):0,r=e.days?Object(Br.a)(e.days):0,o=e.hours?Object(Br.a)(e.hours):0,a=e.minutes?Object(Br.a)(e.minutes):0,l=e.seconds?Object(Br.a)(e.seconds):0,c=Object(Hr.a)(t),h=n||i?Xr(c,n+12*i):c,d=r||s?Yr(h,r+7*s):h,u=a+60*o,f=l+60*u,g=1e3*f,p=new Date(d.getTime()+g);return p}function Jr(t,e){var i;Object(Ur.a)(1,arguments);var n=Object(Br.a)(null!==(i=null==e?void 0:e.additionalDigits)&&void 0!==i?i:2);if(2!==n&&1!==n&&0!==n)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof t&&"[object String]"!==Object.prototype.toString.call(t))return new Date(NaN);var s,r=so(t);if(r.date){var o=ro(r.date,n);s=oo(o.restDateString,o.year)}if(!s||isNaN(s.getTime()))return new Date(NaN);var a,l=s.getTime(),c=0;if(r.time&&(c=lo(r.time),isNaN(c)))return new Date(NaN);if(!r.timezone){var h=new Date(l+c),d=new Date(0);return d.setFullYear(h.getUTCFullYear(),h.getUTCMonth(),h.getUTCDate()),d.setHours(h.getUTCHours(),h.getUTCMinutes(),h.getUTCSeconds(),h.getUTCMilliseconds()),d}return a=ho(r.timezone),isNaN(a)?new Date(NaN):new Date(l+c+a)}Math.pow(10,8);var to={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},eo=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,io=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,no=/^([+-])(\d{2})(?::?(\d{2}))?$/;function so(t){var e,i={},n=t.split(to.dateTimeDelimiter);if(n.length>2)return i;if(/:/.test(n[0])?e=n[0]:(i.date=n[0],e=n[1],to.timeZoneDelimiter.test(i.date)&&(i.date=t.split(to.timeZoneDelimiter)[0],e=t.substr(i.date.length,t.length))),e){var s=to.timezone.exec(e);s?(i.time=e.replace(s[1],""),i.timezone=s[1]):i.time=e}return i}function ro(t,e){var i=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),n=t.match(i);if(!n)return{year:NaN,restDateString:""};var s=n[1]?parseInt(n[1]):null,r=n[2]?parseInt(n[2]):null;return{year:null===r?s:100*r,restDateString:t.slice((n[1]||n[2]).length)}}function oo(t,e){if(null===e)return new Date(NaN);var i=t.match(eo);if(!i)return new Date(NaN);var n=!!i[4],s=ao(i[1]),r=ao(i[2])-1,o=ao(i[3]),a=ao(i[4]),l=ao(i[5])-1;if(n)return function(t,e,i){return e>=1&&e<=53&&i>=0&&i<=6}(0,a,l)?function(t,e,i){var n=new Date(0);n.setUTCFullYear(t,0,4);var s=7*(e-1)+i+1-(n.getUTCDay()||7);return n.setUTCDate(n.getUTCDate()+s),n}(e,a,l):new Date(NaN);var c=new Date(0);return function(t,e,i){return e>=0&&e<=11&&i>=1&&i<=(uo[e]||(fo(t)?29:28))}(e,r,o)&&function(t,e){return e>=1&&e<=(fo(t)?366:365)}(e,s)?(c.setUTCFullYear(e,r,Math.max(s,o)),c):new Date(NaN)}function ao(t){return t?parseInt(t):1}function lo(t){var e=t.match(io);if(!e)return NaN;var i=co(e[1]),n=co(e[2]),s=co(e[3]);return function(t,e,i){return 24===t?0===e&&0===i:i>=0&&i<60&&e>=0&&e<60&&t>=0&&t<25}(i,n,s)?36e5*i+6e4*n+1e3*s:NaN}function co(t){return t&&parseFloat(t.replace(",","."))||0}function ho(t){if("Z"===t)return 0;var e=t.match(no);if(!e)return 0;var i="+"===e[1]?-1:1,n=parseInt(e[2]),s=e[3]&&parseInt(e[3])||0;return function(t,e){return e>=0&&e<=59}(0,s)?i*(36e5*n+6e4*s):NaN}var uo=[31,null,31,30,31,30,31,31,30,31,30,31];function fo(t){return t%400==0||t%4==0&&t%100!=0}var go=i(76);function po(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function mo(t){for(var e=1;e0,"is-negative":e<0});return Object(c.createElement)("div",{className:r},Object(c.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"simpay-admin-charts-badge__icon",width:"16",height:"16"},e>0?Object(c.createElement)("path",{d:"M16.004 9.414l-8.607 8.607-1.414-1.414L14.589 8H7.004V6h11v11h-2V9.414z"}):Object(c.createElement)("path",{d:"M14.59 16.004L5.982 7.397l1.414-1.414 8.607 8.606V7.004h2v11h-11v-2z"})),!n&&Object(c.createElement)("span",null,Math.abs(e),"%"))},Eo="simpay-admin-charts-period-over-period__tooltip",jo=function(t){var e=t.position,i=t.opacity,n=t.data,s=t.delta,r=t.deltaChangedString;if(!n.length)return null;var o=e.top,a=e.left,l=e.right,h=Co()("simpay-admin-charts-badge",{"is-positive":s>0,"is-negative":s<0});return Object(c.createElement)("div",{className:Eo,style:{top:o,left:a||"auto",right:l||"auto",opacity:i}},n.map((function(t,e){var i=t.label,n=t.value;return Object(c.createElement)("div",{className:"".concat(Eo,"-data"),"data-dataset":e,key:i+Math.random()},Object(c.createElement)("strong",null,i)," ",Object(c.createElement)("em",null,Object(Wr.decodeEntities)(n)))})),0!==s&&Object(c.createElement)("div",{className:"".concat(Eo,"-delta")},Object(c.createElement)("div",{className:h},Object(c.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"simpay-admin-charts-badge__icon"},s>0?Object(c.createElement)("path",{fillRule:"evenodd",d:"M5.22 14.78a.75.75 0 001.06 0l7.22-7.22v5.69a.75.75 0 001.5 0v-7.5a.75.75 0 00-.75-.75h-7.5a.75.75 0 000 1.5h5.69l-7.22 7.22a.75.75 0 000 1.06z",clipRule:"evenodd"}):Object(c.createElement)("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06l7.22 7.22H6.75a.75.75 0 000 1.5h7.5a.747.747 0 00.75-.75v-7.5a.75.75 0 00-1.5 0v5.69L6.28 5.22z"}))),Object(c.createElement)("span",null,r)))},Ao=function(t){var e=t.chart,i=function(t,e){var i=Object(c.useState)({marginTop:0,marginRight:0,marginBottom:0,marginLeft:0}),n=l()(i,2),s=n[0],r=s.marginTop,o=s.marginRight,a=s.marginBottom,h=s.marginLeft,d=n[1];return Object(c.useEffect)((function(){t.current&&d({marginTop:Math.floor(t.current.chartArea.top),marginRight:Math.floor(t.current.width-t.current.chartArea.right),marginBottom:Math.floor(t.current.chartArea.bottom),marginLeft:Math.floor(t.current.chartArea.left)})}),[t,e]),{marginTop:r,marginRight:o,marginBottom:a,marginLeft:h}}(t.chartRef,e),n=i.marginLeft,s=i.marginRight;return Object(c.createElement)("div",{style:{width:"100%",position:"relative",fontSize:"12px",display:"flex",justifyContent:"space-between",marginTop:"-2px"}},Object(c.createElement)("div",{style:{marginLeft:n,textAlign:"left"}},e.datasets[0].data[0].x),Object(c.createElement)("div",{style:{marginRight:s,textAlign:"right"}},e.datasets[0].data[e.datasets[0].data.length-1].x))};function Lo(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Ro(t){for(var e=1;e0}))}));return Object(c.createElement)("div",{className:"simpay-admin-charts-period-over-period",style:r},!O&&Object(c.createElement)("div",{className:"simpay-admin-charts-no-data",style:Ro(Ro({},r),{},{height:"calc(".concat(r.height," + 15px)")})},a),Object(c.createElement)(Nr,{type:"line",ref:p,options:M,plugins:[_o,(_="rgb(".concat(f.primary_color.join(","),")"),{id:"YGridLineHover",afterDraw:function(t){var e;if(null!==(e=t.tooltip)&&void 0!==e&&null!==(e=e._active)&&void 0!==e&&e.length){var i=t.tooltip._active[0].element.x,n=t.scales.yAxis,s=t.ctx;s.save(),s.beginPath(),s.moveTo(i,n.top),s.lineTo(i,n.bottom),s.lineWidth=2,s.strokeStyle=_,s.stroke(),s.restore()}}})],data:{datasets:m}}),Object(c.createElement)(Ao,{chartRef:p,chart:f}),Object(c.createElement)(jo,s()({},y,{deltaChangedString:h(y)})),Object(c.createElement)(Vr.Popover.Slot,null))}},function(t,e,i){var n;!function(){"use strict";var i={}.hasOwnProperty;function s(){for(var t=[],e=0;et.length)&&(e=t.length);for(var i=0,n=new Array(e);i=r.getTime()?i+1:e.getTime()>=l.getTime()?i:i-1}function f(t){Object(n.a)(1,arguments);var e=u(t),i=new Date(0);i.setUTCFullYear(e,0,4),i.setUTCHours(0,0,0,0);var s=d(i);return s}var g={};function p(){return g}function m(t,e){var i,s,r,a,c,h,d,u;Object(n.a)(1,arguments);var f=p(),g=Object(l.a)(null!==(i=null!==(s=null!==(r=null!==(a=null==e?void 0:e.weekStartsOn)&&void 0!==a?a:null==e||null===(c=e.locale)||void 0===c||null===(h=c.options)||void 0===h?void 0:h.weekStartsOn)&&void 0!==r?r:f.weekStartsOn)&&void 0!==s?s:null===(d=f.locale)||void 0===d||null===(u=d.options)||void 0===u?void 0:u.weekStartsOn)&&void 0!==i?i:0);if(!(g>=0&&g<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var m=Object(o.a)(t),b=m.getUTCDay(),x=(b=1&&x<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var y=new Date(0);y.setUTCFullYear(g+1,0,x),y.setUTCHours(0,0,0,0);var v=m(y,e),_=new Date(0);_.setUTCFullYear(g,0,x),_.setUTCHours(0,0,0,0);var w=m(_,e);return f.getTime()>=v.getTime()?g+1:f.getTime()>=w.getTime()?g:g-1}function x(t,e){var i,s,r,o,a,c,h,d;Object(n.a)(1,arguments);var u=p(),f=Object(l.a)(null!==(i=null!==(s=null!==(r=null!==(o=null==e?void 0:e.firstWeekContainsDate)&&void 0!==o?o:null==e||null===(a=e.locale)||void 0===a||null===(c=a.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==r?r:u.firstWeekContainsDate)&&void 0!==s?s:null===(h=u.locale)||void 0===h||null===(d=h.options)||void 0===d?void 0:d.firstWeekContainsDate)&&void 0!==i?i:1),g=b(t,e),x=new Date(0);x.setUTCFullYear(g,0,f),x.setUTCHours(0,0,0,0);var y=m(x,e);return y}function y(t,e){for(var i=t<0?"-":"",n=Math.abs(t).toString();n.length0?i:1-i;return y("yy"===e?n%100:n,e.length)},_=function(t,e){var i=t.getUTCMonth();return"M"===e?String(i+1):y(i+1,2)},w=function(t,e){return y(t.getUTCDate(),e.length)},M=function(t,e){return y(t.getUTCHours()%12||12,e.length)},O=function(t,e){return y(t.getUTCHours(),e.length)},k=function(t,e){return y(t.getUTCMinutes(),e.length)},S=function(t,e){return y(t.getUTCSeconds(),e.length)},D=function(t,e){var i=e.length,n=t.getUTCMilliseconds();return y(Math.floor(n*Math.pow(10,i-3)),e.length)};function P(t,e){var i=t>0?"-":"+",n=Math.abs(t),s=Math.floor(n/60),r=n%60;if(0===r)return i+String(s);var o=e||"";return i+String(s)+o+y(r,2)}function C(t,e){return t%60==0?(t>0?"-":"+")+y(Math.abs(t)/60,2):T(t,e)}function T(t,e){var i=e||"",n=t>0?"-":"+",s=Math.abs(t);return n+y(Math.floor(s/60),2)+i+y(s%60,2)}var E={G:function(t,e,i){var n=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return i.era(n,{width:"abbreviated"});case"GGGGG":return i.era(n,{width:"narrow"});case"GGGG":default:return i.era(n,{width:"wide"})}},y:function(t,e,i){if("yo"===e){var n=t.getUTCFullYear(),s=n>0?n:1-n;return i.ordinalNumber(s,{unit:"year"})}return v(t,e)},Y:function(t,e,i,n){var s=b(t,n),r=s>0?s:1-s;return"YY"===e?y(r%100,2):"Yo"===e?i.ordinalNumber(r,{unit:"year"}):y(r,e.length)},R:function(t,e){return y(u(t),e.length)},u:function(t,e){return y(t.getUTCFullYear(),e.length)},Q:function(t,e,i){var n=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return y(n,2);case"Qo":return i.ordinalNumber(n,{unit:"quarter"});case"QQQ":return i.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return i.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return i.quarter(n,{width:"wide",context:"formatting"})}},q:function(t,e,i){var n=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return y(n,2);case"qo":return i.ordinalNumber(n,{unit:"quarter"});case"qqq":return i.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return i.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return i.quarter(n,{width:"wide",context:"standalone"})}},M:function(t,e,i){var n=t.getUTCMonth();switch(e){case"M":case"MM":return _(t,e);case"Mo":return i.ordinalNumber(n+1,{unit:"month"});case"MMM":return i.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return i.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return i.month(n,{width:"wide",context:"formatting"})}},L:function(t,e,i){var n=t.getUTCMonth();switch(e){case"L":return String(n+1);case"LL":return y(n+1,2);case"Lo":return i.ordinalNumber(n+1,{unit:"month"});case"LLL":return i.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return i.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return i.month(n,{width:"wide",context:"standalone"})}},w:function(t,e,i,s){var r=function(t,e){Object(n.a)(1,arguments);var i=Object(o.a)(t),s=m(i,e).getTime()-x(i,e).getTime();return Math.round(s/6048e5)+1}(t,s);return"wo"===e?i.ordinalNumber(r,{unit:"week"}):y(r,e.length)},I:function(t,e,i){var s=function(t){Object(n.a)(1,arguments);var e=Object(o.a)(t),i=d(e).getTime()-f(e).getTime();return Math.round(i/6048e5)+1}(t);return"Io"===e?i.ordinalNumber(s,{unit:"week"}):y(s,e.length)},d:function(t,e,i){return"do"===e?i.ordinalNumber(t.getUTCDate(),{unit:"date"}):w(t,e)},D:function(t,e,i){var s=function(t){Object(n.a)(1,arguments);var e=Object(o.a)(t),i=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var s=e.getTime(),r=i-s;return Math.floor(r/864e5)+1}(t);return"Do"===e?i.ordinalNumber(s,{unit:"dayOfYear"}):y(s,e.length)},E:function(t,e,i){var n=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return i.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return i.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(n,{width:"short",context:"formatting"});case"EEEE":default:return i.day(n,{width:"wide",context:"formatting"})}},e:function(t,e,i,n){var s=t.getUTCDay(),r=(s-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(r);case"ee":return y(r,2);case"eo":return i.ordinalNumber(r,{unit:"day"});case"eee":return i.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return i.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(s,{width:"short",context:"formatting"});case"eeee":default:return i.day(s,{width:"wide",context:"formatting"})}},c:function(t,e,i,n){var s=t.getUTCDay(),r=(s-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(r);case"cc":return y(r,e.length);case"co":return i.ordinalNumber(r,{unit:"day"});case"ccc":return i.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return i.day(s,{width:"narrow",context:"standalone"});case"cccccc":return i.day(s,{width:"short",context:"standalone"});case"cccc":default:return i.day(s,{width:"wide",context:"standalone"})}},i:function(t,e,i){var n=t.getUTCDay(),s=0===n?7:n;switch(e){case"i":return String(s);case"ii":return y(s,e.length);case"io":return i.ordinalNumber(s,{unit:"day"});case"iii":return i.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return i.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return i.day(n,{width:"short",context:"formatting"});case"iiii":default:return i.day(n,{width:"wide",context:"formatting"})}},a:function(t,e,i){var n=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return i.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return i.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(t,e,i){var n,s=t.getUTCHours();switch(n=12===s?"noon":0===s?"midnight":s/12>=1?"pm":"am",e){case"b":case"bb":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return i.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return i.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(t,e,i){var n,s=t.getUTCHours();switch(n=s>=17?"evening":s>=12?"afternoon":s>=4?"morning":"night",e){case"B":case"BB":case"BBB":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return i.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return i.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(t,e,i){if("ho"===e){var n=t.getUTCHours()%12;return 0===n&&(n=12),i.ordinalNumber(n,{unit:"hour"})}return M(t,e)},H:function(t,e,i){return"Ho"===e?i.ordinalNumber(t.getUTCHours(),{unit:"hour"}):O(t,e)},K:function(t,e,i){var n=t.getUTCHours()%12;return"Ko"===e?i.ordinalNumber(n,{unit:"hour"}):y(n,e.length)},k:function(t,e,i){var n=t.getUTCHours();return 0===n&&(n=24),"ko"===e?i.ordinalNumber(n,{unit:"hour"}):y(n,e.length)},m:function(t,e,i){return"mo"===e?i.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):k(t,e)},s:function(t,e,i){return"so"===e?i.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):S(t,e)},S:function(t,e){return D(t,e)},X:function(t,e,i,n){var s=(n._originalDate||t).getTimezoneOffset();if(0===s)return"Z";switch(e){case"X":return C(s);case"XXXX":case"XX":return T(s);case"XXXXX":case"XXX":default:return T(s,":")}},x:function(t,e,i,n){var s=(n._originalDate||t).getTimezoneOffset();switch(e){case"x":return C(s);case"xxxx":case"xx":return T(s);case"xxxxx":case"xxx":default:return T(s,":")}},O:function(t,e,i,n){var s=(n._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+P(s,":");case"OOOO":default:return"GMT"+T(s,":")}},z:function(t,e,i,n){var s=(n._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+P(s,":");case"zzzz":default:return"GMT"+T(s,":")}},t:function(t,e,i,n){var s=n._originalDate||t;return y(Math.floor(s.getTime()/1e3),e.length)},T:function(t,e,i,n){return y((n._originalDate||t).getTime(),e.length)}},j=function(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},A=function(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},L={p:A,P:function(t,e){var i,n=t.match(/(P+)(p+)?/)||[],s=n[1],r=n[2];if(!r)return j(t,e);switch(s){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"})}return i.replace("{{date}}",j(s,e)).replace("{{time}}",A(r,e))}};function R(t){var e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}var F=["D","DD"],z=["YY","YYYY"];function I(t){return-1!==F.indexOf(t)}function N(t){return-1!==z.indexOf(t)}function V(t,e,i){if("YYYY"===t)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===t)throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===t)throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===t)throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var W={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function B(t){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.width?String(e.width):t.defaultWidth,n=t.formats[i]||t.formats[t.defaultWidth];return n}}var H={date:B({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:B({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:B({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},U={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function Y(t){return function(e,i){var n;if("formatting"===(null!=i&&i.context?String(i.context):"standalone")&&t.formattingValues){var s=t.defaultFormattingWidth||t.defaultWidth,r=null!=i&&i.width?String(i.width):s;n=t.formattingValues[r]||t.formattingValues[s]}else{var o=t.defaultWidth,a=null!=i&&i.width?String(i.width):t.defaultWidth;n=t.values[a]||t.values[o]}return n[t.argumentCallback?t.argumentCallback(e):e]}}function $(t){return function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.width,s=n&&t.matchPatterns[n]||t.matchPatterns[t.defaultMatchWidth],r=e.match(s);if(!r)return null;var o,a=r[0],l=n&&t.parsePatterns[n]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?q(l,(function(t){return t.test(a)})):X(l,(function(t){return t.test(a)}));o=t.valueCallback?t.valueCallback(c):c,o=i.valueCallback?i.valueCallback(o):o;var h=e.slice(a.length);return{value:o,rest:h}}}function X(t,e){for(var i in t)if(t.hasOwnProperty(i)&&e(t[i]))return i}function q(t,e){for(var i=0;i0?"in "+n:n+" ago":n},formatLong:H,formatRelative:function(t,e,i,n){return U[t]},localize:{ordinalNumber:function(t,e){var i=Number(t),n=i%100;if(n>20||n<10)switch(n%10){case 1:return i+"st";case 2:return i+"nd";case 3:return i+"rd"}return i+"th"},era:Y({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Y({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:Y({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:Y({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:Y({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(G={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(t){return parseInt(t,10)}},function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.match(G.matchPattern);if(!i)return null;var n=i[0],s=t.match(G.parsePattern);if(!s)return null;var r=G.valueCallback?G.valueCallback(s[0]):s[0];r=e.valueCallback?e.valueCallback(r):r;var o=t.slice(n.length);return{value:r,rest:o}}),era:$({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:$({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:$({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:$({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:$({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}},K=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Z=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,J=/^'([^]*?)'?$/,tt=/''/g,et=/[a-zA-Z]/;function it(t,e,i){var s,r,c,d,u,f,g,m,b,x,y,v,_,w,M,O,k,S;Object(n.a)(2,arguments);var D=String(e),P=p(),C=null!==(s=null!==(r=null==i?void 0:i.locale)&&void 0!==r?r:P.locale)&&void 0!==s?s:Q,T=Object(l.a)(null!==(c=null!==(d=null!==(u=null!==(f=null==i?void 0:i.firstWeekContainsDate)&&void 0!==f?f:null==i||null===(g=i.locale)||void 0===g||null===(m=g.options)||void 0===m?void 0:m.firstWeekContainsDate)&&void 0!==u?u:P.firstWeekContainsDate)&&void 0!==d?d:null===(b=P.locale)||void 0===b||null===(x=b.options)||void 0===x?void 0:x.firstWeekContainsDate)&&void 0!==c?c:1);if(!(T>=1&&T<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var j=Object(l.a)(null!==(y=null!==(v=null!==(_=null!==(w=null==i?void 0:i.weekStartsOn)&&void 0!==w?w:null==i||null===(M=i.locale)||void 0===M||null===(O=M.options)||void 0===O?void 0:O.weekStartsOn)&&void 0!==_?_:P.weekStartsOn)&&void 0!==v?v:null===(k=P.locale)||void 0===k||null===(S=k.options)||void 0===S?void 0:S.weekStartsOn)&&void 0!==y?y:0);if(!(j>=0&&j<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!C.localize)throw new RangeError("locale must contain localize property");if(!C.formatLong)throw new RangeError("locale must contain formatLong property");var A=Object(o.a)(t);if(!a(A))throw new RangeError("Invalid time value");var F=R(A),z=h(A,F),W={firstWeekContainsDate:T,weekStartsOn:j,locale:C,_originalDate:A},B=D.match(Z).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,L[e])(t,C.formatLong):t})).join("").match(K).map((function(n){if("''"===n)return"'";var s=n[0];if("'"===s)return nt(n);var r=E[s];if(r)return null!=i&&i.useAdditionalWeekYearTokens||!N(n)||V(n,e,String(t)),null!=i&&i.useAdditionalDayOfYearTokens||!I(n)||V(n,e,String(t)),r(z,n,C.localize,W);if(s.match(et))throw new RangeError("Format string contains an unescaped latin alphabet character `"+s+"`");return n})).join("");return B}function nt(t){var e=t.match(J);return e?e[1].replace(tt,"'"):t}},,,,,function(t,e,i){"use strict";i.r(e);var n=i(6),s=i.n(n),r=i(0),o=(i(37),i(10)),a=i(24),l=i.n(a),c=i(2),h=i(11),d=i.n(h);function u(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function f(t){for(var e=1;ewebhooks to be properly configured to populate correctly.","stripe"),{url:Object(r.createElement)("a",{href:y})})),Object(r.createElement)(p.Flex,null,Object(r.createElement)(p.Button,{variant:"link",onClick:function(){return e(!1)}},Object(c.__)("Close","stripe")),Object(r.createElement)(p.Button,{variant:"primary",isPrimary:!0,href:"https://dashboard.stripe.com/reports/hub",target:"_blank"},Object(c.__)("View advanced reports in Stripe →","stripe"))))},w=i(13),M=simpayAdminDashboardWidgetReport.currencies,O=new Date,k=function(t){var e=t.report,i=t.currency,n=t.setCurrency,o=t.range,a=t.setRange,l=e.data.delta,h=Object(r.useState)(!1),d=s()(h,2),u=d[0],f=d[1];return Object(r.createElement)("div",{className:"simpay-admin-dashboard-widget-report__data-filter"},Object(r.createElement)("div",{className:"simpay-admin-dashboard-widget-report__data-filter-title"},Object(r.createElement)("strong",null,Object(c.__)("Top Forms","stripe")),u&&Object(r.createElement)(_,{setIsOpen:f}),Object(r.createElement)(p.Button,{variant:"link",onClick:function(){return f(!0)}},Object(r.createElement)(m.a,{size:20,icon:b.a}))),Object(r.createElement)("div",{className:"simpay-admin-dashboard-widget-report__data-filter-controls"},!e.isLoading&&0!==l&&Object(r.createElement)(w.a,{delta:l}),Object(r.createElement)(p.SelectControl,{label:Object(c.__)("Currency","stripe"),hideLabelFromVision:!0,value:i,onChange:n,options:M.map((function(t){return{label:t,value:t.toLowerCase()}}))}),Object(r.createElement)(p.SelectControl,{label:Object(c.__)("Range","stripe"),hideLabelFromVision:!0,value:o.type,onChange:function(t){return a({type:t,start:Object(w.d)(t,O),end:Object(w.c)(t,o.end)})},options:[{label:"Today",value:"today"},{label:"Last 7 days",value:"7days"},{label:"Last 4 weeks",value:"4weeks"}]})))},S=i(15),D=i.n(S),P=i(16),C=function(t){var e=t.id,i=t.title,n=t.total_formatted,s=Object(o.addQueryArgs)("post.php",{post:e,action:"edit"});return Object(r.createElement)("div",{style:{display:"flex",justifyContent:"space-between"}},Object(r.createElement)("span",null,i?Object(r.createElement)("a",{href:s,target:"_blank",rel:"noreferrer"},i):Object(c.sprintf)(/* translators: %d Form ID. */ Object(c.__)("Payment form %d (deleted)","stripe"),e)),Object(r.createElement)("div",null,Object(r.createElement)("strong",null,Object(P.decodeEntities)(n))))},T=function(t){var e=t.report;if(e.isLoading)return Object(r.createElement)("div",{className:"simpay-admin-dashboard-widget-report__data-list"});var i=e.data.top_forms,n=i.top,s=i.remaining;return Object(r.createElement)("div",{className:"simpay-admin-dashboard-widget-report__data-list"},n.map((function(t){return Object(r.createElement)(C,D()({key:t.id},t))})),s.count>0&&Object(r.createElement)("div",{style:{display:"flex",justifyContent:"space-between"}},Object(r.createElement)("div",null,Object(c.sprintf)(/* translators: %d The number of forms included in results that are not shown. */ Object(c.__)("…and %d more","stripe"),s.count)),Object(r.createElement)("div",null,Object(P.decodeEntities)(s.total_formatted))))},E=simpayAdminDashboardWidgetReport,j=E.user_id,A=E.default_range,L=A.type,R=A.start,F=A.end,z=E.default_currency;Object(r.render)(Object(r.createElement)((function(){var t=Object(w.e)(j,"simpay_dashboard_widget_report_range",{start:Object(w.d)(L,R),end:Object(w.c)(L,F),type:L}),e=s()(t,2),i=e[0],n=e[1],a=Object(w.e)(j,"simpay_dashboard_widget_report_currency",z),h=s()(a,2),d=h[0],u=h[1],f=Object(r.useReducer)(g,{data:!1,isLoading:!0}),p=s()(f,2),m=p[0],b=p[1];return Object(r.useEffect)((function(){var t=Object(o.addQueryArgs)("/wpsp/__internal__/report/dashboard-widget",{range:i,currency:d});b({type:"START_RESOLUTION"}),l()({path:t}).then((function(t){b({type:"RECEIVE",data:t}),b({type:"FINISH_RESOLUTION"})}))}),[i,d]),Object(r.createElement)(r.Fragment,null,Object(r.createElement)("div",{className:"simpay-admin-dashboard-widget-report__chart"},Object(r.createElement)(w.b,{report:m,style:{width:"100%",height:"300px"},config:{yAxisIsCurrency:!0},noData:Object(r.createElement)("div",null,Object(r.createElement)("strong",null,Object(c.sprintf)(/* translators: %s Currency code. */ Object(c.__)("No %s transactions found.","stripe"),d.toUpperCase())),Object(r.createElement)("div",null,Object(c.__)("Please select a different currency, date range, or check back later.","stripe"))),deltaChangedString:function(t){return Object(r.createInterpolateElement)(Object(c.sprintf)(/* translators: %s: delta percentage */ diff --git a/includes/core/assets/js/dist/simpay-admin-form-template-explorer-css.asset.php b/includes/core/assets/js/dist/simpay-admin-form-template-explorer-css.asset.php index 2cde2dd0..80de1957 100644 --- a/includes/core/assets/js/dist/simpay-admin-form-template-explorer-css.asset.php +++ b/includes/core/assets/js/dist/simpay-admin-form-template-explorer-css.asset.php @@ -1 +1 @@ - array(), 'version' => 'f65ff075fab34cb49b6d582d31577036'); \ No newline at end of file + array(), 'version' => '374a19a9c7d1b2e8f63c64cfdc233506'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-form-template-explorer.asset.php b/includes/core/assets/js/dist/simpay-admin-form-template-explorer.asset.php index 14a894bd..4a372b96 100644 --- a/includes/core/assets/js/dist/simpay-admin-form-template-explorer.asset.php +++ b/includes/core/assets/js/dist/simpay-admin-form-template-explorer.asset.php @@ -1 +1 @@ - array('lodash', 'wp-a11y', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => '5dce049d9407deb8d0ff4624ab58bb21'); \ No newline at end of file + array('lodash', 'wp-a11y', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => 'add823490f99b1581a187fb38a6e7774'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-form-template-explorer.js b/includes/core/assets/js/dist/simpay-admin-form-template-explorer.js index dc41c979..3ee0704b 100644 --- a/includes/core/assets/js/dist/simpay-admin-form-template-explorer.js +++ b/includes/core/assets/js/dist/simpay-admin-form-template-explorer.js @@ -1,4 +1,4 @@ -!function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.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 a in e)r.d(n,a,function(t){return e[t]}.bind(null,a));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=81)}([function(e,t){e.exports=window.wp.element},,function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wp.components},,,function(e,t,r){var n=r(26),a=r(27),o=r(22),l=r(28);e.exports=function(e,t){return n(e)||a(e,t)||o(e,t)||l()},e.exports.__esModule=!0,e.exports.default=e.exports},,,function(e,t){e.exports=window.wp.primitives},function(e,t){e.exports=window.wp.url},,function(e,t){e.exports=window.lodash},function(e,t,r){var n;!function(){"use strict";var r={}.hasOwnProperty;function a(){for(var e=[],t=0;te.length)&&(t=e.length);for(var r=0,n=new Array(t);rbasic form. Have a suggestion for a new template? We'd love to hear it!","stripe"),{blank:Object(o.createElement)("a",{href:b}),suggest:Object(o.createElement)("a",{href:p,target:"_blank",rel:"noopener noreferrer"})})))},O=r(13),_=r.n(O),v=r(20),h=r(66),E=r(44),x=r(67),w=function e(t){var r=t.className,n=t.onChange,a=t.value,c=t.label,s=t.placeholder,u=void 0===s?Object(i.__)("Search"):s,p=t.hideLabelFromVision,m=void 0===p||p,d=t.help,f=Object(v.useInstanceId)(e),b=Object(o.useRef)(),g="components-search-control-".concat(f);return Object(o.createElement)(l.BaseControl,{label:c,id:g,hideLabelFromVision:m,help:d,className:_()(r,"components-search-control")},Object(o.createElement)("div",{className:"components-search-control__input-wrapper"},Object(o.createElement)("input",{ref:b,className:"components-search-control__input",id:g,type:"search",placeholder:u,onChange:function(e){return n(e.target.value)},autoComplete:"off",value:a||""}),Object(o.createElement)("div",{className:"components-search-control__icon"},!!a&&Object(o.createElement)(l.Button,{icon:h.a,label:Object(i.__)("Reset search","stripe"),onClick:function(){n(""),b.current.focus()}}),!a&&Object(o.createElement)(E.a,{icon:x.a}))))},C="simpay-form-template-explorer-main__sidebar";function S(e){var t=e.selectedCategory,r=e.templateCategories,n=e.onClickCategory;return Object(o.createElement)(l.NavigableMenu,{orientation:"vertical",className:"".concat(C,"-categories")},Object.keys(r).map((function(e){var a=_()("category-".concat(e),"".concat(C,"-categories_category"));return Object(o.createElement)(l.Button,{key:e,label:r[e],className:a,isPressed:t===e,onClick:function(){n(e)}},r[e])})))}function k(e){var t=e.filterValue,r=e.setFilterValue;return Object(o.createElement)("div",{className:"".concat(C,"-search")},Object(o.createElement)(w,{onChange:r,value:t,label:Object(i.__)("Search for templates","stripe"),placeholder:Object(i.__)("Search","stripe")}))}var N=function(e){var t=e.selectedCategory,r=e.templateCategories,n=e.onClickCategory,a=e.filterValue,l=e.setFilterValue;return Object(o.createElement)("div",{className:C},Object(o.createElement)(k,{filterValue:a,setFilterValue:l}),!a&&Object(o.createElement)(S,{selectedCategory:t,templateCategories:r,onClickCategory:n}))},M=r(39),P=r(9),V=Object(o.createElement)(P.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(o.createElement)(P.Path,{d:"M8 5C8 3.34315 9.34315 2 11 2H13C14.6569 2 16 3.34315 16 5V9H18C19.2624 9 20 9.9804 20 11V19C20 20.0196 19.2624 21 18 21H6C4.73763 21 4 20.0196 4 19V11C4 9.9804 4.73763 9 6 9H8V5ZM9.5 9H14.5V5C14.5 4.17157 13.8284 3.5 13 3.5H11C10.1716 3.5 9.5 4.17157 9.5 5V9Z"})),L=r(64),B=simpayFormBuilderTemplateExplorer,A=B.alreadyPurchasedUrl,U=B.licenseLevel,F=B.upgradeUrl,I="simpay-form-template-explorer-upgrade",T=function(e){var t=e.template,r=e.setIsShowingUpgradeModal;return Object(o.createElement)(l.Modal,{title:Object(i.__)("Upgrade Required","stripe"),onRequestClose:function(){return r(!1)},className:I},Object(o.createElement)("div",{className:"".concat(I,"__content")},Object(o.createElement)(E.a,{icon:V,size:"48px"}),Object(o.createElement)("h3",{className:"".concat(I,"__title")},Object(i.sprintf)(/* translators: %s Template name */ -Object(i.__)('Unlock the "%s" Template',"stripe"),t.name)),Object(o.createElement)("p",{className:"".concat(I,"__description")},Object(o.createInterpolateElement)(Object(i.sprintf)(/* translators: %$ss Template name. %2$s Minimum license level. */ -Object(i.__)('We\'re sorry, the "%1$s" template is not available on your plan. Please upgrade to the %2$s plan or higher to unlock this and other awesome features.',"stripe"),t.name,Object(c.upperFirst)(t.license[0])),{strong:Object(o.createElement)("strong",null)})),Object(o.createElement)(l.Button,{isPrimary:!0,variant:"primary",href:Object(s.addQueryArgs)(F,{utm_content:t.name}),target:"_blank",rel:"noopener noreferrer"},"lite"===U?Object(i.__)("Upgrade to Pro","stripe"):Object(i.__)("See Upgrade Options","stripe")),Object(o.createElement)("a",{href:A,target:"_blank",rel:"noopener noreferrer",className:"".concat(I,"__purchased")},Object(i.__)("Already purchased?","stripe")),Object(o.createElement)("p",{className:"".concat(I,"__discount")},Object(o.createElement)(E.a,{icon:L.a}),"lite"===U?Object(o.createInterpolateElement)(Object(i.__)("Bonus: WP Simple Pay Lite users get 50% off regular price, automatically applied at checkout. Upgrade to Pro →","stripe"),{strong:Object(o.createElement)("strong",null),highlight:Object(o.createElement)("u",null),upgrade:Object(o.createElement)("a",{href:Object(s.addQueryArgs)(F,{utm_content:t.name}),target:"_blank",rel:"noopener noreferrer"})}):Object(o.createInterpolateElement)(Object(i.__)("Bonus: WP Simple Pay Pro users get 50% off upgrade pricing, automatically applied at checkout. See Upgrade Options →","stripe"),{strong:Object(o.createElement)("strong",null),highlight:Object(o.createElement)("u",null),upgrade:Object(o.createElement)("a",{href:Object(s.addQueryArgs)(F,{utm_content:t.name}),target:"_blank",rel:"noopener noreferrer"})}))))},H=simpayFormBuilderTemplateExplorer,W=H.licenseLevel,z=H.addNewUrl,G=H.isLite,Q="simpay-form-template-explorer-main__content",R=["payment-button","donate-button","payment-form","product-installment-plan-form","product-purchse-form","product-subscription-form","product-subscription-form-coupon","recurring-service-setup-fee-form","recurring-service-trial-period-form","recurring-services-form","alipay-payment-button","giropay-payment-button","ideal-payment-button","przelewy24-payment-button"],Z=function(e){var t=e.template,r=Object(o.useState)(!1),n=a()(r,2),c=n[0],u=n[1],p=!t.license.includes(W),m=Object(s.addQueryArgs)(z,{"simpay-template":t.id}),d=Object(s.addQueryArgs)("https://wpsimplepay.com/templates/".concat(t.slug,"/"),{utm_source:"WordPress",utm_campaign:"1"===G?"lite-plugin":"pro-plugin",utm_medium:"template-explorer",utm_content:t.name});return Object(o.createElement)(o.Fragment,null,c&&Object(o.createElement)(T,{template:t,setIsShowingUpgradeModal:u}),Object(o.createElement)("div",{key:t.id,className:"".concat(Q,"-list-item")},p&&Object(o.createElement)("div",{className:"".concat(Q,"-list-item__badge")},Object(o.createElement)(E.a,{icon:V,size:"16px"})),Object(o.createElement)("div",{id:t.id,className:"".concat(Q,"-list-item__name ").concat(p?"".concat(Q,"-list-item__name--is-locked"):"")},t.name),Object(o.createElement)("div",{className:"".concat(Q,"-list-item__description")},t.description),Object(o.createElement)("div",{className:"".concat(Q,"-list-item__actions")},Object(o.createElement)(l.Button,{isPrimary:!0,variant:"primary",href:p?void 0:m,onClick:function(){return p?u(!0):null}},Object(i.__)("Use Template","stripe")),!R.includes(t.slug)&&Object(o.createElement)(l.Button,{isSecondary:!0,variant:"secondary",href:d,style:{marginLeft:"10px"},target:"_blank"},Object(i.__)("View Demo","stripe")))))},q=Object(o.createElement)(P.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(o.createElement)(P.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M6.68822 16.625L5.5 17.8145L5.5 5.5L18.5 5.5L18.5 16.625L6.68822 16.625ZM7.31 18.125L19 18.125C19.5523 18.125 20 17.6773 20 17.125L20 5C20 4.44772 19.5523 4 19 4H5C4.44772 4 4 4.44772 4 5V19.5247C4 19.8173 4.16123 20.086 4.41935 20.2237C4.72711 20.3878 5.10601 20.3313 5.35252 20.0845L7.31 18.125ZM16 9.99997H8V8.49997H16V9.99997ZM8 14H13V12.5H8V14Z"})),D=simpayFormBuilderTemplateExplorer.suggestUrl,$=function(){return Object(o.createElement)("div",{className:"".concat("simpay-form-template-explorer-main__content","-suggest")},Object(o.createElement)("div",{style:{flexGrow:0}},Object(o.createElement)(E.a,{icon:q,size:"42px"})),Object(o.createElement)("div",null,Object(o.createElement)("h4",null,Object(i.__)("We need your help!","stripe")),Object(o.createElement)("p",null,Object(o.createInterpolateElement)(Object(i.__)("We're constantly building more pre-made payment form templates to get you up and running even faster. If you have ideas for future templates, please let us know!","stripe"),{suggest:Object(o.createElement)("a",{href:D,target:"_blank",rel:"noopener noreferrer"})})),Object(o.createElement)(l.Button,{isSecondary:!0,variant:"secondary",isLink:!0,href:D,target:"_blank"},Object(i.__)("Suggest a Template","stripe"))))},K=simpayFormBuilderTemplateExplorer,J=K.isLite,X=K.upgradeUrl,Y=function(){return Object(o.createElement)("div",{className:"".concat("simpay-form-template-explorer-main__content","-upgrade")},Object(o.createElement)("div",null,Object(o.createElement)("h4",null,Object(i.__)("Get Access to All of Our Pre-Made Payment Form Templates","stripe")),Object(o.createElement)("p",null,Object(i.__)("Never start from scratch again! Upgrade to gain access to every payment form template we make and unlock powerful new features.","stripe"))),Object(o.createElement)(l.Button,{isSecondary:!0,variant:"primary",isLink:!0,size:"large",href:X,target:"_blank"},J?Object(i.__)("Upgrade to Pro","stripe"):Object(i.__)("Upgrade Now","stripe")))},ee=r(29),te=r.n(ee),re=function(e){return e.name||""},ne=function(e){return e.description||""},ae=function(e){return e.keywords||[]},oe=function(e){return e.category};function le(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(e=(e=Object(c.deburr)(e)).replace(/^\//,"")).toLowerCase()}var ce=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Object(c.words)(le(e))},ie=function(e,t){return Object(c.differenceWith)(e,ce(t),(function(e,t){return t.includes(e)}))};function se(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.getName,a=void 0===n?re:n,o=r.getDescription,l=void 0===o?ne:o,i=r.getKeywords,s=void 0===i?ae:i,u=r.getCategory,p=void 0===u?oe:u,m=a(e),d=l(e),f=s(e),b=p(e),g=le(t),y=le(m),j=0;if(g===y)j+=30;else if(y.startsWith(g))j+=20;else{var O=[m,d].concat(te()(f),[b]).join(" "),_=Object(c.words)(g),v=ie(_,O);0===v.length&&(j+=10)}return j}var ue=simpayFormBuilderTemplateExplorer,pe=ue.suggestUrl,me=ue.licenseLevel,de=function(e){var t=e.filterValue,r=e.selectedCategory,n=e.templates,l=Object(v.useDebounce)(M.speak,500),s=Object(o.useMemo)((function(){var e=n;return t?e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=ce(t);if(0===n.length)return e;var o=e.map((function(e){return[e,se(e,t,r)]})).filter((function(e){return a()(e,2)[1]>0}));return o.sort((function(e,t){var r=a()(e,2)[1];return a()(t,2)[1]-r})),o.map((function(e){return a()(e,1)[0]}))}(n,t):""!==r&&(e=n.filter((function(e){return e.categories.includes(r)}))),Object(c.sortBy)(e,(function(e){return!e.license.includes(me)}))}),[t,r,n]);Object(o.useEffect)((function(){if(t){var e=s.length,r=Object(i.sprintf)(/* translators: %d: number of results. */ -Object(i._n)("%d result found.","%d results found.",e,"stripe"),e);l(r)}}),[t,l]);var u=!(null==s||!s.length),p=_()("simpay-form-template-explorer-main__content",{"is-empty":!u});return Object(o.createElement)("div",{className:p},!u&&Object(o.createElement)("p",null,Object(o.createInterpolateElement)(Object(i.__)("No results found. Have a suggestion for a new template? We'd love to hear it!","stripe"),{suggest:Object(o.createElement)("a",{href:pe,target:"_blank",rel:"noopener noreferrer"})})),u&&Object(o.createElement)(o.Fragment,null,s.map((function(e,r){var n=Object(o.createElement)(Z,{key:e.slug,template:e});return""===t&&["lite","personal","plus"].includes(me)&&5===r?Object(o.createElement)(o.Fragment,{key:"upgrade-frag"},n,Object(o.createElement)(Y,null)):n})),Object(o.createElement)($,null)))},fe=simpayFormBuilderTemplateExplorer,be=fe.hasNew,ge=fe.templates,ye=fe.categories;Object(o.render)(Object(o.createElement)((function(){var e=Object(o.useState)(""),t=a()(e,2),r=t[0],n=t[1],c=Object(o.useState)(be?"new":""),i=a()(c,2),s=i[0],u=i[1];return Object(o.useEffect)((function(){document.querySelector("body").classList.add("simpay-template-explorer-open")}),[]),Object(o.createElement)(l.SlotFillProvider,null,Object(o.createElement)("div",{className:"simpay-form-template-explorer"},Object(o.createElement)(j,null),Object(o.createElement)("div",{className:"".concat("simpay-form-template-explorer","-main")},Object(o.createElement)(N,{selectedCategory:s,templateCategories:ye,onClickCategory:u,filterValue:r,setFilterValue:function(e){n(e),u("")}}),Object(o.createElement)(de,{templates:ge,templateCategories:ye,selectedCategory:s,filterValue:r}))),Object(o.createElement)(l.Popover.Slot,null))}),null),document.getElementById("simpay-form-template-explorer"))}]); \ No newline at end of file +!function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.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 a in e)r.d(n,a,function(t){return e[t]}.bind(null,a));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=79)}([function(e,t){e.exports=window.wp.element},,function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wp.components},,,function(e,t,r){var n=r(26),a=r(27),o=r(21),l=r(28);e.exports=function(e,t){return n(e)||a(e,t)||o(e,t)||l()},e.exports.__esModule=!0,e.exports.default=e.exports},,,function(e,t){e.exports=window.wp.primitives},function(e,t){e.exports=window.wp.url},,function(e,t){e.exports=window.lodash},,function(e,t,r){var n;!function(){"use strict";var r={}.hasOwnProperty;function a(){for(var e=[],t=0;te.length)&&(t=e.length);for(var r=0,n=new Array(t);rbasic form. Have a suggestion for a new template? We'd love to hear it!","stripe"),{blank:Object(o.createElement)("a",{href:b}),suggest:Object(o.createElement)("a",{href:p,target:"_blank",rel:"noopener noreferrer"})})))},O=r(14),_=r.n(O),v="simpay-form-template-explorer-main__sidebar";function h(e){var t=e.selectedCategory,r=e.templateCategories,n=e.onClickCategory;return Object(o.createElement)(l.NavigableMenu,{orientation:"vertical",className:"".concat(v,"-categories")},Object.keys(r).map((function(e){var a=_()("category-".concat(e),"".concat(v,"-categories_category"));return Object(o.createElement)(l.Button,{key:e,label:r[e],className:a,isPressed:t===e,onClick:function(){n(e)}},r[e])})))}function E(e){var t=e.filterValue,r=e.setFilterValue;return Object(o.createElement)("div",{className:"".concat(v,"-search")},Object(o.createElement)(l.SearchControl,{onChange:r,value:t,label:Object(i.__)("Search for templates","stripe"),placeholder:Object(i.__)("Search","stripe")}))}var x=function(e){var t=e.selectedCategory,r=e.templateCategories,n=e.onClickCategory,a=e.filterValue,l=e.setFilterValue;return Object(o.createElement)("div",{className:v},Object(o.createElement)(E,{filterValue:a,setFilterValue:l}),!a&&Object(o.createElement)(h,{selectedCategory:t,templateCategories:r,onClickCategory:n}))},w=r(22),C=r(39),S=r(44),k=r(9),N=Object(o.createElement)(k.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(o.createElement)(k.Path,{d:"M8 5C8 3.34315 9.34315 2 11 2H13C14.6569 2 16 3.34315 16 5V9H18C19.2624 9 20 9.9804 20 11V19C20 20.0196 19.2624 21 18 21H6C4.73763 21 4 20.0196 4 19V11C4 9.9804 4.73763 9 6 9H8V5ZM9.5 9H14.5V5C14.5 4.17157 13.8284 3.5 13 3.5H11C10.1716 3.5 9.5 4.17157 9.5 5V9Z"})),M=r(64),P=simpayFormBuilderTemplateExplorer,V=P.alreadyPurchasedUrl,A=P.licenseLevel,L=P.upgradeUrl,U="simpay-form-template-explorer-upgrade",B=function(e){var t=e.template,r=e.setIsShowingUpgradeModal;return Object(o.createElement)(l.Modal,{title:Object(i.__)("Upgrade Required","stripe"),onRequestClose:function(){return r(!1)},className:U},Object(o.createElement)("div",{className:"".concat(U,"__content")},Object(o.createElement)(S.a,{icon:N,size:"48px"}),Object(o.createElement)("h3",{className:"".concat(U,"__title")},Object(i.sprintf)(/* translators: %s Template name */ +Object(i.__)('Unlock the "%s" Template',"stripe"),t.name)),Object(o.createElement)("p",{className:"".concat(U,"__description")},Object(o.createInterpolateElement)(Object(i.sprintf)(/* translators: %$ss Template name. %2$s Minimum license level. */ +Object(i.__)('We\'re sorry, the "%1$s" template is not available on your plan. Please upgrade to the %2$s plan or higher to unlock this and other awesome features.',"stripe"),t.name,Object(c.upperFirst)(t.license[0])),{strong:Object(o.createElement)("strong",null)})),Object(o.createElement)(l.Button,{isPrimary:!0,variant:"primary",href:Object(s.addQueryArgs)(L,{utm_content:t.name}),target:"_blank",rel:"noopener noreferrer"},"lite"===A?Object(i.__)("Upgrade to Pro","stripe"):Object(i.__)("See Upgrade Options","stripe")),Object(o.createElement)("a",{href:V,target:"_blank",rel:"noopener noreferrer",className:"".concat(U,"__purchased")},Object(i.__)("Already purchased?","stripe")),Object(o.createElement)("p",{className:"".concat(U,"__discount")},Object(o.createElement)(S.a,{icon:M.a}),"lite"===A?Object(o.createInterpolateElement)(Object(i.__)("Bonus: WP Simple Pay Lite users get 50% off regular price, automatically applied at checkout. Upgrade to Pro →","stripe"),{strong:Object(o.createElement)("strong",null),highlight:Object(o.createElement)("u",null),upgrade:Object(o.createElement)("a",{href:Object(s.addQueryArgs)(L,{utm_content:t.name}),target:"_blank",rel:"noopener noreferrer"})}):Object(o.createInterpolateElement)(Object(i.__)("Bonus: WP Simple Pay Pro users get 50% off upgrade pricing, automatically applied at checkout. See Upgrade Options →","stripe"),{strong:Object(o.createElement)("strong",null),highlight:Object(o.createElement)("u",null),upgrade:Object(o.createElement)("a",{href:Object(s.addQueryArgs)(L,{utm_content:t.name}),target:"_blank",rel:"noopener noreferrer"})}))))},F=simpayFormBuilderTemplateExplorer,T=F.licenseLevel,I=F.addNewUrl,H=F.isLite,W="simpay-form-template-explorer-main__content",z=["payment-button","donate-button","payment-form","product-installment-plan-form","product-purchse-form","product-subscription-form","product-subscription-form-coupon","recurring-service-setup-fee-form","recurring-service-trial-period-form","recurring-services-form","alipay-payment-button","giropay-payment-button","ideal-payment-button","przelewy24-payment-button"],Q=function(e){var t=e.template,r=Object(o.useState)(!1),n=a()(r,2),c=n[0],u=n[1],p=!t.license.includes(T),m=Object(s.addQueryArgs)(I,{"simpay-template":t.id}),d=Object(s.addQueryArgs)("https://wpsimplepay.com/templates/".concat(t.slug,"/"),{utm_source:"WordPress",utm_campaign:"1"===H?"lite-plugin":"pro-plugin",utm_medium:"template-explorer",utm_content:t.name});return Object(o.createElement)(o.Fragment,null,c&&Object(o.createElement)(B,{template:t,setIsShowingUpgradeModal:u}),Object(o.createElement)("div",{key:t.id,className:"".concat(W,"-list-item")},p&&Object(o.createElement)("div",{className:"".concat(W,"-list-item__badge")},Object(o.createElement)(S.a,{icon:N,size:"16px"})),Object(o.createElement)("div",{id:t.id,className:"".concat(W,"-list-item__name ").concat(p?"".concat(W,"-list-item__name--is-locked"):"")},t.name),Object(o.createElement)("div",{className:"".concat(W,"-list-item__description")},t.description),Object(o.createElement)("div",{className:"".concat(W,"-list-item__actions")},Object(o.createElement)(l.Button,{isPrimary:!0,variant:"primary",href:p?void 0:m,onClick:function(){return p?u(!0):null}},Object(i.__)("Use Template","stripe")),!z.includes(t.slug)&&Object(o.createElement)(l.Button,{isSecondary:!0,variant:"secondary",href:d,style:{marginLeft:"10px"},target:"_blank"},Object(i.__)("View Demo","stripe")))))},G=Object(o.createElement)(k.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(o.createElement)(k.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M6.68822 16.625L5.5 17.8145L5.5 5.5L18.5 5.5L18.5 16.625L6.68822 16.625ZM7.31 18.125L19 18.125C19.5523 18.125 20 17.6773 20 17.125L20 5C20 4.44772 19.5523 4 19 4H5C4.44772 4 4 4.44772 4 5V19.5247C4 19.8173 4.16123 20.086 4.41935 20.2237C4.72711 20.3878 5.10601 20.3313 5.35252 20.0845L7.31 18.125ZM16 9.99997H8V8.49997H16V9.99997ZM8 14H13V12.5H8V14Z"})),Z=simpayFormBuilderTemplateExplorer.suggestUrl,R=function(){return Object(o.createElement)("div",{className:"".concat("simpay-form-template-explorer-main__content","-suggest")},Object(o.createElement)("div",{style:{flexGrow:0}},Object(o.createElement)(S.a,{icon:G,size:"42px"})),Object(o.createElement)("div",null,Object(o.createElement)("h4",null,Object(i.__)("We need your help!","stripe")),Object(o.createElement)("p",null,Object(o.createInterpolateElement)(Object(i.__)("We're constantly building more pre-made payment form templates to get you up and running even faster. If you have ideas for future templates, please let us know!","stripe"),{suggest:Object(o.createElement)("a",{href:Z,target:"_blank",rel:"noopener noreferrer"})})),Object(o.createElement)(l.Button,{isSecondary:!0,variant:"secondary",isLink:!0,href:Z,target:"_blank"},Object(i.__)("Suggest a Template","stripe"))))},q=simpayFormBuilderTemplateExplorer,D=q.isLite,$=q.upgradeUrl,K=function(){return Object(o.createElement)("div",{className:"".concat("simpay-form-template-explorer-main__content","-upgrade")},Object(o.createElement)("div",null,Object(o.createElement)("h4",null,Object(i.__)("Get Access to All of Our Pre-Made Payment Form Templates","stripe")),Object(o.createElement)("p",null,Object(i.__)("Never start from scratch again! Upgrade to gain access to every payment form template we make and unlock powerful new features.","stripe"))),Object(o.createElement)(l.Button,{isSecondary:!0,variant:"primary",isLink:!0,size:"large",href:$,target:"_blank"},D?Object(i.__)("Upgrade to Pro","stripe"):Object(i.__)("Upgrade Now","stripe")))},J=r(29),X=r.n(J),Y=function(e){return e.name||""},ee=function(e){return e.description||""},te=function(e){return e.keywords||[]},re=function(e){return e.category};function ne(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(e=(e=Object(c.deburr)(e)).replace(/^\//,"")).toLowerCase()}var ae=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Object(c.words)(ne(e))},oe=function(e,t){return Object(c.differenceWith)(e,ae(t),(function(e,t){return t.includes(e)}))};function le(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.getName,a=void 0===n?Y:n,o=r.getDescription,l=void 0===o?ee:o,i=r.getKeywords,s=void 0===i?te:i,u=r.getCategory,p=void 0===u?re:u,m=a(e),d=l(e),f=s(e),b=p(e),g=ne(t),y=ne(m),j=0;if(g===y)j+=30;else if(y.startsWith(g))j+=20;else{var O=[m,d].concat(X()(f),[b]).join(" "),_=Object(c.words)(g),v=oe(_,O);0===v.length&&(j+=10)}return j}var ce=simpayFormBuilderTemplateExplorer,ie=ce.suggestUrl,se=ce.licenseLevel,ue=function(e){var t=e.filterValue,r=e.selectedCategory,n=e.templates,l=Object(w.useDebounce)(C.speak,500),s=Object(o.useMemo)((function(){var e=n;return t?e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=ae(t);if(0===n.length)return e;var o=e.map((function(e){return[e,le(e,t,r)]})).filter((function(e){return a()(e,2)[1]>0}));return o.sort((function(e,t){var r=a()(e,2)[1];return a()(t,2)[1]-r})),o.map((function(e){return a()(e,1)[0]}))}(n,t):""!==r&&(e=n.filter((function(e){return e.categories.includes(r)}))),Object(c.sortBy)(e,(function(e){return!e.license.includes(se)}))}),[t,r,n]);Object(o.useEffect)((function(){if(t){var e=s.length,r=Object(i.sprintf)(/* translators: %d: number of results. */ +Object(i._n)("%d result found.","%d results found.",e,"stripe"),e);l(r)}}),[t,l]);var u=!(null==s||!s.length),p=_()("simpay-form-template-explorer-main__content",{"is-empty":!u});return Object(o.createElement)("div",{className:p},!u&&Object(o.createElement)("p",null,Object(o.createInterpolateElement)(Object(i.__)("No results found. Have a suggestion for a new template? We'd love to hear it!","stripe"),{suggest:Object(o.createElement)("a",{href:ie,target:"_blank",rel:"noopener noreferrer"})})),u&&Object(o.createElement)(o.Fragment,null,s.map((function(e,r){var n=Object(o.createElement)(Q,{key:e.slug,template:e});return""===t&&["lite","personal","plus"].includes(se)&&5===r?Object(o.createElement)(o.Fragment,{key:"upgrade-frag"},n,Object(o.createElement)(K,null)):n})),Object(o.createElement)(R,null)))},pe=simpayFormBuilderTemplateExplorer,me=pe.hasNew,de=pe.templates,fe=pe.categories;Object(o.render)(Object(o.createElement)((function(){var e=Object(o.useState)(""),t=a()(e,2),r=t[0],n=t[1],c=Object(o.useState)(me?"new":""),i=a()(c,2),s=i[0],u=i[1];return Object(o.useEffect)((function(){document.querySelector("body").classList.add("simpay-template-explorer-open")}),[]),Object(o.createElement)(l.SlotFillProvider,null,Object(o.createElement)("div",{className:"simpay-form-template-explorer"},Object(o.createElement)(j,null),Object(o.createElement)("div",{className:"".concat("simpay-form-template-explorer","-main")},Object(o.createElement)(x,{selectedCategory:s,templateCategories:fe,onClickCategory:u,filterValue:r,setFilterValue:function(e){n(e),u("")}}),Object(o.createElement)(ue,{templates:de,templateCategories:fe,selectedCategory:s,filterValue:r}))),Object(o.createElement)(l.Popover.Slot,null))}),null),document.getElementById("simpay-form-template-explorer"))}]); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-help-css.asset.php b/includes/core/assets/js/dist/simpay-admin-help-css.asset.php index 94f97812..8639218a 100644 --- a/includes/core/assets/js/dist/simpay-admin-help-css.asset.php +++ b/includes/core/assets/js/dist/simpay-admin-help-css.asset.php @@ -1 +1 @@ - array(), 'version' => '657fa03a722399c998ae7b0233b5bb8d'); \ No newline at end of file + array(), 'version' => '410c8f231808c04de36b327b88c79222'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-help.asset.php b/includes/core/assets/js/dist/simpay-admin-help.asset.php index 7df9e571..c98f974a 100644 --- a/includes/core/assets/js/dist/simpay-admin-help.asset.php +++ b/includes/core/assets/js/dist/simpay-admin-help.asset.php @@ -1 +1 @@ - array('lodash', 'wp-a11y', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-keycodes', 'wp-primitives', 'wp-url'), 'version' => '340417a4172b75d60d3db387972142da'); \ No newline at end of file + array('lodash', 'wp-a11y', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-keycodes', 'wp-primitives', 'wp-url'), 'version' => '9e27307fcbc57bdefdd2b401ec9fa40b'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-help.js b/includes/core/assets/js/dist/simpay-admin-help.js index 62736c2a..e152225b 100644 --- a/includes/core/assets/js/dist/simpay-admin-help.js +++ b/includes/core/assets/js/dist/simpay-admin-help.js @@ -1,2 +1,2 @@ -!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=80)}([function(e,t){e.exports=window.wp.element},,function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wp.components},,,function(e,t,n){var r=n(26),o=n(27),c=n(22),a=n(28);e.exports=function(e,t){return r(e)||o(e,t)||c(e,t)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},,,function(e,t){e.exports=window.wp.primitives},function(e,t){e.exports=window.wp.url},,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;te.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n5&&Object(c.createElement)(a.Button,{variant:"secondary",isSecondary:!0,isSmall:!0,onClick:function(){return f(!0)}},Object(s.__)("View all","stripe"))))},R=simpayHelp,I=R.docs,G=R.docsCategories,D=function(){var e,t=Object(c.useState)("getting-started"),n=o()(t,2),r=n[0],a=n[1];return Object(c.createElement)("div",{className:"simpay-help-panel__categories"},(e=Object(V.groupBy)(I,"categories"),Object(V.map)(e,(function(e,t){return{slug:t,title:G[t]||"",docs:e}}))).map((function(e){return Object(c.createElement)(H,k()({key:e.slug,openCategory:r,setOpenCategory:a},e))})))},F=n(29),W=n.n(F);function U(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(e=(e=Object(V.deburr)(e)).replace(/^\//,"")).toLowerCase()}var Z=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Object(V.words)(U(e))};function $(e,t){var n,r,o=e.title||"",c=e.excerpt||"",a=e.categories||[],l=e.tags||[],i=U(t),s=U(o),u=0;if(i===s)u+=30;else if(s.startsWith(i))u+=20;else{var p=[o,c].concat(W()(a),W()(l)).join(" ");0===(n=Object(V.words)(i),r=p,Object(V.differenceWith)(n,Z(r),(function(e,t){return t.includes(e)}))).length&&(u+=10)}return u}var Q=simpayHelp.docs,K=function(e){var t=e.searchTerm,n=Object(c.useMemo)((function(){var e=[];return""!==t&&(e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=Z(t);if(0===n.length)return e;var r=e.map((function(e){return[e,$(e,t)]})).filter((function(e){return o()(e,2)[1]>0}));return r.sort((function(e,t){var n=o()(e,2)[1];return o()(t,2)[1]-n})),r.map((function(e){return o()(e,1)[0]}))}(Q,t)),e}),[t]),r=Object(b.useDebounce)(P.speak,500);Object(c.useEffect)((function(){if(t){var e=n.length,o=Object(s.sprintf)(/* translators: %d: number of results. */ -Object(s._n)("%d result found.","%d results found.",e,"stripe"),e);r(o)}}),[t,r]);var a=!(null==n||!n.length);return Object(c.createElement)("div",{className:"simpay-help-panel__results"},!a&&Object(c.createElement)(D,null),a&&n.map((function(e){return Object(c.createElement)(N,k()({key:e.id,searchTerm:t},e))})))},q=function(e){var t=e.onClose,n=e.onSearch,r=e.searchTerm,o=Object(b.useFocusOnMount)("firstElement"),l=function(e){var t=Object(c.useRef)(),n=Object(c.useRef)(!1),r=Object(c.useRef)([]),o=Object(c.useRef)(e);return o.current=e,Object(c.useLayoutEffect)((function(){!1===n.current&&e.forEach((function(e,n){var o=r.current[n];e!==o&&(h(o,null),h(e,t.current))})),r.current=e}),e),Object(c.useLayoutEffect)((function(){n.current=!1})),Object(c.useCallback)((function(e){h(t,e),n.current=!0;var c,a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return 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 c,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,c=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw c}}}}(e?o.current:r.current);try{for(a.s();!(c=a.n()).done;)h(c.value,e)}catch(e){a.e(e)}finally{a.f()}}),[])}([Object(b.useConstrainedTabbing)(),Object(b.useFocusReturn)(),o]);return Object(c.createElement)(a.Animate,{type:"slide-in",options:{origin:"left"}},(function(e){var o=e.className,a=f()("simpay-help-panel",o);return Object(c.createElement)("div",{ref:l,className:a},Object(c.createElement)(v,{onClose:t}),Object(c.createElement)("div",{className:"simpay-help-panel__search"},Object(c.createElement)(M,{label:Object(s.__)("Search the documentation","stripe"),placeholder:Object(s.__)("Search","stripe"),onChange:n,value:r}),Object(c.createElement)(K,{searchTerm:r})),Object(c.createElement)(x,{searchTerm:r}))}))},J=function(e){var t=e.isOpen,n=e.onClose;return Object(c.useEffect)((function(){return document.body.classList.toggle("simpay-help-body-locked"),function(){document.body.classList.remove("simpay-help-body-locked")}}),[t]),Object(c.createElement)("button",{className:"simpay-help-backdrop",onClick:n})},X=simpayHelp,Y=X.docsSearchTerm,ee=X.docs;function te(e){var t=Object(i.getFragment)(e),n=Y;if(t&&t.includes("/")){var r=t.split("/");t=r[0],n=Object(i.safeDecodeURI)(r[1])}return{hash:t,searchTerm:n}}Object(c.render)(Object(c.createElement)((function(){var e=te(window.location.href),t=e.hash,n=e.searchTerm,r=Object(c.useState)(n),i=o()(r,2),s=i[0],u=i[1],m=Object(c.useState)("#help"===t),f=o()(m,2),b=f[0],d=f[1];function h(){d(!1),window.history.pushState("",document.title,window.location.pathname+window.location.search)}return Object(c.useEffect)((function(){function e(e){var t=te(e.newURL),r=t.hash,o=t.searchTerm;"#help"===r&&d(!0),o!==n&&u(o)}return window.addEventListener("hashchange",e),function(){window.removeEventListener("hashchange",e)}}),[]),Object(c.createElement)("div",{onKeyDown:function(e){e.keyCode!==l.ESCAPE||e.defaultPrevented||(e.preventDefault(),d(!1))},role:"region"},Object(c.createElement)(p,{isOpen:b,onOpen:function(){u(Y),d(!0),window.history.pushState("",document.title,window.location.pathname+window.location.search+"#help")}}),b&&Object(c.createElement)(c.Fragment,null,Object(c.createElement)(q,{onClose:h,onSearch:u,searchTerm:s,docs:ee}),Object(c.createElement)(J,{onClose:h})),Object(c.createElement)(a.Popover.Slot,null))}),null),document.getElementById("simpay-branding-bar-help"))}]); \ No newline at end of file +!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=78)}([function(e,t){e.exports=window.wp.element},,function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wp.components},,,function(e,t,n){var r=n(26),o=n(27),c=n(21),a=n(28);e.exports=function(e,t){return r(e)||o(e,t)||c(e,t)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},,,function(e,t){e.exports=window.wp.primitives},function(e,t){e.exports=window.wp.url},,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;te.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n5&&Object(c.createElement)(a.Button,{variant:"secondary",isSecondary:!0,isSmall:!0,onClick:function(){return m(!0)}},Object(s.__)("View all","stripe"))))},N=simpayHelp,B=N.docs,L=N.docsCategories,R=function(){var e,t=Object(c.useState)("getting-started"),n=o()(t,2),r=n[0],a=n[1];return Object(c.createElement)("div",{className:"simpay-help-panel__categories"},(e=Object(P.groupBy)(B,"categories"),Object(P.map)(e,(function(e,t){return{slug:t,title:L[t]||"",docs:e}}))).map((function(e){return Object(c.createElement)(V,C()({key:e.slug,openCategory:r,setOpenCategory:a},e))})))},I=n(29),G=n.n(I);function D(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(e=(e=Object(P.deburr)(e)).replace(/^\//,"")).toLowerCase()}var W=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Object(P.words)(D(e))};function F(e,t){var n,r,o=e.title||"",c=e.excerpt||"",a=e.categories||[],l=e.tags||[],i=D(t),s=D(o),u=0;if(i===s)u+=30;else if(s.startsWith(i))u+=20;else{var p=[o,c].concat(G()(a),G()(l)).join(" ");0===(n=Object(P.words)(i),r=p,Object(P.differenceWith)(n,W(r),(function(e,t){return t.includes(e)}))).length&&(u+=10)}return u}var U=simpayHelp.docs,Z=function(e){var t=e.searchTerm,n=Object(c.useMemo)((function(){var e=[];return""!==t&&(e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=W(t);if(0===n.length)return e;var r=e.map((function(e){return[e,F(e,t)]})).filter((function(e){return o()(e,2)[1]>0}));return r.sort((function(e,t){var n=o()(e,2)[1];return o()(t,2)[1]-n})),r.map((function(e){return o()(e,1)[0]}))}(U,t)),e}),[t]),r=Object(d.useDebounce)(M.speak,500);Object(c.useEffect)((function(){if(t){var e=n.length,o=Object(s.sprintf)(/* translators: %d: number of results. */ +Object(s._n)("%d result found.","%d results found.",e,"stripe"),e);r(o)}}),[t,r]);var a=!(null==n||!n.length);return Object(c.createElement)("div",{className:"simpay-help-panel__results"},!a&&Object(c.createElement)(R,null),a&&n.map((function(e){return Object(c.createElement)(k,C()({key:e.id,searchTerm:t},e))})))},$=function(e){var t=e.onClose,n=e.onSearch,r=e.searchTerm,o=Object(d.useFocusOnMount)("firstElement"),l=function(e){var t=Object(c.useRef)(),n=Object(c.useRef)(!1),r=Object(c.useRef)([]),o=Object(c.useRef)(e);return o.current=e,Object(c.useLayoutEffect)((function(){!1===n.current&&e.forEach((function(e,n){var o=r.current[n];e!==o&&(h(o,null),h(e,t.current))})),r.current=e}),e),Object(c.useLayoutEffect)((function(){n.current=!1})),Object(c.useCallback)((function(e){h(t,e),n.current=!0;var c,a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return b(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)?b(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,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,c=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw c}}}}(e?o.current:r.current);try{for(a.s();!(c=a.n()).done;)h(c.value,e)}catch(e){a.e(e)}finally{a.f()}}),[])}([Object(d.useConstrainedTabbing)(),Object(d.useFocusReturn)(),o]);return Object(c.createElement)(a.Animate,{type:"slide-in",options:{origin:"left"}},(function(e){var o=e.className,i=m()("simpay-help-panel",o);return Object(c.createElement)("div",{ref:l,className:i},Object(c.createElement)(O,{onClose:t}),Object(c.createElement)("div",{className:"simpay-help-panel__search"},Object(c.createElement)(a.SearchControl,{label:Object(s.__)("Search the documentation","stripe"),placeholder:Object(s.__)("Search","stripe"),onChange:n,value:r}),Object(c.createElement)(Z,{searchTerm:r})),Object(c.createElement)(E,{searchTerm:r}))}))},Q=function(e){var t=e.isOpen,n=e.onClose;return Object(c.useEffect)((function(){return document.body.classList.toggle("simpay-help-body-locked"),function(){document.body.classList.remove("simpay-help-body-locked")}}),[t]),Object(c.createElement)("button",{className:"simpay-help-backdrop",onClick:n})},K=simpayHelp,q=K.docsSearchTerm,J=K.docs;function X(e){var t=Object(i.getFragment)(e),n=q;if(t&&t.includes("/")){var r=t.split("/");t=r[0],n=Object(i.safeDecodeURI)(r[1])}return{hash:t,searchTerm:n}}Object(c.render)(Object(c.createElement)((function(){var e=X(window.location.href),t=e.hash,n=e.searchTerm,r=Object(c.useState)(n),i=o()(r,2),s=i[0],u=i[1],f=Object(c.useState)("#help"===t),m=o()(f,2),d=m[0],b=m[1];function h(){b(!1),window.history.pushState("",document.title,window.location.pathname+window.location.search)}return Object(c.useEffect)((function(){function e(e){var t=X(e.newURL),r=t.hash,o=t.searchTerm;"#help"===r&&b(!0),o!==n&&u(o)}return window.addEventListener("hashchange",e),function(){window.removeEventListener("hashchange",e)}}),[]),Object(c.createElement)("div",{onKeyDown:function(e){e.keyCode!==l.ESCAPE||e.defaultPrevented||(e.preventDefault(),b(!1))},role:"region"},Object(c.createElement)(p,{isOpen:d,onOpen:function(){u(q),b(!0),window.history.pushState("",document.title,window.location.pathname+window.location.search+"#help")}}),d&&Object(c.createElement)(c.Fragment,null,Object(c.createElement)($,{onClose:h,onSearch:u,searchTerm:s,docs:J}),Object(c.createElement)(Q,{onClose:h})),Object(c.createElement)(a.Popover.Slot,null))}),null),document.getElementById("simpay-branding-bar-help"))}]); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-notifications-css.asset.php b/includes/core/assets/js/dist/simpay-admin-notifications-css.asset.php index 2c15c1b4..424a7c35 100644 --- a/includes/core/assets/js/dist/simpay-admin-notifications-css.asset.php +++ b/includes/core/assets/js/dist/simpay-admin-notifications-css.asset.php @@ -1 +1 @@ - array(), 'version' => '30784043ec33dac042e57124a07cd0aa'); \ No newline at end of file + array(), 'version' => 'ccb87477a8bed9b0e8f2ca5242289e30'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-notifications.asset.php b/includes/core/assets/js/dist/simpay-admin-notifications.asset.php index 05a6377e..c4d18091 100644 --- a/includes/core/assets/js/dist/simpay-admin-notifications.asset.php +++ b/includes/core/assets/js/dist/simpay-admin-notifications.asset.php @@ -1 +1 @@ - array('lodash', 'moment', 'react', 'react-dom', 'wp-api-fetch', 'wp-autop', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '7a8f10de49c3453462dd59a8e9f8066f'); \ No newline at end of file + array('lodash', 'moment', 'react', 'react-dom', 'wp-api-fetch', 'wp-autop', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => 'cdcd4da1e020aec5e51d9de7811f6fdd'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-notifications.js b/includes/core/assets/js/dist/simpay-admin-notifications.js index 351ccf63..d2b40297 100644 --- a/includes/core/assets/js/dist/simpay-admin-notifications.js +++ b/includes/core/assets/js/dist/simpay-admin-notifications.js @@ -1,3 +1,3 @@ -!function(t){var e={};function n(r){if(e[r])return e[r].exports;var s=e[r]={i:r,l:!1,exports:{}};return t[r].call(s.exports,s,s.exports,n),s.l=!0,s.exports}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 s in t)n.d(r,s,function(e){return t[e]}.bind(null,s));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=82)}([function(t,e){t.exports=window.wp.element},function(t,e,n){"use strict";n.d(e,"w",(function(){return s})),n.d(e,"a",(function(){return Ot})),n.d(e,"b",(function(){return q})),n.d(e,"c",(function(){return jt})),n.d(e,"d",(function(){return yt})),n.d(e,"e",(function(){return H})),n.d(e,"f",(function(){return dt})),n.d(e,"g",(function(){return Rt})),n.d(e,"h",(function(){return _})),n.d(e,"i",(function(){return zt})),n.d(e,"j",(function(){return qt})),n.d(e,"k",(function(){return S})),n.d(e,"l",(function(){return E})),n.d(e,"m",(function(){return M})),n.d(e,"n",(function(){return A})),n.d(e,"o",(function(){return U})),n.d(e,"p",(function(){return gt})),n.d(e,"q",(function(){return bt})),n.d(e,"r",(function(){return mt})),n.d(e,"s",(function(){return x})),n.d(e,"t",(function(){return Lt})),n.d(e,"u",(function(){return k})),n.d(e,"v",(function(){return w})),n.d(e,"x",(function(){return wt})),n.d(e,"y",(function(){return P})),n.d(e,"z",(function(){return Ut})),n.d(e,"A",(function(){return Ft})),n.d(e,"B",(function(){return $t})),n.d(e,"C",(function(){return Qt})),n.d(e,"D",(function(){return Gt}));let r=O();const s=t=>m(t,r);let o=O();s.write=t=>m(t,o);let i=O();s.onStart=t=>m(t,i);let a=O();s.onFrame=t=>m(t,a);let c=O();s.onFinish=t=>m(t,c);let u=[];s.setTimeout=(t,e)=>{let n=s.now()+e,r=()=>{let t=u.findIndex(t=>t.cancel==r);~t&&u.splice(t,1),p-=~t?1:0},o={time:n,handler:t,cancel:r};return u.splice(l(n),0,o),p+=1,b(),o};let l=t=>~(~u.findIndex(e=>e.time>t)||~u.length);s.cancel=t=>{i.delete(t),a.delete(t),r.delete(t),o.delete(t),c.delete(t)},s.sync=t=>{h=!0,s.batchedUpdates(t),h=!1},s.throttle=t=>{let e;function n(){try{t(...e)}finally{e=null}}function r(...t){e=t,s.onStart(n)}return r.handler=t,r.cancel=()=>{i.delete(n),e=null},r};let d="undefined"!=typeof window?window.requestAnimationFrame:()=>{};s.use=t=>d=t,s.now="undefined"!=typeof performance?()=>performance.now():Date.now,s.batchedUpdates=t=>t(),s.catch=console.error,s.frameLoop="always",s.advance=()=>{"demand"!==s.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):y()};let f=-1,p=0,h=!1;function m(t,e){h?(e.delete(t),t(0)):(e.add(t),b())}function b(){f<0&&(f=0,"demand"!==s.frameLoop&&d(g))}function g(){~f&&(d(g),s.batchedUpdates(y))}function y(){let t=f;f=s.now();let e=l(f);e&&(v(u.splice(0,e),t=>t.handler()),p-=e),i.flush(),r.flush(t?Math.min(64,f-t):16.667),a.flush(),o.flush(),c.flush(),p||(f=-1)}function O(){let t=new Set,e=t;return{add(n){p+=e!=t||t.has(n)?0:1,t.add(n)},delete:n=>(p-=e==t&&t.has(n)?1:0,t.delete(n)),flush(n){e.size&&(t=new Set,p-=e.size,v(e,e=>e(n)&&t.add(e)),p+=t.size,e=t)}}}function v(t,e){t.forEach(t=>{try{e(t)}catch(t){s.catch(t)}})}var j=n(5);function w(){}const _=(t,e,n)=>Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0}),x={arr:Array.isArray,obj:t=>!!t&&"Object"===t.constructor.name,fun:t=>"function"==typeof t,str:t=>"string"==typeof t,num:t=>"number"==typeof t,und:t=>void 0===t};function k(t,e){if(x.arr(t)){if(!x.arr(e)||t.length!==e.length)return!1;for(let n=0;nt.forEach(e);function E(t,e,n){if(x.arr(t))for(let r=0;rx.und(t)?[]:x.arr(t)?t:[t];function M(t,e){if(t.size){const n=Array.from(t);t.clear(),S(n,e)}}const A=(t,...e)=>M(t,t=>t(...e)),I=()=>"undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent);let C,R,T=null,N=!1,V=w;var q=Object.freeze({__proto__:null,get createStringInterpolator(){return C},get to(){return R},get colors(){return T},get skipAnimation(){return N},get willAdvance(){return V},assign:t=>{t.to&&(R=t.to),t.now&&(s.now=t.now),void 0!==t.colors&&(T=t.colors),null!=t.skipAnimation&&(N=t.skipAnimation),t.createStringInterpolator&&(C=t.createStringInterpolator),t.requestAnimationFrame&&s.use(t.requestAnimationFrame),t.batchedUpdates&&(s.batchedUpdates=t.batchedUpdates),t.willAdvance&&(V=t.willAdvance),t.frameLoop&&(s.frameLoop=t.frameLoop)}});const D=new Set;let z=[],L=[],F=0;const U={get idle(){return!D.size&&!z.length},start(t){F>t.priority?(D.add(t),s.onStart($)):(Q(t),s(G))},advance:G,sort(t){if(F)s.onFrame(()=>U.sort(t));else{const e=z.indexOf(t);~e&&(z.splice(e,1),B(t))}},clear(){z=[],D.clear()}};function $(){D.forEach(Q),D.clear(),s(G)}function Q(t){z.includes(t)||B(t)}function B(t){z.splice(function(e,n){const r=e.findIndex(e=>e.priority>t.priority);return r<0?e.length:r}(z),0,t)}function G(t){const e=L;for(let n=0;n0}const H={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},W="[-+]?\\d*\\.?\\d+";function Z(...t){return"\\(\\s*("+t.join(")\\s*,\\s*(")+")\\s*\\)"}const Y=new RegExp("rgb"+Z(W,W,W)),J=new RegExp("rgba"+Z(W,W,W,W)),K=new RegExp("hsl"+Z(W,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%")),X=new RegExp("hsla"+Z(W,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%",W)),tt=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,et=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,nt=/^#([0-9a-fA-F]{6})$/,rt=/^#([0-9a-fA-F]{8})$/;function st(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function ot(t,e,n){const r=n<.5?n*(1+e):n+e-n*e,s=2*n-r,o=st(s,r,t+1/3),i=st(s,r,t),a=st(s,r,t-1/3);return Math.round(255*o)<<24|Math.round(255*i)<<16|Math.round(255*a)<<8}function it(t){const e=parseInt(t,10);return e<0?0:e>255?255:e}function at(t){return(parseFloat(t)%360+360)%360/360}function ct(t){const e=parseFloat(t);return e<0?0:e>1?255:Math.round(255*e)}function ut(t){const e=parseFloat(t);return e<0?0:e>100?1:e/100}function lt(t){let e=function(t){let e;return"number"==typeof t?t>>>0===t&&t>=0&&t<=4294967295?t:null:(e=nt.exec(t))?parseInt(e[1]+"ff",16)>>>0:T&&void 0!==T[t]?T[t]:(e=Y.exec(t))?(it(e[1])<<24|it(e[2])<<16|it(e[3])<<8|255)>>>0:(e=J.exec(t))?(it(e[1])<<24|it(e[2])<<16|it(e[3])<<8|ct(e[4]))>>>0:(e=tt.exec(t))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+"ff",16)>>>0:(e=rt.exec(t))?parseInt(e[1],16)>>>0:(e=et.exec(t))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+e[4]+e[4],16)>>>0:(e=K.exec(t))?(255|ot(at(e[1]),ut(e[2]),ut(e[3])))>>>0:(e=X.exec(t))?(ot(at(e[1]),ut(e[2]),ut(e[3]))|ct(e[4]))>>>0:null}(t);return null===e?t:(e=e||0,`rgba(${(4278190080&e)>>>24}, ${(16711680&e)>>>16}, ${(65280&e)>>>8}, ${(255&e)/255})`)}const dt=(t,e,n)=>{if(x.fun(t))return t;if(x.arr(t))return dt({range:t,output:e,extrapolate:n});if(x.str(t.output[0]))return C(t);const r=t,s=r.output,o=r.range||[0,1],i=r.extrapolateLeft||r.extrapolate||"extend",a=r.extrapolateRight||r.extrapolate||"extend",c=r.easing||(t=>t);return t=>{const e=function(t,e){for(var n=1;n=t);++n);return n-1}(t,o);return function(t,e,n,r,s,o,i,a,c){let u=c?c(t):t;if(un){if("identity"===a)return u;"clamp"===a&&(u=n)}return r===s?r:e===n?t<=e?r:s:(e===-1/0?u=-u:n===1/0?u-=e:u=(u-e)/(n-e),u=o(u),r===-1/0?u=-u:s===1/0?u+=r:u=u*(s-r)+r,u)}(t,o[e],o[e+1],s[e],s[e+1],c,i,a,r.map)}};function ft(){return(ft=Object.assign||function(t){for(var e=1;eBoolean(t&&t[pt]),bt=t=>t&&t[pt]?t[pt]():t,gt=t=>t[ht]||null;function yt(t,e){let n=t[ht];n&&n.forEach(t=>{!function(t,e){t.eventObserved?t.eventObserved(e):t(e)}(t,e)})}class Ot{constructor(t){if(this[pt]=void 0,this[ht]=void 0,!t&&!(t=this.get))throw Error("Unknown getter");vt(this,t)}}const vt=(t,e)=>_t(t,pt,e);function jt(t,e){if(t[pt]){let n=t[ht];n||_t(t,ht,n=new Set),n.has(e)||(n.add(e),t.observerAdded&&t.observerAdded(n.size,e))}return e}function wt(t,e){let n=t[ht];if(n&&n.has(e)){const r=n.size-1;r?n.delete(e):t[ht]=null,t.observerRemoved&&t.observerRemoved(r,e)}}const _t=(t,e,n)=>Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0}),xt=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,kt=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,St=new RegExp(`(${xt.source})(%|[a-z]+)`,"i"),Et=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Pt=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,Mt=t=>{const[e,n]=At(t);if(!e||I())return t;const r=window.getComputedStyle(document.documentElement).getPropertyValue(e);if(r)return r.trim();if(n&&n.startsWith("--")){return window.getComputedStyle(document.documentElement).getPropertyValue(n)||t}return n&&Pt.test(n)?Mt(n):n||t},At=t=>{const e=Pt.exec(t);if(!e)return[,];const[,n,r]=e;return[n,r]};let It;const Ct=(t,e,n,r,s)=>`rgba(${Math.round(e)}, ${Math.round(n)}, ${Math.round(r)}, ${s})`,Rt=t=>{It||(It=T?new RegExp(`(${Object.keys(T).join("|")})(?!\\w)`,"g"):/^\b$/);const e=t.output.map(t=>bt(t).replace(Pt,Mt).replace(kt,lt).replace(It,lt)),n=e.map(t=>t.match(xt).map(Number)),r=n[0].map((t,e)=>n.map(t=>{if(!(e in t))throw Error('The arity of each "output" value must be equal');return t[e]})).map(e=>dt(ft({},t,{output:e})));return t=>{var n;const s=!St.test(e[0])&&(null==(n=e.find(t=>St.test(t)))?void 0:n.replace(xt,""));let o=0;return e[0].replace(xt,()=>`${r[o++](t)}${s||""}`).replace(Et,Ct)}},Tt="react-spring: ",Nt=t=>{const e=t;let n=!1;if("function"!=typeof e)throw new TypeError(Tt+"once requires a function parameter");return(...t)=>{n||(e(...t),n=!0)}},Vt=Nt(console.warn);function qt(){Vt(Tt+'The "interpolate" function is deprecated in v9 (use "to" instead)')}const Dt=Nt(console.warn);function zt(){Dt(Tt+'Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions')}function Lt(t){return x.str(t)&&("#"==t[0]||/\d/.test(t)||!I()&&Pt.test(t)||t in(T||{}))}const Ft="undefined"!=typeof window&&window.document&&window.document.createElement?j.useLayoutEffect:j.useEffect;function Ut(){const t=Object(j.useState)()[1],e=(()=>{const t=Object(j.useRef)(!1);return Ft(()=>(t.current=!0,()=>{t.current=!1}),[]),t})();return()=>{e.current&&t(Math.random())}}function $t(t,e){const[n]=Object(j.useState)(()=>({inputs:e,result:t()})),r=Object(j.useRef)(),s=r.current;let o=s;return o?Boolean(e&&o.inputs&&function(t,e){if(t.length!==e.length)return!1;for(let n=0;n{r.current=o,s==n&&(n.inputs=n.result=void 0)},[o]),o.result}const Qt=t=>Object(j.useEffect)(t,Bt),Bt=[];function Gt(t){const e=Object(j.useRef)();return Object(j.useEffect)(()=>{e.current=t}),e.current}},function(t,e){t.exports=window.wp.i18n},function(t,e){t.exports=window.wp.components},,function(t,e){t.exports=window.React},function(t,e,n){var r=n(26),s=n(27),o=n(22),i=n(28);t.exports=function(t,e){return r(t)||s(t,e)||o(t,e)||i()},t.exports.__esModule=!0,t.exports.default=t.exports},,,function(t,e){t.exports=window.wp.primitives},function(t,e){t.exports=window.wp.url},function(t,e,n){var r=n(30);t.exports=function(t,e,n){return(e=r(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=window.lodash},function(t,e,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function s(){for(var t=[],e=0;et&&t[o],a=(t,e)=>Object(r.h)(t,o,e),c=t=>t&&t[o]&&t[o].getPayload();class u{constructor(){this.payload=void 0,a(this,this)}getPayload(){return this.payload||[]}}class l extends u{constructor(t){super(),this.done=!0,this.elapsedTime=void 0,this.lastPosition=void 0,this.lastVelocity=void 0,this.v0=void 0,this.durationProgress=0,this._value=t,r.s.num(this._value)&&(this.lastPosition=this._value)}static create(t){return new l(t)}getPayload(){return[this]}getValue(){return this._value}setValue(t,e){return r.s.num(t)&&(this.lastPosition=t,e&&(t=Math.round(t/e)*e,this.done&&(this.lastPosition=t))),this._value!==t&&(this._value=t,!0)}reset(){const{done:t}=this;this.done=!1,r.s.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,t&&(this.lastVelocity=null),this.v0=null)}}class d extends l{constructor(t){super(0),this._string=null,this._toString=void 0,this._toString=Object(r.f)({output:[t,t]})}static create(t){return new d(t)}getValue(){let t=this._string;return null==t?this._string=this._toString(this._value):t}setValue(t){if(r.s.str(t)){if(t==this._string)return!1;this._string=t,this._value=1}else{if(!super.setValue(t))return!1;this._string=null}return!0}reset(t){t&&(this._toString=Object(r.f)({output:[this.getValue(),t]})),this._value=0,super.reset()}}const f={dependencies:null};class p extends u{constructor(t){super(),this.source=t,this.setValue(t)}getValue(t){const e={};return Object(r.l)(this.source,(n,s)=>{var i;(i=n)&&i[o]===i?e[s]=n.getValue(t):Object(r.r)(n)?e[s]=Object(r.q)(n):t||(e[s]=n)}),e}setValue(t){this.source=t,this.payload=this._makePayload(t)}reset(){this.payload&&Object(r.k)(this.payload,t=>t.reset())}_makePayload(t){if(t){const e=new Set;return Object(r.l)(t,this._addToPayload,e),Array.from(e)}}_addToPayload(t){f.dependencies&&Object(r.r)(t)&&f.dependencies.add(t);const e=c(t);e&&Object(r.k)(e,t=>this.add(t))}}class h extends p{constructor(t){super(t)}static create(t){return new h(t)}getValue(){return this.source.map(t=>t.getValue())}setValue(t){const e=this.getPayload();return t.length==e.length?e.map((e,n)=>e.setValue(t[n])).some(Boolean):(super.setValue(t.map(m)),!0)}}function m(t){return(Object(r.t)(t)?d:l).create(t)}function b(t){const e=i(t);return e?e.constructor:r.s.arr(t)?h:Object(r.t)(t)?d:l}function g(){return(g=Object.assign||function(t){for(var e=1;e{const n=!r.s.fun(t)||t.prototype&&t.prototype.isReactComponent;return Object(s.forwardRef)((o,i)=>{const a=Object(s.useRef)(null),c=n&&Object(s.useCallback)(t=>{a.current=function(t,e){return t&&(r.s.fun(t)?t(e):t.current=e),e}(i,t)},[i]),[u,l]=function(t,e){const n=new Set;return f.dependencies=n,t.style&&(t=g({},t,{style:e.createAnimatedStyle(t.style)})),t=new p(t),f.dependencies=null,[t,n]}(o,e),d=Object(r.z)(),h=()=>{const t=a.current;n&&!t||!1===(!!t&&e.applyAnimatedValues(t,u.getValue(!0)))&&d()},m=new O(h,l),b=Object(s.useRef)();Object(r.A)(()=>(b.current=m,Object(r.k)(l,t=>Object(r.c)(t,m)),()=>{b.current&&(Object(r.k)(b.current.deps,t=>Object(r.x)(t,b.current)),r.w.cancel(b.current.update))})),Object(s.useEffect)(h,[]),Object(r.C)(()=>()=>{const t=b.current;Object(r.k)(t.deps,e=>Object(r.x)(e,t))});const y=e.getComponentProps(u.getValue());return s.createElement(t,g({},y,{ref:c}))})};class O{constructor(t,e){this.update=t,this.deps=e}eventObserved(t){"change"==t.type&&r.w.write(this.update)}}const v=Symbol.for("AnimatedComponent"),j=(t,{applyAnimatedValues:e=(()=>!1),createAnimatedStyle:n=(t=>new p(t)),getComponentProps:s=(t=>t)}={})=>{const o={applyAnimatedValues:e,createAnimatedStyle:n,getComponentProps:s},i=t=>{const e=w(t)||"Anonymous";return(t=r.s.str(t)?i[t]||(i[t]=y(t,o)):t[v]||(t[v]=y(t,o))).displayName=`Animated(${e})`,t};return Object(r.l)(t,(e,n)=>{r.s.arr(t)&&(n=w(e)),i[n]=i(e)}),{animated:i}},w=t=>r.s.str(t)?t:t&&r.s.str(t.displayName)?t.displayName:r.s.fun(t)&&t.name||null},function(t,e){t.exports=window.wp.compose},function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n!0===t||!!(e&&t&&(r.s.fun(t)?t(e):Object(r.y)(t).includes(e))),u=(t,e)=>r.s.obj(t)?e&&t[e]:t,l=(t,e)=>!0===t.default?t[e]:t.default?t.default[e]:void 0,d=t=>t,f=(t,e=d)=>{let n=p;t.default&&!0!==t.default&&(t=t.default,n=Object.keys(t));const s={};for(const o of n){const n=e(t[o],o);r.s.und(n)||(s[o]=n)}return s},p=["config","onProps","onStart","onChange","onPause","onResume","onRest"],h={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function m(t){const e=function(t){const e={};let n=0;if(Object(r.l)(t,(t,r)=>{h[r]||(e[r]=t,n++)}),n)return e}(t);if(e){const n={to:e};return Object(r.l)(t,(t,r)=>r in e||(n[r]=t)),n}return i({},t)}function b(t){return t=Object(r.q)(t),r.s.arr(t)?t.map(b):Object(r.t)(t)?r.b.createStringInterpolator({range:[0,1],output:[t,t]})(1):t}function g(t){for(const e in t)return!0;return!1}function y(t){return r.s.fun(t)||r.s.arr(t)&&r.s.obj(t[0])}function O(t,e){var n;null==(n=t.ref)||n.delete(t),null==e||e.delete(t)}function v(t,e){var n;e&&t.ref!==e&&(null==(n=t.ref)||n.delete(t),e.add(t),t.ref=e)}const j={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}},w=1.70158,_=1.525*w,x=2*Math.PI/3,k=2*Math.PI/4.5,S=t=>{const e=7.5625,n=2.75;return t<1/n?e*t*t:t<2/n?e*(t-=1.5/n)*t+.75:t<2.5/n?e*(t-=2.25/n)*t+.9375:e*(t-=2.625/n)*t+.984375},E={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>1-(1-t)*(1-t),easeInOutQuad:t=>t<.5?2*t*t:1-Math.pow(-2*t+2,2)/2,easeInCubic:t=>t*t*t,easeOutCubic:t=>1-Math.pow(1-t,3),easeInOutCubic:t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2,easeInQuart:t=>t*t*t*t,easeOutQuart:t=>1-Math.pow(1-t,4),easeInOutQuart:t=>t<.5?8*t*t*t*t:1-Math.pow(-2*t+2,4)/2,easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>1-Math.pow(1-t,5),easeInOutQuint:t=>t<.5?16*t*t*t*t*t:1-Math.pow(-2*t+2,5)/2,easeInSine:t=>1-Math.cos(t*Math.PI/2),easeOutSine:t=>Math.sin(t*Math.PI/2),easeInOutSine:t=>-(Math.cos(Math.PI*t)-1)/2,easeInExpo:t=>0===t?0:Math.pow(2,10*t-10),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>0===t?0:1===t?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2,easeInCirc:t=>1-Math.sqrt(1-Math.pow(t,2)),easeOutCirc:t=>Math.sqrt(1-Math.pow(t-1,2)),easeInOutCirc:t=>t<.5?(1-Math.sqrt(1-Math.pow(2*t,2)))/2:(Math.sqrt(1-Math.pow(-2*t+2,2))+1)/2,easeInBack:t=>2.70158*t*t*t-w*t*t,easeOutBack:t=>1+2.70158*Math.pow(t-1,3)+w*Math.pow(t-1,2),easeInOutBack:t=>t<.5?Math.pow(2*t,2)*(7.189819*t-_)/2:(Math.pow(2*t-2,2)*((_+1)*(2*t-2)+_)+2)/2,easeInElastic:t=>0===t?0:1===t?1:-Math.pow(2,10*t-10)*Math.sin((10*t-10.75)*x),easeOutElastic:t=>0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin((10*t-.75)*x)+1,easeInOutElastic:t=>0===t?0:1===t?1:t<.5?-Math.pow(2,20*t-10)*Math.sin((20*t-11.125)*k)/2:Math.pow(2,-20*t+10)*Math.sin((20*t-11.125)*k)/2+1,easeInBounce:t=>1-S(1-t),easeOutBounce:S,easeInOutBounce:t=>t<.5?(1-S(1-2*t))/2:(1+S(2*t-1))/2},P=i({},j.default,{mass:1,damping:1,easing:E.linear,clamp:!1});class M{constructor(){this.tension=void 0,this.friction=void 0,this.frequency=void 0,this.damping=void 0,this.mass=void 0,this.velocity=0,this.restVelocity=void 0,this.precision=void 0,this.progress=void 0,this.duration=void 0,this.easing=void 0,this.clamp=void 0,this.bounce=void 0,this.decay=void 0,this.round=void 0,Object.assign(this,P)}}function A(t,e){if(r.s.und(e.decay)){const n=!r.s.und(e.tension)||!r.s.und(e.friction);!n&&r.s.und(e.frequency)&&r.s.und(e.damping)&&r.s.und(e.mass)||(t.duration=void 0,t.decay=void 0),n&&(t.frequency=void 0)}else t.duration=void 0}const I=[];class C{constructor(){this.changed=!1,this.values=I,this.toValues=null,this.fromValues=I,this.to=void 0,this.from=void 0,this.config=new M,this.immediate=!1}}function R(t,{key:e,props:n,defaultProps:s,state:o,actions:u}){return new Promise((l,d)=>{var f;let p,h,m=c(null!=(f=n.cancel)?f:null==s?void 0:s.cancel,e);if(m)y();else{r.s.und(n.pause)||(o.paused=c(n.pause,e));let t=null==s?void 0:s.pause;!0!==t&&(t=o.paused||c(t,e)),p=a(n.delay||0,e),t?(o.resumeQueue.add(g),u.pause()):(u.resume(),g())}function b(){o.resumeQueue.add(g),o.timeouts.delete(h),h.cancel(),p=h.time-r.w.now()}function g(){p>0&&!r.b.skipAnimation?(o.delayed=!0,h=r.w.setTimeout(y,p),o.pauseQueue.add(b),o.timeouts.add(h)):y()}function y(){o.delayed&&(o.delayed=!1),o.pauseQueue.delete(b),o.timeouts.delete(h),t<=(o.cancelId||0)&&(m=!0);try{u.start(i({},n,{callId:t,cancel:m}),l)}catch(t){d(t)}}})}const T=(t,e)=>1==e.length?e[0]:e.some(t=>t.cancelled)?q(t.get()):e.every(t=>t.noop)?N(t.get()):V(t.get(),e.every(t=>t.finished)),N=t=>({value:t,noop:!0,finished:!0,cancelled:!1}),V=(t,e,n=!1)=>({value:t,finished:e,cancelled:n}),q=t=>({value:t,cancelled:!0,finished:!1});function D(t,e,n,s){const{callId:o,parentId:a,onRest:c}=e,{asyncTo:u,promise:l}=n;return a||t!==u||e.reset?n.promise=(async()=>{n.asyncId=o,n.asyncTo=t;const d=f(e,(t,e)=>"onRest"===e?void 0:t);let p,h;const m=new Promise((t,e)=>(p=t,h=e)),b=t=>{const e=o<=(n.cancelId||0)&&q(s)||o!==n.asyncId&&V(s,!1);if(e)throw t.result=e,h(t),t},g=(t,e)=>{const a=new L,c=new F;return(async()=>{if(r.b.skipAnimation)throw z(n),c.result=V(s,!1),h(c),c;b(a);const u=r.s.obj(t)?i({},t):i({},e,{to:t});u.parentId=o,Object(r.l)(d,(t,e)=>{r.s.und(u[e])&&(u[e]=t)});const l=await s.start(u);return b(a),n.paused&&await new Promise(t=>{n.resumeQueue.add(t)}),l})()};let y;if(r.b.skipAnimation)return z(n),V(s,!1);try{let e;e=r.s.arr(t)?(async t=>{for(const e of t)await g(e)})(t):Promise.resolve(t(g,s.stop.bind(s))),await Promise.all([e.then(p),m]),y=V(s.get(),!0,!1)}catch(t){if(t instanceof L)y=t.result;else{if(!(t instanceof F))throw t;y=t.result}}finally{o==n.asyncId&&(n.asyncId=a,n.asyncTo=a?u:void 0,n.promise=a?l:void 0)}return r.s.fun(c)&&r.w.batchedUpdates(()=>{c(y,s,s.item)}),y})():l}function z(t,e){Object(r.m)(t.timeouts,t=>t.cancel()),t.pauseQueue.clear(),t.resumeQueue.clear(),t.asyncId=t.asyncTo=t.promise=void 0,e&&(t.cancelId=e)}class L extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise."),this.result=void 0}}class F extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const U=t=>t instanceof Q;let $=1;class Q extends r.a{constructor(...t){super(...t),this.id=$++,this.key=void 0,this._priority=0}get priority(){return this._priority}set priority(t){this._priority!=t&&(this._priority=t,this._onPriorityChange(t))}get(){const t=Object(o.e)(this);return t&&t.getValue()}to(...t){return r.b.to(this,t)}interpolate(...t){return Object(r.j)(),r.b.to(this,t)}toJSON(){return this.get()}observerAdded(t){1==t&&this._attach()}observerRemoved(t){0==t&&this._detach()}_attach(){}_detach(){}_onChange(t,e=!1){Object(r.d)(this,{type:"change",parent:this,value:t,idle:e})}_onPriorityChange(t){this.idle||r.o.sort(this),Object(r.d)(this,{type:"priority",parent:this,priority:t})}}const B=Symbol.for("SpringPhase"),G=t=>(1&t[B])>0,H=t=>(2&t[B])>0,W=t=>(4&t[B])>0,Z=(t,e)=>e?t[B]|=3:t[B]&=-3,Y=(t,e)=>e?t[B]|=4:t[B]&=-5;class J extends Q{constructor(t,e){if(super(),this.key=void 0,this.animation=new C,this.queue=void 0,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!r.s.und(t)||!r.s.und(e)){const n=r.s.obj(t)?i({},t):i({},e,{from:t});r.s.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(H(this)||this._state.asyncTo)||W(this)}get goal(){return Object(r.q)(this.animation.to)}get velocity(){const t=Object(o.e)(this);return t instanceof o.c?t.lastVelocity||0:t.getPayload().map(t=>t.lastVelocity||0)}get hasAnimated(){return G(this)}get isAnimating(){return H(this)}get isPaused(){return W(this)}get isDelayed(){return this._state.delayed}advance(t){let e=!0,n=!1;const s=this.animation;let{config:i,toValues:a}=s;const c=Object(o.g)(s.to);!c&&Object(r.r)(s.to)&&(a=Object(r.y)(Object(r.q)(s.to))),s.values.forEach((u,l)=>{if(u.done)return;const d=u.constructor==o.b?1:c?c[l].lastPosition:a[l];let f=s.immediate,p=d;if(!f){if(p=u.lastPosition,i.tension<=0)return void(u.done=!0);let e=u.elapsedTime+=t;const n=s.fromValues[l],o=null!=u.v0?u.v0:u.v0=r.s.arr(i.velocity)?i.velocity[l]:i.velocity;let a;if(r.s.und(i.duration))if(i.decay){const t=!0===i.decay?.998:i.decay,r=Math.exp(-(1-t)*e);p=n+o/(1-t)*(1-r),f=Math.abs(u.lastPosition-p)<.1,a=o*r}else{a=null==u.lastVelocity?o:u.lastVelocity;const e=i.precision||(n==d?.005:Math.min(1,.001*Math.abs(d-n))),s=i.restVelocity||e/10,c=i.clamp?0:i.bounce,l=!r.s.und(c),h=n==d?u.v0>0:ns,m||(f=Math.abs(d-p)<=e,!f));++t)l&&(b=p==d||p>d==h,b&&(a=-a*c,p=d)),a+=(1e-6*-i.tension*(p-d)+.001*-i.friction*a)/i.mass*g,p+=a*g}else{let r=1;i.duration>0&&(this._memoizedDuration!==i.duration&&(this._memoizedDuration=i.duration,u.durationProgress>0&&(u.elapsedTime=i.duration*u.durationProgress,e=u.elapsedTime+=t)),r=(i.progress||0)+e/this._memoizedDuration,r=r>1?1:r<0?0:r,u.durationProgress=r),p=n+i.easing(r)*(d-n),a=(p-u.lastPosition)/t,f=1==r}u.lastVelocity=a,Number.isNaN(p)&&(console.warn("Got NaN while animating:",this),f=!0)}c&&!c[l].done&&(f=!1),f?u.done=!0:e=!1,u.setValue(p,i.round)&&(n=!0)});const u=Object(o.e)(this),l=u.getValue();if(e){const t=Object(r.q)(s.to);l===t&&!n||i.decay?n&&i.decay&&this._onChange(l):(u.setValue(t),this._onChange(t)),this._stop()}else n&&this._onChange(l)}set(t){return r.w.batchedUpdates(()=>{this._stop(),this._focus(t),this._set(t)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(H(this)){const{to:t,config:e}=this.animation;r.w.batchedUpdates(()=>{this._onStart(),e.decay||this._set(t,!1),this._stop()})}return this}update(t){return(this.queue||(this.queue=[])).push(t),this}start(t,e){let n;return r.s.und(t)?(n=this.queue||[],this.queue=[]):n=[r.s.obj(t)?t:i({},e,{to:t})],Promise.all(n.map(t=>this._update(t))).then(t=>T(this,t))}stop(t){const{to:e}=this.animation;return this._focus(this.get()),z(this._state,t&&this._lastCallId),r.w.batchedUpdates(()=>this._stop(e,t)),this}reset(){this._update({reset:!0})}eventObserved(t){"change"==t.type?this._start():"priority"==t.type&&(this.priority=t.priority+1)}_prepareNode(t){const e=this.key||"";let{to:n,from:s}=t;n=r.s.obj(n)?n[e]:n,(null==n||y(n))&&(n=void 0),s=r.s.obj(s)?s[e]:s,null==s&&(s=void 0);const i={to:n,from:s};return G(this)||(t.reverse&&([n,s]=[s,n]),s=Object(r.q)(s),r.s.und(s)?Object(o.e)(this)||this._set(n):this._set(s)),i}_update(t,e){let n=i({},t);const{key:s,defaultProps:o}=this;n.default&&Object.assign(o,f(n,(t,e)=>/^on/.test(e)?u(t,s):t)),st(this,n,"onProps"),ot(this,"onProps",n,this);const a=this._prepareNode(n);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const c=this._state;return R(++this._lastCallId,{key:s,props:n,defaultProps:o,state:c,actions:{pause:()=>{W(this)||(Y(this,!0),Object(r.n)(c.pauseQueue),ot(this,"onPause",V(this,K(this,this.animation.to)),this))},resume:()=>{W(this)&&(Y(this,!1),H(this)&&this._resume(),Object(r.n)(c.resumeQueue),ot(this,"onResume",V(this,K(this,this.animation.to)),this))},start:this._merge.bind(this,a)}}).then(t=>{if(n.loop&&t.finished&&(!e||!t.noop)){const t=X(n);if(t)return this._update(t,!0)}return t})}_merge(t,e,n){if(e.cancel)return this.stop(!0),n(q(this));const s=!r.s.und(t.to),u=!r.s.und(t.from);if(s||u){if(!(e.callId>this._lastToId))return n(q(this));this._lastToId=e.callId}const{key:l,defaultProps:d,animation:f}=this,{to:p,from:h}=f;let{to:m=p,from:g=h}=t;!u||s||e.default&&!r.s.und(m)||(m=g),e.reverse&&([m,g]=[g,m]);const O=!Object(r.u)(g,h);O&&(f.from=g),g=Object(r.q)(g);const v=!Object(r.u)(m,p);v&&this._focus(m);const j=y(e.to),{config:w}=f,{decay:_,velocity:x}=w;(s||u)&&(w.velocity=0),e.config&&!j&&function(t,e,n){n&&(A(n=i({},n),e),e=i({},n,e)),A(t,e),Object.assign(t,e);for(const e in P)null==t[e]&&(t[e]=P[e]);let{mass:s,frequency:o,damping:a}=t;r.s.und(o)||(o<.01&&(o=.01),a<0&&(a=0),t.tension=Math.pow(2*Math.PI/o,2)*s,t.friction=4*Math.PI*a*s/o)}(w,a(e.config,l),e.config!==d.config?a(d.config,l):void 0);let k=Object(o.e)(this);if(!k||r.s.und(m))return n(V(this,!0));const S=r.s.und(e.reset)?u&&!e.default:!r.s.und(g)&&c(e.reset,l),E=S?g:this.get(),M=b(m),I=r.s.num(M)||r.s.arr(M)||Object(r.t)(M),C=!j&&(!I||c(d.immediate||e.immediate,l));if(v){const t=Object(o.f)(m);if(t!==k.constructor){if(!C)throw Error(`Cannot animate between ${k.constructor.name} and ${t.name}, as the "to" prop suggests`);k=this._set(M)}}const R=k.constructor;let T=Object(r.r)(m),z=!1;if(!T){const t=S||!G(this)&&O;(v||t)&&(z=Object(r.u)(b(E),M),T=!z),(Object(r.u)(f.immediate,C)||C)&&Object(r.u)(w.decay,_)&&Object(r.u)(w.velocity,x)||(T=!0)}if(z&&H(this)&&(f.changed&&!S?T=!0:T||this._stop(p)),!j&&((T||Object(r.r)(p))&&(f.values=k.getPayload(),f.toValues=Object(r.r)(m)?null:R==o.b?[1]:Object(r.y)(M)),f.immediate!=C&&(f.immediate=C,C||S||this._set(p)),T)){const{onRest:t}=f;Object(r.k)(rt,t=>st(this,e,t));const s=V(this,K(this,p));Object(r.n)(this._pendingCalls,s),this._pendingCalls.add(n),f.changed&&r.w.batchedUpdates(()=>{f.changed=!S,null==t||t(s,this),S?a(d.onRest,s):null==f.onStart||f.onStart(s,this)})}S&&this._set(E),j?n(D(e.to,e,this._state,this)):T?this._start():H(this)&&!v?this._pendingCalls.add(n):n(N(E))}_focus(t){const e=this.animation;t!==e.to&&(Object(r.p)(this)&&this._detach(),e.to=t,Object(r.p)(this)&&this._attach())}_attach(){let t=0;const{to:e}=this.animation;Object(r.r)(e)&&(Object(r.c)(e,this),U(e)&&(t=e.priority+1)),this.priority=t}_detach(){const{to:t}=this.animation;Object(r.r)(t)&&Object(r.x)(t,this)}_set(t,e=!0){const n=Object(r.q)(t);if(!r.s.und(n)){const t=Object(o.e)(this);if(!t||!Object(r.u)(n,t.getValue())){const s=Object(o.f)(n);t&&t.constructor==s?t.setValue(n):Object(o.h)(this,s.create(n)),t&&r.w.batchedUpdates(()=>{this._onChange(n,e)})}}return Object(o.e)(this)}_onStart(){const t=this.animation;t.changed||(t.changed=!0,ot(this,"onStart",V(this,K(this,t.to)),this))}_onChange(t,e){e||(this._onStart(),a(this.animation.onChange,t,this)),a(this.defaultProps.onChange,t,this),super._onChange(t,e)}_start(){const t=this.animation;Object(o.e)(this).reset(Object(r.q)(t.to)),t.immediate||(t.fromValues=t.values.map(t=>t.lastPosition)),H(this)||(Z(this,!0),W(this)||this._resume())}_resume(){r.b.skipAnimation?this.finish():r.o.start(this)}_stop(t,e){if(H(this)){Z(this,!1);const n=this.animation;Object(r.k)(n.values,t=>{t.done=!0}),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Object(r.d)(this,{type:"idle",parent:this});const s=e?q(this.get()):V(this.get(),K(this,null!=t?t:n.to));Object(r.n)(this._pendingCalls,s),n.changed&&(n.changed=!1,ot(this,"onRest",s,this))}}}function K(t,e){const n=b(e),s=b(t.get());return Object(r.u)(s,n)}function X(t,e=t.loop,n=t.to){let r=a(e);if(r){const s=!0!==r&&m(r),o=(s||t).reverse,a=!s||s.reset;return tt(i({},t,{loop:e,default:!1,pause:void 0,to:!o||y(n)?n:void 0,from:a?t.from:void 0,reset:a},s))}}function tt(t){const{to:e,from:n}=t=m(t),s=new Set;return r.s.obj(e)&&nt(e,s),r.s.obj(n)&&nt(n,s),t.keys=s.size?Array.from(s):null,t}function et(t){const e=tt(t);return r.s.und(e.default)&&(e.default=f(e)),e}function nt(t,e){Object(r.l)(t,(t,n)=>null!=t&&e.add(n))}const rt=["onStart","onRest","onChange","onPause","onResume"];function st(t,e,n){t.animation[n]=e[n]!==l(e,n)?u(e[n],t.key):void 0}function ot(t,e,...n){var r,s,o,i;null==(r=(s=t.animation)[e])||r.call(s,...n),null==(o=(i=t.defaultProps)[e])||o.call(i,...n)}const it=["onStart","onChange","onRest"];let at=1;class ct{constructor(t,e){this.id=at++,this.springs={},this.queue=[],this.ref=void 0,this._flush=void 0,this._initialProps=void 0,this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._item=void 0,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),e&&(this._flush=e),t&&this.start(i({default:!0},t))}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(t=>t.idle&&!t.isDelayed&&!t.isPaused)}get item(){return this._item}set item(t){this._item=t}get(){const t={};return this.each((e,n)=>t[n]=e.get()),t}set(t){for(const e in t){const n=t[e];r.s.und(n)||this.springs[e].set(n)}}update(t){return t&&this.queue.push(tt(t)),this}start(t){let{queue:e}=this;return t?e=Object(r.y)(t).map(tt):this.queue=[],this._flush?this._flush(this,e):(ht(this,e),ut(this,e))}stop(t,e){if(t!==!!t&&(e=t),e){const n=this.springs;Object(r.k)(Object(r.y)(e),e=>n[e].stop(!!t))}else z(this._state,this._lastAsyncId),this.each(e=>e.stop(!!t));return this}pause(t){if(r.s.und(t))this.start({pause:!0});else{const e=this.springs;Object(r.k)(Object(r.y)(t),t=>e[t].pause())}return this}resume(t){if(r.s.und(t))this.start({pause:!1});else{const e=this.springs;Object(r.k)(Object(r.y)(t),t=>e[t].resume())}return this}each(t){Object(r.l)(this.springs,t)}_onFrame(){const{onStart:t,onChange:e,onRest:n}=this._events,s=this._active.size>0,o=this._changed.size>0;(s&&!this._started||o&&!this._started)&&(this._started=!0,Object(r.m)(t,([t,e])=>{e.value=this.get(),t(e,this,this._item)}));const i=!s&&this._started,a=o||i&&n.size?this.get():null;o&&e.size&&Object(r.m)(e,([t,e])=>{e.value=a,t(e,this,this._item)}),i&&(this._started=!1,Object(r.m)(n,([t,e])=>{e.value=a,t(e,this,this._item)}))}eventObserved(t){if("change"==t.type)this._changed.add(t.parent),t.idle||this._active.add(t.parent);else{if("idle"!=t.type)return;this._active.delete(t.parent)}r.w.onFrame(this._onFrame)}}function ut(t,e){return Promise.all(e.map(e=>async function t(e,n,s){const{keys:o,to:i,from:a,loop:c,onRest:u,onResolve:d}=n,f=r.s.obj(n.default)&&n.default;c&&(n.loop=!1),!1===i&&(n.to=null),!1===a&&(n.from=null);const p=r.s.arr(i)||r.s.fun(i)?i:void 0;p?(n.to=void 0,n.onRest=void 0,f&&(f.onRest=void 0)):Object(r.k)(it,t=>{const s=n[t];if(r.s.fun(s)){const r=e._events[t];n[t]=({finished:t,cancelled:e})=>{const n=r.get(s);n?(t||(n.finished=!1),e&&(n.cancelled=!0)):r.set(s,{value:null,finished:t||!1,cancelled:e||!1})},f&&(f[t]=n[t])}});const h=e._state;n.pause===!h.paused?(h.paused=n.pause,Object(r.n)(n.pause?h.pauseQueue:h.resumeQueue)):h.paused&&(n.pause=!0);const m=(o||Object.keys(e.springs)).map(t=>e.springs[t].start(n)),b=!0===n.cancel||!0===l(n,"cancel");(p||b&&h.asyncId)&&m.push(R(++e._lastAsyncId,{props:n,state:h,actions:{pause:r.v,resume:r.v,start(t,n){b?(z(h,e._lastAsyncId),n(q(e))):(t.onRest=u,n(D(p,t,h,e)))}}})),h.paused&&await new Promise(t=>{h.resumeQueue.add(t)});const g=T(e,await Promise.all(m));if(c&&g.finished&&(!s||!g.noop)){const r=X(n,c,i);if(r)return ht(e,[r]),t(e,r,!0)}return d&&r.w.batchedUpdates(()=>d(g,e,e.item)),g}(t,e))).then(e=>T(t,e))}function lt(t,e){const n=i({},t.springs);return e&&Object(r.k)(Object(r.y)(e),t=>{r.s.und(t.keys)&&(t=tt(t)),r.s.obj(t.to)||(t=i({},t,{to:void 0})),pt(n,t,t=>ft(t))}),dt(t,n),n}function dt(t,e){Object(r.l)(e,(e,n)=>{t.springs[n]||(t.springs[n]=e,Object(r.c)(e,t))})}function ft(t,e){const n=new J;return n.key=t,e&&Object(r.c)(n,e),n}function pt(t,e,n){e.keys&&Object(r.k)(e.keys,r=>{(t[r]||(t[r]=n(r)))._prepareNode(e)})}function ht(t,e){Object(r.k)(e,e=>{pt(t.springs,e,e=>ft(e,t))})}const mt=["children"],bt=t=>{let{children:e}=t,n=function(t,e){if(null==t)return{};var n,r,s={},o=Object.keys(t);for(r=0;r=0||(s[n]=t[n]);return s}(t,mt);const o=Object(s.useContext)(gt),i=n.pause||!!o.pause,a=n.immediate||!!o.immediate;n=Object(r.B)(()=>({pause:i,immediate:a}),[i,a]);const{Provider:c}=gt;return s.createElement(c,{value:n},e)},gt=(yt=bt,Ot={},Object.assign(yt,s.createContext(Ot)),yt.Provider._context=yt,yt.Consumer._context=yt,yt);var yt,Ot;bt.Provider=gt.Provider,bt.Consumer=gt.Consumer;const vt=()=>{const t=[],e=function(e){Object(r.i)();const s=[];return Object(r.k)(t,(t,o)=>{if(r.s.und(e))s.push(t.start());else{const r=n(e,t,o);r&&s.push(t.start(r))}}),s};e.current=t,e.add=function(e){t.includes(e)||t.push(e)},e.delete=function(e){const n=t.indexOf(e);~n&&t.splice(n,1)},e.pause=function(){return Object(r.k)(t,t=>t.pause(...arguments)),this},e.resume=function(){return Object(r.k)(t,t=>t.resume(...arguments)),this},e.set=function(e){Object(r.k)(t,t=>t.set(e))},e.start=function(e){const n=[];return Object(r.k)(t,(t,s)=>{if(r.s.und(e))n.push(t.start());else{const r=this._getProps(e,t,s);r&&n.push(t.start(r))}}),n},e.stop=function(){return Object(r.k)(t,t=>t.stop(...arguments)),this},e.update=function(e){return Object(r.k)(t,(t,n)=>t.update(this._getProps(e,t,n))),this};const n=function(t,e,n){return r.s.fun(t)?t(n,e):t};return e._getProps=n,e};function jt(t,e,n){const o=r.s.fun(e)&&e;o&&!n&&(n=[]);const a=Object(s.useMemo)(()=>o||3==arguments.length?vt():void 0,[]),c=Object(s.useRef)(0),u=Object(r.z)(),l=Object(s.useMemo)(()=>({ctrls:[],queue:[],flush(t,e){const n=lt(t,e);return c.current>0&&!l.queue.length&&!Object.keys(n).some(e=>!t.springs[e])?ut(t,e):new Promise(r=>{dt(t,n),l.queue.push(()=>{r(ut(t,e))}),u()})}}),[]),d=Object(s.useRef)([...l.ctrls]),f=[],p=Object(r.D)(t)||0;function h(t,n){for(let r=t;r{Object(r.k)(d.current.slice(t,p),t=>{O(t,a),t.stop(!0)}),d.current.length=t,h(p,t)},[t]),Object(s.useMemo)(()=>{h(0,Math.min(p,t))},n);const m=d.current.map((t,e)=>lt(t,f[e])),b=Object(s.useContext)(bt),y=Object(r.D)(b),j=b!==y&&g(b);Object(r.A)(()=>{c.current++,l.ctrls=d.current;const{queue:t}=l;t.length&&(l.queue=[],Object(r.k)(t,t=>t())),Object(r.k)(d.current,(t,e)=>{null==a||a.add(t),j&&t.start({default:b});const n=f[e];n&&(v(t,n.ref),t.ref?t.queue.push(n):t.start(n))})}),Object(r.C)(()=>()=>{Object(r.k)(l.ctrls,t=>t.stop(!0))});const w=m.map(t=>i({},t));return a?[w,a]:w}function wt(t,e){const n=r.s.fun(t),[[s],o]=jt(1,n?t:[t],n?e||[]:e);return n||2==arguments.length?[s,o]:s}let _t;function xt(t,e,n){const o=r.s.fun(e)&&e,{reset:c,sort:u,trail:l=0,expires:d=!0,exitBeforeEnter:p=!1,onDestroyed:h,ref:b,config:y}=o?o():e,j=Object(s.useMemo)(()=>o||3==arguments.length?vt():void 0,[]),w=Object(r.y)(t),_=[],x=Object(s.useRef)(null),k=c?null:x.current;Object(r.A)(()=>{x.current=_}),Object(r.C)(()=>(Object(r.k)(x.current,t=>{var e;null==(e=t.ctrl.ref)||e.add(t.ctrl);const n=C.get(t);n&&t.ctrl.start(n.payload)}),()=>{Object(r.k)(x.current,t=>{t.expired&&clearTimeout(t.expirationId),O(t.ctrl,j),t.ctrl.stop(!0)})}));const S=St(w,o?o():e,k),E=c&&x.current||[];Object(r.A)(()=>Object(r.k)(E,({ctrl:t,item:e,key:n})=>{O(t,j),a(h,e,n)}));const P=[];if(k&&Object(r.k)(k,(t,e)=>{t.expired?(clearTimeout(t.expirationId),E.push(t)):~(e=P[e]=S.indexOf(t.key))&&(_[e]=t)}),Object(r.k)(w,(t,e)=>{_[e]||(_[e]={key:S[e],item:t,phase:_t.MOUNT,ctrl:new ct},_[e].ctrl.item=t)}),P.length){let t=-1;const{leave:n}=o?o():e;Object(r.k)(P,(e,r)=>{const s=k[r];~e?(t=_.indexOf(s),_[t]=i({},s,{item:w[e]})):n&&_.splice(++t,0,s)})}r.s.fun(u)&&_.sort((t,e)=>u(t.item,e.item));let M=-l;const A=Object(r.z)(),I=f(e),C=new Map,R=Object(s.useRef)(new Map),T=Object(s.useRef)(!1);Object(r.k)(_,(t,n)=>{const s=t.key,c=t.phase,u=o?o():e;let f,h,g=a(u.delay||0,s);if(c==_t.MOUNT)f=u.enter,h=_t.ENTER;else{const t=S.indexOf(s)<0;if(c!=_t.LEAVE)if(t)f=u.leave,h=_t.LEAVE;else{if(!(f=u.update))return;h=_t.UPDATE}else{if(t)return;f=u.enter,h=_t.ENTER}}if(f=a(f,t.item,n),f=r.s.obj(f)?m(f):{to:f},!f.config){const e=y||I.config;f.config=a(e,t.item,n,h)}M+=l;const O=i({},I,{delay:g+M,ref:b,immediate:u.immediate,reset:!1},f);if(h==_t.ENTER&&r.s.und(O.from)){const s=o?o():e,i=r.s.und(s.initial)||k?s.from:s.initial;O.from=a(i,t.item,n)}const{onResolve:v}=O;O.onResolve=t=>{a(v,t);const e=x.current,n=e.find(t=>t.key===s);if(n&&(!t.cancelled||n.phase==_t.UPDATE)&&n.ctrl.idle){const t=e.every(t=>t.ctrl.idle);if(n.phase==_t.LEAVE){const e=a(d,n.item);if(!1!==e){const r=!0===e?0:e;if(n.expired=!0,!t&&r>0)return void(r<=2147483647&&(n.expirationId=setTimeout(A,r)))}}t&&e.some(t=>t.expired)&&(R.current.delete(n),p&&(T.current=!0),A())}};const j=lt(t.ctrl,O);h===_t.LEAVE&&p?R.current.set(t,{phase:h,springs:j,payload:O}):C.set(t,{phase:h,springs:j,payload:O})});const N=Object(s.useContext)(bt),V=Object(r.D)(N),q=N!==V&&g(N);Object(r.A)(()=>{q&&Object(r.k)(_,t=>{t.ctrl.start({default:N})})},[N]),Object(r.k)(C,(t,e)=>{if(R.current.size){const t=_.findIndex(t=>t.key===e.key);_.splice(t,1)}}),Object(r.A)(()=>{Object(r.k)(R.current.size?R.current:C,({phase:t,payload:e},n)=>{const{ctrl:r}=n;n.phase=t,null==j||j.add(r),q&&t==_t.ENTER&&r.start({default:N}),e&&(v(r,e.ref),r.ref&&!T.current?r.update(e):(r.start(e),T.current&&(T.current=!1)))})},c?void 0:n);const D=t=>s.createElement(s.Fragment,null,_.map((e,n)=>{const{springs:o}=C.get(e)||e.ctrl,a=t(i({},o),e.item,e,n);return a&&a.type?s.createElement(a.type,i({},a.props,{key:r.s.str(e.key)||r.s.num(e.key)?e.key:e.ctrl.id,ref:a.ref})):a}));return j?[D,j]:D}!function(t){t.MOUNT="mount",t.ENTER="enter",t.UPDATE="update",t.LEAVE="leave"}(_t||(_t={}));let kt=1;function St(t,{key:e,keys:n=e},s){if(null===n){const e=new Set;return t.map(t=>{const n=s&&s.find(n=>n.item===t&&n.phase!==_t.LEAVE&&!e.has(n));return n?(e.add(n),n.key):kt++})}return r.s.und(n)?t:r.s.fun(n)?t.map(n):Object(r.y)(n)}class Et extends Q{constructor(t,e){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=t,this.calc=Object(r.f)(...e);const n=this._get(),s=Object(o.f)(n);Object(o.h)(this,s.create(n))}advance(t){const e=this._get(),n=this.get();Object(r.u)(e,n)||(Object(o.e)(this).setValue(e),this._onChange(e,this.idle)),!this.idle&&Mt(this._active)&&At(this)}_get(){const t=r.s.arr(this.source)?this.source.map(r.q):Object(r.y)(Object(r.q)(this.source));return this.calc(...t)}_start(){this.idle&&!Mt(this._active)&&(this.idle=!1,Object(r.k)(Object(o.g)(this),t=>{t.done=!1}),r.b.skipAnimation?(r.w.batchedUpdates(()=>this.advance()),At(this)):r.o.start(this))}_attach(){let t=1;Object(r.k)(Object(r.y)(this.source),e=>{Object(r.r)(e)&&Object(r.c)(e,this),U(e)&&(e.idle||this._active.add(e),t=Math.max(t,e.priority+1))}),this.priority=t,this._start()}_detach(){Object(r.k)(Object(r.y)(this.source),t=>{Object(r.r)(t)&&Object(r.x)(t,this)}),this._active.clear(),At(this)}eventObserved(t){"change"==t.type?t.idle?this.advance():(this._active.add(t.parent),this._start()):"idle"==t.type?this._active.delete(t.parent):"priority"==t.type&&(this.priority=Object(r.y)(this.source).reduce((t,e)=>Math.max(t,(U(e)?e.priority:0)+1),0))}}function Pt(t){return!1!==t.idle}function Mt(t){return!t.size||Array.from(t).every(Pt)}function At(t){t.idle||(t.idle=!0,Object(r.k)(Object(o.g)(t),t=>{t.done=!0}),Object(r.d)(t,{type:"idle",parent:t}))}r.b.assign({createStringInterpolator:r.g,to:(t,e)=>new Et(t,e)}),r.o.advance},,function(t,e){t.exports=window.regeneratorRuntime},,,function(t,e,n){"use strict";n.d(e,"animated",(function(){return _}));var r=n(43);n.o(r,"config")&&n.d(e,"config",(function(){return r.config})),n.o(r,"useSpring")&&n.d(e,"useSpring",(function(){return r.useSpring})),n.o(r,"useTransition")&&n.d(e,"useTransition",(function(){return r.useTransition}));var s=n(55),o=n(1),i=n(19);function a(t,e){if(null==t)return{};var n,r,s={},o=Object.keys(t);for(r=0;r=0||(s[n]=t[n]);return s}const c=["style","children","scrollTop","scrollLeft"],u=/^--/;function l(t,e){return null==e||"boolean"==typeof e||""===e?"":"number"!=typeof e||0===e||u.test(t)||f.hasOwnProperty(t)&&f[t]?(""+e).trim():e+"px"}const d={};let f={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};const p=["Webkit","Ms","Moz","O"];f=Object.keys(f).reduce((t,e)=>(p.forEach(n=>t[((t,e)=>t+e.charAt(0).toUpperCase()+e.substring(1))(n,e)]=t[e]),t),f);const h=["x","y","z"],m=/^(matrix|translate|scale|rotate|skew)/,b=/^(translate)/,g=/^(rotate|skew)/,y=(t,e)=>o.s.num(t)&&0!==t?t+e:t,O=(t,e)=>o.s.arr(t)?t.every(t=>O(t,e)):o.s.num(t)?t===e:parseFloat(t)===e;class v extends i.a{constructor(t){let{x:e,y:n,z:r}=t,s=a(t,h);const i=[],c=[];(e||n||r)&&(i.push([e||0,n||0,r||0]),c.push(t=>[`translate3d(${t.map(t=>y(t,"px")).join(",")})`,O(t,0)])),Object(o.l)(s,(t,e)=>{if("transform"===e)i.push([t||""]),c.push(t=>[t,""===t]);else if(m.test(e)){if(delete s[e],o.s.und(t))return;const n=b.test(e)?"px":g.test(e)?"deg":"";i.push(Object(o.y)(t)),c.push("rotate3d"===e?([t,e,r,s])=>[`rotate3d(${t},${e},${r},${y(s,n)})`,O(s,0)]:t=>[`${e}(${t.map(t=>y(t,n)).join(",")})`,O(t,e.startsWith("scale")?1:0)])}}),i.length&&(s.transform=new j(i,c)),super(s)}}class j extends o.a{constructor(t,e){super(),this._value=null,this.inputs=t,this.transforms=e}get(){return this._value||(this._value=this._get())}_get(){let t="",e=!0;return Object(o.k)(this.inputs,(n,r)=>{const s=Object(o.q)(n[0]),[i,a]=this.transforms[r](o.s.arr(s)?s:n.map(o.q));t+=" "+i,e=e&&a}),e?"none":t}observerAdded(t){1==t&&Object(o.k)(this.inputs,t=>Object(o.k)(t,t=>Object(o.r)(t)&&Object(o.c)(t,this)))}observerRemoved(t){0==t&&Object(o.k)(this.inputs,t=>Object(o.k)(t,t=>Object(o.r)(t)&&Object(o.x)(t,this)))}eventObserved(t){"change"==t.type&&(this._value=null),Object(o.d)(this,t)}}const w=["scrollTop","scrollLeft"];r.Globals.assign({batchedUpdates:s.unstable_batchedUpdates,createStringInterpolator:o.g,colors:o.e});const _=Object(i.d)(["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"],{applyAnimatedValues:function(t,e){if(!t.nodeType||!t.setAttribute)return!1;const n="filter"===t.nodeName||t.parentNode&&"filter"===t.parentNode.nodeName,r=e,{style:s,children:o,scrollTop:i,scrollLeft:f}=r,p=a(r,c),h=Object.values(p),m=Object.keys(p).map(e=>n||t.hasAttribute(e)?e:d[e]||(d[e]=e.replace(/([A-Z])/g,t=>"-"+t.toLowerCase())));void 0!==o&&(t.textContent=o);for(let e in s)if(s.hasOwnProperty(e)){const n=l(e,s[e]);u.test(e)?t.style.setProperty(e,n):t.style[e]=n}m.forEach((e,n)=>{t.setAttribute(e,h[n])}),void 0!==i&&(t.scrollTop=i),void 0!==f&&(t.scrollLeft=f)},createAnimatedStyle:t=>new v(t),getComponentProps:t=>a(t,w)}).animated},function(t,e){},function(t,e){},,,,,function(t,e){t.exports=window.ReactDOM},function(t,e){t.exports=window.moment},function(t,e){t.exports=window.wp.autop},function(t,e){function n(t,e,n,r,s,o,i){try{var a=t[o](i),c=a.value}catch(t){return void n(t)}a.done?e(c):Promise.resolve(c).then(r,s)}t.exports=function(t){return function(){var e=this,r=arguments;return new Promise((function(s,o){var i=t.apply(e,r);function a(t){n(i,s,o,a,c,"next",t)}function c(t){n(i,s,o,a,c,"throw",t)}a(void 0)}))}},t.exports.__esModule=!0,t.exports.default=t.exports},,,,,,,,,,,function(t,e,n){"use strict";var r=n(0),s=n(9);const o=Object(r.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(s.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"}));e.a=o},,,,,,,,,,,,,function(t,e,n){"use strict";n.r(e);var r=n(6),s=n.n(r),o=n(0),i=n(25),a=n.n(i),c=n(41),u=n(10),l=n(11),d=n.n(l);function f(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}function p(t){for(var e=1;e0&&Object(o.createElement)(m.animated.span,{style:r,className:"simpay-branding-bar__actions-button-count","aria-label":Object(b.sprintf)(/* translators: %d Unread notification count. */ -Object(b.__)("%d unread notifications","stripe"),e)},Object(o.createElement)("span",null,e)),Object(o.createElement)("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(o.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.8333 2.5H4.16667C3.25 2.5 2.5 3.25 2.5 4.16667V15.8333c0 .9167.74167 1.6667 1.66667 1.6667H15.8333c.9167 0 1.6667-.75 1.6667-1.6667V4.16667C17.5 3.25 16.75 2.5 15.8333 2.5Zm0 13.3333H4.16667v-2.5h2.96666C7.70833 14.325 8.775 15 10.0083 15c1.2334 0 2.2917-.675 2.875-1.6667h2.95v2.5Zm-4.1583-4.1666h4.1583V4.16667H4.16667v7.50003h4.175c0 .9166.75 1.6666 1.66663 1.6666.9167 0 1.6667-.75 1.6667-1.6666Z",fill:"currentColor"})))},y=n(56),O=n.n(y),v=n(3),j=n(57),w="simpay-notifications-notification",_=simpayNotifications.isLite;function x(t){switch(t){case"warning":return"warning";case"error":return"dismiss";case"info":return"admin-generic";case"success":default:return"yes-alt"}}function k(t){return Object(u.getAuthority)(window.location.href)!==Object(u.getAuthority)(t)}function S(t,e,n){return!1===k(t)?t:Object(u.addQueryArgs)(t.replace(/\/?$/,"/"),{utm_source:"WordPress",utm_campaign:"1"===_?"lite-plugin":"pro-plugin",utm_medium:e,utm_content:n})}var E=function(t){var e=t.notification,n=t.onDismissNotification,r=e.id,s=e.title,i=e.content,a=e.type,c=e.start,u=e.actions,l=e.is_dismissible;return Object(o.createElement)("div",{className:w,style:{backgroundColor:l?"transparent":"#fafafa"}},Object(o.createElement)("div",{className:"".concat(w,"__icon ").concat(w,"__icon-").concat(a||"success")},Object(o.createElement)("span",{className:"dashicons dashicons-".concat(x(a))})),Object(o.createElement)("div",{className:"".concat(w,"__body")},Object(o.createElement)("div",{className:"".concat(w,"__header")},Object(o.createElement)("div",{className:"".concat(w,"__title")},s),l&&Object(o.createElement)("div",{className:"".concat(w,"__date")},O.a.unix(c).fromNow())),Object(o.createElement)("div",{className:"".concat(w,"__content"),dangerouslySetInnerHTML:{__html:Object(j.autop)(i)}}),Object(o.createElement)("div",{className:"".concat(w,"__actions")},u.map((function(t){var e=t.type,n=t.text,r=t.url;return Object(o.createElement)(v.Button,{key:n,href:S(r,"notification-inbox",s),isPrimary:"primary"===e,isSecondary:"secondary"===e,variant:e,target:k(r)?"_blank":"_self"},n)})),l&&Object(o.createElement)(v.Button,{isLink:!0,variant:"link",onClick:function(){return n(r)}},Object(b.__)("Dismiss","stripe")))))},P=n(58),M=n.n(P),A=n(45),I=n.n(A),C=n(13),R=n.n(C),T=n(12),N=n(20);function V(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nm(t,r);let o=O();s.write=t=>m(t,o);let i=O();s.onStart=t=>m(t,i);let a=O();s.onFrame=t=>m(t,a);let c=O();s.onFinish=t=>m(t,c);let u=[];s.setTimeout=(t,e)=>{let n=s.now()+e,r=()=>{let t=u.findIndex(t=>t.cancel==r);~t&&u.splice(t,1),p-=~t?1:0},o={time:n,handler:t,cancel:r};return u.splice(l(n),0,o),p+=1,b(),o};let l=t=>~(~u.findIndex(e=>e.time>t)||~u.length);s.cancel=t=>{i.delete(t),a.delete(t),r.delete(t),o.delete(t),c.delete(t)},s.sync=t=>{h=!0,s.batchedUpdates(t),h=!1},s.throttle=t=>{let e;function n(){try{t(...e)}finally{e=null}}function r(...t){e=t,s.onStart(n)}return r.handler=t,r.cancel=()=>{i.delete(n),e=null},r};let d="undefined"!=typeof window?window.requestAnimationFrame:()=>{};s.use=t=>d=t,s.now="undefined"!=typeof performance?()=>performance.now():Date.now,s.batchedUpdates=t=>t(),s.catch=console.error,s.frameLoop="always",s.advance=()=>{"demand"!==s.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):y()};let f=-1,p=0,h=!1;function m(t,e){h?(e.delete(t),t(0)):(e.add(t),b())}function b(){f<0&&(f=0,"demand"!==s.frameLoop&&d(g))}function g(){~f&&(d(g),s.batchedUpdates(y))}function y(){let t=f;f=s.now();let e=l(f);e&&(v(u.splice(0,e),t=>t.handler()),p-=e),i.flush(),r.flush(t?Math.min(64,f-t):16.667),a.flush(),o.flush(),c.flush(),p||(f=-1)}function O(){let t=new Set,e=t;return{add(n){p+=e!=t||t.has(n)?0:1,t.add(n)},delete:n=>(p-=e==t&&t.has(n)?1:0,t.delete(n)),flush(n){e.size&&(t=new Set,p-=e.size,v(e,e=>e(n)&&t.add(e)),p+=t.size,e=t)}}}function v(t,e){t.forEach(t=>{try{e(t)}catch(t){s.catch(t)}})}var j=n(5);function w(){}const _=(t,e,n)=>Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0}),x={arr:Array.isArray,obj:t=>!!t&&"Object"===t.constructor.name,fun:t=>"function"==typeof t,str:t=>"string"==typeof t,num:t=>"number"==typeof t,und:t=>void 0===t};function k(t,e){if(x.arr(t)){if(!x.arr(e)||t.length!==e.length)return!1;for(let n=0;nt.forEach(e);function E(t,e,n){if(x.arr(t))for(let r=0;rx.und(t)?[]:x.arr(t)?t:[t];function M(t,e){if(t.size){const n=Array.from(t);t.clear(),S(n,e)}}const A=(t,...e)=>M(t,t=>t(...e)),I=()=>"undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent);let C,R,T=null,N=!1,V=w;var q=Object.freeze({__proto__:null,get createStringInterpolator(){return C},get to(){return R},get colors(){return T},get skipAnimation(){return N},get willAdvance(){return V},assign:t=>{t.to&&(R=t.to),t.now&&(s.now=t.now),void 0!==t.colors&&(T=t.colors),null!=t.skipAnimation&&(N=t.skipAnimation),t.createStringInterpolator&&(C=t.createStringInterpolator),t.requestAnimationFrame&&s.use(t.requestAnimationFrame),t.batchedUpdates&&(s.batchedUpdates=t.batchedUpdates),t.willAdvance&&(V=t.willAdvance),t.frameLoop&&(s.frameLoop=t.frameLoop)}});const D=new Set;let z=[],L=[],F=0;const U={get idle(){return!D.size&&!z.length},start(t){F>t.priority?(D.add(t),s.onStart($)):(Q(t),s(G))},advance:G,sort(t){if(F)s.onFrame(()=>U.sort(t));else{const e=z.indexOf(t);~e&&(z.splice(e,1),B(t))}},clear(){z=[],D.clear()}};function $(){D.forEach(Q),D.clear(),s(G)}function Q(t){z.includes(t)||B(t)}function B(t){z.splice(function(e,n){const r=e.findIndex(e=>e.priority>t.priority);return r<0?e.length:r}(z),0,t)}function G(t){const e=L;for(let n=0;n0}const H={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},W="[-+]?\\d*\\.?\\d+";function Z(...t){return"\\(\\s*("+t.join(")\\s*,\\s*(")+")\\s*\\)"}const Y=new RegExp("rgb"+Z(W,W,W)),J=new RegExp("rgba"+Z(W,W,W,W)),K=new RegExp("hsl"+Z(W,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%")),X=new RegExp("hsla"+Z(W,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%",W)),tt=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,et=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,nt=/^#([0-9a-fA-F]{6})$/,rt=/^#([0-9a-fA-F]{8})$/;function st(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function ot(t,e,n){const r=n<.5?n*(1+e):n+e-n*e,s=2*n-r,o=st(s,r,t+1/3),i=st(s,r,t),a=st(s,r,t-1/3);return Math.round(255*o)<<24|Math.round(255*i)<<16|Math.round(255*a)<<8}function it(t){const e=parseInt(t,10);return e<0?0:e>255?255:e}function at(t){return(parseFloat(t)%360+360)%360/360}function ct(t){const e=parseFloat(t);return e<0?0:e>1?255:Math.round(255*e)}function ut(t){const e=parseFloat(t);return e<0?0:e>100?1:e/100}function lt(t){let e=function(t){let e;return"number"==typeof t?t>>>0===t&&t>=0&&t<=4294967295?t:null:(e=nt.exec(t))?parseInt(e[1]+"ff",16)>>>0:T&&void 0!==T[t]?T[t]:(e=Y.exec(t))?(it(e[1])<<24|it(e[2])<<16|it(e[3])<<8|255)>>>0:(e=J.exec(t))?(it(e[1])<<24|it(e[2])<<16|it(e[3])<<8|ct(e[4]))>>>0:(e=tt.exec(t))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+"ff",16)>>>0:(e=rt.exec(t))?parseInt(e[1],16)>>>0:(e=et.exec(t))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+e[4]+e[4],16)>>>0:(e=K.exec(t))?(255|ot(at(e[1]),ut(e[2]),ut(e[3])))>>>0:(e=X.exec(t))?(ot(at(e[1]),ut(e[2]),ut(e[3]))|ct(e[4]))>>>0:null}(t);return null===e?t:(e=e||0,`rgba(${(4278190080&e)>>>24}, ${(16711680&e)>>>16}, ${(65280&e)>>>8}, ${(255&e)/255})`)}const dt=(t,e,n)=>{if(x.fun(t))return t;if(x.arr(t))return dt({range:t,output:e,extrapolate:n});if(x.str(t.output[0]))return C(t);const r=t,s=r.output,o=r.range||[0,1],i=r.extrapolateLeft||r.extrapolate||"extend",a=r.extrapolateRight||r.extrapolate||"extend",c=r.easing||(t=>t);return t=>{const e=function(t,e){for(var n=1;n=t);++n);return n-1}(t,o);return function(t,e,n,r,s,o,i,a,c){let u=c?c(t):t;if(un){if("identity"===a)return u;"clamp"===a&&(u=n)}return r===s?r:e===n?t<=e?r:s:(e===-1/0?u=-u:n===1/0?u-=e:u=(u-e)/(n-e),u=o(u),r===-1/0?u=-u:s===1/0?u+=r:u=u*(s-r)+r,u)}(t,o[e],o[e+1],s[e],s[e+1],c,i,a,r.map)}};function ft(){return(ft=Object.assign||function(t){for(var e=1;eBoolean(t&&t[pt]),bt=t=>t&&t[pt]?t[pt]():t,gt=t=>t[ht]||null;function yt(t,e){let n=t[ht];n&&n.forEach(t=>{!function(t,e){t.eventObserved?t.eventObserved(e):t(e)}(t,e)})}class Ot{constructor(t){if(this[pt]=void 0,this[ht]=void 0,!t&&!(t=this.get))throw Error("Unknown getter");vt(this,t)}}const vt=(t,e)=>_t(t,pt,e);function jt(t,e){if(t[pt]){let n=t[ht];n||_t(t,ht,n=new Set),n.has(e)||(n.add(e),t.observerAdded&&t.observerAdded(n.size,e))}return e}function wt(t,e){let n=t[ht];if(n&&n.has(e)){const r=n.size-1;r?n.delete(e):t[ht]=null,t.observerRemoved&&t.observerRemoved(r,e)}}const _t=(t,e,n)=>Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0}),xt=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,kt=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,St=new RegExp(`(${xt.source})(%|[a-z]+)`,"i"),Et=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Pt=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,Mt=t=>{const[e,n]=At(t);if(!e||I())return t;const r=window.getComputedStyle(document.documentElement).getPropertyValue(e);if(r)return r.trim();if(n&&n.startsWith("--")){return window.getComputedStyle(document.documentElement).getPropertyValue(n)||t}return n&&Pt.test(n)?Mt(n):n||t},At=t=>{const e=Pt.exec(t);if(!e)return[,];const[,n,r]=e;return[n,r]};let It;const Ct=(t,e,n,r,s)=>`rgba(${Math.round(e)}, ${Math.round(n)}, ${Math.round(r)}, ${s})`,Rt=t=>{It||(It=T?new RegExp(`(${Object.keys(T).join("|")})(?!\\w)`,"g"):/^\b$/);const e=t.output.map(t=>bt(t).replace(Pt,Mt).replace(kt,lt).replace(It,lt)),n=e.map(t=>t.match(xt).map(Number)),r=n[0].map((t,e)=>n.map(t=>{if(!(e in t))throw Error('The arity of each "output" value must be equal');return t[e]})).map(e=>dt(ft({},t,{output:e})));return t=>{var n;const s=!St.test(e[0])&&(null==(n=e.find(t=>St.test(t)))?void 0:n.replace(xt,""));let o=0;return e[0].replace(xt,()=>`${r[o++](t)}${s||""}`).replace(Et,Ct)}},Tt="react-spring: ",Nt=t=>{const e=t;let n=!1;if("function"!=typeof e)throw new TypeError(Tt+"once requires a function parameter");return(...t)=>{n||(e(...t),n=!0)}},Vt=Nt(console.warn);function qt(){Vt(Tt+'The "interpolate" function is deprecated in v9 (use "to" instead)')}const Dt=Nt(console.warn);function zt(){Dt(Tt+'Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions')}function Lt(t){return x.str(t)&&("#"==t[0]||/\d/.test(t)||!I()&&Pt.test(t)||t in(T||{}))}const Ft="undefined"!=typeof window&&window.document&&window.document.createElement?j.useLayoutEffect:j.useEffect;function Ut(){const t=Object(j.useState)()[1],e=(()=>{const t=Object(j.useRef)(!1);return Ft(()=>(t.current=!0,()=>{t.current=!1}),[]),t})();return()=>{e.current&&t(Math.random())}}function $t(t,e){const[n]=Object(j.useState)(()=>({inputs:e,result:t()})),r=Object(j.useRef)(),s=r.current;let o=s;return o?Boolean(e&&o.inputs&&function(t,e){if(t.length!==e.length)return!1;for(let n=0;n{r.current=o,s==n&&(n.inputs=n.result=void 0)},[o]),o.result}const Qt=t=>Object(j.useEffect)(t,Bt),Bt=[];function Gt(t){const e=Object(j.useRef)();return Object(j.useEffect)(()=>{e.current=t}),e.current}},function(t,e){t.exports=window.wp.i18n},function(t,e){t.exports=window.wp.components},,function(t,e){t.exports=window.React},function(t,e,n){var r=n(26),s=n(27),o=n(21),i=n(28);t.exports=function(t,e){return r(t)||s(t,e)||o(t,e)||i()},t.exports.__esModule=!0,t.exports.default=t.exports},,,function(t,e){t.exports=window.wp.primitives},function(t,e){t.exports=window.wp.url},function(t,e,n){var r=n(30);t.exports=function(t,e,n){return(e=r(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=window.lodash},,function(t,e,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function s(){for(var t=[],e=0;et&&t[o],a=(t,e)=>Object(r.h)(t,o,e),c=t=>t&&t[o]&&t[o].getPayload();class u{constructor(){this.payload=void 0,a(this,this)}getPayload(){return this.payload||[]}}class l extends u{constructor(t){super(),this.done=!0,this.elapsedTime=void 0,this.lastPosition=void 0,this.lastVelocity=void 0,this.v0=void 0,this.durationProgress=0,this._value=t,r.s.num(this._value)&&(this.lastPosition=this._value)}static create(t){return new l(t)}getPayload(){return[this]}getValue(){return this._value}setValue(t,e){return r.s.num(t)&&(this.lastPosition=t,e&&(t=Math.round(t/e)*e,this.done&&(this.lastPosition=t))),this._value!==t&&(this._value=t,!0)}reset(){const{done:t}=this;this.done=!1,r.s.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,t&&(this.lastVelocity=null),this.v0=null)}}class d extends l{constructor(t){super(0),this._string=null,this._toString=void 0,this._toString=Object(r.f)({output:[t,t]})}static create(t){return new d(t)}getValue(){let t=this._string;return null==t?this._string=this._toString(this._value):t}setValue(t){if(r.s.str(t)){if(t==this._string)return!1;this._string=t,this._value=1}else{if(!super.setValue(t))return!1;this._string=null}return!0}reset(t){t&&(this._toString=Object(r.f)({output:[this.getValue(),t]})),this._value=0,super.reset()}}const f={dependencies:null};class p extends u{constructor(t){super(),this.source=t,this.setValue(t)}getValue(t){const e={};return Object(r.l)(this.source,(n,s)=>{var i;(i=n)&&i[o]===i?e[s]=n.getValue(t):Object(r.r)(n)?e[s]=Object(r.q)(n):t||(e[s]=n)}),e}setValue(t){this.source=t,this.payload=this._makePayload(t)}reset(){this.payload&&Object(r.k)(this.payload,t=>t.reset())}_makePayload(t){if(t){const e=new Set;return Object(r.l)(t,this._addToPayload,e),Array.from(e)}}_addToPayload(t){f.dependencies&&Object(r.r)(t)&&f.dependencies.add(t);const e=c(t);e&&Object(r.k)(e,t=>this.add(t))}}class h extends p{constructor(t){super(t)}static create(t){return new h(t)}getValue(){return this.source.map(t=>t.getValue())}setValue(t){const e=this.getPayload();return t.length==e.length?e.map((e,n)=>e.setValue(t[n])).some(Boolean):(super.setValue(t.map(m)),!0)}}function m(t){return(Object(r.t)(t)?d:l).create(t)}function b(t){const e=i(t);return e?e.constructor:r.s.arr(t)?h:Object(r.t)(t)?d:l}function g(){return(g=Object.assign||function(t){for(var e=1;e{const n=!r.s.fun(t)||t.prototype&&t.prototype.isReactComponent;return Object(s.forwardRef)((o,i)=>{const a=Object(s.useRef)(null),c=n&&Object(s.useCallback)(t=>{a.current=function(t,e){return t&&(r.s.fun(t)?t(e):t.current=e),e}(i,t)},[i]),[u,l]=function(t,e){const n=new Set;return f.dependencies=n,t.style&&(t=g({},t,{style:e.createAnimatedStyle(t.style)})),t=new p(t),f.dependencies=null,[t,n]}(o,e),d=Object(r.z)(),h=()=>{const t=a.current;n&&!t||!1===(!!t&&e.applyAnimatedValues(t,u.getValue(!0)))&&d()},m=new O(h,l),b=Object(s.useRef)();Object(r.A)(()=>(b.current=m,Object(r.k)(l,t=>Object(r.c)(t,m)),()=>{b.current&&(Object(r.k)(b.current.deps,t=>Object(r.x)(t,b.current)),r.w.cancel(b.current.update))})),Object(s.useEffect)(h,[]),Object(r.C)(()=>()=>{const t=b.current;Object(r.k)(t.deps,e=>Object(r.x)(e,t))});const y=e.getComponentProps(u.getValue());return s.createElement(t,g({},y,{ref:c}))})};class O{constructor(t,e){this.update=t,this.deps=e}eventObserved(t){"change"==t.type&&r.w.write(this.update)}}const v=Symbol.for("AnimatedComponent"),j=(t,{applyAnimatedValues:e=(()=>!1),createAnimatedStyle:n=(t=>new p(t)),getComponentProps:s=(t=>t)}={})=>{const o={applyAnimatedValues:e,createAnimatedStyle:n,getComponentProps:s},i=t=>{const e=w(t)||"Anonymous";return(t=r.s.str(t)?i[t]||(i[t]=y(t,o)):t[v]||(t[v]=y(t,o))).displayName=`Animated(${e})`,t};return Object(r.l)(t,(e,n)=>{r.s.arr(t)&&(n=w(e)),i[n]=i(e)}),{animated:i}},w=t=>r.s.str(t)?t:t&&r.s.str(t.displayName)?t.displayName:r.s.fun(t)&&t.name||null},function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n!0===t||!!(e&&t&&(r.s.fun(t)?t(e):Object(r.y)(t).includes(e))),u=(t,e)=>r.s.obj(t)?e&&t[e]:t,l=(t,e)=>!0===t.default?t[e]:t.default?t.default[e]:void 0,d=t=>t,f=(t,e=d)=>{let n=p;t.default&&!0!==t.default&&(t=t.default,n=Object.keys(t));const s={};for(const o of n){const n=e(t[o],o);r.s.und(n)||(s[o]=n)}return s},p=["config","onProps","onStart","onChange","onPause","onResume","onRest"],h={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function m(t){const e=function(t){const e={};let n=0;if(Object(r.l)(t,(t,r)=>{h[r]||(e[r]=t,n++)}),n)return e}(t);if(e){const n={to:e};return Object(r.l)(t,(t,r)=>r in e||(n[r]=t)),n}return i({},t)}function b(t){return t=Object(r.q)(t),r.s.arr(t)?t.map(b):Object(r.t)(t)?r.b.createStringInterpolator({range:[0,1],output:[t,t]})(1):t}function g(t){for(const e in t)return!0;return!1}function y(t){return r.s.fun(t)||r.s.arr(t)&&r.s.obj(t[0])}function O(t,e){var n;null==(n=t.ref)||n.delete(t),null==e||e.delete(t)}function v(t,e){var n;e&&t.ref!==e&&(null==(n=t.ref)||n.delete(t),e.add(t),t.ref=e)}const j={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}},w=1.70158,_=1.525*w,x=2*Math.PI/3,k=2*Math.PI/4.5,S=t=>{const e=7.5625,n=2.75;return t<1/n?e*t*t:t<2/n?e*(t-=1.5/n)*t+.75:t<2.5/n?e*(t-=2.25/n)*t+.9375:e*(t-=2.625/n)*t+.984375},E={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>1-(1-t)*(1-t),easeInOutQuad:t=>t<.5?2*t*t:1-Math.pow(-2*t+2,2)/2,easeInCubic:t=>t*t*t,easeOutCubic:t=>1-Math.pow(1-t,3),easeInOutCubic:t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2,easeInQuart:t=>t*t*t*t,easeOutQuart:t=>1-Math.pow(1-t,4),easeInOutQuart:t=>t<.5?8*t*t*t*t:1-Math.pow(-2*t+2,4)/2,easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>1-Math.pow(1-t,5),easeInOutQuint:t=>t<.5?16*t*t*t*t*t:1-Math.pow(-2*t+2,5)/2,easeInSine:t=>1-Math.cos(t*Math.PI/2),easeOutSine:t=>Math.sin(t*Math.PI/2),easeInOutSine:t=>-(Math.cos(Math.PI*t)-1)/2,easeInExpo:t=>0===t?0:Math.pow(2,10*t-10),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>0===t?0:1===t?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2,easeInCirc:t=>1-Math.sqrt(1-Math.pow(t,2)),easeOutCirc:t=>Math.sqrt(1-Math.pow(t-1,2)),easeInOutCirc:t=>t<.5?(1-Math.sqrt(1-Math.pow(2*t,2)))/2:(Math.sqrt(1-Math.pow(-2*t+2,2))+1)/2,easeInBack:t=>2.70158*t*t*t-w*t*t,easeOutBack:t=>1+2.70158*Math.pow(t-1,3)+w*Math.pow(t-1,2),easeInOutBack:t=>t<.5?Math.pow(2*t,2)*(7.189819*t-_)/2:(Math.pow(2*t-2,2)*((_+1)*(2*t-2)+_)+2)/2,easeInElastic:t=>0===t?0:1===t?1:-Math.pow(2,10*t-10)*Math.sin((10*t-10.75)*x),easeOutElastic:t=>0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin((10*t-.75)*x)+1,easeInOutElastic:t=>0===t?0:1===t?1:t<.5?-Math.pow(2,20*t-10)*Math.sin((20*t-11.125)*k)/2:Math.pow(2,-20*t+10)*Math.sin((20*t-11.125)*k)/2+1,easeInBounce:t=>1-S(1-t),easeOutBounce:S,easeInOutBounce:t=>t<.5?(1-S(1-2*t))/2:(1+S(2*t-1))/2},P=i({},j.default,{mass:1,damping:1,easing:E.linear,clamp:!1});class M{constructor(){this.tension=void 0,this.friction=void 0,this.frequency=void 0,this.damping=void 0,this.mass=void 0,this.velocity=0,this.restVelocity=void 0,this.precision=void 0,this.progress=void 0,this.duration=void 0,this.easing=void 0,this.clamp=void 0,this.bounce=void 0,this.decay=void 0,this.round=void 0,Object.assign(this,P)}}function A(t,e){if(r.s.und(e.decay)){const n=!r.s.und(e.tension)||!r.s.und(e.friction);!n&&r.s.und(e.frequency)&&r.s.und(e.damping)&&r.s.und(e.mass)||(t.duration=void 0,t.decay=void 0),n&&(t.frequency=void 0)}else t.duration=void 0}const I=[];class C{constructor(){this.changed=!1,this.values=I,this.toValues=null,this.fromValues=I,this.to=void 0,this.from=void 0,this.config=new M,this.immediate=!1}}function R(t,{key:e,props:n,defaultProps:s,state:o,actions:u}){return new Promise((l,d)=>{var f;let p,h,m=c(null!=(f=n.cancel)?f:null==s?void 0:s.cancel,e);if(m)y();else{r.s.und(n.pause)||(o.paused=c(n.pause,e));let t=null==s?void 0:s.pause;!0!==t&&(t=o.paused||c(t,e)),p=a(n.delay||0,e),t?(o.resumeQueue.add(g),u.pause()):(u.resume(),g())}function b(){o.resumeQueue.add(g),o.timeouts.delete(h),h.cancel(),p=h.time-r.w.now()}function g(){p>0&&!r.b.skipAnimation?(o.delayed=!0,h=r.w.setTimeout(y,p),o.pauseQueue.add(b),o.timeouts.add(h)):y()}function y(){o.delayed&&(o.delayed=!1),o.pauseQueue.delete(b),o.timeouts.delete(h),t<=(o.cancelId||0)&&(m=!0);try{u.start(i({},n,{callId:t,cancel:m}),l)}catch(t){d(t)}}})}const T=(t,e)=>1==e.length?e[0]:e.some(t=>t.cancelled)?q(t.get()):e.every(t=>t.noop)?N(t.get()):V(t.get(),e.every(t=>t.finished)),N=t=>({value:t,noop:!0,finished:!0,cancelled:!1}),V=(t,e,n=!1)=>({value:t,finished:e,cancelled:n}),q=t=>({value:t,cancelled:!0,finished:!1});function D(t,e,n,s){const{callId:o,parentId:a,onRest:c}=e,{asyncTo:u,promise:l}=n;return a||t!==u||e.reset?n.promise=(async()=>{n.asyncId=o,n.asyncTo=t;const d=f(e,(t,e)=>"onRest"===e?void 0:t);let p,h;const m=new Promise((t,e)=>(p=t,h=e)),b=t=>{const e=o<=(n.cancelId||0)&&q(s)||o!==n.asyncId&&V(s,!1);if(e)throw t.result=e,h(t),t},g=(t,e)=>{const a=new L,c=new F;return(async()=>{if(r.b.skipAnimation)throw z(n),c.result=V(s,!1),h(c),c;b(a);const u=r.s.obj(t)?i({},t):i({},e,{to:t});u.parentId=o,Object(r.l)(d,(t,e)=>{r.s.und(u[e])&&(u[e]=t)});const l=await s.start(u);return b(a),n.paused&&await new Promise(t=>{n.resumeQueue.add(t)}),l})()};let y;if(r.b.skipAnimation)return z(n),V(s,!1);try{let e;e=r.s.arr(t)?(async t=>{for(const e of t)await g(e)})(t):Promise.resolve(t(g,s.stop.bind(s))),await Promise.all([e.then(p),m]),y=V(s.get(),!0,!1)}catch(t){if(t instanceof L)y=t.result;else{if(!(t instanceof F))throw t;y=t.result}}finally{o==n.asyncId&&(n.asyncId=a,n.asyncTo=a?u:void 0,n.promise=a?l:void 0)}return r.s.fun(c)&&r.w.batchedUpdates(()=>{c(y,s,s.item)}),y})():l}function z(t,e){Object(r.m)(t.timeouts,t=>t.cancel()),t.pauseQueue.clear(),t.resumeQueue.clear(),t.asyncId=t.asyncTo=t.promise=void 0,e&&(t.cancelId=e)}class L extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise."),this.result=void 0}}class F extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const U=t=>t instanceof Q;let $=1;class Q extends r.a{constructor(...t){super(...t),this.id=$++,this.key=void 0,this._priority=0}get priority(){return this._priority}set priority(t){this._priority!=t&&(this._priority=t,this._onPriorityChange(t))}get(){const t=Object(o.e)(this);return t&&t.getValue()}to(...t){return r.b.to(this,t)}interpolate(...t){return Object(r.j)(),r.b.to(this,t)}toJSON(){return this.get()}observerAdded(t){1==t&&this._attach()}observerRemoved(t){0==t&&this._detach()}_attach(){}_detach(){}_onChange(t,e=!1){Object(r.d)(this,{type:"change",parent:this,value:t,idle:e})}_onPriorityChange(t){this.idle||r.o.sort(this),Object(r.d)(this,{type:"priority",parent:this,priority:t})}}const B=Symbol.for("SpringPhase"),G=t=>(1&t[B])>0,H=t=>(2&t[B])>0,W=t=>(4&t[B])>0,Z=(t,e)=>e?t[B]|=3:t[B]&=-3,Y=(t,e)=>e?t[B]|=4:t[B]&=-5;class J extends Q{constructor(t,e){if(super(),this.key=void 0,this.animation=new C,this.queue=void 0,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!r.s.und(t)||!r.s.und(e)){const n=r.s.obj(t)?i({},t):i({},e,{from:t});r.s.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(H(this)||this._state.asyncTo)||W(this)}get goal(){return Object(r.q)(this.animation.to)}get velocity(){const t=Object(o.e)(this);return t instanceof o.c?t.lastVelocity||0:t.getPayload().map(t=>t.lastVelocity||0)}get hasAnimated(){return G(this)}get isAnimating(){return H(this)}get isPaused(){return W(this)}get isDelayed(){return this._state.delayed}advance(t){let e=!0,n=!1;const s=this.animation;let{config:i,toValues:a}=s;const c=Object(o.g)(s.to);!c&&Object(r.r)(s.to)&&(a=Object(r.y)(Object(r.q)(s.to))),s.values.forEach((u,l)=>{if(u.done)return;const d=u.constructor==o.b?1:c?c[l].lastPosition:a[l];let f=s.immediate,p=d;if(!f){if(p=u.lastPosition,i.tension<=0)return void(u.done=!0);let e=u.elapsedTime+=t;const n=s.fromValues[l],o=null!=u.v0?u.v0:u.v0=r.s.arr(i.velocity)?i.velocity[l]:i.velocity;let a;if(r.s.und(i.duration))if(i.decay){const t=!0===i.decay?.998:i.decay,r=Math.exp(-(1-t)*e);p=n+o/(1-t)*(1-r),f=Math.abs(u.lastPosition-p)<.1,a=o*r}else{a=null==u.lastVelocity?o:u.lastVelocity;const e=i.precision||(n==d?.005:Math.min(1,.001*Math.abs(d-n))),s=i.restVelocity||e/10,c=i.clamp?0:i.bounce,l=!r.s.und(c),h=n==d?u.v0>0:ns,m||(f=Math.abs(d-p)<=e,!f));++t)l&&(b=p==d||p>d==h,b&&(a=-a*c,p=d)),a+=(1e-6*-i.tension*(p-d)+.001*-i.friction*a)/i.mass*g,p+=a*g}else{let r=1;i.duration>0&&(this._memoizedDuration!==i.duration&&(this._memoizedDuration=i.duration,u.durationProgress>0&&(u.elapsedTime=i.duration*u.durationProgress,e=u.elapsedTime+=t)),r=(i.progress||0)+e/this._memoizedDuration,r=r>1?1:r<0?0:r,u.durationProgress=r),p=n+i.easing(r)*(d-n),a=(p-u.lastPosition)/t,f=1==r}u.lastVelocity=a,Number.isNaN(p)&&(console.warn("Got NaN while animating:",this),f=!0)}c&&!c[l].done&&(f=!1),f?u.done=!0:e=!1,u.setValue(p,i.round)&&(n=!0)});const u=Object(o.e)(this),l=u.getValue();if(e){const t=Object(r.q)(s.to);l===t&&!n||i.decay?n&&i.decay&&this._onChange(l):(u.setValue(t),this._onChange(t)),this._stop()}else n&&this._onChange(l)}set(t){return r.w.batchedUpdates(()=>{this._stop(),this._focus(t),this._set(t)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(H(this)){const{to:t,config:e}=this.animation;r.w.batchedUpdates(()=>{this._onStart(),e.decay||this._set(t,!1),this._stop()})}return this}update(t){return(this.queue||(this.queue=[])).push(t),this}start(t,e){let n;return r.s.und(t)?(n=this.queue||[],this.queue=[]):n=[r.s.obj(t)?t:i({},e,{to:t})],Promise.all(n.map(t=>this._update(t))).then(t=>T(this,t))}stop(t){const{to:e}=this.animation;return this._focus(this.get()),z(this._state,t&&this._lastCallId),r.w.batchedUpdates(()=>this._stop(e,t)),this}reset(){this._update({reset:!0})}eventObserved(t){"change"==t.type?this._start():"priority"==t.type&&(this.priority=t.priority+1)}_prepareNode(t){const e=this.key||"";let{to:n,from:s}=t;n=r.s.obj(n)?n[e]:n,(null==n||y(n))&&(n=void 0),s=r.s.obj(s)?s[e]:s,null==s&&(s=void 0);const i={to:n,from:s};return G(this)||(t.reverse&&([n,s]=[s,n]),s=Object(r.q)(s),r.s.und(s)?Object(o.e)(this)||this._set(n):this._set(s)),i}_update(t,e){let n=i({},t);const{key:s,defaultProps:o}=this;n.default&&Object.assign(o,f(n,(t,e)=>/^on/.test(e)?u(t,s):t)),st(this,n,"onProps"),ot(this,"onProps",n,this);const a=this._prepareNode(n);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const c=this._state;return R(++this._lastCallId,{key:s,props:n,defaultProps:o,state:c,actions:{pause:()=>{W(this)||(Y(this,!0),Object(r.n)(c.pauseQueue),ot(this,"onPause",V(this,K(this,this.animation.to)),this))},resume:()=>{W(this)&&(Y(this,!1),H(this)&&this._resume(),Object(r.n)(c.resumeQueue),ot(this,"onResume",V(this,K(this,this.animation.to)),this))},start:this._merge.bind(this,a)}}).then(t=>{if(n.loop&&t.finished&&(!e||!t.noop)){const t=X(n);if(t)return this._update(t,!0)}return t})}_merge(t,e,n){if(e.cancel)return this.stop(!0),n(q(this));const s=!r.s.und(t.to),u=!r.s.und(t.from);if(s||u){if(!(e.callId>this._lastToId))return n(q(this));this._lastToId=e.callId}const{key:l,defaultProps:d,animation:f}=this,{to:p,from:h}=f;let{to:m=p,from:g=h}=t;!u||s||e.default&&!r.s.und(m)||(m=g),e.reverse&&([m,g]=[g,m]);const O=!Object(r.u)(g,h);O&&(f.from=g),g=Object(r.q)(g);const v=!Object(r.u)(m,p);v&&this._focus(m);const j=y(e.to),{config:w}=f,{decay:_,velocity:x}=w;(s||u)&&(w.velocity=0),e.config&&!j&&function(t,e,n){n&&(A(n=i({},n),e),e=i({},n,e)),A(t,e),Object.assign(t,e);for(const e in P)null==t[e]&&(t[e]=P[e]);let{mass:s,frequency:o,damping:a}=t;r.s.und(o)||(o<.01&&(o=.01),a<0&&(a=0),t.tension=Math.pow(2*Math.PI/o,2)*s,t.friction=4*Math.PI*a*s/o)}(w,a(e.config,l),e.config!==d.config?a(d.config,l):void 0);let k=Object(o.e)(this);if(!k||r.s.und(m))return n(V(this,!0));const S=r.s.und(e.reset)?u&&!e.default:!r.s.und(g)&&c(e.reset,l),E=S?g:this.get(),M=b(m),I=r.s.num(M)||r.s.arr(M)||Object(r.t)(M),C=!j&&(!I||c(d.immediate||e.immediate,l));if(v){const t=Object(o.f)(m);if(t!==k.constructor){if(!C)throw Error(`Cannot animate between ${k.constructor.name} and ${t.name}, as the "to" prop suggests`);k=this._set(M)}}const R=k.constructor;let T=Object(r.r)(m),z=!1;if(!T){const t=S||!G(this)&&O;(v||t)&&(z=Object(r.u)(b(E),M),T=!z),(Object(r.u)(f.immediate,C)||C)&&Object(r.u)(w.decay,_)&&Object(r.u)(w.velocity,x)||(T=!0)}if(z&&H(this)&&(f.changed&&!S?T=!0:T||this._stop(p)),!j&&((T||Object(r.r)(p))&&(f.values=k.getPayload(),f.toValues=Object(r.r)(m)?null:R==o.b?[1]:Object(r.y)(M)),f.immediate!=C&&(f.immediate=C,C||S||this._set(p)),T)){const{onRest:t}=f;Object(r.k)(rt,t=>st(this,e,t));const s=V(this,K(this,p));Object(r.n)(this._pendingCalls,s),this._pendingCalls.add(n),f.changed&&r.w.batchedUpdates(()=>{f.changed=!S,null==t||t(s,this),S?a(d.onRest,s):null==f.onStart||f.onStart(s,this)})}S&&this._set(E),j?n(D(e.to,e,this._state,this)):T?this._start():H(this)&&!v?this._pendingCalls.add(n):n(N(E))}_focus(t){const e=this.animation;t!==e.to&&(Object(r.p)(this)&&this._detach(),e.to=t,Object(r.p)(this)&&this._attach())}_attach(){let t=0;const{to:e}=this.animation;Object(r.r)(e)&&(Object(r.c)(e,this),U(e)&&(t=e.priority+1)),this.priority=t}_detach(){const{to:t}=this.animation;Object(r.r)(t)&&Object(r.x)(t,this)}_set(t,e=!0){const n=Object(r.q)(t);if(!r.s.und(n)){const t=Object(o.e)(this);if(!t||!Object(r.u)(n,t.getValue())){const s=Object(o.f)(n);t&&t.constructor==s?t.setValue(n):Object(o.h)(this,s.create(n)),t&&r.w.batchedUpdates(()=>{this._onChange(n,e)})}}return Object(o.e)(this)}_onStart(){const t=this.animation;t.changed||(t.changed=!0,ot(this,"onStart",V(this,K(this,t.to)),this))}_onChange(t,e){e||(this._onStart(),a(this.animation.onChange,t,this)),a(this.defaultProps.onChange,t,this),super._onChange(t,e)}_start(){const t=this.animation;Object(o.e)(this).reset(Object(r.q)(t.to)),t.immediate||(t.fromValues=t.values.map(t=>t.lastPosition)),H(this)||(Z(this,!0),W(this)||this._resume())}_resume(){r.b.skipAnimation?this.finish():r.o.start(this)}_stop(t,e){if(H(this)){Z(this,!1);const n=this.animation;Object(r.k)(n.values,t=>{t.done=!0}),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Object(r.d)(this,{type:"idle",parent:this});const s=e?q(this.get()):V(this.get(),K(this,null!=t?t:n.to));Object(r.n)(this._pendingCalls,s),n.changed&&(n.changed=!1,ot(this,"onRest",s,this))}}}function K(t,e){const n=b(e),s=b(t.get());return Object(r.u)(s,n)}function X(t,e=t.loop,n=t.to){let r=a(e);if(r){const s=!0!==r&&m(r),o=(s||t).reverse,a=!s||s.reset;return tt(i({},t,{loop:e,default:!1,pause:void 0,to:!o||y(n)?n:void 0,from:a?t.from:void 0,reset:a},s))}}function tt(t){const{to:e,from:n}=t=m(t),s=new Set;return r.s.obj(e)&&nt(e,s),r.s.obj(n)&&nt(n,s),t.keys=s.size?Array.from(s):null,t}function et(t){const e=tt(t);return r.s.und(e.default)&&(e.default=f(e)),e}function nt(t,e){Object(r.l)(t,(t,n)=>null!=t&&e.add(n))}const rt=["onStart","onRest","onChange","onPause","onResume"];function st(t,e,n){t.animation[n]=e[n]!==l(e,n)?u(e[n],t.key):void 0}function ot(t,e,...n){var r,s,o,i;null==(r=(s=t.animation)[e])||r.call(s,...n),null==(o=(i=t.defaultProps)[e])||o.call(i,...n)}const it=["onStart","onChange","onRest"];let at=1;class ct{constructor(t,e){this.id=at++,this.springs={},this.queue=[],this.ref=void 0,this._flush=void 0,this._initialProps=void 0,this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._item=void 0,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),e&&(this._flush=e),t&&this.start(i({default:!0},t))}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(t=>t.idle&&!t.isDelayed&&!t.isPaused)}get item(){return this._item}set item(t){this._item=t}get(){const t={};return this.each((e,n)=>t[n]=e.get()),t}set(t){for(const e in t){const n=t[e];r.s.und(n)||this.springs[e].set(n)}}update(t){return t&&this.queue.push(tt(t)),this}start(t){let{queue:e}=this;return t?e=Object(r.y)(t).map(tt):this.queue=[],this._flush?this._flush(this,e):(ht(this,e),ut(this,e))}stop(t,e){if(t!==!!t&&(e=t),e){const n=this.springs;Object(r.k)(Object(r.y)(e),e=>n[e].stop(!!t))}else z(this._state,this._lastAsyncId),this.each(e=>e.stop(!!t));return this}pause(t){if(r.s.und(t))this.start({pause:!0});else{const e=this.springs;Object(r.k)(Object(r.y)(t),t=>e[t].pause())}return this}resume(t){if(r.s.und(t))this.start({pause:!1});else{const e=this.springs;Object(r.k)(Object(r.y)(t),t=>e[t].resume())}return this}each(t){Object(r.l)(this.springs,t)}_onFrame(){const{onStart:t,onChange:e,onRest:n}=this._events,s=this._active.size>0,o=this._changed.size>0;(s&&!this._started||o&&!this._started)&&(this._started=!0,Object(r.m)(t,([t,e])=>{e.value=this.get(),t(e,this,this._item)}));const i=!s&&this._started,a=o||i&&n.size?this.get():null;o&&e.size&&Object(r.m)(e,([t,e])=>{e.value=a,t(e,this,this._item)}),i&&(this._started=!1,Object(r.m)(n,([t,e])=>{e.value=a,t(e,this,this._item)}))}eventObserved(t){if("change"==t.type)this._changed.add(t.parent),t.idle||this._active.add(t.parent);else{if("idle"!=t.type)return;this._active.delete(t.parent)}r.w.onFrame(this._onFrame)}}function ut(t,e){return Promise.all(e.map(e=>async function t(e,n,s){const{keys:o,to:i,from:a,loop:c,onRest:u,onResolve:d}=n,f=r.s.obj(n.default)&&n.default;c&&(n.loop=!1),!1===i&&(n.to=null),!1===a&&(n.from=null);const p=r.s.arr(i)||r.s.fun(i)?i:void 0;p?(n.to=void 0,n.onRest=void 0,f&&(f.onRest=void 0)):Object(r.k)(it,t=>{const s=n[t];if(r.s.fun(s)){const r=e._events[t];n[t]=({finished:t,cancelled:e})=>{const n=r.get(s);n?(t||(n.finished=!1),e&&(n.cancelled=!0)):r.set(s,{value:null,finished:t||!1,cancelled:e||!1})},f&&(f[t]=n[t])}});const h=e._state;n.pause===!h.paused?(h.paused=n.pause,Object(r.n)(n.pause?h.pauseQueue:h.resumeQueue)):h.paused&&(n.pause=!0);const m=(o||Object.keys(e.springs)).map(t=>e.springs[t].start(n)),b=!0===n.cancel||!0===l(n,"cancel");(p||b&&h.asyncId)&&m.push(R(++e._lastAsyncId,{props:n,state:h,actions:{pause:r.v,resume:r.v,start(t,n){b?(z(h,e._lastAsyncId),n(q(e))):(t.onRest=u,n(D(p,t,h,e)))}}})),h.paused&&await new Promise(t=>{h.resumeQueue.add(t)});const g=T(e,await Promise.all(m));if(c&&g.finished&&(!s||!g.noop)){const r=X(n,c,i);if(r)return ht(e,[r]),t(e,r,!0)}return d&&r.w.batchedUpdates(()=>d(g,e,e.item)),g}(t,e))).then(e=>T(t,e))}function lt(t,e){const n=i({},t.springs);return e&&Object(r.k)(Object(r.y)(e),t=>{r.s.und(t.keys)&&(t=tt(t)),r.s.obj(t.to)||(t=i({},t,{to:void 0})),pt(n,t,t=>ft(t))}),dt(t,n),n}function dt(t,e){Object(r.l)(e,(e,n)=>{t.springs[n]||(t.springs[n]=e,Object(r.c)(e,t))})}function ft(t,e){const n=new J;return n.key=t,e&&Object(r.c)(n,e),n}function pt(t,e,n){e.keys&&Object(r.k)(e.keys,r=>{(t[r]||(t[r]=n(r)))._prepareNode(e)})}function ht(t,e){Object(r.k)(e,e=>{pt(t.springs,e,e=>ft(e,t))})}const mt=["children"],bt=t=>{let{children:e}=t,n=function(t,e){if(null==t)return{};var n,r,s={},o=Object.keys(t);for(r=0;r=0||(s[n]=t[n]);return s}(t,mt);const o=Object(s.useContext)(gt),i=n.pause||!!o.pause,a=n.immediate||!!o.immediate;n=Object(r.B)(()=>({pause:i,immediate:a}),[i,a]);const{Provider:c}=gt;return s.createElement(c,{value:n},e)},gt=(yt=bt,Ot={},Object.assign(yt,s.createContext(Ot)),yt.Provider._context=yt,yt.Consumer._context=yt,yt);var yt,Ot;bt.Provider=gt.Provider,bt.Consumer=gt.Consumer;const vt=()=>{const t=[],e=function(e){Object(r.i)();const s=[];return Object(r.k)(t,(t,o)=>{if(r.s.und(e))s.push(t.start());else{const r=n(e,t,o);r&&s.push(t.start(r))}}),s};e.current=t,e.add=function(e){t.includes(e)||t.push(e)},e.delete=function(e){const n=t.indexOf(e);~n&&t.splice(n,1)},e.pause=function(){return Object(r.k)(t,t=>t.pause(...arguments)),this},e.resume=function(){return Object(r.k)(t,t=>t.resume(...arguments)),this},e.set=function(e){Object(r.k)(t,t=>t.set(e))},e.start=function(e){const n=[];return Object(r.k)(t,(t,s)=>{if(r.s.und(e))n.push(t.start());else{const r=this._getProps(e,t,s);r&&n.push(t.start(r))}}),n},e.stop=function(){return Object(r.k)(t,t=>t.stop(...arguments)),this},e.update=function(e){return Object(r.k)(t,(t,n)=>t.update(this._getProps(e,t,n))),this};const n=function(t,e,n){return r.s.fun(t)?t(n,e):t};return e._getProps=n,e};function jt(t,e,n){const o=r.s.fun(e)&&e;o&&!n&&(n=[]);const a=Object(s.useMemo)(()=>o||3==arguments.length?vt():void 0,[]),c=Object(s.useRef)(0),u=Object(r.z)(),l=Object(s.useMemo)(()=>({ctrls:[],queue:[],flush(t,e){const n=lt(t,e);return c.current>0&&!l.queue.length&&!Object.keys(n).some(e=>!t.springs[e])?ut(t,e):new Promise(r=>{dt(t,n),l.queue.push(()=>{r(ut(t,e))}),u()})}}),[]),d=Object(s.useRef)([...l.ctrls]),f=[],p=Object(r.D)(t)||0;function h(t,n){for(let r=t;r{Object(r.k)(d.current.slice(t,p),t=>{O(t,a),t.stop(!0)}),d.current.length=t,h(p,t)},[t]),Object(s.useMemo)(()=>{h(0,Math.min(p,t))},n);const m=d.current.map((t,e)=>lt(t,f[e])),b=Object(s.useContext)(bt),y=Object(r.D)(b),j=b!==y&&g(b);Object(r.A)(()=>{c.current++,l.ctrls=d.current;const{queue:t}=l;t.length&&(l.queue=[],Object(r.k)(t,t=>t())),Object(r.k)(d.current,(t,e)=>{null==a||a.add(t),j&&t.start({default:b});const n=f[e];n&&(v(t,n.ref),t.ref?t.queue.push(n):t.start(n))})}),Object(r.C)(()=>()=>{Object(r.k)(l.ctrls,t=>t.stop(!0))});const w=m.map(t=>i({},t));return a?[w,a]:w}function wt(t,e){const n=r.s.fun(t),[[s],o]=jt(1,n?t:[t],n?e||[]:e);return n||2==arguments.length?[s,o]:s}let _t;function xt(t,e,n){const o=r.s.fun(e)&&e,{reset:c,sort:u,trail:l=0,expires:d=!0,exitBeforeEnter:p=!1,onDestroyed:h,ref:b,config:y}=o?o():e,j=Object(s.useMemo)(()=>o||3==arguments.length?vt():void 0,[]),w=Object(r.y)(t),_=[],x=Object(s.useRef)(null),k=c?null:x.current;Object(r.A)(()=>{x.current=_}),Object(r.C)(()=>(Object(r.k)(x.current,t=>{var e;null==(e=t.ctrl.ref)||e.add(t.ctrl);const n=C.get(t);n&&t.ctrl.start(n.payload)}),()=>{Object(r.k)(x.current,t=>{t.expired&&clearTimeout(t.expirationId),O(t.ctrl,j),t.ctrl.stop(!0)})}));const S=St(w,o?o():e,k),E=c&&x.current||[];Object(r.A)(()=>Object(r.k)(E,({ctrl:t,item:e,key:n})=>{O(t,j),a(h,e,n)}));const P=[];if(k&&Object(r.k)(k,(t,e)=>{t.expired?(clearTimeout(t.expirationId),E.push(t)):~(e=P[e]=S.indexOf(t.key))&&(_[e]=t)}),Object(r.k)(w,(t,e)=>{_[e]||(_[e]={key:S[e],item:t,phase:_t.MOUNT,ctrl:new ct},_[e].ctrl.item=t)}),P.length){let t=-1;const{leave:n}=o?o():e;Object(r.k)(P,(e,r)=>{const s=k[r];~e?(t=_.indexOf(s),_[t]=i({},s,{item:w[e]})):n&&_.splice(++t,0,s)})}r.s.fun(u)&&_.sort((t,e)=>u(t.item,e.item));let M=-l;const A=Object(r.z)(),I=f(e),C=new Map,R=Object(s.useRef)(new Map),T=Object(s.useRef)(!1);Object(r.k)(_,(t,n)=>{const s=t.key,c=t.phase,u=o?o():e;let f,h,g=a(u.delay||0,s);if(c==_t.MOUNT)f=u.enter,h=_t.ENTER;else{const t=S.indexOf(s)<0;if(c!=_t.LEAVE)if(t)f=u.leave,h=_t.LEAVE;else{if(!(f=u.update))return;h=_t.UPDATE}else{if(t)return;f=u.enter,h=_t.ENTER}}if(f=a(f,t.item,n),f=r.s.obj(f)?m(f):{to:f},!f.config){const e=y||I.config;f.config=a(e,t.item,n,h)}M+=l;const O=i({},I,{delay:g+M,ref:b,immediate:u.immediate,reset:!1},f);if(h==_t.ENTER&&r.s.und(O.from)){const s=o?o():e,i=r.s.und(s.initial)||k?s.from:s.initial;O.from=a(i,t.item,n)}const{onResolve:v}=O;O.onResolve=t=>{a(v,t);const e=x.current,n=e.find(t=>t.key===s);if(n&&(!t.cancelled||n.phase==_t.UPDATE)&&n.ctrl.idle){const t=e.every(t=>t.ctrl.idle);if(n.phase==_t.LEAVE){const e=a(d,n.item);if(!1!==e){const r=!0===e?0:e;if(n.expired=!0,!t&&r>0)return void(r<=2147483647&&(n.expirationId=setTimeout(A,r)))}}t&&e.some(t=>t.expired)&&(R.current.delete(n),p&&(T.current=!0),A())}};const j=lt(t.ctrl,O);h===_t.LEAVE&&p?R.current.set(t,{phase:h,springs:j,payload:O}):C.set(t,{phase:h,springs:j,payload:O})});const N=Object(s.useContext)(bt),V=Object(r.D)(N),q=N!==V&&g(N);Object(r.A)(()=>{q&&Object(r.k)(_,t=>{t.ctrl.start({default:N})})},[N]),Object(r.k)(C,(t,e)=>{if(R.current.size){const t=_.findIndex(t=>t.key===e.key);_.splice(t,1)}}),Object(r.A)(()=>{Object(r.k)(R.current.size?R.current:C,({phase:t,payload:e},n)=>{const{ctrl:r}=n;n.phase=t,null==j||j.add(r),q&&t==_t.ENTER&&r.start({default:N}),e&&(v(r,e.ref),r.ref&&!T.current?r.update(e):(r.start(e),T.current&&(T.current=!1)))})},c?void 0:n);const D=t=>s.createElement(s.Fragment,null,_.map((e,n)=>{const{springs:o}=C.get(e)||e.ctrl,a=t(i({},o),e.item,e,n);return a&&a.type?s.createElement(a.type,i({},a.props,{key:r.s.str(e.key)||r.s.num(e.key)?e.key:e.ctrl.id,ref:a.ref})):a}));return j?[D,j]:D}!function(t){t.MOUNT="mount",t.ENTER="enter",t.UPDATE="update",t.LEAVE="leave"}(_t||(_t={}));let kt=1;function St(t,{key:e,keys:n=e},s){if(null===n){const e=new Set;return t.map(t=>{const n=s&&s.find(n=>n.item===t&&n.phase!==_t.LEAVE&&!e.has(n));return n?(e.add(n),n.key):kt++})}return r.s.und(n)?t:r.s.fun(n)?t.map(n):Object(r.y)(n)}class Et extends Q{constructor(t,e){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=t,this.calc=Object(r.f)(...e);const n=this._get(),s=Object(o.f)(n);Object(o.h)(this,s.create(n))}advance(t){const e=this._get(),n=this.get();Object(r.u)(e,n)||(Object(o.e)(this).setValue(e),this._onChange(e,this.idle)),!this.idle&&Mt(this._active)&&At(this)}_get(){const t=r.s.arr(this.source)?this.source.map(r.q):Object(r.y)(Object(r.q)(this.source));return this.calc(...t)}_start(){this.idle&&!Mt(this._active)&&(this.idle=!1,Object(r.k)(Object(o.g)(this),t=>{t.done=!1}),r.b.skipAnimation?(r.w.batchedUpdates(()=>this.advance()),At(this)):r.o.start(this))}_attach(){let t=1;Object(r.k)(Object(r.y)(this.source),e=>{Object(r.r)(e)&&Object(r.c)(e,this),U(e)&&(e.idle||this._active.add(e),t=Math.max(t,e.priority+1))}),this.priority=t,this._start()}_detach(){Object(r.k)(Object(r.y)(this.source),t=>{Object(r.r)(t)&&Object(r.x)(t,this)}),this._active.clear(),At(this)}eventObserved(t){"change"==t.type?t.idle?this.advance():(this._active.add(t.parent),this._start()):"idle"==t.type?this._active.delete(t.parent):"priority"==t.type&&(this.priority=Object(r.y)(this.source).reduce((t,e)=>Math.max(t,(U(e)?e.priority:0)+1),0))}}function Pt(t){return!1!==t.idle}function Mt(t){return!t.size||Array.from(t).every(Pt)}function At(t){t.idle||(t.idle=!0,Object(r.k)(Object(o.g)(t),t=>{t.done=!0}),Object(r.d)(t,{type:"idle",parent:t}))}r.b.assign({createStringInterpolator:r.g,to:(t,e)=>new Et(t,e)}),r.o.advance},,function(t,e){t.exports=window.regeneratorRuntime},,,function(t,e,n){"use strict";n.d(e,"animated",(function(){return _}));var r=n(43);n.o(r,"config")&&n.d(e,"config",(function(){return r.config})),n.o(r,"useSpring")&&n.d(e,"useSpring",(function(){return r.useSpring})),n.o(r,"useTransition")&&n.d(e,"useTransition",(function(){return r.useTransition}));var s=n(55),o=n(1),i=n(19);function a(t,e){if(null==t)return{};var n,r,s={},o=Object.keys(t);for(r=0;r=0||(s[n]=t[n]);return s}const c=["style","children","scrollTop","scrollLeft"],u=/^--/;function l(t,e){return null==e||"boolean"==typeof e||""===e?"":"number"!=typeof e||0===e||u.test(t)||f.hasOwnProperty(t)&&f[t]?(""+e).trim():e+"px"}const d={};let f={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};const p=["Webkit","Ms","Moz","O"];f=Object.keys(f).reduce((t,e)=>(p.forEach(n=>t[((t,e)=>t+e.charAt(0).toUpperCase()+e.substring(1))(n,e)]=t[e]),t),f);const h=["x","y","z"],m=/^(matrix|translate|scale|rotate|skew)/,b=/^(translate)/,g=/^(rotate|skew)/,y=(t,e)=>o.s.num(t)&&0!==t?t+e:t,O=(t,e)=>o.s.arr(t)?t.every(t=>O(t,e)):o.s.num(t)?t===e:parseFloat(t)===e;class v extends i.a{constructor(t){let{x:e,y:n,z:r}=t,s=a(t,h);const i=[],c=[];(e||n||r)&&(i.push([e||0,n||0,r||0]),c.push(t=>[`translate3d(${t.map(t=>y(t,"px")).join(",")})`,O(t,0)])),Object(o.l)(s,(t,e)=>{if("transform"===e)i.push([t||""]),c.push(t=>[t,""===t]);else if(m.test(e)){if(delete s[e],o.s.und(t))return;const n=b.test(e)?"px":g.test(e)?"deg":"";i.push(Object(o.y)(t)),c.push("rotate3d"===e?([t,e,r,s])=>[`rotate3d(${t},${e},${r},${y(s,n)})`,O(s,0)]:t=>[`${e}(${t.map(t=>y(t,n)).join(",")})`,O(t,e.startsWith("scale")?1:0)])}}),i.length&&(s.transform=new j(i,c)),super(s)}}class j extends o.a{constructor(t,e){super(),this._value=null,this.inputs=t,this.transforms=e}get(){return this._value||(this._value=this._get())}_get(){let t="",e=!0;return Object(o.k)(this.inputs,(n,r)=>{const s=Object(o.q)(n[0]),[i,a]=this.transforms[r](o.s.arr(s)?s:n.map(o.q));t+=" "+i,e=e&&a}),e?"none":t}observerAdded(t){1==t&&Object(o.k)(this.inputs,t=>Object(o.k)(t,t=>Object(o.r)(t)&&Object(o.c)(t,this)))}observerRemoved(t){0==t&&Object(o.k)(this.inputs,t=>Object(o.k)(t,t=>Object(o.r)(t)&&Object(o.x)(t,this)))}eventObserved(t){"change"==t.type&&(this._value=null),Object(o.d)(this,t)}}const w=["scrollTop","scrollLeft"];r.Globals.assign({batchedUpdates:s.unstable_batchedUpdates,createStringInterpolator:o.g,colors:o.e});const _=Object(i.d)(["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"],{applyAnimatedValues:function(t,e){if(!t.nodeType||!t.setAttribute)return!1;const n="filter"===t.nodeName||t.parentNode&&"filter"===t.parentNode.nodeName,r=e,{style:s,children:o,scrollTop:i,scrollLeft:f}=r,p=a(r,c),h=Object.values(p),m=Object.keys(p).map(e=>n||t.hasAttribute(e)?e:d[e]||(d[e]=e.replace(/([A-Z])/g,t=>"-"+t.toLowerCase())));void 0!==o&&(t.textContent=o);for(let e in s)if(s.hasOwnProperty(e)){const n=l(e,s[e]);u.test(e)?t.style.setProperty(e,n):t.style[e]=n}m.forEach((e,n)=>{t.setAttribute(e,h[n])}),void 0!==i&&(t.scrollTop=i),void 0!==f&&(t.scrollLeft=f)},createAnimatedStyle:t=>new v(t),getComponentProps:t=>a(t,w)}).animated},function(t,e){},function(t,e){},,,,,function(t,e){t.exports=window.ReactDOM},function(t,e){t.exports=window.moment},function(t,e){t.exports=window.wp.autop},function(t,e){function n(t,e,n,r,s,o,i){try{var a=t[o](i),c=a.value}catch(t){return void n(t)}a.done?e(c):Promise.resolve(c).then(r,s)}t.exports=function(t){return function(){var e=this,r=arguments;return new Promise((function(s,o){var i=t.apply(e,r);function a(t){n(i,s,o,a,c,"next",t)}function c(t){n(i,s,o,a,c,"throw",t)}a(void 0)}))}},t.exports.__esModule=!0,t.exports.default=t.exports},,,,,,,,,function(t,e,n){"use strict";var r=n(0),s=n(9);const o=Object(r.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(s.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"}));e.a=o},,,,,,,,,,,,,function(t,e,n){"use strict";n.r(e);var r=n(6),s=n.n(r),o=n(0),i=n(24),a=n.n(i),c=n(41),u=n(10),l=n(11),d=n.n(l);function f(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}function p(t){for(var e=1;e0&&Object(o.createElement)(m.animated.span,{style:r,className:"simpay-branding-bar__actions-button-count","aria-label":Object(b.sprintf)(/* translators: %d Unread notification count. */ +Object(b.__)("%d unread notifications","stripe"),e)},Object(o.createElement)("span",null,e)),Object(o.createElement)("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(o.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.8333 2.5H4.16667C3.25 2.5 2.5 3.25 2.5 4.16667V15.8333c0 .9167.74167 1.6667 1.66667 1.6667H15.8333c.9167 0 1.6667-.75 1.6667-1.6667V4.16667C17.5 3.25 16.75 2.5 15.8333 2.5Zm0 13.3333H4.16667v-2.5h2.96666C7.70833 14.325 8.775 15 10.0083 15c1.2334 0 2.2917-.675 2.875-1.6667h2.95v2.5Zm-4.1583-4.1666h4.1583V4.16667H4.16667v7.50003h4.175c0 .9166.75 1.6666 1.66663 1.6666.9167 0 1.6667-.75 1.6667-1.6666Z",fill:"currentColor"})))},y=n(56),O=n.n(y),v=n(3),j=n(57),w="simpay-notifications-notification",_=simpayNotifications.isLite;function x(t){switch(t){case"warning":return"warning";case"error":return"dismiss";case"info":return"admin-generic";case"success":default:return"yes-alt"}}function k(t){return Object(u.getAuthority)(window.location.href)!==Object(u.getAuthority)(t)}function S(t,e,n){return!1===k(t)?t:Object(u.addQueryArgs)(t.replace(/\/?$/,"/"),{utm_source:"WordPress",utm_campaign:"1"===_?"lite-plugin":"pro-plugin",utm_medium:e,utm_content:n})}var E=function(t){var e=t.notification,n=t.onDismissNotification,r=e.id,s=e.title,i=e.content,a=e.type,c=e.start,u=e.actions,l=e.is_dismissible;return Object(o.createElement)("div",{className:w,style:{backgroundColor:l?"transparent":"#fafafa"}},Object(o.createElement)("div",{className:"".concat(w,"__icon ").concat(w,"__icon-").concat(a||"success")},Object(o.createElement)("span",{className:"dashicons dashicons-".concat(x(a))})),Object(o.createElement)("div",{className:"".concat(w,"__body")},Object(o.createElement)("div",{className:"".concat(w,"__header")},Object(o.createElement)("div",{className:"".concat(w,"__title")},s),l&&Object(o.createElement)("div",{className:"".concat(w,"__date")},O.a.unix(c).fromNow())),Object(o.createElement)("div",{className:"".concat(w,"__content"),dangerouslySetInnerHTML:{__html:Object(j.autop)(i)}}),Object(o.createElement)("div",{className:"".concat(w,"__actions")},u.map((function(t){var e=t.type,n=t.text,r=t.url;return Object(o.createElement)(v.Button,{key:n,href:S(r,"notification-inbox",s),isPrimary:"primary"===e,isSecondary:"secondary"===e,variant:e,target:k(r)?"_blank":"_self"},n)})),l&&Object(o.createElement)(v.Button,{isLink:!0,variant:"link",onClick:function(){return n(r)}},Object(b.__)("Dismiss","stripe")))))},P=n(58),M=n.n(P),A=n(45),I=n.n(A),C=n(14),R=n.n(C),T=n(12),N=n(22);function V(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:s}}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,i=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return i=t.done,t},e:function(t){a=!0,o=t},f:function(){try{i||null==n.return||n.return()}finally{if(a)throw o}}}}(t?s.current:r.current);try{for(i.s();!(o=i.n()).done;)q(o.value,t)}catch(t){i.e(t)}finally{i.f()}}),[])}([Object(N.useConstrainedTabbing)(),Object(N.useFocusReturn)(),c]),l=Object(o.useState)((function(){return new WeakMap})),d=s()(l,1)[0],f=Object(T.sortBy)(i,"is_dismissible"),p=Object(m.useTransition)(f,{config:m.config.default,enter:function(t){return function(){var e=M()(I.a.mark((function e(n){return I.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n({height:d.get(t).offsetHeight,transform:"translate3d(0%, 0px, 0px)"});case 2:case"end":return e.stop()}}),e)})));return function(_x){return e.apply(this,arguments)}}()},leave:[{transform:"translate3d(150%, 0px, 0px)"},{height:0}],keys:function(t){return t.id},trail:100});return Object(o.createElement)(v.Animate,{type:"slide-in",options:{origin:"left"}},(function(t){var s=t.className,c=R()("simpay-notifications-panel",s);return Object(o.createElement)("div",{ref:u,className:c},Object(o.createElement)(z,{count:e.data.length,onClose:n}),Object(o.createElement)("div",{className:"simpay-notifications-panel__notifications"},a&&Object(o.createElement)("div",{className:"simpay-notifications-panel__none"},Object(o.createElement)(v.Spinner,null)),0===i.length&&!a&&Object(o.createElement)("div",{className:"simpay-notifications-panel__none"},Object(o.createElement)("span",null,Object(b.__)("You have no new notifications.","stripe"))),p((function(t,e){return Object(o.createElement)(m.animated.div,{style:F(F({},t),{},{overflow:"hidden"}),ref:function(t){return t&&d.set(e,t)}},Object(o.createElement)(E,{onDismissNotification:r,notification:e}))}))))}))},$=function(t){var e=t.isOpen,n=t.onClose;return Object(o.useEffect)((function(){return document.body.classList.toggle("simpay-notifications-body-locked"),function(){document.body.classList.remove("simpay-notifications-body-locked")}}),[e]),Object(o.createElement)("button",{className:"simpay-notifications-backdrop",onClick:n})};Object(o.render)(Object(o.createElement)((function(){var t=Object(o.useReducer)(h,{data:[],isLoading:!0}),e=s()(t,2),n=e[0],r=e[1],i=Object(o.useState)("#notifications"===Object(u.getFragment)(window.location.href)),l=s()(i,2),d=l[0],f=l[1];function p(){f(!1),window.history.pushState("",document.title,window.location.pathname+window.location.search)}return Object(o.useEffect)((function(){function t(){"#notifications"===Object(u.getFragment)(window.location.href)&&f(!0)}return window.addEventListener("hashchange",t),function(){window.removeEventListener("hashchange",t)}}),[]),Object(o.useEffect)((function(){if(!n.isLoading){var t=document.querySelector("#wp-admin-bar-simpay-admin-bar-test-mode .wp-ui-notification");if(0===n.data.length){t&&t.remove();var e=document.getElementById("wp-admin-bar-simpay-notifications");e&&e.remove();var r=document.querySelector('#menu-posts-simple-pay .wp-submenu a[href$="#notifications"]');r&&r.remove()}else t&&(t.textContent=n.data.length)}}),[n.data]),Object(o.useEffect)((function(){r({type:"START_RESOLUTION"}),a()({path:"/wpsp/__internal__/notifications"}).then((function(t){var e=t.data;r({type:"SET",notifications:e}),r({type:"FINISH_RESOLUTION"})}))}),[]),Object(o.createElement)("div",{onKeyDown:function(t){t.keyCode!==c.ESCAPE||t.defaultPrevented||(t.preventDefault(),f(!1))},role:"region"},Object(o.createElement)(g,{count:n.data.length,isOpen:d,onOpen:function(){f(!0),window.history.pushState("",document.title,window.location.pathname+window.location.search+"#notifications")}}),d&&Object(o.createElement)(o.Fragment,null,Object(o.createElement)(U,{notifications:n,onDismissNotification:function(t){r({type:"DISMISS",id:t}),a()({path:"/wpsp/__internal__/notifications/"+t,method:"DELETE"})},onClose:p}),Object(o.createElement)($,{onClose:p})))}),null),document.getElementById("simpay-branding-bar-notifications"))}]); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-page-activity-reports-css.asset.php b/includes/core/assets/js/dist/simpay-admin-page-activity-reports-css.asset.php index 43f87d6a..85b7af67 100644 --- a/includes/core/assets/js/dist/simpay-admin-page-activity-reports-css.asset.php +++ b/includes/core/assets/js/dist/simpay-admin-page-activity-reports-css.asset.php @@ -1 +1 @@ - array(), 'version' => '573049bae9275d33a66d652f3a3ff8c7'); \ No newline at end of file + array(), 'version' => 'e9b7cd73b88acda30af513715d29ee94'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-page-activity-reports.asset.php b/includes/core/assets/js/dist/simpay-admin-page-activity-reports.asset.php index 8f0ad733..6b760685 100644 --- a/includes/core/assets/js/dist/simpay-admin-page-activity-reports.asset.php +++ b/includes/core/assets/js/dist/simpay-admin-page-activity-reports.asset.php @@ -1 +1 @@ - array('lodash', 'react', 'wp-api-fetch', 'wp-components', 'wp-core-data', 'wp-data', 'wp-date', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => '865904a6360b86b2b48ca786d982c481'); \ No newline at end of file + array('lodash', 'react', 'wp-api-fetch', 'wp-components', 'wp-core-data', 'wp-data', 'wp-date', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => 'ad02552a44b26c92e9cfba7c85c340fc'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-page-activity-reports.js b/includes/core/assets/js/dist/simpay-admin-page-activity-reports.js index 4cae676a..80255911 100644 --- a/includes/core/assets/js/dist/simpay-admin-page-activity-reports.js +++ b/includes/core/assets/js/dist/simpay-admin-page-activity-reports.js @@ -1,6 +1,6 @@ -!function(t){var e={};function i(n){if(e[n])return e[n].exports;var a=e[n]={i:n,l:!1,exports:{}};return t[n].call(a.exports,a,a.exports,i),a.l=!0,a.exports}i.m=t,i.c=e,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 a in t)i.d(n,a,function(e){return t[e]}.bind(null,a));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="",i(i.s=79)}([function(t,e){t.exports=window.wp.element},,function(t,e){t.exports=window.wp.i18n},function(t,e){t.exports=window.wp.components},function(t,e,i){"use strict";function n(t,e){if(e.length1?"s":"")+" required, but only "+e.length+" present")}i.d(e,"a",(function(){return n}))},function(t,e){t.exports=window.React},function(t,e,i){var n=i(26),a=i(27),s=i(22),r=i(28);t.exports=function(t,e){return n(t)||a(t,e)||s(t,e)||r()},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){"use strict";function n(t){if(null===t||!0===t||!1===t)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}i.d(e,"a",(function(){return n}))},function(t,e,i){"use strict";i.d(e,"a",(function(){return s}));var n=i(4);function a(t){return(a="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 s(t){Object(n.a)(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||"object"===a(t)&&"[object Date]"===e?new Date(t.getTime()):"number"==typeof t||"[object Number]"===e?new Date(t):("string"!=typeof t&&"[object String]"!==e||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}},function(t,e){t.exports=window.wp.primitives},function(t,e){t.exports=window.wp.url},function(t,e,i){var n=i(30);t.exports=function(t,e,i){return(e=n(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=window.lodash},function(t,e,i){var n;!function(){"use strict";var i={}.hasOwnProperty;function a(){for(var t=[],e=0;eArray.prototype.slice.call(t));let a=!1,s=[];return function(...i){s=n(i),a||(a=!0,h.call(window,()=>{a=!1,t.apply(e,s)}))}}const u=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2;function f(){}const p=function(){let t=0;return function(){return t++}}();function g(t){return null==t}function m(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.substr(0,7)&&"Array]"===e.substr(-6)}function b(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}const y=t=>("number"==typeof t||t instanceof Number)&&isFinite(+t);function x(t,e){return y(t)?t:e}function v(t,e){return void 0===t?e:t}const _=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function w(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function O(t,e,i,n){let a,s,r;if(m(t))if(s=t.length,n)for(a=s-1;a>=0;a--)e.call(i,t[a],a);else for(a=0;ai;)t=t[e.substr(i,n-i)],i=n+1,n=C(e,i);return t}function A(t){return t.charAt(0).toUpperCase()+t.slice(1)}const L=t=>void 0!==t,R=t=>"function"==typeof t,N=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0},F=Math.PI,I=2*F,z=I+F,B=Number.POSITIVE_INFINITY,V=F/180,W=F/2,H=F/4,U=2*F/3,Y=Math.log10,$=Math.sign;function X(t){const e=Math.round(t);t=G(t,e,t/1e3)?e:t;const i=Math.pow(10,Math.floor(Y(t))),n=t/i;return(n<=1?1:n<=2?2:n<=5?5:10)*i}function q(t){return!isNaN(parseFloat(t))&&isFinite(t)}function G(t,e,i){return Math.abs(t-e)l&&c=Math.min(e,i)-n&&t<=Math.max(e,i)+n}const ot=t=>0===t||1===t,lt=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*I/i),ct=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*I/i)+1,ht={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*W),easeOutSine:t=>Math.sin(t*W),easeInOutSine:t=>-.5*(Math.cos(F*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>ot(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>ot(t)?t:lt(t,.075,.3),easeOutElastic:t=>ot(t)?t:ct(t,.075,.3),easeInOutElastic(t){const e=.1125;return ot(t)?t:t<.5?.5*lt(2*t,e,.45):.5+.5*ct(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-ht.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*ht.easeInBounce(2*t):.5*ht.easeOutBounce(2*t-1)+.5},dt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},ut="0123456789ABCDEF",ft=t=>ut[15&t],pt=t=>ut[(240&t)>>4]+ut[15&t],gt=t=>(240&t)>>4==(15&t);function mt(t){return t+.5|0}const bt=(t,e,i)=>Math.max(Math.min(t,i),e);function yt(t){return bt(mt(2.55*t),0,255)}function xt(t){return bt(mt(255*t),0,255)}function vt(t){return bt(mt(t/2.55)/100,0,1)}function _t(t){return bt(mt(100*t),0,100)}const wt=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/,Ot=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Mt(t,e,i){const n=e*Math.min(i,1-i),a=(e,a=(e+t/30)%12)=>i-n*Math.max(Math.min(a-3,9-a,1),-1);return[a(0),a(8),a(4)]}function kt(t,e,i){const n=(n,a=(n+t/60)%6)=>i-i*e*Math.max(Math.min(a,4-a,1),0);return[n(5),n(3),n(1)]}function jt(t,e,i){const n=Mt(t,1,.5);let a;for(e+i>1&&(a=1/(e+i),e*=a,i*=a),a=0;a<3;a++)n[a]*=1-e-i,n[a]+=e;return n}function St(t){const e=t.r/255,i=t.g/255,n=t.b/255,a=Math.max(e,i,n),s=Math.min(e,i,n),r=(a+s)/2;let o,l,c;return a!==s&&(c=a-s,l=r>.5?c/(2-a-s):c/(a+s),o=a===e?(i-n)/c+(i=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=xt(t[3]))):(e=Rt(t,{r:0,g:0,b:0,a:1})).a=xt(e.a),e}function Ft(t){return"r"===t.charAt(0)?function(t){const e=wt.exec(t);let i,n,a,s=255;if(e){if(e[7]!==i){const t=+e[7];s=255&(e[8]?yt(t):255*t)}return i=+e[1],n=+e[3],a=+e[5],i=255&(e[2]?yt(i):i),n=255&(e[4]?yt(n):n),a=255&(e[6]?yt(a):a),{r:i,g:n,b:a,a:s}}}(t):function(t){const e=Ot.exec(t);let i,n=255;if(!e)return;e[5]!==i&&(n=e[6]?yt(+e[5]):xt(+e[5]));const a=Et(+e[2]),s=+e[3]/100,r=+e[4]/100;return i="hwb"===e[1]?function(t,e,i){return Dt(jt,t,e,i)}(a,s,r):"hsv"===e[1]?function(t,e,i){return Dt(kt,t,e,i)}(a,s,r):Pt(a,s,r),{r:i[0],g:i[1],b:i[2],a:n}}(t)}class It{constructor(t){if(t instanceof It)return t;const e=typeof t;let i;var n,a,s;"object"===e?i=Nt(t):"string"===e&&(s=(n=t).length,"#"===n[0]&&(4===s||5===s?a={r:255&17*dt[n[1]],g:255&17*dt[n[2]],b:255&17*dt[n[3]],a:5===s?17*dt[n[4]]:255}:7!==s&&9!==s||(a={r:dt[n[1]]<<4|dt[n[2]],g:dt[n[3]]<<4|dt[n[4]],b:dt[n[5]]<<4|dt[n[6]],a:9===s?dt[n[7]]<<4|dt[n[8]]:255})),i=a||function(t){At||(At=function(){const t={},e=Object.keys(Tt),i=Object.keys(Ct);let n,a,s,r,o;for(n=0;n>16&255,s>>8&255,255&s]}return t}(),At.transparent=[0,0,0,0]);const e=At[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}(t)||Ft(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Rt(this._rgb);return t&&(t.a=vt(t.a)),t}set rgb(t){this._rgb=Nt(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${vt(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):this._rgb;var t}hexString(){return this._valid?(t=this._rgb,e=function(t){return gt(t.r)&>(t.g)&>(t.b)&>(t.a)}(t)?ft:pt,t?"#"+e(t.r)+e(t.g)+e(t.b)+(t.a<255?e(t.a):""):t):this._rgb;var t,e}hslString(){return this._valid?function(t){if(!t)return;const e=St(t),i=e[0],n=_t(e[1]),a=_t(e[2]);return t.a<255?`hsla(${i}, ${n}%, ${a}%, ${vt(t.a)})`:`hsl(${i}, ${n}%, ${a}%)`}(this._rgb):this._rgb}mix(t,e){const i=this;if(t){const n=i.rgb,a=t.rgb;let s;const r=e===s?.5:e,o=2*r-1,l=n.a-a.a,c=((o*l==-1?o:(o+l)/(1+o*l))+1)/2;s=1-c,n.r=255&c*n.r+s*a.r+.5,n.g=255&c*n.g+s*a.g+.5,n.b=255&c*n.b+s*a.b+.5,n.a=r*n.a+(1-r)*a.a,i.rgb=n}return i}clone(){return new It(this.rgb)}alpha(t){return this._rgb.a=xt(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=mt(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Lt(this._rgb,2,t),this}darken(t){return Lt(this._rgb,2,-t),this}saturate(t){return Lt(this._rgb,1,t),this}desaturate(t){return Lt(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=St(t);i[0]=Et(i[0]+e),i=Pt(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}function zt(t){return new It(t)}const Bt=t=>t instanceof CanvasGradient||t instanceof CanvasPattern;function Vt(t){return Bt(t)?t:zt(t)}function Wt(t){return Bt(t)?t:zt(t).saturate(.5).darken(.1).hexString()}const Ht=Object.create(null),Ut=Object.create(null);function Yt(t,e){if(!e)return t;const i=e.split(".");for(let e=0,n=i.length;et.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>Wt(e.backgroundColor),this.hoverBorderColor=(t,e)=>Wt(e.borderColor),this.hoverColor=(t,e)=>Wt(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t)}set(t,e){return $t(this,t,e)}get(t){return Yt(this,t)}describe(t,e){return $t(Ut,t,e)}override(t,e){return $t(Ht,t,e)}route(t,e,i,n){const a=Yt(this,t),s=Yt(this,i),r="_"+e;Object.defineProperties(a,{[r]:{value:a[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[r],e=s[n];return b(t)?Object.assign({},e,t):v(t,e)},set(t){this[r]=t}}})}}({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function qt(t,e,i,n,a){let s=e[a];return s||(s=e[a]=t.measureText(a).width,i.push(a)),s>n&&(n=s),n}function Gt(t,e,i,n){let a=(n=n||{}).data=n.data||{},s=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(a=n.data={},s=n.garbageCollect=[],n.font=e),t.save(),t.font=e;let r=0;const o=i.length;let l,c,h,d,u;for(l=0;li.length){for(l=0;l0&&t.stroke()}}function Jt(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.xe.top-i&&t.y0&&""!==s.strokeColor;let l,c;for(t.save(),t.font=a.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),g(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,s),l=0;lv(t[i],t[e[i]]):e=>t[e]:()=>t;for(const t of a)i[t]=+s(t)||0;return i}function de(t){return he(t,{top:"y",right:"x",bottom:"y",left:"x"})}function ue(t){return he(t,["topLeft","topRight","bottomLeft","bottomRight"])}function fe(t){const e=de(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function pe(t,e){t=t||{},e=e||Xt.font;let i=v(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let n=v(t.style,e.style);n&&!(""+n).match(le)&&(console.warn('Invalid font style specified: "'+n+'"'),n="");const a={family:v(t.family,e.family),lineHeight:ce(v(t.lineHeight,e.lineHeight),i),size:i,style:n,weight:v(t.weight,e.weight),string:""};return a.string=function(t){return!t||g(t.size)||g(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(a),a}function ge(t,e,i,n){let a,s,r,o=!0;for(a=0,s=t.length;at[i]1;)n=s+a>>1,i(n)?s=n:a=n;return{lo:s,hi:a}}const ye=(t,e,i)=>be(t,i,n=>t[n][e]be(t,i,n=>t[n][e]>=i),ve=["push","pop","shift","splice","unshift"];function _e(t,e){const i=t._chartjs;if(!i)return;const n=i.listeners,a=n.indexOf(e);-1!==a&&n.splice(a,1),n.length>0||(ve.forEach(e=>{delete t[e]}),delete t._chartjs)}function we(t){const e=new Set;let i,n;for(i=0,n=t.length;it[0])){L(n)||(n=Le("_fallback",t));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:i,_fallback:n,_getTarget:a,override:a=>Oe([a,...t],e,i,n)};return new Proxy(s,{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,n)=>De(i,n,()=>function(t,e,i,n){let a;for(const s of e)if(a=Le(je(s,t),i),L(a))return Se(t,a)?Te(i,n,t,a):a}(n,e,t,i)),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>Re(t).includes(e),ownKeys:t=>Re(t),set(t,e,i){const n=t._storage||(t._storage=a());return t[e]=n[e]=i,delete t._keys,!0}})}function Me(t,e,i,n){const a={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:ke(t,n),setContext:e=>Me(t,e,i,n),override:a=>Me(t.override(a),e,i,n)};return new Proxy(a,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>De(t,e,()=>function(t,e,i){const{_proxy:n,_context:a,_subProxy:s,_descriptors:r}=t;let o=n[e];return R(o)&&r.isScriptable(e)&&(o=function(t,e,i,n){const{_proxy:a,_context:s,_subProxy:r,_stack:o}=i;if(o.has(t))throw new Error("Recursion detected: "+Array.from(o).join("->")+"->"+t);return o.add(t),e=e(s,r||n),o.delete(t),Se(t,e)&&(e=Te(a._scopes,a,t,e)),e}(e,o,t,i)),m(o)&&o.length&&(o=function(t,e,i,n){const{_proxy:a,_context:s,_subProxy:r,_descriptors:o}=i;if(L(s.index)&&n(t))e=e[s.index%e.length];else if(b(e[0])){const i=e,n=a._scopes.filter(t=>t!==i);e=[];for(const l of i){const i=Te(n,a,t,l);e.push(Me(i,s,r&&r[t],o))}}return e}(e,o,t,r.isIndexable)),Se(e,o)&&(o=Me(o,a,s&&s[e],r)),o}(t,e,i)),getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,i)=>Reflect.has(t,i),ownKeys:()=>Reflect.ownKeys(t),set:(e,i,n)=>(t[i]=n,delete e[i],!0)})}function ke(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:n=e.indexable,_allKeys:a=e.allKeys}=t;return{allKeys:a,scriptable:i,indexable:n,isScriptable:R(i)?i:()=>i,isIndexable:R(n)?n:()=>n}}const je=(t,e)=>t?t+A(e):e,Se=(t,e)=>b(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function De(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const n=i();return t[e]=n,n}function Pe(t,e,i){return R(t)?t(e,i):t}const Ee=(t,e)=>!0===t?e:"string"==typeof t?T(e,t):void 0;function Ce(t,e,i,n,a){for(const s of e){const e=Ee(i,s);if(e){t.add(e);const s=Pe(e._fallback,i,a);if(L(s)&&s!==i&&s!==n)return s}else if(!1===e&&L(n)&&i!==n)return null}return!1}function Te(t,e,i,n){const a=e._rootScopes,s=Pe(e._fallback,i,n),r=[...t,...a],o=new Set;o.add(n);let l=Ae(o,r,i,s||i,n);return null!==l&&(!L(s)||s===i||(l=Ae(o,r,s,l,n),null!==l))&&Oe(Array.from(o),[""],a,s,()=>function(t,e,i){const n=t._getTarget();e in n||(n[e]={});const a=n[e];return m(a)&&b(i)?i:a}(e,i,n))}function Ae(t,e,i,n,a){for(;i;)i=Ce(t,e,i,n,a);return i}function Le(t,e){for(const i of e){if(!i)continue;const e=i[t];if(L(e))return e}}function Re(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter(t=>!t.startsWith("_")))e.add(t);return Array.from(e)}(t._scopes)),e}const Ne=Number.EPSILON||1e-14,Fe=(t,e)=>e"x"===t?"y":"x";function ze(t,e,i,n){const a=t.skip?e:t,s=e,r=i.skip?e:i,o=et(s,a),l=et(r,s);let c=o/(o+l),h=l/(o+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=n*c,u=n*h;return{previous:{x:s.x-d*(r.x-a.x),y:s.y-d*(r.y-a.y)},next:{x:s.x+u*(r.x-a.x),y:s.y+u*(r.y-a.y)}}}function Be(t,e,i){return Math.max(Math.min(t,i),e)}function Ve(t,e,i,n,a){let s,r,o,l;if(e.spanGaps&&(t=t.filter(t=>!t.skip)),"monotone"===e.cubicInterpolationMode)!function(t,e="x"){const i=Ie(e),n=t.length,a=Array(n).fill(0),s=Array(n);let r,o,l,c=Fe(t,0);for(r=0;rwindow.getComputedStyle(t,null),$e=["top","right","bottom","left"];function Xe(t,e,i){const n={};i=i?"-"+i:"";for(let a=0;a<4;a++){const s=$e[a];n[s]=parseFloat(t[e+"-"+s+i])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function qe(t,e){const{canvas:i,currentDevicePixelRatio:n}=e,a=Ye(i),s="border-box"===a.boxSizing,r=Xe(a,"padding"),o=Xe(a,"border","width"),{x:l,y:c,box:h}=function(t,e){const i=t.native||t,n=i.touches,a=n&&n.length?n[0]:i,{offsetX:s,offsetY:r}=a;let o,l,c=!1;if(((t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot))(s,r,i.target))o=s,l=r;else{const t=e.getBoundingClientRect();o=a.clientX-t.left,l=a.clientY-t.top,c=!0}return{x:o,y:l,box:c}}(t,i),d=r.left+(h&&o.left),u=r.top+(h&&o.top);let{width:f,height:p}=e;return s&&(f-=r.width+o.width,p-=r.height+o.height),{x:Math.round((l-d)/f*i.width/n),y:Math.round((c-u)/p*i.height/n)}}const Ge=t=>Math.round(10*t)/10;function Qe(t,e,i){const n=e||1,a=Math.floor(t.height*n),s=Math.floor(t.width*n);t.height=a/n,t.width=s/n;const r=t.canvas;return r.style&&(i||!r.style.height&&!r.style.width)&&(r.style.height=t.height+"px",r.style.width=t.width+"px"),(t.currentDevicePixelRatio!==n||r.height!==a||r.width!==s)&&(t.currentDevicePixelRatio=n,r.height=a,r.width=s,t.ctx.setTransform(n,0,0,n,0,0),!0)}const Ke=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(t){}return t}();function Ze(t,e){const i=function(t,e){return Ye(t).getPropertyValue(e)}(t,e),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function Je(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function ti(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:"middle"===n?i<.5?t.y:e.y:"after"===n?i<1?t.y:e.y:i>0?e.y:t.y}}function ei(t,e,i,n){const a={x:t.cp2x,y:t.cp2y},s={x:e.cp1x,y:e.cp1y},r=Je(t,a,i),o=Je(a,s,i),l=Je(s,e,i),c=Je(r,o,i),h=Je(o,l,i);return Je(c,h,i)}const ii=new Map;function ni(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let n=ii.get(i);return n||(n=new Intl.NumberFormat(t,e),ii.set(i,n)),n}(e,i).format(t)}function ai(t,e,i){return t?function(t,e){return{x:i=>t+t+e-i,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,i):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function si(t){return"angle"===t?{between:at,compare:it,normalize:nt}:{between:rt,compare:(t,e)=>t-e,normalize:t=>t}}function ri({start:t,end:e,count:i,loop:n,style:a}){return{start:t%i,end:e%i,loop:n&&(e-t+1)%i==0,style:a}}function oi(t,e,i){if(!i)return[t];const{property:n,start:a,end:s}=i,r=e.length,{compare:o,between:l,normalize:c}=si(n),{start:h,end:d,loop:u,style:f}=function(t,e,i){const{property:n,start:a,end:s}=i,{between:r,normalize:o}=si(n),l=e.length;let c,h,{start:d,end:u,loop:f}=t;if(f){for(d+=l,u+=l,c=0,h=l;cn({chart:t,initial:e.initial,numSteps:s,currentStep:Math.min(i-e.start,s)}))}_refresh(){this._request||(this._running=!0,this._request=h.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,n)=>{if(!i.running||!i.items.length)return;const a=i.items;let s,r=a.length-1,o=!1;for(;r>=0;--r)s=a[r],s._active?(s._total>i.duration&&(i.duration=s._total),s.tick(t),o=!0):(a[r]=a[a.length-1],a.pop());o&&(n.draw(),this._notify(n,i,t,"progress")),a.length||(i.running=!1,this._notify(n,i,t,"complete"),i.initial=!1),e+=a.length}),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((t,e)=>Math.max(t,e._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let n=i.length-1;for(;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}};const ui={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const n=Vt(t||"transparent"),a=n.valid&&Vt(e||"transparent");return a&&a.valid?a.mix(n,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class fi{constructor(t,e,i,n){const a=e[i];n=ge([t.to,n,a,t.from]);const s=ge([t.from,a,n]);this._active=!0,this._fn=t.fn||ui[t.type||typeof s],this._easing=ht[t.easing]||ht.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=s,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const n=this._target[this._prop],a=i-this._start,s=this._duration-a;this._start=i,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=a,this._loop=!!t.loop,this._to=ge([t.to,e,n,t.from]),this._from=ge([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,n=this._prop,a=this._from,s=this._loop,r=this._to;let o;if(this._active=a!==r&&(s||e1?2-o:o,o=this._easing(Math.min(1,Math.max(0,o))),this._target[n]=this._fn(a,r,o))}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let t=0;t"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),Xt.set("animations",{colors:{type:"color",properties:["color","borderColor","backgroundColor"]},numbers:{type:"number",properties:["x","y","borderWidth","radius","tension"]}}),Xt.describe("animations",{_fallback:"animation"}),Xt.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}});class gi{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!b(t))return;const e=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const n=t[i];if(!b(n))return;const a={};for(const t of pi)a[t]=n[t];(m(n.properties)&&n.properties||[i]).forEach(t=>{t!==i&&e.has(t)||e.set(t,a)})})}_animateOptions(t,e){const i=e.options,n=function(t,e){if(!e)return;let i=t.options;if(i)return i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i;t.options=e}(t,i);if(!n)return[];const a=this._createAnimations(n,i);return i.$shared&&function(t,e){const i=[],n=Object.keys(e);for(let e=0;e{t.options=i},()=>{}),a}_createAnimations(t,e){const i=this._properties,n=[],a=t.$animations||(t.$animations={}),s=Object.keys(e),r=Date.now();let o;for(o=s.length-1;o>=0;--o){const l=s[o];if("$"===l.charAt(0))continue;if("options"===l){n.push(...this._animateOptions(t,e));continue}const c=e[l];let h=a[l];const d=i.get(l);if(h){if(d&&h.active()){h.update(d,c,r);continue}h.cancel()}d&&d.duration?(a[l]=h=new fi(d,t,l,c),n.push(h)):t[l]=c}return n}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(di.add(this._chart,i),!0):void 0}}function mi(t,e){const i=t&&t.options||{},n=i.reverse,a=void 0===i.min?e:0,s=void 0===i.max?e:0;return{start:n?s:a,end:n?a:s}}function bi(t,e){const i=[],n=t._getSortedDatasetMetas(e);let a,s;for(a=0,s=n.length;a0||!i&&e<0)return a.index}return null}function wi(t,e){const{chart:i,_cachedMeta:n}=t,a=i._stacks||(i._stacks={}),{iScale:s,vScale:r,index:o}=n,l=s.axis,c=r.axis,h=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(s,r,n),d=e.length;let u;for(let t=0;ti[t].axis===e).shift()}function Mi(t,e){const i=t.controller.index,n=t.vScale&&t.vScale.axis;if(n){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[n]||void 0===e[n][i])return;delete e[n][i]}}}const ki=t=>"reset"===t||"none"===t,ji=(t,e)=>e?t:Object.assign({},t);class Si{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=xi(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&Mi(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=(t,e,i,n)=>"x"===t?e:"r"===t?n:i,a=e.xAxisID=v(i.xAxisID,Oi(t,"x")),s=e.yAxisID=v(i.yAxisID,Oi(t,"y")),r=e.rAxisID=v(i.rAxisID,Oi(t,"r")),o=e.indexAxis,l=e.iAxisID=n(o,a,s,r),c=e.vAxisID=n(o,s,a,r);e.xScale=this.getScaleForId(a),e.yScale=this.getScaleForId(s),e.rScale=this.getScaleForId(r),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&_e(this._data,this),t._stacked&&Mi(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(b(e))this._data=function(t){const e=Object.keys(t),i=new Array(e.length);let n,a,s;for(n=0,a=e.length;n{const e="_onData"+A(t),i=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...t){const a=i.apply(this,t);return n._chartjs.listeners.forEach(i=>{"function"==typeof i[e]&&i[e](...t)}),a}})}))),this._syncList=[],this._data=e}var n}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let n=!1;this._dataCheck();const a=e._stacked;e._stacked=xi(e.vScale,e),e.stack!==i.stack&&(n=!0,Mi(e),e.stack=i.stack),this._resyncElements(t),(n||a!==e._stacked)&&wi(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:n}=this,{iScale:a,_stacked:s}=i,r=a.axis;let o,l,c,h=0===t&&e===n.length||i._sorted,d=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=n,i._sorted=!0,c=n;else{c=m(n[t])?this.parseArrayData(i,n,t,e):b(n[t])?this.parseObjectData(i,n,t,e):this.parsePrimitiveData(i,n,t,e);const a=()=>null===l[r]||d&&l[r]t&&!e.hidden&&e._stacked&&{keys:bi(i,!0),values:null})(e,i,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:h}=function(t){const{min:e,max:i,minDefined:n,maxDefined:a}=t.getUserBounds();return{min:n?e:Number.NEGATIVE_INFINITY,max:a?i:Number.POSITIVE_INFINITY}}(r);let d,u;function f(){u=n[d];const e=u[r.axis];return!y(u[t.axis])||c>e||h=0;--d)if(!f()){this.updateRangeFromParsed(l,t,u,o);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let n,a,s;for(n=0,a=e.length;n=0&&tthis.getContext(i,n),h);return f.$shared&&(f.$shared=o,a[s]=Object.freeze(ji(f,o))),f}_resolveAnimations(t,e,i){const n=this.chart,a=this._cachedDataOpts,s="animation-"+e,r=a[s];if(r)return r;let o;if(!1!==n.options.animation){const n=this.chart.config,a=n.datasetAnimationScopeKeys(this._type,e),s=n.getOptionScopes(this.getDataset(),a);o=n.createResolver(s,this.getContext(t,i,e))}const l=new gi(n,o&&o.animations);return o&&o._cacheable&&(a[s]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||ki(t)||this.chart._animationsDisabled}updateElement(t,e,i,n){ki(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!ki(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;const a=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(a)||a})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];const n=i.length,a=e.length,s=Math.min(a,n);s&&this.parse(0,s),a>n?this._insertElements(n,a-n,t):a{for(t.length+=e,r=t.length-1;r>=s;r--)t[r]=t[r-e]};for(o(a),r=t;rt-e))}return t._cache.$bar}(e,t.type);let n,a,s,r,o=e._length;const l=()=>{32767!==s&&-32768!==s&&(L(r)&&(o=Math.min(o,Math.abs(s-r)||o)),r=s)};for(n=0,a=i.length;nMath.abs(o)&&(l=o,c=r),e[i.axis]=c,e._custom={barStart:l,barEnd:c,start:a,end:s,min:r,max:o}}(t,e,i,n):e[i.axis]=i.parse(t,n),e}function Ei(t,e,i,n){const a=t.iScale,s=t.vScale,r=a.getLabels(),o=a===s,l=[];let c,h,d,u;for(c=i,h=i+n;ct.x,i="left",n="right"):(e=t.base=i?1:-1)}(h,e,s)*a,d===s&&(m-=h/2),c=m+h),m===e.getPixelForValue(s)){const t=$(h)*e.getLineWidthForValue(s)/2;m+=t,h-=t}return{size:h,base:m,head:c,center:c+h/2}}_calculateBarIndexPixels(t,e){const i=e.scale,n=this.options,a=n.skipNull,s=v(n.maxBarThickness,1/0);let r,o;if(e.grouped){const i=a?this._getStackCount(t):e.stackCount,l="flex"===n.barThickness?function(t,e,i,n){const a=e.pixels,s=a[t];let r=t>0?a[t-1]:null,o=t=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,{xScale:i,yScale:n}=e,a=this.getParsed(t),s=i.getLabelForValue(a.x),r=n.getLabelForValue(a.y),o=a._custom;return{label:e.label,value:"("+s+", "+r+(o?", "+o:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,n){const a="reset"===n,{iScale:s,vScale:r}=this._cachedMeta,o=this.resolveDataElementOptions(e,n),l=this.getSharedOptions(o),c=this.includeOptions(n,l),h=s.axis,d=r.axis;for(let o=e;o""}}}};class Ii extends Si{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,n=this._cachedMeta;if(!1===this._parsing)n._parsed=i;else{let a,s,r=t=>+i[t];if(b(i[t])){const{key:t="value"}=this._parsing;r=e=>+T(i[e],t)}for(a=t,s=t+e;aat(t,o,l,!0)?1:Math.max(e,e*i,n,n*i),p=(t,e,n)=>at(t,o,l,!0)?-1:Math.min(e,e*i,n,n*i),g=f(0,c,d),m=f(W,h,u),b=p(F,c,d),y=p(F+W,h,u);n=(g-b)/2,a=(m-y)/2,s=-(g+b)/2,r=-(m+y)/2}return{ratioX:n,ratioY:a,offsetX:s,offsetY:r}}(u,d,o),b=(i.width-s)/f,y=(i.height-s)/p,x=Math.max(Math.min(b,y)/2,0),v=_(this.options.radius,x),w=(v-Math.max(v*o,0))/this._getVisibleDatasetWeightTotal();this.offsetX=g*v,this.offsetY=m*v,n.total=this.calculateTotal(),this.outerRadius=v-w*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-w*h,0),this.updateElements(a,0,a.length,t)}_circumference(t,e){const i=this.options,n=this._cachedMeta,a=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===n._parsed[t]||n.data[t].hidden?0:this.calculateCircumference(n._parsed[t]*a/I)}updateElements(t,e,i,n){const a="reset"===n,s=this.chart,r=s.chartArea,o=s.options.animation,l=(r.left+r.right)/2,c=(r.top+r.bottom)/2,h=a&&o.animateScale,d=h?0:this.innerRadius,u=h?0:this.outerRadius,f=this.resolveDataElementOptions(e,n),p=this.getSharedOptions(f),g=this.includeOptions(n,p);let m,b=this._getRotation();for(m=0;m0&&!isNaN(t)?I*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],a=ni(e._parsed[t],i.options.locale);return{label:n[t]||"",value:a}}getMaxBorderWidth(t){let e=0;const i=this.chart;let n,a,s,r,o;if(!t)for(n=0,a=i.data.datasets.length;n"spacing"!==t,_indexable:t=>"spacing"!==t},Ii.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map((e,n)=>{const a=t.getDatasetMeta(0).controller.getStyle(n);return{text:e,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,lineWidth:a.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label(t){let e=t.label;const i=": "+t.formattedValue;return m(e)?(e=e.slice(),e[0]+=i):e+=i,e}}}}};class zi extends Si{initialize(){this.enableOptionSharing=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:n=[],_dataset:a}=e,s=this.chart._animationsDisabled;let{start:r,count:o}=function(t,e,i){const n=e.length;let a=0,s=n;if(t._sorted){const{iScale:r,_parsed:o}=t,l=r.axis,{min:c,max:h,minDefined:d,maxDefined:u}=r.getUserBounds();d&&(a=st(Math.min(ye(o,r.axis,c).lo,i?n:ye(e,l,r.getPixelForValue(c)).lo),0,n-1)),s=u?st(Math.max(ye(o,r.axis,h).hi+1,i?0:ye(e,l,r.getPixelForValue(h)).hi+1),a,n)-a:n-a}return{start:a,count:s}}(e,n,s);this._drawStart=r,this._drawCount=o,function(t){const{xScale:e,yScale:i,_scaleRanges:n}=t,a={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!n)return t._scaleRanges=a,!0;const s=n.xmin!==e.min||n.xmax!==e.max||n.ymin!==i.min||n.ymax!==i.max;return Object.assign(n,a),s}(e)&&(r=0,o=n.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!a._decimated,i.points=n;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!s,options:l},t),this.updateElements(n,r,o,t)}updateElements(t,e,i,n){const a="reset"===n,{iScale:s,vScale:r,_stacked:o,_dataset:l}=this._cachedMeta,c=this.resolveDataElementOptions(e,n),h=this.getSharedOptions(c),d=this.includeOptions(n,h),u=s.axis,f=r.axis,{spanGaps:p,segment:m}=this.options,b=q(p)?p:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||a||"none"===n;let x=e>0&&this.getParsed(e-1);for(let c=e;c0&&i[u]-x[u]>b,m&&(p.parsed=i,p.raw=l.data[c]),d&&(p.options=h||this.resolveDataElementOptions(c,e.active?"active":n)),y||this.updateElement(e,c,p,n),x=i}this.updateSharedOptions(h,n,c)}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return i;const a=n[0].size(this.resolveDataElementOptions(0)),s=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,a,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}zi.id="line",zi.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},zi.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class Bi extends Si{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],a=ni(e._parsed[t].r,i.options.locale);return{label:n[t]||"",value:a}}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),a=Math.max(n/2,0),s=(a-Math.max(i.cutoutPercentage?a/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=a-s*this.index,this.innerRadius=this.outerRadius-s}updateElements(t,e,i,n){const a="reset"===n,s=this.chart,r=this.getDataset(),o=s.options.animation,l=this._cachedMeta.rScale,c=l.xCenter,h=l.yCenter,d=l.getIndexAngle(0)-.5*F;let u,f=d;const p=360/this.countVisibleElements();for(u=0;u{!isNaN(t.data[n])&&this.chart.getDataVisibility(n)&&i++}),i}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?K(this.resolveDataElementOptions(t,e).angle||i):0}}Bi.id="polarArea",Bi.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},Bi.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map((e,n)=>{const a=t.getDatasetMeta(0).controller.getStyle(n);return{text:e,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,lineWidth:a.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label:t=>t.chart.data.labels[t.dataIndex]+": "+t.formattedValue}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class Vi extends Ii{}Vi.id="pie",Vi.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Wi extends Si{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}update(t){const e=this._cachedMeta,i=e.dataset,n=e.data||[],a=e.iScale.getLabels();if(i.points=n,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const s={_loop:!0,_fullLoop:a.length===n.length,options:e};this.updateElement(i,void 0,s,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,i,n){const a=this.getDataset(),s=this._cachedMeta.rScale,r="reset"===n;for(let o=e;o"",label:t=>"("+t.label+", "+t.formattedValue+")"}}},scales:{x:{type:"linear"},y:{type:"linear"}}};class Yi{constructor(t){this.options=t||{}}formats(){return Ui()}parse(t,e){return Ui()}format(t,e){return Ui()}add(t,e,i){return Ui()}diff(t,e,i){return Ui()}startOf(t,e,i){return Ui()}endOf(t,e){return Ui()}}Yi.override=function(t){Object.assign(Yi.prototype,t)};var $i={_date:Yi};function Xi(t,e){return"native"in t?{x:t.x,y:t.y}:qe(t,e)}function qi(t,e,i,n){const{controller:a,data:s,_sorted:r}=t,o=a._cachedMeta.iScale;if(o&&e===o.axis&&"r"!==e&&r&&s.length){const t=o._reversePixels?xe:ye;if(!n)return t(s,e,i);if(a._sharedOptions){const n=s[0],a="function"==typeof n.getRange&&n.getRange(e);if(a){const n=t(s,e,i-a),r=t(s,e,i+a);return{lo:n.lo,hi:r.hi}}}}return{lo:0,hi:s.length-1}}function Gi(t,e,i,n,a){const s=t.getSortedVisibleDatasetMetas(),r=i[e];for(let t=0,i=s.length;t{t[o](a[r],n)&&s.push({element:t,datasetIndex:e,index:i}),t.inRange(a.x,a.y,n)&&(l=!0)}),i.intersect&&!l?[]:s}var Ji={modes:{index(t,e,i,n){const a=Xi(e,t),s=i.axis||"x",r=i.intersect?Qi(t,a,s,n):Ki(t,a,s,!1,n),o=[];return r.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{const e=r[0].index,i=t.data[e];i&&!i.skip&&o.push({element:i,datasetIndex:t.index,index:e})}),o):[]},dataset(t,e,i,n){const a=Xi(e,t),s=i.axis||"xy";let r=i.intersect?Qi(t,a,s,n):Ki(t,a,s,!1,n);if(r.length>0){const e=r[0].datasetIndex,i=t.getDatasetMeta(e).data;r=[];for(let t=0;tQi(t,Xi(e,t),i.axis||"xy",n),nearest:(t,e,i,n)=>Ki(t,Xi(e,t),i.axis||"xy",i.intersect,n),x:(t,e,i,n)=>Zi(t,e,{axis:"x",intersect:i.intersect},n),y:(t,e,i,n)=>Zi(t,e,{axis:"y",intersect:i.intersect},n)}};const tn=["left","top","right","bottom"];function en(t,e){return t.filter(t=>t.pos===e)}function nn(t,e){return t.filter(t=>-1===tn.indexOf(t.pos)&&t.box.axis===e)}function an(t,e){return t.sort((t,i)=>{const n=e?i:t,a=e?t:i;return n.weight===a.weight?n.index-a.index:n.weight-a.weight})}function sn(t,e,i,n){return Math.max(t[i],e[i])+Math.max(t[n],e[n])}function rn(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function on(t,e,i,n){const{pos:a,box:s}=i,r=t.maxPadding;if(!b(a)){i.size&&(t[a]-=i.size);const e=n[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?s.height:s.width),i.size=e.size/e.count,t[a]+=i.size}s.getPadding&&rn(r,s.getPadding());const o=Math.max(0,e.outerWidth-sn(r,t,"left","right")),l=Math.max(0,e.outerHeight-sn(r,t,"top","bottom")),c=o!==t.w,h=l!==t.h;return t.w=o,t.h=l,i.horizontal?{same:c,other:h}:{same:h,other:c}}function ln(t,e){const i=e.maxPadding;return function(t){const n={left:0,top:0,right:0,bottom:0};return t.forEach(t=>{n[t]=Math.max(e[t],i[t])}),n}(t?["left","right"]:["top","bottom"])}function cn(t,e,i,n){const a=[];let s,r,o,l,c,h;for(s=0,r=t.length,c=0;st.box.fullSize),!0),n=an(en(e,"left"),!0),a=an(en(e,"right")),s=an(en(e,"top"),!0),r=an(en(e,"bottom")),o=nn(e,"x"),l=nn(e,"y");return{fullSize:i,leftAndTop:n.concat(s),rightAndBottom:a.concat(l).concat(r).concat(o),chartArea:en(e,"chartArea"),vertical:n.concat(a).concat(l),horizontal:s.concat(r).concat(o)}}(t.boxes),l=o.vertical,c=o.horizontal;O(t.boxes,t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()});const h=l.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1,d=Object.freeze({outerWidth:e,outerHeight:i,padding:a,availableWidth:s,availableHeight:r,vBoxMaxWidth:s/2/h,hBoxMaxHeight:r/2}),u=Object.assign({},a);rn(u,fe(n));const f=Object.assign({maxPadding:u,w:s,h:r,x:a.left,y:a.top},a),p=function(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:n,stackWeight:a}=i;if(!t||!tn.includes(n))continue;const s=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=a}return e}(t),{vBoxMaxWidth:n,hBoxMaxHeight:a}=e;let s,r,o;for(s=0,r=t.length;s{const i=e.box;Object.assign(i,t.chartArea),i.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class fn{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}isAttached(t){return!0}updateConfig(t){}}class pn extends fn{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const gn={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},mn=t=>null===t||""===t,bn=!!Ke&&{passive:!0};function yn(t,e,i){t.canvas.removeEventListener(e,i,bn)}function xn(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function vn(t,e,i){const n=t.canvas,a=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||xn(i.addedNodes,n),e=e&&!xn(i.removedNodes,n);e&&i()});return a.observe(document,{childList:!0,subtree:!0}),a}function wn(t,e,i){const n=t.canvas,a=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||xn(i.removedNodes,n),e=e&&!xn(i.addedNodes,n);e&&i()});return a.observe(document,{childList:!0,subtree:!0}),a}const On=new Map;let Mn=0;function kn(){const t=window.devicePixelRatio;t!==Mn&&(Mn=t,On.forEach((e,i)=>{i.currentDevicePixelRatio!==t&&e()}))}function jn(t,e,i){const n=t.canvas,a=n&&He(n);if(!a)return;const s=d((t,e)=>{const n=a.clientWidth;i(t,e),n{const e=t[0],i=e.contentRect.width,n=e.contentRect.height;0===i&&0===n||s(i,n)});return r.observe(a),function(t,e){On.size||window.addEventListener("resize",kn),On.set(t,e)}(t,s),r}function Sn(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){On.delete(t),On.size||window.removeEventListener("resize",kn)}(t)}function Dn(t,e,i){const n=t.canvas,a=d(e=>{null!==t.ctx&&i(function(t,e){const i=gn[t.type]||t.type,{x:n,y:a}=qe(t,e);return{type:i,chart:e,native:t,x:void 0!==n?n:null,y:void 0!==a?a:null}}(e,t))},t,t=>{const e=t[0];return[e,e.offsetX,e.offsetY]});return function(t,e,i){t.addEventListener(e,i,bn)}(n,e,a),a}class Pn extends fn{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,n=t.getAttribute("height"),a=t.getAttribute("width");if(t.$chartjs={initial:{height:n,width:a,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",mn(a)){const e=Ze(t,"width");void 0!==e&&(t.width=e)}if(mn(n))if(""===t.style.height)t.height=t.width/(e||2);else{const e=Ze(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e.$chartjs)return!1;const i=e.$chartjs.initial;["height","width"].forEach(t=>{const n=i[t];g(n)?e.removeAttribute(t):e.setAttribute(t,n)});const n=i.style||{};return Object.keys(n).forEach(t=>{e.style[t]=n[t]}),e.width=e.width,delete e.$chartjs,!0}addEventListener(t,e,i){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),a={attach:vn,detach:wn,resize:jn}[e]||Dn;n[e]=a(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),n=i[e];n&&(({attach:Sn,detach:Sn,resize:Sn}[e]||yn)(t,e,n),i[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return function(t,e,i,n){const a=Ye(t),s=Xe(a,"margin"),r=Ue(a.maxWidth,t,"clientWidth")||B,o=Ue(a.maxHeight,t,"clientHeight")||B,l=function(t,e,i){let n,a;if(void 0===e||void 0===i){const s=He(t);if(s){const t=s.getBoundingClientRect(),r=Ye(s),o=Xe(r,"border","width"),l=Xe(r,"padding");e=t.width-l.width-o.width,i=t.height-l.height-o.height,n=Ue(r.maxWidth,s,"clientWidth"),a=Ue(r.maxHeight,s,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:n||B,maxHeight:a||B}}(t,e,i);let{width:c,height:h}=l;if("content-box"===a.boxSizing){const t=Xe(a,"border","width"),e=Xe(a,"padding");c-=e.width+t.width,h-=e.height+t.height}return c=Math.max(0,c-s.width),h=Math.max(0,n?Math.floor(c/n):h-s.height),c=Ge(Math.min(c,r,l.maxWidth)),h=Ge(Math.min(h,o,l.maxHeight)),c&&!h&&(h=Ge(c/2)),{width:c,height:h}}(t,e,i,n)}isAttached(t){const e=He(t);return!(!e||!e.isConnected)}}class En{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return q(this.x)&&q(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const n={};return t.forEach(t=>{n[t]=i[t]&&i[t].active()?i[t]._to:this[t]}),n}}En.defaults={},En.defaultRoutes=void 0;const Cn={values:t=>m(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";const n=this.chart.options.locale;let a,s=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(a="scientific"),s=function(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t)),i}(t,i)}const r=Y(Math.abs(s)),o=Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:a,minimumFractionDigits:o,maximumFractionDigits:o};return Object.assign(l,this.options.ticks.format),ni(t,n,l)},logarithmic(t,e,i){if(0===t)return"0";const n=t/Math.pow(10,Math.floor(Y(t)));return 1===n||2===n||5===n?Cn.numeric.call(this,t,e,i):""}};var Tn={formatters:Cn};function An(t,e,i,n,a){const s=v(n,0),r=Math.min(v(a,t.length),t.length);let o,l,c,h=0;for(i=Math.ceil(i),a&&(o=a-n,i=o/Math.floor(o/i)),c=s;c<0;)h++,c=Math.round(s+h*i);for(l=Math.max(s,0);le.lineWidth,tickColor:(t,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Tn.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),Xt.route("scale.ticks","color","","color"),Xt.route("scale.grid","color","","borderColor"),Xt.route("scale.grid","borderColor","","borderColor"),Xt.route("scale.title","color","","color"),Xt.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t}),Xt.describe("scales",{_fallback:"scale"}),Xt.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t});const Ln=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i;function Rn(t,e){const i=[],n=t.length/e,a=t.length;let s=0;for(;sr+1e-6)))return l}function Fn(t){return t.drawTicks?t.tickLength:0}function In(t,e){if(!t.display)return 0;const i=pe(t.font,e),n=fe(t.padding);return(m(t.text)?t.text.length:1)*i.lineHeight+n.height}function zn(t,e,i){let n=(t=>"start"===t?"left":"end"===t?"right":"center")(t);return(i&&"right"!==e||!i&&"right"===e)&&(n=(t=>"left"===t?"right":"right"===t?"left":t)(n)),n}class Bn extends En{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:n}=this;return t=x(t,Number.POSITIVE_INFINITY),e=x(e,Number.NEGATIVE_INFINITY),i=x(i,Number.POSITIVE_INFINITY),n=x(n,Number.NEGATIVE_INFINITY),{min:x(t,i),max:x(e,n),minDefined:y(t),maxDefined:y(e)}}getMinMax(t){let e,{min:i,max:n,minDefined:a,maxDefined:s}=this.getUserBounds();if(a&&s)return{min:i,max:n};const r=this.getMatchingVisibleMetas();for(let o=0,l=r.length;on?n:i,n=a&&i>n?i:n,{min:x(i,x(n,i)),max:x(n,x(i,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){w(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:n,grace:a,ticks:s}=this.options,r=s.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(t,e,i){const{min:n,max:a}=t,s=_(e,(a-n)/2),r=(t,e)=>i&&0===t?0:t+e;return{min:r(n,-Math.abs(s)),max:r(a,s)}}(this,a,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const o=rn)return function(t,e,i,n){let a,s=0,r=i[0];for(n=Math.ceil(n),a=0;at-e).pop(),e}(n);for(let t=0,e=s.length-1;ta)return e}return Math.max(a,1)}(a,e,n);if(s>0){let t,i;const n=s>1?Math.round((o-r)/(s-1)):null;for(An(e,l,c,g(n)?0:r-n,r),t=0,i=s-1;t=a||i<=1||!this.isHorizontal())return void(this.labelRotation=n);const c=this._getLabelSizes(),h=c.widest.width,d=c.highest.height,u=st(this.chart.width-h,0,this.maxWidth);s=t.offset?this.maxWidth/i:u/(i-1),h+6>s&&(s=u/(i-(t.offset?.5:1)),r=this.maxHeight-Fn(t.grid)-e.padding-In(t.title,this.chart.options.font),o=Math.sqrt(h*h+d*d),l=Z(Math.min(Math.asin(st((c.highest.height+6)/s,-1,1)),Math.asin(st(r/o,-1,1))-Math.asin(st(d/o,-1,1)))),l=Math.max(n,Math.min(a,l))),this.labelRotation=l}afterCalculateLabelRotation(){w(this.options.afterCalculateLabelRotation,[this])}beforeFit(){w(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:n,grid:a}}=this,s=this._isVisible(),r=this.isHorizontal();if(s){const s=In(n,e.options.font);if(r?(t.width=this.maxWidth,t.height=Fn(a)+s):(t.height=this.maxHeight,t.width=Fn(a)+s),i.display&&this.ticks.length){const{first:e,last:n,widest:a,highest:s}=this._getLabelSizes(),o=2*i.padding,l=K(this.labelRotation),c=Math.cos(l),h=Math.sin(l);if(r){const e=i.mirror?0:h*a.width+c*s.height;t.height=Math.min(this.maxHeight,t.height+e+o)}else{const e=i.mirror?0:c*a.width+h*s.height;t.width=Math.min(this.maxWidth,t.width+e+o)}this._calculatePadding(e,n,h,c)}}this._handleMargins(),r?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,n){const{ticks:{align:a,padding:s},position:r}=this.options,o=0!==this.labelRotation,l="top"!==r&&"x"===this.axis;if(this.isHorizontal()){const r=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,d=0;o?l?(h=n*t.width,d=i*e.height):(h=i*t.height,d=n*e.width):"start"===a?d=e.width:"end"===a?h=t.width:(h=t.width/2,d=e.width/2),this.paddingLeft=Math.max((h-r+s)*this.width/(this.width-r),0),this.paddingRight=Math.max((d-c+s)*this.width/(this.width-c),0)}else{let i=e.height/2,n=t.height/2;"start"===a?(i=0,n=t.height):"end"===a&&(i=e.height,n=0),this.paddingTop=i+s,this.paddingBottom=n+s}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){w(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e{const i=t.gc,n=i.length/2;let a;if(n>e){for(a=0;a({width:a[t]||0,height:s[t]||0});return{first:M(0),last:M(e-1),widest:M(_),highest:M(w),widths:a,heights:s}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return st(this._alignToPixels?Qt(this.chart,e,0):e,-32768,32767)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&tr*n?r/i:o/n:o*n0}_computeGridLineItems(t){const e=this.axis,i=this.chart,n=this.options,{grid:a,position:s}=n,r=a.offset,o=this.isHorizontal(),l=this.ticks.length+(r?1:0),c=Fn(a),h=[],d=a.setContext(this.getContext()),u=d.drawBorder?d.borderWidth:0,f=u/2,p=function(t){return Qt(i,t,u)};let g,m,y,x,_,w,O,M,k,j,S,D;if("top"===s)g=p(this.bottom),w=this.bottom-c,M=g-f,j=p(t.top)+f,D=t.bottom;else if("bottom"===s)g=p(this.top),j=t.top,D=p(t.bottom)-f,w=g+f,M=this.top+c;else if("left"===s)g=p(this.right),_=this.right-c,O=g-f,k=p(t.left)+f,S=t.right;else if("right"===s)g=p(this.left),k=t.left,S=p(t.right)-f,_=g+f,O=this.left+c;else if("x"===e){if("center"===s)g=p((t.top+t.bottom)/2+.5);else if(b(s)){const t=Object.keys(s)[0],e=s[t];g=p(this.chart.scales[t].getPixelForValue(e))}j=t.top,D=t.bottom,w=g+f,M=w+c}else if("y"===e){if("center"===s)g=p((t.left+t.right)/2);else if(b(s)){const t=Object.keys(s)[0],e=s[t];g=p(this.chart.scales[t].getPixelForValue(e))}_=g-f,O=_-c,k=t.left,S=t.right}const P=v(n.ticks.maxTicksLimit,l),E=Math.max(1,Math.ceil(l/P));for(m=0;me.value===t);return i>=0?e.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let a,s;const r=(t,e,n)=>{n.width&&n.color&&(i.save(),i.lineWidth=n.width,i.strokeStyle=n.color,i.setLineDash(n.borderDash||[]),i.lineDashOffset=n.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(a=0,s=n.length;a{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:i+1,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",n=[];let a,s;for(a=0,s=e.length;a{const n=i.split("."),a=n.pop(),s=[t].concat(n).join("."),r=e[i].split("."),o=r.pop(),l=r.join(".");Xt.route(s,a,l,o)})}(e,t.defaultRoutes),t.descriptors&&Xt.describe(e,t.descriptors)}(t,s,i),this.override&&Xt.override(t.id,t.overrides)),s}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,n=this.scope;i in e&&delete e[i],n&&i in Xt[n]&&(delete Xt[n][i],this.override&&delete Ht[i])}}var Wn=new class{constructor(){this.controllers=new Vn(Si,"datasets",!0),this.elements=new Vn(En,"elements"),this.plugins=new Vn(Object,"plugins"),this.scales=new Vn(Bn,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(e=>{const n=i||this._getRegistryForType(e);i||n.isForType(e)||n===this.plugins&&e.id?this._exec(t,n,e):O(e,e=>{const n=i||this._getRegistryForType(e);this._exec(t,n,e)})})}_exec(t,e,i){const n=A(t);w(i["before"+n],[],i),e[t](i),w(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;et.filter(t=>!e.some(e=>t.plugin.id===e.plugin.id));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}}function Un(t,e){return e||!1!==t?!0===t?{}:t:null}function Yn(t,e,i,n){const a=t.pluginScopeKeys(e),s=t.getOptionScopes(i,a);return t.createResolver(s,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function $n(t,e){const i=Xt.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function Xn(t,e){return"x"===t||"y"===t?t:e.axis||("top"===(i=e.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0)||t.charAt(0).toLowerCase();var i}function qn(t){const e=t.options||(t.options={});e.plugins=v(e.plugins,{}),e.scales=function(t,e){const i=Ht[t.type]||{scales:{}},n=e.scales||{},a=$n(t.type,e),s=Object.create(null),r=Object.create(null);return Object.keys(n).forEach(t=>{const e=n[t];if(!b(e))return console.error("Invalid scale configuration for scale: "+t);if(e._proxy)return console.warn("Ignoring resolver passed as options for scale: "+t);const o=Xn(t,e),l=function(t,e){return t===e?"_index_":"_value_"}(o,a),c=i.scales||{};s[o]=s[o]||t,r[t]=P(Object.create(null),[{axis:o},e,c[o],c[l]])}),t.data.datasets.forEach(i=>{const a=i.type||t.type,o=i.indexAxis||$n(a,e),l=(Ht[a]||{}).scales||{};Object.keys(l).forEach(t=>{const e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,o),a=i[e+"AxisID"]||s[e]||e;r[a]=r[a]||Object.create(null),P(r[a],[{axis:e},n[a],l[t]])})}),Object.keys(r).forEach(t=>{const e=r[t];P(e,[Xt.scales[e.type],Xt.scale])}),r}(t,e)}function Gn(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const Qn=new Map,Kn=new Set;function Zn(t,e){let i=Qn.get(t);return i||(i=e(),Qn.set(t,i),Kn.add(i)),i}const Jn=(t,e,i)=>{const n=T(e,i);void 0!==n&&t.add(n)};class ta{constructor(t){this._config=function(t){return(t=t||{}).data=Gn(t.data),qn(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Gn(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),qn(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Zn(t,()=>[["datasets."+t,""]])}datasetAnimationScopeKeys(t,e){return Zn(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,"transitions."+e],["datasets."+t,""]])}datasetElementScopeKeys(t,e){return Zn(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,"datasets."+t,"elements."+e,""]])}pluginScopeKeys(t){const e=t.id;return Zn(`${this.type}-plugin-${e}`,()=>[["plugins."+e,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let n=i.get(t);return n&&!e||(n=new Map,i.set(t,n)),n}getOptionScopes(t,e,i){const{options:n,type:a}=this,s=this._cachedScopes(t,i),r=s.get(e);if(r)return r;const o=new Set;e.forEach(e=>{t&&(o.add(t),e.forEach(e=>Jn(o,t,e))),e.forEach(t=>Jn(o,n,t)),e.forEach(t=>Jn(o,Ht[a]||{},t)),e.forEach(t=>Jn(o,Xt,t)),e.forEach(t=>Jn(o,Ut,t))});const l=Array.from(o);return 0===l.length&&l.push(Object.create(null)),Kn.has(e)&&s.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,Ht[e]||{},Xt.datasets[e]||{},{type:e},Xt,Ut]}resolveNamedOptions(t,e,i,n=[""]){const a={$shared:!0},{resolver:s,subPrefixes:r}=ea(this._resolverCache,t,n);let o=s;(function(t,e){const{isScriptable:i,isIndexable:n}=ke(t);for(const a of e){const e=i(a),s=n(a),r=(s||e)&&t[a];if(e&&(R(r)||ia(r))||s&&m(r))return!0}return!1})(s,e)&&(a.$shared=!1,o=Me(s,i=R(i)?i():i,this.createResolver(t,i,r)));for(const t of e)a[t]=o[t];return a}createResolver(t,e,i=[""],n){const{resolver:a}=ea(this._resolverCache,t,i);return b(e)?Me(a,e,void 0,n):a}}function ea(t,e,i){let n=t.get(e);n||(n=new Map,t.set(e,n));const a=i.join();let s=n.get(a);return s||(s={resolver:Oe(e,i),subPrefixes:i.filter(t=>!t.toLowerCase().includes("hover"))},n.set(a,s)),s}const ia=t=>b(t)&&Object.getOwnPropertyNames(t).reduce((e,i)=>e||R(t[i]),!1),na=["top","bottom","left","right","chartArea"];function aa(t,e){return"top"===t||"bottom"===t||-1===na.indexOf(t)&&"x"===e}function sa(t,e){return function(i,n){return i[t]===n[t]?i[e]-n[e]:i[t]-n[t]}}function ra(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),w(i&&i.onComplete,[t],e)}function oa(t){const e=t.chart,i=e.options.animation;w(i&&i.onProgress,[t],e)}function la(t){return We()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const ca={},ha=t=>{const e=la(t);return Object.values(ca).filter(t=>t.canvas===e).pop()};function da(t,e,i){const n=Object.keys(t);for(const a of n){const n=+a;if(n>=e){const s=t[a];delete t[a],(i>0||n>e)&&(t[n+i]=s)}}}class ua{constructor(t,e){const i=this.config=new ta(e),n=la(t),a=ha(n);if(a)throw new Error("Canvas is already in use. Chart with ID '"+a.id+"' must be destroyed before the canvas can be reused.");const s=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||function(t){return!We()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?pn:Pn}(n)),this.platform.updateConfig(i);const r=this.platform.acquireContext(n,s.aspectRatio),o=r&&r.canvas,l=o&&o.height,c=o&&o.width;this.id=p(),this.ctx=r,this.canvas=o,this.width=c,this.height=l,this._options=s,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Hn,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let i;return function(...n){return e?(clearTimeout(i),i=setTimeout(t,e,n)):t.apply(this,n),e}}(t=>this.update(t),s.resizeDelay||0),this._dataChanges=[],ca[this.id]=this,r&&o?(di.listen(this,"complete",ra),di.listen(this,"progress",oa),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:a}=this;return g(t)?e&&a?a:n?i/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Qe(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Kt(this.canvas,this.ctx),this}stop(){return di.stop(this),this}resize(t,e){di.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,n=this.canvas,a=i.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(n,t,e,a),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),o=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,Qe(this,r,!0)&&(this.notifyPlugins("resize",{size:s}),w(i.onResize,[this,s],this),this.attached&&this._doResize(o)&&this.render())}ensureScalesHaveIDs(){O(this.options.scales||{},(t,e)=>{t.id=e})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,n=Object.keys(i).reduce((t,e)=>(t[e]=!1,t),{});let a=[];e&&(a=a.concat(Object.keys(e).map(t=>{const i=e[t],n=Xn(t,i),a="r"===n,s="x"===n;return{options:i,dposition:a?"chartArea":s?"bottom":"left",dtype:a?"radialLinear":s?"category":"linear"}}))),O(a,e=>{const a=e.options,s=a.id,r=Xn(s,a),o=v(a.type,e.dtype);void 0!==a.position&&aa(a.position,r)===aa(e.dposition)||(a.position=e.dposition),n[s]=!0;let l=null;s in i&&i[s].type===o?l=i[s]:(l=new(Wn.getScale(o))({id:s,type:o,ctx:this.ctx,chart:this}),i[l.id]=l),l.init(a,t)}),O(n,(t,e)=>{t||delete i[e]}),O(i,t=>{un.configure(this,t,t.options),un.addBox(this,t)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((t,e)=>t.index-e.index),i>e){for(let t=e;te.length&&delete this._stacks,t.forEach((t,i)=>{0===e.filter(e=>e===t._dataset).length&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,n;for(this._removeUnreferencedMetasets(),i=0,n=e.length;i{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const a=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let t=0,e=this.data.datasets.length;t{t.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(sa("z","_idx"));const{_active:r,_lastEvent:o}=this;o?this._eventHandler(o,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){O(this.scales,t=>{un.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);N(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:n,count:a}of e)da(t,n,"_removeElements"===i?-a:a)}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter(t=>t[0]===e).map((t,e)=>e+","+t.splice(1).join(","))),n=i(0);for(let t=1;tt.split(",")).map(t=>({method:t[1],start:+t[2],count:+t[3]}))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;un.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],O(this.boxes,t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))},this),this._layers.forEach((t,e)=>{t._idx=e}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,n=!i.disabled,a=this.chartArea,s={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",s)&&(n&&te(e,{left:!1===i.left?0:a.left-i.left,right:!1===i.right?this.width:a.right+i.right,top:!1===i.top?0:a.top-i.top,bottom:!1===i.bottom?this.height:a.bottom+i.bottom}),t.controller.draw(),n&&ee(e),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}getElementsAtEventForMode(t,e,i,n){const a=Ji.modes[e];return"function"==typeof a?a(this,t,i,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let n=i.filter(t=>t&&t._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(n)),n}getContext(){return this.$context||(this.$context=me(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const n=i?"show":"hide",a=this.getDatasetMeta(t),s=a.controller._resolveAnimations(void 0,n);L(e)?(a.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),s.update(a,{visible:i}),this.update(e=>e.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),di.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,i,n),t[i]=n},n=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};O(this.options.events,t=>i(t,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,n)=>{e.addEventListener(this,i,n),t[i]=n},n=(i,n)=>{t[i]&&(e.removeEventListener(this,i,n),delete t[i])},a=(t,e)=>{this.canvas&&this.resize(t,e)};let s;const r=()=>{n("attach",r),this.attached=!0,this.resize(),i("resize",a),i("detach",s)};s=()=>{this.attached=!1,n("resize",a),this._stop(),this._resize(0,0),i("attach",r)},e.isAttached(this.canvas)?r():s()}unbindEvents(){O(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},O(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const n=i?"set":"remove";let a,s,r,o;for("dataset"===e&&(a=this.getDatasetMeta(t[0].datasetIndex),a.controller["_"+n+"DatasetHoverStyle"]()),r=0,o=t.length;r{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}});!M(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}_updateHoverStyles(t,e,i){const n=this.options.hover,a=(t,e)=>t.filter(t=>!e.some(e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)),s=a(e,t),r=i?t:a(t,e);s.length&&this.updateHoverStyle(s,n.mode,!1),r.length&&n.mode&&this.updateHoverStyle(r,n.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:Jt(t,this.chartArea,this._minPadding)},n=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,n))return;const a=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(a||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:n=[],options:a}=this,s=e,r=this._getActiveElements(t,n,i,s),o=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}(t),l=function(t,e,i,n){return i&&"mouseout"!==t.type?n?e:t:null}(t,this._lastEvent,i,o);i&&(this._lastEvent=null,w(a.onHover,[t,r,this],this),o&&w(a.onClick,[t,r,this],this));const c=!M(r,n);return(c||e)&&(this._active=r,this._updateHoverStyles(r,n,e)),this._lastEvent=l,c}_getActiveElements(t,e,i,n){if("mouseout"===t.type)return[];if(!i)return e;const a=this.options.hover;return this.getElementsAtEventForMode(t,a.mode,a,n)}}const fa=()=>O(ua.instances,t=>t._plugins.invalidate());function pa(t,e,i){const{startAngle:n,pixelMargin:a,x:s,y:r,outerRadius:o,innerRadius:l}=e;let c=a/o;t.beginPath(),t.arc(s,r,o,n-c,i+c),l>a?(c=a/l,t.arc(s,r,l,i+c,n-c,!0)):t.arc(s,r,a,i+W,n-W),t.closePath(),t.clip()}function ga(t,e,i,n){return{x:i+t*Math.cos(e),y:n+t*Math.sin(e)}}function ma(t,e,i,n,a){const{x:s,y:r,startAngle:o,pixelMargin:l,innerRadius:c}=e,h=Math.max(e.outerRadius+n+i-l,0),d=c>0?c+n+i+l:0;let u=0;const f=a-o;if(n){const t=((c>0?c-n:0)+(h>0?h-n:0))/2;u=(f-(0!==t?f*t/(t+n):f))/2}const p=(f-Math.max(.001,f*h-i/F)/h)/2,g=o+p+u,m=a-p-u,{outerStart:b,outerEnd:y,innerStart:x,innerEnd:v}=function(t,e,i,n){const a=he(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]),s=(i-e)/2,r=Math.min(s,n*e/2),o=t=>{const e=(i-Math.min(s,t))*n/2;return st(t,0,Math.min(s,e))};return{outerStart:o(a.outerStart),outerEnd:o(a.outerEnd),innerStart:st(a.innerStart,0,r),innerEnd:st(a.innerEnd,0,r)}}(e,d,h,m-g),_=h-b,w=h-y,O=g+b/_,M=m-y/w,k=d+x,j=d+v,S=g+x/k,D=m-v/j;if(t.beginPath(),t.arc(s,r,h,O,M),y>0){const e=ga(w,M,s,r);t.arc(e.x,e.y,y,M,m+W)}const P=ga(j,m,s,r);if(t.lineTo(P.x,P.y),v>0){const e=ga(j,D,s,r);t.arc(e.x,e.y,v,m+W,D+Math.PI)}if(t.arc(s,r,d,m-v/d,g+x/d,!0),x>0){const e=ga(k,S,s,r);t.arc(e.x,e.y,x,S+Math.PI,g-W)}const E=ga(_,g,s,r);if(t.lineTo(E.x,E.y),b>0){const e=ga(_,O,s,r);t.arc(e.x,e.y,b,g-W,O)}t.closePath()}Object.defineProperties(ua,{defaults:{enumerable:!0,value:Xt},instances:{enumerable:!0,value:ca},overrides:{enumerable:!0,value:Ht},registry:{enumerable:!0,value:Wn},version:{enumerable:!0,value:"3.7.1"},getChart:{enumerable:!0,value:ha},register:{enumerable:!0,value:(...t)=>{Wn.add(...t),fa()}},unregister:{enumerable:!0,value:(...t)=>{Wn.remove(...t),fa()}}});class ba extends En{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.getProps(["x","y"],i),{angle:a,distance:s}=tt(n,{x:t,y:e}),{startAngle:r,endAngle:o,innerRadius:l,outerRadius:c,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),d=this.options.spacing/2,u=v(h,o-r)>=I||at(a,r,o),f=rt(s,l+d,c+d);return u&&f}getCenterPoint(t){const{x:e,y:i,startAngle:n,endAngle:a,innerRadius:s,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:o,spacing:l}=this.options,c=(n+a)/2,h=(s+r+l+o)/2;return{x:e+Math.cos(c)*h,y:i+Math.sin(c)*h}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,n=(e.offset||0)/2,a=(e.spacing||0)/2;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>I?Math.floor(i/I):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();let s=0;if(n){s=n/2;const e=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(e)*s,Math.sin(e)*s),this.circumference>=F&&(s=n)}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;const r=function(t,e,i,n){const{fullCircles:a,startAngle:s,circumference:r}=e;let o=e.endAngle;if(a){ma(t,e,i,n,s+I);for(let e=0;eo&&s>o;return{count:n,start:l,loop:e.loop,ilen:c(r+(c?o-t:t))%s,x=()=>{f!==p&&(t.lineTo(m,p),t.lineTo(m,f),t.lineTo(m,g))};for(l&&(d=a[y(0)],t.moveTo(d.x,d.y)),h=0;h<=o;++h){if(d=a[y(h)],d.skip)continue;const e=d.x,i=d.y,n=0|e;n===u?(ip&&(p=i),m=(b*m+e)/++b):(x(),t.lineTo(e,i),u=n,b=0,f=p=i),g=i}x()}function Oa(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i?_a:wa}ba.id="arc",ba.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0},ba.defaultRoutes={backgroundColor:"backgroundColor"};const Ma="function"==typeof Path2D;class ka extends En{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const n=i.spanGaps?this._loop:this._fullLoop;Ve(this._points,i,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(t,e){const i=t.points,n=t.options.spanGaps,a=i.length;if(!a)return[];const s=!!t._loop,{start:r,end:o}=function(t,e,i,n){let a=0,s=e-1;if(i&&!n)for(;aa&&t[s%e].skip;)s--;return s%=e,{start:a,end:s}}(i,a,s,n);return function(t,e,i,n){return n&&n.setContext&&i?function(t,e,i,n){const a=t._chart.getContext(),s=ci(t.options),{_datasetIndex:r,options:{spanGaps:o}}=t,l=i.length,c=[];let h=s,d=e[0].start,u=d;function f(t,e,n,a){const s=o?-1:1;if(t!==e){for(t+=l;i[t%l].skip;)t-=s;for(;i[e%l].skip;)e+=s;t%l!=e%l&&(c.push({start:t%l,end:e%l,loop:n,style:a}),h=a,d=e%l)}}for(const t of e){d=o?d:t.start;let e,s=i[d%l];for(u=d+1;u<=t.end;u++){const o=i[u%l];e=ci(n.setContext(me(a,{type:"segment",p0:s,p1:o,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:r}))),hi(e,h)&&f(d,u-1,t.loop,h),s=o,h=e}d"borderDash"!==t&&"fill"!==t};class Sa extends En{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.options,{x:a,y:s}=this.getProps(["x","y"],i);return Math.pow(t-a,2)+Math.pow(e-s,2)=i)&&a):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}Aa.id="bar",Aa.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0},Aa.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};class Ra{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:n,y:a,radius:s}=this;return e=e||{start:0,end:I},t.arc(n,a,s,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:n}=this,a=t.angle;return{x:e+Math.cos(a)*n,y:i+Math.sin(a)*n,angle:a}}}function Na(t,e,i){for(;e>t;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function Fa(t,e,i){const n=[];for(let a=0;a{e=Na(t,e,a);const r=a[t],o=a[e];null!==n?(s.push({x:r.x,y:n}),s.push({x:o.x,y:n})):null!==i&&(s.push({x:i,y:r.y}),s.push({x:i,y:o.y}))}),s}(t,e),i.length?new ka({points:i,options:{tension:0},_loop:n,_fullLoop:n}):null}function Va(t,e,i){let n=t[e].fill;const a=[e];let s;if(!i)return n;for(;!1!==n&&-1===a.indexOf(n);){if(!y(n))return n;if(s=t[n],!s)return!1;if(s.visible)return n;a.push(n),n=s.fill}return!1}function Wa(t,e,i){const{segments:n,points:a}=e;let s=!0,r=!1;t.beginPath();for(const o of n){const{start:n,end:l}=o,c=a[n],h=a[Na(n,l,a)];s?(t.moveTo(c.x,c.y),s=!1):(t.lineTo(c.x,i),t.lineTo(c.x,c.y)),r=!!e.pathSegment(t,o,{move:r}),r?t.closePath():t.lineTo(h.x,i)}t.lineTo(e.first().x,i),t.closePath(),t.clip()}function Ha(t,e,i,n){if(n)return;let a=e[t],s=i[t];return"angle"===t&&(a=nt(a),s=nt(s)),{property:t,start:a,end:s}}function Ua(t,e,i,n){return t&&e?n(t[i],e[i]):t?t[i]:e?e[i]:0}function Ya(t,e,i){const{top:n,bottom:a}=e.chart.chartArea,{property:s,start:r,end:o}=i||{};"x"===s&&(t.beginPath(),t.rect(r,n,o-r,a-n),t.clip())}function $a(t,e,i,n){const a=e.interpolate(i,n);a&&t.lineTo(a.x,a.y)}function Xa(t,e){const{line:i,target:n,property:a,color:s,scale:r}=e,o=function(t,e,i){const n=t.segments,a=t.points,s=e.points,r=[];for(const t of n){let{start:n,end:o}=t;o=Na(n,o,a);const l=Ha(i,a[n],a[o],t.loop);if(!e.segments){r.push({source:t,target:l,start:a[n],end:a[o]});continue}const c=li(e,l);for(const e of c){const n=Ha(i,s[e.start],s[e.end],e.loop),o=oi(t,a,n);for(const t of o)r.push({source:t,target:e,start:{[i]:Ua(l,n,"start",Math.max)},end:{[i]:Ua(l,n,"end",Math.min)}})}}return r}(i,n,a);for(const{source:e,target:l,start:c,end:h}of o){const{style:{backgroundColor:o=s}={}}=e,d=!0!==n;t.save(),t.fillStyle=o,Ya(t,r,d&&Ha(a,c,h)),t.beginPath();const u=!!i.pathSegment(t,e);let f;if(d){u?t.closePath():$a(t,n,h,a);const e=!!n.pathSegment(t,l,{move:u,reverse:!0});f=u&&e,f||$a(t,n,c,a)}t.closePath(),t.fill(f?"evenodd":"nonzero"),t.restore()}}function qa(t,e,i){const n=za(e),{line:a,scale:s,axis:r}=e,o=a.options,l=o.fill,c=o.backgroundColor,{above:h=c,below:d=c}=l||{};n&&a.points.length&&(te(t,i),function(t,e){const{line:i,target:n,above:a,below:s,area:r,scale:o}=e,l=i._loop?"angle":e.axis;t.save(),"x"===l&&s!==a&&(Wa(t,n,r.top),Xa(t,{line:i,target:n,color:a,scale:o,property:l}),t.restore(),t.save(),Wa(t,n,r.bottom)),Xa(t,{line:i,target:n,color:s,scale:o,property:l}),t.restore()}(t,{line:a,target:n,above:h,below:d,area:i,scale:s,axis:r}),ee(t))}var Ga={id:"filler",afterDatasetsUpdate(t,e,i){const n=(t.data.datasets||[]).length,a=[];let s,r,o,l;for(r=0;r=0;--e){const i=a[e].$filler;i&&(i.line.updateControlPoints(s,i.axis),n&&qa(t.ctx,i,s))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const n=t.getSortedVisibleDatasetMetas();for(let e=n.length-1;e>=0;--e){const i=n[e].$filler;i&&qa(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){const n=e.meta.$filler;n&&!1!==n.fill&&"beforeDatasetDraw"===i.drawTime&&qa(t.ctx,n,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};new WeakMap;const Qa={average(t){if(!t.length)return!1;let e,i,n=0,a=0,s=0;for(e=0,i=t.length;e-1?t.split("\n"):t}function Ja(t,e){const{element:i,datasetIndex:n,index:a}=e,s=t.getDatasetMeta(n).controller,{label:r,value:o}=s.getLabelAndValue(a);return{chart:t,label:r,parsed:s.getParsed(a),raw:t.data.datasets[n].data[a],formattedValue:o,dataset:s.getDataset(),dataIndex:a,datasetIndex:n,element:i}}function ts(t,e){const i=t.chart.ctx,{body:n,footer:a,title:s}=t,{boxWidth:r,boxHeight:o}=e,l=pe(e.bodyFont),c=pe(e.titleFont),h=pe(e.footerFont),d=s.length,u=a.length,f=n.length,p=fe(e.padding);let g=p.height,m=0,b=n.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);b+=t.beforeBody.length+t.afterBody.length,d&&(g+=d*c.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),b&&(g+=f*(e.displayColors?Math.max(o,l.lineHeight):l.lineHeight)+(b-f)*l.lineHeight+(b-1)*e.bodySpacing),u&&(g+=e.footerMarginTop+u*h.lineHeight+(u-1)*e.footerSpacing);let y=0;const x=function(t){m=Math.max(m,i.measureText(t).width+y)};return i.save(),i.font=c.string,O(t.title,x),i.font=l.string,O(t.beforeBody.concat(t.afterBody),x),y=e.displayColors?r+2+e.boxPadding:0,O(n,t=>{O(t.before,x),O(t.lines,x),O(t.after,x)}),y=0,i.font=h.string,O(t.footer,x),i.restore(),m+=p.width,{width:m,height:g}}function es(t,e,i,n){const{x:a,width:s}=i,{width:r,chartArea:{left:o,right:l}}=t;let c="center";return"center"===n?c=a<=(o+l)/2?"left":"right":a<=s/2?c="left":a>=r-s/2&&(c="right"),function(t,e,i,n){const{x:a,width:s}=n,r=i.caretSize+i.caretPadding;return"left"===t&&a+s+r>e.width||"right"===t&&a-s-r<0||void 0}(c,t,e,i)&&(c="center"),c}function is(t,e,i){const n=i.yAlign||e.yAlign||function(t,e){const{y:i,height:n}=e;return it.height-n/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||es(t,e,i,n),yAlign:n}}function ns(t,e,i,n){const{caretSize:a,caretPadding:s,cornerRadius:r}=t,{xAlign:o,yAlign:l}=i,c=a+s,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=ue(r);let p=function(t,e){let{x:i,width:n}=t;return"right"===e?i-=n:"center"===e&&(i-=n/2),i}(e,o);const g=function(t,e,i){let{y:n,height:a}=t;return"top"===e?n+=i:n-="bottom"===e?a+i:a/2,n}(e,l,c);return"center"===l?"left"===o?p+=c:"right"===o&&(p-=c):"left"===o?p-=Math.max(h,u)+a:"right"===o&&(p+=Math.max(d,f)+a),{x:st(p,0,n.width-e.width),y:st(g,0,n.height-e.height)}}function as(t,e,i){const n=fe(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-n.right:t.x+n.left}function ss(t){return Ka([],Za(t))}function rs(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}class os extends En{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart||t._chart,this._chart=this.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),n=i.enabled&&e.options.animation&&i.animations,a=new gi(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(a)),a}getContext(){return this.$context||(this.$context=(this,me(this.chart.getContext(),{tooltip:this,tooltipItems:this._tooltipItems,type:"tooltip"})))}getTitle(t,e){const{callbacks:i}=e,n=i.beforeTitle.apply(this,[t]),a=i.title.apply(this,[t]),s=i.afterTitle.apply(this,[t]);let r=[];return r=Ka(r,Za(n)),r=Ka(r,Za(a)),r=Ka(r,Za(s)),r}getBeforeBody(t,e){return ss(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){const{callbacks:i}=e,n=[];return O(t,t=>{const e={before:[],lines:[],after:[]},a=rs(i,t);Ka(e.before,Za(a.beforeLabel.call(this,t))),Ka(e.lines,a.label.call(this,t)),Ka(e.after,Za(a.afterLabel.call(this,t))),n.push(e)}),n}getAfterBody(t,e){return ss(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){const{callbacks:i}=e,n=i.beforeFooter.apply(this,[t]),a=i.footer.apply(this,[t]),s=i.afterFooter.apply(this,[t]);let r=[];return r=Ka(r,Za(n)),r=Ka(r,Za(a)),r=Ka(r,Za(s)),r}_createItems(t){const e=this._active,i=this.chart.data,n=[],a=[],s=[];let r,o,l=[];for(r=0,o=e.length;rt.filter(e,n,a,i))),t.itemSort&&(l=l.sort((e,n)=>t.itemSort(e,n,i))),O(l,e=>{const i=rs(t.callbacks,e);n.push(i.labelColor.call(this,e)),a.push(i.labelPointStyle.call(this,e)),s.push(i.labelTextColor.call(this,e))}),this.labelColors=n,this.labelPointStyles=a,this.labelTextColors=s,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),n=this._active;let a,s=[];if(n.length){const t=Qa[i.position].call(this,n,this._eventPosition);s=this._createItems(i),this.title=this.getTitle(s,i),this.beforeBody=this.getBeforeBody(s,i),this.body=this.getBody(s,i),this.afterBody=this.getAfterBody(s,i),this.footer=this.getFooter(s,i);const e=this._size=ts(this,i),r=Object.assign({},t,e),o=is(this.chart,i,r),l=ns(i,r,o,this.chart);this.xAlign=o.xAlign,this.yAlign=o.yAlign,a={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(a={opacity:0});this._tooltipItems=s,this.$context=void 0,a&&this._resolveAnimations().update(this,a),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,n){const a=this.getCaretPosition(t,i,n);e.lineTo(a.x1,a.y1),e.lineTo(a.x2,a.y2),e.lineTo(a.x3,a.y3)}getCaretPosition(t,e,i){const{xAlign:n,yAlign:a}=this,{caretSize:s,cornerRadius:r}=i,{topLeft:o,topRight:l,bottomLeft:c,bottomRight:h}=ue(r),{x:d,y:u}=t,{width:f,height:p}=e;let g,m,b,y,x,v;return"center"===a?(x=u+p/2,"left"===n?(g=d,m=g-s,y=x+s,v=x-s):(g=d+f,m=g+s,y=x-s,v=x+s),b=g):(m="left"===n?d+Math.max(o,c)+s:"right"===n?d+f-Math.max(l,h)-s:this.caretX,"top"===a?(y=u,x=y-s,g=m-s,b=m+s):(y=u+p,x=y+s,g=m+s,b=m-s),v=y),{x1:g,x2:m,x3:b,y1:y,y2:x,y3:v}}drawTitle(t,e,i){const n=this.title,a=n.length;let s,r,o;if(a){const l=ai(i.rtl,this.x,this.width);for(t.x=as(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",s=pe(i.titleFont),r=i.titleSpacing,e.fillStyle=i.titleColor,e.font=s.string,o=0;o0!==t)?(t.beginPath(),t.fillStyle=a.multiKeyBackground,re(t,{x:e,y:p,w:l,h:o,radius:r}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),re(t,{x:i,y:p+1,w:l-2,h:o-2,radius:r}),t.fill()):(t.fillStyle=a.multiKeyBackground,t.fillRect(e,p,l,o),t.strokeRect(e,p,l,o),t.fillStyle=s.backgroundColor,t.fillRect(i,p+1,l-2,o-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:n}=this,{bodySpacing:a,bodyAlign:s,displayColors:r,boxHeight:o,boxWidth:l,boxPadding:c}=i,h=pe(i.bodyFont);let d=h.lineHeight,u=0;const f=ai(i.rtl,this.x,this.width),p=function(i){e.fillText(i,f.x(t.x+u),t.y+d/2),t.y+=d+a},g=f.textAlign(s);let m,b,y,x,v,_,w;for(e.textAlign=s,e.textBaseline="middle",e.font=h.string,t.x=as(this,g,i),e.fillStyle=i.bodyColor,O(this.beforeBody,p),u=r&&"right"!==g?"center"===s?l/2+c:l+2+c:0,x=0,_=n.length;x<_;++x){for(m=n[x],b=this.labelTextColors[x],e.fillStyle=b,O(m.before,p),y=m.lines,r&&y.length&&(this._drawColorBox(e,t,x,f,i),d=Math.max(h.lineHeight,o)),v=0,w=y.length;v0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,n=i&&i.x,a=i&&i.y;if(n||a){const i=Qa[t.position].call(this,this._active,this._eventPosition);if(!i)return;const s=this._size=ts(this,t),r=Object.assign({},i,this._size),o=is(e,t,r),l=ns(t,r,o,e);n._to===l.x&&a._to===l.y||(this.xAlign=o.xAlign,this.yAlign=o.yAlign,this.width=s.width,this.height=s.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},a={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const s=fe(e.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&r&&(t.save(),t.globalAlpha=i,this.drawBackground(a,t,n,e),function(t,e){let i,n;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,n=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=n)}(t,e.textDirection),a.y+=s.top,this.drawTitle(a,t,e),this.drawBody(a,t,e),this.drawFooter(a,t,e),function(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,n=t.map(({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),a=!M(i,n),s=this._positionChanged(n,e);(a||s)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,a=this._active||[],s=this._getActiveElements(t,a,e,i),r=this._positionChanged(s,t),o=e||!M(s,a)||r;return o&&(this._active=s,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),o}_getActiveElements(t,e,i,n){const a=this.options;if("mouseout"===t.type)return[];if(!n)return e;const s=this.chart.getElementsAtEventForMode(t,a.mode,a,i);return a.reverse&&s.reverse(),s}_positionChanged(t,e){const{caretX:i,caretY:n,options:a}=this,s=Qa[a.position].call(this,t,e);return!1!==s&&(i!==s.x||n!==s.y)}}os.positioners=Qa;var ls={id:"tooltip",_element:os,positioners:Qa,afterInit(t,e,i){i&&(t.tooltip=new os({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip,i={tooltip:e};!1!==t.notifyPlugins("beforeTooltipDraw",i)&&(e&&e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i))},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:f,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,n=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(n>0&&e.dataIndex"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};class cs extends Bn{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:i,label:n}of e)t[i]===n&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(g(t))return null;const i=this.getLabels();return((t,e)=>null===t?null:st(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:function(t,e,i,n){const a=t.indexOf(e);return-1===a?((t,e,i,n)=>("string"==typeof e?(i=t.push(e)-1,n.unshift({index:i,label:e})):isNaN(e)&&(i=null),i))(t,e,i,n):a!==t.lastIndexOf(e)?i:a}(i,t,v(e,t),this._addedLabels),i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:n}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(n=this.getLabels().length-1)),this.min=i,this.max=n}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,n=[];let a=this.getLabels();a=0===t&&e===a.length-1?a:a.slice(t,e+1),this._valueRange=Math.max(a.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let i=t;i<=e;i++)n.push({value:i});return n}getLabelForValue(t){const e=this.getLabels();return t>=0&&te.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function hs(t,e,{horizontal:i,minRotation:n}){const a=K(n),s=(i?Math.sin(a):Math.cos(a))||.001,r=.75*e*(""+t).length;return Math.min(e/s,r)}cs.id="category",cs.defaults={ticks:{callback:cs.prototype.getLabelForValue}};class ds extends Bn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return g(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:n,max:a}=this;const s=t=>n=e?n:t,r=t=>a=i?a:t;if(t){const t=$(n),e=$(a);t<0&&e<0?r(0):t>0&&e>0&&s(0)}if(n===a){let e=1;(a>=Number.MAX_SAFE_INTEGER||n<=Number.MIN_SAFE_INTEGER)&&(e=Math.abs(.05*a)),r(a+e),t||s(n-e)}this.min=n,this.max=a}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:n}=t;return n?(e=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const n=function(t,e){const i=[],{bounds:n,step:a,min:s,max:r,precision:o,count:l,maxTicks:c,maxDigits:h,includeBounds:d}=t,u=a||1,f=c-1,{min:p,max:m}=e,b=!g(s),y=!g(r),x=!g(l),v=(m-p)/(h+1);let _,w,O,M,k=X((m-p)/f/u)*u;if(k<1e-14&&!b&&!y)return[{value:p},{value:m}];M=Math.ceil(m/k)-Math.floor(p/k),M>f&&(k=X(M*k/f/u)*u),g(o)||(_=Math.pow(10,o),k=Math.ceil(k*_)/_),"ticks"===n?(w=Math.floor(p/k)*k,O=Math.ceil(m/k)*k):(w=p,O=m),b&&y&&a&&function(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}((r-s)/a,k/1e3)?(M=Math.round(Math.min((r-s)/k,c)),k=(r-s)/M,w=s,O=r):x?(w=b?s:w,O=y?r:O,M=l-1,k=(O-w)/M):(M=(O-w)/k,M=G(M,Math.round(M),k/1e3)?Math.round(M):Math.ceil(M));const j=Math.max(J(k),J(w));_=Math.pow(10,g(o)?j:o),w=Math.round(w*_)/_,O=Math.round(O*_)/_;let S=0;for(b&&(d&&w!==s?(i.push({value:s}),w0?i:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=y(t)?Math.max(0,t):null,this.max=y(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,n=this.max;const a=e=>i=t?i:e,s=t=>n=e?n:t,r=(t,e)=>Math.pow(10,Math.floor(Y(t))+e);i===n&&(i<=0?(a(1),s(10)):(a(r(i,-1)),s(r(n,1)))),i<=0&&a(r(n,-1)),n<=0&&s(r(i,1)),this._zero&&this.min!==this._suggestedMin&&i===r(this.min,0)&&a(r(i,-1)),this.min=i,this.max=n}buildTicks(){const t=this.options,e=function(t,e){const i=Math.floor(Y(e.max)),n=Math.ceil(e.max/Math.pow(10,i)),a=[];let s=x(t.min,Math.pow(10,Math.floor(Y(e.min)))),r=Math.floor(Y(s)),o=Math.floor(s/Math.pow(10,r)),l=r<0?Math.pow(10,Math.abs(r)):1;do{a.push({value:s,major:fs(s)}),++o,10===o&&(o=1,++r,l=r>=0?1:l),s=Math.round(o*Math.pow(10,r)*l)/l}while(ra?{start:e-i,end:e}:{start:e,end:e+i}}function bs(t,e,i,n,a){const s=Math.abs(Math.sin(i)),r=Math.abs(Math.cos(i));let o=0,l=0;n.starte.r&&(o=(n.end-e.r)/s,t.r=Math.max(t.r,e.r+o)),a.starte.b&&(l=(a.end-e.b)/r,t.b=Math.max(t.b,e.b+l))}function ys(t){return 0===t||180===t?"center":t<180?"left":"right"}function xs(t,e,i){return 90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e),t}function vs(t,e,i,n){const{ctx:a}=t;if(i)a.arc(t.xCenter,t.yCenter,e,0,I);else{let i=t.getPointPosition(0,e);a.moveTo(i.x,i.y);for(let s=1;s{const i=w(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""}).filter((t,e)=>this.chart.getDataVisibility(e))}fit(){const t=this.options;t.display&&t.pointLabels.display?function(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),n=[],a=[],s=t._pointLabels.length,r=t.options.pointLabels,o=r.centerPointLabels?F/s:0;for(let d=0;d=0&&t=0;a--){const e=n.setContext(t.getPointLabelContext(a)),s=pe(e.font),{x:r,y:o,textAlign:l,left:c,top:h,right:d,bottom:u}=t._pointLabelItems[a],{backdropColor:f}=e;if(!g(f)){const t=fe(e.backdropPadding);i.fillStyle=f,i.fillRect(c-t.left,h-t.top,d-c+t.width,u-h+t.height)}ae(i,t._pointLabels[a],r,o+s.lineHeight/2,s,{color:e.color,textAlign:l,textBaseline:"middle"})}}(this,a),n.display&&this.ticks.forEach((t,e)=>{0!==e&&(r=this.getDistanceFromCenterForValue(t.value),function(t,e,i,n){const a=t.ctx,s=e.circular,{color:r,lineWidth:o}=e;!s&&!n||!r||!o||i<0||(a.save(),a.strokeStyle=r,a.lineWidth=o,a.setLineDash(e.borderDash),a.lineDashOffset=e.borderDashOffset,a.beginPath(),vs(t,i,s,n),a.closePath(),a.stroke(),a.restore())}(this,n.setContext(this.getContext(e-1)),r,a))}),i.display){for(t.save(),s=a-1;s>=0;s--){const n=i.setContext(this.getPointLabelContext(s)),{color:a,lineWidth:l}=n;l&&a&&(t.lineWidth=l,t.strokeStyle=a,t.setLineDash(n.borderDash),t.lineDashOffset=n.borderDashOffset,r=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),o=this.getPointPosition(s,r),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(o.x,o.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const n=this.getIndexAngle(0);let a,s;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(n),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((n,r)=>{if(0===r&&!e.reverse)return;const o=i.setContext(this.getContext(r)),l=pe(o.font);if(a=this.getDistanceFromCenterForValue(this.ticks[r].value),o.showLabelBackdrop){t.font=l.string,s=t.measureText(n.label).width,t.fillStyle=o.backdropColor;const e=fe(o.backdropPadding);t.fillRect(-s/2-e.left,-a-l.size/2-e.top,s+e.width,l.size+e.height)}ae(t,n.label,0,-a,l,{color:o.color})}),t.restore()}drawTitle(){}}_s.id="radialLinear",_s.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Tn.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}},_s.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},_s.descriptors={angleLines:{_fallback:"grid"}};const ws={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Os=Object.keys(ws);function Ms(t,e){return t-e}function ks(t,e){if(g(e))return null;const i=t._adapter,{parser:n,round:a,isoWeekday:s}=t._parseOpts;let r=e;return"function"==typeof n&&(r=n(r)),y(r)||(r="string"==typeof n?i.parse(r,n):i.parse(r)),null===r?null:(a&&(r="week"!==a||!q(s)&&!0!==s?i.startOf(r,a):i.startOf(r,"isoWeek",s)),+r)}function js(t,e,i,n){const a=Os.length;for(let s=Os.indexOf(t);s=e?i[n]:i[a]]=!0}}else t[e]=!0}function Ds(t,e,i){const n=[],a={},s=e.length;let r,o;for(r=0;r=0&&(e[l].major=!0);return e}(t,n,a,i):n}class Ps extends Bn{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e){const i=t.time||(t.time={}),n=this._adapter=new $i._date(t.adapters.date);P(i.displayFormats,n.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:ks(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:n,max:a,minDefined:s,maxDefined:r}=this.getUserBounds();function o(t){s||isNaN(t.min)||(n=Math.min(n,t.min)),r||isNaN(t.max)||(a=Math.max(a,t.max))}s&&r||(o(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||o(this.getMinMax(!1))),n=y(n)&&!isNaN(n)?n:+e.startOf(Date.now(),i),a=y(a)&&!isNaN(a)?a:+e.endOf(Date.now(),i)+1,this.min=Math.min(n,a-1),this.max=Math.max(n+1,a)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,n="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const a=this.min,s=function(t,e,i){let n=0,a=t.length;for(;nn&&t[a-1]>i;)a--;return n>0||a=Os.indexOf(i);s--){const i=Os[s];if(ws[i].common&&t._adapter.diff(a,n,i)>=e-1)return i}return Os[i?Os.indexOf(i):0]}(this,s.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(let e=Os.indexOf(t)+1,i=Os.length;e1e5*r)throw new Error(e+" and "+i+" are too far apart with stepSize of "+r+" "+s);const f="data"===n.ticks.source&&this.getDataTimestamps();for(h=u,d=0;ht-e).map(t=>+t)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}_tickFormatFunction(t,e,i,n){const a=this.options,s=a.time.displayFormats,r=this._unit,o=this._majorUnit,l=r&&s[r],c=o&&s[o],h=i[e],d=o&&c&&h&&h.major,u=this._adapter.format(t,n||(d?c:l)),f=a.ticks.callback;return f?w(f,[u,e,i],this):u}generateTickLabels(t){let e,i,n;for(e=0,i=t.length;e0?r:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(t=0,e=n.length;t=t[o].pos&&e<=t[l].pos&&({lo:o,hi:l}=ye(t,"pos",e)),({pos:n,time:s}=t[o]),({pos:a,time:r}=t[l])):(e>=t[o].time&&e<=t[l].time&&({lo:o,hi:l}=ye(t,"time",e)),({time:n,pos:s}=t[o]),({time:a,pos:r}=t[l]));const c=a-n;return c?s+(r-s)*(e-n)/c:s}Ps.id="time",Ps.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};class Cs extends Ps{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Es(e,this.min),this._tableRange=Es(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,n=[],a=[];let s,r,o,l,c;for(s=0,r=t.length;s=e&&l<=i&&n.push(l);if(n.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(s=0,r=n.length;s2&&void 0!==arguments[2]?arguments[2]:"label";const n=[];t.datasets=e.map(e=>{const a=t.datasets.find(t=>t[i]===e[i]);return a&&e.data&&!n.includes(a)?(n.push(a),Object.assign(a,e),a):{...e}})}function Fs(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"label";const i={labels:[],datasets:[]};return Rs(i,t.labels),Ns(i,t.datasets,e),i}function Is(t,e){let{height:i=150,width:n=300,redraw:a=!1,datasetIdKey:s,type:r,data:o,options:l,plugins:c=[],fallbackContent:h,...d}=t;const u=Object(Ts.useRef)(null),f=Object(Ts.useRef)(),p=()=>{u.current&&(f.current=new ua(u.current,{type:r,data:Fs(o,s),options:l,plugins:c}),Ls(e,f.current))},g=()=>{Ls(e,null),f.current&&(f.current.destroy(),f.current=null)};return Object(Ts.useEffect)(()=>{var t,e;!a&&f.current&&l&&(t=f.current,e=l,t.options={...e})},[a,l]),Object(Ts.useEffect)(()=>{!a&&f.current&&Rs(f.current.config.data,o.labels)},[a,o.labels]),Object(Ts.useEffect)(()=>{!a&&f.current&&o.datasets&&Ns(f.current.config.data,o.datasets,s)},[a,o.datasets]),Object(Ts.useEffect)(()=>{f.current&&(a?(g(),setTimeout(p)):f.current.update())},[a,l,o.labels,o.datasets]),Object(Ts.useEffect)(()=>(p(),()=>g()),[]),As.a.createElement("canvas",Object.assign({ref:u,role:"img",height:i,width:n},d),h)}const zs=Object(Ts.forwardRef)(Is);var Bs=i(3),Vs=i(17),Ws=i(7),Hs=i(8),Us=i(4);function Ys(t,e){Object(Us.a)(2,arguments);var i=Object(Hs.a)(t),n=Object(Ws.a)(e);return isNaN(n)?new Date(NaN):n?(i.setDate(i.getDate()+n),i):i}function $s(t,e){Object(Us.a)(2,arguments);var i=Object(Ws.a)(e);return Ys(t,-i)}function Xs(t,e){Object(Us.a)(2,arguments);var i=Object(Hs.a)(t),n=Object(Ws.a)(e);if(isNaN(n))return new Date(NaN);if(!n)return i;var a=i.getDate(),s=new Date(i.getTime());s.setMonth(i.getMonth()+n+1,0);var r=s.getDate();return a>=r?s:(i.setFullYear(s.getFullYear(),s.getMonth(),a),i)}function qs(t,e){Object(Us.a)(2,arguments);var i=Object(Ws.a)(e);return Xs(t,-i)}function Gs(t){return(Gs="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 Qs(t,e){if(Object(Us.a)(2,arguments),!e||"object"!==Gs(e))return new Date(NaN);var i=e.years?Object(Ws.a)(e.years):0,n=e.months?Object(Ws.a)(e.months):0,a=e.weeks?Object(Ws.a)(e.weeks):0,s=e.days?Object(Ws.a)(e.days):0,r=e.hours?Object(Ws.a)(e.hours):0,o=e.minutes?Object(Ws.a)(e.minutes):0,l=e.seconds?Object(Ws.a)(e.seconds):0,c=qs(t,n+12*i),h=$s(c,s+7*a),d=o+60*r,u=l+60*d,f=1e3*u,p=new Date(h.getTime()-f);return p}function Ks(t){return(Ks="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 Zs(t,e){if(Object(Us.a)(2,arguments),!e||"object"!==Ks(e))return new Date(NaN);var i=e.years?Object(Ws.a)(e.years):0,n=e.months?Object(Ws.a)(e.months):0,a=e.weeks?Object(Ws.a)(e.weeks):0,s=e.days?Object(Ws.a)(e.days):0,r=e.hours?Object(Ws.a)(e.hours):0,o=e.minutes?Object(Ws.a)(e.minutes):0,l=e.seconds?Object(Ws.a)(e.seconds):0,c=Object(Hs.a)(t),h=n||i?Xs(c,n+12*i):c,d=s||a?Ys(h,s+7*a):h,u=o+60*r,f=l+60*u,p=1e3*f,g=new Date(d.getTime()+p);return g}function Js(t,e){var i;Object(Us.a)(1,arguments);var n=Object(Ws.a)(null!==(i=null==e?void 0:e.additionalDigits)&&void 0!==i?i:2);if(2!==n&&1!==n&&0!==n)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof t&&"[object String]"!==Object.prototype.toString.call(t))return new Date(NaN);var a,s=ar(t);if(s.date){var r=sr(s.date,n);a=rr(r.restDateString,r.year)}if(!a||isNaN(a.getTime()))return new Date(NaN);var o,l=a.getTime(),c=0;if(s.time&&(c=lr(s.time),isNaN(c)))return new Date(NaN);if(!s.timezone){var h=new Date(l+c),d=new Date(0);return d.setFullYear(h.getUTCFullYear(),h.getUTCMonth(),h.getUTCDate()),d.setHours(h.getUTCHours(),h.getUTCMinutes(),h.getUTCSeconds(),h.getUTCMilliseconds()),d}return o=hr(s.timezone),isNaN(o)?new Date(NaN):new Date(l+c+o)}Math.pow(10,8);var tr={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},er=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,ir=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,nr=/^([+-])(\d{2})(?::?(\d{2}))?$/;function ar(t){var e,i={},n=t.split(tr.dateTimeDelimiter);if(n.length>2)return i;if(/:/.test(n[0])?e=n[0]:(i.date=n[0],e=n[1],tr.timeZoneDelimiter.test(i.date)&&(i.date=t.split(tr.timeZoneDelimiter)[0],e=t.substr(i.date.length,t.length))),e){var a=tr.timezone.exec(e);a?(i.time=e.replace(a[1],""),i.timezone=a[1]):i.time=e}return i}function sr(t,e){var i=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),n=t.match(i);if(!n)return{year:NaN,restDateString:""};var a=n[1]?parseInt(n[1]):null,s=n[2]?parseInt(n[2]):null;return{year:null===s?a:100*s,restDateString:t.slice((n[1]||n[2]).length)}}function rr(t,e){if(null===e)return new Date(NaN);var i=t.match(er);if(!i)return new Date(NaN);var n=!!i[4],a=or(i[1]),s=or(i[2])-1,r=or(i[3]),o=or(i[4]),l=or(i[5])-1;if(n)return function(t,e,i){return e>=1&&e<=53&&i>=0&&i<=6}(0,o,l)?function(t,e,i){var n=new Date(0);n.setUTCFullYear(t,0,4);var a=7*(e-1)+i+1-(n.getUTCDay()||7);return n.setUTCDate(n.getUTCDate()+a),n}(e,o,l):new Date(NaN);var c=new Date(0);return function(t,e,i){return e>=0&&e<=11&&i>=1&&i<=(dr[e]||(ur(t)?29:28))}(e,s,r)&&function(t,e){return e>=1&&e<=(ur(t)?366:365)}(e,a)?(c.setUTCFullYear(e,s,Math.max(a,r)),c):new Date(NaN)}function or(t){return t?parseInt(t):1}function lr(t){var e=t.match(ir);if(!e)return NaN;var i=cr(e[1]),n=cr(e[2]),a=cr(e[3]);return function(t,e,i){return 24===t?0===e&&0===i:i>=0&&i<60&&e>=0&&e<60&&t>=0&&t<25}(i,n,a)?36e5*i+6e4*n+1e3*a:NaN}function cr(t){return t&&parseFloat(t.replace(",","."))||0}function hr(t){if("Z"===t)return 0;var e=t.match(nr);if(!e)return 0;var i="+"===e[1]?-1:1,n=parseInt(e[2]),a=e[3]&&parseInt(e[3])||0;return function(t,e){return e>=0&&e<=59}(0,a)?i*(36e5*n+6e4*a):NaN}var dr=[31,null,31,30,31,30,31,31,30,31,30,31];function ur(t){return t%400==0||t%4==0&&t%100!=0}var fr=i(78);function pr(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function gr(t){for(var e=1;e0,"is-negative":e<0});return Object(c.createElement)("div",{className:s},Object(c.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"simpay-admin-charts-badge__icon",width:"16",height:"16"},e>0?Object(c.createElement)("path",{d:"M16.004 9.414l-8.607 8.607-1.414-1.414L14.589 8H7.004V6h11v11h-2V9.414z"}):Object(c.createElement)("path",{d:"M14.59 16.004L5.982 7.397l1.414-1.414 8.607 8.606V7.004h2v11h-11v-2z"})),!n&&Object(c.createElement)("span",null,Math.abs(e),"%"))},Er="simpay-admin-charts-period-over-period__tooltip",Cr=function(t){var e=t.position,i=t.opacity,n=t.data,a=t.delta,s=t.deltaChangedString;if(!n.length)return null;var r=e.top,o=e.left,l=e.right,h=Dr()("simpay-admin-charts-badge",{"is-positive":a>0,"is-negative":a<0});return Object(c.createElement)("div",{className:Er,style:{top:r,left:o||"auto",right:l||"auto",opacity:i}},n.map((function(t,e){var i=t.label,n=t.value;return Object(c.createElement)("div",{className:"".concat(Er,"-data"),"data-dataset":e,key:i+Math.random()},Object(c.createElement)("strong",null,i)," ",Object(c.createElement)("em",null,Object(Vs.decodeEntities)(n)))})),0!==a&&Object(c.createElement)("div",{className:"".concat(Er,"-delta")},Object(c.createElement)("div",{className:h},Object(c.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"simpay-admin-charts-badge__icon"},a>0?Object(c.createElement)("path",{fillRule:"evenodd",d:"M5.22 14.78a.75.75 0 001.06 0l7.22-7.22v5.69a.75.75 0 001.5 0v-7.5a.75.75 0 00-.75-.75h-7.5a.75.75 0 000 1.5h5.69l-7.22 7.22a.75.75 0 000 1.06z",clipRule:"evenodd"}):Object(c.createElement)("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06l7.22 7.22H6.75a.75.75 0 000 1.5h7.5a.747.747 0 00.75-.75v-7.5a.75.75 0 00-1.5 0v5.69L6.28 5.22z"}))),Object(c.createElement)("span",null,s)))},Tr=function(t){var e=t.chart,i=function(t,e){var i=Object(c.useState)({marginTop:0,marginRight:0,marginBottom:0,marginLeft:0}),n=l()(i,2),a=n[0],s=a.marginTop,r=a.marginRight,o=a.marginBottom,h=a.marginLeft,d=n[1];return Object(c.useEffect)((function(){t.current&&d({marginTop:Math.floor(t.current.chartArea.top),marginRight:Math.floor(t.current.width-t.current.chartArea.right),marginBottom:Math.floor(t.current.chartArea.bottom),marginLeft:Math.floor(t.current.chartArea.left)})}),[t,e]),{marginTop:s,marginRight:r,marginBottom:o,marginLeft:h}}(t.chartRef,e),n=i.marginLeft,a=i.marginRight;return Object(c.createElement)("div",{style:{width:"100%",position:"relative",fontSize:"12px",display:"flex",justifyContent:"space-between",marginTop:"-2px"}},Object(c.createElement)("div",{style:{marginLeft:n,textAlign:"left"}},e.datasets[0].data[0].x),Object(c.createElement)("div",{style:{marginRight:a,textAlign:"right"}},e.datasets[0].data[e.datasets[0].data.length-1].x))};function Ar(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Lr(t){for(var e=1;e0}))}));return Object(c.createElement)("div",{className:"simpay-admin-charts-period-over-period",style:s},!M&&Object(c.createElement)("div",{className:"simpay-admin-charts-no-data",style:Lr(Lr({},s),{},{height:"calc(".concat(s.height," + 15px)")})},o),Object(c.createElement)(zs,{type:"line",ref:g,options:O,plugins:[vr,(_="rgb(".concat(f.primary_color.join(","),")"),{id:"YGridLineHover",afterDraw:function(t){var e;if(null!==(e=t.tooltip)&&void 0!==e&&null!==(e=e._active)&&void 0!==e&&e.length){var i=t.tooltip._active[0].element.x,n=t.scales.yAxis,a=t.ctx;a.save(),a.beginPath(),a.moveTo(i,n.top),a.lineTo(i,n.bottom),a.lineWidth=2,a.strokeStyle=_,a.stroke(),a.restore()}}})],data:{datasets:m}}),Object(c.createElement)(Tr,{chartRef:g,chart:f}),Object(c.createElement)(Cr,a()({},x,{deltaChangedString:h(x)})),Object(c.createElement)(Bs.Popover.Slot,null))}},function(t,e){function i(){return t.exports=i=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var i=0,n=new Array(e);i=s.getTime()?i+1:e.getTime()>=l.getTime()?i:i-1}function f(t){Object(n.a)(1,arguments);var e=u(t),i=new Date(0);i.setUTCFullYear(e,0,4),i.setUTCHours(0,0,0,0);var a=d(i);return a}var p={};function g(){return p}function m(t,e){var i,a,s,o,c,h,d,u;Object(n.a)(1,arguments);var f=g(),p=Object(l.a)(null!==(i=null!==(a=null!==(s=null!==(o=null==e?void 0:e.weekStartsOn)&&void 0!==o?o:null==e||null===(c=e.locale)||void 0===c||null===(h=c.options)||void 0===h?void 0:h.weekStartsOn)&&void 0!==s?s:f.weekStartsOn)&&void 0!==a?a:null===(d=f.locale)||void 0===d||null===(u=d.options)||void 0===u?void 0:u.weekStartsOn)&&void 0!==i?i:0);if(!(p>=0&&p<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var m=Object(r.a)(t),b=m.getUTCDay(),y=(b=1&&y<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var x=new Date(0);x.setUTCFullYear(p+1,0,y),x.setUTCHours(0,0,0,0);var v=m(x,e),_=new Date(0);_.setUTCFullYear(p,0,y),_.setUTCHours(0,0,0,0);var w=m(_,e);return f.getTime()>=v.getTime()?p+1:f.getTime()>=w.getTime()?p:p-1}function y(t,e){var i,a,s,r,o,c,h,d;Object(n.a)(1,arguments);var u=g(),f=Object(l.a)(null!==(i=null!==(a=null!==(s=null!==(r=null==e?void 0:e.firstWeekContainsDate)&&void 0!==r?r:null==e||null===(o=e.locale)||void 0===o||null===(c=o.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==s?s:u.firstWeekContainsDate)&&void 0!==a?a:null===(h=u.locale)||void 0===h||null===(d=h.options)||void 0===d?void 0:d.firstWeekContainsDate)&&void 0!==i?i:1),p=b(t,e),y=new Date(0);y.setUTCFullYear(p,0,f),y.setUTCHours(0,0,0,0);var x=m(y,e);return x}function x(t,e){for(var i=t<0?"-":"",n=Math.abs(t).toString();n.length0?i:1-i;return x("yy"===e?n%100:n,e.length)},_=function(t,e){var i=t.getUTCMonth();return"M"===e?String(i+1):x(i+1,2)},w=function(t,e){return x(t.getUTCDate(),e.length)},O=function(t,e){return x(t.getUTCHours()%12||12,e.length)},M=function(t,e){return x(t.getUTCHours(),e.length)},k=function(t,e){return x(t.getUTCMinutes(),e.length)},j=function(t,e){return x(t.getUTCSeconds(),e.length)},S=function(t,e){var i=e.length,n=t.getUTCMilliseconds();return x(Math.floor(n*Math.pow(10,i-3)),e.length)};function D(t,e){var i=t>0?"-":"+",n=Math.abs(t),a=Math.floor(n/60),s=n%60;if(0===s)return i+String(a);var r=e||"";return i+String(a)+r+x(s,2)}function P(t,e){return t%60==0?(t>0?"-":"+")+x(Math.abs(t)/60,2):E(t,e)}function E(t,e){var i=e||"",n=t>0?"-":"+",a=Math.abs(t);return n+x(Math.floor(a/60),2)+i+x(a%60,2)}var C={G:function(t,e,i){var n=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return i.era(n,{width:"abbreviated"});case"GGGGG":return i.era(n,{width:"narrow"});case"GGGG":default:return i.era(n,{width:"wide"})}},y:function(t,e,i){if("yo"===e){var n=t.getUTCFullYear(),a=n>0?n:1-n;return i.ordinalNumber(a,{unit:"year"})}return v(t,e)},Y:function(t,e,i,n){var a=b(t,n),s=a>0?a:1-a;return"YY"===e?x(s%100,2):"Yo"===e?i.ordinalNumber(s,{unit:"year"}):x(s,e.length)},R:function(t,e){return x(u(t),e.length)},u:function(t,e){return x(t.getUTCFullYear(),e.length)},Q:function(t,e,i){var n=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return x(n,2);case"Qo":return i.ordinalNumber(n,{unit:"quarter"});case"QQQ":return i.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return i.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return i.quarter(n,{width:"wide",context:"formatting"})}},q:function(t,e,i){var n=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return x(n,2);case"qo":return i.ordinalNumber(n,{unit:"quarter"});case"qqq":return i.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return i.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return i.quarter(n,{width:"wide",context:"standalone"})}},M:function(t,e,i){var n=t.getUTCMonth();switch(e){case"M":case"MM":return _(t,e);case"Mo":return i.ordinalNumber(n+1,{unit:"month"});case"MMM":return i.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return i.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return i.month(n,{width:"wide",context:"formatting"})}},L:function(t,e,i){var n=t.getUTCMonth();switch(e){case"L":return String(n+1);case"LL":return x(n+1,2);case"Lo":return i.ordinalNumber(n+1,{unit:"month"});case"LLL":return i.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return i.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return i.month(n,{width:"wide",context:"standalone"})}},w:function(t,e,i,a){var s=function(t,e){Object(n.a)(1,arguments);var i=Object(r.a)(t),a=m(i,e).getTime()-y(i,e).getTime();return Math.round(a/6048e5)+1}(t,a);return"wo"===e?i.ordinalNumber(s,{unit:"week"}):x(s,e.length)},I:function(t,e,i){var a=function(t){Object(n.a)(1,arguments);var e=Object(r.a)(t),i=d(e).getTime()-f(e).getTime();return Math.round(i/6048e5)+1}(t);return"Io"===e?i.ordinalNumber(a,{unit:"week"}):x(a,e.length)},d:function(t,e,i){return"do"===e?i.ordinalNumber(t.getUTCDate(),{unit:"date"}):w(t,e)},D:function(t,e,i){var a=function(t){Object(n.a)(1,arguments);var e=Object(r.a)(t),i=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var a=e.getTime(),s=i-a;return Math.floor(s/864e5)+1}(t);return"Do"===e?i.ordinalNumber(a,{unit:"dayOfYear"}):x(a,e.length)},E:function(t,e,i){var n=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return i.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return i.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(n,{width:"short",context:"formatting"});case"EEEE":default:return i.day(n,{width:"wide",context:"formatting"})}},e:function(t,e,i,n){var a=t.getUTCDay(),s=(a-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return x(s,2);case"eo":return i.ordinalNumber(s,{unit:"day"});case"eee":return i.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return i.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(a,{width:"short",context:"formatting"});case"eeee":default:return i.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,i,n){var a=t.getUTCDay(),s=(a-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return x(s,e.length);case"co":return i.ordinalNumber(s,{unit:"day"});case"ccc":return i.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return i.day(a,{width:"narrow",context:"standalone"});case"cccccc":return i.day(a,{width:"short",context:"standalone"});case"cccc":default:return i.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,i){var n=t.getUTCDay(),a=0===n?7:n;switch(e){case"i":return String(a);case"ii":return x(a,e.length);case"io":return i.ordinalNumber(a,{unit:"day"});case"iii":return i.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return i.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return i.day(n,{width:"short",context:"formatting"});case"iiii":default:return i.day(n,{width:"wide",context:"formatting"})}},a:function(t,e,i){var n=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return i.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return i.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(t,e,i){var n,a=t.getUTCHours();switch(n=12===a?"noon":0===a?"midnight":a/12>=1?"pm":"am",e){case"b":case"bb":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return i.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return i.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(t,e,i){var n,a=t.getUTCHours();switch(n=a>=17?"evening":a>=12?"afternoon":a>=4?"morning":"night",e){case"B":case"BB":case"BBB":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return i.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return i.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(t,e,i){if("ho"===e){var n=t.getUTCHours()%12;return 0===n&&(n=12),i.ordinalNumber(n,{unit:"hour"})}return O(t,e)},H:function(t,e,i){return"Ho"===e?i.ordinalNumber(t.getUTCHours(),{unit:"hour"}):M(t,e)},K:function(t,e,i){var n=t.getUTCHours()%12;return"Ko"===e?i.ordinalNumber(n,{unit:"hour"}):x(n,e.length)},k:function(t,e,i){var n=t.getUTCHours();return 0===n&&(n=24),"ko"===e?i.ordinalNumber(n,{unit:"hour"}):x(n,e.length)},m:function(t,e,i){return"mo"===e?i.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):k(t,e)},s:function(t,e,i){return"so"===e?i.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):j(t,e)},S:function(t,e){return S(t,e)},X:function(t,e,i,n){var a=(n._originalDate||t).getTimezoneOffset();if(0===a)return"Z";switch(e){case"X":return P(a);case"XXXX":case"XX":return E(a);case"XXXXX":case"XXX":default:return E(a,":")}},x:function(t,e,i,n){var a=(n._originalDate||t).getTimezoneOffset();switch(e){case"x":return P(a);case"xxxx":case"xx":return E(a);case"xxxxx":case"xxx":default:return E(a,":")}},O:function(t,e,i,n){var a=(n._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+D(a,":");case"OOOO":default:return"GMT"+E(a,":")}},z:function(t,e,i,n){var a=(n._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+D(a,":");case"zzzz":default:return"GMT"+E(a,":")}},t:function(t,e,i,n){var a=n._originalDate||t;return x(Math.floor(a.getTime()/1e3),e.length)},T:function(t,e,i,n){return x((n._originalDate||t).getTime(),e.length)}},T=function(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},A=function(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},L={p:A,P:function(t,e){var i,n=t.match(/(P+)(p+)?/)||[],a=n[1],s=n[2];if(!s)return T(t,e);switch(a){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"})}return i.replace("{{date}}",T(a,e)).replace("{{time}}",A(s,e))}};function R(t){var e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}var N=["D","DD"],F=["YY","YYYY"];function I(t){return-1!==N.indexOf(t)}function z(t){return-1!==F.indexOf(t)}function B(t,e,i){if("YYYY"===t)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===t)throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===t)throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===t)throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var V={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function W(t){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.width?String(e.width):t.defaultWidth,n=t.formats[i]||t.formats[t.defaultWidth];return n}}var H={date:W({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:W({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:W({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},U={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function Y(t){return function(e,i){var n;if("formatting"===(null!=i&&i.context?String(i.context):"standalone")&&t.formattingValues){var a=t.defaultFormattingWidth||t.defaultWidth,s=null!=i&&i.width?String(i.width):a;n=t.formattingValues[s]||t.formattingValues[a]}else{var r=t.defaultWidth,o=null!=i&&i.width?String(i.width):t.defaultWidth;n=t.values[o]||t.values[r]}return n[t.argumentCallback?t.argumentCallback(e):e]}}function $(t){return function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.width,a=n&&t.matchPatterns[n]||t.matchPatterns[t.defaultMatchWidth],s=e.match(a);if(!s)return null;var r,o=s[0],l=n&&t.parsePatterns[n]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?q(l,(function(t){return t.test(o)})):X(l,(function(t){return t.test(o)}));r=t.valueCallback?t.valueCallback(c):c,r=i.valueCallback?i.valueCallback(r):r;var h=e.slice(o.length);return{value:r,rest:h}}}function X(t,e){for(var i in t)if(t.hasOwnProperty(i)&&e(t[i]))return i}function q(t,e){for(var i=0;i0?"in "+n:n+" ago":n},formatLong:H,formatRelative:function(t,e,i,n){return U[t]},localize:{ordinalNumber:function(t,e){var i=Number(t),n=i%100;if(n>20||n<10)switch(n%10){case 1:return i+"st";case 2:return i+"nd";case 3:return i+"rd"}return i+"th"},era:Y({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Y({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:Y({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:Y({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:Y({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(G={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(t){return parseInt(t,10)}},function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.match(G.matchPattern);if(!i)return null;var n=i[0],a=t.match(G.parsePattern);if(!a)return null;var s=G.valueCallback?G.valueCallback(a[0]):a[0];s=e.valueCallback?e.valueCallback(s):s;var r=t.slice(n.length);return{value:s,rest:r}}),era:$({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:$({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:$({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:$({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:$({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}},K=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Z=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,J=/^'([^]*?)'?$/,tt=/''/g,et=/[a-zA-Z]/;function it(t,e,i){var a,s,c,d,u,f,p,m,b,y,x,v,_,w,O,M,k,j;Object(n.a)(2,arguments);var S=String(e),D=g(),P=null!==(a=null!==(s=null==i?void 0:i.locale)&&void 0!==s?s:D.locale)&&void 0!==a?a:Q,E=Object(l.a)(null!==(c=null!==(d=null!==(u=null!==(f=null==i?void 0:i.firstWeekContainsDate)&&void 0!==f?f:null==i||null===(p=i.locale)||void 0===p||null===(m=p.options)||void 0===m?void 0:m.firstWeekContainsDate)&&void 0!==u?u:D.firstWeekContainsDate)&&void 0!==d?d:null===(b=D.locale)||void 0===b||null===(y=b.options)||void 0===y?void 0:y.firstWeekContainsDate)&&void 0!==c?c:1);if(!(E>=1&&E<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var T=Object(l.a)(null!==(x=null!==(v=null!==(_=null!==(w=null==i?void 0:i.weekStartsOn)&&void 0!==w?w:null==i||null===(O=i.locale)||void 0===O||null===(M=O.options)||void 0===M?void 0:M.weekStartsOn)&&void 0!==_?_:D.weekStartsOn)&&void 0!==v?v:null===(k=D.locale)||void 0===k||null===(j=k.options)||void 0===j?void 0:j.weekStartsOn)&&void 0!==x?x:0);if(!(T>=0&&T<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!P.localize)throw new RangeError("locale must contain localize property");if(!P.formatLong)throw new RangeError("locale must contain formatLong property");var A=Object(r.a)(t);if(!o(A))throw new RangeError("Invalid time value");var N=R(A),F=h(A,N),V={firstWeekContainsDate:E,weekStartsOn:T,locale:P,_originalDate:A},W=S.match(Z).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,L[e])(t,P.formatLong):t})).join("").match(K).map((function(n){if("''"===n)return"'";var a=n[0];if("'"===a)return nt(n);var s=C[a];if(s)return null!=i&&i.useAdditionalWeekYearTokens||!z(n)||B(n,e,String(t)),null!=i&&i.useAdditionalDayOfYearTokens||!I(n)||B(n,e,String(t)),s(F,n,P.localize,V);if(a.match(et))throw new RangeError("Format string contains an unescaped latin alphabet character `"+a+"`");return n})).join("");return W}function nt(t){var e=t.match(J);return e?e[1].replace(tt,"'"):t}},function(t,e,i){"use strict";i.r(e);var n=i(0),a=(i(37),i(3)),s=i(6),r=i.n(s),o=i(2),l=i(9),c=Object(n.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(l.Path,{fillRule:"evenodd",d:"M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z",clipRule:"evenodd"})),h=i(10),d=i(14),u=simpayAdminPageActivityReports,f=u.user_id,p=u.currencies,g=u.default_currency,m=i(15),b=i.n(m),y=i(17),x=i(11),v=i.n(x),_=i(25),w=i.n(_);function O(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function M(t){for(var e=1;e0&&Object(n.createElement)(n.Fragment,null,Object(n.createElement)(a.CardDivider,null),Object(n.createElement)("h3",{className:"".concat("simpay-activity-reports-card-today","-today-misc-title")},Object(o.__)("Top Forms","stripe")),Object(n.createElement)("div",{className:"".concat("simpay-activity-reports-card-today","-forms")},s.map((function(t){return Object(n.createElement)(D,b()({key:t.id},t))})))),r&&Object(n.createElement)("div",{className:"".concat("simpay-activity-reports-card-today","-tip")},Object(n.createElement)("strong",null,Object(n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{d:"M11.7 2.805a.75.75 0 01.6 0A60.65 60.65 0 0122.83 8.72a.75.75 0 01-.231 1.337 49.949 49.949 0 00-9.902 3.912l-.003.002-.34.18a.75.75 0 01-.707 0A50.009 50.009 0 007.5 12.174v-.224c0-.131.067-.248.172-.311a54.614 54.614 0 014.653-2.52.75.75 0 00-.65-1.352 56.129 56.129 0 00-4.78 2.589 1.858 1.858 0 00-.859 1.228 49.803 49.803 0 00-4.634-1.527.75.75 0 01-.231-1.337A60.653 60.653 0 0111.7 2.805z"}),Object(n.createElement)("path",{d:"M13.06 15.473a48.45 48.45 0 017.666-3.282c.134 1.414.22 2.843.255 4.285a.75.75 0 01-.46.71 47.878 47.878 0 00-8.105 4.342.75.75 0 01-.832 0 47.877 47.877 0 00-8.104-4.342.75.75 0 01-.461-.71c.035-1.442.121-2.87.255-4.286A48.4 48.4 0 016 13.18v1.27a1.5 1.5 0 00-.14 2.508c-.09.38-.222.753-.397 1.11.452.213.901.434 1.346.661a6.729 6.729 0 00.551-1.608 1.5 1.5 0 00.14-2.67v-.645a48.549 48.549 0 013.44 1.668 2.25 2.25 0 002.12 0z"}),Object(n.createElement)("path",{d:"M4.462 19.462c.42-.419.753-.89 1-1.394.453.213.902.434 1.347.661a6.743 6.743 0 01-1.286 1.794.75.75 0 11-1.06-1.06z"})),r.title),Object(n.createElement)("p",null,r.text," ",Object(n.createElement)("a",{href:Object(y.decodeEntities)(r.href),target:"_blank",rel:"noreferrer"},Object(o.__)("Learn More →","stripe")))))))},C=function(t){var e=t.currency;return Object(n.createElement)("div",{className:"simpay-admin-charts-no-data",style:{width:"100%",height:"100%"}},Object(n.createElement)("div",null,Object(n.createElement)("strong",null,Object(o.sprintf)(/* translators: %s Currency code. */ -Object(o.__)("No %s transactions found.","stripe"),e.toUpperCase())),Object(n.createElement)("div",null,Object(o.__)("Please select a different currency or check back later.","stripe"))))},T=i(13),A=i.n(T),L=function(t){var e=t.currency,i=t.amount_total_formatted,s=t.status,r=t.status_formatted,l=t.email,c=t.payment_method_type_icon,h=t.date_created_human_time_diff,d=t.links,u=d.customer,f=d.payment,p="simpay-activity-reports-card-latest-payment",g=A()("simpay-activity-reports-badge",{"is-succeeded":"succeeded"===s,"is-failed":"failed"===s});return Object(n.createElement)("tr",{className:p},Object(n.createElement)("td",{className:"".concat(p,"__amount")},Object(y.decodeEntities)(i)," ",Object(n.createElement)("small",{style:{fontWeight:"normal"}},e.toUpperCase())),Object(n.createElement)("td",{className:"".concat(p,"__type")},""!==c&&Object(n.createElement)("span",{dangerouslySetInnerHTML:{__html:c}})),Object(n.createElement)("td",{className:"".concat(p,"__status")},Object(n.createElement)("div",{className:g},Object(n.createElement)("span",null,r),Object(n.createElement)("svg",{"aria-hidden":"true",className:"simpay-activity-reports-badge__icon",height:"12",width:"12",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",style:{marginLeft:"4px"}},"succeeded"===s?Object(n.createElement)("path",{d:"M5.297 13.213.293 8.255c-.39-.394-.39-1.033 0-1.426s1.024-.394 1.414 0l4.294 4.224 8.288-8.258c.39-.393 1.024-.393 1.414 0s.39 1.033 0 1.426L6.7 13.208a.994.994 0 0 1-1.402.005z",fillRule:"evenodd"}):Object(n.createElement)("path",{d:"m8 6.585 4.593-4.592a1 1 0 0 1 1.415 1.416L9.417 8l4.591 4.591a1 1 0 0 1-1.415 1.416L8 9.415l-4.592 4.592a1 1 0 0 1-1.416-1.416L6.584 8l-4.59-4.591a1 1 0 1 1 1.415-1.416z",fillRule:"evenodd"})))),Object(n.createElement)("td",{className:"".concat(p,"__email")},Object(n.createElement)(a.Tooltip,{text:Object(o.__)("View customer records","stripe")},Object(n.createElement)("a",{href:u,target:"_blank",rel:"noreferrer noopener"},l))),Object(n.createElement)("td",{className:"".concat(p,"__date")},Object(n.createElement)(a.Tooltip,{text:Object(o.__)("View payment record","stripe")},Object(n.createElement)("a",{href:f,target:"_blank",rel:"noreferrer noopener"},h))))},R=simpayAdminPageActivityReports,N=R.default_currency,F=R.links.all_payments,I=function(){var t=j("/wpsp/__internal__/report/latest-payments",{currency:N},[]),e=t.data.payments;return Object(n.createElement)(a.Card,{elevation:2,className:"simpay-activity-reports-card-latest"},Object(n.createElement)(a.CardHeader,null,Object(n.createElement)("h2",{className:"simpay-activity-reports-card-title"},Object(o.__)("Latest Payments","stripe")),Object(n.createElement)(a.Button,{className:"simpay-activity-reports-card-title-link",href:F,variant:"link",isSmall:!0,target:"_blank"},Object(o.__)("View More →","stripe"))),Object(n.createElement)(a.CardBody,null,t.isLoading&&Object(n.createElement)(a.Spinner,null),!t.isLoading&&e.length>0&&Object(n.createElement)("table",{className:"".concat("simpay-activity-reports-card-latest","-payments")},Object(n.createElement)("tbody",null,e.map((function(t){return Object(n.createElement)(L,b()({key:t.id},t))})))),!t.isLoading&&0===e.length&&Object(n.createElement)(C,{currency:N})))},z=i(8),B=i(4);function V(t,e){Object(B.a)(2,arguments);var i=Object(z.a)(t),n=Object(z.a)(e),a=i.getFullYear()-n.getFullYear(),s=i.getMonth()-n.getMonth();return 12*a+s}function W(t,e){Object(B.a)(2,arguments);var i=Object(z.a)(t),n=Object(z.a)(e),a=i.getTime()-n.getTime();return a<0?-1:a>0?1:a}function H(t){Object(B.a)(1,arguments);var e=Object(z.a)(t);return e.setHours(23,59,59,999),e}function U(t){Object(B.a)(1,arguments);var e=Object(z.a)(t),i=e.getMonth();return e.setFullYear(e.getFullYear(),i+1,0),e.setHours(23,59,59,999),e}function Y(t){Object(B.a)(1,arguments);var e=Object(z.a)(t);return H(e).getTime()===U(e).getTime()}var $=i(78),X=i(33);function q(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function G(t){for(var e=1;e27&&n.setDate(30),n.setMonth(n.getMonth()-s*r);var o=W(n,a)===-s;Y(Object(z.a)(t))&&1===r&&1===W(t,a)&&(o=!1),i=s*(r-Number(o))}return 0===i?0:i}(new Date(s.end),new Date(s.start))>12?(e=Object(X.dateI18n)("F Y",s.start),i=Object(X.dateI18n)("F Y",s.end)):"today"===s.type?(e=Object(X.dateI18n)(l.formats.date,K),i=e):(e=Object(X.dateI18n)(l.formats.date,s.start),i=Object(X.dateI18n)(l.formats.date,s.end)),Object(n.createElement)("div",{className:"simpay-activity-reports-card-reports-date-range"},Object(n.createElement)(a.SelectControl,{label:Object(o.__)("Report range","stripe"),value:s.type,options:"custom"===s.type?[].concat(c,[{label:Object(o.__)("Custom","stripe"),value:"custom"}]):c,onChange:function(t){r(G(G({},s),{},{type:t,start:Object(d.d)(t,K),end:Object(d.c)(t,s.end)}))},hideLabelFromVision:!0}),Object(n.createElement)(a.Dropdown,{position:"bottom center",popoverProps:{noArrow:!1},renderToggle:function(t){var i=t.isOpen,s=t.onToggle;return Object(n.createElement)(a.Button,{variant:"tertiary",onClick:s,"aria-expanded":i},e)},renderContent:function(t){var e=t.onToggle;return Object(n.createElement)(a.DatePicker,{currentDate:new Date(s.start),onChange:function(t){r(G(G({},s),{},{start:Object($.a)(new Date(t),"yyyy-MM-dd 00:00:00"),type:"custom"})),e()},startOfWeek:l.l10n.startOfWeek,isInvalidDate:function(t){return t>new Date(s.end)}})}}),Object(n.createElement)("span",{style:{color:"#ccc"}},"–"),Object(n.createElement)(a.Dropdown,{position:"bottom center",popoverProps:{noArrow:!1},renderToggle:function(t){var e=t.isOpen,s=t.onToggle;return Object(n.createElement)(a.Button,{variant:"tertiary",onClick:s,"aria-expanded":e},i)},renderContent:function(t){var e=t.onToggle;return Object(n.createElement)(a.DatePicker,{currentDate:new Date(s.end),onChange:function(t){r(G(G({},s),{},{end:Object($.a)(new Date(t),"yyyy-MM-dd 23:59:59"),type:"custom"})),e()},startOfWeek:l.l10n.startOfWeek,isInvalidDate:function(t){return tnew Date}})}}))},J="simpay-activity-reports-data-bar",tt=function(t){var e=t.isLoading,i=t.label,s=t.data;return Object(n.createElement)("div",{className:J},Object(n.createElement)("div",{className:"".concat(J,"__header")},Object(n.createElement)("h3",{className:"".concat(J,"__label")},i),!e&&Object(n.createElement)("div",{className:"".concat(J,"__legend")},s.map((function(t){var e=t.label,i=t.color;return Object(n.createElement)("div",{key:e,className:"".concat(J,"__legend-item"),style:{color:i}},Object(n.createElement)("span",null,e))})))),Object(n.createElement)("div",{className:"".concat(J,"__bar")},!e&&s.length>0&&s.map((function(t){return Object(n.createElement)(a.Button,{key:t.label,label:"".concat(t.label,": ").concat(t.value,"%"),showTooltip:!0,className:"".concat(J,"__bar-item"),style:{backgroundColor:t.color,flexBasis:"".concat(t.value,"%"),flexGrow:1}},Object(n.createElement)("div",{className:"screen-reader-text"},t.label))})),!e&&0===s.length&&Object(n.createElement)("div",{className:"".concat(J,"__bar-item-none")},Object(o.__)("n/a","stripe"))))},et=function(t){var e=t.currency,i=t.range,a=j("/wpsp/__internal__/report/payment-info",{range:i,currency:e},[i]),s=a.data,r=s.payment_method_types,l=s.payment_statuses;return Object(n.createElement)("div",{className:"".concat("simpay-activity-reports-card-reports","-payment-breakdown")},Object(n.createElement)(tt,{label:Object(o.__)("Payment Methods","stripe"),data:r,isLoading:a.isLoading}),Object(n.createElement)(tt,{label:Object(o.__)("Payments","stripe"),data:l,isLoading:a.isLoading}))},it=function(t){var e=t.currency,i=t.range,a=j("/wpsp/__internal__/report/gross-volume-period-over-period",{range:i,currency:e},[i]),s=a.data,r=s.delta,l=s.total_formatted;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)("div",{className:"".concat("simpay-activity-reports-card-reports","-report-title")},Object(n.createElement)("h3",null,Object(o.__)("Gross Volume","stripe"),!a.isLoading&&Object(n.createElement)(n.Fragment,null,": ",Object(n.createElement)("em",null,Object(y.decodeEntities)(l)))),!a.isLoading&&Object(n.createElement)(d.a,{delta:r})),Object(n.createElement)(d.b,{report:a,style:{width:"100%",height:"300px"},config:{yAxisIsCurrency:!0},noData:Object(n.createElement)("div",null,Object(n.createElement)("strong",null,Object(o.sprintf)(/* translators: %s Currency code. */ +!function(t){var e={};function i(n){if(e[n])return e[n].exports;var a=e[n]={i:n,l:!1,exports:{}};return t[n].call(a.exports,a,a.exports,i),a.l=!0,a.exports}i.m=t,i.c=e,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 a in t)i.d(n,a,function(e){return t[e]}.bind(null,a));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="",i(i.s=77)}([function(t,e){t.exports=window.wp.element},,function(t,e){t.exports=window.wp.i18n},function(t,e){t.exports=window.wp.components},function(t,e,i){"use strict";function n(t,e){if(e.length1?"s":"")+" required, but only "+e.length+" present")}i.d(e,"a",(function(){return n}))},function(t,e){t.exports=window.React},function(t,e,i){var n=i(26),a=i(27),s=i(21),r=i(28);t.exports=function(t,e){return n(t)||a(t,e)||s(t,e)||r()},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,i){"use strict";function n(t){if(null===t||!0===t||!1===t)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}i.d(e,"a",(function(){return n}))},function(t,e,i){"use strict";i.d(e,"a",(function(){return s}));var n=i(4);function a(t){return(a="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 s(t){Object(n.a)(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||"object"===a(t)&&"[object Date]"===e?new Date(t.getTime()):"number"==typeof t||"[object Number]"===e?new Date(t):("string"!=typeof t&&"[object String]"!==e||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}},function(t,e){t.exports=window.wp.primitives},function(t,e){t.exports=window.wp.url},function(t,e,i){var n=i(30);t.exports=function(t,e,i){return(e=n(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=window.lodash},function(t,e,i){"use strict";i.d(e,"b",(function(){return Rr})),i.d(e,"e",(function(){return jr})),i.d(e,"d",(function(){return yr})),i.d(e,"c",(function(){return xr})),i.d(e,"a",(function(){return Pr}));var n=i(15),a=i.n(n),s=i(11),r=i.n(s),o=i(6),l=i.n(o),c=i(0);const h="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function d(t,e,i){const n=i||(t=>Array.prototype.slice.call(t));let a=!1,s=[];return function(...i){s=n(i),a||(a=!0,h.call(window,()=>{a=!1,t.apply(e,s)}))}}const u=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2;function f(){}const p=function(){let t=0;return function(){return t++}}();function g(t){return null==t}function m(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.substr(0,7)&&"Array]"===e.substr(-6)}function b(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}const y=t=>("number"==typeof t||t instanceof Number)&&isFinite(+t);function x(t,e){return y(t)?t:e}function v(t,e){return void 0===t?e:t}const _=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function w(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function O(t,e,i,n){let a,s,r;if(m(t))if(s=t.length,n)for(a=s-1;a>=0;a--)e.call(i,t[a],a);else for(a=0;ai;)t=t[e.substr(i,n-i)],i=n+1,n=C(e,i);return t}function A(t){return t.charAt(0).toUpperCase()+t.slice(1)}const L=t=>void 0!==t,R=t=>"function"==typeof t,N=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0},F=Math.PI,I=2*F,z=I+F,V=Number.POSITIVE_INFINITY,B=F/180,W=F/2,H=F/4,U=2*F/3,Y=Math.log10,$=Math.sign;function X(t){const e=Math.round(t);t=G(t,e,t/1e3)?e:t;const i=Math.pow(10,Math.floor(Y(t))),n=t/i;return(n<=1?1:n<=2?2:n<=5?5:10)*i}function q(t){return!isNaN(parseFloat(t))&&isFinite(t)}function G(t,e,i){return Math.abs(t-e)l&&c=Math.min(e,i)-n&&t<=Math.max(e,i)+n}const ot=t=>0===t||1===t,lt=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*I/i),ct=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*I/i)+1,ht={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*W),easeOutSine:t=>Math.sin(t*W),easeInOutSine:t=>-.5*(Math.cos(F*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>ot(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>ot(t)?t:lt(t,.075,.3),easeOutElastic:t=>ot(t)?t:ct(t,.075,.3),easeInOutElastic(t){const e=.1125;return ot(t)?t:t<.5?.5*lt(2*t,e,.45):.5+.5*ct(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-ht.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*ht.easeInBounce(2*t):.5*ht.easeOutBounce(2*t-1)+.5},dt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},ut="0123456789ABCDEF",ft=t=>ut[15&t],pt=t=>ut[(240&t)>>4]+ut[15&t],gt=t=>(240&t)>>4==(15&t);function mt(t){return t+.5|0}const bt=(t,e,i)=>Math.max(Math.min(t,i),e);function yt(t){return bt(mt(2.55*t),0,255)}function xt(t){return bt(mt(255*t),0,255)}function vt(t){return bt(mt(t/2.55)/100,0,1)}function _t(t){return bt(mt(100*t),0,100)}const wt=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/,Ot=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Mt(t,e,i){const n=e*Math.min(i,1-i),a=(e,a=(e+t/30)%12)=>i-n*Math.max(Math.min(a-3,9-a,1),-1);return[a(0),a(8),a(4)]}function kt(t,e,i){const n=(n,a=(n+t/60)%6)=>i-i*e*Math.max(Math.min(a,4-a,1),0);return[n(5),n(3),n(1)]}function jt(t,e,i){const n=Mt(t,1,.5);let a;for(e+i>1&&(a=1/(e+i),e*=a,i*=a),a=0;a<3;a++)n[a]*=1-e-i,n[a]+=e;return n}function St(t){const e=t.r/255,i=t.g/255,n=t.b/255,a=Math.max(e,i,n),s=Math.min(e,i,n),r=(a+s)/2;let o,l,c;return a!==s&&(c=a-s,l=r>.5?c/(2-a-s):c/(a+s),o=a===e?(i-n)/c+(i=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=xt(t[3]))):(e=Rt(t,{r:0,g:0,b:0,a:1})).a=xt(e.a),e}function Ft(t){return"r"===t.charAt(0)?function(t){const e=wt.exec(t);let i,n,a,s=255;if(e){if(e[7]!==i){const t=+e[7];s=255&(e[8]?yt(t):255*t)}return i=+e[1],n=+e[3],a=+e[5],i=255&(e[2]?yt(i):i),n=255&(e[4]?yt(n):n),a=255&(e[6]?yt(a):a),{r:i,g:n,b:a,a:s}}}(t):function(t){const e=Ot.exec(t);let i,n=255;if(!e)return;e[5]!==i&&(n=e[6]?yt(+e[5]):xt(+e[5]));const a=Et(+e[2]),s=+e[3]/100,r=+e[4]/100;return i="hwb"===e[1]?function(t,e,i){return Dt(jt,t,e,i)}(a,s,r):"hsv"===e[1]?function(t,e,i){return Dt(kt,t,e,i)}(a,s,r):Pt(a,s,r),{r:i[0],g:i[1],b:i[2],a:n}}(t)}class It{constructor(t){if(t instanceof It)return t;const e=typeof t;let i;var n,a,s;"object"===e?i=Nt(t):"string"===e&&(s=(n=t).length,"#"===n[0]&&(4===s||5===s?a={r:255&17*dt[n[1]],g:255&17*dt[n[2]],b:255&17*dt[n[3]],a:5===s?17*dt[n[4]]:255}:7!==s&&9!==s||(a={r:dt[n[1]]<<4|dt[n[2]],g:dt[n[3]]<<4|dt[n[4]],b:dt[n[5]]<<4|dt[n[6]],a:9===s?dt[n[7]]<<4|dt[n[8]]:255})),i=a||function(t){At||(At=function(){const t={},e=Object.keys(Tt),i=Object.keys(Ct);let n,a,s,r,o;for(n=0;n>16&255,s>>8&255,255&s]}return t}(),At.transparent=[0,0,0,0]);const e=At[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}(t)||Ft(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Rt(this._rgb);return t&&(t.a=vt(t.a)),t}set rgb(t){this._rgb=Nt(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${vt(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):this._rgb;var t}hexString(){return this._valid?(t=this._rgb,e=function(t){return gt(t.r)&>(t.g)&>(t.b)&>(t.a)}(t)?ft:pt,t?"#"+e(t.r)+e(t.g)+e(t.b)+(t.a<255?e(t.a):""):t):this._rgb;var t,e}hslString(){return this._valid?function(t){if(!t)return;const e=St(t),i=e[0],n=_t(e[1]),a=_t(e[2]);return t.a<255?`hsla(${i}, ${n}%, ${a}%, ${vt(t.a)})`:`hsl(${i}, ${n}%, ${a}%)`}(this._rgb):this._rgb}mix(t,e){const i=this;if(t){const n=i.rgb,a=t.rgb;let s;const r=e===s?.5:e,o=2*r-1,l=n.a-a.a,c=((o*l==-1?o:(o+l)/(1+o*l))+1)/2;s=1-c,n.r=255&c*n.r+s*a.r+.5,n.g=255&c*n.g+s*a.g+.5,n.b=255&c*n.b+s*a.b+.5,n.a=r*n.a+(1-r)*a.a,i.rgb=n}return i}clone(){return new It(this.rgb)}alpha(t){return this._rgb.a=xt(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=mt(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Lt(this._rgb,2,t),this}darken(t){return Lt(this._rgb,2,-t),this}saturate(t){return Lt(this._rgb,1,t),this}desaturate(t){return Lt(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=St(t);i[0]=Et(i[0]+e),i=Pt(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}function zt(t){return new It(t)}const Vt=t=>t instanceof CanvasGradient||t instanceof CanvasPattern;function Bt(t){return Vt(t)?t:zt(t)}function Wt(t){return Vt(t)?t:zt(t).saturate(.5).darken(.1).hexString()}const Ht=Object.create(null),Ut=Object.create(null);function Yt(t,e){if(!e)return t;const i=e.split(".");for(let e=0,n=i.length;et.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>Wt(e.backgroundColor),this.hoverBorderColor=(t,e)=>Wt(e.borderColor),this.hoverColor=(t,e)=>Wt(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t)}set(t,e){return $t(this,t,e)}get(t){return Yt(this,t)}describe(t,e){return $t(Ut,t,e)}override(t,e){return $t(Ht,t,e)}route(t,e,i,n){const a=Yt(this,t),s=Yt(this,i),r="_"+e;Object.defineProperties(a,{[r]:{value:a[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[r],e=s[n];return b(t)?Object.assign({},e,t):v(t,e)},set(t){this[r]=t}}})}}({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function qt(t,e,i,n,a){let s=e[a];return s||(s=e[a]=t.measureText(a).width,i.push(a)),s>n&&(n=s),n}function Gt(t,e,i,n){let a=(n=n||{}).data=n.data||{},s=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(a=n.data={},s=n.garbageCollect=[],n.font=e),t.save(),t.font=e;let r=0;const o=i.length;let l,c,h,d,u;for(l=0;li.length){for(l=0;l0&&t.stroke()}}function Jt(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.xe.top-i&&t.y0&&""!==s.strokeColor;let l,c;for(t.save(),t.font=a.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),g(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,s),l=0;lv(t[i],t[e[i]]):e=>t[e]:()=>t;for(const t of a)i[t]=+s(t)||0;return i}function de(t){return he(t,{top:"y",right:"x",bottom:"y",left:"x"})}function ue(t){return he(t,["topLeft","topRight","bottomLeft","bottomRight"])}function fe(t){const e=de(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function pe(t,e){t=t||{},e=e||Xt.font;let i=v(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let n=v(t.style,e.style);n&&!(""+n).match(le)&&(console.warn('Invalid font style specified: "'+n+'"'),n="");const a={family:v(t.family,e.family),lineHeight:ce(v(t.lineHeight,e.lineHeight),i),size:i,style:n,weight:v(t.weight,e.weight),string:""};return a.string=function(t){return!t||g(t.size)||g(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(a),a}function ge(t,e,i,n){let a,s,r,o=!0;for(a=0,s=t.length;at[i]1;)n=s+a>>1,i(n)?s=n:a=n;return{lo:s,hi:a}}const ye=(t,e,i)=>be(t,i,n=>t[n][e]be(t,i,n=>t[n][e]>=i),ve=["push","pop","shift","splice","unshift"];function _e(t,e){const i=t._chartjs;if(!i)return;const n=i.listeners,a=n.indexOf(e);-1!==a&&n.splice(a,1),n.length>0||(ve.forEach(e=>{delete t[e]}),delete t._chartjs)}function we(t){const e=new Set;let i,n;for(i=0,n=t.length;it[0])){L(n)||(n=Le("_fallback",t));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:i,_fallback:n,_getTarget:a,override:a=>Oe([a,...t],e,i,n)};return new Proxy(s,{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,n)=>De(i,n,()=>function(t,e,i,n){let a;for(const s of e)if(a=Le(je(s,t),i),L(a))return Se(t,a)?Te(i,n,t,a):a}(n,e,t,i)),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>Re(t).includes(e),ownKeys:t=>Re(t),set(t,e,i){const n=t._storage||(t._storage=a());return t[e]=n[e]=i,delete t._keys,!0}})}function Me(t,e,i,n){const a={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:ke(t,n),setContext:e=>Me(t,e,i,n),override:a=>Me(t.override(a),e,i,n)};return new Proxy(a,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>De(t,e,()=>function(t,e,i){const{_proxy:n,_context:a,_subProxy:s,_descriptors:r}=t;let o=n[e];return R(o)&&r.isScriptable(e)&&(o=function(t,e,i,n){const{_proxy:a,_context:s,_subProxy:r,_stack:o}=i;if(o.has(t))throw new Error("Recursion detected: "+Array.from(o).join("->")+"->"+t);return o.add(t),e=e(s,r||n),o.delete(t),Se(t,e)&&(e=Te(a._scopes,a,t,e)),e}(e,o,t,i)),m(o)&&o.length&&(o=function(t,e,i,n){const{_proxy:a,_context:s,_subProxy:r,_descriptors:o}=i;if(L(s.index)&&n(t))e=e[s.index%e.length];else if(b(e[0])){const i=e,n=a._scopes.filter(t=>t!==i);e=[];for(const l of i){const i=Te(n,a,t,l);e.push(Me(i,s,r&&r[t],o))}}return e}(e,o,t,r.isIndexable)),Se(e,o)&&(o=Me(o,a,s&&s[e],r)),o}(t,e,i)),getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,i)=>Reflect.has(t,i),ownKeys:()=>Reflect.ownKeys(t),set:(e,i,n)=>(t[i]=n,delete e[i],!0)})}function ke(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:n=e.indexable,_allKeys:a=e.allKeys}=t;return{allKeys:a,scriptable:i,indexable:n,isScriptable:R(i)?i:()=>i,isIndexable:R(n)?n:()=>n}}const je=(t,e)=>t?t+A(e):e,Se=(t,e)=>b(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function De(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const n=i();return t[e]=n,n}function Pe(t,e,i){return R(t)?t(e,i):t}const Ee=(t,e)=>!0===t?e:"string"==typeof t?T(e,t):void 0;function Ce(t,e,i,n,a){for(const s of e){const e=Ee(i,s);if(e){t.add(e);const s=Pe(e._fallback,i,a);if(L(s)&&s!==i&&s!==n)return s}else if(!1===e&&L(n)&&i!==n)return null}return!1}function Te(t,e,i,n){const a=e._rootScopes,s=Pe(e._fallback,i,n),r=[...t,...a],o=new Set;o.add(n);let l=Ae(o,r,i,s||i,n);return null!==l&&(!L(s)||s===i||(l=Ae(o,r,s,l,n),null!==l))&&Oe(Array.from(o),[""],a,s,()=>function(t,e,i){const n=t._getTarget();e in n||(n[e]={});const a=n[e];return m(a)&&b(i)?i:a}(e,i,n))}function Ae(t,e,i,n,a){for(;i;)i=Ce(t,e,i,n,a);return i}function Le(t,e){for(const i of e){if(!i)continue;const e=i[t];if(L(e))return e}}function Re(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter(t=>!t.startsWith("_")))e.add(t);return Array.from(e)}(t._scopes)),e}const Ne=Number.EPSILON||1e-14,Fe=(t,e)=>e"x"===t?"y":"x";function ze(t,e,i,n){const a=t.skip?e:t,s=e,r=i.skip?e:i,o=et(s,a),l=et(r,s);let c=o/(o+l),h=l/(o+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=n*c,u=n*h;return{previous:{x:s.x-d*(r.x-a.x),y:s.y-d*(r.y-a.y)},next:{x:s.x+u*(r.x-a.x),y:s.y+u*(r.y-a.y)}}}function Ve(t,e,i){return Math.max(Math.min(t,i),e)}function Be(t,e,i,n,a){let s,r,o,l;if(e.spanGaps&&(t=t.filter(t=>!t.skip)),"monotone"===e.cubicInterpolationMode)!function(t,e="x"){const i=Ie(e),n=t.length,a=Array(n).fill(0),s=Array(n);let r,o,l,c=Fe(t,0);for(r=0;rwindow.getComputedStyle(t,null),$e=["top","right","bottom","left"];function Xe(t,e,i){const n={};i=i?"-"+i:"";for(let a=0;a<4;a++){const s=$e[a];n[s]=parseFloat(t[e+"-"+s+i])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function qe(t,e){const{canvas:i,currentDevicePixelRatio:n}=e,a=Ye(i),s="border-box"===a.boxSizing,r=Xe(a,"padding"),o=Xe(a,"border","width"),{x:l,y:c,box:h}=function(t,e){const i=t.native||t,n=i.touches,a=n&&n.length?n[0]:i,{offsetX:s,offsetY:r}=a;let o,l,c=!1;if(((t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot))(s,r,i.target))o=s,l=r;else{const t=e.getBoundingClientRect();o=a.clientX-t.left,l=a.clientY-t.top,c=!0}return{x:o,y:l,box:c}}(t,i),d=r.left+(h&&o.left),u=r.top+(h&&o.top);let{width:f,height:p}=e;return s&&(f-=r.width+o.width,p-=r.height+o.height),{x:Math.round((l-d)/f*i.width/n),y:Math.round((c-u)/p*i.height/n)}}const Ge=t=>Math.round(10*t)/10;function Qe(t,e,i){const n=e||1,a=Math.floor(t.height*n),s=Math.floor(t.width*n);t.height=a/n,t.width=s/n;const r=t.canvas;return r.style&&(i||!r.style.height&&!r.style.width)&&(r.style.height=t.height+"px",r.style.width=t.width+"px"),(t.currentDevicePixelRatio!==n||r.height!==a||r.width!==s)&&(t.currentDevicePixelRatio=n,r.height=a,r.width=s,t.ctx.setTransform(n,0,0,n,0,0),!0)}const Ze=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(t){}return t}();function Ke(t,e){const i=function(t,e){return Ye(t).getPropertyValue(e)}(t,e),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function Je(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function ti(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:"middle"===n?i<.5?t.y:e.y:"after"===n?i<1?t.y:e.y:i>0?e.y:t.y}}function ei(t,e,i,n){const a={x:t.cp2x,y:t.cp2y},s={x:e.cp1x,y:e.cp1y},r=Je(t,a,i),o=Je(a,s,i),l=Je(s,e,i),c=Je(r,o,i),h=Je(o,l,i);return Je(c,h,i)}const ii=new Map;function ni(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let n=ii.get(i);return n||(n=new Intl.NumberFormat(t,e),ii.set(i,n)),n}(e,i).format(t)}function ai(t,e,i){return t?function(t,e){return{x:i=>t+t+e-i,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,i):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function si(t){return"angle"===t?{between:at,compare:it,normalize:nt}:{between:rt,compare:(t,e)=>t-e,normalize:t=>t}}function ri({start:t,end:e,count:i,loop:n,style:a}){return{start:t%i,end:e%i,loop:n&&(e-t+1)%i==0,style:a}}function oi(t,e,i){if(!i)return[t];const{property:n,start:a,end:s}=i,r=e.length,{compare:o,between:l,normalize:c}=si(n),{start:h,end:d,loop:u,style:f}=function(t,e,i){const{property:n,start:a,end:s}=i,{between:r,normalize:o}=si(n),l=e.length;let c,h,{start:d,end:u,loop:f}=t;if(f){for(d+=l,u+=l,c=0,h=l;cn({chart:t,initial:e.initial,numSteps:s,currentStep:Math.min(i-e.start,s)}))}_refresh(){this._request||(this._running=!0,this._request=h.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,n)=>{if(!i.running||!i.items.length)return;const a=i.items;let s,r=a.length-1,o=!1;for(;r>=0;--r)s=a[r],s._active?(s._total>i.duration&&(i.duration=s._total),s.tick(t),o=!0):(a[r]=a[a.length-1],a.pop());o&&(n.draw(),this._notify(n,i,t,"progress")),a.length||(i.running=!1,this._notify(n,i,t,"complete"),i.initial=!1),e+=a.length}),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((t,e)=>Math.max(t,e._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let n=i.length-1;for(;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}};const ui={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const n=Bt(t||"transparent"),a=n.valid&&Bt(e||"transparent");return a&&a.valid?a.mix(n,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class fi{constructor(t,e,i,n){const a=e[i];n=ge([t.to,n,a,t.from]);const s=ge([t.from,a,n]);this._active=!0,this._fn=t.fn||ui[t.type||typeof s],this._easing=ht[t.easing]||ht.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=s,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const n=this._target[this._prop],a=i-this._start,s=this._duration-a;this._start=i,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=a,this._loop=!!t.loop,this._to=ge([t.to,e,n,t.from]),this._from=ge([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,n=this._prop,a=this._from,s=this._loop,r=this._to;let o;if(this._active=a!==r&&(s||e1?2-o:o,o=this._easing(Math.min(1,Math.max(0,o))),this._target[n]=this._fn(a,r,o))}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let t=0;t"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),Xt.set("animations",{colors:{type:"color",properties:["color","borderColor","backgroundColor"]},numbers:{type:"number",properties:["x","y","borderWidth","radius","tension"]}}),Xt.describe("animations",{_fallback:"animation"}),Xt.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}});class gi{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!b(t))return;const e=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const n=t[i];if(!b(n))return;const a={};for(const t of pi)a[t]=n[t];(m(n.properties)&&n.properties||[i]).forEach(t=>{t!==i&&e.has(t)||e.set(t,a)})})}_animateOptions(t,e){const i=e.options,n=function(t,e){if(!e)return;let i=t.options;if(i)return i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i;t.options=e}(t,i);if(!n)return[];const a=this._createAnimations(n,i);return i.$shared&&function(t,e){const i=[],n=Object.keys(e);for(let e=0;e{t.options=i},()=>{}),a}_createAnimations(t,e){const i=this._properties,n=[],a=t.$animations||(t.$animations={}),s=Object.keys(e),r=Date.now();let o;for(o=s.length-1;o>=0;--o){const l=s[o];if("$"===l.charAt(0))continue;if("options"===l){n.push(...this._animateOptions(t,e));continue}const c=e[l];let h=a[l];const d=i.get(l);if(h){if(d&&h.active()){h.update(d,c,r);continue}h.cancel()}d&&d.duration?(a[l]=h=new fi(d,t,l,c),n.push(h)):t[l]=c}return n}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(di.add(this._chart,i),!0):void 0}}function mi(t,e){const i=t&&t.options||{},n=i.reverse,a=void 0===i.min?e:0,s=void 0===i.max?e:0;return{start:n?s:a,end:n?a:s}}function bi(t,e){const i=[],n=t._getSortedDatasetMetas(e);let a,s;for(a=0,s=n.length;a0||!i&&e<0)return a.index}return null}function wi(t,e){const{chart:i,_cachedMeta:n}=t,a=i._stacks||(i._stacks={}),{iScale:s,vScale:r,index:o}=n,l=s.axis,c=r.axis,h=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(s,r,n),d=e.length;let u;for(let t=0;ti[t].axis===e).shift()}function Mi(t,e){const i=t.controller.index,n=t.vScale&&t.vScale.axis;if(n){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[n]||void 0===e[n][i])return;delete e[n][i]}}}const ki=t=>"reset"===t||"none"===t,ji=(t,e)=>e?t:Object.assign({},t);class Si{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=xi(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&Mi(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=(t,e,i,n)=>"x"===t?e:"r"===t?n:i,a=e.xAxisID=v(i.xAxisID,Oi(t,"x")),s=e.yAxisID=v(i.yAxisID,Oi(t,"y")),r=e.rAxisID=v(i.rAxisID,Oi(t,"r")),o=e.indexAxis,l=e.iAxisID=n(o,a,s,r),c=e.vAxisID=n(o,s,a,r);e.xScale=this.getScaleForId(a),e.yScale=this.getScaleForId(s),e.rScale=this.getScaleForId(r),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&_e(this._data,this),t._stacked&&Mi(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(b(e))this._data=function(t){const e=Object.keys(t),i=new Array(e.length);let n,a,s;for(n=0,a=e.length;n{const e="_onData"+A(t),i=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...t){const a=i.apply(this,t);return n._chartjs.listeners.forEach(i=>{"function"==typeof i[e]&&i[e](...t)}),a}})}))),this._syncList=[],this._data=e}var n}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let n=!1;this._dataCheck();const a=e._stacked;e._stacked=xi(e.vScale,e),e.stack!==i.stack&&(n=!0,Mi(e),e.stack=i.stack),this._resyncElements(t),(n||a!==e._stacked)&&wi(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:n}=this,{iScale:a,_stacked:s}=i,r=a.axis;let o,l,c,h=0===t&&e===n.length||i._sorted,d=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=n,i._sorted=!0,c=n;else{c=m(n[t])?this.parseArrayData(i,n,t,e):b(n[t])?this.parseObjectData(i,n,t,e):this.parsePrimitiveData(i,n,t,e);const a=()=>null===l[r]||d&&l[r]t&&!e.hidden&&e._stacked&&{keys:bi(i,!0),values:null})(e,i,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:h}=function(t){const{min:e,max:i,minDefined:n,maxDefined:a}=t.getUserBounds();return{min:n?e:Number.NEGATIVE_INFINITY,max:a?i:Number.POSITIVE_INFINITY}}(r);let d,u;function f(){u=n[d];const e=u[r.axis];return!y(u[t.axis])||c>e||h=0;--d)if(!f()){this.updateRangeFromParsed(l,t,u,o);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let n,a,s;for(n=0,a=e.length;n=0&&tthis.getContext(i,n),h);return f.$shared&&(f.$shared=o,a[s]=Object.freeze(ji(f,o))),f}_resolveAnimations(t,e,i){const n=this.chart,a=this._cachedDataOpts,s="animation-"+e,r=a[s];if(r)return r;let o;if(!1!==n.options.animation){const n=this.chart.config,a=n.datasetAnimationScopeKeys(this._type,e),s=n.getOptionScopes(this.getDataset(),a);o=n.createResolver(s,this.getContext(t,i,e))}const l=new gi(n,o&&o.animations);return o&&o._cacheable&&(a[s]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||ki(t)||this.chart._animationsDisabled}updateElement(t,e,i,n){ki(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!ki(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;const a=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(a)||a})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];const n=i.length,a=e.length,s=Math.min(a,n);s&&this.parse(0,s),a>n?this._insertElements(n,a-n,t):a{for(t.length+=e,r=t.length-1;r>=s;r--)t[r]=t[r-e]};for(o(a),r=t;rt-e))}return t._cache.$bar}(e,t.type);let n,a,s,r,o=e._length;const l=()=>{32767!==s&&-32768!==s&&(L(r)&&(o=Math.min(o,Math.abs(s-r)||o)),r=s)};for(n=0,a=i.length;nMath.abs(o)&&(l=o,c=r),e[i.axis]=c,e._custom={barStart:l,barEnd:c,start:a,end:s,min:r,max:o}}(t,e,i,n):e[i.axis]=i.parse(t,n),e}function Ei(t,e,i,n){const a=t.iScale,s=t.vScale,r=a.getLabels(),o=a===s,l=[];let c,h,d,u;for(c=i,h=i+n;ct.x,i="left",n="right"):(e=t.base=i?1:-1)}(h,e,s)*a,d===s&&(m-=h/2),c=m+h),m===e.getPixelForValue(s)){const t=$(h)*e.getLineWidthForValue(s)/2;m+=t,h-=t}return{size:h,base:m,head:c,center:c+h/2}}_calculateBarIndexPixels(t,e){const i=e.scale,n=this.options,a=n.skipNull,s=v(n.maxBarThickness,1/0);let r,o;if(e.grouped){const i=a?this._getStackCount(t):e.stackCount,l="flex"===n.barThickness?function(t,e,i,n){const a=e.pixels,s=a[t];let r=t>0?a[t-1]:null,o=t=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,{xScale:i,yScale:n}=e,a=this.getParsed(t),s=i.getLabelForValue(a.x),r=n.getLabelForValue(a.y),o=a._custom;return{label:e.label,value:"("+s+", "+r+(o?", "+o:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,n){const a="reset"===n,{iScale:s,vScale:r}=this._cachedMeta,o=this.resolveDataElementOptions(e,n),l=this.getSharedOptions(o),c=this.includeOptions(n,l),h=s.axis,d=r.axis;for(let o=e;o""}}}};class Ii extends Si{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,n=this._cachedMeta;if(!1===this._parsing)n._parsed=i;else{let a,s,r=t=>+i[t];if(b(i[t])){const{key:t="value"}=this._parsing;r=e=>+T(i[e],t)}for(a=t,s=t+e;aat(t,o,l,!0)?1:Math.max(e,e*i,n,n*i),p=(t,e,n)=>at(t,o,l,!0)?-1:Math.min(e,e*i,n,n*i),g=f(0,c,d),m=f(W,h,u),b=p(F,c,d),y=p(F+W,h,u);n=(g-b)/2,a=(m-y)/2,s=-(g+b)/2,r=-(m+y)/2}return{ratioX:n,ratioY:a,offsetX:s,offsetY:r}}(u,d,o),b=(i.width-s)/f,y=(i.height-s)/p,x=Math.max(Math.min(b,y)/2,0),v=_(this.options.radius,x),w=(v-Math.max(v*o,0))/this._getVisibleDatasetWeightTotal();this.offsetX=g*v,this.offsetY=m*v,n.total=this.calculateTotal(),this.outerRadius=v-w*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-w*h,0),this.updateElements(a,0,a.length,t)}_circumference(t,e){const i=this.options,n=this._cachedMeta,a=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===n._parsed[t]||n.data[t].hidden?0:this.calculateCircumference(n._parsed[t]*a/I)}updateElements(t,e,i,n){const a="reset"===n,s=this.chart,r=s.chartArea,o=s.options.animation,l=(r.left+r.right)/2,c=(r.top+r.bottom)/2,h=a&&o.animateScale,d=h?0:this.innerRadius,u=h?0:this.outerRadius,f=this.resolveDataElementOptions(e,n),p=this.getSharedOptions(f),g=this.includeOptions(n,p);let m,b=this._getRotation();for(m=0;m0&&!isNaN(t)?I*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],a=ni(e._parsed[t],i.options.locale);return{label:n[t]||"",value:a}}getMaxBorderWidth(t){let e=0;const i=this.chart;let n,a,s,r,o;if(!t)for(n=0,a=i.data.datasets.length;n"spacing"!==t,_indexable:t=>"spacing"!==t},Ii.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map((e,n)=>{const a=t.getDatasetMeta(0).controller.getStyle(n);return{text:e,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,lineWidth:a.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label(t){let e=t.label;const i=": "+t.formattedValue;return m(e)?(e=e.slice(),e[0]+=i):e+=i,e}}}}};class zi extends Si{initialize(){this.enableOptionSharing=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:n=[],_dataset:a}=e,s=this.chart._animationsDisabled;let{start:r,count:o}=function(t,e,i){const n=e.length;let a=0,s=n;if(t._sorted){const{iScale:r,_parsed:o}=t,l=r.axis,{min:c,max:h,minDefined:d,maxDefined:u}=r.getUserBounds();d&&(a=st(Math.min(ye(o,r.axis,c).lo,i?n:ye(e,l,r.getPixelForValue(c)).lo),0,n-1)),s=u?st(Math.max(ye(o,r.axis,h).hi+1,i?0:ye(e,l,r.getPixelForValue(h)).hi+1),a,n)-a:n-a}return{start:a,count:s}}(e,n,s);this._drawStart=r,this._drawCount=o,function(t){const{xScale:e,yScale:i,_scaleRanges:n}=t,a={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!n)return t._scaleRanges=a,!0;const s=n.xmin!==e.min||n.xmax!==e.max||n.ymin!==i.min||n.ymax!==i.max;return Object.assign(n,a),s}(e)&&(r=0,o=n.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!a._decimated,i.points=n;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!s,options:l},t),this.updateElements(n,r,o,t)}updateElements(t,e,i,n){const a="reset"===n,{iScale:s,vScale:r,_stacked:o,_dataset:l}=this._cachedMeta,c=this.resolveDataElementOptions(e,n),h=this.getSharedOptions(c),d=this.includeOptions(n,h),u=s.axis,f=r.axis,{spanGaps:p,segment:m}=this.options,b=q(p)?p:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||a||"none"===n;let x=e>0&&this.getParsed(e-1);for(let c=e;c0&&i[u]-x[u]>b,m&&(p.parsed=i,p.raw=l.data[c]),d&&(p.options=h||this.resolveDataElementOptions(c,e.active?"active":n)),y||this.updateElement(e,c,p,n),x=i}this.updateSharedOptions(h,n,c)}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return i;const a=n[0].size(this.resolveDataElementOptions(0)),s=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,a,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}zi.id="line",zi.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},zi.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class Vi extends Si{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,n=i.data.labels||[],a=ni(e._parsed[t].r,i.options.locale);return{label:n[t]||"",value:a}}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),a=Math.max(n/2,0),s=(a-Math.max(i.cutoutPercentage?a/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=a-s*this.index,this.innerRadius=this.outerRadius-s}updateElements(t,e,i,n){const a="reset"===n,s=this.chart,r=this.getDataset(),o=s.options.animation,l=this._cachedMeta.rScale,c=l.xCenter,h=l.yCenter,d=l.getIndexAngle(0)-.5*F;let u,f=d;const p=360/this.countVisibleElements();for(u=0;u{!isNaN(t.data[n])&&this.chart.getDataVisibility(n)&&i++}),i}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?Z(this.resolveDataElementOptions(t,e).angle||i):0}}Vi.id="polarArea",Vi.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},Vi.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map((e,n)=>{const a=t.getDatasetMeta(0).controller.getStyle(n);return{text:e,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,lineWidth:a.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label:t=>t.chart.data.labels[t.dataIndex]+": "+t.formattedValue}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class Bi extends Ii{}Bi.id="pie",Bi.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Wi extends Si{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}update(t){const e=this._cachedMeta,i=e.dataset,n=e.data||[],a=e.iScale.getLabels();if(i.points=n,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const s={_loop:!0,_fullLoop:a.length===n.length,options:e};this.updateElement(i,void 0,s,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,i,n){const a=this.getDataset(),s=this._cachedMeta.rScale,r="reset"===n;for(let o=e;o"",label:t=>"("+t.label+", "+t.formattedValue+")"}}},scales:{x:{type:"linear"},y:{type:"linear"}}};class Yi{constructor(t){this.options=t||{}}formats(){return Ui()}parse(t,e){return Ui()}format(t,e){return Ui()}add(t,e,i){return Ui()}diff(t,e,i){return Ui()}startOf(t,e,i){return Ui()}endOf(t,e){return Ui()}}Yi.override=function(t){Object.assign(Yi.prototype,t)};var $i={_date:Yi};function Xi(t,e){return"native"in t?{x:t.x,y:t.y}:qe(t,e)}function qi(t,e,i,n){const{controller:a,data:s,_sorted:r}=t,o=a._cachedMeta.iScale;if(o&&e===o.axis&&"r"!==e&&r&&s.length){const t=o._reversePixels?xe:ye;if(!n)return t(s,e,i);if(a._sharedOptions){const n=s[0],a="function"==typeof n.getRange&&n.getRange(e);if(a){const n=t(s,e,i-a),r=t(s,e,i+a);return{lo:n.lo,hi:r.hi}}}}return{lo:0,hi:s.length-1}}function Gi(t,e,i,n,a){const s=t.getSortedVisibleDatasetMetas(),r=i[e];for(let t=0,i=s.length;t{t[o](a[r],n)&&s.push({element:t,datasetIndex:e,index:i}),t.inRange(a.x,a.y,n)&&(l=!0)}),i.intersect&&!l?[]:s}var Ji={modes:{index(t,e,i,n){const a=Xi(e,t),s=i.axis||"x",r=i.intersect?Qi(t,a,s,n):Zi(t,a,s,!1,n),o=[];return r.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{const e=r[0].index,i=t.data[e];i&&!i.skip&&o.push({element:i,datasetIndex:t.index,index:e})}),o):[]},dataset(t,e,i,n){const a=Xi(e,t),s=i.axis||"xy";let r=i.intersect?Qi(t,a,s,n):Zi(t,a,s,!1,n);if(r.length>0){const e=r[0].datasetIndex,i=t.getDatasetMeta(e).data;r=[];for(let t=0;tQi(t,Xi(e,t),i.axis||"xy",n),nearest:(t,e,i,n)=>Zi(t,Xi(e,t),i.axis||"xy",i.intersect,n),x:(t,e,i,n)=>Ki(t,e,{axis:"x",intersect:i.intersect},n),y:(t,e,i,n)=>Ki(t,e,{axis:"y",intersect:i.intersect},n)}};const tn=["left","top","right","bottom"];function en(t,e){return t.filter(t=>t.pos===e)}function nn(t,e){return t.filter(t=>-1===tn.indexOf(t.pos)&&t.box.axis===e)}function an(t,e){return t.sort((t,i)=>{const n=e?i:t,a=e?t:i;return n.weight===a.weight?n.index-a.index:n.weight-a.weight})}function sn(t,e,i,n){return Math.max(t[i],e[i])+Math.max(t[n],e[n])}function rn(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function on(t,e,i,n){const{pos:a,box:s}=i,r=t.maxPadding;if(!b(a)){i.size&&(t[a]-=i.size);const e=n[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?s.height:s.width),i.size=e.size/e.count,t[a]+=i.size}s.getPadding&&rn(r,s.getPadding());const o=Math.max(0,e.outerWidth-sn(r,t,"left","right")),l=Math.max(0,e.outerHeight-sn(r,t,"top","bottom")),c=o!==t.w,h=l!==t.h;return t.w=o,t.h=l,i.horizontal?{same:c,other:h}:{same:h,other:c}}function ln(t,e){const i=e.maxPadding;return function(t){const n={left:0,top:0,right:0,bottom:0};return t.forEach(t=>{n[t]=Math.max(e[t],i[t])}),n}(t?["left","right"]:["top","bottom"])}function cn(t,e,i,n){const a=[];let s,r,o,l,c,h;for(s=0,r=t.length,c=0;st.box.fullSize),!0),n=an(en(e,"left"),!0),a=an(en(e,"right")),s=an(en(e,"top"),!0),r=an(en(e,"bottom")),o=nn(e,"x"),l=nn(e,"y");return{fullSize:i,leftAndTop:n.concat(s),rightAndBottom:a.concat(l).concat(r).concat(o),chartArea:en(e,"chartArea"),vertical:n.concat(a).concat(l),horizontal:s.concat(r).concat(o)}}(t.boxes),l=o.vertical,c=o.horizontal;O(t.boxes,t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()});const h=l.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1,d=Object.freeze({outerWidth:e,outerHeight:i,padding:a,availableWidth:s,availableHeight:r,vBoxMaxWidth:s/2/h,hBoxMaxHeight:r/2}),u=Object.assign({},a);rn(u,fe(n));const f=Object.assign({maxPadding:u,w:s,h:r,x:a.left,y:a.top},a),p=function(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:n,stackWeight:a}=i;if(!t||!tn.includes(n))continue;const s=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=a}return e}(t),{vBoxMaxWidth:n,hBoxMaxHeight:a}=e;let s,r,o;for(s=0,r=t.length;s{const i=e.box;Object.assign(i,t.chartArea),i.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class fn{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}isAttached(t){return!0}updateConfig(t){}}class pn extends fn{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const gn={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},mn=t=>null===t||""===t,bn=!!Ze&&{passive:!0};function yn(t,e,i){t.canvas.removeEventListener(e,i,bn)}function xn(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function vn(t,e,i){const n=t.canvas,a=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||xn(i.addedNodes,n),e=e&&!xn(i.removedNodes,n);e&&i()});return a.observe(document,{childList:!0,subtree:!0}),a}function wn(t,e,i){const n=t.canvas,a=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||xn(i.removedNodes,n),e=e&&!xn(i.addedNodes,n);e&&i()});return a.observe(document,{childList:!0,subtree:!0}),a}const On=new Map;let Mn=0;function kn(){const t=window.devicePixelRatio;t!==Mn&&(Mn=t,On.forEach((e,i)=>{i.currentDevicePixelRatio!==t&&e()}))}function jn(t,e,i){const n=t.canvas,a=n&&He(n);if(!a)return;const s=d((t,e)=>{const n=a.clientWidth;i(t,e),n{const e=t[0],i=e.contentRect.width,n=e.contentRect.height;0===i&&0===n||s(i,n)});return r.observe(a),function(t,e){On.size||window.addEventListener("resize",kn),On.set(t,e)}(t,s),r}function Sn(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){On.delete(t),On.size||window.removeEventListener("resize",kn)}(t)}function Dn(t,e,i){const n=t.canvas,a=d(e=>{null!==t.ctx&&i(function(t,e){const i=gn[t.type]||t.type,{x:n,y:a}=qe(t,e);return{type:i,chart:e,native:t,x:void 0!==n?n:null,y:void 0!==a?a:null}}(e,t))},t,t=>{const e=t[0];return[e,e.offsetX,e.offsetY]});return function(t,e,i){t.addEventListener(e,i,bn)}(n,e,a),a}class Pn extends fn{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,n=t.getAttribute("height"),a=t.getAttribute("width");if(t.$chartjs={initial:{height:n,width:a,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",mn(a)){const e=Ke(t,"width");void 0!==e&&(t.width=e)}if(mn(n))if(""===t.style.height)t.height=t.width/(e||2);else{const e=Ke(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e.$chartjs)return!1;const i=e.$chartjs.initial;["height","width"].forEach(t=>{const n=i[t];g(n)?e.removeAttribute(t):e.setAttribute(t,n)});const n=i.style||{};return Object.keys(n).forEach(t=>{e.style[t]=n[t]}),e.width=e.width,delete e.$chartjs,!0}addEventListener(t,e,i){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),a={attach:vn,detach:wn,resize:jn}[e]||Dn;n[e]=a(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),n=i[e];n&&(({attach:Sn,detach:Sn,resize:Sn}[e]||yn)(t,e,n),i[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return function(t,e,i,n){const a=Ye(t),s=Xe(a,"margin"),r=Ue(a.maxWidth,t,"clientWidth")||V,o=Ue(a.maxHeight,t,"clientHeight")||V,l=function(t,e,i){let n,a;if(void 0===e||void 0===i){const s=He(t);if(s){const t=s.getBoundingClientRect(),r=Ye(s),o=Xe(r,"border","width"),l=Xe(r,"padding");e=t.width-l.width-o.width,i=t.height-l.height-o.height,n=Ue(r.maxWidth,s,"clientWidth"),a=Ue(r.maxHeight,s,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:n||V,maxHeight:a||V}}(t,e,i);let{width:c,height:h}=l;if("content-box"===a.boxSizing){const t=Xe(a,"border","width"),e=Xe(a,"padding");c-=e.width+t.width,h-=e.height+t.height}return c=Math.max(0,c-s.width),h=Math.max(0,n?Math.floor(c/n):h-s.height),c=Ge(Math.min(c,r,l.maxWidth)),h=Ge(Math.min(h,o,l.maxHeight)),c&&!h&&(h=Ge(c/2)),{width:c,height:h}}(t,e,i,n)}isAttached(t){const e=He(t);return!(!e||!e.isConnected)}}class En{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return q(this.x)&&q(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const n={};return t.forEach(t=>{n[t]=i[t]&&i[t].active()?i[t]._to:this[t]}),n}}En.defaults={},En.defaultRoutes=void 0;const Cn={values:t=>m(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";const n=this.chart.options.locale;let a,s=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(a="scientific"),s=function(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t)),i}(t,i)}const r=Y(Math.abs(s)),o=Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:a,minimumFractionDigits:o,maximumFractionDigits:o};return Object.assign(l,this.options.ticks.format),ni(t,n,l)},logarithmic(t,e,i){if(0===t)return"0";const n=t/Math.pow(10,Math.floor(Y(t)));return 1===n||2===n||5===n?Cn.numeric.call(this,t,e,i):""}};var Tn={formatters:Cn};function An(t,e,i,n,a){const s=v(n,0),r=Math.min(v(a,t.length),t.length);let o,l,c,h=0;for(i=Math.ceil(i),a&&(o=a-n,i=o/Math.floor(o/i)),c=s;c<0;)h++,c=Math.round(s+h*i);for(l=Math.max(s,0);le.lineWidth,tickColor:(t,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Tn.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),Xt.route("scale.ticks","color","","color"),Xt.route("scale.grid","color","","borderColor"),Xt.route("scale.grid","borderColor","","borderColor"),Xt.route("scale.title","color","","color"),Xt.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t}),Xt.describe("scales",{_fallback:"scale"}),Xt.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t});const Ln=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i;function Rn(t,e){const i=[],n=t.length/e,a=t.length;let s=0;for(;sr+1e-6)))return l}function Fn(t){return t.drawTicks?t.tickLength:0}function In(t,e){if(!t.display)return 0;const i=pe(t.font,e),n=fe(t.padding);return(m(t.text)?t.text.length:1)*i.lineHeight+n.height}function zn(t,e,i){let n=(t=>"start"===t?"left":"end"===t?"right":"center")(t);return(i&&"right"!==e||!i&&"right"===e)&&(n=(t=>"left"===t?"right":"right"===t?"left":t)(n)),n}class Vn extends En{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:n}=this;return t=x(t,Number.POSITIVE_INFINITY),e=x(e,Number.NEGATIVE_INFINITY),i=x(i,Number.POSITIVE_INFINITY),n=x(n,Number.NEGATIVE_INFINITY),{min:x(t,i),max:x(e,n),minDefined:y(t),maxDefined:y(e)}}getMinMax(t){let e,{min:i,max:n,minDefined:a,maxDefined:s}=this.getUserBounds();if(a&&s)return{min:i,max:n};const r=this.getMatchingVisibleMetas();for(let o=0,l=r.length;on?n:i,n=a&&i>n?i:n,{min:x(i,x(n,i)),max:x(n,x(i,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){w(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:n,grace:a,ticks:s}=this.options,r=s.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(t,e,i){const{min:n,max:a}=t,s=_(e,(a-n)/2),r=(t,e)=>i&&0===t?0:t+e;return{min:r(n,-Math.abs(s)),max:r(a,s)}}(this,a,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const o=rn)return function(t,e,i,n){let a,s=0,r=i[0];for(n=Math.ceil(n),a=0;at-e).pop(),e}(n);for(let t=0,e=s.length-1;ta)return e}return Math.max(a,1)}(a,e,n);if(s>0){let t,i;const n=s>1?Math.round((o-r)/(s-1)):null;for(An(e,l,c,g(n)?0:r-n,r),t=0,i=s-1;t=a||i<=1||!this.isHorizontal())return void(this.labelRotation=n);const c=this._getLabelSizes(),h=c.widest.width,d=c.highest.height,u=st(this.chart.width-h,0,this.maxWidth);s=t.offset?this.maxWidth/i:u/(i-1),h+6>s&&(s=u/(i-(t.offset?.5:1)),r=this.maxHeight-Fn(t.grid)-e.padding-In(t.title,this.chart.options.font),o=Math.sqrt(h*h+d*d),l=K(Math.min(Math.asin(st((c.highest.height+6)/s,-1,1)),Math.asin(st(r/o,-1,1))-Math.asin(st(d/o,-1,1)))),l=Math.max(n,Math.min(a,l))),this.labelRotation=l}afterCalculateLabelRotation(){w(this.options.afterCalculateLabelRotation,[this])}beforeFit(){w(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:n,grid:a}}=this,s=this._isVisible(),r=this.isHorizontal();if(s){const s=In(n,e.options.font);if(r?(t.width=this.maxWidth,t.height=Fn(a)+s):(t.height=this.maxHeight,t.width=Fn(a)+s),i.display&&this.ticks.length){const{first:e,last:n,widest:a,highest:s}=this._getLabelSizes(),o=2*i.padding,l=Z(this.labelRotation),c=Math.cos(l),h=Math.sin(l);if(r){const e=i.mirror?0:h*a.width+c*s.height;t.height=Math.min(this.maxHeight,t.height+e+o)}else{const e=i.mirror?0:c*a.width+h*s.height;t.width=Math.min(this.maxWidth,t.width+e+o)}this._calculatePadding(e,n,h,c)}}this._handleMargins(),r?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,n){const{ticks:{align:a,padding:s},position:r}=this.options,o=0!==this.labelRotation,l="top"!==r&&"x"===this.axis;if(this.isHorizontal()){const r=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,d=0;o?l?(h=n*t.width,d=i*e.height):(h=i*t.height,d=n*e.width):"start"===a?d=e.width:"end"===a?h=t.width:(h=t.width/2,d=e.width/2),this.paddingLeft=Math.max((h-r+s)*this.width/(this.width-r),0),this.paddingRight=Math.max((d-c+s)*this.width/(this.width-c),0)}else{let i=e.height/2,n=t.height/2;"start"===a?(i=0,n=t.height):"end"===a&&(i=e.height,n=0),this.paddingTop=i+s,this.paddingBottom=n+s}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){w(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e{const i=t.gc,n=i.length/2;let a;if(n>e){for(a=0;a({width:a[t]||0,height:s[t]||0});return{first:M(0),last:M(e-1),widest:M(_),highest:M(w),widths:a,heights:s}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return st(this._alignToPixels?Qt(this.chart,e,0):e,-32768,32767)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&tr*n?r/i:o/n:o*n0}_computeGridLineItems(t){const e=this.axis,i=this.chart,n=this.options,{grid:a,position:s}=n,r=a.offset,o=this.isHorizontal(),l=this.ticks.length+(r?1:0),c=Fn(a),h=[],d=a.setContext(this.getContext()),u=d.drawBorder?d.borderWidth:0,f=u/2,p=function(t){return Qt(i,t,u)};let g,m,y,x,_,w,O,M,k,j,S,D;if("top"===s)g=p(this.bottom),w=this.bottom-c,M=g-f,j=p(t.top)+f,D=t.bottom;else if("bottom"===s)g=p(this.top),j=t.top,D=p(t.bottom)-f,w=g+f,M=this.top+c;else if("left"===s)g=p(this.right),_=this.right-c,O=g-f,k=p(t.left)+f,S=t.right;else if("right"===s)g=p(this.left),k=t.left,S=p(t.right)-f,_=g+f,O=this.left+c;else if("x"===e){if("center"===s)g=p((t.top+t.bottom)/2+.5);else if(b(s)){const t=Object.keys(s)[0],e=s[t];g=p(this.chart.scales[t].getPixelForValue(e))}j=t.top,D=t.bottom,w=g+f,M=w+c}else if("y"===e){if("center"===s)g=p((t.left+t.right)/2);else if(b(s)){const t=Object.keys(s)[0],e=s[t];g=p(this.chart.scales[t].getPixelForValue(e))}_=g-f,O=_-c,k=t.left,S=t.right}const P=v(n.ticks.maxTicksLimit,l),E=Math.max(1,Math.ceil(l/P));for(m=0;me.value===t);return i>=0?e.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let a,s;const r=(t,e,n)=>{n.width&&n.color&&(i.save(),i.lineWidth=n.width,i.strokeStyle=n.color,i.setLineDash(n.borderDash||[]),i.lineDashOffset=n.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(a=0,s=n.length;a{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:i+1,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",n=[];let a,s;for(a=0,s=e.length;a{const n=i.split("."),a=n.pop(),s=[t].concat(n).join("."),r=e[i].split("."),o=r.pop(),l=r.join(".");Xt.route(s,a,l,o)})}(e,t.defaultRoutes),t.descriptors&&Xt.describe(e,t.descriptors)}(t,s,i),this.override&&Xt.override(t.id,t.overrides)),s}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,n=this.scope;i in e&&delete e[i],n&&i in Xt[n]&&(delete Xt[n][i],this.override&&delete Ht[i])}}var Wn=new class{constructor(){this.controllers=new Bn(Si,"datasets",!0),this.elements=new Bn(En,"elements"),this.plugins=new Bn(Object,"plugins"),this.scales=new Bn(Vn,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(e=>{const n=i||this._getRegistryForType(e);i||n.isForType(e)||n===this.plugins&&e.id?this._exec(t,n,e):O(e,e=>{const n=i||this._getRegistryForType(e);this._exec(t,n,e)})})}_exec(t,e,i){const n=A(t);w(i["before"+n],[],i),e[t](i),w(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;et.filter(t=>!e.some(e=>t.plugin.id===e.plugin.id));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}}function Un(t,e){return e||!1!==t?!0===t?{}:t:null}function Yn(t,e,i,n){const a=t.pluginScopeKeys(e),s=t.getOptionScopes(i,a);return t.createResolver(s,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function $n(t,e){const i=Xt.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function Xn(t,e){return"x"===t||"y"===t?t:e.axis||("top"===(i=e.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0)||t.charAt(0).toLowerCase();var i}function qn(t){const e=t.options||(t.options={});e.plugins=v(e.plugins,{}),e.scales=function(t,e){const i=Ht[t.type]||{scales:{}},n=e.scales||{},a=$n(t.type,e),s=Object.create(null),r=Object.create(null);return Object.keys(n).forEach(t=>{const e=n[t];if(!b(e))return console.error("Invalid scale configuration for scale: "+t);if(e._proxy)return console.warn("Ignoring resolver passed as options for scale: "+t);const o=Xn(t,e),l=function(t,e){return t===e?"_index_":"_value_"}(o,a),c=i.scales||{};s[o]=s[o]||t,r[t]=P(Object.create(null),[{axis:o},e,c[o],c[l]])}),t.data.datasets.forEach(i=>{const a=i.type||t.type,o=i.indexAxis||$n(a,e),l=(Ht[a]||{}).scales||{};Object.keys(l).forEach(t=>{const e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,o),a=i[e+"AxisID"]||s[e]||e;r[a]=r[a]||Object.create(null),P(r[a],[{axis:e},n[a],l[t]])})}),Object.keys(r).forEach(t=>{const e=r[t];P(e,[Xt.scales[e.type],Xt.scale])}),r}(t,e)}function Gn(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const Qn=new Map,Zn=new Set;function Kn(t,e){let i=Qn.get(t);return i||(i=e(),Qn.set(t,i),Zn.add(i)),i}const Jn=(t,e,i)=>{const n=T(e,i);void 0!==n&&t.add(n)};class ta{constructor(t){this._config=function(t){return(t=t||{}).data=Gn(t.data),qn(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Gn(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),qn(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Kn(t,()=>[["datasets."+t,""]])}datasetAnimationScopeKeys(t,e){return Kn(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,"transitions."+e],["datasets."+t,""]])}datasetElementScopeKeys(t,e){return Kn(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,"datasets."+t,"elements."+e,""]])}pluginScopeKeys(t){const e=t.id;return Kn(`${this.type}-plugin-${e}`,()=>[["plugins."+e,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let n=i.get(t);return n&&!e||(n=new Map,i.set(t,n)),n}getOptionScopes(t,e,i){const{options:n,type:a}=this,s=this._cachedScopes(t,i),r=s.get(e);if(r)return r;const o=new Set;e.forEach(e=>{t&&(o.add(t),e.forEach(e=>Jn(o,t,e))),e.forEach(t=>Jn(o,n,t)),e.forEach(t=>Jn(o,Ht[a]||{},t)),e.forEach(t=>Jn(o,Xt,t)),e.forEach(t=>Jn(o,Ut,t))});const l=Array.from(o);return 0===l.length&&l.push(Object.create(null)),Zn.has(e)&&s.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,Ht[e]||{},Xt.datasets[e]||{},{type:e},Xt,Ut]}resolveNamedOptions(t,e,i,n=[""]){const a={$shared:!0},{resolver:s,subPrefixes:r}=ea(this._resolverCache,t,n);let o=s;(function(t,e){const{isScriptable:i,isIndexable:n}=ke(t);for(const a of e){const e=i(a),s=n(a),r=(s||e)&&t[a];if(e&&(R(r)||ia(r))||s&&m(r))return!0}return!1})(s,e)&&(a.$shared=!1,o=Me(s,i=R(i)?i():i,this.createResolver(t,i,r)));for(const t of e)a[t]=o[t];return a}createResolver(t,e,i=[""],n){const{resolver:a}=ea(this._resolverCache,t,i);return b(e)?Me(a,e,void 0,n):a}}function ea(t,e,i){let n=t.get(e);n||(n=new Map,t.set(e,n));const a=i.join();let s=n.get(a);return s||(s={resolver:Oe(e,i),subPrefixes:i.filter(t=>!t.toLowerCase().includes("hover"))},n.set(a,s)),s}const ia=t=>b(t)&&Object.getOwnPropertyNames(t).reduce((e,i)=>e||R(t[i]),!1),na=["top","bottom","left","right","chartArea"];function aa(t,e){return"top"===t||"bottom"===t||-1===na.indexOf(t)&&"x"===e}function sa(t,e){return function(i,n){return i[t]===n[t]?i[e]-n[e]:i[t]-n[t]}}function ra(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),w(i&&i.onComplete,[t],e)}function oa(t){const e=t.chart,i=e.options.animation;w(i&&i.onProgress,[t],e)}function la(t){return We()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const ca={},ha=t=>{const e=la(t);return Object.values(ca).filter(t=>t.canvas===e).pop()};function da(t,e,i){const n=Object.keys(t);for(const a of n){const n=+a;if(n>=e){const s=t[a];delete t[a],(i>0||n>e)&&(t[n+i]=s)}}}class ua{constructor(t,e){const i=this.config=new ta(e),n=la(t),a=ha(n);if(a)throw new Error("Canvas is already in use. Chart with ID '"+a.id+"' must be destroyed before the canvas can be reused.");const s=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||function(t){return!We()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?pn:Pn}(n)),this.platform.updateConfig(i);const r=this.platform.acquireContext(n,s.aspectRatio),o=r&&r.canvas,l=o&&o.height,c=o&&o.width;this.id=p(),this.ctx=r,this.canvas=o,this.width=c,this.height=l,this._options=s,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Hn,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let i;return function(...n){return e?(clearTimeout(i),i=setTimeout(t,e,n)):t.apply(this,n),e}}(t=>this.update(t),s.resizeDelay||0),this._dataChanges=[],ca[this.id]=this,r&&o?(di.listen(this,"complete",ra),di.listen(this,"progress",oa),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:a}=this;return g(t)?e&&a?a:n?i/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Qe(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Zt(this.canvas,this.ctx),this}stop(){return di.stop(this),this}resize(t,e){di.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,n=this.canvas,a=i.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(n,t,e,a),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),o=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,Qe(this,r,!0)&&(this.notifyPlugins("resize",{size:s}),w(i.onResize,[this,s],this),this.attached&&this._doResize(o)&&this.render())}ensureScalesHaveIDs(){O(this.options.scales||{},(t,e)=>{t.id=e})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,n=Object.keys(i).reduce((t,e)=>(t[e]=!1,t),{});let a=[];e&&(a=a.concat(Object.keys(e).map(t=>{const i=e[t],n=Xn(t,i),a="r"===n,s="x"===n;return{options:i,dposition:a?"chartArea":s?"bottom":"left",dtype:a?"radialLinear":s?"category":"linear"}}))),O(a,e=>{const a=e.options,s=a.id,r=Xn(s,a),o=v(a.type,e.dtype);void 0!==a.position&&aa(a.position,r)===aa(e.dposition)||(a.position=e.dposition),n[s]=!0;let l=null;s in i&&i[s].type===o?l=i[s]:(l=new(Wn.getScale(o))({id:s,type:o,ctx:this.ctx,chart:this}),i[l.id]=l),l.init(a,t)}),O(n,(t,e)=>{t||delete i[e]}),O(i,t=>{un.configure(this,t,t.options),un.addBox(this,t)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((t,e)=>t.index-e.index),i>e){for(let t=e;te.length&&delete this._stacks,t.forEach((t,i)=>{0===e.filter(e=>e===t._dataset).length&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,n;for(this._removeUnreferencedMetasets(),i=0,n=e.length;i{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const a=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let t=0,e=this.data.datasets.length;t{t.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(sa("z","_idx"));const{_active:r,_lastEvent:o}=this;o?this._eventHandler(o,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){O(this.scales,t=>{un.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);N(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:n,count:a}of e)da(t,n,"_removeElements"===i?-a:a)}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter(t=>t[0]===e).map((t,e)=>e+","+t.splice(1).join(","))),n=i(0);for(let t=1;tt.split(",")).map(t=>({method:t[1],start:+t[2],count:+t[3]}))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;un.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],O(this.boxes,t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))},this),this._layers.forEach((t,e)=>{t._idx=e}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,n=!i.disabled,a=this.chartArea,s={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",s)&&(n&&te(e,{left:!1===i.left?0:a.left-i.left,right:!1===i.right?this.width:a.right+i.right,top:!1===i.top?0:a.top-i.top,bottom:!1===i.bottom?this.height:a.bottom+i.bottom}),t.controller.draw(),n&&ee(e),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}getElementsAtEventForMode(t,e,i,n){const a=Ji.modes[e];return"function"==typeof a?a(this,t,i,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let n=i.filter(t=>t&&t._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(n)),n}getContext(){return this.$context||(this.$context=me(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const n=i?"show":"hide",a=this.getDatasetMeta(t),s=a.controller._resolveAnimations(void 0,n);L(e)?(a.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),s.update(a,{visible:i}),this.update(e=>e.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),di.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,i,n),t[i]=n},n=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};O(this.options.events,t=>i(t,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,n)=>{e.addEventListener(this,i,n),t[i]=n},n=(i,n)=>{t[i]&&(e.removeEventListener(this,i,n),delete t[i])},a=(t,e)=>{this.canvas&&this.resize(t,e)};let s;const r=()=>{n("attach",r),this.attached=!0,this.resize(),i("resize",a),i("detach",s)};s=()=>{this.attached=!1,n("resize",a),this._stop(),this._resize(0,0),i("attach",r)},e.isAttached(this.canvas)?r():s()}unbindEvents(){O(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},O(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const n=i?"set":"remove";let a,s,r,o;for("dataset"===e&&(a=this.getDatasetMeta(t[0].datasetIndex),a.controller["_"+n+"DatasetHoverStyle"]()),r=0,o=t.length;r{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}});!M(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}_updateHoverStyles(t,e,i){const n=this.options.hover,a=(t,e)=>t.filter(t=>!e.some(e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)),s=a(e,t),r=i?t:a(t,e);s.length&&this.updateHoverStyle(s,n.mode,!1),r.length&&n.mode&&this.updateHoverStyle(r,n.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:Jt(t,this.chartArea,this._minPadding)},n=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,n))return;const a=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(a||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:n=[],options:a}=this,s=e,r=this._getActiveElements(t,n,i,s),o=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}(t),l=function(t,e,i,n){return i&&"mouseout"!==t.type?n?e:t:null}(t,this._lastEvent,i,o);i&&(this._lastEvent=null,w(a.onHover,[t,r,this],this),o&&w(a.onClick,[t,r,this],this));const c=!M(r,n);return(c||e)&&(this._active=r,this._updateHoverStyles(r,n,e)),this._lastEvent=l,c}_getActiveElements(t,e,i,n){if("mouseout"===t.type)return[];if(!i)return e;const a=this.options.hover;return this.getElementsAtEventForMode(t,a.mode,a,n)}}const fa=()=>O(ua.instances,t=>t._plugins.invalidate());function pa(t,e,i){const{startAngle:n,pixelMargin:a,x:s,y:r,outerRadius:o,innerRadius:l}=e;let c=a/o;t.beginPath(),t.arc(s,r,o,n-c,i+c),l>a?(c=a/l,t.arc(s,r,l,i+c,n-c,!0)):t.arc(s,r,a,i+W,n-W),t.closePath(),t.clip()}function ga(t,e,i,n){return{x:i+t*Math.cos(e),y:n+t*Math.sin(e)}}function ma(t,e,i,n,a){const{x:s,y:r,startAngle:o,pixelMargin:l,innerRadius:c}=e,h=Math.max(e.outerRadius+n+i-l,0),d=c>0?c+n+i+l:0;let u=0;const f=a-o;if(n){const t=((c>0?c-n:0)+(h>0?h-n:0))/2;u=(f-(0!==t?f*t/(t+n):f))/2}const p=(f-Math.max(.001,f*h-i/F)/h)/2,g=o+p+u,m=a-p-u,{outerStart:b,outerEnd:y,innerStart:x,innerEnd:v}=function(t,e,i,n){const a=he(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]),s=(i-e)/2,r=Math.min(s,n*e/2),o=t=>{const e=(i-Math.min(s,t))*n/2;return st(t,0,Math.min(s,e))};return{outerStart:o(a.outerStart),outerEnd:o(a.outerEnd),innerStart:st(a.innerStart,0,r),innerEnd:st(a.innerEnd,0,r)}}(e,d,h,m-g),_=h-b,w=h-y,O=g+b/_,M=m-y/w,k=d+x,j=d+v,S=g+x/k,D=m-v/j;if(t.beginPath(),t.arc(s,r,h,O,M),y>0){const e=ga(w,M,s,r);t.arc(e.x,e.y,y,M,m+W)}const P=ga(j,m,s,r);if(t.lineTo(P.x,P.y),v>0){const e=ga(j,D,s,r);t.arc(e.x,e.y,v,m+W,D+Math.PI)}if(t.arc(s,r,d,m-v/d,g+x/d,!0),x>0){const e=ga(k,S,s,r);t.arc(e.x,e.y,x,S+Math.PI,g-W)}const E=ga(_,g,s,r);if(t.lineTo(E.x,E.y),b>0){const e=ga(_,O,s,r);t.arc(e.x,e.y,b,g-W,O)}t.closePath()}Object.defineProperties(ua,{defaults:{enumerable:!0,value:Xt},instances:{enumerable:!0,value:ca},overrides:{enumerable:!0,value:Ht},registry:{enumerable:!0,value:Wn},version:{enumerable:!0,value:"3.7.1"},getChart:{enumerable:!0,value:ha},register:{enumerable:!0,value:(...t)=>{Wn.add(...t),fa()}},unregister:{enumerable:!0,value:(...t)=>{Wn.remove(...t),fa()}}});class ba extends En{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.getProps(["x","y"],i),{angle:a,distance:s}=tt(n,{x:t,y:e}),{startAngle:r,endAngle:o,innerRadius:l,outerRadius:c,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),d=this.options.spacing/2,u=v(h,o-r)>=I||at(a,r,o),f=rt(s,l+d,c+d);return u&&f}getCenterPoint(t){const{x:e,y:i,startAngle:n,endAngle:a,innerRadius:s,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:o,spacing:l}=this.options,c=(n+a)/2,h=(s+r+l+o)/2;return{x:e+Math.cos(c)*h,y:i+Math.sin(c)*h}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,n=(e.offset||0)/2,a=(e.spacing||0)/2;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>I?Math.floor(i/I):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();let s=0;if(n){s=n/2;const e=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(e)*s,Math.sin(e)*s),this.circumference>=F&&(s=n)}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;const r=function(t,e,i,n){const{fullCircles:a,startAngle:s,circumference:r}=e;let o=e.endAngle;if(a){ma(t,e,i,n,s+I);for(let e=0;eo&&s>o;return{count:n,start:l,loop:e.loop,ilen:c(r+(c?o-t:t))%s,x=()=>{f!==p&&(t.lineTo(m,p),t.lineTo(m,f),t.lineTo(m,g))};for(l&&(d=a[y(0)],t.moveTo(d.x,d.y)),h=0;h<=o;++h){if(d=a[y(h)],d.skip)continue;const e=d.x,i=d.y,n=0|e;n===u?(ip&&(p=i),m=(b*m+e)/++b):(x(),t.lineTo(e,i),u=n,b=0,f=p=i),g=i}x()}function Oa(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i?_a:wa}ba.id="arc",ba.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0},ba.defaultRoutes={backgroundColor:"backgroundColor"};const Ma="function"==typeof Path2D;class ka extends En{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const n=i.spanGaps?this._loop:this._fullLoop;Be(this._points,i,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(t,e){const i=t.points,n=t.options.spanGaps,a=i.length;if(!a)return[];const s=!!t._loop,{start:r,end:o}=function(t,e,i,n){let a=0,s=e-1;if(i&&!n)for(;aa&&t[s%e].skip;)s--;return s%=e,{start:a,end:s}}(i,a,s,n);return function(t,e,i,n){return n&&n.setContext&&i?function(t,e,i,n){const a=t._chart.getContext(),s=ci(t.options),{_datasetIndex:r,options:{spanGaps:o}}=t,l=i.length,c=[];let h=s,d=e[0].start,u=d;function f(t,e,n,a){const s=o?-1:1;if(t!==e){for(t+=l;i[t%l].skip;)t-=s;for(;i[e%l].skip;)e+=s;t%l!=e%l&&(c.push({start:t%l,end:e%l,loop:n,style:a}),h=a,d=e%l)}}for(const t of e){d=o?d:t.start;let e,s=i[d%l];for(u=d+1;u<=t.end;u++){const o=i[u%l];e=ci(n.setContext(me(a,{type:"segment",p0:s,p1:o,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:r}))),hi(e,h)&&f(d,u-1,t.loop,h),s=o,h=e}d"borderDash"!==t&&"fill"!==t};class Sa extends En{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const n=this.options,{x:a,y:s}=this.getProps(["x","y"],i);return Math.pow(t-a,2)+Math.pow(e-s,2)=i)&&a):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}Aa.id="bar",Aa.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0},Aa.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};class Ra{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:n,y:a,radius:s}=this;return e=e||{start:0,end:I},t.arc(n,a,s,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:n}=this,a=t.angle;return{x:e+Math.cos(a)*n,y:i+Math.sin(a)*n,angle:a}}}function Na(t,e,i){for(;e>t;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function Fa(t,e,i){const n=[];for(let a=0;a{e=Na(t,e,a);const r=a[t],o=a[e];null!==n?(s.push({x:r.x,y:n}),s.push({x:o.x,y:n})):null!==i&&(s.push({x:i,y:r.y}),s.push({x:i,y:o.y}))}),s}(t,e),i.length?new ka({points:i,options:{tension:0},_loop:n,_fullLoop:n}):null}function Ba(t,e,i){let n=t[e].fill;const a=[e];let s;if(!i)return n;for(;!1!==n&&-1===a.indexOf(n);){if(!y(n))return n;if(s=t[n],!s)return!1;if(s.visible)return n;a.push(n),n=s.fill}return!1}function Wa(t,e,i){const{segments:n,points:a}=e;let s=!0,r=!1;t.beginPath();for(const o of n){const{start:n,end:l}=o,c=a[n],h=a[Na(n,l,a)];s?(t.moveTo(c.x,c.y),s=!1):(t.lineTo(c.x,i),t.lineTo(c.x,c.y)),r=!!e.pathSegment(t,o,{move:r}),r?t.closePath():t.lineTo(h.x,i)}t.lineTo(e.first().x,i),t.closePath(),t.clip()}function Ha(t,e,i,n){if(n)return;let a=e[t],s=i[t];return"angle"===t&&(a=nt(a),s=nt(s)),{property:t,start:a,end:s}}function Ua(t,e,i,n){return t&&e?n(t[i],e[i]):t?t[i]:e?e[i]:0}function Ya(t,e,i){const{top:n,bottom:a}=e.chart.chartArea,{property:s,start:r,end:o}=i||{};"x"===s&&(t.beginPath(),t.rect(r,n,o-r,a-n),t.clip())}function $a(t,e,i,n){const a=e.interpolate(i,n);a&&t.lineTo(a.x,a.y)}function Xa(t,e){const{line:i,target:n,property:a,color:s,scale:r}=e,o=function(t,e,i){const n=t.segments,a=t.points,s=e.points,r=[];for(const t of n){let{start:n,end:o}=t;o=Na(n,o,a);const l=Ha(i,a[n],a[o],t.loop);if(!e.segments){r.push({source:t,target:l,start:a[n],end:a[o]});continue}const c=li(e,l);for(const e of c){const n=Ha(i,s[e.start],s[e.end],e.loop),o=oi(t,a,n);for(const t of o)r.push({source:t,target:e,start:{[i]:Ua(l,n,"start",Math.max)},end:{[i]:Ua(l,n,"end",Math.min)}})}}return r}(i,n,a);for(const{source:e,target:l,start:c,end:h}of o){const{style:{backgroundColor:o=s}={}}=e,d=!0!==n;t.save(),t.fillStyle=o,Ya(t,r,d&&Ha(a,c,h)),t.beginPath();const u=!!i.pathSegment(t,e);let f;if(d){u?t.closePath():$a(t,n,h,a);const e=!!n.pathSegment(t,l,{move:u,reverse:!0});f=u&&e,f||$a(t,n,c,a)}t.closePath(),t.fill(f?"evenodd":"nonzero"),t.restore()}}function qa(t,e,i){const n=za(e),{line:a,scale:s,axis:r}=e,o=a.options,l=o.fill,c=o.backgroundColor,{above:h=c,below:d=c}=l||{};n&&a.points.length&&(te(t,i),function(t,e){const{line:i,target:n,above:a,below:s,area:r,scale:o}=e,l=i._loop?"angle":e.axis;t.save(),"x"===l&&s!==a&&(Wa(t,n,r.top),Xa(t,{line:i,target:n,color:a,scale:o,property:l}),t.restore(),t.save(),Wa(t,n,r.bottom)),Xa(t,{line:i,target:n,color:s,scale:o,property:l}),t.restore()}(t,{line:a,target:n,above:h,below:d,area:i,scale:s,axis:r}),ee(t))}var Ga={id:"filler",afterDatasetsUpdate(t,e,i){const n=(t.data.datasets||[]).length,a=[];let s,r,o,l;for(r=0;r=0;--e){const i=a[e].$filler;i&&(i.line.updateControlPoints(s,i.axis),n&&qa(t.ctx,i,s))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const n=t.getSortedVisibleDatasetMetas();for(let e=n.length-1;e>=0;--e){const i=n[e].$filler;i&&qa(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){const n=e.meta.$filler;n&&!1!==n.fill&&"beforeDatasetDraw"===i.drawTime&&qa(t.ctx,n,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};new WeakMap;const Qa={average(t){if(!t.length)return!1;let e,i,n=0,a=0,s=0;for(e=0,i=t.length;e-1?t.split("\n"):t}function Ja(t,e){const{element:i,datasetIndex:n,index:a}=e,s=t.getDatasetMeta(n).controller,{label:r,value:o}=s.getLabelAndValue(a);return{chart:t,label:r,parsed:s.getParsed(a),raw:t.data.datasets[n].data[a],formattedValue:o,dataset:s.getDataset(),dataIndex:a,datasetIndex:n,element:i}}function ts(t,e){const i=t.chart.ctx,{body:n,footer:a,title:s}=t,{boxWidth:r,boxHeight:o}=e,l=pe(e.bodyFont),c=pe(e.titleFont),h=pe(e.footerFont),d=s.length,u=a.length,f=n.length,p=fe(e.padding);let g=p.height,m=0,b=n.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);b+=t.beforeBody.length+t.afterBody.length,d&&(g+=d*c.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),b&&(g+=f*(e.displayColors?Math.max(o,l.lineHeight):l.lineHeight)+(b-f)*l.lineHeight+(b-1)*e.bodySpacing),u&&(g+=e.footerMarginTop+u*h.lineHeight+(u-1)*e.footerSpacing);let y=0;const x=function(t){m=Math.max(m,i.measureText(t).width+y)};return i.save(),i.font=c.string,O(t.title,x),i.font=l.string,O(t.beforeBody.concat(t.afterBody),x),y=e.displayColors?r+2+e.boxPadding:0,O(n,t=>{O(t.before,x),O(t.lines,x),O(t.after,x)}),y=0,i.font=h.string,O(t.footer,x),i.restore(),m+=p.width,{width:m,height:g}}function es(t,e,i,n){const{x:a,width:s}=i,{width:r,chartArea:{left:o,right:l}}=t;let c="center";return"center"===n?c=a<=(o+l)/2?"left":"right":a<=s/2?c="left":a>=r-s/2&&(c="right"),function(t,e,i,n){const{x:a,width:s}=n,r=i.caretSize+i.caretPadding;return"left"===t&&a+s+r>e.width||"right"===t&&a-s-r<0||void 0}(c,t,e,i)&&(c="center"),c}function is(t,e,i){const n=i.yAlign||e.yAlign||function(t,e){const{y:i,height:n}=e;return it.height-n/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||es(t,e,i,n),yAlign:n}}function ns(t,e,i,n){const{caretSize:a,caretPadding:s,cornerRadius:r}=t,{xAlign:o,yAlign:l}=i,c=a+s,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=ue(r);let p=function(t,e){let{x:i,width:n}=t;return"right"===e?i-=n:"center"===e&&(i-=n/2),i}(e,o);const g=function(t,e,i){let{y:n,height:a}=t;return"top"===e?n+=i:n-="bottom"===e?a+i:a/2,n}(e,l,c);return"center"===l?"left"===o?p+=c:"right"===o&&(p-=c):"left"===o?p-=Math.max(h,u)+a:"right"===o&&(p+=Math.max(d,f)+a),{x:st(p,0,n.width-e.width),y:st(g,0,n.height-e.height)}}function as(t,e,i){const n=fe(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-n.right:t.x+n.left}function ss(t){return Za([],Ka(t))}function rs(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}class os extends En{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart||t._chart,this._chart=this.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),n=i.enabled&&e.options.animation&&i.animations,a=new gi(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(a)),a}getContext(){return this.$context||(this.$context=(this,me(this.chart.getContext(),{tooltip:this,tooltipItems:this._tooltipItems,type:"tooltip"})))}getTitle(t,e){const{callbacks:i}=e,n=i.beforeTitle.apply(this,[t]),a=i.title.apply(this,[t]),s=i.afterTitle.apply(this,[t]);let r=[];return r=Za(r,Ka(n)),r=Za(r,Ka(a)),r=Za(r,Ka(s)),r}getBeforeBody(t,e){return ss(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){const{callbacks:i}=e,n=[];return O(t,t=>{const e={before:[],lines:[],after:[]},a=rs(i,t);Za(e.before,Ka(a.beforeLabel.call(this,t))),Za(e.lines,a.label.call(this,t)),Za(e.after,Ka(a.afterLabel.call(this,t))),n.push(e)}),n}getAfterBody(t,e){return ss(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){const{callbacks:i}=e,n=i.beforeFooter.apply(this,[t]),a=i.footer.apply(this,[t]),s=i.afterFooter.apply(this,[t]);let r=[];return r=Za(r,Ka(n)),r=Za(r,Ka(a)),r=Za(r,Ka(s)),r}_createItems(t){const e=this._active,i=this.chart.data,n=[],a=[],s=[];let r,o,l=[];for(r=0,o=e.length;rt.filter(e,n,a,i))),t.itemSort&&(l=l.sort((e,n)=>t.itemSort(e,n,i))),O(l,e=>{const i=rs(t.callbacks,e);n.push(i.labelColor.call(this,e)),a.push(i.labelPointStyle.call(this,e)),s.push(i.labelTextColor.call(this,e))}),this.labelColors=n,this.labelPointStyles=a,this.labelTextColors=s,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),n=this._active;let a,s=[];if(n.length){const t=Qa[i.position].call(this,n,this._eventPosition);s=this._createItems(i),this.title=this.getTitle(s,i),this.beforeBody=this.getBeforeBody(s,i),this.body=this.getBody(s,i),this.afterBody=this.getAfterBody(s,i),this.footer=this.getFooter(s,i);const e=this._size=ts(this,i),r=Object.assign({},t,e),o=is(this.chart,i,r),l=ns(i,r,o,this.chart);this.xAlign=o.xAlign,this.yAlign=o.yAlign,a={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(a={opacity:0});this._tooltipItems=s,this.$context=void 0,a&&this._resolveAnimations().update(this,a),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,n){const a=this.getCaretPosition(t,i,n);e.lineTo(a.x1,a.y1),e.lineTo(a.x2,a.y2),e.lineTo(a.x3,a.y3)}getCaretPosition(t,e,i){const{xAlign:n,yAlign:a}=this,{caretSize:s,cornerRadius:r}=i,{topLeft:o,topRight:l,bottomLeft:c,bottomRight:h}=ue(r),{x:d,y:u}=t,{width:f,height:p}=e;let g,m,b,y,x,v;return"center"===a?(x=u+p/2,"left"===n?(g=d,m=g-s,y=x+s,v=x-s):(g=d+f,m=g+s,y=x-s,v=x+s),b=g):(m="left"===n?d+Math.max(o,c)+s:"right"===n?d+f-Math.max(l,h)-s:this.caretX,"top"===a?(y=u,x=y-s,g=m-s,b=m+s):(y=u+p,x=y+s,g=m+s,b=m-s),v=y),{x1:g,x2:m,x3:b,y1:y,y2:x,y3:v}}drawTitle(t,e,i){const n=this.title,a=n.length;let s,r,o;if(a){const l=ai(i.rtl,this.x,this.width);for(t.x=as(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",s=pe(i.titleFont),r=i.titleSpacing,e.fillStyle=i.titleColor,e.font=s.string,o=0;o0!==t)?(t.beginPath(),t.fillStyle=a.multiKeyBackground,re(t,{x:e,y:p,w:l,h:o,radius:r}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),re(t,{x:i,y:p+1,w:l-2,h:o-2,radius:r}),t.fill()):(t.fillStyle=a.multiKeyBackground,t.fillRect(e,p,l,o),t.strokeRect(e,p,l,o),t.fillStyle=s.backgroundColor,t.fillRect(i,p+1,l-2,o-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:n}=this,{bodySpacing:a,bodyAlign:s,displayColors:r,boxHeight:o,boxWidth:l,boxPadding:c}=i,h=pe(i.bodyFont);let d=h.lineHeight,u=0;const f=ai(i.rtl,this.x,this.width),p=function(i){e.fillText(i,f.x(t.x+u),t.y+d/2),t.y+=d+a},g=f.textAlign(s);let m,b,y,x,v,_,w;for(e.textAlign=s,e.textBaseline="middle",e.font=h.string,t.x=as(this,g,i),e.fillStyle=i.bodyColor,O(this.beforeBody,p),u=r&&"right"!==g?"center"===s?l/2+c:l+2+c:0,x=0,_=n.length;x<_;++x){for(m=n[x],b=this.labelTextColors[x],e.fillStyle=b,O(m.before,p),y=m.lines,r&&y.length&&(this._drawColorBox(e,t,x,f,i),d=Math.max(h.lineHeight,o)),v=0,w=y.length;v0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,n=i&&i.x,a=i&&i.y;if(n||a){const i=Qa[t.position].call(this,this._active,this._eventPosition);if(!i)return;const s=this._size=ts(this,t),r=Object.assign({},i,this._size),o=is(e,t,r),l=ns(t,r,o,e);n._to===l.x&&a._to===l.y||(this.xAlign=o.xAlign,this.yAlign=o.yAlign,this.width=s.width,this.height=s.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},a={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const s=fe(e.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&r&&(t.save(),t.globalAlpha=i,this.drawBackground(a,t,n,e),function(t,e){let i,n;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,n=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=n)}(t,e.textDirection),a.y+=s.top,this.drawTitle(a,t,e),this.drawBody(a,t,e),this.drawFooter(a,t,e),function(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,n=t.map(({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),a=!M(i,n),s=this._positionChanged(n,e);(a||s)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,a=this._active||[],s=this._getActiveElements(t,a,e,i),r=this._positionChanged(s,t),o=e||!M(s,a)||r;return o&&(this._active=s,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),o}_getActiveElements(t,e,i,n){const a=this.options;if("mouseout"===t.type)return[];if(!n)return e;const s=this.chart.getElementsAtEventForMode(t,a.mode,a,i);return a.reverse&&s.reverse(),s}_positionChanged(t,e){const{caretX:i,caretY:n,options:a}=this,s=Qa[a.position].call(this,t,e);return!1!==s&&(i!==s.x||n!==s.y)}}os.positioners=Qa;var ls={id:"tooltip",_element:os,positioners:Qa,afterInit(t,e,i){i&&(t.tooltip=new os({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip,i={tooltip:e};!1!==t.notifyPlugins("beforeTooltipDraw",i)&&(e&&e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i))},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:f,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,n=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(n>0&&e.dataIndex"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};class cs extends Vn{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:i,label:n}of e)t[i]===n&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(g(t))return null;const i=this.getLabels();return((t,e)=>null===t?null:st(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:function(t,e,i,n){const a=t.indexOf(e);return-1===a?((t,e,i,n)=>("string"==typeof e?(i=t.push(e)-1,n.unshift({index:i,label:e})):isNaN(e)&&(i=null),i))(t,e,i,n):a!==t.lastIndexOf(e)?i:a}(i,t,v(e,t),this._addedLabels),i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:n}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(n=this.getLabels().length-1)),this.min=i,this.max=n}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,n=[];let a=this.getLabels();a=0===t&&e===a.length-1?a:a.slice(t,e+1),this._valueRange=Math.max(a.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let i=t;i<=e;i++)n.push({value:i});return n}getLabelForValue(t){const e=this.getLabels();return t>=0&&te.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function hs(t,e,{horizontal:i,minRotation:n}){const a=Z(n),s=(i?Math.sin(a):Math.cos(a))||.001,r=.75*e*(""+t).length;return Math.min(e/s,r)}cs.id="category",cs.defaults={ticks:{callback:cs.prototype.getLabelForValue}};class ds extends Vn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return g(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:n,max:a}=this;const s=t=>n=e?n:t,r=t=>a=i?a:t;if(t){const t=$(n),e=$(a);t<0&&e<0?r(0):t>0&&e>0&&s(0)}if(n===a){let e=1;(a>=Number.MAX_SAFE_INTEGER||n<=Number.MIN_SAFE_INTEGER)&&(e=Math.abs(.05*a)),r(a+e),t||s(n-e)}this.min=n,this.max=a}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:n}=t;return n?(e=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const n=function(t,e){const i=[],{bounds:n,step:a,min:s,max:r,precision:o,count:l,maxTicks:c,maxDigits:h,includeBounds:d}=t,u=a||1,f=c-1,{min:p,max:m}=e,b=!g(s),y=!g(r),x=!g(l),v=(m-p)/(h+1);let _,w,O,M,k=X((m-p)/f/u)*u;if(k<1e-14&&!b&&!y)return[{value:p},{value:m}];M=Math.ceil(m/k)-Math.floor(p/k),M>f&&(k=X(M*k/f/u)*u),g(o)||(_=Math.pow(10,o),k=Math.ceil(k*_)/_),"ticks"===n?(w=Math.floor(p/k)*k,O=Math.ceil(m/k)*k):(w=p,O=m),b&&y&&a&&function(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}((r-s)/a,k/1e3)?(M=Math.round(Math.min((r-s)/k,c)),k=(r-s)/M,w=s,O=r):x?(w=b?s:w,O=y?r:O,M=l-1,k=(O-w)/M):(M=(O-w)/k,M=G(M,Math.round(M),k/1e3)?Math.round(M):Math.ceil(M));const j=Math.max(J(k),J(w));_=Math.pow(10,g(o)?j:o),w=Math.round(w*_)/_,O=Math.round(O*_)/_;let S=0;for(b&&(d&&w!==s?(i.push({value:s}),w0?i:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=y(t)?Math.max(0,t):null,this.max=y(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,n=this.max;const a=e=>i=t?i:e,s=t=>n=e?n:t,r=(t,e)=>Math.pow(10,Math.floor(Y(t))+e);i===n&&(i<=0?(a(1),s(10)):(a(r(i,-1)),s(r(n,1)))),i<=0&&a(r(n,-1)),n<=0&&s(r(i,1)),this._zero&&this.min!==this._suggestedMin&&i===r(this.min,0)&&a(r(i,-1)),this.min=i,this.max=n}buildTicks(){const t=this.options,e=function(t,e){const i=Math.floor(Y(e.max)),n=Math.ceil(e.max/Math.pow(10,i)),a=[];let s=x(t.min,Math.pow(10,Math.floor(Y(e.min)))),r=Math.floor(Y(s)),o=Math.floor(s/Math.pow(10,r)),l=r<0?Math.pow(10,Math.abs(r)):1;do{a.push({value:s,major:fs(s)}),++o,10===o&&(o=1,++r,l=r>=0?1:l),s=Math.round(o*Math.pow(10,r)*l)/l}while(ra?{start:e-i,end:e}:{start:e,end:e+i}}function bs(t,e,i,n,a){const s=Math.abs(Math.sin(i)),r=Math.abs(Math.cos(i));let o=0,l=0;n.starte.r&&(o=(n.end-e.r)/s,t.r=Math.max(t.r,e.r+o)),a.starte.b&&(l=(a.end-e.b)/r,t.b=Math.max(t.b,e.b+l))}function ys(t){return 0===t||180===t?"center":t<180?"left":"right"}function xs(t,e,i){return 90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e),t}function vs(t,e,i,n){const{ctx:a}=t;if(i)a.arc(t.xCenter,t.yCenter,e,0,I);else{let i=t.getPointPosition(0,e);a.moveTo(i.x,i.y);for(let s=1;s{const i=w(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""}).filter((t,e)=>this.chart.getDataVisibility(e))}fit(){const t=this.options;t.display&&t.pointLabels.display?function(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),n=[],a=[],s=t._pointLabels.length,r=t.options.pointLabels,o=r.centerPointLabels?F/s:0;for(let d=0;d=0&&t=0;a--){const e=n.setContext(t.getPointLabelContext(a)),s=pe(e.font),{x:r,y:o,textAlign:l,left:c,top:h,right:d,bottom:u}=t._pointLabelItems[a],{backdropColor:f}=e;if(!g(f)){const t=fe(e.backdropPadding);i.fillStyle=f,i.fillRect(c-t.left,h-t.top,d-c+t.width,u-h+t.height)}ae(i,t._pointLabels[a],r,o+s.lineHeight/2,s,{color:e.color,textAlign:l,textBaseline:"middle"})}}(this,a),n.display&&this.ticks.forEach((t,e)=>{0!==e&&(r=this.getDistanceFromCenterForValue(t.value),function(t,e,i,n){const a=t.ctx,s=e.circular,{color:r,lineWidth:o}=e;!s&&!n||!r||!o||i<0||(a.save(),a.strokeStyle=r,a.lineWidth=o,a.setLineDash(e.borderDash),a.lineDashOffset=e.borderDashOffset,a.beginPath(),vs(t,i,s,n),a.closePath(),a.stroke(),a.restore())}(this,n.setContext(this.getContext(e-1)),r,a))}),i.display){for(t.save(),s=a-1;s>=0;s--){const n=i.setContext(this.getPointLabelContext(s)),{color:a,lineWidth:l}=n;l&&a&&(t.lineWidth=l,t.strokeStyle=a,t.setLineDash(n.borderDash),t.lineDashOffset=n.borderDashOffset,r=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),o=this.getPointPosition(s,r),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(o.x,o.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const n=this.getIndexAngle(0);let a,s;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(n),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((n,r)=>{if(0===r&&!e.reverse)return;const o=i.setContext(this.getContext(r)),l=pe(o.font);if(a=this.getDistanceFromCenterForValue(this.ticks[r].value),o.showLabelBackdrop){t.font=l.string,s=t.measureText(n.label).width,t.fillStyle=o.backdropColor;const e=fe(o.backdropPadding);t.fillRect(-s/2-e.left,-a-l.size/2-e.top,s+e.width,l.size+e.height)}ae(t,n.label,0,-a,l,{color:o.color})}),t.restore()}drawTitle(){}}_s.id="radialLinear",_s.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Tn.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}},_s.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},_s.descriptors={angleLines:{_fallback:"grid"}};const ws={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Os=Object.keys(ws);function Ms(t,e){return t-e}function ks(t,e){if(g(e))return null;const i=t._adapter,{parser:n,round:a,isoWeekday:s}=t._parseOpts;let r=e;return"function"==typeof n&&(r=n(r)),y(r)||(r="string"==typeof n?i.parse(r,n):i.parse(r)),null===r?null:(a&&(r="week"!==a||!q(s)&&!0!==s?i.startOf(r,a):i.startOf(r,"isoWeek",s)),+r)}function js(t,e,i,n){const a=Os.length;for(let s=Os.indexOf(t);s=e?i[n]:i[a]]=!0}}else t[e]=!0}function Ds(t,e,i){const n=[],a={},s=e.length;let r,o;for(r=0;r=0&&(e[l].major=!0);return e}(t,n,a,i):n}class Ps extends Vn{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e){const i=t.time||(t.time={}),n=this._adapter=new $i._date(t.adapters.date);P(i.displayFormats,n.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:ks(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:n,max:a,minDefined:s,maxDefined:r}=this.getUserBounds();function o(t){s||isNaN(t.min)||(n=Math.min(n,t.min)),r||isNaN(t.max)||(a=Math.max(a,t.max))}s&&r||(o(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||o(this.getMinMax(!1))),n=y(n)&&!isNaN(n)?n:+e.startOf(Date.now(),i),a=y(a)&&!isNaN(a)?a:+e.endOf(Date.now(),i)+1,this.min=Math.min(n,a-1),this.max=Math.max(n+1,a)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,n="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const a=this.min,s=function(t,e,i){let n=0,a=t.length;for(;nn&&t[a-1]>i;)a--;return n>0||a=Os.indexOf(i);s--){const i=Os[s];if(ws[i].common&&t._adapter.diff(a,n,i)>=e-1)return i}return Os[i?Os.indexOf(i):0]}(this,s.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(let e=Os.indexOf(t)+1,i=Os.length;e1e5*r)throw new Error(e+" and "+i+" are too far apart with stepSize of "+r+" "+s);const f="data"===n.ticks.source&&this.getDataTimestamps();for(h=u,d=0;ht-e).map(t=>+t)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}_tickFormatFunction(t,e,i,n){const a=this.options,s=a.time.displayFormats,r=this._unit,o=this._majorUnit,l=r&&s[r],c=o&&s[o],h=i[e],d=o&&c&&h&&h.major,u=this._adapter.format(t,n||(d?c:l)),f=a.ticks.callback;return f?w(f,[u,e,i],this):u}generateTickLabels(t){let e,i,n;for(e=0,i=t.length;e0?r:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(t=0,e=n.length;t=t[o].pos&&e<=t[l].pos&&({lo:o,hi:l}=ye(t,"pos",e)),({pos:n,time:s}=t[o]),({pos:a,time:r}=t[l])):(e>=t[o].time&&e<=t[l].time&&({lo:o,hi:l}=ye(t,"time",e)),({time:n,pos:s}=t[o]),({time:a,pos:r}=t[l]));const c=a-n;return c?s+(r-s)*(e-n)/c:s}Ps.id="time",Ps.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};class Cs extends Ps{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Es(e,this.min),this._tableRange=Es(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,n=[],a=[];let s,r,o,l,c;for(s=0,r=t.length;s=e&&l<=i&&n.push(l);if(n.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(s=0,r=n.length;s2&&void 0!==arguments[2]?arguments[2]:"label";const n=[];t.datasets=e.map(e=>{const a=t.datasets.find(t=>t[i]===e[i]);return a&&e.data&&!n.includes(a)?(n.push(a),Object.assign(a,e),a):{...e}})}function Fs(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"label";const i={labels:[],datasets:[]};return Rs(i,t.labels),Ns(i,t.datasets,e),i}function Is(t,e){let{height:i=150,width:n=300,redraw:a=!1,datasetIdKey:s,type:r,data:o,options:l,plugins:c=[],fallbackContent:h,...d}=t;const u=Object(Ts.useRef)(null),f=Object(Ts.useRef)(),p=()=>{u.current&&(f.current=new ua(u.current,{type:r,data:Fs(o,s),options:l,plugins:c}),Ls(e,f.current))},g=()=>{Ls(e,null),f.current&&(f.current.destroy(),f.current=null)};return Object(Ts.useEffect)(()=>{var t,e;!a&&f.current&&l&&(t=f.current,e=l,t.options={...e})},[a,l]),Object(Ts.useEffect)(()=>{!a&&f.current&&Rs(f.current.config.data,o.labels)},[a,o.labels]),Object(Ts.useEffect)(()=>{!a&&f.current&&o.datasets&&Ns(f.current.config.data,o.datasets,s)},[a,o.datasets]),Object(Ts.useEffect)(()=>{f.current&&(a?(g(),setTimeout(p)):f.current.update())},[a,l,o.labels,o.datasets]),Object(Ts.useEffect)(()=>(p(),()=>g()),[]),As.a.createElement("canvas",Object.assign({ref:u,role:"img",height:i,width:n},d),h)}const zs=Object(Ts.forwardRef)(Is);var Vs=i(3),Bs=i(16),Ws=i(7),Hs=i(8),Us=i(4);function Ys(t,e){Object(Us.a)(2,arguments);var i=Object(Hs.a)(t),n=Object(Ws.a)(e);return isNaN(n)?new Date(NaN):n?(i.setDate(i.getDate()+n),i):i}function $s(t,e){Object(Us.a)(2,arguments);var i=Object(Ws.a)(e);return Ys(t,-i)}function Xs(t,e){Object(Us.a)(2,arguments);var i=Object(Hs.a)(t),n=Object(Ws.a)(e);if(isNaN(n))return new Date(NaN);if(!n)return i;var a=i.getDate(),s=new Date(i.getTime());s.setMonth(i.getMonth()+n+1,0);var r=s.getDate();return a>=r?s:(i.setFullYear(s.getFullYear(),s.getMonth(),a),i)}function qs(t,e){Object(Us.a)(2,arguments);var i=Object(Ws.a)(e);return Xs(t,-i)}function Gs(t){return(Gs="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 Qs(t,e){if(Object(Us.a)(2,arguments),!e||"object"!==Gs(e))return new Date(NaN);var i=e.years?Object(Ws.a)(e.years):0,n=e.months?Object(Ws.a)(e.months):0,a=e.weeks?Object(Ws.a)(e.weeks):0,s=e.days?Object(Ws.a)(e.days):0,r=e.hours?Object(Ws.a)(e.hours):0,o=e.minutes?Object(Ws.a)(e.minutes):0,l=e.seconds?Object(Ws.a)(e.seconds):0,c=qs(t,n+12*i),h=$s(c,s+7*a),d=o+60*r,u=l+60*d,f=1e3*u,p=new Date(h.getTime()-f);return p}function Zs(t){return(Zs="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 Ks(t,e){if(Object(Us.a)(2,arguments),!e||"object"!==Zs(e))return new Date(NaN);var i=e.years?Object(Ws.a)(e.years):0,n=e.months?Object(Ws.a)(e.months):0,a=e.weeks?Object(Ws.a)(e.weeks):0,s=e.days?Object(Ws.a)(e.days):0,r=e.hours?Object(Ws.a)(e.hours):0,o=e.minutes?Object(Ws.a)(e.minutes):0,l=e.seconds?Object(Ws.a)(e.seconds):0,c=Object(Hs.a)(t),h=n||i?Xs(c,n+12*i):c,d=s||a?Ys(h,s+7*a):h,u=o+60*r,f=l+60*u,p=1e3*f,g=new Date(d.getTime()+p);return g}function Js(t,e){var i;Object(Us.a)(1,arguments);var n=Object(Ws.a)(null!==(i=null==e?void 0:e.additionalDigits)&&void 0!==i?i:2);if(2!==n&&1!==n&&0!==n)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof t&&"[object String]"!==Object.prototype.toString.call(t))return new Date(NaN);var a,s=ar(t);if(s.date){var r=sr(s.date,n);a=rr(r.restDateString,r.year)}if(!a||isNaN(a.getTime()))return new Date(NaN);var o,l=a.getTime(),c=0;if(s.time&&(c=lr(s.time),isNaN(c)))return new Date(NaN);if(!s.timezone){var h=new Date(l+c),d=new Date(0);return d.setFullYear(h.getUTCFullYear(),h.getUTCMonth(),h.getUTCDate()),d.setHours(h.getUTCHours(),h.getUTCMinutes(),h.getUTCSeconds(),h.getUTCMilliseconds()),d}return o=hr(s.timezone),isNaN(o)?new Date(NaN):new Date(l+c+o)}Math.pow(10,8);var tr={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},er=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,ir=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,nr=/^([+-])(\d{2})(?::?(\d{2}))?$/;function ar(t){var e,i={},n=t.split(tr.dateTimeDelimiter);if(n.length>2)return i;if(/:/.test(n[0])?e=n[0]:(i.date=n[0],e=n[1],tr.timeZoneDelimiter.test(i.date)&&(i.date=t.split(tr.timeZoneDelimiter)[0],e=t.substr(i.date.length,t.length))),e){var a=tr.timezone.exec(e);a?(i.time=e.replace(a[1],""),i.timezone=a[1]):i.time=e}return i}function sr(t,e){var i=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),n=t.match(i);if(!n)return{year:NaN,restDateString:""};var a=n[1]?parseInt(n[1]):null,s=n[2]?parseInt(n[2]):null;return{year:null===s?a:100*s,restDateString:t.slice((n[1]||n[2]).length)}}function rr(t,e){if(null===e)return new Date(NaN);var i=t.match(er);if(!i)return new Date(NaN);var n=!!i[4],a=or(i[1]),s=or(i[2])-1,r=or(i[3]),o=or(i[4]),l=or(i[5])-1;if(n)return function(t,e,i){return e>=1&&e<=53&&i>=0&&i<=6}(0,o,l)?function(t,e,i){var n=new Date(0);n.setUTCFullYear(t,0,4);var a=7*(e-1)+i+1-(n.getUTCDay()||7);return n.setUTCDate(n.getUTCDate()+a),n}(e,o,l):new Date(NaN);var c=new Date(0);return function(t,e,i){return e>=0&&e<=11&&i>=1&&i<=(dr[e]||(ur(t)?29:28))}(e,s,r)&&function(t,e){return e>=1&&e<=(ur(t)?366:365)}(e,a)?(c.setUTCFullYear(e,s,Math.max(a,r)),c):new Date(NaN)}function or(t){return t?parseInt(t):1}function lr(t){var e=t.match(ir);if(!e)return NaN;var i=cr(e[1]),n=cr(e[2]),a=cr(e[3]);return function(t,e,i){return 24===t?0===e&&0===i:i>=0&&i<60&&e>=0&&e<60&&t>=0&&t<25}(i,n,a)?36e5*i+6e4*n+1e3*a:NaN}function cr(t){return t&&parseFloat(t.replace(",","."))||0}function hr(t){if("Z"===t)return 0;var e=t.match(nr);if(!e)return 0;var i="+"===e[1]?-1:1,n=parseInt(e[2]),a=e[3]&&parseInt(e[3])||0;return function(t,e){return e>=0&&e<=59}(0,a)?i*(36e5*n+6e4*a):NaN}var dr=[31,null,31,30,31,30,31,31,30,31,30,31];function ur(t){return t%400==0||t%4==0&&t%100!=0}var fr=i(76);function pr(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function gr(t){for(var e=1;e0,"is-negative":e<0});return Object(c.createElement)("div",{className:s},Object(c.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"simpay-admin-charts-badge__icon",width:"16",height:"16"},e>0?Object(c.createElement)("path",{d:"M16.004 9.414l-8.607 8.607-1.414-1.414L14.589 8H7.004V6h11v11h-2V9.414z"}):Object(c.createElement)("path",{d:"M14.59 16.004L5.982 7.397l1.414-1.414 8.607 8.606V7.004h2v11h-11v-2z"})),!n&&Object(c.createElement)("span",null,Math.abs(e),"%"))},Er="simpay-admin-charts-period-over-period__tooltip",Cr=function(t){var e=t.position,i=t.opacity,n=t.data,a=t.delta,s=t.deltaChangedString;if(!n.length)return null;var r=e.top,o=e.left,l=e.right,h=Dr()("simpay-admin-charts-badge",{"is-positive":a>0,"is-negative":a<0});return Object(c.createElement)("div",{className:Er,style:{top:r,left:o||"auto",right:l||"auto",opacity:i}},n.map((function(t,e){var i=t.label,n=t.value;return Object(c.createElement)("div",{className:"".concat(Er,"-data"),"data-dataset":e,key:i+Math.random()},Object(c.createElement)("strong",null,i)," ",Object(c.createElement)("em",null,Object(Bs.decodeEntities)(n)))})),0!==a&&Object(c.createElement)("div",{className:"".concat(Er,"-delta")},Object(c.createElement)("div",{className:h},Object(c.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"simpay-admin-charts-badge__icon"},a>0?Object(c.createElement)("path",{fillRule:"evenodd",d:"M5.22 14.78a.75.75 0 001.06 0l7.22-7.22v5.69a.75.75 0 001.5 0v-7.5a.75.75 0 00-.75-.75h-7.5a.75.75 0 000 1.5h5.69l-7.22 7.22a.75.75 0 000 1.06z",clipRule:"evenodd"}):Object(c.createElement)("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06l7.22 7.22H6.75a.75.75 0 000 1.5h7.5a.747.747 0 00.75-.75v-7.5a.75.75 0 00-1.5 0v5.69L6.28 5.22z"}))),Object(c.createElement)("span",null,s)))},Tr=function(t){var e=t.chart,i=function(t,e){var i=Object(c.useState)({marginTop:0,marginRight:0,marginBottom:0,marginLeft:0}),n=l()(i,2),a=n[0],s=a.marginTop,r=a.marginRight,o=a.marginBottom,h=a.marginLeft,d=n[1];return Object(c.useEffect)((function(){t.current&&d({marginTop:Math.floor(t.current.chartArea.top),marginRight:Math.floor(t.current.width-t.current.chartArea.right),marginBottom:Math.floor(t.current.chartArea.bottom),marginLeft:Math.floor(t.current.chartArea.left)})}),[t,e]),{marginTop:s,marginRight:r,marginBottom:o,marginLeft:h}}(t.chartRef,e),n=i.marginLeft,a=i.marginRight;return Object(c.createElement)("div",{style:{width:"100%",position:"relative",fontSize:"12px",display:"flex",justifyContent:"space-between",marginTop:"-2px"}},Object(c.createElement)("div",{style:{marginLeft:n,textAlign:"left"}},e.datasets[0].data[0].x),Object(c.createElement)("div",{style:{marginRight:a,textAlign:"right"}},e.datasets[0].data[e.datasets[0].data.length-1].x))};function Ar(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Lr(t){for(var e=1;e0}))}));return Object(c.createElement)("div",{className:"simpay-admin-charts-period-over-period",style:s},!M&&Object(c.createElement)("div",{className:"simpay-admin-charts-no-data",style:Lr(Lr({},s),{},{height:"calc(".concat(s.height," + 15px)")})},o),Object(c.createElement)(zs,{type:"line",ref:g,options:O,plugins:[vr,(_="rgb(".concat(f.primary_color.join(","),")"),{id:"YGridLineHover",afterDraw:function(t){var e;if(null!==(e=t.tooltip)&&void 0!==e&&null!==(e=e._active)&&void 0!==e&&e.length){var i=t.tooltip._active[0].element.x,n=t.scales.yAxis,a=t.ctx;a.save(),a.beginPath(),a.moveTo(i,n.top),a.lineTo(i,n.bottom),a.lineWidth=2,a.strokeStyle=_,a.stroke(),a.restore()}}})],data:{datasets:m}}),Object(c.createElement)(Tr,{chartRef:g,chart:f}),Object(c.createElement)(Cr,a()({},x,{deltaChangedString:h(x)})),Object(c.createElement)(Vs.Popover.Slot,null))}},function(t,e,i){var n;!function(){"use strict";var i={}.hasOwnProperty;function a(){for(var t=[],e=0;et.length)&&(e=t.length);for(var i=0,n=new Array(e);i=s.getTime()?i+1:e.getTime()>=l.getTime()?i:i-1}function f(t){Object(n.a)(1,arguments);var e=u(t),i=new Date(0);i.setUTCFullYear(e,0,4),i.setUTCHours(0,0,0,0);var a=d(i);return a}var p={};function g(){return p}function m(t,e){var i,a,s,o,c,h,d,u;Object(n.a)(1,arguments);var f=g(),p=Object(l.a)(null!==(i=null!==(a=null!==(s=null!==(o=null==e?void 0:e.weekStartsOn)&&void 0!==o?o:null==e||null===(c=e.locale)||void 0===c||null===(h=c.options)||void 0===h?void 0:h.weekStartsOn)&&void 0!==s?s:f.weekStartsOn)&&void 0!==a?a:null===(d=f.locale)||void 0===d||null===(u=d.options)||void 0===u?void 0:u.weekStartsOn)&&void 0!==i?i:0);if(!(p>=0&&p<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var m=Object(r.a)(t),b=m.getUTCDay(),y=(b=1&&y<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var x=new Date(0);x.setUTCFullYear(p+1,0,y),x.setUTCHours(0,0,0,0);var v=m(x,e),_=new Date(0);_.setUTCFullYear(p,0,y),_.setUTCHours(0,0,0,0);var w=m(_,e);return f.getTime()>=v.getTime()?p+1:f.getTime()>=w.getTime()?p:p-1}function y(t,e){var i,a,s,r,o,c,h,d;Object(n.a)(1,arguments);var u=g(),f=Object(l.a)(null!==(i=null!==(a=null!==(s=null!==(r=null==e?void 0:e.firstWeekContainsDate)&&void 0!==r?r:null==e||null===(o=e.locale)||void 0===o||null===(c=o.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==s?s:u.firstWeekContainsDate)&&void 0!==a?a:null===(h=u.locale)||void 0===h||null===(d=h.options)||void 0===d?void 0:d.firstWeekContainsDate)&&void 0!==i?i:1),p=b(t,e),y=new Date(0);y.setUTCFullYear(p,0,f),y.setUTCHours(0,0,0,0);var x=m(y,e);return x}function x(t,e){for(var i=t<0?"-":"",n=Math.abs(t).toString();n.length0?i:1-i;return x("yy"===e?n%100:n,e.length)},_=function(t,e){var i=t.getUTCMonth();return"M"===e?String(i+1):x(i+1,2)},w=function(t,e){return x(t.getUTCDate(),e.length)},O=function(t,e){return x(t.getUTCHours()%12||12,e.length)},M=function(t,e){return x(t.getUTCHours(),e.length)},k=function(t,e){return x(t.getUTCMinutes(),e.length)},j=function(t,e){return x(t.getUTCSeconds(),e.length)},S=function(t,e){var i=e.length,n=t.getUTCMilliseconds();return x(Math.floor(n*Math.pow(10,i-3)),e.length)};function D(t,e){var i=t>0?"-":"+",n=Math.abs(t),a=Math.floor(n/60),s=n%60;if(0===s)return i+String(a);var r=e||"";return i+String(a)+r+x(s,2)}function P(t,e){return t%60==0?(t>0?"-":"+")+x(Math.abs(t)/60,2):E(t,e)}function E(t,e){var i=e||"",n=t>0?"-":"+",a=Math.abs(t);return n+x(Math.floor(a/60),2)+i+x(a%60,2)}var C={G:function(t,e,i){var n=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return i.era(n,{width:"abbreviated"});case"GGGGG":return i.era(n,{width:"narrow"});case"GGGG":default:return i.era(n,{width:"wide"})}},y:function(t,e,i){if("yo"===e){var n=t.getUTCFullYear(),a=n>0?n:1-n;return i.ordinalNumber(a,{unit:"year"})}return v(t,e)},Y:function(t,e,i,n){var a=b(t,n),s=a>0?a:1-a;return"YY"===e?x(s%100,2):"Yo"===e?i.ordinalNumber(s,{unit:"year"}):x(s,e.length)},R:function(t,e){return x(u(t),e.length)},u:function(t,e){return x(t.getUTCFullYear(),e.length)},Q:function(t,e,i){var n=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return x(n,2);case"Qo":return i.ordinalNumber(n,{unit:"quarter"});case"QQQ":return i.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return i.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return i.quarter(n,{width:"wide",context:"formatting"})}},q:function(t,e,i){var n=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return x(n,2);case"qo":return i.ordinalNumber(n,{unit:"quarter"});case"qqq":return i.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return i.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return i.quarter(n,{width:"wide",context:"standalone"})}},M:function(t,e,i){var n=t.getUTCMonth();switch(e){case"M":case"MM":return _(t,e);case"Mo":return i.ordinalNumber(n+1,{unit:"month"});case"MMM":return i.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return i.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return i.month(n,{width:"wide",context:"formatting"})}},L:function(t,e,i){var n=t.getUTCMonth();switch(e){case"L":return String(n+1);case"LL":return x(n+1,2);case"Lo":return i.ordinalNumber(n+1,{unit:"month"});case"LLL":return i.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return i.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return i.month(n,{width:"wide",context:"standalone"})}},w:function(t,e,i,a){var s=function(t,e){Object(n.a)(1,arguments);var i=Object(r.a)(t),a=m(i,e).getTime()-y(i,e).getTime();return Math.round(a/6048e5)+1}(t,a);return"wo"===e?i.ordinalNumber(s,{unit:"week"}):x(s,e.length)},I:function(t,e,i){var a=function(t){Object(n.a)(1,arguments);var e=Object(r.a)(t),i=d(e).getTime()-f(e).getTime();return Math.round(i/6048e5)+1}(t);return"Io"===e?i.ordinalNumber(a,{unit:"week"}):x(a,e.length)},d:function(t,e,i){return"do"===e?i.ordinalNumber(t.getUTCDate(),{unit:"date"}):w(t,e)},D:function(t,e,i){var a=function(t){Object(n.a)(1,arguments);var e=Object(r.a)(t),i=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var a=e.getTime(),s=i-a;return Math.floor(s/864e5)+1}(t);return"Do"===e?i.ordinalNumber(a,{unit:"dayOfYear"}):x(a,e.length)},E:function(t,e,i){var n=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return i.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return i.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(n,{width:"short",context:"formatting"});case"EEEE":default:return i.day(n,{width:"wide",context:"formatting"})}},e:function(t,e,i,n){var a=t.getUTCDay(),s=(a-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return x(s,2);case"eo":return i.ordinalNumber(s,{unit:"day"});case"eee":return i.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return i.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(a,{width:"short",context:"formatting"});case"eeee":default:return i.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,i,n){var a=t.getUTCDay(),s=(a-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return x(s,e.length);case"co":return i.ordinalNumber(s,{unit:"day"});case"ccc":return i.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return i.day(a,{width:"narrow",context:"standalone"});case"cccccc":return i.day(a,{width:"short",context:"standalone"});case"cccc":default:return i.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,i){var n=t.getUTCDay(),a=0===n?7:n;switch(e){case"i":return String(a);case"ii":return x(a,e.length);case"io":return i.ordinalNumber(a,{unit:"day"});case"iii":return i.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return i.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return i.day(n,{width:"short",context:"formatting"});case"iiii":default:return i.day(n,{width:"wide",context:"formatting"})}},a:function(t,e,i){var n=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return i.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return i.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(t,e,i){var n,a=t.getUTCHours();switch(n=12===a?"noon":0===a?"midnight":a/12>=1?"pm":"am",e){case"b":case"bb":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return i.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return i.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(t,e,i){var n,a=t.getUTCHours();switch(n=a>=17?"evening":a>=12?"afternoon":a>=4?"morning":"night",e){case"B":case"BB":case"BBB":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return i.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return i.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(t,e,i){if("ho"===e){var n=t.getUTCHours()%12;return 0===n&&(n=12),i.ordinalNumber(n,{unit:"hour"})}return O(t,e)},H:function(t,e,i){return"Ho"===e?i.ordinalNumber(t.getUTCHours(),{unit:"hour"}):M(t,e)},K:function(t,e,i){var n=t.getUTCHours()%12;return"Ko"===e?i.ordinalNumber(n,{unit:"hour"}):x(n,e.length)},k:function(t,e,i){var n=t.getUTCHours();return 0===n&&(n=24),"ko"===e?i.ordinalNumber(n,{unit:"hour"}):x(n,e.length)},m:function(t,e,i){return"mo"===e?i.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):k(t,e)},s:function(t,e,i){return"so"===e?i.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):j(t,e)},S:function(t,e){return S(t,e)},X:function(t,e,i,n){var a=(n._originalDate||t).getTimezoneOffset();if(0===a)return"Z";switch(e){case"X":return P(a);case"XXXX":case"XX":return E(a);case"XXXXX":case"XXX":default:return E(a,":")}},x:function(t,e,i,n){var a=(n._originalDate||t).getTimezoneOffset();switch(e){case"x":return P(a);case"xxxx":case"xx":return E(a);case"xxxxx":case"xxx":default:return E(a,":")}},O:function(t,e,i,n){var a=(n._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+D(a,":");case"OOOO":default:return"GMT"+E(a,":")}},z:function(t,e,i,n){var a=(n._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+D(a,":");case"zzzz":default:return"GMT"+E(a,":")}},t:function(t,e,i,n){var a=n._originalDate||t;return x(Math.floor(a.getTime()/1e3),e.length)},T:function(t,e,i,n){return x((n._originalDate||t).getTime(),e.length)}},T=function(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},A=function(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},L={p:A,P:function(t,e){var i,n=t.match(/(P+)(p+)?/)||[],a=n[1],s=n[2];if(!s)return T(t,e);switch(a){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"})}return i.replace("{{date}}",T(a,e)).replace("{{time}}",A(s,e))}};function R(t){var e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}var N=["D","DD"],F=["YY","YYYY"];function I(t){return-1!==N.indexOf(t)}function z(t){return-1!==F.indexOf(t)}function V(t,e,i){if("YYYY"===t)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===t)throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===t)throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===t)throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var B={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function W(t){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.width?String(e.width):t.defaultWidth,n=t.formats[i]||t.formats[t.defaultWidth];return n}}var H={date:W({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:W({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:W({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},U={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function Y(t){return function(e,i){var n;if("formatting"===(null!=i&&i.context?String(i.context):"standalone")&&t.formattingValues){var a=t.defaultFormattingWidth||t.defaultWidth,s=null!=i&&i.width?String(i.width):a;n=t.formattingValues[s]||t.formattingValues[a]}else{var r=t.defaultWidth,o=null!=i&&i.width?String(i.width):t.defaultWidth;n=t.values[o]||t.values[r]}return n[t.argumentCallback?t.argumentCallback(e):e]}}function $(t){return function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.width,a=n&&t.matchPatterns[n]||t.matchPatterns[t.defaultMatchWidth],s=e.match(a);if(!s)return null;var r,o=s[0],l=n&&t.parsePatterns[n]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?q(l,(function(t){return t.test(o)})):X(l,(function(t){return t.test(o)}));r=t.valueCallback?t.valueCallback(c):c,r=i.valueCallback?i.valueCallback(r):r;var h=e.slice(o.length);return{value:r,rest:h}}}function X(t,e){for(var i in t)if(t.hasOwnProperty(i)&&e(t[i]))return i}function q(t,e){for(var i=0;i0?"in "+n:n+" ago":n},formatLong:H,formatRelative:function(t,e,i,n){return U[t]},localize:{ordinalNumber:function(t,e){var i=Number(t),n=i%100;if(n>20||n<10)switch(n%10){case 1:return i+"st";case 2:return i+"nd";case 3:return i+"rd"}return i+"th"},era:Y({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Y({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:Y({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:Y({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:Y({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(G={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(t){return parseInt(t,10)}},function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.match(G.matchPattern);if(!i)return null;var n=i[0],a=t.match(G.parsePattern);if(!a)return null;var s=G.valueCallback?G.valueCallback(a[0]):a[0];s=e.valueCallback?e.valueCallback(s):s;var r=t.slice(n.length);return{value:s,rest:r}}),era:$({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:$({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:$({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:$({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:$({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}},Z=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,K=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,J=/^'([^]*?)'?$/,tt=/''/g,et=/[a-zA-Z]/;function it(t,e,i){var a,s,c,d,u,f,p,m,b,y,x,v,_,w,O,M,k,j;Object(n.a)(2,arguments);var S=String(e),D=g(),P=null!==(a=null!==(s=null==i?void 0:i.locale)&&void 0!==s?s:D.locale)&&void 0!==a?a:Q,E=Object(l.a)(null!==(c=null!==(d=null!==(u=null!==(f=null==i?void 0:i.firstWeekContainsDate)&&void 0!==f?f:null==i||null===(p=i.locale)||void 0===p||null===(m=p.options)||void 0===m?void 0:m.firstWeekContainsDate)&&void 0!==u?u:D.firstWeekContainsDate)&&void 0!==d?d:null===(b=D.locale)||void 0===b||null===(y=b.options)||void 0===y?void 0:y.firstWeekContainsDate)&&void 0!==c?c:1);if(!(E>=1&&E<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var T=Object(l.a)(null!==(x=null!==(v=null!==(_=null!==(w=null==i?void 0:i.weekStartsOn)&&void 0!==w?w:null==i||null===(O=i.locale)||void 0===O||null===(M=O.options)||void 0===M?void 0:M.weekStartsOn)&&void 0!==_?_:D.weekStartsOn)&&void 0!==v?v:null===(k=D.locale)||void 0===k||null===(j=k.options)||void 0===j?void 0:j.weekStartsOn)&&void 0!==x?x:0);if(!(T>=0&&T<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!P.localize)throw new RangeError("locale must contain localize property");if(!P.formatLong)throw new RangeError("locale must contain formatLong property");var A=Object(r.a)(t);if(!o(A))throw new RangeError("Invalid time value");var N=R(A),F=h(A,N),B={firstWeekContainsDate:E,weekStartsOn:T,locale:P,_originalDate:A},W=S.match(K).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,L[e])(t,P.formatLong):t})).join("").match(Z).map((function(n){if("''"===n)return"'";var a=n[0];if("'"===a)return nt(n);var s=C[a];if(s)return null!=i&&i.useAdditionalWeekYearTokens||!z(n)||V(n,e,String(t)),null!=i&&i.useAdditionalDayOfYearTokens||!I(n)||V(n,e,String(t)),s(F,n,P.localize,B);if(a.match(et))throw new RangeError("Format string contains an unescaped latin alphabet character `"+a+"`");return n})).join("");return W}function nt(t){var e=t.match(J);return e?e[1].replace(tt,"'"):t}},function(t,e,i){"use strict";i.r(e);var n=i(0),a=(i(37),i(3)),s=i(6),r=i.n(s),o=i(2),l=i(9),c=Object(n.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(l.Path,{fillRule:"evenodd",d:"M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z",clipRule:"evenodd"})),h=i(10),d=i(13),u=simpayAdminPageActivityReports,f=u.user_id,p=u.currencies,g=u.default_currency,m=i(15),b=i.n(m),y=i(16),x=i(11),v=i.n(x),_=i(24),w=i.n(_);function O(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function M(t){for(var e=1;e0&&Object(n.createElement)(n.Fragment,null,Object(n.createElement)(a.CardDivider,null),Object(n.createElement)("h3",{className:"".concat("simpay-activity-reports-card-today","-today-misc-title")},Object(o.__)("Top Forms","stripe")),Object(n.createElement)("div",{className:"".concat("simpay-activity-reports-card-today","-forms")},s.map((function(t){return Object(n.createElement)(D,b()({key:t.id},t))})))),r&&Object(n.createElement)("div",{className:"".concat("simpay-activity-reports-card-today","-tip")},Object(n.createElement)("strong",null,Object(n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{d:"M11.7 2.805a.75.75 0 01.6 0A60.65 60.65 0 0122.83 8.72a.75.75 0 01-.231 1.337 49.949 49.949 0 00-9.902 3.912l-.003.002-.34.18a.75.75 0 01-.707 0A50.009 50.009 0 007.5 12.174v-.224c0-.131.067-.248.172-.311a54.614 54.614 0 014.653-2.52.75.75 0 00-.65-1.352 56.129 56.129 0 00-4.78 2.589 1.858 1.858 0 00-.859 1.228 49.803 49.803 0 00-4.634-1.527.75.75 0 01-.231-1.337A60.653 60.653 0 0111.7 2.805z"}),Object(n.createElement)("path",{d:"M13.06 15.473a48.45 48.45 0 017.666-3.282c.134 1.414.22 2.843.255 4.285a.75.75 0 01-.46.71 47.878 47.878 0 00-8.105 4.342.75.75 0 01-.832 0 47.877 47.877 0 00-8.104-4.342.75.75 0 01-.461-.71c.035-1.442.121-2.87.255-4.286A48.4 48.4 0 016 13.18v1.27a1.5 1.5 0 00-.14 2.508c-.09.38-.222.753-.397 1.11.452.213.901.434 1.346.661a6.729 6.729 0 00.551-1.608 1.5 1.5 0 00.14-2.67v-.645a48.549 48.549 0 013.44 1.668 2.25 2.25 0 002.12 0z"}),Object(n.createElement)("path",{d:"M4.462 19.462c.42-.419.753-.89 1-1.394.453.213.902.434 1.347.661a6.743 6.743 0 01-1.286 1.794.75.75 0 11-1.06-1.06z"})),r.title),Object(n.createElement)("p",null,r.text," ",Object(n.createElement)("a",{href:Object(y.decodeEntities)(r.href),target:"_blank",rel:"noreferrer"},Object(o.__)("Learn More →","stripe")))))))},C=function(t){var e=t.currency;return Object(n.createElement)("div",{className:"simpay-admin-charts-no-data",style:{width:"100%",height:"100%"}},Object(n.createElement)("div",null,Object(n.createElement)("strong",null,Object(o.sprintf)(/* translators: %s Currency code. */ +Object(o.__)("No %s transactions found.","stripe"),e.toUpperCase())),Object(n.createElement)("div",null,Object(o.__)("Please select a different currency or check back later.","stripe"))))},T=i(14),A=i.n(T),L=function(t){var e=t.currency,i=t.amount_total_formatted,s=t.status,r=t.status_formatted,l=t.email,c=t.payment_method_type_icon,h=t.date_created_human_time_diff,d=t.links,u=d.customer,f=d.payment,p="simpay-activity-reports-card-latest-payment",g=A()("simpay-activity-reports-badge",{"is-succeeded":"succeeded"===s,"is-failed":"failed"===s}),m=function(){return"refunded"===s&&t.amount_refunded!==t.amount_total};return Object(n.createElement)("tr",{className:p},Object(n.createElement)("td",{className:"".concat(p,"__amount")},Object(y.decodeEntities)(i)," ",Object(n.createElement)("small",{style:{fontWeight:"normal"}},e.toUpperCase())),Object(n.createElement)("td",{className:"".concat(p,"__type")},""!==c&&Object(n.createElement)("span",{dangerouslySetInnerHTML:{__html:c}})),Object(n.createElement)("td",{className:"".concat(p,"__status")},Object(n.createElement)(a.Tooltip,{text:function(){if(m()&&"refunded"===s)return Object(o.sprintf)(Object(o.__)("%s refund was initiated","stripe"),Object(y.decodeEntities)(t.amount_refunded_formatted))}()},Object(n.createElement)("div",{className:g},Object(n.createElement)("span",null,r),Object(n.createElement)("svg",{"aria-hidden":"true",className:"simpay-activity-reports-badge__icon",height:"12",width:"12",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",style:{marginLeft:"4px"}},"succeeded"===s?Object(n.createElement)("path",{d:"M5.297 13.213.293 8.255c-.39-.394-.39-1.033 0-1.426s1.024-.394 1.414 0l4.294 4.224 8.288-8.258c.39-.393 1.024-.393 1.414 0s.39 1.033 0 1.426L6.7 13.208a.994.994 0 0 1-1.402.005z",fillRule:"evenodd"}):"refunded"===s&&m()?Object(n.createElement)(n.Fragment,null,Object(n.createElement)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11 2.5H5A2.5 2.5 0 0 0 2.5 5v6A2.5 2.5 0 0 0 5 13.5h6a2.5 2.5 0 0 0 2.5-2.5V5A2.5 2.5 0 0 0 11 2.5ZM5 1a4 4 0 0 0-4 4v6a4 4 0 0 0 4 4h6a4 4 0 0 0 4-4V5a4 4 0 0 0-4-4H5Z"}),Object(n.createElement)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M6.25 8A.75.75 0 0 1 7 7.25h1.25A.75.75 0 0 1 9 8v3.5a.75.75 0 0 1-1.5 0V8.75H7A.75.75 0 0 1 6.25 8Z"}),Object(n.createElement)("path",{d:"M6.75 5a1.25 1.25 0 1 1 2.5 0 1.25 1.25 0 0 1-2.5 0Z"})):"refunded"!==s||m()?Object(n.createElement)("path",{d:"m8 6.585 4.593-4.592a1 1 0 0 1 1.415 1.416L9.417 8l4.591 4.591a1 1 0 0 1-1.415 1.416L8 9.415l-4.592 4.592a1 1 0 0 1-1.416-1.416L6.584 8l-4.59-4.591a1 1 0 1 1 1.415-1.416z",fillRule:"evenodd"}):Object(n.createElement)(n.Fragment,null,Object(n.createElement)("path",{d:"M5.994 2.38a.875.875 0 1 0-1.238-1.238l-4.25 4.25A.849.849 0 0 0 .25 6c0 .232.093.466.257.63l4.25 4.24a.875.875 0 1 0 1.236-1.24L3.238 6.875h7.387C12.492 6.875 14 8.271 14 10c0 1.797-1.578 3.375-3.375 3.375a.875.875 0 0 0 0 1.75c2.763 0 5.125-2.362 5.125-5.125 0-2.83-2.43-4.872-5.12-4.875H3.24l2.754-2.746Z",fillRule:"evenodd"})))))),Object(n.createElement)("td",{className:"".concat(p,"__email")},Object(n.createElement)(a.Tooltip,{text:Object(o.__)("View customer records","stripe")},Object(n.createElement)("a",{href:u,target:"_blank",rel:"noreferrer noopener"},l))),Object(n.createElement)("td",{className:"".concat(p,"__date")},Object(n.createElement)(a.Tooltip,{text:Object(o.__)("View payment record","stripe")},Object(n.createElement)("a",{href:f,target:"_blank",rel:"noreferrer noopener"},h))))},R=simpayAdminPageActivityReports,N=R.default_currency,F=R.links.all_payments,I=function(){var t=j("/wpsp/__internal__/report/latest-payments",{currency:N},[]),e=t.data.payments;return Object(n.createElement)(a.Card,{elevation:2,className:"simpay-activity-reports-card-latest"},Object(n.createElement)(a.CardHeader,null,Object(n.createElement)("h2",{className:"simpay-activity-reports-card-title"},Object(o.__)("Latest Payments","stripe")),Object(n.createElement)(a.Button,{className:"simpay-activity-reports-card-title-link",href:F,variant:"link",isSmall:!0,target:"_blank"},Object(o.__)("View More →","stripe"))),Object(n.createElement)(a.CardBody,null,t.isLoading&&Object(n.createElement)(a.Spinner,null),!t.isLoading&&e.length>0&&Object(n.createElement)("table",{className:"".concat("simpay-activity-reports-card-latest","-payments")},Object(n.createElement)("tbody",null,e.map((function(t){return Object(n.createElement)(L,b()({key:t.id},t))})))),!t.isLoading&&0===e.length&&Object(n.createElement)(C,{currency:N})))},z=i(8),V=i(4);function B(t,e){Object(V.a)(2,arguments);var i=Object(z.a)(t),n=Object(z.a)(e),a=i.getFullYear()-n.getFullYear(),s=i.getMonth()-n.getMonth();return 12*a+s}function W(t,e){Object(V.a)(2,arguments);var i=Object(z.a)(t),n=Object(z.a)(e),a=i.getTime()-n.getTime();return a<0?-1:a>0?1:a}function H(t){Object(V.a)(1,arguments);var e=Object(z.a)(t);return e.setHours(23,59,59,999),e}function U(t){Object(V.a)(1,arguments);var e=Object(z.a)(t),i=e.getMonth();return e.setFullYear(e.getFullYear(),i+1,0),e.setHours(23,59,59,999),e}function Y(t){Object(V.a)(1,arguments);var e=Object(z.a)(t);return H(e).getTime()===U(e).getTime()}var $=i(76),X=i(33);function q(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function G(t){for(var e=1;e27&&n.setDate(30),n.setMonth(n.getMonth()-s*r);var o=W(n,a)===-s;Y(Object(z.a)(t))&&1===r&&1===W(t,a)&&(o=!1),i=s*(r-Number(o))}return 0===i?0:i}(new Date(s.end),new Date(s.start))>12?(e=Object(X.dateI18n)("F Y",s.start),i=Object(X.dateI18n)("F Y",s.end)):"today"===s.type?(e=Object(X.dateI18n)(l.formats.date,Z),i=e):(e=Object(X.dateI18n)(l.formats.date,s.start),i=Object(X.dateI18n)(l.formats.date,s.end)),Object(n.createElement)("div",{className:"simpay-activity-reports-card-reports-date-range"},Object(n.createElement)(a.SelectControl,{label:Object(o.__)("Report range","stripe"),value:s.type,options:"custom"===s.type?[].concat(c,[{label:Object(o.__)("Custom","stripe"),value:"custom"}]):c,onChange:function(t){r(G(G({},s),{},{type:t,start:Object(d.d)(t,Z),end:Object(d.c)(t,s.end)}))},hideLabelFromVision:!0}),Object(n.createElement)(a.Dropdown,{position:"bottom center",popoverProps:{noArrow:!1},renderToggle:function(t){var i=t.isOpen,s=t.onToggle;return Object(n.createElement)(a.Button,{variant:"tertiary",onClick:s,"aria-expanded":i},e)},renderContent:function(t){var e=t.onToggle;return Object(n.createElement)(a.DatePicker,{currentDate:new Date(s.start),onChange:function(t){r(G(G({},s),{},{start:Object($.a)(new Date(t),"yyyy-MM-dd 00:00:00"),type:"custom"})),e()},startOfWeek:l.l10n.startOfWeek,isInvalidDate:function(t){return t>new Date(s.end)}})}}),Object(n.createElement)("span",{style:{color:"#ccc"}},"–"),Object(n.createElement)(a.Dropdown,{position:"bottom center",popoverProps:{noArrow:!1},renderToggle:function(t){var e=t.isOpen,s=t.onToggle;return Object(n.createElement)(a.Button,{variant:"tertiary",onClick:s,"aria-expanded":e},i)},renderContent:function(t){var e=t.onToggle;return Object(n.createElement)(a.DatePicker,{currentDate:new Date(s.end),onChange:function(t){r(G(G({},s),{},{end:Object($.a)(new Date(t),"yyyy-MM-dd 23:59:59"),type:"custom"})),e()},startOfWeek:l.l10n.startOfWeek,isInvalidDate:function(t){return tnew Date}})}}))},J="simpay-activity-reports-data-bar",tt=function(t){var e=t.isLoading,i=t.label,s=t.data;return Object(n.createElement)("div",{className:J},Object(n.createElement)("div",{className:"".concat(J,"__header")},Object(n.createElement)("h3",{className:"".concat(J,"__label")},i),!e&&Object(n.createElement)("div",{className:"".concat(J,"__legend")},s.map((function(t){var e=t.label,i=t.color;return Object(n.createElement)("div",{key:e,className:"".concat(J,"__legend-item"),style:{color:i}},Object(n.createElement)("span",null,e))})))),Object(n.createElement)("div",{className:"".concat(J,"__bar")},!e&&s.length>0&&s.map((function(t){return Object(n.createElement)(a.Button,{key:t.label,label:"".concat(t.label,": ").concat(t.value,"%"),showTooltip:!0,className:"".concat(J,"__bar-item"),style:{backgroundColor:t.color,flexBasis:"".concat(t.value,"%"),flexGrow:1}},Object(n.createElement)("div",{className:"screen-reader-text"},t.label))})),!e&&0===s.length&&Object(n.createElement)("div",{className:"".concat(J,"__bar-item-none")},Object(o.__)("n/a","stripe"))))},et=function(t){var e=t.currency,i=t.range,a=j("/wpsp/__internal__/report/payment-info",{range:i,currency:e},[i]),s=a.data,r=s.payment_method_types,l=s.payment_statuses;return Object(n.createElement)("div",{className:"".concat("simpay-activity-reports-card-reports","-payment-breakdown")},Object(n.createElement)(tt,{label:Object(o.__)("Payment Methods","stripe"),data:r,isLoading:a.isLoading}),Object(n.createElement)(tt,{label:Object(o.__)("Payments","stripe"),data:l,isLoading:a.isLoading}))},it=function(t){var e=t.currency,i=t.range,a=j("/wpsp/__internal__/report/gross-volume-period-over-period",{range:i,currency:e},[i]),s=a.data,r=s.delta,l=s.total_formatted;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)("div",{className:"".concat("simpay-activity-reports-card-reports","-report-title")},Object(n.createElement)("h3",null,Object(o.__)("Gross Volume","stripe"),!a.isLoading&&Object(n.createElement)(n.Fragment,null,": ",Object(n.createElement)("em",null,Object(y.decodeEntities)(l)))),!a.isLoading&&Object(n.createElement)(d.a,{delta:r})),Object(n.createElement)(d.b,{report:a,style:{width:"100%",height:"300px"},config:{yAxisIsCurrency:!0},noData:Object(n.createElement)("div",null,Object(n.createElement)("strong",null,Object(o.sprintf)(/* translators: %s Currency code. */ Object(o.__)("No %s transactions found.","stripe"),e.toUpperCase())),Object(n.createElement)("div",null,Object(o.__)("Please select a different currency, date range, or check back later.","stripe"))),deltaChangedString:function(t){return Object(n.createInterpolateElement)(Object(o.sprintf)(/* translators: %s: delta percentage */ Object(o.__)("%1$s%% vs. previous period","stripe"),Math.abs(t.delta)),{delta:Object(n.createElement)("strong",{className:t.delta>0?"is-positive":"is-negative"})})}}))},nt=simpayAdminPageActivityReports.default_currency,at=function(t){var e=t.range,i=j("/wpsp/__internal__/report/successful-payments-period-over-period",{range:e,currency:nt},[e]),a=i.data,s=a.delta,r=a.total_formatted;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)("div",{className:"".concat("simpay-activity-reports-card-reports","-report-title")},Object(n.createElement)("h3",null,Object(o.__)("Successful Payments","stripe"),!i.isLoading&&Object(n.createElement)(n.Fragment,null,": ",Object(n.createElement)("em",null,r))),!i.isLoading&&Object(n.createElement)(d.a,{delta:s})),Object(n.createElement)(d.b,{report:i,style:{width:"100%",height:"300px"},config:{yAxisIsCurrency:!1},noData:Object(n.createElement)("div",null,Object(n.createElement)("strong",null,Object(o.sprintf)(/* translators: %s Currency code. */ Object(o.__)("No %s transactions found.","stripe"),nt.toUpperCase())),Object(n.createElement)("div",null,Object(o.__)("Please select a different currency, date range, or check back later.","stripe"))),deltaChangedString:function(t){return Object(n.createInterpolateElement)(Object(o.sprintf)(/* translators: %s: delta percentage */ -Object(o.__)("%1$s%% vs. previous period","stripe"),Math.abs(t.delta)),{delta:Object(n.createElement)("strong",{className:t.delta>0?"is-positive":"is-negative"})})}}))},st=simpayAdminPageActivityReports,rt=st.user_id,ot=st.default_range,lt=ot.start,ct=ot.end,ht=ot.type,dt=st.default_currency,ut=function(){var t=Object(d.e)(rt,"simpay_activity_reports_range",{start:Object(d.d)(ht,lt),end:Object(d.c)(ht,ct),type:ht}),e=r()(t,2),i=e[0],s=e[1];return Object(n.createElement)(a.Card,{elevation:2,className:"simpay-activity-reports-card-reports"},Object(n.createElement)(a.CardHeader,{className:"".concat("simpay-activity-reports-card-reports","-header")},Object(n.createElement)("h2",{className:"simpay-activity-reports-card-title"},Object(o.__)("Reports","stripe")),Object(n.createElement)(Z,{range:i,setRange:s})),Object(n.createElement)(a.CardBody,null,Object(n.createElement)(et,{range:i,currency:dt}),Object(n.createElement)(a.CardDivider,null),Object(n.createElement)(it,{range:i,currency:dt}),Object(n.createElement)(a.CardDivider,null),Object(n.createElement)(at,{range:i,currency:dt})))};Object(n.render)(Object(n.createElement)((function(){var t=Object(d.e)(f,"simpay_activity_reports_currency",g),e=r()(t,3),i=e[0],s=e[1],l=e[2];function u(){var t=Object(h.addQueryArgs)(window.location.href,{currency:i});window.location.href=t}return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(a.Dropdown,{position:"bottom center",popoverProps:{noArrow:!1},renderToggle:function(t){var e=t.isOpen,i=t.onToggle;return Object(n.createElement)(a.Button,{variant:"secondary",onClick:i,"aria-expanded":e,icon:c,tooltip:Object(o.__)("Settings","stripe")})},renderContent:function(){return Object(n.createElement)("div",{style:{width:"200px",padding:"8px"}},Object(n.createElement)(a.SelectControl,{label:Object(o.__)("Currency","stripe"),value:i,onChange:s,options:p.map((function(t){return{label:t,value:t.toLowerCase()}})),help:Object(o.__)("Activity with the selected currency and global payment mode will be shown.","stripe")}),Object(n.createElement)(a.Button,{type:"submit",variant:"primary",onClick:u,isBusy:l,disabled:l},Object(o.__)("Update","stripe")))}}),Object(n.createElement)(a.Popover.Slot,null))}),null),document.getElementById("simpay-admin-page-activity-reports-config")),Object(n.render)(Object(n.createElement)((function(){return Object(n.createElement)("div",{className:"simpay-activity-reports"},Object(n.createElement)(E,null),Object(n.createElement)(I,null),Object(n.createElement)(ut,null),Object(n.createElement)(a.Popover.Slot,null))}),null),document.getElementById("simpay-admin-page-activity-reports"))}]); \ No newline at end of file +Object(o.__)("%1$s%% vs. previous period","stripe"),Math.abs(t.delta)),{delta:Object(n.createElement)("strong",{className:t.delta>0?"is-positive":"is-negative"})})}}))},st=simpayAdminPageActivityReports,rt=st.user_id,ot=st.default_range,lt=ot.start,ct=ot.end,ht=ot.type,dt=st.default_currency,ut=function(){var t=Object(d.e)(rt,"simpay_activity_reports_range",{start:Object(d.d)(ht,lt),end:Object(d.c)(ht,ct),type:ht}),e=r()(t,2),i=e[0],s=e[1];return Object(n.createElement)(a.Card,{elevation:2,className:"simpay-activity-reports-card-reports"},Object(n.createElement)(a.CardHeader,{className:"".concat("simpay-activity-reports-card-reports","-header")},Object(n.createElement)("h2",{className:"simpay-activity-reports-card-title"},Object(o.__)("Reports","stripe")),Object(n.createElement)(K,{range:i,setRange:s})),Object(n.createElement)(a.CardBody,null,Object(n.createElement)(et,{range:i,currency:dt}),Object(n.createElement)(a.CardDivider,null),Object(n.createElement)(it,{range:i,currency:dt}),Object(n.createElement)(a.CardDivider,null),Object(n.createElement)(at,{range:i,currency:dt})))};Object(n.render)(Object(n.createElement)((function(){var t=Object(d.e)(f,"simpay_activity_reports_currency",g),e=r()(t,3),i=e[0],s=e[1],l=e[2];function u(){var t=Object(h.addQueryArgs)(window.location.href,{currency:i});window.location.href=t}return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(a.Dropdown,{position:"bottom center",popoverProps:{noArrow:!1},renderToggle:function(t){var e=t.isOpen,i=t.onToggle;return Object(n.createElement)(a.Button,{variant:"secondary",onClick:i,"aria-expanded":e,icon:c,tooltip:Object(o.__)("Settings","stripe")})},renderContent:function(){return Object(n.createElement)("div",{style:{width:"200px",padding:"8px"}},Object(n.createElement)(a.SelectControl,{label:Object(o.__)("Currency","stripe"),value:i,onChange:s,options:p.map((function(t){return{label:t,value:t.toLowerCase()}})),help:Object(o.__)("Activity with the selected currency and global payment mode will be shown.","stripe")}),Object(n.createElement)(a.Button,{type:"submit",variant:"primary",onClick:u,isBusy:l,disabled:l},Object(o.__)("Update","stripe")))}}),Object(n.createElement)(a.Popover.Slot,null))}),null),document.getElementById("simpay-admin-page-activity-reports-config")),Object(n.render)(Object(n.createElement)((function(){return Object(n.createElement)("div",{className:"simpay-activity-reports"},Object(n.createElement)(E,null),Object(n.createElement)(I,null),Object(n.createElement)(ut,null),Object(n.createElement)(a.Popover.Slot,null))}),null),document.getElementById("simpay-admin-page-activity-reports"))}]); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-page-setup-wizard-css.asset.php b/includes/core/assets/js/dist/simpay-admin-page-setup-wizard-css.asset.php index bb8b4ef8..b71491df 100644 --- a/includes/core/assets/js/dist/simpay-admin-page-setup-wizard-css.asset.php +++ b/includes/core/assets/js/dist/simpay-admin-page-setup-wizard-css.asset.php @@ -1 +1 @@ - array(), 'version' => 'd99dc49f938c91cae2684bcc17849259'); \ No newline at end of file + array(), 'version' => 'fffb1affd7c46d59ca8858785f26ba36'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-page-setup-wizard.asset.php b/includes/core/assets/js/dist/simpay-admin-page-setup-wizard.asset.php index 15e647bb..c9a7fad6 100644 --- a/includes/core/assets/js/dist/simpay-admin-page-setup-wizard.asset.php +++ b/includes/core/assets/js/dist/simpay-admin-page-setup-wizard.asset.php @@ -1 +1 @@ - array('lodash', 'react', 'wp-api-fetch', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-primitives', 'wp-url'), 'version' => '579b9765c204b25653135173b92b4236'); \ No newline at end of file + array('lodash', 'react', 'wp-api-fetch', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-primitives', 'wp-url'), 'version' => '460aeaabd1d5ec4ac3dfda45048d8c3b'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-page-setup-wizard.js b/includes/core/assets/js/dist/simpay-admin-page-setup-wizard.js index b515d6a7..08b72398 100644 --- a/includes/core/assets/js/dist/simpay-admin-page-setup-wizard.js +++ b/includes/core/assets/js/dist/simpay-admin-page-setup-wizard.js @@ -1,2 +1,2 @@ -!function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.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 a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));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=77)}([function(e,t){e.exports=window.wp.element},,function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wp.components},,function(e,t){e.exports=window.React},function(e,t,n){var r=n(26),a=n(27),i=n(22),c=n(28);e.exports=function(e,t){return r(e)||a(e,t)||i(e,t)||c()},e.exports.__esModule=!0,e.exports.default=e.exports},,,function(e,t){e.exports=window.wp.primitives},function(e,t){e.exports=window.wp.url},function(e,t,n){var r=n(30);e.exports=function(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=window.lodash},function(e,t,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function a(){for(var e=[],t=0;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i},e.exports.__esModule=!0,e.exports.default=e.exports},,,,,,,,function(e,t){e.exports=window.wp.notices},function(e,t,n){"use strict";e.exports=n(62)},function(e,t,n){"use strict";var r="function"==typeof Symbol&&Symbol.for,a=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,c=r?Symbol.for("react.fragment"):60107,o=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,p=r?Symbol.for("react.async_mode"):60111,m=r?Symbol.for("react.concurrent_mode"):60111,f=r?Symbol.for("react.forward_ref"):60112,d=r?Symbol.for("react.suspense"):60113,b=r?Symbol.for("react.suspense_list"):60120,y=r?Symbol.for("react.memo"):60115,h=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,j=r?Symbol.for("react.scope"):60119;function _(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case a:switch(e=e.type){case p:case m:case c:case s:case o:case d:return e;default:switch(e=e&&e.$$typeof){case u:case f:case h:case y:case l:return e;default:return t}}case i:return t}}}function x(e){return _(e)===m}t.AsyncMode=p,t.ConcurrentMode=m,t.ContextConsumer=u,t.ContextProvider=l,t.Element=a,t.ForwardRef=f,t.Fragment=c,t.Lazy=h,t.Memo=y,t.Portal=i,t.Profiler=s,t.StrictMode=o,t.Suspense=d,t.isAsyncMode=function(e){return x(e)||_(e)===p},t.isConcurrentMode=x,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===a},t.isForwardRef=function(e){return _(e)===f},t.isFragment=function(e){return _(e)===c},t.isLazy=function(e){return _(e)===h},t.isMemo=function(e){return _(e)===y},t.isPortal=function(e){return _(e)===i},t.isProfiler=function(e){return _(e)===s},t.isStrictMode=function(e){return _(e)===o},t.isSuspense=function(e){return _(e)===d},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===c||e===m||e===s||e===o||e===d||e===b||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===y||e.$$typeof===l||e.$$typeof===u||e.$$typeof===f||e.$$typeof===v||e.$$typeof===O||e.$$typeof===j||e.$$typeof===g)},t.typeOf=_},function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r=0||(a[n]=e[n]);return a},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";var r=n(0),a=n(9);const i=Object(r.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(a.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}));t.a=i},function(e,t,n){"use strict";var r=n(0),a=n(9);const i=Object(r.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(a.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"}));t.a=i},,,,,,,,,,,,function(e,t,n){"use strict";n.r(t);var r=n(6),a=n.n(r),i=n(0),c=(n(60),n(3)),o=n(2),s=n(10),l=n(37),u=n(12),p=n(25),m=n.n(p),f=n(44),d=n(65),b=n(18),y=n.n(b),h=n(15),g=n.n(h),v=n(5);function O(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var j=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|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|enterKeyHint|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|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|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)-.*))$/,_=O((function(e){return j.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}));function x(){return(x=Object.assign?Object.assign.bind():function(e){for(var t=1;t2||J(V)>3?"":" "}function ae(e,t){for(;--t&&Y()&&!(V<48||V>102||V>57&&V<65||V>70&&V<97););return K(e,Q()+(t<6&&32==X()&&32==Y()))}function ie(e,t){for(;Y()&&e+V!==57&&(e+V!==84||47!==X()););return"/*"+K(t,Z-1)+"*"+A(47===e?e:Y())}function ce(e){for(;!J(X());)Y();return K(e,Z)}function oe(e,t,n,r,a,i,c,o,s,l,u){for(var p=a-1,m=0===a?i:[""],f=D(m),d=0,b=0,y=0;d0?m[h]+" "+g:$(g,/&\f/g,m[h])))&&(s[y++]=v);return G(e,t,n,0===a?k:o,s,l,u)}function se(e,t,n){return G(e,t,n,S,A(V),F(e,2,-2),0)}function le(e,t,n,r){return G(e,t,n,C,F(e,0,r),F(e,r+1,-1),r)}function ue(e,t){for(var n="",r=D(e),a=0;a-1&&!e.return)switch(e.type){case C:e.return=function e(t,n){switch(a=n,45^T(r=t,0)?(((a<<2^T(r,0))<<2^T(r,1))<<2^T(r,2))<<2^T(r,3):0){case 5103:return E+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return E+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return E+t+"-moz-"+t+"-ms-"+t+t;case 6828:case 4268:return E+t+"-ms-"+t+t;case 6165:return E+t+"-ms-flex-"+t+t;case 5187:return E+t+$(t,/(\w+).+(:[^]+)/,E+"box-$1$2-ms-flex-$1$2")+t;case 5443:return E+t+"-ms-flex-item-"+$(t,/flex-|-self/,"")+t;case 4675:return E+t+"-ms-flex-line-pack"+$(t,/align-content|flex-|-self/,"")+t;case 5548:return E+t+"-ms-"+$(t,"shrink","negative")+t;case 5292:return E+t+"-ms-"+$(t,"basis","preferred-size")+t;case 6060:return E+"box-"+$(t,"-grow","")+E+t+"-ms-"+$(t,"grow","positive")+t;case 4554:return E+$(t,/([^-])(transform)/g,"$1"+E+"$2")+t;case 6187:return $($($(t,/(zoom-|grab)/,E+"$1"),/(image-set)/,E+"$1"),t,"")+t;case 5495:case 3959:return $(t,/(image-set\([^]*)/,E+"$1$`$1");case 4968:return $($(t,/(.+:)(flex-)?(.*)/,E+"box-pack:$3-ms-flex-pack:$3"),/s.+-b[^;]+/,"justify")+E+t+t;case 4095:case 3583:case 4068:case 2532:return $(t,/(.+)-inline(.+)/,E+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(L(t)-1-n>6)switch(T(t,n+1)){case 109:if(45!==T(t,n+4))break;case 102:return $(t,/(.+:)(.+)-([^]+)/,"$1"+E+"$2-$3$1-moz-"+(108==T(t,n+3)?"$3":"$2-$3"))+t;case 115:return~R(t,"stretch")?e($(t,"stretch","fill-available"),n)+t:t}break;case 4949:if(115!==T(t,n+1))break;case 6444:switch(T(t,L(t)-3-(~R(t,"!important")&&10))){case 107:return $(t,":",":"+E)+t;case 101:return $(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+E+(45===T(t,14)?"inline-":"")+"box$3$1"+E+"$2$3$1-ms-$2box$3")+t}break;case 5936:switch(T(t,n+11)){case 114:return E+t+"-ms-"+$(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return E+t+"-ms-"+$(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return E+t+"-ms-"+$(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return E+t+"-ms-"+t+t}var r,a;return t}(e.value,e.length);break;case P:return ue([q(e,{value:$(e.value,"@","@"+E)})],r);case k:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch((n=/(::plac\w+|:read-\w+)/.exec(n=t))?n[0]:n){case":read-only":case":read-write":return ue([q(e,{props:[$(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return ue([q(e,{props:[$(t,/:(plac\w+)/,":"+E+"input-$1")]}),q(e,{props:[$(t,/:(plac\w+)/,":-moz-$1")]}),q(e,{props:[$(t,/:(plac\w+)/,"-ms-input-$1")]})],r)}var n;return""}))}}],ge=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var r,a,i=e.stylisPlugins||he,c={},o=[];r=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n0&&L(w)-m&&B(d>32?le(w+";",a,r,m-1):le($(w," ","")+";",a,r,m-2),l);break;case 59:w+=";";default:if(B(x=oe(w,n,r,u,p,i,s,O,j=[],_=[],m),c),123===v)if(0===p)e(w,n,x,x,j,c,m,s,_);else switch(99===f&&110===T(w,3)?100:f){case 100:case 108:case 109:case 115:e(t,x,x,a&&B(oe(t,x,x,0,0,i,s,O,i,j=[],m),_),i,_,m,s,a?j:_);break;default:e(w,x,x,x,[""],_,0,s,_)}}u=p=d=0,y=g=1,O=w="",m=o;break;case 58:m=1+L(w),d=b;default:if(y<1)if(123==v)--y;else if(125==v&&0==y++&&125==(V=Z>0?T(H,--Z):0,W--,10===V&&(W=1,U--),V))continue;switch(w+=A(v),v*y){case 38:g=p>0?1:(w+="\f",-1);break;case 44:s[u++]=(L(w)-1)*g,g=1;break;case 64:45===X()&&(w+=ne(Y())),f=X(),p=m=L(O=w+=ce(Q())),v++;break;case 45:45===b&&2==L(w)&&(y=0)}}return c}("",null,null,null,[""],e=ee(e),0,[0],e))}(e?e+"{"+t.styles+"}":t.styles),p),r&&(m.inserted[t.name]=!0)};var m={key:t,sheet:new w({key:t,container:r,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:c,registered:{},insert:a};return m.sheet.hydrate(o),m};function ve(e,t,n){var r="";return n.split(" ").forEach((function(n){void 0!==e[n]?t.push(e[n]+";"):r+=n+" "})),r}n(51);var Oe=function(e,t,n){!function(e,t,n){var r=e.key+"-"+t.name;!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles)}(e,t,n);var r=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var a=t;do{e.insert(t===a?"."+r:"",a,e.sheet,!0),a=a.next}while(void 0!==a)}},je={animationIterationCount:1,aspectRatio: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},_e=/[A-Z]|^ms/g,xe=/_EMO_([^_]+?)_([^]*?)_EMO_/g,we=function(e){return 45===e.charCodeAt(1)},Ee=function(e){return null!=e&&"boolean"!=typeof e},Se=O((function(e){return we(e)?e:e.replace(_e,"-$&").toLowerCase()})),ke=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(xe,(function(e,t,n){return Pe={name:t,styles:n,next:Pe},t}))}return 1===je[e]||we(e)||"number"!=typeof t||0===t?t:t+"px"};function Ce(e,t,n){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 Pe={name:n.name,styles:n.styles,next:Pe},n.name;if(void 0!==n.styles){var r=n.next;if(void 0!==r)for(;void 0!==r;)Pe={name:r.name,styles:r.styles,next:Pe},r=r.next;return n.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var a=0;a=4;++r,a-=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(a){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)}(a)+s,styles:a,next:Pe}},Me=(!!v.useInsertionEffect&&v.useInsertionEffect||v.useLayoutEffect,v.createContext("undefined"!=typeof HTMLElement?ge({key:"css"}):null));Me.Provider;var Ne=function(e){return Object(v.forwardRef)((function(t,n){var r=Object(v.useContext)(Me);return e(t,r,n)}))},$e=v.createContext({}),Re=_,Te=function(e){return"theme"!==e},Fe=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?Re:Te},Le=function(e,t,n){var r;if(t){var a=t.shouldForwardProp;r=e.__emotion_forwardProp&&a?function(t){return e.__emotion_forwardProp(t)&&a(t)}:a}return"function"!=typeof r&&n&&(r=e.__emotion_forwardProp),r},De=function(){return null},Be=function e(t,n){var r,a,i=t.__emotion_real===t,c=i&&t.__emotion_base||t;void 0!==n&&(r=n.label,a=n.target);var o=Le(t,n,i),s=o||Fe(c),l=!s("as");return function(){var u=arguments,p=i&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==r&&p.push("label:"+r+";"),null==u[0]||void 0===u[0].raw)p.push.apply(p,u);else{p.push(u[0][0]);for(var m=u.length,f=1;f div {\n\t\tmargin-left: 8px;\n\t}\n\n\tsvg {\n\t\tdisplay: block;\n\n\t\t&:hover {\n\t\t\tcursor: pointer;\n\t\t}\n\t}\n"]))),Ke=Ye(c.Popover)(Ie||(Ie=y()(["\n\t.components-popover__content {\n\t\tpadding: 20px;\n\t\twidth: 200px;\n\t}\n"]))),Je=Ye(c.ToggleControl)(Ze||(Ze=y()(["\n\t&& {\n\t\t.components-base-control__field {\n\t\t\tmargin-bottom: 0;\n\t\t}\n\t}\n"]))),et=n(52),tt=n.n(et),nt=Ye(c.Card)(Ve||(Ve=y()(["\n\tpadding: 30px;\n\n\t&& {\n\t\tbox-shadow: 0 2px 6px 0 rgba( 0, 0, 0, 0.05 );\n\t\tborder: 1px solid #ccc;\n\t\twidth: 100%;\n\t}\n"]))),rt=Ye(c.CardHeader)(He||(He=y()(["\n\t&&& {\n\t\tpadding: 0 0 30px;\n\t}\n\n\th1 {\n\t\tfont-size: 26px;\n\t\tline-height: 1;\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t}\n\n\tsmall {\n\t\tcolor: #c0c0c0;\n\t\tfont-size: 13px;\n\t\tfont-weight: normal;\n\t\tdisplay: block;\n\t\tmargin: 0 0 3px;\n\t}\n"]))),at=Ye(c.CardFooter)(Ge||(Ge=y()(["\n\t&&& {\n\t\tpadding: 30px 0 0;\n\t}\n"]))),it=Ye(c.CardBody)(qe||(qe=y()(["\n\t&&& {\n\t\tpadding: 30px 0;\n\t}\n\n\t> * {\n\t\tmargin: 0 0 2rem;\n\n\t\t&:last-child {\n\t\t\tmargin-bottom: 0;\n\t\t}\n\t}\n\n\t> p {\n\t\tcolor: #555555;\n\t\tfont-size: 15px;\n\t}\n"]))),ct=["title","supTitle","children"];function ot(e){return Object(i.createElement)(nt,e)}function st(e){var t=e.title,n=e.supTitle,r=e.children,a=tt()(e,ct);return Object(i.createElement)(rt,a,Object(i.createElement)("div",null,n&&Object(i.createElement)("small",null,n),t&&Object(i.createElement)("h1",null,t)),r)}function lt(e){return Object(i.createElement)(at,e)}function ut(e){return Object(i.createElement)(it,e)}var pt,mt=simpaySetupWizard.adminUrl;function ft(e){var t=e.isFirst,n=Object(i.useState)(!1),r=a()(n,2),s=r[0],l=r[1];return Object(i.createElement)(c.Flex,{justify:"center"},s&&Object(i.createElement)(c.Modal,{title:Object(o.__)("Are you sure you want to exit the wizard?","stripe"),onRequestClose:function(){return l(!1)}},Object(i.createElement)("p",{style:{marginBottom:"2rem"}},Object(o.__)("Manual setup is only recommended for experienced users.","stripe")),Object(i.createElement)(c.Flex,null,Object(i.createElement)(c.Button,{href:mt,isDestructive:!0,variant:"destructive"},Object(o.__)("Exit Setup Wizard","stripe")),Object(i.createElement)(c.Button,{variant:"primary",isPrimary:!0,onClick:function(){return l(!1)}},Object(o.__)("Continue Setup","stripe")))),Object(i.createElement)(c.Button,{isLink:!0,variant:"link",className:"simpay-setup-wizard-subtle-link",onClick:function(){return l(!0)}},t?Object(o.__)("Go back to the Dashboard","stripe"):Object(o.__)("Close and exit the Setup Wizard","stripe")))}var dt=Ye(c.Button)(pt||(pt=y()(["\n\t&& {\n\t\tfont-size: 16px;\n\t\tfont-weight: bold;\n\t\tpadding: 15px 30px !important;\n\t\theight: auto;\n\t}\n"]))),bt=Object(i.forwardRef)((function(e,t){return Object(i.createElement)(dt,g()({isPrimary:!0,variant:"primary"},e,{ref:t}))}));function yt(e){return e.width,Object(i.createElement)("svg",{width:"311",height:"41",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(i.createElement)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.352 0C1.052 0 0 1.02 0 2.277v30.746C0 34.281 1.053 35.3 2.352 35.3h28.806c.975 0 1.764-.764 1.764-1.708 0-.943-.79-1.708-1.763-1.708H5.29c-.974 0-1.764-.765-1.764-1.708v-17.08c0-.944.79-1.709 1.764-1.709h44.092c1.299 0 2.352-1.02 2.352-2.277V2.277C51.735 1.02 50.682 0 49.383 0H2.352Zm55.262 24.198h-1.47v-1.993c0-4.088-3.422-7.402-7.643-7.402-4.22 0-7.642 3.314-7.642 7.402v1.993H38.8c-1.299 0-2.352 1.02-2.352 2.277v11.387c0 1.258 1.053 2.278 2.352 2.278h18.813c1.299 0 2.351-1.02 2.351-2.278V26.475c0-1.258-1.053-2.277-2.351-2.277Zm-4.997-1.993v1.993h-8.23v-1.993c0-2.201 1.842-3.985 4.114-3.985 2.273 0 4.116 1.784 4.116 3.985ZM8.23 20.497c0-.629.526-1.139 1.175-1.139H28.22c.65 0 1.176.51 1.176 1.139s-.527 1.139-1.176 1.139H9.406c-.649 0-1.175-.51-1.175-1.139Zm0 5.124c0-.629.526-1.138 1.175-1.138h7.055c.65 0 1.176.51 1.176 1.138 0 .63-.527 1.139-1.176 1.139H9.406c-.649 0-1.175-.51-1.175-1.139Zm31.158 11.672V27.045h17.637v10.248H39.389Z",fill:"#428BCA"}),Object(i.createElement)("path",{d:"M81.08 30.745h5.288l5.41-17.186 5.596 17.187h5.289l7.84-24.29h-5.288l-5.289 17.956L94.7 6.457h-5.842L83.785 24.38 78.528 6.457h-5.289l7.84 24.288Zm31.511 0h4.796v-8.793h6.456c5.319 0 8.302-3.228 8.302-7.963 0-4.735-2.983-7.532-8.302-7.532h-11.252v24.288Zm4.796-13.405V11.1h5.288c2.952 0 4.52 1.168 4.52 3.104 0 1.968-1.507 3.136-4.366 3.136h-5.442Zm35.473 13.897c6.303 0 10.023-3.197 10.023-7.747 0-10.3-14.789-4.581-14.789-10.085 0-1.906 1.599-3.013 4.52-3.013 2.859 0 4.519 1.322 4.704 3.567h5.288c0-4.92-4.089-7.994-9.9-7.994-5.872 0-9.562 2.89-9.562 7.502 0 10.268 14.758 4.642 14.758 10.084 0 1.998-1.752 3.26-4.919 3.26-3.228 0-5.073-1.6-5.165-4.305h-5.381c0 5.503 4.274 8.731 10.423 8.731Zm15.137-18.447c1.66 0 2.89-1.23 2.89-2.89 0-1.66-1.23-2.829-2.89-2.829-1.691 0-2.921 1.169-2.921 2.83 0 1.66 1.23 2.89 2.921 2.89Zm-2.306 17.956h4.581V14.758h-4.581v15.988Zm7.696-.001h4.55v-8.178c0-2.644 1.384-4.366 3.597-4.366 1.968 0 3.136 1.415 3.136 3.751v8.793h4.612v-8.178c0-2.644 1.384-4.366 3.597-4.366 1.968 0 3.136 1.415 3.136 3.751v8.793h4.643v-9.039c0-4.888-1.968-7.44-5.965-7.44-2.459 0-4.642.86-6.21 3.044-.892-2.03-2.583-3.044-5.135-3.044-2.552 0-4.335 1.076-5.411 2.798v-2.306h-4.55v15.988Zm30.183 6.15h4.551v-8.24c1.106 1.63 2.859 2.582 5.38 2.582 4.028 0 6.887-3.504 6.887-8.424 0-5.011-2.859-8.547-6.887-8.547-2.521 0-4.274.953-5.38 2.583v-2.091h-4.551v22.137Zm8.363-9.593c-2.244 0-3.843-1.875-3.843-4.52 0-2.674 1.599-4.58 3.843-4.58 2.275 0 3.874 1.906 3.874 4.58 0 2.645-1.599 4.52-3.874 4.52Zm10.651 3.443h4.551V6.457h-4.551v24.288Zm15.443.492c3.905 0 6.918-2.213 7.41-5.688h-4.551c-.184 1.107-1.229 1.968-2.828 1.968-2.368 0-3.536-1.353-3.751-3.412h11.222v-1.476c0-5.104-3.259-8.363-7.502-8.363-4.919 0-8.363 3.505-8.363 8.455 0 4.98 3.444 8.516 8.363 8.516Zm-3.689-9.93c.276-1.845 1.352-3.106 3.505-3.106 1.937 0 3.013 1.322 3.105 3.106h-6.61Zm22.358 9.438h4.796v-8.793h6.457c5.319 0 8.301-3.228 8.301-7.963 0-4.735-2.982-7.532-8.301-7.532h-11.253v24.288Zm4.796-13.405V11.1h5.288c2.952 0 4.52 1.168 4.52 3.104 0 1.968-1.507 3.136-4.366 3.136h-5.442Zm20.704 13.897c2.736 0 4.458-1.23 5.257-3.228.4 2.183 2.152 3.413 5.688 2.613v-3.259c-1.261.123-1.507-.338-1.507-1.66v-5.411c0-3.782-2.644-6.026-7.317-6.026-4.612 0-7.317 2.275-7.317 6.118h4.488c0-1.383 1.015-2.183 2.768-2.183 1.906 0 2.859.769 2.828 2.091v.492l-3.659.43c-4.519.523-7.071 2.368-7.071 5.258 0 2.429 1.722 4.765 5.842 4.765Zm.922-3.382c-1.414 0-2.183-.645-2.183-1.63 0-1.167 1.507-1.629 4.397-1.998l1.568-.153c-.277 2.152-1.599 3.781-3.782 3.781Zm11.126 9.04h1.967c3.936 0 6.641-1.077 8.271-4.981L311 14.758h-4.766l-3.996 10.669-4.797-10.67h-4.796l7.225 16.234c-1.014 1.446-2.06 1.907-4.058 1.876h-1.568v4.028Z",fill:"#428BCA"}))}var ht=n(16);function gt(e){var t=Object(ht.useSelect)((function(e){return Object(u.filter)(e("core/notices").getNotices(),{type:"snackbar"})}),[]),n=Object(ht.useDispatch)("core/notices").removeNotice;return 0===t.length?null:Object(i.createElement)(c.SnackbarList,g()({onRemove:n,notices:t},e))}var vt,Ot,jt,_t,xt,wt=n(64),Et=Ye.div(vt||(vt=y()(["\n\tmax-width: 80%;\n\tdisplay: flex;\n\talign-items: center;\n\n\t> * {\n\t\tmargin-right: 8px;\n\n\t\t&:last-child {\n\t\t\tmargin-right: 0;\n\t\t}\n\t}\n"]))),St={current:"var(--wp-admin-theme-color)",complete:"var(--wp-admin-theme-color)",incomplete:"#c0c0c0"},kt=Ye.div(Ot||(Ot=y()(["\n\twidth: 16px;\n\theight: 16px;\n\tborder-radius: 50%;\n\tbackground-color: ",";\n\tflex-shrink: 0;\n\tposition: relative;\n\ttransition: backgroundColor 0.2s ease-in-out;\n\n\tsvg {\n\t\tfill: #fff;\n\t\tposition: absolute;\n\t\tleft: -1px;\n\t\ttop: -1px;\n\t\ttransition: opacity 0.2s ease-in-out;\n\t\topacity: ",";\n\t}\n\n\tdiv {\n\t\topacity: ",";\n\t}\n\n\tpath {\n\t\tstroke: #fff;\n\t}\n"])),(function(e){return St[e.status]}),(function(e){return e.isComplete?"1":"0"}),(function(e){var t=e.isCurrent,n=e.isComplete;return t&&!n?"1":"0"})),Ct=Ye.div(jt||(jt=y()(["\n\twidth: 6px;\n\theight: 6px;\n\tbackground-color: #f0f0f1;\n\tborder-radius: 50%;\n\tposition: absolute;\n\ttop: 5px;\n\tleft: 5px;\n\ttransition: opacity 0.2s ease-in-out;\n"]))),Pt=Ye.div(_t||(_t=y()(["\n\twidth: 100%;\n\theight: 2px;\n\tbackground-color: rgba( 192, 192, 192, 0.5 );\n\twidth: 100px;\n"])));function zt(e){for(var t=e.current,n=e.total,r=[],a=1;a<=n;a++){var c="incomplete";a * {\n\t\tmargin: 25px 0;\n\t}\n"])));function Nt(e){return Object(i.createElement)(Mt,e)}var $t=Ye(c.Button)(At||(At=y()(["\n\t&&&& {\n\t\tfont-size: 16px;\n\t\tfont-weight: bold;\n\t\tpadding: 13px 30px 12px !important;\n\t\theight: auto;\n\t\tbackground-color: #635bff;\n\n\t\t&:focus {\n\t\t\tbackground-color: #635bff;\n\t\t\tbox-shadow: inset 0 0 0 1px #fff,\n\t\t\t\t0 0 0 var( --wp-admin-border-width-focus ) #635bff;\n\t\t}\n\n\t\t&:hover {\n\t\t\tbackground-color: #0a2540 !important;\n\t\t}\n\n\t\t&:focus:hover {\n\t\t\tbox-shadow: inset 0 0 0 1px #fff,\n\t\t\t\t0 0 0 var( --wp-admin-border-width-focus ) #0a2540;\n\t\t}\n\n\t\tsvg {\n\t\t\tmargin-left: 5px;\n\t\t}\n\t}\n"]))),Rt=Object(i.forwardRef)((function(e,t){return Object(i.createElement)($t,g()({isPrimary:!0,variant:"primary"},e,{ref:t}))}));function Tt(){return Object(i.createElement)("svg",{width:56,height:23,fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(i.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M55.742 11.884c0-3.93-1.92-7.032-5.59-7.032-3.684 0-5.914 3.101-5.914 7.001 0 4.622 2.632 6.955 6.41 6.955 1.843 0 3.236-.414 4.29-.998v-3.07c-1.053.522-2.261.844-3.794.844-1.502 0-2.834-.522-3.004-2.334h7.572c0-.2.03-.998.03-1.366Zm-7.649-1.459c0-1.735 1.069-2.456 2.044-2.456.945 0 1.951.721 1.951 2.456h-3.995Zm-9.832-5.573c-1.517 0-2.493.706-3.035 1.197l-.201-.952h-3.407V23l3.871-.814.016-4.345c.557.4 1.378.967 2.74.967 2.772 0 5.296-2.21 5.296-7.078-.015-4.452-2.57-6.878-5.28-6.878Zm-.929 10.579c-.913 0-1.456-.323-1.827-.722l-.016-5.696c.403-.446.96-.753 1.843-.753 1.41 0 2.385 1.566 2.385 3.578 0 2.057-.96 3.593-2.385 3.593ZM26.292 3.946l3.886-.83V0l-3.886.814v3.132Zm0 1.167h3.886v13.434h-3.886V5.113Zm-4.165 1.136-.248-1.136h-3.345v13.434h3.871V9.443c.914-1.183 2.462-.968 2.942-.799V5.113c-.495-.184-2.307-.522-3.22 1.136Zm-7.742-4.468-3.778.798-.016 12.299c0 2.272 1.719 3.946 4.01 3.946 1.27 0 2.2-.23 2.71-.507V15.2c-.495.2-2.942.906-2.942-1.366v-5.45h2.942V5.112H14.37l.016-3.332ZM3.917 9.013c0-.6.496-.83 1.317-.83 1.176 0 2.663.354 3.84.983V5.558c-1.286-.507-2.555-.706-3.84-.706C2.09 4.852 0 6.479 0 9.197c0 4.238 5.884 3.562 5.884 5.39 0 .705-.62.936-1.487.936-1.285 0-2.926-.522-4.227-1.229v3.655c1.44.614 2.896.875 4.227.875 3.221 0 5.435-1.582 5.435-4.33-.015-4.575-5.915-3.762-5.915-5.481Z",fill:"#fff"}))}var Ft=n(11),Lt=n.n(Ft);function Dt(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 Bt(e){for(var t=1;tWP Simple Pay account or purchase receipt email.","stripe"),{strong:Object(i.createElement)("strong",null),a:Object(i.createElement)("a",{href:Jt,target:"_blank",rel:"noopener noreferrer"})})),Object(i.createElement)(c.TextControl,{label:Object(o.__)("License Key","stripe"),value:l,className:_,onChange:function(e){return u(e)},disabled:d,help:g||Object(o.__)("An active license ensures automatic updates and the latest features.","stripe"),ref:j})),Object(i.createElement)(lt,{justify:"flex-end",align:"center"},Object(i.createElement)(bt,{onClick:function(){b(!0);var e=new FormData;e.append("action","simpay_activate_license"),e.append("nonce",en),e.append("license",l),m()({url:Kt,method:"POST",body:e}).then((function(e){var r=e.success,a=e.data,i=a.message,c=a.license;if(!r)throw{message:i};n(c),O(Object(o.__)("License activated","stripe"),{type:"snackbar"}),b(!1),t()})).catch((function(e){var t=e.message;v(t),b(!1)}))},disabled:""===l||d,isBusy:d},Object(o.__)("Activate and Continue →","stripe"))))}},{id:"stripe",title:Object(o.__)("Connect to Stripe","stripe"),content:wn},{id:"emails",title:Object(o.__)("Configure Emails","stripe"),content:function(e){var t=e.goPrev,n=e.goNext,r=e.licenseData,a=Wt(),s=a.settings,l=a.rawSettings,p=a.discardChanges,m=a.editSettings,f=a.saveSettings,d=Object(i.useRef)();if(Object(i.useLayoutEffect)((function(){d.current&&d.current.focus()}),[l]),Object(u.isEmpty)(s))return Object(i.createElement)(ut,null,Object(i.createElement)(c.Spinner,null));var b=s["email_payment-confirmation"],y=s["email_payment-notification"],h=s["email_payment-notification_to"],g=s["email_upcoming-invoice"],v=s["email_invoice-confirmation"],O=r.features,j=O.subscriptions,_=O.enhanced_subscriptions;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(ut,null,Object(i.createElement)("ul",{className:"simpay-setup-wizard-toggle-list"},Object(i.createElement)("li",null,Object(i.createElement)("label",{htmlFor:"email_payment-confirmation"},Object(i.createElement)("h3",null,Object(o.__)("Payment Receipt","stripe")),Object(i.createElement)("p",null,Object(o.__)("Send a payment receipt email to the customer upon successful payment.","stripe"))),Object(i.createElement)(c.FormToggle,{id:"email_payment-confirmation",checked:"no"!==b,onChange:function(e){var t=e.target;return m({"email_payment-confirmation":t.checked?"yes":"no"})}})),Object(i.createElement)("li",null,Object(i.createElement)("label",{htmlFor:"email_payment-notification"},Object(i.createElement)("h3",null,Object(o.__)("Payment Notification","stripe")),Object(i.createElement)("p",null,Object(o.__)("Receive an email notification when a new payment is made.","stripe"))),Object(i.createElement)(c.FormToggle,{id:"email_payment-notification",checked:"no"!==y,onChange:function(e){var t=e.target;return m({"email_payment-notification":t.checked?"yes":"no"})}})),"no"!==y&&Object(i.createElement)("li",{className:"simpay-setup-wizard-toggle-list__child"},Object(i.createElement)(c.TextControl,{label:Object(o.__)("Send to:","stripe"),value:h,onChange:function(e){return m({"email_payment-notification_to":e})}})),_&&Object(i.createElement)("li",null,Object(i.createElement)("label",{htmlFor:"email_invoice-confirmation"},Object(i.createElement)("h3",null,Object(o.__)("Invoice Receipt","stripe")),Object(i.createElement)("p",null,Object(o.__)("Send a payment receipt email to the customer upon successful invoice.","stripe"))),Object(i.createElement)(c.FormToggle,{id:"email_payment-confirmation",checked:"no"!==v,onChange:function(e){var t=e.target;return m({"email_invoice-confirmation":t.checked?"yes":"no"})}})),j&&Object(i.createElement)("li",null,Object(i.createElement)("label",{htmlFor:"email_upcoming-invoice"},Object(i.createElement)("h3",null,Object(o.__)("Upcoming Invoice","stripe")),Object(i.createElement)("p",null,Object(o.__)("Remind customers of upcoming invoices and allow payment method changes.","stripe"))),Object(i.createElement)(c.FormToggle,{id:"email_upcoming-invoice",checked:"no"!==g,onChange:function(e){var t=e.target;return m({"email_upcoming-invoice":t.checked?"yes":"no"})}})))),Object(i.createElement)(lt,{justify:"space-between",align:"center"},Object(i.createElement)("div",null,Object(i.createElement)(c.Button,{isLink:!0,variant:"link",onClick:t,className:"simpay-setup-wizard-subtle-link"},Object(o.__)("← Previous Step","stripe"))),Object(i.createElement)("div",{style:{display:"flex",justifyContent:"center"}},Object(i.createElement)(c.Button,{isLink:!0,variant:"link",onClick:function(){p(),n()},style:{marginRight:"16px"},className:"simpay-setup-wizard-subtle-link"},Object(o.__)("Skip Step","stripe")),Object(i.createElement)(bt,{onClick:function(){f(),n()},ref:d},Object(o.__)("Save and Continue →","stripe")))))}},{id:"next-steps",title:Object(o.__)("🎉 Setup Complete","stripe"),content:function(){return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(ut,null,Object(i.createElement)("div",{className:"simpay-setup-wizard-content-list"},Object(i.createElement)("div",{className:"simpay-setup-wizard-content-list__content"},Object(i.createElement)("p",null,Object(o.__)("Congratulations, you’re ready to start accepting payments!","stripe")),Object(i.createElement)("p",null,Object(o.__)("WP Simple Pay is just that: simple. Create your first payment form below to start collecting payments, or fine-tune your setup through some of these suggestions:","stripe"))),Object(i.createElement)("div",{className:"simpay-setup-wizard-content-list__list"},Object(i.createElement)("ul",{className:"simpay-setup-wizard-bullet-list"},Object(i.createElement)("li",null,Object(i.createElement)("a",{href:bn,target:"_blank",rel:"noopener noreferrer"},Object(o.__)("Collect tax or GST","stripe"))),Object(i.createElement)("li",null,Object(i.createElement)("a",{href:yn,target:"_blank",rel:"noopener noreferrer"},Object(o.__)("Add anti-spam protection","stripe"))),Object(i.createElement)("li",null,Object(i.createElement)("a",{href:hn,target:"_blank",rel:"noopener noreferrer"},Object(o.__)("Change the default currency","stripe"))),Object(i.createElement)("li",null,Object(i.createElement)("a",{href:gn,target:"_blank",rel:"noopener noreferrer"},Object(o.__)("Customize receipts","stripe")))))),Object(i.createElement)("hr",null),Object(i.createElement)("div",{className:"simpay-setup-wizard-doc-suggestions"},Object(i.createElement)("div",null,Object(i.createElement)("h3",null,Object(o.__)("Accept Donations","stripe")),Object(i.createElement)("p",null,Object(o.__)("Easily fundraise or accept donations online via 135+ supported currencies. Offer one-time or recurring donations of fixed or user-defined amounts.","stripe")),Object(i.createElement)(c.Button,{href:vn,variant:"secondary",isSecondary:!0,target:"_blank",rel:"noopener noreferrer"},Object(o.__)("View Walkthrough","stripe"))),Object(i.createElement)("div",null,Object(i.createElement)("h3",null,Object(o.__)("Reconcile Invoices","stripe")),Object(i.createElement)("p",null,Object(o.__)("Collect additional custom data on your payment forms such as an Invoice ID to reconcile invoices against your own invoicing system.","stripe")),Object(i.createElement)(c.Button,{href:On,variant:"secondary",isSecondary:!0,target:"_blank",rel:"noopener noreferrer"},Object(o.__)("View Walkthrough","stripe"))))),Object(i.createElement)(lt,{justify:"space-between",align:"center"},Object(i.createElement)("div",{style:{flexBasis:"100%"}},Object(i.createElement)(c.Button,{isLink:!0,variant:"link",href:fn,className:"simpay-setup-wizard-subtle-link",icon:Object(i.createElement)(f.a,{icon:rn})},Object(o.__)("Return to Dashboard","stripe"))),Object(i.createElement)(c.Flex,{justify:"flex-end",gap:4},Object(i.createElement)(bt,{href:dn},Object(o.__)("Create a Payment Form →","stripe")))))}}],lite:[{id:"stripe",title:Object(o.__)("Connect to Stripe","stripe"),content:wn},{id:"analytics",title:Object(o.__)("Help Improve WP Simple Pay + Smart Recommendations","stripe"),content:function(e){var t=e.goPrev,n=e.goNext,r=Wt(),s=r.settings,l=r.rawSettings,p=r.discardChanges,b=r.editSettings,y=r.saveSettings,h=Object(i.useState)(!0),g=a()(h,2),v=g[0],O=g[1],j=Object(i.useState)(Ht),_=a()(j,2),x=_[0],w=_[1],E=Object(i.useState)(!1),S=a()(E,2),k=S[0],C=S[1],P=Object(i.useState)(!1),z=a()(P,2),A=z[0],M=z[1],N=Object(i.useRef)();return Object(i.useLayoutEffect)((function(){N.current&&N.current.focus()}),[l]),Object(u.isEmpty)(s)?Object(i.createElement)(ut,null,Object(i.createElement)(c.Spinner,null)):Object(i.createElement)(i.Fragment,null,Object(i.createElement)(ut,null,Object(i.createElement)("p",null,Object(o.__)("Get helpful suggestions from WP Simple Pay on how to optimize your payment forms and grow your business or increase donations.","stripe")),Object(i.createElement)(c.TextControl,{label:Object(o.__)("Your Email Address:","stripe"),value:x,className:"simpay-setup-wizard-large-input",onChange:function(e){return w(e)},help:Object(o.__)("Your email is needed so you receive recommendations.","stripe"),ref:N,disabled:k}),Object(i.createElement)("hr",null),Object(i.createElement)(Xe,null,Object(i.createElement)(Qe,null,Object(o.__)("Help make WP Simple Pay better for everyone","stripe"),Object(i.createElement)("div",null,A&&Object(i.createElement)(Ke,{position:"top center"},Object(o.__)("By allowing us to track usage data we can better help you because we know which WordPress configurations, themes, and plugins we should test.","stripe")),Object(i.createElement)(f.a,{size:20,icon:d.a,onMouseEnter:function(){return M(!0)},onMouseLeave:function(){return M(!1)}}))),Object(i.createElement)(Je,{label:Object(o.__)("Yes, count me in","stripe"),id:"email_payment-confirmation",checked:v,disabled:k,onChange:function(e){O(e)}}))),Object(i.createElement)(lt,{justify:"space-between",align:"center"},Object(i.createElement)("div",null,Object(i.createElement)(c.Button,{isLink:!0,variant:"link",onClick:t,className:"simpay-setup-wizard-subtle-link",disabled:k},Object(o.__)("← Previous Step","stripe"))),Object(i.createElement)("div",{style:{display:"flex",justifyContent:"center"}},Object(i.createElement)(c.Button,{isLink:!0,variant:"link",onClick:function(){p(),n()},style:{marginRight:"16px"},className:"simpay-setup-wizard-subtle-link",disabled:k},Object(o.__)("Skip Step","stripe")),Object(i.createElement)(bt,{onClick:function(){C(!0),b({usage_tracking_opt_in:v?"yes":"no"}),y();var e=new FormData;e.append("action","simpay_setup_wizard_subscribe_email"),e.append("nonce",Gt),e.append("email",x),m()({url:qt,method:"POST",body:e}).finally((function(){C(!1),n()}))},isBusy:k,disabled:k},Object(o.__)("Save and Continue →","stripe")))))}},{id:"next-steps",title:Object(o.__)("🎉 Setup Complete","stripe"),content:function(){return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(ut,null,Object(i.createElement)(c.Flex,{justify:"space-between",align:"center",className:"simpay-setup-wizard-content-list"},Object(i.createElement)("div",{className:"simpay-setup-wizard-content-list__content"},Object(i.createElement)("p",null,Object(o.__)("Congratulations, you’re ready to start easily and securely accepting payments with WP Simple Pay!","stripe"))),Object(i.createElement)("div",null,Object(i.createElement)(bt,{href:ln},Object(o.__)("Create a Payment Form →","stripe")))),Object(i.createElement)("hr",null),Object(i.createElement)(an,null,Object(i.createElement)("h4",null,Object(o.__)("Special Upgrade Offer - Save 50%","stripe")),Object(i.createElement)("h3",null,Object(o.__)("Upgrade to WP Simple Pay Pro Today and Save","stripe")),Object(i.createElement)(cn,{className:"simpay-setup-wizard-check-list"},pn.map((function(e){return Object(i.createElement)("li",{key:e},Object(i.createElement)(f.a,{icon:wt.a}),e)}))),Object(i.createElement)(c.Button,{isLarge:!0,isSecondary:!0,variant:"secondary",href:un,target:"_blank",rel:"noopener noreferrer"},Object(o.__)("Upgrade to WP Simple Pay Pro","stripe")))),Object(i.createElement)(lt,{justify:"center"},Object(i.createElement)(c.Button,{isLink:!0,variant:"link",href:sn,className:"simpay-setup-wizard-subtle-link",icon:Object(i.createElement)(f.a,{icon:rn})},Object(o.__)("Return to Dashboard","stripe"))))}}]},Cn=simpaySetupWizard,Pn=Cn.license,zn=Cn.adminUrl,An=Pn.is_lite;Object(i.render)(Object(i.createElement)((function(){var e=kn[!0===An?"lite":"pro"],t=Object(s.getQueryArg)(window.location.href,"step"),n=Object(i.useState)(Pn),r=a()(n,2),u=r[0],p=r[1],m=function(e){var t=e.steps,n=e.currentStepId,r=t.findIndex((function(e){return e.id===n}))||0,c=Object(i.useState)(r),o=a()(c,2),l=o[0],u=o[1];function p(e){u(e),window.history.pushState({},"",Object(s.addQueryArgs)(window.location.href,{step:t[e].id}))}return Object(i.useEffect)((function(){var e=function(){var e=Object(s.getQueryArg)(window.location.search,"step"),n=t.findIndex((function(t){return t.id===e}))||0;u(n)};return window.addEventListener("popstate",e),window.addEventListener("pushstate",e),function(){window.removeEventListener("popstate",e),window.removeEventListener("pushstate",e)}}),[]),{currentStep:l,setCurrentStep:u,hasNext:l0}}({steps:e,currentStepId:t}),f=m.currentStep,d=m.goNext,b=m.goPrev,y=m.hasNext,h=m.hasPrev;if(-1===f)return Object(i.createElement)(Sn,{steps:e,goNext:d});var g=e[f],v=g.content;return Object(i.createElement)(c.SlotFillProvider,null,Object(i.createElement)(l.EntityProvider,{kind:"root",type:"site"},Object(i.createElement)(Nt,null,Object(i.createElement)("a",{href:zn},Object(i.createElement)(yt,{width:"250px"})),Object(i.createElement)(zt,{current:f+1,total:e.length}),Object(i.createElement)(ot,{isRounded:!0},Object(i.createElement)(st,{supTitle:Object(o.sprintf)(/* translators: %1$d current step count. %2$d total step count*/ +!function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.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 a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));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=75)}([function(e,t){e.exports=window.wp.element},,function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wp.components},,function(e,t){e.exports=window.React},function(e,t,n){var r=n(26),a=n(27),i=n(21),c=n(28);e.exports=function(e,t){return r(e)||a(e,t)||i(e,t)||c()},e.exports.__esModule=!0,e.exports.default=e.exports},,,function(e,t){e.exports=window.wp.primitives},function(e,t){e.exports=window.wp.url},function(e,t,n){var r=n(30);e.exports=function(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=window.lodash},,function(e,t,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function a(){for(var e=[],t=0;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i},e.exports.__esModule=!0,e.exports.default=e.exports},,,,,,,,function(e,t){e.exports=window.wp.notices},function(e,t,n){"use strict";e.exports=n(62)},function(e,t,n){"use strict";var r="function"==typeof Symbol&&Symbol.for,a=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,c=r?Symbol.for("react.fragment"):60107,o=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,p=r?Symbol.for("react.async_mode"):60111,m=r?Symbol.for("react.concurrent_mode"):60111,f=r?Symbol.for("react.forward_ref"):60112,d=r?Symbol.for("react.suspense"):60113,b=r?Symbol.for("react.suspense_list"):60120,y=r?Symbol.for("react.memo"):60115,h=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,j=r?Symbol.for("react.scope"):60119;function _(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case a:switch(e=e.type){case p:case m:case c:case s:case o:case d:return e;default:switch(e=e&&e.$$typeof){case u:case f:case h:case y:case l:return e;default:return t}}case i:return t}}}function x(e){return _(e)===m}t.AsyncMode=p,t.ConcurrentMode=m,t.ContextConsumer=u,t.ContextProvider=l,t.Element=a,t.ForwardRef=f,t.Fragment=c,t.Lazy=h,t.Memo=y,t.Portal=i,t.Profiler=s,t.StrictMode=o,t.Suspense=d,t.isAsyncMode=function(e){return x(e)||_(e)===p},t.isConcurrentMode=x,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===a},t.isForwardRef=function(e){return _(e)===f},t.isFragment=function(e){return _(e)===c},t.isLazy=function(e){return _(e)===h},t.isMemo=function(e){return _(e)===y},t.isPortal=function(e){return _(e)===i},t.isProfiler=function(e){return _(e)===s},t.isStrictMode=function(e){return _(e)===o},t.isSuspense=function(e){return _(e)===d},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===c||e===m||e===s||e===o||e===d||e===b||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===y||e.$$typeof===l||e.$$typeof===u||e.$$typeof===f||e.$$typeof===v||e.$$typeof===O||e.$$typeof===j||e.$$typeof===g)},t.typeOf=_},function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r=0||(a[n]=e[n]);return a},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";var r=n(0),a=n(9);const i=Object(r.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(a.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}));t.a=i},function(e,t,n){"use strict";var r=n(0),a=n(9);const i=Object(r.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(a.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"}));t.a=i},,,,,,,,,,function(e,t,n){"use strict";n.r(t);var r=n(6),a=n.n(r),i=n(0),c=(n(60),n(3)),o=n(2),s=n(10),l=n(37),u=n(12),p=n(24),m=n.n(p),f=n(44),d=n(65),b=n(18),y=n.n(b),h=n(15),g=n.n(h),v=n(5);function O(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var j=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|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|enterKeyHint|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|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|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)-.*))$/,_=O((function(e){return j.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}));function x(){return(x=Object.assign?Object.assign.bind():function(e){for(var t=1;t2||J(V)>3?"":" "}function ae(e,t){for(;--t&&Y()&&!(V<48||V>102||V>57&&V<65||V>70&&V<97););return K(e,Q()+(t<6&&32==X()&&32==Y()))}function ie(e,t){for(;Y()&&e+V!==57&&(e+V!==84||47!==X()););return"/*"+K(t,Z-1)+"*"+A(47===e?e:Y())}function ce(e){for(;!J(X());)Y();return K(e,Z)}function oe(e,t,n,r,a,i,c,o,s,l,u){for(var p=a-1,m=0===a?i:[""],f=D(m),d=0,b=0,y=0;d0?m[h]+" "+g:$(g,/&\f/g,m[h])))&&(s[y++]=v);return G(e,t,n,0===a?k:o,s,l,u)}function se(e,t,n){return G(e,t,n,S,A(V),F(e,2,-2),0)}function le(e,t,n,r){return G(e,t,n,C,F(e,0,r),F(e,r+1,-1),r)}function ue(e,t){for(var n="",r=D(e),a=0;a-1&&!e.return)switch(e.type){case C:e.return=function e(t,n){switch(a=n,45^T(r=t,0)?(((a<<2^T(r,0))<<2^T(r,1))<<2^T(r,2))<<2^T(r,3):0){case 5103:return E+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return E+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return E+t+"-moz-"+t+"-ms-"+t+t;case 6828:case 4268:return E+t+"-ms-"+t+t;case 6165:return E+t+"-ms-flex-"+t+t;case 5187:return E+t+$(t,/(\w+).+(:[^]+)/,E+"box-$1$2-ms-flex-$1$2")+t;case 5443:return E+t+"-ms-flex-item-"+$(t,/flex-|-self/,"")+t;case 4675:return E+t+"-ms-flex-line-pack"+$(t,/align-content|flex-|-self/,"")+t;case 5548:return E+t+"-ms-"+$(t,"shrink","negative")+t;case 5292:return E+t+"-ms-"+$(t,"basis","preferred-size")+t;case 6060:return E+"box-"+$(t,"-grow","")+E+t+"-ms-"+$(t,"grow","positive")+t;case 4554:return E+$(t,/([^-])(transform)/g,"$1"+E+"$2")+t;case 6187:return $($($(t,/(zoom-|grab)/,E+"$1"),/(image-set)/,E+"$1"),t,"")+t;case 5495:case 3959:return $(t,/(image-set\([^]*)/,E+"$1$`$1");case 4968:return $($(t,/(.+:)(flex-)?(.*)/,E+"box-pack:$3-ms-flex-pack:$3"),/s.+-b[^;]+/,"justify")+E+t+t;case 4095:case 3583:case 4068:case 2532:return $(t,/(.+)-inline(.+)/,E+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(L(t)-1-n>6)switch(T(t,n+1)){case 109:if(45!==T(t,n+4))break;case 102:return $(t,/(.+:)(.+)-([^]+)/,"$1"+E+"$2-$3$1-moz-"+(108==T(t,n+3)?"$3":"$2-$3"))+t;case 115:return~R(t,"stretch")?e($(t,"stretch","fill-available"),n)+t:t}break;case 4949:if(115!==T(t,n+1))break;case 6444:switch(T(t,L(t)-3-(~R(t,"!important")&&10))){case 107:return $(t,":",":"+E)+t;case 101:return $(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+E+(45===T(t,14)?"inline-":"")+"box$3$1"+E+"$2$3$1-ms-$2box$3")+t}break;case 5936:switch(T(t,n+11)){case 114:return E+t+"-ms-"+$(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return E+t+"-ms-"+$(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return E+t+"-ms-"+$(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return E+t+"-ms-"+t+t}var r,a;return t}(e.value,e.length);break;case P:return ue([q(e,{value:$(e.value,"@","@"+E)})],r);case k:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch((n=/(::plac\w+|:read-\w+)/.exec(n=t))?n[0]:n){case":read-only":case":read-write":return ue([q(e,{props:[$(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return ue([q(e,{props:[$(t,/:(plac\w+)/,":"+E+"input-$1")]}),q(e,{props:[$(t,/:(plac\w+)/,":-moz-$1")]}),q(e,{props:[$(t,/:(plac\w+)/,"-ms-input-$1")]})],r)}var n;return""}))}}],ge=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var r,a,i=e.stylisPlugins||he,c={},o=[];r=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n0&&L(w)-m&&B(d>32?le(w+";",a,r,m-1):le($(w," ","")+";",a,r,m-2),l);break;case 59:w+=";";default:if(B(x=oe(w,n,r,u,p,i,s,O,j=[],_=[],m),c),123===v)if(0===p)e(w,n,x,x,j,c,m,s,_);else switch(99===f&&110===T(w,3)?100:f){case 100:case 108:case 109:case 115:e(t,x,x,a&&B(oe(t,x,x,0,0,i,s,O,i,j=[],m),_),i,_,m,s,a?j:_);break;default:e(w,x,x,x,[""],_,0,s,_)}}u=p=d=0,y=g=1,O=w="",m=o;break;case 58:m=1+L(w),d=b;default:if(y<1)if(123==v)--y;else if(125==v&&0==y++&&125==(V=Z>0?T(H,--Z):0,W--,10===V&&(W=1,U--),V))continue;switch(w+=A(v),v*y){case 38:g=p>0?1:(w+="\f",-1);break;case 44:s[u++]=(L(w)-1)*g,g=1;break;case 64:45===X()&&(w+=ne(Y())),f=X(),p=m=L(O=w+=ce(Q())),v++;break;case 45:45===b&&2==L(w)&&(y=0)}}return c}("",null,null,null,[""],e=ee(e),0,[0],e))}(e?e+"{"+t.styles+"}":t.styles),p),r&&(m.inserted[t.name]=!0)};var m={key:t,sheet:new w({key:t,container:r,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:c,registered:{},insert:a};return m.sheet.hydrate(o),m};function ve(e,t,n){var r="";return n.split(" ").forEach((function(n){void 0!==e[n]?t.push(e[n]+";"):r+=n+" "})),r}n(51);var Oe=function(e,t,n){!function(e,t,n){var r=e.key+"-"+t.name;!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles)}(e,t,n);var r=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var a=t;do{e.insert(t===a?"."+r:"",a,e.sheet,!0),a=a.next}while(void 0!==a)}},je={animationIterationCount:1,aspectRatio: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},_e=/[A-Z]|^ms/g,xe=/_EMO_([^_]+?)_([^]*?)_EMO_/g,we=function(e){return 45===e.charCodeAt(1)},Ee=function(e){return null!=e&&"boolean"!=typeof e},Se=O((function(e){return we(e)?e:e.replace(_e,"-$&").toLowerCase()})),ke=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(xe,(function(e,t,n){return Pe={name:t,styles:n,next:Pe},t}))}return 1===je[e]||we(e)||"number"!=typeof t||0===t?t:t+"px"};function Ce(e,t,n){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 Pe={name:n.name,styles:n.styles,next:Pe},n.name;if(void 0!==n.styles){var r=n.next;if(void 0!==r)for(;void 0!==r;)Pe={name:r.name,styles:r.styles,next:Pe},r=r.next;return n.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var a=0;a=4;++r,a-=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(a){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)}(a)+s,styles:a,next:Pe}},Me=(!!v.useInsertionEffect&&v.useInsertionEffect||v.useLayoutEffect,v.createContext("undefined"!=typeof HTMLElement?ge({key:"css"}):null));Me.Provider;var Ne=function(e){return Object(v.forwardRef)((function(t,n){var r=Object(v.useContext)(Me);return e(t,r,n)}))},$e=v.createContext({}),Re=_,Te=function(e){return"theme"!==e},Fe=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?Re:Te},Le=function(e,t,n){var r;if(t){var a=t.shouldForwardProp;r=e.__emotion_forwardProp&&a?function(t){return e.__emotion_forwardProp(t)&&a(t)}:a}return"function"!=typeof r&&n&&(r=e.__emotion_forwardProp),r},De=function(){return null},Be=function e(t,n){var r,a,i=t.__emotion_real===t,c=i&&t.__emotion_base||t;void 0!==n&&(r=n.label,a=n.target);var o=Le(t,n,i),s=o||Fe(c),l=!s("as");return function(){var u=arguments,p=i&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==r&&p.push("label:"+r+";"),null==u[0]||void 0===u[0].raw)p.push.apply(p,u);else{p.push(u[0][0]);for(var m=u.length,f=1;f div {\n\t\tmargin-left: 8px;\n\t}\n\n\tsvg {\n\t\tdisplay: block;\n\n\t\t&:hover {\n\t\t\tcursor: pointer;\n\t\t}\n\t}\n"]))),Ke=Ye(c.Popover)(Ie||(Ie=y()(["\n\t.components-popover__content {\n\t\tpadding: 20px;\n\t\twidth: 200px;\n\t}\n"]))),Je=Ye(c.ToggleControl)(Ze||(Ze=y()(["\n\t&& {\n\t\t.components-base-control__field {\n\t\t\tmargin-bottom: 0;\n\t\t}\n\t}\n"]))),et=n(52),tt=n.n(et),nt=Ye(c.Card)(Ve||(Ve=y()(["\n\tpadding: 30px;\n\n\t&& {\n\t\tbox-shadow: 0 2px 6px 0 rgba( 0, 0, 0, 0.05 );\n\t\tborder: 1px solid #ccc;\n\t\twidth: 100%;\n\t}\n"]))),rt=Ye(c.CardHeader)(He||(He=y()(["\n\t&&& {\n\t\tpadding: 0 0 30px;\n\t}\n\n\th1 {\n\t\tfont-size: 26px;\n\t\tline-height: 1;\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t}\n\n\tsmall {\n\t\tcolor: #c0c0c0;\n\t\tfont-size: 13px;\n\t\tfont-weight: normal;\n\t\tdisplay: block;\n\t\tmargin: 0 0 3px;\n\t}\n"]))),at=Ye(c.CardFooter)(Ge||(Ge=y()(["\n\t&&& {\n\t\tpadding: 30px 0 0;\n\t}\n"]))),it=Ye(c.CardBody)(qe||(qe=y()(["\n\t&&& {\n\t\tpadding: 30px 0;\n\t}\n\n\t> * {\n\t\tmargin: 0 0 2rem;\n\n\t\t&:last-child {\n\t\t\tmargin-bottom: 0;\n\t\t}\n\t}\n\n\t> p {\n\t\tcolor: #555555;\n\t\tfont-size: 15px;\n\t}\n"]))),ct=["title","supTitle","children"];function ot(e){return Object(i.createElement)(nt,e)}function st(e){var t=e.title,n=e.supTitle,r=e.children,a=tt()(e,ct);return Object(i.createElement)(rt,a,Object(i.createElement)("div",null,n&&Object(i.createElement)("small",null,n),t&&Object(i.createElement)("h1",null,t)),r)}function lt(e){return Object(i.createElement)(at,e)}function ut(e){return Object(i.createElement)(it,e)}var pt,mt=simpaySetupWizard.adminUrl;function ft(e){var t=e.isFirst,n=Object(i.useState)(!1),r=a()(n,2),s=r[0],l=r[1];return Object(i.createElement)(c.Flex,{justify:"center"},s&&Object(i.createElement)(c.Modal,{title:Object(o.__)("Are you sure you want to exit the wizard?","stripe"),onRequestClose:function(){return l(!1)}},Object(i.createElement)("p",{style:{marginBottom:"2rem"}},Object(o.__)("Manual setup is only recommended for experienced users.","stripe")),Object(i.createElement)(c.Flex,null,Object(i.createElement)(c.Button,{href:mt,isDestructive:!0,variant:"destructive"},Object(o.__)("Exit Setup Wizard","stripe")),Object(i.createElement)(c.Button,{variant:"primary",isPrimary:!0,onClick:function(){return l(!1)}},Object(o.__)("Continue Setup","stripe")))),Object(i.createElement)(c.Button,{isLink:!0,variant:"link",className:"simpay-setup-wizard-subtle-link",onClick:function(){return l(!0)}},t?Object(o.__)("Go back to the Dashboard","stripe"):Object(o.__)("Close and exit the Setup Wizard","stripe")))}var dt=Ye(c.Button)(pt||(pt=y()(["\n\t&& {\n\t\tfont-size: 16px;\n\t\tfont-weight: bold;\n\t\tpadding: 15px 30px !important;\n\t\theight: auto;\n\t}\n"]))),bt=Object(i.forwardRef)((function(e,t){return Object(i.createElement)(dt,g()({isPrimary:!0,variant:"primary"},e,{ref:t}))}));function yt(e){return e.width,Object(i.createElement)("svg",{width:"311",height:"41",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(i.createElement)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.352 0C1.052 0 0 1.02 0 2.277v30.746C0 34.281 1.053 35.3 2.352 35.3h28.806c.975 0 1.764-.764 1.764-1.708 0-.943-.79-1.708-1.763-1.708H5.29c-.974 0-1.764-.765-1.764-1.708v-17.08c0-.944.79-1.709 1.764-1.709h44.092c1.299 0 2.352-1.02 2.352-2.277V2.277C51.735 1.02 50.682 0 49.383 0H2.352Zm55.262 24.198h-1.47v-1.993c0-4.088-3.422-7.402-7.643-7.402-4.22 0-7.642 3.314-7.642 7.402v1.993H38.8c-1.299 0-2.352 1.02-2.352 2.277v11.387c0 1.258 1.053 2.278 2.352 2.278h18.813c1.299 0 2.351-1.02 2.351-2.278V26.475c0-1.258-1.053-2.277-2.351-2.277Zm-4.997-1.993v1.993h-8.23v-1.993c0-2.201 1.842-3.985 4.114-3.985 2.273 0 4.116 1.784 4.116 3.985ZM8.23 20.497c0-.629.526-1.139 1.175-1.139H28.22c.65 0 1.176.51 1.176 1.139s-.527 1.139-1.176 1.139H9.406c-.649 0-1.175-.51-1.175-1.139Zm0 5.124c0-.629.526-1.138 1.175-1.138h7.055c.65 0 1.176.51 1.176 1.138 0 .63-.527 1.139-1.176 1.139H9.406c-.649 0-1.175-.51-1.175-1.139Zm31.158 11.672V27.045h17.637v10.248H39.389Z",fill:"#428BCA"}),Object(i.createElement)("path",{d:"M81.08 30.745h5.288l5.41-17.186 5.596 17.187h5.289l7.84-24.29h-5.288l-5.289 17.956L94.7 6.457h-5.842L83.785 24.38 78.528 6.457h-5.289l7.84 24.288Zm31.511 0h4.796v-8.793h6.456c5.319 0 8.302-3.228 8.302-7.963 0-4.735-2.983-7.532-8.302-7.532h-11.252v24.288Zm4.796-13.405V11.1h5.288c2.952 0 4.52 1.168 4.52 3.104 0 1.968-1.507 3.136-4.366 3.136h-5.442Zm35.473 13.897c6.303 0 10.023-3.197 10.023-7.747 0-10.3-14.789-4.581-14.789-10.085 0-1.906 1.599-3.013 4.52-3.013 2.859 0 4.519 1.322 4.704 3.567h5.288c0-4.92-4.089-7.994-9.9-7.994-5.872 0-9.562 2.89-9.562 7.502 0 10.268 14.758 4.642 14.758 10.084 0 1.998-1.752 3.26-4.919 3.26-3.228 0-5.073-1.6-5.165-4.305h-5.381c0 5.503 4.274 8.731 10.423 8.731Zm15.137-18.447c1.66 0 2.89-1.23 2.89-2.89 0-1.66-1.23-2.829-2.89-2.829-1.691 0-2.921 1.169-2.921 2.83 0 1.66 1.23 2.89 2.921 2.89Zm-2.306 17.956h4.581V14.758h-4.581v15.988Zm7.696-.001h4.55v-8.178c0-2.644 1.384-4.366 3.597-4.366 1.968 0 3.136 1.415 3.136 3.751v8.793h4.612v-8.178c0-2.644 1.384-4.366 3.597-4.366 1.968 0 3.136 1.415 3.136 3.751v8.793h4.643v-9.039c0-4.888-1.968-7.44-5.965-7.44-2.459 0-4.642.86-6.21 3.044-.892-2.03-2.583-3.044-5.135-3.044-2.552 0-4.335 1.076-5.411 2.798v-2.306h-4.55v15.988Zm30.183 6.15h4.551v-8.24c1.106 1.63 2.859 2.582 5.38 2.582 4.028 0 6.887-3.504 6.887-8.424 0-5.011-2.859-8.547-6.887-8.547-2.521 0-4.274.953-5.38 2.583v-2.091h-4.551v22.137Zm8.363-9.593c-2.244 0-3.843-1.875-3.843-4.52 0-2.674 1.599-4.58 3.843-4.58 2.275 0 3.874 1.906 3.874 4.58 0 2.645-1.599 4.52-3.874 4.52Zm10.651 3.443h4.551V6.457h-4.551v24.288Zm15.443.492c3.905 0 6.918-2.213 7.41-5.688h-4.551c-.184 1.107-1.229 1.968-2.828 1.968-2.368 0-3.536-1.353-3.751-3.412h11.222v-1.476c0-5.104-3.259-8.363-7.502-8.363-4.919 0-8.363 3.505-8.363 8.455 0 4.98 3.444 8.516 8.363 8.516Zm-3.689-9.93c.276-1.845 1.352-3.106 3.505-3.106 1.937 0 3.013 1.322 3.105 3.106h-6.61Zm22.358 9.438h4.796v-8.793h6.457c5.319 0 8.301-3.228 8.301-7.963 0-4.735-2.982-7.532-8.301-7.532h-11.253v24.288Zm4.796-13.405V11.1h5.288c2.952 0 4.52 1.168 4.52 3.104 0 1.968-1.507 3.136-4.366 3.136h-5.442Zm20.704 13.897c2.736 0 4.458-1.23 5.257-3.228.4 2.183 2.152 3.413 5.688 2.613v-3.259c-1.261.123-1.507-.338-1.507-1.66v-5.411c0-3.782-2.644-6.026-7.317-6.026-4.612 0-7.317 2.275-7.317 6.118h4.488c0-1.383 1.015-2.183 2.768-2.183 1.906 0 2.859.769 2.828 2.091v.492l-3.659.43c-4.519.523-7.071 2.368-7.071 5.258 0 2.429 1.722 4.765 5.842 4.765Zm.922-3.382c-1.414 0-2.183-.645-2.183-1.63 0-1.167 1.507-1.629 4.397-1.998l1.568-.153c-.277 2.152-1.599 3.781-3.782 3.781Zm11.126 9.04h1.967c3.936 0 6.641-1.077 8.271-4.981L311 14.758h-4.766l-3.996 10.669-4.797-10.67h-4.796l7.225 16.234c-1.014 1.446-2.06 1.907-4.058 1.876h-1.568v4.028Z",fill:"#428BCA"}))}var ht=n(17);function gt(e){var t=Object(ht.useSelect)((function(e){return Object(u.filter)(e("core/notices").getNotices(),{type:"snackbar"})}),[]),n=Object(ht.useDispatch)("core/notices").removeNotice;return 0===t.length?null:Object(i.createElement)(c.SnackbarList,g()({onRemove:n,notices:t},e))}var vt,Ot,jt,_t,xt,wt=n(64),Et=Ye.div(vt||(vt=y()(["\n\tmax-width: 80%;\n\tdisplay: flex;\n\talign-items: center;\n\n\t> * {\n\t\tmargin-right: 8px;\n\n\t\t&:last-child {\n\t\t\tmargin-right: 0;\n\t\t}\n\t}\n"]))),St={current:"var(--wp-admin-theme-color)",complete:"var(--wp-admin-theme-color)",incomplete:"#c0c0c0"},kt=Ye.div(Ot||(Ot=y()(["\n\twidth: 16px;\n\theight: 16px;\n\tborder-radius: 50%;\n\tbackground-color: ",";\n\tflex-shrink: 0;\n\tposition: relative;\n\ttransition: backgroundColor 0.2s ease-in-out;\n\n\tsvg {\n\t\tfill: #fff;\n\t\tposition: absolute;\n\t\tleft: -1px;\n\t\ttop: -1px;\n\t\ttransition: opacity 0.2s ease-in-out;\n\t\topacity: ",";\n\t}\n\n\tdiv {\n\t\topacity: ",";\n\t}\n\n\tpath {\n\t\tstroke: #fff;\n\t}\n"])),(function(e){return St[e.status]}),(function(e){return e.isComplete?"1":"0"}),(function(e){var t=e.isCurrent,n=e.isComplete;return t&&!n?"1":"0"})),Ct=Ye.div(jt||(jt=y()(["\n\twidth: 6px;\n\theight: 6px;\n\tbackground-color: #f0f0f1;\n\tborder-radius: 50%;\n\tposition: absolute;\n\ttop: 5px;\n\tleft: 5px;\n\ttransition: opacity 0.2s ease-in-out;\n"]))),Pt=Ye.div(_t||(_t=y()(["\n\twidth: 100%;\n\theight: 2px;\n\tbackground-color: rgba( 192, 192, 192, 0.5 );\n\twidth: 100px;\n"])));function zt(e){for(var t=e.current,n=e.total,r=[],a=1;a<=n;a++){var c="incomplete";a * {\n\t\tmargin: 25px 0;\n\t}\n"])));function Nt(e){return Object(i.createElement)(Mt,e)}var $t=Ye(c.Button)(At||(At=y()(["\n\t&&&& {\n\t\tfont-size: 16px;\n\t\tfont-weight: bold;\n\t\tpadding: 13px 30px 12px !important;\n\t\theight: auto;\n\t\tbackground-color: #635bff;\n\n\t\t&:focus {\n\t\t\tbackground-color: #635bff;\n\t\t\tbox-shadow: inset 0 0 0 1px #fff,\n\t\t\t\t0 0 0 var( --wp-admin-border-width-focus ) #635bff;\n\t\t}\n\n\t\t&:hover {\n\t\t\tbackground-color: #0a2540 !important;\n\t\t}\n\n\t\t&:focus:hover {\n\t\t\tbox-shadow: inset 0 0 0 1px #fff,\n\t\t\t\t0 0 0 var( --wp-admin-border-width-focus ) #0a2540;\n\t\t}\n\n\t\tsvg {\n\t\t\tmargin-left: 5px;\n\t\t}\n\t}\n"]))),Rt=Object(i.forwardRef)((function(e,t){return Object(i.createElement)($t,g()({isPrimary:!0,variant:"primary"},e,{ref:t}))}));function Tt(){return Object(i.createElement)("svg",{width:56,height:23,fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(i.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M55.742 11.884c0-3.93-1.92-7.032-5.59-7.032-3.684 0-5.914 3.101-5.914 7.001 0 4.622 2.632 6.955 6.41 6.955 1.843 0 3.236-.414 4.29-.998v-3.07c-1.053.522-2.261.844-3.794.844-1.502 0-2.834-.522-3.004-2.334h7.572c0-.2.03-.998.03-1.366Zm-7.649-1.459c0-1.735 1.069-2.456 2.044-2.456.945 0 1.951.721 1.951 2.456h-3.995Zm-9.832-5.573c-1.517 0-2.493.706-3.035 1.197l-.201-.952h-3.407V23l3.871-.814.016-4.345c.557.4 1.378.967 2.74.967 2.772 0 5.296-2.21 5.296-7.078-.015-4.452-2.57-6.878-5.28-6.878Zm-.929 10.579c-.913 0-1.456-.323-1.827-.722l-.016-5.696c.403-.446.96-.753 1.843-.753 1.41 0 2.385 1.566 2.385 3.578 0 2.057-.96 3.593-2.385 3.593ZM26.292 3.946l3.886-.83V0l-3.886.814v3.132Zm0 1.167h3.886v13.434h-3.886V5.113Zm-4.165 1.136-.248-1.136h-3.345v13.434h3.871V9.443c.914-1.183 2.462-.968 2.942-.799V5.113c-.495-.184-2.307-.522-3.22 1.136Zm-7.742-4.468-3.778.798-.016 12.299c0 2.272 1.719 3.946 4.01 3.946 1.27 0 2.2-.23 2.71-.507V15.2c-.495.2-2.942.906-2.942-1.366v-5.45h2.942V5.112H14.37l.016-3.332ZM3.917 9.013c0-.6.496-.83 1.317-.83 1.176 0 2.663.354 3.84.983V5.558c-1.286-.507-2.555-.706-3.84-.706C2.09 4.852 0 6.479 0 9.197c0 4.238 5.884 3.562 5.884 5.39 0 .705-.62.936-1.487.936-1.285 0-2.926-.522-4.227-1.229v3.655c1.44.614 2.896.875 4.227.875 3.221 0 5.435-1.582 5.435-4.33-.015-4.575-5.915-3.762-5.915-5.481Z",fill:"#fff"}))}var Ft=n(11),Lt=n.n(Ft);function Dt(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 Bt(e){for(var t=1;tWP Simple Pay account or purchase receipt email.","stripe"),{strong:Object(i.createElement)("strong",null),a:Object(i.createElement)("a",{href:Jt,target:"_blank",rel:"noopener noreferrer"})})),Object(i.createElement)(c.TextControl,{label:Object(o.__)("License Key","stripe"),value:l,className:_,onChange:function(e){return u(e)},disabled:d,help:g||Object(o.__)("An active license ensures automatic updates and the latest features.","stripe"),ref:j})),Object(i.createElement)(lt,{justify:"flex-end",align:"center"},Object(i.createElement)(bt,{onClick:function(){b(!0);var e=new FormData;e.append("action","simpay_activate_license"),e.append("nonce",en),e.append("license",l),m()({url:Kt,method:"POST",body:e}).then((function(e){var r=e.success,a=e.data,i=a.message,c=a.license;if(!r)throw{message:i};n(c),O(Object(o.__)("License activated","stripe"),{type:"snackbar"}),b(!1),t()})).catch((function(e){var t=e.message;v(t),b(!1)}))},disabled:""===l||d,isBusy:d},Object(o.__)("Activate and Continue →","stripe"))))}},{id:"stripe",title:Object(o.__)("Connect to Stripe","stripe"),content:wn},{id:"emails",title:Object(o.__)("Configure Emails","stripe"),content:function(e){var t=e.goPrev,n=e.goNext,r=e.licenseData,a=Wt(),s=a.settings,l=a.rawSettings,p=a.discardChanges,m=a.editSettings,f=a.saveSettings,d=Object(i.useRef)();if(Object(i.useLayoutEffect)((function(){d.current&&d.current.focus()}),[l]),Object(u.isEmpty)(s))return Object(i.createElement)(ut,null,Object(i.createElement)(c.Spinner,null));var b=s["email_payment-confirmation"],y=s["email_payment-notification"],h=s["email_payment-notification_to"],g=s["email_upcoming-invoice"],v=s["email_invoice-confirmation"],O=r.features,j=O.subscriptions,_=O.enhanced_subscriptions;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(ut,null,Object(i.createElement)("ul",{className:"simpay-setup-wizard-toggle-list"},Object(i.createElement)("li",null,Object(i.createElement)("label",{htmlFor:"email_payment-confirmation"},Object(i.createElement)("h3",null,Object(o.__)("Payment Receipt","stripe")),Object(i.createElement)("p",null,Object(o.__)("Send a payment receipt email to the customer upon successful payment.","stripe"))),Object(i.createElement)(c.FormToggle,{id:"email_payment-confirmation",checked:"no"!==b,onChange:function(e){var t=e.target;return m({"email_payment-confirmation":t.checked?"yes":"no"})}})),Object(i.createElement)("li",null,Object(i.createElement)("label",{htmlFor:"email_payment-notification"},Object(i.createElement)("h3",null,Object(o.__)("Payment Notification","stripe")),Object(i.createElement)("p",null,Object(o.__)("Receive an email notification when a new payment is made.","stripe"))),Object(i.createElement)(c.FormToggle,{id:"email_payment-notification",checked:"no"!==y,onChange:function(e){var t=e.target;return m({"email_payment-notification":t.checked?"yes":"no"})}})),"no"!==y&&Object(i.createElement)("li",{className:"simpay-setup-wizard-toggle-list__child"},Object(i.createElement)(c.TextControl,{label:Object(o.__)("Send to:","stripe"),value:h,onChange:function(e){return m({"email_payment-notification_to":e})}})),_&&Object(i.createElement)("li",null,Object(i.createElement)("label",{htmlFor:"email_invoice-confirmation"},Object(i.createElement)("h3",null,Object(o.__)("Invoice Receipt","stripe")),Object(i.createElement)("p",null,Object(o.__)("Send a payment receipt email to the customer upon successful invoice.","stripe"))),Object(i.createElement)(c.FormToggle,{id:"email_payment-confirmation",checked:"no"!==v,onChange:function(e){var t=e.target;return m({"email_invoice-confirmation":t.checked?"yes":"no"})}})),j&&Object(i.createElement)("li",null,Object(i.createElement)("label",{htmlFor:"email_upcoming-invoice"},Object(i.createElement)("h3",null,Object(o.__)("Upcoming Invoice","stripe")),Object(i.createElement)("p",null,Object(o.__)("Remind customers of upcoming invoices and allow payment method changes.","stripe"))),Object(i.createElement)(c.FormToggle,{id:"email_upcoming-invoice",checked:"no"!==g,onChange:function(e){var t=e.target;return m({"email_upcoming-invoice":t.checked?"yes":"no"})}})))),Object(i.createElement)(lt,{justify:"space-between",align:"center"},Object(i.createElement)("div",null,Object(i.createElement)(c.Button,{isLink:!0,variant:"link",onClick:t,className:"simpay-setup-wizard-subtle-link"},Object(o.__)("← Previous Step","stripe"))),Object(i.createElement)("div",{style:{display:"flex",justifyContent:"center"}},Object(i.createElement)(c.Button,{isLink:!0,variant:"link",onClick:function(){p(),n()},style:{marginRight:"16px"},className:"simpay-setup-wizard-subtle-link"},Object(o.__)("Skip Step","stripe")),Object(i.createElement)(bt,{onClick:function(){f(),n()},ref:d},Object(o.__)("Save and Continue →","stripe")))))}},{id:"next-steps",title:Object(o.__)("🎉 Setup Complete","stripe"),content:function(){return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(ut,null,Object(i.createElement)("div",{className:"simpay-setup-wizard-content-list"},Object(i.createElement)("div",{className:"simpay-setup-wizard-content-list__content"},Object(i.createElement)("p",null,Object(o.__)("Congratulations, you’re ready to start accepting payments!","stripe")),Object(i.createElement)("p",null,Object(o.__)("WP Simple Pay is just that: simple. Create your first payment form below to start collecting payments, or fine-tune your setup through some of these suggestions:","stripe"))),Object(i.createElement)("div",{className:"simpay-setup-wizard-content-list__list"},Object(i.createElement)("ul",{className:"simpay-setup-wizard-bullet-list"},Object(i.createElement)("li",null,Object(i.createElement)("a",{href:bn,target:"_blank",rel:"noopener noreferrer"},Object(o.__)("Collect tax or GST","stripe"))),Object(i.createElement)("li",null,Object(i.createElement)("a",{href:yn,target:"_blank",rel:"noopener noreferrer"},Object(o.__)("Add anti-spam protection","stripe"))),Object(i.createElement)("li",null,Object(i.createElement)("a",{href:hn,target:"_blank",rel:"noopener noreferrer"},Object(o.__)("Change the default currency","stripe"))),Object(i.createElement)("li",null,Object(i.createElement)("a",{href:gn,target:"_blank",rel:"noopener noreferrer"},Object(o.__)("Customize receipts","stripe")))))),Object(i.createElement)("hr",null),Object(i.createElement)("div",{className:"simpay-setup-wizard-doc-suggestions"},Object(i.createElement)("div",null,Object(i.createElement)("h3",null,Object(o.__)("Accept Donations","stripe")),Object(i.createElement)("p",null,Object(o.__)("Easily fundraise or accept donations online via 135+ supported currencies. Offer one-time or recurring donations of fixed or user-defined amounts.","stripe")),Object(i.createElement)(c.Button,{href:vn,variant:"secondary",isSecondary:!0,target:"_blank",rel:"noopener noreferrer"},Object(o.__)("View Walkthrough","stripe"))),Object(i.createElement)("div",null,Object(i.createElement)("h3",null,Object(o.__)("Reconcile Invoices","stripe")),Object(i.createElement)("p",null,Object(o.__)("Collect additional custom data on your payment forms such as an Invoice ID to reconcile invoices against your own invoicing system.","stripe")),Object(i.createElement)(c.Button,{href:On,variant:"secondary",isSecondary:!0,target:"_blank",rel:"noopener noreferrer"},Object(o.__)("View Walkthrough","stripe"))))),Object(i.createElement)(lt,{justify:"space-between",align:"center"},Object(i.createElement)("div",{style:{flexBasis:"100%"}},Object(i.createElement)(c.Button,{isLink:!0,variant:"link",href:fn,className:"simpay-setup-wizard-subtle-link",icon:Object(i.createElement)(f.a,{icon:rn})},Object(o.__)("Return to Dashboard","stripe"))),Object(i.createElement)(c.Flex,{justify:"flex-end",gap:4},Object(i.createElement)(bt,{href:dn},Object(o.__)("Create a Payment Form →","stripe")))))}}],lite:[{id:"stripe",title:Object(o.__)("Connect to Stripe","stripe"),content:wn},{id:"analytics",title:Object(o.__)("Help Improve WP Simple Pay + Smart Recommendations","stripe"),content:function(e){var t=e.goPrev,n=e.goNext,r=Wt(),s=r.settings,l=r.rawSettings,p=r.discardChanges,b=r.editSettings,y=r.saveSettings,h=Object(i.useState)(!0),g=a()(h,2),v=g[0],O=g[1],j=Object(i.useState)(Ht),_=a()(j,2),x=_[0],w=_[1],E=Object(i.useState)(!1),S=a()(E,2),k=S[0],C=S[1],P=Object(i.useState)(!1),z=a()(P,2),A=z[0],M=z[1],N=Object(i.useRef)();return Object(i.useLayoutEffect)((function(){N.current&&N.current.focus()}),[l]),Object(u.isEmpty)(s)?Object(i.createElement)(ut,null,Object(i.createElement)(c.Spinner,null)):Object(i.createElement)(i.Fragment,null,Object(i.createElement)(ut,null,Object(i.createElement)("p",null,Object(o.__)("Get helpful suggestions from WP Simple Pay on how to optimize your payment forms and grow your business or increase donations.","stripe")),Object(i.createElement)(c.TextControl,{label:Object(o.__)("Your Email Address:","stripe"),value:x,className:"simpay-setup-wizard-large-input",onChange:function(e){return w(e)},help:Object(o.__)("Your email is needed so you receive recommendations.","stripe"),ref:N,disabled:k}),Object(i.createElement)("hr",null),Object(i.createElement)(Xe,null,Object(i.createElement)(Qe,null,Object(o.__)("Help make WP Simple Pay better for everyone","stripe"),Object(i.createElement)("div",null,A&&Object(i.createElement)(Ke,{position:"top center"},Object(o.__)("By allowing us to track usage data we can better help you because we know which WordPress configurations, themes, and plugins we should test.","stripe")),Object(i.createElement)(f.a,{size:20,icon:d.a,onMouseEnter:function(){return M(!0)},onMouseLeave:function(){return M(!1)}}))),Object(i.createElement)(Je,{label:Object(o.__)("Yes, count me in","stripe"),id:"email_payment-confirmation",checked:v,disabled:k,onChange:function(e){O(e)}}))),Object(i.createElement)(lt,{justify:"space-between",align:"center"},Object(i.createElement)("div",null,Object(i.createElement)(c.Button,{isLink:!0,variant:"link",onClick:t,className:"simpay-setup-wizard-subtle-link",disabled:k},Object(o.__)("← Previous Step","stripe"))),Object(i.createElement)("div",{style:{display:"flex",justifyContent:"center"}},Object(i.createElement)(c.Button,{isLink:!0,variant:"link",onClick:function(){p(),n()},style:{marginRight:"16px"},className:"simpay-setup-wizard-subtle-link",disabled:k},Object(o.__)("Skip Step","stripe")),Object(i.createElement)(bt,{onClick:function(){C(!0),b({usage_tracking_opt_in:v?"yes":"no"}),y();var e=new FormData;e.append("action","simpay_setup_wizard_subscribe_email"),e.append("nonce",Gt),e.append("email",x),m()({url:qt,method:"POST",body:e}).finally((function(){C(!1),n()}))},isBusy:k,disabled:k},Object(o.__)("Save and Continue →","stripe")))))}},{id:"next-steps",title:Object(o.__)("🎉 Setup Complete","stripe"),content:function(){return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(ut,null,Object(i.createElement)(c.Flex,{justify:"space-between",align:"center",className:"simpay-setup-wizard-content-list"},Object(i.createElement)("div",{className:"simpay-setup-wizard-content-list__content"},Object(i.createElement)("p",null,Object(o.__)("Congratulations, you’re ready to start easily and securely accepting payments with WP Simple Pay!","stripe"))),Object(i.createElement)("div",null,Object(i.createElement)(bt,{href:ln},Object(o.__)("Create a Payment Form →","stripe")))),Object(i.createElement)("hr",null),Object(i.createElement)(an,null,Object(i.createElement)("h4",null,Object(o.__)("Special Upgrade Offer - Save 50%","stripe")),Object(i.createElement)("h3",null,Object(o.__)("Upgrade to WP Simple Pay Pro Today and Save","stripe")),Object(i.createElement)(cn,{className:"simpay-setup-wizard-check-list"},pn.map((function(e){return Object(i.createElement)("li",{key:e},Object(i.createElement)(f.a,{icon:wt.a}),e)}))),Object(i.createElement)(c.Button,{isLarge:!0,isSecondary:!0,variant:"secondary",href:un,target:"_blank",rel:"noopener noreferrer"},Object(o.__)("Upgrade to WP Simple Pay Pro","stripe")))),Object(i.createElement)(lt,{justify:"center"},Object(i.createElement)(c.Button,{isLink:!0,variant:"link",href:sn,className:"simpay-setup-wizard-subtle-link",icon:Object(i.createElement)(f.a,{icon:rn})},Object(o.__)("Return to Dashboard","stripe"))))}}]},Cn=simpaySetupWizard,Pn=Cn.license,zn=Cn.adminUrl,An=Pn.is_lite;Object(i.render)(Object(i.createElement)((function(){var e=kn[!0===An?"lite":"pro"],t=Object(s.getQueryArg)(window.location.href,"step"),n=Object(i.useState)(Pn),r=a()(n,2),u=r[0],p=r[1],m=function(e){var t=e.steps,n=e.currentStepId,r=t.findIndex((function(e){return e.id===n}))||0,c=Object(i.useState)(r),o=a()(c,2),l=o[0],u=o[1];function p(e){u(e),window.history.pushState({},"",Object(s.addQueryArgs)(window.location.href,{step:t[e].id}))}return Object(i.useEffect)((function(){var e=function(){var e=Object(s.getQueryArg)(window.location.search,"step"),n=t.findIndex((function(t){return t.id===e}))||0;u(n)};return window.addEventListener("popstate",e),window.addEventListener("pushstate",e),function(){window.removeEventListener("popstate",e),window.removeEventListener("pushstate",e)}}),[]),{currentStep:l,setCurrentStep:u,hasNext:l0}}({steps:e,currentStepId:t}),f=m.currentStep,d=m.goNext,b=m.goPrev,y=m.hasNext,h=m.hasPrev;if(-1===f)return Object(i.createElement)(Sn,{steps:e,goNext:d});var g=e[f],v=g.content;return Object(i.createElement)(c.SlotFillProvider,null,Object(i.createElement)(l.EntityProvider,{kind:"root",type:"site"},Object(i.createElement)(Nt,null,Object(i.createElement)("a",{href:zn},Object(i.createElement)(yt,{width:"250px"})),Object(i.createElement)(zt,{current:f+1,total:e.length}),Object(i.createElement)(ot,{isRounded:!0},Object(i.createElement)(st,{supTitle:Object(o.sprintf)(/* translators: %1$d current step count. %2$d total step count*/ Object(o.__)("Step %1$d of %2$d","stripe"),f+1,e.length),title:g.title}),Object(i.createElement)(v,{steps:e,currentStep:f,goPrev:b,goNext:d,hasNext:y,hasPrev:h,licenseData:u,setLicenseData:p})),y&&Object(i.createElement)(ft,null)),Object(i.createElement)(gt,{className:"simpay-setup-wizard-toasts"}),Object(i.createElement)(c.Popover.Slot,null)))}),null),document.getElementById("simpay-setup-wizard"))}]); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin.js b/includes/core/assets/js/dist/simpay-admin.js index 2e7940ca..e98243df 100644 --- a/includes/core/assets/js/dist/simpay-admin.js +++ b/includes/core/assets/js/dist/simpay-admin.js @@ -1 +1 @@ -!function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.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 a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));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=32)}([function(e,t,n){"use strict";function r(e){"complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",e):e()}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return c}));var r=n(9),a=n.n(r),i=n(5),o=n.n(i);function c(_x,e){return s.apply(this,arguments)}function s(){return(s=a()(o.a.mark((function t(n,r){return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.ajax({data:r,method:"POST",url:"".concat(wpApiSettings.root,"wpsp/").concat(n),beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",wpApiSettings.nonce)}});case 3:return t.abrupt("return",t.sent);case 6:throw t.prev=6,t.t0=t.catch(0),t.t0.responseJSON;case 10:case"end":return t.stop()}}),t,null,[[0,6]])})))).apply(this,arguments)}}).call(this,n(7))},function(e,t,n){var r=n(18);e.exports=function(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";var r=n(27);n.o(r,"maybeBlockButtonWithUpgradeModal")&&n.d(t,"maybeBlockButtonWithUpgradeModal",(function(){return r.maybeBlockButtonWithUpgradeModal})),n.o(r,"maybeBlockCheckboxWithUpgradeModal")&&n.d(t,"maybeBlockCheckboxWithUpgradeModal",(function(){return r.maybeBlockCheckboxWithUpgradeModal})),n.o(r,"maybeBlockSelectWithUpgradeModal")&&n.d(t,"maybeBlockSelectWithUpgradeModal",(function(){return r.maybeBlockSelectWithUpgradeModal})),n.o(r,"upgradeModal")&&n.d(t,"upgradeModal",(function(){return r.upgradeModal})),n(15);var a=n(28);n.d(t,"maybeBlockButtonWithUpgradeModal",(function(){return a.a})),n.d(t,"maybeBlockCheckboxWithUpgradeModal",(function(){return a.b})),n.d(t,"maybeBlockSelectWithUpgradeModal",(function(){return a.c})),n.d(t,"upgradeModal",(function(){return a.d}))},function(e,t){var n=/^(?:submit|button|image|reset|file)$/i,r=/^(?:input|select|textarea|keygen)/i,a=/(\[[^\[\]]*\])/g;function i(e,t,n){if(t.match(a))!function e(t,n,r){if(0===n.length)return r;var a=n.shift(),i=a.match(/^\[(.+?)\]$/);if("[]"===a)return t=t||[],Array.isArray(t)?t.push(e(null,n,r)):(t._values=t._values||[],t._values.push(e(null,n,r))),t;if(i){var o=i[1],c=+o;isNaN(c)?(t=t||{})[o]=e(t[o],n,r):(t=t||[])[c]=e(t[c],n,r)}else t[a]=e(t[a],n,r);return t}(e,function(e){var t=[],n=new RegExp(a),r=/^([^\[\]]*)/.exec(e);for(r[1]&&t.push(r[1]);null!==(r=n.exec(e));)t.push(r[1]);return t}(t),n);else{var r=e[t];r?(Array.isArray(r)||(e[t]=[r]),e[t].push(n)):e[t]=n}return e}function o(e,t,n){return n=n.replace(/(\r)?\n/g,"\r\n"),n=(n=encodeURIComponent(n)).replace(/%20/g,"+"),e+(e?"&":"")+encodeURIComponent(t)+"="+n}e.exports=function(e,t){"object"!=typeof t?t={hash:!!t}:void 0===t.hash&&(t.hash=!0);for(var a=t.hash?{}:"",c=t.serializer||(t.hash?i:o),s=e&&e.elements?e.elements:[],l=Object.create(null),u=0;u3&&void 0!==arguments[3]?arguments[3]:10;if(a(t)&&r(n))if("function"==typeof i)if("number"==typeof o){var c={callback:i,priority:o,namespace:n};if(e[t]){var s,l=e[t].handlers;for(s=l.length;s>0&&!(o>=l[s-1].priority);s--);s===l.length?l[s]=c:l.splice(s,0,c),(e.__current||[]).forEach((function(e){e.name===t&&e.currentIndex>=s&&e.currentIndex++}))}else e[t]={handlers:[c],runs:0};"hookAdded"!==t&&f("hookAdded",t,n,i,o)}else console.error("If specified, the hook priority must be a number.");else console.error("The hook callback must be a function.")}},o=function(e,t){return function(n,i){if(a(n)&&(t||r(i))){if(!e[n])return 0;var o=0;if(t)o=e[n].handlers.length,e[n]={runs:e[n].runs,handlers:[]};else for(var c=e[n].handlers,s=function(t){c[t].namespace===i&&(c.splice(t,1),o++,(e.__current||[]).forEach((function(e){e.name===n&&e.currentIndex>=t&&e.currentIndex--})))},l=c.length-1;l>=0;l--)s(l);return"hookRemoved"!==n&&f("hookRemoved",n,i),o}}},c=function(e){return function(t,n){return void 0!==n?t in e&&e[t].handlers.some((function(e){return e.namespace===n})):t in e}},s=function(e,t){return function(n){e[n]||(e[n]={handlers:[],runs:0}),e[n].runs++;for(var r=e[n].handlers,a=arguments.length,i=new Array(a>1?a-1:0),o=1;o0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=t.id,r=t.getFormData;return Object(i.a)("v2/customer",d({form_values:l()(t[0],{hash:!0}),form_data:r(),form_id:n},e))}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;t0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=t.id,r=t.getFormData;return Object(i.a)("v2/checkout-session",f({form_values:l()(t[0],{hash:!0}),form_data:r(),form_id:n},e))}n(9),n(5),n(11)},,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=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),l=o.call(i,"finallyLoc");if(s&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),q(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;q(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:M(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},n}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){var r=n(6).default;e.exports=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,t||"default");if("object"!=r(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){Number.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},Number.isSafeInteger=Number.isSafeInteger||function(e){return Number.isInteger(e)&&Math.abs(e)<=Number.MAX_SAFE_INTEGER},Number.MAX_SAFE_INTEGER||(Number.MAX_SAFE_INTEGER=9007199254740991)},function(e,t,n){"use strict";(function(e){n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return s})),n.d(t,"c",(function(){return l})),n.d(t,"d",(function(){return u}));var r=n(2),a=n.n(r);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 o(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};e(".simpay-upgrade-modal").dialog(o({position:{my:"center",at:"center",of:window},modal:!0,width:600,resizable:!1,draggable:!1,open:function(){var t=e(this);t.parent().find(".ui-dialog-titlebar").css({borderBottom:0}),t.find(".simpay-upgrade-modal__title").html(n),t.find(".simpay-upgrade-modal__description").html(r),t.find(".simpay-upgrade-modal__upgrade-url").attr("href",a),t.find(".simpay-upgrade-modal__upgrade-purchased-url").attr("href",i)}},c))}}).call(this,n(7))},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return a}));var r=n(0);function a(e,t){var n=document.getElementById("simpay-test-mode-toggle-notice");if(n)if(e!==t){var r=document.getElementById("simpay-toggle-notice-status"),a=document.getElementById("simpay-toggle-notice-status-link");n.style.display="block",r&&a&&(r.innerHTML=""+r.dataset[e]+"",a.href=a.dataset[e])}else n.style.display="none"}function i(){var t=document.querySelectorAll(".simpay-disconnect-link");if(t){var n=simpayAdmin.i18n,r=n.disconnectConfirm,a=n.disconnectCancel;t.forEach((function(t){t.addEventListener("click",(function(n){n.preventDefault(),e(".simpay-disconnect-confirm").dialog({resizable:!1,height:"auto",width:400,modal:!0,draggable:!1,open:function(){e(".ui-dialog-buttonset .ui-button").removeClass("ui-button").last().css({marginLeft:"10px"}).focus()},buttons:[{text:a,click:function(){e(this).dialog("close")},class:"button button-secondary"},{text:r,click:function(){window.location.href=t.href},class:"button button-primary"}]})}))}))}}Object(r.a)((function(){var e;(e=document.getElementById("simpay-stripe-account-info"))&&wp.ajax.send("simpay_stripe_connect_account_information",{data:{nonce:e.dataset.nonce},success:function(t){e.querySelector("p").innerHTML=t.message,e.style.display="block","simpay-stripe-activated-account-actions"===t.actions?e.classList.add("notice-info"):e.classList.add("notice-warning");var n=document.getElementById(t.actions);n&&(n.style.display="block"),i()},error:function(t){e.querySelector("p").innerHTML=t.message,e.style.display="block",e.classList.add("notice-error");var n=document.getElementById(t.actions);n&&(n.style.display="block",i())}})}))}).call(this,n(7))},,,function(e,t,n){"use strict";n.r(t),function(e){var t=n(10),r=n.n(t),a=n(8),i=(n(33),n(34),n(35),n(29));n(36),n(37),n(59),n(42),n(43),window.wpsp=window.wpsp||{hooks:a.b};var o,c,s,l=simpayAdmin,u=l.licenseLevel,d=l.i18n.trashFormConfirm,p={};p={init:function(){c=o(document.body),s=c.find("#simpay-form-settings"),this.handleMetaboxTabClick(),window.postboxes&&window.postboxes.handle_click&&s.on("click",".postbox .simpay-hndle, .postbox .simpay-handlediv",window.postboxes.handle_click),a.b.addAction("settings.toggleTestMode","wpsp/settings/stripe-connect",i.a),this.handleFormBuilderSettingToggles(),a.b.addAction("customFieldAdded","wpsp/payment-form",this.handleFormBuilderSettingToggles),s.on("click.simpayTabLink",".simpay-tab-link",(function(e){e.preventDefault(),p.handleInternalLinkToTabClicks(o(this))})),o(document).on("click.simpayImagePreview",".simpay-remove-image-preview",(function(e){p.handleRemoveImagePreviewClick(e)})),this.setupChosen(),this.addMediaFields(),this.stripeConnect(),this.initSortableFields(s.find(".simpay-custom-fields")),s.find(".add-field").on("click.simpayAddField",this.addField),s.find(".simpay-custom-fields").on("click",".simpay-remove-field-link",this.removeField);var e=o(".simpay-payment-modes");e.length&&e.find("input").each((function(){var t=o(this);e.hasClass("simpay-payment-mode--"+t.val())||t.attr("disabled",!0)})),this.bindTrashWarning(),c.trigger("simpayAdminInit"),o(".show-settings").detach().prependTo(".simpay-branding-bar__actions").removeClass().addClass("simpay-branding-bar__actions-button").html('').on("click",window.screenMeta.toggleEvent)},handleFormBuilderSettingToggles:function(){["_amount_type","_success_redirect_type","_subscription_type","_subscription_custom_amount","_form_type","_tax_status","_enable_payment_page","_inventory","_inventory_behavior","_schedule_start","_schedule_end",".simpay-total-amount-label-recurring",".simpay-total-amount-label-tax",".simpay-shipping-address",".simpay-text-multiline",".simpay-dropdown-type",".simpay-radio-type",".simpay-price-enable-custom",".simpay-price-type input",".simpay-email-link-enabled",".simpay-phone-smart-enabled"].forEach((function(e){var t=o(e),n=!1;"."!==e.substring(0,1)?t='[name="'.concat(e,'"]'):(t=e,n=!0),o("#simpay-form-settings").on("change",t,(function(){var t=o("#simpay-form-settings");!0===n&&(t=o(this).closest(".simpay-field-data"));var r=o(this).val();o(this).is(":checkbox")&&(r=o(this).is(":checked")?"yes":"no"),t.find(o('.simpay-show-if[data-if="'.concat(e,'"]'))).each((function(){var e=o(this),t=e.data("is");e.hide(),t.includes(r)&&e.show().css("display","block")}))})),o(t).filter(":checkbox").trigger("change"),o(t).filter(":checked").trigger("change"),o(t).is("select")&&o(t).trigger("change")}))},handleRemoveImagePreviewClick:function(e){e.preventDefault(),o(e.target).parents("td").find(".simpay-image-preview-wrap").val("").hide(),o(e.target).parents("td").find(".simpay-field-image-url").val(""),o(e.target).parents("td").find(".simpay-remove-image-preview").hide()},addMediaFields:function(){o(".simpay-media-uploader").on("click",(function(e){e.preventDefault();var t=wp.media.frames.file_frame=wp.media({title:simpayAdmin.i18n.mediaTitle,button:{text:simpayAdmin.i18n.mediaButtonText},multiple:!1}),n=o(this);t.on("select",(function(){var e=t.state().get("selection").first().toJSON(),r=n.parents("td").find(".simpay-field-image-url"),a="id"===r.data("fvalue")?e.id:e.url;n.parents("td").find(".simpay-image-preview-wrap").show(),n.parents("td").find(".simpay-remove-image-preview").show(),n.parents("td").find(".simpay-image-preview").prop("src",a),r.val(a)})),t.open()}))},setupChosen:function(){var e=o(".simpay-chosen-select, .simpay-chosen-search");e.chosen({disable_search_threshold:20}),e.chosen()},handleMetaboxTabClick:function(){var e=o('ul.simpay-tabs li:not([data-available="no"]) a'),t=o("div.simpay-panel"),n=e.parents("li");e.on("click",(function(e){e.preventDefault();var r=o(this).parent(),a=o(o(this).attr("href")),i=o(this).attr("href");history.pushState(null,null,i),setTimeout((function(){window.scrollTo(0,0)}),1),o('[name="simpay_form_settings_tab"]').val(i),o(".simpay-panels > .spinner").hide(),n.removeClass("active"),r.addClass("active"),t.addClass("simpay-panel-hidden"),a.removeClass("simpay-panel-hidden")}));var r="#form-display-options-settings-panel";location.hash.length&&(r=location.hash);var a=o('ul.simpay-tabs a[href="'+r+'"]');o('[name="simpay_form_settings_tab"]').val(r),a.length&&a.click()},stripeConnect:function(){var e="tr:nth-child(2), tr:nth-child(3), tr:nth-child(4), tr:nth-child(5)";o(".simpay-settings.stripe-account .form-table").find(e).hide(),o("#wpsp-api-keys-row-reveal button").on("click",(function(t){t.preventDefault(),o(".simpay-settings.stripe-account .form-table").find(e).show(),o("#wpsp-api-keys-row-hide").show(),o(this).parent().hide(),o(".wpsp-manual-key-warning").show()})),o("#wpsp-api-keys-row-hide button").on("click",(function(t){t.preventDefault(),o(".simpay-settings.stripe-account .form-table").find(e).hide(),o("#wpsp-api-keys-row-reveal").show(),o(this).parent().hide(),o(".wpsp-manual-key-warning").hide()}))},handleInternalLinkToTabClicks:function(e){var t=e.data("show-tab");c.find("."+t+"-tab a").click()},bindTrashWarning:function(){["plus","professional","elite","ultimate"].includes(u)&&(o(".post-type-simple-pay .submitdelete").click((function(e){confirm(d)||e.preventDefault()})),o(".post-type-simple-pay #posts-filter").submit((function(e){"trash"===o(this).find('select[name="action"]').val()&&(confirm(d)||e.preventDefault())})))},initSortableFields:function(e){e.sortable({items:".simpay-field-metabox:not(.simpay-custom-field-payment-button):not(.simpay-custom-field-checkout-button)",containment:"#simpay-form-settings",handle:".simpay-hndle",placeholder:"sortable-placeholder",cursor:"move",delay:o(document.body).hasClass("mobile")?200:0,distance:2,tolerance:"pointer",forcePlaceholderSize:!0,opacity:.65,stop:function(e,t){p.orderFields()},helper:function(e,t){return t.clone().find(":input").attr("name",(function(e,t){return"sort_"+parseInt(1e5*Math.random(),10).toString()+"_"+t})).end()}})},addField:function(e){var t=s.find(".simpay-custom-fields .simpay-field-metabox").length,n=o("#simpay-custom-fields-wrap").find(".simpay-metaboxes"),i=s.find("#custom-field-select"),c=i.val(),l=r()(document.querySelectorAll(".field-uid")).map((function(e){return parseInt(e.value)})),u={action:"simpay_add_field",post_id:o("#post_ID").val(),fieldType:c,counter:parseInt(t)+1,nextUid:parseInt(_.max(l))+1,addFieldNonce:s.find("#simpay_custom_fields_nonce").val()};e.preventDefault(),s.find(".simpay-field-data").each((function(){o(this).is(":visible")&&(o(this).hide(),o(this).addClass("closed"))})),o.ajax({url:ajaxurl,method:"POST",data:u,success:function(e){var t=o("
").append(e);["payment_button","checkout_button"].includes(c)?n.append(t.html()):n.prepend(t.html()),i.prop("selectedIndex",0),p.orderFields(),a.b.doAction("customFieldAdded",e)},error:function(e){window.spShared.debugLog(e)}})},removeField:function(e){if(e.preventDefault(),s.find("#custom-field-select"),window.confirm("Are you sure you want to remove this field?")){var t=o(this).closest(".simpay-field-metabox");t.data("type"),t.remove(),a.b.doAction("customFieldRemoved")}},orderFields:function(){o(".simpay-custom-fields .simpay-field-metabox").each((function(e,t){var n=parseInt(o(t).index(".simpay-custom-fields .simpay-field-metabox"));o(".field-order",t).val(n+1)}))}},(o=e)(document).ready((function(e){p.init()}))}.call(this,n(7))},function(e,t,n){"use strict";var r=n(10),a=n.n(r),i=n(0),o=simpayAdminSettingToggles||[];function c(e){var t=e.id,n=document.querySelector(".simpay-settings-".concat(t));if(!n)return{};var r=n.querySelectorAll('input[name="simpay_settings['.concat(t,']"]'));0===r.length&&(r=n.querySelectorAll('select[name="'.concat(t,'"]')));var i=r[0].value;if(["radio","checkbox"].includes(r[0].type)){var o=a()(r).filter((function(e){return e.checked}));i=0===o.length?"no":o[0].value}return{setting:r,currentValue:i}}function s(e){var t=e.id,n=e.value,r=e.toggles,a=e.compare;if("none"!==document.querySelector(".simpay-settings-".concat(t)).style.display){var i=c(e).currentValue;r.map((function(e){return document.querySelector(".simpay-settings-".concat(e))})).forEach((function(e){e&&(e.style.display="IS NOT"===a?i===n?"none":"table-row":i===n?"table-row":"none")})),r.forEach((function(e){var t=_.find(o,{id:e});t&&s(t)}))}}Object(i.a)((function(){o.forEach((function(e){s(e),c(e).setting.forEach((function(t){t.addEventListener("change",(function(){s(e)}))}))}))}))},function(e,t,n){"use strict";var r=n(0);Object(r.a)((function(){var e=window.wpsp.hooks,t=document.querySelectorAll('[name="simpay_settings[test_mode]"]');if(0!==t.length){var n="enabled"===document.querySelector('[name="simpay_settings[test_mode]"]:checked').value?"test":"live";e.doAction("settings.toggleTestMode",n,n),_.each(t,(function(t){return t.addEventListener("change",(function(t){var r="enabled"===t.target.value?"test":"live";e.doAction("settings.toggleTestMode",r,n)}))}))}}))},function(e,t,n){"use strict";var r=n(0);function a(e){var t=document.getElementById("simpay-connect-license-feedback"),n=document.getElementById("simpay-connect-license-submit");e.message?(t.innerText=e.message,t.classList.remove("simpay-license-message--valid"),t.classList.add("simpay-license-message--invalid"),t.style.display="block"):t.style.display="none",e.reload?setTimeout((function(){window.location.reload()}),2e3):(n.disabled=!1,n.innerText=n.dataset.connect)}function i(e){var t=document.getElementById("simpay-connect-license-feedback");e.message?(t.innerText=e.message,t.classList.remove("simpay-license-message--invalid"),t.classList.add("simpay-license-message--valid"),t.style.display="block"):t.style.display="none",e.reload?setTimeout((function(){window.location.reload()}),2e3):window.location=e.url}function o(){var e=document.getElementById("simpay-connect-license-key"),t=document.getElementById("simpay-connect-license-nonce"),n=document.getElementById("simpay-connect-license-submit");n.disabled=!0,n.innerText=n.dataset.connecting,wp.ajax.send("simpay_get_connect_url",{data:{nonce:t.value,key:e.value},success:i,error:a})}Object(r.a)((function(){var e=document.getElementById("simpay-connect-license-key");if(e){var t=document.getElementById("simpay-connect-license-submit");e.addEventListener("keypress",(function(e){"Enter"===e.key&&(e.preventDefault(),o())})),t.addEventListener("click",(function(e){e.preventDefault(),t.disabled=!0,o()}))}}))},function(e,t,n){"use strict";var r=n(0),a=[".simpay-settings-hcaptcha_setup",".simpay-settings-hcaptcha_site_key",".simpay-settings-hcaptcha_secret_key",".simpay-settings-recaptcha_setup",".simpay-settings-recaptcha_site_key",".simpay-settings-recaptcha_secret_key",".simpay-settings-recaptcha_score_threshold",".simpay-settings-cloudflare_turnstile_setup",".simpay-settings-cloudflare_turnstile_site_key",".simpay-settings-cloudflare_turnstile_secret_key",".simpay-settings-no_captcha_warning"];function i(e){var t,n=e.target.value;switch(n){case"none":t="no_captcha";break;case"recaptcha-v3":t="recaptcha";break;case"cloudflare-turnstile":t="cloudflare_turnstile";break;default:t=n}a.forEach((function(e){var n=document.querySelector(e);n&&(n.style.display=e.includes(t)?"table-row":"none")}))}Object(r.a)((function(){var e=document.querySelectorAll('input[name="simpay_settings[captcha_type]"]');if(0!==e.length){a.forEach((function(e){var t=document.querySelector(e);t&&(t.style.display="none")})),e.forEach((function(e){return e.addEventListener("change",i)}));var t=document.querySelector('input[name="simpay_settings[captcha_type]"]:checked');t&&t.dispatchEvent(new Event("change")),function(){var e=document.querySelector(".simpay-recaptcha-feedback");if(e){var t=simpayGoogleRecaptcha,n=t.siteKey,r=t.i18n;""!==n&&grecaptcha.ready((function(){var e=document.querySelector(".grecaptcha-badge");e&&(e.style.display="none");try{grecaptcha.execute(n,{action:"simple_pay_admin_test"}).then((function(e){wp.ajax.send("simpay_validate_recaptcha_source",{data:{token:e,recaptcha_action:"simple_pay_admin_test"},error:a})})).catch(a)}catch(e){a()}}))}function a(){e.style.display="block",e.classList.add("notice-error"),e.innerHTML="";var t=document.createElement("p");t.innerText=r.invalid,e.appendChild(t)}}()}}))},function(e,t,n){"use strict";var r=n(0),a=n(3);Object(r.a)((function(){var e=document.querySelector(".simpay-settings-emails-configure");e&&(document.querySelector(".simpay-settings-subsection-delivery").after(e),function(e){var t=e.querySelector("select");t&&t.addEventListener("change",(function(e){var n=e.target,r=n.options[n.selectedIndex].dataset,i=r.available,o=r.upgradeTitle,c=r.upgradeDescription,s=r.upgradeUrl,l=r.upgradePurchasedUrl;"no"===i&&(Object(a.upgradeModal)({title:o,description:c,url:s,purchasedUrl:l}),t.value="",t.selectedIndex=0)}))}(e))}))},function(e,t,n){"use strict";(function(e){var t=n(4),r=n.n(t),a=n(0),i=n(3);Object(a.a)((function(){var t,n,a,o,c=document.querySelector(".post-type-simple-pay #post");if(c){var s=r()(c,{hash:!0});delete s.simpay_form_settings_tab,function(t){function n(e){var n=r()(document.querySelector(".post-type-simple-pay form#post"),{hash:!0});if(delete n.simpay_form_settings_tab,delete n.simpay_save_preview,JSON.stringify(n)!==t)return e.preventDefault(),simpayAdmin.i18n.leavePageConfirm}window.addEventListener("beforeunload",n),window.onbeforeunload=n,e(".post-type-simple-pay form#post").off("submit").on("submit",(function(){window.removeEventListener("beforeunload",n),window.onbeforeunload=null}))}(JSON.stringify(s)),a=document.getElementById("form-type-select"),o=document.getElementById("is-overlay"),a.addEventListener("change",(function(e){var t=e.target,n=t.options[t.selectedIndex],r=n.value;"on-site"===r&&Object(i.maybeBlockSelectWithUpgradeModal)(e),"off-site"===r&&(o.querySelector("input").checked=!1),o.style.display="yes"===n.dataset.available&&"on-site"===r?"block":"none"})),(n=document.getElementById("_recaptcha"))&&n.addEventListener("change",(function(e){e.preventDefault(),e.target.checked=!e.target.checked,window.open(e.target.dataset.settingsUrl,"_blank")})),function(){var e=document.getElementById("_email_verification");e&&e.addEventListener("change",(function(e){e.preventDefault(),e.target.checked=!e.target.checked,window.open(e.target.dataset.settingsUrl,"_blank")}))}(),(t=document.querySelector("#_company_name"))&&(t.addEventListener("blur",(function(){0===t.value.length?(t.nextElementSibling.classList.remove("hidden"),t.value=simpayAdmin.siteTitle):t.nextElementSibling.classList.add("hidden")})),t.addEventListener("focus",(function(){0!==t.value.length&&t.nextElementSibling.classList.add("hidden")})))}}))}).call(this,n(7))},function(e,t,n){"use strict";(function(e){var t=n(10),r=n.n(t),a=n(0),i=n(8),o=n(3);function c(){var e=document.getElementById("simpay-prices");if(e){var t=e.querySelectorAll(".simpay-price").length;document.querySelectorAll(".simpay-price-label-default").forEach((function(e){return e.style.display=t>1?"none":"block"})),document.querySelectorAll(".simpay-price-label-display").forEach((function(e){return e.style.display=t>1?"block":"none"})),document.querySelectorAll(".simpay-price-option-label").forEach((function(e){if(t>1)e.style.display="block";else{var n=e.querySelector("input");n&&""!==n.value.trim()?e.style.display="block":e.style.display="none"}})),document.querySelectorAll(".simpay-price-default-check").forEach((function(e){return e.style.display=t>1?"block":"none"}));var n=document.querySelector(".simpay-custom-field-plan-select");n&&(n.style.display=t>1?"block":"none")}}function s(e){var t,n=e.querySelector(".simpay-price-label-display"),r=e.querySelector(".simpay-price-label"),a=simpayAdmin,o=a.currencyPosition,c=a.i18n,s=c.recurringIntervals,l=c.recurringIntervalDisplay,u=c.customAmountLabel;if(""!==r.value)t=r.value;else{var d=e.querySelector(".simpay-price-currency"),p=e.querySelector(".simpay-price-amount"),m=e.querySelector(".simpay-price-amount-type"),f=e.querySelector(".simpay-price-custom-amount input"),y=e.querySelector(".simpay-price-enable-custom-amount"),h=d.options[d.selectedIndex].dataset.symbol;switch(t=!0===y.checked?f.value:p.value,o){case"left":t="".concat(h).concat(t);break;case"left_space":t="".concat(h," ").concat(t);break;case"right":t="".concat(t).concat(h);break;case"right_space":t="".concat(t," ").concat(h)}if(!0===y.checked&&(t=u.replace("%s",t)),"recurring"===m.value){var v=e.querySelector(".simpay-price-recurring-interval"),g=e.querySelector(".simpay-price-recurring-interval-count"),b=s[v.options[v.selectedIndex].value];t=l.replace("%1$s",t).replace("%2$s",g.value).replace("%3$s","1"===g.value?b[0]:b[1])}}n.innerHTML=t,Object(i.c)("simpayFormBuilderPriceOptionLabelUpdated",t,e)}function l(e,t){e.querySelector(".simpay-price-recurring-settings").style.display=t.checked?"table":"none"}function u(e){var t=e.querySelector(".simpay-price-recurring-interval"),n=e.querySelector(".simpay-price-recurring-interval-count"),a=parseInt(n.value);switch(t.options[t.selectedIndex].value){case"day":a>365&&(n.value=365);break;case"week":a>52&&(n.value=52);break;case"month":a>12&&(n.value=12);break;case"year":a>1&&(n.value=1)}var i=JSON.parse(t.dataset.intervals);r()(t.options).forEach((function(e,r){var a=e.value;t.options[r].text=1===parseInt(n.value)?i[a][0]:i[a][1]}))}function d(){document.querySelectorAll(".simpay-price").forEach((function(e){var t=e.querySelector(".simpay-price-amount-type").value;e.querySelector(".simpay-price-label").addEventListener("keyup",(function(){return s(e)})),s(e),e.querySelector(".simpay-price-currency").addEventListener("change",(function(){!function(e){var t=e.querySelector(".simpay-price-currency"),n=t.options[t.selectedIndex].dataset.symbol;e.querySelectorAll(".simpay-price-currency-symbol").forEach((function(e){return e.innerText=n}))}(e),s(e)}));var n=e.querySelectorAll(".simpay-price-amount-type .button");n.length>0&&n.forEach((function(t){return t.addEventListener("click",(function(t){t.preventDefault();var n=t.target.dataset,r=n.available,a=n.upgradeTitle,i=n.upgradeDescription,c=n.upgradeUrl,l=n.upgradePurchasedUrl;"no"===r?Object(o.upgradeModal)({title:a,description:i,url:c,purchasedUrl:l}):(function(e,t){e.querySelectorAll(".simpay-price-amount-type .button").forEach((function(e){return e.classList.remove("button-primary")}));var n=t.dataset.amountType,r=e.querySelector(".simpay-price-recurring-settings");t.classList.add("button-primary"),r.style.display="recurring"===n?"table":"none";var a=e.querySelector(".simpay-price-recurring-amount-toggle"),i=e.querySelector(".simpay-price-enable-optional-subscription");a.style.display="recurring"===n?"none":"block",i.checked=!1,e.querySelector(".simpay-price-amount-type").value=n}(e,t.target),s(e))}))})),e.querySelector(".simpay-price-amount").addEventListener("keyup",(function(){return s(e)}));var r=e.querySelector(".simpay-price-enable-optional-subscription");r&&(r.addEventListener("click",(function(t){var n=t.target,r=n.dataset,a=r.available,i=r.upgradeTitle,c=r.upgradeDescription,u=r.upgradeUrl,d=r.upgradePurchasedUrl;"no"===a?(n.checked=!1,t.preventDefault(),Object(o.upgradeModal)({title:i,description:c,url:u,purchasedUrl:d})):(l(e,n),s(e))})),"recurring"!==t&&l(e,r));var a=e.querySelector(".simpay-price-enable-custom-amount");a.addEventListener("change",(function(){!function(e,t){e.querySelector(".simpay-price-custom-amount").style.display=t.checked?"table":"none"}(e,a),s(e)})),e.querySelector(".simpay-price-recurring-interval").addEventListener("change",(function(){s(e),u(e)}));var d=e.querySelector(".simpay-price-recurring-interval-count");u(e),d.addEventListener("keyup",(function(){u(e),s(e)})),d.addEventListener("change",(function(){u(e),s(e)}));var m=e.querySelector(".simpay-price-legacy-setting-toggle");m&&m.addEventListener("click",(function(t){t.preventDefault(),function(e){e.querySelectorAll(".simpay-price-legacy-setting").forEach((function(e){return e.style.display="block"===e.style.display?"none":"block"}))}(e)})),e.querySelector(".simpay-price-default").addEventListener("change",(function(){return function(e){document.querySelectorAll(".simpay-price-default").forEach((function(e){return e.checked=!1})),e.querySelector(".simpay-price-default").checked=!0}(e)})),e.querySelector(".simpay-price-remove").addEventListener("click",(function(t){t.preventDefault(),function(e){e.remove(),p(),c(),Object(i.c)("simpayFormBuilderPriceRemoved",e.id)}(e)}))})),c()}function p(){var e=document.querySelectorAll(".simpay-price");document.querySelector(".simpay-price-default:checked")||(e[0].querySelector(".simpay-price-default").checked=!0)}Object(a.a)((function(){var t,n,r,a,s,l,u;e(".simpay-prices").sortable({items:".simpay-field-metabox",containment:"#simpay-prices",handle:".simpay-hndle",placeholder:"sortable-placeholder",cursor:"move",delay:e(document.body).hasClass("mobile")?200:0,distance:2,tolerance:"pointer",forcePlaceholderSize:!0,opacity:.65,helper:function(e,t){return t.clone().find(":input").attr("name",(function(e,t){return"sort_"+parseInt(1e5*Math.random(),10).toString()+"_"+t})).end()}}),d(),t=document.getElementById("simpay-prices-advanced-toggle"),n=document.getElementById("simpay-prices-advanced"),t&&n&&t.addEventListener("click",(function(e){e.preventDefault(),n.style.display="block"===n.style.display?"none":"block"})),(u=document.getElementById("simpay-prices-advanced-add"))&&u.addEventListener("click",(function(t){var n,r,a,i,o,s;t.preventDefault(),a=(r=(n=u).dataset).nonce,i=r.formId,o=document.getElementById("simpay-prices"),s=document.getElementById("simpay-prices-advanced-plan-id"),n.classList.add("disabled"),wp.ajax.send("simpay_add_plan",{data:{_wpnonce:a,form_id:i,plan_id:s.value},success:function(t){e(o).append(t),d(),document.getElementById("simpay-prices-advanced").style.display="none",s.value="",n.classList.remove("disabled"),c()},error:function(e){var t=e.message;window.alert(t),n.classList.remove("disabled")}})})),function(){var t=document.getElementById("simpay-add-price");t&&t.addEventListener("click",(function(n){var r,a,o,s,l;n.preventDefault(),o=(a=(r=t).dataset).nonce,s=a.formId,l=document.getElementById("simpay-prices"),r.classList.add("disabled"),wp.ajax.send("simpay_add_price",{data:{_wpnonce:o,form_id:s},success:function(t){e(l).append(t),d(),p(),r.classList.remove("disabled"),c(),Object(i.c)("simpayFormBuilderPriceAdded",t)},error:function(e){var t=e.message;window.alert(t),r.classList.remove("disabled")}})}))}(),(r=document.getElementById("simpay-add-price-lite"))&&r.addEventListener("click",o.maybeBlockButtonWithUpgradeModal),(a=document.getElementById("simpay-amount-type-lite"))&&a.addEventListener("click",o.maybeBlockButtonWithUpgradeModal),(s=document.getElementById("simpay-can-recur-lite"))&&s.addEventListener("click",o.maybeBlockButtonWithUpgradeModal),(l=document.getElementById("simpay-custom-lite"))&&l.addEventListener("click",o.maybeBlockButtonWithUpgradeModal)}))}).call(this,n(7))},function(e,t,n){"use strict";(function(e){var t=n(0),r=n(3);Object(t.a)((function(){var t;document.querySelector(".post-type-simple-pay #post")&&(t=e("#simpay-form-settings").find("#lite-add-field"))&&t.on("click.simpayAddField",(function(e){var t=e,n=document.querySelectorAll(".simpay-custom-fields > div").length;t.target.dataset.available=n>=3?"no":"yes",Object(r.maybeBlockButtonWithUpgradeModal)(t)&&e.stopImmediatePropagation()}))}))}).call(this,n(7))},function(e,t,n){"use strict";(function(e){var t=n(0),r=n(3);Object(t.a)((function(){var t,n,a;(t=document.querySelector('[name="_enable_payment_page"]'))&&t.addEventListener("change",r.maybeBlockCheckboxWithUpgradeModal),(n=document.querySelector('[name="_payment_page_powered_by"]'))&&n.addEventListener("change",r.maybeBlockCheckboxWithUpgradeModal),function(){if(document.getElementById("payment-page-background-color-custom")){e("#payment-page-background-color-custom").wpColorPicker();var t=document.querySelector(".simpay-payment-page-background-color .wp-color-result"),n=document.querySelectorAll(".simpay-payment-page-background-color");t.addEventListener("click",(function(t){n.forEach((function(e){e.querySelector("input").checked=!1})),t.target.classList.add("is-selected"),e(t.target).parent().find("input").prop("checked",!0)})),n.forEach((function(e){e.querySelector("input").addEventListener("change",(function(){t.classList.remove("is-selected")}))}))}}(),(a=document.querySelector('[name="_payment_page_slug"]'))&&a.addEventListener("keyup",(function(e){var t=document.querySelector(".simpay-payment-page-url");t&&(t.dataset.clipboardText="".concat(window.location.origin,"/").concat(e.target.value))}))}))}).call(this,n(7))},function(e,t,n){"use strict";(function(e){var t=n(6),r=n.n(t),a=n(0),i='',o='',c=simpayAdmin,s=c.nonce,l=c.ajaxUrl,u=c.i18n,d=u.addonActivated,p=u.addonActivate,m=u.addonActive,f=u.addonDeactivate,y=u.addonInactive,h=u.addonInstall,v=u.addonError,g=u.pluginError;function b(t){t.preventDefault();var n,a,c,u,b,_,k=e(t.target);if(k.hasClass("status-go-to-url"))window.open(k.attr("data-plugin"),"_blank");else{var w=k.attr("data-type");if(k.prop("disabled",!0).addClass("loading"),k.html(''),k.hasClass("status-active"))n="deactivate",a="status-installed","plugin"===w&&(a+=" button button-secondary"),c=y,u=p,b=f,"addon"===w&&(u=i+u,b=o+b);else if(k.hasClass("status-installed"))n="activate",a="status-active","plugin"===w&&(a+=" button button-secondary disabled"),c=m,u=f,"addon"===w?(u=o+u,b=i+p):"plugin"===w&&(u=d,b=p);else{if(!k.hasClass("status-missing"))return;n="install",a="status-active","plugin"===w&&(a+=" button disabled"),c=m,u=d,b='',"addon"===w&&(u=i+f,b+=h)}var x=k.closest(".simpay-addon");!function(t,n,r,a){var i={activate:"simpay_activate_addon",install:"simpay_install_addon",deactivate:"simpay_deactivate_addon"}[n];if(i){var o={action:i,nonce:s,plugin:t,type:r};e.post(l,o,a).fail((function(e){console.log(e.responseText)}))}}(k.attr("data-plugin"),n,w,(function(e){e.success?("install"===n?(k.attr("data-plugin",e.data.basename),_=e.data.msg,e.data.is_activated||(c=y,u="plugin"===w?p:i+p,a="plugin"===w?"status-installed button button-secondary":"status-installed")):_=e.data,x.find(".simpay-addon__actions").append('
'+_+"
"),x.find("span.status-label").removeClass("status-active status-installed status-missing").addClass(a).removeClass("button button-primary button-secondary disabled").text(c),k.removeClass("status-active status-installed status-missing").removeClass("button button-primary button-secondary disabled").addClass(a).html(u)):("object"===r()(e.data)?"addon"===w?x.find(".simpay-addon__actions").append('
'+v+"
"):x.find(".simpay-addon__actions").append('
'+g+"
"):x.find(".simpay-addon__actions").append('
'+e.data+"
"),"install"===n&&"plugin"===w&&k.addClass("status-go-to-url").removeClass("status-missing"),k.html(b)),k.prop("disabled",!1).removeClass("loading"),setTimeout((function(){x.find(".msg").remove()}),3e3)}))}}Object(a.a)((function(){document.querySelector(".simpay-addons")&&document.querySelectorAll(".simpay-addon").forEach((function(e){e.querySelector("button").addEventListener("click",b)}))}))}).call(this,n(7))},function(e,t,n){"use strict";var r=n(0);Object(r.a)((function(){var e=new ClipboardJS(".simpay-copy-button");e.on("success",(function(t){var n=t.trigger,r=n.dataset.copied,a=n.innerHTML;clearTimeout(i),n.innerHTML=r,n.classList.contains("button-secondary")&&(n.style.color="green",n.style.borderColor="green"),t.clearSelection();var i=setTimeout((function(){n.innerHTML=a,n.classList.contains("button-secondary")&&(n.style.color="",n.style.borderColor=""),e.clipboardAction.fakeElem&&e.clipboardAction.removeFake&&e.clipboardAction.removeFake()}),3e3);wp.a11y.speak(r)}))}))},,,,,,,,,,,,,,,,function(e,t,n){"use strict";n(38),n(39);var r=n(10),a=n.n(r),i=n(0),o=n(3);function c(e){var t=e.target,n=t.options[t.selectedIndex].value,r=document.querySelectorAll(".simpay-panel-field-payment-method[data-payment-method]");a()(r).forEach((function(e){var t="popular"===JSON.parse(e.dataset.paymentMethod).scope?"block":"none";e.style.display="all"===n?"block":t}))}Object(i.a)((function(){var e=document.querySelectorAll(".simpay-panel-field-payment-method-filter");0!==e.length&&a()(e).forEach((function(e){e.addEventListener("change",c)}));var t=document.querySelectorAll(".simpay-payment-method-lite");t&&t.forEach((function(e){return e.addEventListener("change",o.maybeBlockCheckboxWithUpgradeModal)}));var n=document.querySelectorAll(".simpay-payment-method-fee-recovery-lite");n&&n.forEach((function(e){return e.addEventListener("click",o.maybeBlockButtonWithUpgradeModal)}))})),Object(i.a)((function(){var e=document.getElementById("_tax_status_lite");e&&e.addEventListener("change",o.maybeBlockSelectWithUpgradeModal)})),n(40),Object(i.a)((function(){var e,t;(e=document.getElementById("_enable_tax_id"))&&e.addEventListener("change",o.maybeBlockCheckboxWithUpgradeModal),(t=document.getElementById("_enable_promotion_codes"))&&t.addEventListener("change",o.maybeBlockCheckboxWithUpgradeModal)})),n(41),Object(i.a)((function(){var e=document.getElementById("_inventory");e&&e.addEventListener("change",o.maybeBlockCheckboxWithUpgradeModal);var t=document.getElementById("_inventory_behavior_individual");t&&t.addEventListener("change",o.maybeBlockCheckboxWithUpgradeModal);var n=document.getElementById("_schedule_start");n&&n.addEventListener("change",o.maybeBlockCheckboxWithUpgradeModal);var r=document.getElementById("_schedule_end");r&&r.addEventListener("change",o.maybeBlockCheckboxWithUpgradeModal)})),Object(i.a)((function(){var e=document.getElementById("automations-search");if(e){var t=document.querySelectorAll(".simpay-form-builder-automator__integrations-integration");e.addEventListener("input",(function(){var n=e.value.toLowerCase();t.forEach((function(e){for(var t=Object.values(e.dataset),r=0;r3&&void 0!==arguments[3]?arguments[3]:10;if(a(t)&&r(n))if("function"==typeof i)if("number"==typeof o){var c={callback:i,priority:o,namespace:n};if(e[t]){var s,l=e[t].handlers;for(s=l.length;s>0&&!(o>=l[s-1].priority);s--);s===l.length?l[s]=c:l.splice(s,0,c),(e.__current||[]).forEach((function(e){e.name===t&&e.currentIndex>=s&&e.currentIndex++}))}else e[t]={handlers:[c],runs:0};"hookAdded"!==t&&f("hookAdded",t,n,i,o)}else console.error("If specified, the hook priority must be a number.");else console.error("The hook callback must be a function.")}},o=function(e,t){return function(n,i){if(a(n)&&(t||r(i))){if(!e[n])return 0;var o=0;if(t)o=e[n].handlers.length,e[n]={runs:e[n].runs,handlers:[]};else for(var c=e[n].handlers,s=function(t){c[t].namespace===i&&(c.splice(t,1),o++,(e.__current||[]).forEach((function(e){e.name===n&&e.currentIndex>=t&&e.currentIndex--})))},l=c.length-1;l>=0;l--)s(l);return"hookRemoved"!==n&&f("hookRemoved",n,i),o}}},c=function(e){return function(t,n){return void 0!==n?t in e&&e[t].handlers.some((function(e){return e.namespace===n})):t in e}},s=function(e,t){return function(n){e[n]||(e[n]={handlers:[],runs:0}),e[n].runs++;for(var r=e[n].handlers,a=arguments.length,i=new Array(a>1?a-1:0),o=1;o0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=t.id,r=t.getFormData;return Object(i.a)("v2/customer",d({form_values:l()(t[0],{hash:!0}),form_data:r(),form_id:n},e))}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;t0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=t.id,r=t.getFormData;return Object(i.a)("v2/checkout-session",f({form_values:l()(t[0],{hash:!0}),form_data:r(),form_id:n},e))}n(9),n(5),n(11)},,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=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),l=o.call(i,"finallyLoc");if(s&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),q(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;q(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:M(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},n}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){var r=n(6).default;e.exports=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,t||"default");if("object"!=r(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){Number.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},Number.isSafeInteger=Number.isSafeInteger||function(e){return Number.isInteger(e)&&Math.abs(e)<=Number.MAX_SAFE_INTEGER},Number.MAX_SAFE_INTEGER||(Number.MAX_SAFE_INTEGER=9007199254740991)},function(e,t,n){"use strict";(function(e){n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return s})),n.d(t,"c",(function(){return l})),n.d(t,"d",(function(){return u}));var r=n(2),a=n.n(r);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 o(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};e(".simpay-upgrade-modal").dialog(o({position:{my:"center",at:"center",of:window},modal:!0,width:600,resizable:!1,draggable:!1,open:function(){var t=e(this);t.parent().find(".ui-dialog-titlebar").css({borderBottom:0}),t.find(".simpay-upgrade-modal__title").html(n),t.find(".simpay-upgrade-modal__description").html(r),t.find(".simpay-upgrade-modal__upgrade-url").attr("href",a),t.find(".simpay-upgrade-modal__upgrade-purchased-url").attr("href",i)}},c))}}).call(this,n(7))},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return a}));var r=n(0);function a(e,t){var n=document.getElementById("simpay-test-mode-toggle-notice");if(n)if(e!==t){var r=document.getElementById("simpay-toggle-notice-status"),a=document.getElementById("simpay-toggle-notice-status-link");n.style.display="block",r&&a&&(r.innerHTML=""+r.dataset[e]+"",a.href=a.dataset[e])}else n.style.display="none"}function i(){var t=document.querySelectorAll(".simpay-disconnect-link");if(t){var n=simpayAdmin.i18n,r=n.disconnectConfirm,a=n.disconnectCancel;t.forEach((function(t){t.addEventListener("click",(function(n){n.preventDefault(),e(".simpay-disconnect-confirm").dialog({resizable:!1,height:"auto",width:400,modal:!0,draggable:!1,open:function(){e(".ui-dialog-buttonset .ui-button").removeClass("ui-button").last().css({marginLeft:"10px"}).focus()},buttons:[{text:a,click:function(){e(this).dialog("close")},class:"button button-secondary"},{text:r,click:function(){window.location.href=t.href},class:"button button-primary"}]})}))}))}}Object(r.a)((function(){var e;(e=document.getElementById("simpay-stripe-account-info"))&&wp.ajax.send("simpay_stripe_connect_account_information",{data:{nonce:e.dataset.nonce},success:function(t){e.querySelector("p").innerHTML=t.message,e.style.display="block","simpay-stripe-activated-account-actions"===t.actions?e.classList.add("notice-info"):e.classList.add("notice-warning");var n=document.getElementById(t.actions);n&&(n.style.display="block"),i()},error:function(t){e.querySelector("p").innerHTML=t.message,e.style.display="block",e.classList.add("notice-error");var n=document.getElementById(t.actions);n&&(n.style.display="block",i())}})}))}).call(this,n(7))},,,function(e,t,n){"use strict";n.r(t),function(e){var t=n(10),r=n.n(t),a=n(8),i=(n(33),n(34),n(35),n(29));n(36),n(37),n(59),n(42),n(43),window.wpsp=window.wpsp||{hooks:a.b};var o,c,s,l=simpayAdmin,u=l.licenseLevel,d=l.i18n.trashFormConfirm,p={};p={init:function(){c=o(document.body),s=c.find("#simpay-form-settings"),this.handleMetaboxTabClick(),window.postboxes&&window.postboxes.handle_click&&s.on("click",".postbox .simpay-hndle, .postbox .simpay-handlediv",window.postboxes.handle_click),a.b.addAction("settings.toggleTestMode","wpsp/settings/stripe-connect",i.a),this.handleFormBuilderSettingToggles(),a.b.addAction("customFieldAdded","wpsp/payment-form",this.handleFormBuilderSettingToggles),s.on("click.simpayTabLink",".simpay-tab-link",(function(e){e.preventDefault(),p.handleInternalLinkToTabClicks(o(this))})),o(document).on("click.simpayImagePreview",".simpay-remove-image-preview",(function(e){p.handleRemoveImagePreviewClick(e)})),this.setupChosen(),this.addMediaFields(),this.stripeConnect(),this.initSortableFields(s.find(".simpay-custom-fields")),s.find(".add-field").on("click.simpayAddField",this.addField),s.find(".simpay-custom-fields").on("click",".simpay-remove-field-link",this.removeField);var e=o(".simpay-payment-modes");e.length&&e.find("input").each((function(){var t=o(this);e.hasClass("simpay-payment-mode--"+t.val())||t.attr("disabled",!0)})),this.bindTrashWarning(),c.trigger("simpayAdminInit"),o(".show-settings").detach().prependTo(".simpay-branding-bar__actions").removeClass().addClass("simpay-branding-bar__actions-button").html('').on("click",window.screenMeta.toggleEvent)},handleFormBuilderSettingToggles:function(){["_amount_type","_success_redirect_type","_subscription_type","_subscription_custom_amount","_form_type","_tax_status","_enable_payment_page","_inventory","_inventory_behavior","_schedule_start","_schedule_end",".simpay-total-amount-label-recurring",".simpay-total-amount-label-tax",".simpay-shipping-address",".simpay-text-multiline",".simpay-dropdown-type",".simpay-radio-type",".simpay-price-enable-custom",".simpay-price-type input",".simpay-email-link-enabled",".simpay-phone-smart-enabled"].forEach((function(e){var t=o(e),n=!1;"."!==e.substring(0,1)?t='[name="'.concat(e,'"]'):(t=e,n=!0),o("#simpay-form-settings").on("change",t,(function(){var t=o("#simpay-form-settings");!0===n&&(t=o(this).closest(".simpay-field-data"));var r=o(this).val();o(this).is(":checkbox")&&(r=o(this).is(":checked")?"yes":"no"),t.find(o('.simpay-show-if[data-if="'.concat(e,'"]'))).each((function(){var e=o(this),t=e.data("is");e.hide(),t.includes(r)&&e.show().css("display","block")}))})),o(t).filter(":checkbox").trigger("change"),o(t).filter(":checked").trigger("change"),o(t).is("select")&&o(t).trigger("change")}))},handleRemoveImagePreviewClick:function(e){e.preventDefault(),o(e.target).parents("td").find(".simpay-image-preview-wrap").val("").hide(),o(e.target).parents("td").find(".simpay-field-image-url").val(""),o(e.target).parents("td").find(".simpay-remove-image-preview").hide()},addMediaFields:function(){o(".simpay-media-uploader").on("click",(function(e){e.preventDefault();var t=wp.media.frames.file_frame=wp.media({title:simpayAdmin.i18n.mediaTitle,button:{text:simpayAdmin.i18n.mediaButtonText},multiple:!1}),n=o(this);t.on("select",(function(){var e=t.state().get("selection").first().toJSON(),r=n.parents("td").find(".simpay-field-image-url"),a="id"===r.data("fvalue")?e.id:e.url;n.parents("td").find(".simpay-image-preview-wrap").show(),n.parents("td").find(".simpay-remove-image-preview").show(),n.parents("td").find(".simpay-image-preview").prop("src",a),r.val(a)})),t.open()}))},setupChosen:function(){var e=o(".simpay-chosen-select, .simpay-chosen-search");e.chosen({disable_search_threshold:20}),e.chosen()},handleMetaboxTabClick:function(){var e=o('ul.simpay-tabs li:not([data-available="no"]) a'),t=o("div.simpay-panel"),n=e.parents("li");e.on("click",(function(e){e.preventDefault();var r=o(this).parent(),a=o(o(this).attr("href")),i=o(this).attr("href");history.pushState(null,null,i),setTimeout((function(){window.scrollTo(0,0)}),1),o('[name="simpay_form_settings_tab"]').val(i),o(".simpay-panels > .spinner").hide(),n.removeClass("active"),r.addClass("active"),t.addClass("simpay-panel-hidden"),a.removeClass("simpay-panel-hidden")}));var r="#form-display-options-settings-panel";location.hash.length&&(r=location.hash);var a=o('ul.simpay-tabs a[href="'+r+'"]');o('[name="simpay_form_settings_tab"]').val(r),a.length&&a.click()},stripeConnect:function(){var e="tr:nth-child(2), tr:nth-child(3), tr:nth-child(4), tr:nth-child(5)";o(".simpay-settings.stripe-account .form-table").find(e).hide(),o("#wpsp-api-keys-row-reveal button").on("click",(function(t){t.preventDefault(),o(".simpay-settings.stripe-account .form-table").find(e).show(),o("#wpsp-api-keys-row-hide").show(),o(this).parent().hide(),o(".wpsp-manual-key-warning").show()})),o("#wpsp-api-keys-row-hide button").on("click",(function(t){t.preventDefault(),o(".simpay-settings.stripe-account .form-table").find(e).hide(),o("#wpsp-api-keys-row-reveal").show(),o(this).parent().hide(),o(".wpsp-manual-key-warning").hide()}))},handleInternalLinkToTabClicks:function(e){var t=e.data("show-tab");c.find("."+t+"-tab a").click()},bindTrashWarning:function(){["plus","professional","elite","ultimate"].includes(u)&&(o(".post-type-simple-pay .submitdelete").click((function(e){confirm(d)||e.preventDefault()})),o(".post-type-simple-pay #posts-filter").submit((function(e){"trash"===o(this).find('select[name="action"]').val()&&(confirm(d)||e.preventDefault())})))},initSortableFields:function(e){e.sortable({items:".simpay-field-metabox:not(.simpay-custom-field-payment-button):not(.simpay-custom-field-checkout-button)",containment:"#simpay-form-settings",handle:".simpay-hndle",placeholder:"sortable-placeholder",cursor:"move",delay:o(document.body).hasClass("mobile")?200:0,distance:2,tolerance:"pointer",forcePlaceholderSize:!0,opacity:.65,stop:function(e,t){p.orderFields()},helper:function(e,t){return t.clone().find(":input").attr("name",(function(e,t){return"sort_"+parseInt(1e5*Math.random(),10).toString()+"_"+t})).end()}})},addField:function(e){var t=s.find(".simpay-custom-fields .simpay-field-metabox").length,n=o("#simpay-custom-fields-wrap").find(".simpay-metaboxes"),i=s.find("#custom-field-select"),c=i.val(),l=r()(document.querySelectorAll(".field-uid")).map((function(e){return parseInt(e.value)})),u={action:"simpay_add_field",post_id:o("#post_ID").val(),fieldType:c,counter:parseInt(t)+1,nextUid:parseInt(_.max(l))+1,addFieldNonce:s.find("#simpay_custom_fields_nonce").val()};e.preventDefault(),s.find(".postbox").each((function(){o(this).is(":visible")&&o(this).addClass("closed")})),o.ajax({url:ajaxurl,method:"POST",data:u,success:function(e){var t=o("
").append(e);["payment_button","checkout_button"].includes(c)?n.append(t.html()):n.prepend(t.html()),i.prop("selectedIndex",0),p.orderFields(),a.b.doAction("customFieldAdded",e)},error:function(e){window.spShared.debugLog(e)}})},removeField:function(e){if(e.preventDefault(),s.find("#custom-field-select"),window.confirm("Are you sure you want to remove this field?")){var t=o(this).closest(".simpay-field-metabox");t.data("type"),t.remove(),a.b.doAction("customFieldRemoved")}},orderFields:function(){o(".simpay-custom-fields .simpay-field-metabox").each((function(e,t){var n=parseInt(o(t).index(".simpay-custom-fields .simpay-field-metabox"));o(".field-order",t).val(n+1)}))}},(o=e)(document).ready((function(e){p.init()}))}.call(this,n(7))},function(e,t,n){"use strict";var r=n(10),a=n.n(r),i=n(0),o=simpayAdminSettingToggles||[];function c(e){var t=e.id,n=document.querySelector(".simpay-settings-".concat(t));if(!n)return{};var r=n.querySelectorAll('input[name="simpay_settings['.concat(t,']"]'));0===r.length&&(r=n.querySelectorAll('select[name="'.concat(t,'"]')));var i=r[0].value;if(["radio","checkbox"].includes(r[0].type)){var o=a()(r).filter((function(e){return e.checked}));i=0===o.length?"no":o[0].value}return{setting:r,currentValue:i}}function s(e){var t=e.id,n=e.value,r=e.toggles,a=e.compare;if("none"!==document.querySelector(".simpay-settings-".concat(t)).style.display){var i=c(e).currentValue;r.map((function(e){return document.querySelector(".simpay-settings-".concat(e))})).forEach((function(e){e&&(e.style.display="IS NOT"===a?i===n?"none":"table-row":i===n?"table-row":"none")})),r.forEach((function(e){var t=_.find(o,{id:e});t&&s(t)}))}}Object(i.a)((function(){o.forEach((function(e){s(e),c(e).setting.forEach((function(t){t.addEventListener("change",(function(){s(e)}))}))}))}))},function(e,t,n){"use strict";var r=n(0);Object(r.a)((function(){var e=window.wpsp.hooks,t=document.querySelectorAll('[name="simpay_settings[test_mode]"]');if(0!==t.length){var n="enabled"===document.querySelector('[name="simpay_settings[test_mode]"]:checked').value?"test":"live";e.doAction("settings.toggleTestMode",n,n),_.each(t,(function(t){return t.addEventListener("change",(function(t){var r="enabled"===t.target.value?"test":"live";e.doAction("settings.toggleTestMode",r,n)}))}))}}))},function(e,t,n){"use strict";var r=n(0);function a(e){var t=document.getElementById("simpay-connect-license-feedback"),n=document.getElementById("simpay-connect-license-submit");e.message?(t.innerText=e.message,t.classList.remove("simpay-license-message--valid"),t.classList.add("simpay-license-message--invalid"),t.style.display="block"):t.style.display="none",e.reload?setTimeout((function(){window.location.reload()}),2e3):(n.disabled=!1,n.innerText=n.dataset.connect)}function i(e){var t=document.getElementById("simpay-connect-license-feedback");e.message?(t.innerText=e.message,t.classList.remove("simpay-license-message--invalid"),t.classList.add("simpay-license-message--valid"),t.style.display="block"):t.style.display="none",e.reload?setTimeout((function(){window.location.reload()}),2e3):window.location=e.url}function o(){var e=document.getElementById("simpay-connect-license-key"),t=document.getElementById("simpay-connect-license-nonce"),n=document.getElementById("simpay-connect-license-submit");n.disabled=!0,n.innerText=n.dataset.connecting,wp.ajax.send("simpay_get_connect_url",{data:{nonce:t.value,key:e.value},success:i,error:a})}Object(r.a)((function(){var e=document.getElementById("simpay-connect-license-key");if(e){var t=document.getElementById("simpay-connect-license-submit");e.addEventListener("keypress",(function(e){"Enter"===e.key&&(e.preventDefault(),o())})),t.addEventListener("click",(function(e){e.preventDefault(),t.disabled=!0,o()}))}}))},function(e,t,n){"use strict";var r=n(0),a=[".simpay-settings-hcaptcha_setup",".simpay-settings-hcaptcha_site_key",".simpay-settings-hcaptcha_secret_key",".simpay-settings-recaptcha_setup",".simpay-settings-recaptcha_site_key",".simpay-settings-recaptcha_secret_key",".simpay-settings-recaptcha_score_threshold",".simpay-settings-cloudflare_turnstile_setup",".simpay-settings-cloudflare_turnstile_site_key",".simpay-settings-cloudflare_turnstile_secret_key",".simpay-settings-no_captcha_warning"];function i(e){var t,n=e.target.value;switch(n){case"none":t="no_captcha";break;case"recaptcha-v3":t="recaptcha";break;case"cloudflare-turnstile":t="cloudflare_turnstile";break;default:t=n}a.forEach((function(e){var n=document.querySelector(e);n&&(n.style.display=e.includes(t)?"table-row":"none")}))}Object(r.a)((function(){var e=document.querySelectorAll('input[name="simpay_settings[captcha_type]"]');if(0!==e.length){a.forEach((function(e){var t=document.querySelector(e);t&&(t.style.display="none")})),e.forEach((function(e){return e.addEventListener("change",i)}));var t=document.querySelector('input[name="simpay_settings[captcha_type]"]:checked');t&&t.dispatchEvent(new Event("change")),function(){var e=document.querySelector(".simpay-recaptcha-feedback");if(e){var t=simpayGoogleRecaptcha,n=t.siteKey,r=t.i18n;""!==n&&grecaptcha.ready((function(){var e=document.querySelector(".grecaptcha-badge");e&&(e.style.display="none");try{grecaptcha.execute(n,{action:"simple_pay_admin_test"}).then((function(e){wp.ajax.send("simpay_validate_recaptcha_source",{data:{token:e,recaptcha_action:"simple_pay_admin_test"},error:a})})).catch(a)}catch(e){a()}}))}function a(){e.style.display="block",e.classList.add("notice-error"),e.innerHTML="";var t=document.createElement("p");t.innerText=r.invalid,e.appendChild(t)}}()}}))},function(e,t,n){"use strict";var r=n(0),a=n(3);Object(r.a)((function(){var e=document.querySelector(".simpay-settings-emails-configure");e&&(document.querySelector(".simpay-settings-subsection-delivery").after(e),function(e){var t=e.querySelector("select");t&&t.addEventListener("change",(function(e){var n=e.target,r=n.options[n.selectedIndex].dataset,i=r.available,o=r.upgradeTitle,c=r.upgradeDescription,s=r.upgradeUrl,l=r.upgradePurchasedUrl;"no"===i&&(Object(a.upgradeModal)({title:o,description:c,url:s,purchasedUrl:l}),t.value="",t.selectedIndex=0)}))}(e))}))},function(e,t,n){"use strict";(function(e){var t=n(4),r=n.n(t),a=n(0),i=n(3);Object(a.a)((function(){var t,n,a,o,c=document.querySelector(".post-type-simple-pay #post");if(c){var s=r()(c,{hash:!0});delete s.simpay_form_settings_tab,function(t){function n(e){var n=r()(document.querySelector(".post-type-simple-pay form#post"),{hash:!0});if(delete n.simpay_form_settings_tab,delete n.simpay_save_preview,JSON.stringify(n)!==t)return e.preventDefault(),simpayAdmin.i18n.leavePageConfirm}window.addEventListener("beforeunload",n),window.onbeforeunload=n,e(".post-type-simple-pay form#post").off("submit").on("submit",(function(){window.removeEventListener("beforeunload",n),window.onbeforeunload=null}))}(JSON.stringify(s)),a=document.getElementById("form-type-select"),o=document.getElementById("is-overlay"),a.addEventListener("change",(function(e){var t=e.target,n=t.options[t.selectedIndex],r=n.value;"on-site"===r&&Object(i.maybeBlockSelectWithUpgradeModal)(e),"off-site"===r&&(o.querySelector("input").checked=!1),o.style.display="yes"===n.dataset.available&&"on-site"===r?"block":"none"})),(n=document.getElementById("_recaptcha"))&&n.addEventListener("change",(function(e){e.preventDefault(),e.target.checked=!e.target.checked,window.open(e.target.dataset.settingsUrl,"_blank")})),function(){var e=document.getElementById("_email_verification");e&&e.addEventListener("change",(function(e){e.preventDefault(),e.target.checked=!e.target.checked,window.open(e.target.dataset.settingsUrl,"_blank")}))}(),(t=document.querySelector("#_company_name"))&&(t.addEventListener("blur",(function(){0===t.value.length?(t.nextElementSibling.classList.remove("hidden"),t.value=simpayAdmin.siteTitle):t.nextElementSibling.classList.add("hidden")})),t.addEventListener("focus",(function(){0!==t.value.length&&t.nextElementSibling.classList.add("hidden")})))}}))}).call(this,n(7))},function(e,t,n){"use strict";(function(e){var t=n(10),r=n.n(t),a=n(0),i=n(8),o=n(3);function c(){var e=document.getElementById("simpay-prices");if(e){var t=e.querySelectorAll(".simpay-price").length;document.querySelectorAll(".simpay-price-label-default").forEach((function(e){return e.style.display=t>1?"none":"block"})),document.querySelectorAll(".simpay-price-label-display").forEach((function(e){return e.style.display=t>1?"block":"none"})),document.querySelectorAll(".simpay-price-option-label").forEach((function(e){if(t>1)e.style.display="block";else{var n=e.querySelector("input");n&&""!==n.value.trim()?e.style.display="block":e.style.display="none"}})),document.querySelectorAll(".simpay-price-default-check").forEach((function(e){return e.style.display=t>1?"block":"none"}));var n=document.querySelector(".simpay-custom-field-plan-select");n&&(n.style.display=t>1?"block":"none")}}function s(e){var t,n=e.querySelector(".simpay-price-label-display"),r=e.querySelector(".simpay-price-label"),a=simpayAdmin,o=a.currencyPosition,c=a.i18n,s=c.recurringIntervals,l=c.recurringIntervalDisplay,u=c.customAmountLabel;if(""!==r.value)t=r.value;else{var d=e.querySelector(".simpay-price-currency"),p=e.querySelector(".simpay-price-amount"),m=e.querySelector(".simpay-price-amount-type"),f=e.querySelector(".simpay-price-custom-amount input"),y=e.querySelector(".simpay-price-enable-custom-amount"),h=d.options[d.selectedIndex].dataset.symbol;switch(t=!0===y.checked?f.value:p.value,o){case"left":t="".concat(h).concat(t);break;case"left_space":t="".concat(h," ").concat(t);break;case"right":t="".concat(t).concat(h);break;case"right_space":t="".concat(t," ").concat(h)}if(!0===y.checked&&(t=u.replace("%s",t)),"recurring"===m.value){var v=e.querySelector(".simpay-price-recurring-interval"),g=e.querySelector(".simpay-price-recurring-interval-count"),b=s[v.options[v.selectedIndex].value];t=l.replace("%1$s",t).replace("%2$s",g.value).replace("%3$s","1"===g.value?b[0]:b[1])}}n.innerHTML=t,Object(i.c)("simpayFormBuilderPriceOptionLabelUpdated",t,e)}function l(e,t){e.querySelector(".simpay-price-recurring-settings").style.display=t.checked?"table":"none"}function u(e){var t=e.querySelector(".simpay-price-recurring-interval"),n=e.querySelector(".simpay-price-recurring-interval-count"),a=parseInt(n.value);switch(t.options[t.selectedIndex].value){case"day":a>365&&(n.value=365);break;case"week":a>52&&(n.value=52);break;case"month":a>12&&(n.value=12);break;case"year":a>1&&(n.value=1)}var i=JSON.parse(t.dataset.intervals);r()(t.options).forEach((function(e,r){var a=e.value;t.options[r].text=1===parseInt(n.value)?i[a][0]:i[a][1]}))}function d(){document.querySelectorAll(".simpay-price").forEach((function(e){var t=e.querySelector(".simpay-price-amount-type").value;e.querySelector(".simpay-price-label").addEventListener("keyup",(function(){return s(e)})),s(e),e.querySelector(".simpay-price-currency").addEventListener("change",(function(){!function(e){var t=e.querySelector(".simpay-price-currency"),n=t.options[t.selectedIndex].dataset.symbol;e.querySelectorAll(".simpay-price-currency-symbol").forEach((function(e){return e.innerText=n}))}(e),s(e)}));var n=e.querySelectorAll(".simpay-price-amount-type .button");n.length>0&&n.forEach((function(t){return t.addEventListener("click",(function(t){t.preventDefault();var n=t.target.dataset,r=n.available,a=n.upgradeTitle,i=n.upgradeDescription,c=n.upgradeUrl,l=n.upgradePurchasedUrl;"no"===r?Object(o.upgradeModal)({title:a,description:i,url:c,purchasedUrl:l}):(function(e,t){e.querySelectorAll(".simpay-price-amount-type .button").forEach((function(e){return e.classList.remove("button-primary")}));var n=t.dataset.amountType,r=e.querySelector(".simpay-price-recurring-settings");t.classList.add("button-primary"),r.style.display="recurring"===n?"table":"none";var a=e.querySelector(".simpay-price-recurring-amount-toggle"),i=e.querySelector(".simpay-price-enable-optional-subscription");a.style.display="recurring"===n?"none":"block",i.checked=!1,e.querySelector(".simpay-price-amount-type").value=n}(e,t.target),s(e))}))})),e.querySelector(".simpay-price-amount").addEventListener("keyup",(function(){return s(e)}));var r=e.querySelector(".simpay-price-enable-optional-subscription");r&&(r.addEventListener("click",(function(t){var n=t.target,r=n.dataset,a=r.available,i=r.upgradeTitle,c=r.upgradeDescription,u=r.upgradeUrl,d=r.upgradePurchasedUrl;"no"===a?(n.checked=!1,t.preventDefault(),Object(o.upgradeModal)({title:i,description:c,url:u,purchasedUrl:d})):(l(e,n),s(e))})),"recurring"!==t&&l(e,r));var a=e.querySelector(".simpay-price-enable-custom-amount");a.addEventListener("change",(function(){!function(e,t){e.querySelector(".simpay-price-custom-amount").style.display=t.checked?"table":"none"}(e,a),s(e)})),e.querySelector(".simpay-price-recurring-interval").addEventListener("change",(function(){s(e),u(e)}));var d=e.querySelector(".simpay-price-recurring-interval-count");u(e),d.addEventListener("keyup",(function(){u(e),s(e)})),d.addEventListener("change",(function(){u(e),s(e)}));var m=e.querySelector(".simpay-price-legacy-setting-toggle");m&&m.addEventListener("click",(function(t){t.preventDefault(),function(e){e.querySelectorAll(".simpay-price-legacy-setting").forEach((function(e){return e.style.display="block"===e.style.display?"none":"block"}))}(e)})),e.querySelector(".simpay-price-default").addEventListener("change",(function(){return function(e){document.querySelectorAll(".simpay-price-default").forEach((function(e){return e.checked=!1})),e.querySelector(".simpay-price-default").checked=!0}(e)})),e.querySelector(".simpay-price-remove").addEventListener("click",(function(t){t.preventDefault(),function(e){e.remove(),p(),c(),Object(i.c)("simpayFormBuilderPriceRemoved",e.id)}(e)}))})),c()}function p(){var e=document.querySelectorAll(".simpay-price");document.querySelector(".simpay-price-default:checked")||(e[0].querySelector(".simpay-price-default").checked=!0)}Object(a.a)((function(){var t,n,r,a,s,l,u;e(".simpay-prices").sortable({items:".simpay-field-metabox",containment:"#simpay-prices",handle:".simpay-hndle",placeholder:"sortable-placeholder",cursor:"move",delay:e(document.body).hasClass("mobile")?200:0,distance:2,tolerance:"pointer",forcePlaceholderSize:!0,opacity:.65,helper:function(e,t){return t.clone().find(":input").attr("name",(function(e,t){return"sort_"+parseInt(1e5*Math.random(),10).toString()+"_"+t})).end()}}),d(),t=document.getElementById("simpay-prices-advanced-toggle"),n=document.getElementById("simpay-prices-advanced"),t&&n&&t.addEventListener("click",(function(e){e.preventDefault(),n.style.display="block"===n.style.display?"none":"block"})),(u=document.getElementById("simpay-prices-advanced-add"))&&u.addEventListener("click",(function(t){var n,r,a,i,o,s;t.preventDefault(),a=(r=(n=u).dataset).nonce,i=r.formId,o=document.getElementById("simpay-prices"),s=document.getElementById("simpay-prices-advanced-plan-id"),n.classList.add("disabled"),wp.ajax.send("simpay_add_plan",{data:{_wpnonce:a,form_id:i,plan_id:s.value},success:function(t){e(o).append(t),d(),document.getElementById("simpay-prices-advanced").style.display="none",s.value="",n.classList.remove("disabled"),c()},error:function(e){var t=e.message;window.alert(t),n.classList.remove("disabled")}})})),function(){var t=document.getElementById("simpay-add-price");t&&t.addEventListener("click",(function(n){var r,a,o,s,l;n.preventDefault(),o=(a=(r=t).dataset).nonce,s=a.formId,l=document.getElementById("simpay-prices"),r.classList.add("disabled"),wp.ajax.send("simpay_add_price",{data:{_wpnonce:o,form_id:s},success:function(t){e(l).append(t),d(),p(),r.classList.remove("disabled"),c(),Object(i.c)("simpayFormBuilderPriceAdded",t)},error:function(e){var t=e.message;window.alert(t),r.classList.remove("disabled")}})}))}(),(r=document.getElementById("simpay-add-price-lite"))&&r.addEventListener("click",o.maybeBlockButtonWithUpgradeModal),(a=document.getElementById("simpay-amount-type-lite"))&&a.addEventListener("click",o.maybeBlockButtonWithUpgradeModal),(s=document.getElementById("simpay-can-recur-lite"))&&s.addEventListener("click",o.maybeBlockButtonWithUpgradeModal),(l=document.getElementById("simpay-custom-lite"))&&l.addEventListener("click",o.maybeBlockButtonWithUpgradeModal)}))}).call(this,n(7))},function(e,t,n){"use strict";(function(e){var t=n(0),r=n(3);Object(t.a)((function(){var t;document.querySelector(".post-type-simple-pay #post")&&(t=e("#simpay-form-settings").find("#lite-add-field"))&&t.on("click.simpayAddField",(function(e){var t=e,n=document.querySelectorAll(".simpay-custom-fields > div").length;t.target.dataset.available=n>=3?"no":"yes",Object(r.maybeBlockButtonWithUpgradeModal)(t)&&e.stopImmediatePropagation()}))}))}).call(this,n(7))},function(e,t,n){"use strict";(function(e){var t=n(0),r=n(3);Object(t.a)((function(){var t,n,a;(t=document.querySelector('[name="_enable_payment_page"]'))&&t.addEventListener("change",r.maybeBlockCheckboxWithUpgradeModal),(n=document.querySelector('[name="_payment_page_powered_by"]'))&&n.addEventListener("change",r.maybeBlockCheckboxWithUpgradeModal),function(){if(document.getElementById("payment-page-background-color-custom")){e("#payment-page-background-color-custom").wpColorPicker();var t=document.querySelector(".simpay-payment-page-background-color .wp-color-result"),n=document.querySelectorAll(".simpay-payment-page-background-color");t.addEventListener("click",(function(t){n.forEach((function(e){e.querySelector("input").checked=!1})),t.target.classList.add("is-selected"),e(t.target).parent().find("input").prop("checked",!0)})),n.forEach((function(e){e.querySelector("input").addEventListener("change",(function(){t.classList.remove("is-selected")}))}))}}(),(a=document.querySelector('[name="_payment_page_slug"]'))&&a.addEventListener("keyup",(function(e){var t=document.querySelector(".simpay-payment-page-url");t&&(t.dataset.clipboardText="".concat(window.location.origin,"/").concat(e.target.value))}))}))}).call(this,n(7))},function(e,t,n){"use strict";(function(e){var t=n(6),r=n.n(t),a=n(0),i='',o='',c=simpayAdmin,s=c.nonce,l=c.ajaxUrl,u=c.i18n,d=u.addonActivated,p=u.addonActivate,m=u.addonActive,f=u.addonDeactivate,y=u.addonInactive,h=u.addonInstall,v=u.addonError,g=u.pluginError;function b(t){t.preventDefault();var n,a,c,u,b,_,k=e(t.target);if(k.hasClass("status-go-to-url"))window.open(k.attr("data-plugin"),"_blank");else{var w=k.attr("data-type");if(k.prop("disabled",!0).addClass("loading"),k.html(''),k.hasClass("status-active"))n="deactivate",a="status-installed","plugin"===w&&(a+=" button button-secondary"),c=y,u=p,b=f,"addon"===w&&(u=i+u,b=o+b);else if(k.hasClass("status-installed"))n="activate",a="status-active","plugin"===w&&(a+=" button button-secondary disabled"),c=m,u=f,"addon"===w?(u=o+u,b=i+p):"plugin"===w&&(u=d,b=p);else{if(!k.hasClass("status-missing"))return;n="install",a="status-active","plugin"===w&&(a+=" button disabled"),c=m,u=d,b='',"addon"===w&&(u=i+f,b+=h)}var x=k.closest(".simpay-addon");!function(t,n,r,a){var i={activate:"simpay_activate_addon",install:"simpay_install_addon",deactivate:"simpay_deactivate_addon"}[n];if(i){var o={action:i,nonce:s,plugin:t,type:r};e.post(l,o,a).fail((function(e){console.log(e.responseText)}))}}(k.attr("data-plugin"),n,w,(function(e){e.success?("install"===n?(k.attr("data-plugin",e.data.basename),_=e.data.msg,e.data.is_activated||(c=y,u="plugin"===w?p:i+p,a="plugin"===w?"status-installed button button-secondary":"status-installed")):_=e.data,x.find(".simpay-addon__actions").append('
'+_+"
"),x.find("span.status-label").removeClass("status-active status-installed status-missing").addClass(a).removeClass("button button-primary button-secondary disabled").text(c),k.removeClass("status-active status-installed status-missing").removeClass("button button-primary button-secondary disabled").addClass(a).html(u)):("object"===r()(e.data)?"addon"===w?x.find(".simpay-addon__actions").append('
'+v+"
"):x.find(".simpay-addon__actions").append('
'+g+"
"):x.find(".simpay-addon__actions").append('
'+e.data+"
"),"install"===n&&"plugin"===w&&k.addClass("status-go-to-url").removeClass("status-missing"),k.html(b)),k.prop("disabled",!1).removeClass("loading"),setTimeout((function(){x.find(".msg").remove()}),3e3)}))}}Object(a.a)((function(){document.querySelector(".simpay-addons")&&document.querySelectorAll(".simpay-addon").forEach((function(e){e.querySelector("button").addEventListener("click",b)}))}))}).call(this,n(7))},function(e,t,n){"use strict";var r=n(0);Object(r.a)((function(){var e=new ClipboardJS(".simpay-copy-button");e.on("success",(function(t){var n=t.trigger,r=n.dataset.copied,a=n.innerHTML;clearTimeout(i),n.innerHTML=r,n.classList.contains("button-secondary")&&(n.style.color="green",n.style.borderColor="green"),t.clearSelection();var i=setTimeout((function(){n.innerHTML=a,n.classList.contains("button-secondary")&&(n.style.color="",n.style.borderColor=""),e.clipboardAction.fakeElem&&e.clipboardAction.removeFake&&e.clipboardAction.removeFake()}),3e3);wp.a11y.speak(r)}))}))},,,,,,,,,,,,,,,,function(e,t,n){"use strict";n(38),n(39);var r=n(10),a=n.n(r),i=n(0),o=n(3);function c(e){var t=e.target,n=t.options[t.selectedIndex].value,r=document.querySelectorAll(".simpay-panel-field-payment-method[data-payment-method]");a()(r).forEach((function(e){var t="popular"===JSON.parse(e.dataset.paymentMethod).scope?"block":"none";e.style.display="all"===n?"block":t}))}Object(i.a)((function(){var e=document.querySelectorAll(".simpay-panel-field-payment-method-filter");0!==e.length&&a()(e).forEach((function(e){e.addEventListener("change",c)}));var t=document.querySelectorAll(".simpay-payment-method-lite");t&&t.forEach((function(e){return e.addEventListener("change",o.maybeBlockCheckboxWithUpgradeModal)}));var n=document.querySelectorAll(".simpay-payment-method-fee-recovery-lite");n&&n.forEach((function(e){return e.addEventListener("click",o.maybeBlockButtonWithUpgradeModal)}))})),Object(i.a)((function(){var e=document.getElementById("_tax_status_lite");e&&e.addEventListener("change",o.maybeBlockSelectWithUpgradeModal)})),n(40),Object(i.a)((function(){var e,t;(e=document.getElementById("_enable_tax_id"))&&e.addEventListener("change",o.maybeBlockCheckboxWithUpgradeModal),(t=document.getElementById("_enable_promotion_codes"))&&t.addEventListener("change",o.maybeBlockCheckboxWithUpgradeModal)})),n(41),Object(i.a)((function(){var e=document.getElementById("_inventory");e&&e.addEventListener("change",o.maybeBlockCheckboxWithUpgradeModal);var t=document.getElementById("_inventory_behavior_individual");t&&t.addEventListener("change",o.maybeBlockCheckboxWithUpgradeModal);var n=document.getElementById("_schedule_start");n&&n.addEventListener("change",o.maybeBlockCheckboxWithUpgradeModal);var r=document.getElementById("_schedule_end");r&&r.addEventListener("change",o.maybeBlockCheckboxWithUpgradeModal)})),Object(i.a)((function(){var e=document.getElementById("automations-search");if(e){var t=document.querySelectorAll(".simpay-form-builder-automator__integrations-integration");e.addEventListener("input",(function(){var n=e.value.toLowerCase();t.forEach((function(e){for(var t=Object.values(e.dataset),r=0;r array('wp-block-editor', 'wp-components', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-primitives'), 'version' => 'f832a397ccab62027d2aab6dcfeae955'); \ No newline at end of file + array('wp-block-editor', 'wp-components', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-primitives'), 'version' => 'b18683d83e7524462f85ba4914d1391f'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-block-button.js b/includes/core/assets/js/dist/simpay-block-button.js index 3d964eed..c1ea774e 100644 --- a/includes/core/assets/js/dist/simpay-block-button.js +++ b/includes/core/assets/js/dist/simpay-block-button.js @@ -1 +1 @@ -!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}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=85)}({0:function(e,t){e.exports=window.wp.element},11:function(e,t,r){var o=r(30);e.exports=function(e,t,r){return(t=o(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},2:function(e,t){e.exports=window.wp.i18n},20:function(e,t){e.exports=window.wp.compose},21:function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);re.length)&&(t=e.length);for(var r=0,o=new Array(t);r array(), 'version' => '1334fe88e4b24843d98aa4ae04c0275a'); \ No newline at end of file + array(), 'version' => '91ece58c7a9ea4949d4f311a542142fc'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-block-payment-form.asset.php b/includes/core/assets/js/dist/simpay-block-payment-form.asset.php index 6e425254..3a808135 100644 --- a/includes/core/assets/js/dist/simpay-block-payment-form.asset.php +++ b/includes/core/assets/js/dist/simpay-block-payment-form.asset.php @@ -1 +1 @@ - array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-server-side-render'), 'version' => '0e00c2ad55cf5fb0e7e38ffbc8efe143'); \ No newline at end of file + array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-server-side-render'), 'version' => 'f4d7ea43f1839a3ab7a2f8eb25fc66bb'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-block-payment-form.js b/includes/core/assets/js/dist/simpay-block-payment-form.js index 92e5fdf8..58d5f6e0 100644 --- a/includes/core/assets/js/dist/simpay-block-payment-form.js +++ b/includes/core/assets/js/dist/simpay-block-payment-form.js @@ -1 +1 @@ -!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=84)}({0:function(e,t){e.exports=window.wp.element},16:function(e,t){e.exports=window.wp.data},2:function(e,t){e.exports=window.wp.i18n},21:function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r compat for WordPress 5.6-5.8 - -/** - * External dependencies - */ -import classnames from 'classnames'; - -/** - * WordPress dependencies - */ -import { useInstanceId } from '@wordpress/compose'; -import { __ } from '@wordpress/i18n'; -import { Icon, search, closeSmall } from '@wordpress/icons'; -import { useRef } from '@wordpress/element'; -import { BaseControl, Button } from '@wordpress/components'; - -function SearchControl( { - className, - onChange, - value, - label, - placeholder = __( 'Search' ), - hideLabelFromVision = true, - help, -} ) { - const instanceId = useInstanceId( SearchControl ); - const searchInput = useRef(); - const id = `components-search-control-${ instanceId }`; - - return ( - -
- onChange( event.target.value ) } - autoComplete="off" - value={ value || '' } - /> -
- { !! value && ( -
-
-
- ); -} - -export default SearchControl; diff --git a/includes/core/assets/js/src/admin/index.js b/includes/core/assets/js/src/admin/index.js index fc13003d..89a3df97 100644 --- a/includes/core/assets/js/src/admin/index.js +++ b/includes/core/assets/js/src/admin/index.js @@ -554,9 +554,8 @@ let spAdmin = {}; e.preventDefault(); - spFormSettings.find( '.simpay-field-data' ).each( function () { + spFormSettings.find( '.postbox' ).each( function () { if ( $( this ).is( ':visible' ) ) { - $( this ).hide(); $( this ).addClass( 'closed' ); } } ); diff --git a/includes/core/assets/js/src/admin/pages/activity-reports/components/card-latest-payments/payment.js b/includes/core/assets/js/src/admin/pages/activity-reports/components/card-latest-payments/payment.js index 02d3167d..7c600dbf 100644 --- a/includes/core/assets/js/src/admin/pages/activity-reports/components/card-latest-payments/payment.js +++ b/includes/core/assets/js/src/admin/pages/activity-reports/components/card-latest-payments/payment.js @@ -7,7 +7,7 @@ import classnames from 'classnames'; * WordPress dependencies */ import { Tooltip } from '@wordpress/components'; -import { __ } from '@wordpress/i18n'; +import { __ , sprintf } from '@wordpress/i18n'; import { decodeEntities } from '@wordpress/html-entities'; function Payment( payment ) { @@ -27,6 +27,27 @@ function Payment( payment ) { 'is-failed': 'failed' === status, } ); + + const getTooltipText = () => { + if ( isPartialRefund() && 'refunded' === status ) { + return sprintf( + __('%s refund was initiated', 'simple-pay'), + decodeEntities(payment.amount_refunded_formatted) + ); + } + }; + + const isPartialRefund = () => { + if ( + status === 'refunded' && + payment.amount_refunded !== payment.amount_total + ) { + return true; + } + + return false; + }; + return ( @@ -45,32 +66,58 @@ function Payment( payment ) { ) } -
- { statusFormatted } + +
+ + { statusFormatted } + - -
+ +
+ diff --git a/includes/core/assets/js/src/admin/payment-form/template-explorer/search-control.js b/includes/core/assets/js/src/admin/payment-form/template-explorer/search-control.js deleted file mode 100644 index bca5b427..00000000 --- a/includes/core/assets/js/src/admin/payment-form/template-explorer/search-control.js +++ /dev/null @@ -1,67 +0,0 @@ -// compat for WordPress 5.6-5.8 - -/** - * External dependencies - */ -import classnames from 'classnames'; - -/** - * WordPress dependencies - */ -import { useInstanceId } from '@wordpress/compose'; -import { __ } from '@wordpress/i18n'; -import { Icon, search, closeSmall } from '@wordpress/icons'; -import { useRef } from '@wordpress/element'; -import { BaseControl, Button } from '@wordpress/components'; - -function SearchControl( { - className, - onChange, - value, - label, - placeholder = __( 'Search' ), - hideLabelFromVision = true, - help, -} ) { - const instanceId = useInstanceId( SearchControl ); - const searchInput = useRef(); - const id = `components-search-control-${ instanceId }`; - - return ( - -
- onChange( event.target.value ) } - autoComplete="off" - value={ value || '' } - /> -
- { !! value && ( -
-
-
- ); -} - -export default SearchControl; diff --git a/includes/core/assets/js/src/admin/payment-form/template-explorer/sidebar.js b/includes/core/assets/js/src/admin/payment-form/template-explorer/sidebar.js index f70f43de..f72fe6f0 100644 --- a/includes/core/assets/js/src/admin/payment-form/template-explorer/sidebar.js +++ b/includes/core/assets/js/src/admin/payment-form/template-explorer/sidebar.js @@ -6,13 +6,10 @@ import classnames from 'classnames'; /** * WordPress dependencies */ -import { Button, NavigableMenu } from '@wordpress/components'; +import { Button, NavigableMenu , SearchControl } from '@wordpress/components'; import { __ } from '@wordpress/i18n'; -/** - * Internal dependencies - */ -import SearchControl from './search-control.js'; + const baseClassName = 'simpay-form-template-explorer-main__sidebar'; diff --git a/includes/core/bootstrap/compatibility.php b/includes/core/bootstrap/compatibility.php index 935a5e8a..c3e3f9a6 100644 --- a/includes/core/bootstrap/compatibility.php +++ b/includes/core/bootstrap/compatibility.php @@ -33,8 +33,8 @@ function get_requirements_list() { return array( 'wp' => array( 'name' => 'WordPress', - 'requires' => '5.2', - 'met' => version_compare( get_bloginfo( 'version' ), '5.2', '>=' ), + 'requires' => '5.9', + 'met' => version_compare( get_bloginfo( 'version' ), '5.9', '>=' ), ), 'php' => array( 'name' => 'PHP', @@ -97,7 +97,7 @@ function show_admin_notices() { */ add_action( 'admin_notices', - function() use ( $requirement ) { + function () use ( $requirement ) { ?>
diff --git a/includes/core/forms/functions.php b/includes/core/forms/functions.php index 25d41f8c..b8a17da3 100644 --- a/includes/core/forms/functions.php +++ b/includes/core/forms/functions.php @@ -577,7 +577,7 @@ function simpay_payment_form_add_missing_custom_fields( } elseif ( false === $has_custom_amount ) { if ( isset( $fields['custom_amount'] ) ) { unset( $fields['custom_amount'] ); - $changes[] = __( 'Custom Amount Input has been removed from the payment form. A price option with that allows user-defined amounts is required. ', 'stripe' ); + $changes[] = __( 'Custom Amount Input has been removed from the payment form. A price option that allows user-defined amounts is required. ', 'stripe' ); } } diff --git a/includes/core/payments/payment-confirmation-template-tags.php b/includes/core/payments/payment-confirmation-template-tags.php index 2b8da8db..edc94986 100644 --- a/includes/core/payments/payment-confirmation-template-tags.php +++ b/includes/core/payments/payment-confirmation-template-tags.php @@ -102,6 +102,10 @@ function parse_content( $content, $payment_confirmation_data ) { if ( has_filter( sprintf( 'simpay_payment_confirmation_template_tag_%s', $tag ) ) ) { foreach ( $tags_with_keys as $tag_with_keys ) { + $keys = explode( '|', $tag_with_keys ); + + $fallback_value = isset( $keys[1] ) ? trim( trim( substr( $keys[1], 1, -1 ), '"' ) ) : ''; + /** * Filters the value used to replace the smart tag with. * @@ -121,6 +125,7 @@ function parse_content( $content, $payment_confirmation_data ) { * @param string $tag Payment confirmation smart tag name, excluding curly braces. * @param array $tags_with_keys Payment confirmation smart tags including keys, excluding curly braces. */ + $value = apply_filters( sprintf( 'simpay_payment_confirmation_template_tag_%s', $tag ), // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores $value, @@ -129,6 +134,10 @@ function parse_content( $content, $payment_confirmation_data ) { $tag_with_keys ); + if ( empty( $value ) ) { + $value = $fallback_value; + } + $content = replace_tag( $tag_with_keys, $value, $content ); } } @@ -149,7 +158,30 @@ function parse_content( $content, $payment_confirmation_data ) { * @return string */ function replace_tag( $tag, $value, $content ) { - return str_replace( '{' . $tag . '}', $value, $content ); + // Remove non-breaking spaces for tag only. + $content = preg_replace_callback( + '/\{([^}]*)\}/', + function ( $matches ) { + return str_replace( "\xC2\xA0", '', $matches[0] ); + }, + $content + ); + $pattern = '/{(' . $tag . '(?::\w+)*)(?:\s*\|\s*"((?:\\"|[^"])*?)")?\}/U'; + $content = preg_replace( '/\{\s*(.*?)\s*\}/', '{$1}', $content ); + preg_match_all( $pattern, $content, $matches, PREG_SET_ORDER ); + + if ( ! empty( $matches ) ) { + foreach ( $matches as $match ) { + // If value is empty, use the fallback value. + if ( empty( $value ) ) { + $value = isset( $match[2] ) ? $match[2] : $value; + } + // $match[0] is the full tag. Example: {form-details}. + $content = str_replace( $match[0], $value, $content ); + } + } + + return $content; } /** @@ -164,16 +196,31 @@ function replace_tag( $tag, $value, $content ) { * @return string $tags_with_keys Tag including keys, excluding curly braces. */ function get_tags_with_keys( $tag, $content ) { + // Remove non-breaking spaces for tag only. + $content = preg_replace_callback( + '/\{([^}]*)\}/', + function ( $matches ) { + return str_replace( "\xC2\xA0", '', $matches[0] ); + }, + $content + ); $tags_with_keys = array(); + $pattern = '/{(' . $tag . '(?::\w+)*)(?:\s*\|\s*"((?:\\"|[^"])*?)")?\}/U'; + $content = preg_replace( '/\{\s*(.*?)\s*\}/', '{$1}', $content ); - preg_match_all( '/{' . $tag . '(:.*)?}/U', $content, $matches ); + preg_match_all( $pattern, $content, $matches, PREG_SET_ORDER ); if ( ! empty( $matches ) ) { - $full_matches = $matches[0]; - foreach ( $full_matches as $match ) { - // Remove { from start and } from end. - $tags_with_keys[] = substr( $match, 1, -1 ); + foreach ( $matches as $match ) { + $tag_with_key = $match[1]; + $key = isset( $match[2] ) ? stripcslashes( $match[2] ) : ''; + + $unique_key = $tag_with_key . ( $key ? " | \"$key\"" : '' ); + + if ( ! in_array( $unique_key, $tags_with_keys, true ) ) { + $tags_with_keys[] = $unique_key; + } } } diff --git a/includes/core/settings/register-emails.php b/includes/core/settings/register-emails.php index aec4da5c..440a06fa 100644 --- a/includes/core/settings/register-emails.php +++ b/includes/core/settings/register-emails.php @@ -438,6 +438,11 @@ function add_email_selector() { Emails\Email\UpcomingInvoiceEmail::class, Emails\Email\InvoiceConfirmationEmail::class, Emails\Email\ManageSubscriptionsEmail::class, + Emails\Email\PaymentProcessingConfirmationEmail::class, + Emails\Email\PaymentProcessingNotificationEmail::class, + Emails\Email\PaymentRefundedConfirmationEmail::class, + Emails\Email\SubscriptionCancellationConfirmation::class, + Emails\Email\SubscriptionCancellationNotification::class, ), ), 'general' => array( diff --git a/lib/Symfony/Component/CssSelector/CHANGELOG.md b/lib/Symfony/Component/CssSelector/CHANGELOG.md index 4061ff20..de81fa2e 100644 --- a/lib/Symfony/Component/CssSelector/CHANGELOG.md +++ b/lib/Symfony/Component/CssSelector/CHANGELOG.md @@ -1,6 +1,11 @@ CHANGELOG ========= +4.4.0 +----- + + * Added support for `*:only-of-type` + 2.8.0 ----- diff --git a/lib/Symfony/Component/CssSelector/CssSelectorConverter.php b/lib/Symfony/Component/CssSelector/CssSelectorConverter.php index ffd641e8..3a62cc43 100644 --- a/lib/Symfony/Component/CssSelector/CssSelectorConverter.php +++ b/lib/Symfony/Component/CssSelector/CssSelectorConverter.php @@ -27,16 +27,23 @@ class CssSelectorConverter { private $translator; + private $cache; + + private static $xmlCache = []; + private static $htmlCache = []; /** * @param bool $html Whether HTML support should be enabled. Disable it for XML documents */ - public function __construct($html = true) + public function __construct(bool $html = true) { $this->translator = new Translator(); if ($html) { $this->translator->registerExtension(new HtmlExtension($this->translator)); + $this->cache = &self::$htmlCache; + } else { + $this->cache = &self::$xmlCache; } $this->translator @@ -53,13 +60,10 @@ public function __construct($html = true) * Optionally, a prefix can be added to the resulting XPath * expression with the $prefix parameter. * - * @param string $cssExpr The CSS expression - * @param string $prefix An optional prefix for the XPath expression - * * @return string */ - public function toXPath($cssExpr, $prefix = 'descendant-or-self::') + public function toXPath(string $cssExpr, string $prefix = 'descendant-or-self::') { - return $this->translator->cssToXPath($cssExpr, $prefix); + return $this->cache[$prefix][$cssExpr] ?? $this->cache[$prefix][$cssExpr] = $this->translator->cssToXPath($cssExpr, $prefix); } } diff --git a/lib/Symfony/Component/CssSelector/Exception/ExceptionInterface.php b/lib/Symfony/Component/CssSelector/Exception/ExceptionInterface.php index 649216a0..8c8c825e 100644 --- a/lib/Symfony/Component/CssSelector/Exception/ExceptionInterface.php +++ b/lib/Symfony/Component/CssSelector/Exception/ExceptionInterface.php @@ -19,6 +19,6 @@ * * @author Jean-François Simon */ -interface ExceptionInterface +interface ExceptionInterface extends \Throwable { } diff --git a/lib/Symfony/Component/CssSelector/Exception/SyntaxErrorException.php b/lib/Symfony/Component/CssSelector/Exception/SyntaxErrorException.php index 081a164e..1a5e279c 100644 --- a/lib/Symfony/Component/CssSelector/Exception/SyntaxErrorException.php +++ b/lib/Symfony/Component/CssSelector/Exception/SyntaxErrorException.php @@ -24,32 +24,25 @@ class SyntaxErrorException extends ParseException { /** - * @param string $expectedValue - * * @return self */ - public static function unexpectedToken($expectedValue, Token $foundToken) + public static function unexpectedToken(string $expectedValue, Token $foundToken) { return new self(sprintf('Expected %s, but %s found.', $expectedValue, $foundToken)); } /** - * @param string $pseudoElement - * @param string $unexpectedLocation - * * @return self */ - public static function pseudoElementFound($pseudoElement, $unexpectedLocation) + public static function pseudoElementFound(string $pseudoElement, string $unexpectedLocation) { return new self(sprintf('Unexpected pseudo-element "::%s" found %s.', $pseudoElement, $unexpectedLocation)); } /** - * @param int $position - * * @return self */ - public static function unclosedString($position) + public static function unclosedString(int $position) { return new self(sprintf('Unclosed/invalid string at %s.', $position)); } diff --git a/lib/Symfony/Component/CssSelector/LICENSE b/lib/Symfony/Component/CssSelector/LICENSE index 9e936ec0..0138f8f0 100644 --- a/lib/Symfony/Component/CssSelector/LICENSE +++ b/lib/Symfony/Component/CssSelector/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2020 Fabien Potencier +Copyright (c) 2004-present Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/lib/Symfony/Component/CssSelector/Node/AbstractNode.php b/lib/Symfony/Component/CssSelector/Node/AbstractNode.php index 0046a613..ce8fc043 100644 --- a/lib/Symfony/Component/CssSelector/Node/AbstractNode.php +++ b/lib/Symfony/Component/CssSelector/Node/AbstractNode.php @@ -28,10 +28,7 @@ abstract class AbstractNode implements NodeInterface */ private $nodeName; - /** - * @return string - */ - public function getNodeName() + public function getNodeName(): string { if (null === $this->nodeName) { $this->nodeName = preg_replace('~.*\\\\([^\\\\]+)Node$~', '$1', static::class); diff --git a/lib/Symfony/Component/CssSelector/Node/AttributeNode.php b/lib/Symfony/Component/CssSelector/Node/AttributeNode.php index 3fbccdfb..5587ff0c 100644 --- a/lib/Symfony/Component/CssSelector/Node/AttributeNode.php +++ b/lib/Symfony/Component/CssSelector/Node/AttributeNode.php @@ -29,13 +29,7 @@ class AttributeNode extends AbstractNode private $operator; private $value; - /** - * @param string $namespace - * @param string $attribute - * @param string $operator - * @param string $value - */ - public function __construct(NodeInterface $selector, $namespace, $attribute, $operator, $value) + public function __construct(NodeInterface $selector, ?string $namespace, string $attribute, string $operator, ?string $value) { $this->selector = $selector; $this->namespace = $namespace; @@ -44,42 +38,27 @@ public function __construct(NodeInterface $selector, $namespace, $attribute, $op $this->value = $value; } - /** - * @return NodeInterface - */ - public function getSelector() + public function getSelector(): NodeInterface { return $this->selector; } - /** - * @return string - */ - public function getNamespace() + public function getNamespace(): ?string { return $this->namespace; } - /** - * @return string - */ - public function getAttribute() + public function getAttribute(): string { return $this->attribute; } - /** - * @return string - */ - public function getOperator() + public function getOperator(): string { return $this->operator; } - /** - * @return string - */ - public function getValue() + public function getValue(): ?string { return $this->value; } @@ -87,15 +66,12 @@ public function getValue() /** * {@inheritdoc} */ - public function getSpecificity() + public function getSpecificity(): Specificity { return $this->selector->getSpecificity()->plus(new Specificity(0, 1, 0)); } - /** - * {@inheritdoc} - */ - public function __toString() + public function __toString(): string { $attribute = $this->namespace ? $this->namespace.'|'.$this->attribute : $this->attribute; diff --git a/lib/Symfony/Component/CssSelector/Node/ClassNode.php b/lib/Symfony/Component/CssSelector/Node/ClassNode.php index aa1e7603..d03ea954 100644 --- a/lib/Symfony/Component/CssSelector/Node/ClassNode.php +++ b/lib/Symfony/Component/CssSelector/Node/ClassNode.php @@ -26,27 +26,18 @@ class ClassNode extends AbstractNode private $selector; private $name; - /** - * @param string $name - */ - public function __construct(NodeInterface $selector, $name) + public function __construct(NodeInterface $selector, string $name) { $this->selector = $selector; $this->name = $name; } - /** - * @return NodeInterface - */ - public function getSelector() + public function getSelector(): NodeInterface { return $this->selector; } - /** - * @return string - */ - public function getName() + public function getName(): string { return $this->name; } @@ -54,15 +45,12 @@ public function getName() /** * {@inheritdoc} */ - public function getSpecificity() + public function getSpecificity(): Specificity { return $this->selector->getSpecificity()->plus(new Specificity(0, 1, 0)); } - /** - * {@inheritdoc} - */ - public function __toString() + public function __toString(): string { return sprintf('%s[%s.%s]', $this->getNodeName(), $this->selector, $this->name); } diff --git a/lib/Symfony/Component/CssSelector/Node/CombinedSelectorNode.php b/lib/Symfony/Component/CssSelector/Node/CombinedSelectorNode.php index 964659c6..09832c16 100644 --- a/lib/Symfony/Component/CssSelector/Node/CombinedSelectorNode.php +++ b/lib/Symfony/Component/CssSelector/Node/CombinedSelectorNode.php @@ -27,36 +27,24 @@ class CombinedSelectorNode extends AbstractNode private $combinator; private $subSelector; - /** - * @param string $combinator - */ - public function __construct(NodeInterface $selector, $combinator, NodeInterface $subSelector) + public function __construct(NodeInterface $selector, string $combinator, NodeInterface $subSelector) { $this->selector = $selector; $this->combinator = $combinator; $this->subSelector = $subSelector; } - /** - * @return NodeInterface - */ - public function getSelector() + public function getSelector(): NodeInterface { return $this->selector; } - /** - * @return string - */ - public function getCombinator() + public function getCombinator(): string { return $this->combinator; } - /** - * @return NodeInterface - */ - public function getSubSelector() + public function getSubSelector(): NodeInterface { return $this->subSelector; } @@ -64,15 +52,12 @@ public function getSubSelector() /** * {@inheritdoc} */ - public function getSpecificity() + public function getSpecificity(): Specificity { return $this->selector->getSpecificity()->plus($this->subSelector->getSpecificity()); } - /** - * {@inheritdoc} - */ - public function __toString() + public function __toString(): string { $combinator = ' ' === $this->combinator ? '' : $this->combinator; diff --git a/lib/Symfony/Component/CssSelector/Node/ElementNode.php b/lib/Symfony/Component/CssSelector/Node/ElementNode.php index ce28f31b..a68b629b 100644 --- a/lib/Symfony/Component/CssSelector/Node/ElementNode.php +++ b/lib/Symfony/Component/CssSelector/Node/ElementNode.php @@ -26,28 +26,18 @@ class ElementNode extends AbstractNode private $namespace; private $element; - /** - * @param string|null $namespace - * @param string|null $element - */ - public function __construct($namespace = null, $element = null) + public function __construct(?string $namespace = null, ?string $element = null) { $this->namespace = $namespace; $this->element = $element; } - /** - * @return string|null - */ - public function getNamespace() + public function getNamespace(): ?string { return $this->namespace; } - /** - * @return string|null - */ - public function getElement() + public function getElement(): ?string { return $this->element; } @@ -55,15 +45,12 @@ public function getElement() /** * {@inheritdoc} */ - public function getSpecificity() + public function getSpecificity(): Specificity { return new Specificity(0, 0, $this->element ? 1 : 0); } - /** - * {@inheritdoc} - */ - public function __toString() + public function __toString(): string { $element = $this->element ?: '*'; diff --git a/lib/Symfony/Component/CssSelector/Node/FunctionNode.php b/lib/Symfony/Component/CssSelector/Node/FunctionNode.php index 311fc648..14d07b1c 100644 --- a/lib/Symfony/Component/CssSelector/Node/FunctionNode.php +++ b/lib/Symfony/Component/CssSelector/Node/FunctionNode.php @@ -30,28 +30,21 @@ class FunctionNode extends AbstractNode private $arguments; /** - * @param string $name * @param Token[] $arguments */ - public function __construct(NodeInterface $selector, $name, array $arguments = []) + public function __construct(NodeInterface $selector, string $name, array $arguments = []) { $this->selector = $selector; $this->name = strtolower($name); $this->arguments = $arguments; } - /** - * @return NodeInterface - */ - public function getSelector() + public function getSelector(): NodeInterface { return $this->selector; } - /** - * @return string - */ - public function getName() + public function getName(): string { return $this->name; } @@ -59,7 +52,7 @@ public function getName() /** * @return Token[] */ - public function getArguments() + public function getArguments(): array { return $this->arguments; } @@ -67,15 +60,12 @@ public function getArguments() /** * {@inheritdoc} */ - public function getSpecificity() + public function getSpecificity(): Specificity { return $this->selector->getSpecificity()->plus(new Specificity(0, 1, 0)); } - /** - * {@inheritdoc} - */ - public function __toString() + public function __toString(): string { $arguments = implode(', ', array_map(function (Token $token) { return "'".$token->getValue()."'"; diff --git a/lib/Symfony/Component/CssSelector/Node/HashNode.php b/lib/Symfony/Component/CssSelector/Node/HashNode.php index a6bd2394..524ac76a 100644 --- a/lib/Symfony/Component/CssSelector/Node/HashNode.php +++ b/lib/Symfony/Component/CssSelector/Node/HashNode.php @@ -26,27 +26,18 @@ class HashNode extends AbstractNode private $selector; private $id; - /** - * @param string $id - */ - public function __construct(NodeInterface $selector, $id) + public function __construct(NodeInterface $selector, string $id) { $this->selector = $selector; $this->id = $id; } - /** - * @return NodeInterface - */ - public function getSelector() + public function getSelector(): NodeInterface { return $this->selector; } - /** - * @return string - */ - public function getId() + public function getId(): string { return $this->id; } @@ -54,15 +45,12 @@ public function getId() /** * {@inheritdoc} */ - public function getSpecificity() + public function getSpecificity(): Specificity { return $this->selector->getSpecificity()->plus(new Specificity(1, 0, 0)); } - /** - * {@inheritdoc} - */ - public function __toString() + public function __toString(): string { return sprintf('%s[%s#%s]', $this->getNodeName(), $this->selector, $this->id); } diff --git a/lib/Symfony/Component/CssSelector/Node/NegationNode.php b/lib/Symfony/Component/CssSelector/Node/NegationNode.php index d014c76d..39010ca6 100644 --- a/lib/Symfony/Component/CssSelector/Node/NegationNode.php +++ b/lib/Symfony/Component/CssSelector/Node/NegationNode.php @@ -32,18 +32,12 @@ public function __construct(NodeInterface $selector, NodeInterface $subSelector) $this->subSelector = $subSelector; } - /** - * @return NodeInterface - */ - public function getSelector() + public function getSelector(): NodeInterface { return $this->selector; } - /** - * @return NodeInterface - */ - public function getSubSelector() + public function getSubSelector(): NodeInterface { return $this->subSelector; } @@ -51,15 +45,12 @@ public function getSubSelector() /** * {@inheritdoc} */ - public function getSpecificity() + public function getSpecificity(): Specificity { return $this->selector->getSpecificity()->plus($this->subSelector->getSpecificity()); } - /** - * {@inheritdoc} - */ - public function __toString() + public function __toString(): string { return sprintf('%s[%s:not(%s)]', $this->getNodeName(), $this->selector, $this->subSelector); } diff --git a/lib/Symfony/Component/CssSelector/Node/NodeInterface.php b/lib/Symfony/Component/CssSelector/Node/NodeInterface.php index 4ceafd24..e2eb3b22 100644 --- a/lib/Symfony/Component/CssSelector/Node/NodeInterface.php +++ b/lib/Symfony/Component/CssSelector/Node/NodeInterface.php @@ -23,24 +23,9 @@ */ interface NodeInterface { - /** - * Returns node's name. - * - * @return string - */ - public function getNodeName(); + public function getNodeName(): string; - /** - * Returns node's specificity. - * - * @return Specificity - */ - public function getSpecificity(); + public function getSpecificity(): Specificity; - /** - * Returns node's string representation. - * - * @return string - */ - public function __toString(); + public function __toString(): string; } diff --git a/lib/Symfony/Component/CssSelector/Node/PseudoNode.php b/lib/Symfony/Component/CssSelector/Node/PseudoNode.php index 6772b0db..4a20145c 100644 --- a/lib/Symfony/Component/CssSelector/Node/PseudoNode.php +++ b/lib/Symfony/Component/CssSelector/Node/PseudoNode.php @@ -26,27 +26,18 @@ class PseudoNode extends AbstractNode private $selector; private $identifier; - /** - * @param string $identifier - */ - public function __construct(NodeInterface $selector, $identifier) + public function __construct(NodeInterface $selector, string $identifier) { $this->selector = $selector; $this->identifier = strtolower($identifier); } - /** - * @return NodeInterface - */ - public function getSelector() + public function getSelector(): NodeInterface { return $this->selector; } - /** - * @return string - */ - public function getIdentifier() + public function getIdentifier(): string { return $this->identifier; } @@ -54,15 +45,12 @@ public function getIdentifier() /** * {@inheritdoc} */ - public function getSpecificity() + public function getSpecificity(): Specificity { return $this->selector->getSpecificity()->plus(new Specificity(0, 1, 0)); } - /** - * {@inheritdoc} - */ - public function __toString() + public function __toString(): string { return sprintf('%s[%s:%s]', $this->getNodeName(), $this->selector, $this->identifier); } diff --git a/lib/Symfony/Component/CssSelector/Node/SelectorNode.php b/lib/Symfony/Component/CssSelector/Node/SelectorNode.php index 8f7807ab..c9b30c41 100644 --- a/lib/Symfony/Component/CssSelector/Node/SelectorNode.php +++ b/lib/Symfony/Component/CssSelector/Node/SelectorNode.php @@ -26,27 +26,18 @@ class SelectorNode extends AbstractNode private $tree; private $pseudoElement; - /** - * @param string|null $pseudoElement - */ - public function __construct(NodeInterface $tree, $pseudoElement = null) + public function __construct(NodeInterface $tree, ?string $pseudoElement = null) { $this->tree = $tree; $this->pseudoElement = $pseudoElement ? strtolower($pseudoElement) : null; } - /** - * @return NodeInterface - */ - public function getTree() + public function getTree(): NodeInterface { return $this->tree; } - /** - * @return string|null - */ - public function getPseudoElement() + public function getPseudoElement(): ?string { return $this->pseudoElement; } @@ -54,15 +45,12 @@ public function getPseudoElement() /** * {@inheritdoc} */ - public function getSpecificity() + public function getSpecificity(): Specificity { return $this->tree->getSpecificity()->plus(new Specificity(0, 0, $this->pseudoElement ? 1 : 0)); } - /** - * {@inheritdoc} - */ - public function __toString() + public function __toString(): string { return sprintf('%s[%s%s]', $this->getNodeName(), $this->tree, $this->pseudoElement ? '::'.$this->pseudoElement : ''); } diff --git a/lib/Symfony/Component/CssSelector/Node/Specificity.php b/lib/Symfony/Component/CssSelector/Node/Specificity.php index a473dd7f..3dcf7ab4 100644 --- a/lib/Symfony/Component/CssSelector/Node/Specificity.php +++ b/lib/Symfony/Component/CssSelector/Node/Specificity.php @@ -25,40 +25,27 @@ */ class Specificity { - const A_FACTOR = 100; - const B_FACTOR = 10; - const C_FACTOR = 1; + public const A_FACTOR = 100; + public const B_FACTOR = 10; + public const C_FACTOR = 1; private $a; private $b; private $c; - /** - * @param int $a - * @param int $b - * @param int $c - */ - public function __construct($a, $b, $c) + public function __construct(int $a, int $b, int $c) { $this->a = $a; $this->b = $b; $this->c = $c; } - /** - * @return self - */ - public function plus(self $specificity) + public function plus(self $specificity): self { return new self($this->a + $specificity->a, $this->b + $specificity->b, $this->c + $specificity->c); } - /** - * Returns global specificity value. - * - * @return int - */ - public function getValue() + public function getValue(): int { return $this->a * self::A_FACTOR + $this->b * self::B_FACTOR + $this->c * self::C_FACTOR; } @@ -66,10 +53,8 @@ public function getValue() /** * Returns -1 if the object specificity is lower than the argument, * 0 if they are equal, and 1 if the argument is lower. - * - * @return int */ - public function compareTo(self $specificity) + public function compareTo(self $specificity): int { if ($this->a !== $specificity->a) { return $this->a > $specificity->a ? 1 : -1; diff --git a/lib/Symfony/Component/CssSelector/Parser/Handler/CommentHandler.php b/lib/Symfony/Component/CssSelector/Parser/Handler/CommentHandler.php index 1d3feb7a..fefe062f 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Handler/CommentHandler.php +++ b/lib/Symfony/Component/CssSelector/Parser/Handler/CommentHandler.php @@ -29,7 +29,7 @@ class CommentHandler implements HandlerInterface /** * {@inheritdoc} */ - public function handle(Reader $reader, TokenStream $stream) + public function handle(Reader $reader, TokenStream $stream): bool { if ('/*' !== $reader->getSubstring(2)) { return false; diff --git a/lib/Symfony/Component/CssSelector/Parser/Handler/HandlerInterface.php b/lib/Symfony/Component/CssSelector/Parser/Handler/HandlerInterface.php index 6716e91b..53889e4a 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Handler/HandlerInterface.php +++ b/lib/Symfony/Component/CssSelector/Parser/Handler/HandlerInterface.php @@ -26,8 +26,5 @@ */ interface HandlerInterface { - /** - * @return bool - */ - public function handle(Reader $reader, TokenStream $stream); + public function handle(Reader $reader, TokenStream $stream): bool; } diff --git a/lib/Symfony/Component/CssSelector/Parser/Handler/HashHandler.php b/lib/Symfony/Component/CssSelector/Parser/Handler/HashHandler.php index 87d2f57e..2730de70 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Handler/HashHandler.php +++ b/lib/Symfony/Component/CssSelector/Parser/Handler/HashHandler.php @@ -41,7 +41,7 @@ public function __construct(TokenizerPatterns $patterns, TokenizerEscaping $esca /** * {@inheritdoc} */ - public function handle(Reader $reader, TokenStream $stream) + public function handle(Reader $reader, TokenStream $stream): bool { $match = $reader->findPattern($this->patterns->getHashPattern()); diff --git a/lib/Symfony/Component/CssSelector/Parser/Handler/IdentifierHandler.php b/lib/Symfony/Component/CssSelector/Parser/Handler/IdentifierHandler.php index 5146fb6d..1744e421 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Handler/IdentifierHandler.php +++ b/lib/Symfony/Component/CssSelector/Parser/Handler/IdentifierHandler.php @@ -41,7 +41,7 @@ public function __construct(TokenizerPatterns $patterns, TokenizerEscaping $esca /** * {@inheritdoc} */ - public function handle(Reader $reader, TokenStream $stream) + public function handle(Reader $reader, TokenStream $stream): bool { $match = $reader->findPattern($this->patterns->getIdentifierPattern()); diff --git a/lib/Symfony/Component/CssSelector/Parser/Handler/NumberHandler.php b/lib/Symfony/Component/CssSelector/Parser/Handler/NumberHandler.php index 6bf8355a..8c831035 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Handler/NumberHandler.php +++ b/lib/Symfony/Component/CssSelector/Parser/Handler/NumberHandler.php @@ -38,7 +38,7 @@ public function __construct(TokenizerPatterns $patterns) /** * {@inheritdoc} */ - public function handle(Reader $reader, TokenStream $stream) + public function handle(Reader $reader, TokenStream $stream): bool { $match = $reader->findPattern($this->patterns->getNumberPattern()); diff --git a/lib/Symfony/Component/CssSelector/Parser/Handler/StringHandler.php b/lib/Symfony/Component/CssSelector/Parser/Handler/StringHandler.php index 10efd0f1..89a331b6 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Handler/StringHandler.php +++ b/lib/Symfony/Component/CssSelector/Parser/Handler/StringHandler.php @@ -43,7 +43,7 @@ public function __construct(TokenizerPatterns $patterns, TokenizerEscaping $esca /** * {@inheritdoc} */ - public function handle(Reader $reader, TokenStream $stream) + public function handle(Reader $reader, TokenStream $stream): bool { $quote = $reader->getSubstring(1); diff --git a/lib/Symfony/Component/CssSelector/Parser/Handler/WhitespaceHandler.php b/lib/Symfony/Component/CssSelector/Parser/Handler/WhitespaceHandler.php index 2c712021..bae5c97c 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Handler/WhitespaceHandler.php +++ b/lib/Symfony/Component/CssSelector/Parser/Handler/WhitespaceHandler.php @@ -30,7 +30,7 @@ class WhitespaceHandler implements HandlerInterface /** * {@inheritdoc} */ - public function handle(Reader $reader, TokenStream $stream) + public function handle(Reader $reader, TokenStream $stream): bool { $match = $reader->findPattern('~^[ \t\r\n\f]+~'); diff --git a/lib/Symfony/Component/CssSelector/Parser/Parser.php b/lib/Symfony/Component/CssSelector/Parser/Parser.php index dc6e2b92..5cd87d55 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Parser.php +++ b/lib/Symfony/Component/CssSelector/Parser/Parser.php @@ -29,15 +29,15 @@ class Parser implements ParserInterface { private $tokenizer; - public function __construct(Tokenizer $tokenizer = null) + public function __construct(?Tokenizer $tokenizer = null) { - $this->tokenizer = $tokenizer ?: new Tokenizer(); + $this->tokenizer = $tokenizer ?? new Tokenizer(); } /** * {@inheritdoc} */ - public function parse($source) + public function parse(string $source): array { $reader = new Reader($source); $stream = $this->tokenizer->tokenize($reader); @@ -50,11 +50,9 @@ public function parse($source) * * @param Token[] $tokens * - * @return array - * * @throws SyntaxErrorException */ - public static function parseSeries(array $tokens) + public static function parseSeries(array $tokens): array { foreach ($tokens as $token) { if ($token->isString()) { @@ -81,12 +79,12 @@ public static function parseSeries(array $tokens) return [2, 0]; case 'n' === $joined: return [1, 0]; - case false === strpos($joined, 'n'): + case !str_contains($joined, 'n'): return [0, $int($joined)]; } $split = explode('n', $joined); - $first = isset($split[0]) ? $split[0] : null; + $first = $split[0] ?? null; return [ $first ? ('-' === $first || '+' === $first ? $int($first.'1') : $int($first)) : 1, @@ -94,12 +92,7 @@ public static function parseSeries(array $tokens) ]; } - /** - * Parses selector nodes. - * - * @return array - */ - private function parseSelectorList(TokenStream $stream) + private function parseSelectorList(TokenStream $stream): array { $stream->skipWhitespace(); $selectors = []; @@ -118,16 +111,9 @@ private function parseSelectorList(TokenStream $stream) return $selectors; } - /** - * Parses next selector or combined node. - * - * @return Node\SelectorNode - * - * @throws SyntaxErrorException - */ - private function parserSelectorNode(TokenStream $stream) + private function parserSelectorNode(TokenStream $stream): Node\SelectorNode { - list($result, $pseudoElement) = $this->parseSimpleSelector($stream); + [$result, $pseudoElement] = $this->parseSimpleSelector($stream); while (true) { $stream->skipWhitespace(); @@ -148,7 +134,7 @@ private function parserSelectorNode(TokenStream $stream) $combinator = ' '; } - list($nextSelector, $pseudoElement) = $this->parseSimpleSelector($stream); + [$nextSelector, $pseudoElement] = $this->parseSimpleSelector($stream); $result = new Node\CombinedSelectorNode($result, $combinator, $nextSelector); } @@ -158,13 +144,9 @@ private function parserSelectorNode(TokenStream $stream) /** * Parses next simple node (hash, class, pseudo, negation). * - * @param bool $insideNegation - * - * @return array - * * @throws SyntaxErrorException */ - private function parseSimpleSelector(TokenStream $stream, $insideNegation = false) + private function parseSimpleSelector(TokenStream $stream, bool $insideNegation = false): array { $stream->skipWhitespace(); @@ -227,7 +209,7 @@ private function parseSimpleSelector(TokenStream $stream, $insideNegation = fals throw SyntaxErrorException::nestedNot(); } - list($argument, $argumentPseudoElement) = $this->parseSimpleSelector($stream, true); + [$argument, $argumentPseudoElement] = $this->parseSimpleSelector($stream, true); $next = $stream->getNext(); if (null !== $argumentPseudoElement) { @@ -278,12 +260,7 @@ private function parseSimpleSelector(TokenStream $stream, $insideNegation = fals return [$result, $pseudoElement]; } - /** - * Parses next element node. - * - * @return Node\ElementNode - */ - private function parseElementNode(TokenStream $stream) + private function parseElementNode(TokenStream $stream): Node\ElementNode { $peek = $stream->getPeek(); @@ -309,14 +286,7 @@ private function parseElementNode(TokenStream $stream) return new Node\ElementNode($namespace, $element); } - /** - * Parses next attribute node. - * - * @return Node\AttributeNode - * - * @throws SyntaxErrorException - */ - private function parseAttributeNode(Node\NodeInterface $selector, TokenStream $stream) + private function parseAttributeNode(Node\NodeInterface $selector, TokenStream $stream): Node\AttributeNode { $stream->skipWhitespace(); $attribute = $stream->getNextIdentifierOrStar(); diff --git a/lib/Symfony/Component/CssSelector/Parser/ParserInterface.php b/lib/Symfony/Component/CssSelector/Parser/ParserInterface.php index 0690f95f..d693befa 100644 --- a/lib/Symfony/Component/CssSelector/Parser/ParserInterface.php +++ b/lib/Symfony/Component/CssSelector/Parser/ParserInterface.php @@ -28,9 +28,7 @@ interface ParserInterface /** * Parses given selector source into an array of tokens. * - * @param string $source - * * @return SelectorNode[] */ - public function parse($source); + public function parse(string $source): array; } diff --git a/lib/Symfony/Component/CssSelector/Parser/Reader.php b/lib/Symfony/Component/CssSelector/Parser/Reader.php index ebd5fc51..b04a6c07 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Reader.php +++ b/lib/Symfony/Component/CssSelector/Parser/Reader.php @@ -27,56 +27,33 @@ class Reader private $length; private $position = 0; - /** - * @param string $source - */ - public function __construct($source) + public function __construct(string $source) { $this->source = $source; $this->length = \strlen($source); } - /** - * @return bool - */ - public function isEOF() + public function isEOF(): bool { return $this->position >= $this->length; } - /** - * @return int - */ - public function getPosition() + public function getPosition(): int { return $this->position; } - /** - * @return int - */ - public function getRemainingLength() + public function getRemainingLength(): int { return $this->length - $this->position; } - /** - * @param int $length - * @param int $offset - * - * @return string - */ - public function getSubstring($length, $offset = 0) + public function getSubstring(int $length, int $offset = 0): string { return substr($this->source, $this->position + $offset, $length); } - /** - * @param string $string - * - * @return int - */ - public function getOffset($string) + public function getOffset(string $string) { $position = strpos($this->source, $string, $this->position); @@ -84,11 +61,9 @@ public function getOffset($string) } /** - * @param string $pattern - * * @return array|false */ - public function findPattern($pattern) + public function findPattern(string $pattern) { $source = substr($this->source, $this->position); @@ -99,10 +74,7 @@ public function findPattern($pattern) return false; } - /** - * @param int $length - */ - public function moveForward($length) + public function moveForward(int $length) { $this->position += $length; } diff --git a/lib/Symfony/Component/CssSelector/Parser/Shortcut/ClassParser.php b/lib/Symfony/Component/CssSelector/Parser/Shortcut/ClassParser.php index 985baec8..a026faa7 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Shortcut/ClassParser.php +++ b/lib/Symfony/Component/CssSelector/Parser/Shortcut/ClassParser.php @@ -31,7 +31,7 @@ class ClassParser implements ParserInterface /** * {@inheritdoc} */ - public function parse($source) + public function parse(string $source): array { // Matches an optional namespace, optional element, and required class // $source = 'test|input.ab6bd_field'; diff --git a/lib/Symfony/Component/CssSelector/Parser/Shortcut/ElementParser.php b/lib/Symfony/Component/CssSelector/Parser/Shortcut/ElementParser.php index 97bf6de3..a0c4afaa 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Shortcut/ElementParser.php +++ b/lib/Symfony/Component/CssSelector/Parser/Shortcut/ElementParser.php @@ -30,7 +30,7 @@ class ElementParser implements ParserInterface /** * {@inheritdoc} */ - public function parse($source) + public function parse(string $source): array { // Matches an optional namespace, required element or `*` // $source = 'testns|testel'; diff --git a/lib/Symfony/Component/CssSelector/Parser/Shortcut/EmptyStringParser.php b/lib/Symfony/Component/CssSelector/Parser/Shortcut/EmptyStringParser.php index 24f9a459..c5c82a9b 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Shortcut/EmptyStringParser.php +++ b/lib/Symfony/Component/CssSelector/Parser/Shortcut/EmptyStringParser.php @@ -34,7 +34,7 @@ class EmptyStringParser implements ParserInterface /** * {@inheritdoc} */ - public function parse($source) + public function parse(string $source): array { // Matches an empty string if ('' == $source) { diff --git a/lib/Symfony/Component/CssSelector/Parser/Shortcut/HashParser.php b/lib/Symfony/Component/CssSelector/Parser/Shortcut/HashParser.php index f65a2587..bcab6fe8 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Shortcut/HashParser.php +++ b/lib/Symfony/Component/CssSelector/Parser/Shortcut/HashParser.php @@ -31,7 +31,7 @@ class HashParser implements ParserInterface /** * {@inheritdoc} */ - public function parse($source) + public function parse(string $source): array { // Matches an optional namespace, optional element, and required id // $source = 'test|input#ab6bd_field'; diff --git a/lib/Symfony/Component/CssSelector/Parser/Token.php b/lib/Symfony/Component/CssSelector/Parser/Token.php index f647e103..735cf47d 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Token.php +++ b/lib/Symfony/Component/CssSelector/Parser/Token.php @@ -23,66 +23,46 @@ */ class Token { - const TYPE_FILE_END = 'eof'; - const TYPE_DELIMITER = 'delimiter'; - const TYPE_WHITESPACE = 'whitespace'; - const TYPE_IDENTIFIER = 'identifier'; - const TYPE_HASH = 'hash'; - const TYPE_NUMBER = 'number'; - const TYPE_STRING = 'string'; + public const TYPE_FILE_END = 'eof'; + public const TYPE_DELIMITER = 'delimiter'; + public const TYPE_WHITESPACE = 'whitespace'; + public const TYPE_IDENTIFIER = 'identifier'; + public const TYPE_HASH = 'hash'; + public const TYPE_NUMBER = 'number'; + public const TYPE_STRING = 'string'; private $type; private $value; private $position; - /** - * @param int $type - * @param string $value - * @param int $position - */ - public function __construct($type, $value, $position) + public function __construct(?string $type, ?string $value, ?int $position) { $this->type = $type; $this->value = $value; $this->position = $position; } - /** - * @return int - */ - public function getType() + public function getType(): ?int { return $this->type; } - /** - * @return string - */ - public function getValue() + public function getValue(): ?string { return $this->value; } - /** - * @return int - */ - public function getPosition() + public function getPosition(): ?int { return $this->position; } - /** - * @return bool - */ - public function isFileEnd() + public function isFileEnd(): bool { return self::TYPE_FILE_END === $this->type; } - /** - * @return bool - */ - public function isDelimiter(array $values = []) + public function isDelimiter(array $values = []): bool { if (self::TYPE_DELIMITER !== $this->type) { return false; @@ -95,50 +75,32 @@ public function isDelimiter(array $values = []) return \in_array($this->value, $values); } - /** - * @return bool - */ - public function isWhitespace() + public function isWhitespace(): bool { return self::TYPE_WHITESPACE === $this->type; } - /** - * @return bool - */ - public function isIdentifier() + public function isIdentifier(): bool { return self::TYPE_IDENTIFIER === $this->type; } - /** - * @return bool - */ - public function isHash() + public function isHash(): bool { return self::TYPE_HASH === $this->type; } - /** - * @return bool - */ - public function isNumber() + public function isNumber(): bool { return self::TYPE_NUMBER === $this->type; } - /** - * @return bool - */ - public function isString() + public function isString(): bool { return self::TYPE_STRING === $this->type; } - /** - * @return string - */ - public function __toString() + public function __toString(): string { if ($this->value) { return sprintf('<%s "%s" at %s>', $this->type, $this->value, $this->position); diff --git a/lib/Symfony/Component/CssSelector/Parser/TokenStream.php b/lib/Symfony/Component/CssSelector/Parser/TokenStream.php index e8cbbb61..28af1ca1 100644 --- a/lib/Symfony/Component/CssSelector/Parser/TokenStream.php +++ b/lib/Symfony/Component/CssSelector/Parser/TokenStream.php @@ -56,7 +56,7 @@ class TokenStream * * @return $this */ - public function push(Token $token) + public function push(Token $token): self { $this->tokens[] = $token; @@ -68,7 +68,7 @@ public function push(Token $token) * * @return $this */ - public function freeze() + public function freeze(): self { return $this; } @@ -76,11 +76,9 @@ public function freeze() /** * Returns next token. * - * @return Token - * * @throws InternalErrorException If there is no more token */ - public function getNext() + public function getNext(): Token { if ($this->peeking) { $this->peeking = false; @@ -98,10 +96,8 @@ public function getNext() /** * Returns peeked token. - * - * @return Token */ - public function getPeek() + public function getPeek(): Token { if (!$this->peeking) { $this->peeked = $this->getNext(); @@ -116,19 +112,17 @@ public function getPeek() * * @return Token[] */ - public function getUsed() + public function getUsed(): array { return $this->used; } /** - * Returns nex identifier token. - * - * @return string The identifier token value + * Returns next identifier token. * * @throws SyntaxErrorException If next token is not an identifier */ - public function getNextIdentifier() + public function getNextIdentifier(): string { $next = $this->getNext(); @@ -140,13 +134,11 @@ public function getNextIdentifier() } /** - * Returns nex identifier or star delimiter token. - * - * @return string|null The identifier token value or null if star found + * Returns next identifier or null if star delimiter token is found. * * @throws SyntaxErrorException If next token is not an identifier or a star delimiter */ - public function getNextIdentifierOrStar() + public function getNextIdentifierOrStar(): ?string { $next = $this->getNext(); diff --git a/lib/Symfony/Component/CssSelector/Parser/Tokenizer/Tokenizer.php b/lib/Symfony/Component/CssSelector/Parser/Tokenizer/Tokenizer.php index adfd3d55..643cc8e5 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Tokenizer/Tokenizer.php +++ b/lib/Symfony/Component/CssSelector/Parser/Tokenizer/Tokenizer.php @@ -50,10 +50,8 @@ public function __construct() /** * Tokenize selector source code. - * - * @return TokenStream */ - public function tokenize(Reader $reader) + public function tokenize(Reader $reader): TokenStream { $stream = new TokenStream(); diff --git a/lib/Symfony/Component/CssSelector/Parser/Tokenizer/TokenizerEscaping.php b/lib/Symfony/Component/CssSelector/Parser/Tokenizer/TokenizerEscaping.php index 4dd83403..b476fbbd 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Tokenizer/TokenizerEscaping.php +++ b/lib/Symfony/Component/CssSelector/Parser/Tokenizer/TokenizerEscaping.php @@ -30,36 +30,21 @@ public function __construct(TokenizerPatterns $patterns) $this->patterns = $patterns; } - /** - * @param string $value - * - * @return string - */ - public function escapeUnicode($value) + public function escapeUnicode(string $value): string { $value = $this->replaceUnicodeSequences($value); return preg_replace($this->patterns->getSimpleEscapePattern(), '$1', $value); } - /** - * @param string $value - * - * @return string - */ - public function escapeUnicodeAndNewLine($value) + public function escapeUnicodeAndNewLine(string $value): string { $value = preg_replace($this->patterns->getNewLineEscapePattern(), '', $value); return $this->escapeUnicode($value); } - /** - * @param string $value - * - * @return string - */ - private function replaceUnicodeSequences($value) + private function replaceUnicodeSequences(string $value): string { return preg_replace_callback($this->patterns->getUnicodeEscapePattern(), function ($match) { $c = hexdec($match[1]); diff --git a/lib/Symfony/Component/CssSelector/Parser/Tokenizer/TokenizerPatterns.php b/lib/Symfony/Component/CssSelector/Parser/Tokenizer/TokenizerPatterns.php index fec6d044..a3f91c8e 100644 --- a/lib/Symfony/Component/CssSelector/Parser/Tokenizer/TokenizerPatterns.php +++ b/lib/Symfony/Component/CssSelector/Parser/Tokenizer/TokenizerPatterns.php @@ -49,63 +49,40 @@ public function __construct() $this->identifierPattern = '-?(?:'.$this->nmStartPattern.')(?:'.$this->nmCharPattern.')*'; $this->hashPattern = '#((?:'.$this->nmCharPattern.')+)'; $this->numberPattern = '[+-]?(?:[0-9]*\.[0-9]+|[0-9]+)'; - $this->quotedStringPattern = '([^\n\r\f%s]|'.$this->stringEscapePattern.')*'; + $this->quotedStringPattern = '([^\n\r\f\\\\%s]|'.$this->stringEscapePattern.')*'; } - /** - * @return string - */ - public function getNewLineEscapePattern() + public function getNewLineEscapePattern(): string { - return '~^'.$this->newLineEscapePattern.'~'; + return '~'.$this->newLineEscapePattern.'~'; } - /** - * @return string - */ - public function getSimpleEscapePattern() + public function getSimpleEscapePattern(): string { - return '~^'.$this->simpleEscapePattern.'~'; + return '~'.$this->simpleEscapePattern.'~'; } - /** - * @return string - */ - public function getUnicodeEscapePattern() + public function getUnicodeEscapePattern(): string { - return '~^'.$this->unicodeEscapePattern.'~i'; + return '~'.$this->unicodeEscapePattern.'~i'; } - /** - * @return string - */ - public function getIdentifierPattern() + public function getIdentifierPattern(): string { return '~^'.$this->identifierPattern.'~i'; } - /** - * @return string - */ - public function getHashPattern() + public function getHashPattern(): string { return '~^'.$this->hashPattern.'~i'; } - /** - * @return string - */ - public function getNumberPattern() + public function getNumberPattern(): string { return '~^'.$this->numberPattern.'~'; } - /** - * @param string $quote - * - * @return string - */ - public function getQuotedStringPattern($quote) + public function getQuotedStringPattern(string $quote): string { return '~^'.sprintf($this->quotedStringPattern, $quote).'~i'; } diff --git a/lib/Symfony/Component/CssSelector/README.md b/lib/Symfony/Component/CssSelector/README.md index 7c4c4116..ede4a3ac 100644 --- a/lib/Symfony/Component/CssSelector/README.md +++ b/lib/Symfony/Component/CssSelector/README.md @@ -6,11 +6,11 @@ The CssSelector component converts CSS selectors to XPath expressions. Resources --------- - * [Documentation](https://symfony.com/doc/current/components/css_selector.html) - * [Contributing](https://symfony.com/doc/current/contributing/index.html) - * [Report issues](https://github.com/symfony/symfony/issues) and - [send Pull Requests](https://github.com/symfony/symfony/pulls) - in the [main Symfony repository](https://github.com/symfony/symfony) + * [Documentation](https://symfony.com/doc/current/components/css_selector.html) + * [Contributing](https://symfony.com/doc/current/contributing/index.html) + * [Report issues](https://github.com/symfony/symfony/issues) and + [send Pull Requests](https://github.com/symfony/symfony/pulls) + in the [main Symfony repository](https://github.com/symfony/symfony) Credits ------- diff --git a/lib/Symfony/Component/CssSelector/Tests/CssSelectorConverterTest.php b/lib/Symfony/Component/CssSelector/Tests/CssSelectorConverterTest.php deleted file mode 100644 index 68e98c4f..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/CssSelectorConverterTest.php +++ /dev/null @@ -1,74 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests; - -use PHPUnit\Framework\TestCase; -use SimplePay\Vendor\Symfony\Component\CssSelector\CssSelectorConverter; - -class CssSelectorConverterTest extends TestCase -{ - public function testCssToXPath() - { - $converter = new CssSelectorConverter(); - - $this->assertEquals('descendant-or-self::*', $converter->toXPath('')); - $this->assertEquals('descendant-or-self::h1', $converter->toXPath('h1')); - $this->assertEquals("descendant-or-self::h1[@id = 'foo']", $converter->toXPath('h1#foo')); - $this->assertEquals("descendant-or-self::h1[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]", $converter->toXPath('h1.foo')); - $this->assertEquals('descendant-or-self::foo:h1', $converter->toXPath('foo|h1')); - $this->assertEquals('descendant-or-self::h1', $converter->toXPath('H1')); - } - - public function testCssToXPathXml() - { - $converter = new CssSelectorConverter(false); - - $this->assertEquals('descendant-or-self::H1', $converter->toXPath('H1')); - } - - public function testParseExceptions() - { - $this->expectException('SimplePay\Vendor\Symfony\Component\CssSelector\Exception\ParseException'); - $this->expectExceptionMessage('Expected identifier, but found.'); - $converter = new CssSelectorConverter(); - $converter->toXPath('h1:'); - } - - /** @dataProvider getCssToXPathWithoutPrefixTestData */ - public function testCssToXPathWithoutPrefix($css, $xpath) - { - $converter = new CssSelectorConverter(); - - $this->assertEquals($xpath, $converter->toXPath($css, ''), '->parse() parses an input string and returns a node'); - } - - public function getCssToXPathWithoutPrefixTestData() - { - return [ - ['h1', 'h1'], - ['foo|h1', 'foo:h1'], - ['h1, h2, h3', 'h1 | h2 | h3'], - ['h1:nth-child(3n+1)', "*/*[(name() = 'h1') and (position() - 1 >= 0 and (position() - 1) mod 3 = 0)]"], - ['h1 > p', 'h1/p'], - ['h1#foo', "h1[@id = 'foo']"], - ['h1.foo', "h1[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"], - ['h1[class*="foo bar"]', "h1[@class and contains(@class, 'foo bar')]"], - ['h1[foo|class*="foo bar"]', "h1[@foo:class and contains(@foo:class, 'foo bar')]"], - ['h1[class]', 'h1[@class]'], - ['h1 .foo', "h1/descendant-or-self::*/*[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"], - ['h1 #foo', "h1/descendant-or-self::*/*[@id = 'foo']"], - ['h1 [class*=foo]', "h1/descendant-or-self::*/*[@class and contains(@class, 'foo')]"], - ['div>.foo', "div/*[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"], - ['div > .foo', "div/*[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"], - ]; - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Node/AbstractNodeTest.php b/lib/Symfony/Component/CssSelector/Tests/Node/AbstractNodeTest.php deleted file mode 100644 index 834f8a88..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Node/AbstractNodeTest.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Node; - -use PHPUnit\Framework\TestCase; -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\NodeInterface; - -abstract class AbstractNodeTest extends TestCase -{ - /** @dataProvider getToStringConversionTestData */ - public function testToStringConversion(NodeInterface $node, $representation) - { - $this->assertEquals($representation, (string) $node); - } - - /** @dataProvider getSpecificityValueTestData */ - public function testSpecificityValue(NodeInterface $node, $value) - { - $this->assertEquals($value, $node->getSpecificity()->getValue()); - } - - abstract public function getToStringConversionTestData(); - - abstract public function getSpecificityValueTestData(); -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Node/AttributeNodeTest.php b/lib/Symfony/Component/CssSelector/Tests/Node/AttributeNodeTest.php deleted file mode 100644 index 0e7ca0ac..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Node/AttributeNodeTest.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Node; - -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\AttributeNode; -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\ElementNode; - -class AttributeNodeTest extends AbstractNodeTest -{ - public function getToStringConversionTestData() - { - return [ - [new AttributeNode(new ElementNode(), null, 'attribute', 'exists', null), 'Attribute[Element[*][attribute]]'], - [new AttributeNode(new ElementNode(), null, 'attribute', '$=', 'value'), "Attribute[Element[*][attribute $= 'value']]"], - [new AttributeNode(new ElementNode(), 'namespace', 'attribute', '$=', 'value'), "Attribute[Element[*][namespace|attribute $= 'value']]"], - ]; - } - - public function getSpecificityValueTestData() - { - return [ - [new AttributeNode(new ElementNode(), null, 'attribute', 'exists', null), 10], - [new AttributeNode(new ElementNode(null, 'element'), null, 'attribute', 'exists', null), 11], - [new AttributeNode(new ElementNode(), null, 'attribute', '$=', 'value'), 10], - [new AttributeNode(new ElementNode(), 'namespace', 'attribute', '$=', 'value'), 10], - ]; - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Node/ClassNodeTest.php b/lib/Symfony/Component/CssSelector/Tests/Node/ClassNodeTest.php deleted file mode 100644 index d988e4a4..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Node/ClassNodeTest.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Node; - -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\ClassNode; -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\ElementNode; - -class ClassNodeTest extends AbstractNodeTest -{ - public function getToStringConversionTestData() - { - return [ - [new ClassNode(new ElementNode(), 'class'), 'Class[Element[*].class]'], - ]; - } - - public function getSpecificityValueTestData() - { - return [ - [new ClassNode(new ElementNode(), 'class'), 10], - [new ClassNode(new ElementNode(null, 'element'), 'class'), 11], - ]; - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Node/CombinedSelectorNodeTest.php b/lib/Symfony/Component/CssSelector/Tests/Node/CombinedSelectorNodeTest.php deleted file mode 100644 index 9de72bde..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Node/CombinedSelectorNodeTest.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Node; - -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\CombinedSelectorNode; -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\ElementNode; - -class CombinedSelectorNodeTest extends AbstractNodeTest -{ - public function getToStringConversionTestData() - { - return [ - [new CombinedSelectorNode(new ElementNode(), '>', new ElementNode()), 'CombinedSelector[Element[*] > Element[*]]'], - [new CombinedSelectorNode(new ElementNode(), ' ', new ElementNode()), 'CombinedSelector[Element[*] Element[*]]'], - ]; - } - - public function getSpecificityValueTestData() - { - return [ - [new CombinedSelectorNode(new ElementNode(), '>', new ElementNode()), 0], - [new CombinedSelectorNode(new ElementNode(null, 'element'), '>', new ElementNode()), 1], - [new CombinedSelectorNode(new ElementNode(null, 'element'), '>', new ElementNode(null, 'element')), 2], - ]; - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Node/ElementNodeTest.php b/lib/Symfony/Component/CssSelector/Tests/Node/ElementNodeTest.php deleted file mode 100644 index 0f4984ee..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Node/ElementNodeTest.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Node; - -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\ElementNode; - -class ElementNodeTest extends AbstractNodeTest -{ - public function getToStringConversionTestData() - { - return [ - [new ElementNode(), 'Element[*]'], - [new ElementNode(null, 'element'), 'Element[element]'], - [new ElementNode('namespace', 'element'), 'Element[namespace|element]'], - ]; - } - - public function getSpecificityValueTestData() - { - return [ - [new ElementNode(), 0], - [new ElementNode(null, 'element'), 1], - [new ElementNode('namespace', 'element'), 1], - ]; - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Node/FunctionNodeTest.php b/lib/Symfony/Component/CssSelector/Tests/Node/FunctionNodeTest.php deleted file mode 100644 index 9d389eed..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Node/FunctionNodeTest.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Node; - -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\ElementNode; -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\FunctionNode; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Token; - -class FunctionNodeTest extends AbstractNodeTest -{ - public function getToStringConversionTestData() - { - return [ - [new FunctionNode(new ElementNode(), 'function'), 'Function[Element[*]:function()]'], - [new FunctionNode(new ElementNode(), 'function', [ - new Token(Token::TYPE_IDENTIFIER, 'value', 0), - ]), "Function[Element[*]:function(['value'])]"], - [new FunctionNode(new ElementNode(), 'function', [ - new Token(Token::TYPE_STRING, 'value1', 0), - new Token(Token::TYPE_NUMBER, 'value2', 0), - ]), "Function[Element[*]:function(['value1', 'value2'])]"], - ]; - } - - public function getSpecificityValueTestData() - { - return [ - [new FunctionNode(new ElementNode(), 'function'), 10], - [new FunctionNode(new ElementNode(), 'function', [ - new Token(Token::TYPE_IDENTIFIER, 'value', 0), - ]), 10], - [new FunctionNode(new ElementNode(), 'function', [ - new Token(Token::TYPE_STRING, 'value1', 0), - new Token(Token::TYPE_NUMBER, 'value2', 0), - ]), 10], - ]; - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Node/HashNodeTest.php b/lib/Symfony/Component/CssSelector/Tests/Node/HashNodeTest.php deleted file mode 100644 index 88382c39..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Node/HashNodeTest.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Node; - -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\ElementNode; -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\HashNode; - -class HashNodeTest extends AbstractNodeTest -{ - public function getToStringConversionTestData() - { - return [ - [new HashNode(new ElementNode(), 'id'), 'Hash[Element[*]#id]'], - ]; - } - - public function getSpecificityValueTestData() - { - return [ - [new HashNode(new ElementNode(), 'id'), 100], - [new HashNode(new ElementNode(null, 'id'), 'class'), 101], - ]; - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Node/NegationNodeTest.php b/lib/Symfony/Component/CssSelector/Tests/Node/NegationNodeTest.php deleted file mode 100644 index b0798f5a..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Node/NegationNodeTest.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Node; - -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\ClassNode; -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\ElementNode; -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\NegationNode; - -class NegationNodeTest extends AbstractNodeTest -{ - public function getToStringConversionTestData() - { - return [ - [new NegationNode(new ElementNode(), new ClassNode(new ElementNode(), 'class')), 'Negation[Element[*]:not(Class[Element[*].class])]'], - ]; - } - - public function getSpecificityValueTestData() - { - return [ - [new NegationNode(new ElementNode(), new ClassNode(new ElementNode(), 'class')), 10], - ]; - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Node/PseudoNodeTest.php b/lib/Symfony/Component/CssSelector/Tests/Node/PseudoNodeTest.php deleted file mode 100644 index 81f169f1..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Node/PseudoNodeTest.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Node; - -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\ElementNode; -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\PseudoNode; - -class PseudoNodeTest extends AbstractNodeTest -{ - public function getToStringConversionTestData() - { - return [ - [new PseudoNode(new ElementNode(), 'pseudo'), 'Pseudo[Element[*]:pseudo]'], - ]; - } - - public function getSpecificityValueTestData() - { - return [ - [new PseudoNode(new ElementNode(), 'pseudo'), 10], - ]; - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Node/SelectorNodeTest.php b/lib/Symfony/Component/CssSelector/Tests/Node/SelectorNodeTest.php deleted file mode 100644 index 6ca772f8..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Node/SelectorNodeTest.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Node; - -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\ElementNode; -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\SelectorNode; - -class SelectorNodeTest extends AbstractNodeTest -{ - public function getToStringConversionTestData() - { - return [ - [new SelectorNode(new ElementNode()), 'Selector[Element[*]]'], - [new SelectorNode(new ElementNode(), 'pseudo'), 'Selector[Element[*]::pseudo]'], - ]; - } - - public function getSpecificityValueTestData() - { - return [ - [new SelectorNode(new ElementNode()), 0], - [new SelectorNode(new ElementNode(), 'pseudo'), 1], - ]; - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Node/SpecificityTest.php b/lib/Symfony/Component/CssSelector/Tests/Node/SpecificityTest.php deleted file mode 100644 index 8c5cd9a4..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Node/SpecificityTest.php +++ /dev/null @@ -1,63 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Node; - -use PHPUnit\Framework\TestCase; -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\Specificity; - -class SpecificityTest extends TestCase -{ - /** @dataProvider getValueTestData */ - public function testValue(Specificity $specificity, $value) - { - $this->assertEquals($value, $specificity->getValue()); - } - - /** @dataProvider getValueTestData */ - public function testPlusValue(Specificity $specificity, $value) - { - $this->assertEquals($value + 123, $specificity->plus(new Specificity(1, 2, 3))->getValue()); - } - - public function getValueTestData() - { - return [ - [new Specificity(0, 0, 0), 0], - [new Specificity(0, 0, 2), 2], - [new Specificity(0, 3, 0), 30], - [new Specificity(4, 0, 0), 400], - [new Specificity(4, 3, 2), 432], - ]; - } - - /** @dataProvider getCompareTestData */ - public function testCompareTo(Specificity $a, Specificity $b, $result) - { - $this->assertEquals($result, $a->compareTo($b)); - } - - public function getCompareTestData() - { - return [ - [new Specificity(0, 0, 0), new Specificity(0, 0, 0), 0], - [new Specificity(0, 0, 1), new Specificity(0, 0, 1), 0], - [new Specificity(0, 0, 2), new Specificity(0, 0, 1), 1], - [new Specificity(0, 0, 2), new Specificity(0, 0, 3), -1], - [new Specificity(0, 4, 0), new Specificity(0, 4, 0), 0], - [new Specificity(0, 6, 0), new Specificity(0, 5, 11), 1], - [new Specificity(0, 7, 0), new Specificity(0, 8, 0), -1], - [new Specificity(9, 0, 0), new Specificity(9, 0, 0), 0], - [new Specificity(11, 0, 0), new Specificity(10, 11, 0), 1], - [new Specificity(12, 11, 0), new Specificity(13, 0, 0), -1], - ]; - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/AbstractHandlerTest.php b/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/AbstractHandlerTest.php deleted file mode 100644 index 9de6f0e4..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/AbstractHandlerTest.php +++ /dev/null @@ -1,70 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Parser\Handler; - -use PHPUnit\Framework\TestCase; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Reader; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Token; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\TokenStream; - -/** - * @author Jean-François Simon - */ -abstract class AbstractHandlerTest extends TestCase -{ - /** @dataProvider getHandleValueTestData */ - public function testHandleValue($value, Token $expectedToken, $remainingContent) - { - $reader = new Reader($value); - $stream = new TokenStream(); - - $this->assertTrue($this->generateHandler()->handle($reader, $stream)); - $this->assertEquals($expectedToken, $stream->getNext()); - $this->assertRemainingContent($reader, $remainingContent); - } - - /** @dataProvider getDontHandleValueTestData */ - public function testDontHandleValue($value) - { - $reader = new Reader($value); - $stream = new TokenStream(); - - $this->assertFalse($this->generateHandler()->handle($reader, $stream)); - $this->assertStreamEmpty($stream); - $this->assertRemainingContent($reader, $value); - } - - abstract public function getHandleValueTestData(); - - abstract public function getDontHandleValueTestData(); - - abstract protected function generateHandler(); - - protected function assertStreamEmpty(TokenStream $stream) - { - $property = new \ReflectionProperty($stream, 'tokens'); - $property->setAccessible(true); - - $this->assertEquals([], $property->getValue($stream)); - } - - protected function assertRemainingContent(Reader $reader, $remainingContent) - { - if ('' === $remainingContent) { - $this->assertEquals(0, $reader->getRemainingLength()); - $this->assertTrue($reader->isEOF()); - } else { - $this->assertEquals(\strlen($remainingContent), $reader->getRemainingLength()); - $this->assertEquals(0, $reader->getOffset($remainingContent)); - } - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/CommentHandlerTest.php b/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/CommentHandlerTest.php deleted file mode 100644 index fc621278..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/CommentHandlerTest.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Parser\Handler; - -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Handler\CommentHandler; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Reader; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Token; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\TokenStream; - -class CommentHandlerTest extends AbstractHandlerTest -{ - /** @dataProvider getHandleValueTestData */ - public function testHandleValue($value, Token $unusedArgument, $remainingContent) - { - $reader = new Reader($value); - $stream = new TokenStream(); - - $this->assertTrue($this->generateHandler()->handle($reader, $stream)); - // comments are ignored (not pushed as token in stream) - $this->assertStreamEmpty($stream); - $this->assertRemainingContent($reader, $remainingContent); - } - - public function getHandleValueTestData() - { - return [ - // 2nd argument only exists for inherited method compatibility - ['/* comment */', new Token(null, null, null), ''], - ['/* comment */foo', new Token(null, null, null), 'foo'], - ]; - } - - public function getDontHandleValueTestData() - { - return [ - ['>'], - ['+'], - [' '], - ]; - } - - protected function generateHandler() - { - return new CommentHandler(); - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/HashHandlerTest.php b/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/HashHandlerTest.php deleted file mode 100644 index eeafa65f..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/HashHandlerTest.php +++ /dev/null @@ -1,49 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Parser\Handler; - -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Handler\HashHandler; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Token; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerEscaping; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns; - -class HashHandlerTest extends AbstractHandlerTest -{ - public function getHandleValueTestData() - { - return [ - ['#id', new Token(Token::TYPE_HASH, 'id', 0), ''], - ['#123', new Token(Token::TYPE_HASH, '123', 0), ''], - - ['#id.class', new Token(Token::TYPE_HASH, 'id', 0), '.class'], - ['#id element', new Token(Token::TYPE_HASH, 'id', 0), ' element'], - ]; - } - - public function getDontHandleValueTestData() - { - return [ - ['id'], - ['123'], - ['<'], - ['<'], - ['#'], - ]; - } - - protected function generateHandler() - { - $patterns = new TokenizerPatterns(); - - return new HashHandler($patterns, new TokenizerEscaping($patterns)); - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/IdentifierHandlerTest.php b/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/IdentifierHandlerTest.php deleted file mode 100644 index 678defe1..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/IdentifierHandlerTest.php +++ /dev/null @@ -1,49 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Parser\Handler; - -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Handler\IdentifierHandler; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Token; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerEscaping; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns; - -class IdentifierHandlerTest extends AbstractHandlerTest -{ - public function getHandleValueTestData() - { - return [ - ['foo', new Token(Token::TYPE_IDENTIFIER, 'foo', 0), ''], - ['foo|bar', new Token(Token::TYPE_IDENTIFIER, 'foo', 0), '|bar'], - ['foo.class', new Token(Token::TYPE_IDENTIFIER, 'foo', 0), '.class'], - ['foo[attr]', new Token(Token::TYPE_IDENTIFIER, 'foo', 0), '[attr]'], - ['foo bar', new Token(Token::TYPE_IDENTIFIER, 'foo', 0), ' bar'], - ]; - } - - public function getDontHandleValueTestData() - { - return [ - ['>'], - ['+'], - [' '], - ['*|foo'], - ['/* comment */'], - ]; - } - - protected function generateHandler() - { - $patterns = new TokenizerPatterns(); - - return new IdentifierHandler($patterns, new TokenizerEscaping($patterns)); - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/NumberHandlerTest.php b/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/NumberHandlerTest.php deleted file mode 100644 index f57fbb1c..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/NumberHandlerTest.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Parser\Handler; - -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Handler\NumberHandler; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Token; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns; - -class NumberHandlerTest extends AbstractHandlerTest -{ - public function getHandleValueTestData() - { - return [ - ['12', new Token(Token::TYPE_NUMBER, '12', 0), ''], - ['12.34', new Token(Token::TYPE_NUMBER, '12.34', 0), ''], - ['+12.34', new Token(Token::TYPE_NUMBER, '+12.34', 0), ''], - ['-12.34', new Token(Token::TYPE_NUMBER, '-12.34', 0), ''], - - ['12 arg', new Token(Token::TYPE_NUMBER, '12', 0), ' arg'], - ['12]', new Token(Token::TYPE_NUMBER, '12', 0), ']'], - ]; - } - - public function getDontHandleValueTestData() - { - return [ - ['hello'], - ['>'], - ['+'], - [' '], - ['/* comment */'], - ]; - } - - protected function generateHandler() - { - $patterns = new TokenizerPatterns(); - - return new NumberHandler($patterns); - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/StringHandlerTest.php b/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/StringHandlerTest.php deleted file mode 100644 index a7707525..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/StringHandlerTest.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Parser\Handler; - -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Handler\StringHandler; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Token; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerEscaping; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns; - -class StringHandlerTest extends AbstractHandlerTest -{ - public function getHandleValueTestData() - { - return [ - ['"hello"', new Token(Token::TYPE_STRING, 'hello', 1), ''], - ['"1"', new Token(Token::TYPE_STRING, '1', 1), ''], - ['" "', new Token(Token::TYPE_STRING, ' ', 1), ''], - ['""', new Token(Token::TYPE_STRING, '', 1), ''], - ["'hello'", new Token(Token::TYPE_STRING, 'hello', 1), ''], - - ["'foo'bar", new Token(Token::TYPE_STRING, 'foo', 1), 'bar'], - ]; - } - - public function getDontHandleValueTestData() - { - return [ - ['hello'], - ['>'], - ['1'], - [' '], - ]; - } - - protected function generateHandler() - { - $patterns = new TokenizerPatterns(); - - return new StringHandler($patterns, new TokenizerEscaping($patterns)); - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/WhitespaceHandlerTest.php b/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/WhitespaceHandlerTest.php deleted file mode 100644 index 2b05aeca..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Parser/Handler/WhitespaceHandlerTest.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Parser\Handler; - -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Handler\WhitespaceHandler; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Token; - -class WhitespaceHandlerTest extends AbstractHandlerTest -{ - public function getHandleValueTestData() - { - return [ - [' ', new Token(Token::TYPE_WHITESPACE, ' ', 0), ''], - ["\n", new Token(Token::TYPE_WHITESPACE, "\n", 0), ''], - ["\t", new Token(Token::TYPE_WHITESPACE, "\t", 0), ''], - - [' foo', new Token(Token::TYPE_WHITESPACE, ' ', 0), 'foo'], - [' .foo', new Token(Token::TYPE_WHITESPACE, ' ', 0), '.foo'], - ]; - } - - public function getDontHandleValueTestData() - { - return [ - ['>'], - ['1'], - ['a'], - ]; - } - - protected function generateHandler() - { - return new WhitespaceHandler(); - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Parser/ParserTest.php b/lib/Symfony/Component/CssSelector/Tests/Parser/ParserTest.php deleted file mode 100644 index 030ce734..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Parser/ParserTest.php +++ /dev/null @@ -1,253 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Parser; - -use PHPUnit\Framework\TestCase; -use SimplePay\Vendor\Symfony\Component\CssSelector\Exception\SyntaxErrorException; -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\FunctionNode; -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\SelectorNode; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Parser; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Token; - -class ParserTest extends TestCase -{ - /** @dataProvider getParserTestData */ - public function testParser($source, $representation) - { - $parser = new Parser(); - - $this->assertEquals($representation, array_map(function (SelectorNode $node) { - return (string) $node->getTree(); - }, $parser->parse($source))); - } - - /** @dataProvider getParserExceptionTestData */ - public function testParserException($source, $message) - { - $parser = new Parser(); - - try { - $parser->parse($source); - $this->fail('Parser should throw a SyntaxErrorException.'); - } catch (SyntaxErrorException $e) { - $this->assertEquals($message, $e->getMessage()); - } - } - - /** @dataProvider getPseudoElementsTestData */ - public function testPseudoElements($source, $element, $pseudo) - { - $parser = new Parser(); - $selectors = $parser->parse($source); - $this->assertCount(1, $selectors); - - /** @var SelectorNode $selector */ - $selector = $selectors[0]; - $this->assertEquals($element, (string) $selector->getTree()); - $this->assertEquals($pseudo, (string) $selector->getPseudoElement()); - } - - /** @dataProvider getSpecificityTestData */ - public function testSpecificity($source, $value) - { - $parser = new Parser(); - $selectors = $parser->parse($source); - $this->assertCount(1, $selectors); - - /** @var SelectorNode $selector */ - $selector = $selectors[0]; - $this->assertEquals($value, $selector->getSpecificity()->getValue()); - } - - /** @dataProvider getParseSeriesTestData */ - public function testParseSeries($series, $a, $b) - { - $parser = new Parser(); - $selectors = $parser->parse(sprintf(':nth-child(%s)', $series)); - $this->assertCount(1, $selectors); - - /** @var FunctionNode $function */ - $function = $selectors[0]->getTree(); - $this->assertEquals([$a, $b], Parser::parseSeries($function->getArguments())); - } - - /** @dataProvider getParseSeriesExceptionTestData */ - public function testParseSeriesException($series) - { - $parser = new Parser(); - $selectors = $parser->parse(sprintf(':nth-child(%s)', $series)); - $this->assertCount(1, $selectors); - - /** @var FunctionNode $function */ - $function = $selectors[0]->getTree(); - $this->expectException('SimplePay\Vendor\Symfony\Component\CssSelector\Exception\SyntaxErrorException'); - Parser::parseSeries($function->getArguments()); - } - - public function getParserTestData() - { - return [ - ['*', ['Element[*]']], - ['*|*', ['Element[*]']], - ['*|foo', ['Element[foo]']], - ['foo|*', ['Element[foo|*]']], - ['foo|bar', ['Element[foo|bar]']], - ['#foo#bar', ['Hash[Hash[Element[*]#foo]#bar]']], - ['div>.foo', ['CombinedSelector[Element[div] > Class[Element[*].foo]]']], - ['div> .foo', ['CombinedSelector[Element[div] > Class[Element[*].foo]]']], - ['div >.foo', ['CombinedSelector[Element[div] > Class[Element[*].foo]]']], - ['div > .foo', ['CombinedSelector[Element[div] > Class[Element[*].foo]]']], - ["div \n> \t \t .foo", ['CombinedSelector[Element[div] > Class[Element[*].foo]]']], - ['td.foo,.bar', ['Class[Element[td].foo]', 'Class[Element[*].bar]']], - ['td.foo, .bar', ['Class[Element[td].foo]', 'Class[Element[*].bar]']], - ["td.foo\t\r\n\f ,\t\r\n\f .bar", ['Class[Element[td].foo]', 'Class[Element[*].bar]']], - ['td.foo,.bar', ['Class[Element[td].foo]', 'Class[Element[*].bar]']], - ['td.foo, .bar', ['Class[Element[td].foo]', 'Class[Element[*].bar]']], - ["td.foo\t\r\n\f ,\t\r\n\f .bar", ['Class[Element[td].foo]', 'Class[Element[*].bar]']], - ['div, td.foo, div.bar span', ['Element[div]', 'Class[Element[td].foo]', 'CombinedSelector[Class[Element[div].bar] Element[span]]']], - ['div > p', ['CombinedSelector[Element[div] > Element[p]]']], - ['td:first', ['Pseudo[Element[td]:first]']], - ['td :first', ['CombinedSelector[Element[td] Pseudo[Element[*]:first]]']], - ['a[name]', ['Attribute[Element[a][name]]']], - ["a[ name\t]", ['Attribute[Element[a][name]]']], - ['a [name]', ['CombinedSelector[Element[a] Attribute[Element[*][name]]]']], - ['[name="foo"]', ["Attribute[Element[*][name = 'foo']]"]], - ["[name='foo[1]']", ["Attribute[Element[*][name = 'foo[1]']]"]], - ["[name='foo[0][bar]']", ["Attribute[Element[*][name = 'foo[0][bar]']]"]], - ['a[rel="include"]', ["Attribute[Element[a][rel = 'include']]"]], - ['a[rel = include]', ["Attribute[Element[a][rel = 'include']]"]], - ["a[hreflang |= 'en']", ["Attribute[Element[a][hreflang |= 'en']]"]], - ['a[hreflang|=en]', ["Attribute[Element[a][hreflang |= 'en']]"]], - ['div:nth-child(10)', ["Function[Element[div]:nth-child(['10'])]"]], - [':nth-child(2n+2)', ["Function[Element[*]:nth-child(['2', 'n', '+2'])]"]], - ['div:nth-of-type(10)', ["Function[Element[div]:nth-of-type(['10'])]"]], - ['div div:nth-of-type(10) .aclass', ["CombinedSelector[CombinedSelector[Element[div] Function[Element[div]:nth-of-type(['10'])]] Class[Element[*].aclass]]"]], - ['label:only', ['Pseudo[Element[label]:only]']], - ['a:lang(fr)', ["Function[Element[a]:lang(['fr'])]"]], - ['div:contains("foo")', ["Function[Element[div]:contains(['foo'])]"]], - ['div#foobar', ['Hash[Element[div]#foobar]']], - ['div:not(div.foo)', ['Negation[Element[div]:not(Class[Element[div].foo])]']], - ['td ~ th', ['CombinedSelector[Element[td] ~ Element[th]]']], - ['.foo[data-bar][data-baz=0]', ["Attribute[Attribute[Class[Element[*].foo][data-bar]][data-baz = '0']]"]], - ]; - } - - public function getParserExceptionTestData() - { - return [ - ['attributes(href)/html/body/a', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '(', 10))->getMessage()], - ['attributes(href)', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '(', 10))->getMessage()], - ['html/body/a', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '/', 4))->getMessage()], - [' ', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_FILE_END, '', 1))->getMessage()], - ['div, ', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_FILE_END, '', 5))->getMessage()], - [' , div', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, ',', 1))->getMessage()], - ['p, , div', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, ',', 3))->getMessage()], - ['div > ', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_FILE_END, '', 6))->getMessage()], - [' > div', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '>', 2))->getMessage()], - ['foo|#bar', SyntaxErrorException::unexpectedToken('identifier or "*"', new Token(Token::TYPE_HASH, 'bar', 4))->getMessage()], - ['#.foo', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '#', 0))->getMessage()], - ['.#foo', SyntaxErrorException::unexpectedToken('identifier', new Token(Token::TYPE_HASH, 'foo', 1))->getMessage()], - [':#foo', SyntaxErrorException::unexpectedToken('identifier', new Token(Token::TYPE_HASH, 'foo', 1))->getMessage()], - ['[*]', SyntaxErrorException::unexpectedToken('"|"', new Token(Token::TYPE_DELIMITER, ']', 2))->getMessage()], - ['[foo|]', SyntaxErrorException::unexpectedToken('identifier', new Token(Token::TYPE_DELIMITER, ']', 5))->getMessage()], - ['[#]', SyntaxErrorException::unexpectedToken('identifier or "*"', new Token(Token::TYPE_DELIMITER, '#', 1))->getMessage()], - ['[foo=#]', SyntaxErrorException::unexpectedToken('string or identifier', new Token(Token::TYPE_DELIMITER, '#', 5))->getMessage()], - [':nth-child()', SyntaxErrorException::unexpectedToken('at least one argument', new Token(Token::TYPE_DELIMITER, ')', 11))->getMessage()], - ['[href]a', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_IDENTIFIER, 'a', 6))->getMessage()], - ['[rel:stylesheet]', SyntaxErrorException::unexpectedToken('operator', new Token(Token::TYPE_DELIMITER, ':', 4))->getMessage()], - ['[rel=stylesheet', SyntaxErrorException::unexpectedToken('"]"', new Token(Token::TYPE_FILE_END, '', 15))->getMessage()], - [':lang(fr', SyntaxErrorException::unexpectedToken('an argument', new Token(Token::TYPE_FILE_END, '', 8))->getMessage()], - [':contains("foo', SyntaxErrorException::unclosedString(10)->getMessage()], - ['foo!', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '!', 3))->getMessage()], - ]; - } - - public function getPseudoElementsTestData() - { - return [ - ['foo', 'Element[foo]', ''], - ['*', 'Element[*]', ''], - [':empty', 'Pseudo[Element[*]:empty]', ''], - [':BEfore', 'Element[*]', 'before'], - [':aftER', 'Element[*]', 'after'], - [':First-Line', 'Element[*]', 'first-line'], - [':First-Letter', 'Element[*]', 'first-letter'], - ['::befoRE', 'Element[*]', 'before'], - ['::AFter', 'Element[*]', 'after'], - ['::firsT-linE', 'Element[*]', 'first-line'], - ['::firsT-letteR', 'Element[*]', 'first-letter'], - ['::Selection', 'Element[*]', 'selection'], - ['foo:after', 'Element[foo]', 'after'], - ['foo::selection', 'Element[foo]', 'selection'], - ['lorem#ipsum ~ a#b.c[href]:empty::selection', 'CombinedSelector[Hash[Element[lorem]#ipsum] ~ Pseudo[Attribute[Class[Hash[Element[a]#b].c][href]]:empty]]', 'selection'], - ['video::-webkit-media-controls', 'Element[video]', '-webkit-media-controls'], - ]; - } - - public function getSpecificityTestData() - { - return [ - ['*', 0], - [' foo', 1], - [':empty ', 10], - [':before', 1], - ['*:before', 1], - [':nth-child(2)', 10], - ['.bar', 10], - ['[baz]', 10], - ['[baz="4"]', 10], - ['[baz^="4"]', 10], - ['#lipsum', 100], - [':not(*)', 0], - [':not(foo)', 1], - [':not(.foo)', 10], - [':not([foo])', 10], - [':not(:empty)', 10], - [':not(#foo)', 100], - ['foo:empty', 11], - ['foo:before', 2], - ['foo::before', 2], - ['foo:empty::before', 12], - ['#lorem + foo#ipsum:first-child > bar:first-line', 213], - ]; - } - - public function getParseSeriesTestData() - { - return [ - ['1n+3', 1, 3], - ['1n +3', 1, 3], - ['1n + 3', 1, 3], - ['1n+ 3', 1, 3], - ['1n-3', 1, -3], - ['1n -3', 1, -3], - ['1n - 3', 1, -3], - ['1n- 3', 1, -3], - ['n-5', 1, -5], - ['odd', 2, 1], - ['even', 2, 0], - ['3n', 3, 0], - ['n', 1, 0], - ['+n', 1, 0], - ['-n', -1, 0], - ['5', 0, 5], - ]; - } - - public function getParseSeriesExceptionTestData() - { - return [ - ['foo'], - ['n+'], - ]; - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Parser/ReaderTest.php b/lib/Symfony/Component/CssSelector/Tests/Parser/ReaderTest.php deleted file mode 100644 index 72c04698..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Parser/ReaderTest.php +++ /dev/null @@ -1,102 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Parser; - -use PHPUnit\Framework\TestCase; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Reader; - -class ReaderTest extends TestCase -{ - public function testIsEOF() - { - $reader = new Reader(''); - $this->assertTrue($reader->isEOF()); - - $reader = new Reader('hello'); - $this->assertFalse($reader->isEOF()); - - $this->assignPosition($reader, 2); - $this->assertFalse($reader->isEOF()); - - $this->assignPosition($reader, 5); - $this->assertTrue($reader->isEOF()); - } - - public function testGetRemainingLength() - { - $reader = new Reader('hello'); - $this->assertEquals(5, $reader->getRemainingLength()); - - $this->assignPosition($reader, 2); - $this->assertEquals(3, $reader->getRemainingLength()); - - $this->assignPosition($reader, 5); - $this->assertEquals(0, $reader->getRemainingLength()); - } - - public function testGetSubstring() - { - $reader = new Reader('hello'); - $this->assertEquals('he', $reader->getSubstring(2)); - $this->assertEquals('el', $reader->getSubstring(2, 1)); - - $this->assignPosition($reader, 2); - $this->assertEquals('ll', $reader->getSubstring(2)); - $this->assertEquals('lo', $reader->getSubstring(2, 1)); - } - - public function testGetOffset() - { - $reader = new Reader('hello'); - $this->assertEquals(2, $reader->getOffset('ll')); - $this->assertFalse($reader->getOffset('w')); - - $this->assignPosition($reader, 2); - $this->assertEquals(0, $reader->getOffset('ll')); - $this->assertFalse($reader->getOffset('he')); - } - - public function testFindPattern() - { - $reader = new Reader('hello'); - - $this->assertFalse($reader->findPattern('/world/')); - $this->assertEquals(['hello', 'h'], $reader->findPattern('/^([a-z]).*/')); - - $this->assignPosition($reader, 2); - $this->assertFalse($reader->findPattern('/^h.*/')); - $this->assertEquals(['llo'], $reader->findPattern('/^llo$/')); - } - - public function testMoveForward() - { - $reader = new Reader('hello'); - $this->assertEquals(0, $reader->getPosition()); - - $reader->moveForward(2); - $this->assertEquals(2, $reader->getPosition()); - } - - public function testToEnd() - { - $reader = new Reader('hello'); - $reader->moveToEnd(); - $this->assertTrue($reader->isEOF()); - } - - private function assignPosition(Reader $reader, $value) - { - $position = new \ReflectionProperty($reader, 'position'); - $position->setAccessible(true); - $position->setValue($reader, $value); - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Parser/Shortcut/ClassParserTest.php b/lib/Symfony/Component/CssSelector/Tests/Parser/Shortcut/ClassParserTest.php deleted file mode 100644 index c0cbc60c..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Parser/Shortcut/ClassParserTest.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Parser\Shortcut; - -use PHPUnit\Framework\TestCase; -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\SelectorNode; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Shortcut\ClassParser; - -/** - * @author Jean-François Simon - */ -class ClassParserTest extends TestCase -{ - /** @dataProvider getParseTestData */ - public function testParse($source, $representation) - { - $parser = new ClassParser(); - $selectors = $parser->parse($source); - $this->assertCount(1, $selectors); - - /** @var SelectorNode $selector */ - $selector = $selectors[0]; - $this->assertEquals($representation, (string) $selector->getTree()); - } - - public function getParseTestData() - { - return [ - ['.testclass', 'Class[Element[*].testclass]'], - ['testel.testclass', 'Class[Element[testel].testclass]'], - ['testns|.testclass', 'Class[Element[testns|*].testclass]'], - ['testns|*.testclass', 'Class[Element[testns|*].testclass]'], - ['testns|testel.testclass', 'Class[Element[testns|testel].testclass]'], - ]; - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Parser/Shortcut/ElementParserTest.php b/lib/Symfony/Component/CssSelector/Tests/Parser/Shortcut/ElementParserTest.php deleted file mode 100644 index 71cda4ae..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Parser/Shortcut/ElementParserTest.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Parser\Shortcut; - -use PHPUnit\Framework\TestCase; -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\SelectorNode; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Shortcut\ElementParser; - -/** - * @author Jean-François Simon - */ -class ElementParserTest extends TestCase -{ - /** @dataProvider getParseTestData */ - public function testParse($source, $representation) - { - $parser = new ElementParser(); - $selectors = $parser->parse($source); - $this->assertCount(1, $selectors); - - /** @var SelectorNode $selector */ - $selector = $selectors[0]; - $this->assertEquals($representation, (string) $selector->getTree()); - } - - public function getParseTestData() - { - return [ - ['*', 'Element[*]'], - ['testel', 'Element[testel]'], - ['testns|*', 'Element[testns|*]'], - ['testns|testel', 'Element[testns|testel]'], - ]; - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Parser/Shortcut/EmptyStringParserTest.php b/lib/Symfony/Component/CssSelector/Tests/Parser/Shortcut/EmptyStringParserTest.php deleted file mode 100644 index 638d8fb8..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Parser/Shortcut/EmptyStringParserTest.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Parser\Shortcut; - -use PHPUnit\Framework\TestCase; -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\SelectorNode; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Shortcut\EmptyStringParser; - -/** - * @author Jean-François Simon - */ -class EmptyStringParserTest extends TestCase -{ - public function testParse() - { - $parser = new EmptyStringParser(); - $selectors = $parser->parse(''); - $this->assertCount(1, $selectors); - - /** @var SelectorNode $selector */ - $selector = $selectors[0]; - $this->assertEquals('Element[*]', (string) $selector->getTree()); - - $selectors = $parser->parse('this will produce an empty array'); - $this->assertCount(0, $selectors); - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Parser/Shortcut/HashParserTest.php b/lib/Symfony/Component/CssSelector/Tests/Parser/Shortcut/HashParserTest.php deleted file mode 100644 index f86bf8d9..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Parser/Shortcut/HashParserTest.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Parser\Shortcut; - -use PHPUnit\Framework\TestCase; -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\SelectorNode; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Shortcut\HashParser; - -/** - * @author Jean-François Simon - */ -class HashParserTest extends TestCase -{ - /** @dataProvider getParseTestData */ - public function testParse($source, $representation) - { - $parser = new HashParser(); - $selectors = $parser->parse($source); - $this->assertCount(1, $selectors); - - /** @var SelectorNode $selector */ - $selector = $selectors[0]; - $this->assertEquals($representation, (string) $selector->getTree()); - } - - public function getParseTestData() - { - return [ - ['#testid', 'Hash[Element[*]#testid]'], - ['testel#testid', 'Hash[Element[testel]#testid]'], - ['testns|#testid', 'Hash[Element[testns|*]#testid]'], - ['testns|*#testid', 'Hash[Element[testns|*]#testid]'], - ['testns|testel#testid', 'Hash[Element[testns|testel]#testid]'], - ]; - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/Parser/TokenStreamTest.php b/lib/Symfony/Component/CssSelector/Tests/Parser/TokenStreamTest.php deleted file mode 100644 index c5917981..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/Parser/TokenStreamTest.php +++ /dev/null @@ -1,96 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\Parser; - -use PHPUnit\Framework\TestCase; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Token; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\TokenStream; - -class TokenStreamTest extends TestCase -{ - public function testGetNext() - { - $stream = new TokenStream(); - $stream->push($t1 = new Token(Token::TYPE_IDENTIFIER, 'h1', 0)); - $stream->push($t2 = new Token(Token::TYPE_DELIMITER, '.', 2)); - $stream->push($t3 = new Token(Token::TYPE_IDENTIFIER, 'title', 3)); - - $this->assertSame($t1, $stream->getNext()); - $this->assertSame($t2, $stream->getNext()); - $this->assertSame($t3, $stream->getNext()); - } - - public function testGetPeek() - { - $stream = new TokenStream(); - $stream->push($t1 = new Token(Token::TYPE_IDENTIFIER, 'h1', 0)); - $stream->push($t2 = new Token(Token::TYPE_DELIMITER, '.', 2)); - $stream->push($t3 = new Token(Token::TYPE_IDENTIFIER, 'title', 3)); - - $this->assertSame($t1, $stream->getPeek()); - $this->assertSame($t1, $stream->getNext()); - $this->assertSame($t2, $stream->getPeek()); - $this->assertSame($t2, $stream->getPeek()); - $this->assertSame($t2, $stream->getNext()); - } - - public function testGetNextIdentifier() - { - $stream = new TokenStream(); - $stream->push(new Token(Token::TYPE_IDENTIFIER, 'h1', 0)); - - $this->assertEquals('h1', $stream->getNextIdentifier()); - } - - public function testFailToGetNextIdentifier() - { - $this->expectException('SimplePay\Vendor\Symfony\Component\CssSelector\Exception\SyntaxErrorException'); - - $stream = new TokenStream(); - $stream->push(new Token(Token::TYPE_DELIMITER, '.', 2)); - $stream->getNextIdentifier(); - } - - public function testGetNextIdentifierOrStar() - { - $stream = new TokenStream(); - - $stream->push(new Token(Token::TYPE_IDENTIFIER, 'h1', 0)); - $this->assertEquals('h1', $stream->getNextIdentifierOrStar()); - - $stream->push(new Token(Token::TYPE_DELIMITER, '*', 0)); - $this->assertNull($stream->getNextIdentifierOrStar()); - } - - public function testFailToGetNextIdentifierOrStar() - { - $this->expectException('SimplePay\Vendor\Symfony\Component\CssSelector\Exception\SyntaxErrorException'); - - $stream = new TokenStream(); - $stream->push(new Token(Token::TYPE_DELIMITER, '.', 2)); - $stream->getNextIdentifierOrStar(); - } - - public function testSkipWhitespace() - { - $stream = new TokenStream(); - $stream->push($t1 = new Token(Token::TYPE_IDENTIFIER, 'h1', 0)); - $stream->push($t2 = new Token(Token::TYPE_WHITESPACE, ' ', 2)); - $stream->push($t3 = new Token(Token::TYPE_IDENTIFIER, 'h1', 3)); - - $stream->skipWhitespace(); - $this->assertSame($t1, $stream->getNext()); - - $stream->skipWhitespace(); - $this->assertSame($t3, $stream->getNext()); - } -} diff --git a/lib/Symfony/Component/CssSelector/Tests/XPath/Fixtures/ids.html b/lib/Symfony/Component/CssSelector/Tests/XPath/Fixtures/ids.html deleted file mode 100644 index 5799fad2..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/XPath/Fixtures/ids.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - -
- - - - link -
    -
  1. content
  2. -
  3. -
    -
    -
  4. -
  5. -
  6. -
  7. -
  8. -
  9. -
-

- hi there - guy - - - - - - - -

- - -
-

-
    -
- - - - -
-
- diff --git a/lib/Symfony/Component/CssSelector/Tests/XPath/Fixtures/lang.xml b/lib/Symfony/Component/CssSelector/Tests/XPath/Fixtures/lang.xml deleted file mode 100644 index 14f8dbed..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/XPath/Fixtures/lang.xml +++ /dev/null @@ -1,11 +0,0 @@ - - a - b - c - d - e - f - - - - diff --git a/lib/Symfony/Component/CssSelector/Tests/XPath/Fixtures/shakespear.html b/lib/Symfony/Component/CssSelector/Tests/XPath/Fixtures/shakespear.html deleted file mode 100644 index 15d1ad33..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/XPath/Fixtures/shakespear.html +++ /dev/null @@ -1,308 +0,0 @@ - - - - - - -
-
-

As You Like It

-
- by William Shakespeare -
-
-

ACT I, SCENE III. A room in the palace.

-
-
Enter CELIA and ROSALIND
-
-
CELIA
-
-
Why, cousin! why, Rosalind! Cupid have mercy! not a word?
-
-
ROSALIND
-
-
Not one to throw at a dog.
-
-
CELIA
-
-
No, thy words are too precious to be cast away upon
-
curs; throw some of them at me; come, lame me with reasons.
-
-
ROSALIND
-
CELIA
-
-
But is all this for your father?
-
-
-
Then there were two cousins laid up; when the one
-
should be lamed with reasons and the other mad
-
without any.
-
-
ROSALIND
-
-
No, some of it is for my child's father. O, how
-
full of briers is this working-day world!
-
-
CELIA
-
-
They are but burs, cousin, thrown upon thee in
-
holiday foolery: if we walk not in the trodden
-
paths our very petticoats will catch them.
-
-
ROSALIND
-
-
I could shake them off my coat: these burs are in my heart.
-
-
CELIA
-
-
Hem them away.
-
-
ROSALIND
-
-
I would try, if I could cry 'hem' and have him.
-
-
CELIA
-
-
Come, come, wrestle with thy affections.
-
-
ROSALIND
-
-
O, they take the part of a better wrestler than myself!
-
-
CELIA
-
-
O, a good wish upon you! you will try in time, in
-
despite of a fall. But, turning these jests out of
-
service, let us talk in good earnest: is it
-
possible, on such a sudden, you should fall into so
-
strong a liking with old Sir Rowland's youngest son?
-
-
ROSALIND
-
-
The duke my father loved his father dearly.
-
-
CELIA
-
-
Doth it therefore ensue that you should love his son
-
dearly? By this kind of chase, I should hate him,
-
for my father hated his father dearly; yet I hate
-
not Orlando.
-
-
ROSALIND
-
-
No, faith, hate him not, for my sake.
-
-
CELIA
-
-
Why should I not? doth he not deserve well?
-
-
ROSALIND
-
-
Let me love him for that, and do you love him
-
because I do. Look, here comes the duke.
-
-
CELIA
-
-
With his eyes full of anger.
-
Enter DUKE FREDERICK, with Lords
-
-
DUKE FREDERICK
-
-
Mistress, dispatch you with your safest haste
-
And get you from our court.
-
-
ROSALIND
-
-
Me, uncle?
-
-
DUKE FREDERICK
-
-
You, cousin
-
Within these ten days if that thou be'st found
-
So near our public court as twenty miles,
-
Thou diest for it.
-
-
ROSALIND
-
-
I do beseech your grace,
-
Let me the knowledge of my fault bear with me:
-
If with myself I hold intelligence
-
Or have acquaintance with mine own desires,
-
If that I do not dream or be not frantic,--
-
As I do trust I am not--then, dear uncle,
-
Never so much as in a thought unborn
-
Did I offend your highness.
-
-
DUKE FREDERICK
-
-
Thus do all traitors:
-
If their purgation did consist in words,
-
They are as innocent as grace itself:
-
Let it suffice thee that I trust thee not.
-
-
ROSALIND
-
-
Yet your mistrust cannot make me a traitor:
-
Tell me whereon the likelihood depends.
-
-
DUKE FREDERICK
-
-
Thou art thy father's daughter; there's enough.
-
-
ROSALIND
-
-
So was I when your highness took his dukedom;
-
So was I when your highness banish'd him:
-
Treason is not inherited, my lord;
-
Or, if we did derive it from our friends,
-
What's that to me? my father was no traitor:
-
Then, good my liege, mistake me not so much
-
To think my poverty is treacherous.
-
-
CELIA
-
-
Dear sovereign, hear me speak.
-
-
DUKE FREDERICK
-
-
Ay, Celia; we stay'd her for your sake,
-
Else had she with her father ranged along.
-
-
CELIA
-
-
I did not then entreat to have her stay;
-
It was your pleasure and your own remorse:
-
I was too young that time to value her;
-
But now I know her: if she be a traitor,
-
Why so am I; we still have slept together,
-
Rose at an instant, learn'd, play'd, eat together,
-
And wheresoever we went, like Juno's swans,
-
Still we went coupled and inseparable.
-
-
DUKE FREDERICK
-
-
She is too subtle for thee; and her smoothness,
-
Her very silence and her patience
-
Speak to the people, and they pity her.
-
Thou art a fool: she robs thee of thy name;
-
And thou wilt show more bright and seem more virtuous
-
When she is gone. Then open not thy lips:
-
Firm and irrevocable is my doom
-
Which I have pass'd upon her; she is banish'd.
-
-
CELIA
-
-
Pronounce that sentence then on me, my liege:
-
I cannot live out of her company.
-
-
DUKE FREDERICK
-
-
You are a fool. You, niece, provide yourself:
-
If you outstay the time, upon mine honour,
-
And in the greatness of my word, you die.
-
Exeunt DUKE FREDERICK and Lords
-
-
CELIA
-
-
O my poor Rosalind, whither wilt thou go?
-
Wilt thou change fathers? I will give thee mine.
-
I charge thee, be not thou more grieved than I am.
-
-
ROSALIND
-
-
I have more cause.
-
-
CELIA
-
-
Thou hast not, cousin;
-
Prithee be cheerful: know'st thou not, the duke
-
Hath banish'd me, his daughter?
-
-
ROSALIND
-
-
That he hath not.
-
-
CELIA
-
-
No, hath not? Rosalind lacks then the love
-
Which teacheth thee that thou and I am one:
-
Shall we be sunder'd? shall we part, sweet girl?
-
No: let my father seek another heir.
-
Therefore devise with me how we may fly,
-
Whither to go and what to bear with us;
-
And do not seek to take your change upon you,
-
To bear your griefs yourself and leave me out;
-
For, by this heaven, now at our sorrows pale,
-
Say what thou canst, I'll go along with thee.
-
-
ROSALIND
-
-
Why, whither shall we go?
-
-
CELIA
-
-
To seek my uncle in the forest of Arden.
-
-
ROSALIND
-
-
Alas, what danger will it be to us,
-
Maids as we are, to travel forth so far!
-
Beauty provoketh thieves sooner than gold.
-
-
CELIA
-
-
I'll put myself in poor and mean attire
-
And with a kind of umber smirch my face;
-
The like do you: so shall we pass along
-
And never stir assailants.
-
-
ROSALIND
-
-
Were it not better,
-
Because that I am more than common tall,
-
That I did suit me all points like a man?
-
A gallant curtle-axe upon my thigh,
-
A boar-spear in my hand; and--in my heart
-
Lie there what hidden woman's fear there will--
-
We'll have a swashing and a martial outside,
-
As many other mannish cowards have
-
That do outface it with their semblances.
-
-
CELIA
-
-
What shall I call thee when thou art a man?
-
-
ROSALIND
-
-
I'll have no worse a name than Jove's own page;
-
And therefore look you call me Ganymede.
-
But what will you be call'd?
-
-
CELIA
-
-
Something that hath a reference to my state
-
No longer Celia, but Aliena.
-
-
ROSALIND
-
-
But, cousin, what if we assay'd to steal
-
The clownish fool out of your father's court?
-
Would he not be a comfort to our travel?
-
-
CELIA
-
-
He'll go along o'er the wide world with me;
-
Leave me alone to woo him. Let's away,
-
And get our jewels and our wealth together,
-
Devise the fittest time and safest way
-
To hide us from pursuit that will be made
-
After my flight. Now go we in content
-
To liberty and not to banishment.
-
Exeunt
-
-
-
-
- - diff --git a/lib/Symfony/Component/CssSelector/Tests/XPath/TranslatorTest.php b/lib/Symfony/Component/CssSelector/Tests/XPath/TranslatorTest.php deleted file mode 100644 index 66c8f8b0..00000000 --- a/lib/Symfony/Component/CssSelector/Tests/XPath/TranslatorTest.php +++ /dev/null @@ -1,413 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace SimplePay\Vendor\Symfony\Component\CssSelector\Tests\XPath; - -use PHPUnit\Framework\TestCase; -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\ElementNode; -use SimplePay\Vendor\Symfony\Component\CssSelector\Node\FunctionNode; -use SimplePay\Vendor\Symfony\Component\CssSelector\Parser\Parser; -use SimplePay\Vendor\Symfony\Component\CssSelector\XPath\Extension\HtmlExtension; -use SimplePay\Vendor\Symfony\Component\CssSelector\XPath\Translator; -use SimplePay\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr; - -class TranslatorTest extends TestCase -{ - /** @dataProvider getXpathLiteralTestData */ - public function testXpathLiteral($value, $literal) - { - $this->assertEquals($literal, Translator::getXpathLiteral($value)); - } - - /** @dataProvider getCssToXPathTestData */ - public function testCssToXPath($css, $xpath) - { - $translator = new Translator(); - $translator->registerExtension(new HtmlExtension($translator)); - $this->assertEquals($xpath, $translator->cssToXPath($css, '')); - } - - public function testCssToXPathPseudoElement() - { - $this->expectException('SimplePay\Vendor\Symfony\Component\CssSelector\Exception\ExpressionErrorException'); - $translator = new Translator(); - $translator->registerExtension(new HtmlExtension($translator)); - $translator->cssToXPath('e::first-line'); - } - - public function testGetExtensionNotExistsExtension() - { - $this->expectException('SimplePay\Vendor\Symfony\Component\CssSelector\Exception\ExpressionErrorException'); - $translator = new Translator(); - $translator->registerExtension(new HtmlExtension($translator)); - $translator->getExtension('fake'); - } - - public function testAddCombinationNotExistsExtension() - { - $this->expectException('SimplePay\Vendor\Symfony\Component\CssSelector\Exception\ExpressionErrorException'); - $translator = new Translator(); - $translator->registerExtension(new HtmlExtension($translator)); - $parser = new Parser(); - $xpath = $parser->parse('*')[0]; - $combinedXpath = $parser->parse('*')[0]; - $translator->addCombination('fake', $xpath, $combinedXpath); - } - - public function testAddFunctionNotExistsFunction() - { - $this->expectException('SimplePay\Vendor\Symfony\Component\CssSelector\Exception\ExpressionErrorException'); - $translator = new Translator(); - $translator->registerExtension(new HtmlExtension($translator)); - $xpath = new XPathExpr(); - $function = new FunctionNode(new ElementNode(), 'fake'); - $translator->addFunction($xpath, $function); - } - - public function testAddPseudoClassNotExistsClass() - { - $this->expectException('SimplePay\Vendor\Symfony\Component\CssSelector\Exception\ExpressionErrorException'); - $translator = new Translator(); - $translator->registerExtension(new HtmlExtension($translator)); - $xpath = new XPathExpr(); - $translator->addPseudoClass($xpath, 'fake'); - } - - public function testAddAttributeMatchingClassNotExistsClass() - { - $this->expectException('SimplePay\Vendor\Symfony\Component\CssSelector\Exception\ExpressionErrorException'); - $translator = new Translator(); - $translator->registerExtension(new HtmlExtension($translator)); - $xpath = new XPathExpr(); - $translator->addAttributeMatching($xpath, '', '', ''); - } - - /** @dataProvider getXmlLangTestData */ - public function testXmlLang($css, array $elementsId) - { - $translator = new Translator(); - $document = new \SimpleXMLElement(file_get_contents(__DIR__.'/Fixtures/lang.xml')); - $elements = $document->xpath($translator->cssToXPath($css)); - $this->assertCount(\count($elementsId), $elements); - foreach ($elements as $element) { - $this->assertContains((string) $element->attributes()->id, $elementsId); - } - } - - /** @dataProvider getHtmlIdsTestData */ - public function testHtmlIds($css, array $elementsId) - { - $translator = new Translator(); - $translator->registerExtension(new HtmlExtension($translator)); - $document = new \DOMDocument(); - $document->strictErrorChecking = false; - $internalErrors = libxml_use_internal_errors(true); - $document->loadHTMLFile(__DIR__.'/Fixtures/ids.html'); - $document = simplexml_import_dom($document); - $elements = $document->xpath($translator->cssToXPath($css)); - $this->assertCount(\count($elementsId), $elementsId); - foreach ($elements as $element) { - if (null !== $element->attributes()->id) { - $this->assertContains((string) $element->attributes()->id, $elementsId); - } - } - libxml_clear_errors(); - libxml_use_internal_errors($internalErrors); - } - - /** @dataProvider getHtmlShakespearTestData */ - public function testHtmlShakespear($css, $count) - { - $translator = new Translator(); - $translator->registerExtension(new HtmlExtension($translator)); - $document = new \DOMDocument(); - $document->strictErrorChecking = false; - $document->loadHTMLFile(__DIR__.'/Fixtures/shakespear.html'); - $document = simplexml_import_dom($document); - $bodies = $document->xpath('//body'); - $elements = $bodies[0]->xpath($translator->cssToXPath($css)); - $this->assertCount($count, $elements); - } - - public function testOnlyOfTypeFindsSingleChildrenOfGivenType() - { - $translator = new Translator(); - $translator->registerExtension(new HtmlExtension($translator)); - $document = new \DOMDocument(); - $document->loadHTML(<<<'HTML' - - -

- A -

-

- B - C -

- - -HTML -); - - $xpath = new \DOMXPath($document); - $nodeList = $xpath->query($translator->cssToXPath('span:only-of-type')); - - $this->assertSame(1, $nodeList->length); - $this->assertSame('A', $nodeList->item(0)->textContent); - } - - public function getXpathLiteralTestData() - { - return [ - ['foo', "'foo'"], - ["foo's bar", '"foo\'s bar"'], - ["foo's \"middle\" bar", 'concat(\'foo\', "\'", \'s "middle" bar\')'], - ["foo's 'middle' \"bar\"", 'concat(\'foo\', "\'", \'s \', "\'", \'middle\', "\'", \' "bar"\')'], - ]; - } - - public function getCssToXPathTestData() - { - return [ - ['*', '*'], - ['e', 'e'], - ['*|e', 'e'], - ['e|f', 'e:f'], - ['e[foo]', 'e[@foo]'], - ['e[foo|bar]', 'e[@foo:bar]'], - ['e[foo="bar"]', "e[@foo = 'bar']"], - ['e[foo~="bar"]', "e[@foo and contains(concat(' ', normalize-space(@foo), ' '), ' bar ')]"], - ['e[foo^="bar"]', "e[@foo and starts-with(@foo, 'bar')]"], - ['e[foo$="bar"]', "e[@foo and substring(@foo, string-length(@foo)-2) = 'bar']"], - ['e[foo*="bar"]', "e[@foo and contains(@foo, 'bar')]"], - ['e[foo!="bar"]', "e[not(@foo) or @foo != 'bar']"], - ['e[foo!="bar"][foo!="baz"]', "e[(not(@foo) or @foo != 'bar') and (not(@foo) or @foo != 'baz')]"], - ['e[hreflang|="en"]', "e[@hreflang and (@hreflang = 'en' or starts-with(@hreflang, 'en-'))]"], - ['e:nth-child(1)', "*/*[(name() = 'e') and (position() = 1)]"], - ['e:nth-last-child(1)', "*/*[(name() = 'e') and (position() = last() - 0)]"], - ['e:nth-last-child(2n+2)', "*/*[(name() = 'e') and (last() - position() - 1 >= 0 and (last() - position() - 1) mod 2 = 0)]"], - ['e:nth-of-type(1)', '*/e[position() = 1]'], - ['e:nth-last-of-type(1)', '*/e[position() = last() - 0]'], - ['div e:nth-last-of-type(1) .aclass', "div/descendant-or-self::*/e[position() = last() - 0]/descendant-or-self::*/*[@class and contains(concat(' ', normalize-space(@class), ' '), ' aclass ')]"], - ['e:first-child', "*/*[(name() = 'e') and (position() = 1)]"], - ['e:last-child', "*/*[(name() = 'e') and (position() = last())]"], - ['e:first-of-type', '*/e[position() = 1]'], - ['e:last-of-type', '*/e[position() = last()]'], - ['e:only-child', "*/*[(name() = 'e') and (last() = 1)]"], - ['e:only-of-type', 'e[count(preceding-sibling::e)=0 and count(following-sibling::e)=0]'], - ['e:empty', 'e[not(*) and not(string-length())]'], - ['e:EmPTY', 'e[not(*) and not(string-length())]'], - ['e:root', 'e[not(parent::*)]'], - ['e:hover', 'e[0]'], - ['e:contains("foo")', "e[contains(string(.), 'foo')]"], - ['e:ConTains(foo)', "e[contains(string(.), 'foo')]"], - ['e.warning', "e[@class and contains(concat(' ', normalize-space(@class), ' '), ' warning ')]"], - ['e#myid', "e[@id = 'myid']"], - ['e:not(:nth-child(odd))', 'e[not(position() - 1 >= 0 and (position() - 1) mod 2 = 0)]'], - ['e:nOT(*)', 'e[0]'], - ['e f', 'e/descendant-or-self::*/f'], - ['e > f', 'e/f'], - ['e + f', "e/following-sibling::*[(name() = 'f') and (position() = 1)]"], - ['e ~ f', 'e/following-sibling::f'], - ['div#container p', "div[@id = 'container']/descendant-or-self::*/p"], - ]; - } - - public function getXmlLangTestData() - { - return [ - [':lang("EN")', ['first', 'second', 'third', 'fourth']], - [':lang("en-us")', ['second', 'fourth']], - [':lang(en-nz)', ['third']], - [':lang(fr)', ['fifth']], - [':lang(ru)', ['sixth']], - [":lang('ZH')", ['eighth']], - [':lang(de) :lang(zh)', ['eighth']], - [':lang(en), :lang(zh)', ['first', 'second', 'third', 'fourth', 'eighth']], - [':lang(es)', []], - ]; - } - - public function getHtmlIdsTestData() - { - return [ - ['div', ['outer-div', 'li-div', 'foobar-div']], - ['DIV', ['outer-div', 'li-div', 'foobar-div']], // case-insensitive in HTML - ['div div', ['li-div']], - ['div, div div', ['outer-div', 'li-div', 'foobar-div']], - ['a[name]', ['name-anchor']], - ['a[NAme]', ['name-anchor']], // case-insensitive in HTML: - ['a[rel]', ['tag-anchor', 'nofollow-anchor']], - ['a[rel="tag"]', ['tag-anchor']], - ['a[href*="localhost"]', ['tag-anchor']], - ['a[href*=""]', []], - ['a[href^="http"]', ['tag-anchor', 'nofollow-anchor']], - ['a[href^="http:"]', ['tag-anchor']], - ['a[href^=""]', []], - ['a[href$="org"]', ['nofollow-anchor']], - ['a[href$=""]', []], - ['div[foobar~="bc"]', ['foobar-div']], - ['div[foobar~="cde"]', ['foobar-div']], - ['[foobar~="ab bc"]', ['foobar-div']], - ['[foobar~=""]', []], - ['[foobar~=" \t"]', []], - ['div[foobar~="cd"]', []], - ['*[lang|="En"]', ['second-li']], - ['[lang|="En-us"]', ['second-li']], - // Attribute values are case sensitive - ['*[lang|="en"]', []], - ['[lang|="en-US"]', []], - ['*[lang|="e"]', []], - // ... :lang() is not. - [':lang("EN")', ['second-li', 'li-div']], - ['*:lang(en-US)', ['second-li', 'li-div']], - [':lang("e")', []], - ['li:nth-child(3)', ['third-li']], - ['li:nth-child(10)', []], - ['li:nth-child(2n)', ['second-li', 'fourth-li', 'sixth-li']], - ['li:nth-child(even)', ['second-li', 'fourth-li', 'sixth-li']], - ['li:nth-child(2n+0)', ['second-li', 'fourth-li', 'sixth-li']], - ['li:nth-child(+2n+1)', ['first-li', 'third-li', 'fifth-li', 'seventh-li']], - ['li:nth-child(odd)', ['first-li', 'third-li', 'fifth-li', 'seventh-li']], - ['li:nth-child(2n+4)', ['fourth-li', 'sixth-li']], - ['li:nth-child(3n+1)', ['first-li', 'fourth-li', 'seventh-li']], - ['li:nth-child(n)', ['first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li']], - ['li:nth-child(n-1)', ['first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li']], - ['li:nth-child(n+1)', ['first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li']], - ['li:nth-child(n+3)', ['third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li']], - ['li:nth-child(-n)', []], - ['li:nth-child(-n-1)', []], - ['li:nth-child(-n+1)', ['first-li']], - ['li:nth-child(-n+3)', ['first-li', 'second-li', 'third-li']], - ['li:nth-last-child(0)', []], - ['li:nth-last-child(2n)', ['second-li', 'fourth-li', 'sixth-li']], - ['li:nth-last-child(even)', ['second-li', 'fourth-li', 'sixth-li']], - ['li:nth-last-child(2n+2)', ['second-li', 'fourth-li', 'sixth-li']], - ['li:nth-last-child(n)', ['first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li']], - ['li:nth-last-child(n-1)', ['first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li']], - ['li:nth-last-child(n-3)', ['first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li']], - ['li:nth-last-child(n+1)', ['first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li']], - ['li:nth-last-child(n+3)', ['first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li']], - ['li:nth-last-child(-n)', []], - ['li:nth-last-child(-n-1)', []], - ['li:nth-last-child(-n+1)', ['seventh-li']], - ['li:nth-last-child(-n+3)', ['fifth-li', 'sixth-li', 'seventh-li']], - ['ol:first-of-type', ['first-ol']], - ['ol:nth-child(1)', ['first-ol']], - ['ol:nth-of-type(2)', ['second-ol']], - ['ol:nth-last-of-type(1)', ['second-ol']], - ['span:only-child', ['foobar-span']], - ['li div:only-child', ['li-div']], - ['div *:only-child', ['li-div', 'foobar-span']], - ['p:only-of-type', ['paragraph']], - ['a:empty', ['name-anchor']], - ['a:EMpty', ['name-anchor']], - ['li:empty', ['third-li', 'fourth-li', 'fifth-li', 'sixth-li']], - [':root', ['html']], - ['html:root', ['html']], - ['li:root', []], - ['* :root', []], - ['*:contains("link")', ['html', 'outer-div', 'tag-anchor', 'nofollow-anchor']], - [':CONtains("link")', ['html', 'outer-div', 'tag-anchor', 'nofollow-anchor']], - ['*:contains("LInk")', []], // case sensitive - ['*:contains("e")', ['html', 'nil', 'outer-div', 'first-ol', 'first-li', 'paragraph', 'p-em']], - ['*:contains("E")', []], // case-sensitive - ['.a', ['first-ol']], - ['.b', ['first-ol']], - ['*.a', ['first-ol']], - ['ol.a', ['first-ol']], - ['.c', ['first-ol', 'third-li', 'fourth-li']], - ['*.c', ['first-ol', 'third-li', 'fourth-li']], - ['ol *.c', ['third-li', 'fourth-li']], - ['ol li.c', ['third-li', 'fourth-li']], - ['li ~ li.c', ['third-li', 'fourth-li']], - ['ol > li.c', ['third-li', 'fourth-li']], - ['#first-li', ['first-li']], - ['li#first-li', ['first-li']], - ['*#first-li', ['first-li']], - ['li div', ['li-div']], - ['li > div', ['li-div']], - ['div div', ['li-div']], - ['div > div', []], - ['div>.c', ['first-ol']], - ['div > .c', ['first-ol']], - ['div + div', ['foobar-div']], - ['a ~ a', ['tag-anchor', 'nofollow-anchor']], - ['a[rel="tag"] ~ a', ['nofollow-anchor']], - ['ol#first-ol li:last-child', ['seventh-li']], - ['ol#first-ol *:last-child', ['li-div', 'seventh-li']], - ['#outer-div:first-child', ['outer-div']], - ['#outer-div :first-child', ['name-anchor', 'first-li', 'li-div', 'p-b', 'checkbox-fieldset-disabled', 'area-href']], - ['a[href]', ['tag-anchor', 'nofollow-anchor']], - [':not(*)', []], - ['a:not([href])', ['name-anchor']], - ['ol :Not(li[class])', ['first-li', 'second-li', 'li-div', 'fifth-li', 'sixth-li', 'seventh-li']], - // HTML-specific - [':link', ['link-href', 'tag-anchor', 'nofollow-anchor', 'area-href']], - [':visited', []], - [':enabled', ['link-href', 'tag-anchor', 'nofollow-anchor', 'checkbox-unchecked', 'text-checked', 'checkbox-checked', 'area-href']], - [':disabled', ['checkbox-disabled', 'checkbox-disabled-checked', 'fieldset', 'checkbox-fieldset-disabled']], - [':checked', ['checkbox-checked', 'checkbox-disabled-checked']], - ]; - } - - public function getHtmlShakespearTestData() - { - return [ - ['*', 246], - ['div:contains(CELIA)', 26], - ['div:only-child', 22], // ? - ['div:nth-child(even)', 106], - ['div:nth-child(2n)', 106], - ['div:nth-child(odd)', 137], - ['div:nth-child(2n+1)', 137], - ['div:nth-child(n)', 243], - ['div:last-child', 53], - ['div:first-child', 51], - ['div > div', 242], - ['div + div', 190], - ['div ~ div', 190], - ['body', 1], - ['body div', 243], - ['div', 243], - ['div div', 242], - ['div div div', 241], - ['div, div, div', 243], - ['div, a, span', 243], - ['.dialog', 51], - ['div.dialog', 51], - ['div .dialog', 51], - ['div.character, div.dialog', 99], - ['div.direction.dialog', 0], - ['div.dialog.direction', 0], - ['div.dialog.scene', 1], - ['div.scene.scene', 1], - ['div.scene .scene', 0], - ['div.direction .dialog ', 0], - ['div .dialog .direction', 4], - ['div.dialog .dialog .direction', 4], - ['#speech5', 1], - ['div#speech5', 1], - ['div #speech5', 1], - ['div.scene div.dialog', 49], - ['div#scene1 div.dialog div', 142], - ['#scene1 #speech1', 1], - ['div[class]', 103], - ['div[class=dialog]', 50], - ['div[class^=dia]', 51], - ['div[class$=log]', 50], - ['div[class*=sce]', 1], - ['div[class|=dialog]', 50], // ? Seems right - ['div[class!=madeup]', 243], // ? Seems right - ['div[class~=dialog]', 51], // ? Seems right - ]; - } -} diff --git a/lib/Symfony/Component/CssSelector/XPath/Extension/AbstractExtension.php b/lib/Symfony/Component/CssSelector/XPath/Extension/AbstractExtension.php index c7483c74..9db3fdc9 100644 --- a/lib/Symfony/Component/CssSelector/XPath/Extension/AbstractExtension.php +++ b/lib/Symfony/Component/CssSelector/XPath/Extension/AbstractExtension.php @@ -26,7 +26,7 @@ abstract class AbstractExtension implements ExtensionInterface /** * {@inheritdoc} */ - public function getNodeTranslators() + public function getNodeTranslators(): array { return []; } @@ -34,7 +34,7 @@ public function getNodeTranslators() /** * {@inheritdoc} */ - public function getCombinationTranslators() + public function getCombinationTranslators(): array { return []; } @@ -42,7 +42,7 @@ public function getCombinationTranslators() /** * {@inheritdoc} */ - public function getFunctionTranslators() + public function getFunctionTranslators(): array { return []; } @@ -50,7 +50,7 @@ public function getFunctionTranslators() /** * {@inheritdoc} */ - public function getPseudoClassTranslators() + public function getPseudoClassTranslators(): array { return []; } @@ -58,7 +58,7 @@ public function getPseudoClassTranslators() /** * {@inheritdoc} */ - public function getAttributeMatchingTranslators() + public function getAttributeMatchingTranslators(): array { return []; } diff --git a/lib/Symfony/Component/CssSelector/XPath/Extension/AttributeMatchingExtension.php b/lib/Symfony/Component/CssSelector/XPath/Extension/AttributeMatchingExtension.php index 6b555a31..70d3c331 100644 --- a/lib/Symfony/Component/CssSelector/XPath/Extension/AttributeMatchingExtension.php +++ b/lib/Symfony/Component/CssSelector/XPath/Extension/AttributeMatchingExtension.php @@ -29,7 +29,7 @@ class AttributeMatchingExtension extends AbstractExtension /** * {@inheritdoc} */ - public function getAttributeMatchingTranslators() + public function getAttributeMatchingTranslators(): array { return [ 'exists' => [$this, 'translateExists'], @@ -43,35 +43,17 @@ public function getAttributeMatchingTranslators() ]; } - /** - * @param string $attribute - * @param string $value - * - * @return XPathExpr - */ - public function translateExists(XPathExpr $xpath, $attribute, $value) + public function translateExists(XPathExpr $xpath, string $attribute, ?string $value): XPathExpr { return $xpath->addCondition($attribute); } - /** - * @param string $attribute - * @param string $value - * - * @return XPathExpr - */ - public function translateEquals(XPathExpr $xpath, $attribute, $value) + public function translateEquals(XPathExpr $xpath, string $attribute, ?string $value): XPathExpr { return $xpath->addCondition(sprintf('%s = %s', $attribute, Translator::getXpathLiteral($value))); } - /** - * @param string $attribute - * @param string $value - * - * @return XPathExpr - */ - public function translateIncludes(XPathExpr $xpath, $attribute, $value) + public function translateIncludes(XPathExpr $xpath, string $attribute, ?string $value): XPathExpr { return $xpath->addCondition($value ? sprintf( '%1$s and contains(concat(\' \', normalize-space(%1$s), \' \'), %2$s)', @@ -80,13 +62,7 @@ public function translateIncludes(XPathExpr $xpath, $attribute, $value) ) : '0'); } - /** - * @param string $attribute - * @param string $value - * - * @return XPathExpr - */ - public function translateDashMatch(XPathExpr $xpath, $attribute, $value) + public function translateDashMatch(XPathExpr $xpath, string $attribute, ?string $value): XPathExpr { return $xpath->addCondition(sprintf( '%1$s and (%1$s = %2$s or starts-with(%1$s, %3$s))', @@ -96,13 +72,7 @@ public function translateDashMatch(XPathExpr $xpath, $attribute, $value) )); } - /** - * @param string $attribute - * @param string $value - * - * @return XPathExpr - */ - public function translatePrefixMatch(XPathExpr $xpath, $attribute, $value) + public function translatePrefixMatch(XPathExpr $xpath, string $attribute, ?string $value): XPathExpr { return $xpath->addCondition($value ? sprintf( '%1$s and starts-with(%1$s, %2$s)', @@ -111,13 +81,7 @@ public function translatePrefixMatch(XPathExpr $xpath, $attribute, $value) ) : '0'); } - /** - * @param string $attribute - * @param string $value - * - * @return XPathExpr - */ - public function translateSuffixMatch(XPathExpr $xpath, $attribute, $value) + public function translateSuffixMatch(XPathExpr $xpath, string $attribute, ?string $value): XPathExpr { return $xpath->addCondition($value ? sprintf( '%1$s and substring(%1$s, string-length(%1$s)-%2$s) = %3$s', @@ -127,13 +91,7 @@ public function translateSuffixMatch(XPathExpr $xpath, $attribute, $value) ) : '0'); } - /** - * @param string $attribute - * @param string $value - * - * @return XPathExpr - */ - public function translateSubstringMatch(XPathExpr $xpath, $attribute, $value) + public function translateSubstringMatch(XPathExpr $xpath, string $attribute, ?string $value): XPathExpr { return $xpath->addCondition($value ? sprintf( '%1$s and contains(%1$s, %2$s)', @@ -142,13 +100,7 @@ public function translateSubstringMatch(XPathExpr $xpath, $attribute, $value) ) : '0'); } - /** - * @param string $attribute - * @param string $value - * - * @return XPathExpr - */ - public function translateDifferent(XPathExpr $xpath, $attribute, $value) + public function translateDifferent(XPathExpr $xpath, string $attribute, ?string $value): XPathExpr { return $xpath->addCondition(sprintf( $value ? 'not(%1$s) or %1$s != %2$s' : '%s != %s', @@ -160,7 +112,7 @@ public function translateDifferent(XPathExpr $xpath, $attribute, $value) /** * {@inheritdoc} */ - public function getName() + public function getName(): string { return 'attribute-matching'; } diff --git a/lib/Symfony/Component/CssSelector/XPath/Extension/CombinationExtension.php b/lib/Symfony/Component/CssSelector/XPath/Extension/CombinationExtension.php index 75207ad3..7e589c58 100644 --- a/lib/Symfony/Component/CssSelector/XPath/Extension/CombinationExtension.php +++ b/lib/Symfony/Component/CssSelector/XPath/Extension/CombinationExtension.php @@ -28,7 +28,7 @@ class CombinationExtension extends AbstractExtension /** * {@inheritdoc} */ - public function getCombinationTranslators() + public function getCombinationTranslators(): array { return [ ' ' => [$this, 'translateDescendant'], @@ -38,26 +38,17 @@ public function getCombinationTranslators() ]; } - /** - * @return XPathExpr - */ - public function translateDescendant(XPathExpr $xpath, XPathExpr $combinedXpath) + public function translateDescendant(XPathExpr $xpath, XPathExpr $combinedXpath): XPathExpr { return $xpath->join('/descendant-or-self::*/', $combinedXpath); } - /** - * @return XPathExpr - */ - public function translateChild(XPathExpr $xpath, XPathExpr $combinedXpath) + public function translateChild(XPathExpr $xpath, XPathExpr $combinedXpath): XPathExpr { return $xpath->join('/', $combinedXpath); } - /** - * @return XPathExpr - */ - public function translateDirectAdjacent(XPathExpr $xpath, XPathExpr $combinedXpath) + public function translateDirectAdjacent(XPathExpr $xpath, XPathExpr $combinedXpath): XPathExpr { return $xpath ->join('/following-sibling::', $combinedXpath) @@ -65,10 +56,7 @@ public function translateDirectAdjacent(XPathExpr $xpath, XPathExpr $combinedXpa ->addCondition('position() = 1'); } - /** - * @return XPathExpr - */ - public function translateIndirectAdjacent(XPathExpr $xpath, XPathExpr $combinedXpath) + public function translateIndirectAdjacent(XPathExpr $xpath, XPathExpr $combinedXpath): XPathExpr { return $xpath->join('/following-sibling::', $combinedXpath); } @@ -76,7 +64,7 @@ public function translateIndirectAdjacent(XPathExpr $xpath, XPathExpr $combinedX /** * {@inheritdoc} */ - public function getName() + public function getName(): string { return 'combination'; } diff --git a/lib/Symfony/Component/CssSelector/XPath/Extension/ExtensionInterface.php b/lib/Symfony/Component/CssSelector/XPath/Extension/ExtensionInterface.php index 11ac5734..0dc17426 100644 --- a/lib/Symfony/Component/CssSelector/XPath/Extension/ExtensionInterface.php +++ b/lib/Symfony/Component/CssSelector/XPath/Extension/ExtensionInterface.php @@ -30,40 +30,38 @@ interface ExtensionInterface * * @return callable[] */ - public function getNodeTranslators(); + public function getNodeTranslators(): array; /** * Returns combination translators. * * @return callable[] */ - public function getCombinationTranslators(); + public function getCombinationTranslators(): array; /** * Returns function translators. * * @return callable[] */ - public function getFunctionTranslators(); + public function getFunctionTranslators(): array; /** * Returns pseudo-class translators. * * @return callable[] */ - public function getPseudoClassTranslators(); + public function getPseudoClassTranslators(): array; /** * Returns attribute operation translators. * * @return callable[] */ - public function getAttributeMatchingTranslators(); + public function getAttributeMatchingTranslators(): array; /** * Returns extension name. - * - * @return string */ - public function getName(); + public function getName(): string; } diff --git a/lib/Symfony/Component/CssSelector/XPath/Extension/FunctionExtension.php b/lib/Symfony/Component/CssSelector/XPath/Extension/FunctionExtension.php index 0afaaccd..ba398238 100644 --- a/lib/Symfony/Component/CssSelector/XPath/Extension/FunctionExtension.php +++ b/lib/Symfony/Component/CssSelector/XPath/Extension/FunctionExtension.php @@ -33,7 +33,7 @@ class FunctionExtension extends AbstractExtension /** * {@inheritdoc} */ - public function getFunctionTranslators() + public function getFunctionTranslators(): array { return [ 'nth-child' => [$this, 'translateNthChild'], @@ -46,17 +46,12 @@ public function getFunctionTranslators() } /** - * @param bool $last - * @param bool $addNameTest - * - * @return XPathExpr - * * @throws ExpressionErrorException */ - public function translateNthChild(XPathExpr $xpath, FunctionNode $function, $last = false, $addNameTest = true) + public function translateNthChild(XPathExpr $xpath, FunctionNode $function, bool $last = false, bool $addNameTest = true): XPathExpr { try { - list($a, $b) = Parser::parseSeries($function->getArguments()); + [$a, $b] = Parser::parseSeries($function->getArguments()); } catch (SyntaxErrorException $e) { throw new ExpressionErrorException(sprintf('Invalid series: "%s".', implode('", "', $function->getArguments())), 0, $e); } @@ -108,28 +103,20 @@ public function translateNthChild(XPathExpr $xpath, FunctionNode $function, $las // -1n+6 means elements 6 and previous } - /** - * @return XPathExpr - */ - public function translateNthLastChild(XPathExpr $xpath, FunctionNode $function) + public function translateNthLastChild(XPathExpr $xpath, FunctionNode $function): XPathExpr { return $this->translateNthChild($xpath, $function, true); } - /** - * @return XPathExpr - */ - public function translateNthOfType(XPathExpr $xpath, FunctionNode $function) + public function translateNthOfType(XPathExpr $xpath, FunctionNode $function): XPathExpr { return $this->translateNthChild($xpath, $function, false, false); } /** - * @return XPathExpr - * * @throws ExpressionErrorException */ - public function translateNthLastOfType(XPathExpr $xpath, FunctionNode $function) + public function translateNthLastOfType(XPathExpr $xpath, FunctionNode $function): XPathExpr { if ('*' === $xpath->getElement()) { throw new ExpressionErrorException('"*:nth-of-type()" is not implemented.'); @@ -139,11 +126,9 @@ public function translateNthLastOfType(XPathExpr $xpath, FunctionNode $function) } /** - * @return XPathExpr - * * @throws ExpressionErrorException */ - public function translateContains(XPathExpr $xpath, FunctionNode $function) + public function translateContains(XPathExpr $xpath, FunctionNode $function): XPathExpr { $arguments = $function->getArguments(); foreach ($arguments as $token) { @@ -159,11 +144,9 @@ public function translateContains(XPathExpr $xpath, FunctionNode $function) } /** - * @return XPathExpr - * * @throws ExpressionErrorException */ - public function translateLang(XPathExpr $xpath, FunctionNode $function) + public function translateLang(XPathExpr $xpath, FunctionNode $function): XPathExpr { $arguments = $function->getArguments(); foreach ($arguments as $token) { @@ -181,7 +164,7 @@ public function translateLang(XPathExpr $xpath, FunctionNode $function) /** * {@inheritdoc} */ - public function getName() + public function getName(): string { return 'function'; } diff --git a/lib/Symfony/Component/CssSelector/XPath/Extension/HtmlExtension.php b/lib/Symfony/Component/CssSelector/XPath/Extension/HtmlExtension.php index 58a0c5d5..64dc3871 100644 --- a/lib/Symfony/Component/CssSelector/XPath/Extension/HtmlExtension.php +++ b/lib/Symfony/Component/CssSelector/XPath/Extension/HtmlExtension.php @@ -39,7 +39,7 @@ public function __construct(Translator $translator) /** * {@inheritdoc} */ - public function getPseudoClassTranslators() + public function getPseudoClassTranslators(): array { return [ 'checked' => [$this, 'translateChecked'], @@ -56,17 +56,14 @@ public function getPseudoClassTranslators() /** * {@inheritdoc} */ - public function getFunctionTranslators() + public function getFunctionTranslators(): array { return [ 'lang' => [$this, 'translateLang'], ]; } - /** - * @return XPathExpr - */ - public function translateChecked(XPathExpr $xpath) + public function translateChecked(XPathExpr $xpath): XPathExpr { return $xpath->addCondition( '(@checked ' @@ -75,18 +72,12 @@ public function translateChecked(XPathExpr $xpath) ); } - /** - * @return XPathExpr - */ - public function translateLink(XPathExpr $xpath) + public function translateLink(XPathExpr $xpath): XPathExpr { return $xpath->addCondition("@href and (name(.) = 'a' or name(.) = 'link' or name(.) = 'area')"); } - /** - * @return XPathExpr - */ - public function translateDisabled(XPathExpr $xpath) + public function translateDisabled(XPathExpr $xpath): XPathExpr { return $xpath->addCondition( '(' @@ -112,10 +103,7 @@ public function translateDisabled(XPathExpr $xpath) // todo: in the second half, add "and is not a descendant of that fieldset element's first legend element child, if any." } - /** - * @return XPathExpr - */ - public function translateEnabled(XPathExpr $xpath) + public function translateEnabled(XPathExpr $xpath): XPathExpr { return $xpath->addCondition( '(' @@ -149,11 +137,9 @@ public function translateEnabled(XPathExpr $xpath) } /** - * @return XPathExpr - * * @throws ExpressionErrorException */ - public function translateLang(XPathExpr $xpath, FunctionNode $function) + public function translateLang(XPathExpr $xpath, FunctionNode $function): XPathExpr { $arguments = $function->getArguments(); foreach ($arguments as $token) { @@ -171,34 +157,22 @@ public function translateLang(XPathExpr $xpath, FunctionNode $function) )); } - /** - * @return XPathExpr - */ - public function translateSelected(XPathExpr $xpath) + public function translateSelected(XPathExpr $xpath): XPathExpr { return $xpath->addCondition("(@selected and name(.) = 'option')"); } - /** - * @return XPathExpr - */ - public function translateInvalid(XPathExpr $xpath) + public function translateInvalid(XPathExpr $xpath): XPathExpr { return $xpath->addCondition('0'); } - /** - * @return XPathExpr - */ - public function translateHover(XPathExpr $xpath) + public function translateHover(XPathExpr $xpath): XPathExpr { return $xpath->addCondition('0'); } - /** - * @return XPathExpr - */ - public function translateVisited(XPathExpr $xpath) + public function translateVisited(XPathExpr $xpath): XPathExpr { return $xpath->addCondition('0'); } @@ -206,7 +180,7 @@ public function translateVisited(XPathExpr $xpath) /** * {@inheritdoc} */ - public function getName() + public function getName(): string { return 'html'; } diff --git a/lib/Symfony/Component/CssSelector/XPath/Extension/NodeExtension.php b/lib/Symfony/Component/CssSelector/XPath/Extension/NodeExtension.php index 4034b315..6628c0fa 100644 --- a/lib/Symfony/Component/CssSelector/XPath/Extension/NodeExtension.php +++ b/lib/Symfony/Component/CssSelector/XPath/Extension/NodeExtension.php @@ -27,27 +27,21 @@ */ class NodeExtension extends AbstractExtension { - const ELEMENT_NAME_IN_LOWER_CASE = 1; - const ATTRIBUTE_NAME_IN_LOWER_CASE = 2; - const ATTRIBUTE_VALUE_IN_LOWER_CASE = 4; + public const ELEMENT_NAME_IN_LOWER_CASE = 1; + public const ATTRIBUTE_NAME_IN_LOWER_CASE = 2; + public const ATTRIBUTE_VALUE_IN_LOWER_CASE = 4; private $flags; - /** - * @param int $flags - */ - public function __construct($flags = 0) + public function __construct(int $flags = 0) { $this->flags = $flags; } /** - * @param int $flag - * @param bool $on - * * @return $this */ - public function setFlag($flag, $on) + public function setFlag(int $flag, bool $on): self { if ($on && !$this->hasFlag($flag)) { $this->flags += $flag; @@ -60,12 +54,7 @@ public function setFlag($flag, $on) return $this; } - /** - * @param int $flag - * - * @return bool - */ - public function hasFlag($flag) + public function hasFlag(int $flag): bool { return (bool) ($this->flags & $flag); } @@ -73,7 +62,7 @@ public function hasFlag($flag) /** * {@inheritdoc} */ - public function getNodeTranslators() + public function getNodeTranslators(): array { return [ 'Selector' => [$this, 'translateSelector'], @@ -81,33 +70,24 @@ public function getNodeTranslators() 'Negation' => [$this, 'translateNegation'], 'Function' => [$this, 'translateFunction'], 'Pseudo' => [$this, 'translatePseudo'], - 'Attribute' => [$this, 'translateAttribute'], + 'SimplePay_Attribute' => [$this, 'translateAttribute'], 'Class' => [$this, 'translateClass'], 'Hash' => [$this, 'translateHash'], 'Element' => [$this, 'translateElement'], ]; } - /** - * @return XPathExpr - */ - public function translateSelector(Node\SelectorNode $node, Translator $translator) + public function translateSelector(Node\SelectorNode $node, Translator $translator): XPathExpr { return $translator->nodeToXPath($node->getTree()); } - /** - * @return XPathExpr - */ - public function translateCombinedSelector(Node\CombinedSelectorNode $node, Translator $translator) + public function translateCombinedSelector(Node\CombinedSelectorNode $node, Translator $translator): XPathExpr { return $translator->addCombination($node->getCombinator(), $node->getSelector(), $node->getSubSelector()); } - /** - * @return XPathExpr - */ - public function translateNegation(Node\NegationNode $node, Translator $translator) + public function translateNegation(Node\NegationNode $node, Translator $translator): XPathExpr { $xpath = $translator->nodeToXPath($node->getSelector()); $subXpath = $translator->nodeToXPath($node->getSubSelector()); @@ -120,30 +100,21 @@ public function translateNegation(Node\NegationNode $node, Translator $translato return $xpath->addCondition('0'); } - /** - * @return XPathExpr - */ - public function translateFunction(Node\FunctionNode $node, Translator $translator) + public function translateFunction(Node\FunctionNode $node, Translator $translator): XPathExpr { $xpath = $translator->nodeToXPath($node->getSelector()); return $translator->addFunction($xpath, $node); } - /** - * @return XPathExpr - */ - public function translatePseudo(Node\PseudoNode $node, Translator $translator) + public function translatePseudo(Node\PseudoNode $node, Translator $translator): XPathExpr { $xpath = $translator->nodeToXPath($node->getSelector()); return $translator->addPseudoClass($xpath, $node->getIdentifier()); } - /** - * @return XPathExpr - */ - public function translateAttribute(Node\AttributeNode $node, Translator $translator) + public function translateAttribute(Node\AttributeNode $node, Translator $translator): XPathExpr { $name = $node->getAttribute(); $safe = $this->isSafeName($name); @@ -168,34 +139,25 @@ public function translateAttribute(Node\AttributeNode $node, Translator $transla return $translator->addAttributeMatching($xpath, $node->getOperator(), $attribute, $value); } - /** - * @return XPathExpr - */ - public function translateClass(Node\ClassNode $node, Translator $translator) + public function translateClass(Node\ClassNode $node, Translator $translator): XPathExpr { $xpath = $translator->nodeToXPath($node->getSelector()); return $translator->addAttributeMatching($xpath, '~=', '@class', $node->getName()); } - /** - * @return XPathExpr - */ - public function translateHash(Node\HashNode $node, Translator $translator) + public function translateHash(Node\HashNode $node, Translator $translator): XPathExpr { $xpath = $translator->nodeToXPath($node->getSelector()); return $translator->addAttributeMatching($xpath, '=', '@id', $node->getId()); } - /** - * @return XPathExpr - */ - public function translateElement(Node\ElementNode $node) + public function translateElement(Node\ElementNode $node): XPathExpr { $element = $node->getElement(); - if ($this->hasFlag(self::ELEMENT_NAME_IN_LOWER_CASE)) { + if ($element && $this->hasFlag(self::ELEMENT_NAME_IN_LOWER_CASE)) { $element = strtolower($element); } @@ -223,19 +185,12 @@ public function translateElement(Node\ElementNode $node) /** * {@inheritdoc} */ - public function getName() + public function getName(): string { return 'node'; } - /** - * Tests if given name is safe. - * - * @param string $name - * - * @return bool - */ - private function isSafeName($name) + private function isSafeName(string $name): bool { return 0 < preg_match('~^[a-zA-Z_][a-zA-Z0-9_.-]*$~', $name); } diff --git a/lib/Symfony/Component/CssSelector/XPath/Extension/PseudoClassExtension.php b/lib/Symfony/Component/CssSelector/XPath/Extension/PseudoClassExtension.php index 30c13f70..32a8a065 100644 --- a/lib/Symfony/Component/CssSelector/XPath/Extension/PseudoClassExtension.php +++ b/lib/Symfony/Component/CssSelector/XPath/Extension/PseudoClassExtension.php @@ -29,7 +29,7 @@ class PseudoClassExtension extends AbstractExtension /** * {@inheritdoc} */ - public function getPseudoClassTranslators() + public function getPseudoClassTranslators(): array { return [ 'root' => [$this, 'translateRoot'], @@ -43,18 +43,12 @@ public function getPseudoClassTranslators() ]; } - /** - * @return XPathExpr - */ - public function translateRoot(XPathExpr $xpath) + public function translateRoot(XPathExpr $xpath): XPathExpr { return $xpath->addCondition('not(parent::*)'); } - /** - * @return XPathExpr - */ - public function translateFirstChild(XPathExpr $xpath) + public function translateFirstChild(XPathExpr $xpath): XPathExpr { return $xpath ->addStarPrefix() @@ -62,10 +56,7 @@ public function translateFirstChild(XPathExpr $xpath) ->addCondition('position() = 1'); } - /** - * @return XPathExpr - */ - public function translateLastChild(XPathExpr $xpath) + public function translateLastChild(XPathExpr $xpath): XPathExpr { return $xpath ->addStarPrefix() @@ -74,11 +65,9 @@ public function translateLastChild(XPathExpr $xpath) } /** - * @return XPathExpr - * * @throws ExpressionErrorException */ - public function translateFirstOfType(XPathExpr $xpath) + public function translateFirstOfType(XPathExpr $xpath): XPathExpr { if ('*' === $xpath->getElement()) { throw new ExpressionErrorException('"*:first-of-type" is not implemented.'); @@ -90,11 +79,9 @@ public function translateFirstOfType(XPathExpr $xpath) } /** - * @return XPathExpr - * * @throws ExpressionErrorException */ - public function translateLastOfType(XPathExpr $xpath) + public function translateLastOfType(XPathExpr $xpath): XPathExpr { if ('*' === $xpath->getElement()) { throw new ExpressionErrorException('"*:last-of-type" is not implemented.'); @@ -105,10 +92,7 @@ public function translateLastOfType(XPathExpr $xpath) ->addCondition('position() = last()'); } - /** - * @return XPathExpr - */ - public function translateOnlyChild(XPathExpr $xpath) + public function translateOnlyChild(XPathExpr $xpath): XPathExpr { return $xpath ->addStarPrefix() @@ -116,26 +100,14 @@ public function translateOnlyChild(XPathExpr $xpath) ->addCondition('last() = 1'); } - /** - * @return XPathExpr - * - * @throws ExpressionErrorException - */ - public function translateOnlyOfType(XPathExpr $xpath) + public function translateOnlyOfType(XPathExpr $xpath): XPathExpr { $element = $xpath->getElement(); - if ('*' === $element) { - throw new ExpressionErrorException('"*:only-of-type" is not implemented.'); - } - return $xpath->addCondition(sprintf('count(preceding-sibling::%s)=0 and count(following-sibling::%s)=0', $element, $element)); } - /** - * @return XPathExpr - */ - public function translateEmpty(XPathExpr $xpath) + public function translateEmpty(XPathExpr $xpath): XPathExpr { return $xpath->addCondition('not(*) and not(string-length())'); } @@ -143,7 +115,7 @@ public function translateEmpty(XPathExpr $xpath) /** * {@inheritdoc} */ - public function getName() + public function getName(): string { return 'pseudo-class'; } diff --git a/lib/Symfony/Component/CssSelector/XPath/Translator.php b/lib/Symfony/Component/CssSelector/XPath/Translator.php index e910035a..2150cfaa 100644 --- a/lib/Symfony/Component/CssSelector/XPath/Translator.php +++ b/lib/Symfony/Component/CssSelector/XPath/Translator.php @@ -48,9 +48,9 @@ class Translator implements TranslatorInterface private $pseudoClassTranslators = []; private $attributeMatchingTranslators = []; - public function __construct(ParserInterface $parser = null) + public function __construct(?ParserInterface $parser = null) { - $this->mainParser = $parser ?: new Parser(); + $this->mainParser = $parser ?? new Parser(); $this ->registerExtension(new Extension\NodeExtension()) @@ -61,18 +61,13 @@ public function __construct(ParserInterface $parser = null) ; } - /** - * @param string $element - * - * @return string - */ - public static function getXpathLiteral($element) + public static function getXpathLiteral(string $element): string { - if (false === strpos($element, "'")) { + if (!str_contains($element, "'")) { return "'".$element."'"; } - if (false === strpos($element, '"')) { + if (!str_contains($element, '"')) { return '"'.$element.'"'; } @@ -95,7 +90,7 @@ public static function getXpathLiteral($element) /** * {@inheritdoc} */ - public function cssToXPath($cssExpr, $prefix = 'descendant-or-self::') + public function cssToXPath(string $cssExpr, string $prefix = 'descendant-or-self::'): string { $selectors = $this->parseSelectors($cssExpr); @@ -114,17 +109,15 @@ public function cssToXPath($cssExpr, $prefix = 'descendant-or-self::') /** * {@inheritdoc} */ - public function selectorToXPath(SelectorNode $selector, $prefix = 'descendant-or-self::') + public function selectorToXPath(SelectorNode $selector, string $prefix = 'descendant-or-self::'): string { return ($prefix ?: '').$this->nodeToXPath($selector); } /** - * Registers an extension. - * * @return $this */ - public function registerExtension(Extension\ExtensionInterface $extension) + public function registerExtension(Extension\ExtensionInterface $extension): self { $this->extensions[$extension->getName()] = $extension; @@ -138,13 +131,9 @@ public function registerExtension(Extension\ExtensionInterface $extension) } /** - * @param string $name - * - * @return Extension\ExtensionInterface - * * @throws ExpressionErrorException */ - public function getExtension($name) + public function getExtension(string $name): Extension\ExtensionInterface { if (!isset($this->extensions[$name])) { throw new ExpressionErrorException(sprintf('Extension "%s" not registered.', $name)); @@ -154,11 +143,9 @@ public function getExtension($name) } /** - * Registers a shortcut parser. - * * @return $this */ - public function registerParserShortcut(ParserInterface $shortcut) + public function registerParserShortcut(ParserInterface $shortcut): self { $this->shortcutParsers[] = $shortcut; @@ -166,89 +153,69 @@ public function registerParserShortcut(ParserInterface $shortcut) } /** - * @return XPathExpr - * * @throws ExpressionErrorException */ - public function nodeToXPath(NodeInterface $node) + public function nodeToXPath(NodeInterface $node): XPathExpr { if (!isset($this->nodeTranslators[$node->getNodeName()])) { throw new ExpressionErrorException(sprintf('Node "%s" not supported.', $node->getNodeName())); } - return \call_user_func($this->nodeTranslators[$node->getNodeName()], $node, $this); + return $this->nodeTranslators[$node->getNodeName()]($node, $this); } /** - * @param string $combiner - * - * @return XPathExpr - * * @throws ExpressionErrorException */ - public function addCombination($combiner, NodeInterface $xpath, NodeInterface $combinedXpath) + public function addCombination(string $combiner, NodeInterface $xpath, NodeInterface $combinedXpath): XPathExpr { if (!isset($this->combinationTranslators[$combiner])) { throw new ExpressionErrorException(sprintf('Combiner "%s" not supported.', $combiner)); } - return \call_user_func($this->combinationTranslators[$combiner], $this->nodeToXPath($xpath), $this->nodeToXPath($combinedXpath)); + return $this->combinationTranslators[$combiner]($this->nodeToXPath($xpath), $this->nodeToXPath($combinedXpath)); } /** - * @return XPathExpr - * * @throws ExpressionErrorException */ - public function addFunction(XPathExpr $xpath, FunctionNode $function) + public function addFunction(XPathExpr $xpath, FunctionNode $function): XPathExpr { if (!isset($this->functionTranslators[$function->getName()])) { throw new ExpressionErrorException(sprintf('Function "%s" not supported.', $function->getName())); } - return \call_user_func($this->functionTranslators[$function->getName()], $xpath, $function); + return $this->functionTranslators[$function->getName()]($xpath, $function); } /** - * @param string $pseudoClass - * - * @return XPathExpr - * * @throws ExpressionErrorException */ - public function addPseudoClass(XPathExpr $xpath, $pseudoClass) + public function addPseudoClass(XPathExpr $xpath, string $pseudoClass): XPathExpr { if (!isset($this->pseudoClassTranslators[$pseudoClass])) { throw new ExpressionErrorException(sprintf('Pseudo-class "%s" not supported.', $pseudoClass)); } - return \call_user_func($this->pseudoClassTranslators[$pseudoClass], $xpath); + return $this->pseudoClassTranslators[$pseudoClass]($xpath); } /** - * @param string $operator - * @param string $attribute - * @param string $value - * - * @return XPathExpr - * * @throws ExpressionErrorException */ - public function addAttributeMatching(XPathExpr $xpath, $operator, $attribute, $value) + public function addAttributeMatching(XPathExpr $xpath, string $operator, string $attribute, ?string $value): XPathExpr { if (!isset($this->attributeMatchingTranslators[$operator])) { - throw new ExpressionErrorException(sprintf('Attribute matcher operator "%s" not supported.', $operator)); + throw new ExpressionErrorException(sprintf('SimplePay_Attribute matcher operator "%s" not supported.', $operator)); } - return \call_user_func($this->attributeMatchingTranslators[$operator], $xpath, $attribute, $value); + return $this->attributeMatchingTranslators[$operator]($xpath, $attribute, $value); } /** - * @param string $css - * * @return SelectorNode[] */ - private function parseSelectors($css) + private function parseSelectors(string $css): array { foreach ($this->shortcutParsers as $shortcut) { $tokens = $shortcut->parse($css); diff --git a/lib/Symfony/Component/CssSelector/XPath/TranslatorInterface.php b/lib/Symfony/Component/CssSelector/XPath/TranslatorInterface.php index f2613206..b956fb79 100644 --- a/lib/Symfony/Component/CssSelector/XPath/TranslatorInterface.php +++ b/lib/Symfony/Component/CssSelector/XPath/TranslatorInterface.php @@ -27,20 +27,11 @@ interface TranslatorInterface { /** * Translates a CSS selector to an XPath expression. - * - * @param string $cssExpr - * @param string $prefix - * - * @return string */ - public function cssToXPath($cssExpr, $prefix = 'descendant-or-self::'); + public function cssToXPath(string $cssExpr, string $prefix = 'descendant-or-self::'): string; /** * Translates a parsed selector node to an XPath expression. - * - * @param string $prefix - * - * @return string */ - public function selectorToXPath(SelectorNode $selector, $prefix = 'descendant-or-self::'); + public function selectorToXPath(SelectorNode $selector, string $prefix = 'descendant-or-self::'): string; } diff --git a/lib/Symfony/Component/CssSelector/XPath/XPathExpr.php b/lib/Symfony/Component/CssSelector/XPath/XPathExpr.php index 89a3e742..613025e8 100644 --- a/lib/Symfony/Component/CssSelector/XPath/XPathExpr.php +++ b/lib/Symfony/Component/CssSelector/XPath/XPathExpr.php @@ -27,13 +27,7 @@ class XPathExpr private $element; private $condition; - /** - * @param string $path - * @param string $element - * @param string $condition - * @param bool $starPrefix - */ - public function __construct($path = '', $element = '*', $condition = '', $starPrefix = false) + public function __construct(string $path = '', string $element = '*', string $condition = '', bool $starPrefix = false) { $this->path = $path; $this->element = $element; @@ -44,10 +38,7 @@ public function __construct($path = '', $element = '*', $condition = '', $starPr } } - /** - * @return string - */ - public function getElement() + public function getElement(): string { return $this->element; } @@ -55,17 +46,14 @@ public function getElement() /** * @return $this */ - public function addCondition($condition) + public function addCondition(string $condition): self { $this->condition = $this->condition ? sprintf('(%s) and (%s)', $this->condition, $condition) : $condition; return $this; } - /** - * @return string - */ - public function getCondition() + public function getCondition(): string { return $this->condition; } @@ -73,7 +61,7 @@ public function getCondition() /** * @return $this */ - public function addNameTest() + public function addNameTest(): self { if ('*' !== $this->element) { $this->addCondition('name() = '.Translator::getXpathLiteral($this->element)); @@ -86,7 +74,7 @@ public function addNameTest() /** * @return $this */ - public function addStarPrefix() + public function addStarPrefix(): self { $this->path .= '*/'; @@ -96,12 +84,9 @@ public function addStarPrefix() /** * Joins another XPathExpr with a combiner. * - * @param string $combiner - * @param XPathExpr $expr - * * @return $this */ - public function join($combiner, self $expr) + public function join(string $combiner, self $expr): self { $path = $this->__toString().$combiner; @@ -116,10 +101,7 @@ public function join($combiner, self $expr) return $this; } - /** - * @return string - */ - public function __toString() + public function __toString(): string { $path = $this->path.$this->element; $condition = null === $this->condition || '' === $this->condition ? '' : '['.$this->condition.']'; diff --git a/lib/Symfony/Component/CssSelector/composer.json b/lib/Symfony/Component/CssSelector/composer.json index 435063fd..f0b71249 100644 --- a/lib/Symfony/Component/CssSelector/composer.json +++ b/lib/Symfony/Component/CssSelector/composer.json @@ -1,7 +1,7 @@ { "name": "symfony/css-selector", "type": "library", - "description": "Symfony CssSelector Component", + "description": "Converts CSS selectors to XPath expressions", "keywords": [], "homepage": "https://symfony.com", "license": "MIT", @@ -20,7 +20,8 @@ } ], "require": { - "php": "^5.5.9|>=7.0.8" + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.16" }, "autoload": { "psr-4": { "Symfony\\Component\\CssSelector\\": "" }, diff --git a/lib/Symfony/Component/CssSelector/phpunit.xml.dist b/lib/Symfony/Component/CssSelector/phpunit.xml.dist deleted file mode 100644 index a8e537ef..00000000 --- a/lib/Symfony/Component/CssSelector/phpunit.xml.dist +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - ./Tests/ - - - - - - ./ - - ./Resources - ./Tests - ./vendor - - - - diff --git a/lib/Symfony/Polyfill/Php80/LICENSE b/lib/Symfony/Polyfill/Php80/LICENSE new file mode 100644 index 00000000..0ed3a246 --- /dev/null +++ b/lib/Symfony/Polyfill/Php80/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2020-present Fabien Potencier + +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. diff --git a/lib/Symfony/Polyfill/Php80/Php80.php b/lib/Symfony/Polyfill/Php80/Php80.php new file mode 100644 index 00000000..97dce9e5 --- /dev/null +++ b/lib/Symfony/Polyfill/Php80/Php80.php @@ -0,0 +1,115 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SimplePay\Vendor\Symfony\Polyfill\Php80; + +/** + * @author Ion Bazan + * @author Nico Oelgart + * @author Nicolas Grekas + * + * @internal + */ +final class Php80 +{ + public static function fdiv(float $dividend, float $divisor): float + { + return @($dividend / $divisor); + } + + public static function get_debug_type($value): string + { + switch (true) { + case null === $value: return 'null'; + case \is_bool($value): return 'bool'; + case \is_string($value): return 'string'; + case \is_array($value): return 'array'; + case \is_int($value): return 'int'; + case \is_float($value): return 'float'; + case \is_object($value): break; + case $value instanceof \__PHP_Incomplete_Class: return '__PHP_Incomplete_Class'; + default: + if (null === $type = @get_resource_type($value)) { + return 'unknown'; + } + + if ('Unknown' === $type) { + $type = 'closed'; + } + + return "resource ($type)"; + } + + $class = \get_class($value); + + if (false === strpos($class, '@')) { + return $class; + } + + return (get_parent_class($class) ?: key(class_implements($class)) ?: 'class').'@anonymous'; + } + + public static function get_resource_id($res): int + { + if (!\is_resource($res) && null === @get_resource_type($res)) { + throw new \TypeError(sprintf('Argument 1 passed to get_resource_id() must be of the type resource, %s given', get_debug_type($res))); + } + + return (int) $res; + } + + public static function preg_last_error_msg(): string + { + switch (preg_last_error()) { + case \PREG_INTERNAL_ERROR: + return 'Internal error'; + case \PREG_BAD_UTF8_ERROR: + return 'Malformed UTF-8 characters, possibly incorrectly encoded'; + case \PREG_BAD_UTF8_OFFSET_ERROR: + return 'The offset did not correspond to the beginning of a valid UTF-8 code point'; + case \PREG_BACKTRACK_LIMIT_ERROR: + return 'Backtrack limit exhausted'; + case \PREG_RECURSION_LIMIT_ERROR: + return 'Recursion limit exhausted'; + case \PREG_JIT_STACKLIMIT_ERROR: + return 'JIT stack limit exhausted'; + case \PREG_NO_ERROR: + return 'No error'; + default: + return 'Unknown error'; + } + } + + public static function str_contains(string $haystack, string $needle): bool + { + return '' === $needle || false !== strpos($haystack, $needle); + } + + public static function str_starts_with(string $haystack, string $needle): bool + { + return 0 === strncmp($haystack, $needle, \strlen($needle)); + } + + public static function str_ends_with(string $haystack, string $needle): bool + { + if ('' === $needle || $needle === $haystack) { + return true; + } + + if ('' === $haystack) { + return false; + } + + $needleLength = \strlen($needle); + + return $needleLength <= \strlen($haystack) && 0 === substr_compare($haystack, $needle, -$needleLength); + } +} diff --git a/lib/Symfony/Polyfill/Php80/PhpToken.php b/lib/Symfony/Polyfill/Php80/PhpToken.php new file mode 100644 index 00000000..81bf6fc9 --- /dev/null +++ b/lib/Symfony/Polyfill/Php80/PhpToken.php @@ -0,0 +1,103 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace SimplePay\Vendor\Symfony\Polyfill\Php80; + +/** + * @author Fedonyuk Anton + * + * @internal + */ +class SimplePay_PhpToken implements \SimplePay_Stringable +{ + /** + * @var int + */ + public $id; + + /** + * @var string + */ + public $text; + + /** + * @var int + */ + public $line; + + /** + * @var int + */ + public $pos; + + public function __construct(int $id, string $text, int $line = -1, int $position = -1) + { + $this->id = $id; + $this->text = $text; + $this->line = $line; + $this->pos = $position; + } + + public function getTokenName(): ?string + { + if ('UNKNOWN' === $name = token_name($this->id)) { + $name = \strlen($this->text) > 1 || \ord($this->text) < 32 ? null : $this->text; + } + + return $name; + } + + /** + * @param int|string|array $kind + */ + public function is($kind): bool + { + foreach ((array) $kind as $value) { + if (\in_array($value, [$this->id, $this->text], true)) { + return true; + } + } + + return false; + } + + public function isIgnorable(): bool + { + return \in_array($this->id, [\T_WHITESPACE, \T_COMMENT, \T_DOC_COMMENT, \T_OPEN_TAG], true); + } + + public function __toString(): string + { + return (string) $this->text; + } + + /** + * @return static[] + */ + public static function tokenize(string $code, int $flags = 0): array + { + $line = 1; + $position = 0; + $tokens = token_get_all($code, $flags); + foreach ($tokens as $index => $token) { + if (\is_string($token)) { + $id = \ord($token); + $text = $token; + } else { + [$id, $text, $line] = $token; + } + $tokens[$index] = new static($id, $text, $line, $position); + $position += \strlen($text); + } + + return $tokens; + } +} diff --git a/lib/Symfony/Polyfill/Php80/README.md b/lib/Symfony/Polyfill/Php80/README.md new file mode 100644 index 00000000..3816c559 --- /dev/null +++ b/lib/Symfony/Polyfill/Php80/README.md @@ -0,0 +1,25 @@ +Symfony Polyfill / Php80 +======================== + +This component provides features added to PHP 8.0 core: + +- [`Stringable`](https://php.net/stringable) interface +- [`fdiv`](https://php.net/fdiv) +- [`ValueError`](https://php.net/valueerror) class +- [`UnhandledMatchError`](https://php.net/unhandledmatcherror) class +- `FILTER_VALIDATE_BOOL` constant +- [`get_debug_type`](https://php.net/get_debug_type) +- [`PhpToken`](https://php.net/phptoken) class +- [`preg_last_error_msg`](https://php.net/preg_last_error_msg) +- [`str_contains`](https://php.net/str_contains) +- [`str_starts_with`](https://php.net/str_starts_with) +- [`str_ends_with`](https://php.net/str_ends_with) +- [`get_resource_id`](https://php.net/get_resource_id) + +More information can be found in the +[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). + +License +======= + +This library is released under the [MIT license](LICENSE). diff --git a/lib/Symfony/Polyfill/Php80/Resources/stubs/Attribute.php b/lib/Symfony/Polyfill/Php80/Resources/stubs/Attribute.php new file mode 100644 index 00000000..3cb3a2a1 --- /dev/null +++ b/lib/Symfony/Polyfill/Php80/Resources/stubs/Attribute.php @@ -0,0 +1,31 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#[SimplePay_Attribute(Attribute::TARGET_CLASS)] +final class SimplePay_Attribute +{ + public const TARGET_CLASS = 1; + public const TARGET_FUNCTION = 2; + public const TARGET_METHOD = 4; + public const TARGET_PROPERTY = 8; + public const TARGET_CLASS_CONSTANT = 16; + public const TARGET_PARAMETER = 32; + public const TARGET_ALL = 63; + public const IS_REPEATABLE = 64; + + /** @var int */ + public $flags; + + public function __construct(int $flags = self::TARGET_ALL) + { + $this->flags = $flags; + } +} diff --git a/lib/Symfony/Polyfill/Php80/Resources/stubs/PhpToken.php b/lib/Symfony/Polyfill/Php80/Resources/stubs/PhpToken.php new file mode 100644 index 00000000..2d8fa240 --- /dev/null +++ b/lib/Symfony/Polyfill/Php80/Resources/stubs/PhpToken.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80000 && extension_loaded('tokenizer')) { + class SimplePay_PhpToken extends SimplePay\Vendor\Symfony\Polyfill\Php80\SimplePay_PhpToken + { + } +} diff --git a/lib/Symfony/Polyfill/Php80/Resources/stubs/Stringable.php b/lib/Symfony/Polyfill/Php80/Resources/stubs/Stringable.php new file mode 100644 index 00000000..3d6cb5bb --- /dev/null +++ b/lib/Symfony/Polyfill/Php80/Resources/stubs/Stringable.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80000) { + interface SimplePay_Stringable + { + /** + * @return string + */ + public function __toString(); + } +} diff --git a/lib/Symfony/Polyfill/Php80/Resources/stubs/UnhandledMatchError.php b/lib/Symfony/Polyfill/Php80/Resources/stubs/UnhandledMatchError.php new file mode 100644 index 00000000..1a48aee8 --- /dev/null +++ b/lib/Symfony/Polyfill/Php80/Resources/stubs/UnhandledMatchError.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80000) { + class SimplePay_UnhandledMatchError extends Error + { + } +} diff --git a/lib/Symfony/Polyfill/Php80/Resources/stubs/ValueError.php b/lib/Symfony/Polyfill/Php80/Resources/stubs/ValueError.php new file mode 100644 index 00000000..9ee29b14 --- /dev/null +++ b/lib/Symfony/Polyfill/Php80/Resources/stubs/ValueError.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80000) { + class SimplePay_ValueError extends Error + { + } +} diff --git a/lib/Symfony/Polyfill/Php80/bootstrap.php b/lib/Symfony/Polyfill/Php80/bootstrap.php new file mode 100644 index 00000000..e441add4 --- /dev/null +++ b/lib/Symfony/Polyfill/Php80/bootstrap.php @@ -0,0 +1,42 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use SimplePay\Vendor\Symfony\Polyfill\Php80 as p; + +if (\PHP_VERSION_ID >= 80000) { + return; +} + +if (!defined('FILTER_VALIDATE_BOOL') && defined('FILTER_VALIDATE_BOOLEAN')) { + define('FILTER_VALIDATE_BOOL', \FILTER_VALIDATE_BOOLEAN); +} + +if (!function_exists('fdiv')) { + function fdiv(float $num1, float $num2): float { return p\Php80::fdiv($num1, $num2); } +} +if (!function_exists('preg_last_error_msg')) { + function preg_last_error_msg(): string { return p\Php80::preg_last_error_msg(); } +} +if (!function_exists('str_contains')) { + function str_contains(?string $haystack, ?string $needle): bool { return p\Php80::str_contains($haystack ?? '', $needle ?? ''); } +} +if (!function_exists('str_starts_with')) { + function str_starts_with(?string $haystack, ?string $needle): bool { return p\Php80::str_starts_with($haystack ?? '', $needle ?? ''); } +} +if (!function_exists('str_ends_with')) { + function str_ends_with(?string $haystack, ?string $needle): bool { return p\Php80::str_ends_with($haystack ?? '', $needle ?? ''); } +} +if (!function_exists('get_debug_type')) { + function get_debug_type($value): string { return p\Php80::get_debug_type($value); } +} +if (!function_exists('get_resource_id')) { + function get_resource_id($resource): int { return p\Php80::get_resource_id($resource); } +} diff --git a/lib/Symfony/Polyfill/Php80/composer.json b/lib/Symfony/Polyfill/Php80/composer.json new file mode 100644 index 00000000..46ccde20 --- /dev/null +++ b/lib/Symfony/Polyfill/Php80/composer.json @@ -0,0 +1,37 @@ +{ + "name": "symfony/polyfill-php80", + "type": "library", + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "keywords": ["polyfill", "shim", "compatibility", "portable"], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=7.1" + }, + "autoload": { + "psr-4": { "Symfony\\Polyfill\\Php80\\": "" }, + "files": [ "bootstrap.php" ], + "classmap": [ "Resources/stubs" ] + }, + "minimum-stability": "dev", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + } +} diff --git a/lib/TijsVerkoyen/CssToInlineStyles/Css/Processor.php b/lib/TijsVerkoyen/CssToInlineStyles/Css/Processor.php index 88bf0fd0..f19c6a9d 100644 --- a/lib/TijsVerkoyen/CssToInlineStyles/Css/Processor.php +++ b/lib/TijsVerkoyen/CssToInlineStyles/Css/Processor.php @@ -11,7 +11,8 @@ class Processor * Get the rules from a given CSS-string * * @param string $css - * @param array $existingRules + * @param Rule[] $existingRules + * * @return Rule[] */ public function getRules($css, $existingRules = array()) @@ -27,13 +28,15 @@ public function getRules($css, $existingRules = array()) * Get the CSS from the style-tags in the given HTML-string * * @param string $html + * * @return string */ public function getCssFromStyleTags($html) { $css = ''; $matches = array(); - preg_match_all('|(.*)|isU', $html, $matches); + $htmlNoComments = preg_replace('||s', '', $html); + preg_match_all('|(.*)|isU', $htmlNoComments, $matches); if (!empty($matches[1])) { foreach ($matches[1] as $match) { @@ -46,6 +49,7 @@ public function getCssFromStyleTags($html) /** * @param string $css + * * @return string */ private function doCleanup($css) diff --git a/lib/TijsVerkoyen/CssToInlineStyles/Css/Property/Processor.php b/lib/TijsVerkoyen/CssToInlineStyles/Css/Property/Processor.php index 3830e2a2..27fe4b3a 100644 --- a/lib/TijsVerkoyen/CssToInlineStyles/Css/Property/Processor.php +++ b/lib/TijsVerkoyen/CssToInlineStyles/Css/Property/Processor.php @@ -7,10 +7,11 @@ class Processor { /** - * Split a string into seperate properties + * Split a string into separate properties * * @param string $propertiesString - * @return array + * + * @return string[] */ public function splitIntoSeparateProperties($propertiesString) { @@ -40,8 +41,9 @@ public function splitIntoSeparateProperties($propertiesString) } /** - * @param $string - * @return mixed|string + * @param string $string + * + * @return string */ private function cleanup($string) { @@ -58,9 +60,10 @@ private function cleanup($string) } /** - * Convert a property-string into an object + * Converts a property-string into an object * * @param string $property + * * @return Property|null */ public function convertToObject($property, Specificity $specificity = null) @@ -82,9 +85,10 @@ public function convertToObject($property, Specificity $specificity = null) } /** - * Convert an array of property-strings into objects + * Converts an array of property-strings into objects + * + * @param string[] $properties * - * @param array $properties * @return Property[] */ public function convertArrayToObjects(array $properties, Specificity $specificity = null) @@ -106,7 +110,8 @@ public function convertArrayToObjects(array $properties, Specificity $specificit /** * Build the property-string for multiple properties * - * @param array $properties + * @param Property[] $properties + * * @return string */ public function buildPropertiesString(array $properties) diff --git a/lib/TijsVerkoyen/CssToInlineStyles/Css/Property/Property.php b/lib/TijsVerkoyen/CssToInlineStyles/Css/Property/Property.php index 22bd371f..ff31b90c 100644 --- a/lib/TijsVerkoyen/CssToInlineStyles/Css/Property/Property.php +++ b/lib/TijsVerkoyen/CssToInlineStyles/Css/Property/Property.php @@ -23,8 +23,8 @@ final class Property /** * Property constructor. - * @param $name - * @param $value + * @param string $name + * @param string $value * @param Specificity|null $specificity */ public function __construct($name, $value, Specificity $specificity = null) diff --git a/lib/TijsVerkoyen/CssToInlineStyles/Css/Rule/Processor.php b/lib/TijsVerkoyen/CssToInlineStyles/Css/Rule/Processor.php index 9cb2142d..b16fed2a 100644 --- a/lib/TijsVerkoyen/CssToInlineStyles/Css/Rule/Processor.php +++ b/lib/TijsVerkoyen/CssToInlineStyles/Css/Rule/Processor.php @@ -8,10 +8,11 @@ class Processor { /** - * Split a string into seperate rules + * Splits a string into separate rules * * @param string $rulesString - * @return array + * + * @return string[] */ public function splitIntoSeparateRules($rulesString) { @@ -22,6 +23,7 @@ public function splitIntoSeparateRules($rulesString) /** * @param string $string + * * @return string */ private function cleanup($string) @@ -39,11 +41,12 @@ private function cleanup($string) } /** - * Convert a rule-string into an object + * Converts a rule-string into an object * * @param string $rule * @param int $originalOrder - * @return array + * + * @return Rule[] */ public function convertToObjects($rule, $originalOrder) { @@ -74,11 +77,13 @@ public function convertToObjects($rule, $originalOrder) } /** - * Calculate the specificity based on a CSS Selector string, + * Calculates the specificity based on a CSS Selector string, * Based on the patterns from premailer/css_parser by Alex Dunae * * @see https://github.com/premailer/css_parser/blob/master/lib/css_parser/regexps.rb + * * @param string $selector + * * @return Specificity */ public function calculateSpecificityBasedOnASelector($selector) @@ -118,7 +123,9 @@ public function calculateSpecificityBasedOnASelector($selector) } /** - * @param array $rules + * @param string[] $rules + * @param Rule[] $objects + * * @return Rule[] */ public function convertArrayToObjects(array $rules, array $objects = array()) @@ -133,12 +140,13 @@ public function convertArrayToObjects(array $rules, array $objects = array()) } /** - * Sort an array on the specificity element in an ascending way + * Sorts an array on the specificity element in an ascending way * Lower specificity will be sorted to the beginning of the array * + * @param Rule $e1 The first element. + * @param Rule $e2 The second element. + * * @return int - * @param Rule $e1 The first element. - * @param Rule $e2 The second element. */ public static function sortOnSpecificity(Rule $e1, Rule $e2) { diff --git a/lib/TijsVerkoyen/CssToInlineStyles/Css/Rule/Rule.php b/lib/TijsVerkoyen/CssToInlineStyles/Css/Rule/Rule.php index 9ab5ff54..6d4ae802 100644 --- a/lib/TijsVerkoyen/CssToInlineStyles/Css/Rule/Rule.php +++ b/lib/TijsVerkoyen/CssToInlineStyles/Css/Rule/Rule.php @@ -3,6 +3,7 @@ namespace SimplePay\Vendor\TijsVerkoyen\CssToInlineStyles\Css\Rule; use SimplePay\Vendor\Symfony\Component\CssSelector\Node\Specificity; +use SimplePay\Vendor\TijsVerkoyen\CssToInlineStyles\Css\Property\Property; final class Rule { @@ -12,7 +13,7 @@ final class Rule private $selector; /** - * @var array + * @var Property[] */ private $properties; @@ -55,7 +56,7 @@ public function getSelector() /** * Get properties * - * @return array + * @return Property[] */ public function getProperties() { diff --git a/lib/TijsVerkoyen/CssToInlineStyles/CssToInlineStyles.php b/lib/TijsVerkoyen/CssToInlineStyles/CssToInlineStyles.php index bc017d97..dca3dde1 100644 --- a/lib/TijsVerkoyen/CssToInlineStyles/CssToInlineStyles.php +++ b/lib/TijsVerkoyen/CssToInlineStyles/CssToInlineStyles.php @@ -8,7 +8,6 @@ use SimplePay\Vendor\TijsVerkoyen\CssToInlineStyles\Css\Processor; use SimplePay\Vendor\TijsVerkoyen\CssToInlineStyles\Css\Property\Processor as PropertyProcessor; use SimplePay\Vendor\TijsVerkoyen\CssToInlineStyles\Css\Rule\Processor as RuleProcessor; -use SimplePay\Vendor\TijsVerkoyen\CssToInlineStyles\Css\Rule\Rule; class CssToInlineStyles { @@ -29,6 +28,7 @@ public function __construct() * * @param string $html * @param string $css + * * @return string */ public function convert($html, $css = null) @@ -55,6 +55,7 @@ public function convert($html, $css = null) * * @param \DOMElement $element * @param Css\Property\Property[] $properties + * * @return \DOMElement */ public function inlineCssOnElement(\DOMElement $element, array $properties) @@ -89,6 +90,7 @@ public function inlineCssOnElement(\DOMElement $element, array $properties) * Get the current inline styles for a given DOMElement * * @param \DOMElement $element + * * @return Css\Property\Property[] */ public function getInlineStyles(\DOMElement $element) @@ -104,13 +106,14 @@ public function getInlineStyles(\DOMElement $element) /** * @param string $html + * * @return \DOMDocument */ protected function createDomDocumentFromHtml($html) { $document = new \DOMDocument('1.0', 'UTF-8'); $internalErrors = libxml_use_internal_errors(true); - $document->loadHTML(mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8')); + $document->loadHTML(mb_encode_numericentity($html, [0x80, 0x10FFFF, 0, 0x1FFFFF], 'UTF-8')); libxml_use_internal_errors($internalErrors); $document->formatOutput = true; @@ -119,6 +122,7 @@ protected function createDomDocumentFromHtml($html) /** * @param \DOMDocument $document + * * @return string */ protected function getHtmlFromDocument(\DOMDocument $document) @@ -145,6 +149,7 @@ protected function getHtmlFromDocument(\DOMDocument $document) /** * @param \DOMDocument $document * @param Css\Rule\Rule[] $rules + * * @return \DOMDocument */ protected function inline(\DOMDocument $document, array $rules) diff --git a/src/Emails/Email/PaymentProcessingConfirmationEmail.php b/src/Emails/Email/PaymentProcessingConfirmationEmail.php new file mode 100644 index 00000000..fd04363b --- /dev/null +++ b/src/Emails/Email/PaymentProcessingConfirmationEmail.php @@ -0,0 +1,90 @@ +get_id() ), + esc_html( + sprintf( + /* translators: %s Site name */ + __( 'Payment Processing Confirmation for %s', 'stripe' ), + get_bloginfo( 'name' ) + ) + ) + ); + + return $subject; + } + + /** + * Returns the body (content) of the email. + * + * @since 4.10.0 + * + * @return string + */ + public function get_body() { + return Settings\Emails\PaymentProcessingConfirmation\get_body_setting_or_default(); + } +} diff --git a/src/Emails/Email/PaymentProcessingNotificationEmail.php b/src/Emails/Email/PaymentProcessingNotificationEmail.php new file mode 100644 index 00000000..7efd9b1c --- /dev/null +++ b/src/Emails/Email/PaymentProcessingNotificationEmail.php @@ -0,0 +1,107 @@ +get_id() ), + get_bloginfo( 'admin_email' ) + ); + + return $to_address; + } + + /** + * Returns the subject of the email. + * + * @since 4.10.0 + * + * @return string + */ + public function get_subject() { + /** @var string $subject */ + $subject = simpay_get_setting( + sprintf( 'email_%s_subject', $this->get_id() ), + esc_html( + sprintf( + /* translators: %s Site name */ + __( 'Payment Processing Notification for %s', 'stripe' ), + get_bloginfo( 'name' ) + ) + ) + ); + + return $subject; + } + + /** + * Returns the body (content) of the email. + * + * @since 4.10.0 + * + * @return string + */ + public function get_body() { + return Settings\Emails\PaymentProcessingNotification\get_body_setting_or_default(); + } +} diff --git a/src/Emails/Email/PaymentRefundedConfirmationEmail.php b/src/Emails/Email/PaymentRefundedConfirmationEmail.php new file mode 100644 index 00000000..6d7b4d21 --- /dev/null +++ b/src/Emails/Email/PaymentRefundedConfirmationEmail.php @@ -0,0 +1,105 @@ +get_id() ), + get_bloginfo( 'admin_email' ) + ); + + return $to_address; + } + + /** + * Returns the subject of the email. + * + * @since 4.10.0 + * + * @return string + */ + public function get_subject() { + /** @var string $subject */ + $subject = simpay_get_setting( + sprintf( 'email_%s_subject', $this->get_id() ), + sprintf( + /* translators: %s Site name */ + __( 'Payment refunded on %s', 'stripe' ), + get_bloginfo( 'name' ) + ) + ); + + return $subject; + } + + /** + * Returns the body (content) of the email. + * + * @since 4.10.0 + * + * @return string + */ + public function get_body() { + return Settings\Emails\PaymentRefundedConfirmation\get_body_setting_or_default(); + } +} diff --git a/src/Emails/Email/SubscriptionCancellationConfirmation.php b/src/Emails/Email/SubscriptionCancellationConfirmation.php new file mode 100644 index 00000000..84e8bd76 --- /dev/null +++ b/src/Emails/Email/SubscriptionCancellationConfirmation.php @@ -0,0 +1,99 @@ +get_id() ), + esc_html( + sprintf( + /* translators: %s Site name */ + __( 'Subscription Cancelled for %s', 'stripe' ), + get_bloginfo( 'name' ) + ) + ) + ); + + return $subject; + } + + /** + * Returns the body (content) of the email. + * + * @since 4.10.0 + * + * @return string + */ + public function get_body() { + return Settings\Emails\SubscriptionCancellationConfirmation\get_body_setting_or_default(); + } +} diff --git a/src/Emails/Email/SubscriptionCancellationNotification.php b/src/Emails/Email/SubscriptionCancellationNotification.php new file mode 100644 index 00000000..8c0d9ac2 --- /dev/null +++ b/src/Emails/Email/SubscriptionCancellationNotification.php @@ -0,0 +1,116 @@ +get_id() ), + get_bloginfo( 'admin_email' ) + ); + + return $to_address; + } + + /** + * Returns the subject of the email. + * + * @since 4.10.0 + * + * @return string + */ + public function get_subject() { + /** @var string $subject */ + $subject = simpay_get_setting( + sprintf( 'email_%s_subject', $this->get_id() ), + esc_html( + sprintf( + /* translators: %s Site name */ + __( 'Subscription Cancellation Notification for %s', 'stripe' ), + get_bloginfo( 'name' ) + ) + ) + ); + + return $subject; + } + + /** + * Returns the body (content) of the email. + * + * @since 4.10.0 + * + * @return string + */ + public function get_body() { + return Settings\Emails\SubscriptionCancellationNotification\get_body_setting_or_default(); + } +} diff --git a/src/Emails/EmailServiceProvider.php b/src/Emails/EmailServiceProvider.php index e12dee0d..0ab04a23 100644 --- a/src/Emails/EmailServiceProvider.php +++ b/src/Emails/EmailServiceProvider.php @@ -32,6 +32,10 @@ public function get_services() { 'email-upcoming-invoice', 'email-summary-report', 'email-manage-subscriptions', + 'email-payment-processing-confirmation', + 'email-payment-processing-notification', + 'email-payment-refunded-confirmation', + 'email-subscription-cancel', ); } @@ -85,6 +89,31 @@ public function register() { Email\ManageSubscriptionsEmail::class ); + $container->add( + 'email-payment-processing-confirmation', + Email\PaymentProcessingConfirmationEmail::class + ); + + $container->add( + 'email-payment-processing-notification', + Email\PaymentProcessingNotificationEmail::class + ); + + $container->add( + 'email-payment-refunded-confirmation', + Email\PaymentRefundedConfirmationEmail::class + ); + + $container->add( + 'email-subscription-cancel-confirmation', + Email\SubscriptionCancellationConfirmation::class + ); + + $container->add( + 'email-subscription-cancel-notification', + Email\SubscriptionCancellationNotification::class + ); + // Summary report scheduler. $container->add( 'email-summary-report-scheduler', @@ -101,12 +130,17 @@ public function register() { $container->share( 'email-subscriber', EmailSubscriber::class ) ->withArgument( array( - 'invoice-confirmation' => $container->get( 'email-invoice-confirmation' ), - 'payment-confirmation' => $container->get( 'email-payment-confirmation' ), - 'payment-notification' => $container->get( 'email-payment-notification' ), - 'upcoming-invoice' => $container->get( 'email-upcoming-invoice' ), - 'summary-report' => $container->get( 'email-summary-report' ), - 'manage-subscriptions' => $container->get( 'email-manage-subscriptions' ), + 'invoice-confirmation' => $container->get( 'email-invoice-confirmation' ), + 'payment-confirmation' => $container->get( 'email-payment-confirmation' ), + 'payment-notification' => $container->get( 'email-payment-notification' ), + 'upcoming-invoice' => $container->get( 'email-upcoming-invoice' ), + 'summary-report' => $container->get( 'email-summary-report' ), + 'manage-subscriptions' => $container->get( 'email-manage-subscriptions' ), + 'subscription-cancel-confirmation' => $container->get( 'email-subscription-cancel-confirmation' ), + 'subscription-cancel-notification' => $container->get( 'email-subscription-cancel-notification' ), + 'payment-processing-confirmation' => $container->get( 'email-payment-processing-confirmation' ), + 'payment-processing-notification' => $container->get( 'email-payment-processing-notification' ), + 'payment-refunded-confirmation' => $container->get( 'email-payment-refunded-confirmation' ), ) ); } diff --git a/src/Emails/EmailSubscriber.php b/src/Emails/EmailSubscriber.php index 3c718c12..47936204 100644 --- a/src/Emails/EmailSubscriber.php +++ b/src/Emails/EmailSubscriber.php @@ -104,6 +104,20 @@ public function get_subscribed_events() { 3, ); + // Payment processing. + $subscribers['simpay_webhook_payment_intent_processing'] = array( + 'payment_processing', + 10, + 3, + ); + + // Refunded payment confirmation. + $subscribers['simpay_webhook_charge_refunded'] = array( + 'payment_refunded_confirmation', + 10, + 3, + ); + // Legacy. // These aren't used anymore, but we'll keep it here for backwards compatibility. // `simpay_webhook_payment_intent_succeeded` is used instead instead. @@ -112,6 +126,12 @@ public function get_subscribed_events() { $payment_confirmation, ); + $subscribers['simpay_webhook_subscription_cancel'] = array( + 'subscription_cancel', + 10, + 3, + ); + return $subscribers; } @@ -511,4 +531,164 @@ public function summary_report() { add_filter( 'simpay_emails_autop', '__return_true' ); } + /** + * Mails the "Payment Refunded Confirmation" email. + * + * @since 4.10.0 + * @param \SimplePay\Vendor\Stripe\Event $event Stripe Event object. + * @param \SimplePay\Vendor\Stripe\Charge $charge Stripe Charge object. + * @param \SimplePay\Core\Abstracts\Form $form Form object. + * + * @return void + */ + public function payment_refunded_confirmation( $event, $charge, $form ) { + /** @var \SimplePay\Core\Emails\Email\PaymentRefundedConfirmationEmail $email */ + $email = $this->emails['payment-refunded-confirmation']; + + // If the email is not enabled, do nothing. + if ( ! $email->is_enabled() ) { + return; + } + + // Ensure we have data before proceeding. + $payment_refund_data = Payment_Confirmation\get_confirmation_data( + $charge->customer->id, // @phpstan-ignore-line + false, + $form->id + ); + + // Setup the mailer. + $mailer = new Mailer( $email ); + + // Set data. + + $mailer->set_data( $payment_refund_data ); + + // ...then set the address(es). + $mailer->set_to( $payment_refund_data['customer']->email ); + + // ...then set the subject. + $mailer->set_subject( $email->get_subject() ); + + // ...then parse and set the body. + $mailer->set_body( $email->get_body() ); + + // Finally, send the email. + $mailer->send(); + } + + /** + * Mails the 'Subscription Cancel' email . + * + * @since 4.10.0 + * + * @param \SimplePay\Vendor\Stripe\Event $event Stripe Event object . + * @param \SimplePay\Vendor\Stripe\Subscription $subscription Stripe Subscription object . + * @return void + */ + public function subscription_cancel( $event, $subscription ) { + if ( null === $subscription->canceled_at ) { + return; + } + + if ( 'customer.subscription.deleted' === $event->type + && $subscription->cancel_at_period_end ) { + return; + } + + /** @var \SimplePay\Core\Emails\Email\SubscriptionCancellationNotification $subscription_cancel_confirmation_email */ + $subscription_cancel_confirmation_email = $this->emails['subscription-cancel-confirmation']; + + /** @var \SimplePay\Core\Emails\Email\SubscriptionCancellationNotification $subscription_cancel_notification_email */ + $subscription_cancel_notification_email = $this->emails['subscription-cancel-notification']; + + $notification_mailer = new Mailer( $subscription_cancel_notification_email ); + $confirmation_mailer = new Mailer( $subscription_cancel_confirmation_email ); + + // Retrieve the payment confirmation data. + /** @var \SimplePay\Vendor\Stripe\Customer $customer */ + $customer = $subscription->customer; + + // Ensure we have data before proceeding. + $payment_confirmation_data = Payment_Confirmation\get_confirmation_data( + $customer->id, + false, + $subscription->metadata->simpay_form_id // @phpstan-ignore-line + ); + + // Set email for merchant. + $notification_mailer->set_data( $payment_confirmation_data ); + $notification_mailer->set_to( $subscription_cancel_notification_email->get_to() ); + $notification_mailer->set_subject( $subscription_cancel_notification_email->get_subject() ); + $notification_mailer->set_body( $subscription_cancel_notification_email->get_body() ); + + // Set email for customer. + $confirmation_mailer->set_data( $payment_confirmation_data ); + $confirmation_mailer->set_to( $subscription->customer->email ); /** @phpstan-ignore-line */ + $confirmation_mailer->set_subject( $subscription_cancel_confirmation_email->get_subject() ); + $confirmation_mailer->set_body( $subscription_cancel_confirmation_email->get_body() ); + + // Send emails. + if ( $subscription_cancel_notification_email->is_enabled() ) { + $notification_mailer->send(); + } + + if ( $subscription_cancel_confirmation_email->is_enabled() ) { + $confirmation_mailer->send(); + } + } + + /** + * Mails the "Payment Processing" email. + * + * @since 4.10.0 + * + * @param \SimplePay\Vendor\Stripe\Event $event Stripe webhook event. + * @param \SimplePay\Vendor\Stripe\PaymentIntent $payment_intent Stripe PaymentIntent. + * @param \SimplePay\Core\Abstracts\Form $form Form object. + * @return void + */ + public function payment_processing( $event, $payment_intent, $form ) { + // Retrieve the payment confirmation data. + /** @var \SimplePay\Vendor\Stripe\Customer $customer */ + $customer = $payment_intent->customer; + + // Ensure we have data before proceeding. + $payment_confirmation_data = Payment_Confirmation\get_confirmation_data( + $customer->id, + false, + $form->id + ); + + // if there is no data, do nothing. + if ( empty( $payment_confirmation_data ) ) { + return; + } + + /** @var \SimplePay\Core\Emails\Email\PaymentProcessingConfirmationEmail $payment_processing_confirmation_email */ + $payment_processing_confirmation_email = $this->emails['payment-processing-confirmation']; + + /** @var \SimplePay\Core\Emails\Email\PaymentProcessingNotificationEmail $payment_processing_notification_email */ + $payment_processing_notification_email = $this->emails['payment-processing-notification']; + + // Send confirmation email if enabled. + if ( $payment_processing_confirmation_email->is_enabled() ) { + $confirmation_mailer = new Mailer( $payment_processing_confirmation_email ); + $confirmation_mailer->set_data( $payment_confirmation_data ); + $confirmation_mailer->set_to( $customer->email ); // @phpstan-ignore-line + $confirmation_mailer->set_subject( $payment_processing_confirmation_email->get_subject() ); + $confirmation_mailer->set_body( $payment_processing_confirmation_email->get_body() ); + $confirmation_mailer->send(); + } + + // Send notification email if enabled. + if ( $payment_processing_notification_email->is_enabled() ) { + $notification_mailer = new Mailer( $payment_processing_notification_email ); + $notification_mailer->set_data( $payment_confirmation_data ); + $notification_mailer->set_to( $payment_processing_notification_email->get_to() ); + $notification_mailer->set_subject( $payment_processing_notification_email->get_subject() ); + $notification_mailer->set_body( $payment_processing_notification_email->get_body() ); + $notification_mailer->send(); + } + } } diff --git a/src/NotificationInbox/Database/Query.php b/src/NotificationInbox/Database/Query.php old mode 100644 new mode 100755 diff --git a/src/NotificationInbox/Database/Schema.php b/src/NotificationInbox/Database/Schema.php old mode 100644 new mode 100755 diff --git a/src/NotificationInbox/Database/Table.php b/src/NotificationInbox/Database/Table.php old mode 100644 new mode 100755 diff --git a/src/Plugin.php b/src/Plugin.php index d3eaa7c1..b9c8cabf 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -81,7 +81,7 @@ public function load() { * @return \SimplePay\Core\PluginContainer */ public function setup_container() { - $this->container = new PluginContainer; + $this->container = new PluginContainer(); // Event management. $this->container->share( @@ -92,7 +92,7 @@ public function setup_container() { // Scheduler. $this->container->share( 'scheduler', - function() { + function () { $events = $this->container->get( 'event-manager' ); if ( ! $events instanceof EventManager ) { @@ -108,7 +108,7 @@ function() { return new Scheduler\WpCronScheduler( $events ); } - return new Scheduler\ActionScheduler; + return new Scheduler\ActionScheduler(); } ); @@ -200,57 +200,42 @@ private function get_service_providers() { global $wp_version; $service_providers = array( - new AdminBar\AdminBarServiceProvider, - new AntiSpam\AntiSpamServiceProvider, - new CustomerSuccess\CustomerSuccessServiceProvider, - new Emails\EmailServiceProvider, - new FormPreview\FormPreviewServiceProvider, - new Integration\IntegrationServiceProvider, - new License\LicenseServiceProvider, - new Connect\ConnectServiceProvider, - new PaymentPage\PaymentPageServiceProvider, - new Report\ReportServiceProvider, - new RestApi\RestApiServiceProvider, - new StripeConnect\StripeConnectServiceProvider, - new Transaction\TransactionServiceProvider, - new Webhook\WebhookServiceProvider, + new AdminBar\AdminBarServiceProvider(), + new AntiSpam\AntiSpamServiceProvider(), + new Block\BlockServiceProvider(), + new Connect\ConnectServiceProvider(), + new CustomerSuccess\CustomerSuccessServiceProvider(), + new Emails\EmailServiceProvider(), + new FormPreview\FormPreviewServiceProvider(), + new Help\HelpServiceProvider(), + new Integration\IntegrationServiceProvider(), + new License\LicenseServiceProvider(), + new NotificationInbox\NotificationInboxServiceProvider(), + new PaymentPage\PaymentPageServiceProvider(), + new Report\ReportServiceProvider(), + new RestApi\RestApiServiceProvider(), + new StripeConnect\StripeConnectServiceProvider(), + new Transaction\TransactionServiceProvider(), + new Webhook\WebhookServiceProvider(), ); - if ( version_compare( $wp_version, '5.6', '>=' ) ) { - $service_providers[] = new Block\BlockServiceProvider; - } - - if ( version_compare( $wp_version, '5.7', '>=' ) ) { - $service_providers[] = new Help\HelpServiceProvider; - $service_providers[] = new NotificationInbox\NotificationInboxServiceProvider; - } - if ( is_admin() ) { global $wp_version; $admin_service_providers = array( - new Admin\AdminServiceProvider, - new Admin\Addon\AddonServiceProvider, - new Admin\DashboardWidget\DashboardWidgetServiceProvider, - new Admin\Education\EducationServiceProvider, - new Admin\SiteHealth\SiteHealthServiceProvider, - new Admin\Translations\TranslationsServiceProvider, + new Admin\AdminServiceProvider(), + new Admin\Addon\AddonServiceProvider(), + new Admin\DashboardWidget\DashboardWidgetServiceProvider(), + new Admin\Education\EducationServiceProvider(), + new Admin\FormBuilder\FormBuilderServiceProvider(), + new Admin\SetupWizard\SetupWizardServiceProvider(), + new Admin\SiteHealth\SiteHealthServiceProvider(), + new Admin\Translations\TranslationsServiceProvider(), ); - if ( version_compare( $wp_version, '5.5', '>=' ) ) { - $admin_service_providers[] = - new Admin\SetupWizard\SetupWizardServiceProvider; - } - - if ( version_compare( $wp_version, '5.6', '>=' ) ) { - $admin_service_providers[] = - new Admin\FormBuilder\FormBuilderServiceProvider; - } - return array_merge( $admin_service_providers, $service_providers ); } return $service_providers; } - } diff --git a/src/RestApi/Internal/Report/LatestPaymentsReport.php b/src/RestApi/Internal/Report/LatestPaymentsReport.php index 7bf2bb06..986a0972 100644 --- a/src/RestApi/Internal/Report/LatestPaymentsReport.php +++ b/src/RestApi/Internal/Report/LatestPaymentsReport.php @@ -114,7 +114,7 @@ private function get_results( $currency ) { $results = $wpdb->get_results( // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared $wpdb->prepare( - "SELECT * FROM {$wpdb->prefix}wpsp_transactions WHERE livemode = %d AND currency = %s AND status IN ( 'succeeded', 'failed', 'requires_payment_method') AND object IN ('payment_intent', 'setup_intent') ORDER BY date_created DESC LIMIT 0, 10", + "SELECT * FROM {$wpdb->prefix}wpsp_transactions WHERE livemode = %d AND currency = %s AND status IN ( 'succeeded', 'failed', 'requires_payment_method', 'refunded') AND object IN ('payment_intent', 'setup_intent') ORDER BY date_created DESC LIMIT 0, 10", simpay_is_test_mode() ? 0 : 1, $currency ), @@ -144,11 +144,16 @@ private function format_result( $result ) { $result->currency ); + $result->amount_refunded_formatted = simpay_format_currency( + $result->amount_refunded, + $result->currency + ); + $result->payment_method_type_icon = $this->get_payment_method_type_icon( $result->payment_method_type ); - $result->status_formatted = $this->format_status( $result->status ); + $result->status_formatted = $this->format_status( $result ); $result->date_created_human_time_diff = sprintf( /* translators: %s Payment created date. */ @@ -179,20 +184,41 @@ private function format_result( $result ) { * * @since 4.6.7 * - * @param string $status Status. + * @param \stdClass $result Result object. * @return string */ - private function format_status( $status ) { + private function format_status( $result ) { + $status = $this->get_status( $result ); switch ( $status ) { case 'succeeded': return __( 'Succeeded', 'stripe' ); case 'failed': return __( 'Failed', 'stripe' ); + case 'refunded': + return __( 'Refunded', 'stripe' ); + case 'partial_refund': + return __( 'Partially Refunded', 'stripe' ); default: return __( 'Incomplete', 'stripe' ); } } + /** + * Formats status for the Latest Payments report. + * + * @since 4.10.0 + * + * @param \stdClass $result Result object. + * @return string + */ + private function get_status( $result ) { + if ( $result->amount_refunded !== $result->amount_total && 'refunded' === $result->status ) { + return 'partial_refund'; + } + + return $result->status; + } + /** * Returns an icon for a given payment method type from the Payment Method registry. * @@ -236,5 +262,4 @@ private function get_payment_method_type_icon( $payment_method_type ) { return $payment_method->icon_sm; } } - } diff --git a/src/Transaction/Database/Query.php b/src/Transaction/Database/Query.php old mode 100644 new mode 100755 diff --git a/src/Transaction/Database/Schema.php b/src/Transaction/Database/Schema.php old mode 100644 new mode 100755 index 2c0b0ddc..a17d874c --- a/src/Transaction/Database/Schema.php +++ b/src/Transaction/Database/Schema.php @@ -104,6 +104,16 @@ class Schema extends BerlinDBSchema { 'validate' => 'intval', ), + // amount_refunded. + array( + 'name' => 'amount_refunded', + 'type' => 'bigint', + 'length' => '20', + 'default' => 0, + 'allow_null' => false, + 'validate' => 'intval', + ), + // amount_tax. array( 'name' => 'amount_tax', diff --git a/src/Transaction/Database/Table.php b/src/Transaction/Database/Table.php old mode 100644 new mode 100755 index 8d93328d..f2daf97f --- a/src/Transaction/Database/Table.php +++ b/src/Transaction/Database/Table.php @@ -42,7 +42,7 @@ class Table extends BerlinDBTable { * * @var int */ - protected $version = 202301090001; + protected $version = 202404230001; /** * {@inheritdoc} @@ -59,6 +59,7 @@ class Table extends BerlinDBTable { protected $upgrades = array( // @phpstan-ignore-line '202206170001' => 202206170001, '202301090001' => 202301090001, + '202404230001' => 202404230001, ); /** @@ -77,6 +78,7 @@ protected function set_schema() { amount_subtotal bigint(20) NOT NULL, amount_shipping bigint(20) NOT NULL, amount_discount bigint(20) NOT NULL, + amount_refunded bigint(20) NOT NULL DEFAULT 0, amount_tax bigint(20) NOT NULL, currency varchar(3) NOT NULL, payment_method_type varchar(50) DEFAULT NULL, @@ -151,4 +153,20 @@ protected function __202301090001() { return $this->is_success( true ); } + /** + * Upgrade to version 202404230001. + * - Add a new `amount_refunded` column. + * + * @since 4.10.0 + * + * @return bool + */ + protected function __202404230001() { + // Add the `amount_refunded` column after `amount_discount`. + $this->get_db()->query( + "ALTER TABLE {$this->table_name} ADD COLUMN `amount_refunded` bigint(20) NOT NULL DEFAULT 0 AFTER `amount_discount`" + ); + + return $this->is_success( true ); + } } diff --git a/src/Transaction/TransactionObserver.php b/src/Transaction/TransactionObserver.php index b3987d23..8fd45997 100644 --- a/src/Transaction/TransactionObserver.php +++ b/src/Transaction/TransactionObserver.php @@ -106,6 +106,7 @@ public function get_subscribed_events() { array( 'update_on_failed', 10, 2 ), array( 'maybe_increment_stock', 10, 2 ), ), + 'simpay_webhook_charge_refunded' => array( 'add_refund_log', 10, 3 ), ); // Update Checkout Session in Lite when viewing confirmation. @@ -117,6 +118,60 @@ public function get_subscribed_events() { return $observe; } + /** + * Logs a transaction when a refund is created. + * + * @since 4.10.0 + * + * @param \SimplePay\Vendor\Stripe\Event $event Stripe Event object. + * @param \SimplePay\Vendor\Stripe\Charge $charge Stripe Charge object. + * @param \SimplePay\Core\Abstracts\Form $form Payment Form. + * @return void + */ + public function add_refund_log( $event, $charge, $form ) { + // Check if the payment made form WP Simple Pay. + if ( ! isset( $charge->payment_intent->metadata->simpay_form_id ) ) { + return; + } + + $transaction = $this->transactions->get_by_object_id( + $charge->payment_intent->id + ); + + // Update the transaction status if it exists. + if ( $transaction instanceof Transaction ) { + $this->transactions->update( + $transaction->id, + array( + 'status' => 'refunded', + 'amount_refunded' => $charge->amount_refunded, + ) + ); + } else { + // Create a new transaction log if it doesn't exist. + $this->transactions->add( + array( + 'form_id' => $charge->payment_intent->metadata->simpay_form_id, + 'object' => 'payment_intent', + 'object_id' => $charge->payment_intent->id, + 'livemode' => (bool) $charge->livemode, + 'amount_total' => $charge->amount, + 'amount_subtotal' => $charge->amount_refunded, + 'amount_shipping' => 0, + 'amount_discount' => 0, + 'amount_refunded' => $charge->amount_refunded, + 'currency' => $charge->currency, + 'payment_method_type' => null, + 'email' => $charge->billing_details->email, // @phpstan-ignore-line + 'customer_id' => $charge->customer->id, // @phpstan-ignore-line + 'subscription_id' => null, + 'status' => 'refunded', + 'application_fee' => $this->application_fee->has_application_fee(), + ) + ); + } + } + /** * Logs a transaction when a PaymentIntent is created. * @@ -291,7 +346,7 @@ public function add_on_invoice( $event, $invoice, $subscription ) { * @param int $total_discount Total discount, so far. * @param \stdClass $discount Discount object. */ - function( $total_discount, $discount ) { + function ( $total_discount, $discount ) { /** @var \stdClass $discount */ return $total_discount + $discount->amount; }, @@ -487,7 +542,7 @@ public function update_on_checkout_session( $event, $customer, $payment_intent, * @property int $amount_discount * @property int $amount_tax */ - $default_totals = new stdClass; + $default_totals = new stdClass(); $default_totals->amount_shipping = 0; $default_totals->amount_discount = 0; $default_totals->amount_tax = 0; @@ -579,7 +634,7 @@ public function update_on_checkout_session_lite( $payment_confirmation_data ) { * @property int $amount_discount * @property int $amount_tax */ - $default_totals = new stdClass; + $default_totals = new stdClass(); $default_totals->amount_shipping = 0; $default_totals->amount_discount = 0; $default_totals->amount_tax = 0; @@ -671,7 +726,7 @@ public function update_on_invoice( $event, $invoice, $subscription ) { * @param int $total_discount Total discount, so far. * @param \stdClass $discount Discount object. */ - function( $total_discount, $discount ) { + function ( $total_discount, $discount ) { /** @var \stdClass $discount */ return $total_discount + $discount->amount; }, @@ -852,5 +907,4 @@ public function maybe_increment_stock( $event, $charge ) { $form->adjust_inventory( 'increment', $quantity, $instance_id ); } } - } diff --git a/vendor/autoload.php b/vendor/autoload.php index db60b171..da33d7bf 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -22,4 +22,4 @@ require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInit314dd3482abd4cc1454cdb0e133d5085::getLoader(); +return ComposerAutoloaderInitd92c3bfb21634ab9fea4e7c0f7420ff2::getLoader(); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index a1c492d7..23a03803 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit314dd3482abd4cc1454cdb0e133d5085 +class ComposerAutoloaderInitd92c3bfb21634ab9fea4e7c0f7420ff2 { private static $loader; @@ -22,12 +22,12 @@ public static function getLoader() return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInit314dd3482abd4cc1454cdb0e133d5085', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInitd92c3bfb21634ab9fea4e7c0f7420ff2', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); - spl_autoload_unregister(array('ComposerAutoloaderInit314dd3482abd4cc1454cdb0e133d5085', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInitd92c3bfb21634ab9fea4e7c0f7420ff2', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInit314dd3482abd4cc1454cdb0e133d5085::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInitd92c3bfb21634ab9fea4e7c0f7420ff2::getInitializer($loader)); $loader->register(true); diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 9f9557ae..a198a257 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInit314dd3482abd4cc1454cdb0e133d5085 +class ComposerStaticInitd92c3bfb21634ab9fea4e7c0f7420ff2 { public static $prefixLengthsPsr4 = array ( 'S' => @@ -37,9 +37,9 @@ class ComposerStaticInit314dd3482abd4cc1454cdb0e133d5085 public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit314dd3482abd4cc1454cdb0e133d5085::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit314dd3482abd4cc1454cdb0e133d5085::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInit314dd3482abd4cc1454cdb0e133d5085::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInitd92c3bfb21634ab9fea4e7c0f7420ff2::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInitd92c3bfb21634ab9fea4e7c0f7420ff2::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInitd92c3bfb21634ab9fea4e7c0f7420ff2::$classMap; }, null, ClassLoader::class); } diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 4d6dc29a..7e6e744e 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -272,23 +272,24 @@ }, { "name": "symfony/css-selector", - "version": "v3.4.47", - "version_normalized": "3.4.47.0", + "version": "v5.4.39", + "version_normalized": "5.4.39.0", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "da3d9da2ce0026771f5fe64cb332158f1bd2bc33" + "reference": "0934c9f1d433776f25c629bdc93f3e157d139e08" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/da3d9da2ce0026771f5fe64cb332158f1bd2bc33", - "reference": "da3d9da2ce0026771f5fe64cb332158f1bd2bc33", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/0934c9f1d433776f25c629bdc93f3e157d139e08", + "reference": "0934c9f1d433776f25c629bdc93f3e157d139e08", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.16" }, - "time": "2020-10-24T10:57:07+00:00", + "time": "2024-04-18T08:26:06+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -317,10 +318,10 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony CssSelector Component", + "description": "Converts CSS selectors to XPath expressions", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/css-selector/tree/v3.4.47" + "source": "https://github.com/symfony/css-selector/tree/v5.4.39" }, "funding": [ { @@ -338,33 +339,118 @@ ], "install-path": "../symfony/css-selector" }, + { + "name": "symfony/polyfill-php80", + "version": "v1.29.0", + "version_normalized": "1.29.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", + "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "time": "2024-01-29T20:11:03+00:00", + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.29.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/polyfill-php80" + }, { "name": "tijsverkoyen/css-to-inline-styles", - "version": "2.2.0", - "version_normalized": "2.2.0.0", + "version": "v2.2.7", + "version_normalized": "2.2.7.0", "source": { "type": "git", "url": "https://github.com/tijsverkoyen/CssToInlineStyles.git", - "reference": "ab03919dfd85a74ae0372f8baf9f3c7d5c03b04b" + "reference": "83ee6f38df0a63106a9e4536e3060458b74ccedb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/tijsverkoyen/CssToInlineStyles/zipball/ab03919dfd85a74ae0372f8baf9f3c7d5c03b04b", - "reference": "ab03919dfd85a74ae0372f8baf9f3c7d5c03b04b", + "url": "https://api.github.com/repos/tijsverkoyen/CssToInlineStyles/zipball/83ee6f38df0a63106a9e4536e3060458b74ccedb", + "reference": "83ee6f38df0a63106a9e4536e3060458b74ccedb", "shasum": "" }, "require": { - "php": "^5.5 || ^7", - "symfony/css-selector": "^2.7|~3.0" + "ext-dom": "*", + "ext-libxml": "*", + "php": "^5.5 || ^7.0 || ^8.0", + "symfony/css-selector": "^2.7 || ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.8|5.1.*" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0 || ^7.5 || ^8.5.21 || ^9.5.10" }, - "time": "2016-09-20T12:50:39+00:00", + "time": "2023-12-08T13:03:43+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "2.2.x-dev" } }, "installation-source": "dist", @@ -388,7 +474,7 @@ "homepage": "https://github.com/tijsverkoyen/CssToInlineStyles", "support": { "issues": "https://github.com/tijsverkoyen/CssToInlineStyles/issues", - "source": "https://github.com/tijsverkoyen/CssToInlineStyles/tree/master" + "source": "https://github.com/tijsverkoyen/CssToInlineStyles/tree/v2.2.7" }, "install-path": "../tijsverkoyen/css-to-inline-styles" }, diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 2b6541b9..e75dc489 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => 'wpsimplepay/wp-simple-pay-pro-3', 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => '3473178cf524568b73c5a652692feed0ea69ecef', + 'reference' => '218978ce393e95dc6c493868673a375aa9101ce6', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -74,18 +74,27 @@ 'dev_requirement' => false, ), 'symfony/css-selector' => array( - 'pretty_version' => 'v3.4.47', - 'version' => '3.4.47.0', - 'reference' => 'da3d9da2ce0026771f5fe64cb332158f1bd2bc33', + 'pretty_version' => 'v5.4.39', + 'version' => '5.4.39.0', + 'reference' => '0934c9f1d433776f25c629bdc93f3e157d139e08', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/css-selector', 'aliases' => array(), 'dev_requirement' => false, ), + 'symfony/polyfill-php80' => array( + 'pretty_version' => 'v1.29.0', + 'version' => '1.29.0.0', + 'reference' => '87b68208d5c1188808dd7839ee1e6c8ec3b02f1b', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-php80', + 'aliases' => array(), + 'dev_requirement' => false, + ), 'tijsverkoyen/css-to-inline-styles' => array( - 'pretty_version' => '2.2.0', - 'version' => '2.2.0.0', - 'reference' => 'ab03919dfd85a74ae0372f8baf9f3c7d5c03b04b', + 'pretty_version' => 'v2.2.7', + 'version' => '2.2.7.0', + 'reference' => '83ee6f38df0a63106a9e4536e3060458b74ccedb', 'type' => 'library', 'install_path' => __DIR__ . '/../tijsverkoyen/css-to-inline-styles', 'aliases' => array(), @@ -103,7 +112,7 @@ 'wpsimplepay/wp-simple-pay-pro-3' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => '3473178cf524568b73c5a652692feed0ea69ecef', + 'reference' => '218978ce393e95dc6c493868673a375aa9101ce6', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), From 0ddfb374becf76141fa8d5ee3ad82cd2feeaa604 Mon Sep 17 00:00:00 2001 From: Spencer Finnell Date: Tue, 14 May 2024 08:48:33 -0400 Subject: [PATCH 09/11] Build - Translations - replace `wp_set_script_translations` domain --- gruntfile.js | 1 + src/Admin/DashboardWidget/ProductEducationDashboardWidget.php | 2 +- src/Admin/FormBuilder/TemplateExplorer.php | 2 +- src/AdminPage/ActivityReportsPage.php | 2 +- src/AdminPage/SetupWizardPage.php | 2 +- src/Help/HelpUi.php | 2 +- src/NotificationInbox/NotificationInboxUi.php | 2 +- 7 files changed, 7 insertions(+), 6 deletions(-) diff --git a/gruntfile.js b/gruntfile.js index f49873b5..2c78a8c4 100644 --- a/gruntfile.js +++ b/gruntfile.js @@ -57,6 +57,7 @@ module.exports = function (grunt) { "_nx:1,2,4c,5d", "_n_noop:1,2,3d", "_nx_noop:1,2,3c,4d", + "wp_set_script_translations:1,2d", ], }, files: { diff --git a/src/Admin/DashboardWidget/ProductEducationDashboardWidget.php b/src/Admin/DashboardWidget/ProductEducationDashboardWidget.php index b47dbe79..3db0bd3f 100644 --- a/src/Admin/DashboardWidget/ProductEducationDashboardWidget.php +++ b/src/Admin/DashboardWidget/ProductEducationDashboardWidget.php @@ -248,7 +248,7 @@ private function get_report_view() { wp_set_script_translations( 'simpay-admin-dashboard-widget-report', - 'simple-pay', + 'stripe', SIMPLE_PAY_DIR . '/languages' // @phpstan-ignore-line ); diff --git a/src/Admin/FormBuilder/TemplateExplorer.php b/src/Admin/FormBuilder/TemplateExplorer.php index b0a7f1b3..9107563c 100644 --- a/src/Admin/FormBuilder/TemplateExplorer.php +++ b/src/Admin/FormBuilder/TemplateExplorer.php @@ -230,7 +230,7 @@ public function render() { wp_set_script_translations( 'simpay-admin-form-template-explorer', - 'simple-pay', + 'stripe', SIMPLE_PAY_DIR . '/languages' // @phpstan-ignore-line ); diff --git a/src/AdminPage/ActivityReportsPage.php b/src/AdminPage/ActivityReportsPage.php index 0ab95147..39510e4e 100644 --- a/src/AdminPage/ActivityReportsPage.php +++ b/src/AdminPage/ActivityReportsPage.php @@ -129,7 +129,7 @@ public function render() { wp_set_script_translations( 'simpay-admin-page-activity-reports', - 'simple-pay', + 'stripe', SIMPLE_PAY_DIR . '/languages' // @phpstan-ignore-line ); diff --git a/src/AdminPage/SetupWizardPage.php b/src/AdminPage/SetupWizardPage.php index 80e3c3af..0dc27d22 100644 --- a/src/AdminPage/SetupWizardPage.php +++ b/src/AdminPage/SetupWizardPage.php @@ -170,7 +170,7 @@ public function render() { wp_set_script_translations( 'simpay-setup-wizard', - 'simple-pay', + 'stripe', SIMPLE_PAY_DIR . '/languages' // @phpstan-ignore-line ); diff --git a/src/Help/HelpUi.php b/src/Help/HelpUi.php index 97920dea..7479756d 100644 --- a/src/Help/HelpUi.php +++ b/src/Help/HelpUi.php @@ -132,7 +132,7 @@ public function output() { wp_set_script_translations( 'simpay-admin-help', - 'simple-pay', + 'stripe', SIMPLE_PAY_DIR . '/languages' // @phpstan-ignore-line ); diff --git a/src/NotificationInbox/NotificationInboxUi.php b/src/NotificationInbox/NotificationInboxUi.php index 505df149..76e40138 100644 --- a/src/NotificationInbox/NotificationInboxUi.php +++ b/src/NotificationInbox/NotificationInboxUi.php @@ -86,7 +86,7 @@ public function output() { wp_set_script_translations( 'simpay-admin-notifications', - 'simple-pay', + 'stripe', SIMPLE_PAY_INC . 'core/languages' // @phpstan-ignore-line ); From 8a07c0be48736149dab08d99e15d28169c0d9ce2 Mon Sep 17 00:00:00 2001 From: Prappo Date: Tue, 14 May 2024 20:27:00 +0600 Subject: [PATCH 10/11] sync with pro --- .../assets/css/simpay-admin-page-smtp.min.css | 2 +- includes/core/assets/css/simpay-admin.min.css | 2 +- ...ay-admin-dashboard-widget-report.asset.php | 2 +- ...pay-admin-form-template-explorer.asset.php | 2 +- .../js/dist/simpay-admin-help.asset.php | 2 +- .../dist/simpay-admin-notifications.asset.php | 2 +- ...mpay-admin-page-activity-reports.asset.php | 2 +- .../simpay-admin-page-setup-wizard.asset.php | 2 +- .../js/dist/simpay-block-button.asset.php | 2 +- .../dist/simpay-block-payment-form.asset.php | 2 +- includes/core/bootstrap/compatibility.php | 4 +- languages/stripe.pot | 140 +++++++++++++----- .../Resources/stubs/Attribute.php | 31 ++++ .../Resources/stubs/PhpToken.php | 16 ++ .../Resources/stubs/Stringable.php | 20 +++ .../Resources/stubs/UnhandledMatchError.php | 16 ++ .../Resources/stubs/ValueError.php | 16 ++ src/NotificationInbox/Database/Query.php | 0 src/NotificationInbox/Database/Schema.php | 0 src/NotificationInbox/Database/Table.php | 0 src/Transaction/Database/Query.php | 0 src/Transaction/Database/Schema.php | 0 src/Transaction/Database/Table.php | 0 vendor/autoload.php | 2 +- vendor/composer/autoload_real.php | 8 +- vendor/composer/autoload_static.php | 8 +- vendor/composer/installed.php | 4 +- 27 files changed, 228 insertions(+), 57 deletions(-) create mode 100644 lib/Symfony/polyfill-php80/Resources/stubs/Attribute.php create mode 100644 lib/Symfony/polyfill-php80/Resources/stubs/PhpToken.php create mode 100644 lib/Symfony/polyfill-php80/Resources/stubs/Stringable.php create mode 100644 lib/Symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php create mode 100644 lib/Symfony/polyfill-php80/Resources/stubs/ValueError.php mode change 100755 => 100644 src/NotificationInbox/Database/Query.php mode change 100755 => 100644 src/NotificationInbox/Database/Schema.php mode change 100755 => 100644 src/NotificationInbox/Database/Table.php mode change 100755 => 100644 src/Transaction/Database/Query.php mode change 100755 => 100644 src/Transaction/Database/Schema.php mode change 100755 => 100644 src/Transaction/Database/Table.php diff --git a/includes/core/assets/css/simpay-admin-page-smtp.min.css b/includes/core/assets/css/simpay-admin-page-smtp.min.css index 54385c98..6185775e 100644 --- a/includes/core/assets/css/simpay-admin-page-smtp.min.css +++ b/includes/core/assets/css/simpay-admin-page-smtp.min.css @@ -1 +1 @@ -.lity,.lity-container{transition:opacity .5s ease}.lity-active,.lity-active body{overflow:initial}#wpbody-content .notice,#wpbody-content .update-nag{display:none !important}.simpay-plugin-page .notice{display:none !important}.simpay-plugin-page .loader{margin:0 auto;position:relative;text-indent:-9999em;border-top:4px solid #969696;border-right:4px solid #969696;border-bottom:4px solid #969696;border-left:4px solid #404040;transform:translateZ(0);animation:load8 1.1s infinite linear;background-color:rgba(0,0,0,0)}.simpay-plugin-page .loader,.simpay-plugin-page .loader:after{display:block;border-radius:50%;width:50px;height:50px}@keyframes load8{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}#simpay-plugin-page-smtp{width:700px;margin:0 auto}#simpay-plugin-page-smtp *,#simpay-plugin-page-smtp *::before,#simpay-plugin-page-smtp *::after{box-sizing:border-box}#simpay-plugin-page-smtp section{margin:50px 0;text-align:left;clear:both}#simpay-plugin-page-smtp p{font-size:15px}#simpay-plugin-page-smtp .top{text-align:center}#simpay-plugin-page-smtp .top img{margin-bottom:38px}#simpay-plugin-page-smtp .top h1{font-size:26px;font-weight:600;margin-bottom:0;padding:0}#simpay-plugin-page-smtp .top p{font-size:17px;color:#777;margin-top:.5em}#simpay-plugin-page-smtp .top .updated{display:none}#simpay-plugin-page-smtp .screenshot>*{vertical-align:middle}#simpay-plugin-page-smtp .screenshot .cont{display:inline-block;position:relative;width:315px;padding:5px;background-color:#fff;box-shadow:0px 2px 5px 0px rgba(0,0,0,.05);border-radius:3px}#simpay-plugin-page-smtp .screenshot .cont img{max-width:100%;display:block}#simpay-plugin-page-smtp .screenshot .cont .hover{position:absolute;opacity:0;height:100%;width:100%;top:0;left:0;border:5px solid #fff;background-color:rgba(0,0,0,.15);background-image:url(data:image/svg+xml;base64,PHN2ZyBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjojZmZmZmZmMDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCIgaGVpZ2h0PSIxMDAiPjxwYXRoIGQ9Ik01MCAwYzI3LjYxNCAwIDUwIDIyLjM4NiA1MCA1MHMtMjIuMzg2IDUwLTUwIDUwUzAgNzcuNjE0IDAgNTAgMjIuMzg2IDAgNTAgMHoiIGZpbGw9IiMxNjg1YjciLz48cGF0aCBkPSJNNzMuMDIzIDY3LjA2N2wtOS4zNDQtOS4zNDRhMi4yNDcgMi4yNDcgMCAwMC0xLjU5My0uNjU2aC0xLjUyOGExOS4zOTkgMTkuMzk5IDAgMDA0LjEyNC0xMS45OTZjMC0xMC43Ny04LjcyNS0xOS40OTUtMTkuNDk0LTE5LjQ5NS0xMC43NjggMC0xOS40OTQgOC43MjYtMTkuNDk0IDE5LjQ5NSAwIDEwLjc2OCA4LjcyNiAxOS40OTMgMTkuNDk0IDE5LjQ5M2ExOS40IDE5LjQgMCAwMDExLjk5Ny00LjEyM3YxLjUyN2MwIC42LjIzNCAxLjE3Mi42NTUgMS41OTRsOS4zNDQgOS4zNDRhMi4yNCAyLjI0IDAgMDAzLjE3OCAwbDIuNjUyLTIuNjUzYTIuMjYgMi4yNiAwIDAwLjAxLTMuMTg2em0tMjcuODM1LTEwYy02LjYyNiAwLTExLjk5Ni01LjM2MS0xMS45OTYtMTEuOTk2IDAtNi42MjcgNS4zNi0xMS45OTcgMTEuOTk2LTExLjk5NyA2LjYyNiAwIDExLjk5NyA1LjM2MSAxMS45OTcgMTEuOTk3IDAgNi42MjYtNS4zNjEgMTEuOTk2LTExLjk5NyAxMS45OTZ6IiBmaWxsPSIjZmZmIi8+PC9zdmc+);background-repeat:no-repeat;background-position:center;background-size:50px;transition:all .3s}#simpay-plugin-page-smtp .screenshot .cont:hover .hover{opacity:1;transition:all .3s}#simpay-plugin-page-smtp .screenshot ul{display:inline-block;margin:0 0 0 30px;list-style-type:none;max-width:calc(100% - 350px)}#simpay-plugin-page-smtp .screenshot li{margin:16px 0;padding:0 0 0 24px;font-size:15px;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGQ9Ik0xMy43NzYyIDYuNDU2MDVMOC43MjAzMiAxLjQwMDA1QzguNTc1OTkgMS4yNTU3MiA4LjM4MzY0IDEuMTc2NSA4LjE3ODUzIDEuMTc2NUM3Ljk3MzIgMS4xNzY1IDcuNzgwOTYgMS4yNTU4NCA3LjYzNjY0IDEuNDAwMDVMNy4xNzc2IDEuODU5MkM3LjAzMzM5IDIuMDAzMjkgNi45NTM5NSAyLjE5NTc2IDYuOTUzOTUgMi40MDA5OEM2Ljk1Mzk1IDIuNjA2MDggNy4wMzMzOSAyLjgwNTA0IDcuMTc3NiAyLjk0OTE0TDEwLjEyNzEgNS45MDUxNkgwLjc1NjMzNEMwLjMzMzgzNCA1LjkwNTE2IDAgNi4yMzU5MiAwIDYuNjU4NTRWNy4zMDc2NUMwIDcuNzMwMjcgMC4zMzM4MzQgOC4wOTQzOCAwLjc1NjMzNCA4LjA5NDM4SDEwLjE2MDZMNy4xNzc3MiAxMS4wNjY5QzcuMDMzNTEgMTEuMjExMiA2Ljk1NDA2IDExLjM5ODUgNi45NTQwNiAxMS42MDM3QzYuOTU0MDYgMTEuODA4NyA3LjAzMzUxIDExLjk5ODYgNy4xNzc3MiAxMi4xNDI4TDcuNjM2NzUgMTIuNjAwNUM3Ljc4MTA3IDEyLjc0NDggNy45NzMzMiAxMi44MjM1IDguMTc4NjUgMTIuODIzNUM4LjM4Mzc1IDEyLjgyMzUgOC41NzYxMSAxMi43NDM4IDguNzIwNDMgMTIuNTk5NUwxMy43NzYzIDcuNTQzNkMxMy45MjEgNy4zOTg4MiAxNC4wMDA1IDcuMjA1NTYgMTQgNy4wMDAxMUMxNC4wMDA0IDYuNzkzOTggMTMuOTIxIDYuNjAwNiAxMy43NzYyIDYuNDU2MDVWNi40NTYwNVoiIGZpbGw9IiM0MjhCQ0EiLz4NCjwvc3ZnPg0K);background-position:left 3px;background-repeat:no-repeat;background-size:14px;color:#777}#simpay-plugin-page-smtp .step{background-color:#f9f9f9;box-shadow:0px 2px 5px 0px rgba(0,0,0,.05);border:1px solid #e5e5e5;margin:0 0 25px 0}#simpay-plugin-page-smtp .step>*{vertical-align:middle}#simpay-plugin-page-smtp .step .num{display:inline-block;position:relative;width:100px;height:50px;text-align:center}#simpay-plugin-page-smtp .step .loader{margin-top:-54px;transition:all .3s;opacity:1}#simpay-plugin-page-smtp .step div{display:inline-block;width:calc(100% - 104px);background-color:#fff;padding:30px;border-left:1px solid #eee}#simpay-plugin-page-smtp .step h2{font-size:24px;line-height:22px;margin-top:0;margin-bottom:15px}#simpay-plugin-page-smtp .step p{font-size:16px;color:#777}#simpay-plugin-page-smtp .step .error{font-size:14px;color:#b97474;margin-bottom:0}#simpay-plugin-page-smtp .step .link{text-decoration:none}#simpay-plugin-page-smtp .step .button{font-weight:500;box-shadow:none;padding:12px;min-width:200px;height:auto;line-height:13px;text-align:center;font-size:15px;transition:all .3s}#simpay-plugin-page-smtp .step .button.grey{background:#f6f6f6;border:1px solid #ddd;text-shadow:none;color:#9fa5aa}#simpay-plugin-page-smtp .step .button.disabled{cursor:default}#simpay-plugin-page-smtp .step .hidden{opacity:0;transition:all .3s}#simpay-plugin-page-smtp .grey{opacity:.5}@media(max-width: 767px){#simpay-admin-smtp{width:auto;margin:0 20px}#simpay-admin-smtp .screenshot .cont{width:auto}#simpay-admin-smtp .screenshot ul{margin:20px 0 0 15px;max-width:100%}#simpay-admin-smtp .button{white-space:normal}} +.lity,.lity-container{transition:opacity .5s ease}.lity-active,.lity-active body{overflow:initial}#wpbody-content .notice,#wpbody-content .update-nag{display:none !important}.simpay-plugin-page .notice{display:none !important}.simpay-plugin-page .loader{margin:0 auto;position:relative;text-indent:-9999em;border-top:4px solid #969696;border-right:4px solid #969696;border-bottom:4px solid #969696;border-left:4px solid #404040;transform:translateZ(0);animation:load8 1.1s infinite linear;background-color:rgba(0,0,0,0)}.simpay-plugin-page .loader,.simpay-plugin-page .loader:after{display:block;border-radius:50%;width:50px;height:50px}@keyframes load8{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}#simpay-plugin-page-smtp{width:700px;margin:0 auto}#simpay-plugin-page-smtp *,#simpay-plugin-page-smtp *::before,#simpay-plugin-page-smtp *::after{box-sizing:border-box}#simpay-plugin-page-smtp section{margin:50px 0;text-align:left;clear:both}#simpay-plugin-page-smtp p{font-size:15px}#simpay-plugin-page-smtp .top{text-align:center}#simpay-plugin-page-smtp .top img{margin-bottom:38px}#simpay-plugin-page-smtp .top h1{font-size:26px;font-weight:600;margin-bottom:0;padding:0}#simpay-plugin-page-smtp .top p{font-size:17px;color:#777;margin-top:.5em}#simpay-plugin-page-smtp .top .updated{display:none}#simpay-plugin-page-smtp .screenshot>*{vertical-align:middle}#simpay-plugin-page-smtp .screenshot .cont{display:inline-block;position:relative;width:315px;padding:5px;background-color:#fff;box-shadow:0px 2px 5px 0px rgba(0,0,0,.05);border-radius:3px}#simpay-plugin-page-smtp .screenshot .cont img{max-width:100%;display:block}#simpay-plugin-page-smtp .screenshot .cont .hover{position:absolute;opacity:0;height:100%;width:100%;top:0;left:0;border:5px solid #fff;background-color:rgba(0,0,0,.15);background-image:url(data:image/svg+xml;base64,PHN2ZyBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjojZmZmZmZmMDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCIgaGVpZ2h0PSIxMDAiPjxwYXRoIGQ9Ik01MCAwYzI3LjYxNCAwIDUwIDIyLjM4NiA1MCA1MHMtMjIuMzg2IDUwLTUwIDUwUzAgNzcuNjE0IDAgNTAgMjIuMzg2IDAgNTAgMHoiIGZpbGw9IiMxNjg1YjciLz48cGF0aCBkPSJNNzMuMDIzIDY3LjA2N2wtOS4zNDQtOS4zNDRhMi4yNDcgMi4yNDcgMCAwMC0xLjU5My0uNjU2aC0xLjUyOGExOS4zOTkgMTkuMzk5IDAgMDA0LjEyNC0xMS45OTZjMC0xMC43Ny04LjcyNS0xOS40OTUtMTkuNDk0LTE5LjQ5NS0xMC43NjggMC0xOS40OTQgOC43MjYtMTkuNDk0IDE5LjQ5NSAwIDEwLjc2OCA4LjcyNiAxOS40OTMgMTkuNDk0IDE5LjQ5M2ExOS40IDE5LjQgMCAwMDExLjk5Ny00LjEyM3YxLjUyN2MwIC42LjIzNCAxLjE3Mi42NTUgMS41OTRsOS4zNDQgOS4zNDRhMi4yNCAyLjI0IDAgMDAzLjE3OCAwbDIuNjUyLTIuNjUzYTIuMjYgMi4yNiAwIDAwLjAxLTMuMTg2em0tMjcuODM1LTEwYy02LjYyNiAwLTExLjk5Ni01LjM2MS0xMS45OTYtMTEuOTk2IDAtNi42MjcgNS4zNi0xMS45OTcgMTEuOTk2LTExLjk5NyA2LjYyNiAwIDExLjk5NyA1LjM2MSAxMS45OTcgMTEuOTk3IDAgNi42MjYtNS4zNjEgMTEuOTk2LTExLjk5NyAxMS45OTZ6IiBmaWxsPSIjZmZmIi8+PC9zdmc+);background-repeat:no-repeat;background-position:center;background-size:50px;transition:all .3s}#simpay-plugin-page-smtp .screenshot .cont:hover .hover{opacity:1;transition:all .3s}#simpay-plugin-page-smtp .screenshot ul{display:inline-block;margin:0 0 0 30px;list-style-type:none;max-width:calc(100% - 350px)}#simpay-plugin-page-smtp .screenshot li{margin:16px 0;padding:0 0 0 24px;font-size:15px;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEzLjc3NjIgNi40NTYwNUw4LjcyMDMyIDEuNDAwMDVDOC41NzU5OSAxLjI1NTcyIDguMzgzNjQgMS4xNzY1IDguMTc4NTMgMS4xNzY1QzcuOTczMiAxLjE3NjUgNy43ODA5NiAxLjI1NTg0IDcuNjM2NjQgMS40MDAwNUw3LjE3NzYgMS44NTkyQzcuMDMzMzkgMi4wMDMyOSA2Ljk1Mzk1IDIuMTk1NzYgNi45NTM5NSAyLjQwMDk4QzYuOTUzOTUgMi42MDYwOCA3LjAzMzM5IDIuODA1MDQgNy4xNzc2IDIuOTQ5MTRMMTAuMTI3MSA1LjkwNTE2SDAuNzU2MzM0QzAuMzMzODM0IDUuOTA1MTYgMCA2LjIzNTkyIDAgNi42NTg1NFY3LjMwNzY1QzAgNy43MzAyNyAwLjMzMzgzNCA4LjA5NDM4IDAuNzU2MzM0IDguMDk0MzhIMTAuMTYwNkw3LjE3NzcyIDExLjA2NjlDNy4wMzM1MSAxMS4yMTEyIDYuOTU0MDYgMTEuMzk4NSA2Ljk1NDA2IDExLjYwMzdDNi45NTQwNiAxMS44MDg3IDcuMDMzNTEgMTEuOTk4NiA3LjE3NzcyIDEyLjE0MjhMNy42MzY3NSAxMi42MDA1QzcuNzgxMDcgMTIuNzQ0OCA3Ljk3MzMyIDEyLjgyMzUgOC4xNzg2NSAxMi44MjM1QzguMzgzNzUgMTIuODIzNSA4LjU3NjExIDEyLjc0MzggOC43MjA0MyAxMi41OTk1TDEzLjc3NjMgNy41NDM2QzEzLjkyMSA3LjM5ODgyIDE0LjAwMDUgNy4yMDU1NiAxNCA3LjAwMDExQzE0LjAwMDQgNi43OTM5OCAxMy45MjEgNi42MDA2IDEzLjc3NjIgNi40NTYwNVY2LjQ1NjA1WiIgZmlsbD0iIzQyOEJDQSIvPgo8L3N2Zz4K);background-position:left 3px;background-repeat:no-repeat;background-size:14px;color:#777}#simpay-plugin-page-smtp .step{background-color:#f9f9f9;box-shadow:0px 2px 5px 0px rgba(0,0,0,.05);border:1px solid #e5e5e5;margin:0 0 25px 0}#simpay-plugin-page-smtp .step>*{vertical-align:middle}#simpay-plugin-page-smtp .step .num{display:inline-block;position:relative;width:100px;height:50px;text-align:center}#simpay-plugin-page-smtp .step .loader{margin-top:-54px;transition:all .3s;opacity:1}#simpay-plugin-page-smtp .step div{display:inline-block;width:calc(100% - 104px);background-color:#fff;padding:30px;border-left:1px solid #eee}#simpay-plugin-page-smtp .step h2{font-size:24px;line-height:22px;margin-top:0;margin-bottom:15px}#simpay-plugin-page-smtp .step p{font-size:16px;color:#777}#simpay-plugin-page-smtp .step .error{font-size:14px;color:#b97474;margin-bottom:0}#simpay-plugin-page-smtp .step .link{text-decoration:none}#simpay-plugin-page-smtp .step .button{font-weight:500;box-shadow:none;padding:12px;min-width:200px;height:auto;line-height:13px;text-align:center;font-size:15px;transition:all .3s}#simpay-plugin-page-smtp .step .button.grey{background:#f6f6f6;border:1px solid #ddd;text-shadow:none;color:#9fa5aa}#simpay-plugin-page-smtp .step .button.disabled{cursor:default}#simpay-plugin-page-smtp .step .hidden{opacity:0;transition:all .3s}#simpay-plugin-page-smtp .grey{opacity:.5}@media(max-width: 767px){#simpay-admin-smtp{width:auto;margin:0 20px}#simpay-admin-smtp .screenshot .cont{width:auto}#simpay-admin-smtp .screenshot ul{margin:20px 0 0 15px;max-width:100%}#simpay-admin-smtp .button{white-space:normal}} diff --git a/includes/core/assets/css/simpay-admin.min.css b/includes/core/assets/css/simpay-admin.min.css index 77c3dbb9..3296730a 100644 --- a/includes/core/assets/css/simpay-admin.min.css +++ b/includes/core/assets/css/simpay-admin.min.css @@ -1 +1 @@ -.simpay-settings-subsections{display:flex;align-items:center;box-shadow:inset 0 -1px 0 0 #ccc}.simpay-settings-subsections__subsection{font-weight:500;text-decoration:none;padding:15px;display:flex;align-items:center}.simpay-settings-subsections__subsection .dashicons{width:18px;height:18px;font-size:18px;margin-right:4px}.simpay-settings-subsections__subsection.is-active{box-shadow:inset 0 -4px 0 0 currentColor;position:relative;z-index:1}.simpay-settings-subsections__subsection:not(.is-active){color:#23282d}.simpay-settings form>h2:not(.nav-tab-wrapper){clip:rect(1px, 1px, 1px, 1px);height:1px;overflow:hidden;position:absolute !important;width:1px}.simpay-settings .form-table td fieldset+p,.simpay-settings .form-table td label+p,.simpay-settings .form-table td select+p,.simpay-settings .form-table td input+p{color:#666;font-style:italic}.simpay-settings .simpay-settings-subsections__subsection{display:flex;align-items:center}.simpay-settings .simpay-settings-subsections__subsection .simpay-settings-bubble{margin-left:5px}.simpay-settings .simpay-settings-visual-toggles{margin:30px 0 0;display:flex}.simpay-settings .simpay-settings-visual-toggles input[type=radio]{display:none}.simpay-settings .simpay-settings-visual-toggles__toggle{-webkit-user-select:none;-moz-user-select:none;user-select:none;min-width:180px;margin:0 30px 0 0 !important;position:relative;display:block;background-color:#fff;border-radius:4px;border:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04)}.simpay-settings .simpay-settings-visual-toggles__toggle:hover{border:1px solid #999;box-shadow:0 1px 2px rgba(0,0,0,.1)}.simpay-settings .simpay-settings-visual-toggles input[type=radio]:checked+.simpay-settings-visual-toggles__toggle{border-color:#007cba;border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px #007cba;box-shadow:0 0 0 1px var(--wp-admin-theme-color)}.simpay-settings .simpay-settings-visual-toggles__toggle-recommended,.simpay-settings .simpay-settings-visual-toggles__toggle-not-recommended{text-align:center;font-size:12px;text-transform:uppercase;font-weight:bold;margin:0;padding:5px 0;display:block;border-top-right-radius:4px;border-top-left-radius:4px}.simpay-settings .simpay-settings-visual-toggles__toggle-recommended{color:#0f8569;background:#f4f9f7}.simpay-settings .simpay-settings-visual-toggles__toggle-not-recommended{color:#b91c1b;background:#fef2f2}.simpay-settings .simpay-settings-visual-toggles__toggle-icon{margin:20px auto 15px;padding:0 15px;display:block}.simpay-settings .simpay-settings-visual-toggles__toggle-label{line-height:1.5;text-align:center;font-size:16px;font-weight:500;margin:15px;display:block}.simpay-settings .simpay-settings-visual-toggles__toggle-label small{color:#666;font-weight:normal;font-size:13px;line-height:1;display:block;margin:4px 0}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type .simpay-settings-visual-toggles__toggle{min-height:160px}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type .simpay-settings-visual-toggles__toggle-icon{width:80px;height:80px}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type input[type=radio].simpay-settings-captcha-type--is-recommended:checked+.simpay-settings-visual-toggles__toggle{border-color:#0f8569;box-shadow:0 0 0 1px #0f8569}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type input[type=radio].simpay-settings-captcha-type--is-not-recommended:checked+.simpay-settings-visual-toggles__toggle{border-color:#b91c1b;box-shadow:0 0 0 1px #b91c1b}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type label[for=simpay-settings-captcha-type-cloudflare-turnstile] .simpay-settings-visual-toggles__toggle-icon{width:120px}.simpay-settings-general-recaptcha-no_captcha_warning th,.simpay-settings-general-recaptcha-no_captcha_warning td,.simpay-settings-hcaptcha_secret_key th,.simpay-settings-hcaptcha_secret_key td,.simpay-settings-cloudflare_turnstile_secret_key th,.simpay-settings-cloudflare_turnstile_secret_key td,.simpay-settings-recaptcha_score_threshold th,.simpay-settings-recaptcha_score_threshold td{padding-bottom:50px !important}.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-summary-report,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-payment-confirmation,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-payment-notification,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-upcoming-invoice,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-manage-subscriptions,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-payment-processing-confirmation,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-payment-processing-notification,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-payment-refunded-confirmation,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-subscription-cancel-confirmation,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-subscription-cancel-notification,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-invoice-confirmation{display:none}.simpay-settings .simpay-settings-subsection-emails-tools{margin-left:auto}.simpay-admin-charts-period-over-period{position:relative;padding-bottom:12px}.simpay-admin-charts-period-over-period *{box-sizing:border-box}.simpay-admin-charts-period-over-period__tooltip{position:absolute;background:#fff;border:1px solid #c3c3c3;box-shadow:0 2px 6px rgba(0,0,0,.05);border-radius:2px;padding:10px 14px;display:flex;flex-direction:column;z-Index:10000;min-width:175px}.simpay-admin-charts-period-over-period__tooltip-data{white-space:nowrap;margin-bottom:8px;display:grid;grid-template-columns:1fr auto;grid-auto-rows:auto;-moz-column-gap:16px;column-gap:16px}.simpay-admin-charts-period-over-period__tooltip-data:last-child{margin-bottom:0}.simpay-admin-charts-period-over-period__tooltip-data[data-dataset="1"]{opacity:.65}.simpay-admin-charts-period-over-period__tooltip-data em{font-style:normal;text-align:right}.simpay-admin-charts-period-over-period__tooltip-delta{font-size:12px;margin:0 -14px -10px;padding:8px 14px;border-top:1px solid #eee;background:#fdfdfd;border-radius:2px;display:flex;align-items:center;justify-content:center}.simpay-admin-charts-period-over-period__tooltip-delta .simpay-admin-charts-badge{margin-right:4px}.simpay-admin-charts-period-over-period__tooltip-delta strong.is-positive{color:#006908}.simpay-admin-charts-period-over-period__tooltip-delta strong.is-negative{color:#b3093c}.simpay-admin-charts-badge{color:#2f2f2f;font-size:12px;font-weight:500;font-style:normal;line-height:1;padding:3px 6px;display:inline-flex;align-items:center;background:#f0f0f0;border-radius:100px}.simpay-admin-charts-badge.is-positive{color:#006908;background-color:#d7f7c2}.simpay-admin-charts-badge.is-negative{color:#b3093c;background-color:#ffe7f2}.simpay-admin-charts-badge__icon{width:15px;height:15px}.simpay-admin-charts-no-data{position:absolute;top:0;left:0;display:flex;justify-content:center;align-items:center;background:rgba(255,255,255,.5);z-index:2}.simpay-admin-charts-no-data>div{text-align:center;padding:24px;background:#fff;border:1px solid #c3c3c3;box-shadow:0 2px 6px rgba(0,0,0,.1);border-radius:2px;max-width:60%}.simpay-admin-charts-no-data strong{font-size:15px;margin-bottom:8px;display:block}.button.button-large.simpay-button-large{font-size:14px;line-height:30px;padding:4px 12px}.simpay-copy-hidden-input{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}.fixed .column-livemode{width:15%;text-align:right}@media screen and (max-width: 782px){.fixed .column-livemode{text-align:left}}.fixed .column-livemode .simpay-badge{margin-top:3px}.fixed .column-shortcode{width:25%}.fixed .column-shortcode .simpay-shortcode{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}.post-type-simple-pay .misc-pub-curtime,.post-type-simple-pay .misc-pub-visibility{display:none}.simpay-metabox-title{border:1px solid #eee}.simpay-shortcode-section{border-top:1px solid #ddd;border-width:1px 0;padding-top:15px;padding-bottom:15px;position:relative}.simpay-shortcode-section label{display:block;margin-bottom:6px}.simpay-shortcode-section label .dashicons{color:#8c8f94;margin-right:3px}.simpay-shortcode-section .simpay-copy-button{line-height:normal;position:absolute;right:20px;bottom:20px;border:0;background:none;box-shadow:none;padding:0}.simpay-shortcode-section .simpay-copy-button:hover{border:0;background:none;box-shadow:none}.simpay-shortcode-section .simpay-copy-button .dashicons{color:#3c434a}.simpay-shortcode{width:100%;padding:8px;line-height:1;margin:0;height:32px;resize:none}.simpay-badge{color:#3f3f46;text-align:center;line-height:1;padding:5px 7px;border-radius:3px;background:#e4e4e7;border:0;box-shadow:none;display:inline-flex;align-items:center}button.simpay-badge{cursor:pointer}button.simpay-badge:hover{background:#d4d4d8}.simpay-badge__icon{opacity:.8;margin:2px 5px 0 0}.simpay-badge--green{color:#0e6245;background:#cbf4c9}.simpay-badge--yellow{color:#983705;background:#f8e5b9}.simpay-stripe-account-info{display:flex;align-items:center;margin-bottom:8px;position:relative}.simpay-stripe-account-info .spinner{float:none;margin-top:0;margin-left:0}.simple-pay_page_simpay_settings .simpay-settings-upgrade,.post-type-simple-pay .simpay-settings-upgrade{margin-top:20px;padding:1px;position:relative;background:#fff;border-radius:4px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.2),0 5px 10px rgba(0,0,0,.1);max-width:677px}.simple-pay_page_simpay_settings .simpay-settings-upgrade__inner,.post-type-simple-pay .simpay-settings-upgrade__inner{text-align:center;margin:0;padding:30px}.simple-pay_page_simpay_settings .simpay-settings-upgrade h3,.post-type-simple-pay .simpay-settings-upgrade h3{line-height:1.5;font-size:22px;margin:0 0 1.5rem}.simple-pay_page_simpay_settings .simpay-settings-upgrade ul,.post-type-simple-pay .simpay-settings-upgrade ul{margin:1.5rem 0 calc(1.5rem - 6px);display:flex;flex-wrap:wrap;justify-content:center}@media screen and (min-width: 782px){.simple-pay_page_simpay_settings .simpay-settings-upgrade ul,.post-type-simple-pay .simpay-settings-upgrade ul{margin-left:4rem;margin-right:4rem}}.simple-pay_page_simpay_settings .simpay-settings-upgrade li,.post-type-simple-pay .simpay-settings-upgrade li{font-size:15px;margin:6px 0;width:100%}.simple-pay_page_simpay_settings .simpay-settings-upgrade li a,.post-type-simple-pay .simpay-settings-upgrade li a{color:#3c434a;text-decoration:none}.simple-pay_page_simpay_settings .simpay-settings-upgrade li a:hover,.post-type-simple-pay .simpay-settings-upgrade li a:hover{color:var(--wp-admin-theme-color);text-decoration:underline}@media screen and (min-width: 782px){.simple-pay_page_simpay_settings .simpay-settings-upgrade li,.post-type-simple-pay .simpay-settings-upgrade li{text-align:left;width:50%}}.simple-pay_page_simpay_settings .simpay-settings-upgrade .button.button-large,.post-type-simple-pay .simpay-settings-upgrade .button.button-large{font-size:17px;line-height:30px;padding:10px 20px}.simple-pay_page_simpay_settings .simpay-settings-upgrade small,.post-type-simple-pay .simpay-settings-upgrade small{color:#666;margin:15px 0 0;display:block}.simple-pay_page_simpay_settings .simpay-settings-upgrade .dashicons-yes,.post-type-simple-pay .simpay-settings-upgrade .dashicons-yes{color:#428bca}.simple-pay_page_simpay_settings .simpay-settings-upgrade .button-link,.post-type-simple-pay .simpay-settings-upgrade .button-link{position:absolute;top:0;right:0;font-size:20px;color:#666;font-weight:bold;text-decoration:none;margin-left:5px;padding:6px 10px;z-index:2}.simple-pay_page_simpay_settings .simpay-settings-upgrade .button-link:hover,.simple-pay_page_simpay_settings .simpay-settings-upgrade .button-link:active,.simple-pay_page_simpay_settings .simpay-settings-upgrade .button-link:focus,.post-type-simple-pay .simpay-settings-upgrade .button-link:hover,.post-type-simple-pay .simpay-settings-upgrade .button-link:active,.post-type-simple-pay .simpay-settings-upgrade .button-link:focus{color:#666;text-decoration:none}.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext{text-align:center;margin:0;padding:30px 20px 20px;background-color:#fcf9e8;border:1px solid #edeac9;border-width:1px 0 0;position:relative;border-radius:0;border-bottom-left-radius:4px;border-bottom-right-radius:4px}@media screen and (min-width: 782px){.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext{padding-left:4rem;padding-right:4rem}}.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext svg,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext svg{background:#00a32a;fill:#fff;border-radius:50%;border:4px solid #fff;box-shadow:0 0 0 1px #edeac9;width:28px;height:28px;position:absolute;top:-18px;left:50%;margin-left:-18px}.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext u,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext u{text-decoration:none;font-weight:bold;color:#00a32a}.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext a,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext a{font-weight:normal;display:inline-block}#simpay-payment-form-settings table{width:100%;border-collapse:collapse}#simpay-payment-form-settings ::-webkit-input-placeholder{color:#9ba1a9}#simpay-payment-form-settings ::-moz-placeholder{color:#9ba1a9;opacity:1}#simpay-payment-form-settings :-ms-input-placeholder{color:#9ba1a9}#simpay-payment-form-settings .inside{margin:0;padding:0}#simpay-payment-form-settings .simpay-panel-field .toolbar{margin-bottom:-4px}#simpay-payment-form-settings .simpay-panel-field .toolbar .simpay-field-select{margin:0 0 4px;width:auto;max-width:70%}#simpay-payment-form-settings .simpay-tabs{margin:0;padding:0;list-style:none;background:#fafafa;border-right:1px solid #ccd0d4;line-height:1em;position:relative;flex:0 0 25%}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-tabs{flex-basis:100%;flex-grow:1;border-right:0}}#simpay-payment-form-settings .simpay-tabs li{margin:0;padding:0}#simpay-payment-form-settings .simpay-tabs li:first-child{margin-top:12px}#simpay-payment-form-settings .simpay-tabs li:last-child{margin-bottom:20px}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-tabs li:last-child{margin-bottom:0}}#simpay-payment-form-settings .simpay-tabs li.active{margin-left:-1px;box-shadow:0 1px 1px rgba(0,0,0,.04);position:relative}#simpay-payment-form-settings .simpay-tabs li.active:focus:after{display:none}#simpay-payment-form-settings .simpay-tabs li.active:before,#simpay-payment-form-settings .simpay-tabs li.active:after{content:"";width:calc(100% + 1px);height:1px;background:#ccd0d4;position:absolute;top:0;left:0;right:0;z-index:2}#simpay-payment-form-settings .simpay-tabs li.active:after{top:auto;bottom:0}#simpay-payment-form-settings .simpay-tabs li.active a{font-weight:bold;background-color:#fff;position:relative;margin-right:-1px}#simpay-payment-form-settings .simpay-tabs li.active a:before{content:"";position:absolute;top:0;left:0;bottom:0;width:4px;height:100%;background:currentColor;z-index:3}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-tabs li.active a{margin-right:0}}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item{display:flex;align-items:center;line-height:20px;margin:0;padding:8px 10px 8px 14px;text-decoration:none;transition:all .05s ease-in-out}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item svg,#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item .dashicons{margin-right:6px}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item{padding:18px}}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item:focus{outline:0;position:relative;z-index:3;box-shadow:inset 0 0 0 1px currentColor,0 0 0 1px currentColor}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item[href="#purchase-restrictions-settings-panel"],#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item[href="#payment-page-settings-panel"]{margin-bottom:20px;position:relative}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item[href="#purchase-restrictions-settings-panel"]:after,#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item[href="#payment-page-settings-panel"]:after{content:"";position:absolute;left:14px;right:14px;bottom:-10px;width:calc(100% - 28px);height:1px;background:#eaeaea}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item span>span{color:#f18500;font-size:12px;font-weight:600;margin:0 0 0 5px;display:inline-block}#simpay-payment-form-settings .simpay-tabs li:not(.active) .simpay-tab-item{color:inherit}#simpay-payment-form-settings .simpay-panels-wrap{background:#fff;display:flex}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-panels-wrap{flex-direction:column}}#simpay-payment-form-settings .simpay-panels{flex:0 0 75%;display:flex}@media screen and (min-width: 1400px){#simpay-payment-form-settings .simpay-panels{flex-basis:75%}}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-panels{flex-basis:100%}}#simpay-payment-form-settings .simpay-panel,#simpay-payment-form-settings .simpay-panel-section{width:100%}#simpay-payment-form-settings .simpay-panel>table,#simpay-payment-form-settings .simpay-panel>table>tr,#simpay-payment-form-settings .simpay-panel>table>tbody,#simpay-payment-form-settings .simpay-panel>table>tbody>tr,#simpay-payment-form-settings .simpay-panel>table>thead,#simpay-payment-form-settings .simpay-panel>table>thead>tr{display:block;width:100%}#simpay-payment-form-settings .simpay-panel>table:last-child>tbody:last-child>tr:last-child>td{border-bottom:0}#simpay-payment-form-settings .simpay-panel-field--requires-upgrade{position:relative}#simpay-payment-form-settings .simpay-panel-field--requires-upgrade td>div{margin-right:80px}#simpay-payment-form-settings .simpay-panel-field--requires-upgrade td>div .button-small{position:absolute;top:calc(50% - 13px);right:18px}#simpay-payment-form-settings .simpay-panel-field,#simpay-payment-form-settings .simpay-panel-field>td,#simpay-payment-form-settings .simpay-panel-field>th{text-align:left;display:block}#simpay-payment-form-settings .simpay-panel-field>td,#simpay-payment-form-settings .simpay-panel-field>th{width:calc(100% - 36px);margin-left:18px;margin-right:18px}#simpay-payment-form-settings .simpay-panel-field th{font-weight:bold;padding-top:18px;padding-bottom:5px}#simpay-payment-form-settings .simpay-panel-field td{border-bottom:1px solid #ddd;padding-bottom:18px}#simpay-payment-form-settings .simpay-panel-field p.description{margin-top:4px}#simpay-payment-form-settings .simpay-panel-field p.description:last-of-type{margin-bottom:0}#simpay-payment-form-settings .simpay-panel-field .simpay-panel-field__nested{margin-top:18px}#simpay-payment-form-settings .simpay-panel-field .simpay-panel-field__nested label{font-weight:bold;display:block;margin-bottom:4px}#simpay-payment-form-settings .simpay-panel-field .simpay-field-select,#simpay-payment-form-settings .simpay-panel-field .simpay-field-text{min-width:75%;max-width:100%}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-panel-field .simpay-field-select,#simpay-payment-form-settings .simpay-panel-field .simpay-field-text{min-width:0;width:100%}}#simpay-payment-form-settings .simpay-panel-field .simpay-field-textarea{width:100%;max-width:100%}#simpay-payment-form-settings .simpay-panel-field .notice:last-of-type{margin-bottom:0}#simpay-payment-form-settings .simpay-panel-field .error,#simpay-payment-form-settings .simpay-panel-field .simpay-important{color:#a94442;font-weight:normal}#simpay-payment-form-settings .simpay-panel-field .simpay-image-preview-wrap{position:relative;margin-top:12px}#simpay-payment-form-settings .simpay-panel-field .simpay-image-preview-wrap .simpay-remove-image-preview{position:absolute;top:-15px;left:-15px;cursor:pointer;background-color:#fff}#simpay-payment-form-settings .simpay-panel-field .simpay-image-preview-wrap .simpay-remove-image-preview::before{font-size:22px;line-height:26px}#simpay-payment-form-settings .simpay-panel-field .simpay-image-preview-wrap .simpay-image-preview{max-height:128px;max-width:128px;border:1px solid #ddd}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box{background-color:#f4f4f4;border:1px solid #e5e5e5;padding:18px;margin-top:18px;position:relative}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box__dismiss{color:inherit;text-decoration:none;position:absolute;top:8px;right:8px}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box__dismiss .dashicons-dismiss{font-size:16px;width:16px;height:16px}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box h3{font-size:18px;font-weight:600;margin:0;padding:0}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box p{font-size:14px}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box p:last-child{margin-bottom:0}#simpay-payment-form-settings .simpay-metabox-content{margin-bottom:-1px;background-color:#f5f5f5;border:1px solid #c3c4c7;border-width:1px 0;box-shadow:0 1px 1px rgba(0,0,0,.04);position:relative}#simpay-payment-form-settings .simpay-show-if,#simpay-payment-form-settings .simpay-panel-hidden{display:none}#simpay-payment-form-settings .simpay-payment-methods{border:1px solid #ccd0d4;border-radius:4px;box-shadow:0 1px 1px rgba(0,0,0,.04)}#simpay-payment-form-settings .simpay-panel-field-payment-method{display:block;border-top:1px solid #ccd0d4;padding:7px;box-sizing:border-box}#simpay-payment-form-settings .simpay-panel-field-payment-method:first-child{border-top:0;border-top-left-radius:4px;border-top-right-radius:4px}#simpay-payment-form-settings .simpay-panel-field-payment-method__enable{display:flex;align-items:center}#simpay-payment-form-settings .simpay-panel-field-payment-method__enable input[type=checkbox]{margin-top:0;margin-right:8px}#simpay-payment-form-settings .simpay-panel-field-payment-method__help{text-decoration:none}#simpay-payment-form-settings .simpay-panel-field-payment-method__help .dashicons{font-size:18px;width:18px;height:18px}#simpay-payment-form-settings .simpay-panel-field-payment-method__restrictions,#simpay-payment-form-settings .simpay-panel-field-payment-method__restrictions-ach{margin-left:72px}#simpay-payment-form-settings .simpay-panel-field-payment-method__icon{border-radius:3px;overflow:hidden;margin:0 8px 0 5px;width:30px;height:30px;flex-shrink:0}#simpay-payment-form-settings .simpay-panel-field-payment-method__icon svg{width:30px;height:30px}#simpay-payment-form-settings .simpay-panel-field-payment-method__configure{display:flex;align-items:center;justify-content:center}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metaboxes:not(.is-empty),#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metaboxes:not(.is-empty){border:1px solid #ccd0d4;box-shadow:0 1px 1px rgba(0,0,0,.04);border-radius:4px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-handlediv,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-handlediv{display:none;float:right;width:36px;height:36px;margin:0;padding:0;border:0;background:none;cursor:pointer;display:block}#simpay-global-settings .simpay-metaboxes-wrapper .postbox.closed .simpay-handlediv .toggle-indicator:before,#simpay-form-settings .simpay-metaboxes-wrapper .postbox.closed .simpay-handlediv .toggle-indicator:before{content:""}#simpay-global-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv:focus,#simpay-form-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv:focus{outline:0}#simpay-global-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv:focus .toggle-indicator:before,#simpay-form-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv:focus .toggle-indicator:before{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}#simpay-global-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv .toggle-indicator:before,#simpay-form-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv .toggle-indicator:before{margin-top:4px;width:20px;border-radius:50%;text-indent:-1px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox{background:#fff;border:1px solid #ccd0d4;margin:0 -1px -1px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .hndle,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .hndle{border:0}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox select,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox select{font-weight:400}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox:first-of-type,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox:first-of-type{margin-top:-1px;border-top-left-radius:4px;border-top-right-radius:4px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox:last-of-type,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox:last-of-type{margin-bottom:-1px;border-bottom-left-radius:4px;border-bottom-right-radius:4px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox:last-of-type .simpay-metabox-content,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox:last-of-type .simpay-metabox-content{border-bottom-left-radius:4px;border-bottom-right-radius:4px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2{cursor:pointer;display:flex;align-items:center;padding:10px 0 10px 12px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .simpay-field-type,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .simpay-field-type{font-size:90%;color:gray;font-weight:normal;text-decoration:none;margin-left:10px}@media screen and (max-width: 782px){#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .simpay-field-type,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .simpay-field-type{display:none}}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .dashicons-handle,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .dashicons-handle{cursor:move}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 strong,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 strong{font-size:95%;margin-left:8px;display:flex;align-items:center;flex-grow:1}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 svg,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 svg{border-radius:3px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 select,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 select{font-family:sans-serif;max-width:20%;margin:.25em .25em .25em 0}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2.fixed,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2.fixed{cursor:pointer !important}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .dashicons-menu,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .dashicons-menu{cursor:move}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions{padding:9px 18px;justify-content:space-between;display:flex;align-items:center}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id{display:flex;align-items:center}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id input,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id input{margin:0 2px 0 5px;width:50px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id a,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id a{text-decoration:none}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .button-link.simpay-remove-field-link,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .button-link.simpay-remove-field-link{color:#a00}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .button-link.simpay-remove-field-link:hover,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .button-link.simpay-remove-field-link:hover{color:#dc3232}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox table,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox table{border-spacing:0;width:100%}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox table.simpay-inner-table,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox table.simpay-inner-table{border:none;padding:0 1em}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox table tr td,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox table tr td{border-bottom-color:#ccd0d4}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-remove-plan,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-remove-plan{color:#a00}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-custom-field-payment-button .dashicons-menu,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-custom-field-payment-button .dashicons-menu{visibility:hidden}#simpay-global-settings .sortable-placeholder,#simpay-form-settings .sortable-placeholder{margin:5px;display:block;min-height:36px}#simpay-global-settings .chosen-container,#simpay-form-settings .chosen-container{min-width:20em;max-width:30em}#simpay-global-settings .simpay-field.simpay-small-text,#simpay-form-settings .simpay-field.simpay-small-text{width:7em}#simpay-global-settings .simpay-field.simpay-medium-text,#simpay-form-settings .simpay-field.simpay-medium-text{width:15em}#simpay-global-settings .simpay-field-radios ul,#simpay-form-settings .simpay-field-radios ul{margin:0}#simpay-global-settings .simpay-field-radios>i,#simpay-form-settings .simpay-field-radios>i{margin-left:5px;vertical-align:middle}#simpay-global-settings ul.simpay-field-radios-inline,#simpay-form-settings ul.simpay-field-radios-inline{margin:0 0 -10px}#simpay-global-settings ul.simpay-field-radios-inline li,#simpay-form-settings ul.simpay-field-radios-inline li{display:inline-block;margin:0 10px 10px 0}#simpay-global-settings ul.simpay-field-radios-inline li:last-child,#simpay-form-settings ul.simpay-field-radios-inline li:last-child{margin-right:0}#simpay-global-settings .simpay-currency-field,#simpay-form-settings .simpay-currency-field{display:flex;align-items:center}>#simpay-global-settings .simpay-currency-field:focus,>#simpay-form-settings .simpay-currency-field:focus{position:relative;z-index:5}#simpay-global-settings .simpay-currency-symbol,#simpay-form-settings .simpay-currency-symbol{margin:0;padding-left:8px;padding-right:8px;line-height:28px;font-size:14px}@media screen and (max-width: 782px){#simpay-global-settings .simpay-currency-symbol,#simpay-form-settings .simpay-currency-symbol{line-height:38px}}#simpay-global-settings .simpay-currency-symbol-left,#simpay-form-settings .simpay-currency-symbol-left{border-top-left-radius:4px;border-bottom-left-radius:4px}#simpay-global-settings .simpay-currency-symbol-right,#simpay-form-settings .simpay-currency-symbol-right{border-top-right-radius:4px;border-bottom-right-radius:4px}#simpay-global-settings div.simpay-currency-symbol,#simpay-form-settings div.simpay-currency-symbol{border-color:#7e8993;border-style:solid;background-color:#fff}#simpay-global-settings select.simpay-currency-symbol,#simpay-form-settings select.simpay-currency-symbol{padding-right:25px}#simpay-global-settings .simpay-currency-symbol-left,#simpay-form-settings .simpay-currency-symbol-left{border-width:1px 0 1px 1px}#simpay-global-settings .simpay-currency-symbol-left+.simpay-field-amount,#simpay-form-settings .simpay-currency-symbol-left+.simpay-field-amount{border-radius:0 4px 4px 0}#simpay-global-settings .simpay-currency-symbol-right,#simpay-form-settings .simpay-currency-symbol-right{border-width:1px 1px 1px 0}#simpay-global-settings .simpay-field-amount,#simpay-form-settings .simpay-field-amount{margin:0;padding-left:8px;padding-right:8px;font-size:14px;width:6em;position:relative;z-index:2;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px}#simpay-global-settings .simpay-error,#simpay-form-settings .simpay-error{color:red}#simpay-global-settings .simpay-docs-link-wrap,#simpay-form-settings .simpay-docs-link-wrap{position:absolute;right:0;bottom:0;color:#666;font-size:13px;font-style:italic;padding:15px 18px}#simpay-global-settings .simpay-docs-link-wrap a .dashicons-editor-help,#simpay-form-settings .simpay-docs-link-wrap a .dashicons-editor-help{color:#666;text-decoration:none;width:17px;height:17px;font-size:17px;padding-left:4px}#simpay-global-settings .simpay-docs-icon,#simpay-form-settings .simpay-docs-icon{color:#666}#simpay-global-settings .simpay-docs-icon,#simpay-global-settings .simpay-docs-icon .dashicons-editor-help,#simpay-form-settings .simpay-docs-icon,#simpay-form-settings .simpay-docs-icon .dashicons-editor-help{text-decoration:none;width:17px;height:17px;font-size:17px}.button.button-primary.simpay-upgrade-btn{background-color:#428bca;border:1px solid #428bca;color:#fff;display:inline-block}.button.button-primary.simpay-upgrade-btn:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px #2d6ca2}.button.button-primary.simpay-upgrade-btn:hover{background-color:#037ad0;border:1px solid #428bca}.simpay-upgrade-btn-subtext{color:#3c434a;font-size:14px;line-height:1.5;text-align:center;margin:40px 0 0;padding:30px 35px 20px;background-color:#fcf9e8;border:3px solid #ebe29a;border-radius:4px;position:relative}.simpay-upgrade-btn-subtext svg{background:#00a32a;fill:#fff;border-radius:50%;border:3px solid #ebe29a;width:28px;height:28px;position:absolute;top:-14px;left:50%;margin-left:-14px}.simpay-upgrade-btn-subtext u{text-decoration:none;font-weight:bold;color:#00a32a}.simpay-upgrade-btn-subtext a{text-decoration:none;display:block;margin-top:6px;font-weight:bold}.post-type-simple-pay #post-body-content{display:none}.simpay-card{margin:0 0 20px;padding:30px;background:#fff;border:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04)}.simpay-card,.simpay-card p{line-height:1.5;font-size:16px}.simpay-card h3{line-height:1.6;font-size:18px;margin:0 0 20px;color:#23282c}.simpay-card p{margin:0 0 20px}.simpay-card p:last-child,.simpay-card ul:last-child{margin-bottom:0}.simpay-card figure{float:right;margin:0 0 30px 30px;max-width:400px}.simpay-card figure iframe,.simpay-card figure img{max-width:100%}.simpay-card figure figcaption{text-align:center}@media screen and (max-width: 782px){.simpay-card figure{margin:0 0 30px;max-width:100%;float:none}}.simpay-doc-suggestions{width:100%;display:flex;flex-wrap:wrap;padding:0}.simpay-doc-suggestion{text-align:center;display:flex;flex-direction:column;justify-content:center;align-items:center;flex:0 1 33.333%;padding:30px;border-right:1px solid #c3c4c7;box-sizing:border-box}.simpay-doc-suggestion:nth-child(3n){border-right:0}@media screen and (max-width: 782px){.simpay-doc-suggestion{flex:0 1 100%;border-bottom:1px solid #c3c4c7;border-right:0}.simpay-doc-suggestion:last-child{border-bottom:0}}.simpay-doc-suggestion h3{font-size:20px;margin-bottom:10px}.simpay-doc-suggestion p{font-size:15px}.simpay-doc-suggestion .dashicons{font-size:40px;width:40px;height:40px;display:block;margin-bottom:10px}.simpay-doc-suggestion .button-large{font-size:16px}.simpay-addons{display:flex;flex-wrap:wrap;justify-content:space-between;margin:20px 0}.simpay-addon{background:#fff;border:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04);margin-bottom:20px;display:flex;flex-direction:column;flex-basis:calc(33% - 10px);box-sizing:border-box}@media screen and (max-width: 782px){.simpay-addon{flex-basis:100%}}.simpay-addon img{float:left;max-width:75px}.simpay-addon h5{margin:0 0 10px 100px;font-size:16px}.simpay-addon__details{padding:20px;flex:1 0 auto}.simpay-addon__actions{display:flex;align-items:center;justify-content:space-between;flex:0 1 auto;background-color:#f7f7f7;border-top:1px solid #ddd;margin-top:auto;padding:20px;position:relative}.simpay-addon__actions .msg{text-align:center;justify-content:center;display:flex;align-items:center;position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;background-color:#f7f7f7;z-index:3}.simpay-addon .error,.simpay-addon .status-label.status-installed{color:#d63638}.simpay-addon .success,.simpay-addon .status-label.status-active{color:#00a32a}.simpay-addon .addon-desc{margin:0 0 0 100px}.form-table td .simpay-stripe-connect-help{margin:15px 0;display:flex;align-items:center}.form-table td .simpay-stripe-connect-help .dashicons{margin-right:4px}.simpay-currency-field{display:flex;align-items:center}>.simpay-currency-field:focus{position:relative;z-index:5}.simpay-currency-symbol{margin:0;padding-left:8px;padding-right:8px;line-height:28px;font-size:14px}@media screen and (max-width: 782px){.simpay-currency-symbol{line-height:38px}}.simpay-currency-symbol-left{border-top-left-radius:4px;border-bottom-left-radius:4px}.simpay-currency-symbol-right{border-top-right-radius:4px;border-bottom-right-radius:4px}div.simpay-currency-symbol{border-color:#7e8993;border-style:solid;background-color:#fff}select.simpay-currency-symbol{padding-right:25px}.simpay-currency-symbol-left{border-width:1px 0 1px 1px}.simpay-currency-symbol-left+.simpay-field-amount{border-radius:0 4px 4px 0}.simpay-currency-symbol-right{border-width:1px 1px 1px 0}.simpay-field-amount{margin:0;padding-left:8px;padding-right:8px;font-size:14px;width:6em;position:relative;z-index:2;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px}.simpay-template-explorer-open .show-settings{display:none !important}.simpay-branding-bar{margin:0 -20px;padding:14px 22px;background:#fff;border-bottom:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04);width:calc(100% + 20px);display:flex;justify-content:space-between;box-sizing:border-box}.site-health .simpay-branding-bar{display:none}.simpay-branding-bar__title{display:flex;align-items:center;margin:8px 0}.simpay-branding-bar__logo{width:200px}.simpay-branding-bar__divider{color:#dadbdf;font-size:23px;font-weight:400;margin:0 15px}.simpay-branding-bar__actions{display:flex;align-items:center}.simpay-branding-bar__actions>div{margin-left:10px;min-width:40px}.simpay-branding-bar__actions-button{color:#000;cursor:pointer;padding:10px;width:40px;height:40px;background-color:#f3f4f5;border-radius:50%;border:0;box-shadow:none;position:relative;transition:background-color .2s ease;box-sizing:border-box;display:block}.simpay-branding-bar__actions-button:hover{background-color:#e5e5e5}.simpay-branding-bar__actions-button:active,.simpay-branding-bar__actions-button:focus{box-shadow:0 0 0 2px var(--wp-admin-theme-color)}.simpay-branding-bar__actions-button-count{font-weight:600;font-size:10px;line-height:16px;color:#fff;margin:0;background-color:#df2a4a;border-radius:100%;width:16px;height:16px;position:absolute;top:-8px;left:50%;margin-left:-8px}.simpay-branding-bar .wp-heading-inline{font-size:23px;font-weight:400;margin:0}.simpay-branding-bar .page-title-action{font-weight:600;font-size:13px;line-height:normal;cursor:pointer;text-shadow:none;text-decoration:none;margin-left:10px;padding:4px 8px;border:1px solid currentColor;border-radius:2px;background:#f6f7f7}.simpay-landing-zone{text-align:center;max-width:700px;margin:40px auto}.simpay-landing-zone__title{font-size:26px;font-weight:600;margin:0 0 1.5rem;padding:0}.simpay-landing-zone__subtitle{font-size:17px;color:#666;margin:.25rem 0}.simpay-landing-zone__subtitle strong{color:#444}.simpay-landing-zone section{margin:2rem 0}.simpay-landing-zone__empty-state-graphic img{width:425px}.simpay-landing-zone__screenshot>*{vertical-align:middle}.simpay-landing-zone__screenshot-img{display:inline-block;position:relative;width:315px;padding:5px;background-color:#fff;box-shadow:0px 2px 5px 0px rgba(0,0,0,.05);border-radius:3px}.simpay-landing-zone__screenshot-img img{max-width:100%;display:block}.simpay-landing-zone__screenshot-img .hover{position:absolute;opacity:0;height:calc(100% - 10px);width:calc(100% - 10px);top:0;left:0;border:5px solid #fff;background-color:rgba(0,0,0,.15);background-image:url(data:image/svg+xml;base64,PHN2ZyBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjojZmZmZmZmMDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCIgaGVpZ2h0PSIxMDAiPjxwYXRoIGQ9Ik01MCAwYzI3LjYxNCAwIDUwIDIyLjM4NiA1MCA1MHMtMjIuMzg2IDUwLTUwIDUwUzAgNzcuNjE0IDAgNTAgMjIuMzg2IDAgNTAgMHoiIGZpbGw9IiMxNjg1YjciLz48cGF0aCBkPSJNNzMuMDIzIDY3LjA2N2wtOS4zNDQtOS4zNDRhMi4yNDcgMi4yNDcgMCAwMC0xLjU5My0uNjU2aC0xLjUyOGExOS4zOTkgMTkuMzk5IDAgMDA0LjEyNC0xMS45OTZjMC0xMC43Ny04LjcyNS0xOS40OTUtMTkuNDk0LTE5LjQ5NS0xMC43NjggMC0xOS40OTQgOC43MjYtMTkuNDk0IDE5LjQ5NSAwIDEwLjc2OCA4LjcyNiAxOS40OTMgMTkuNDk0IDE5LjQ5M2ExOS40IDE5LjQgMCAwMDExLjk5Ny00LjEyM3YxLjUyN2MwIC42LjIzNCAxLjE3Mi42NTUgMS41OTRsOS4zNDQgOS4zNDRhMi4yNCAyLjI0IDAgMDAzLjE3OCAwbDIuNjUyLTIuNjUzYTIuMjYgMi4yNiAwIDAwLjAxLTMuMTg2em0tMjcuODM1LTEwYy02LjYyNiAwLTExLjk5Ni01LjM2MS0xMS45OTYtMTEuOTk2IDAtNi42MjcgNS4zNi0xMS45OTcgMTEuOTk2LTExLjk5NyA2LjYyNiAwIDExLjk5NyA1LjM2MSAxMS45OTcgMTEuOTk3IDAgNi42MjYtNS4zNjEgMTEuOTk2LTExLjk5NyAxMS45OTZ6IiBmaWxsPSIjZmZmIi8+PC9zdmc+);background-repeat:no-repeat;background-position:center;background-size:50px;transition:all .3s}.simpay-landing-zone__screenshot-img:hover .hover{opacity:1;transition:all .3s}.simpay-landing-zone__screenshot ul{text-align:left;display:inline-block;margin:0 0 0 30px;list-style-type:none;max-width:calc(100% - 350px)}@media screen and (max-width: 782px){.simpay-landing-zone__screenshot ul{text-align:center;margin:30px auto;max-width:100%;display:block}}.simpay-landing-zone__screenshot li{margin:16px 0;padding:0;font-size:15px;color:#777;position:relative}.simpay-landing-zone__screenshot li:before{content:"";background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGQ9Ik0xMy43NzYyIDYuNDU2MDVMOC43MjAzMiAxLjQwMDA1QzguNTc1OTkgMS4yNTU3MiA4LjM4MzY0IDEuMTc2NSA4LjE3ODUzIDEuMTc2NUM3Ljk3MzIgMS4xNzY1IDcuNzgwOTYgMS4yNTU4NCA3LjYzNjY0IDEuNDAwMDVMNy4xNzc2IDEuODU5MkM3LjAzMzM5IDIuMDAzMjkgNi45NTM5NSAyLjE5NTc2IDYuOTUzOTUgMi40MDA5OEM2Ljk1Mzk1IDIuNjA2MDggNy4wMzMzOSAyLjgwNTA0IDcuMTc3NiAyLjk0OTE0TDEwLjEyNzEgNS45MDUxNkgwLjc1NjMzNEMwLjMzMzgzNCA1LjkwNTE2IDAgNi4yMzU5MiAwIDYuNjU4NTRWNy4zMDc2NUMwIDcuNzMwMjcgMC4zMzM4MzQgOC4wOTQzOCAwLjc1NjMzNCA4LjA5NDM4SDEwLjE2MDZMNy4xNzc3MiAxMS4wNjY5QzcuMDMzNTEgMTEuMjExMiA2Ljk1NDA2IDExLjM5ODUgNi45NTQwNiAxMS42MDM3QzYuOTU0MDYgMTEuODA4NyA3LjAzMzUxIDExLjk5ODYgNy4xNzc3MiAxMi4xNDI4TDcuNjM2NzUgMTIuNjAwNUM3Ljc4MTA3IDEyLjc0NDggNy45NzMzMiAxMi44MjM1IDguMTc4NjUgMTIuODIzNUM4LjM4Mzc1IDEyLjgyMzUgOC41NzYxMSAxMi43NDM4IDguNzIwNDMgMTIuNTk5NUwxMy43NzYzIDcuNTQzNkMxMy45MjEgNy4zOTg4MiAxNC4wMDA1IDcuMjA1NTYgMTQgNy4wMDAxMUMxNC4wMDA0IDYuNzkzOTggMTMuOTIxIDYuNjAwNiAxMy43NzYyIDYuNDU2MDVWNi40NTYwNVoiIGZpbGw9IiM0MjhCQ0EiLz4NCjwvc3ZnPg0K);background-position:center;background-repeat:no-repeat;background-size:14px;width:14px;height:14px;display:inline-block;margin:-3px 5px 0 0;vertical-align:middle}.simpay-landing-zone .button.button-large{font-size:17px;line-height:30px;padding:10px 20px}.simpay-landing-zone__purchased{display:block;margin:15px 0 0}.simpay-upgrade-modal,.simpay-upgrade-upe-modal{padding:0 !important}.simpay-upgrade-modal *,.simpay-upgrade-upe-modal *{box-sizing:border-box}.simpay-upgrade-modal__content,.simpay-upgrade-upe-modal__content{text-align:center;display:flex;flex-direction:column;align-items:center;padding:16px 32px 32px}.simpay-upgrade-modal__content>.dashicons,.simpay-upgrade-upe-modal__content>.dashicons{color:#333;font-size:48px;width:48px;height:48px}.simpay-upgrade-modal__title,.simpay-upgrade-upe-modal__title{font-size:22px;line-height:1.5;display:block;margin:12px 0 0}.simpay-upgrade-modal__description,.simpay-upgrade-upe-modal__description{color:#777;font-size:16px;margin:16px 0 24px}.simpay-upgrade-modal__description strong,.simpay-upgrade-upe-modal__description strong{color:#333}.simpay-upgrade-modal__discount,.simpay-upgrade-upe-modal__discount{font-size:15px;text-align:center;margin:32px -32px -32px;padding:24px 40px;background-color:#fcf9e8;position:relative}.simpay-upgrade-modal__discount svg,.simpay-upgrade-upe-modal__discount svg{background:#00a32a;fill:#fff;border-radius:50%;border:4px solid #fff;width:32px;height:32px;position:absolute;top:-16px;left:50%;margin-left:-16px}.simpay-upgrade-modal__discount u,.simpay-upgrade-upe-modal__discount u{text-decoration:none;font-weight:bold;color:#00a32a}.simpay-upgrade-modal .button-large,.simpay-upgrade-upe-modal .button-large{font-size:16px;font-weight:bold;margin:0 0 15px;padding:8px 30px !important;height:auto}.simpay-teaser-float{margin:50px;position:relative}.simpay-teaser-float__card{text-align:center;padding:30px;background:#fff;border-radius:4px;box-shadow:0 0 30px 15px rgba(0,0,0,.18);position:relative;z-index:2}#poststuff .simpay-teaser-float h2,.simpay-teaser-float h2{font-size:24px;font-weight:600;margin:0;padding:0}.simpay-teaser-float p{font-size:15px;line-height:1.35;color:#666}.simpay-teaser-float p strong{color:#444}.simpay-teaser-float ul{text-align:left;display:inline-block;margin:-10px 0 20px;list-style-type:none}.simpay-teaser-float li{margin:16px 0;padding:0 0 0 24px;font-size:15px;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGQ9Ik0xMy43NzYyIDYuNDU2MDVMOC43MjAzMiAxLjQwMDA1QzguNTc1OTkgMS4yNTU3MiA4LjM4MzY0IDEuMTc2NSA4LjE3ODUzIDEuMTc2NUM3Ljk3MzIgMS4xNzY1IDcuNzgwOTYgMS4yNTU4NCA3LjYzNjY0IDEuNDAwMDVMNy4xNzc2IDEuODU5MkM3LjAzMzM5IDIuMDAzMjkgNi45NTM5NSAyLjE5NTc2IDYuOTUzOTUgMi40MDA5OEM2Ljk1Mzk1IDIuNjA2MDggNy4wMzMzOSAyLjgwNTA0IDcuMTc3NiAyLjk0OTE0TDEwLjEyNzEgNS45MDUxNkgwLjc1NjMzNEMwLjMzMzgzNCA1LjkwNTE2IDAgNi4yMzU5MiAwIDYuNjU4NTRWNy4zMDc2NUMwIDcuNzMwMjcgMC4zMzM4MzQgOC4wOTQzOCAwLjc1NjMzNCA4LjA5NDM4SDEwLjE2MDZMNy4xNzc3MiAxMS4wNjY5QzcuMDMzNTEgMTEuMjExMiA2Ljk1NDA2IDExLjM5ODUgNi45NTQwNiAxMS42MDM3QzYuOTU0MDYgMTEuODA4NyA3LjAzMzUxIDExLjk5ODYgNy4xNzc3MiAxMi4xNDI4TDcuNjM2NzUgMTIuNjAwNUM3Ljc4MTA3IDEyLjc0NDggNy45NzMzMiAxMi44MjM1IDguMTc4NjUgMTIuODIzNUM4LjM4Mzc1IDEyLjgyMzUgOC41NzYxMSAxMi43NDM4IDguNzIwNDMgMTIuNTk5NUwxMy43NzYzIDcuNTQzNkMxMy45MjEgNy4zOTg4MiAxNC4wMDA1IDcuMjA1NTYgMTQgNy4wMDAxMUMxNC4wMDA0IDYuNzkzOTggMTMuOTIxIDYuNjAwNiAxMy43NzYyIDYuNDU2MDVWNi40NTYwNVoiIGZpbGw9IiM0MjhCQ0EiLz4NCjwvc3ZnPg0K);background-position:left 3px;background-repeat:no-repeat;background-size:14px;color:#777}.simpay-teaser-float .button.button-large{font-size:17px;line-height:30px;padding:10px 20px}.simpay-teaser-float .simpay-notice-dismiss{position:absolute;top:0;right:0;font-size:20px;color:#666;font-weight:bold;text-decoration:none;margin-left:5px;padding:6px 10px;z-index:2}.simpay-teaser-float .simpay-notice-dismiss:hover,.simpay-teaser-float .simpay-notice-dismiss:active,.simpay-teaser-float .simpay-notice-dismiss:focus{color:#666;text-decoration:none}.simpay-teaser-float:after,.simpay-teaser-float:before{opacity:.75;z-index:0;content:"";position:absolute;left:-30px;right:-30px;top:-35px;width:calc(100% + 60px);height:170px;background-image:linear-gradient(#ddd, #ddd),linear-gradient(#eee, #eee),linear-gradient(#ddd, #ddd),linear-gradient(#eee, #eee);background-repeat:no-repeat;background-size:100% 20px,100% 40px,100% 20px,100% 40px;background-position:0 0,0 30px,0 100px,0 130px}.simpay-teaser-float:before{top:170px}.simpay-teaser-float .simpay-upgrade-btn-subtext{margin:24px -30px -30px;padding:32px 40px;border-bottom-left-radius:2px;border-bottom-right-radius:2px;border:0}.simpay-teaser-float .simpay-upgrade-btn-subtext svg{border-color:#fff}.simpay-teaser-float--inline{margin:40px 30px 30px}.simpay-teaser-float--inline .simpay-teaser-float__card{padding:30px;box-shadow:0 0 12px 6px rgba(0,0,0,.16)}#poststuff .simpay-teaser-float--inline h2,.simpay-teaser-float--inline h2{font-size:20px}.simpay-teaser-float--inline p{font-size:15px;margin:.75rem 0}.simpay-teaser-float--inline .button.button-large{font-size:15px;line-height:24px;margin:1rem 0;padding:8px 14px;display:inline-block}.simpay-teaser-float--inline:before,.simpay-teaser-float--inline:after{opacity:.6}.simpay-teaser-float--inline:before{display:none}.simpay-teaser-float--inline:after{top:15px}.simpay-form-settings-notice{font-weight:normal;color:#1d2327;position:relative;margin:18px 18px 0;padding:14px;border-radius:4px;background:#f5f5ff}.simpay-form-settings-notice a{color:#635aff}.simpay-form-settings-notice .simpay-external-link .dashicons-external{margin:1px 0 0 2px}.simpay-form-settings-notice strong{font-size:14px}.simpay-form-settings-notice p{margin:5px 0 0 23px}.simpay-form-settings-notice .simpay-notice-dismiss{font-size:20px;color:#b0b0f0;font-weight:bold;line-height:1;position:absolute;top:0;right:5px;text-decoration:none;padding:0 5px;z-index:2}.simpay-form-settings-notice .simpay-notice-dismiss:hover,.simpay-form-settings-notice .simpay-notice-dismiss:active,.simpay-form-settings-notice .simpay-notice-dismiss:focus{color:#9191ef;text-decoration:none;background:none}.simpay-settings .simpay-form-settings-notice{border:2px solid #645aff;box-shadow:0 1px 1px rgba(0,0,0,.04)}.post-type-simple-pay .lity{z-index:999999999;padding:20px}.post-type-simple-pay .lity-close{margin:10px}.post-type-simple-pay .lity-content{max-width:80vw;max-height:80vh}.post-type-simple-pay .lity-content img{max-height:80vh !important;max-width:80vw !important}#wpsp-api-keys-row-hide{display:none}.post-type-simple-pay #post-preview:not(.simpay-preview-button){display:none}.simpay-license-field-wrapper{margin:20px 0}#simpay-settings-license-key-license-key{margin:0}#simpay-settings-license-key-license-key[readonly]{background:#fff}.simpay-license-message__loading,.simpay-license-field{display:flex;align-items:center}.wp-core-ui .button.simpay-license-button.button-primary,.wp-core-ui .button.simpay-license-button.button-secondary{font-size:1rem;line-height:1;margin:0 8px;padding:13px}.simpay-license-message{font-size:15px;margin-top:8px}.simpay-license-message--valid{color:#15803d}.simpay-license-message--invalid{color:#b91c1c}.simpay-recaptcha-payment-form-feedback .dashicons{margin-top:-1px;display:inline-block}.simpay-recaptcha-payment-form-feedback .dashicons-update-alt{animation:rotation 2s infinite linear}.simpay-form-builder-inset-settings{margin:3px 0 0 24px}fieldset.simpay-form-builder-inset-settings>*:not(legend){margin:5px 0 8px}.simpay-form-builder-inset-settings>*:last-child{margin-bottom:0}.simpay-form-builder-inventory-control{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;padding:6px 8px;box-shadow:0 0 0 rgba(0,0,0,0);transition:box-shadow .1s linear;border-radius:2px;border:1px solid #757575;font-size:16px;line-height:normal;margin:0;padding:0;width:auto;display:inline-flex;align-items:center}@media(prefers-reduced-motion: reduce){.simpay-form-builder-inventory-control{transition-duration:0s;transition-delay:0s}}@media(min-width: 600px){.simpay-form-builder-inventory-control{font-size:13px;line-height:normal}}.simpay-form-builder-inventory-control:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid rgba(0,0,0,0)}.simpay-form-builder-inventory-control::-webkit-input-placeholder{color:rgba(30,30,30,.62)}.simpay-form-builder-inventory-control::-moz-placeholder{opacity:1;color:rgba(30,30,30,.62)}.simpay-form-builder-inventory-control:-ms-input-placeholder{color:rgba(30,30,30,.62)}.simpay-form-builder-inventory-control:focus-within{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid rgba(0,0,0,0)}.simpay-form-builder-inventory-control input[type=number]{border:0;box-shadow:none;background:none;border-radius:0;width:75px}.simpay-form-builder-inventory-control input[type=number]:focus{border:0;box-shadow:none;outline:0}.simpay-form-builder-inventory-control+label{margin-left:8px}.simpay-form-builder-inventory-control__initial{color:#757575;font-size:16px;line-height:normal;padding-right:8px}@media(min-width: 600px){.simpay-form-builder-inventory-control__initial{font-size:13px;line-height:normal}}.simpay-form-builder-inventory-control__initial:before{content:"/";display:inline-block;vertical-align:top;margin-top:-1px}.simpay-form-builder-purchase-restrictions__restriction-item{display:flex;align-items:center;margin-top:8px;margin-bottom:8px}.simpay-form-builder-purchase-restrictions__restriction-item label{margin-left:8px}.simpay-form-builder-purchase-restrictions__restriction-item-datetime{display:flex;align-items:center}.simpay-form-builder-purchase-restrictions__restriction-item-datetime>*{margin-right:10px}.simpay-form-builder-purchase-restrictions__restriction-item-datetime span{color:#757575}.simpay-form-builder-fee-recovery__amounts{display:flex;align-items:center;margin-top:5px}.simpay-form-builder-fee-recovery ::-webkit-input-placeholder{color:#b7bec7}.simpay-form-builder-fee-recovery ::-moz-placeholder{color:#b7bec7;opacity:1}.simpay-form-builder-fee-recovery :-ms-input-placeholder{color:#b7bec7}.simpay-form-builder-fee-recovery>*{margin-right:8px}.simpay-form-builder-fee-percent-control{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;padding:6px 8px;box-shadow:0 0 0 rgba(0,0,0,0);transition:box-shadow .1s linear;border-radius:2px;border:1px solid #757575;font-size:16px;line-height:normal;margin:0;padding:0;width:auto;display:inline-flex;align-items:center}@media(prefers-reduced-motion: reduce){.simpay-form-builder-fee-percent-control{transition-duration:0s;transition-delay:0s}}@media(min-width: 600px){.simpay-form-builder-fee-percent-control{font-size:13px;line-height:normal}}.simpay-form-builder-fee-percent-control:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid rgba(0,0,0,0)}.simpay-form-builder-fee-percent-control::-webkit-input-placeholder{color:rgba(30,30,30,.62)}.simpay-form-builder-fee-percent-control::-moz-placeholder{opacity:1;color:rgba(30,30,30,.62)}.simpay-form-builder-fee-percent-control:-ms-input-placeholder{color:rgba(30,30,30,.62)}.simpay-form-builder-fee-percent-control:focus-within{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid rgba(0,0,0,0)}.simpay-form-builder-fee-percent-control input[type=number]{border:0;box-shadow:none;background:none;border-radius:0;width:75px}.simpay-form-builder-fee-percent-control input[type=number]:focus{border:0;box-shadow:none;outline:0}.simpay-form-builder-fee-percent-control+label{margin-left:8px}.simpay-form-builder-fee-percent-control__suffix{color:#757575;font-size:16px;line-height:normal;padding-right:8px}@media(min-width: 600px){.simpay-form-builder-fee-percent-control__suffix{font-size:13px;line-height:normal}}.simpay-form-builder-automations__cta{margin:24px 0 6px;text-align:center}.simpay-form-builder-automator{padding:16px 4px 26px !important}.simpay-form-builder-automator,.simpay-form-builder-automator *{box-sizing:border-box}.simpay-form-builder-automator input[type=search]{font-size:15px;padding:2px 8px}.simpay-form-builder-automator__integrations{display:grid;grid-template-columns:repeat(4, minmax(0, 1fr));grid-column-gap:16px;grid-row-gap:16px;margin:18px -18px 0;padding:0 18px 10px;width:calc(100% + 36px);max-height:400px;overflow-y:scroll}.simpay-form-builder-automator__integrations-integration{color:initial;text-align:center;text-decoration:none;background:#fff;border:1px solid #eee;border-radius:4px;box-shadow:0 1px 3px 0 rgba(0,0,0,.03);transition:all ease-in .15s}.simpay-form-builder-automator__integrations-integration img{display:block;margin:16px auto;height:50px}.simpay-form-builder-automator__integrations-integration span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:8px 16px;display:block;border-top:1px solid #eee}.simpay-form-builder-automator__integrations-integration:hover{cursor:pointer;border-color:#ddd;box-shadow:0 2px 4px 0 rgba(0,0,0,.06)}body.site-health #wpbody-content,body.post-type-simple-pay #wpbody-content{padding-bottom:200px}#wpfooter .simpay-footer-promotion{text-align:center;font-weight:400;font-size:13px;line-height:16px;color:#787c82;padding:20px 0 30px 0;margin-bottom:20px}#wpfooter .simpay-footer-promotion p{font-weight:600}#wpfooter .simpay-footer-promotion-links,#wpfooter .simpay-footer-promotion-social{display:flex;justify-content:center;align-items:center}#wpfooter .simpay-footer-promotion-links{margin:9px 0 0}#wpfooter .simpay-footer-promotion-links span{color:#c3c4c7;padding:0 7px}#wpfooter .simpay-footer-promotion-social{margin:10px 0 0 0;gap:10px}#wpfooter .simpay-footer-promotion-social li{margin-bottom:0}#wpfooter .simpay-footer-promotion-social li:hover path{fill:#50575e}#wpfooter .simpay-footer-promotion-social a{display:block;height:16px}.simpay-settings-is_upe td{background:#fff;border:1px solid #c3c4c7;border-left-width:4px;border-left-color:#2271b1;box-shadow:0 1px 1px rgba(0,0,0,.04);padding:12px 18px} +.simpay-settings-subsections{display:flex;align-items:center;box-shadow:inset 0 -1px 0 0 #ccc}.simpay-settings-subsections__subsection{font-weight:500;text-decoration:none;padding:15px;display:flex;align-items:center}.simpay-settings-subsections__subsection .dashicons{width:18px;height:18px;font-size:18px;margin-right:4px}.simpay-settings-subsections__subsection.is-active{box-shadow:inset 0 -4px 0 0 currentColor;position:relative;z-index:1}.simpay-settings-subsections__subsection:not(.is-active){color:#23282d}.simpay-settings form>h2:not(.nav-tab-wrapper){clip:rect(1px, 1px, 1px, 1px);height:1px;overflow:hidden;position:absolute !important;width:1px}.simpay-settings .form-table td fieldset+p,.simpay-settings .form-table td label+p,.simpay-settings .form-table td select+p,.simpay-settings .form-table td input+p{color:#666;font-style:italic}.simpay-settings .simpay-settings-subsections__subsection{display:flex;align-items:center}.simpay-settings .simpay-settings-subsections__subsection .simpay-settings-bubble{margin-left:5px}.simpay-settings .simpay-settings-visual-toggles{margin:30px 0 0;display:flex}.simpay-settings .simpay-settings-visual-toggles input[type=radio]{display:none}.simpay-settings .simpay-settings-visual-toggles__toggle{-webkit-user-select:none;-moz-user-select:none;user-select:none;min-width:180px;margin:0 30px 0 0 !important;position:relative;display:block;background-color:#fff;border-radius:4px;border:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04)}.simpay-settings .simpay-settings-visual-toggles__toggle:hover{border:1px solid #999;box-shadow:0 1px 2px rgba(0,0,0,.1)}.simpay-settings .simpay-settings-visual-toggles input[type=radio]:checked+.simpay-settings-visual-toggles__toggle{border-color:#007cba;border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px #007cba;box-shadow:0 0 0 1px var(--wp-admin-theme-color)}.simpay-settings .simpay-settings-visual-toggles__toggle-recommended,.simpay-settings .simpay-settings-visual-toggles__toggle-not-recommended{text-align:center;font-size:12px;text-transform:uppercase;font-weight:bold;margin:0;padding:5px 0;display:block;border-top-right-radius:4px;border-top-left-radius:4px}.simpay-settings .simpay-settings-visual-toggles__toggle-recommended{color:#0f8569;background:#f4f9f7}.simpay-settings .simpay-settings-visual-toggles__toggle-not-recommended{color:#b91c1b;background:#fef2f2}.simpay-settings .simpay-settings-visual-toggles__toggle-icon{margin:20px auto 15px;padding:0 15px;display:block}.simpay-settings .simpay-settings-visual-toggles__toggle-label{line-height:1.5;text-align:center;font-size:16px;font-weight:500;margin:15px;display:block}.simpay-settings .simpay-settings-visual-toggles__toggle-label small{color:#666;font-weight:normal;font-size:13px;line-height:1;display:block;margin:4px 0}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type .simpay-settings-visual-toggles__toggle{min-height:160px}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type .simpay-settings-visual-toggles__toggle-icon{width:80px;height:80px}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type input[type=radio].simpay-settings-captcha-type--is-recommended:checked+.simpay-settings-visual-toggles__toggle{border-color:#0f8569;box-shadow:0 0 0 1px #0f8569}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type input[type=radio].simpay-settings-captcha-type--is-not-recommended:checked+.simpay-settings-visual-toggles__toggle{border-color:#b91c1b;box-shadow:0 0 0 1px #b91c1b}.simpay-settings .simpay-settings-visual-toggles.simpay-settings-captcha-type label[for=simpay-settings-captcha-type-cloudflare-turnstile] .simpay-settings-visual-toggles__toggle-icon{width:120px}.simpay-settings-general-recaptcha-no_captcha_warning th,.simpay-settings-general-recaptcha-no_captcha_warning td,.simpay-settings-hcaptcha_secret_key th,.simpay-settings-hcaptcha_secret_key td,.simpay-settings-cloudflare_turnstile_secret_key th,.simpay-settings-cloudflare_turnstile_secret_key td,.simpay-settings-recaptcha_score_threshold th,.simpay-settings-recaptcha_score_threshold td{padding-bottom:50px !important}.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-summary-report,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-payment-confirmation,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-payment-notification,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-upcoming-invoice,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-manage-subscriptions,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-payment-processing-confirmation,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-payment-processing-notification,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-payment-refunded-confirmation,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-subscription-cancel-confirmation,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-subscription-cancel-notification,.simpay-settings .simpay-settings-subsections__subsection.simpay-settings-subsection-invoice-confirmation{display:none}.simpay-settings .simpay-settings-subsection-emails-tools{margin-left:auto}.simpay-admin-charts-period-over-period{position:relative;padding-bottom:12px}.simpay-admin-charts-period-over-period *{box-sizing:border-box}.simpay-admin-charts-period-over-period__tooltip{position:absolute;background:#fff;border:1px solid #c3c3c3;box-shadow:0 2px 6px rgba(0,0,0,.05);border-radius:2px;padding:10px 14px;display:flex;flex-direction:column;z-Index:10000;min-width:175px}.simpay-admin-charts-period-over-period__tooltip-data{white-space:nowrap;margin-bottom:8px;display:grid;grid-template-columns:1fr auto;grid-auto-rows:auto;-moz-column-gap:16px;column-gap:16px}.simpay-admin-charts-period-over-period__tooltip-data:last-child{margin-bottom:0}.simpay-admin-charts-period-over-period__tooltip-data[data-dataset="1"]{opacity:.65}.simpay-admin-charts-period-over-period__tooltip-data em{font-style:normal;text-align:right}.simpay-admin-charts-period-over-period__tooltip-delta{font-size:12px;margin:0 -14px -10px;padding:8px 14px;border-top:1px solid #eee;background:#fdfdfd;border-radius:2px;display:flex;align-items:center;justify-content:center}.simpay-admin-charts-period-over-period__tooltip-delta .simpay-admin-charts-badge{margin-right:4px}.simpay-admin-charts-period-over-period__tooltip-delta strong.is-positive{color:#006908}.simpay-admin-charts-period-over-period__tooltip-delta strong.is-negative{color:#b3093c}.simpay-admin-charts-badge{color:#2f2f2f;font-size:12px;font-weight:500;font-style:normal;line-height:1;padding:3px 6px;display:inline-flex;align-items:center;background:#f0f0f0;border-radius:100px}.simpay-admin-charts-badge.is-positive{color:#006908;background-color:#d7f7c2}.simpay-admin-charts-badge.is-negative{color:#b3093c;background-color:#ffe7f2}.simpay-admin-charts-badge__icon{width:15px;height:15px}.simpay-admin-charts-no-data{position:absolute;top:0;left:0;display:flex;justify-content:center;align-items:center;background:rgba(255,255,255,.5);z-index:2}.simpay-admin-charts-no-data>div{text-align:center;padding:24px;background:#fff;border:1px solid #c3c3c3;box-shadow:0 2px 6px rgba(0,0,0,.1);border-radius:2px;max-width:60%}.simpay-admin-charts-no-data strong{font-size:15px;margin-bottom:8px;display:block}.button.button-large.simpay-button-large{font-size:14px;line-height:30px;padding:4px 12px}.simpay-copy-hidden-input{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}.fixed .column-livemode{width:15%;text-align:right}@media screen and (max-width: 782px){.fixed .column-livemode{text-align:left}}.fixed .column-livemode .simpay-badge{margin-top:3px}.fixed .column-shortcode{width:25%}.fixed .column-shortcode .simpay-shortcode{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}.post-type-simple-pay .misc-pub-curtime,.post-type-simple-pay .misc-pub-visibility{display:none}.simpay-metabox-title{border:1px solid #eee}.simpay-shortcode-section{border-top:1px solid #ddd;border-width:1px 0;padding-top:15px;padding-bottom:15px;position:relative}.simpay-shortcode-section label{display:block;margin-bottom:6px}.simpay-shortcode-section label .dashicons{color:#8c8f94;margin-right:3px}.simpay-shortcode-section .simpay-copy-button{line-height:normal;position:absolute;right:20px;bottom:20px;border:0;background:none;box-shadow:none;padding:0}.simpay-shortcode-section .simpay-copy-button:hover{border:0;background:none;box-shadow:none}.simpay-shortcode-section .simpay-copy-button .dashicons{color:#3c434a}.simpay-shortcode{width:100%;padding:8px;line-height:1;margin:0;height:32px;resize:none}.simpay-badge{color:#3f3f46;text-align:center;line-height:1;padding:5px 7px;border-radius:3px;background:#e4e4e7;border:0;box-shadow:none;display:inline-flex;align-items:center}button.simpay-badge{cursor:pointer}button.simpay-badge:hover{background:#d4d4d8}.simpay-badge__icon{opacity:.8;margin:2px 5px 0 0}.simpay-badge--green{color:#0e6245;background:#cbf4c9}.simpay-badge--yellow{color:#983705;background:#f8e5b9}.simpay-stripe-account-info{display:flex;align-items:center;margin-bottom:8px;position:relative}.simpay-stripe-account-info .spinner{float:none;margin-top:0;margin-left:0}.simple-pay_page_simpay_settings .simpay-settings-upgrade,.post-type-simple-pay .simpay-settings-upgrade{margin-top:20px;padding:1px;position:relative;background:#fff;border-radius:4px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.2),0 5px 10px rgba(0,0,0,.1);max-width:677px}.simple-pay_page_simpay_settings .simpay-settings-upgrade__inner,.post-type-simple-pay .simpay-settings-upgrade__inner{text-align:center;margin:0;padding:30px}.simple-pay_page_simpay_settings .simpay-settings-upgrade h3,.post-type-simple-pay .simpay-settings-upgrade h3{line-height:1.5;font-size:22px;margin:0 0 1.5rem}.simple-pay_page_simpay_settings .simpay-settings-upgrade ul,.post-type-simple-pay .simpay-settings-upgrade ul{margin:1.5rem 0 calc(1.5rem - 6px);display:flex;flex-wrap:wrap;justify-content:center}@media screen and (min-width: 782px){.simple-pay_page_simpay_settings .simpay-settings-upgrade ul,.post-type-simple-pay .simpay-settings-upgrade ul{margin-left:4rem;margin-right:4rem}}.simple-pay_page_simpay_settings .simpay-settings-upgrade li,.post-type-simple-pay .simpay-settings-upgrade li{font-size:15px;margin:6px 0;width:100%}.simple-pay_page_simpay_settings .simpay-settings-upgrade li a,.post-type-simple-pay .simpay-settings-upgrade li a{color:#3c434a;text-decoration:none}.simple-pay_page_simpay_settings .simpay-settings-upgrade li a:hover,.post-type-simple-pay .simpay-settings-upgrade li a:hover{color:var(--wp-admin-theme-color);text-decoration:underline}@media screen and (min-width: 782px){.simple-pay_page_simpay_settings .simpay-settings-upgrade li,.post-type-simple-pay .simpay-settings-upgrade li{text-align:left;width:50%}}.simple-pay_page_simpay_settings .simpay-settings-upgrade .button.button-large,.post-type-simple-pay .simpay-settings-upgrade .button.button-large{font-size:17px;line-height:30px;padding:10px 20px}.simple-pay_page_simpay_settings .simpay-settings-upgrade small,.post-type-simple-pay .simpay-settings-upgrade small{color:#666;margin:15px 0 0;display:block}.simple-pay_page_simpay_settings .simpay-settings-upgrade .dashicons-yes,.post-type-simple-pay .simpay-settings-upgrade .dashicons-yes{color:#428bca}.simple-pay_page_simpay_settings .simpay-settings-upgrade .button-link,.post-type-simple-pay .simpay-settings-upgrade .button-link{position:absolute;top:0;right:0;font-size:20px;color:#666;font-weight:bold;text-decoration:none;margin-left:5px;padding:6px 10px;z-index:2}.simple-pay_page_simpay_settings .simpay-settings-upgrade .button-link:hover,.simple-pay_page_simpay_settings .simpay-settings-upgrade .button-link:active,.simple-pay_page_simpay_settings .simpay-settings-upgrade .button-link:focus,.post-type-simple-pay .simpay-settings-upgrade .button-link:hover,.post-type-simple-pay .simpay-settings-upgrade .button-link:active,.post-type-simple-pay .simpay-settings-upgrade .button-link:focus{color:#666;text-decoration:none}.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext{text-align:center;margin:0;padding:30px 20px 20px;background-color:#fcf9e8;border:1px solid #edeac9;border-width:1px 0 0;position:relative;border-radius:0;border-bottom-left-radius:4px;border-bottom-right-radius:4px}@media screen and (min-width: 782px){.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext{padding-left:4rem;padding-right:4rem}}.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext svg,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext svg{background:#00a32a;fill:#fff;border-radius:50%;border:4px solid #fff;box-shadow:0 0 0 1px #edeac9;width:28px;height:28px;position:absolute;top:-18px;left:50%;margin-left:-18px}.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext u,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext u{text-decoration:none;font-weight:bold;color:#00a32a}.simple-pay_page_simpay_settings .simpay-settings-upgrade .simpay-upgrade-btn-subtext a,.post-type-simple-pay .simpay-settings-upgrade .simpay-upgrade-btn-subtext a{font-weight:normal;display:inline-block}#simpay-payment-form-settings table{width:100%;border-collapse:collapse}#simpay-payment-form-settings ::-webkit-input-placeholder{color:#9ba1a9}#simpay-payment-form-settings ::-moz-placeholder{color:#9ba1a9;opacity:1}#simpay-payment-form-settings :-ms-input-placeholder{color:#9ba1a9}#simpay-payment-form-settings .inside{margin:0;padding:0}#simpay-payment-form-settings .simpay-panel-field .toolbar{margin-bottom:-4px}#simpay-payment-form-settings .simpay-panel-field .toolbar .simpay-field-select{margin:0 0 4px;width:auto;max-width:70%}#simpay-payment-form-settings .simpay-tabs{margin:0;padding:0;list-style:none;background:#fafafa;border-right:1px solid #ccd0d4;line-height:1em;position:relative;flex:0 0 25%}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-tabs{flex-basis:100%;flex-grow:1;border-right:0}}#simpay-payment-form-settings .simpay-tabs li{margin:0;padding:0}#simpay-payment-form-settings .simpay-tabs li:first-child{margin-top:12px}#simpay-payment-form-settings .simpay-tabs li:last-child{margin-bottom:20px}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-tabs li:last-child{margin-bottom:0}}#simpay-payment-form-settings .simpay-tabs li.active{margin-left:-1px;box-shadow:0 1px 1px rgba(0,0,0,.04);position:relative}#simpay-payment-form-settings .simpay-tabs li.active:focus:after{display:none}#simpay-payment-form-settings .simpay-tabs li.active:before,#simpay-payment-form-settings .simpay-tabs li.active:after{content:"";width:calc(100% + 1px);height:1px;background:#ccd0d4;position:absolute;top:0;left:0;right:0;z-index:2}#simpay-payment-form-settings .simpay-tabs li.active:after{top:auto;bottom:0}#simpay-payment-form-settings .simpay-tabs li.active a{font-weight:bold;background-color:#fff;position:relative;margin-right:-1px}#simpay-payment-form-settings .simpay-tabs li.active a:before{content:"";position:absolute;top:0;left:0;bottom:0;width:4px;height:100%;background:currentColor;z-index:3}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-tabs li.active a{margin-right:0}}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item{display:flex;align-items:center;line-height:20px;margin:0;padding:8px 10px 8px 14px;text-decoration:none;transition:all .05s ease-in-out}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item svg,#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item .dashicons{margin-right:6px}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item{padding:18px}}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item:focus{outline:0;position:relative;z-index:3;box-shadow:inset 0 0 0 1px currentColor,0 0 0 1px currentColor}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item[href="#purchase-restrictions-settings-panel"],#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item[href="#payment-page-settings-panel"]{margin-bottom:20px;position:relative}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item[href="#purchase-restrictions-settings-panel"]:after,#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item[href="#payment-page-settings-panel"]:after{content:"";position:absolute;left:14px;right:14px;bottom:-10px;width:calc(100% - 28px);height:1px;background:#eaeaea}#simpay-payment-form-settings .simpay-tabs li .simpay-tab-item span>span{color:#f18500;font-size:12px;font-weight:600;margin:0 0 0 5px;display:inline-block}#simpay-payment-form-settings .simpay-tabs li:not(.active) .simpay-tab-item{color:inherit}#simpay-payment-form-settings .simpay-panels-wrap{background:#fff;display:flex}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-panels-wrap{flex-direction:column}}#simpay-payment-form-settings .simpay-panels{flex:0 0 75%;display:flex}@media screen and (min-width: 1400px){#simpay-payment-form-settings .simpay-panels{flex-basis:75%}}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-panels{flex-basis:100%}}#simpay-payment-form-settings .simpay-panel,#simpay-payment-form-settings .simpay-panel-section{width:100%}#simpay-payment-form-settings .simpay-panel>table,#simpay-payment-form-settings .simpay-panel>table>tr,#simpay-payment-form-settings .simpay-panel>table>tbody,#simpay-payment-form-settings .simpay-panel>table>tbody>tr,#simpay-payment-form-settings .simpay-panel>table>thead,#simpay-payment-form-settings .simpay-panel>table>thead>tr{display:block;width:100%}#simpay-payment-form-settings .simpay-panel>table:last-child>tbody:last-child>tr:last-child>td{border-bottom:0}#simpay-payment-form-settings .simpay-panel-field--requires-upgrade{position:relative}#simpay-payment-form-settings .simpay-panel-field--requires-upgrade td>div{margin-right:80px}#simpay-payment-form-settings .simpay-panel-field--requires-upgrade td>div .button-small{position:absolute;top:calc(50% - 13px);right:18px}#simpay-payment-form-settings .simpay-panel-field,#simpay-payment-form-settings .simpay-panel-field>td,#simpay-payment-form-settings .simpay-panel-field>th{text-align:left;display:block}#simpay-payment-form-settings .simpay-panel-field>td,#simpay-payment-form-settings .simpay-panel-field>th{width:calc(100% - 36px);margin-left:18px;margin-right:18px}#simpay-payment-form-settings .simpay-panel-field th{font-weight:bold;padding-top:18px;padding-bottom:5px}#simpay-payment-form-settings .simpay-panel-field td{border-bottom:1px solid #ddd;padding-bottom:18px}#simpay-payment-form-settings .simpay-panel-field p.description{margin-top:4px}#simpay-payment-form-settings .simpay-panel-field p.description:last-of-type{margin-bottom:0}#simpay-payment-form-settings .simpay-panel-field .simpay-panel-field__nested{margin-top:18px}#simpay-payment-form-settings .simpay-panel-field .simpay-panel-field__nested label{font-weight:bold;display:block;margin-bottom:4px}#simpay-payment-form-settings .simpay-panel-field .simpay-field-select,#simpay-payment-form-settings .simpay-panel-field .simpay-field-text{min-width:75%;max-width:100%}@media screen and (max-width: 782px){#simpay-payment-form-settings .simpay-panel-field .simpay-field-select,#simpay-payment-form-settings .simpay-panel-field .simpay-field-text{min-width:0;width:100%}}#simpay-payment-form-settings .simpay-panel-field .simpay-field-textarea{width:100%;max-width:100%}#simpay-payment-form-settings .simpay-panel-field .notice:last-of-type{margin-bottom:0}#simpay-payment-form-settings .simpay-panel-field .error,#simpay-payment-form-settings .simpay-panel-field .simpay-important{color:#a94442;font-weight:normal}#simpay-payment-form-settings .simpay-panel-field .simpay-image-preview-wrap{position:relative;margin-top:12px}#simpay-payment-form-settings .simpay-panel-field .simpay-image-preview-wrap .simpay-remove-image-preview{position:absolute;top:-15px;left:-15px;cursor:pointer;background-color:#fff}#simpay-payment-form-settings .simpay-panel-field .simpay-image-preview-wrap .simpay-remove-image-preview::before{font-size:22px;line-height:26px}#simpay-payment-form-settings .simpay-panel-field .simpay-image-preview-wrap .simpay-image-preview{max-height:128px;max-width:128px;border:1px solid #ddd}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box{background-color:#f4f4f4;border:1px solid #e5e5e5;padding:18px;margin-top:18px;position:relative}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box__dismiss{color:inherit;text-decoration:none;position:absolute;top:8px;right:8px}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box__dismiss .dashicons-dismiss{font-size:16px;width:16px;height:16px}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box h3{font-size:18px;font-weight:600;margin:0;padding:0}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box p{font-size:14px}#simpay-payment-form-settings .simpay-panel .simpay-promo-under-box p:last-child{margin-bottom:0}#simpay-payment-form-settings .simpay-metabox-content{margin-bottom:-1px;background-color:#f5f5f5;border:1px solid #c3c4c7;border-width:1px 0;box-shadow:0 1px 1px rgba(0,0,0,.04);position:relative}#simpay-payment-form-settings .simpay-show-if,#simpay-payment-form-settings .simpay-panel-hidden{display:none}#simpay-payment-form-settings .simpay-payment-methods{border:1px solid #ccd0d4;border-radius:4px;box-shadow:0 1px 1px rgba(0,0,0,.04)}#simpay-payment-form-settings .simpay-panel-field-payment-method{display:block;border-top:1px solid #ccd0d4;padding:7px;box-sizing:border-box}#simpay-payment-form-settings .simpay-panel-field-payment-method:first-child{border-top:0;border-top-left-radius:4px;border-top-right-radius:4px}#simpay-payment-form-settings .simpay-panel-field-payment-method__enable{display:flex;align-items:center}#simpay-payment-form-settings .simpay-panel-field-payment-method__enable input[type=checkbox]{margin-top:0;margin-right:8px}#simpay-payment-form-settings .simpay-panel-field-payment-method__help{text-decoration:none}#simpay-payment-form-settings .simpay-panel-field-payment-method__help .dashicons{font-size:18px;width:18px;height:18px}#simpay-payment-form-settings .simpay-panel-field-payment-method__restrictions,#simpay-payment-form-settings .simpay-panel-field-payment-method__restrictions-ach{margin-left:72px}#simpay-payment-form-settings .simpay-panel-field-payment-method__icon{border-radius:3px;overflow:hidden;margin:0 8px 0 5px;width:30px;height:30px;flex-shrink:0}#simpay-payment-form-settings .simpay-panel-field-payment-method__icon svg{width:30px;height:30px}#simpay-payment-form-settings .simpay-panel-field-payment-method__configure{display:flex;align-items:center;justify-content:center}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metaboxes:not(.is-empty),#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metaboxes:not(.is-empty){border:1px solid #ccd0d4;box-shadow:0 1px 1px rgba(0,0,0,.04);border-radius:4px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-handlediv,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-handlediv{display:none;float:right;width:36px;height:36px;margin:0;padding:0;border:0;background:none;cursor:pointer;display:block}#simpay-global-settings .simpay-metaboxes-wrapper .postbox.closed .simpay-handlediv .toggle-indicator:before,#simpay-form-settings .simpay-metaboxes-wrapper .postbox.closed .simpay-handlediv .toggle-indicator:before{content:""}#simpay-global-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv:focus,#simpay-form-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv:focus{outline:0}#simpay-global-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv:focus .toggle-indicator:before,#simpay-form-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv:focus .toggle-indicator:before{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}#simpay-global-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv .toggle-indicator:before,#simpay-form-settings .simpay-metaboxes-wrapper .postbox .simpay-handlediv .toggle-indicator:before{margin-top:4px;width:20px;border-radius:50%;text-indent:-1px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox{background:#fff;border:1px solid #ccd0d4;margin:0 -1px -1px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .hndle,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .hndle{border:0}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox select,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox select{font-weight:400}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox:first-of-type,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox:first-of-type{margin-top:-1px;border-top-left-radius:4px;border-top-right-radius:4px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox:last-of-type,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox:last-of-type{margin-bottom:-1px;border-bottom-left-radius:4px;border-bottom-right-radius:4px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox:last-of-type .simpay-metabox-content,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox:last-of-type .simpay-metabox-content{border-bottom-left-radius:4px;border-bottom-right-radius:4px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2{cursor:pointer;display:flex;align-items:center;padding:10px 0 10px 12px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .simpay-field-type,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .simpay-field-type{font-size:90%;color:gray;font-weight:normal;text-decoration:none;margin-left:10px}@media screen and (max-width: 782px){#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .simpay-field-type,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .simpay-field-type{display:none}}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .dashicons-handle,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .dashicons-handle{cursor:move}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 strong,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 strong{font-size:95%;margin-left:8px;display:flex;align-items:center;flex-grow:1}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 svg,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 svg{border-radius:3px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 select,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 select{font-family:sans-serif;max-width:20%;margin:.25em .25em .25em 0}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2.fixed,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2.fixed{cursor:pointer !important}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .dashicons-menu,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox h2 .dashicons-menu{cursor:move}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions{padding:9px 18px;justify-content:space-between;display:flex;align-items:center}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id{display:flex;align-items:center}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id input,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id input{margin:0 2px 0 5px;width:50px}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id a,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-metabox-content-actions__field-id a{text-decoration:none}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .button-link.simpay-remove-field-link,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .button-link.simpay-remove-field-link{color:#a00}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .button-link.simpay-remove-field-link:hover,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .button-link.simpay-remove-field-link:hover{color:#dc3232}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox table,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox table{border-spacing:0;width:100%}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox table.simpay-inner-table,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox table.simpay-inner-table{border:none;padding:0 1em}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox table tr td,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox table tr td{border-bottom-color:#ccd0d4}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-remove-plan,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-metabox .simpay-remove-plan{color:#a00}#simpay-global-settings .simpay-metaboxes-wrapper .simpay-custom-field-payment-button .dashicons-menu,#simpay-form-settings .simpay-metaboxes-wrapper .simpay-custom-field-payment-button .dashicons-menu{visibility:hidden}#simpay-global-settings .sortable-placeholder,#simpay-form-settings .sortable-placeholder{margin:5px;display:block;min-height:36px}#simpay-global-settings .chosen-container,#simpay-form-settings .chosen-container{min-width:20em;max-width:30em}#simpay-global-settings .simpay-field.simpay-small-text,#simpay-form-settings .simpay-field.simpay-small-text{width:7em}#simpay-global-settings .simpay-field.simpay-medium-text,#simpay-form-settings .simpay-field.simpay-medium-text{width:15em}#simpay-global-settings .simpay-field-radios ul,#simpay-form-settings .simpay-field-radios ul{margin:0}#simpay-global-settings .simpay-field-radios>i,#simpay-form-settings .simpay-field-radios>i{margin-left:5px;vertical-align:middle}#simpay-global-settings ul.simpay-field-radios-inline,#simpay-form-settings ul.simpay-field-radios-inline{margin:0 0 -10px}#simpay-global-settings ul.simpay-field-radios-inline li,#simpay-form-settings ul.simpay-field-radios-inline li{display:inline-block;margin:0 10px 10px 0}#simpay-global-settings ul.simpay-field-radios-inline li:last-child,#simpay-form-settings ul.simpay-field-radios-inline li:last-child{margin-right:0}#simpay-global-settings .simpay-currency-field,#simpay-form-settings .simpay-currency-field{display:flex;align-items:center}>#simpay-global-settings .simpay-currency-field:focus,>#simpay-form-settings .simpay-currency-field:focus{position:relative;z-index:5}#simpay-global-settings .simpay-currency-symbol,#simpay-form-settings .simpay-currency-symbol{margin:0;padding-left:8px;padding-right:8px;line-height:28px;font-size:14px}@media screen and (max-width: 782px){#simpay-global-settings .simpay-currency-symbol,#simpay-form-settings .simpay-currency-symbol{line-height:38px}}#simpay-global-settings .simpay-currency-symbol-left,#simpay-form-settings .simpay-currency-symbol-left{border-top-left-radius:4px;border-bottom-left-radius:4px}#simpay-global-settings .simpay-currency-symbol-right,#simpay-form-settings .simpay-currency-symbol-right{border-top-right-radius:4px;border-bottom-right-radius:4px}#simpay-global-settings div.simpay-currency-symbol,#simpay-form-settings div.simpay-currency-symbol{border-color:#7e8993;border-style:solid;background-color:#fff}#simpay-global-settings select.simpay-currency-symbol,#simpay-form-settings select.simpay-currency-symbol{padding-right:25px}#simpay-global-settings .simpay-currency-symbol-left,#simpay-form-settings .simpay-currency-symbol-left{border-width:1px 0 1px 1px}#simpay-global-settings .simpay-currency-symbol-left+.simpay-field-amount,#simpay-form-settings .simpay-currency-symbol-left+.simpay-field-amount{border-radius:0 4px 4px 0}#simpay-global-settings .simpay-currency-symbol-right,#simpay-form-settings .simpay-currency-symbol-right{border-width:1px 1px 1px 0}#simpay-global-settings .simpay-field-amount,#simpay-form-settings .simpay-field-amount{margin:0;padding-left:8px;padding-right:8px;font-size:14px;width:6em;position:relative;z-index:2;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px}#simpay-global-settings .simpay-error,#simpay-form-settings .simpay-error{color:red}#simpay-global-settings .simpay-docs-link-wrap,#simpay-form-settings .simpay-docs-link-wrap{position:absolute;right:0;bottom:0;color:#666;font-size:13px;font-style:italic;padding:15px 18px}#simpay-global-settings .simpay-docs-link-wrap a .dashicons-editor-help,#simpay-form-settings .simpay-docs-link-wrap a .dashicons-editor-help{color:#666;text-decoration:none;width:17px;height:17px;font-size:17px;padding-left:4px}#simpay-global-settings .simpay-docs-icon,#simpay-form-settings .simpay-docs-icon{color:#666}#simpay-global-settings .simpay-docs-icon,#simpay-global-settings .simpay-docs-icon .dashicons-editor-help,#simpay-form-settings .simpay-docs-icon,#simpay-form-settings .simpay-docs-icon .dashicons-editor-help{text-decoration:none;width:17px;height:17px;font-size:17px}.button.button-primary.simpay-upgrade-btn{background-color:#428bca;border:1px solid #428bca;color:#fff;display:inline-block}.button.button-primary.simpay-upgrade-btn:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px #2d6ca2}.button.button-primary.simpay-upgrade-btn:hover{background-color:#037ad0;border:1px solid #428bca}.simpay-upgrade-btn-subtext{color:#3c434a;font-size:14px;line-height:1.5;text-align:center;margin:40px 0 0;padding:30px 35px 20px;background-color:#fcf9e8;border:3px solid #ebe29a;border-radius:4px;position:relative}.simpay-upgrade-btn-subtext svg{background:#00a32a;fill:#fff;border-radius:50%;border:3px solid #ebe29a;width:28px;height:28px;position:absolute;top:-14px;left:50%;margin-left:-14px}.simpay-upgrade-btn-subtext u{text-decoration:none;font-weight:bold;color:#00a32a}.simpay-upgrade-btn-subtext a{text-decoration:none;display:block;margin-top:6px;font-weight:bold}.post-type-simple-pay #post-body-content{display:none}.simpay-card{margin:0 0 20px;padding:30px;background:#fff;border:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04)}.simpay-card,.simpay-card p{line-height:1.5;font-size:16px}.simpay-card h3{line-height:1.6;font-size:18px;margin:0 0 20px;color:#23282c}.simpay-card p{margin:0 0 20px}.simpay-card p:last-child,.simpay-card ul:last-child{margin-bottom:0}.simpay-card figure{float:right;margin:0 0 30px 30px;max-width:400px}.simpay-card figure iframe,.simpay-card figure img{max-width:100%}.simpay-card figure figcaption{text-align:center}@media screen and (max-width: 782px){.simpay-card figure{margin:0 0 30px;max-width:100%;float:none}}.simpay-doc-suggestions{width:100%;display:flex;flex-wrap:wrap;padding:0}.simpay-doc-suggestion{text-align:center;display:flex;flex-direction:column;justify-content:center;align-items:center;flex:0 1 33.333%;padding:30px;border-right:1px solid #c3c4c7;box-sizing:border-box}.simpay-doc-suggestion:nth-child(3n){border-right:0}@media screen and (max-width: 782px){.simpay-doc-suggestion{flex:0 1 100%;border-bottom:1px solid #c3c4c7;border-right:0}.simpay-doc-suggestion:last-child{border-bottom:0}}.simpay-doc-suggestion h3{font-size:20px;margin-bottom:10px}.simpay-doc-suggestion p{font-size:15px}.simpay-doc-suggestion .dashicons{font-size:40px;width:40px;height:40px;display:block;margin-bottom:10px}.simpay-doc-suggestion .button-large{font-size:16px}.simpay-addons{display:flex;flex-wrap:wrap;justify-content:space-between;margin:20px 0}.simpay-addon{background:#fff;border:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04);margin-bottom:20px;display:flex;flex-direction:column;flex-basis:calc(33% - 10px);box-sizing:border-box}@media screen and (max-width: 782px){.simpay-addon{flex-basis:100%}}.simpay-addon img{float:left;max-width:75px}.simpay-addon h5{margin:0 0 10px 100px;font-size:16px}.simpay-addon__details{padding:20px;flex:1 0 auto}.simpay-addon__actions{display:flex;align-items:center;justify-content:space-between;flex:0 1 auto;background-color:#f7f7f7;border-top:1px solid #ddd;margin-top:auto;padding:20px;position:relative}.simpay-addon__actions .msg{text-align:center;justify-content:center;display:flex;align-items:center;position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;background-color:#f7f7f7;z-index:3}.simpay-addon .error,.simpay-addon .status-label.status-installed{color:#d63638}.simpay-addon .success,.simpay-addon .status-label.status-active{color:#00a32a}.simpay-addon .addon-desc{margin:0 0 0 100px}.form-table td .simpay-stripe-connect-help{margin:15px 0;display:flex;align-items:center}.form-table td .simpay-stripe-connect-help .dashicons{margin-right:4px}.simpay-currency-field{display:flex;align-items:center}>.simpay-currency-field:focus{position:relative;z-index:5}.simpay-currency-symbol{margin:0;padding-left:8px;padding-right:8px;line-height:28px;font-size:14px}@media screen and (max-width: 782px){.simpay-currency-symbol{line-height:38px}}.simpay-currency-symbol-left{border-top-left-radius:4px;border-bottom-left-radius:4px}.simpay-currency-symbol-right{border-top-right-radius:4px;border-bottom-right-radius:4px}div.simpay-currency-symbol{border-color:#7e8993;border-style:solid;background-color:#fff}select.simpay-currency-symbol{padding-right:25px}.simpay-currency-symbol-left{border-width:1px 0 1px 1px}.simpay-currency-symbol-left+.simpay-field-amount{border-radius:0 4px 4px 0}.simpay-currency-symbol-right{border-width:1px 1px 1px 0}.simpay-field-amount{margin:0;padding-left:8px;padding-right:8px;font-size:14px;width:6em;position:relative;z-index:2;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px}.simpay-template-explorer-open .show-settings{display:none !important}.simpay-branding-bar{margin:0 -20px;padding:14px 22px;background:#fff;border-bottom:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04);width:calc(100% + 20px);display:flex;justify-content:space-between;box-sizing:border-box}.site-health .simpay-branding-bar{display:none}.simpay-branding-bar__title{display:flex;align-items:center;margin:8px 0}.simpay-branding-bar__logo{width:200px}.simpay-branding-bar__divider{color:#dadbdf;font-size:23px;font-weight:400;margin:0 15px}.simpay-branding-bar__actions{display:flex;align-items:center}.simpay-branding-bar__actions>div{margin-left:10px;min-width:40px}.simpay-branding-bar__actions-button{color:#000;cursor:pointer;padding:10px;width:40px;height:40px;background-color:#f3f4f5;border-radius:50%;border:0;box-shadow:none;position:relative;transition:background-color .2s ease;box-sizing:border-box;display:block}.simpay-branding-bar__actions-button:hover{background-color:#e5e5e5}.simpay-branding-bar__actions-button:active,.simpay-branding-bar__actions-button:focus{box-shadow:0 0 0 2px var(--wp-admin-theme-color)}.simpay-branding-bar__actions-button-count{font-weight:600;font-size:10px;line-height:16px;color:#fff;margin:0;background-color:#df2a4a;border-radius:100%;width:16px;height:16px;position:absolute;top:-8px;left:50%;margin-left:-8px}.simpay-branding-bar .wp-heading-inline{font-size:23px;font-weight:400;margin:0}.simpay-branding-bar .page-title-action{font-weight:600;font-size:13px;line-height:normal;cursor:pointer;text-shadow:none;text-decoration:none;margin-left:10px;padding:4px 8px;border:1px solid currentColor;border-radius:2px;background:#f6f7f7}.simpay-landing-zone{text-align:center;max-width:700px;margin:40px auto}.simpay-landing-zone__title{font-size:26px;font-weight:600;margin:0 0 1.5rem;padding:0}.simpay-landing-zone__subtitle{font-size:17px;color:#666;margin:.25rem 0}.simpay-landing-zone__subtitle strong{color:#444}.simpay-landing-zone section{margin:2rem 0}.simpay-landing-zone__empty-state-graphic img{width:425px}.simpay-landing-zone__screenshot>*{vertical-align:middle}.simpay-landing-zone__screenshot-img{display:inline-block;position:relative;width:315px;padding:5px;background-color:#fff;box-shadow:0px 2px 5px 0px rgba(0,0,0,.05);border-radius:3px}.simpay-landing-zone__screenshot-img img{max-width:100%;display:block}.simpay-landing-zone__screenshot-img .hover{position:absolute;opacity:0;height:calc(100% - 10px);width:calc(100% - 10px);top:0;left:0;border:5px solid #fff;background-color:rgba(0,0,0,.15);background-image:url(data:image/svg+xml;base64,PHN2ZyBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjojZmZmZmZmMDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCIgaGVpZ2h0PSIxMDAiPjxwYXRoIGQ9Ik01MCAwYzI3LjYxNCAwIDUwIDIyLjM4NiA1MCA1MHMtMjIuMzg2IDUwLTUwIDUwUzAgNzcuNjE0IDAgNTAgMjIuMzg2IDAgNTAgMHoiIGZpbGw9IiMxNjg1YjciLz48cGF0aCBkPSJNNzMuMDIzIDY3LjA2N2wtOS4zNDQtOS4zNDRhMi4yNDcgMi4yNDcgMCAwMC0xLjU5My0uNjU2aC0xLjUyOGExOS4zOTkgMTkuMzk5IDAgMDA0LjEyNC0xMS45OTZjMC0xMC43Ny04LjcyNS0xOS40OTUtMTkuNDk0LTE5LjQ5NS0xMC43NjggMC0xOS40OTQgOC43MjYtMTkuNDk0IDE5LjQ5NSAwIDEwLjc2OCA4LjcyNiAxOS40OTMgMTkuNDk0IDE5LjQ5M2ExOS40IDE5LjQgMCAwMDExLjk5Ny00LjEyM3YxLjUyN2MwIC42LjIzNCAxLjE3Mi42NTUgMS41OTRsOS4zNDQgOS4zNDRhMi4yNCAyLjI0IDAgMDAzLjE3OCAwbDIuNjUyLTIuNjUzYTIuMjYgMi4yNiAwIDAwLjAxLTMuMTg2em0tMjcuODM1LTEwYy02LjYyNiAwLTExLjk5Ni01LjM2MS0xMS45OTYtMTEuOTk2IDAtNi42MjcgNS4zNi0xMS45OTcgMTEuOTk2LTExLjk5NyA2LjYyNiAwIDExLjk5NyA1LjM2MSAxMS45OTcgMTEuOTk3IDAgNi42MjYtNS4zNjEgMTEuOTk2LTExLjk5NyAxMS45OTZ6IiBmaWxsPSIjZmZmIi8+PC9zdmc+);background-repeat:no-repeat;background-position:center;background-size:50px;transition:all .3s}.simpay-landing-zone__screenshot-img:hover .hover{opacity:1;transition:all .3s}.simpay-landing-zone__screenshot ul{text-align:left;display:inline-block;margin:0 0 0 30px;list-style-type:none;max-width:calc(100% - 350px)}@media screen and (max-width: 782px){.simpay-landing-zone__screenshot ul{text-align:center;margin:30px auto;max-width:100%;display:block}}.simpay-landing-zone__screenshot li{margin:16px 0;padding:0;font-size:15px;color:#777;position:relative}.simpay-landing-zone__screenshot li:before{content:"";background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEzLjc3NjIgNi40NTYwNUw4LjcyMDMyIDEuNDAwMDVDOC41NzU5OSAxLjI1NTcyIDguMzgzNjQgMS4xNzY1IDguMTc4NTMgMS4xNzY1QzcuOTczMiAxLjE3NjUgNy43ODA5NiAxLjI1NTg0IDcuNjM2NjQgMS40MDAwNUw3LjE3NzYgMS44NTkyQzcuMDMzMzkgMi4wMDMyOSA2Ljk1Mzk1IDIuMTk1NzYgNi45NTM5NSAyLjQwMDk4QzYuOTUzOTUgMi42MDYwOCA3LjAzMzM5IDIuODA1MDQgNy4xNzc2IDIuOTQ5MTRMMTAuMTI3MSA1LjkwNTE2SDAuNzU2MzM0QzAuMzMzODM0IDUuOTA1MTYgMCA2LjIzNTkyIDAgNi42NTg1NFY3LjMwNzY1QzAgNy43MzAyNyAwLjMzMzgzNCA4LjA5NDM4IDAuNzU2MzM0IDguMDk0MzhIMTAuMTYwNkw3LjE3NzcyIDExLjA2NjlDNy4wMzM1MSAxMS4yMTEyIDYuOTU0MDYgMTEuMzk4NSA2Ljk1NDA2IDExLjYwMzdDNi45NTQwNiAxMS44MDg3IDcuMDMzNTEgMTEuOTk4NiA3LjE3NzcyIDEyLjE0MjhMNy42MzY3NSAxMi42MDA1QzcuNzgxMDcgMTIuNzQ0OCA3Ljk3MzMyIDEyLjgyMzUgOC4xNzg2NSAxMi44MjM1QzguMzgzNzUgMTIuODIzNSA4LjU3NjExIDEyLjc0MzggOC43MjA0MyAxMi41OTk1TDEzLjc3NjMgNy41NDM2QzEzLjkyMSA3LjM5ODgyIDE0LjAwMDUgNy4yMDU1NiAxNCA3LjAwMDExQzE0LjAwMDQgNi43OTM5OCAxMy45MjEgNi42MDA2IDEzLjc3NjIgNi40NTYwNVY2LjQ1NjA1WiIgZmlsbD0iIzQyOEJDQSIvPgo8L3N2Zz4K);background-position:center;background-repeat:no-repeat;background-size:14px;width:14px;height:14px;display:inline-block;margin:-3px 5px 0 0;vertical-align:middle}.simpay-landing-zone .button.button-large{font-size:17px;line-height:30px;padding:10px 20px}.simpay-landing-zone__purchased{display:block;margin:15px 0 0}.simpay-upgrade-modal,.simpay-upgrade-upe-modal{padding:0 !important}.simpay-upgrade-modal *,.simpay-upgrade-upe-modal *{box-sizing:border-box}.simpay-upgrade-modal__content,.simpay-upgrade-upe-modal__content{text-align:center;display:flex;flex-direction:column;align-items:center;padding:16px 32px 32px}.simpay-upgrade-modal__content>.dashicons,.simpay-upgrade-upe-modal__content>.dashicons{color:#333;font-size:48px;width:48px;height:48px}.simpay-upgrade-modal__title,.simpay-upgrade-upe-modal__title{font-size:22px;line-height:1.5;display:block;margin:12px 0 0}.simpay-upgrade-modal__description,.simpay-upgrade-upe-modal__description{color:#777;font-size:16px;margin:16px 0 24px}.simpay-upgrade-modal__description strong,.simpay-upgrade-upe-modal__description strong{color:#333}.simpay-upgrade-modal__discount,.simpay-upgrade-upe-modal__discount{font-size:15px;text-align:center;margin:32px -32px -32px;padding:24px 40px;background-color:#fcf9e8;position:relative}.simpay-upgrade-modal__discount svg,.simpay-upgrade-upe-modal__discount svg{background:#00a32a;fill:#fff;border-radius:50%;border:4px solid #fff;width:32px;height:32px;position:absolute;top:-16px;left:50%;margin-left:-16px}.simpay-upgrade-modal__discount u,.simpay-upgrade-upe-modal__discount u{text-decoration:none;font-weight:bold;color:#00a32a}.simpay-upgrade-modal .button-large,.simpay-upgrade-upe-modal .button-large{font-size:16px;font-weight:bold;margin:0 0 15px;padding:8px 30px !important;height:auto}.simpay-teaser-float{margin:50px;position:relative}.simpay-teaser-float__card{text-align:center;padding:30px;background:#fff;border-radius:4px;box-shadow:0 0 30px 15px rgba(0,0,0,.18);position:relative;z-index:2}#poststuff .simpay-teaser-float h2,.simpay-teaser-float h2{font-size:24px;font-weight:600;margin:0;padding:0}.simpay-teaser-float p{font-size:15px;line-height:1.35;color:#666}.simpay-teaser-float p strong{color:#444}.simpay-teaser-float ul{text-align:left;display:inline-block;margin:-10px 0 20px;list-style-type:none}.simpay-teaser-float li{margin:16px 0;padding:0 0 0 24px;font-size:15px;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEzLjc3NjIgNi40NTYwNUw4LjcyMDMyIDEuNDAwMDVDOC41NzU5OSAxLjI1NTcyIDguMzgzNjQgMS4xNzY1IDguMTc4NTMgMS4xNzY1QzcuOTczMiAxLjE3NjUgNy43ODA5NiAxLjI1NTg0IDcuNjM2NjQgMS40MDAwNUw3LjE3NzYgMS44NTkyQzcuMDMzMzkgMi4wMDMyOSA2Ljk1Mzk1IDIuMTk1NzYgNi45NTM5NSAyLjQwMDk4QzYuOTUzOTUgMi42MDYwOCA3LjAzMzM5IDIuODA1MDQgNy4xNzc2IDIuOTQ5MTRMMTAuMTI3MSA1LjkwNTE2SDAuNzU2MzM0QzAuMzMzODM0IDUuOTA1MTYgMCA2LjIzNTkyIDAgNi42NTg1NFY3LjMwNzY1QzAgNy43MzAyNyAwLjMzMzgzNCA4LjA5NDM4IDAuNzU2MzM0IDguMDk0MzhIMTAuMTYwNkw3LjE3NzcyIDExLjA2NjlDNy4wMzM1MSAxMS4yMTEyIDYuOTU0MDYgMTEuMzk4NSA2Ljk1NDA2IDExLjYwMzdDNi45NTQwNiAxMS44MDg3IDcuMDMzNTEgMTEuOTk4NiA3LjE3NzcyIDEyLjE0MjhMNy42MzY3NSAxMi42MDA1QzcuNzgxMDcgMTIuNzQ0OCA3Ljk3MzMyIDEyLjgyMzUgOC4xNzg2NSAxMi44MjM1QzguMzgzNzUgMTIuODIzNSA4LjU3NjExIDEyLjc0MzggOC43MjA0MyAxMi41OTk1TDEzLjc3NjMgNy41NDM2QzEzLjkyMSA3LjM5ODgyIDE0LjAwMDUgNy4yMDU1NiAxNCA3LjAwMDExQzE0LjAwMDQgNi43OTM5OCAxMy45MjEgNi42MDA2IDEzLjc3NjIgNi40NTYwNVY2LjQ1NjA1WiIgZmlsbD0iIzQyOEJDQSIvPgo8L3N2Zz4K);background-position:left 3px;background-repeat:no-repeat;background-size:14px;color:#777}.simpay-teaser-float .button.button-large{font-size:17px;line-height:30px;padding:10px 20px}.simpay-teaser-float .simpay-notice-dismiss{position:absolute;top:0;right:0;font-size:20px;color:#666;font-weight:bold;text-decoration:none;margin-left:5px;padding:6px 10px;z-index:2}.simpay-teaser-float .simpay-notice-dismiss:hover,.simpay-teaser-float .simpay-notice-dismiss:active,.simpay-teaser-float .simpay-notice-dismiss:focus{color:#666;text-decoration:none}.simpay-teaser-float:after,.simpay-teaser-float:before{opacity:.75;z-index:0;content:"";position:absolute;left:-30px;right:-30px;top:-35px;width:calc(100% + 60px);height:170px;background-image:linear-gradient(#ddd, #ddd),linear-gradient(#eee, #eee),linear-gradient(#ddd, #ddd),linear-gradient(#eee, #eee);background-repeat:no-repeat;background-size:100% 20px,100% 40px,100% 20px,100% 40px;background-position:0 0,0 30px,0 100px,0 130px}.simpay-teaser-float:before{top:170px}.simpay-teaser-float .simpay-upgrade-btn-subtext{margin:24px -30px -30px;padding:32px 40px;border-bottom-left-radius:2px;border-bottom-right-radius:2px;border:0}.simpay-teaser-float .simpay-upgrade-btn-subtext svg{border-color:#fff}.simpay-teaser-float--inline{margin:40px 30px 30px}.simpay-teaser-float--inline .simpay-teaser-float__card{padding:30px;box-shadow:0 0 12px 6px rgba(0,0,0,.16)}#poststuff .simpay-teaser-float--inline h2,.simpay-teaser-float--inline h2{font-size:20px}.simpay-teaser-float--inline p{font-size:15px;margin:.75rem 0}.simpay-teaser-float--inline .button.button-large{font-size:15px;line-height:24px;margin:1rem 0;padding:8px 14px;display:inline-block}.simpay-teaser-float--inline:before,.simpay-teaser-float--inline:after{opacity:.6}.simpay-teaser-float--inline:before{display:none}.simpay-teaser-float--inline:after{top:15px}.simpay-form-settings-notice{font-weight:normal;color:#1d2327;position:relative;margin:18px 18px 0;padding:14px;border-radius:4px;background:#f5f5ff}.simpay-form-settings-notice a{color:#635aff}.simpay-form-settings-notice .simpay-external-link .dashicons-external{margin:1px 0 0 2px}.simpay-form-settings-notice strong{font-size:14px}.simpay-form-settings-notice p{margin:5px 0 0 23px}.simpay-form-settings-notice .simpay-notice-dismiss{font-size:20px;color:#b0b0f0;font-weight:bold;line-height:1;position:absolute;top:0;right:5px;text-decoration:none;padding:0 5px;z-index:2}.simpay-form-settings-notice .simpay-notice-dismiss:hover,.simpay-form-settings-notice .simpay-notice-dismiss:active,.simpay-form-settings-notice .simpay-notice-dismiss:focus{color:#9191ef;text-decoration:none;background:none}.simpay-settings .simpay-form-settings-notice{border:2px solid #645aff;box-shadow:0 1px 1px rgba(0,0,0,.04)}.post-type-simple-pay .lity{z-index:999999999;padding:20px}.post-type-simple-pay .lity-close{margin:10px}.post-type-simple-pay .lity-content{max-width:80vw;max-height:80vh}.post-type-simple-pay .lity-content img{max-height:80vh !important;max-width:80vw !important}#wpsp-api-keys-row-hide{display:none}.post-type-simple-pay #post-preview:not(.simpay-preview-button){display:none}.simpay-license-field-wrapper{margin:20px 0}#simpay-settings-license-key-license-key{margin:0}#simpay-settings-license-key-license-key[readonly]{background:#fff}.simpay-license-message__loading,.simpay-license-field{display:flex;align-items:center}.wp-core-ui .button.simpay-license-button.button-primary,.wp-core-ui .button.simpay-license-button.button-secondary{font-size:1rem;line-height:1;margin:0 8px;padding:13px}.simpay-license-message{font-size:15px;margin-top:8px}.simpay-license-message--valid{color:#15803d}.simpay-license-message--invalid{color:#b91c1c}.simpay-recaptcha-payment-form-feedback .dashicons{margin-top:-1px;display:inline-block}.simpay-recaptcha-payment-form-feedback .dashicons-update-alt{animation:rotation 2s infinite linear}.simpay-form-builder-inset-settings{margin:3px 0 0 24px}fieldset.simpay-form-builder-inset-settings>*:not(legend){margin:5px 0 8px}.simpay-form-builder-inset-settings>*:last-child{margin-bottom:0}.simpay-form-builder-inventory-control{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;padding:6px 8px;box-shadow:0 0 0 rgba(0,0,0,0);transition:box-shadow .1s linear;border-radius:2px;border:1px solid #757575;font-size:16px;line-height:normal;margin:0;padding:0;width:auto;display:inline-flex;align-items:center}@media(prefers-reduced-motion: reduce){.simpay-form-builder-inventory-control{transition-duration:0s;transition-delay:0s}}@media(min-width: 600px){.simpay-form-builder-inventory-control{font-size:13px;line-height:normal}}.simpay-form-builder-inventory-control:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid rgba(0,0,0,0)}.simpay-form-builder-inventory-control::-webkit-input-placeholder{color:rgba(30,30,30,.62)}.simpay-form-builder-inventory-control::-moz-placeholder{opacity:1;color:rgba(30,30,30,.62)}.simpay-form-builder-inventory-control:-ms-input-placeholder{color:rgba(30,30,30,.62)}.simpay-form-builder-inventory-control:focus-within{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid rgba(0,0,0,0)}.simpay-form-builder-inventory-control input[type=number]{border:0;box-shadow:none;background:none;border-radius:0;width:75px}.simpay-form-builder-inventory-control input[type=number]:focus{border:0;box-shadow:none;outline:0}.simpay-form-builder-inventory-control+label{margin-left:8px}.simpay-form-builder-inventory-control__initial{color:#757575;font-size:16px;line-height:normal;padding-right:8px}@media(min-width: 600px){.simpay-form-builder-inventory-control__initial{font-size:13px;line-height:normal}}.simpay-form-builder-inventory-control__initial:before{content:"/";display:inline-block;vertical-align:top;margin-top:-1px}.simpay-form-builder-purchase-restrictions__restriction-item{display:flex;align-items:center;margin-top:8px;margin-bottom:8px}.simpay-form-builder-purchase-restrictions__restriction-item label{margin-left:8px}.simpay-form-builder-purchase-restrictions__restriction-item-datetime{display:flex;align-items:center}.simpay-form-builder-purchase-restrictions__restriction-item-datetime>*{margin-right:10px}.simpay-form-builder-purchase-restrictions__restriction-item-datetime span{color:#757575}.simpay-form-builder-fee-recovery__amounts{display:flex;align-items:center;margin-top:5px}.simpay-form-builder-fee-recovery ::-webkit-input-placeholder{color:#b7bec7}.simpay-form-builder-fee-recovery ::-moz-placeholder{color:#b7bec7;opacity:1}.simpay-form-builder-fee-recovery :-ms-input-placeholder{color:#b7bec7}.simpay-form-builder-fee-recovery>*{margin-right:8px}.simpay-form-builder-fee-percent-control{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;padding:6px 8px;box-shadow:0 0 0 rgba(0,0,0,0);transition:box-shadow .1s linear;border-radius:2px;border:1px solid #757575;font-size:16px;line-height:normal;margin:0;padding:0;width:auto;display:inline-flex;align-items:center}@media(prefers-reduced-motion: reduce){.simpay-form-builder-fee-percent-control{transition-duration:0s;transition-delay:0s}}@media(min-width: 600px){.simpay-form-builder-fee-percent-control{font-size:13px;line-height:normal}}.simpay-form-builder-fee-percent-control:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid rgba(0,0,0,0)}.simpay-form-builder-fee-percent-control::-webkit-input-placeholder{color:rgba(30,30,30,.62)}.simpay-form-builder-fee-percent-control::-moz-placeholder{opacity:1;color:rgba(30,30,30,.62)}.simpay-form-builder-fee-percent-control:-ms-input-placeholder{color:rgba(30,30,30,.62)}.simpay-form-builder-fee-percent-control:focus-within{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid rgba(0,0,0,0)}.simpay-form-builder-fee-percent-control input[type=number]{border:0;box-shadow:none;background:none;border-radius:0;width:75px}.simpay-form-builder-fee-percent-control input[type=number]:focus{border:0;box-shadow:none;outline:0}.simpay-form-builder-fee-percent-control+label{margin-left:8px}.simpay-form-builder-fee-percent-control__suffix{color:#757575;font-size:16px;line-height:normal;padding-right:8px}@media(min-width: 600px){.simpay-form-builder-fee-percent-control__suffix{font-size:13px;line-height:normal}}.simpay-form-builder-automations__cta{margin:24px 0 6px;text-align:center}.simpay-form-builder-automator{padding:16px 4px 26px !important}.simpay-form-builder-automator,.simpay-form-builder-automator *{box-sizing:border-box}.simpay-form-builder-automator input[type=search]{font-size:15px;padding:2px 8px}.simpay-form-builder-automator__integrations{display:grid;grid-template-columns:repeat(4, minmax(0, 1fr));grid-column-gap:16px;grid-row-gap:16px;margin:18px -18px 0;padding:0 18px 10px;width:calc(100% + 36px);max-height:400px;overflow-y:scroll}.simpay-form-builder-automator__integrations-integration{color:initial;text-align:center;text-decoration:none;background:#fff;border:1px solid #eee;border-radius:4px;box-shadow:0 1px 3px 0 rgba(0,0,0,.03);transition:all ease-in .15s}.simpay-form-builder-automator__integrations-integration img{display:block;margin:16px auto;height:50px}.simpay-form-builder-automator__integrations-integration span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:8px 16px;display:block;border-top:1px solid #eee}.simpay-form-builder-automator__integrations-integration:hover{cursor:pointer;border-color:#ddd;box-shadow:0 2px 4px 0 rgba(0,0,0,.06)}body.site-health #wpbody-content,body.post-type-simple-pay #wpbody-content{padding-bottom:200px}#wpfooter .simpay-footer-promotion{text-align:center;font-weight:400;font-size:13px;line-height:16px;color:#787c82;padding:20px 0 30px 0;margin-bottom:20px}#wpfooter .simpay-footer-promotion p{font-weight:600}#wpfooter .simpay-footer-promotion-links,#wpfooter .simpay-footer-promotion-social{display:flex;justify-content:center;align-items:center}#wpfooter .simpay-footer-promotion-links{margin:9px 0 0}#wpfooter .simpay-footer-promotion-links span{color:#c3c4c7;padding:0 7px}#wpfooter .simpay-footer-promotion-social{margin:10px 0 0 0;gap:10px}#wpfooter .simpay-footer-promotion-social li{margin-bottom:0}#wpfooter .simpay-footer-promotion-social li:hover path{fill:#50575e}#wpfooter .simpay-footer-promotion-social a{display:block;height:16px}.simpay-settings-is_upe td{background:#fff;border:1px solid #c3c4c7;border-left-width:4px;border-left-color:#2271b1;box-shadow:0 1px 1px rgba(0,0,0,.04);padding:12px 18px} diff --git a/includes/core/assets/js/dist/simpay-admin-dashboard-widget-report.asset.php b/includes/core/assets/js/dist/simpay-admin-dashboard-widget-report.asset.php index 9d17f391..6e941e93 100644 --- a/includes/core/assets/js/dist/simpay-admin-dashboard-widget-report.asset.php +++ b/includes/core/assets/js/dist/simpay-admin-dashboard-widget-report.asset.php @@ -1 +1 @@ - array('lodash', 'react', 'wp-api-fetch', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => 'f514bdccae609dacea820edddfa0180d'); \ No newline at end of file + array('lodash', 'react', 'wp-api-fetch', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => '45676981d2cb1015b0e201bc2fd50dc7'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-form-template-explorer.asset.php b/includes/core/assets/js/dist/simpay-admin-form-template-explorer.asset.php index 4a372b96..c8473798 100644 --- a/includes/core/assets/js/dist/simpay-admin-form-template-explorer.asset.php +++ b/includes/core/assets/js/dist/simpay-admin-form-template-explorer.asset.php @@ -1 +1 @@ - array('lodash', 'wp-a11y', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => 'add823490f99b1581a187fb38a6e7774'); \ No newline at end of file + array('lodash', 'wp-a11y', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => 'd317b524f24f6ec8bc0334b96339c4fe'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-help.asset.php b/includes/core/assets/js/dist/simpay-admin-help.asset.php index c98f974a..dac4e37b 100644 --- a/includes/core/assets/js/dist/simpay-admin-help.asset.php +++ b/includes/core/assets/js/dist/simpay-admin-help.asset.php @@ -1 +1 @@ - array('lodash', 'wp-a11y', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-keycodes', 'wp-primitives', 'wp-url'), 'version' => '9e27307fcbc57bdefdd2b401ec9fa40b'); \ No newline at end of file + array('lodash', 'wp-a11y', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-keycodes', 'wp-primitives', 'wp-url'), 'version' => '2582dbcfcda65c13b2fd8474ce3c3a1b'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-notifications.asset.php b/includes/core/assets/js/dist/simpay-admin-notifications.asset.php index c4d18091..486e7367 100644 --- a/includes/core/assets/js/dist/simpay-admin-notifications.asset.php +++ b/includes/core/assets/js/dist/simpay-admin-notifications.asset.php @@ -1 +1 @@ - array('lodash', 'moment', 'react', 'react-dom', 'wp-api-fetch', 'wp-autop', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => 'cdcd4da1e020aec5e51d9de7811f6fdd'); \ No newline at end of file + array('lodash', 'moment', 'react', 'react-dom', 'wp-api-fetch', 'wp-autop', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '1ed40b7b0e41fd10aa673cfdd11b6a5a'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-page-activity-reports.asset.php b/includes/core/assets/js/dist/simpay-admin-page-activity-reports.asset.php index 6b760685..3e8865cd 100644 --- a/includes/core/assets/js/dist/simpay-admin-page-activity-reports.asset.php +++ b/includes/core/assets/js/dist/simpay-admin-page-activity-reports.asset.php @@ -1 +1 @@ - array('lodash', 'react', 'wp-api-fetch', 'wp-components', 'wp-core-data', 'wp-data', 'wp-date', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => 'ad02552a44b26c92e9cfba7c85c340fc'); \ No newline at end of file + array('lodash', 'react', 'wp-api-fetch', 'wp-components', 'wp-core-data', 'wp-data', 'wp-date', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-primitives', 'wp-url'), 'version' => '5add37d82a4d7a26743dc6a03948d095'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-admin-page-setup-wizard.asset.php b/includes/core/assets/js/dist/simpay-admin-page-setup-wizard.asset.php index c9a7fad6..49ec2325 100644 --- a/includes/core/assets/js/dist/simpay-admin-page-setup-wizard.asset.php +++ b/includes/core/assets/js/dist/simpay-admin-page-setup-wizard.asset.php @@ -1 +1 @@ - array('lodash', 'react', 'wp-api-fetch', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-primitives', 'wp-url'), 'version' => '460aeaabd1d5ec4ac3dfda45048d8c3b'); \ No newline at end of file + array('lodash', 'react', 'wp-api-fetch', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-primitives', 'wp-url'), 'version' => '21c6959b11500cc7331462593884c2a7'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-block-button.asset.php b/includes/core/assets/js/dist/simpay-block-button.asset.php index 79fda27f..e0534b9e 100644 --- a/includes/core/assets/js/dist/simpay-block-button.asset.php +++ b/includes/core/assets/js/dist/simpay-block-button.asset.php @@ -1 +1 @@ - array('wp-block-editor', 'wp-components', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-primitives'), 'version' => 'b18683d83e7524462f85ba4914d1391f'); \ No newline at end of file + array('wp-block-editor', 'wp-components', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-primitives'), 'version' => 'dda6568c499f1c76658381fc4c6c324c'); \ No newline at end of file diff --git a/includes/core/assets/js/dist/simpay-block-payment-form.asset.php b/includes/core/assets/js/dist/simpay-block-payment-form.asset.php index 3a808135..4980812c 100644 --- a/includes/core/assets/js/dist/simpay-block-payment-form.asset.php +++ b/includes/core/assets/js/dist/simpay-block-payment-form.asset.php @@ -1 +1 @@ - array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-server-side-render'), 'version' => 'f4d7ea43f1839a3ab7a2f8eb25fc66bb'); \ No newline at end of file + array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-server-side-render'), 'version' => '8b9e84675cdf249f06a70f5e13506ecc'); \ No newline at end of file diff --git a/includes/core/bootstrap/compatibility.php b/includes/core/bootstrap/compatibility.php index c3e3f9a6..c0957737 100644 --- a/includes/core/bootstrap/compatibility.php +++ b/includes/core/bootstrap/compatibility.php @@ -38,8 +38,8 @@ function get_requirements_list() { ), 'php' => array( 'name' => 'PHP', - 'requires' => '5.6.0', - 'met' => version_compare( PHP_VERSION, '5.6.0', '>=' ), + 'requires' => '7.2', + 'met' => version_compare( PHP_VERSION, '7.2', '>=' ), ), 'curl' => array( 'name' => 'cURL', diff --git a/languages/stripe.pot b/languages/stripe.pot index 45715d42..e124be0a 100644 --- a/languages/stripe.pot +++ b/languages/stripe.pot @@ -2,14 +2,14 @@ # This file is distributed under the same license as the WP Simple Pay Lite plugin. msgid "" msgstr "" -"Project-Id-Version: WP Simple Pay Lite 4.10.0-beta-2\n" +"Project-Id-Version: WP Simple Pay Lite 4.10.0\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-simple-pay-lite\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2024-05-08T14:57:08+00:00\n" +"POT-Creation-Date: 2024-05-14T14:22:52+00:00\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "X-Generator: WP-CLI 2.9.0\n" "X-Domain: stripe\n" @@ -280,7 +280,7 @@ msgstr "" #. translators: %1$s Future PHP version requirement. #: includes/core/admin/functions/notices.php:167 -msgid "In order to be compatible with future versions of WP Simple Pay, you should update your PHP version to %1$s, 7.0, 7.1, or 7.2. On a normal WordPress site, switching to PHP %1$s should never cause issues. We would however actually recommend you switch to PHP 7.1 or higher to receive the full speed and security benefits provided to more modern and fully supported versions of PHP. However, some plugins may not be fully compatible with PHP 7.x, so more testing may be required." +msgid "In order to be compatible with future versions of WP Simple Pay, you should update your PHP version to %1$s, 7.4, or 8.0. On a normal WordPress site, switching to PHP %1$s should never cause issues. We would however actually recommend you switch to PHP 8.0 or higher to receive the full speed and security benefits provided to more modern and fully supported versions of PHP. However, some plugins may not be fully compatible with PHP 8.x, so more testing may be required." msgstr "" #: includes/core/admin/functions/notices.php:181 @@ -605,7 +605,7 @@ msgid "The Custom Amount Input field is required because you have set a custom a msgstr "" #: includes/core/forms/functions.php:580 -msgid "Custom Amount Input has been removed from the payment form. A price option with that allows user-defined amounts is required. " +msgid "Custom Amount Input has been removed from the payment form. A price option that allows user-defined amounts is required. " msgstr "" #: includes/core/forms/functions.php:594 @@ -10321,71 +10321,71 @@ msgstr "" msgid "Please select a valid Tax ID type." msgstr "" -#: includes/core/payments/payment-confirmation-template-tags.php:647 +#: includes/core/payments/payment-confirmation-template-tags.php:694 #: includes/core/post-types/simple-pay/edit-form-payment-options.php:490 #: includes/core/post-types/simple-pay/edit-form-payment-options.php:498 msgid "Subscription" msgstr "" -#: includes/core/payments/payment-confirmation-template-tags.php:649 +#: includes/core/payments/payment-confirmation-template-tags.php:696 #: includes/core/post-types/simple-pay/edit-form-payment-options.php:481 #: includes/core/post-types/simple-pay/edit-form-payment-options.php:485 msgid "One time" msgstr "" -#: includes/core/payments/payment-confirmation-template-tags.php:713 +#: includes/core/payments/payment-confirmation-template-tags.php:760 msgid "The form's title." msgstr "" -#: includes/core/payments/payment-confirmation-template-tags.php:717 +#: includes/core/payments/payment-confirmation-template-tags.php:764 msgid "The form's description." msgstr "" -#: includes/core/payments/payment-confirmation-template-tags.php:721 +#: includes/core/payments/payment-confirmation-template-tags.php:768 msgid "The total price of the payment." msgstr "" -#: includes/core/payments/payment-confirmation-template-tags.php:725 +#: includes/core/payments/payment-confirmation-template-tags.php:772 msgid "The value of the Name form field." msgstr "" -#: includes/core/payments/payment-confirmation-template-tags.php:729 +#: includes/core/payments/payment-confirmation-template-tags.php:776 msgid "The charge date returned from Stripe." msgstr "" -#: includes/core/payments/payment-confirmation-template-tags.php:733 +#: includes/core/payments/payment-confirmation-template-tags.php:780 msgid "The unique charge ID returned from Stripe." msgstr "" -#: includes/core/payments/payment-confirmation-template-tags.php:740 +#: includes/core/payments/payment-confirmation-template-tags.php:787 msgid "The cumulative cost of selected items." msgstr "" -#: includes/core/payments/payment-confirmation-template-tags.php:747 +#: includes/core/payments/payment-confirmation-template-tags.php:794 msgid "The type of payment (one-time or recurring)." msgstr "" -#: includes/core/payments/payment-confirmation-template-tags.php:752 +#: includes/core/payments/payment-confirmation-template-tags.php:799 msgid "The brand of the card used. Visa, Amex, etc." msgstr "" -#: includes/core/payments/payment-confirmation-template-tags.php:757 +#: includes/core/payments/payment-confirmation-template-tags.php:804 msgid "The last four digits of the card used." msgstr "" -#: includes/core/payments/payment-confirmation-template-tags.php:762 +#: includes/core/payments/payment-confirmation-template-tags.php:809 msgid "The calculated tax amount based on the total and the tax percent setting." msgstr "" -#: includes/core/payments/payment-confirmation-template-tags.php:767 +#: includes/core/payments/payment-confirmation-template-tags.php:814 msgid "The calculated fee recovery amount based on the total and the fee recovery percent setting." msgstr "" -#: includes/core/payments/payment-confirmation-template-tags.php:773 +#: includes/core/payments/payment-confirmation-template-tags.php:820 msgid "The amount of the coupon applied to the payment." msgstr "" -#: includes/core/payments/payment-confirmation-template-tags.php:801 +#: includes/core/payments/payment-confirmation-template-tags.php:848 msgid "Available smart tags:" msgstr "" @@ -11054,7 +11054,7 @@ msgid "Learn more" msgstr "" #: includes/core/post-types/simple-pay/edit-form-stripe-checkout.php:288 -#: includes/core/settings/register-emails.php:444 +#: includes/core/settings/register-emails.php:449 msgid "Other" msgstr "" @@ -11823,21 +11823,21 @@ msgstr "" msgid "Payments" msgstr "" -#: includes/core/settings/register-emails.php:461 +#: includes/core/settings/register-emails.php:466 msgid "Select an email to configure…" msgstr "" #. translators: Email label. -#: includes/core/settings/register-emails.php:471 +#: includes/core/settings/register-emails.php:476 msgid "Unlock \"%s\" Email" msgstr "" #. translators: %1$s Email label. %2$s License level required. -#: includes/core/settings/register-emails.php:480 +#: includes/core/settings/register-emails.php:485 msgid "We're sorry, sending and customizing the \"%1$s\" email is not available on your plan. Please upgrade to the %2$s plan or higher to unlock this and other awesome features." msgstr "" -#: includes/core/settings/register-emails.php:534 +#: includes/core/settings/register-emails.php:539 msgid "Configure" msgstr "" @@ -12941,6 +12941,71 @@ msgstr "" msgid "View %s in Stripe →" msgstr "" +#: src/Emails/Email/PaymentProcessingConfirmationEmail.php:44 +msgid "Payment Processing Confirmation" +msgstr "" + +#: src/Emails/Email/PaymentProcessingConfirmationEmail.php:51 +msgid "Send a payment processing confirmation email to the customer upon successful payment" +msgstr "" + +#. translators: %s Site name +#: src/Emails/Email/PaymentProcessingConfirmationEmail.php:71 +msgid "Payment Processing Confirmation for %s" +msgstr "" + +#: src/Emails/Email/PaymentProcessingNotificationEmail.php:44 +msgid "Payment Processing Notification" +msgstr "" + +#: src/Emails/Email/PaymentProcessingNotificationEmail.php:51 +msgid "Send a payment processing notification email to the merchant upon successful payment" +msgstr "" + +#. translators: %s Site name +#: src/Emails/Email/PaymentProcessingNotificationEmail.php:88 +msgid "Payment Processing Notification for %s" +msgstr "" + +#: src/Emails/Email/PaymentRefundedConfirmationEmail.php:44 +msgid "Payment Refunded Confirmation" +msgstr "" + +#: src/Emails/Email/PaymentRefundedConfirmationEmail.php:51 +msgid "Send a confirmation email for a payment refund" +msgstr "" + +#. translators: %s Site name +#: src/Emails/Email/PaymentRefundedConfirmationEmail.php:87 +msgid "Payment refunded on %s" +msgstr "" + +#: src/Emails/Email/SubscriptionCancellationConfirmation.php:53 +msgid "Subscription Cancellation Confirmation" +msgstr "" + +#: src/Emails/Email/SubscriptionCancellationConfirmation.php:60 +msgid "Email sent to users when their subscription is cancelled." +msgstr "" + +#. translators: %s Site name +#: src/Emails/Email/SubscriptionCancellationConfirmation.php:80 +msgid "Subscription Cancelled for %s" +msgstr "" + +#: src/Emails/Email/SubscriptionCancellationNotification.php:53 +msgid "Subscription Cancellation Notification" +msgstr "" + +#: src/Emails/Email/SubscriptionCancellationNotification.php:60 +msgid "Email sent to merchants when a subscription is cancelled." +msgstr "" + +#. translators: %s Site name +#: src/Emails/Email/SubscriptionCancellationNotification.php:97 +msgid "Subscription Cancellation Notification for %s" +msgstr "" + #: src/Emails/Email/SummaryReportEmail.php:47 msgid "Summary Report" msgstr "" @@ -13376,21 +13441,29 @@ msgid "Previous period" msgstr "" #. translators: %s Payment created date. -#: src/RestApi/Internal/Report/LatestPaymentsReport.php:155 +#: src/RestApi/Internal/Report/LatestPaymentsReport.php:160 msgid "%s ago" msgstr "" -#: src/RestApi/Internal/Report/LatestPaymentsReport.php:188 +#: src/RestApi/Internal/Report/LatestPaymentsReport.php:194 #: src/RestApi/Internal/Report/PaymentInfoReport.php:356 msgid "Succeeded" msgstr "" -#: src/RestApi/Internal/Report/LatestPaymentsReport.php:190 +#: src/RestApi/Internal/Report/LatestPaymentsReport.php:196 #: src/RestApi/Internal/Report/PaymentInfoReport.php:354 msgid "Failed" msgstr "" -#: src/RestApi/Internal/Report/LatestPaymentsReport.php:192 +#: src/RestApi/Internal/Report/LatestPaymentsReport.php:198 +msgid "Refunded" +msgstr "" + +#: src/RestApi/Internal/Report/LatestPaymentsReport.php:200 +msgid "Partially Refunded" +msgstr "" + +#: src/RestApi/Internal/Report/LatestPaymentsReport.php:202 #: src/RestApi/Internal/Report/PaymentInfoReport.php:358 msgid "Incomplete" msgstr "" @@ -14179,11 +14252,6 @@ msgstr "" msgid "To speed up the process you can select from one of our pre-made templates or start with a basic form. Have a suggestion for a new template? We'd love to hear it!" msgstr "" -#: includes/core/assets/js/dist/simpay-admin-form-template-explorer.js:1 -#: includes/core/assets/js/dist/simpay-admin-help.js:1 -msgid "Reset search" -msgstr "" - #: includes/core/assets/js/dist/simpay-admin-form-template-explorer.js:1 msgid "Search for templates" msgstr "" @@ -14340,6 +14408,10 @@ msgstr "" msgid "Please select a different currency or check back later." msgstr "" +#: includes/core/assets/js/dist/simpay-admin-page-activity-reports.js:2 +msgid "%s refund was initiated" +msgstr "" + #: includes/core/assets/js/dist/simpay-admin-page-activity-reports.js:2 msgid "View customer records" msgstr "" diff --git a/lib/Symfony/polyfill-php80/Resources/stubs/Attribute.php b/lib/Symfony/polyfill-php80/Resources/stubs/Attribute.php new file mode 100644 index 00000000..3cb3a2a1 --- /dev/null +++ b/lib/Symfony/polyfill-php80/Resources/stubs/Attribute.php @@ -0,0 +1,31 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#[SimplePay_Attribute(Attribute::TARGET_CLASS)] +final class SimplePay_Attribute +{ + public const TARGET_CLASS = 1; + public const TARGET_FUNCTION = 2; + public const TARGET_METHOD = 4; + public const TARGET_PROPERTY = 8; + public const TARGET_CLASS_CONSTANT = 16; + public const TARGET_PARAMETER = 32; + public const TARGET_ALL = 63; + public const IS_REPEATABLE = 64; + + /** @var int */ + public $flags; + + public function __construct(int $flags = self::TARGET_ALL) + { + $this->flags = $flags; + } +} diff --git a/lib/Symfony/polyfill-php80/Resources/stubs/PhpToken.php b/lib/Symfony/polyfill-php80/Resources/stubs/PhpToken.php new file mode 100644 index 00000000..c8a70cca --- /dev/null +++ b/lib/Symfony/polyfill-php80/Resources/stubs/PhpToken.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80000 && extension_loaded('tokenizer')) { + class SimplePay_PhpToken extends Symfony\Polyfill\Php80\SimplePay_PhpToken + { + } +} diff --git a/lib/Symfony/polyfill-php80/Resources/stubs/Stringable.php b/lib/Symfony/polyfill-php80/Resources/stubs/Stringable.php new file mode 100644 index 00000000..3d6cb5bb --- /dev/null +++ b/lib/Symfony/polyfill-php80/Resources/stubs/Stringable.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80000) { + interface SimplePay_Stringable + { + /** + * @return string + */ + public function __toString(); + } +} diff --git a/lib/Symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php b/lib/Symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php new file mode 100644 index 00000000..1a48aee8 --- /dev/null +++ b/lib/Symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80000) { + class SimplePay_UnhandledMatchError extends Error + { + } +} diff --git a/lib/Symfony/polyfill-php80/Resources/stubs/ValueError.php b/lib/Symfony/polyfill-php80/Resources/stubs/ValueError.php new file mode 100644 index 00000000..9ee29b14 --- /dev/null +++ b/lib/Symfony/polyfill-php80/Resources/stubs/ValueError.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80000) { + class SimplePay_ValueError extends Error + { + } +} diff --git a/src/NotificationInbox/Database/Query.php b/src/NotificationInbox/Database/Query.php old mode 100755 new mode 100644 diff --git a/src/NotificationInbox/Database/Schema.php b/src/NotificationInbox/Database/Schema.php old mode 100755 new mode 100644 diff --git a/src/NotificationInbox/Database/Table.php b/src/NotificationInbox/Database/Table.php old mode 100755 new mode 100644 diff --git a/src/Transaction/Database/Query.php b/src/Transaction/Database/Query.php old mode 100755 new mode 100644 diff --git a/src/Transaction/Database/Schema.php b/src/Transaction/Database/Schema.php old mode 100755 new mode 100644 diff --git a/src/Transaction/Database/Table.php b/src/Transaction/Database/Table.php old mode 100755 new mode 100644 diff --git a/vendor/autoload.php b/vendor/autoload.php index da33d7bf..05fb2db5 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -22,4 +22,4 @@ require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInitd92c3bfb21634ab9fea4e7c0f7420ff2::getLoader(); +return ComposerAutoloaderInit95bda4c6ff34275fb409b78b64b6072e::getLoader(); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 23a03803..10f5f94b 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInitd92c3bfb21634ab9fea4e7c0f7420ff2 +class ComposerAutoloaderInit95bda4c6ff34275fb409b78b64b6072e { private static $loader; @@ -22,12 +22,12 @@ public static function getLoader() return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInitd92c3bfb21634ab9fea4e7c0f7420ff2', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit95bda4c6ff34275fb409b78b64b6072e', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); - spl_autoload_unregister(array('ComposerAutoloaderInitd92c3bfb21634ab9fea4e7c0f7420ff2', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit95bda4c6ff34275fb409b78b64b6072e', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInitd92c3bfb21634ab9fea4e7c0f7420ff2::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInit95bda4c6ff34275fb409b78b64b6072e::getInitializer($loader)); $loader->register(true); diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index a198a257..2bc583f1 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInitd92c3bfb21634ab9fea4e7c0f7420ff2 +class ComposerStaticInit95bda4c6ff34275fb409b78b64b6072e { public static $prefixLengthsPsr4 = array ( 'S' => @@ -37,9 +37,9 @@ class ComposerStaticInitd92c3bfb21634ab9fea4e7c0f7420ff2 public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInitd92c3bfb21634ab9fea4e7c0f7420ff2::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInitd92c3bfb21634ab9fea4e7c0f7420ff2::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInitd92c3bfb21634ab9fea4e7c0f7420ff2::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInit95bda4c6ff34275fb409b78b64b6072e::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit95bda4c6ff34275fb409b78b64b6072e::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInit95bda4c6ff34275fb409b78b64b6072e::$classMap; }, null, ClassLoader::class); } diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index e75dc489..7bdaa45d 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => 'wpsimplepay/wp-simple-pay-pro-3', 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => '218978ce393e95dc6c493868673a375aa9101ce6', + 'reference' => '8e2a09f67746ae24f4f45b7e96ac16a4b3573bb4', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -112,7 +112,7 @@ 'wpsimplepay/wp-simple-pay-pro-3' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => '218978ce393e95dc6c493868673a375aa9101ce6', + 'reference' => '8e2a09f67746ae24f4f45b7e96ac16a4b3573bb4', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), From d60798b1bc249fc571a311020b638dfbe5d4d2d1 Mon Sep 17 00:00:00 2001 From: Spencer Finnell Date: Tue, 14 May 2024 10:49:40 -0400 Subject: [PATCH 11/11] Update readme.txt --- readme.txt | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/readme.txt b/readme.txt index cc5d8f98..25d443f1 100644 --- a/readme.txt +++ b/readme.txt @@ -249,12 +249,8 @@ No. WP Simple Pay is a standalone Stripe payments plugin and does not integrate == Changelog == -= Stripe Payment Forms v4.10.0 - May 2, 2024 = += Stripe Payment Forms v4.10.0 - May 14, 2024 = -* New: Emails - Add Support for Delayed Notification Payment Methods (ACH Direct Debit, etc). -* New: Emails - Notify Merchant and Users of Cancelled Subscriptions. -* New: Emails - Notify Users about Refunds. -* New: Add Refunded and Partially Refunded statuses to the latest payments. * New: Smart Tags - Provide Fallback For Optional Fields. * Fix: Form Builder - Custom Fields Can Become Unexpandable. * Fix: Remove Redundant Word in Sentence. @@ -302,8 +298,3 @@ No. WP Simple Pay is a standalone Stripe payments plugin and does not integrate * New: Form Builder - add per-form confirmation and email messages. * Fix: Form Preview - avoid calling wp_head() more than once. - -= Stripe Payment Forms v4.7.8 - August 2, 2023 = - -* New: Add "Automations" tab to the form builder. -* Fix: Ensure at least one payment method is active when updating a payment form.