iThemes Security (formerly Better WP Security) - Version 7.8.0

Version Description

  • New Feature: The new, improved WordPress Security Site Scan powered by iThemes checks if Google has detected malware and added your site to their threat list.
  • Enhancement: Remove quick bans. Persist banned hosts to .htaccess or nginx.conf on an hourly schedule.
  • Tweak: Cap banned hosts persisted to .htaccess or nginx.conf to the most recent 100. This number can be adjusted with the "itsec_ban_users_max_hosts_for_server_config" filter. Older banned hosts will be locked out after WordPress loads.
  • Tweak: Ensure randomly generated passwords are considered strong by the Strong Passwords library.
  • Tweak: Suggest a 32 character password when forcing a password change.
  • Tweak: Change insensitive language to be more inclusive.
  • Bug Fix: PHP warning when a user's email address is updated outside of the user edit admin page.
  • Bug Fix: Fix login interstitials on WP Engine when using a front-end login form.
  • Bug Fix: PHP warning when checking opaque tokens.
  • Bug Fix: PHP warning after successfully connecting a site to iThemes Sync via the login connection flow.
  • Bug Fix: File Change Security Message would not appear for new installs.
Download this release

Release Info

Developer TimothyBlynJacobs
Plugin Icon 128x128 iThemes Security (formerly Better WP Security)
Version 7.8.0
Comparing to
See all releases

Code changes from version 7.7.0 to 7.8.0

Files changed (123) hide show
  1. better-wp-security.php +2 -2
  2. core/composer.json +2 -1
  3. core/container.php +7 -0
  4. core/core.php +31 -1
  5. core/files.php +10 -61
  6. core/history.txt +23 -0
  7. core/lib.php +57 -0
  8. core/lib/admin-notices/class-itsec-admin-notice-highlighted-log.php +1 -1
  9. core/lib/class-itsec-lib-feature-flags.php +43 -0
  10. core/lib/class-itsec-lib-jwt.php +368 -0
  11. core/lib/class-itsec-lib-login-interstitial.php +4 -3
  12. core/lib/class-itsec-lib-opaque-tokens.php +1 -1
  13. core/lib/class-itsec-lib-password-requirements.php +8 -0
  14. core/lib/class-itsec-lib-remote-messages.php +8 -4
  15. core/lib/class-itsec-lib-rest.php +33 -0
  16. core/lib/class-itsec-lib-upgrader.php +148 -0
  17. core/lib/class-itsec-scheduler.php +18 -0
  18. core/lib/debug.php +11 -5
  19. core/lib/upgrader-skin.php +33 -0
  20. core/lockout.php +6 -6
  21. core/modules.php +15 -1
  22. core/modules/404-detection/settings-page.php +8 -8
  23. core/modules/404-detection/validator.php +8 -8
  24. core/modules/ban-users/config-generators.php +57 -40
  25. core/modules/ban-users/settings-page.php +3 -3
  26. core/modules/ban-users/validator.php +21 -18
  27. core/modules/core/entries/admin-notices/components/admin-bar/style.scss +3 -1
  28. core/modules/core/entries/admin-notices/components/panel/index.js +4 -0
  29. core/modules/core/notices.php +11 -4
  30. core/modules/core/sidebar-widget-sync-cross-promo.php +1 -1
  31. core/modules/email-confirmation/class-itsec-email-confirmation.php +1 -0
  32. core/modules/file-change/class-itsec-file-change.php +1 -4
  33. core/modules/{malware/sync-verbs → file-writing/js}/index.php +0 -0
  34. core/modules/file-writing/js/settings-page.js +28 -0
  35. core/modules/file-writing/settings-page.php +46 -12
  36. core/modules/global/notices.php +53 -0
  37. core/modules/global/settings-page.php +11 -14
  38. core/modules/global/settings.php +1 -0
  39. core/modules/global/validator.php +7 -6
  40. core/modules/malware/class-itsec-malware-scan-results-template.php +0 -5
  41. core/modules/malware/class-itsec-malware-scanner.php +4 -247
  42. core/modules/malware/class-itsec-malware.php +1 -31
  43. core/modules/malware/css/index.php +1 -2
  44. core/modules/malware/css/settings.css +0 -82
  45. core/modules/malware/js/index.php +1 -1
  46. core/modules/malware/js/malware.js +0 -78
  47. core/modules/malware/js/settings-page.js +0 -89
  48. core/modules/malware/privacy.php +0 -17
  49. core/modules/malware/settings-page.php +0 -80
  50. core/modules/malware/setup.php +0 -70
  51. core/modules/malware/sync-verbs/itsec-do-malware-scan.php +0 -12
  52. core/modules/malware/sync-verbs/itsec-get-malware-scan-log.php +0 -17
  53. core/modules/password-requirements/class-itsec-password-requirements.php +2 -31
  54. core/modules/security-check/scanner.php +2 -3
  55. core/modules/site-scanner/Fixer/Fixer.php +45 -0
  56. core/modules/site-scanner/Fixer/Multi_Fixer.php +53 -0
  57. core/modules/site-scanner/Fixer/Vulnerability_Fixer.php +143 -0
  58. {dist/vendors/user-groups → core/modules/site-scanner/Fixer}/index.php +0 -0
  59. core/modules/site-scanner/Model/Blacklist.php +24 -0
  60. core/modules/site-scanner/Model/Entry.php +80 -0
  61. core/modules/site-scanner/Model/Factory.php +186 -0
  62. core/modules/site-scanner/Model/Issue.php +50 -0
  63. core/modules/site-scanner/Model/Issue_Trait.php +41 -0
  64. core/modules/site-scanner/Model/Malware.php +23 -0
  65. core/modules/site-scanner/Model/Scan.php +209 -0
  66. core/modules/site-scanner/Model/Status.php +11 -0
  67. core/modules/site-scanner/Model/Vulnerability.php +55 -0
  68. core/modules/site-scanner/Model/index.php +1 -0
  69. core/modules/site-scanner/REST/Issues.php +369 -0
  70. core/modules/site-scanner/REST/Muted_Issues.php +225 -0
  71. core/modules/site-scanner/REST/REST.php +61 -0
  72. core/modules/site-scanner/REST/Scans.php +381 -0
  73. core/modules/site-scanner/REST/index.php +1 -0
  74. core/modules/site-scanner/Repository/LatestScanRepository.php +42 -0
  75. core/modules/site-scanner/Repository/LogRepository.php +75 -0
  76. core/modules/site-scanner/Repository/Options.php +131 -0
  77. core/modules/site-scanner/Repository/Repository.php +35 -0
  78. core/modules/site-scanner/Repository/index.php +1 -0
  79. core/modules/site-scanner/active.php +5 -0
  80. core/modules/site-scanner/api.php +500 -0
  81. core/modules/site-scanner/class-itsec-site-scanner.php +93 -0
  82. core/modules/site-scanner/container.php +69 -0
  83. core/modules/site-scanner/index.php +1 -0
  84. core/modules/site-scanner/js/index.php +1 -0
  85. core/modules/site-scanner/js/scanner.js +51 -0
  86. core/modules/site-scanner/labels.php +5 -0
  87. core/modules/site-scanner/logs.php +105 -0
  88. core/modules/site-scanner/mail.php +168 -0
  89. core/modules/site-scanner/privacy.php +17 -0
  90. core/modules/site-scanner/settings-page.php +45 -0
  91. core/modules/site-scanner/settings.php +16 -0
  92. core/modules/site-scanner/template.php +199 -0
  93. core/modules/site-scanner/util.php +291 -0
  94. core/modules/site-scanner/validator.php +46 -0
  95. core/modules/strong-passwords/class-itsec-strong-passwords.php +39 -0
  96. core/modules/sync-connect/class-itsec-sync-connect-interstitial.php +4 -1
  97. core/package.json +38 -34
  98. core/packages/components/src/async-select/index.js +1 -1
  99. core/packages/components/src/site-scan-results/blacklist-details.js +0 -52
  100. core/packages/components/src/site-scan-results/entry.js +30 -0
  101. core/packages/components/src/site-scan-results/index.js +13 -8
  102. core/packages/components/src/site-scan-results/known-vulnerabilities.js +0 -30
  103. core/packages/components/src/site-scan-results/malware-details.js +0 -64
  104. core/packages/components/src/site-scan-results/wp-error-details.js +1 -2
  105. core/packages/webpack/src/babel.js +0 -5
  106. core/rest.php +35 -0
  107. core/setup.php +4 -0
  108. dist/8.min.js +1 -1
  109. dist/core/admin-notices-api.min.js +1 -1
  110. dist/core/admin-notices-dashboard-admin-bar.min.css +1 -1
  111. dist/core/admin-notices-dashboard-admin-bar.min.js +1 -1
  112. dist/core/admin-notices.min.js +1 -1
  113. dist/manifest.php +23 -21
  114. dist/user-groups/api.min.js +1 -1
  115. dist/user-groups/settings.min.js +2 -2
  116. dist/vendors/core/admin-notices-api~api~settings.min.js +1 -0
  117. dist/vendors/core/index.php +1 -0
  118. dist/vendors/user-groups/api.min.js +0 -1
  119. history.txt +14 -0
  120. package.json +38 -34
  121. readme.txt +22 -6
  122. vendor-prod/composer/autoload_classmap.php +34 -16
  123. vendor-prod/composer/autoload_static.php +34 -16
better-wp-security.php CHANGED
@@ -6,7 +6,7 @@
6
  * Description: Take the guesswork out of WordPress security. iThemes Security offers 30+ ways to lock down WordPress in an easy-to-use WordPress security plugin.
7
  * Author: iThemes
8
  * Author URI: https://ithemes.com
9
- * Version: 7.7.0
10
  * Text Domain: better-wp-security
11
  * Network: True
12
  * License: GPLv2
@@ -16,7 +16,7 @@
16
 
17
  if ( version_compare( phpversion(), '5.6.0', '<' ) ) {
18
  function itsec_free_minimum_php_version_notice() {
19
- echo '<div class="notice notice-error"><p>' . esc_html__( 'iThemes Security requires PHP 5.5 or higher.', 'better-wp-security' ) . '</p></div>';
20
  }
21
 
22
  add_action( 'admin_notices', 'itsec_free_minimum_php_version_notice' );
6
  * Description: Take the guesswork out of WordPress security. iThemes Security offers 30+ ways to lock down WordPress in an easy-to-use WordPress security plugin.
7
  * Author: iThemes
8
  * Author URI: https://ithemes.com
9
+ * Version: 7.8.0
10
  * Text Domain: better-wp-security
11
  * Network: True
12
  * License: GPLv2
16
 
17
  if ( version_compare( phpversion(), '5.6.0', '<' ) ) {
18
  function itsec_free_minimum_php_version_notice() {
19
+ echo '<div class="notice notice-error"><p>' . esc_html__( 'iThemes Security requires PHP 5.6 or higher.', 'better-wp-security' ) . '</p></div>';
20
  }
21
 
22
  add_action( 'admin_notices', 'itsec_free_minimum_php_version_notice' );
core/composer.json CHANGED
@@ -25,7 +25,8 @@
25
  "lib"
26
  ],
27
  "exclude-from-classmap": [
28
- "lib/itsec-zxcvbn-php"
 
29
  ]
30
  }
31
  }
25
  "lib"
26
  ],
27
  "exclude-from-classmap": [
28
+ "lib/itsec-zxcvbn-php",
29
+ "modules/pro"
30
  ]
31
  }
32
  }
core/container.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ return static function ( \Pimple\Container $c ) {
4
+ $c[ ITSEC_Lib_Upgrader::class ] = static function () {
5
+ return new ITSEC_Lib_Upgrader();
6
+ };
7
+ };
core/core.php CHANGED
@@ -26,7 +26,7 @@ if ( ! class_exists( 'ITSEC_Core' ) ) {
26
  *
27
  * @access private
28
  */
29
- private $plugin_build = 4118;
30
 
31
  /**
32
  * Used to distinguish between a user modifying settings and the API modifying settings (such as from Sync
@@ -152,6 +152,7 @@ if ( ! class_exists( 'ITSEC_Core' ) ) {
152
  add_action( 'itsec_scheduler_register_events', array( $this, 'register_events' ) );
153
  add_action( 'itsec_scheduled_clear-locks', array( 'ITSEC_Lib', 'delete_expired_locks' ) );
154
  add_action( 'itsec_scheduled_clear-tokens', array( ITSEC_Lib_Opaque_Tokens::class, 'delete_expired_tokens' ) );
 
155
  add_action( 'itsec_before_import', function () {
156
  $this->importing = true;
157
  } );
@@ -450,6 +451,7 @@ if ( ! class_exists( 'ITSEC_Core' ) ) {
450
  $scheduler->schedule( ITSEC_Scheduler::S_DAILY, 'clear-locks' );
451
  $scheduler->schedule( ITSEC_Scheduler::S_DAILY, 'health-check' );
452
  $scheduler->schedule( ITSEC_Scheduler::S_DAILY, 'clear-tokens' );
 
453
  }
454
 
455
  /**
@@ -498,6 +500,7 @@ if ( ! class_exists( 'ITSEC_Core' ) ) {
498
  ITSEC_Modules::register_module( 'malware', "$path/modules/malware", 'always-active' );
499
  ITSEC_Modules::register_module( 'security-check-pro', "$path/modules/security-check-pro", self::is_pro() ? 'always-active' : 'default-inactive' );
500
  ITSEC_Modules::register_module( 'sync-connect', "$path/modules/sync-connect", 'always-active' );
 
501
 
502
  if ( ! ITSEC_Core::is_pro() ) {
503
  ITSEC_Modules::register_module( 'pro-module-upsells', "$path/modules/pro", 'always-active' );
@@ -724,9 +727,36 @@ if ( ! class_exists( 'ITSEC_Core' ) ) {
724
  return false;
725
  }
726
 
 
 
 
 
727
  return 'active' === $package_details['packages']['ithemes-security-pro/ithemes-security-pro.php']['status'];
728
  }
729
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
730
  /**
731
  * Get the current local timestamp.
732
  *
26
  *
27
  * @access private
28
  */
29
+ private $plugin_build = 4119;
30
 
31
  /**
32
  * Used to distinguish between a user modifying settings and the API modifying settings (such as from Sync
152
  add_action( 'itsec_scheduler_register_events', array( $this, 'register_events' ) );
153
  add_action( 'itsec_scheduled_clear-locks', array( 'ITSEC_Lib', 'delete_expired_locks' ) );
154
  add_action( 'itsec_scheduled_clear-tokens', array( ITSEC_Lib_Opaque_Tokens::class, 'delete_expired_tokens' ) );
155
+ add_action( 'itsec_scheduled_flush-files', array( 'ITSEC_Files', 'flush_files' ) );
156
  add_action( 'itsec_before_import', function () {
157
  $this->importing = true;
158
  } );
451
  $scheduler->schedule( ITSEC_Scheduler::S_DAILY, 'clear-locks' );
452
  $scheduler->schedule( ITSEC_Scheduler::S_DAILY, 'health-check' );
453
  $scheduler->schedule( ITSEC_Scheduler::S_DAILY, 'clear-tokens' );
454
+ $scheduler->schedule( ITSEC_Scheduler::S_HOURLY, 'flush-files' );
455
  }
456
 
457
  /**
500
  ITSEC_Modules::register_module( 'malware', "$path/modules/malware", 'always-active' );
501
  ITSEC_Modules::register_module( 'security-check-pro', "$path/modules/security-check-pro", self::is_pro() ? 'always-active' : 'default-inactive' );
502
  ITSEC_Modules::register_module( 'sync-connect', "$path/modules/sync-connect", 'always-active' );
503
+ ITSEC_Modules::register_module( 'site-scanner', "$path/modules/site-scanner", 'always-active' );
504
 
505
  if ( ! ITSEC_Core::is_pro() ) {
506
  ITSEC_Modules::register_module( 'pro-module-upsells', "$path/modules/pro", 'always-active' );
727
  return false;
728
  }
729
 
730
+ if ( empty( $package_details['packages']['ithemes-security-pro/ithemes-security-pro.php']['user'] ) ) {
731
+ return false;
732
+ }
733
+
734
  return 'active' === $package_details['packages']['ithemes-security-pro/ithemes-security-pro.php']['status'];
735
  }
736
 
737
+ /**
738
+ * Gets the URL iThemes Security was licensed for.
739
+ *
740
+ * @return string
741
+ */
742
+ public static function get_licensed_url() {
743
+ if ( ! self::is_licensed() || ! function_exists( 'ithemes_updater_get_licensed_site_url' ) ) {
744
+ return '';
745
+ }
746
+
747
+ if ( ithemes_updater_is_licensed_site_url_confirmed() ) {
748
+ return '';
749
+ }
750
+
751
+ $hostname = ithemes_updater_get_licensed_site_url();
752
+
753
+ if ( ! $hostname ) {
754
+ return '';
755
+ }
756
+
757
+ return $hostname;
758
+ }
759
+
760
  /**
761
  * Get the current local timestamp.
762
  *
core/files.php CHANGED
@@ -12,11 +12,7 @@
12
  final class ITSEC_Files {
13
  static $instance = false;
14
 
15
- private function __construct() {
16
-
17
- add_action( 'itsec-new-blacklisted-ip', array( $this, 'quick_ban' ) );
18
-
19
- }
20
 
21
  public static function get_instance() {
22
  if ( ! self::$instance ) {
@@ -73,6 +69,15 @@ final class ITSEC_Files {
73
  return $success;
74
  }
75
 
 
 
 
 
 
 
 
 
 
76
  /**
77
  * Execute activation functions.
78
  *
@@ -102,60 +107,4 @@ final class ITSEC_Files {
102
  ITSEC_Lib_Config_File::reset_wp_config();
103
  ITSEC_Lib_Config_File::reset_server_config();
104
  }
105
-
106
- /**
107
- * Process quick ban of host.
108
- *
109
- * Immediately adds the supplied host to the .htaccess file for banning.
110
- *
111
- * @since 4.0.0
112
- *
113
- * @param string $host the host to ban
114
- *
115
- * @return bool true on success or false on failure
116
- */
117
- public function quick_ban( $host ) {
118
- $host = trim( $host );
119
-
120
- require_once( ITSEC_Core::get_core_dir() . '/lib/class-itsec-lib-ip-tools.php' );
121
-
122
- if ( ! ITSEC_Lib_IP_Tools::validate( $host ) ) {
123
- return false;
124
- }
125
-
126
-
127
- $host_rule = '# ' . __( 'Quick ban IP. Will be updated on next formal rules save.', 'better-wp-security' ) . "\n";
128
-
129
- if ( 'nginx' === ITSEC_Lib::get_server() ) {
130
- $host_rule .= "\tdeny $host;\n";
131
- } else if ( 'apache' === ITSEC_Lib::get_server() ) {
132
- $dhost = str_replace( '.', '\\.', $host ); //re-define $dhost to match required output for SetEnvIf-RegEX
133
-
134
- $host_rule .= "SetEnvIF REMOTE_ADDR \"^$dhost$\" DenyAccess\n"; //Ban IP
135
- $host_rule .= "SetEnvIF X-FORWARDED-FOR \"^$dhost$\" DenyAccess\n"; //Ban IP from Proxy-User
136
- $host_rule .= "SetEnvIF X-CLUSTER-CLIENT-IP \"^$dhost$\" DenyAccess\n"; //Ban IP for Cluster/Cloud-hosted WP-Installs
137
- $host_rule .= "<IfModule mod_authz_core.c>\n";
138
- $host_rule .= "\t<RequireAll>\n";
139
- $host_rule .= "\t\tRequire all granted\n";
140
- $host_rule .= "\t\tRequire not env DenyAccess\n";
141
- $host_rule .= "\t\tRequire not ip $host\n";
142
- $host_rule .= "\t</RequireAll>\n";
143
- $host_rule .= "</IfModule>\n";
144
- $host_rule .= "<IfModule !mod_authz_core.c>\n";
145
- $host_rule .= "\tOrder allow,deny\n";
146
- $host_rule .= "\tAllow from all\n";
147
- $host_rule .= "\tDeny from env=DenyAccess\n";
148
- $host_rule .= "\tDeny from $host\n";
149
- $host_rule .= "</IfModule>\n";
150
- }
151
-
152
- require_once( ITSEC_Core::get_core_dir() . '/lib/class-itsec-lib-config-file.php' );
153
- $result = ITSEC_Lib_Config_File::append_server_config( $host_rule );
154
-
155
- if ( is_wp_error( $result ) ) {
156
- return false;
157
- }
158
-
159
- return true;
160
- }
161
  }
12
  final class ITSEC_Files {
13
  static $instance = false;
14
 
15
+ private function __construct() {}
 
 
 
 
16
 
17
  public static function get_instance() {
18
  if ( ! self::$instance ) {
69
  return $success;
70
  }
71
 
72
+ /**
73
+ * Flush files to the filesystem on a schedule.
74
+ *
75
+ * @param ITSEC_Job $job
76
+ */
77
+ public static function flush_files( ITSEC_Job $job ) {
78
+ self::regenerate_server_config( false );
79
+ }
80
+
81
  /**
82
  * Execute activation functions.
83
  *
107
  ITSEC_Lib_Config_File::reset_wp_config();
108
  ITSEC_Lib_Config_File::reset_server_config();
109
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
110
  }
core/history.txt CHANGED
@@ -877,3 +877,26 @@
877
  5.7.4 - 2020-04-15 - Timothy Jacobs
878
  Bug Fix: Users with weak passwords would not be forced to change their password if the strong password requirement had been enabled after their password strength was checked.
879
  Bug Fix: PHP warning if downgrading from Pro to Free.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
877
  5.7.4 - 2020-04-15 - Timothy Jacobs
878
  Bug Fix: Users with weak passwords would not be forced to change their password if the strong password requirement had been enabled after their password strength was checked.
879
  Bug Fix: PHP warning if downgrading from Pro to Free.
880
+ 5.7.5 - 2020-04-20 - Timothy Jacobs
881
+ Bug Fix: PHP warning when evaluating password requirements.
882
+ 5.7.6 - 2020-05-18 - Timothy Jacobs
883
+ Tweak: Ensure randomly generated passwords are considered strong by the Strong Passwords library.
884
+ Tweak: Suggest a 32 character password when forcing a password change.
885
+ Bug Fix: PHP warning when a user's email address is updated outside of the user edit admin page.
886
+ Bug Fix: Fix login interstitials on WP Engine when using a front-end login form.
887
+ Bug Fix: PHP warning when checking opaque tokens.
888
+ Bug Fix: PHP warning after succesfully connecting a site to iThemes Sync via the login connection flow.
889
+ 5.8.0 - 2020-06-10 - Timothy Jacobs
890
+ New Feature: The new, improved WordPress Security Site Scan powered by iThemes checks if Google has detected malware and added your site to their blacklist
891
+ Enhancement: Remove quick bans. Persist banned hosts to .htaccess or nginx.conf on an hourly schedule.
892
+ Tweak: Cap banned hosts persisted to .htaccess or nginx.conf to the most recent 100. This number can be adjusted with the "itsec_ban_users_max_hosts_for_server_config" filter. Older banned hosts will be locked out after WordPress loads.
893
+ Bug Fix: File Change Security Message would not appear for new installs.
894
+ 5.8.1 - 2020-07-08 - Timothy Jacobs
895
+ Tweak: Update site scanner notification language to be less alarming.
896
+ Tweak: Change insensitive language to be more inclusive.
897
+ 5.8.2 - 2020-08-06 - Timothy Jacobs
898
+ Enhancement: Make the Site Scanner Report a configurable admin notice.
899
+ Tweak: Add a security message if a user needs to update their license information.
900
+ Tweak: Check if a licensed user is defined when checking license status.
901
+ Tweak: Use an opaque token for site scan verification to reduce invalid secret errors.
902
+ Bug Fix: Error when trying to run Security Check on new installations.
core/lib.php CHANGED
@@ -2055,4 +2055,61 @@ final class ITSEC_Lib {
2055
 
2056
  return $wp_error;
2057
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2058
  }
2055
 
2056
  return $wp_error;
2057
  }
2058
+
2059
+ /**
2060
+ * Evaluate whether this site passes the given requirements.
2061
+ *
2062
+ * @param array $requirements
2063
+ *
2064
+ * @return WP_Error
2065
+ */
2066
+ public static function evaluate_requirements( array $requirements ) {
2067
+ $schema = [
2068
+ 'type' => 'object',
2069
+ 'additionalProperties' => false,
2070
+ 'properties' => [
2071
+ 'version' => [
2072
+ 'type' => 'object',
2073
+ 'additionalProperties' => false,
2074
+ 'properties' => [
2075
+ 'pro' => [
2076
+ 'type' => 'string',
2077
+ 'required' => true,
2078
+ ],
2079
+ 'free' => [
2080
+ 'type' => 'string',
2081
+ 'required' => true,
2082
+ ],
2083
+ ],
2084
+ ],
2085
+ ],
2086
+ ];
2087
+
2088
+ $valid_requirements = rest_validate_value_from_schema( $requirements, $schema );
2089
+
2090
+ if ( is_wp_error( $valid_requirements ) ) {
2091
+ return $valid_requirements;
2092
+ }
2093
+
2094
+ $error = new WP_Error();
2095
+
2096
+ foreach ( $requirements as $kind => $requirement ) {
2097
+ switch ( $kind ) {
2098
+ case 'version':
2099
+ $key = ITSEC_Core::is_pro() ? 'pro' : 'free';
2100
+ $version = $requirement[ $key ];
2101
+
2102
+ if ( version_compare( ITSEC_Core::get_plugin_version(), $version, '<' ) ) {
2103
+ $error->add(
2104
+ 'version',
2105
+ sprintf( __( 'Must be running at least version %s of iThemes Security.', 'better-wp-security' ), $version )
2106
+ );
2107
+ }
2108
+
2109
+ break;
2110
+ }
2111
+ }
2112
+
2113
+ return $error;
2114
+ }
2115
  }
core/lib/admin-notices/class-itsec-admin-notice-highlighted-log.php CHANGED
@@ -104,7 +104,7 @@ class ITSEC_Admin_Notice_Highlighted_Log implements ITSEC_Admin_Notice {
104
  );
105
  }
106
 
107
- return $actions;
108
  }
109
 
110
  public function _handle_mute( WP_User $user, array $data ) {
104
  );
105
  }
106
 
107
+ return apply_filters( "itsec_highlighted_log_{$this->highlight_id}_actions", $actions, $this->log );
108
  }
109
 
110
  public function _handle_mute( WP_User $user, array $data ) {
core/lib/class-itsec-lib-feature-flags.php CHANGED
@@ -42,17 +42,50 @@ class ITSEC_Lib_Feature_Flags {
42
  'title' => '',
43
  'description' => '',
44
  'documentation' => '',
 
45
  ) );
46
 
47
  return true;
48
  }
49
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  /**
51
  * Get a list of all the available feature flags.
52
  *
53
  * @return array
54
  */
55
  public static function get_available_flags() {
 
 
 
 
 
 
 
 
 
 
 
56
  self::load();
57
 
58
  $flags = array();
@@ -93,6 +126,10 @@ class ITSEC_Lib_Feature_Flags {
93
  return false;
94
  }
95
 
 
 
 
 
96
  if ( defined( 'ITSEC_FF_' . $flag ) ) {
97
  // A constant overrules everything.
98
  return (bool) constant( 'ITSEC_FF_' . $flag );
@@ -149,6 +186,12 @@ class ITSEC_Lib_Feature_Flags {
149
  return [ 'unknown', __( 'Unknown flag' ) ];
150
  }
151
 
 
 
 
 
 
 
152
  if ( defined( 'ITSEC_FF_' . $flag ) ) {
153
  return [ 'constant', __( 'Manually configured with a constant.' ) ];
154
  }
42
  'title' => '',
43
  'description' => '',
44
  'documentation' => '',
45
+ 'requirements' => [],
46
  ) );
47
 
48
  return true;
49
  }
50
 
51
+ /**
52
+ * Is the given flag available to be enabled.
53
+ *
54
+ * @param string $flag
55
+ *
56
+ * @return bool
57
+ */
58
+ public static function is_available( $flag ) {
59
+ if ( ! $config = self::get_flag_config( $flag ) ) {
60
+ return false;
61
+ }
62
+
63
+ if ( ! $config['requirements'] ) {
64
+ return true;
65
+ }
66
+
67
+ $error = ITSEC_Lib::evaluate_requirements( $config['requirements'] );
68
+
69
+ return ! $error->has_errors();
70
+ }
71
+
72
  /**
73
  * Get a list of all the available feature flags.
74
  *
75
  * @return array
76
  */
77
  public static function get_available_flags() {
78
+ $flags = self::get_registered_flags();
79
+
80
+ return array_filter( $flags, [ __CLASS__, 'is_available' ], ARRAY_FILTER_USE_KEY );
81
+ }
82
+
83
+ /**
84
+ * Get a list of all registered flags.
85
+ *
86
+ * @return array
87
+ */
88
+ public static function get_registered_flags() {
89
  self::load();
90
 
91
  $flags = array();
126
  return false;
127
  }
128
 
129
+ if ( ! self::is_available( $flag ) ) {
130
+ return false;
131
+ }
132
+
133
  if ( defined( 'ITSEC_FF_' . $flag ) ) {
134
  // A constant overrules everything.
135
  return (bool) constant( 'ITSEC_FF_' . $flag );
186
  return [ 'unknown', __( 'Unknown flag' ) ];
187
  }
188
 
189
+ if ( ! self::is_available( $flag ) ) {
190
+ $evaluation = ITSEC_Lib::evaluate_requirements( $config['requirements'] );
191
+
192
+ return [ 'requirements', $evaluation->get_error_message() ];
193
+ }
194
+
195
  if ( defined( 'ITSEC_FF_' . $flag ) ) {
196
  return [ 'constant', __( 'Manually configured with a constant.' ) ];
197
  }
core/lib/class-itsec-lib-jwt.php ADDED
@@ -0,0 +1,368 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * JSON Web Token implementation, based on this spec:
5
+ * https://tools.ietf.org/html/rfc7519
6
+ *
7
+ * PHP version 5
8
+ *
9
+ * @category Authentication
10
+ * @package Authentication_JWT
11
+ * @author Neuman Vong <neuman@twilio.com>
12
+ * @author Anant Narayanan <anant@php.net>
13
+ * @license http://opensource.org/licenses/BSD-3-Clause 3-clause BSD
14
+ * @link https://github.com/firebase/php-jwt
15
+ *
16
+ * Forked to follow WordPress Coding Standards and provide additional APIs.
17
+ */
18
+ final class ITSEC_Lib_JWT {
19
+ /**
20
+ * When checking nbf, iat or expiration times,
21
+ * we want to provide some extra leeway time to
22
+ * account for clock skew.
23
+ */
24
+ public static $leeway = 0;
25
+
26
+ /**
27
+ * Allow the current timestamp to be specified.
28
+ * Useful for fixing a value within unit testing.
29
+ *
30
+ * Will default to PHP time() value if null.
31
+ */
32
+ public static $timestamp = null;
33
+
34
+ protected static $supported_algs = array(
35
+ 'HS256' => array( 'hash_hmac', 'SHA256' ),
36
+ 'HS512' => array( 'hash_hmac', 'SHA512' ),
37
+ 'HS384' => array( 'hash_hmac', 'SHA384' ),
38
+ 'RS256' => array( 'openssl', 'SHA256' ),
39
+ 'RS384' => array( 'openssl', 'SHA384' ),
40
+ 'RS512' => array( 'openssl', 'SHA512' ),
41
+ );
42
+
43
+ /**
44
+ * Decodes a JWT string into a PHP object.
45
+ *
46
+ * @param string $jwt The JWT
47
+ * @param string|array $key The key, or map of keys.
48
+ * If the algorithm used is asymmetric, this is the public key
49
+ * @param array $allowed_algs List of supported verification algorithms
50
+ * Supported algorithms are 'HS256', 'HS384', 'HS512' and 'RS256'
51
+ * @param string $confirm_unsecure Must be set to "unsecure" to allow using the "none" algorithm.
52
+ *
53
+ * @return object|\WP_Error The JWT's payload as a PHP object
54
+ *
55
+ * @uses json_decode
56
+ * @uses url_safe_b64_decode
57
+ */
58
+ public static function decode( $jwt, $key, array $allowed_algs = array(), $confirm_unsecure = '' ) {
59
+ $timestamp = is_null( static::$timestamp ) ? time() : static::$timestamp;
60
+ $allow_unsecured = in_array( 'none', $allowed_algs, true );
61
+
62
+ if ( $allow_unsecured && 'unsecure' !== $confirm_unsecure ) {
63
+ return new \WP_Error( 'jwt_unsecure_not_confirmed', __( 'Did not confirm that "none" is an allowed algorithm.', 'oauth2' ) );
64
+ }
65
+
66
+ if ( empty( $key ) && ! $allow_unsecured ) {
67
+ return new \WP_Error( 'jwt_empty_key', __( 'Key may not be empty', 'oauth2' ) );
68
+ }
69
+
70
+ $parsed = self::parse_jwt( $jwt );
71
+
72
+ if ( is_wp_error( $parsed ) ) {
73
+ return $parsed;
74
+ }
75
+
76
+ list( $header, $payload, $sig, $headb64, $bodyb64 ) = $parsed;
77
+
78
+ if ( empty( $header->alg ) ) {
79
+ return new \WP_Error( 'jwt_invalid_format', __( 'Empty algorithm', 'oauth2' ) );
80
+ }
81
+
82
+ if ( 'none' !== $header->alg || ! $allow_unsecured ) {
83
+ if ( empty( static::$supported_algs[ $header->alg ] ) ) {
84
+ return new \WP_Error( 'jwt_unsupported_algorithm', __( 'Algorithm not supported', 'oauth2' ) );
85
+ }
86
+
87
+ if ( ! in_array( $header->alg, $allowed_algs, true ) ) {
88
+ return new \WP_Error( 'jwt_disallowed_algorithm', __( 'Algorithm not allowed', 'oauth2' ) );
89
+ }
90
+
91
+ if ( is_array( $key ) || $key instanceof \ArrayAccess ) {
92
+ if ( isset( $header->kid ) ) {
93
+ if ( ! isset( $key[ $header->kid ] ) ) {
94
+ return new \WP_Error( 'jwt_invalid_key', __( '"kid" invalid, unable to lookup correct key', 'oauth2' ) );
95
+ }
96
+
97
+ $key = $key[ $header->kid ];
98
+ } else {
99
+ return new \WP_Error( 'jwt_invalid_key', __( '"kid" empty, unable to lookup correct key', 'oauth2' ) );
100
+ }
101
+ }
102
+
103
+ // Check the signature
104
+ $verified = static::verify( "$headb64.$bodyb64", $sig, $key, $header->alg );
105
+
106
+ if ( is_wp_error( $verified ) ) {
107
+ return $verified;
108
+ }
109
+
110
+ if ( true !== $verified ) {
111
+ return new \WP_Error( 'jwt_invalid_signature', __( 'Signature verification failed', 'oauth2' ) );
112
+ }
113
+ }
114
+
115
+ // Check if the nbf if it is defined. This is the time that the
116
+ // token can actually be used. If it's not yet that time, abort.
117
+ if ( isset( $payload->nbf ) && $payload->nbf > ( $timestamp + static::$leeway ) ) {
118
+ return new \WP_Error(
119
+ 'jwt_before_valid',
120
+ sprintf(
121
+ /* translators: %s Date/Time the JWT is valid. */
122
+ __( 'Cannot handle token prior to %s.', 'oauth2' ),
123
+ wp_date( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), $payload->nbf )
124
+ ),
125
+ array( 'nbf' => $payload->nbf )
126
+ );
127
+ }
128
+
129
+ // Check that this token has been created before 'now'. This prevents
130
+ // using tokens that have been created for later use (and haven't
131
+ // correctly used the nbf claim).
132
+ if ( isset( $payload->iat ) && $payload->iat > ( $timestamp + static::$leeway ) ) {
133
+ return new \WP_Error(
134
+ 'jwt_before_valid',
135
+ sprintf(
136
+ /* translators: %s Date/Time the JWT is valid. */
137
+ __( 'Cannot handle token prior to %s.', 'oauth2' ),
138
+ wp_date( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), $payload->iat )
139
+ ),
140
+ array( 'iat' => $payload->iat )
141
+ );
142
+ }
143
+
144
+ // Check if this token has expired.
145
+ if ( isset( $payload->exp ) && ( $timestamp - static::$leeway ) >= $payload->exp ) {
146
+ return new \WP_Error( 'jwt_expired', __( 'Expired token', 'oauth2' ), array( 'exp' => $payload->exp ) );
147
+ }
148
+
149
+ return $payload;
150
+ }
151
+
152
+ /**
153
+ * Parses a JWT into it's component parts.
154
+ *
155
+ * @param string $jwt
156
+ *
157
+ * @return array|\WP_Error
158
+ */
159
+ protected static function parse_jwt( $jwt ) {
160
+ $tks = explode( '.', $jwt );
161
+
162
+ if ( 3 !== count( $tks ) ) {
163
+ return new \WP_Error( 'jwt_invalid_format', __( 'Wrong number of segments', 'oauth2' ) );
164
+ }
165
+
166
+ list( $headb64, $bodyb64, $cryptob64 ) = $tks;
167
+
168
+ if ( null === ( $header = static::json_decode( static::url_safe_b64_decode( $headb64 ) ) ) ) {
169
+ return new \WP_Error( 'jwt_invalid_format', __( 'Invalid header encoding', 'oauth2' ) );
170
+ }
171
+
172
+ if ( null === $payload = static::json_decode( static::url_safe_b64_decode( $bodyb64 ) ) ) {
173
+ return new \WP_Error( 'jwt_invalid_format', __( 'Invalid claims encoding', 'oauth2' ) );
174
+ }
175
+
176
+ if ( false === ( $sig = static::url_safe_b64_decode( $cryptob64 ) ) ) {
177
+ return new \WP_Error( 'jwt_invalid_format', __( 'Invalid signature encoding', 'oauth2' ) );
178
+ }
179
+
180
+ return array( $header, $payload, $sig, $headb64, $bodyb64, $cryptob64 );
181
+ }
182
+
183
+ /**
184
+ * Converts and signs a PHP object or array into a JWT string.
185
+ *
186
+ * @param object|array $payload PHP object or array
187
+ * @param string $key The secret key.
188
+ * If the algorithm used is asymmetric, this is the private key
189
+ * @param string $alg The signing algorithm.
190
+ * Supported algorithms are 'HS256', 'HS384', 'HS512' and 'RS256'
191
+ * @param mixed $key_id
192
+ * @param array $head An array with header elements to attach
193
+ *
194
+ * @return string A signed JWT
195
+ *
196
+ * @uses json_encode
197
+ * @uses url_safe_b64_encode
198
+ */
199
+ public static function encode( $payload, $key, $alg = 'HS256', $key_id = null, $head = null ) {
200
+ $header = array( 'typ' => 'JWT', 'alg' => $alg );
201
+ if ( $key_id !== null ) {
202
+ $header['kid'] = $key_id;
203
+ }
204
+ if ( is_array( $head ) ) {
205
+ $header = array_merge( $head, $header );
206
+ }
207
+ $segments = array();
208
+ $segments[] = static::url_safe_b64_encode( static::json_encode( $header ) );
209
+ $segments[] = static::url_safe_b64_encode( static::json_encode( $payload ) );
210
+ $signing_input = implode( '.', $segments );
211
+
212
+ if ( 'none' === $alg ) {
213
+ $signature = '';
214
+ } else {
215
+ $signature = static::sign( $signing_input, $key, $alg );
216
+ }
217
+
218
+ if ( is_wp_error( $signature ) ) {
219
+ return $signature;
220
+ }
221
+
222
+ $segments[] = static::url_safe_b64_encode( $signature );
223
+
224
+ return implode( '.', $segments );
225
+ }
226
+
227
+ /**
228
+ * Gets the list of support algorithms.
229
+ *
230
+ * @return \string[][]
231
+ */
232
+ public static function get_supported_algos() {
233
+ return static::$supported_algs;
234
+ }
235
+
236
+ /**
237
+ * Sign a string with a given key and algorithm.
238
+ *
239
+ * @param string $msg The message to sign
240
+ * @param string|resource $key The secret key
241
+ * @param string $alg The signing algorithm.
242
+ * Supported algorithms are 'HS256', 'HS384', 'HS512' and 'RS256'
243
+ *
244
+ * @return string|\WP_Error An encrypted message
245
+ */
246
+ protected static function sign( $msg, $key, $alg = 'HS256' ) {
247
+ if ( empty( static::$supported_algs[ $alg ] ) ) {
248
+ return new \WP_Error( 'jwt_unsupported_algorithm', __( 'Algorithm not supported', 'oauth2' ) );
249
+ }
250
+
251
+ list( $function, $algorithm ) = static::$supported_algs[ $alg ];
252
+
253
+ switch ( $function ) {
254
+ case 'hash_hmac':
255
+ return hash_hmac( $algorithm, $msg, $key, true );
256
+ case 'openssl':
257
+ $signature = '';
258
+ $success = openssl_sign( $msg, $signature, $key, $algorithm );
259
+
260
+ if ( ! $success ) {
261
+ return new \WP_Error( 'jwt_openssl_error', __( 'OpenSSL unable to sign data', 'oauth2' ) );
262
+ }
263
+
264
+ return $signature;
265
+ }
266
+
267
+ return new \WP_Error( 'jwt_unsupported_algorithm', __( 'Algorithm not supported', 'oauth2' ) );
268
+ }
269
+
270
+ /**
271
+ * Verify a signature with the message, key and method. Not all methods
272
+ * are symmetric, so we must have a separate verify and sign method.
273
+ *
274
+ * @param string $msg The original message (header and body)
275
+ * @param string $signature The original signature
276
+ * @param string|resource $key For HS*, a string key works. for RS*, must be a resource of an openssl public key
277
+ * @param string $alg The algorithm
278
+ *
279
+ * @return bool|\WP_Error
280
+ */
281
+ protected static function verify( $msg, $signature, $key, $alg ) {
282
+ if ( empty( static::$supported_algs[ $alg ] ) ) {
283
+ return new \WP_Error( 'jwt_unsupported_algorithm', __( 'Algorithm not supported', 'oauth2' ) );
284
+ }
285
+
286
+ list( $function, $algorithm ) = static::$supported_algs[ $alg ];
287
+ switch ( $function ) {
288
+ case 'openssl':
289
+ $success = openssl_verify( $msg, $signature, $key, $algorithm );
290
+ if ( $success === 1 ) {
291
+ return true;
292
+ }
293
+
294
+ if ( $success === 0 ) {
295
+ return false;
296
+ }
297
+
298
+ return new \WP_Error( 'jwt_openssl_error', openssl_error_string() );
299
+ case 'hash_hmac':
300
+ default:
301
+ $hash = hash_hmac( $algorithm, $msg, $key, true );
302
+
303
+ return hash_equals( $signature, $hash );
304
+ }
305
+ }
306
+
307
+ /**
308
+ * Decode a JSON string into a PHP object.
309
+ *
310
+ * @param string $input JSON string
311
+ *
312
+ * @return object|\WP_Error Object representation of JSON string
313
+ */
314
+ protected static function json_decode( $input ) {
315
+ $obj = json_decode( $input, false, 512, JSON_BIGINT_AS_STRING );
316
+
317
+ if ( $errno = json_last_error() ) {
318
+ return new \WP_Error( 'jwt_cannot_decode_json', json_last_error_msg(), array( 'code' => $errno ) );
319
+ }
320
+
321
+ return $obj;
322
+ }
323
+
324
+ /**
325
+ * Encode a PHP object into a JSON string.
326
+ *
327
+ * @param object|array $input A PHP object or array
328
+ *
329
+ * @return string|\WP_Error JSON representation of the PHP object or array
330
+ */
331
+ protected static function json_encode( $input ) {
332
+ $json = json_encode( $input );
333
+
334
+ if ( $errno = json_last_error() ) {
335
+ return new \WP_Error( 'jwt_cannot_encode_json', json_last_error_msg(), array( 'code' => $errno ) );
336
+ }
337
+
338
+ return $json;
339
+ }
340
+
341
+ /**
342
+ * Decode a string with URL-safe Base64.
343
+ *
344
+ * @param string $input A Base64 encoded string
345
+ *
346
+ * @return string A decoded string
347
+ */
348
+ protected static function url_safe_b64_decode( $input ) {
349
+ $remainder = strlen( $input ) % 4;
350
+ if ( $remainder ) {
351
+ $padlen = 4 - $remainder;
352
+ $input .= str_repeat( '=', $padlen );
353
+ }
354
+
355
+ return base64_decode( strtr( $input, '-_', '+/' ) );
356
+ }
357
+
358
+ /**
359
+ * Encode a string with URL-safe Base64.
360
+ *
361
+ * @param string $input The string you want encoded
362
+ *
363
+ * @return string The base64 encode of what you passed in
364
+ */
365
+ protected static function url_safe_b64_encode( $input ) {
366
+ return str_replace( '=', '', strtr( base64_encode( $input ), '+/', '-_' ) );
367
+ }
368
+ }
core/lib/class-itsec-lib-login-interstitial.php CHANGED
@@ -570,7 +570,7 @@ class ITSEC_Lib_Login_Interstitial {
570
  $session = $this->get_and_verify_session();
571
 
572
  if ( ! $interstitial->show_to_user( $session->get_user(), $session->is_current_requested() ) ) {
573
- wp_safe_redirect( set_url_scheme( wp_login_url(), 'login_post' ) );
574
  die;
575
  }
576
 
@@ -903,8 +903,9 @@ class ITSEC_Lib_Login_Interstitial {
903
  private function get_base_wp_login_url() {
904
  $wp_login_url = set_url_scheme( wp_login_url(), 'login_post' );
905
 
906
- if ( isset( $_GET['wpe-login'] ) && ! preg_match( '/[&?]wpe-login=/', $wp_login_url ) ) {
907
- $wp_login_url = add_query_arg( 'wpe-login', $_GET['wpe-login'], $wp_login_url );
 
908
  }
909
 
910
  return $wp_login_url;
570
  $session = $this->get_and_verify_session();
571
 
572
  if ( ! $interstitial->show_to_user( $session->get_user(), $session->is_current_requested() ) ) {
573
+ wp_safe_redirect( wp_login_url() );
574
  die;
575
  }
576
 
903
  private function get_base_wp_login_url() {
904
  $wp_login_url = set_url_scheme( wp_login_url(), 'login_post' );
905
 
906
+ if ( ( defined( 'WPE_PLUGIN_URL' ) || isset( $_GET['wpe-login'] ) ) && ! preg_match( '/[&?]wpe-login=/', $wp_login_url ) ) {
907
+ $wpe_login = isset( $_GET['wpe-login'] ) ? $_GET['wpe-login'] : 'true';
908
+ $wp_login_url = add_query_arg( 'wpe-login', $wpe_login, $wp_login_url );
909
  }
910
 
911
  return $wp_login_url;
core/lib/class-itsec-lib-opaque-tokens.php CHANGED
@@ -45,7 +45,7 @@ class ITSEC_Lib_Opaque_Tokens {
45
  return new WP_Error( self::E_MISSING, __( 'Token not found.', 'better-wp-security' ) );
46
  }
47
 
48
- if ( $data['token_created_at'] + $ttl > ITSEC_Core::get_current_time_gmt() ) {
49
  self::delete_token( $token );
50
 
51
  return new WP_Error( self::E_EXPIRED, __( 'Token expired.', 'better-wp-security' ) );
45
  return new WP_Error( self::E_MISSING, __( 'Token not found.', 'better-wp-security' ) );
46
  }
47
 
48
+ if ( strtotime( $data['token_created_at'] ) + $ttl < ITSEC_Core::get_current_time_gmt() ) {
49
  self::delete_token( $token );
50
 
51
  return new WP_Error( self::E_EXPIRED, __( 'Token expired.', 'better-wp-security' ) );
core/lib/class-itsec-lib-password-requirements.php CHANGED
@@ -50,24 +50,32 @@ class ITSEC_Lib_Password_Requirements {
50
  ( array_key_exists( 'validate', $opts ) || array_key_exists( 'evaluate', $opts ) ) &&
51
  ( ! is_callable( $merged['validate'] ) || ! is_callable( $merged['evaluate'] ) )
52
  ) {
 
53
  return;
54
  }
55
 
56
  if ( array_key_exists( 'flag_check', $opts ) && ! is_callable( $merged['flag_check'] ) ) {
 
 
57
  return;
58
  }
59
 
60
  if ( array_key_exists( 'defaults', $opts ) ) {
61
  if ( ! is_array( $merged['defaults'] ) ) {
 
62
  return;
63
  }
64
 
65
  if ( ! array_key_exists( 'settings_config', $opts ) ) {
 
 
66
  return;
67
  }
68
  }
69
 
70
  if ( array_key_exists( 'settings_config', $opts ) && ! is_callable( $merged['settings_config'] ) ) {
 
 
71
  return;
72
  }
73
 
50
  ( array_key_exists( 'validate', $opts ) || array_key_exists( 'evaluate', $opts ) ) &&
51
  ( ! is_callable( $merged['validate'] ) || ! is_callable( $merged['evaluate'] ) )
52
  ) {
53
+ _doing_it_wrong( __METHOD__, 'Validate and evaluate must be callable if defined.', '5.8.0' );
54
  return;
55
  }
56
 
57
  if ( array_key_exists( 'flag_check', $opts ) && ! is_callable( $merged['flag_check'] ) ) {
58
+ _doing_it_wrong( __METHOD__, 'Flag check must be callable if defined.', '5.8.0' );
59
+
60
  return;
61
  }
62
 
63
  if ( array_key_exists( 'defaults', $opts ) ) {
64
  if ( ! is_array( $merged['defaults'] ) ) {
65
+ _doing_it_wrong( __METHOD__, 'Defaults must be an array if defined.', '5.8.0' );
66
  return;
67
  }
68
 
69
  if ( ! array_key_exists( 'settings_config', $opts ) ) {
70
+ _doing_it_wrong( __METHOD__, 'Settings config must be defined if defaults are provided.', '5.8.0' );
71
+
72
  return;
73
  }
74
  }
75
 
76
  if ( array_key_exists( 'settings_config', $opts ) && ! is_callable( $merged['settings_config'] ) ) {
77
+ _doing_it_wrong( __METHOD__, 'Settings config must be a callable if defined.', '5.8.0' );
78
+
79
  return;
80
  }
81
 
core/lib/class-itsec-lib-remote-messages.php CHANGED
@@ -98,9 +98,11 @@ class ITSEC_Lib_Remote_Messages {
98
  return new WP_Error( 'invalid_json', __( 'Invalid json response.', 'better-wp-security' ) );
99
  }
100
 
 
 
101
  update_site_option( self::OPTION, array(
102
- 'response' => self::sanitize_response( $json ),
103
- 'ttl' => $json['ttl'],
104
  'requested' => ITSEC_Core::get_current_time_gmt(),
105
  ) );
106
 
@@ -123,6 +125,7 @@ class ITSEC_Lib_Remote_Messages {
123
  ) );
124
 
125
  $sanitized = array(
 
126
  'messages' => array(),
127
  'features' => array(),
128
  'actions' => wp_parse_slug_list( $json['actions'] ),
@@ -138,8 +141,9 @@ class ITSEC_Lib_Remote_Messages {
138
 
139
  foreach ( $json['features'] as $feature => $f_config ) {
140
  $sanitized['features'][ $feature ] = [
141
- 'rate' => isset( $f_config['rate'] ) ? (int) $f_config['rate'] : false,
142
- 'disabled' => ! empty( $f_config['disabled'] ),
 
143
  ];
144
  }
145
 
98
  return new WP_Error( 'invalid_json', __( 'Invalid json response.', 'better-wp-security' ) );
99
  }
100
 
101
+ $sanitized = self::sanitize_response( $json );
102
+
103
  update_site_option( self::OPTION, array(
104
+ 'response' => $sanitized,
105
+ 'ttl' => $sanitized['ttl'],
106
  'requested' => ITSEC_Core::get_current_time_gmt(),
107
  ) );
108
 
125
  ) );
126
 
127
  $sanitized = array(
128
+ 'ttl' => absint( $json['ttl'] ),
129
  'messages' => array(),
130
  'features' => array(),
131
  'actions' => wp_parse_slug_list( $json['actions'] ),
141
 
142
  foreach ( $json['features'] as $feature => $f_config ) {
143
  $sanitized['features'][ $feature ] = [
144
+ 'rate' => isset( $f_config['rate'] ) ? (int) $f_config['rate'] : false,
145
+ 'disabled' => ! empty( $f_config['disabled'] ),
146
+ 'requirements' => isset( $f_config['requirements'] ) && is_array( $f_config['requirements'] ) ? $f_config['requirements'] : [],
147
  ];
148
  }
149
 
core/lib/class-itsec-lib-rest.php CHANGED
@@ -2,6 +2,7 @@
2
 
3
  class ITSEC_Lib_REST {
4
  const LINK_REL = 'https://s.api.ithemes.com/l/ithemes-security/';
 
5
 
6
  /**
7
  * Get the URI for an iThemes Security link relation.
@@ -82,4 +83,36 @@ class ITSEC_Lib_REST {
82
 
83
  return $prev;
84
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
  }
2
 
3
  class ITSEC_Lib_REST {
4
  const LINK_REL = 'https://s.api.ithemes.com/l/ithemes-security/';
5
+ const DATE_FORMAT = 'Y-m-d\TH:i:sP';
6
 
7
  /**
8
  * Get the URI for an iThemes Security link relation.
83
 
84
  return $prev;
85
  }
86
+
87
+ /**
88
+ * Gets a Bearer token from the Authorization header.
89
+ *
90
+ * @param string $header
91
+ *
92
+ * @return string
93
+ */
94
+ public static function get_token_from_auth_header( $header ) {
95
+ $prefix = 'Bearer ';
96
+
97
+ if ( 0 !== strpos( $header, $prefix ) ) {
98
+ return '';
99
+ }
100
+
101
+ return trim( substr( $header, strlen( $prefix ) ) );
102
+ }
103
+
104
+ /**
105
+ * Gets the authorization status code to use.
106
+ *
107
+ * @param WP_User|null $user
108
+ *
109
+ * @return int
110
+ */
111
+ public static function auth_code_required( $user = null ) {
112
+ if ( func_num_args() === 0 ) {
113
+ return rest_authorization_required_code();
114
+ }
115
+
116
+ return $user instanceof WP_User && $user->exists() ? 403 : 401;
117
+ }
118
  }
core/lib/class-itsec-lib-upgrader.php ADDED
@@ -0,0 +1,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class ITSEC_Lib_Upgrader {
4
+
5
+ /**
6
+ * Gets the update available for a plugin.
7
+ *
8
+ * @param string $plugin The plugin file.
9
+ *
10
+ * @return array|WP_Error
11
+ */
12
+ public function get_available_plugin_update( $plugin ) {
13
+ $update_plugins = get_site_transient( 'update_plugins' );
14
+
15
+ if ( empty( $update_plugins ) || empty( $update_plugins->response ) || empty( $update_plugins->response[ $plugin ] ) ) {
16
+ return new WP_Error( 'itsec_updates_no_update', esc_html__( 'No update is listed for the plugin.', 'better-wp-security' ) );
17
+ }
18
+
19
+ $api = $update_plugins->response[ $plugin ];
20
+
21
+ if ( ! empty( $api->requires_php ) && ! is_php_version_compatible( $api->requires_php ) ) {
22
+ $message = sprintf(
23
+ esc_html__( 'An update to version %1$s is available, but it doesn&#8217;t work with your version of PHP. %2$sLearn more about updating PHP%3$s.', 'better-wp-security' ),
24
+ $api->new_version,
25
+ '<a href="' . esc_url( wp_get_update_php_url() ) . '">',
26
+ '</a>'
27
+ );
28
+
29
+ return new WP_Error( 'itsec_updates_incompatible_php', $message, [ 'requires_php' => $api->requires_php ] );
30
+ }
31
+
32
+ if ( empty( $api->package ) ) {
33
+ return new WP_Error( 'itsec_updates_missing_package', esc_html__( 'An available update is listed, but automatic updates are not configured.', 'better-wp-security' ) );
34
+ }
35
+
36
+ return [
37
+ 'version' => $api->new_version,
38
+ 'package' => $api->package,
39
+ ];
40
+ }
41
+
42
+ /**
43
+ * Gets the update available for a theme.
44
+ *
45
+ * @param string $theme The theme slug.
46
+ *
47
+ * @return array|WP_Error
48
+ */
49
+ public function get_available_theme_update( $theme ) {
50
+ $update_themes = get_site_transient( 'update_themes' );
51
+
52
+ if ( empty( $update_themes ) || empty( $update_themes->response ) || empty( $update_themes->response[ $theme ] ) ) {
53
+ return new WP_Error( 'itsec_updates_no_update', esc_html__( 'No update is listed for the theme.', 'better-wp-security' ) );
54
+ }
55
+
56
+ $api = $update_themes->response[ $theme ];
57
+
58
+ if ( empty( $api['package'] ) ) {
59
+ return new WP_Error( 'itsec_updates_missing_package', esc_html__( 'An available update is listed, but automatic updates are not configured.', 'better-wp-security' ) );
60
+ }
61
+
62
+ return [
63
+ 'version' => $api['new_version'],
64
+ 'package' => $api['package'],
65
+ ];
66
+ }
67
+
68
+ /**
69
+ * Updates the plugin to the latest version.
70
+ *
71
+ * @param string $plugin The plugin file.
72
+ *
73
+ * @return true|WP_Error
74
+ */
75
+ public function update_plugin( $plugin ) {
76
+ require_once( ABSPATH . 'wp-admin/includes/file.php' );
77
+ require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
78
+ require_once( ABSPATH . 'wp-admin/includes/misc.php' );
79
+ require_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
80
+
81
+ $skin = new ITSEC_Upgrader_Skin();
82
+ $plugin_upgrader = new Plugin_Upgrader( $skin );
83
+
84
+ $result = $plugin_upgrader->upgrade( $plugin, array( 'clear_update_cache' => false ) );
85
+
86
+ if ( is_wp_error( $result ) ) {
87
+ return $result;
88
+ }
89
+
90
+ if ( $skin->errors ) {
91
+ $strings = array_merge( ...array_map( 'ITSEC_Response::get_error_strings', $skin->errors ) );
92
+
93
+ return new WP_Error( 'itsec_updates_update_error', wp_sprintf(
94
+ esc_html__( 'Unable to update the plugin: %l', 'better-wp-security' ),
95
+ $strings
96
+ ) );
97
+ }
98
+
99
+ if ( false === $result ) {
100
+ return new WP_Error( 'itsec_updates_unknown_update_error', esc_html__( 'An unknown issue prevented the update from completing.', 'better-wp-security' ) );
101
+ }
102
+
103
+ wp_clean_plugins_cache();
104
+ wp_update_plugins();
105
+
106
+ return true;
107
+ }
108
+
109
+ /**
110
+ * Updates the theme to the latest version.
111
+ *
112
+ * @param string $theme
113
+ *
114
+ * @return true|WP_Error
115
+ */
116
+ public function update_theme( $theme ) {
117
+ require_once( ABSPATH . 'wp-admin/includes/file.php' );
118
+ require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
119
+ require_once( ABSPATH . 'wp-admin/includes/misc.php' );
120
+ require_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
121
+
122
+ $skin = new ITSEC_Upgrader_Skin();
123
+ $upgrader = new Theme_Upgrader( $skin );
124
+ $result = $upgrader->upgrade( $theme, array( 'clear_update_cache' => false ) );
125
+
126
+ if ( is_wp_error( $result ) ) {
127
+ return $result;
128
+ }
129
+
130
+ if ( $skin->errors ) {
131
+ $strings = array_merge( ...array_map( 'ITSEC_Response::get_error_strings', $skin->errors ) );
132
+
133
+ return new WP_Error( 'itsec_updates_update_error', wp_sprintf(
134
+ esc_html__( 'Unable to update the theme: %l', 'better-wp-security' ),
135
+ $strings
136
+ ) );
137
+ }
138
+
139
+ if ( false === $result ) {
140
+ return new WP_Error( 'itsec_updates_unknown_update_error', esc_html__( 'An unknown issue prevented the update from completing.', 'better-wp-security' ) );
141
+ }
142
+
143
+ wp_clean_themes_cache();
144
+ wp_update_themes();
145
+
146
+ return true;
147
+ }
148
+ }
core/lib/class-itsec-scheduler.php CHANGED
@@ -220,6 +220,24 @@ abstract class ITSEC_Scheduler {
220
  * @param ITSEC_Scheduler $this
221
  */
222
  do_action( 'itsec_scheduler_register_events', $this );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
223
  }
224
 
225
  /**
220
  * @param ITSEC_Scheduler $this
221
  */
222
  do_action( 'itsec_scheduler_register_events', $this );
223
+ $this->register_events_for_module( ':active' );
224
+ }
225
+
226
+ /**
227
+ * Registers events for a given module using the "scheduling.php" module file.
228
+ *
229
+ * @param string $module
230
+ */
231
+ public function register_events_for_module( $module ) {
232
+ ITSEC_Modules::load_module_file( 'scheduling.php', $module, function ( $fn ) {
233
+ if ( ! is_callable( $fn ) ) {
234
+ _doing_it_wrong( 'scheduling.php', __( 'An iThemes Security module\'s scheduling.php file must return a callable.', 'better-wp-security' ), '5.8.0' );
235
+
236
+ return;
237
+ }
238
+
239
+ $fn( $this );
240
+ } );
241
  }
242
 
243
  /**
core/lib/debug.php CHANGED
@@ -1,11 +1,17 @@
1
  <?php
2
 
3
  final class ITSEC_Debug {
4
- public static function print_r( $data, $args = array() ) {
5
- echo "<style>.wp-admin .it-debug-print-r { margin-left: 170px; } .wp-admin #wpcontent .it-debug-print-r { margin-left: 0; }</style>\n";
6
- echo "<pre style='color:black;background:white;padding:15px;font-family:\"Courier New\",Courier,monospace;font-size:12px;white-space:pre-wrap;text-align:left;max-width:100%;' class='it-debug-print-r'>";
7
- echo self::get_print_r( $data, $args );
8
- echo "</pre>\n";
 
 
 
 
 
 
9
  }
10
 
11
  public static function get_print_r( $data, $args = array() ) {
1
  <?php
2
 
3
  final class ITSEC_Debug {
4
+ public static function print_r( $data, $args = array(), $echo = true ) {
5
+ $html = "<style>.wp-admin .it-debug-print-r { margin-left: 170px; } .wp-admin #wpcontent .it-debug-print-r { margin-left: 0; }</style>\n";
6
+ $html .= "<pre style='color:black;background:white;padding:15px;font-family:\"Courier New\",Courier,monospace;font-size:12px;white-space:pre-wrap;text-align:left;max-width:100%;' class='it-debug-print-r'>";
7
+ $html .= self::get_print_r( $data, $args );
8
+ $html .= "</pre>\n";
9
+
10
+ if ( $echo ) {
11
+ echo $html;
12
+ }
13
+
14
+ return $html;
15
  }
16
 
17
  public static function get_print_r( $data, $args = array() ) {
core/lib/upgrader-skin.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ final class ITSEC_Upgrader_Skin extends Automatic_Upgrader_Skin {
4
+ public $errors = [];
5
+
6
+ public function error( $errors ) {
7
+ $this->errors[] = $errors;
8
+
9
+ if ( ! empty( $this->options['add_to_response'] ) && ! empty( $this->plugin_info ) ) {
10
+ ITSEC_Response::add_error(
11
+ new WP_Error( 'itsec-plugin-update-failed', sprintf(
12
+ __( 'Unable to update the %1$s plugin. %2$s', 'better-wp-security' ),
13
+ $this->plugin_info['Name'],
14
+ wp_sprintf('%l', ITSEC_Response::get_error_strings( $errors ) )
15
+ ) )
16
+ );
17
+ }
18
+ }
19
+
20
+ public function request_filesystem_credentials( $error = false, $context = '', $allow_relaxed_file_ownership = false ) {
21
+ if ( ! function_exists( 'submit_button' ) ) {
22
+ require_once( ABSPATH . 'wp-admin/includes/template.php' );
23
+ }
24
+
25
+ $r = parent::request_filesystem_credentials( $error, $context, $allow_relaxed_file_ownership );
26
+
27
+ if ( false === $r ) {
28
+ $this->error( __( 'Could not request filesystem credentials.', 'better-wp-security' ) );
29
+ }
30
+
31
+ return $r;
32
+ }
33
+ }
core/lockout.php CHANGED
@@ -847,7 +847,7 @@ final class ITSEC_Lockout {
847
  $description .= '</li><li>';
848
  $description .= sprintf( __( '<strong>User lockout message:</strong> %s', 'better-wp-security' ), ITSEC_Modules::get_setting( 'global', 'user_lockout_message' ) );
849
  $description .= '</li><li>';
850
- $description .= sprintf( __( '<strong>Is this computer white-listed:</strong> %s', 'better-wp-security' ), ITSEC_Lib::is_ip_whitelisted( ITSEC_Lib::get_ip() ) === true ? __( 'yes', 'better-wp-security' ) : __( 'no', 'better-wp-security' ) );
851
  $description .= '</li></ul>';
852
 
853
  return $description;
@@ -1374,11 +1374,11 @@ final class ITSEC_Lockout {
1374
  $entry['module_display'] = esc_html__( 'Lockout', 'better-wp-security' );
1375
 
1376
  if ( 'whitelisted-host-triggered-blacklist' === $code ) {
1377
- $entry['description'] = esc_html__( 'Whitelisted Host Triggered Blacklist', 'better-wp-security' );
1378
  } elseif ( 'host-triggered-blacklist' === $code ) {
1379
- $entry['description'] = esc_html__( 'Host Triggered Blacklist', 'better-wp-security' );
1380
  } elseif ( 'whitelisted-host-triggered-host-lockout' === $code ) {
1381
- $entry['description'] = esc_html__( 'Whitelisted Host Triggered Host Lockout', 'better-wp-security' );
1382
  } elseif ( 'host-lockout' === $code ) {
1383
  if ( isset( $data[0] ) ) {
1384
  $entry['description'] = sprintf( wp_kses( __( 'Host Lockout: <code>%s</code>', 'better-wp-security' ), array( 'code' => array() ) ), $data[0] );
@@ -1386,7 +1386,7 @@ final class ITSEC_Lockout {
1386
  $entry['description'] = esc_html__( 'Host Lockout', 'better-wp-security' );
1387
  }
1388
  } elseif ( 'whitelisted-host-triggered-user-lockout' === $code ) {
1389
- $entry['description'] = esc_html__( 'Whitelisted Host Triggered User Lockout', 'better-wp-security' );
1390
  } elseif ( 'user-lockout' === $code ) {
1391
  if ( isset( $data[0] ) ) {
1392
  $user = get_user_by( 'id', $data[0] );
@@ -1398,7 +1398,7 @@ final class ITSEC_Lockout {
1398
  $entry['description'] = esc_html__( 'User Lockout', 'better-wp-security' );
1399
  }
1400
  } elseif ( 'whitelisted-host-triggered-username-lockout' === $code ) {
1401
- $entry['description'] = esc_html__( 'Whitelisted Host Triggered Username Lockout', 'better-wp-security' );
1402
  } elseif ( 'username-lockout' === $code ) {
1403
  if ( isset( $data[0] ) ) {
1404
  $entry['description'] = sprintf( wp_kses( __( 'Username Lockout: <code>%s</code>', 'better-wp-security' ), array( 'code' => array() ) ), $data[0] );
847
  $description .= '</li><li>';
848
  $description .= sprintf( __( '<strong>User lockout message:</strong> %s', 'better-wp-security' ), ITSEC_Modules::get_setting( 'global', 'user_lockout_message' ) );
849
  $description .= '</li><li>';
850
+ $description .= sprintf( __( '<strong>Is this computer an authorized host:</strong> %s', 'better-wp-security' ), ITSEC_Lib::is_ip_whitelisted( ITSEC_Lib::get_ip() ) === true ? __( 'yes', 'better-wp-security' ) : __( 'no', 'better-wp-security' ) );
851
  $description .= '</li></ul>';
852
 
853
  return $description;
1374
  $entry['module_display'] = esc_html__( 'Lockout', 'better-wp-security' );
1375
 
1376
  if ( 'whitelisted-host-triggered-blacklist' === $code ) {
1377
+ $entry['description'] = esc_html__( 'Authorized Host Triggered Ban Conditions', 'better-wp-security' );
1378
  } elseif ( 'host-triggered-blacklist' === $code ) {
1379
+ $entry['description'] = esc_html__( 'Host Triggered Ban Conditions', 'better-wp-security' );
1380
  } elseif ( 'whitelisted-host-triggered-host-lockout' === $code ) {
1381
+ $entry['description'] = esc_html__( 'Authorized Host Triggered Host Lockout', 'better-wp-security' );
1382
  } elseif ( 'host-lockout' === $code ) {
1383
  if ( isset( $data[0] ) ) {
1384
  $entry['description'] = sprintf( wp_kses( __( 'Host Lockout: <code>%s</code>', 'better-wp-security' ), array( 'code' => array() ) ), $data[0] );
1386
  $entry['description'] = esc_html__( 'Host Lockout', 'better-wp-security' );
1387
  }
1388
  } elseif ( 'whitelisted-host-triggered-user-lockout' === $code ) {
1389
+ $entry['description'] = esc_html__( 'Authorized Host Triggered User Lockout', 'better-wp-security' );
1390
  } elseif ( 'user-lockout' === $code ) {
1391
  if ( isset( $data[0] ) ) {
1392
  $user = get_user_by( 'id', $data[0] );
1398
  $entry['description'] = esc_html__( 'User Lockout', 'better-wp-security' );
1399
  }
1400
  } elseif ( 'whitelisted-host-triggered-username-lockout' === $code ) {
1401
+ $entry['description'] = esc_html__( 'Authorized Host Triggered Username Lockout', 'better-wp-security' );
1402
  } elseif ( 'username-lockout' === $code ) {
1403
  if ( isset( $data[0] ) ) {
1404
  $entry['description'] = sprintf( wp_kses( __( 'Username Lockout: <code>%s</code>', 'better-wp-security' ), array( 'code' => array() ) ), $data[0] );
core/modules.php CHANGED
@@ -21,6 +21,7 @@ final class ITSEC_Modules {
21
  private $_settings_files_loaded = false;
22
  private $loaded_containers = [];
23
  private $labels = array();
 
24
 
25
  /** @var Container */
26
  private $pimple;
@@ -484,6 +485,8 @@ final class ITSEC_Modules {
484
  $self->_active_modules[ $module_id ] = true;
485
  self::set_active_modules( $self->_active_modules );
486
 
 
 
487
  return $was_active;
488
  }
489
 
@@ -606,7 +609,12 @@ final class ITSEC_Modules {
606
  continue;
607
  }
608
 
609
- $returned = include_once( $path );
 
 
 
 
 
610
  }
611
 
612
  if ( $returned ) {
@@ -650,6 +658,12 @@ final class ITSEC_Modules {
650
  * Initialize the container.
651
  */
652
  public static function initialize_container() {
 
 
 
 
 
 
653
  foreach ( self::get_active_modules_to_run() as $module ) {
654
  self::get_instance()->load_container_definitions( $module );
655
  }
21
  private $_settings_files_loaded = false;
22
  private $loaded_containers = [];
23
  private $labels = array();
24
+ private $returned_files = array();
25
 
26
  /** @var Container */
27
  private $pimple;
485
  $self->_active_modules[ $module_id ] = true;
486
  self::set_active_modules( $self->_active_modules );
487
 
488
+ ITSEC_Core::get_scheduler()->register_events_for_module( $module_id );
489
+
490
  return $was_active;
491
  }
492
 
609
  continue;
610
  }
611
 
612
+ if ( array_key_exists( $path, $self->returned_files ) ) {
613
+ $returned = $self->returned_files[ $path ];
614
+ } else {
615
+ $returned = include_once( $path );
616
+ $self->returned_files[ $path ] = $returned;
617
+ }
618
  }
619
 
620
  if ( $returned ) {
658
  * Initialize the container.
659
  */
660
  public static function initialize_container() {
661
+ $load = require __DIR__ . '/container.php';
662
+
663
+ if ( is_callable( $load ) ) {
664
+ $load( self::get_instance()->pimple );
665
+ }
666
+
667
  foreach ( self::get_active_modules_to_run() as $module ) {
668
  self::get_instance()->load_container_definitions( $module );
669
  }
core/modules/404-detection/settings-page.php CHANGED
@@ -6,18 +6,18 @@ final class ITSEC_404_Detection_Settings_Page extends ITSEC_Module_Settings_Page
6
  $this->title = __( '404 Detection', 'better-wp-security' );
7
  $this->description = __( 'Automatically block users snooping around for pages to exploit.', 'better-wp-security' );
8
  $this->type = 'recommended';
9
-
10
  parent::__construct();
11
  }
12
-
13
  protected function render_description( $form ) {
14
-
15
  ?>
16
  <p><?php _e( '404 detection looks at a user who is hitting a large number of non-existent pages and getting a large number of 404 errors. 404 detection assumes that a user who hits a lot of 404 errors in a short period of time is scanning for something (presumably a vulnerability) and locks them out accordingly. This also gives the added benefit of helping you find hidden problems causing 404 errors on unseen parts of your site. All errors will be logged in the "View Logs" page. You can set thresholds for this feature below.', 'better-wp-security' ); ?></p>
17
  <?php
18
-
19
  }
20
-
21
  protected function render_settings( $form ) {
22
 
23
  /** @var ITSEC_Lockout $itsec_lockout */
@@ -42,10 +42,10 @@ final class ITSEC_404_Detection_Settings_Page extends ITSEC_Module_Settings_Page
42
  </td>
43
  </tr>
44
  <tr>
45
- <th scope="row"><label for="itsec-404-detection-white_list"><?php _e( '404 File/Folder White List', 'better-wp-security' ); ?></label></th>
46
  <td>
47
  <?php $form->add_textarea( 'white_list', array( 'wrap' => 'off' ) ); ?>
48
- <p class="description"><?php _e( 'Use the white list above to prevent recording common 404 errors. If you know a common file on your site is missing and you do not want it to count towards a lockout record it here. You must list the full path beginning with the "/".', 'better-wp-security' ); ?></p>
49
  </td>
50
  </tr>
51
  <tr>
@@ -57,7 +57,7 @@ final class ITSEC_404_Detection_Settings_Page extends ITSEC_Module_Settings_Page
57
  </tr>
58
  </table>
59
  <?php
60
-
61
  }
62
  }
63
 
6
  $this->title = __( '404 Detection', 'better-wp-security' );
7
  $this->description = __( 'Automatically block users snooping around for pages to exploit.', 'better-wp-security' );
8
  $this->type = 'recommended';
9
+
10
  parent::__construct();
11
  }
12
+
13
  protected function render_description( $form ) {
14
+
15
  ?>
16
  <p><?php _e( '404 detection looks at a user who is hitting a large number of non-existent pages and getting a large number of 404 errors. 404 detection assumes that a user who hits a lot of 404 errors in a short period of time is scanning for something (presumably a vulnerability) and locks them out accordingly. This also gives the added benefit of helping you find hidden problems causing 404 errors on unseen parts of your site. All errors will be logged in the "View Logs" page. You can set thresholds for this feature below.', 'better-wp-security' ); ?></p>
17
  <?php
18
+
19
  }
20
+
21
  protected function render_settings( $form ) {
22
 
23
  /** @var ITSEC_Lockout $itsec_lockout */
42
  </td>
43
  </tr>
44
  <tr>
45
+ <th scope="row"><label for="itsec-404-detection-white_list"><?php _e( '404 File/Folder Ignore List', 'better-wp-security' ); ?></label></th>
46
  <td>
47
  <?php $form->add_textarea( 'white_list', array( 'wrap' => 'off' ) ); ?>
48
+ <p class="description"><?php _e( 'Use the list above to prevent recording common 404 errors. If you know a common file on your site is missing and you do not want it to count towards a lockout record it here. You must list the full path beginning with the "/".', 'better-wp-security' ); ?></p>
49
  </td>
50
  </tr>
51
  <tr>
57
  </tr>
58
  </table>
59
  <?php
60
+
61
  }
62
  }
63
 
core/modules/404-detection/validator.php CHANGED
@@ -4,28 +4,28 @@ class ITSEC_Four_Oh_Four_Validator extends ITSEC_Validator {
4
  public function get_id() {
5
  return '404-detection';
6
  }
7
-
8
  protected function sanitize_settings() {
9
  $this->sanitize_setting( 'positive-int', 'check_period', __( 'Minutes to Remember 404 Error (Check Period)', 'better-wp-security' ) );
10
  $this->sanitize_setting( 'positive-int', 'error_threshold', __( 'Error Threshold', 'better-wp-security' ) );
11
-
12
- $this->sanitize_setting( array( $this, 'sanitize_white_list_entry' ), 'white_list', __( '404 File/Folder White List', 'better-wp-security' ) );
13
- $this->sanitize_setting( array( $this, 'sanitize_types_entry' ), 'types', __( '404 File/Folder White List', 'better-wp-security' ) );
14
  }
15
-
16
  protected function sanitize_white_list_entry( $entry ) {
17
  if ( '/' !== substr( $entry, 0, 1 ) ) {
18
  return false;
19
  }
20
-
21
  return $entry;
22
  }
23
-
24
  protected function sanitize_types_entry( $entry ) {
25
  if ( '.' !== substr( $entry, 0, 1 ) ) {
26
  return false;
27
  }
28
-
29
  return $entry;
30
  }
31
  }
4
  public function get_id() {
5
  return '404-detection';
6
  }
7
+
8
  protected function sanitize_settings() {
9
  $this->sanitize_setting( 'positive-int', 'check_period', __( 'Minutes to Remember 404 Error (Check Period)', 'better-wp-security' ) );
10
  $this->sanitize_setting( 'positive-int', 'error_threshold', __( 'Error Threshold', 'better-wp-security' ) );
11
+
12
+ $this->sanitize_setting( array( $this, 'sanitize_white_list_entry' ), 'white_list', __( '404 File/Folder Ignore List', 'better-wp-security' ) );
13
+ $this->sanitize_setting( array( $this, 'sanitize_types_entry' ), 'types', __( '404 File/Folder Ignore List', 'better-wp-security' ) );
14
  }
15
+
16
  protected function sanitize_white_list_entry( $entry ) {
17
  if ( '/' !== substr( $entry, 0, 1 ) ) {
18
  return false;
19
  }
20
+
21
  return $entry;
22
  }
23
+
24
  protected function sanitize_types_entry( $entry ) {
25
  if ( '.' !== substr( $entry, 0, 1 ) ) {
26
  return false;
27
  }
28
+
29
  return $entry;
30
  }
31
  }
core/modules/ban-users/config-generators.php CHANGED
@@ -3,81 +3,98 @@
3
  final class ITSEC_Ban_Users_Config_Generators {
4
  public static function get_server_config_default_blacklist_rules( $server_type ) {
5
  $rules = '';
6
-
7
  require_once( ITSEC_Core::get_core_dir() . '/lib/class-itsec-lib-file.php' );
8
-
9
  $file = plugin_dir_path( __FILE__ ) . "lists/hackrepair-$server_type.inc";
10
-
11
  if ( ITSEC_Lib_File::is_file( $file ) ) {
12
  $default_list = ITSEC_Lib_File::read( $file );
13
-
14
  if ( ! empty( $default_list ) ) {
15
  $default_list = preg_replace( '/^/m', "\t", $default_list );
16
-
17
  $rules .= "\n";
18
- $rules .= "\t# " . __( 'Enable HackRepair.com\'s blacklist feature - Security > Settings > Banned Users > Default Blacklist', 'better-wp-security' ) . "\n";
19
  $rules .= $default_list;
20
  }
21
  }
22
-
23
  return $rules;
24
  }
25
-
26
  public static function get_server_config_ban_hosts_rules( $server_type ) {
27
  $host_list = ITSEC_Modules::get_setting( 'ban-users', 'host_list', array() );
28
-
29
  if ( ! is_array( $host_list ) || empty( $host_list ) ) {
30
  return '';
31
  }
32
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  if ( ! class_exists( 'ITSEC_Lib_IP_Tools' ) ) {
34
  require_once( ITSEC_Core::get_core_dir() . '/lib/class-itsec-lib-ip-tools.php' );
35
  }
36
-
37
-
38
  $host_rules = '';
39
  $set_env_rules = '';
40
  $deny_rules = '';
41
  $require_rules = '';
42
-
43
  // process hosts list
44
- foreach ( $host_list as $host ) {
45
  $host = ITSEC_Lib_IP_Tools::ip_wild_to_ip_cidr( trim( $host ) );
46
-
47
  if ( empty( $host ) ) {
48
  continue;
49
  }
50
-
51
  if ( ITSEC_Lib::is_ip_whitelisted( $host ) ) {
52
  /**
53
  * @todo warn the user the ip to be banned is whitelisted
54
  */
55
  continue;
56
  }
57
-
58
-
59
  if ( in_array( $server_type, array( 'apache', 'litespeed' ) ) ) {
60
  $converted_host = ITSEC_Lib_IP_Tools::ip_cidr_to_ip_regex( $host );
61
-
62
  if ( empty( $converted_host ) ) {
63
  continue;
64
  }
65
-
66
  $set_env_rules .= "\tSetEnvIF REMOTE_ADDR \"^$converted_host$\" DenyAccess\n"; // Ban IP
67
  $set_env_rules .= "\tSetEnvIF X-FORWARDED-FOR \"^$converted_host$\" DenyAccess\n"; // Ban IP from a proxy
68
  $set_env_rules .= "\tSetEnvIF X-CLUSTER-CLIENT-IP \"^$converted_host$\" DenyAccess\n"; // Ban IP from a load balancer
69
  $set_env_rules .= "\n";
70
-
71
  $require_rules .= "\t\t\tRequire not ip $host\n";
72
  $deny_rules .= "\t\tDeny from $host\n";
73
  } else if ( 'nginx' === $server_type ) {
74
  $host_rules .= "\tdeny $host;\n";
75
  }
76
  }
77
-
78
-
79
  $rules = '';
80
-
81
  if ( 'apache' === $server_type ) {
82
  if ( ! empty( $set_env_rules ) ) {
83
  $rules .= "\n";
@@ -116,31 +133,31 @@ final class ITSEC_Ban_Users_Config_Generators {
116
  $rules .= $host_rules;
117
  }
118
  }
119
-
120
  return $rules;
121
  }
122
-
123
  public static function get_server_config_ban_user_agents_rules( $server_type ) {
124
  $agent_list = ITSEC_Modules::get_setting( 'ban-users', 'agent_list', array() );
125
-
126
  if ( ! is_array( $agent_list ) || empty( $agent_list ) ) {
127
  return '';
128
  }
129
-
130
-
131
  $agent_rules = '';
132
  $rewrite_rules = '';
133
-
134
  foreach ( $agent_list as $index => $agent ) {
135
  $agent = trim( $agent );
136
-
137
  if ( empty( $agent ) ) {
138
  continue;
139
  }
140
-
141
-
142
  $agent = preg_quote( $agent );
143
-
144
  if ( in_array( $server_type, array( 'apache', 'litespeed' ) ) ) {
145
  $agent = str_replace( ' ', '\\ ', $agent );
146
  $rewrite_rules .= "\t\tRewriteCond %{HTTP_USER_AGENT} ^$agent [NC,OR]\n";
@@ -149,26 +166,26 @@ final class ITSEC_Ban_Users_Config_Generators {
149
  $agent_rules .= "\tif (\$http_user_agent ~* \"^$agent\") { return 403; }\n";
150
  }
151
  }
152
-
153
  if ( in_array( $server_type, array( 'apache', 'litespeed' ) ) && ! empty( $rewrite_rules ) ) {
154
  $rewrite_rules = preg_replace( "/\[NC,OR\]\n$/", "[NC]\n", $rewrite_rules );
155
-
156
  $agent_rules .= "\t<IfModule mod_rewrite.c>\n";
157
  $agent_rules .= "\t\tRewriteEngine On\n";
158
  $agent_rules .= $rewrite_rules;
159
  $agent_rules .= "\t\tRewriteRule ^.* - [F]\n";
160
  $agent_rules .= "\t</IfModule>\n";
161
  }
162
-
163
-
164
  $rules = '';
165
-
166
  if ( ! empty( $agent_rules ) ) {
167
  $rules .= "\n";
168
  $rules .= "\t# " . __( 'Ban User Agents - Security > Settings > Banned Users', 'better-wp-security' ) . "\n";
169
  $rules .= $agent_rules;
170
  }
171
-
172
  return $rules;
173
  }
174
  }
3
  final class ITSEC_Ban_Users_Config_Generators {
4
  public static function get_server_config_default_blacklist_rules( $server_type ) {
5
  $rules = '';
6
+
7
  require_once( ITSEC_Core::get_core_dir() . '/lib/class-itsec-lib-file.php' );
8
+
9
  $file = plugin_dir_path( __FILE__ ) . "lists/hackrepair-$server_type.inc";
10
+
11
  if ( ITSEC_Lib_File::is_file( $file ) ) {
12
  $default_list = ITSEC_Lib_File::read( $file );
13
+
14
  if ( ! empty( $default_list ) ) {
15
  $default_list = preg_replace( '/^/m', "\t", $default_list );
16
+
17
  $rules .= "\n";
18
+ $rules .= "\t# " . __( 'Enable HackRepair.com\'s blocklist feature - Security > Settings > Banned Users > Default Blocklist', 'better-wp-security' ) . "\n";
19
  $rules .= $default_list;
20
  }
21
  }
22
+
23
  return $rules;
24
  }
25
+
26
  public static function get_server_config_ban_hosts_rules( $server_type ) {
27
  $host_list = ITSEC_Modules::get_setting( 'ban-users', 'host_list', array() );
28
+
29
  if ( ! is_array( $host_list ) || empty( $host_list ) ) {
30
  return '';
31
  }
32
+
33
+ /**
34
+ * Filters the maximum number of IPs to include in the server config file.
35
+ *
36
+ * @param int $max_hosts The maximum IPs. Defaults to 100.
37
+ */
38
+ $max_hosts = apply_filters( 'itsec_ban_users_max_hosts_for_server_config', 100 );
39
+
40
+ $hosts = array_slice( $host_list, -$max_hosts, $max_hosts );
41
+
42
+ /**
43
+ * Filters the list of hosts to write to the server config file.
44
+ *
45
+ * @param array $hosts The list of IPs to write to the file.
46
+ * @param array $host_list The full list of IPs that are banned.
47
+ */
48
+ $hosts = apply_filters( 'itsec_ban_users_list_for_server_config', $hosts, $host_list );
49
+
50
  if ( ! class_exists( 'ITSEC_Lib_IP_Tools' ) ) {
51
  require_once( ITSEC_Core::get_core_dir() . '/lib/class-itsec-lib-ip-tools.php' );
52
  }
53
+
54
+
55
  $host_rules = '';
56
  $set_env_rules = '';
57
  $deny_rules = '';
58
  $require_rules = '';
59
+
60
  // process hosts list
61
+ foreach ( $hosts as $host ) {
62
  $host = ITSEC_Lib_IP_Tools::ip_wild_to_ip_cidr( trim( $host ) );
63
+
64
  if ( empty( $host ) ) {
65
  continue;
66
  }
67
+
68
  if ( ITSEC_Lib::is_ip_whitelisted( $host ) ) {
69
  /**
70
  * @todo warn the user the ip to be banned is whitelisted
71
  */
72
  continue;
73
  }
74
+
75
+
76
  if ( in_array( $server_type, array( 'apache', 'litespeed' ) ) ) {
77
  $converted_host = ITSEC_Lib_IP_Tools::ip_cidr_to_ip_regex( $host );
78
+
79
  if ( empty( $converted_host ) ) {
80
  continue;
81
  }
82
+
83
  $set_env_rules .= "\tSetEnvIF REMOTE_ADDR \"^$converted_host$\" DenyAccess\n"; // Ban IP
84
  $set_env_rules .= "\tSetEnvIF X-FORWARDED-FOR \"^$converted_host$\" DenyAccess\n"; // Ban IP from a proxy
85
  $set_env_rules .= "\tSetEnvIF X-CLUSTER-CLIENT-IP \"^$converted_host$\" DenyAccess\n"; // Ban IP from a load balancer
86
  $set_env_rules .= "\n";
87
+
88
  $require_rules .= "\t\t\tRequire not ip $host\n";
89
  $deny_rules .= "\t\tDeny from $host\n";
90
  } else if ( 'nginx' === $server_type ) {
91
  $host_rules .= "\tdeny $host;\n";
92
  }
93
  }
94
+
95
+
96
  $rules = '';
97
+
98
  if ( 'apache' === $server_type ) {
99
  if ( ! empty( $set_env_rules ) ) {
100
  $rules .= "\n";
133
  $rules .= $host_rules;
134
  }
135
  }
136
+
137
  return $rules;
138
  }
139
+
140
  public static function get_server_config_ban_user_agents_rules( $server_type ) {
141
  $agent_list = ITSEC_Modules::get_setting( 'ban-users', 'agent_list', array() );
142
+
143
  if ( ! is_array( $agent_list ) || empty( $agent_list ) ) {
144
  return '';
145
  }
146
+
147
+
148
  $agent_rules = '';
149
  $rewrite_rules = '';
150
+
151
  foreach ( $agent_list as $index => $agent ) {
152
  $agent = trim( $agent );
153
+
154
  if ( empty( $agent ) ) {
155
  continue;
156
  }
157
+
158
+
159
  $agent = preg_quote( $agent );
160
+
161
  if ( in_array( $server_type, array( 'apache', 'litespeed' ) ) ) {
162
  $agent = str_replace( ' ', '\\ ', $agent );
163
  $rewrite_rules .= "\t\tRewriteCond %{HTTP_USER_AGENT} ^$agent [NC,OR]\n";
166
  $agent_rules .= "\tif (\$http_user_agent ~* \"^$agent\") { return 403; }\n";
167
  }
168
  }
169
+
170
  if ( in_array( $server_type, array( 'apache', 'litespeed' ) ) && ! empty( $rewrite_rules ) ) {
171
  $rewrite_rules = preg_replace( "/\[NC,OR\]\n$/", "[NC]\n", $rewrite_rules );
172
+
173
  $agent_rules .= "\t<IfModule mod_rewrite.c>\n";
174
  $agent_rules .= "\t\tRewriteEngine On\n";
175
  $agent_rules .= $rewrite_rules;
176
  $agent_rules .= "\t\tRewriteRule ^.* - [F]\n";
177
  $agent_rules .= "\t</IfModule>\n";
178
  }
179
+
180
+
181
  $rules = '';
182
+
183
  if ( ! empty( $agent_rules ) ) {
184
  $rules .= "\n";
185
  $rules .= "\t# " . __( 'Ban User Agents - Security > Settings > Banned Users', 'better-wp-security' ) . "\n";
186
  $rules .= $agent_rules;
187
  }
188
+
189
  return $rules;
190
  }
191
  }
core/modules/ban-users/settings-page.php CHANGED
@@ -26,11 +26,11 @@ final class ITSEC_Ban_Users_Settings_Page extends ITSEC_Module_Settings_Page {
26
  ?>
27
  <table class="form-table itsec-settings-section">
28
  <tr>
29
- <th scope="row"><label for="itsec-ban-users-default"><?php _e( 'Default Blacklist', 'better-wp-security' ); ?></label></th>
30
  <td>
31
  <?php $form->add_checkbox( 'default' ); ?>
32
- <label for="itsec-ban-users-default"><?php _e( 'Enable HackRepair.com\'s blacklist feature', 'better-wp-security' ); ?></label>
33
- <p class="description"><?php esc_html_e( 'As a getting-started point you can include the blacklist developed by Jim Walker.', 'better-wp-security' ); ?></p>
34
  </td>
35
  </tr>
36
  <tr>
26
  ?>
27
  <table class="form-table itsec-settings-section">
28
  <tr>
29
+ <th scope="row"><label for="itsec-ban-users-default"><?php _e( 'Default Ban List', 'better-wp-security' ); ?></label></th>
30
  <td>
31
  <?php $form->add_checkbox( 'default' ); ?>
32
+ <label for="itsec-ban-users-default"><?php _e( 'Enable HackRepair.com\'s ban list feature', 'better-wp-security' ); ?></label>
33
+ <p class="description"><?php esc_html_e( 'As a getting-started point you can include the ban list developed by Jim Walker.', 'better-wp-security' ); ?></p>
34
  </td>
35
  </tr>
36
  <tr>
core/modules/ban-users/validator.php CHANGED
@@ -4,57 +4,60 @@ class ITSEC_Ban_Users_Validator extends ITSEC_Validator {
4
  public function get_id() {
5
  return 'ban-users';
6
  }
7
-
8
  protected function sanitize_settings() {
9
- $this->sanitize_setting( 'bool', 'default', __( 'Default Blacklist', 'better-wp-security' ) );
10
  $this->sanitize_setting( 'bool', 'enable_ban_lists', __( 'Ban Lists', 'better-wp-security' ) );
11
-
12
  $this->sanitize_setting( 'newline-separated-ips', 'host_list', __( 'Ban Hosts', 'better-wp-security' ) );
13
-
14
  if ( is_array( $this->settings['host_list'] ) ) {
15
  require_once( ITSEC_Core::get_core_dir() . '/lib/class-itsec-lib-ip-tools.php' );
16
-
17
  $whitelisted_hosts = array();
18
  $current_ip = ITSEC_Lib::get_ip();
19
-
20
  foreach ( $this->settings['host_list'] as $host ) {
21
  if ( is_user_logged_in() && ITSEC_Lib_IP_Tools::intersect( $current_ip, ITSEC_Lib_IP_Tools::ip_wild_to_ip_cidr( $host ) ) ) {
22
  $this->set_can_save( false );
23
-
24
  /* translators: 1: input name, 2: invalid host */
25
  $this->add_error( sprintf( __( 'The following host in %1$s matches your current IP and cannot be banned: %2$s', 'better-wp-security' ), __( 'Ban Hosts', 'better-wp-security' ), $host ) );
26
-
27
  continue;
28
  }
29
-
30
  if ( ITSEC_Lib::is_ip_whitelisted( $host ) ) {
31
  $whitelisted_hosts[] = $host;
32
  }
33
  }
34
-
35
  if ( ! empty( $whitelisted_hosts ) ) {
36
  $this->set_can_save( false );
37
-
38
  /* translators: 1: input name, 2: invalid host list */
39
- $this->add_error( wp_sprintf( _n( 'The following IP in %1$s is whitelisted and cannot be banned: %2$l', 'The following IPs in %1$s are whitelisted and cannot be banned: %2$l', count( $whitelisted_hosts ), 'better-wp-security' ), __( 'Ban Hosts', 'better-wp-security' ), $whitelisted_hosts ) );
40
  }
41
  }
42
-
43
  $this->sanitize_setting( array( $this, 'sanitize_agent_list_entry' ), 'agent_list', __( 'Ban User Agents', 'better-wp-security' ) );
44
  }
45
-
46
  protected function sanitize_agent_list_entry( $entry ) {
47
  return trim( sanitize_text_field( $entry ) );
48
  }
49
-
50
  protected function validate_settings() {
51
  if ( ! $this->can_save() ) {
52
  return;
53
  }
54
-
55
-
 
 
 
56
  $previous_settings = ITSEC_Modules::get_settings( $this->get_id() );
57
-
58
  foreach ( $this->settings as $key => $val ) {
59
  if ( ! isset( $previous_settings[$key] ) || $previous_settings[$key] != $val ) {
60
  ITSEC_Response::regenerate_server_config();
4
  public function get_id() {
5
  return 'ban-users';
6
  }
7
+
8
  protected function sanitize_settings() {
9
+ $this->sanitize_setting( 'bool', 'default', __( 'Default Ban List', 'better-wp-security' ) );
10
  $this->sanitize_setting( 'bool', 'enable_ban_lists', __( 'Ban Lists', 'better-wp-security' ) );
11
+
12
  $this->sanitize_setting( 'newline-separated-ips', 'host_list', __( 'Ban Hosts', 'better-wp-security' ) );
13
+
14
  if ( is_array( $this->settings['host_list'] ) ) {
15
  require_once( ITSEC_Core::get_core_dir() . '/lib/class-itsec-lib-ip-tools.php' );
16
+
17
  $whitelisted_hosts = array();
18
  $current_ip = ITSEC_Lib::get_ip();
19
+
20
  foreach ( $this->settings['host_list'] as $host ) {
21
  if ( is_user_logged_in() && ITSEC_Lib_IP_Tools::intersect( $current_ip, ITSEC_Lib_IP_Tools::ip_wild_to_ip_cidr( $host ) ) ) {
22
  $this->set_can_save( false );
23
+
24
  /* translators: 1: input name, 2: invalid host */
25
  $this->add_error( sprintf( __( 'The following host in %1$s matches your current IP and cannot be banned: %2$s', 'better-wp-security' ), __( 'Ban Hosts', 'better-wp-security' ), $host ) );
26
+
27
  continue;
28
  }
29
+
30
  if ( ITSEC_Lib::is_ip_whitelisted( $host ) ) {
31
  $whitelisted_hosts[] = $host;
32
  }
33
  }
34
+
35
  if ( ! empty( $whitelisted_hosts ) ) {
36
  $this->set_can_save( false );
37
+
38
  /* translators: 1: input name, 2: invalid host list */
39
+ $this->add_error( wp_sprintf( _n( 'The following IP in %1$s is on the authorized hosts list and cannot be banned: %2$l', 'The following IPs in %1$s are on the authorized hosts list and cannot be banned: %2$l', count( $whitelisted_hosts ), 'better-wp-security' ), __( 'Ban Hosts', 'better-wp-security' ), $whitelisted_hosts ) );
40
  }
41
  }
42
+
43
  $this->sanitize_setting( array( $this, 'sanitize_agent_list_entry' ), 'agent_list', __( 'Ban User Agents', 'better-wp-security' ) );
44
  }
45
+
46
  protected function sanitize_agent_list_entry( $entry ) {
47
  return trim( sanitize_text_field( $entry ) );
48
  }
49
+
50
  protected function validate_settings() {
51
  if ( ! $this->can_save() ) {
52
  return;
53
  }
54
+
55
+ if ( ! ITSEC_Core::is_interactive() ) {
56
+ return;
57
+ }
58
+
59
  $previous_settings = ITSEC_Modules::get_settings( $this->get_id() );
60
+
61
  foreach ( $this->settings as $key => $val ) {
62
  if ( ! isset( $previous_settings[$key] ) || $previous_settings[$key] != $val ) {
63
  ITSEC_Response::regenerate_server_config();
core/modules/core/entries/admin-notices/components/admin-bar/style.scss CHANGED
@@ -7,10 +7,12 @@
7
  & .itsec-admin-bar-admin-notices__trigger > .components-button {
8
  color: $main-blue;
9
  border: none;
10
- background: transparent;
 
11
 
12
  &:hover {
13
  color: lighten($main-blue, 20%);
 
14
  }
15
 
16
  & svg {
7
  & .itsec-admin-bar-admin-notices__trigger > .components-button {
8
  color: $main-blue;
9
  border: none;
10
+ background: transparent !important;
11
+ box-shadow: none;
12
 
13
  &:hover {
14
  color: lighten($main-blue, 20%);
15
+ box-shadow: none;
16
  }
17
 
18
  & svg {
core/modules/core/entries/admin-notices/components/panel/index.js CHANGED
@@ -35,6 +35,10 @@ function getAvailableHighlights() {
35
  slug: 'malware-scan-failed',
36
  label: __( 'Malware Scan Failed', 'better-wp-security' ),
37
  },
 
 
 
 
38
  ];
39
  }
40
 
35
  slug: 'malware-scan-failed',
36
  label: __( 'Malware Scan Failed', 'better-wp-security' ),
37
  },
38
+ {
39
+ slug: 'site-scanner-report',
40
+ label: __( 'Site Scan Report', 'better-wp-security' ),
41
+ },
42
  ];
43
  }
44
 
core/modules/core/notices.php CHANGED
@@ -3,7 +3,7 @@
3
  class ITSEC_Admin_Notice_New_Feature_Core implements ITSEC_Admin_Notice {
4
 
5
  public function get_id() {
6
- return 'release-user-groups';
7
  }
8
 
9
  public function get_title() {
@@ -11,9 +11,16 @@ class ITSEC_Admin_Notice_New_Feature_Core implements ITSEC_Admin_Notice {
11
  }
12
 
13
  public function get_message() {
 
 
 
 
 
 
 
 
14
  return sprintf(
15
- esc_html__( 'New in iThemes Security version %1$s, %2$sSave Time Securing WordPress With User Groups%3$s!', 'better-wp-security' ),
16
- ITSEC_Core::is_pro() ? '6.4.0' : '7.7.0',
17
  '<a href="{{ $blog }}">',
18
  '</a>'
19
  );
@@ -40,7 +47,7 @@ class ITSEC_Admin_Notice_New_Feature_Core implements ITSEC_Admin_Notice {
40
  function () {
41
  $this->handle_dismiss();
42
 
43
- wp_redirect( 'https://ithemes.com/new-save-time-securing-wordpress-with-user-groups' );
44
  die;
45
  }
46
  )
3
  class ITSEC_Admin_Notice_New_Feature_Core implements ITSEC_Admin_Notice {
4
 
5
  public function get_id() {
6
+ return 'release-site-scanner';
7
  }
8
 
9
  public function get_title() {
11
  }
12
 
13
  public function get_message() {
14
+ if ( ITSEC_Core::is_pro() ) {
15
+ return sprintf(
16
+ esc_html__( 'The new, improved %1$sWordPress Security Site Scan%2$s powered by iThemes performs automatic checks for known website vulnerabilities and, if a patch is available, iThemes Security Pro will now automatically apply the fix for you.', 'better-wp-security' ),
17
+ '<a href="{{ $blog }}">',
18
+ '</a>'
19
+ );
20
+ }
21
+
22
  return sprintf(
23
+ esc_html__( 'The new, improved %1$sWordPress Security Site Scan powered by iThemes checks if Google has detected malware and added your site to their threat list', 'better-wp-security' ),
 
24
  '<a href="{{ $blog }}">',
25
  '</a>'
26
  );
47
  function () {
48
  $this->handle_dismiss();
49
 
50
+ wp_redirect( 'https://ithemes.com/new-protect-your-wordpress-website-with-the-ithemes-security-site-scan/' );
51
  die;
52
  }
53
  )
core/modules/core/sidebar-widget-sync-cross-promo.php CHANGED
@@ -17,7 +17,7 @@ class ITSEC_Settings_Page_Sidebar_Widget_Sync_Cross_Promo extends ITSEC_Settings
17
  <?php
18
 
19
  echo '<p>' . __( 'Manage updates (and much more!) for your WordPress websites all in one place. Save time logging in to multiple websites to perform WordPress admin tasks.', 'better-wp-security' ) . '</p>';
20
- echo '<p>' . __( 'Integrated with iThemes Security, so you can release lockouts, whitelist IPs, and turn Away Mode on or off right from your Sync dashboard.', 'better-wp-security' ) . '</p>';
21
  echo '<div style="text-align: center;">';
22
  echo '<p><a class="button-primary" href="https://ithemes.com/member/cart.php?action=add&id=523" target="_blank" rel="noopener noreferrer">' . __( 'Free 30 Day Trial', 'better-wp-security' ) . '</a></p>';
23
  echo '</div>';
17
  <?php
18
 
19
  echo '<p>' . __( 'Manage updates (and much more!) for your WordPress websites all in one place. Save time logging in to multiple websites to perform WordPress admin tasks.', 'better-wp-security' ) . '</p>';
20
+ echo '<p>' . __( 'Integrated with iThemes Security, so you can release lockouts, authorize IPs, and turn Away Mode on or off right from your Sync dashboard.', 'better-wp-security' ) . '</p>';
21
  echo '<div style="text-align: center;">';
22
  echo '<p><a class="button-primary" href="https://ithemes.com/member/cart.php?action=add&id=523" target="_blank" rel="noopener noreferrer">' . __( 'Free 30 Day Trial', 'better-wp-security' ) . '</a></p>';
23
  echo '</div>';
core/modules/email-confirmation/class-itsec-email-confirmation.php CHANGED
@@ -34,6 +34,7 @@ class ITSEC_Email_Confirmation {
34
  $change = get_user_meta( $user->ID, '_new_email', true );
35
 
36
  if (
 
37
  IS_PROFILE_PAGE &&
38
  ! empty( $_GET['newuseremail'] ) &&
39
  is_array( $change ) &&
34
  $change = get_user_meta( $user->ID, '_new_email', true );
35
 
36
  if (
37
+ defined( 'IS_PROFILE_PAGE' ) &&
38
  IS_PROFILE_PAGE &&
39
  ! empty( $_GET['newuseremail'] ) &&
40
  is_array( $change ) &&
core/modules/file-change/class-itsec-file-change.php CHANGED
@@ -38,10 +38,7 @@ class ITSEC_File_Change {
38
  add_action( 'itsec_scheduled_file-change-fast', array( $this, 'run_scan' ) );
39
  ITSEC_Core::get_scheduler()->register_loop( 'file-change', ITSEC_Scheduler::S_DAILY, 60 );
40
  ITSEC_Core::get_scheduler()->register_loop( 'file-change-fast', ITSEC_Scheduler::S_DAILY, 0 );
41
-
42
- if ( ITSEC_Modules::get_setting( 'file-change', 'notify_admin' ) ) {
43
- add_action( 'itsec_register_highlighted_logs', array( $this, 'register_highlight' ) );
44
- }
45
  }
46
 
47
  public function run_scan( $job ) {
38
  add_action( 'itsec_scheduled_file-change-fast', array( $this, 'run_scan' ) );
39
  ITSEC_Core::get_scheduler()->register_loop( 'file-change', ITSEC_Scheduler::S_DAILY, 60 );
40
  ITSEC_Core::get_scheduler()->register_loop( 'file-change-fast', ITSEC_Scheduler::S_DAILY, 0 );
41
+ add_action( 'itsec_register_highlighted_logs', array( $this, 'register_highlight' ) );
 
 
 
42
  }
43
 
44
  public function run_scan( $job ) {
core/modules/{malware/sync-verbs → file-writing/js}/index.php RENAMED
File without changes
core/modules/file-writing/js/settings-page.js ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ( function( $ ) {
2
+ function writeToFile( type, $el ) {
3
+ const module = type + '-config-rules';
4
+
5
+ itsecUtil.sendModuleAJAXRequest( module, { method: 'flush' }, function( r ) {
6
+ if ( r.messages.length > 0 ) {
7
+ itsecSettingsPage.showMessages( r.messages, module, 'open', 'success' );
8
+ }
9
+
10
+ if ( r.errors.length > 0 ) {
11
+ itsecSettingsPage.showErrors( r.errors, module, 'open', 'error' );
12
+ }
13
+
14
+ itsecSettingsPage.scrollTop();
15
+ $el.removeAttr( 'disabled' );
16
+ } );
17
+ }
18
+
19
+ $( document ).on( 'click', '.itsec-file-writing-flush', function() {
20
+ const $el = $( this );
21
+ const type = $el.data( 'type' );
22
+
23
+ if ( type ) {
24
+ $el.attr( 'disabled', true );
25
+ writeToFile( type, $el );
26
+ }
27
+ } );
28
+ } )( jQuery );
core/modules/file-writing/settings-page.php CHANGED
@@ -2,16 +2,30 @@
2
 
3
  final class ITSEC_Core_Server_Config_Rules_Settings_Page extends ITSEC_Module_Settings_Page {
4
  public function __construct() {
5
- $this->id = 'server-config-rules';
6
- $this->title = __( 'Server Config Rules', 'better-wp-security' );
7
- $this->description = __( 'If you need to manually add the server config rules generated by iThemes Security to your server, you can find them here.', 'better-wp-security' );
8
- $this->type = 'advanced';
9
  $this->information_only = true;
10
- $this->can_save = false;
11
 
12
  parent::__construct();
13
  }
14
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  protected function render_description( $form ) {
16
  require_once( ITSEC_Core::get_core_dir() . '/lib/class-itsec-lib-config-file.php' );
17
 
@@ -22,25 +36,40 @@ final class ITSEC_Core_Server_Config_Rules_Settings_Page extends ITSEC_Module_Se
22
  } else {
23
  echo '<p>' . __( "The following rules need to be written to your server's config file. Please make sure to keep the comments in place." ) . '</p>';
24
  echo '<div class="itsec_server_config_rules"><pre id="itsec-server-config-rules">' . esc_html( $config ) . '</pre></div>';
25
- echo '<button class="button itsec-copy-trigger" data-copy-from="itsec-server-config-rules">' . esc_html__( 'Copy to Clipboard', 'better-wp-security' ) . '</button>';
 
 
 
 
26
  }
27
  }
28
  }
 
29
  new ITSEC_Core_Server_Config_Rules_Settings_Page();
30
 
31
 
32
  final class ITSEC_Core_WPConfig_File_Settings_Page extends ITSEC_Module_Settings_Page {
33
  public function __construct() {
34
- $this->id = 'wp-config-rules';
35
- $this->title = __( 'wp-config.php Rules', 'better-wp-security' );
36
- $this->description = __( 'If you need to manually add the <code>wp-config.php</code> rules generated by iThemes Security to your server, you can find them here.', 'better-wp-security' );
37
- $this->type = 'advanced';
38
  $this->information_only = true;
39
- $this->can_save = false;
40
 
41
  parent::__construct();
42
  }
43
 
 
 
 
 
 
 
 
 
 
 
44
  protected function render_description( $form ) {
45
  require_once( ITSEC_Core::get_core_dir() . '/lib/class-itsec-lib-config-file.php' );
46
 
@@ -51,8 +80,13 @@ final class ITSEC_Core_WPConfig_File_Settings_Page extends ITSEC_Module_Settings
51
  } else {
52
  echo '<p>' . __( "The following rules need to be written to your <code>wp-config.php</code> file. Please make sure to keep the comments in place." ) . '</p>';
53
  echo '<div class="itsec_rewrite_rules"><pre id="itsec-rewrite-rules">' . esc_html( $config ) . '</pre></div>';
54
- echo '<button class="button itsec-copy-trigger" data-copy-from="itsec-rewrite-rules">' . esc_html__( 'Copy to Clipboard', 'better-wp-security' ) . '</button>';
 
 
 
 
55
  }
56
  }
57
  }
 
58
  new ITSEC_Core_WPConfig_File_Settings_Page();
2
 
3
  final class ITSEC_Core_Server_Config_Rules_Settings_Page extends ITSEC_Module_Settings_Page {
4
  public function __construct() {
5
+ $this->id = 'server-config-rules';
6
+ $this->title = __( 'Server Config Rules', 'better-wp-security' );
7
+ $this->description = __( 'If you need to manually add the server config rules generated by iThemes Security to your server, you can find them here.', 'better-wp-security' );
8
+ $this->type = 'advanced';
9
  $this->information_only = true;
10
+ $this->can_save = false;
11
 
12
  parent::__construct();
13
  }
14
 
15
+ public function handle_ajax_request( $data ) {
16
+ switch ( empty( $data['method'] ) ? '' : $data['method'] ) {
17
+ case 'flush':
18
+ if ( ITSEC_Files::regenerate_server_config() ) {
19
+ ITSEC_Response::add_message( esc_html__( 'Regenerated server config.', 'better-wp-security' ) );
20
+ }
21
+ break;
22
+ }
23
+ }
24
+
25
+ public function enqueue_scripts_and_styles() {
26
+ wp_enqueue_script( 'itsec-file-writing-settings-page', plugins_url( 'js/settings-page.js', __FILE__ ), array( 'jquery', 'itsec-settings-page-script', 'itsec-util' ), 1, true );
27
+ }
28
+
29
  protected function render_description( $form ) {
30
  require_once( ITSEC_Core::get_core_dir() . '/lib/class-itsec-lib-config-file.php' );
31
 
36
  } else {
37
  echo '<p>' . __( "The following rules need to be written to your server's config file. Please make sure to keep the comments in place." ) . '</p>';
38
  echo '<div class="itsec_server_config_rules"><pre id="itsec-server-config-rules">' . esc_html( $config ) . '</pre></div>';
39
+ echo '<button class="button itsec-copy-trigger" data-copy-from="itsec-server-config-rules">' . esc_html__( 'Copy to Clipboard', 'better-wp-security' ) . '</button>';
40
+
41
+ if ( ITSEC_Files::can_write_to_files() ) {
42
+ echo ' <button class="button itsec-file-writing-flush" data-type="server">' . esc_html__( 'Write to File', 'better-wp-security' ) . '</button>';
43
+ }
44
  }
45
  }
46
  }
47
+
48
  new ITSEC_Core_Server_Config_Rules_Settings_Page();
49
 
50
 
51
  final class ITSEC_Core_WPConfig_File_Settings_Page extends ITSEC_Module_Settings_Page {
52
  public function __construct() {
53
+ $this->id = 'wp-config-rules';
54
+ $this->title = __( 'wp-config.php Rules', 'better-wp-security' );
55
+ $this->description = __( 'If you need to manually add the <code>wp-config.php</code> rules generated by iThemes Security to your server, you can find them here.', 'better-wp-security' );
56
+ $this->type = 'advanced';
57
  $this->information_only = true;
58
+ $this->can_save = false;
59
 
60
  parent::__construct();
61
  }
62
 
63
+ public function handle_ajax_request( $data ) {
64
+ switch ( empty( $data['method'] ) ? '' : $data['method'] ) {
65
+ case 'flush':
66
+ if ( ITSEC_Files::regenerate_wp_config() ) {
67
+ ITSEC_Response::add_message( esc_html__( 'Regenerated wp-config.php.', 'better-wp-security' ) );
68
+ }
69
+ break;
70
+ }
71
+ }
72
+
73
  protected function render_description( $form ) {
74
  require_once( ITSEC_Core::get_core_dir() . '/lib/class-itsec-lib-config-file.php' );
75
 
80
  } else {
81
  echo '<p>' . __( "The following rules need to be written to your <code>wp-config.php</code> file. Please make sure to keep the comments in place." ) . '</p>';
82
  echo '<div class="itsec_rewrite_rules"><pre id="itsec-rewrite-rules">' . esc_html( $config ) . '</pre></div>';
83
+ echo '<button class="button itsec-copy-trigger" data-copy-from="itsec-rewrite-rules">' . esc_html__( 'Copy to Clipboard', 'better-wp-security' ) . '</button>';
84
+
85
+ if ( ITSEC_Files::can_write_to_files() ) {
86
+ echo ' <button class="button itsec-file-writing-flush" data-type="wp">' . esc_html__( 'Write to File', 'better-wp-security' ) . '</button>';
87
+ }
88
  }
89
  }
90
  }
91
+
92
  new ITSEC_Core_WPConfig_File_Settings_Page();
core/modules/global/notices.php CHANGED
@@ -43,6 +43,47 @@ class ITSEC_Admin_Notice_Network_Brute_Force_Promo implements ITSEC_Admin_Notice
43
  }
44
  }
45
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  if ( ITSEC_Core::is_temp_disable_modules_set() ) {
47
  ITSEC_Lib_Admin_Notices::register(
48
  new ITSEC_Admin_Notice_Managers_Only(
@@ -62,3 +103,15 @@ if ( ! ITSEC_Modules::is_active( 'network-brute-force' ) || ! ITSEC_Modules::get
62
  )
63
  );
64
  }
 
 
 
 
 
 
 
 
 
 
 
 
43
  }
44
  }
45
 
46
+ class ITSEC_Admin_Notice_Licensed_Hostname_Prompt implements ITSEC_Admin_Notice {
47
+ public function get_id() {
48
+ return 'licensed-hostname-prompt';
49
+ }
50
+
51
+ public function get_title() {
52
+ return '';
53
+ }
54
+
55
+ public function get_message() {
56
+ return esc_html__( 'iThemes Security Pro couldn\'t verify the license for this site. An active license is required to authenticate the Site Scanner.', 'better-wp-security' );
57
+ }
58
+
59
+ public function get_meta() {
60
+ return [];
61
+ }
62
+
63
+ public function get_severity() {
64
+ return self::S_WARN;
65
+ }
66
+
67
+ public function show_for_context( ITSEC_Admin_Notice_Context $context ) {
68
+ return true;
69
+ }
70
+
71
+ public function get_actions() {
72
+ return [
73
+ 'update' => new ITSEC_Admin_Notice_Action_Link(
74
+ ithemes_updater_get_change_licensed_site_url(
75
+ ITSEC_Core::get_settings_page_url()
76
+ ),
77
+ esc_html__( 'Update License', 'better-wp-security' ),
78
+ ITSEC_Admin_Notice_Action::S_PRIMARY,
79
+ static function () {
80
+ ITSEC_Modules::set_setting( 'global', 'licensed_hostname_prompt', false );
81
+ }
82
+ )
83
+ ];
84
+ }
85
+ }
86
+
87
  if ( ITSEC_Core::is_temp_disable_modules_set() ) {
88
  ITSEC_Lib_Admin_Notices::register(
89
  new ITSEC_Admin_Notice_Managers_Only(
103
  )
104
  );
105
  }
106
+
107
+ if (
108
+ ITSEC_Core::is_licensed() &&
109
+ ITSEC_Modules::get_setting( 'global', 'licensed_hostname_prompt' ) &&
110
+ function_exists( 'ithemes_updater_get_change_licensed_site_url' )
111
+ ) {
112
+ ITSEC_Lib_Admin_Notices::register(
113
+ new ITSEC_Admin_Notice_Managers_Only(
114
+ new ITSEC_Admin_Notice_Licensed_Hostname_Prompt()
115
+ )
116
+ );
117
+ }
core/modules/global/settings-page.php CHANGED
@@ -169,15 +169,15 @@ final class ITSEC_Global_Settings_Page extends ITSEC_Module_Settings_Page {
169
  </td>
170
  </tr>
171
  <tr>
172
- <th scope="row"><label for="itsec-global-blacklist"><?php _e( 'Blacklist Repeat Offender', 'better-wp-security' ); ?></label></th>
173
  <td>
174
  <?php $form->add_checkbox( 'blacklist' ); ?>
175
- <label for="itsec-global-blacklist"><?php _e( 'Enable Blacklist Repeat Offender', 'better-wp-security' ); ?></label>
176
- <p class="description"><?php _e( 'If this box is checked the IP address of the offending computer will be added to the "Ban Users" blacklist after reaching the number of lockouts listed below.', 'better-wp-security' ); ?></p>
177
  </td>
178
  </tr>
179
  <tr>
180
- <th scope="row"><label for="itsec-global-blacklist_count"><?php _e( 'Blacklist Threshold', 'better-wp-security' ); ?></label></th>
181
  <td>
182
  <?php $form->add_text( 'blacklist_count', array( 'class' => 'small-text' ) ); ?>
183
  <label for="itsec-global-blacklist_count"><?php _e( 'Lockouts', 'better-wp-security' ); ?></label>
@@ -185,11 +185,11 @@ final class ITSEC_Global_Settings_Page extends ITSEC_Module_Settings_Page {
185
  </td>
186
  </tr>
187
  <tr>
188
- <th scope="row"><label for="itsec-global-blacklist_period"><?php _e( 'Blacklist Lookback Period', 'better-wp-security' ); ?></label></th>
189
  <td>
190
  <?php $form->add_text( 'blacklist_period', array( 'class' => 'small-text' ) ); ?>
191
  <label for="itsec-global-blacklist_period"><?php _e( 'Days', 'better-wp-security' ); ?></label>
192
- <p class="description"><?php _e( 'How many days should a lockout be remembered to meet the blacklist count above.', 'better-wp-security' ); ?></p>
193
  </td>
194
  </tr>
195
  <tr>
@@ -197,18 +197,18 @@ final class ITSEC_Global_Settings_Page extends ITSEC_Module_Settings_Page {
197
  <td>
198
  <?php $form->add_text( 'lockout_period', array( 'class' => 'small-text' ) ); ?>
199
  <label for="itsec-global-lockout_period"><?php _e( 'Minutes', 'better-wp-security' ); ?></label>
200
- <p class="description"><?php _e( 'The length of time a host or user will be banned from this site after hitting the limit of bad logins. The default setting of 15 minutes is recommended as increasing it could prevent attacking IP addresses from being added to the blacklist.', 'better-wp-security' ); ?></p>
201
  </td>
202
  </tr>
203
  <tr>
204
- <th scope="row"><label for="itsec-global-lockout_white_list"><?php _e( 'Lockout White List', 'better-wp-security' ); ?></label></th>
205
  <td>
206
  <?php $form->add_textarea( 'lockout_white_list' ); ?>
207
- <p><?php $form->add_button( 'add-to-whitelist', array( 'value' => __( 'Add my current IP to the White List', 'better-wp-security' ), 'class' => 'button-primary' ) ); ?></p>
208
- <p class="description"><?php _e( 'Use the guidelines below to enter hosts that will not be locked out from your site. This will keep you from locking yourself out of any features if you should trigger a lockout. Please note this does not override away mode and will only prevent a temporary ban. Should a permanent ban be triggered you will still be added to the "Ban Users" list unless the IP address is also white listed in that section.', 'better-wp-security' ); ?></p>
209
  <ul>
210
  <li>
211
- <?php _e( 'You may white list users by individual IP address or IP address range using wildcards or CIDR notation.', 'better-wp-security' ); ?>
212
  <ul>
213
  <li><?php _e( 'Individual IP addresses must be in IPv4 or IPv6 standard format (###.###.###.### or ####:####:####:####:####:####:####:####).', 'better-wp-security' ); ?></li>
214
  <li><?php _e( 'CIDR notation is allowed to specify a range of IP addresses (###.###.###.###/## or ####:####:####:####:####:####:####:####/###).', 'better-wp-security' ); ?></li>
@@ -218,9 +218,6 @@ final class ITSEC_Global_Settings_Page extends ITSEC_Module_Settings_Page {
218
  <li><?php _e( 'Enter only 1 IP address or 1 IP address range per line.', 'better-wp-security' ); ?></li>
219
  </ul>
220
  <p><a href="<?php echo esc_url( ITSEC_Lib::get_trace_ip_link() ); ?>" target="_blank" rel="noopener noreferrer"><?php _e( 'Lookup IP Address.', 'better-wp-security' ); ?></a></p>
221
- <p class="description">
222
- <strong><?php _e( 'This white list will prevent any IP listed from triggering an automatic lockout. You can still block the IP address manually in the banned users settings.', 'better-wp-security' ); ?></strong>
223
- </p>
224
  </td>
225
  </tr>
226
  <tr>
169
  </td>
170
  </tr>
171
  <tr>
172
+ <th scope="row"><label for="itsec-global-blacklist"><?php _e( 'Ban Repeat Offender', 'better-wp-security' ); ?></label></th>
173
  <td>
174
  <?php $form->add_checkbox( 'blacklist' ); ?>
175
+ <label for="itsec-global-blacklist"><?php _e( 'Enable Ban Repeat Offender', 'better-wp-security' ); ?></label>
176
+ <p class="description"><?php _e( 'If this box is checked the IP address of the offending computer will be added to the "Ban Users" list after reaching the number of lockouts listed below.', 'better-wp-security' ); ?></p>
177
  </td>
178
  </tr>
179
  <tr>
180
+ <th scope="row"><label for="itsec-global-blacklist_count"><?php _e( 'Ban Threshold', 'better-wp-security' ); ?></label></th>
181
  <td>
182
  <?php $form->add_text( 'blacklist_count', array( 'class' => 'small-text' ) ); ?>
183
  <label for="itsec-global-blacklist_count"><?php _e( 'Lockouts', 'better-wp-security' ); ?></label>
185
  </td>
186
  </tr>
187
  <tr>
188
+ <th scope="row"><label for="itsec-global-blacklist_period"><?php _e( 'Ban Lookback Period', 'better-wp-security' ); ?></label></th>
189
  <td>
190
  <?php $form->add_text( 'blacklist_period', array( 'class' => 'small-text' ) ); ?>
191
  <label for="itsec-global-blacklist_period"><?php _e( 'Days', 'better-wp-security' ); ?></label>
192
+ <p class="description"><?php _e( 'How many days should a lockout be remembered to meet the ban threshold above.', 'better-wp-security' ); ?></p>
193
  </td>
194
  </tr>
195
  <tr>
197
  <td>
198
  <?php $form->add_text( 'lockout_period', array( 'class' => 'small-text' ) ); ?>
199
  <label for="itsec-global-lockout_period"><?php _e( 'Minutes', 'better-wp-security' ); ?></label>
200
+ <p class="description"><?php _e( 'The length of time a host or user will be banned from this site after hitting the limit of bad logins. The default setting of 15 minutes is recommended as increasing it could prevent attacking IP addresses from being banned.', 'better-wp-security' ); ?></p>
201
  </td>
202
  </tr>
203
  <tr>
204
+ <th scope="row"><label for="itsec-global-lockout_white_list"><?php _e( 'Authorized Hosts List', 'better-wp-security' ); ?></label></th>
205
  <td>
206
  <?php $form->add_textarea( 'lockout_white_list' ); ?>
207
+ <p><?php $form->add_button( 'add-to-whitelist', array( 'value' => __( 'Add my current IP to the Authorized Hosts List', 'better-wp-security' ), 'class' => 'button-primary' ) ); ?></p>
208
+ <p class="description"><?php _e( 'Use the guidelines below to enter hosts that will not be locked out from your site. This will keep you from locking yourself out of any features if you should trigger a lockout. Please note this does not override away mode.', 'better-wp-security' ); ?></p>
209
  <ul>
210
  <li>
211
+ <?php _e( 'You can add authorized users by individual IP address or IP address range using wildcards or CIDR notation.', 'better-wp-security' ); ?>
212
  <ul>
213
  <li><?php _e( 'Individual IP addresses must be in IPv4 or IPv6 standard format (###.###.###.### or ####:####:####:####:####:####:####:####).', 'better-wp-security' ); ?></li>
214
  <li><?php _e( 'CIDR notation is allowed to specify a range of IP addresses (###.###.###.###/## or ####:####:####:####:####:####:####:####/###).', 'better-wp-security' ); ?></li>
218
  <li><?php _e( 'Enter only 1 IP address or 1 IP address range per line.', 'better-wp-security' ); ?></li>
219
  </ul>
220
  <p><a href="<?php echo esc_url( ITSEC_Lib::get_trace_ip_link() ); ?>" target="_blank" rel="noopener noreferrer"><?php _e( 'Lookup IP Address.', 'better-wp-security' ); ?></a></p>
 
 
 
221
  </td>
222
  </tr>
223
  <tr>
core/modules/global/settings.php CHANGED
@@ -41,6 +41,7 @@ final class ITSEC_Global_Settings_New extends ITSEC_Settings {
41
  'server_ips' => array(),
42
  'feature_flags' => array(),
43
  'manage_group' => array(),
 
44
  );
45
  }
46
 
41
  'server_ips' => array(),
42
  'feature_flags' => array(),
43
  'manage_group' => array(),
44
+ 'licensed_hostname_prompt' => false,
45
  );
46
  }
47
 
core/modules/global/validator.php CHANGED
@@ -21,13 +21,13 @@ class ITSEC_Global_Validator extends ITSEC_Validator {
21
  }
22
 
23
 
24
- $this->vars_to_skip_validate_matching_fields = array( 'digest_last_sent', 'digest_messages', 'digest_email', 'email_notifications', 'notification_email', 'backup_email', 'show_new_dashboard_notice', 'proxy_override', 'proxy', 'proxy_header', 'server_ips', 'initial_build', 'feature_flags' );
25
- $this->set_previous_if_empty( array( 'did_upgrade', 'log_info', 'show_security_check', 'build', 'activation_timestamp', 'lock_file', 'cron_status', 'use_cron', 'cron_test_time', 'proxy', 'proxy_header', 'server_ips', 'initial_build', 'feature_flags' ) );
26
  $this->set_default_if_empty( array( 'log_location', 'nginx_file', 'enable_grade_report' ) );
27
  $this->preserve_setting_if_exists( array( 'digest_email', 'email_notifications', 'notification_email', 'backup_email', 'proxy_override' ) );
28
 
29
  $this->sanitize_setting( 'bool', 'write_files', __( 'Write to Files', 'better-wp-security' ) );
30
- $this->sanitize_setting( 'bool', 'blacklist', __( 'Blacklist Repeat Offender', 'better-wp-security' ) );
31
  $this->sanitize_setting( 'bool', 'allow_tracking', __( 'Allow Data Tracking', 'better-wp-security' ) );
32
  $this->sanitize_setting( array_keys( $this->get_proxy_types() ), 'proxy', __( 'Proxy Detection', 'better-wp-security' ) );
33
  $this->sanitize_setting( 'string', 'proxy_header', __( 'Manual Proxy Header', 'better-wp-security' ) );
@@ -39,13 +39,13 @@ class ITSEC_Global_Validator extends ITSEC_Validator {
39
  $this->sanitize_setting( 'string', 'user_lockout_message', __( 'User Lockout Message', 'better-wp-security' ) );
40
  $this->sanitize_setting( 'string', 'community_lockout_message', __( 'Community Lockout Message', 'better-wp-security' ) );
41
 
42
- $this->sanitize_setting( 'positive-int', 'blacklist_count', __( 'Blacklist Threshold', 'better-wp-security' ) );
43
- $this->sanitize_setting( 'positive-int', 'blacklist_period', __( 'Blacklist Lockout Period', 'better-wp-security' ) );
44
  $this->sanitize_setting( 'positive-int', 'lockout_period', __( 'Lockout Period', 'better-wp-security' ) );
45
  $this->sanitize_setting( 'positive-int', 'log_rotation', __( 'Days to Keep Database Logs', 'better-wp-security' ) );
46
  $this->sanitize_setting( 'positive-int', 'file_log_rotation', __( 'Days to Keep File Logs', 'better-wp-security' ) );
47
 
48
- $this->sanitize_setting( 'newline-separated-ips', 'lockout_white_list', __( 'Lockout White List', 'better-wp-security' ) );
49
 
50
  $log_types = array_keys( $this->get_valid_log_types() );
51
  $this->sanitize_setting( $log_types, 'log_type', __( 'Log Type', 'better-wp-security' ) );
@@ -63,6 +63,7 @@ class ITSEC_Global_Validator extends ITSEC_Validator {
63
  $this->sanitize_setting( 'newline-separated-ips', 'server_ips', __( 'Server IPs', 'better-wp-security' ) );
64
  $this->sanitize_setting( 'array', 'feature_flags', __( 'Feature Flags', 'better-wp-security' ) );
65
  $this->sanitize_setting( 'user-groups', 'manage_group', __( 'Manage Group', 'better-wp-security' ) );
 
66
  }
67
 
68
  protected function validate_settings() {
21
  }
22
 
23
 
24
+ $this->vars_to_skip_validate_matching_fields = array( 'digest_last_sent', 'digest_messages', 'digest_email', 'email_notifications', 'notification_email', 'backup_email', 'show_new_dashboard_notice', 'proxy_override', 'proxy', 'proxy_header', 'server_ips', 'initial_build', 'feature_flags', 'licensed_hostname_prompt' );
25
+ $this->set_previous_if_empty( array( 'did_upgrade', 'log_info', 'show_security_check', 'build', 'activation_timestamp', 'lock_file', 'cron_status', 'use_cron', 'cron_test_time', 'proxy', 'proxy_header', 'server_ips', 'initial_build', 'feature_flags', 'licensed_hostname_prompt' ) );
26
  $this->set_default_if_empty( array( 'log_location', 'nginx_file', 'enable_grade_report' ) );
27
  $this->preserve_setting_if_exists( array( 'digest_email', 'email_notifications', 'notification_email', 'backup_email', 'proxy_override' ) );
28
 
29
  $this->sanitize_setting( 'bool', 'write_files', __( 'Write to Files', 'better-wp-security' ) );
30
+ $this->sanitize_setting( 'bool', 'blacklist', __( 'Ban Repeat Offender', 'better-wp-security' ) );
31
  $this->sanitize_setting( 'bool', 'allow_tracking', __( 'Allow Data Tracking', 'better-wp-security' ) );
32
  $this->sanitize_setting( array_keys( $this->get_proxy_types() ), 'proxy', __( 'Proxy Detection', 'better-wp-security' ) );
33
  $this->sanitize_setting( 'string', 'proxy_header', __( 'Manual Proxy Header', 'better-wp-security' ) );
39
  $this->sanitize_setting( 'string', 'user_lockout_message', __( 'User Lockout Message', 'better-wp-security' ) );
40
  $this->sanitize_setting( 'string', 'community_lockout_message', __( 'Community Lockout Message', 'better-wp-security' ) );
41
 
42
+ $this->sanitize_setting( 'positive-int', 'blacklist_count', __( 'Ban Threshold', 'better-wp-security' ) );
43
+ $this->sanitize_setting( 'positive-int', 'blacklist_period', __( 'Ban Lockout Period', 'better-wp-security' ) );
44
  $this->sanitize_setting( 'positive-int', 'lockout_period', __( 'Lockout Period', 'better-wp-security' ) );
45
  $this->sanitize_setting( 'positive-int', 'log_rotation', __( 'Days to Keep Database Logs', 'better-wp-security' ) );
46
  $this->sanitize_setting( 'positive-int', 'file_log_rotation', __( 'Days to Keep File Logs', 'better-wp-security' ) );
47
 
48
+ $this->sanitize_setting( 'newline-separated-ips', 'lockout_white_list', __( 'Authorized Hosts List', 'better-wp-security' ) );
49
 
50
  $log_types = array_keys( $this->get_valid_log_types() );
51
  $this->sanitize_setting( $log_types, 'log_type', __( 'Log Type', 'better-wp-security' ) );
63
  $this->sanitize_setting( 'newline-separated-ips', 'server_ips', __( 'Server IPs', 'better-wp-security' ) );
64
  $this->sanitize_setting( 'array', 'feature_flags', __( 'Feature Flags', 'better-wp-security' ) );
65
  $this->sanitize_setting( 'user-groups', 'manage_group', __( 'Manage Group', 'better-wp-security' ) );
66
+ $this->sanitize_setting( 'bool', 'licensed_hostname_prompt', __( 'Licensed Hostname Prompt', 'better-wp-security' ) );
67
  }
68
 
69
  protected function validate_settings() {
core/modules/malware/class-itsec-malware-scan-results-template.php CHANGED
@@ -2,11 +2,6 @@
2
 
3
  class ITSEC_Malware_Scan_Results_Template {
4
  public static function get_html( $results, $show_error_details = false ) {
5
-
6
- if ( ( $html = apply_filters( 'itsec_pre_malware_scanner_get_html', null, $results, $show_error_details ) ) !== null ) {
7
- return $html;
8
- }
9
-
10
  if ( is_wp_error( $results ) && ( $edata = $results->get_error_data() ) && ! empty( $edata['itsec_site'] ) ) {
11
  $site_url = $edata['itsec_site']['url'];
12
  } elseif ( is_array( $results ) && ! empty( $results['itsec_site'] ) ) {
2
 
3
  class ITSEC_Malware_Scan_Results_Template {
4
  public static function get_html( $results, $show_error_details = false ) {
 
 
 
 
 
5
  if ( is_wp_error( $results ) && ( $edata = $results->get_error_data() ) && ! empty( $edata['itsec_site'] ) ) {
6
  $site_url = $edata['itsec_site']['url'];
7
  } elseif ( is_array( $results ) && ! empty( $results['itsec_site'] ) ) {
core/modules/malware/class-itsec-malware-scanner.php CHANGED
@@ -1,58 +1,10 @@
1
  <?php
2
 
3
  final class ITSEC_Malware_Scanner {
4
- protected static $transient_name = 'itsec_cached_sucuri_scan';
5
-
6
  public static function scan( $site_id = 0 ) {
 
7
 
8
- if ( ( $results = apply_filters( 'itsec_pre_malware_scanner_scan', null, $site_id ) ) !== null ) {
9
- return $results;
10
- }
11
-
12
- $process_id = ITSEC_Log::add_process_start( 'malware', 'scan', compact( 'site_id' ) );
13
-
14
- if ( $site_id && ! is_main_site( $site_id ) ) {
15
- $results = self::scan_sub_site( $site_id, $process_id );
16
- } else {
17
- $results = self::scan_main_site( $process_id );
18
- }
19
-
20
- ITSEC_Log::add_process_stop( $process_id, compact( 'results' ) );
21
-
22
- if ( is_array( $results ) && ! empty( $results['cached'] ) ) {
23
- return $results;
24
- }
25
-
26
- if ( is_wp_error( $results ) ) {
27
- if ( self::is_sucuri_error( $results ) ) {
28
- ITSEC_Log::add_warning( 'malware', 'scan-failure-server-error', compact( 'results' ) );
29
- } else {
30
- ITSEC_Log::add_warning( 'malware', 'scan-failure-client-error', compact( 'results' ) );
31
- }
32
- } else if ( ! empty( $results['SYSTEM']['ERROR'] ) ) {
33
- ITSEC_Log::add_warning( 'malware', 'sucuri-system-error', compact( 'results' ) );
34
- } else if ( ! empty( $results['MALWARE']['WARN'] ) ) {
35
- $data = compact( 'results' );
36
-
37
- if ( ITSEC_Lib_Remote_Messages::has_action( 'malware-scanner-disable-malware-warnings' ) ) {
38
- $data['sucuri_error'] = true;
39
- ITSEC_Log::add_warning( 'malware', 'malware-warning-suppressed', $data );
40
-
41
- return $results;
42
- }
43
-
44
- if ( ! empty( $results['BLACKLIST']['WARN'] ) ) {
45
- ITSEC_Log::add_critical_issue( 'malware', 'found-malware-and-on-blacklist', $data );
46
- } else {
47
- ITSEC_Log::add_critical_issue( 'malware', 'found-malware', $data );
48
- }
49
- } else if ( ! empty( $results['BLACKLIST']['WARN'] ) ) {
50
- ITSEC_Log::add_critical_issue( 'malware', 'on-blacklist', compact( 'results' ) );
51
- } else {
52
- ITSEC_Log::add_notice( 'malware', 'clean', compact( 'results' ) );
53
- }
54
-
55
- return $results;
56
  }
57
 
58
  /**
@@ -63,6 +15,8 @@ final class ITSEC_Malware_Scanner {
63
  * @return bool
64
  */
65
  public static function is_sucuri_error( $results ) {
 
 
66
  if ( ! is_wp_error( $results ) ) {
67
  return false;
68
  }
@@ -91,201 +45,4 @@ final class ITSEC_Malware_Scanner {
91
 
92
  return true;
93
  }
94
-
95
- /**
96
- * Scan the main site of the network.
97
- *
98
- * This handles caching and filter overrides for URLs.
99
- *
100
- * @param array $process_id
101
- *
102
- * @return array|WP_Error
103
- */
104
- protected static function scan_main_site( $process_id ) {
105
-
106
- $response = get_site_transient( self::$transient_name );
107
- $cached = true;
108
-
109
- ITSEC_Log::add_process_update( $process_id, array( 'cached-response' => $response ) );
110
-
111
- if ( defined( 'ITSEC_TEST_MALWARE_SCAN_SKIP_CACHE' ) && ITSEC_TEST_MALWARE_SCAN_SKIP_CACHE ) {
112
- ITSEC_Log::add_process_update( $process_id, array( 'action' => 'define-skip-cache', 'define-name' => 'ITSEC_TEST_MALWARE_SCAN_SKIP_CACHE', 'define-value' => ITSEC_TEST_MALWARE_SCAN_SKIP_CACHE ) );
113
- $cached = false;
114
- $response = false;
115
- }
116
-
117
- if ( false === $response ) {
118
- $cached = false;
119
-
120
- $site_url = apply_filters( 'itsec_test_malware_scan_site_url', get_home_url() );
121
-
122
- if ( defined( 'ITSEC_TEST_MALWARE_SCAN_SITE_URL' ) ) {
123
- ITSEC_Log::add_process_update( $process_id, array( 'action' => 'define-force-site-url', 'original-site-url' => $site_url, 'define-name' => 'ITSEC_TEST_MALWARE_SCAN_SITE_URL', 'define-value' => ITSEC_TEST_MALWARE_SCAN_SITE_URL ) );
124
- $site_url = ITSEC_TEST_MALWARE_SCAN_SITE_URL;
125
- }
126
-
127
- $response = self::scan_url( $site_url, $process_id );
128
-
129
- if ( ! is_wp_error( $response ) ) {
130
- set_site_transient( self::$transient_name, array(
131
- 'body' => $response['body'],
132
- 'headers' => $response['headers'],
133
- 'response' => $response['response'],
134
- ), MINUTE_IN_SECONDS * 10 );
135
- }
136
- } else {
137
- ITSEC_Log::add_process_update( $process_id, array( 'action' => 'using-cached-response' ) );
138
- }
139
-
140
- if ( is_wp_error( $response ) ) {
141
- return $response;
142
- }
143
-
144
- $results = self::parse_response( $response );
145
-
146
- if ( ! is_wp_error( $results ) ) {
147
- $results['cached'] = $cached;
148
- }
149
-
150
- return $results;
151
- }
152
-
153
- /**
154
- * Scan a sub site.
155
- *
156
- * These requests are not cached.
157
- *
158
- * @param int $site_id
159
- * @param array $process_id
160
- *
161
- * @return array|WP_Error
162
- */
163
- protected static function scan_sub_site( $site_id, $process_id ) {
164
-
165
- $url = get_home_url( $site_id );
166
- $record = array(
167
- 'url' => $url,
168
- 'id' => $site_id,
169
- );
170
-
171
- if ( $url ) {
172
- $response = self::scan_url( $url, $process_id );
173
-
174
- if ( is_wp_error( $response ) ) {
175
- return $response;
176
- }
177
-
178
- $results = self::parse_response( $response );
179
- } else {
180
- $results = new WP_Error( 'itsec-malware-scanner-invalid-site', sprintf( __( 'Failed to scan site #%d because it does not exist.', 'better-wp-security' ), $site_id ) );
181
- }
182
-
183
- if ( is_wp_error( $results ) ) {
184
- $results->add_data( array_merge( $results->get_error_data(), array( 'itsec_site' => $record ) ) );
185
- } else {
186
- $results['itsec_site'] = $record;
187
- }
188
-
189
- return $results;
190
- }
191
-
192
- /**
193
- * Request a Sucuri Malware Scan for a URL.
194
- *
195
- * @param string $site_url
196
- * @param array $process_id
197
- *
198
- * @return array|WP_Error
199
- */
200
- protected static function scan_url( $site_url, $process_id ) {
201
-
202
- $site_url = preg_replace( '|^https?://|i', '', $site_url );
203
-
204
- $query_args = array(
205
- 'scan' => $site_url,
206
- 'p' => 'ithemes',
207
- 'clear' => 1,
208
- 'json' => 1,
209
- 'time' => time(),
210
- );
211
-
212
- $key = apply_filters( 'itsec_sucuri_key', '' );
213
-
214
- if ( defined( 'ITSEC_SUCURI_KEY' ) ) {
215
- $key = ITSEC_SUCURI_KEY;
216
- }
217
-
218
- if ( ! empty( $key ) ) {
219
- $query_args['k'] = $key;
220
- }
221
-
222
- $scanner_url = 'https://sitecheck.sucuri.net/';
223
- $scan_url = "$scanner_url?" . http_build_query( $query_args, '', '&' );
224
-
225
- $req_args = array(
226
- 'connect_timeout' => 30, // Placeholder for when WordPress implements support.
227
- 'timeout' => 300,
228
- );
229
-
230
- if ( defined( 'ITSEC_TEST_MALWARE_SCAN_DISABLE_SSLVERIFY' ) && ITSEC_TEST_MALWARE_SCAN_DISABLE_SSLVERIFY ) {
231
- $req_args['sslverify'] = false;
232
-
233
- // Ensure that another plugin isn't preventing the disabling of sslverify from working.
234
- add_filter( 'https_local_ssl_verify', '__return_false', 999999 );
235
- add_filter( 'https_ssl_verify', '__return_false', 999999 );
236
- }
237
-
238
- $response = wp_remote_get( $scan_url, $req_args );
239
-
240
- if ( defined( 'ITSEC_TEST_MALWARE_SCAN_DISABLE_SSLVERIFY' ) && ITSEC_TEST_MALWARE_SCAN_DISABLE_SSLVERIFY ) {
241
- remove_filter( 'https_local_ssl_verify', '__return_false', 999999 );
242
- remove_filter( 'https_ssl_verify', '__return_false', 999999 );
243
- }
244
-
245
- ITSEC_Log::add_process_update( $process_id, compact( 'scan_url', 'req_args', 'response' ) );
246
-
247
- return $response;
248
- }
249
-
250
- /**
251
- * Parse the response from Sucuri to get either a WP_Error instance or the scan results.
252
- *
253
- * @param array $response
254
- *
255
- * @return array|WP_Error
256
- */
257
- protected static function parse_response( $response ) {
258
-
259
- if ( isset( $response['body'] ) ) {
260
- $body = $response['body'];
261
- } else {
262
- return new WP_Error( 'itsec-malware-scanner-wp-remote-get-response-missing-body', __( 'The scan failed due to an unexpected technical error. The response from the wp_remote_get function does not contain a body entry. Since the body entry contains the response for the request to Sucuri\'s servers, the response cannot be processed. This could indicate a plugin/theme compatibility issue or a problem in WordPress.', 'better-wp-security' ), $response );
263
- }
264
-
265
- if ( empty( $body ) ) {
266
- return new WP_Error( 'itsec-malware-scanner-wp-remote-get-response-empty-body', __( 'The scan failed due to an unexpected technical error. The response from the wp_remote_get function contains an empty body entry. Since the body entry contains the response for the request to Sucuri\'s servers, the response cannot be processed. This could indicate a plugin/theme compatibility issue or a problem in WordPress.', 'better-wp-security' ), $response );
267
- }
268
-
269
- $body = @json_decode( $body, true );
270
-
271
- if ( is_null( $body ) && isset( $response['headers']['content-type'] ) ) {
272
- if ( 'application/json' === $response['headers']['content-type'] ) {
273
- return new WP_Error( 'itsec-malware-scanner-invalid-json-data-in-scan-response', __( 'The scan did not complete successfully. The Sucuri server should send its response in JSON encoding. The response indicates that the encoding is JSON, but the data could not be decoded. This problem could be due to a temporary Sucuri server issue or a compatibility issue on your server. If the problem continues, please contact iThemes Security support.', 'better-wp-security' ), $response );
274
- } else {
275
- return new WP_Error( 'itsec-malware-scanner-invalid-content-type-in-scan-response', sprintf( __( 'The scan did not complete successfully. The Sucuri server should send its response in JSON encoding. The data received from the Sucuri server could not be decoded. In addition, a content type of <code>%s</code> was received when a content type of <code>application/json</code> was expected. This could indicate a temporary issue with the Sucuri servers.', 'better-wp-security' ), esc_html( $response['headers']['content-type'] ) ), $response );
276
- }
277
- } else if ( ! is_array( $body ) ) {
278
- if ( 0 === strpos( $response['body'], 'ERROR' ) ) {
279
- return new WP_Error( 'itsec-malware-scanner-error-received', sprintf( __( 'The scan did not complete successfully. Sucuri sent the following error: %s', 'better-wp-security' ), '<code>' . $response['body'] . '</code>' ), $response );
280
- }
281
-
282
- if ( ! empty( $response['response'] ) && ! empty( $response['response']['code'] ) ) {
283
- return new WP_Error( 'itsec-malware-scanner-unknown-scan-error', sprintf( __( 'An unknown error prevented the scan from completing successfully. The Sucuri server responded with a <code>%s</code> error code.', 'better-wp-security' ), $response['response']['code'] ), $response );
284
- }
285
-
286
- return new WP_Error( 'itsec-malware-scanner-wp-remote-get-response-malformed', __( 'The scan failed due to an unexpected technical error. The response from the wp_remote_get function is missing some critical information that is needed in order to properly process the response from Sucuri\'s servers. This could indicate a plugin/theme compatibility issue or a problem in WordPress.', 'better-wp-security' ), $response );
287
- }
288
-
289
- return $body;
290
- }
291
  }
1
  <?php
2
 
3
  final class ITSEC_Malware_Scanner {
 
 
4
  public static function scan( $site_id = 0 ) {
5
+ _deprecated_function( __METHOD__, '5.8.0', 'ITSEC_Site_Scanner_API::scan' );
6
 
7
+ return new WP_Error( 'malware_scanner_deprecated', __( 'The malware scanner has been deprecated. Please switch to the Site Scanner API.', 'better-wp-security' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  }
9
 
10
  /**
15
  * @return bool
16
  */
17
  public static function is_sucuri_error( $results ) {
18
+ _deprecated_function( __METHOD__, '5.8.0' );
19
+
20
  if ( ! is_wp_error( $results ) ) {
21
  return false;
22
  }
45
 
46
  return true;
47
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  }
core/modules/malware/class-itsec-malware.php CHANGED
@@ -3,40 +3,10 @@
3
  class ITSEC_Malware {
4
 
5
  function run() {
6
- add_action( 'ithemes_sync_register_verbs', array( $this, 'register_sync_verbs' ) );
7
- add_filter( 'itsec-filter-itsec-get-everything-verbs', array( $this, 'register_sync_get_everything_verbs' ) );
8
  add_action( 'admin_enqueue_scripts', array( $this, 'register_scripts' ) );
9
  }
10
 
11
- /**
12
- * Register verbs for Sync.
13
- *
14
- * @since 3.6.0
15
- *
16
- * @param Ithemes_Sync_API $api Sync API object.
17
- */
18
- public function register_sync_verbs( $api ) {
19
- $api->register( 'itsec-do-malware-scan', 'Ithemes_Sync_Verb_ITSEC_Malware_Do_Scan', dirname( __FILE__ ) . '/sync-verbs/itsec-do-malware-scan.php' );
20
- $api->register( 'itsec-get-malware-scan-log', 'Ithemes_Sync_Verb_ITSEC_Get_Malware_Scan_Log', dirname( __FILE__ ) . '/sync-verbs/itsec-get-malware-scan-log.php' );
21
- }
22
-
23
- /**
24
- * Filter to add verbs to the response for the itsec-get-everything verb.
25
- *
26
- * @since 3.6.0
27
- *
28
- * @param array Array of verbs.
29
- *
30
- * @return array Array of verbs.
31
- */
32
- public function register_sync_get_everything_verbs( $verbs ) {
33
- $verbs['malware'][] = 'itsec-get-malware-scan-log';
34
-
35
- return $verbs;
36
- }
37
-
38
  public function register_scripts() {
39
- wp_register_script( 'itsec-malware-scan', plugin_dir_url( __FILE__ ) . 'js/malware.js', array( 'jquery' ), 3 );
40
  }
41
-
42
  }
3
  class ITSEC_Malware {
4
 
5
  function run() {
 
 
6
  add_action( 'admin_enqueue_scripts', array( $this, 'register_scripts' ) );
7
  }
8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  public function register_scripts() {
10
+ wp_register_script( 'itsec-malware-scan', plugin_dir_url( __FILE__ ) . 'js/malware.js', array( 'jquery' ), 4 );
11
  }
 
12
  }
core/modules/malware/css/index.php CHANGED
@@ -1,2 +1 @@
1
- <?php
2
- // Silence is golden.
1
+ <?php // Silence is golden.
 
core/modules/malware/css/settings.css DELETED
@@ -1,82 +0,0 @@
1
- .itsec-malware-scan-results h4 {
2
- margin-top: 5px;
3
- }
4
-
5
- .itsec-malware-scan-results ul {
6
- margin-left: 20px;
7
- }
8
- .itsec-malware-scan-results ul li {
9
- line-height: 16px;
10
- list-style: outside none disc;
11
- }
12
- .itsec-malware-scan-details {
13
- display: none;
14
- }
15
- .itsec-malware-scan-details pre {
16
- background-color: #eaeaea;
17
- padding: 1em;
18
- white-space: pre-wrap;
19
- }
20
- .itsec-malware-scan-results-section {
21
- border: 1px solid #ddd;
22
- border-bottom-color: transparent;
23
- padding: 0 1em;
24
- }
25
- .itsec-malware-scan-results-section:last-child {
26
- border-bottom-color: #ddd;
27
- }
28
- .form-table td .itsec-malware-scan-results-section p {
29
- margin: 1em 0;
30
- }
31
- .itsec-malware-scan-clean,
32
- .itsec-malware-scan-warn,
33
- .itsec-malware-scan-error {
34
- padding: 2px 6px;
35
- color: #fff;
36
- margin-right: 1em;
37
- width: 60px;
38
- text-align: center;
39
- }
40
- span.itsec-malware-scan-clean,
41
- span.itsec-malware-scan-warn,
42
- span.itsec-malware-scan-error {
43
- display:inline-block;
44
- }
45
- .itsec-malware-scan-clean {
46
- background: #7ad03a;
47
- }
48
- .itsec-malware-scan-warn,
49
- .itsec-malware-scan-error {
50
- background: #dd3d36;
51
- }
52
- .itsec-malware-scan-details .itsec-malware-scan-warn,
53
- .itsec-malware-scan-details .itsec-malware-scan-error,
54
- .itsec-malware-scan-details .itsec-malware-scan-clean {
55
- background: none;
56
- padding: 0;
57
- color: inherit;
58
- margin: 0;
59
- width: 100%;
60
- text-align: left;
61
- }
62
- .itsec-malware-scan-details .itsec-malware-scan-warn,
63
- .itsec-malware-scan-details .itsec-malware-scan-error {
64
- color: #dd3d36;
65
- }
66
- .itsec-malware-scan-details .itsec-malware-scan-clean {
67
- color: #7ad03a;
68
- }
69
- .itsec-malware-scan-results-section .itsec-malware-scan-details li {
70
- margin-bottom: .25em;
71
- padding-bottom: .5em;
72
- border-bottom: 1px solid #ddd;
73
- }
74
- .itsec-malware-scan-results-section .itsec-malware-scan-details li:last-child {
75
- border:none;
76
- }
77
- .itsec-malware-scan-results-section .itsec-malware-scan-details li span {
78
- color: #444;
79
- }
80
- .itsec-malware-scan-toggle-details {
81
- margin-left: 1em;
82
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
core/modules/malware/js/index.php CHANGED
@@ -1 +1 @@
1
- <?php //You don't belong here. ?>
1
+ <?php // Silence is golden.
core/modules/malware/js/malware.js CHANGED
@@ -7,9 +7,7 @@
7
  },
8
 
9
  bindEvents: function() {
10
- $('#itsec-malware-scan').on('click', this.startScan);
11
  $(document).on('click', '.itsec-malware-scan-results .itsec-malware-scan-toggle-details', this.toggleDetails);
12
- $(document).on('click', '.itsec-site-scan-toggle-details', this.toggleSiteScanDetails );
13
  },
14
 
15
  toggleDetails: function( event ) {
@@ -25,82 +23,6 @@
25
  $(this).html('Hide Details');
26
  $details.show();
27
  }
28
- },
29
-
30
- toggleSiteScanDetails: function( e ) {
31
- e.preventDefault();
32
-
33
- var $container = $( this ).parents( '.itsec-site-scan-results-section' );
34
- var $details = $container.find( '.itsec-site-scan__details' );
35
-
36
- if ( $details.hasClass( 'hidden' ) ) {
37
- $( this ).text( 'Hide Details' ).attr( 'aria-expanded', true );
38
- $details.removeClass( 'hidden' );
39
- } else {
40
- $( this ).text( 'Show Details' ).attr( 'aria-expanded', false );
41
- $details.addClass( 'hidden' );
42
- }
43
- },
44
-
45
- startScan: function( event ) {
46
- event.preventDefault();
47
-
48
- itsecMalwareScanData.originalSubmitButtonText = $(this).val();
49
-
50
- $(this)
51
- .prop( 'disabled', true )
52
- .val( itsecMalwareScanData.clickedButtonText );
53
-
54
- var postData = {
55
- action: 'itsec_malware_scan',
56
- _wpnonce: itsecMalwareScanData.nonce
57
- };
58
-
59
- $.ajax( ajaxurl, {
60
- type: 'POST',
61
- data: postData,
62
- success: itsecMalware.handleSuccessResponse,
63
- error: itsecMalware.handleErrorResponse,
64
- timeout: 0
65
- });
66
- },
67
-
68
- handleSuccessResponse: function( data, status, jqXHR ) {
69
- $('#itsec-malware-scan').hide();
70
-
71
- if ( 'string' !== typeof data ) {
72
- itsecMalware.showError( itsecMalwareScanData.errorMessages.parseError );
73
- } else if ( '-1' === data ) {
74
- itsecMalware.showError( itsecMalwareScanData.errorMessages.nonceFailure );
75
- } else if ( '-2' === data ) {
76
- itsecMalware.showError( itsecMalwareScanData.errorMessages.invalidUser );
77
- } else {
78
- $('.itsec-malware-scan-results-wrapper').html( data );
79
- }
80
- },
81
-
82
- handleErrorResponse: function( jqXHR, status, exception ) {
83
- $('#itsec-malware-scan').hide();
84
-
85
- var message = itsecMalwareScanData.errorMessages.ajaxUnknown;
86
-
87
- if ( 'timeout' === status ) {
88
- message = itsecMalwareScanData.errorMessages.ajaxTimeout;
89
- } else if ( 'parsererror' === status ) {
90
- message = itsecMalwareScanData.errorMessages.parseError;
91
- }
92
-
93
- itsecMalware.showError( message, '(' + status + ') ' + exception )
94
- },
95
-
96
- showError: function( message, replacement ) {
97
- if ( 'string' === typeof replacement ) {
98
- message = message.replace( '%1$s', replacement );
99
- }
100
-
101
- message = '<div class="error inline"><p><strong>' + message + '</strong></p></div>';
102
-
103
- $('.itsec-malware-scan-results-wrapper').html( message );
104
  }
105
  };
106
 
7
  },
8
 
9
  bindEvents: function() {
 
10
  $(document).on('click', '.itsec-malware-scan-results .itsec-malware-scan-toggle-details', this.toggleDetails);
 
11
  },
12
 
13
  toggleDetails: function( event ) {
23
  $(this).html('Hide Details');
24
  $details.show();
25
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  }
27
  };
28
 
core/modules/malware/js/settings-page.js DELETED
@@ -1,89 +0,0 @@
1
- "use strict";
2
-
3
- (function( $ ) {
4
- var itsecMalwareScan = {
5
- init: function() {
6
- this.bindEvents();
7
- },
8
-
9
- bindEvents: function() {
10
- $( document ).on( 'click', '#itsec-malware-scan-start', this.startScan );
11
- $( document ).on( 'click', '.itsec-malware-scan-results-wrapper .itsec-malware-scan-toggle-details', this.toggleDetails );
12
- $( document ).on('click', '.itsec-site-scan-toggle-details', this.toggleSiteScanDetails );
13
- },
14
-
15
- toggleDetails: function( e ) {
16
- e.preventDefault();
17
-
18
- var $container = $(this).parents( '.itsec-malware-scan-results-section' );
19
- var $details = $container.find( '.itsec-malware-scan-details' );
20
-
21
- if ( $details.is(':visible') ) {
22
- $(this).html( itsecMalwareScanData.showDetailsText );
23
- $details.hide();
24
- } else {
25
- $(this).html( itsecMalwareScanData.hideDetailsText );
26
- $details.show();
27
- }
28
- },
29
-
30
- toggleSiteScanDetails: function(e) {
31
- e.preventDefault();
32
-
33
- var $container = $( this ).parents( '.itsec-site-scan-results-section' );
34
- var $details = $container.find( '.itsec-site-scan__details' );
35
-
36
- if ( $details.is( ':visible' ) ) {
37
- $( this ).text( 'Show Details' ).attr( 'aria-expanded', false );
38
- $details.hide();
39
- } else {
40
- $( this ).text( 'Hide Details' ).attr( 'aria-expanded', true );
41
- $details.show();
42
- }
43
- },
44
-
45
- startScan: function( e ) {
46
- e.preventDefault();
47
-
48
- itsecMalwareScanData.originalSubmitButtonText = $(this).val();
49
-
50
- $(this)
51
- .prop( 'disabled', true )
52
- .val( itsecMalwareScanData.clickedButtonText );
53
-
54
- var data = {
55
- 'action': 'run-scan'
56
- };
57
-
58
- itsecUtil.sendWidgetAJAXRequest( 'malware-scan', data, itsecMalwareScan.handleResponse );
59
- },
60
-
61
- handleResponse: function( results ) {
62
- $('#itsec-malware-scan-start').hide();
63
-
64
- if ( results.response && results.response.length ) {
65
- $('.itsec-malware-scan-results-wrapper').html( results.response );
66
- }
67
-
68
- if ( results.errors.length > 0 ) {
69
- var message;
70
-
71
- $.each( results.errors, function( index, error ) {
72
- message = '<div class="notice notice-error notice-alt"><p><strong>' + error + '</strong></p></div>';
73
- $('.itsec-malware-scan-results-wrapper').append( message );
74
- } );
75
- }
76
-
77
- if ( results.warnings.length > 0 ) {
78
- $.each( results.warnings, function( index, warning ) {
79
- message = '<div class="notice notice-warning notice-alt"><p>' + warning + '</p></div>';
80
- $('.itsec-malware-scan-results-wrapper').append( message );
81
- } );
82
- }
83
- },
84
- };
85
-
86
- $(document).ready(function() {
87
- itsecMalwareScan.init();
88
- });
89
- })( jQuery );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
core/modules/malware/privacy.php DELETED
@@ -1,17 +0,0 @@
1
- <?php
2
-
3
- final class ITSEC_Malware_Privacy {
4
- public function __construct() {
5
- add_filter( 'itsec_get_privacy_policy_for_sharing', array( $this, 'get_privacy_policy_for_sharing' ) );
6
- }
7
-
8
- public function get_privacy_policy_for_sharing( $policy ) {
9
- $suggested_text = '<strong class="privacy-policy-tutorial">' . __( 'Suggested text:' ) . ' </strong>';
10
-
11
- /* Translators: 1: Link to Sucuri's privacy policy */
12
- $policy .= "<p>$suggested_text " . sprintf( wp_kses( __( 'This site is scanned for potential malware and vulnerabilities by Sucuri\'s SiteCheck. We do not send personal information to Sucuri; however, Sucuri could find personal information posted publicly (such as in comments) during their scan. For more details, please see <a href="%1$s">Sucuri\'s privacy policy</a>.', 'better-wp-security' ), array( 'a' => array( 'href' => array() ) ) ), 'https://sucuri.net/privacy' ) . "</p>\n";
13
-
14
- return $policy;
15
- }
16
- }
17
- new ITSEC_Malware_Privacy();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
core/modules/malware/settings-page.php DELETED
@@ -1,80 +0,0 @@
1
- <?php
2
-
3
- class ITSEC_Settings_Page_Sidebar_Widget_Malware_Scan extends ITSEC_Settings_Page_Sidebar_Widget {
4
- private $script_version = 2;
5
-
6
-
7
- public function __construct() {
8
- ITSEC_Lib::load( 'feature-flags' );
9
-
10
- $this->id = 'malware-scan';
11
- $this->title = ITSEC_Lib_Feature_Flags::is_enabled( 'site_scanner' ) ? __( 'Site Scan', 'better-wp-security' ) : __( 'Malware Scan', 'better-wp-security' );
12
- $this->priority = 8;
13
-
14
- parent::__construct();
15
- }
16
-
17
- public function enqueue_scripts_and_styles() {
18
- $vars = array(
19
- 'clickedButtonText' => __( 'Scanning...', 'better-wp-security' ),
20
- 'showDetailsText' => __( 'Show Details', 'better-wp-security' ),
21
- 'hideDetailsText' => __( 'Hide Details', 'better-wp-security' ),
22
- );
23
-
24
- wp_enqueue_script( 'itsec-settings-malware-scan-settings-script', plugins_url( 'js/settings-page.js', __FILE__ ), array( 'jquery' ), $this->script_version, true );
25
- wp_localize_script( 'itsec-settings-malware-scan-settings-script', 'itsecMalwareScanData', $vars );
26
-
27
- wp_enqueue_style( 'itsec-settings-malware-scan-style', plugins_url( 'css/settings.css', __FILE__ ), array(), $this->script_version );
28
- wp_enqueue_style( 'itsec-core-packages-components-site-scan-results-style' );
29
- }
30
-
31
- public function handle_ajax_request( $data ) {
32
- require_once( dirname( __FILE__ ) . '/class-itsec-malware-scanner.php' );
33
- require_once( dirname( __FILE__ ) . '/class-itsec-malware-scan-results-template.php' );
34
-
35
- $temporary_error = false;
36
-
37
- if ( ! ITSEC_Core::current_user_can_manage() ) {
38
- $results = new WP_Error( 'itsec-settings-malware-scan-insufficient-privileges', __( 'An error prevented the scan from completing as expected. The currently logged in user does not have sufficient permissions to run this scan. You may need to log out of the site and log back in.', 'better-wp-security' ) );
39
- } else {
40
- $results = ITSEC_Malware_Scanner::scan();
41
- $temporary_error = ITSEC_Malware_Scanner::is_sucuri_error( $results );
42
- }
43
-
44
- if ( $temporary_error ) {
45
- ITSEC_Response::add_warning( __( 'Malware scanning is temporarily unavailable, please try again later.', 'better-wp-security' ) );
46
- } else {
47
- ITSEC_Response::set_response( ITSEC_Malware_Scan_Results_Template::get_html( $results, true ) );
48
- }
49
- }
50
-
51
- public function render( $form ) {
52
- if ( ITSEC_Lib_Feature_Flags::is_enabled( 'site_scanner' ) ) {
53
- $button = __( 'Scan Now', 'better-wp-security' );
54
- $module = 'site-scanner';
55
- $description = __( 'This %1$ssite scan is powered by iThemes%2$s. We use several datapoints to check for known malware, blacklisting status, website errors and out-of-date software. These datapoints are not 100% accurate, but we try our best to provide thorough results.', 'better-wp-security' );
56
- $description = sprintf( $description, '<a href="https://help.ithemes.com/hc/en-us/articles/360046334433" target="_blank">', '</a>' );
57
- } else {
58
- $button = __( 'Scan Homepage for Malware', 'better-wp-security' );
59
- $module = 'malware';
60
- $description = sprintf( __( 'This malware scan is powered by <a href="%s">Sucuri SiteCheck</a>. It checks for known malware, blacklisting status, website errors and out-of-date software. Although the Sucuri team does its best to provide thorough results, 100%% accuracy is not realistic and is not guaranteed.', 'better-wp-security' ), esc_url( 'https://ithemes.com/sitecheck' ) );
61
- }
62
-
63
- ?>
64
- <div class="hide-if-no-js">
65
- <p><?php echo $description; ?></p>
66
- <p><?php printf( __( 'Results of previous scans can be found on the <a href="%s">logs page</a>.', 'better-wp-security' ), ITSEC_Core::get_logs_page_url( $module ) ); ?></p>
67
- <div class='itsec-malware-scan-results-wrapper'></div>
68
- <?php $form->add_button( 'start', array( 'value' => $button, 'class' => 'button-primary' ) ); ?>
69
- </div>
70
- <div class="hide-if-js">
71
- <p><?php _e( 'The malware scanner requires Javascript in order to function. If Javascript is disabled in your browser, please enable it. If Javascript is not disabled, a script from another plugin, the theme, or a broken WordPress file is preventing the malware scanner\'s script from executing properly. Please try disabling other plugins to see if that resolves the issue.', 'better-wp-security' ); ?></p>
72
- </div>
73
- <?php
74
- }
75
-
76
- protected function save( $data ) {
77
- }
78
- }
79
-
80
- new ITSEC_Settings_Page_Sidebar_Widget_Malware_Scan();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
core/modules/malware/setup.php DELETED
@@ -1,70 +0,0 @@
1
- <?php
2
-
3
- if ( ! class_exists( 'ITSEC_Malware_Setup' ) ) {
4
-
5
- class ITSEC_Malware_Setup {
6
-
7
- private
8
- $defaults;
9
-
10
- public function __construct() {
11
-
12
- add_action( 'itsec_modules_do_plugin_activation', array( $this, 'execute_activate' ) );
13
- add_action( 'itsec_modules_do_plugin_deactivation', array( $this, 'execute_deactivate' ) );
14
- add_action( 'itsec_modules_do_plugin_uninstall', array( $this, 'execute_uninstall' ) );
15
- add_action( 'itsec_modules_do_plugin_upgrade', array( $this, 'execute_upgrade' ), null, 2 );
16
-
17
- $this->defaults = array(
18
- 'enabled' => false,
19
- 'api_key' => '',
20
- );
21
-
22
- }
23
-
24
- /**
25
- * Execute module activation.
26
- *
27
- * @since 4.0
28
- *
29
- * @return void
30
- */
31
- public function execute_activate() {}
32
-
33
- /**
34
- * Execute module deactivation
35
- *
36
- * @return void
37
- */
38
- public function execute_deactivate() {
39
- delete_site_transient( 'itsec_cached_sucuri_scan' );
40
- }
41
-
42
- /**
43
- * Execute module uninstall
44
- *
45
- * @return void
46
- */
47
- public function execute_uninstall() {
48
-
49
- $this->execute_deactivate();
50
-
51
- delete_site_option( 'itsec_malware' );
52
-
53
- }
54
-
55
- /**
56
- * Execute module upgrade
57
- *
58
- * @return void
59
- */
60
- public function execute_upgrade( $itsec_old_version ) {
61
- if ( $itsec_old_version < 4065 ) {
62
- delete_site_option( 'itsec_malware' );
63
- }
64
- }
65
-
66
- }
67
-
68
- }
69
-
70
- new ITSEC_Malware_Setup();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
core/modules/malware/sync-verbs/itsec-do-malware-scan.php DELETED
@@ -1,12 +0,0 @@
1
- <?php
2
-
3
- class Ithemes_Sync_Verb_ITSEC_Malware_Do_Scan extends Ithemes_Sync_Verb {
4
- public static $name = 'itsec-do-malware-scan';
5
- public static $description = '';
6
-
7
- public function run( $arguments ) {
8
- require_once( dirname( dirname( __FILE__ ) ) . '/class-itsec-malware-scanner.php' );
9
-
10
- return ITSEC_Malware_Scanner::scan();
11
- }
12
- }
 
 
 
 
 
 
 
 
 
 
 
 
core/modules/malware/sync-verbs/itsec-get-malware-scan-log.php DELETED
@@ -1,17 +0,0 @@
1
- <?php
2
-
3
- class Ithemes_Sync_Verb_ITSEC_Get_Malware_Scan_Log extends Ithemes_Sync_Verb {
4
- public static $name = 'itsec-get-malware-scan-log';
5
- public static $description = '';
6
-
7
- public $default_arguments = array(
8
- 'count' => 10,
9
- 'page' => 1,
10
- );
11
-
12
- public function run( $arguments ) {
13
- $arguments = Ithemes_Sync_Functions::merge_defaults( $arguments, $this->default_arguments );
14
-
15
- return ITSEC_Log::get_entries( array( 'module' => 'malware' ), $arguments['count'], $arguments['page'], 'timestamp', 'DESC', 'all' );
16
- }
17
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
core/modules/password-requirements/class-itsec-password-requirements.php CHANGED
@@ -346,7 +346,7 @@ class ITSEC_Password_Requirements {
346
  $evaluation = get_user_meta( $user->ID, $requirement['meta'], true );
347
 
348
  if ( '' !== $evaluation ) {
349
- $validated = call_user_func( $requirement['validate'], $evaluation, $user, $settings[ $code ], array(
350
  'target' => User_Groups\Match_Target::for_user( $user ),
351
  ) );
352
 
@@ -360,35 +360,6 @@ class ITSEC_Password_Requirements {
360
  }
361
  }
362
 
363
- /**
364
- * Is a given requirement enabled.
365
- *
366
- * @param string $requirement
367
- *
368
- * @return bool
369
- */
370
- protected function is_requirement_enabled( $requirement ) {
371
-
372
- $requirements = ITSEC_Lib_Password_Requirements::get_registered();
373
-
374
- if ( ! isset( $requirements[ $requirement ] ) ) {
375
- return false;
376
- }
377
-
378
- // If the requirement does not have any settings, than it is always enabled.
379
- if ( null === $requirements[ $requirement ]['settings_config'] ) {
380
- return true;
381
- }
382
-
383
- $enabled = ITSEC_Modules::get_setting( 'password-requirements', 'enabled_requirements' );
384
-
385
- if ( ! empty( $enabled[ $requirement ] ) ) {
386
- return true;
387
- }
388
-
389
- return false;
390
- }
391
-
392
  /**
393
  * When a user's role changes, clear all the evaluation times as evaluat
394
  *
@@ -438,7 +409,7 @@ class ITSEC_Password_Requirements {
438
  <div class="wp-pwd">
439
  <span class="password-input-wrapper">
440
  <input type="password" data-reveal="1"
441
- data-pw="<?php echo esc_attr( wp_generate_password( 16 ) ); ?>" name="pass1" id="pass1"
442
  class="input" size="20" value="" autocomplete="off" aria-describedby="pass-strength-result"/>
443
  </span>
444
  <div id="pass-strength-result" class="hide-if-no-js" aria-live="polite"><?php _e( 'Strength indicator', 'better-wp-security' ); ?></div>
346
  $evaluation = get_user_meta( $user->ID, $requirement['meta'], true );
347
 
348
  if ( '' !== $evaluation ) {
349
+ $validated = call_user_func( $requirement['validate'], $evaluation, $user, $settings, array(
350
  'target' => User_Groups\Match_Target::for_user( $user ),
351
  ) );
352
 
360
  }
361
  }
362
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
363
  /**
364
  * When a user's role changes, clear all the evaluation times as evaluat
365
  *
409
  <div class="wp-pwd">
410
  <span class="password-input-wrapper">
411
  <input type="password" data-reveal="1"
412
+ data-pw="<?php echo esc_attr( wp_generate_password( 32 ) ); ?>" name="pass1" id="pass1"
413
  class="input" size="20" value="" autocomplete="off" aria-describedby="pass-strength-result"/>
414
  </span>
415
  <div id="pass-strength-result" class="hide-if-no-js" aria-live="polite"><?php _e( 'Strength indicator', 'better-wp-security' ); ?></div>
core/modules/security-check/scanner.php CHANGED
@@ -16,7 +16,7 @@ final class ITSEC_Security_Check_Scanner {
16
  'brute-force' => __( 'Local Brute Force Protection', 'better-wp-security' ),
17
  'online-files' => __( 'File Change Detection', 'better-wp-security' ),
18
  'magic-links' => __( 'Magic Links', 'better-wp-security' ),
19
- 'malware-scheduling' => __( 'Malware Scan Scheduling', 'better-wp-security' ),
20
  'network-brute-force' => __( 'Network Brute Force Protection', 'better-wp-security' ),
21
  'passwordless-login' => __( 'Passwordless Login', 'better-wp-security' ),
22
  'strong-passwords' => __( 'Strong Passwords', 'better-wp-security' ),
@@ -76,8 +76,7 @@ final class ITSEC_Security_Check_Scanner {
76
 
77
  self::enforce_activation( 'brute-force', __( 'Local Brute Force Protection', 'better-wp-security' ) );
78
  self::enforce_activation( 'magic-links', __( 'Magic Links', 'better-wp-security' ) );
79
- self::enforce_activation( 'malware-scheduling', __( 'Malware Scan Scheduling', 'better-wp-security' ) );
80
- self::enforce_setting( 'malware-scheduling', 'email_notifications', true, __( 'Enabled the Email Notifications setting in Malware Scan Scheduling.', 'better-wp-security' ) );
81
 
82
  self::add_network_brute_force_signup();
83
 
16
  'brute-force' => __( 'Local Brute Force Protection', 'better-wp-security' ),
17
  'online-files' => __( 'File Change Detection', 'better-wp-security' ),
18
  'magic-links' => __( 'Magic Links', 'better-wp-security' ),
19
+ 'malware-scheduling' => __( 'Site Scan Scheduling', 'better-wp-security' ),
20
  'network-brute-force' => __( 'Network Brute Force Protection', 'better-wp-security' ),
21
  'passwordless-login' => __( 'Passwordless Login', 'better-wp-security' ),
22
  'strong-passwords' => __( 'Strong Passwords', 'better-wp-security' ),
76
 
77
  self::enforce_activation( 'brute-force', __( 'Local Brute Force Protection', 'better-wp-security' ) );
78
  self::enforce_activation( 'magic-links', __( 'Magic Links', 'better-wp-security' ) );
79
+ self::enforce_activation( 'malware-scheduling', __( 'Site Scan Scheduling', 'better-wp-security' ) );
 
80
 
81
  self::add_network_brute_force_signup();
82
 
core/modules/site-scanner/Fixer/Fixer.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace iThemesSecurity\Site_Scanner;
4
+
5
+ interface Fixer {
6
+
7
+ /**
8
+ * Can this issue be fixed.
9
+ *
10
+ * @param Issue $issue
11
+ *
12
+ * @return bool
13
+ */
14
+ public function is_fixable( Issue $issue );
15
+
16
+ /**
17
+ * Does the user have permission to fix the issue.
18
+ *
19
+ * @param \WP_User $user
20
+ * @param Issue $issue
21
+ *
22
+ * @return true|\WP_Error
23
+ */
24
+ public function can_user_fix( \WP_User $user, Issue $issue );
25
+
26
+ /**
27
+ * Fix the issue.
28
+ *
29
+ * @param Issue $issue
30
+ *
31
+ * @return true|\WP_Error
32
+ */
33
+ public function fix( Issue $issue );
34
+
35
+ /**
36
+ * Get a descriptive action label for fixing the issue.
37
+ *
38
+ * For instance "Update Now" instead of just a generic "Fix".
39
+ *
40
+ * @param Issue $issue
41
+ *
42
+ * @return string
43
+ */
44
+ public function get_fix_label( Issue $issue );
45
+ }
core/modules/site-scanner/Fixer/Multi_Fixer.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace iThemesSecurity\Site_Scanner;
4
+
5
+ final class Multi_Fixer implements Fixer {
6
+
7
+ /** @var Fixer[] */
8
+ private $fixers;
9
+
10
+ public function __construct( Fixer ...$fixers ) {
11
+ $this->fixers = $fixers;
12
+ }
13
+
14
+ public function is_fixable( Issue $issue ) {
15
+ foreach ( $this->fixers as $fixer ) {
16
+ if ( $fixer->is_fixable( $issue ) ) {
17
+ return true;
18
+ }
19
+ }
20
+
21
+ return false;
22
+ }
23
+
24
+ public function can_user_fix( \WP_User $user, Issue $issue ) {
25
+ foreach ( $this->fixers as $fixer ) {
26
+ if ( $fixer->is_fixable( $issue ) ) {
27
+ return $fixer->can_user_fix( $user, $issue );
28
+ }
29
+ }
30
+
31
+ return new \WP_Error( 'itsec_site_scanner_fixer_not_fixable', __( 'This issue cannot be automatically fixed.', 'better-wp-security' ) );
32
+ }
33
+
34
+ public function fix( Issue $issue ) {
35
+ foreach ( $this->fixers as $fixer ) {
36
+ if ( $fixer->is_fixable( $issue ) ) {
37
+ return $fixer->fix( $issue );
38
+ }
39
+ }
40
+
41
+ return new \WP_Error( 'itsec_site_scanner_fixer_not_fixable', __( 'This issue cannot be automatically fixed.', 'better-wp-security' ) );
42
+ }
43
+
44
+ public function get_fix_label( Issue $issue ) {
45
+ foreach ( $this->fixers as $fixer ) {
46
+ if ( $fixer->is_fixable( $issue ) ) {
47
+ return $fixer->get_fix_label( $issue );
48
+ }
49
+ }
50
+
51
+ return '';
52
+ }
53
+ }
core/modules/site-scanner/Fixer/Vulnerability_Fixer.php ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace iThemesSecurity\Site_Scanner;
4
+
5
+ final class Vulnerability_Fixer implements Fixer {
6
+
7
+ /** @var \ITSEC_Lib_Upgrader */
8
+ private $upgrader;
9
+
10
+ /**
11
+ * Vulnerability_Fixer constructor.
12
+ *
13
+ * @param \ITSEC_Lib_Upgrader $upgrader
14
+ */
15
+ public function __construct( \ITSEC_Lib_Upgrader $upgrader ) { $this->upgrader = $upgrader; }
16
+
17
+ public function can_user_fix( \WP_User $user, Issue $issue ) {
18
+ if ( ! $issue instanceof Vulnerability ) {
19
+ return new \WP_Error( 'itsec_site_scanner_fixer_not_fixable', __( 'This issue cannot be automatically fixed.', 'better-wp-security' ) );
20
+ }
21
+
22
+ switch ( $issue->get_meta()['type'] ) {
23
+ case 'plugin':
24
+ if ( user_can( $user, 'update_plugins' ) ) {
25
+ return true;
26
+ }
27
+
28
+ return new \WP_Error( 'itsec_site_scanner_fixer_missing_update_permissions', __( 'You must have permission to update plugins to fix this issue.', 'better-wp-security' ) );
29
+ case 'theme':
30
+ if ( user_can( $user, 'update_themes' ) ) {
31
+ return true;
32
+ }
33
+
34
+ return new \WP_Error( 'itsec_site_scanner_fixer_missing_update_permissions', __( 'You must have permission to update themes to fix this issue.', 'better-wp-security' ) );
35
+ default:
36
+ return new \WP_Error( 'itsec_site_scanner_fixer_not_fixable', __( 'This issue cannot be automatically fixed.', 'better-wp-security' ) );
37
+ }
38
+ }
39
+
40
+ public function is_fixable( Issue $issue ) {
41
+ if ( ! $issue instanceof Vulnerability ) {
42
+ return false;
43
+ }
44
+
45
+ if ( ! $fixed_in = $issue->get_fixed_in() ) {
46
+ return false;
47
+ }
48
+
49
+ $meta = $issue->get_meta();
50
+
51
+ switch ( $meta['type'] ) {
52
+ case 'plugin':
53
+ $file = $this->get_plugin_file_for_slug( $meta['software']['slug'] );
54
+
55
+ if ( ! $file ) {
56
+ return false;
57
+ }
58
+
59
+ $update = $this->upgrader->get_available_plugin_update( $file );
60
+
61
+ if ( is_wp_error( $update ) ) {
62
+ return false;
63
+ }
64
+ break;
65
+ case 'theme':
66
+ $update = $this->upgrader->get_available_theme_update( $meta['software']['slug'] );
67
+
68
+ if ( is_wp_error( $update ) ) {
69
+ return false;
70
+ }
71
+
72
+ break;
73
+ case 'wordpress':
74
+ default:
75
+ return false;
76
+ }
77
+
78
+ if ( version_compare( $update['version'], $fixed_in, '<' ) ) {
79
+ return false;
80
+ }
81
+
82
+ return true;
83
+ }
84
+
85
+ public function fix( Issue $issue ) {
86
+ if ( ! $this->is_fixable( $issue ) ) {
87
+ return new \WP_Error( 'itsec_site_scanner_fixer_not_fixable', __( 'This issue cannot be automatically fixed.', 'better-wp-security' ) );
88
+ }
89
+
90
+ $meta = $issue->get_meta();
91
+
92
+ switch ( $meta['type'] ) {
93
+ case 'plugin':
94
+ $file = $this->get_plugin_file_for_slug( $meta['software']['slug'] );
95
+
96
+ return $this->upgrader->update_plugin( $file );
97
+ case 'theme':
98
+ return $this->upgrader->update_theme( $meta['software']['slug'] );
99
+ default:
100
+ return new \WP_Error( 'itsec_site_scanner_fixer_not_fixable', __( 'This issue cannot be automatically fixed.', 'better-wp-security' ) );
101
+ }
102
+ }
103
+
104
+ public function get_fix_label( Issue $issue ) {
105
+ if ( ! $issue instanceof Vulnerability ) {
106
+ return '';
107
+ }
108
+
109
+ $meta = $issue->get_meta();
110
+
111
+ switch ( $meta['type'] ) {
112
+ case 'plugin':
113
+ return __( 'Update Plugin', 'better-wp-security' );
114
+ case 'theme':
115
+ return __( 'Update Theme', 'better-wp-security' );
116
+ default:
117
+ return '';
118
+ }
119
+ }
120
+
121
+ /**
122
+ * Get the plugin file for a directory slug.
123
+ *
124
+ * @param string $slug
125
+ *
126
+ * @return string
127
+ */
128
+ private function get_plugin_file_for_slug( $slug ) {
129
+ if ( ! function_exists( 'get_plugins' ) ) {
130
+ require_once ABSPATH . 'wp-admin/includes/plugin.php';
131
+ }
132
+
133
+ $plugins = get_plugins();
134
+
135
+ foreach ( $plugins as $file => $_ ) {
136
+ if ( 0 === strpos( $file, $slug . '/' ) ) {
137
+ return $file;
138
+ }
139
+ }
140
+
141
+ return '';
142
+ }
143
+ }
{dist/vendors/user-groups → core/modules/site-scanner/Fixer}/index.php RENAMED
File without changes
core/modules/site-scanner/Model/Blacklist.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace iThemesSecurity\Site_Scanner;
4
+
5
+ final class Blacklist implements Issue {
6
+ use Issue_Trait;
7
+
8
+ public function __construct( array $details ) {
9
+ $this->id = $details['vendor']['slug'];
10
+ $this->status = $details['status'] === 'blacklisted' ? Status::WARN : Status::CLEAN;
11
+ $this->link = $details['report_details'];
12
+ $this->entry = 'blacklist';
13
+
14
+ if ( Status::WARN === $this->status ) {
15
+ $this->description = sprintf( esc_html__( 'Domain blocked by %s', 'better-wp-security' ), esc_html( $details['vendor']['label'] ) );
16
+ } else {
17
+ $this->description = sprintf( esc_html__( 'Domain clean by %s', 'better-wp-security' ), esc_html( $details['vendor']['label'] ) );
18
+ }
19
+ }
20
+
21
+ public function get_meta() {
22
+ return [];
23
+ }
24
+ }
core/modules/site-scanner/Model/Entry.php ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace iThemesSecurity\Site_Scanner;
4
+
5
+ final class Entry implements \Countable {
6
+ private $slug;
7
+ private $title;
8
+ private $status;
9
+ private $issues;
10
+
11
+ /**
12
+ * Entry constructor.
13
+ *
14
+ * @param string $slug The slug uniquely identifying the entry.
15
+ * @param string $title The entry title.
16
+ * @param string $status The overall status, {@see Status}, of the entry.
17
+ * @param Issue[] $issues The list of issues part of this entry.
18
+ */
19
+ public function __construct( $slug, $title, $status, array $issues = [] ) {
20
+ $this->slug = $slug;
21
+ $this->title = $title;
22
+ $this->status = $status;
23
+ $this->issues = $issues;
24
+ }
25
+
26
+ /**
27
+ * Gets the entry slug.
28
+ *
29
+ * @return string
30
+ */
31
+ public function get_slug() {
32
+ return $this->slug;
33
+ }
34
+
35
+ /**
36
+ * Gets the entry title.
37
+ *
38
+ * @return string
39
+ */
40
+ public function get_title() {
41
+ return $this->title;
42
+ }
43
+
44
+ /**
45
+ * Gets the entry status.
46
+ *
47
+ * @return string
48
+ */
49
+ public function get_status() {
50
+ return $this->status;
51
+ }
52
+
53
+ /**
54
+ * Gets the entry issues.
55
+ *
56
+ * @return Issue[]
57
+ */
58
+ public function get_issues() {
59
+ return $this->issues;
60
+ }
61
+
62
+ /**
63
+ * Counts the total number of issues found in the entry.
64
+ *
65
+ * @param string $status Only count issues with the given status.
66
+ *
67
+ * @return int
68
+ */
69
+ public function count( $status = '' ) {
70
+ $i = 0;
71
+
72
+ foreach ( $this->get_issues() as $issue ) {
73
+ if ( ! $status || $status === $issue->get_status() ) {
74
+ $i ++;
75
+ }
76
+ }
77
+
78
+ return $i;
79
+ }
80
+ }
core/modules/site-scanner/Model/Factory.php ADDED
@@ -0,0 +1,186 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace iThemesSecurity\Site_Scanner;
4
+
5
+ final class Factory {
6
+ const ENTRIES = [ 'vulnerabilities', 'blacklist', 'malware' ];
7
+
8
+ /**
9
+ * Makes a scan result for a log item.
10
+ *
11
+ * @param int $log_id The log id.
12
+ *
13
+ * @return Scan|\WP_Error
14
+ */
15
+ public function for_log_id( $log_id ) {
16
+ $log_type = \ITSEC_Modules::get_setting( 'global', 'log_type' );
17
+
18
+ if ( 'file' === $log_type ) {
19
+ return new \WP_Error( 'itsec_site_scanner_factory_invalid_log_type', __( 'Logs must be stored in the database to retrieve past scans.', 'better-wp-security' ) );
20
+ }
21
+
22
+ $entry = \ITSEC_Log::get_entry( $log_id );
23
+
24
+ return $this->for_log_item( $entry );
25
+ }
26
+
27
+ /**
28
+ * Makes a scan result for a log item.
29
+ *
30
+ * @param array $log
31
+ *
32
+ * @return Scan|\WP_Error
33
+ */
34
+ public function for_log_item( $log ) {
35
+ $valid = \ITSEC_Site_Scanner_Util::is_log_item_valid_scan( $log );
36
+
37
+ if ( is_wp_error( $valid ) ) {
38
+ return $valid;
39
+ }
40
+
41
+ if ( ! isset( $log['data']['results'] ) ) {
42
+ return new \WP_Error( 'itsec_site_scanner_factory_malformed_log_item', __( 'Log item is malformed.', 'better-wp-security' ) );
43
+ }
44
+
45
+ $id = (int) $log['id'];
46
+ $code = $log['code'];
47
+ $time = new \DateTimeImmutable( $log['init_timestamp'], new \DateTimeZone( 'UTC' ) );
48
+
49
+ $results = $log['data']['results'];
50
+
51
+ if ( is_wp_error( $results ) ) {
52
+ return Scan::as_error( $id, $code, '', $time, $results );
53
+ }
54
+
55
+ $url = isset( $results['url'] ) ? $results['url'] : '';
56
+ $entries = ! empty( $results['entries'] ) ? $this->make_entries( $results['entries'] ) : [];
57
+ $errors = ! empty( $results['errors'] ) ? $results['errors'] : [];
58
+
59
+ return new Scan( $id, $code, $url, $time, $entries, $errors );
60
+ }
61
+
62
+ /**
63
+ * Makes a Scan object from the API response.
64
+ *
65
+ * @param array|\WP_Error $response
66
+ *
67
+ * @return Scan
68
+ */
69
+ public function for_api_response( $response ) {
70
+ $id = 0;
71
+ $code = \ITSEC_Site_Scanner_Util::get_scan_result_code( $response );
72
+ $time = new \DateTimeImmutable( 'now', new \DateTimeZone( 'UTC' ) );
73
+
74
+ if ( is_wp_error( $response ) ) {
75
+ $url = isset( $response->get_error_data()['url'] ) ? $response->get_error_data()['url'] : '';
76
+
77
+ return Scan::as_error( $id, $code, $url, $time, $response );
78
+ }
79
+
80
+ $url = isset( $response['url'] ) ? $response['url'] : '';
81
+ $entries = ! empty( $response['entries'] ) ? $this->make_entries( $response['entries'] ) : [];
82
+ $errors = ! empty( $response['errors'] ) ? $response['errors'] : [];
83
+
84
+ return new Scan( $id, $code, $url, $time, $entries, $errors );
85
+ }
86
+
87
+ /**
88
+ * Make a list of entries from the scan data.
89
+ *
90
+ * @param array $data
91
+ *
92
+ * @return Entry[]
93
+ */
94
+ protected function make_entries( array $data ) {
95
+ $entries = [];
96
+
97
+ foreach ( self::ENTRIES as $slug ) {
98
+ if ( ! isset( $data[ $slug ] ) ) {
99
+ continue;
100
+ }
101
+
102
+ $entry = $this->{"make_{$slug}"}( $data[ $slug ] );
103
+
104
+ if ( $entry instanceof Entry ) {
105
+ $entries[] = $entry;
106
+ }
107
+ }
108
+
109
+ return $entries;
110
+ }
111
+
112
+ /**
113
+ * Make a vulnerability entry from the scan data.
114
+ *
115
+ * @param array $data
116
+ *
117
+ * @return Entry
118
+ */
119
+ protected function make_vulnerabilities( $data ) {
120
+ if ( ! $data || ! is_array( $data ) ) {
121
+ return new Entry( 'vulnerabilities', __( 'Known Vulnerabilities', 'better-wp-security' ), Status::CLEAN );
122
+ }
123
+
124
+ $issues = [];
125
+
126
+ foreach ( $data as $vulnerability ) {
127
+ $link = \ITSEC_Site_Scanner_Util::authenticate_vulnerability_link( $vulnerability['link'] );
128
+
129
+ foreach ( $vulnerability['issues'] as $issue ) {
130
+ if ( empty( $issue['id'] ) ) {
131
+ continue;
132
+ }
133
+
134
+ $issues[] = new Vulnerability( $vulnerability, $issue['id'], $link );
135
+ }
136
+ }
137
+
138
+ return new Entry( 'vulnerabilities', __( 'Known Vulnerabilities', 'better-wp-security' ), Status::WARN, $issues );
139
+ }
140
+
141
+ /**
142
+ * Make a blacklist entry from the scan data.
143
+ *
144
+ * @param array $data
145
+ *
146
+ * @return Entry
147
+ */
148
+ protected function make_blacklist( $data ) {
149
+ $issues = [];
150
+ $status = Status::CLEAN;
151
+
152
+ if ( $data && is_array( $data ) ) {
153
+ foreach ( $data as $details ) {
154
+ $issue = new Blacklist( $details );
155
+ $issues[] = $issue;
156
+
157
+ if ( $issue->get_status() === Status::WARN ) {
158
+ $status = $issue->get_status();
159
+ }
160
+ }
161
+ }
162
+
163
+ return new Entry( 'blacklist', __( 'Blocklist', 'better-wp-security' ), $status, $issues );
164
+ }
165
+
166
+ /**
167
+ * Makes a malware entry from the scan data.
168
+ *
169
+ * @param array $data
170
+ *
171
+ * @return Entry
172
+ */
173
+ protected function make_malware( $data ) {
174
+ if ( ! $data || ! is_array( $data ) ) {
175
+ return new Entry( 'malware', __( 'Malware', 'better-wp-security' ), Status::CLEAN );
176
+ }
177
+
178
+ $issues = [];
179
+
180
+ foreach ( $data as $malware ) {
181
+ $issues[] = new Malware( $malware );
182
+ }
183
+
184
+ return new Entry( 'malware', __( 'Malware', 'better-wp-security' ), Status::WARN );
185
+ }
186
+ }
core/modules/site-scanner/Model/Issue.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace iThemesSecurity\Site_Scanner;
4
+
5
+ interface Issue {
6
+
7
+ /**
8
+ * Get the unique issue id.
9
+ *
10
+ * @return string
11
+ */
12
+ public function get_id();
13
+
14
+ /**
15
+ * Get's the status for this issue.
16
+ *
17
+ * @return string One of the {@see Status} enums.
18
+ */
19
+ public function get_status();
20
+
21
+ /**
22
+ * Gets the short, 1 sentence, description of the issue.
23
+ *
24
+ * @return string
25
+ */
26
+ public function get_description();
27
+
28
+ /**
29
+ * Gets a link to see more about the issue.
30
+ *
31
+ * @return string
32
+ */
33
+ public function get_link();
34
+
35
+ /**
36
+ * Gets the entry this issue belongs to.
37
+ *
38
+ * @return string
39
+ */
40
+ public function get_entry();
41
+
42
+ /**
43
+ * Get meta information about the issue.
44
+ *
45
+ * This is untyped beyond returning an array.
46
+ *
47
+ * @return array
48
+ */
49
+ public function get_meta();
50
+ }
core/modules/site-scanner/Model/Issue_Trait.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace iThemesSecurity\Site_Scanner;
4
+
5
+ trait Issue_Trait {
6
+
7
+ /** @var string */
8
+ private $id;
9
+
10
+ /** @var string */
11
+ private $status;
12
+
13
+ /** @var string */
14
+ private $description;
15
+
16
+ /** @var string */
17
+ private $link;
18
+
19
+ /** @var string */
20
+ private $entry;
21
+
22
+ public function get_id() {
23
+ return $this->id;
24
+ }
25
+
26
+ public function get_status() {
27
+ return $this->status;
28
+ }
29
+
30
+ public function get_description() {
31
+ return $this->description;
32
+ }
33
+
34
+ public function get_link() {
35
+ return $this->link;
36
+ }
37
+
38
+ public function get_entry() {
39
+ return $this->entry;
40
+ }
41
+ }
core/modules/site-scanner/Model/Malware.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace iThemesSecurity\Site_Scanner;
4
+
5
+ class Malware implements Issue {
6
+ use Issue_Trait;
7
+
8
+ /** @var array */
9
+ private $malware;
10
+
11
+ public function __construct( array $malware ) {
12
+ $this->id = $malware['id'];
13
+ $this->status = Status::WARN;
14
+ $this->description = $malware['message'];
15
+ $this->link = $malware['link'];
16
+ $this->entry = 'malware';
17
+ $this->malware = $malware;
18
+ }
19
+
20
+ public function get_meta() {
21
+ return array_diff_key( $this->malware, [ 'id' => '', 'message' => '', 'link' => '' ] );
22
+ }
23
+ }
core/modules/site-scanner/Model/Scan.php ADDED
@@ -0,0 +1,209 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace iThemesSecurity\Site_Scanner;
4
+
5
+ final class Scan implements \Countable {
6
+ /** @var int */
7
+ private $id;
8
+
9
+ /** @var string */
10
+ private $code;
11
+
12
+ /** @var string */
13
+ private $url;
14
+
15
+ /** @var \DateTimeImmutable */
16
+ private $time;
17
+
18
+ /** @var Entry[] */
19
+ private $entries;
20
+
21
+ /** @var \WP_Error */
22
+ private $error;
23
+
24
+ /** @var array[] */
25
+ private $errors;
26
+
27
+ /**
28
+ * Scan constructor.
29
+ *
30
+ * @param int $id
31
+ * @param string $code
32
+ * @param string $url
33
+ * @param \DateTimeImmutable $time
34
+ * @param Entry[] $entries
35
+ * @param array[] $errors
36
+ */
37
+ public function __construct( $id, $code, $url, \DateTimeImmutable $time, array $entries, array $errors ) {
38
+ $this->id = $id;
39
+ $this->code = $code;
40
+ $this->url = $url;
41
+ $this->time = $time;
42
+ $this->entries = $entries;
43
+ $this->errors = $errors;
44
+ }
45
+
46
+ /**
47
+ * Creates an error scan.
48
+ *
49
+ * @param int $id
50
+ * @param string $code
51
+ * @param string $url
52
+ * @param \DateTimeImmutable $time
53
+ * @param \WP_Error $error
54
+ *
55
+ * @return static
56
+ */
57
+ public static function as_error( $id, $code, $url, \DateTimeImmutable $time, \WP_Error $error ) {
58
+ $scan = new static( $id, $code, $url, $time, [], [] );
59
+ $scan->error = $error;
60
+
61
+ return $scan;
62
+ }
63
+
64
+ /**
65
+ * The id identifying this scan.
66
+ *
67
+ * @return int
68
+ */
69
+ public function get_id() {
70
+ return $this->id;
71
+ }
72
+
73
+ /**
74
+ * Get the scan result code.
75
+ *
76
+ * @return string
77
+ */
78
+ public function get_code() {
79
+ return $this->code;
80
+ }
81
+
82
+ /**
83
+ * Get the URL that was scanned.
84
+ *
85
+ * @return string
86
+ */
87
+ public function get_url() {
88
+ return $this->url;
89
+ }
90
+
91
+ /**
92
+ * Get the time a scan occurred.
93
+ *
94
+ * @return \DateTimeImmutable
95
+ */
96
+ public function get_time() {
97
+ return $this->time;
98
+ }
99
+
100
+ /**
101
+ * Get the overall status of the scan.
102
+ *
103
+ * @return string
104
+ */
105
+ public function get_status() {
106
+ if ( $this->is_error() ) {
107
+ return Status::ERROR;
108
+ }
109
+
110
+ if ( $this->count( Status::WARN ) ) {
111
+ return Status::WARN;
112
+ }
113
+
114
+ if ( $this->count( Status::CLEAN ) ) {
115
+ return Status::CLEAN;
116
+ }
117
+
118
+ return Status::ERROR;
119
+ }
120
+
121
+ /**
122
+ * Gets the entries accompanying this scan.
123
+ *
124
+ * @return Entry[]
125
+ */
126
+ public function get_entries() {
127
+ return $this->entries;
128
+ }
129
+
130
+ /**
131
+ * Finds an entry with the given slug.
132
+ *
133
+ * @param string $slug
134
+ *
135
+ * @return Entry|null
136
+ */
137
+ public function find_entry( $slug ) {
138
+ foreach ( $this->get_entries() as $entry ) {
139
+ if ( $entry->get_slug() === $slug ) {
140
+ return $entry;
141
+ }
142
+ }
143
+
144
+ return null;
145
+ }
146
+
147
+ /**
148
+ * Gets the list of errors encountered during the scan.
149
+ *
150
+ * @return array[]
151
+ */
152
+ public function get_errors() {
153
+ return $this->errors;
154
+ }
155
+
156
+ /**
157
+ * Was this scan an error.
158
+ *
159
+ * @return bool
160
+ */
161
+ public function is_error() {
162
+ return (bool) $this->error;
163
+ }
164
+
165
+ /**
166
+ * Get the error that occurred.
167
+ *
168
+ * @return \WP_Error|null
169
+ */
170
+ public function get_error() {
171
+ return $this->error;
172
+ }
173
+
174
+ /**
175
+ * Finds an issue by its id.
176
+ *
177
+ * @param string $issue_id
178
+ *
179
+ * @return Issue|null
180
+ */
181
+ public function find_issue( $issue_id ) {
182
+ foreach ( $this->get_entries() as $entry ) {
183
+ foreach ( $entry->get_issues() as $issue ) {
184
+ if ( $issue->get_id() === $issue_id ) {
185
+ return $issue;
186
+ }
187
+ }
188
+ }
189
+
190
+ return null;
191
+ }
192
+
193
+ /**
194
+ * Counts the total number of issues found in the scan.
195
+ *
196
+ * @param string $status Only count issues with the given status.
197
+ *
198
+ * @return int
199
+ */
200
+ public function count( $status = '' ) {
201
+ $i = 0;
202
+
203
+ foreach ( $this->get_entries() as $entry ) {
204
+ $i += $entry->count( $status );
205
+ }
206
+
207
+ return $i;
208
+ }
209
+ }
core/modules/site-scanner/Model/Status.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace iThemesSecurity\Site_Scanner;
4
+
5
+ interface Status {
6
+ const CLEAN = 'clean';
7
+ const WARN = 'warn';
8
+ const ERROR = 'error';
9
+
10
+ const ALL = [ self::CLEAN, self::WARN, self::ERROR ];
11
+ }
core/modules/site-scanner/Model/Vulnerability.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace iThemesSecurity\Site_Scanner;
4
+
5
+ final class Vulnerability implements Issue {
6
+ use Issue_Trait;
7
+
8
+ /** @var array */
9
+ private $vulnerability;
10
+
11
+ /** @var array */
12
+ private $issue;
13
+
14
+ /**
15
+ * Vulnerability constructor.
16
+ *
17
+ * @param array $vulnerability The full vulnerability details for the software item.
18
+ * @param string $issue_id The id of this particular issue.
19
+ * @param string $details_link The link to more details about the issue.
20
+ */
21
+ public function __construct( array $vulnerability, $issue_id, $details_link ) {
22
+ $match = wp_list_filter( $vulnerability['issues'], [ 'id' => $issue_id ] );
23
+ $issue = reset( $match );
24
+
25
+ $this->id = $issue_id;
26
+ $this->description = $issue['title'];
27
+ $this->status = Status::WARN;
28
+ $this->link = $details_link;
29
+ $this->issue = $issue;
30
+ $this->vulnerability = $vulnerability;
31
+ $this->entry = 'vulnerabilities';
32
+ }
33
+
34
+ public function get_meta() {
35
+ $meta = [
36
+ 'issue' => $this->issue,
37
+ 'type' => $this->vulnerability['type'],
38
+ ];
39
+
40
+ if ( isset( $this->vulnerability['software'] ) ) {
41
+ $meta['software'] = $this->vulnerability['software'];
42
+ }
43
+
44
+ return $meta;
45
+ }
46
+
47
+ /**
48
+ * Get the version the vulnerability was fixed in.
49
+ *
50
+ * @return string|null
51
+ */
52
+ public function get_fixed_in() {
53
+ return $this->issue['fixed_in'];
54
+ }
55
+ }
core/modules/site-scanner/Model/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden.
core/modules/site-scanner/REST/Issues.php ADDED
@@ -0,0 +1,369 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace iThemesSecurity\Site_Scanner\REST;
4
+
5
+ use iThemesSecurity\Site_Scanner\Factory;
6
+ use iThemesSecurity\Site_Scanner\Fixer;
7
+ use iThemesSecurity\Site_Scanner\Issue;
8
+ use iThemesSecurity\Site_Scanner\Repository\Repository;
9
+ use iThemesSecurity\Site_Scanner\Scan;
10
+ use iThemesSecurity\Site_Scanner\Status;
11
+
12
+ class Issues extends \WP_REST_Controller {
13
+
14
+ /** @var Repository */
15
+ private $repository;
16
+
17
+ /** @var Fixer */
18
+ private $fixer;
19
+
20
+ /** @var string */
21
+ private $parent_base;
22
+
23
+ /**
24
+ * Issues constructor.
25
+ *
26
+ * @param Repository $repository
27
+ * @param Fixer $fixer
28
+ */
29
+ public function __construct( Repository $repository, Fixer $fixer ) {
30
+ $this->repository = $repository;
31
+ $this->fixer = $fixer;
32
+ $this->namespace = 'ithemes-security/v1';
33
+ $this->parent_base = 'site-scanner/scans';
34
+ $this->rest_base = 'issues';
35
+ }
36
+
37
+ public function register_routes() {
38
+ register_rest_route( $this->namespace, $this->parent_base . '/(?P<scan_id>\d+)/' . $this->rest_base, [
39
+ [
40
+ 'methods' => \WP_REST_Server::READABLE,
41
+ 'callback' => [ $this, 'get_items' ],
42
+ 'permission_callback' => [ $this, 'get_items_permissions_check' ],
43
+ 'args' => array_merge( $this->get_collection_params(), [
44
+ 'scan_id' => [
45
+ 'type' => 'integer',
46
+ ],
47
+ ] ),
48
+ ],
49
+ 'schema' => [ $this, 'get_public_item_schema' ],
50
+ ] );
51
+
52
+ register_rest_route( $this->namespace, $this->parent_base . '/(?P<scan_id>\d+)/' . $this->rest_base . '/(?P<issue_id>[\w_-]+)', [
53
+ [
54
+ 'methods' => \WP_REST_Server::READABLE,
55
+ 'callback' => [ $this, 'get_item' ],
56
+ 'permission_callback' => [ $this, 'get_item_permissions_check' ],
57
+ 'args' => [
58
+ 'scan_id' => [
59
+ 'type' => 'integer',
60
+ ],
61
+ 'issue_id' => [
62
+ 'type' => 'string',
63
+ ],
64
+ 'context' => $this->get_context_param( [ 'default' => 'view' ] ),
65
+ ],
66
+ ],
67
+ 'schema' => [ $this, 'get_public_item_schema' ],
68
+ ] );
69
+
70
+ register_rest_route( $this->namespace, $this->parent_base . '/(?P<scan_id>\d+)/' . $this->rest_base . '/(?P<issue_id>[\w_-]+)/fix', [
71
+ 'methods' => 'POST',
72
+ 'callback' => [ $this, 'fix_issue' ],
73
+ 'permission_callback' => [ $this, 'fix_issue_permissions_check' ],
74
+ 'args' => [
75
+ 'scan_id' => [
76
+ 'type' => 'integer',
77
+ ],
78
+ 'issue_id' => [
79
+ 'type' => 'string',
80
+ ],
81
+ ],
82
+ ] );
83
+ }
84
+
85
+ public function get_items_permissions_check( $request ) {
86
+ $valid = $this->has_permission( $request );
87
+
88
+ if ( is_wp_error( $valid ) ) {
89
+ return $valid;
90
+ }
91
+
92
+ if ( ! $valid instanceof \WP_User || ! user_can( $valid, \ITSEC_Core::get_required_cap() ) ) {
93
+ return new \WP_Error( 'rest_cannot_view', __( 'Sorry, you cannot view site scan issues.', 'better-wp-security' ), [ 'status' => \ITSEC_Lib_REST::auth_code_required( $valid ) ] );
94
+ }
95
+
96
+ return true;
97
+ }
98
+
99
+ public function get_items( $request ) {
100
+ $scan = $this->repository->get_scan( $request['scan_id'] );
101
+
102
+ if ( is_wp_error( $scan ) ) {
103
+ $scan->add_data( [ 'status' => \WP_Http::NOT_FOUND ] );
104
+
105
+ return $scan;
106
+ }
107
+
108
+ $issues = [];
109
+
110
+ foreach ( $scan->get_entries() as $entry ) {
111
+ foreach ( $entry->get_issues() as $issue ) {
112
+ $issues[] = $this->prepare_response_for_collection( $this->prepare_item_for_response( $issue, $request, $scan ) );
113
+ }
114
+ }
115
+
116
+ return rest_ensure_response( $issues );
117
+ }
118
+
119
+ public function get_item_permissions_check( $request ) {
120
+ $valid = $this->has_permission( $request );
121
+
122
+ if ( is_wp_error( $valid ) ) {
123
+ return $valid;
124
+ }
125
+
126
+ if ( ! $valid instanceof \WP_User || ! user_can( $valid, \ITSEC_Core::get_required_cap() ) ) {
127
+ return new \WP_Error( 'rest_cannot_view', __( 'Sorry, you cannot view site scan issues.', 'better-wp-security' ), [ 'status' => \ITSEC_Lib_REST::auth_code_required( $valid ) ] );
128
+ }
129
+
130
+ return true;
131
+ }
132
+
133
+ public function get_item( $request ) {
134
+ $issue = $this->find_issue( $request );
135
+
136
+ if ( is_wp_error( $issue ) ) {
137
+ return $issue;
138
+ }
139
+
140
+ list( $scan, $issue ) = $issue;
141
+
142
+ return $this->prepare_item_for_response( $issue, $request, $scan );
143
+ }
144
+
145
+ /**
146
+ * Check if the user has permission to fix the issue.
147
+ *
148
+ * @param \WP_REST_Request $request
149
+ *
150
+ * @return \WP_User|\WP_Error
151
+ */
152
+ public function fix_issue_permissions_check( \WP_REST_Request $request ) {
153
+ $valid = $this->has_permission( $request );
154
+
155
+ if ( is_wp_error( $valid ) ) {
156
+ return $valid;
157
+ }
158
+
159
+ if ( ! $valid instanceof \WP_User || ! user_can( $valid, \ITSEC_Core::get_required_cap() ) ) {
160
+ return new \WP_Error( 'rest_cannot_fix', __( 'Sorry, you cannot fix site scan issues.', 'better-wp-security' ), [ 'status' => \ITSEC_Lib_REST::auth_code_required( $valid ) ] );
161
+ }
162
+
163
+ $issue = $this->find_issue( $request );
164
+
165
+ if ( is_wp_error( $issue ) ) {
166
+ return $issue;
167
+ }
168
+
169
+ list( , $issue ) = $issue;
170
+
171
+ if ( ! $this->fixer->is_fixable( $issue ) ) {
172
+ return new \WP_Error( 'itsec_site_scanner_fixer_not_fixable', __( 'This issue cannot be automatically fixed.', 'better-wp-security' ), array( 'status' => 404 ) );
173
+ }
174
+
175
+ $can_fix = $this->fixer->can_user_fix( $valid, $issue );
176
+
177
+ if ( is_wp_error( $can_fix ) ) {
178
+ $can_fix->add_data( [ 'status' => 403 ] );
179
+ }
180
+
181
+ return $can_fix;
182
+ }
183
+
184
+ /**
185
+ * Fixes the issue.
186
+ *
187
+ * @param \WP_REST_Request $request
188
+ *
189
+ * @return \WP_REST_Response|\WP_Error
190
+ */
191
+ public function fix_issue( \WP_REST_Request $request ) {
192
+ $issue = $this->find_issue( $request );
193
+
194
+ if ( is_wp_error( $issue ) ) {
195
+ return $issue;
196
+ }
197
+
198
+ list( , $issue ) = $issue;
199
+
200
+ $fixed = $this->fixer->fix( $issue );
201
+
202
+ if ( is_wp_error( $fixed ) ) {
203
+ return $fixed;
204
+ }
205
+
206
+ return new \WP_REST_Response( null, 204 );
207
+ }
208
+
209
+ /**
210
+ * Find the requested Issue object.
211
+ *
212
+ * @param \WP_REST_Request $request
213
+ *
214
+ * @return array|\WP_Error The issue object if found, or a WP_Error instance.
215
+ */
216
+ protected function find_issue( \WP_REST_Request $request ) {
217
+ $scan = $this->repository->get_scan( $request['scan_id'] );
218
+
219
+ if ( is_wp_error( $scan ) ) {
220
+ $scan->add_data( [ 'status' => \WP_Http::NOT_FOUND ] );
221
+
222
+ return $scan;
223
+ }
224
+
225
+ $issue = $scan->find_issue( $request['issue_id'] );
226
+
227
+ if ( ! $issue ) {
228
+ return new \WP_Error( 'itsec_site_scanner_scan_issue_not_found', __( 'No issue was found with that id.', 'better-wp-security' ), [ 'status' => \WP_Http::NOT_FOUND ] );
229
+ }
230
+
231
+ return [ $scan, $issue ];
232
+ }
233
+
234
+ /**
235
+ * Prepares the issue for response.
236
+ *
237
+ * @param Issue $item
238
+ * @param \WP_REST_Request $request
239
+ * @param Scan $scan
240
+ *
241
+ * @return \WP_Error|\WP_REST_Response
242
+ */
243
+ public function prepare_item_for_response( $item, $request, Scan $scan = null ) {
244
+ if ( ! $scan ) {
245
+ return rest_ensure_response( null );
246
+ }
247
+
248
+ $data = [
249
+ 'id' => $item->get_id(),
250
+ 'link' => $item->get_link(),
251
+ 'description' => $item->get_description(),
252
+ 'status' => $item->get_status(),
253
+ 'entry' => $item->get_entry(),
254
+ 'meta' => $item->get_meta(),
255
+ ];
256
+ $data = $this->filter_response_by_context( $data, $request['context'] );
257
+
258
+ $response = new \WP_REST_Response( $data );
259
+ $response->add_links( $this->prepare_links( $scan, $item ) );
260
+
261
+ return $response;
262
+ }
263
+
264
+ /**
265
+ * Prepares the list of links for an issue.
266
+ *
267
+ * @param Scan $scan
268
+ * @param Issue $issue
269
+ *
270
+ * @return array
271
+ */
272
+ protected function prepare_links( Scan $scan, Issue $issue ) {
273
+ $base = sprintf( '%s/%s/%d/%s/%s', $this->namespace, $this->parent_base, $scan->get_id(), $this->rest_base, $issue->get_id() );
274
+
275
+ $links = [
276
+ 'self' => [
277
+ 'href' => rest_url( $base ),
278
+ ],
279
+ 'collection' => [
280
+ 'href' => rest_url( sprintf( '%s/%s/%d/%s', $this->namespace, $this->parent_base, $scan->get_id(), $this->rest_base ) ),
281
+ ],
282
+ 'up' => [
283
+ 'href' => rest_url( sprintf( '%s/%s/%d', $this->namespace, $this->parent_base, $scan->get_id() ) ),
284
+ ],
285
+ ];
286
+
287
+ if ( $this->fixer->is_fixable( $issue ) && $this->fixer->can_user_fix( wp_get_current_user(), $issue ) ) {
288
+ $links[ \ITSEC_Lib_REST::get_link_relation( 'site-scan-fix-issue' ) ] = [
289
+ 'href' => rest_url( $base . '/fix' ),
290
+ 'title' => $this->fixer->get_fix_label( $issue ),
291
+ ];
292
+ }
293
+
294
+ return $links;
295
+ }
296
+
297
+ /**
298
+ * Checks if the current request has permission to interact with scans.
299
+ *
300
+ * @param \WP_REST_Request $request
301
+ *
302
+ * @return \WP_User|\WP_Error|false
303
+ */
304
+ protected function has_permission( \WP_REST_Request $request ) {
305
+ if ( is_user_logged_in() ) {
306
+ return wp_get_current_user();
307
+ }
308
+
309
+ if ( $token = \ITSEC_Lib_REST::get_token_from_auth_header( $request->get_header( 'Authorization' ) ) ) {
310
+ $valid = \ITSEC_Site_Scanner_Util::validate_scan_auth_token( $token );
311
+
312
+ if ( is_wp_error( $valid ) ) {
313
+ $valid->add_data( [ 'status' => 401 ] );
314
+ }
315
+
316
+ return $valid;
317
+ }
318
+
319
+ return false;
320
+ }
321
+
322
+ public function get_item_schema() {
323
+ if ( ! $this->schema ) {
324
+ $this->schema = [
325
+ '$schema' => 'http://json-schema.org/draft-04/schema#',
326
+ 'type' => 'object',
327
+ 'properties' => [
328
+ 'id' => [
329
+ 'type' => 'string',
330
+ 'context' => [ 'view', 'embed' ],
331
+ ],
332
+ 'link' => [
333
+ 'type' => 'string',
334
+ 'format' => 'uri',
335
+ 'context' => [ 'view', 'embed' ],
336
+ ],
337
+ 'description' => [
338
+ 'type' => 'string',
339
+ 'context' => [ 'view', 'embed' ],
340
+ ],
341
+ 'status' => [
342
+ 'type' => 'string',
343
+ 'enum' => Status::ALL,
344
+ 'context' => [ 'view', 'embed' ],
345
+ ],
346
+ 'entry' => [
347
+ 'type' => 'string',
348
+ 'context' => [ 'view', 'embed' ],
349
+ 'enum' => Factory::ENTRIES,
350
+ ],
351
+ 'meta' => [
352
+ 'type' => 'object',
353
+ 'properties' => [],
354
+ 'additionalProperties' => true,
355
+ 'context' => [ 'view' ],
356
+ ],
357
+ ],
358
+ ];
359
+ }
360
+
361
+ return $this->schema;
362
+ }
363
+
364
+ public function get_collection_params() {
365
+ return [
366
+ 'context' => $this->get_context_param( [ 'default' => 'view' ] ),
367
+ ];
368
+ }
369
+ }
core/modules/site-scanner/REST/Muted_Issues.php ADDED
@@ -0,0 +1,225 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace iThemesSecurity\Site_Scanner\REST;
4
+
5
+ use iThemesSecurity\Exception\WP_Error;
6
+
7
+ class Muted_Issues extends \WP_REST_Controller {
8
+
9
+ protected $schema;
10
+
11
+ public function __construct() {
12
+ $this->namespace = 'ithemes-security/v1';
13
+ $this->rest_base = 'site-scanner/muted-issues';
14
+ }
15
+
16
+ public function register_routes() {
17
+ register_rest_route( $this->namespace, $this->rest_base, [
18
+ [
19
+ 'methods' => \WP_REST_Server::READABLE,
20
+ 'callback' => [ $this, 'get_items' ],
21
+ 'permission_callback' => [ $this, 'get_items_permissions_check' ],
22
+ 'args' => [],
23
+ ],
24
+ [
25
+ 'methods' => \WP_REST_Server::CREATABLE,
26
+ 'callback' => [ $this, 'create_item' ],
27
+ 'permission_callback' => [ $this, 'create_item_permissions_check' ],
28
+ 'args' => $this->get_endpoint_args_for_item_schema(),
29
+ ],
30
+ 'schema' => [ $this, 'get_public_item_schema' ],
31
+ ] );
32
+ register_rest_route( $this->namespace, $this->rest_base . '/(?P<id>[\w-]+)', [
33
+ [
34
+ 'methods' => \WP_REST_Server::READABLE,
35
+ 'callback' => [ $this, 'get_item' ],
36
+ 'permission_callback' => [ $this, 'get_item_permissions_check' ],
37
+ ],
38
+ [
39
+ 'methods' => \WP_REST_Server::DELETABLE,
40
+ 'callback' => [ $this, 'delete_item' ],
41
+ 'permission_callback' => [ $this, 'delete_item_permissions_check' ],
42
+ ],
43
+ 'args' => [],
44
+ 'schema' => [ $this, 'get_public_item_schema' ],
45
+ ] );
46
+ }
47
+
48
+ public function get_items_permissions_check( $request ) {
49
+ $valid = $this->has_permission( $request );
50
+
51
+ if ( is_wp_error( $valid ) ) {
52
+ return $valid;
53
+ }
54
+
55
+ if ( ! $valid instanceof \WP_User || ! user_can( $valid, \ITSEC_Core::get_required_cap() ) ) {
56
+ return new \WP_Error( 'rest_cannot_view', __( 'Sorry, you cannot view muted issues.', 'better-wp-security' ), [ 'status' => \ITSEC_Lib_REST::auth_code_required( $valid ) ] );
57
+ }
58
+
59
+ return true;
60
+ }
61
+
62
+ public function get_items( $request ) {
63
+ $issues = \ITSEC_Site_Scanner_Util::get_muted_issues();
64
+ $data = [];
65
+
66
+ foreach ( $issues as $issue ) {
67
+ $data[] = $this->prepare_response_for_collection( $this->prepare_item_for_response( $issue, $request ) );
68
+ }
69
+
70
+ return new \WP_REST_Response( $data );
71
+ }
72
+
73
+ public function get_item_permissions_check( $request ) {
74
+ $valid = $this->has_permission( $request );
75
+
76
+ if ( is_wp_error( $valid ) ) {
77
+ return $valid;
78
+ }
79
+
80
+ if ( ! $valid instanceof \WP_User || ! user_can( $valid, \ITSEC_Core::get_required_cap() ) ) {
81
+ return new \WP_Error( 'rest_cannot_view', __( 'Sorry, you cannot view muted issues.', 'better-wp-security' ), [ 'status' => \ITSEC_Lib_REST::auth_code_required( $valid ) ] );
82
+ }
83
+
84
+ return true;
85
+ }
86
+
87
+ public function get_item( $request ) {
88
+ if ( ! \ITSEC_Site_Scanner_Util::is_issue_muted( $request['id'] ) ) {
89
+ return new \WP_Error( 'rest_not_found', __( 'This issue has not been muted.', 'better-wp-security' ), array( 'status' => \WP_Http::NOT_FOUND ) );
90
+ }
91
+
92
+ $issue = \ITSEC_Site_Scanner_Util::get_muted_issue( $request['id'] );
93
+
94
+ return $this->prepare_item_for_response( $issue, $request );
95
+ }
96
+
97
+ public function create_item_permissions_check( $request ) {
98
+ $valid = $this->has_permission( $request );
99
+
100
+ if ( is_wp_error( $valid ) ) {
101
+ return $valid;
102
+ }
103
+
104
+ if ( ! $valid instanceof \WP_User || ! user_can( $valid, \ITSEC_Core::get_required_cap() ) ) {
105
+ return new \WP_Error( 'rest_cannot_create', __( 'Sorry, you cannot mute issues.', 'better-wp-security' ), [ 'status' => \ITSEC_Lib_REST::auth_code_required( $valid ) ] );
106
+ }
107
+
108
+ return true;
109
+ }
110
+
111
+ public function create_item( $request ) {
112
+ if ( \ITSEC_Site_Scanner_Util::is_issue_muted( $request['id'] ) ) {
113
+ return new \WP_Error( 'rest_issue_already_muted', __( 'This issue has already been muted.', 'better-wp-security' ), array( 'status' => \WP_Http::BAD_REQUEST ) );
114
+ }
115
+
116
+ $args = [];
117
+
118
+ if ( ( $user = $this->has_permission( $request ) ) && $user instanceof \WP_User ) {
119
+ $args['muted_by'] = $user->ID;
120
+ }
121
+
122
+ $muted = \ITSEC_Site_Scanner_Util::mute_issue( $request['id'], $args );
123
+
124
+ if ( is_wp_error( $muted ) ) {
125
+ return $muted;
126
+ }
127
+
128
+ $response = $this->prepare_item_for_response( $muted, $request );
129
+ $response->set_status( 201 );
130
+ $response->header( 'Location', rest_url( $this->namespace . '/' . $this->rest_base . $request['id'] ) );
131
+
132
+ return $response;
133
+ }
134
+
135
+ public function delete_item_permissions_check( $request ) {
136
+ $valid = $this->has_permission( $request );
137
+
138
+ if ( is_wp_error( $valid ) ) {
139
+ return $valid;
140
+ }
141
+
142
+ if ( ! $valid instanceof \WP_User || ! user_can( $valid, \ITSEC_Core::get_required_cap() ) ) {
143
+ return new \WP_Error( 'rest_cannot_delete', __( 'Sorry, you cannot unmute issues.', 'better-wp-security' ), [ 'status' => \ITSEC_Lib_REST::auth_code_required( $valid ) ] );
144
+ }
145
+
146
+ return true;
147
+ }
148
+
149
+ public function delete_item( $request ) {
150
+ if ( ! \ITSEC_Site_Scanner_Util::is_issue_muted( $request['id'] ) ) {
151
+ return new \WP_Error( 'rest_not_found', __( 'This issue is not muted.', 'better-wp-security' ), array( 'status' => \WP_Http::NOT_FOUND ) );
152
+ }
153
+
154
+ $deleted = \ITSEC_Site_Scanner_Util::unmute_issue( $request['id'] );
155
+
156
+ if ( is_wp_error( $deleted ) ) {
157
+ return $deleted;
158
+ }
159
+
160
+ return new \WP_REST_Response( null, \WP_Http::NO_CONTENT );
161
+ }
162
+
163
+ public function prepare_item_for_response( $item, $request ) {
164
+ $response = new \WP_REST_Response( [
165
+ 'id' => $item['id'],
166
+ 'muted_by' => $item['muted_by'],
167
+ 'muted_at' => date( 'Y-m-d\TH:i:s', $item['muted_at'] ),
168
+ ] );
169
+ $response->add_link( 'self', rest_url( $this->namespace . '/' . $this->rest_base . $request['id'] ) );
170
+
171
+ if ( $item['muted_by'] ) {
172
+ $response->add_link( 'author', rest_url( '/wp/v2/users/' . $item['muted_by'] ) );
173
+ }
174
+
175
+ return $response;
176
+ }
177
+
178
+ /**
179
+ * Checks if the current request has permission to modify muted issues.
180
+ *
181
+ * @param \WP_REST_Request $request
182
+ *
183
+ * @return \WP_User|WP_Error|false
184
+ */
185
+ protected function has_permission( \WP_REST_Request $request ) {
186
+ if ( is_user_logged_in() ) {
187
+ return wp_get_current_user();
188
+ }
189
+
190
+ if ( $token = \ITSEC_Lib_REST::get_token_from_auth_header( $request->get_header( 'Authorization' ) ) ) {
191
+ $valid = \ITSEC_Site_Scanner_Util::validate_scan_auth_token( $token );
192
+
193
+ if ( is_wp_error( $valid ) ) {
194
+ $valid->add_data( [ 'status' => 401 ] );
195
+ }
196
+
197
+ return $valid;
198
+ }
199
+
200
+ return false;
201
+ }
202
+
203
+ public function get_item_schema() {
204
+ if ( ! $this->schema ) {
205
+ $this->schema = [
206
+ '$schema' => 'http://json-schema.org/draft-04/schema#',
207
+ 'type' => 'object',
208
+ 'properties' => [
209
+ 'id' => [
210
+ 'type' => 'string',
211
+ ],
212
+ 'muted_by' => [
213
+ 'type' => 'integer',
214
+ ],
215
+ 'muted_at' => [
216
+ 'type' => 'string',
217
+ 'format' => 'date-time',
218
+ ],
219
+ ],
220
+ ];
221
+ }
222
+
223
+ return $this->schema;
224
+ }
225
+ }
core/modules/site-scanner/REST/REST.php ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace iThemesSecurity\Site_Scanner\REST;
4
+
5
+ use iThemesSecurity\Contracts\Runnable;
6
+
7
+ class REST implements Runnable {
8
+ /** @var \WP_REST_Controller[] */
9
+ private $controllers;
10
+
11
+ public function __construct( \WP_REST_Controller ...$controllers ) {
12
+ $this->controllers = $controllers;
13
+ }
14
+
15
+ public function run() {
16
+ add_action( 'rest_api_init', [ $this, 'register_routes' ] );
17
+ }
18
+
19
+ public function register_routes() {
20
+ foreach ( $this->controllers as $controller ) {
21
+ $controller->register_routes();
22
+ }
23
+
24
+ register_rest_route( 'ithemes-security/v1', 'site-scanner/verify-scan', [
25
+ 'methods' => 'POST',
26
+ 'callback' => [ $this, 'handle_verification_request' ],
27
+ 'permission_callback' => '__return_true',
28
+ 'args' => [
29
+ 'secret' => [
30
+ 'type' => 'string',
31
+ 'required' => true,
32
+ 'minLength' => 1,
33
+ ],
34
+ ],
35
+ ] );
36
+ }
37
+
38
+ public function handle_verification_request( \WP_REST_Request $request ) {
39
+ $public = \ITSEC_Site_Scanner_API::get_public_key( $request['secret'] );
40
+
41
+ if ( is_wp_error( $public ) ) {
42
+ \ITSEC_Log::add_debug( 'site-scanner', 'verify-scan::invalid_secret', [
43
+ 'params' => $request->get_params(),
44
+ 'error' => $public->get_error_code(),
45
+ ] );
46
+
47
+ $public->add_data( [ 'status' => \WP_Http::OK ] );
48
+
49
+ return $public;
50
+ }
51
+
52
+ \ITSEC_Site_Scanner_API::clear_key_pair( $request['secret'] );
53
+ \ITSEC_Log::add_debug( 'site-scanner', 'verify-scan::valid_secret', [
54
+ 'params' => $request->get_params(),
55
+ 'public' => $public,
56
+ ] );
57
+
58
+ return new \WP_REST_Response( [ 'public' => $public ] );
59
+ }
60
+
61
+ }
core/modules/site-scanner/REST/Scans.php ADDED
@@ -0,0 +1,381 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace iThemesSecurity\Site_Scanner\REST;
4
+
5
+ use iThemesSecurity\Site_Scanner\Factory;
6
+ use iThemesSecurity\Site_Scanner\Repository\Options;
7
+ use iThemesSecurity\Site_Scanner\Repository\Repository;
8
+ use iThemesSecurity\Site_Scanner\Scan;
9
+ use iThemesSecurity\Site_Scanner\Status;
10
+
11
+ class Scans extends \WP_REST_Controller {
12
+
13
+ /** @var Repository */
14
+ private $repository;
15
+
16
+ /**
17
+ * Scans constructor.
18
+ *
19
+ * @param Repository $repository
20
+ */
21
+ public function __construct( Repository $repository ) {
22
+ $this->repository = $repository;
23
+ $this->namespace = 'ithemes-security/v1';
24
+ $this->rest_base = 'site-scanner/scans';
25
+ }
26
+
27
+ public function register_routes() {
28
+ register_rest_route( $this->namespace, $this->rest_base, [
29
+ [
30
+ 'methods' => \WP_REST_Server::READABLE,
31
+ 'callback' => [ $this, 'get_items' ],
32
+ 'permission_callback' => [ $this, 'get_items_permissions_check' ],
33
+ 'args' => $this->get_collection_params(),
34
+ ],
35
+ [
36
+ 'methods' => \WP_REST_Server::CREATABLE,
37
+ 'callback' => [ $this, 'create_item' ],
38
+ 'permission_callback' => [ $this, 'create_item_permissions_check' ],
39
+ 'args' => [
40
+ 'site_id' => [
41
+ 'type' => 'integer',
42
+ 'default' => 0,
43
+ ],
44
+ ]
45
+ ],
46
+ 'schema' => [ $this, 'get_public_item_schema' ],
47
+ ] );
48
+ register_rest_route( $this->namespace, $this->rest_base . '/(?P<id>\d+)', [
49
+ [
50
+ 'methods' => \WP_REST_Server::READABLE,
51
+ 'callback' => [ $this, 'get_item' ],
52
+ 'permission_callback' => [ $this, 'get_item_permissions_check' ],
53
+ 'args' => [
54
+ 'id' => [
55
+ 'type' => 'integer',
56
+ ],
57
+ 'context' => $this->get_context_param( [ 'default' => 'view' ] ),
58
+ ],
59
+ ],
60
+ 'schema' => [ $this, 'get_public_item_schema' ],
61
+ ] );
62
+ }
63
+
64
+ public function create_item_permissions_check( $request ) {
65
+ $valid = $this->has_permission( $request );
66
+
67
+ if ( is_wp_error( $valid ) ) {
68
+ return $valid;
69
+ }
70
+
71
+ if ( ! $valid instanceof \WP_User || ! user_can( $valid, \ITSEC_Core::get_required_cap() ) ) {
72
+ return new \WP_Error( 'rest_cannot_create', __( 'Sorry, you cannot perform site scans.', 'better-wp-security' ), [ 'status' => \ITSEC_Lib_REST::auth_code_required( $valid ) ] );
73
+ }
74
+
75
+ return true;
76
+ }
77
+
78
+ public function create_item( $request ) {
79
+ $scan = \ITSEC_Site_Scanner_API::scan( $request['site_id'] );
80
+
81
+ $response = $this->prepare_item_for_response( $scan, $request );
82
+ $response->set_status( 201 );
83
+ $response->header( 'Location', rest_url( sprintf( '%s/%s/%s', $this->namespace, $this->rest_base, $scan->get_id() ) ) );
84
+
85
+ return $response;
86
+ }
87
+
88
+ public function get_items_permissions_check( $request ) {
89
+ $valid = $this->has_permission( $request );
90
+
91
+ if ( is_wp_error( $valid ) ) {
92
+ return $valid;
93
+ }
94
+
95
+ if ( ! $valid instanceof \WP_User || ! user_can( $valid, \ITSEC_Core::get_required_cap() ) ) {
96
+ return new \WP_Error( 'rest_cannot_view', __( 'Sorry, you cannot view site scans.', 'better-wp-security' ), [ 'status' => \ITSEC_Lib_REST::auth_code_required( $valid ) ] );
97
+ }
98
+
99
+ return true;
100
+ }
101
+
102
+ public function get_items( $request ) {
103
+ $page = (int) $request['page'];
104
+ $per_page = (int) $request['per_page'];
105
+
106
+ $options = ( new Options() )
107
+ ->set_page( $page )
108
+ ->set_per_page( $per_page );
109
+
110
+ if ( $request['code'] ) {
111
+ $options->set_code( $request['code'] );
112
+ }
113
+
114
+ if ( $request['before'] ) {
115
+ $options->set_before( new \DateTimeImmutable( $request['before'], new \DateTimeZone( 'UTC' ) ) );
116
+ }
117
+
118
+ if ( $request['after'] ) {
119
+ $options->set_after( new \DateTimeImmutable( $request['after'], new \DateTimeZone( 'UTC' ) ) );
120
+ }
121
+
122
+ $total = $this->repository->count_scans( $options );
123
+ $scans = $this->repository->get_scans( $options );
124
+
125
+ $responses = [];
126
+
127
+ foreach ( $scans as $scan ) {
128
+ $responses[] = $this->prepare_response_for_collection( $this->prepare_item_for_response( $scan, $request ) );
129
+ }
130
+
131
+ $response = new \WP_REST_Response( $responses );
132
+
133
+ $max_pages = ceil( $total / $per_page );
134
+
135
+ $response->header( 'X-WP-Total', $total );
136
+ $response->header( 'X-WP-TotalPages', (int) $max_pages );
137
+
138
+ $request_params = $request->get_query_params();
139
+ $base = add_query_arg( urlencode_deep( $request_params ), rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ) );
140
+
141
+ if ( $page > 1 ) {
142
+ $prev_page = $page - 1;
143
+
144
+ if ( $prev_page > $max_pages ) {
145
+ $prev_page = $max_pages;
146
+ }
147
+
148
+ $prev_link = add_query_arg( 'page', $prev_page, $base );
149
+ $response->link_header( 'prev', $prev_link );
150
+ }
151
+
152
+ if ( $max_pages > $page ) {
153
+ $next_page = $page + 1;
154
+ $next_link = add_query_arg( 'page', $next_page, $base );
155
+
156
+ $response->link_header( 'next', $next_link );
157
+ }
158
+
159
+ return $response;
160
+ }
161
+
162
+ public function get_item_permissions_check( $request ) {
163
+ $valid = $this->has_permission( $request );
164
+
165
+ if ( is_wp_error( $valid ) ) {
166
+ return $valid;
167
+ }
168
+
169
+ if ( ! $valid instanceof \WP_User || ! user_can( $valid, \ITSEC_Core::get_required_cap() ) ) {
170
+ return new \WP_Error( 'rest_cannot_view', __( 'Sorry, you cannot view site scans.', 'better-wp-security' ), [ 'status' => \ITSEC_Lib_REST::auth_code_required( $valid ) ] );
171
+ }
172
+
173
+ return true;
174
+ }
175
+
176
+ public function get_item( $request ) {
177
+ $scan = $this->repository->get_scan( $request['id'] );
178
+
179
+ if ( is_wp_error( $scan ) ) {
180
+ $scan->add_data( [ 'status' => \WP_Http::NOT_FOUND ] );
181
+
182
+ return $scan;
183
+ }
184
+
185
+ return $this->prepare_item_for_response( $scan, $request );
186
+ }
187
+
188
+ /**
189
+ * Prepares a scan item for response.
190
+ *
191
+ * @param Scan $item
192
+ * @param \WP_REST_Request $request
193
+ *
194
+ * @return \WP_Error|\WP_REST_Response
195
+ */
196
+ public function prepare_item_for_response( $item, $request ) {
197
+ $data = [
198
+ 'id' => $item->get_id(),
199
+ 'time' => $item->get_time()->format( \ITSEC_Lib_REST::DATE_FORMAT ),
200
+ 'url' => $item->get_url(),
201
+ 'code' => $item->get_code(),
202
+ 'description' => \ITSEC_Site_Scanner_Util::get_scan_code_description( $item->get_code() ),
203
+ 'status' => $item->get_status(),
204
+ 'entries' => [],
205
+ 'errors' => [],
206
+ ];
207
+
208
+ foreach ( $item->get_entries() as $entry ) {
209
+ $data['entries'][] = [
210
+ 'slug' => $entry->get_slug(),
211
+ 'title' => $entry->get_title(),
212
+ 'status' => $entry->get_status(),
213
+ ];
214
+ }
215
+
216
+ if ( $item->is_error() ) {
217
+ $data['errors'][] = [
218
+ 'code' => $item->get_error()->get_error_code(),
219
+ 'message' => $item->get_error()->get_error_message(),
220
+ 'data' => $item->get_error()->get_error_data(),
221
+ ];
222
+ }
223
+
224
+ foreach ( $item->get_errors() as $error ) {
225
+ $data['errors'][] = [
226
+ 'code' => $error['code'],
227
+ 'message' => $error['message'],
228
+ ];
229
+ }
230
+
231
+ $data = $this->filter_response_by_context( $data, $request['context'] ?: 'view' );
232
+ $response = new \WP_REST_Response( $data );
233
+ $response->add_links( $this->prepare_links( $item->get_id() ) );
234
+
235
+ return $response;
236
+ }
237
+
238
+ /**
239
+ * Prepares a list of links for the scan item.
240
+ *
241
+ * @param int $scan_id
242
+ *
243
+ * @return array
244
+ */
245
+ protected function prepare_links( $scan_id ) {
246
+ return [
247
+ 'self' => [
248
+ 'href' => rest_url( sprintf( '%s/%s/%s', $this->namespace, $this->rest_base, $scan_id ) ),
249
+ ],
250
+
251
+ \ITSEC_Lib_REST::get_link_relation( 'site-scan-issues' ) => [
252
+ 'href' => rest_url( sprintf( '%s/%s/%s/issues', $this->namespace, $this->rest_base, $scan_id ) ),
253
+ 'embeddable' => true,
254
+ ],
255
+ ];
256
+ }
257
+
258
+ /**
259
+ * Checks if the current request has permission to interact with scans.
260
+ *
261
+ * @param \WP_REST_Request $request
262
+ *
263
+ * @return \WP_User|\WP_Error|false
264
+ */
265
+ protected function has_permission( \WP_REST_Request $request ) {
266
+ if ( is_user_logged_in() ) {
267
+ return wp_get_current_user();
268
+ }
269
+
270
+ if ( $token = \ITSEC_Lib_REST::get_token_from_auth_header( $request->get_header( 'Authorization' ) ) ) {
271
+ $valid = \ITSEC_Site_Scanner_Util::validate_scan_auth_token( $token );
272
+
273
+ if ( is_wp_error( $valid ) ) {
274
+ $valid->add_data( [ 'status' => 401 ] );
275
+ }
276
+
277
+ return $valid;
278
+ }
279
+
280
+ return false;
281
+ }
282
+
283
+ public function get_item_schema() {
284
+ if ( ! $this->schema ) {
285
+ $this->schema = [
286
+ '$schema' => 'http://json-schema.org/draft-04/schema#',
287
+ 'type' => 'object',
288
+ 'properties' => [
289
+ 'id' => [
290
+ 'type' => 'integer',
291
+ 'context' => [ 'view', 'embed' ],
292
+ ],
293
+ 'time' => [
294
+ 'type' => 'string',
295
+ 'format' => 'date-time',
296
+ 'context' => [ 'view', 'embed' ],
297
+ ],
298
+ 'url' => [
299
+ 'type' => 'string',
300
+ 'format' => 'uri',
301
+ 'context' => [ 'view', 'embed' ],
302
+ ],
303
+ 'code' => [
304
+ 'type' => 'string',
305
+ 'context' => [ 'view', 'embed' ],
306
+ ],
307
+ 'description' => [
308
+ 'type' => 'string',
309
+ 'context' => [ 'view', 'embed' ],
310
+ ],
311
+ 'status' => [
312
+ 'type' => 'string',
313
+ 'context' => [ 'view', 'embed' ],
314
+ 'enum' => Status::ALL,
315
+ ],
316
+ 'entries' => [
317
+ 'type' => 'array',
318
+ 'context' => [ 'view' ],
319
+ 'items' => [
320
+ 'type' => 'object',
321
+ 'properties' => [
322
+ 'slug' => [
323
+ 'type' => 'string',
324
+ ],
325
+ 'title' => [
326
+ 'type' => 'string',
327
+ ],
328
+ 'status' => [
329
+ 'type' => 'string',
330
+ 'enum' => Status::ALL,
331
+ ],
332
+ ],
333
+ ],
334
+ ],
335
+ 'errors' => [
336
+ 'type' => 'array',
337
+ 'context' => [ 'view' ],
338
+ 'items' => [
339
+ 'type' => 'object',
340
+ 'properties' => [
341
+ 'code' => [
342
+ 'type' => 'string',
343
+ ],
344
+ 'message' => [
345
+ 'type' => 'string',
346
+ ],
347
+ ],
348
+ ],
349
+ ],
350
+ ],
351
+ ];
352
+ }
353
+
354
+ return $this->schema;
355
+ }
356
+
357
+ public function get_collection_params() {
358
+ $params = parent::get_collection_params();
359
+
360
+ $params['context']['default'] = 'view';
361
+ unset( $params['search'] );
362
+
363
+ $params['code'] = [
364
+ 'type' => 'array',
365
+ 'items' => [
366
+ 'type' => 'string',
367
+ ],
368
+ ];
369
+
370
+ $params['before'] = [
371
+ 'type' => 'string',
372
+ 'format' => 'date-time',
373
+ ];
374
+ $params['after'] = [
375
+ 'type' => 'string',
376
+ 'format' => 'date-time',
377
+ ];
378
+
379
+ return $params;
380
+ }
381
+ }
core/modules/site-scanner/REST/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden.
core/modules/site-scanner/Repository/LatestScanRepository.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace iThemesSecurity\Site_Scanner\Repository;
4
+
5
+ use iThemesSecurity\Contracts\Runnable;
6
+ use iThemesSecurity\Site_Scanner\Scan;
7
+
8
+ final class LatestScanRepository implements Repository, Runnable {
9
+
10
+ /** @var Scan */
11
+ private $scan;
12
+
13
+ public function run() {
14
+ add_action( 'itsec_site_scanner_scan_complete', function ( Scan $scan ) {
15
+ $this->scan = $scan;
16
+ } );
17
+ }
18
+
19
+ public function get_scans( Options $options ) {
20
+ if ( ! $this->scan ) {
21
+ return [];
22
+ }
23
+
24
+ if ( $options->get_code() && $options->get_code() !== $this->scan->get_code() ) {
25
+ return [];
26
+ }
27
+
28
+ return [ $this->scan ];
29
+ }
30
+
31
+ public function count_scans( Options $options ) {
32
+ return $this->scan ? 1 : 0;
33
+ }
34
+
35
+ public function get_scan( $id ) {
36
+ if ( $this->scan ) {
37
+ return $this->scan;
38
+ }
39
+
40
+ return new \WP_Error( 'itsec_no_recent_scan', __( 'No recent site scan.', 'better-wp-security' ) );
41
+ }
42
+ }
core/modules/site-scanner/Repository/LogRepository.php ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace iThemesSecurity\Site_Scanner\Repository;
4
+
5
+ use iThemesSecurity\Site_Scanner\Factory;
6
+ use iThemesSecurity\Site_Scanner\Scan;
7
+
8
+ final class LogRepository implements Repository {
9
+
10
+ /** @var Factory */
11
+ private $factory;
12
+
13
+ /**
14
+ * LogRepository constructor.
15
+ *
16
+ * @param Factory $factory
17
+ */
18
+ public function __construct( Factory $factory ) { $this->factory = $factory; }
19
+
20
+ public function get_scans( Options $options ) {
21
+ $filters = $this->get_filters( $options );
22
+
23
+ $page = $options->get_page();
24
+ $per_page = $options->get_per_page();
25
+
26
+ $items = \ITSEC_Log::get_entries( $filters, $per_page, $page, [ 'timestamp', 'id' ], 'DESC', 'all' );
27
+ $scans = [];
28
+
29
+ foreach ( $items as $item ) {
30
+ $scan = $this->factory->for_log_item( $item );
31
+
32
+ if ( ! is_wp_error( $scan ) ) {
33
+ $scans[] = $scan;
34
+ }
35
+ }
36
+
37
+ return $scans;
38
+ }
39
+
40
+ public function count_scans( Options $options ) {
41
+ return \ITSEC_Log::get_number_of_entries( $this->get_filters( $options ) );
42
+ }
43
+
44
+ public function get_scan( $id ) {
45
+ return $this->factory->for_log_id( $id );
46
+ }
47
+
48
+ /**
49
+ * Get the filters to query the logs.
50
+ *
51
+ * @param Options $options
52
+ *
53
+ * @return array
54
+ */
55
+ protected function get_filters( Options $options ) {
56
+ $filters = [
57
+ 'module' => 'site-scanner',
58
+ 'type_not' => [ 'process-start', 'process-update', 'process-stop' ],
59
+ ];
60
+
61
+ if ( $options->get_code() ) {
62
+ $filters['code'] = $options->get_code();
63
+ }
64
+
65
+ if ( $options->get_after() ) {
66
+ $filters['__min_timestamp'] = $options->get_after()->getTimestamp();
67
+ }
68
+
69
+ if ( $options->get_before() ) {
70
+ $filters['__max_timestamp'] = $options->get_before()->getTimestamp();
71
+ }
72
+
73
+ return $filters;
74
+ }
75
+ }
core/modules/site-scanner/Repository/Options.php ADDED
@@ -0,0 +1,131 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace iThemesSecurity\Site_Scanner\Repository;
4
+
5
+ final class Options {
6
+
7
+ /** @var string */
8
+ private $code;
9
+
10
+ /** @var int */
11
+ private $page = 1;
12
+
13
+ /** @var int */
14
+ private $per_page = 100;
15
+
16
+ /** @var \DateTimeImmutable */
17
+ private $before;
18
+
19
+ /** @var \DateTimeImmutable */
20
+ private $after;
21
+
22
+ /**
23
+ * Get the code to search for.
24
+ *
25
+ * @return string
26
+ */
27
+ public function get_code() {
28
+ return $this->code;
29
+ }
30
+
31
+ /**
32
+ * Set the code to search for.
33
+ *
34
+ * @param string $code
35
+ *
36
+ * @return Options
37
+ */
38
+ public function set_code( $code ) {
39
+ $this->code = $code;
40
+
41
+ return $this;
42
+ }
43
+
44
+ /**
45
+ * Get the date scans must have run before.
46
+ *
47
+ * @return \DateTimeImmutable
48
+ */
49
+ public function get_before() {
50
+ return $this->before;
51
+ }
52
+
53
+ /**
54
+ * Set the date scans must have run before.
55
+ *
56
+ * @param \DateTimeImmutable $before
57
+ *
58
+ * @return Options
59
+ */
60
+ public function set_before( \DateTimeImmutable $before ) {
61
+ $this->before = $before;
62
+
63
+ return $this;
64
+ }
65
+
66
+ /**
67
+ * Get the date scans must have run after.
68
+ *
69
+ * @return \DateTimeImmutable
70
+ */
71
+ public function get_after() {
72
+ return $this->after;
73
+ }
74
+
75
+ /**
76
+ * Set the date scans must have run after.
77
+ *
78
+ * @param \DateTimeImmutable $after
79
+ *
80
+ * @return Options
81
+ */
82
+ public function set_after( \DateTimeImmutable $after ) {
83
+ $this->after = $after;
84
+
85
+ return $this;
86
+ }
87
+
88
+ /**
89
+ * Get the page of scans to return.
90
+ *
91
+ * @return int
92
+ */
93
+ public function get_page() {
94
+ return $this->page;
95
+ }
96
+
97
+ /**
98
+ * Set the page of scans to return.
99
+ *
100
+ * @param int $page
101
+ *
102
+ * @return Options
103
+ */
104
+ public function set_page( $page ) {
105
+ $this->page = absint( $page );
106
+
107
+ return $this;
108
+ }
109
+
110
+ /**
111
+ * Get the number of items to return per page.
112
+ *
113
+ * @return int
114
+ */
115
+ public function get_per_page() {
116
+ return $this->per_page;
117
+ }
118
+
119
+ /**
120
+ * Set the number of items to return per page.
121
+ *
122
+ * @param int $per_page
123
+ *
124
+ * @return Options
125
+ */
126
+ public function set_per_page( $per_page ) {
127
+ $this->per_page = absint( $per_page );
128
+
129
+ return $this;
130
+ }
131
+ }
core/modules/site-scanner/Repository/Repository.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace iThemesSecurity\Site_Scanner\Repository;
4
+
5
+ use iThemesSecurity\Site_Scanner\Scan;
6
+
7
+ interface Repository {
8
+
9
+ /**
10
+ * Get the scans matching the given options.
11
+ *
12
+ * @param Options $options
13
+ *
14
+ * @return mixed
15
+ */
16
+ public function get_scans( Options $options );
17
+
18
+ /**
19
+ * Count the number of scans that match the given options.
20
+ *
21
+ * @param Options $options
22
+ *
23
+ * @return int
24
+ */
25
+ public function count_scans( Options $options );
26
+
27
+ /**
28
+ * Get a scan by id.
29
+ *
30
+ * @param int $id The scan id.
31
+ *
32
+ * @return Scan|\WP_Error
33
+ */
34
+ public function get_scan( $id );
35
+ }
core/modules/site-scanner/Repository/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden.
core/modules/site-scanner/active.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+
3
+ require_once dirname( __FILE__ ) . '/class-itsec-site-scanner.php';
4
+ $scanner = new ITSEC_Site_Scanner();
5
+ $scanner->run();
core/modules/site-scanner/api.php ADDED
@@ -0,0 +1,500 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ use iThemesSecurity\Site_Scanner\Factory;
4
+ use iThemesSecurity\Site_Scanner\Scan;
5
+
6
+ class ITSEC_Site_Scanner_API {
7
+
8
+ const HOST = 'https://itsec-site-scanner.ithemes.com/';
9
+ const ACCEPT = 'application/vnd.site-scanner.ithemes;v=1.0';
10
+ const VERIFY_TOKEN = 'site-scanner-verify';
11
+
12
+ /**
13
+ * Performs the site scan.
14
+ *
15
+ * @param int $site_id The site ID to scan. Accepts 0 to scan the main site in a multisite network.
16
+ *
17
+ * @return Scan
18
+ */
19
+ public static function scan( $site_id = 0 ) {
20
+ $factory = ITSEC_Modules::get_container()->get( Factory::class );
21
+ $pid = ITSEC_Log::add_process_start( 'site-scanner', 'scan', compact( 'site_id' ) );
22
+
23
+ if ( $site_id && ! is_main_site( $site_id ) ) {
24
+ $results = self::scan_sub_site( $pid, $site_id );
25
+ } else {
26
+ $results = self::scan_main_site( $pid );
27
+ }
28
+
29
+ /** @var array|WP_Error $response */
30
+ $response = $results['response'];
31
+ $cached = $results['cached'];
32
+
33
+ if ( is_wp_error( $response ) ) {
34
+ $response->add_data( array_merge( (array) $response->get_error_data(), [ 'url' => get_site_url( $site_id ) ] ) );
35
+
36
+ if ( $response->get_error_message( 'invalid_license' ) ) {
37
+ ITSEC_Modules::set_setting( 'global', 'licensed_hostname_prompt', true );
38
+
39
+ $response->add(
40
+ 'invalid_license',
41
+ sprintf(
42
+ esc_html__( 'Please %1$sconfirm%2$s your licensing details.', 'better-wp-security' ),
43
+ '<a href="' . esc_url( admin_url( 'options-general.php?page=ithemes-licensing' ) ) . '">',
44
+ '</a>'
45
+ )
46
+ );
47
+ }
48
+ }
49
+
50
+ if ( self::is_temporary_server_error( $response ) ) {
51
+ $response->add( 'itsec-temporary-server-error', __( 'Site Scanning is temporarily unavailable, please try again later.' ) );
52
+ }
53
+
54
+ $log_data = [ 'results' => $response, 'cached' => $cached ];
55
+ ITSEC_Log::add_process_stop( $pid, $log_data );
56
+
57
+ if ( $cached ) {
58
+ $scan = $factory->for_api_response( $response );
59
+ } else {
60
+ $code = ITSEC_Site_Scanner_Util::get_scan_result_code( $response );
61
+
62
+ if ( is_wp_error( $response ) ) {
63
+ $id = ITSEC_Log::add_warning( 'site-scanner', $code, $log_data );
64
+ } elseif ( 'error' === $code ) {
65
+ $id = ITSEC_Log::add_warning( 'site-scanner', $code, $log_data );
66
+ } elseif ( 'clean' === $code ) {
67
+ $id = ITSEC_Log::add_notice( 'site-scanner', $code, $log_data );
68
+ } else {
69
+ $id = ITSEC_Log::add_critical_issue( 'site-scanner', $code, $log_data );
70
+ }
71
+
72
+ if ( 'file' !== ITSEC_Modules::get_setting( 'global', 'log_type' ) ) {
73
+ $scan = $factory->for_log_id( $id );
74
+ } else {
75
+ $scan = $factory->for_api_response( $response );
76
+ }
77
+ }
78
+
79
+ /**
80
+ * Fires after a site scan has completed.
81
+ *
82
+ * @param Scan $scan
83
+ * @param int $site_id
84
+ * @param bool $cached
85
+ */
86
+ do_action( 'itsec_site_scanner_scan_complete', $scan, $site_id, $cached );
87
+
88
+ return $scan;
89
+ }
90
+
91
+ /**
92
+ * Scan the main site.
93
+ *
94
+ * @param array $pid
95
+ *
96
+ * @return array
97
+ */
98
+ private static function scan_main_site( array $pid ) {
99
+
100
+ if ( ! function_exists( 'get_plugins' ) ) {
101
+ require_once ABSPATH . 'wp-admin/includes/plugin.php';
102
+ }
103
+
104
+ $body = array();
105
+
106
+ if ( ITSEC_Core::is_licensed() ) {
107
+ $plugins = $themes = array();
108
+
109
+ list( $wp_version ) = explode( '-', $GLOBALS['wp_version'] );
110
+
111
+ foreach ( get_plugins() as $file => $data ) {
112
+ if ( ! empty( $data['Version'] ) ) {
113
+ $plugins[ dirname( $file ) ] = $data['Version'];
114
+ }
115
+ }
116
+
117
+ foreach ( wp_get_themes() as $theme ) {
118
+ $themes[ $theme->get_stylesheet() ] = $theme->get( 'Version' );
119
+ }
120
+
121
+ $body['wordpress'] = $wp_version;
122
+ $body['plugins'] = $plugins;
123
+ $body['themes'] = $themes;
124
+ $body['mutedIssues'] = wp_list_pluck( ITSEC_Site_Scanner_Util::get_muted_issues(), 'id' );
125
+ } else {
126
+ $key_pair = self::generate_key_pair();
127
+
128
+ if ( is_wp_error( $key_pair ) ) {
129
+ return array(
130
+ 'cached' => false,
131
+ 'response' => $key_pair,
132
+ );
133
+ }
134
+
135
+ $body['scan'] = array(
136
+ 'url' => self::clean_url( network_home_url() ),
137
+ 'keyPair' => $key_pair,
138
+ 'verifyTarget' => rest_url( 'ithemes-security/v1/site-scanner/verify-scan' ),
139
+ );
140
+ }
141
+
142
+ return self::make_request( 'api/scan', 'POST', $body, $pid );
143
+ }
144
+
145
+ /**
146
+ * Scan a sub site.
147
+ *
148
+ * @param array $pid The process id for logging.
149
+ * @param int $site_id The site ID to scan.
150
+ *
151
+ * @return array
152
+ */
153
+ private static function scan_sub_site( array $pid, $site_id ) {
154
+ $key_pair = self::generate_key_pair();
155
+
156
+ if ( is_wp_error( $key_pair ) ) {
157
+ return array(
158
+ 'cached' => false,
159
+ 'response' => $key_pair,
160
+ );
161
+ }
162
+
163
+ return self::make_request( 'api/scan', 'POST', array(
164
+ 'scan' => array(
165
+ 'url' => self::clean_url( get_home_url( $site_id ) ),
166
+ 'keyPair' => $key_pair,
167
+ 'verifyTarget' => get_rest_url( $site_id, 'ithemes-security/v1/site-scanner/verify-scan' ),
168
+ )
169
+ ), $pid );
170
+ }
171
+
172
+ /**
173
+ * Make a request to the site scanner API.
174
+ *
175
+ * @param string $route Route to call.
176
+ * @param string $method HTTP method to use.
177
+ * @param array $body Data to be encoded as json.
178
+ * @param array $pid Process ID to continue making log updates.
179
+ *
180
+ * @return array Array of response and cache status.
181
+ */
182
+ private static function make_request( $route, $method, array $body, array $pid = null ) {
183
+ $json = wp_json_encode( $body );
184
+ $headers = array(
185
+ 'Content-Type' => 'application/json',
186
+ 'Accept' => self::ACCEPT,
187
+ );
188
+ $signature = self::generate_signature( $json );
189
+
190
+ if ( is_wp_error( $signature ) ) {
191
+ if ( $signature->get_error_code() !== 'non_active_license' ) {
192
+ return array(
193
+ 'cached' => false,
194
+ 'response' => $signature,
195
+ );
196
+ }
197
+ } else {
198
+ $headers['Authorization'] = $signature;
199
+ }
200
+
201
+ if ( $pid ) {
202
+ ITSEC_Log::add_process_update( $pid, compact( 'route', 'method', 'body', 'headers' ) );
203
+ }
204
+
205
+ $cache_key = self::build_cache_key( $route, $method, $body );
206
+ $cached = true;
207
+
208
+ if ( ( $parsed = get_site_transient( $cache_key ) ) === false ) {
209
+ $cached = false;
210
+ $response = self::call_api( $route, array(), array(
211
+ 'body' => $json,
212
+ 'method' => $method,
213
+ 'timeout' => 300,
214
+ 'headers' => $headers,
215
+ ) );
216
+
217
+ if ( is_wp_error( $response ) ) {
218
+ return compact( 'cached', 'response' );
219
+ }
220
+
221
+ $parsed = self::parse_response( $response );
222
+ self::maybe_cache( $pid, $cache_key, $response, $parsed );
223
+ }
224
+
225
+ return array( 'cached' => $cached, 'response' => $parsed );
226
+ }
227
+
228
+ /**
229
+ * Sign the given request data.
230
+ *
231
+ * @param string $json Request body to sign.
232
+ *
233
+ * @return string|WP_Error
234
+ */
235
+ private static function generate_signature( $json ) {
236
+ if ( ! ITSEC_Core::is_pro() ) {
237
+ return new WP_Error( 'non_active_license', __( 'Not an iThemes Security Pro install.', 'better-wp-security' ) );
238
+ }
239
+
240
+ if ( ! isset( $GLOBALS['ithemes_updater_path'] ) ) {
241
+ return new WP_Error( 'updater_not_available', __( 'Could not find the iThemes updater.', 'better-wp-security' ) );
242
+ }
243
+
244
+ require_once( $GLOBALS['ithemes_updater_path'] . '/keys.php' );
245
+ require_once( $GLOBALS['ithemes_updater_path'] . '/packages.php' );
246
+
247
+ $keys = Ithemes_Updater_Keys::get( array( 'ithemes-security-pro' ) );
248
+
249
+ if ( empty( $keys['ithemes-security-pro'] ) ) {
250
+ return new WP_Error( 'non_active_license', __( 'iThemes Security Pro is not activated.', 'better-wp-security' ) );
251
+ }
252
+
253
+ $signature = hash_hmac( 'sha1', $json, $keys['ithemes-security-pro'] );
254
+
255
+ if ( ! $signature ) {
256
+ return new WP_Error( 'hmac_failed', __( 'Failed to calculate hmac.', 'better-wp-security' ) );
257
+ }
258
+
259
+ $package_details = Ithemes_Updater_Packages::get_full_details();
260
+
261
+ if ( empty( $package_details['packages']['ithemes-security-pro/ithemes-security-pro.php']['user'] ) ) {
262
+ return new WP_Error( 'non_active_license', __( 'iThemes Security Pro is not activated.', 'better-wp-security' ) );
263
+ }
264
+
265
+ $user = $package_details['packages']['ithemes-security-pro/ithemes-security-pro.php']['user'];
266
+ $site = self::clean_url( ITSEC_Core::get_licensed_url() ?: network_home_url() );
267
+
268
+ return sprintf( 'X-KeySignature signature="%s" username="%s" site="%s"', $signature, $user, $site );
269
+ }
270
+
271
+ /**
272
+ * Cleans a URL.
273
+ *
274
+ * @param string $url
275
+ *
276
+ * @return string
277
+ */
278
+ private static function clean_url( $url ) {
279
+ return preg_replace( '|/$|', '', $url );
280
+ }
281
+
282
+ /**
283
+ * Parse a response into a WP_Error or the result.
284
+ *
285
+ * @param array $response WP_Http response.
286
+ *
287
+ * @return mixed|null|WP_Error
288
+ */
289
+ private static function parse_response( $response ) {
290
+ $parsed = self::parse_response_body( $response );
291
+ $code = wp_remote_retrieve_response_code( $response );
292
+
293
+ if ( $code >= 400 ) {
294
+ if ( is_wp_error( $parsed ) ) {
295
+ return $parsed;
296
+ }
297
+
298
+ if ( ! is_array( $parsed ) ) {
299
+ return new WP_Error( 'invalid_json', __( 'Invalid JSON.', 'better-wp-security' ), wp_remote_retrieve_body( $response ) );
300
+ }
301
+
302
+ return new WP_Error(
303
+ isset( $parsed['code'] ) ? $parsed['code'] : 'unknown_error',
304
+ isset( $parsed['message'] ) ? $parsed['message'] : __( 'Unknown Error', 'better-wp-security' ),
305
+ isset( $parsed['data'] ) ? $parsed['data'] : array()
306
+ );
307
+ }
308
+
309
+ return $parsed;
310
+ }
311
+
312
+ /**
313
+ * Parse the response body out of the response object.
314
+ *
315
+ * @param $response
316
+ *
317
+ * @return mixed|null|WP_Error
318
+ */
319
+ private static function parse_response_body( $response ) {
320
+ $body = wp_remote_retrieve_body( $response );
321
+ $code = wp_remote_retrieve_response_code( $response );
322
+ $content_type = wp_remote_retrieve_header( $response, 'content-type' );
323
+
324
+ if ( 204 === $code ) {
325
+ return null;
326
+ }
327
+
328
+ if ( ! $body ) {
329
+ return new WP_Error( 'empty_response_body', __( 'Empty response body.', 'better-wp-security' ) );
330
+ }
331
+
332
+ if ( 'application/json' === $content_type ) {
333
+ $decoded = json_decode( $body, true );
334
+
335
+ if ( json_last_error() !== JSON_ERROR_NONE ) {
336
+ return new WP_Error( 'invalid_json', sprintf( __( 'Invalid JSON: %s.', 'better-wp-security' ), json_last_error_msg() ) );
337
+ }
338
+
339
+ return $decoded;
340
+ }
341
+
342
+ return $body;
343
+ }
344
+
345
+ /**
346
+ * Builds the cache key based on the selected route.
347
+ *
348
+ * @param string $route
349
+ * @param string $method
350
+ * @param array $body
351
+ *
352
+ * @return string
353
+ */
354
+ private static function build_cache_key( $route, $method, array $body ) {
355
+ switch ( $route ) {
356
+ case 'api/scan':
357
+ unset( $body['scan']['keyPair'] );
358
+ break;
359
+ }
360
+
361
+ return 'itsec-site-scanner-' . md5( $route . $method . wp_json_encode( $body ) );
362
+ }
363
+
364
+ /**
365
+ * Maybe cache the response if the cache control allows it.
366
+ *
367
+ * @param array $pid
368
+ * @param string $cache_key
369
+ * @param array $response
370
+ * @param array $cache
371
+ */
372
+ private static function maybe_cache( $pid, $cache_key, $response, $cache ) {
373
+ $cache_control = wp_remote_retrieve_header( $response, 'cache-control' );
374
+
375
+ if ( ! $cache_control ) {
376
+ return;
377
+ }
378
+
379
+ $keywords = array_map( 'trim', explode( ',', $cache_control ) );
380
+
381
+ $mapped = array();
382
+
383
+ foreach ( $keywords as $keyword ) {
384
+ if ( false === strpos( $keyword, '=' ) ) {
385
+ $mapped[ $keyword ] = true;
386
+ } else {
387
+ list( $key, $value ) = explode( '=', $keyword, 2 );
388
+ $mapped[ $key ] = $value;
389
+ }
390
+ }
391
+
392
+ if ( isset( $mapped['max-age'] ) ) {
393
+ $cached = set_site_transient( $cache_key, $cache, (int) $mapped['max-age'] );
394
+
395
+ if ( $cached ) {
396
+ ITSEC_Log::add_process_update( $pid, array( 'action' => 'caching-response', 'mapped' => $mapped, 'cache_key' => $cache_key ) );
397
+ } else {
398
+ ITSEC_Log::add_process_update( $pid, array( 'action' => 'caching-response-failed', 'mapped' => $mapped ) );
399
+ }
400
+ }
401
+ }
402
+
403
+ /**
404
+ * Call the API.
405
+ *
406
+ * @param string $route Route to call.
407
+ * @param array $query Query Args.
408
+ * @param array $args Arguments to pass to {@see wp_remote_request()}.
409
+ *
410
+ * @return array|WP_Error
411
+ */
412
+ private static function call_api( $route, $query, $args ) {
413
+ $url = self::HOST . $route;
414
+
415
+ if ( $query ) {
416
+ $url = add_query_arg( $query, $url );
417
+ }
418
+
419
+ $url = apply_filters( 'itsec_site_scanner_api_request_url', $url, $route, $query, $args );
420
+ $args = apply_filters( 'itsec_site_scanner_api_request_args', $args, $url, $route, $query );
421
+
422
+ return wp_remote_request( $url, $args );
423
+ }
424
+
425
+ /**
426
+ * Generate a public secret key pair for a sub-site site scan.
427
+ *
428
+ * @return array|WP_Error
429
+ */
430
+ public static function generate_key_pair() {
431
+ $public = wp_generate_password( 64, false );
432
+ $secret = ITSEC_Lib_Opaque_Tokens::create_token( self::VERIFY_TOKEN, [
433
+ 'public' => $public,
434
+ ] );
435
+
436
+ if ( is_wp_error( $secret ) ) {
437
+ return $secret;
438
+ }
439
+
440
+ return compact( 'public', 'secret' );
441
+ }
442
+
443
+ /**
444
+ * Gets the public key for the given secret key.
445
+ *
446
+ * @param string $secret_key
447
+ *
448
+ * @return string|WP_Error
449
+ */
450
+ public static function get_public_key( $secret_key ) {
451
+ $token = \ITSEC_Lib_Opaque_Tokens::verify_and_get_token_data(
452
+ self::VERIFY_TOKEN,
453
+ $secret_key,
454
+ 15 * MINUTE_IN_SECONDS
455
+ );
456
+
457
+ if ( is_wp_error( $token ) ) {
458
+ return $token;
459
+ }
460
+
461
+ return $token['public'];
462
+ }
463
+
464
+ /**
465
+ * Deletes the key pair.
466
+ *
467
+ * @param string $secret_key
468
+ */
469
+ public static function clear_key_pair( $secret_key ) {
470
+ ITSEC_Lib_Opaque_Tokens::delete_token( $secret_key );
471
+ }
472
+
473
+ /**
474
+ * Check if this is a temporary server error, in which case we should retry the scan at a later point in time,
475
+ * or if this is an issue with the client that needs to be fixed.
476
+ *
477
+ * @param array|WP_Error $results The parsed results from the scan.
478
+ *
479
+ * @return bool
480
+ */
481
+ private static function is_temporary_server_error( $results ) {
482
+ if ( ! is_wp_error( $results ) ) {
483
+ return false;
484
+ }
485
+
486
+ $code = $results->get_error_code();
487
+
488
+ if ( 'http_request_failed' === $code && strpos( $results->get_error_message(), 'cURL error 52:' ) !== false ) {
489
+ return true;
490
+ }
491
+
492
+ $codes = [
493
+ 'empty_response_body',
494
+ 'invalid_json',
495
+ 'internal_server_error',
496
+ ];
497
+
498
+ return in_array( $code, $codes, true );
499
+ }
500
+ }
core/modules/site-scanner/class-itsec-site-scanner.php ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ use iThemesSecurity\Contracts\Runnable;
4
+ use iThemesSecurity\Site_Scanner\Repository\Repository;
5
+ use iThemesSecurity\Site_Scanner\Scan;
6
+ use iThemesSecurity\Site_Scanner\Vulnerability;
7
+
8
+ class ITSEC_Site_Scanner {
9
+
10
+ public function run() {
11
+ add_action( 'itsec_register_highlighted_logs', array( $this, 'register_highlight' ) );
12
+ add_action( 'itsec_site_scanner_scan_complete', array( $this, 'extract_vulnerabilities_from_scan' ), 10, 3 );
13
+ add_action( 'admin_enqueue_scripts', array( $this, 'register_scripts' ) );
14
+
15
+ $repository = ITSEC_Modules::get_container()->get( Repository::class );
16
+
17
+ if ( $repository instanceof Runnable ) {
18
+ $repository->run();
19
+ }
20
+ }
21
+
22
+ public function register_highlight() {
23
+ ITSEC_Lib_Highlighted_Logs::register_dynamic_highlight( 'site-scanner-report', array(
24
+ 'module' => 'site-scanner',
25
+ 'type' => 'critical-issue',
26
+ ) );
27
+ }
28
+
29
+ /**
30
+ * Extracts vulnerabilities from a site scan result, and stores them.
31
+ *
32
+ * @param Scan $scan
33
+ * @param int $site_id
34
+ * @param bool $cached
35
+ */
36
+ public function extract_vulnerabilities_from_scan( $scan, $site_id, $cached ) {
37
+ if ( $scan->is_error() ) {
38
+ return;
39
+ }
40
+
41
+ if ( $cached ) {
42
+ return;
43
+ }
44
+
45
+ if ( $site_id && ! is_main_site( $site_id ) ) {
46
+ return; // Vulnerabilities aren't checked on sub site scans.
47
+ }
48
+
49
+ $vulnerabilities = array();
50
+
51
+ if ( $entry = $scan->find_entry( 'vulnerabilities' ) ) {
52
+ foreach ( $entry->get_issues() as $issue ) {
53
+ if ( ! $issue instanceof Vulnerability ) {
54
+ continue;
55
+ }
56
+
57
+ $vulnerability = $issue->get_meta();
58
+
59
+ $vulnerability['issues'] = [
60
+ [
61
+ 'title' => $issue->get_description(),
62
+ 'fixed_in' => $issue->get_fixed_in(),
63
+ ]
64
+ ];
65
+ $vulnerability['link'] = $issue->get_link();
66
+
67
+ unset( $vulnerability['issue'] );
68
+ $vulnerabilities[] = $vulnerability;
69
+ }
70
+ }
71
+
72
+ $existing = ITSEC_Modules::get_setting( 'site-scanner', 'vulnerabilities' );
73
+
74
+ if ( $existing !== $vulnerabilities ) {
75
+ ITSEC_Modules::set_setting( 'site-scanner', 'vulnerabilities', $vulnerabilities );
76
+
77
+ /**
78
+ * Fires when the detected software vulnerabilities have changed.
79
+ *
80
+ * @param array $vulnerabilities The new vulnerabilities set.
81
+ * @param array $existing The existing vulnerabilities.
82
+ */
83
+ do_action( 'itsec_software_vulnerabilities_changed', $vulnerabilities, $existing );
84
+ }
85
+ }
86
+
87
+ /**
88
+ * Registers scripts for the site scanner.
89
+ */
90
+ public function register_scripts() {
91
+ wp_register_script( 'itsec-site-scanner-scan-settings', plugins_url( 'js/scanner.js', __FILE__ ), array( 'jquery', 'wp-i18n', 'itsec-util' ), 1, true );
92
+ }
93
+ }
core/modules/site-scanner/container.php ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace iThemesSecurity\Site_Scanner;
4
+
5
+ use iThemesSecurity\Site_Scanner\Repository\LatestScanRepository;
6
+ use iThemesSecurity\Site_Scanner\Repository\LogRepository;
7
+ use iThemesSecurity\Site_Scanner\Repository\Repository;
8
+ use Pimple\Container;
9
+
10
+ return static function ( Container $c ) {
11
+ $c['module.site-scanner.files'] = [
12
+ 'rest.php' => REST\REST::class,
13
+ ];
14
+
15
+ $c[ Factory::class ] = static function () {
16
+ return new Factory();
17
+ };
18
+
19
+ $c[ Multi_Fixer::class ] = static function ( Container $c ) {
20
+ return new Multi_Fixer( $c[ Vulnerability_Fixer::class ] );
21
+ };
22
+
23
+ $c[ Vulnerability_Fixer::class ] = static function ( Container $c ) {
24
+ return new Vulnerability_Fixer( $c[ \ITSEC_Lib_Upgrader::class ] );
25
+ };
26
+
27
+ $c[ Repository::class ] = static function ( Container $c ) {
28
+ $log_type = \ITSEC_Modules::get_setting( 'global', 'log_type' );
29
+
30
+ if ( 'file' === $log_type ) {
31
+ return $c[ LatestScanRepository::class ];
32
+ }
33
+
34
+ return $c[ LogRepository::class ];
35
+ };
36
+
37
+ $c[ LogRepository::class ] = static function ( Container $c ) {
38
+ return new LogRepository( $c[ Factory::class ] );
39
+ };
40
+
41
+ $c[ LatestScanRepository::class ] = static function ( Container $c ) {
42
+ return new LatestScanRepository();
43
+ };
44
+
45
+ $c[ REST\REST::class ] = static function ( Container $c ) {
46
+ return new REST\REST(
47
+ $c[ REST\Scans::class ],
48
+ $c[ REST\Issues::class ],
49
+ $c[ REST\Muted_Issues::class ]
50
+ );
51
+ };
52
+
53
+ $c[ REST\Scans::class ] = static function ( Container $c ) {
54
+ return new REST\Scans(
55
+ $c[ Repository::class ]
56
+ );
57
+ };
58
+
59
+ $c[ REST\Issues::class ] = static function ( Container $c ) {
60
+ return new REST\Issues(
61
+ $c[ Repository::class ],
62
+ $c[ Multi_Fixer::class ]
63
+ );
64
+ };
65
+
66
+ $c[ REST\Muted_Issues::class ] = static function () {
67
+ return new REST\Muted_Issues();
68
+ };
69
+ };
core/modules/site-scanner/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden.
core/modules/site-scanner/js/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden.
core/modules/site-scanner/js/scanner.js ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 'use strict';
2
+
3
+ ( function( $ ) {
4
+ var itsecSiteScanner = {
5
+ init: function() {
6
+ this.bindEvents();
7
+ },
8
+
9
+ bindEvents: function() {
10
+ $( document ).on( 'click', '#itsec-site-scanner-start', this.startScan );
11
+ $( document ).on( 'click', '.itsec-site-scan-toggle-details', this.toggleDetails );
12
+ },
13
+
14
+ toggleDetails: function( e ) {
15
+ e.preventDefault();
16
+
17
+ var $container = $( this ).parents( '.itsec-site-scan-results-section' );
18
+ var $details = $container.find( '.itsec-site-scan__details' );
19
+
20
+ if ( $details.is( ':visible' ) ) {
21
+ $( this ).text( wp.i18n.__( 'Show Details', 'better-wp-security' ) ).attr( 'aria-expanded', false );
22
+ $details.hide();
23
+ } else {
24
+ $( this ).text( wp.i18n.__( 'Hide Details', 'better-wp-security' ) ).attr( 'aria-expanded', true );
25
+ $details.show();
26
+ }
27
+ },
28
+
29
+ startScan: function( e ) {
30
+ e.preventDefault();
31
+
32
+ $( this ).prop( 'disabled', true ).val( wp.i18n.__( 'Scanning...', 'better-wp-security' ) );
33
+ itsecUtil.sendWidgetAJAXRequest( 'site-scanner', { action: 'run-scan' }, itsecSiteScanner.handleResponse );
34
+ },
35
+
36
+ handleResponse: function( results ) {
37
+ $( '#itsec-site-scanner-start' ).hide();
38
+ var $wrapper = $( '.itsec-site-scanner-scan-results-wrapper' );
39
+
40
+ if ( results.response && results.response.length ) {
41
+ $wrapper.html( results.response );
42
+ }
43
+
44
+ itsecUtil.displayNotices( results, $wrapper, true );
45
+ },
46
+ };
47
+
48
+ $( document ).ready( function() {
49
+ itsecSiteScanner.init();
50
+ } );
51
+ } )( jQuery );
core/modules/site-scanner/labels.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+
3
+ return [
4
+ 'title' => __( 'Site Scanner', 'better-wp-security' ),
5
+ ];
core/modules/site-scanner/logs.php ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class ITSEC_Site_Scanner_Logs {
4
+ public function __construct() {
5
+ add_filter( 'itsec_logs_prepare_site-scanner_entry_for_list_display', array( $this, 'filter_entry_for_list_display' ), 10, 3 );
6
+ add_filter( 'itsec_logs_prepare_site-scanner_entry_for_details_display', array( $this, 'filter_entry_for_details_display' ), 10, 4 );
7
+ add_filter( 'itsec_highlighted_log_site-scanner-report_notice_title', array( $this, 'filter_highlight_title' ), 10, 2 );
8
+ add_filter( 'itsec_highlighted_log_site-scanner-report_notice_message', array( $this, 'filter_highlight_message' ), 10, 2 );
9
+
10
+ if ( did_action( 'admin_enqueue_scripts' ) ) {
11
+ $this->enqueue();
12
+ } else {
13
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue' ) );
14
+ }
15
+ }
16
+
17
+ public function filter_entry_for_list_display( $entry, $code, $code_data ) {
18
+ $entry['module_display'] = esc_html__( 'Site Scan', 'better-wp-security' );
19
+
20
+ switch ( $code ) {
21
+ case 'scan':
22
+ if ( 'process-start' === $entry['type'] ) {
23
+ $entry['description'] = esc_html__( 'Scan Performance', 'better-wp-security' );
24
+ } else {
25
+ $entry['description'] = esc_html__( 'Scan', 'better-wp-security' );
26
+ }
27
+ break;
28
+ case 'verify-scan':
29
+ if ( $code_data[0] === 'invalid_secret' ) {
30
+ $entry['description'] = __( 'Scan Verification Failed: Invalid Secret', 'better-wp-security' );
31
+ } else {
32
+ $entry['description'] = __( 'Site Verification Succeeded', 'better-wp-security' );
33
+ }
34
+ break;
35
+ default:
36
+ require_once( dirname( __FILE__ ) . '/util.php' );
37
+ $entry['description'] = ITSEC_Site_Scanner_Util::get_scan_code_description( $entry['code'] );
38
+
39
+ if ( ! $entry['description'] ) {
40
+ $entry['description'] = $entry['code'];
41
+ }
42
+ }
43
+
44
+ return $entry;
45
+ }
46
+
47
+ public function filter_entry_for_details_display( $details, $entry, $code, $code_data ) {
48
+ require_once( dirname( __FILE__ ) . '/template.php' );
49
+
50
+ $entry = $this->filter_entry_for_list_display( $entry, $code, $code_data );
51
+
52
+ $details['module']['content'] = $entry['module_display'];
53
+ $details['description']['content'] = $entry['description'];
54
+
55
+ if (
56
+ isset( $entry['data']['results'] ) &&
57
+ ( is_array( $entry['data']['results'] ) || is_wp_error( $entry['data']['results'] ) ) &&
58
+ ! in_array( $entry['type'], [ 'process-start', 'process-update', 'process-stop' ], true )
59
+ ) {
60
+ $details['results'] = array(
61
+ 'header' => esc_html__( 'Results', 'better-wp-security' ),
62
+ 'content' => ITSEC_Site_Scanner_Template::get_html( $entry['data']['results'] ),
63
+ );
64
+ }
65
+
66
+ return $details;
67
+ }
68
+
69
+ public function filter_highlight_title( $title, $entry ) {
70
+ $factory = ITSEC_Modules::get_container()->get( \iThemesSecurity\Site_Scanner\Factory::class );
71
+
72
+ $scan = $factory->for_log_item( $entry );
73
+
74
+ if ( is_wp_error( $scan ) ) {
75
+ return esc_html__( 'The iThemes Security site scan encountered an error.', 'better-wp-security' );
76
+ }
77
+
78
+ $count = $scan->count( \iThemesSecurity\Site_Scanner\Status::WARN );
79
+
80
+ return esc_html( sprintf(
81
+ _n(
82
+ 'iThemes Security found %s issue during a site scan.',
83
+ 'iThemes Security found %s issues during a site scan.',
84
+ $count,
85
+ 'better-wp-security'
86
+ ),
87
+ number_format_i18n( $count )
88
+ ) );
89
+ }
90
+
91
+ public function filter_highlight_message( $title, $entry ) {
92
+ return sprintf(
93
+ esc_html__( 'Please %1$sreview the logs%2$s to make sure your system is secure.', 'better-wp-security' ),
94
+ '<a href="{{ $view }}">',
95
+ '</a>'
96
+ );
97
+ }
98
+
99
+ public function enqueue() {
100
+ wp_enqueue_script( 'itsec-site-scanner-scan-settings' );
101
+ wp_enqueue_style( 'itsec-core-packages-components-site-scan-results-style' );
102
+ }
103
+ }
104
+
105
+ new ITSEC_Site_Scanner_Logs();
core/modules/site-scanner/mail.php ADDED
@@ -0,0 +1,168 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ use iThemesSecurity\Site_Scanner\Scan;
4
+ use iThemesSecurity\Site_Scanner\Status;
5
+ use iThemesSecurity\Site_Scanner\Issue;
6
+
7
+ class ITSEC_Site_Scanner_Mail {
8
+
9
+ /**
10
+ * Sends a notification about the results of the scan.
11
+ *
12
+ * @param Scan $scan
13
+ *
14
+ * @return bool
15
+ */
16
+ public static function send( $scan ) {
17
+ if ( ! $scan instanceof Scan ) {
18
+ _doing_it_wrong( __METHOD__, __( 'Must pass Scan instance.', 'better-wp-security' ), '5.8.1' );
19
+
20
+ return false;
21
+ }
22
+
23
+ $code = $scan->get_code();
24
+
25
+ if ( 'clean' === $code ) {
26
+ return true;
27
+ }
28
+
29
+ $nc = ITSEC_Core::get_notification_center();
30
+
31
+ $mail = $nc->mail();
32
+ $mail->set_subject( static::get_scan_subject( $code ) );
33
+ $mail->set_recipients( $nc->get_recipients( 'malware-scheduling' ) );
34
+
35
+ $mail->add_header(
36
+ esc_html__( 'Site Scan', 'better-wp-security' ),
37
+ sprintf(
38
+ esc_html__( 'Site Scan for %s', 'better-wp-security' ),
39
+ '<b>' . ITSEC_Lib::date_format_i18n_and_local_timezone( $scan->get_time()->getTimestamp(), get_option( 'date_format' ) ) . '</b>'
40
+ )
41
+ );
42
+ static::format_scan_body( $mail, $scan );
43
+ $mail->add_footer();
44
+
45
+ return $nc->send( 'malware-scheduling', $mail );
46
+ }
47
+
48
+ /**
49
+ * Get the subject line for a site scan result.
50
+ *
51
+ * @param string $code
52
+ *
53
+ * @return string
54
+ */
55
+ public static function get_scan_subject( $code ) {
56
+
57
+ switch ( $code ) {
58
+ case 'scan-failure-server-error':
59
+ case 'scan-failure-client-error':
60
+ case 'error':
61
+ return esc_html__( 'Scheduled site scan resulted in an error', 'better-wp-security' );
62
+ case 'clean':
63
+ return esc_html__( 'Scheduled site scan found no issues.', 'better-wp-security' );
64
+ default:
65
+ require_once( dirname( __FILE__ ) . '/util.php' );
66
+
67
+ if ( $codes = ITSEC_Site_Scanner_Util::translate_findings_code( $code ) ) {
68
+ return wp_sprintf( esc_html__( 'Scheduled site scan report: %l', 'better-wp-security' ), $codes );
69
+ }
70
+
71
+ return wp_sprintf( esc_html__( 'Scheduled site scan found warnings', 'better-wp-security' ) );
72
+ }
73
+ }
74
+
75
+ /**
76
+ * Format the scan results into the mail object.
77
+ *
78
+ * @param ITSEC_Mail $mail
79
+ * @param Scan $scan
80
+ */
81
+ public static function format_scan_body( ITSEC_Mail $mail, $scan ) {
82
+ $log_url = '';
83
+
84
+ if ( $scan->get_id() ) {
85
+ $log_url = add_query_arg( 'id', $scan->get_id(), ITSEC_Core::get_logs_page_url() );
86
+ $log_url = ITSEC_Mail::filter_admin_page_url( $log_url );
87
+ }
88
+
89
+ if ( $scan->is_error() ) {
90
+ $mail->add_list( array(
91
+ /* translators: 1. Site name. */
92
+ sprintf( esc_html__( 'An error occurred while running the scheduled site scan on %s:', 'better-wp-security' ), get_bloginfo( 'name', 'display' ) ),
93
+ sprintf( esc_html__( 'Error Message: %s', 'better-wp-security' ), $scan->get_error()->get_error_message() ),
94
+ sprintf( esc_html__( 'Error Code: %s', 'better-wp-security' ), '<code>' . esc_html( $scan->get_error()->get_error_code() ) . '</code>' ),
95
+ ), true );
96
+
97
+ if ( $log_url ) {
98
+ $mail->add_button( esc_html__( 'View Report', 'better-wp-security' ), $log_url );
99
+ }
100
+
101
+ return;
102
+ }
103
+
104
+ $issues = $scan->count( Status::WARN );
105
+ $errors = count( $scan->get_errors() );
106
+
107
+ $lead = '';
108
+
109
+ if ( $issues ) {
110
+ $lead = sprintf( esc_html(
111
+ _n(
112
+ 'The scheduled site scan found %1$s issue when scanning %2$s.',
113
+ 'The scheduled site scan found %1$s issues when scanning %2$s.',
114
+ $issues,
115
+ 'better-wp-security'
116
+ )
117
+ ), number_format_i18n( $issues ), $scan->get_url() );
118
+ }
119
+
120
+ if ( $errors ) {
121
+ if ( $lead ) {
122
+ $lead .= ' ' . sprintf( esc_html(
123
+ _n(
124
+ 'The scanner encountered %s additional error.',
125
+ 'The scanner encountered %s additional errors.',
126
+ $errors,
127
+ 'better-wp-security'
128
+ )
129
+ ), number_format_i18n( $errors ) );
130
+ } else {
131
+ $lead = sprintf( esc_html(
132
+ _n(
133
+ 'The scheduled site scan encountered %1$s error when scanning %2$s.',
134
+ 'The scheduled site scan encountered %1$s errors when scanning %2$s.',
135
+ $errors,
136
+ 'better-wp-security'
137
+ )
138
+ ), number_format_i18n( $errors ), $scan->get_url() );
139
+ }
140
+ }
141
+
142
+ $mail->add_text( $lead );
143
+
144
+ $mail->start_group( 'report' );
145
+
146
+ foreach ( $scan->get_entries() as $entry ) {
147
+ if ( $entry->get_status() !== Status::WARN ) {
148
+ continue;
149
+ }
150
+
151
+ $mail->add_section_heading( $entry->get_title() );
152
+ $mail->add_list( array_map( static function ( Issue $issue ) {
153
+ return sprintf( '<a href="%s">%s</a>', esc_url( $issue->get_link() ), esc_html( $issue->get_description() ) );
154
+ }, $entry->get_issues() ) );
155
+ }
156
+
157
+ if ( $errors ) {
158
+ $mail->add_section_heading( esc_html__( 'Scan Errors', 'better-wp-security' ) );
159
+ $mail->add_list( array_map( 'esc_html', wp_list_pluck( $scan->get_errors(), 'message' ) ) );
160
+ }
161
+
162
+ $mail->end_group();
163
+
164
+ if ( $log_url ) {
165
+ $mail->add_button( esc_html__( 'View Report', 'better-wp-security' ), $log_url );
166
+ }
167
+ }
168
+ }
core/modules/site-scanner/privacy.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ final class ITSEC_Site_Scanner_Privacy {
4
+ public function __construct() {
5
+ add_filter( 'itsec_get_privacy_policy_for_sharing', array( $this, 'get_privacy_policy_for_sharing' ) );
6
+ }
7
+
8
+ public function get_privacy_policy_for_sharing( $policy ) {
9
+ $suggested_text = '<strong class="privacy-policy-tutorial">' . __( 'Suggested text:' ) . ' </strong>';
10
+
11
+ /* Translators: 1: Link to Sucuri's privacy policy */
12
+ $policy .= "<p>$suggested_text " . __( 'This site is scanned for potential malware and vulnerabilities by the iThemes Site Scanner. We do not send personal information to the scanner; however, the scanner could find personal information posted publicly (such as in comments) during the scan.', 'better-wp-security' ) . "</p>\n";
13
+
14
+ return $policy;
15
+ }
16
+ }
17
+ new ITSEC_Site_Scanner_Privacy();
core/modules/site-scanner/settings-page.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class ITSEC_Settings_Page_Sidebar_Widget_Site_Scanner extends ITSEC_Settings_Page_Sidebar_Widget {
4
+ public function __construct() {
5
+ $this->id = 'site-scanner';
6
+ $this->title = __( 'Site Scan', 'better-wp-security' );
7
+ $this->priority = 8;
8
+
9
+ parent::__construct();
10
+ }
11
+
12
+ public function enqueue_scripts_and_styles() {
13
+ wp_enqueue_script( 'itsec-site-scanner-scan-settings' );
14
+ wp_enqueue_style( 'itsec-core-packages-components-site-scan-results-style' );
15
+ }
16
+
17
+ public function handle_ajax_request( $data ) {
18
+ $scan = ITSEC_Site_Scanner_API::scan();
19
+
20
+ if ( $scan->is_error() && $scan->get_error()->get_error_message( 'itsec-temporary-server-error' ) ) {
21
+ ITSEC_Response::add_warning( __( 'Site Scanning is temporarily unavailable, please try again later.', 'better-wp-security' ) );
22
+ } else {
23
+ ITSEC_Response::set_response( ITSEC_Site_Scanner_Template::get_html( $scan, true ) );
24
+ }
25
+ }
26
+
27
+ public function render( $form ) {
28
+ $button = __( 'Scan Now', 'better-wp-security' );
29
+ $module = 'site-scanner';
30
+ $description = __( 'This %1$ssite scan is powered by iThemes%2$s. We use several datapoints to check for known malware, blocklist status, website errors and out-of-date software. These datapoints are not 100%% accurate, but we try our best to provide thorough results.', 'better-wp-security' );
31
+ $description = sprintf( $description, '<a href="https://help.ithemes.com/hc/en-us/articles/360046334433" target="_blank">', '</a>' );
32
+
33
+ ?>
34
+ <p><?php echo $description; ?></p>
35
+ <p><?php printf( __( 'Results of previous scans can be found on the <a href="%s">logs page</a>.', 'better-wp-security' ), ITSEC_Core::get_logs_page_url( $module ) ); ?></p>
36
+ <div class="itsec-site-scanner-scan-results-wrapper"></div>
37
+ <?php $form->add_button( 'start', array( 'value' => $button, 'class' => 'button-primary' ) ); ?>
38
+ <?php
39
+ }
40
+
41
+ protected function save( $data ) {
42
+ }
43
+ }
44
+
45
+ new ITSEC_Settings_Page_Sidebar_Widget_Site_Scanner();
core/modules/site-scanner/settings.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ final class ITSEC_Site_Scanner_Settings extends ITSEC_Settings {
4
+ public function get_id() {
5
+ return 'site-scanner';
6
+ }
7
+
8
+ public function get_defaults() {
9
+ return array(
10
+ 'vulnerabilities' => array(),
11
+ 'muted_issues' => array(),
12
+ );
13
+ }
14
+ }
15
+
16
+ ITSEC_Modules::register_settings( new ITSEC_Site_Scanner_Settings() );
core/modules/site-scanner/template.php ADDED
@@ -0,0 +1,199 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ use iThemesSecurity\Site_Scanner\Entry;
4
+ use iThemesSecurity\Site_Scanner\Factory;
5
+ use iThemesSecurity\Site_Scanner\Scan;
6
+
7
+ class ITSEC_Site_Scanner_Template {
8
+
9
+ private static $instance_id = 0;
10
+
11
+ /**
12
+ * Get's the HTML for the scan results.
13
+ *
14
+ * @param Scan|array|\WP_Error $results
15
+ * @param bool $show_error_details
16
+ *
17
+ * @return string
18
+ */
19
+ public static function get_html( $results, $show_error_details = true ) {
20
+ if ( $results instanceof Scan ) {
21
+ $scan = $results;
22
+ } else {
23
+ $scan = ITSEC_Modules::get_container()->get( Factory::class )->for_api_response( $results );
24
+ }
25
+
26
+ $html = '<div class="itsec-site-scan-results">';
27
+
28
+ if ( self::show_site_url( $scan ) ) {
29
+ $html .= '<h4>' . sprintf( esc_html__( 'Site: %s', 'better-wp-security' ), $scan->get_url() ) . '</h4>';
30
+ }
31
+
32
+ if ( $scan->is_error() ) {
33
+ $html .= self::render_wp_error_details( $scan->get_error(), $show_error_details );
34
+ } else {
35
+ $html .= self::render_system_error_details( $scan );
36
+
37
+ foreach ( $scan->get_entries() as $entry ) {
38
+ $html .= self::render_entry( $entry );
39
+ }
40
+ }
41
+
42
+ $html .= '</div>';
43
+
44
+ return $html;
45
+ }
46
+
47
+ /**
48
+ * Renders an entry.
49
+ *
50
+ * @param Entry $entry
51
+ *
52
+ * @return string
53
+ */
54
+ private static function render_entry( Entry $entry ) {
55
+ $children = '';
56
+
57
+ foreach ( $entry->get_issues() as $issue ) {
58
+ $children .= '<li class="itsec-site-scan__detail itsec-site-scan__detail--' . esc_attr( $issue->get_status() ) . '"><span>';
59
+ $children .= '<a href="' . esc_url( $issue->get_link() ) . '">';
60
+ $children .= $issue->get_description();
61
+ $children .= '</a>';
62
+ $children .= '</span></li>';
63
+ }
64
+
65
+ return self::render_wrapped_section( [
66
+ 'type' => $entry->get_slug(),
67
+ 'status' => $entry->get_status(),
68
+ 'description' => $entry->get_title(),
69
+ 'children' => $children,
70
+ ] );
71
+ }
72
+
73
+ /**
74
+ * Render details for a system error.
75
+ *
76
+ * @param Scan $scan
77
+ *
78
+ * @return string
79
+ */
80
+ private static function render_system_error_details( Scan $scan ) {
81
+ if ( ! $scan->get_errors() ) {
82
+ return '';
83
+ }
84
+
85
+ $children = '';
86
+
87
+ foreach ( $scan->get_errors() as $error ) {
88
+ $children .= '<li class="itsec-site-scan__detail itsec-site-scan__detail--error"><span>' . esc_html( $error['message'] ) . '</span></li>';
89
+ }
90
+
91
+ return self::render_wrapped_section( array(
92
+ 'children' => $children,
93
+ 'type' => 'system-error',
94
+ 'status' => 'error',
95
+ 'description' => esc_html__( 'The scan failed to properly scan the site.', 'better-wp-security' ),
96
+ ) );
97
+ }
98
+
99
+ /**
100
+ * Render details for a WP_Error.
101
+ *
102
+ * @param WP_Error $results
103
+ * @param bool $show_error_details
104
+ *
105
+ * @return string
106
+ */
107
+ private static function render_wp_error_details( $results, $show_error_details ) {
108
+ $html = '<p>' . sprintf( esc_html__( 'Error Message: %s', 'better-wp-security' ), implode( ' ', ITSEC_Lib::get_error_strings( $results ) ) ) . '</p>';
109
+ $html .= '<p>' . sprintf( esc_html__( 'Error Code: %s', 'better-wp-security' ), $results->get_error_code() ) . '</p>';
110
+
111
+ if ( $show_error_details && $results->get_error_data() ) {
112
+ $html .= '<p>' . esc_html__( 'If you contact support about this error, please provide the following debug details:', 'better-wp-security' ) . '</p>';
113
+ $html .= ITSEC_Debug::print_r( array(
114
+ 'code' => $results->get_error_code(),
115
+ 'data' => $results->get_error_data(),
116
+ ), [], false );
117
+ }
118
+
119
+ return self::render_wrapped_section( array(
120
+ 'children' => $html,
121
+ 'type' => 'wp-error',
122
+ 'status' => 'error',
123
+ 'description' => esc_html__( 'The scan failed to properly scan the site.', 'better-wp-security' ),
124
+ ) );
125
+ }
126
+
127
+ /**
128
+ * Render wrapped section HTML.
129
+ *
130
+ * @param array $args
131
+ *
132
+ * @return string
133
+ */
134
+ private static function render_wrapped_section( $args ) {
135
+ $i_id = self::$instance_id ++;
136
+
137
+ switch ( $args['status'] ) {
138
+ case 'clean':
139
+ $status_text = __( 'Clean', 'better-wp-security' );
140
+ break;
141
+ case 'warn':
142
+ $status_text = __( 'Warn', 'better-wp-security' );
143
+ break;
144
+ case 'error':
145
+ $status_text = __( 'Error', 'better-wp-security' );
146
+ break;
147
+ default:
148
+ $status_text = $args['status'];
149
+ break;
150
+ }
151
+
152
+ $status_el = '<span class="itsec-site-scan__status itsec-site-scan__status--' . esc_attr( $args['status'] ) . '">' . $status_text . '</span>';
153
+
154
+ $html = '<div class="itsec-site-scan-results-section itsec-site-scan-results-' . esc_attr( $args['type'] ) . '-section">';
155
+
156
+ if ( empty( $args['children'] ) ) {
157
+ $html .= '<p>' . $status_el . ' ' . esc_html( $args['description'] ) . '</p>';
158
+ } else {
159
+ $html .= '<p>';
160
+ $html .= $status_el;
161
+ $html .= esc_html( $args['description'] );
162
+
163
+ $id = 'itsec-site-scan__details--' . $i_id;
164
+
165
+ $html .= '<button type="button" class="itsec-site-scan-toggle-details button-link" aria-expanded="false" aria-controls="' . esc_attr( $id ) . '">';
166
+ $html .= esc_html__( 'Show Details', 'better-wp-security' );
167
+ $html .= '</button>';
168
+ $html .= '</p>';
169
+
170
+ $html .= '<div class="itsec-site-scan__details hidden" id="' . esc_attr( $id ) . '">';
171
+ $html .= '<ul>';
172
+ $html .= $args['children'];
173
+ $html .= '</ul>';
174
+ $html .= '</div>';
175
+ }
176
+
177
+ $html .= '</div>';
178
+
179
+ return $html;
180
+ }
181
+
182
+ /**
183
+ * Should the site URL be showed.
184
+ *
185
+ * @param Scan $scan
186
+ *
187
+ * @return bool
188
+ */
189
+ private static function show_site_url( Scan $scan ) {
190
+ if ( ! $scan->get_url() ) {
191
+ return false;
192
+ }
193
+
194
+ $cleaned_scan = preg_replace( '/https?:\/\//', '', $scan->get_url() );
195
+ $cleaned_home = preg_replace( '/https?:\/\//', '', network_home_url() );
196
+
197
+ return $cleaned_scan !== $cleaned_home;
198
+ }
199
+ }
core/modules/site-scanner/util.php ADDED
@@ -0,0 +1,291 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class ITSEC_Site_Scanner_Util {
4
+
5
+ const GRANT = 'itsec-site-scanner-manage-scan';
6
+
7
+ /**
8
+ * Get the log code for a scan result.
9
+ *
10
+ * @param array|WP_Error $results
11
+ *
12
+ * @return string
13
+ */
14
+ public static function get_scan_result_code( $results ) {
15
+ if ( is_wp_error( $results ) ) {
16
+ if ( $results->get_error_message( 'itsec-temporary-server-error' ) ) {
17
+ return 'scan-failure-server-error';
18
+ }
19
+
20
+ return 'scan-failure-client-error';
21
+ }
22
+
23
+ $codes = array();
24
+
25
+ if ( ! empty( $results['entries']['malware'] ) ) {
26
+ $codes[] = 'found-malware';
27
+ }
28
+
29
+ if ( isset( $results['entries']['blacklist'] ) ) {
30
+ foreach ( $results['entries']['blacklist'] as $blacklist ) {
31
+ if ( 'blacklisted' === $blacklist['status'] ) {
32
+ $codes[] = 'on-blacklist';
33
+ break;
34
+ }
35
+ }
36
+ }
37
+
38
+ if ( ! empty( $results['entries']['vulnerabilities'] ) ) {
39
+ $codes[] = 'vulnerable-software';
40
+ }
41
+
42
+ if ( $codes ) {
43
+ if ( ! empty( $results['errors'] ) ) {
44
+ $codes[] = 'has-error';
45
+ }
46
+
47
+ return implode( '--', $codes );
48
+ }
49
+
50
+ if ( ! empty( $results['errors'] ) ) {
51
+ return 'error';
52
+ }
53
+
54
+ return 'clean';
55
+ }
56
+
57
+ public static function get_scan_code_description( $code ) {
58
+ switch ( $code ) {
59
+ case 'scan-failure-server-error':
60
+ case 'scan-failure-client-error':
61
+ case 'error':
62
+ return esc_html__( 'Scan Error', 'better-wp-security' );
63
+ case 'clean':
64
+ return esc_html__( 'Clean', 'better-wp-security' );
65
+ default:
66
+ return wp_sprintf( '%l', self::translate_findings_code( $code ) );
67
+ }
68
+ }
69
+
70
+ public static function translate_findings_code( $code ) {
71
+ $part_labels = array();
72
+
73
+ if ( is_string( $code ) ) {
74
+ $parts = explode( '--', $code );
75
+ } else {
76
+ $parts = $code;
77
+ }
78
+
79
+ foreach ( $parts as $part ) {
80
+ switch ( $part ) {
81
+ case 'found-malware':
82
+ $part_labels[] = esc_html__( 'Found Malware', 'better-wp-security' );
83
+ break;
84
+ case 'on-blacklist':
85
+ $part_labels[] = esc_html__( 'On Blocklist', 'better-wp-security' );
86
+ break;
87
+ case 'vulnerable-software':
88
+ $part_labels[] = esc_html__( 'Vulnerable Software', 'better-wp-security' );
89
+ break;
90
+ case 'has-error':
91
+ $part_labels[] = esc_html__( 'Scan Error', 'better-wp-security' );
92
+ break;
93
+ default:
94
+ $part_labels[] = $part;
95
+ break;
96
+ }
97
+ }
98
+
99
+ return $part_labels;
100
+ }
101
+
102
+ /**
103
+ * Is the given log item a valid scan result.
104
+ *
105
+ * @param array $entry
106
+ *
107
+ * @return true|WP_Error
108
+ */
109
+ public static function is_log_item_valid_scan( $entry ) {
110
+ if ( ! $entry ) {
111
+ return new \WP_Error( 'itsec_site_scanner_factory_log_not_found', __( 'Could not find a log item with that id.', 'better-wp-security' ) );
112
+ }
113
+
114
+ if ( 'site-scanner' !== $entry['module'] ) {
115
+ return new \WP_Error( 'itsec_site_scanner_factory_invalid_log_item', __( 'Log item does not belong to the Site Scanner module.', 'better-wp-security' ) );
116
+ }
117
+
118
+ if ( in_array( $entry['type'], [ 'process-start', 'process-update', 'process-stop' ], true ) ) {
119
+ return new \WP_Error( 'itsec_site_scanner_factory_invalid_log_item_type', __( 'Log item is of the incorrect type.', 'better-wp-security' ) );
120
+ }
121
+
122
+ return true;
123
+ }
124
+
125
+ /**
126
+ * Generates a muted issues auth token.
127
+ *
128
+ * @param WP_User|null $user
129
+ *
130
+ * @return string|WP_Error
131
+ */
132
+ public static function generate_scan_auth_token( WP_User $user = null ) {
133
+ $user = $user ?: wp_get_current_user();
134
+
135
+ $payload = [
136
+ 'nbf' => ITSEC_Core::get_current_time_gmt(),
137
+ 'iat' => ITSEC_Core::get_current_time_gmt(),
138
+ 'exp' => ITSEC_Core::get_current_time_gmt() + WEEK_IN_SECONDS,
139
+ 'grant' => self::GRANT,
140
+ 'user' => $user->ID,
141
+ ];
142
+
143
+ return ITSEC_Lib_JWT::encode( $payload, wp_salt() );
144
+ }
145
+
146
+ /**
147
+ * Validates the muted issues auth token.
148
+ *
149
+ * @param string $jwt The JWT
150
+ *
151
+ * @return WP_User|WP_Error
152
+ */
153
+ public static function validate_scan_auth_token( $jwt ) {
154
+ $decoded = ITSEC_Lib_JWT::decode( $jwt, wp_salt(), [ 'HS256' ] );
155
+
156
+ if ( is_wp_error( $decoded ) ) {
157
+ return $decoded;
158
+ }
159
+
160
+ if ( ! isset( $decoded->grant ) ) {
161
+ return new WP_Error( 'itsec_site_scanner_muted_auth_missing_grant', __( 'Malformed token.', 'better-wp-security' ) );
162
+ }
163
+
164
+ if ( $decoded->grant !== self::GRANT ) {
165
+ return new WP_Error( 'itsec_site_scanner_invalid_grant', __( 'Malformed token.', 'better-wp-security' ) );
166
+ }
167
+
168
+ if ( empty( $decoded->user ) ) {
169
+ return new WP_Error( 'itsec_site_scanner_muted_auth_missing_user', __( 'Malformed token.', 'better-wp-security' ) );
170
+ }
171
+
172
+ $user = get_userdata( $decoded->user );
173
+
174
+ if ( ! $user instanceof WP_User ) {
175
+ return new WP_Error( 'itsec_site_scanner_muted_auth_invalid_user', __( 'Malformed token.', 'better-wp-security' ) );
176
+ }
177
+
178
+ return $user;
179
+ }
180
+
181
+ /**
182
+ * Adds a URL parameter to give authentication for muted issues.
183
+ *
184
+ * @param string $link
185
+ * @param WP_User $user
186
+ *
187
+ * @return string
188
+ */
189
+ public static function authenticate_vulnerability_link( $link, WP_User $user = null ) {
190
+ $user = $user ?: wp_get_current_user();
191
+
192
+ if ( user_can( $user, ITSEC_Core::get_required_cap() ) ) {
193
+ $token = self::generate_scan_auth_token( $user );
194
+
195
+ if ( ! is_wp_error( $token ) ) {
196
+ $link = add_query_arg( 'token', rawurlencode( $token ), $link );
197
+ }
198
+ }
199
+
200
+ return $link;
201
+ }
202
+
203
+ /**
204
+ * Mutes an issue.
205
+ *
206
+ * @param string $issue_id
207
+ * @param array $args
208
+ *
209
+ * @return array|WP_Error
210
+ */
211
+ public static function mute_issue( $issue_id, array $args = [] ) {
212
+ if ( static::is_issue_muted( $issue_id ) ) {
213
+ return new \WP_Error( 'itsec_site_scanner_issue_already_muted', __( 'This issue has already been muted.', 'better-wp-security' ), array( 'status' => \WP_Http::BAD_REQUEST ) );
214
+ }
215
+
216
+ $issue = array_merge( [
217
+ 'id' => $issue_id,
218
+ 'muted_by' => get_current_user_id(),
219
+ 'muted_at' => ITSEC_Core::get_current_time_gmt(),
220
+ ], $args );
221
+ $issues = static::get_muted_issues();
222
+ $issues[] = $issue;
223
+
224
+ $updated = ITSEC_Modules::set_setting( 'site-scanner', 'muted_issues', $issues );
225
+ $error = ITSEC_Lib::updated_settings_to_wp_error( $updated );
226
+
227
+ if ( is_wp_error( $error ) ) {
228
+ return $error;
229
+ }
230
+
231
+ return $issue;
232
+ }
233
+
234
+ /**
235
+ * Is the given issue muted.
236
+ *
237
+ * @param string $issue_id
238
+ *
239
+ * @return bool
240
+ */
241
+ public static function is_issue_muted( $issue_id ) {
242
+ return (bool) static::get_muted_issue( $issue_id );
243
+ }
244
+
245
+ /**
246
+ * Unmute an issue.
247
+ *
248
+ * @param string $issue_id
249
+ *
250
+ * @return bool|WP_Error
251
+ */
252
+ public static function unmute_issue( $issue_id ) {
253
+ if ( ! static::is_issue_muted( $issue_id ) ) {
254
+ return new \WP_Error( 'itsec_site_scanner_issue_not_muted', __( 'This issue is not muted.', 'better-wp-security' ), array( 'status' => \WP_Http::BAD_REQUEST ) );
255
+ }
256
+
257
+ $issues = static::get_muted_issues();
258
+ $issues = wp_list_filter( $issues, [ 'id' => $issue_id ], 'NOT' );
259
+
260
+ $updated = ITSEC_Modules::set_setting( 'site-scanner', 'muted_issues', $issues );
261
+ $error = ITSEC_Lib::updated_settings_to_wp_error( $updated );
262
+
263
+ return is_wp_error( $error ) ? $error : true;
264
+ }
265
+
266
+ /**
267
+ * Get a muted issue.
268
+ *
269
+ * @param string $issue_id
270
+ *
271
+ * @return array|null
272
+ */
273
+ public static function get_muted_issue( $issue_id ) {
274
+ foreach ( static::get_muted_issues() as $issue ) {
275
+ if ( $issue['id'] === $issue_id ) {
276
+ return $issue;
277
+ }
278
+ }
279
+
280
+ return null;
281
+ }
282
+
283
+ /**
284
+ * Gets a list of all the muted issues.
285
+ *
286
+ * @return array[]
287
+ */
288
+ public static function get_muted_issues() {
289
+ return ITSEC_Modules::get_setting( 'site-scanner', 'muted_issues', [] );
290
+ }
291
+ }
core/modules/site-scanner/validator.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class ITSEC_Site_Scanner_Validator extends ITSEC_Validator {
4
+ public function get_id() {
5
+ return 'site-scanner';
6
+ }
7
+
8
+ protected function sanitize_settings() {
9
+ unset( $this->settings['public_key'], $this->settings['secret_key'] );
10
+
11
+ $this->sanitize_setting( 'array', 'vulnerabilities', __( 'Vulnerabilities', 'better-wp-security' ) );
12
+ $this->sanitize_setting( 'array', 'muted_issues', __( 'Muted Issues', 'better-wp-security' ) );
13
+ $this->sanitize_setting( 'cb-items:validate_muted_issue', 'muted_issues', __( 'Muted Issues', 'better-wp-security' ) );
14
+ }
15
+
16
+ protected function validate_muted_issue( $issue ) {
17
+ $schema = [
18
+ 'type' => 'object',
19
+ 'required' => [ 'id', 'muted_at', 'muted_by' ],
20
+ 'properties' => [
21
+ 'id' => [
22
+ 'type' => 'string',
23
+ ],
24
+ 'muted_at' => [
25
+ 'type' => 'integer',
26
+ 'minimum' => 0,
27
+ ],
28
+ 'muted_by' => [
29
+ 'type' => 'integer',
30
+ 'minimum' => 0,
31
+ ],
32
+ ],
33
+ 'additionalProperties' => false,
34
+ ];
35
+
36
+ $valid = rest_validate_value_from_schema( $issue, $schema );
37
+
38
+ if ( is_wp_error( $valid ) ) {
39
+ return $valid;
40
+ }
41
+
42
+ return rest_sanitize_value_from_schema( $issue, $schema );
43
+ }
44
+ }
45
+
46
+ ITSEC_Modules::register_validator( new ITSEC_Site_Scanner_Validator() );
core/modules/strong-passwords/class-itsec-strong-passwords.php CHANGED
@@ -25,6 +25,7 @@ final class ITSEC_Strong_Passwords implements Runnable {
25
  add_action( 'admin_enqueue_scripts', array( $this, 'add_scripts' ) );
26
  add_action( 'resetpass_form', array( $this, 'add_scripts_to_wp_login' ) );
27
  add_action( 'itsec_password_requirements_change_form', array( $this, 'add_scripts_to_wp_login' ) );
 
28
  }
29
 
30
  /**
@@ -98,6 +99,44 @@ final class ITSEC_Strong_Passwords implements Runnable {
98
  }
99
  }
100
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101
  /**
102
  * Provide the reason string displayed to users on the change password form.
103
  *
25
  add_action( 'admin_enqueue_scripts', array( $this, 'add_scripts' ) );
26
  add_action( 'resetpass_form', array( $this, 'add_scripts_to_wp_login' ) );
27
  add_action( 'itsec_password_requirements_change_form', array( $this, 'add_scripts_to_wp_login' ) );
28
+ add_filter( 'random_password', [ $this, 'make_random_password_strong' ], 10, 4 );
29
  }
30
 
31
  /**
99
  }
100
  }
101
 
102
+ /**
103
+ * Forces `wp_generate_password()` to generate a password that zxcvbn will treat as strong.
104
+ *
105
+ * WordPress uses a 24 character password length in its suggested passwords which isn't always long
106
+ * enough for zxcvbn to think is secure.
107
+ *
108
+ * @param string $password The generated password.
109
+ * @param int $length The length of password to generate.
110
+ * @param bool $special_chars Whether to include standard special characters.
111
+ * @param bool $extra_special_chars Whether to include other special characters.
112
+ *
113
+ * @return string
114
+ */
115
+ public function make_random_password_strong( $password, $length = 12, $special_chars = true, $extra_special_chars = false ) {
116
+ // We can't guarantee that the correct number of arguments will be passed to this filter.
117
+ // If we don't have the extra context, bail.
118
+ if ( func_num_args() <= 1 ) {
119
+ return $password;
120
+ }
121
+
122
+ if ( $length < 24 || ! $special_chars || ! ITSEC_Lib_Password_Requirements::is_requirement_enabled( 'strength' ) ) {
123
+ return $password;
124
+ }
125
+
126
+ remove_filter( 'random_password', [ $this, 'make_random_password_strong' ] );
127
+
128
+ $tries = 0;
129
+
130
+ while ( $tries < 10 && ITSEC_Lib::get_password_strength_results( $password )->score < 4 ) {
131
+ $password = wp_generate_password( $length, $special_chars, $extra_special_chars );
132
+ $tries++;
133
+ }
134
+
135
+ add_filter( 'random_password', [ $this, 'make_random_password_strong' ], 10, 4 );
136
+
137
+ return $password;
138
+ }
139
+
140
  /**
141
  * Provide the reason string displayed to users on the change password form.
142
  *
core/modules/sync-connect/class-itsec-sync-connect-interstitial.php CHANGED
@@ -110,7 +110,10 @@ class ITSEC_Sync_Connect_Interstitial extends ITSEC_Login_Interstitial {
110
  require_once( WP_PLUGIN_DIR . '/ithemes-sync/settings.php' );
111
  $GLOBALS['ithemes-sync-settings']->add_authentication( $response['site_id'], $response['username'], $response['key'], $user->user_login );
112
 
113
- ITSEC_Log::add_notice( 'sync_connect', 'successful_authentication::' . $user->ID, compact( 'post_data' ), compact( 'site_id' ) );
 
 
 
114
 
115
  wp_redirect( $this->sync_dashboard . $response['site_id'] );
116
  exit;
110
  require_once( WP_PLUGIN_DIR . '/ithemes-sync/settings.php' );
111
  $GLOBALS['ithemes-sync-settings']->add_authentication( $response['site_id'], $response['username'], $response['key'], $user->user_login );
112
 
113
+ ITSEC_Log::add_notice( 'sync_connect', 'successful_authentication::' . $user->ID, [
114
+ 'post_data' => $post_data,
115
+ 'site_id' => $response['site_id'],
116
+ ] );
117
 
118
  wp_redirect( $this->sync_dashboard . $response['site_id'] );
119
  exit;
core/package.json CHANGED
@@ -7,26 +7,26 @@
7
  "extends @wordpress/browserslist-config"
8
  ],
9
  "dependencies": {
10
- "@wordpress/a11y": "*",
11
- "@wordpress/api-fetch": "*",
12
- "@wordpress/autop": "*",
13
- "@wordpress/components": "*",
14
- "@wordpress/compose": "*",
15
- "@wordpress/data": "*",
16
- "@wordpress/date": "*",
17
- "@wordpress/dom-ready": "*",
18
- "@wordpress/element": "*",
19
- "@wordpress/hooks": "*",
20
- "@wordpress/html-entities": "*",
21
- "@wordpress/i18n": "*",
22
- "@wordpress/is-shallow-equal": "*",
23
- "@wordpress/keycodes": "*",
24
- "@wordpress/notices": "*",
25
- "@wordpress/plugins": "*",
26
- "@wordpress/redux-routine": "*",
27
- "@wordpress/rich-text": "*",
28
- "@wordpress/url": "*",
29
- "@wordpress/viewport": "*",
30
  "classnames": "^2.2.6",
31
  "contrast": "^1.0.1",
32
  "li": "^1.3.0",
@@ -34,8 +34,8 @@
34
  "memize": "^1.0.5",
35
  "react": "^16.6.3",
36
  "react-error-boundary": "^1.2.3",
37
- "react-grid-layout": "^0.16.6",
38
- "react-select": "^2.4.1",
39
  "react-transition-group": "^2.0.0",
40
  "recharts": "^1.5.0",
41
  "rememo": "^3.0.0",
@@ -43,18 +43,21 @@
43
  "uuid": "^3.3.3"
44
  },
45
  "devDependencies": {
46
- "@babel/core": "^7.3.3",
47
- "@babel/plugin-proposal-class-properties": "^7.3.3",
48
- "@babel/plugin-proposal-export-default-from": "^7.8.3",
49
- "@babel/plugin-syntax-dynamic-import": "^7.2.0",
50
- "@babel/plugin-transform-react-jsx": "^7.3.0",
51
- "@babel/runtime-corejs2": "^7.3.1",
52
- "@wordpress/babel-plugin-import-jsx-pragma": "^1.1.3",
53
- "@wordpress/babel-preset-default": "^3.0.2",
54
- "@wordpress/browserslist-config": "^2.2.3",
55
- "@wordpress/custom-templated-path-webpack-plugin": "^1.2.0",
56
- "@wordpress/jest-preset-default": "^3.0.0",
57
- "@wordpress/scripts": "^2.4.4",
 
 
 
58
  "acorn": "^6.0.5",
59
  "autoprefixer": "^9.4.7",
60
  "babel-loader": "^8.0.5",
@@ -113,6 +116,7 @@
113
  "test-unit:update": "npm run test-unit -- --updateSnapshot",
114
  "test-unit:watch": "npm run test-unit -- --watch",
115
  "watch": "./node_modules/.bin/webpack --watch",
 
116
  "test-up": "./bin/test-up.sh",
117
  "test-wpunit": "docker-compose exec -T -w /var/www/html/wp-content/plugins/ithemes-security-pro wordpress ./vendor/bin/codecept run wpunit",
118
  "test-acceptance": "docker-compose exec -T -w /var/www/html/wp-content/plugins/ithemes-security-pro wordpress ./vendor/bin/codecept run acceptance",
7
  "extends @wordpress/browserslist-config"
8
  ],
9
  "dependencies": {
10
+ "@wordpress/a11y": "^2.11.0",
11
+ "@wordpress/api-fetch": "^3.18.0",
12
+ "@wordpress/autop": "^2.9.0",
13
+ "@wordpress/components": "^10.0.1",
14
+ "@wordpress/compose": "^3.19.1",
15
+ "@wordpress/data": "^4.22.1",
16
+ "@wordpress/date": "^3.10.0",
17
+ "@wordpress/dom-ready": "^2.10.0",
18
+ "@wordpress/element": "^2.16.0",
19
+ "@wordpress/hooks": "^2.9.0",
20
+ "@wordpress/html-entities": "^2.8.0",
21
+ "@wordpress/i18n": "^3.14.0",
22
+ "@wordpress/is-shallow-equal": "^2.1.0",
23
+ "@wordpress/keycodes": "^2.14.0",
24
+ "@wordpress/notices": "^2.8.1",
25
+ "@wordpress/plugins": "^2.20.1",
26
+ "@wordpress/redux-routine": "^3.10.0",
27
+ "@wordpress/rich-text": "^3.20.1",
28
+ "@wordpress/url": "^2.17.0",
29
+ "@wordpress/viewport": "^2.21.1",
30
  "classnames": "^2.2.6",
31
  "contrast": "^1.0.1",
32
  "li": "^1.3.0",
34
  "memize": "^1.0.5",
35
  "react": "^16.6.3",
36
  "react-error-boundary": "^1.2.3",
37
+ "react-grid-layout": "^0.18.0",
38
+ "react-select": "^3.1.0",
39
  "react-transition-group": "^2.0.0",
40
  "recharts": "^1.5.0",
41
  "rememo": "^3.0.0",
43
  "uuid": "^3.3.3"
44
  },
45
  "devDependencies": {
46
+ "@babel/core": "^7.10.5",
47
+ "@babel/plugin-proposal-class-properties": "^7.10.4",
48
+ "@babel/plugin-proposal-export-default-from": "^7.10.4",
49
+ "@babel/plugin-syntax-dynamic-import": "^7.8.3",
50
+ "@babel/plugin-transform-react-jsx": "^7.10.0",
51
+ "@babel/runtime-corejs2": "^7.10.5",
52
+ "@emotion/core": "^10.0.28",
53
+ "@emotion/styled": "^10.0.27",
54
+ "@emotion/stylis": "^0.8.5",
55
+ "@wordpress/babel-plugin-import-jsx-pragma": "^2.7.0",
56
+ "@wordpress/babel-preset-default": "^4.17.0",
57
+ "@wordpress/browserslist-config": "^2.7.0",
58
+ "@wordpress/custom-templated-path-webpack-plugin": "^1.7.0",
59
+ "@wordpress/jest-preset-default": "^6.2.0",
60
+ "@wordpress/scripts": "^12.1.1",
61
  "acorn": "^6.0.5",
62
  "autoprefixer": "^9.4.7",
63
  "babel-loader": "^8.0.5",
116
  "test-unit:update": "npm run test-unit -- --updateSnapshot",
117
  "test-unit:watch": "npm run test-unit -- --watch",
118
  "watch": "./node_modules/.bin/webpack --watch",
119
+ "packages-update": "wp-scripts packages-update",
120
  "test-up": "./bin/test-up.sh",
121
  "test-wpunit": "docker-compose exec -T -w /var/www/html/wp-content/plugins/ithemes-security-pro wordpress ./vendor/bin/codecept run wpunit",
122
  "test-acceptance": "docker-compose exec -T -w /var/www/html/wp-content/plugins/ithemes-security-pro wordpress ./vendor/bin/codecept run acceptance",
core/packages/components/src/async-select/index.js CHANGED
@@ -13,7 +13,7 @@ import { __ } from '@wordpress/i18n';
13
  /**
14
  * Async dependencies
15
  */
16
- const Select = lazy( () => import( 'react-select/lib/Async' ) );
17
 
18
  function LoadError() {
19
  return ( <span>{ __( 'Error when loading. Please refresh.', 'better-wp-security' ) }</span> );
13
  /**
14
  * Async dependencies
15
  */
16
+ const Select = lazy( () => import( 'react-select/Async' ) );
17
 
18
  function LoadError() {
19
  return ( <span>{ __( 'Error when loading. Please refresh.', 'better-wp-security' ) }</span> );
core/packages/components/src/site-scan-results/blacklist-details.js DELETED
@@ -1,52 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { get } from 'lodash';
5
- import memize from 'memize';
6
-
7
- /**
8
- * WordPress dependencies
9
- */
10
- import { __, sprintf } from '@wordpress/i18n';
11
-
12
- /**
13
- * Internal dependencies
14
- */
15
- import WrappedSection from './wrapped-section';
16
- import Detail from './detail';
17
-
18
- const sortBlacklist = memize( ( blacklist ) => {
19
- return [ ...blacklist ].sort( ( a, b ) => {
20
- if ( a.status === 'blacklisted' && b.status !== 'blacklisted' ) {
21
- return -1;
22
- }
23
-
24
- if ( a.status !== 'blacklisted' && b.status === 'blacklisted' ) {
25
- return 1;
26
- }
27
-
28
- return 0;
29
- } );
30
- } );
31
-
32
- function BlacklistDetails( { results } ) {
33
- const blacklist = sortBlacklist( results.entries.blacklist );
34
- const status = get( blacklist, [ 0, 'status' ] ) === 'blacklisted' ? 'warn' : 'clean';
35
-
36
- return (
37
- <WrappedSection type="malware" status={ status } description={ __( 'Blacklist', 'better-wp-security' ) }>
38
- { blacklist.map( ( entry, i ) => (
39
- <Detail key={ i } status={ entry.status === 'blacklisted' ? 'warn' : 'clean' }>
40
- <a href={ entry.report_details }>
41
- { entry.status === 'blacklisted' ?
42
- sprintf( __( 'Domain blacklisted by %s', 'better-wp-security' ), entry.vendor.label ) :
43
- sprintf( __( 'Domain clean by %s', 'better-wp-security' ), entry.vendor.label )
44
- }
45
- </a>
46
- </Detail>
47
- ) ) }
48
- </WrappedSection>
49
- );
50
- }
51
-
52
- export default BlacklistDetails;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
core/packages/components/src/site-scan-results/entry.js ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { get, isArray } from 'lodash';
5
+
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+ import WrappedSection from './wrapped-section';
10
+ import Detail from './detail';
11
+
12
+ function Entry( { results, entry } ) {
13
+ let issues = get( results, [ '_embedded', 'ithemes-security:site-scan-issues', 0 ], [] );
14
+
15
+ if ( ! isArray( issues ) ) {
16
+ issues = [];
17
+ }
18
+
19
+ return (
20
+ <WrappedSection type="malware" status={ entry.status } description={ entry.title }>
21
+ { issues.filter( ( issue ) => issue.entry === entry.slug ).map( ( issue, i ) => (
22
+ <Detail key={ i } status={ issue.status }>
23
+ <a href={ issue.link }>{ issue.description }</a>
24
+ </Detail>
25
+ ) ) }
26
+ </WrappedSection>
27
+ );
28
+ }
29
+
30
+ export default Entry;
core/packages/components/src/site-scan-results/index.js CHANGED
@@ -7,27 +7,32 @@ import { Fragment } from '@wordpress/element';
7
  /**
8
  * Internal dependencies
9
  */
10
- import { isWPError } from '@ithemes/security-utils';
11
  import WPErrorDetails from './wp-error-details';
12
  import SystemErrorDetails from './system-error-details';
13
- import MalwareDetails from './malware-details';
14
- import BlacklistDetails from './blacklist-details';
15
- import KnownVulnerabilities from './known-vulnerabilities';
16
  import './style.scss';
17
 
18
  function SiteScanResults( { results, showSiteUrl = true, showErrorDetails = true } ) {
19
  const siteUrl = results.url;
 
 
 
 
 
 
 
20
 
21
  return (
22
  <div className="itsec-site-scan-results">
23
  { showSiteUrl && siteUrl && <h4>{ sprintf( __( 'Site: %s', 'better-wp-security' ), siteUrl ) }</h4> }
24
 
25
- { isWPError( results ) ? <WPErrorDetails results={ results } showErrorDetails={ showErrorDetails } /> : (
26
  <Fragment>
27
  <SystemErrorDetails results={ results } />
28
- <KnownVulnerabilities results={ results } />
29
- <MalwareDetails results={ results } />
30
- <BlacklistDetails results={ results } />
31
  </Fragment>
32
  ) }
33
  </div>
7
  /**
8
  * Internal dependencies
9
  */
10
+ import { castWPError, isWPError } from '@ithemes/security-utils';
11
  import WPErrorDetails from './wp-error-details';
12
  import SystemErrorDetails from './system-error-details';
13
+ import Entry from './entry';
 
 
14
  import './style.scss';
15
 
16
  function SiteScanResults( { results, showSiteUrl = true, showErrorDetails = true } ) {
17
  const siteUrl = results.url;
18
+ let error;
19
+
20
+ if ( isWPError( results ) ) {
21
+ error = castWPError( results );
22
+ } else if ( results.code === 'error' ) {
23
+ error = castWPError( results.errors[ 0 ] );
24
+ }
25
 
26
  return (
27
  <div className="itsec-site-scan-results">
28
  { showSiteUrl && siteUrl && <h4>{ sprintf( __( 'Site: %s', 'better-wp-security' ), siteUrl ) }</h4> }
29
 
30
+ { error ? <WPErrorDetails results={ error } showErrorDetails={ showErrorDetails } /> : (
31
  <Fragment>
32
  <SystemErrorDetails results={ results } />
33
+ { results.entries.map( ( entry, i ) => (
34
+ <Entry results={ results } entry={ entry } key={ i } />
35
+ ) ) }
36
  </Fragment>
37
  ) }
38
  </div>
core/packages/components/src/site-scan-results/known-vulnerabilities.js DELETED
@@ -1,30 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { __ } from '@wordpress/i18n';
5
-
6
- /**
7
- * Internal dependencies
8
- */
9
- import WrappedSection from './wrapped-section';
10
- import Detail from './detail';
11
-
12
- function KnownVulnerabilities( { results } ) {
13
- if ( ! results.entries.vulnerabilities.length ) {
14
- return <WrappedSection type="vulnerabilities" status="clean" description={ __( 'Known Vulnerabilities', 'better-wp-security' ) } />;
15
- }
16
-
17
- return (
18
- <WrappedSection type="vulnerabilities" status="warn" description={ __( 'Known Vulnerabilities', 'better-wp-security' ) }>
19
- { results.entries.vulnerabilities.map( ( entry, i ) => {
20
- return entry.issues.map( ( issue, j ) => (
21
- <Detail key={ `${ i }-${ j }` } status="warn">
22
- <a href={ entry.link } target={ '_blank' }>{ issue.title }</a>
23
- </Detail>
24
- ) );
25
- } ) }
26
- </WrappedSection>
27
- );
28
- }
29
-
30
- export default KnownVulnerabilities;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
core/packages/components/src/site-scan-results/malware-details.js DELETED
@@ -1,64 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { __, sprintf } from '@wordpress/i18n';
5
- import { Fragment } from '@wordpress/element';
6
-
7
- /**
8
- * Internal dependencies
9
- */
10
- import WrappedSection from './wrapped-section';
11
- import Detail from './detail';
12
-
13
- function MalwareDetails( { results } ) {
14
- if ( ! results.entries.malware.length ) {
15
- return <WrappedSection type="malware" status="clean" description={ __( 'Malware', 'better-wp-security' ) } />;
16
- }
17
-
18
- return (
19
- <WrappedSection type="malware" status="warn" description={ __( 'Malware', 'better-wp-security' ) }>
20
- { results.entries.malware.map( ( entry, i ) => {
21
- let location = entry.location;
22
- const message = entry.message,
23
- documentation = entry.documentation,
24
- payload = entry.payload,
25
- type = entry.type;
26
-
27
- if ( ! location.match( /https?:\/\// ) ) {
28
- location = false;
29
- }
30
-
31
- return (
32
- <Detail key={ i } status="warn">
33
- { message }
34
- { location && (
35
- <Fragment>
36
- <br />
37
- { __( 'Infected URL:', 'better-wp-security' ) }
38
- { location && <a href={ location } target="_blank" rel="noopener noreferrer">{ location }</a> }
39
- </Fragment>
40
- ) }
41
- { type.slug !== 'other' && (
42
- <Fragment>
43
- <br />
44
- { sprintf( __( 'Type: %s', 'better-wp-security' ), type.label ) }
45
- <br />
46
- { __( 'Documentation:', 'better-wp-security' ) }
47
- <a href={ documentation } target="_blank" rel="noopener noreferrer">{ documentation }</a>
48
- </Fragment>
49
- ) }
50
- { payload && (
51
- <Fragment>
52
- <br />
53
- { __( 'Payload:', 'better-wp-security' ) }
54
- <pre>{ payload }</pre>
55
- </Fragment>
56
- ) }
57
- </Detail>
58
- );
59
- } ) }
60
- </WrappedSection>
61
- );
62
- }
63
-
64
- export default MalwareDetails;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
core/packages/components/src/site-scan-results/wp-error-details.js CHANGED
@@ -8,10 +8,9 @@ import { Fragment } from '@wordpress/element';
8
  * Internal dependencies
9
  */
10
  import WrappedSection from './wrapped-section';
11
- import { castWPError } from '@ithemes/security-utils';
12
 
13
  function WPErrorDetails( { results, showErrorDetails = false } ) {
14
- const wpError = castWPError( results );
15
 
16
  return (
17
  <WrappedSection status="error" description={ __( 'The scan failed to properly scan the site.', 'better-wp-security' ) }>
8
  * Internal dependencies
9
  */
10
  import WrappedSection from './wrapped-section';
 
11
 
12
  function WPErrorDetails( { results, showErrorDetails = false } ) {
13
+ const wpError = results;
14
 
15
  return (
16
  <WrappedSection status="error" description={ __( 'The scan failed to properly scan the site.', 'better-wp-security' ) }>
core/packages/webpack/src/babel.js CHANGED
@@ -1,11 +1,6 @@
1
  module.exports = {
2
  presets: [ '@wordpress/default' ],
3
  plugins: [
4
- [ '@wordpress/babel-plugin-import-jsx-pragma', {
5
- scopeVariable: 'createElement',
6
- source: '@wordpress/element',
7
- isDefault: false,
8
- } ],
9
  [ '@babel/plugin-transform-react-jsx', {
10
  pragma: 'createElement',
11
  } ],
1
  module.exports = {
2
  presets: [ '@wordpress/default' ],
3
  plugins: [
 
 
 
 
 
4
  [ '@babel/plugin-transform-react-jsx', {
5
  pragma: 'createElement',
6
  } ],
core/rest.php CHANGED
@@ -7,6 +7,9 @@ class ITSEC_REST {
7
  add_filter( 'rest_namespace_index', array( $this, 'modify_index' ) );
8
  add_filter( 'rest_user_collection_params', [ $this, 'register_global_users_query' ] );
9
  add_filter( 'rest_user_query', [ $this, 'apply_global_users_query' ], 10, 2 );
 
 
 
10
  }
11
 
12
  /**
@@ -100,4 +103,36 @@ class ITSEC_REST {
100
 
101
  return $prepared_args;
102
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103
  }
7
  add_filter( 'rest_namespace_index', array( $this, 'modify_index' ) );
8
  add_filter( 'rest_user_collection_params', [ $this, 'register_global_users_query' ] );
9
  add_filter( 'rest_user_query', [ $this, 'apply_global_users_query' ], 10, 2 );
10
+ add_filter( 'rest_request_from_url', [ $this, 'retain_auth_header_from_embeds' ] );
11
+ add_filter( 'itsec_filter_apache_server_config_modification', [ $this, 'add_htaccess_authorization_header' ] );
12
+ add_filter( 'itsec_filter_litespeed_server_config_modification', [ $this, 'add_htaccess_authorization_header' ] );
13
  }
14
 
15
  /**
103
 
104
  return $prepared_args;
105
  }
106
+
107
+ /**
108
+ * Retain the authorization header when doing internal embed requests.
109
+ *
110
+ * @param WP_REST_Request $request
111
+ *
112
+ * @return WP_REST_Request
113
+ */
114
+ public function retain_auth_header_from_embeds( $request ) {
115
+ $headers = rest_get_server()->get_headers( $_SERVER );
116
+
117
+ if ( isset( $headers['AUTHORIZATION'] ) && 0 === strpos( $request->get_route(), '/ithemes-security/v1/' ) ) {
118
+ $request->add_header( 'Authorization', $headers['AUTHORIZATION'] );
119
+ }
120
+
121
+ return $request;
122
+ }
123
+
124
+ public function add_htaccess_authorization_header( $rules ) {
125
+ $rules .= "\n";
126
+ $rules .= "\t# " . __( 'Pass through Authorization header.', 'better-wp-security' ) . "\n";
127
+ $rules .= <<<'APACHE'
128
+ <IfModule mod_rewrite.c>
129
+ RewriteEngine On
130
+ RewriteCond %{HTTP:Authorization} ^(.*)
131
+ RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
132
+ </IfModule>
133
+ APACHE;
134
+ $rules .= "\n";
135
+
136
+ return $rules;
137
+ }
138
  }
core/setup.php CHANGED
@@ -203,6 +203,10 @@ final class ITSEC_Setup {
203
  ITSEC_Lib::schedule_cron_test();
204
  }
205
 
 
 
 
 
206
  if ( null === get_site_option( 'itsec-enable-grade-report', null ) ) {
207
  update_site_option( 'itsec-enable-grade-report', ITSEC_Modules::get_setting( 'global', 'enable_grade_report' ) );
208
  }
203
  ITSEC_Lib::schedule_cron_test();
204
  }
205
 
206
+ if ( $build < 4119 ) {
207
+ ITSEC_Files::regenerate_server_config( false );
208
+ }
209
+
210
  if ( null === get_site_option( 'itsec-enable-grade-report', null ) ) {
211
  update_site_option( 'itsec-enable-grade-report', ITSEC_Modules::get_setting( 'global', 'enable_grade_report' ) );
212
  }
dist/8.min.js CHANGED
@@ -1 +1 @@
1
- (window.itsecWebpackJsonP=window.itsecWebpackJsonP||[]).push([[8],{"+8qv":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.css=void 0;var r,o=(r=n("cDcd"))&&r.__esModule?r:{default:r},u=n("PAeb");function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}t.css=function(e){var t=e.isDisabled,n=e.theme,r=n.spacing,o=n.colors;return{color:t?o.neutral40:o.neutral80,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2,maxWidth:"calc(100% - ".concat(2*r.baseUnit,"px)"),overflow:"hidden",position:"absolute",textOverflow:"ellipsis",whiteSpace:"nowrap",top:"50%",transform:"translateY(-50%)"}};var a=function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles,s=e.isDisabled,l=e.innerProps;return o.default.createElement("div",i({className:r((0,u.css)(a("singleValue",e)),{"single-value":!0,"single-value--is-disabled":s},n)},l),t)};t.default=a},"+URl":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LoadingIndicator=t.loadingIndicatorCSS=t.IndicatorSeparator=t.indicatorSeparatorCSS=t.ClearIndicator=t.clearIndicatorCSS=t.DropdownIndicator=t.dropdownIndicatorCSS=t.DownChevron=t.CrossIcon=void 0;var r,o=(r=n("cDcd"))&&r.__esModule?r:{default:r},u=n("PAeb");function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function a(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},u=Object.keys(e);for(r=0;r<u.length;r++)n=u[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(r=0;r<u.length;r++)n=u[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var s=function(e){var t=e.size,n=a(e,["size"]);return o.default.createElement("svg",i({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",className:(0,u.css)({display:"inline-block",fill:"currentColor",lineHeight:1,stroke:"currentColor",strokeWidth:0})},n))},l=function(e){return o.default.createElement(s,i({size:20},e),o.default.createElement("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))};t.CrossIcon=l;var c=function(e){return o.default.createElement(s,i({size:20},e),o.default.createElement("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))};t.DownChevron=c;var p=function(e){var t=e.isFocused,n=e.theme,r=n.spacing.baseUnit,o=n.colors;return{color:t?o.neutral60:o.neutral20,display:"flex",padding:2*r,transition:"color 150ms",":hover":{color:t?o.neutral80:o.neutral40}}},f=p;t.dropdownIndicatorCSS=f;t.DropdownIndicator=function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles,s=e.innerProps;return o.default.createElement("div",i({},s,{className:r((0,u.css)(a("dropdownIndicator",e)),{indicator:!0,"dropdown-indicator":!0},n)}),t||o.default.createElement(c,null))};var d=p;t.clearIndicatorCSS=d;t.ClearIndicator=function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles,s=e.innerProps;return o.default.createElement("div",i({},s,{className:r((0,u.css)(a("clearIndicator",e)),{indicator:!0,"clear-indicator":!0},n)}),t||o.default.createElement(l,null))};t.indicatorSeparatorCSS=function(e){var t=e.isDisabled,n=e.theme,r=n.spacing.baseUnit,o=n.colors;return{alignSelf:"stretch",backgroundColor:t?o.neutral10:o.neutral20,marginBottom:2*r,marginTop:2*r,width:1}};t.IndicatorSeparator=function(e){var t=e.className,n=e.cx,r=e.getStyles,a=e.innerProps;return o.default.createElement("span",i({},a,{className:n((0,u.css)(r("indicatorSeparator",e)),{"indicator-separator":!0},t)}))};var h=!1;t.loadingIndicatorCSS=function(e){var t=e.isFocused,n=e.size,r=e.theme,o=r.colors,u=r.spacing.baseUnit;return{color:t?o.neutral60:o.neutral20,display:"flex",padding:2*u,transition:"color 150ms",alignSelf:"center",fontSize:n,lineHeight:1,marginRight:n,textAlign:"center",verticalAlign:"middle"}};var b=function(e){var t=e.color,n=e.delay,r=e.offset;return o.default.createElement("span",{className:(0,u.css)({animationDuration:"1s",animationDelay:"".concat(n,"ms"),animationIterationCount:"infinite",animationName:"react-select-loading-indicator",animationTimingFunction:"ease-in-out",backgroundColor:t,borderRadius:"1em",display:"inline-block",marginLeft:r?"1em":null,height:"1em",verticalAlign:"top",width:"1em"})})},m=function(e){var t=e.className,n=e.cx,r=e.getStyles,a=e.innerProps,s=e.isFocused,l=e.isRtl,c=e.theme.colors,p=s?c.neutral80:c.neutral20;return h||((0,u.injectGlobal)("@keyframes ","react-select-loading-indicator","{0%,80%,100%{opacity:0;}40%{opacity:1;}};"),h=!0),o.default.createElement("div",i({},a,{className:n((0,u.css)(r("loadingIndicator",e)),{indicator:!0,"loading-indicator":!0},t)}),o.default.createElement(b,{color:p,delay:0,offset:l}),o.default.createElement(b,{color:p,delay:160,offset:!0}),o.default.createElement(b,{color:p,delay:320,offset:!l}))};t.LoadingIndicator=m,m.defaultProps={size:4}},"/+00":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=(r=n("cDcd"))&&r.__esModule?r:{default:r},u=n("PAeb");function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var a=function(e){return o.default.createElement("span",i({className:(0,u.css)({zIndex:9999,border:0,clip:"rect(1px, 1px, 1px, 1px)",height:1,width:1,position:"absolute",overflow:"hidden",padding:0,whiteSpace:"nowrap",backgroundColor:"red",color:"blue"})},e))};t.default=a},"2cv3":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IndicatorsContainer=t.indicatorsContainerCSS=t.ValueContainer=t.valueContainerCSS=t.SelectContainer=t.containerCSS=void 0;var r=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,n):{};r.get||r.set?Object.defineProperty(t,n,r):t[n]=e[n]}return t.default=e,t}(n("cDcd")),o=n("PAeb");function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e,t){return!t||"object"!==u(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(){return(c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}t.containerCSS=function(e){var t=e.isDisabled;return{direction:e.isRtl?"rtl":null,pointerEvents:t?"none":null,position:"relative"}};t.SelectContainer=function(e){var t=e.children,n=e.className,u=e.cx,i=e.getStyles,a=e.innerProps,s=e.isDisabled,l=e.isRtl;return r.default.createElement("div",c({className:u((0,o.css)(i("container",e)),{"--is-disabled":s,"--is-rtl":l},n)},a),t)};t.valueContainerCSS=function(e){var t=e.theme.spacing;return{alignItems:"center",display:"flex",flex:1,flexWrap:"wrap",padding:"".concat(t.baseUnit/2,"px ").concat(2*t.baseUnit,"px"),WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"}};var p=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a(this,s(t).apply(this,arguments))}var n,u,c;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(t,r.Component),n=t,(u=[{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,u=e.cx,i=e.isMulti,a=e.getStyles,s=e.hasValue;return r.default.createElement("div",{className:u((0,o.css)(a("valueContainer",this.props)),{"value-container":!0,"value-container--is-multi":i,"value-container--has-value":s},n)},t)}}])&&i(n.prototype,u),c&&i(n,c),t}();t.ValueContainer=p;t.indicatorsContainerCSS=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}};t.IndicatorsContainer=function(e){var t=e.children,n=e.className,u=e.cx,i=e.getStyles;return r.default.createElement("div",{className:u((0,o.css)(i("indicatorsContainer",e)),{indicators:!0},n)},t)}},"3lEq":function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){try{return function e(t,n){if(t===n)return!0;if(t&&n&&"object"==r(t)&&"object"==r(n)){var a,s,l,c=o(t),p=o(n);if(c&&p){if((s=t.length)!=n.length)return!1;for(a=s;0!=a--;)if(!e(t[a],n[a]))return!1;return!0}if(c!=p)return!1;var f=t instanceof Date,d=n instanceof Date;if(f!=d)return!1;if(f&&d)return t.getTime()==n.getTime();var h=t instanceof RegExp,b=n instanceof RegExp;if(h!=b)return!1;if(h&&b)return t.toString()==n.toString();var m=u(t);if((s=m.length)!==u(n).length)return!1;for(a=s;0!=a--;)if(!i.call(n,m[a]))return!1;for(a=s;0!=a--;)if(!("_owner"===(l=m[a])&&t.$$typeof||e(t[l],n[l])))return!1;return!0}return t!=t&&n!=n}(e,t)}catch(e){if(e.message&&e.message.match(/stack|recursion/i))return console.warn("Warning: react-fast-compare does not handle circular references.",e.name,e.message),!1;throw e}};var o=Array.isArray,u=Object.keys,i=Object.prototype.hasOwnProperty},"59S1":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resultsAriaMessage=t.optionFocusAriaMessage=t.valueFocusAriaMessage=t.valueEventAriaMessage=t.instructionsAriaMessage=void 0;t.instructionsAriaMessage=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.isSearchable,r=t.isMulti,o=t.label;switch(e){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu, press Tab to select the option and exit the menu.";case"input":return"".concat(o||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(r?" press left to focus selected values":"");case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value"}};t.valueEventAriaMessage=function(e,t){var n=t.value;if(n)switch(e){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(n,", deselected.");case"select-option":return"option ".concat(n,", selected.")}};t.valueFocusAriaMessage=function(e){var t=e.focusedValue,n=e.getOptionLabel,r=e.selectValue;return"value ".concat(n(t)," focused, ").concat(r.indexOf(t)+1," of ").concat(r.length,".")};t.optionFocusAriaMessage=function(e){var t=e.focusedOption,n=e.getOptionLabel,r=e.options;return"option ".concat(n(t)," focused, ").concat(r.indexOf(t)+1," of ").concat(r.length,".")};t.resultsAriaMessage=function(e){var t=e.inputValue,n=e.screenReaderMessage;return"".concat(n).concat(t?" for search term "+t:"",".")}},"5bE3":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultComponents=t.components=void 0;var r=n("2cv3"),o=n("+URl"),u=h(n("rc6b")),i=d(n("n929")),a=h(n("KIQE")),s=d(n("Avrx")),l=d(n("lQ6M")),c=h(n("SrCC")),p=h(n("BCie")),f=h(n("+8qv"));function d(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,n):{};r.get||r.set?Object.defineProperty(t,n,r):t[n]=e[n]}return t.default=e,t}function h(e){return e&&e.__esModule?e:{default:e}}function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var m={ClearIndicator:o.ClearIndicator,Control:u.default,DropdownIndicator:o.DropdownIndicator,DownChevron:o.DownChevron,CrossIcon:o.CrossIcon,Group:i.default,GroupHeading:i.GroupHeading,IndicatorsContainer:r.IndicatorsContainer,IndicatorSeparator:o.IndicatorSeparator,Input:a.default,LoadingIndicator:o.LoadingIndicator,Menu:s.default,MenuList:s.MenuList,MenuPortal:s.MenuPortal,LoadingMessage:s.LoadingMessage,NoOptionsMessage:s.NoOptionsMessage,MultiValue:l.default,MultiValueContainer:l.MultiValueContainer,MultiValueLabel:l.MultiValueLabel,MultiValueRemove:l.MultiValueRemove,Option:c.default,Placeholder:p.default,SelectContainer:r.SelectContainer,SingleValue:f.default,ValueContainer:r.ValueContainer};t.components=m;t.defaultComponents=function(e){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){b(e,t,n[t])})}return e}({},m,e.components)}},"8oxB":function(e,t){var n,r,o=e.exports={};function u(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===u||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:u}catch(e){n=u}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(e){r=i}}();var s,l=[],c=!1,p=-1;function f(){c&&s&&(c=!1,s.length?l=s.concat(l):p=-1,l.length&&d())}function d(){if(!c){var e=a(f);c=!0;for(var t=l.length;t;){for(s=l,l=[];++p<t;)s&&s[p].run();p=-1,t=l.length}s=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===i||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function b(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new h(e,t)),1!==l.length||c||a(d)},h.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=b,o.addListener=b,o.once=b,o.off=b,o.removeListener=b,o.removeAllListeners=b,o.emit=b,o.prependListener=b,o.prependOnceListener=b,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},Avrx:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getMenuPlacement=O,t.MenuPortal=t.menuPortalCSS=t.LoadingMessage=t.NoOptionsMessage=t.loadingMessageCSS=t.noOptionsMessageCSS=t.MenuList=t.menuListCSS=t.default=t.MenuPlacer=t.menuCSS=void 0;var r,o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,n):{};r.get||r.set?Object.defineProperty(t,n,r):t[n]=e[n]}return t.default=e,t}(n("cDcd")),u=n("PAeb"),i=n("faye"),a=(r=n("17x9"))&&r.__esModule?r:{default:r},s=n("b+PA");function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(){return(c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function d(e,t,n){return t&&f(e.prototype,t),n&&f(e,n),e}function h(e,t){return!t||"object"!==l(t)&&"function"!=typeof t?g(e):t}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function m(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&v(e,t)}function v(e,t){return(v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function g(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function O(e){var t=e.maxHeight,n=e.menuEl,r=e.minHeight,o=e.placement,u=e.shouldScroll,i=e.isFixedPosition,a=e.theme.spacing,l=(0,s.getScrollParent)(n),c={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return c;var p=l.getBoundingClientRect().height,f=n.getBoundingClientRect(),d=f.bottom,h=f.height,b=f.top,m=n.offsetParent.getBoundingClientRect().top,v=window.innerHeight,g=(0,s.getScrollTop)(l),y=parseInt(getComputedStyle(n).marginBottom,10),O=parseInt(getComputedStyle(n).marginTop,10),E=m-O,S=v-b,C=E+g,w=p-g-b,P=d-v+g+y,A=g+b-O;switch(o){case"auto":case"bottom":if(S>=h)return{placement:"bottom",maxHeight:t};if(w>=h&&!i)return u&&(0,s.animatedScrollTo)(l,P,160),{placement:"bottom",maxHeight:t};if(!i&&w>=r||i&&S>=r)return u&&(0,s.animatedScrollTo)(l,P,160),{placement:"bottom",maxHeight:i?S-y:w-y};if("auto"===o||i){var j=t,D=i?E:C;return D>=r&&(j=Math.min(D-y-a.controlHeight,t)),{placement:"top",maxHeight:j}}if("bottom"===o)return(0,s.scrollTo)(l,P),{placement:"bottom",maxHeight:t};break;case"top":if(E>=h)return{placement:"top",maxHeight:t};if(C>=h&&!i)return u&&(0,s.animatedScrollTo)(l,A,160),{placement:"top",maxHeight:t};if(!i&&C>=r||i&&E>=r){var M=t;return(!i&&C>=r||i&&E>=r)&&(M=i?E-O:C-O),u&&(0,s.animatedScrollTo)(l,A,160),{placement:"top",maxHeight:M}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(o,'".'))}return c}var E=function(e){return"auto"===e?"bottom":e};t.menuCSS=function(e){var t,n=e.placement,r=e.theme,o=r.borderRadius,u=r.spacing,i=r.colors;return y(t={},function(e){return e?{bottom:"top",top:"bottom"}[e]:"bottom"}(n),"100%"),y(t,"backgroundColor",i.neutral0),y(t,"borderRadius",o),y(t,"boxShadow","0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)"),y(t,"marginBottom",u.menuGutter),y(t,"marginTop",u.menuGutter),y(t,"position","absolute"),y(t,"width","100%"),y(t,"zIndex",1),t};var S=function(e){function t(){var e,n;p(this,t);for(var r=arguments.length,o=new Array(r),u=0;u<r;u++)o[u]=arguments[u];return y(g(g(n=h(this,(e=b(t)).call.apply(e,[this].concat(o))))),"state",{maxHeight:n.props.maxMenuHeight,placement:null}),y(g(g(n)),"getPlacement",function(e){var t=n.props,r=t.minMenuHeight,o=t.maxMenuHeight,u=t.menuPlacement,i=t.menuPosition,a=t.menuShouldScrollIntoView,s=t.theme,l=n.context.getPortalPlacement;if(e){var c="fixed"===i,p=O({maxHeight:o,menuEl:e,minHeight:r,placement:u,shouldScroll:a&&!c,isFixedPosition:c,theme:s});l&&l(p),n.setState(p)}}),y(g(g(n)),"getUpdatedProps",function(){var e=n.props.menuPlacement,t=n.state.placement||E(e);return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){y(e,t,n[t])})}return e}({},n.props,{placement:t,maxHeight:n.state.maxHeight})}),n}return m(t,o.Component),d(t,[{key:"render",value:function(){return(0,this.props.children)({ref:this.getPlacement,placerProps:this.getUpdatedProps()})}}]),t}();t.MenuPlacer=S,y(S,"contextTypes",{getPortalPlacement:a.default.func});var C=function(e){var t=e.children,n=e.className,r=e.cx,i=e.getStyles,a=e.innerRef,s=e.innerProps,l=r((0,u.css)(i("menu",e)),{menu:!0},n);return o.default.createElement("div",c({className:l},s,{ref:a}),t)};t.default=C;t.menuListCSS=function(e){var t=e.maxHeight,n=e.theme.spacing.baseUnit;return{maxHeight:t,overflowY:"auto",paddingBottom:n,paddingTop:n,position:"relative",WebkitOverflowScrolling:"touch"}};t.MenuList=function(e){var t=e.children,n=e.className,r=e.cx,i=e.getStyles,a=e.isMulti,s=e.innerRef;return o.default.createElement("div",{className:r((0,u.css)(i("menuList",e)),{"menu-list":!0,"menu-list--is-multi":a},n),ref:s},t)};var w=function(e){var t=e.theme,n=t.spacing.baseUnit;return{color:t.colors.neutral40,padding:"".concat(2*n,"px ").concat(3*n,"px"),textAlign:"center"}},P=w;t.noOptionsMessageCSS=P;var A=w;t.loadingMessageCSS=A;var j=function(e){var t=e.children,n=e.className,r=e.cx,i=e.getStyles,a=e.innerProps;return o.default.createElement("div",c({className:r((0,u.css)(i("noOptionsMessage",e)),{"menu-notice":!0,"menu-notice--no-options":!0},n)},a),t)};t.NoOptionsMessage=j,j.defaultProps={children:"No options"};var D=function(e){var t=e.children,n=e.className,r=e.cx,i=e.getStyles,a=e.innerProps;return o.default.createElement("div",c({className:r((0,u.css)(i("loadingMessage",e)),{"menu-notice":!0,"menu-notice--loading":!0},n)},a),t)};t.LoadingMessage=D,D.defaultProps={children:"Loading..."};t.menuPortalCSS=function(e){var t=e.rect,n=e.offset,r=e.position;return{left:t.left,position:r,top:n,width:t.width,zIndex:1}};var M=function(e){function t(){var e,n;p(this,t);for(var r=arguments.length,o=new Array(r),u=0;u<r;u++)o[u]=arguments[u];return y(g(g(n=h(this,(e=b(t)).call.apply(e,[this].concat(o))))),"state",{placement:null}),y(g(g(n)),"getPortalPlacement",function(e){var t=e.placement;t!==E(n.props.menuPlacement)&&n.setState({placement:t})}),n}return m(t,o.Component),d(t,[{key:"getChildContext",value:function(){return{getPortalPlacement:this.getPortalPlacement}}},{key:"render",value:function(){var e=this.props,t=e.appendTo,n=e.children,r=e.controlElement,a=e.menuPlacement,l=e.menuPosition,c=e.getStyles,p="fixed"===l;if(!t&&!p||!r)return null;var f=this.state.placement||E(a),d=(0,s.getBoundingClientObj)(r),h=p?0:window.pageYOffset,b={offset:d[f]+h,position:l,rect:d},m=o.default.createElement("div",{className:(0,u.css)(c("menuPortal",b))},n);return t?(0,i.createPortal)(m,t):m}}]),t}();t.MenuPortal=M,y(M,"childContextTypes",{getPortalPlacement:a.default.func})},BCie:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.placeholderCSS=void 0;var r,o=(r=n("cDcd"))&&r.__esModule?r:{default:r},u=n("PAeb");function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}t.placeholderCSS=function(e){var t=e.theme,n=t.spacing;return{color:t.colors.neutral50,marginLeft:n.baseUnit/2,marginRight:n.baseUnit/2,position:"absolute",top:"50%",transform:"translateY(-50%)"}};var a=function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles,s=e.innerProps;return o.default.createElement("div",i({className:r((0,u.css)(a("placeholder",e)),{placeholder:!0},n)},s),t)};t.default=a},CXKz:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n("cDcd"),o=n("GlKT"),u=n("SHH1");function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var f=!("undefined"==typeof window||!window.document||!window.document.createElement),d=0,h=function(e){function t(){var e,n,r,o;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var u=arguments.length,a=new Array(u),l=0;l<u;l++)a[l]=arguments[l];return r=this,n=!(o=(e=s(t)).call.apply(e,[this].concat(a)))||"object"!==i(o)&&"function"!=typeof o?c(r):o,p(c(c(n)),"originalStyles",{}),p(c(c(n)),"listenerOptions",{capture:!1,passive:!1}),n}var n,h,b;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(t,r.Component),n=t,(h=[{key:"componentDidMount",value:function(){var e=this;if(f){var t=this.props,n=t.accountForScrollbars,r=t.touchScrollTarget,i=document.body,a=i&&i.style;if(n&&o.STYLE_KEYS.forEach(function(t){var n=a&&a[t];e.originalStyles[t]=n}),n&&d<1){var s=parseInt(this.originalStyles.paddingRight,10)||0,l=document.body?document.body.clientWidth:0,c=window.innerWidth-l+s||0;Object.keys(o.LOCK_STYLES).forEach(function(e){var t=o.LOCK_STYLES[e];a&&(a[e]=t)}),a&&(a.paddingRight="".concat(c,"px"))}i&&(0,u.isTouchDevice)()&&(i.addEventListener("touchmove",u.preventTouchMove,this.listenerOptions),r&&(r.addEventListener("touchstart",u.preventInertiaScroll,this.listenerOptions),r.addEventListener("touchmove",u.allowTouchMove,this.listenerOptions))),d+=1}}},{key:"componentWillUnmount",value:function(){var e=this;if(f){var t=this.props,n=t.accountForScrollbars,r=t.touchScrollTarget,i=document.body,a=i&&i.style;d=Math.max(d-1,0),n&&d<1&&o.STYLE_KEYS.forEach(function(t){var n=e.originalStyles[t];a&&(a[t]=n)}),i&&(0,u.isTouchDevice)()&&(i.removeEventListener("touchmove",u.preventTouchMove,this.listenerOptions),r&&(r.removeEventListener("touchstart",u.preventInertiaScroll,this.listenerOptions),r.removeEventListener("touchmove",u.allowTouchMove,this.listenerOptions)))}}},{key:"render",value:function(){return null}}])&&a(n.prototype,h),b&&a(n,b),t}();t.default=h,p(h,"defaultProps",{accountForScrollbars:!0})},FUBA:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n("cDcd"),i=s(u),a=s(n("17x9"));function s(e){return e&&e.__esModule?e:{default:e}}var l={position:"absolute",top:0,left:0,visibility:"hidden",height:0,overflow:"scroll",whiteSpace:"pre"},c=["extraWidth","injectStyles","inputClassName","inputRef","inputStyle","minWidth","onAutosize","placeholderIsMinWidth"],p=function(e,t){t.style.fontSize=e.fontSize,t.style.fontFamily=e.fontFamily,t.style.fontWeight=e.fontWeight,t.style.fontStyle=e.fontStyle,t.style.letterSpacing=e.letterSpacing,t.style.textTransform=e.textTransform},f=!("undefined"==typeof window||!window.navigator)&&/MSIE |Trident\/|Edge\//.test(window.navigator.userAgent),d=function(){return f?"_"+Math.random().toString(36).substr(2,12):void 0},h=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.inputRef=function(e){n.input=e,"function"==typeof n.props.inputRef&&n.props.inputRef(e)},n.placeHolderSizerRef=function(e){n.placeHolderSizer=e},n.sizerRef=function(e){n.sizer=e},n.state={inputWidth:e.minWidth,inputId:e.id||d()},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,u.Component),o(t,[{key:"componentDidMount",value:function(){this.mounted=!0,this.copyInputStyles(),this.updateInputWidth()}},{key:"componentWillReceiveProps",value:function(e){var t=e.id;t!==this.props.id&&this.setState({inputId:t||d()})}},{key:"componentDidUpdate",value:function(e,t){t.inputWidth!==this.state.inputWidth&&"function"==typeof this.props.onAutosize&&this.props.onAutosize(this.state.inputWidth),this.updateInputWidth()}},{key:"componentWillUnmount",value:function(){this.mounted=!1}},{key:"copyInputStyles",value:function(){if(this.mounted&&window.getComputedStyle){var e=this.input&&window.getComputedStyle(this.input);e&&(p(e,this.sizer),this.placeHolderSizer&&p(e,this.placeHolderSizer))}}},{key:"updateInputWidth",value:function(){if(this.mounted&&this.sizer&&void 0!==this.sizer.scrollWidth){var e=void 0;e=this.props.placeholder&&(!this.props.value||this.props.value&&this.props.placeholderIsMinWidth)?Math.max(this.sizer.scrollWidth,this.placeHolderSizer.scrollWidth)+2:this.sizer.scrollWidth+2,(e+="number"===this.props.type&&void 0===this.props.extraWidth?16:parseInt(this.props.extraWidth)||0)<this.props.minWidth&&(e=this.props.minWidth),e!==this.state.inputWidth&&this.setState({inputWidth:e})}}},{key:"getInput",value:function(){return this.input}},{key:"focus",value:function(){this.input.focus()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"renderStyles",value:function(){var e=this.props.injectStyles;return f&&e?i.default.createElement("style",{dangerouslySetInnerHTML:{__html:"input#"+this.state.inputId+"::-ms-clear {display: none;}"}}):null}},{key:"render",value:function(){var e=[this.props.defaultValue,this.props.value,""].reduce(function(e,t){return null!=e?e:t}),t=r({},this.props.style);t.display||(t.display="inline-block");var n=r({boxSizing:"content-box",width:this.state.inputWidth+"px"},this.props.inputStyle),o=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(this.props,[]);return function(e){c.forEach(function(t){return delete e[t]})}(o),o.className=this.props.inputClassName,o.id=this.state.inputId,o.style=n,i.default.createElement("div",{className:this.props.className,style:t},this.renderStyles(),i.default.createElement("input",r({},o,{ref:this.inputRef})),i.default.createElement("div",{ref:this.sizerRef,style:l},e),this.props.placeholder?i.default.createElement("div",{ref:this.placeHolderSizerRef,style:l},this.props.placeholder):null)}}]),t}();h.propTypes={className:a.default.string,defaultValue:a.default.any,extraWidth:a.default.oneOfType([a.default.number,a.default.string]),id:a.default.string,injectStyles:a.default.bool,inputClassName:a.default.string,inputRef:a.default.func,inputStyle:a.default.object,minWidth:a.default.oneOfType([a.default.number,a.default.string]),onAutosize:a.default.func,onChange:a.default.func,placeholder:a.default.string,placeholderIsMinWidth:a.default.bool,style:a.default.object,value:a.default.any},h.defaultProps={minWidth:1,injectStyles:!0},t.default=h},GlKT:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LOCK_STYLES=t.STYLE_KEYS=void 0;t.STYLE_KEYS=["boxSizing","height","overflow","paddingRight","position"];t.LOCK_STYLES={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"}},H0AD:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.makeAsyncSelect=t.defaultProps=void 0;var r=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,n):{};r.get||r.set?Object.defineProperty(t,n,r):t[n]=e[n]}return t.default=e,t}(n("cDcd")),o=a(n("jMYa")),u=n("b+PA"),i=a(n("oUUL"));function a(e){return e&&e.__esModule?e:{default:e}}function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(){return(l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function c(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},u=Object.keys(e);for(r=0;r<u.length;r++)n=u[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(r=0;r<u.length;r++)n=u[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var m={cacheOptions:!1,defaultOptions:!1,filterOption:null};t.defaultProps=m;var v=function(e){var t,n;return n=t=function(t){function n(e){var t,r,o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),r=this,o=f(n).call(this),t=!o||"object"!==s(o)&&"function"!=typeof o?h(r):o,b(h(h(t)),"select",void 0),b(h(h(t)),"lastRequest",void 0),b(h(h(t)),"mounted",!1),b(h(h(t)),"optionsCache",{}),b(h(h(t)),"handleInputChange",function(e,n){var r=t.props,o=r.cacheOptions,i=r.onInputChange,a=(0,u.handleInputChange)(e,n,i);if(!a)return delete t.lastRequest,void t.setState({inputValue:"",loadedInputValue:"",loadedOptions:[],isLoading:!1,passEmptyOptions:!1});if(o&&t.optionsCache[a])t.setState({inputValue:a,loadedInputValue:a,loadedOptions:t.optionsCache[a],isLoading:!1,passEmptyOptions:!1});else{var s=t.lastRequest={};t.setState({inputValue:a,isLoading:!0,passEmptyOptions:!t.state.loadedInputValue},function(){t.loadOptions(a,function(e){t.mounted&&(e&&(t.optionsCache[a]=e),s===t.lastRequest&&(delete t.lastRequest,t.setState({isLoading:!1,loadedInputValue:a,loadedOptions:e||[],passEmptyOptions:!1})))})})}return a}),t.state={defaultOptions:Array.isArray(e.defaultOptions)?e.defaultOptions:void 0,inputValue:void 0!==e.inputValue?e.inputValue:"",isLoading:!0===e.defaultOptions,loadedOptions:[],passEmptyOptions:!1},t}var o,i,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}(n,r.Component),o=n,(i=[{key:"componentDidMount",value:function(){var e=this;this.mounted=!0;var t=this.props.defaultOptions,n=this.state.inputValue;!0===t&&this.loadOptions(n,function(t){if(e.mounted){var n=!!e.lastRequest;e.setState({defaultOptions:t||[],isLoading:n})}})}},{key:"componentWillReceiveProps",value:function(e){e.cacheOptions!==this.props.cacheOptions&&(this.optionsCache={}),e.defaultOptions!==this.props.defaultOptions&&this.setState({defaultOptions:Array.isArray(e.defaultOptions)?e.defaultOptions:void 0})}},{key:"componentWillUnmount",value:function(){this.mounted=!1}},{key:"focus",value:function(){this.select.focus()}},{key:"blur",value:function(){this.select.blur()}},{key:"loadOptions",value:function(e,t){var n=this.props.loadOptions;if(!n)return t();var r=n(e,t);r&&"function"==typeof r.then&&r.then(t,function(){return t()})}},{key:"render",value:function(){var t=this,n=this.props,o=(n.loadOptions,c(n,["loadOptions"])),u=this.state,i=u.defaultOptions,a=u.inputValue,s=u.isLoading,p=u.loadedInputValue,f=u.loadedOptions,d=u.passEmptyOptions?[]:a&&p?f:i||[];return r.default.createElement(e,l({},o,{ref:function(e){t.select=e},options:d,isLoading:s,onInputChange:this.handleInputChange}))}}])&&p(o.prototype,i),a&&p(o,a),n}(),b(t,"defaultProps",m),n};t.makeAsyncSelect=v;var g=v((0,i.default)(o.default));t.default=g},H6Zs:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,n):{};r.get||r.set?Object.defineProperty(t,n,r):t[n]=e[n]}return t.default=e,t}(n("cDcd")),o=n("PAeb");function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function a(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},u=Object.keys(e);for(r=0;r<u.length;r++)n=u[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(r=0;r<u.length;r++)n=u[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function l(e,t){return!t||"object"!==u(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var f=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),l(this,c(t).apply(this,arguments))}var n,u,f;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}(t,r.Component),n=t,(u=[{key:"render",value:function(){var e=this.props,t=(e.in,e.out,e.onExited,e.appear,e.enter,e.exit,e.innerRef),n=(e.emotion,a(e,["in","out","onExited","appear","enter","exit","innerRef","emotion"]));return r.default.createElement("input",i({ref:t},n,{className:(0,o.css)({background:0,border:0,fontSize:"inherit",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(0)"})}))}}])&&s(n.prototype,u),f&&s(n,f),t}();t.default=f},KIQE:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.inputCSS=void 0;var r=i(n("cDcd")),o=n("PAeb"),u=i(n("FUBA"));function i(e){return e&&e.__esModule?e:{default:e}}function a(){return(a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){l(e,t,n[t])})}return e}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},u=Object.keys(e);for(r=0;r<u.length;r++)n=u[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(r=0;r<u.length;r++)n=u[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}t.inputCSS=function(e){var t=e.isDisabled,n=e.theme,r=n.spacing,o=n.colors;return{margin:r.baseUnit/2,paddingBottom:r.baseUnit/2,paddingTop:r.baseUnit/2,visibility:t?"hidden":"visible",color:o.neutral80}};var p=function(e){return{background:0,border:0,fontSize:"inherit",opacity:e?0:1,outline:0,padding:0,color:"inherit"}},f=function(e){var t=e.className,n=e.cx,i=e.getStyles,l=e.innerRef,f=e.isHidden,d=e.isDisabled,h=e.theme,b=(e.selectProps,c(e,["className","cx","getStyles","innerRef","isHidden","isDisabled","theme","selectProps"]));return r.default.createElement("div",{className:(0,o.css)(i("input",s({theme:h},b)))},r.default.createElement(u.default,a({className:n(null,{input:!0},t),inputRef:l,inputStyle:p(f),disabled:d},b)))};t.default=f},KXCe:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultTheme=t.spacing=t.colors=void 0;var r={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"};t.colors=r;var o={baseUnit:4,controlHeight:38,menuGutter:8};t.spacing=o;var u={borderRadius:4,colors:r,spacing:o};t.defaultTheme=u},N3bB:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n("cDcd"),o=n("faye");function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e,t){return!t||"object"!==u(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var c=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a(this,s(t).apply(this,arguments))}var n,u,c;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(t,r.Component),n=t,(u=[{key:"componentDidMount",value:function(){this.props.innerRef((0,o.findDOMNode)(this))}},{key:"componentWillUnmount",value:function(){this.props.innerRef(null)}},{key:"render",value:function(){return this.props.children}}])&&i(n.prototype,u),c&&i(n,c),t}();t.default=c},PAeb:function(e,t,n){"use strict";n.r(t),function(e){n.d(t,"flush",function(){return i}),n.d(t,"hydrate",function(){return a}),n.d(t,"cx",function(){return s}),n.d(t,"merge",function(){return l}),n.d(t,"getRegisteredStyles",function(){return c}),n.d(t,"injectGlobal",function(){return p}),n.d(t,"keyframes",function(){return f}),n.d(t,"css",function(){return d}),n.d(t,"sheet",function(){return h}),n.d(t,"caches",function(){return b});var r=n("oj4i"),o=void 0!==e?e:{},u=Object(r.a)(o),i=u.flush,a=u.hydrate,s=u.cx,l=u.merge,c=u.getRegisteredStyles,p=u.injectGlobal,f=u.keyframes,d=u.css,h=u.sheet,b=u.caches}.call(this,n("yLpj"))},QcsS:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,n):{};r.get||r.set?Object.defineProperty(t,n,r):t[n]=e[n]}return t.default=e,t}(n("cDcd")),o=n("PAeb"),u=a(n("N3bB")),i=a(n("CXKz"));function a(e){return e&&e.__esModule?e:{default:e}}function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var h=function(e){function t(){var e,n,r,o;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var u=arguments.length,i=new Array(u),a=0;a<u;a++)i[a]=arguments[a];return r=this,o=(e=c(t)).call.apply(e,[this].concat(i)),n=!o||"object"!==s(o)&&"function"!=typeof o?f(r):o,d(f(f(n)),"state",{touchScrollTarget:null}),d(f(f(n)),"getScrollTarget",function(e){e!==n.state.touchScrollTarget&&n.setState({touchScrollTarget:e})}),d(f(f(n)),"blurSelectInput",function(){document.activeElement&&document.activeElement.blur()}),n}var n,a,h;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}(t,r.PureComponent),n=t,(a=[{key:"render",value:function(){var e=this.props,t=e.children,n=e.isEnabled,a=this.state.touchScrollTarget;return n?r.default.createElement("div",null,r.default.createElement("div",{onClick:this.blurSelectInput,className:(0,o.css)({position:"fixed",left:0,bottom:0,right:0,top:0})}),r.default.createElement(u.default,{innerRef:this.getScrollTarget},t),a?r.default.createElement(i.default,{touchScrollTarget:a}):null):t}}])&&l(n.prototype,a),h&&l(n,h),t}();t.default=h},SHH1:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.preventTouchMove=function(e){e.preventDefault()},t.allowTouchMove=function(e){e.stopPropagation()},t.preventInertiaScroll=function(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;0===e?this.scrollTop=1:n===t&&(this.scrollTop=e-1)},t.isTouchDevice=function(){return"ontouchstart"in window||navigator.maxTouchPoints}},SrCC:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.optionCSS=void 0;var r,o=(r=n("cDcd"))&&r.__esModule?r:{default:r},u=n("PAeb");function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}t.optionCSS=function(e){var t=e.isDisabled,n=e.isFocused,r=e.isSelected,o=e.theme,u=o.spacing,i=o.colors;return{backgroundColor:r?i.primary:n?i.primary25:"transparent",color:t?i.neutral20:r?i.neutral0:"inherit",cursor:"default",display:"block",fontSize:"inherit",padding:"".concat(2*u.baseUnit,"px ").concat(3*u.baseUnit,"px"),width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)",":active":{backgroundColor:r?i.primary:i.primary50}}};var a=function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles,s=e.isDisabled,l=e.isFocused,c=e.isSelected,p=e.innerRef,f=e.innerProps;return o.default.createElement("div",i({ref:p,className:r((0,u.css)(a("option",e)),{option:!0,"option--is-disabled":s,"option--is-focused":l,"option--is-selected":c},n)},f),t)};t.default=a},TAZq:function(e,t,n){e.exports=function(){"use strict";return function(e){function t(t){if(t)try{e(t+"}")}catch(e){}}return function(n,r,o,u,i,a,s,l,c,p){switch(n){case 1:if(0===c&&64===r.charCodeAt(0))return e(r+";"),"";break;case 2:if(0===l)return r+"/*|*/";break;case 3:switch(l){case 102:case 112:return e(o[0]+r),"";default:return r+(0===p?"/*|*/":"")}case-2:r.split("/*|*/}").forEach(t)}}}}()},WvHe:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeStyles=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){d(e,t,n[t])})}return e}({},e);return Object.keys(t).forEach(function(r){e[r]?n[r]=function(n,o){return t[r](e[r](n,o),o)}:n[r]=t[r]}),n},t.defaultStyles=void 0;var r=n("2cv3"),o=n("rc6b"),u=n("n929"),i=n("+URl"),a=n("KIQE"),s=n("BCie"),l=n("SrCC"),c=n("Avrx"),p=n("+8qv"),f=n("lQ6M");function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var h={clearIndicator:i.clearIndicatorCSS,container:r.containerCSS,control:o.css,dropdownIndicator:i.dropdownIndicatorCSS,group:u.groupCSS,groupHeading:u.groupHeadingCSS,indicatorsContainer:r.indicatorsContainerCSS,indicatorSeparator:i.indicatorSeparatorCSS,input:a.inputCSS,loadingIndicator:i.loadingIndicatorCSS,loadingMessage:c.loadingMessageCSS,menu:c.menuCSS,menuList:c.menuListCSS,menuPortal:c.menuPortalCSS,multiValue:f.multiValueCSS,multiValueLabel:f.multiValueLabelCSS,multiValueRemove:f.multiValueRemoveCSS,noOptionsMessage:c.noOptionsMessageCSS,option:l.optionCSS,placeholder:s.placeholderCSS,singleValue:p.css,valueContainer:r.valueContainerCSS};t.defaultStyles=h},Wwog:function(e,t,n){"use strict";n.r(t);var r=function(e,t){return e.length===t.length&&e.every(function(e,n){return r=e,o=t[n],r===o;var r,o})};t.default=function(e,t){var n;void 0===t&&(t=r);var o,u=[],i=!1;return function(){for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i&&n===this&&t(a,u)?o:(o=e.apply(this,a),i=!0,n=this,u=a,o)}}},"b+PA":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.classNames=function(e,t,n,r){var o=[t,r];if(n&&e)for(var u in n)n.hasOwnProperty(u)&&n[u]&&o.push("".concat(a(e,u)));return o.filter(function(e){return e}).map(function(e){return String(e).trim()}).join(" ")},t.handleInputChange=function(e,t,n){if(n){var r=n(e,t);if("string"==typeof r)return r}return e},t.isDocumentElement=s,t.normalizedHeight=function(e){if(s(e))return window.innerHeight;return e.clientHeight},t.getScrollTop=l,t.scrollTo=c,t.getScrollParent=function(e){var t=getComputedStyle(e),n="absolute"===t.position,r=/(auto|scroll)/,o=document.documentElement;if("fixed"===t.position)return o;for(var u=e;u=u.parentElement;)if(t=getComputedStyle(u),(!n||"static"!==t.position)&&r.test(t.overflow+t.overflowY+t.overflowX))return u;return o},t.animatedScrollTo=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:i,u=l(e),a=t-u,s=10,p=0;!function t(){p+=s;var i=(l=p,f=u,d=a,h=n,d*((l=l/h-1)*l*l+1)+f);var l,f,d,h;c(e,i);p<n?(0,o.default)(t):r(e)}()},t.scrollIntoView=function(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),o=t.offsetHeight/3;r.bottom+o>n.bottom?c(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+o,e.scrollHeight)):r.top-o<n.top&&c(e,Math.max(t.offsetTop-o,0))},t.getBoundingClientObj=function(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}},t.toKey=function(e){return e.replace(/\W/g,"-")},t.isTouchCapable=function(){try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}},t.isMobileDevice=function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(e){return!1}},t.cleanValue=t.emptyString=t.noop=void 0;var r,o=(r=n("xEkU"))&&r.__esModule?r:{default:r};function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=function(){};t.noop=i;function a(e,t){return t?"-"===t[0]?e+t:e+"__"+t:e}t.emptyString=function(){return""};function s(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function l(e){return s(e)?window.pageYOffset:e.scrollTop}function c(e,t){s(e)?window.scrollTo(0,t):e.scrollTop=t}t.cleanValue=function(e){return Array.isArray(e)?e.filter(Boolean):"object"===u(e)&&null!==e?[e]:[]}},bQgK:function(e,t,n){(function(t){(function(){var n,r,o,u,i,a;"undefined"!=typeof performance&&null!==performance&&performance.now?e.exports=function(){return performance.now()}:null!=t&&t.hrtime?(e.exports=function(){return(n()-i)/1e6},r=t.hrtime,u=(n=function(){var e;return 1e9*(e=r())[0]+e[1]})(),a=1e9*t.uptime(),i=u-a):Date.now?(e.exports=function(){return Date.now()-o},o=Date.now()):(e.exports=function(){return(new Date).getTime()-o},o=(new Date).getTime())}).call(this)}).call(this,n("8oxB"))},"c+lM":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stripDiacritics=void 0;var r=[{base:"A",letters:/[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g},{base:"AA",letters:/[\uA732]/g},{base:"AE",letters:/[\u00C6\u01FC\u01E2]/g},{base:"AO",letters:/[\uA734]/g},{base:"AU",letters:/[\uA736]/g},{base:"AV",letters:/[\uA738\uA73A]/g},{base:"AY",letters:/[\uA73C]/g},{base:"B",letters:/[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g},{base:"C",letters:/[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g},{base:"D",letters:/[\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779]/g},{base:"DZ",letters:/[\u01F1\u01C4]/g},{base:"Dz",letters:/[\u01F2\u01C5]/g},{base:"E",letters:/[\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E]/g},{base:"F",letters:/[\u0046\u24BB\uFF26\u1E1E\u0191\uA77B]/g},{base:"G",letters:/[\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E]/g},{base:"H",letters:/[\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D]/g},{base:"I",letters:/[\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197]/g},{base:"J",letters:/[\u004A\u24BF\uFF2A\u0134\u0248]/g},{base:"K",letters:/[\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2]/g},{base:"L",letters:/[\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780]/g},{base:"LJ",letters:/[\u01C7]/g},{base:"Lj",letters:/[\u01C8]/g},{base:"M",letters:/[\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C]/g},{base:"N",letters:/[\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4]/g},{base:"NJ",letters:/[\u01CA]/g},{base:"Nj",letters:/[\u01CB]/g},{base:"O",letters:/[\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C]/g},{base:"OI",letters:/[\u01A2]/g},{base:"OO",letters:/[\uA74E]/g},{base:"OU",letters:/[\u0222]/g},{base:"P",letters:/[\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754]/g},{base:"Q",letters:/[\u0051\u24C6\uFF31\uA756\uA758\u024A]/g},{base:"R",letters:/[\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782]/g},{base:"S",letters:/[\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784]/g},{base:"T",letters:/[\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786]/g},{base:"TZ",letters:/[\uA728]/g},{base:"U",letters:/[\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244]/g},{base:"V",letters:/[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245]/g},{base:"VY",letters:/[\uA760]/g},{base:"W",letters:/[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72]/g},{base:"X",letters:/[\u0058\u24CD\uFF38\u1E8A\u1E8C]/g},{base:"Y",letters:/[\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE]/g},{base:"Z",letters:/[\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762]/g},{base:"a",letters:/[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g},{base:"aa",letters:/[\uA733]/g},{base:"ae",letters:/[\u00E6\u01FD\u01E3]/g},{base:"ao",letters:/[\uA735]/g},{base:"au",letters:/[\uA737]/g},{base:"av",letters:/[\uA739\uA73B]/g},{base:"ay",letters:/[\uA73D]/g},{base:"b",letters:/[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g},{base:"c",letters:/[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g},{base:"d",letters:/[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A]/g},{base:"dz",letters:/[\u01F3\u01C6]/g},{base:"e",letters:/[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD]/g},{base:"f",letters:/[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C]/g},{base:"g",letters:/[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F]/g},{base:"h",letters:/[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/g},{base:"hv",letters:/[\u0195]/g},{base:"i",letters:/[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131]/g},{base:"j",letters:/[\u006A\u24D9\uFF4A\u0135\u01F0\u0249]/g},{base:"k",letters:/[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3]/g},{base:"l",letters:/[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747]/g},{base:"lj",letters:/[\u01C9]/g},{base:"m",letters:/[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F]/g},{base:"n",letters:/[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5]/g},{base:"nj",letters:/[\u01CC]/g},{base:"o",letters:/[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275]/g},{base:"oi",letters:/[\u01A3]/g},{base:"ou",letters:/[\u0223]/g},{base:"oo",letters:/[\uA74F]/g},{base:"p",letters:/[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755]/g},{base:"q",letters:/[\u0071\u24E0\uFF51\u024B\uA757\uA759]/g},{base:"r",letters:/[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783]/g},{base:"s",letters:/[\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B]/g},{base:"t",letters:/[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787]/g},{base:"tz",letters:/[\uA729]/g},{base:"u",letters:/[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289]/g},{base:"v",letters:/[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C]/g},{base:"vy",letters:/[\uA761]/g},{base:"w",letters:/[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/g},{base:"x",letters:/[\u0078\u24E7\uFF58\u1E8B\u1E8D]/g},{base:"y",letters:/[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF]/g},{base:"z",letters:/[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763]/g}];t.stripDiacritics=function(e){for(var t=0;t<r.length;t++)e=e.replace(r[t].letters,r[t].base);return e}},d6Hc:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,n):{};r.get||r.set?Object.defineProperty(t,n,r):t[n]=e[n]}return t.default=e,t}(n("cDcd")),u=(r=n("N3bB"))&&r.__esModule?r:{default:r};function i(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},u=Object.keys(e);for(r=0;r<u.length;r++)n=u[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(r=0;r<u.length;r++)n=u[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function c(e,t,n){return t&&l(e.prototype,t),n&&l(e,n),e}function p(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?b(e):t}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}function h(e,t){return(h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function b(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var v=function(e){function t(){var e,n;s(this,t);for(var r=arguments.length,o=new Array(r),u=0;u<r;u++)o[u]=arguments[u];return m(b(b(n=p(this,(e=f(t)).call.apply(e,[this].concat(o))))),"isBottom",!1),m(b(b(n)),"isTop",!1),m(b(b(n)),"scrollTarget",void 0),m(b(b(n)),"touchStart",void 0),m(b(b(n)),"cancelScroll",function(e){e.preventDefault(),e.stopPropagation()}),m(b(b(n)),"handleEventDelta",function(e,t){var r=n.props,o=r.onBottomArrive,u=r.onBottomLeave,i=r.onTopArrive,a=r.onTopLeave,s=n.scrollTarget,l=s.scrollTop,c=s.scrollHeight,p=s.clientHeight,f=n.scrollTarget,d=t>0,h=c-p-l,b=!1;h>t&&n.isBottom&&(u&&u(e),n.isBottom=!1),d&&n.isTop&&(a&&a(e),n.isTop=!1),d&&t>h?(o&&!n.isBottom&&o(e),f.scrollTop=c,b=!0,n.isBottom=!0):!d&&-t>l&&(i&&!n.isTop&&i(e),f.scrollTop=0,b=!0,n.isTop=!0),b&&n.cancelScroll(e)}),m(b(b(n)),"onWheel",function(e){n.handleEventDelta(e,e.deltaY)}),m(b(b(n)),"onTouchStart",function(e){n.touchStart=e.changedTouches[0].clientY}),m(b(b(n)),"onTouchMove",function(e){var t=n.touchStart-e.changedTouches[0].clientY;n.handleEventDelta(e,t)}),m(b(b(n)),"getScrollTarget",function(e){n.scrollTarget=e}),n}return d(t,o.Component),c(t,[{key:"componentDidMount",value:function(){this.startListening(this.scrollTarget)}},{key:"componentWillUnmount",value:function(){this.stopListening(this.scrollTarget)}},{key:"startListening",value:function(e){e&&(e.scrollHeight<=e.clientHeight||("function"==typeof e.addEventListener&&e.addEventListener("wheel",this.onWheel,!1),"function"==typeof e.addEventListener&&e.addEventListener("touchstart",this.onTouchStart,!1),"function"==typeof e.addEventListener&&e.addEventListener("touchmove",this.onTouchMove,!1)))}},{key:"stopListening",value:function(e){e.scrollHeight<=e.clientHeight||("function"==typeof e.removeEventListener&&e.removeEventListener("wheel",this.onWheel,!1),"function"==typeof e.removeEventListener&&e.removeEventListener("touchstart",this.onTouchStart,!1),"function"==typeof e.removeEventListener&&e.removeEventListener("touchmove",this.onTouchMove,!1))}},{key:"render",value:function(){return o.default.createElement(u.default,{innerRef:this.getScrollTarget},this.props.children)}}]),t}(),g=function(e){function t(){return s(this,t),p(this,f(t).apply(this,arguments))}return d(t,o.Component),c(t,[{key:"render",value:function(){var e=this.props,t=e.isEnabled,n=i(e,["isEnabled"]);return t?o.default.createElement(v,n):this.props.children}}]),t}();t.default=g,m(g,"defaultProps",{isEnabled:!0})},grMF:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createFilter=void 0;var r=n("c+lM");function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var u=function(e){return e.replace(/^\s+|\s+$/g,"")},i=function(e){return"".concat(e.label," ").concat(e.value)};t.createFilter=function(e){return function(t,n){var a=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){o(e,t,n[t])})}return e}({ignoreCase:!0,ignoreAccents:!0,stringify:i,trim:!0,matchFrom:"any"},e),s=a.ignoreCase,l=a.ignoreAccents,c=a.stringify,p=a.trim,f=a.matchFrom,d=p?u(n):n,h=p?u(c(t)):c(t);return s&&(d=d.toLowerCase(),h=h.toLowerCase()),l&&(d=(0,r.stripDiacritics)(d),h=(0,r.stripDiacritics)(h)),"start"===f?h.substr(0,d.length)===d:h.indexOf(d)>-1}}},jMYa:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.defaultProps=void 0;var r=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,n):{};r.get||r.set?Object.defineProperty(t,n,r):t[n]=e[n]}return t.default=e,t}(n("cDcd")),o=b(n("Wwog")),u=n("Avrx"),i=b(n("3lEq")),a=n("grMF"),s=n("tJT6"),l=n("59S1"),c=n("b+PA"),p=n("oZmp"),f=n("5bE3"),d=n("WvHe"),h=n("KXCe");function b(e){return e&&e.__esModule?e:{default:e}}function m(e){return(m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function v(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},u=Object.keys(e);for(r=0;r<u.length;r++)n=u[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(r=0;r<u.length;r++)n=u[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function g(){return(g=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function y(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){P(e,t,n[t])})}return e}function E(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function S(e){return(S=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function C(e,t){return(C=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function w(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function P(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var A={backspaceRemovesValue:!0,blurInputOnSelect:(0,c.isTouchCapable)(),captureMenuScroll:!(0,c.isTouchCapable)(),closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:(0,a.createFilter)(),formatGroupLabel:p.formatGroupLabel,getOptionLabel:p.getOptionLabel,getOptionValue:p.getOptionValue,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:p.isOptionDisabled,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!(0,c.isMobileDevice)(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(1!==t?"s":""," available")},styles:{},tabIndex:"0",tabSelectsValue:!0};t.defaultProps=A;var j=1,D=function(e){function t(e){var n,r,u;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),r=this,u=S(t).call(this,e),n=!u||"object"!==m(u)&&"function"!=typeof u?w(r):u,P(w(w(n)),"state",{ariaLiveSelection:"",ariaLiveContext:"",focusedOption:null,focusedValue:null,inputIsHidden:!1,isFocused:!1,isComposing:!1,menuOptions:{render:[],focusable:[]},selectValue:[]}),P(w(w(n)),"blockOptionHover",!1),P(w(w(n)),"clearFocusValueOnUpdate",!1),P(w(w(n)),"commonProps",void 0),P(w(w(n)),"components",void 0),P(w(w(n)),"hasGroups",!1),P(w(w(n)),"initialTouchX",0),P(w(w(n)),"initialTouchY",0),P(w(w(n)),"inputIsHiddenAfterUpdate",void 0),P(w(w(n)),"instancePrefix",""),P(w(w(n)),"openAfterFocus",!1),P(w(w(n)),"scrollToFocusedOptionOnUpdate",!1),P(w(w(n)),"userIsDragging",void 0),P(w(w(n)),"controlRef",null),P(w(w(n)),"getControlRef",function(e){n.controlRef=e}),P(w(w(n)),"focusedOptionRef",null),P(w(w(n)),"getFocusedOptionRef",function(e){n.focusedOptionRef=e}),P(w(w(n)),"menuListRef",null),P(w(w(n)),"getMenuListRef",function(e){n.menuListRef=e}),P(w(w(n)),"inputRef",null),P(w(w(n)),"getInputRef",function(e){n.inputRef=e}),P(w(w(n)),"cacheComponents",function(e){n.components=(0,f.defaultComponents)({components:e})}),P(w(w(n)),"focus",n.focusInput),P(w(w(n)),"blur",n.blurInput),P(w(w(n)),"onChange",function(e,t){var r=n.props;(0,r.onChange)(e,O({},t,{name:r.name}))}),P(w(w(n)),"setValue",function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"set-value",r=arguments.length>2?arguments[2]:void 0,o=n.props,u=o.closeMenuOnSelect,i=o.isMulti;n.onInputChange("",{action:"set-value"}),u&&(n.inputIsHiddenAfterUpdate=!i,n.onMenuClose()),n.clearFocusValueOnUpdate=!0,n.onChange(e,{action:t,option:r})}),P(w(w(n)),"selectOption",function(e){var t=n.props,r=t.blurInputOnSelect;if(t.isMulti){var o=n.state.selectValue;if(n.isOptionSelected(e,o)){var u=n.getOptionValue(e);n.setValue(o.filter(function(e){return n.getOptionValue(e)!==u}),"deselect-option",e),n.announceAriaLiveSelection({event:"deselect-option",context:{value:n.getOptionLabel(e)}})}else n.setValue([].concat(y(o),[e]),"select-option",e),n.announceAriaLiveSelection({event:"select-option",context:{value:n.getOptionLabel(e)}})}else n.setValue(e,"select-option"),n.announceAriaLiveSelection({event:"select-option",context:{value:n.getOptionLabel(e)}});r&&n.blurInput()}),P(w(w(n)),"removeValue",function(e){var t=n.state.selectValue,r=n.getOptionValue(e);n.onChange(t.filter(function(e){return n.getOptionValue(e)!==r}),{action:"remove-value",removedValue:e}),n.announceAriaLiveSelection({event:"remove-value",context:{value:e?n.getOptionLabel(e):""}}),n.focusInput()}),P(w(w(n)),"clearValue",function(){var e=n.props.isMulti;n.onChange(e?[]:null,{action:"clear"})}),P(w(w(n)),"popValue",function(){var e=n.state.selectValue,t=e[e.length-1];n.announceAriaLiveSelection({event:"pop-value",context:{value:t?n.getOptionLabel(t):""}}),n.onChange(e.slice(0,e.length-1),{action:"pop-value",removedValue:t})}),P(w(w(n)),"getOptionLabel",function(e){return n.props.getOptionLabel(e)}),P(w(w(n)),"getOptionValue",function(e){return n.props.getOptionValue(e)}),P(w(w(n)),"getStyles",function(e,t){var r=d.defaultStyles[e](t);r.boxSizing="border-box";var o=n.props.styles[e];return o?o(r,t):r}),P(w(w(n)),"getElementId",function(e){return"".concat(n.instancePrefix,"-").concat(e)}),P(w(w(n)),"getActiveDescendentId",function(){var e=n.props.menuIsOpen,t=n.state,r=t.menuOptions,o=t.focusedOption;if(o&&e){var u=r.focusable.indexOf(o),i=r.render[u];return i&&i.key}}),P(w(w(n)),"announceAriaLiveSelection",function(e){var t=e.event,r=e.context;n.setState({ariaLiveSelection:(0,l.valueEventAriaMessage)(t,r)})}),P(w(w(n)),"announceAriaLiveContext",function(e){var t=e.event,r=e.context;n.setState({ariaLiveContext:(0,l.instructionsAriaMessage)(t,O({},r,{label:n.props["aria-label"]}))})}),P(w(w(n)),"onMenuMouseDown",function(e){0===e.button&&(e.stopPropagation(),e.preventDefault(),n.focusInput())}),P(w(w(n)),"onMenuMouseMove",function(e){n.blockOptionHover=!1}),P(w(w(n)),"onControlMouseDown",function(e){var t=n.props.openMenuOnClick;n.state.isFocused?n.props.menuIsOpen?"INPUT"!==e.currentTarget.tagName&&n.onMenuClose():t&&n.openMenu("first"):(t&&(n.openAfterFocus=!0),n.focusInput()),"INPUT"!==e.currentTarget.tagName&&e.preventDefault()}),P(w(w(n)),"onDropdownIndicatorMouseDown",function(e){if(!(e&&"mousedown"===e.type&&0!==e.button||n.props.isDisabled)){var t=n.props,r=t.isMulti,o=t.menuIsOpen;n.focusInput(),o?(n.inputIsHiddenAfterUpdate=!r,n.onMenuClose()):n.openMenu("first"),e.preventDefault(),e.stopPropagation()}}),P(w(w(n)),"onClearIndicatorMouseDown",function(e){e&&"mousedown"===e.type&&0!==e.button||(n.clearValue(),e.stopPropagation(),n.openAfterFocus=!1,setTimeout(function(){return n.focusInput()}))}),P(w(w(n)),"onScroll",function(e){"boolean"==typeof n.props.closeMenuOnScroll?e.target instanceof HTMLElement&&(0,c.isDocumentElement)(e.target)&&n.props.onMenuClose():"function"==typeof n.props.closeMenuOnScroll&&n.props.closeMenuOnScroll(e)&&n.props.onMenuClose()}),P(w(w(n)),"onCompositionStart",function(){n.setState({isComposing:!0})}),P(w(w(n)),"onCompositionEnd",function(){n.setState({isComposing:!1})}),P(w(w(n)),"onTouchStart",function(e){var t=e.touches.item(0);t&&(n.initialTouchX=t.clientX,n.initialTouchY=t.clientY,n.userIsDragging=!1)}),P(w(w(n)),"onTouchMove",function(e){var t=e.touches.item(0);if(t){var r=Math.abs(t.clientX-n.initialTouchX),o=Math.abs(t.clientY-n.initialTouchY);n.userIsDragging=r>5||o>5}}),P(w(w(n)),"onTouchEnd",function(e){n.userIsDragging||(n.controlRef&&!n.controlRef.contains(e.target)&&n.menuListRef&&!n.menuListRef.contains(e.target)&&n.blurInput(),n.initialTouchX=0,n.initialTouchY=0)}),P(w(w(n)),"onControlTouchEnd",function(e){n.userIsDragging||n.onControlMouseDown(e)}),P(w(w(n)),"onClearIndicatorTouchEnd",function(e){n.userIsDragging||n.onClearIndicatorMouseDown(e)}),P(w(w(n)),"onDropdownIndicatorTouchEnd",function(e){n.userIsDragging||n.onDropdownIndicatorMouseDown(e)}),P(w(w(n)),"handleInputChange",function(e){var t=e.currentTarget.value;n.inputIsHiddenAfterUpdate=!1,n.onInputChange(t,{action:"input-change"}),n.onMenuOpen()}),P(w(w(n)),"onInputFocus",function(e){var t=n.props,r=t.isSearchable,o=t.isMulti;n.props.onFocus&&n.props.onFocus(e),n.inputIsHiddenAfterUpdate=!1,n.announceAriaLiveContext({event:"input",context:{isSearchable:r,isMulti:o}}),n.setState({isFocused:!0}),(n.openAfterFocus||n.props.openMenuOnFocus)&&n.openMenu("first"),n.openAfterFocus=!1}),P(w(w(n)),"onInputBlur",function(e){n.menuListRef&&n.menuListRef.contains(document.activeElement)?n.inputRef.focus():(n.props.onBlur&&n.props.onBlur(e),n.onInputChange("",{action:"input-blur"}),n.onMenuClose(),n.setState({focusedValue:null,isFocused:!1}))}),P(w(w(n)),"onOptionHover",function(e){n.blockOptionHover||n.state.focusedOption===e||n.setState({focusedOption:e})}),P(w(w(n)),"shouldHideSelectedOptions",function(){var e=n.props,t=e.hideSelectedOptions,r=e.isMulti;return void 0===t?r:t}),P(w(w(n)),"onKeyDown",function(e){var t=n.props,r=t.isMulti,o=t.backspaceRemovesValue,u=t.escapeClearsValue,i=t.inputValue,a=t.isClearable,s=t.isDisabled,l=t.menuIsOpen,c=t.onKeyDown,p=t.tabSelectsValue,f=t.openMenuOnFocus,d=n.state,h=d.isComposing,b=d.focusedOption,m=d.focusedValue,v=d.selectValue;if(!(s||"function"==typeof c&&(c(e),e.defaultPrevented))){switch(n.blockOptionHover=!0,e.key){case"ArrowLeft":if(!r||i)return;n.focusValue("previous");break;case"ArrowRight":if(!r||i)return;n.focusValue("next");break;case"Delete":case"Backspace":if(i)return;if(m)n.removeValue(m);else{if(!o)return;r?n.popValue():a&&n.clearValue()}break;case"Tab":if(h)return;if(e.shiftKey||!l||!p||!b||f&&n.isOptionSelected(b,v))return;n.selectOption(b);break;case"Enter":if(l){if(!b)return;if(h)return;n.selectOption(b);break}return;case"Escape":l?(n.inputIsHiddenAfterUpdate=!1,n.onInputChange("",{action:"menu-close"}),n.onMenuClose()):a&&u&&n.clearValue();break;case" ":if(i)return;if(!l){n.openMenu("first");break}if(!b)return;n.selectOption(b);break;case"ArrowUp":l?n.focusOption("up"):n.openMenu("last");break;case"ArrowDown":l?n.focusOption("down"):n.openMenu("first");break;case"PageUp":if(!l)return;n.focusOption("pageup");break;case"PageDown":if(!l)return;n.focusOption("pagedown");break;case"Home":if(!l)return;n.focusOption("first");break;case"End":if(!l)return;n.focusOption("last");break;default:return}e.preventDefault()}});var a=e.value;n.cacheComponents=(0,o.default)(n.cacheComponents,i.default).bind(w(w(n))),n.cacheComponents(e.components),n.instancePrefix="react-select-"+(n.props.instanceId||++j);var s=(0,c.cleanValue)(a),p=n.buildMenuOptions(e,s);return n.state.menuOptions=p,n.state.selectValue=s,n}var n,a,p;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&C(e,t)}(t,r.Component),n=t,(a=[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput()}},{key:"componentWillReceiveProps",value:function(e){var t=this.props,n=t.options,r=t.value,o=t.inputValue;if(this.cacheComponents(e.components),e.value!==r||e.options!==n||e.inputValue!==o){var u=(0,c.cleanValue)(e.value),i=this.buildMenuOptions(e,u),a=this.getNextFocusedValue(u),s=this.getNextFocusedOption(i.focusable);this.setState({menuOptions:i,selectValue:u,focusedOption:s,focusedValue:a})}null!=this.inputIsHiddenAfterUpdate&&(this.setState({inputIsHidden:this.inputIsHiddenAfterUpdate}),delete this.inputIsHiddenAfterUpdate)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.isDisabled,r=t.menuIsOpen,o=this.state.isFocused;(o&&!n&&e.isDisabled||o&&r&&!e.menuIsOpen)&&this.focusInput(),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(0,c.scrollIntoView)(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){var e=this.props,t=e.isSearchable,n=e.isMulti;this.announceAriaLiveContext({event:"input",context:{isSearchable:t,isMulti:n}}),this.onInputChange("",{action:"menu-close"}),this.props.onMenuClose()}},{key:"onInputChange",value:function(e,t){this.props.onInputChange(e,t)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(e){var t=this.state,n=t.menuOptions,r=t.selectValue,o=t.isFocused,u=this.props.isMulti,i="first"===e?0:n.focusable.length-1;if(!u){var a=n.focusable.indexOf(r[0]);a>-1&&(i=a)}this.scrollToFocusedOptionOnUpdate=!(o&&this.menuListRef),this.inputIsHiddenAfterUpdate=!1,this.onMenuOpen(),this.setState({focusedValue:null,focusedOption:n.focusable[i]}),this.announceAriaLiveContext({event:"menu"})}},{key:"focusValue",value:function(e){var t=this.props,n=t.isMulti,r=t.isSearchable,o=this.state,u=o.selectValue,i=o.focusedValue;if(n){this.setState({focusedOption:null});var a=u.indexOf(i);i||(a=-1,this.announceAriaLiveContext({event:"value"}));var s=u.length-1,l=-1;if(u.length){switch(e){case"previous":l=0===a?0:-1===a?s:a-1;break;case"next":a>-1&&a<s&&(l=a+1)}-1===l&&this.announceAriaLiveContext({event:"input",context:{isSearchable:r,isMulti:n}}),this.setState({inputIsHidden:-1!==l,focusedValue:u[l]})}}}},{key:"focusOption",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"first",t=this.props.pageSize,n=this.state,r=n.focusedOption,o=n.menuOptions.focusable;if(o.length){var u=0,i=o.indexOf(r);r||(i=-1,this.announceAriaLiveContext({event:"menu"})),"up"===e?u=i>0?i-1:o.length-1:"down"===e?u=(i+1)%o.length:"pageup"===e?(u=i-t)<0&&(u=0):"pagedown"===e?(u=i+t)>o.length-1&&(u=o.length-1):"last"===e&&(u=o.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:o[u],focusedValue:null})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(h.defaultTheme):O({},h.defaultTheme,this.props.theme):h.defaultTheme}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.getStyles,n=this.setValue,r=this.selectOption,o=this.props,u=o.classNamePrefix,i=o.isMulti,a=o.isRtl,s=o.options,l=this.state.selectValue,p=this.hasValue();return{cx:c.classNames.bind(null,u),clearValue:e,getStyles:t,getValue:function(){return l},hasValue:p,isMulti:i,isRtl:a,options:s,selectOption:r,setValue:n,selectProps:o,theme:this.getTheme()}}},{key:"getNextFocusedValue",value:function(e){if(this.clearFocusValueOnUpdate)return this.clearFocusValueOnUpdate=!1,null;var t=this.state,n=t.focusedValue,r=t.selectValue.indexOf(n);if(r>-1){if(e.indexOf(n)>-1)return n;if(r<e.length)return e[r]}return null}},{key:"getNextFocusedOption",value:function(e){var t=this.state.focusedOption;return t&&e.indexOf(t)>-1?t:e[0]}},{key:"hasValue",value:function(){return this.state.selectValue.length>0}},{key:"hasOptions",value:function(){return!!this.state.menuOptions.render.length}},{key:"countOptions",value:function(){return this.state.menuOptions.focusable.length}},{key:"isClearable",value:function(){var e=this.props,t=e.isClearable,n=e.isMulti;return void 0===t?n:t}},{key:"isOptionDisabled",value:function(e,t){return"function"==typeof this.props.isOptionDisabled&&this.props.isOptionDisabled(e,t)}},{key:"isOptionSelected",value:function(e,t){var n=this;if(t.indexOf(e)>-1)return!0;if("function"==typeof this.props.isOptionSelected)return this.props.isOptionSelected(e,t);var r=this.getOptionValue(e);return t.some(function(e){return n.getOptionValue(e)===r})}},{key:"filterOption",value:function(e,t){return!this.props.filterOption||this.props.filterOption(e,t)}},{key:"formatOptionLabel",value:function(e,t){if("function"==typeof this.props.formatOptionLabel){var n=this.props.inputValue,r=this.state.selectValue;return this.props.formatOptionLabel(e,{context:t,inputValue:n,selectValue:r})}return this.getOptionLabel(e)}},{key:"formatGroupLabel",value:function(e){return this.props.formatGroupLabel(e)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"buildMenuOptions",value:function(e,t){var n=this,r=e.inputValue,o=void 0===r?"":r,u=e.options,i=function(e,r){var u=n.isOptionDisabled(e,t),i=n.isOptionSelected(e,t),a=n.getOptionLabel(e),s=n.getOptionValue(e);if(!(n.shouldHideSelectedOptions()&&i||!n.filterOption({label:a,value:s,data:e},o))){var l=u?void 0:function(){return n.onOptionHover(e)},c=u?void 0:function(){return n.selectOption(e)},p="".concat(n.getElementId("option"),"-").concat(r);return{innerProps:{id:p,onClick:c,onMouseMove:l,onMouseOver:l,tabIndex:-1},data:e,isDisabled:u,isSelected:i,key:p,label:a,type:"option",value:s}}};return u.reduce(function(e,t,r){if(t.options){n.hasGroups||(n.hasGroups=!0);var o=t.options.map(function(t,n){var o=i(t,"".concat(r,"-").concat(n));return o&&!o.isDisabled&&e.focusable.push(t),o}).filter(Boolean);if(o.length){var u="".concat(n.getElementId("group"),"-").concat(r);e.render.push({type:"group",key:u,data:t,options:o})}}else{var a=i(t,"".concat(r));a&&(e.render.push(a),a.isDisabled||e.focusable.push(t))}return e},{render:[],focusable:[]})}},{key:"constructAriaLiveMessage",value:function(){var e=this.state,t=e.ariaLiveContext,n=e.selectValue,r=e.focusedValue,o=e.focusedOption,u=this.props,i=u.options,a=u.menuIsOpen,s=u.inputValue,c=u.screenReaderStatus,p=r?(0,l.valueFocusAriaMessage)({focusedValue:r,getOptionLabel:this.getOptionLabel,selectValue:n}):"",f=o&&a?(0,l.optionFocusAriaMessage)({focusedOption:o,getOptionLabel:this.getOptionLabel,options:i}):"",d=(0,l.resultsAriaMessage)({inputValue:s,screenReaderMessage:c({count:this.countOptions()})});return"".concat(p," ").concat(f," ").concat(d," ").concat(t)}},{key:"renderInput",value:function(){var e=this.props,t=e.isDisabled,n=e.isSearchable,o=e.inputId,u=e.inputValue,i=e.tabIndex,a=this.components.Input,l=this.state.inputIsHidden,p=o||this.getElementId("input");if(!n)return r.default.createElement(s.DummyInput,{id:p,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:c.noop,onFocus:this.onInputFocus,readOnly:!0,disabled:t,tabIndex:i,value:""});var f={"aria-autocomplete":"list","aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"]},d=this.commonProps,h=d.cx,b=d.theme,m=d.selectProps;return r.default.createElement(a,g({autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",cx:h,getStyles:this.getStyles,id:p,innerRef:this.getInputRef,isDisabled:t,isHidden:l,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,selectProps:m,spellCheck:"false",tabIndex:i,theme:b,type:"text",value:u},f))}},{key:"renderPlaceholderOrValue",value:function(){var e=this,t=this.components,n=t.MultiValue,o=t.MultiValueContainer,u=t.MultiValueLabel,i=t.MultiValueRemove,a=t.SingleValue,s=t.Placeholder,l=this.commonProps,c=this.props,p=c.controlShouldRenderValue,f=c.isDisabled,d=c.isMulti,h=c.inputValue,b=c.placeholder,m=this.state,v=m.selectValue,y=m.focusedValue,O=m.isFocused;if(!this.hasValue()||!p)return h?null:r.default.createElement(s,g({},l,{key:"placeholder",isDisabled:f,isFocused:O}),b);if(d)return v.map(function(t){var a=t===y;return r.default.createElement(n,g({},l,{components:{Container:o,Label:u,Remove:i},isFocused:a,isDisabled:f,key:e.getOptionValue(t),removeProps:{onClick:function(){return e.removeValue(t)},onTouchEnd:function(){return e.removeValue(t)},onMouseDown:function(e){e.preventDefault(),e.stopPropagation()}},data:t}),e.formatOptionLabel(t,"value"))});if(h)return null;var E=v[0];return r.default.createElement(a,g({},l,{data:E,isDisabled:f}),this.formatOptionLabel(E,"value"))}},{key:"renderClearIndicator",value:function(){var e=this.components.ClearIndicator,t=this.commonProps,n=this.props,o=n.isDisabled,u=n.isLoading,i=this.state.isFocused;if(!this.isClearable()||!e||o||!this.hasValue()||u)return null;var a={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return r.default.createElement(e,g({},t,{innerProps:a,isFocused:i}))}},{key:"renderLoadingIndicator",value:function(){var e=this.components.LoadingIndicator,t=this.commonProps,n=this.props,o=n.isDisabled,u=n.isLoading,i=this.state.isFocused;if(!e||!u)return null;return r.default.createElement(e,g({},t,{innerProps:{"aria-hidden":"true"},isDisabled:o,isFocused:i}))}},{key:"renderIndicatorSeparator",value:function(){var e=this.components,t=e.DropdownIndicator,n=e.IndicatorSeparator;if(!t||!n)return null;var o=this.commonProps,u=this.props.isDisabled,i=this.state.isFocused;return r.default.createElement(n,g({},o,{isDisabled:u,isFocused:i}))}},{key:"renderDropdownIndicator",value:function(){var e=this.components.DropdownIndicator;if(!e)return null;var t=this.commonProps,n=this.props.isDisabled,o=this.state.isFocused,u={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return r.default.createElement(e,g({},t,{innerProps:u,isDisabled:n,isFocused:o}))}},{key:"renderMenu",value:function(){var e=this,t=this.components,n=t.Group,o=t.GroupHeading,i=t.Menu,a=t.MenuList,l=t.MenuPortal,c=t.LoadingMessage,p=t.NoOptionsMessage,f=t.Option,d=this.commonProps,h=this.state,b=h.focusedOption,m=h.menuOptions,y=this.props,O=y.captureMenuScroll,E=y.inputValue,S=y.isLoading,C=y.loadingMessage,w=y.minMenuHeight,P=y.maxMenuHeight,A=y.menuIsOpen,j=y.menuPlacement,D=y.menuPosition,M=y.menuPortalTarget,k=y.menuShouldBlockScroll,F=y.menuShouldScrollIntoView,x=y.noOptionsMessage,_=y.onMenuScrollToTop,I=y.onMenuScrollToBottom;if(!A)return null;var T,L=function(t){var n=b===t.data;return t.innerRef=n?e.getFocusedOptionRef:void 0,r.default.createElement(f,g({},d,t,{isFocused:n}),e.formatOptionLabel(t.data,"menu"))};if(this.hasOptions())T=m.render.map(function(t){if("group"===t.type){t.type;var u=v(t,["type"]),i="".concat(t.key,"-heading");return r.default.createElement(n,g({},d,u,{Heading:o,headingProps:{id:i},label:e.formatGroupLabel(t.data)}),t.options.map(function(e){return L(e)}))}if("option"===t.type)return L(t)});else if(S){var V=C({inputValue:E});if(null===V)return null;T=r.default.createElement(c,d,V)}else{var R=x({inputValue:E});if(null===R)return null;T=r.default.createElement(p,d,R)}var B={minMenuHeight:w,maxMenuHeight:P,menuPlacement:j,menuPosition:D,menuShouldScrollIntoView:F},H=r.default.createElement(u.MenuPlacer,g({},d,B),function(t){var n=t.ref,o=t.placerProps,u=o.placement,l=o.maxHeight;return r.default.createElement(i,g({},d,B,{innerRef:n,innerProps:{onMouseDown:e.onMenuMouseDown,onMouseMove:e.onMenuMouseMove},isLoading:S,placement:u}),r.default.createElement(s.ScrollCaptor,{isEnabled:O,onTopArrive:_,onBottomArrive:I},r.default.createElement(s.ScrollBlock,{isEnabled:k},r.default.createElement(a,g({},d,{innerRef:e.getMenuListRef,isLoading:S,maxHeight:l}),T))))});return M||"fixed"===D?r.default.createElement(l,g({},d,{appendTo:M,controlElement:this.controlRef,menuPlacement:j,menuPosition:D}),H):H}},{key:"renderFormField",value:function(){var e=this,t=this.props,n=t.delimiter,o=t.isDisabled,u=t.isMulti,i=t.name,a=this.state.selectValue;if(i&&!o){if(u){if(n){var s=a.map(function(t){return e.getOptionValue(t)}).join(n);return r.default.createElement("input",{name:i,type:"hidden",value:s})}var l=a.length>0?a.map(function(t,n){return r.default.createElement("input",{key:"i-".concat(n),name:i,type:"hidden",value:e.getOptionValue(t)})}):r.default.createElement("input",{name:i,type:"hidden"});return r.default.createElement("div",null,l)}var c=a[0]?this.getOptionValue(a[0]):"";return r.default.createElement("input",{name:i,type:"hidden",value:c})}}},{key:"renderLiveRegion",value:function(){return this.state.isFocused?r.default.createElement(s.A11yText,{"aria-live":"assertive"},r.default.createElement("p",{id:"aria-selection-event"}," ",this.state.ariaLiveSelection),r.default.createElement("p",{id:"aria-context"}," ",this.constructAriaLiveMessage())):null}},{key:"render",value:function(){var e=this.components,t=e.Control,n=e.IndicatorsContainer,o=e.SelectContainer,u=e.ValueContainer,i=this.props,a=i.className,s=i.id,l=i.isDisabled,c=i.menuIsOpen,p=this.state.isFocused,f=this.commonProps=this.getCommonProps();return r.default.createElement(o,g({},f,{className:a,innerProps:{id:s,onKeyDown:this.onKeyDown},isDisabled:l,isFocused:p}),this.renderLiveRegion(),r.default.createElement(t,g({},f,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:l,isFocused:p,menuIsOpen:c}),r.default.createElement(u,g({},f,{isDisabled:l}),this.renderPlaceholderOrValue(),this.renderInput()),r.default.createElement(n,g({},f,{isDisabled:l}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}])&&E(n.prototype,a),p&&E(n,p),t}();t.default=D,P(D,"defaultProps",A)},lQ6M:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.MultiValueRemove=t.MultiValueLabel=t.MultiValueContainer=t.MultiValueGeneric=t.multiValueRemoveCSS=t.multiValueLabelCSS=t.multiValueCSS=void 0;var r=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,n):{};r.get||r.set?Object.defineProperty(t,n,r):t[n]=e[n]}return t.default=e,t}(n("cDcd")),o=n("PAeb"),u=n("+URl");function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){s(e,t,n[t])})}return e}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function p(e,t,n){return t&&c(e.prototype,t),n&&c(e,n),e}function f(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function h(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&b(e,t)}function b(e,t){return(b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}t.multiValueCSS=function(e){var t=e.theme,n=t.spacing,r=t.borderRadius;return{backgroundColor:t.colors.neutral10,borderRadius:r/2,display:"flex",margin:n.baseUnit/2,minWidth:0}};t.multiValueLabelCSS=function(e){var t=e.theme,n=t.borderRadius,r=t.colors,o=e.cropWithEllipsis;return{borderRadius:n/2,color:r.neutral80,fontSize:"85%",overflow:"hidden",padding:3,paddingLeft:6,textOverflow:o?"ellipsis":null,whiteSpace:"nowrap"}};t.multiValueRemoveCSS=function(e){var t=e.theme,n=t.spacing,r=t.borderRadius,o=t.colors;return{alignItems:"center",borderRadius:r/2,backgroundColor:e.isFocused&&o.dangerLight,display:"flex",paddingLeft:n.baseUnit,paddingRight:n.baseUnit,":hover":{backgroundColor:o.dangerLight,color:o.danger}}};var m=function(e){var t=e.children,n=e.innerProps;return r.default.createElement("div",n,t)};t.MultiValueGeneric=m;var v=m;t.MultiValueContainer=v;var g=m;t.MultiValueLabel=g;var y=function(e){function t(){return l(this,t),f(this,d(t).apply(this,arguments))}return h(t,r.Component),p(t,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.innerProps;return r.default.createElement("div",n,t||r.default.createElement(u.CrossIcon,{size:14}))}}]),t}();t.MultiValueRemove=y;var O=function(e){function t(){return l(this,t),f(this,d(t).apply(this,arguments))}return h(t,r.Component),p(t,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,u=e.components,i=e.cx,s=e.data,l=e.getStyles,c=e.innerProps,p=e.isDisabled,f=e.removeProps,d=e.selectProps,h=u.Container,b=u.Label,m=u.Remove,v=a({className:i((0,o.css)(l("multiValue",this.props)),{"multi-value":!0,"multi-value--is-disabled":p},n)},c),g={className:i((0,o.css)(l("multiValueLabel",this.props)),{"multi-value__label":!0},n)},y=a({className:i((0,o.css)(l("multiValueRemove",this.props)),{"multi-value__remove":!0},n)},f);return r.default.createElement(h,{data:s,innerProps:v,selectProps:d},r.default.createElement(b,{data:s,innerProps:g,selectProps:d},t),r.default.createElement(m,{data:s,innerProps:y,selectProps:d}))}}]),t}();s(O,"defaultProps",{cropWithEllipsis:!0});var E=O;t.default=E},n929:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.GroupHeading=t.groupHeadingCSS=t.groupCSS=void 0;var r,o=(r=n("cDcd"))&&r.__esModule?r:{default:r},u=n("PAeb");function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){a(e,t,n[t])})}return e}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},u=Object.keys(e);for(r=0;r<u.length;r++)n=u[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(r=0;r<u.length;r++)n=u[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function l(){return(l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}t.groupCSS=function(e){var t=e.theme.spacing;return{paddingBottom:2*t.baseUnit,paddingTop:2*t.baseUnit}};t.groupHeadingCSS=function(e){var t=e.theme.spacing;return{color:"#999",cursor:"default",display:"block",fontSize:"75%",fontWeight:"500",marginBottom:"0.25em",paddingLeft:3*t.baseUnit,paddingRight:3*t.baseUnit,textTransform:"uppercase"}};t.GroupHeading=function(e){var t=e.className,n=e.cx,r=e.getStyles,a=e.theme,c=(e.selectProps,s(e,["className","cx","getStyles","theme","selectProps"]));return o.default.createElement("div",l({className:n((0,u.css)(r("groupHeading",i({theme:a},c))),{"group-heading":!0},t)},c))};var c=function(e){var t=e.children,n=e.className,r=e.cx,i=e.getStyles,a=e.Heading,s=e.headingProps,c=e.label,p=e.theme,f=e.selectProps;return o.default.createElement("div",{className:r((0,u.css)(i("group",e)),{group:!0},n)},o.default.createElement(a,l({},s,{selectProps:f,theme:p,getStyles:i,cx:r}),c),o.default.createElement("div",null,t))};t.default=c},oUUL:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.defaultProps=void 0;var r=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,n):{};r.get||r.set?Object.defineProperty(t,n,r):t[n]=e[n]}return t.default=e,t}(n("cDcd"));function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function u(){return(u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function i(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},u=Object.keys(e);for(r=0;r<u.length;r++)n=u[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(r=0;r<u.length;r++)n=u[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var f={defaultInputValue:"",defaultMenuIsOpen:!1,defaultValue:null};t.defaultProps=f;var d=function(e){var t,n;return n=t=function(t){function n(){var e,t,r,u;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);for(var i=arguments.length,a=new Array(i),l=0;l<i;l++)a[l]=arguments[l];return r=this,u=(e=s(n)).call.apply(e,[this].concat(a)),t=!u||"object"!==o(u)&&"function"!=typeof u?c(r):u,p(c(c(t)),"select",void 0),p(c(c(t)),"state",{inputValue:void 0!==t.props.inputValue?t.props.inputValue:t.props.defaultInputValue,menuIsOpen:void 0!==t.props.menuIsOpen?t.props.menuIsOpen:t.props.defaultMenuIsOpen,value:void 0!==t.props.value?t.props.value:t.props.defaultValue}),p(c(c(t)),"onChange",function(e,n){t.callProp("onChange",e,n),t.setState({value:e})}),p(c(c(t)),"onInputChange",function(e,n){var r=t.callProp("onInputChange",e,n);t.setState({inputValue:void 0!==r?r:e})}),p(c(c(t)),"onMenuOpen",function(){t.callProp("onMenuOpen"),t.setState({menuIsOpen:!0})}),p(c(c(t)),"onMenuClose",function(){t.callProp("onMenuClose"),t.setState({menuIsOpen:!1})}),t}var f,d,h;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(n,r.Component),f=n,(d=[{key:"focus",value:function(){this.select.focus()}},{key:"blur",value:function(){this.select.blur()}},{key:"getProp",value:function(e){return void 0!==this.props[e]?this.props[e]:this.state[e]}},{key:"callProp",value:function(e){if("function"==typeof this.props[e]){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return(t=this.props)[e].apply(t,r)}}},{key:"render",value:function(){var t=this,n=this.props,o=(n.defaultInputValue,n.defaultMenuIsOpen,n.defaultValue,i(n,["defaultInputValue","defaultMenuIsOpen","defaultValue"]));return r.default.createElement(e,u({},o,{ref:function(e){t.select=e},inputValue:this.getProp("inputValue"),menuIsOpen:this.getProp("menuIsOpen"),onChange:this.onChange,onInputChange:this.onInputChange,onMenuClose:this.onMenuClose,onMenuOpen:this.onMenuOpen,value:this.getProp("value")}))}}])&&a(f.prototype,d),h&&a(f,h),n}(),p(t,"defaultProps",f),n};t.default=d},oZmp:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isOptionDisabled=t.getOptionValue=t.getOptionLabel=t.formatGroupLabel=void 0;t.formatGroupLabel=function(e){return e.label};t.getOptionLabel=function(e){return e.label};t.getOptionValue=function(e){return e.value};t.isOptionDisabled=function(e){return!!e.isDisabled}},oj4i:function(e,t,n){"use strict";var r=function(e){var t={};return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}},o={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,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};var u=function(e){for(var t,n=e.length,r=n^n,o=0;n>=4;)t=1540483477*(65535&(t=255&e.charCodeAt(o)|(255&e.charCodeAt(++o))<<8|(255&e.charCodeAt(++o))<<16|(255&e.charCodeAt(++o))<<24))+((1540483477*(t>>>16)&65535)<<16),r=1540483477*(65535&r)+((1540483477*(r>>>16)&65535)<<16)^(t=1540483477*(65535&(t^=t>>>24))+((1540483477*(t>>>16)&65535)<<16)),n-=4,++o;switch(n){case 3:r^=(255&e.charCodeAt(o+2))<<16;case 2:r^=(255&e.charCodeAt(o+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(o)))+((1540483477*(r>>>16)&65535)<<16)}return r=1540483477*(65535&(r^=r>>>13))+((1540483477*(r>>>16)&65535)<<16),((r^=r>>>15)>>>0).toString(36)};var i=function(e){function t(e,t,r){var o=t.trim().split(h);t=o;var u=o.length,i=e.length;switch(i){case 0:case 1:var a=0;for(e=0===i?"":e[0]+" ";a<u;++a)t[a]=n(e,t[a],r).trim();break;default:var s=a=0;for(t=[];a<u;++a)for(var l=0;l<i;++l)t[s++]=n(e[l]+" ",o[a],r).trim()}return t}function n(e,t,n){var r=t.charCodeAt(0);switch(33>r&&(r=(t=t.trim()).charCodeAt(0)),r){case 38:return t.replace(b,"$1"+e.trim());case 58:return e.trim()+t.replace(b,"$1"+e.trim());default:if(0<1*n&&0<t.indexOf("\f"))return t.replace(b,(58===e.charCodeAt(0)?"":"$1")+e.trim())}return e+t}function r(e,t,n,u){var i=e+";",a=2*t+3*n+4*u;if(944===a){e=i.indexOf(":",9)+1;var s=i.substring(e,i.length-1).trim();return s=i.substring(0,e).trim()+s+";",1===M||2===M&&o(s,1)?"-webkit-"+s+s:s}if(0===M||2===M&&!o(i,1))return i;switch(a){case 1015:return 97===i.charCodeAt(10)?"-webkit-"+i+i:i;case 951:return 116===i.charCodeAt(3)?"-webkit-"+i+i:i;case 963:return 110===i.charCodeAt(5)?"-webkit-"+i+i:i;case 1009:if(100!==i.charCodeAt(4))break;case 969:case 942:return"-webkit-"+i+i;case 978:return"-webkit-"+i+"-moz-"+i+i;case 1019:case 983:return"-webkit-"+i+"-moz-"+i+"-ms-"+i+i;case 883:if(45===i.charCodeAt(8))return"-webkit-"+i+i;if(0<i.indexOf("image-set(",11))return i.replace(P,"$1-webkit-$2")+i;break;case 932:if(45===i.charCodeAt(4))switch(i.charCodeAt(5)){case 103:return"-webkit-box-"+i.replace("-grow","")+"-webkit-"+i+"-ms-"+i.replace("grow","positive")+i;case 115:return"-webkit-"+i+"-ms-"+i.replace("shrink","negative")+i;case 98:return"-webkit-"+i+"-ms-"+i.replace("basis","preferred-size")+i}return"-webkit-"+i+"-ms-"+i+i;case 964:return"-webkit-"+i+"-ms-flex-"+i+i;case 1023:if(99!==i.charCodeAt(8))break;return"-webkit-box-pack"+(s=i.substring(i.indexOf(":",15)).replace("flex-","").replace("space-between","justify"))+"-webkit-"+i+"-ms-flex-pack"+s+i;case 1005:return f.test(i)?i.replace(p,":-webkit-")+i.replace(p,":-moz-")+i:i;case 1e3:switch(t=(s=i.substring(13).trim()).indexOf("-")+1,s.charCodeAt(0)+s.charCodeAt(t)){case 226:s=i.replace(y,"tb");break;case 232:s=i.replace(y,"tb-rl");break;case 220:s=i.replace(y,"lr");break;default:return i}return"-webkit-"+i+"-ms-"+s+i;case 1017:if(-1===i.indexOf("sticky",9))break;case 975:switch(t=(i=e).length-10,a=(s=(33===i.charCodeAt(t)?i.substring(0,t):i).substring(e.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|s.charCodeAt(7))){case 203:if(111>s.charCodeAt(8))break;case 115:i=i.replace(s,"-webkit-"+s)+";"+i;break;case 207:case 102:i=i.replace(s,"-webkit-"+(102<a?"inline-":"")+"box")+";"+i.replace(s,"-webkit-"+s)+";"+i.replace(s,"-ms-"+s+"box")+";"+i}return i+";";case 938:if(45===i.charCodeAt(5))switch(i.charCodeAt(6)){case 105:return s=i.replace("-items",""),"-webkit-"+i+"-webkit-box-"+s+"-ms-flex-"+s+i;case 115:return"-webkit-"+i+"-ms-flex-item-"+i.replace(S,"")+i;default:return"-webkit-"+i+"-ms-flex-line-pack"+i.replace("align-content","").replace(S,"")+i}break;case 973:case 989:if(45!==i.charCodeAt(3)||122===i.charCodeAt(4))break;case 931:case 953:if(!0===w.test(e))return 115===(s=e.substring(e.indexOf(":")+1)).charCodeAt(0)?r(e.replace("stretch","fill-available"),t,n,u).replace(":fill-available",":stretch"):i.replace(s,"-webkit-"+s)+i.replace(s,"-moz-"+s.replace("fill-",""))+i;break;case 962:if(i="-webkit-"+i+(102===i.charCodeAt(5)?"-ms-"+i:"")+i,211===n+u&&105===i.charCodeAt(13)&&0<i.indexOf("transform",10))return i.substring(0,i.indexOf(";",27)+1).replace(d,"$1-webkit-$2")+i}return i}function o(e,t){var n=e.indexOf(1===t?":":"{"),r=e.substring(0,3!==t?n:10);return n=e.substring(n+1,e.length-1),_(2!==t?r:r.replace(C,"$1"),n,t)}function u(e,t){var n=r(t,t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2));return n!==t+";"?n.replace(E," or ($1)").substring(4):"("+t+")"}function i(e,t,n,r,o,u,i,a,l,c){for(var p,f=0,d=t;f<x;++f)switch(p=F[f].call(s,e,d,n,r,o,u,i,a,l,c)){case void 0:case!1:case!0:case null:break;default:d=p}if(d!==t)return d}function a(e){return void 0!==(e=e.prefix)&&(_=null,e?"function"!=typeof e?M=1:(M=2,_=e):M=0),a}function s(e,n){var a=e;if(33>a.charCodeAt(0)&&(a=a.trim()),a=[a],0<x){var s=i(-1,n,a,a,j,A,0,0,0,0);void 0!==s&&"string"==typeof s&&(n=s)}var p=function e(n,a,s,p,f){for(var d,h,b,y,E,S=0,C=0,w=0,P=0,F=0,_=0,T=b=d=0,L=0,V=0,R=0,B=0,H=s.length,N=H-1,U="",W="",z="",G="";L<H;){if(h=s.charCodeAt(L),L===N&&0!==C+P+w+S&&(0!==C&&(h=47===C?10:47),P=w=S=0,H++,N++),0===C+P+w+S){if(L===N&&(0<V&&(U=U.replace(c,"")),0<U.trim().length)){switch(h){case 32:case 9:case 59:case 13:case 10:break;default:U+=s.charAt(L)}h=59}switch(h){case 123:for(d=(U=U.trim()).charCodeAt(0),b=1,B=++L;L<H;){switch(h=s.charCodeAt(L)){case 123:b++;break;case 125:b--;break;case 47:switch(h=s.charCodeAt(L+1)){case 42:case 47:e:{for(T=L+1;T<N;++T)switch(s.charCodeAt(T)){case 47:if(42===h&&42===s.charCodeAt(T-1)&&L+2!==T){L=T+1;break e}break;case 10:if(47===h){L=T+1;break e}}L=T}}break;case 91:h++;case 40:h++;case 34:case 39:for(;L++<N&&s.charCodeAt(L)!==h;);}if(0===b)break;L++}switch(b=s.substring(B,L),0===d&&(d=(U=U.replace(l,"").trim()).charCodeAt(0)),d){case 64:switch(0<V&&(U=U.replace(c,"")),h=U.charCodeAt(1)){case 100:case 109:case 115:case 45:V=a;break;default:V=k}if(B=(b=e(a,V,b,h,f+1)).length,0<x&&(E=i(3,b,V=t(k,U,R),a,j,A,B,h,f,p),U=V.join(""),void 0!==E&&0===(B=(b=E.trim()).length)&&(h=0,b="")),0<B)switch(h){case 115:U=U.replace(O,u);case 100:case 109:case 45:b=U+"{"+b+"}";break;case 107:b=(U=U.replace(m,"$1 $2"))+"{"+b+"}",b=1===M||2===M&&o("@"+b,3)?"@-webkit-"+b+"@"+b:"@"+b;break;default:b=U+b,112===p&&(W+=b,b="")}else b="";break;default:b=e(a,t(a,U,R),b,p,f+1)}z+=b,b=R=V=T=d=0,U="",h=s.charCodeAt(++L);break;case 125:case 59:if(1<(B=(U=(0<V?U.replace(c,""):U).trim()).length))switch(0===T&&(d=U.charCodeAt(0),45===d||96<d&&123>d)&&(B=(U=U.replace(" ",":")).length),0<x&&void 0!==(E=i(1,U,a,n,j,A,W.length,p,f,p))&&0===(B=(U=E.trim()).length)&&(U="\0\0"),d=U.charCodeAt(0),h=U.charCodeAt(1),d){case 0:break;case 64:if(105===h||99===h){G+=U+s.charAt(L);break}default:58!==U.charCodeAt(B-1)&&(W+=r(U,d,h,U.charCodeAt(2)))}R=V=T=d=0,U="",h=s.charCodeAt(++L)}}switch(h){case 13:case 10:47===C?C=0:0===1+d&&107!==p&&0<U.length&&(V=1,U+="\0"),0<x*I&&i(0,U,a,n,j,A,W.length,p,f,p),A=1,j++;break;case 59:case 125:if(0===C+P+w+S){A++;break}default:switch(A++,y=s.charAt(L),h){case 9:case 32:if(0===P+S+C)switch(F){case 44:case 58:case 9:case 32:y="";break;default:32!==h&&(y=" ")}break;case 0:y="\\0";break;case 12:y="\\f";break;case 11:y="\\v";break;case 38:0===P+C+S&&(V=R=1,y="\f"+y);break;case 108:if(0===P+C+S+D&&0<T)switch(L-T){case 2:112===F&&58===s.charCodeAt(L-3)&&(D=F);case 8:111===_&&(D=_)}break;case 58:0===P+C+S&&(T=L);break;case 44:0===C+w+P+S&&(V=1,y+="\r");break;case 34:case 39:0===C&&(P=P===h?0:0===P?h:P);break;case 91:0===P+C+w&&S++;break;case 93:0===P+C+w&&S--;break;case 41:0===P+C+S&&w--;break;case 40:if(0===P+C+S){if(0===d)switch(2*F+3*_){case 533:break;default:d=1}w++}break;case 64:0===C+w+P+S+T+b&&(b=1);break;case 42:case 47:if(!(0<P+S+w))switch(C){case 0:switch(2*h+3*s.charCodeAt(L+1)){case 235:C=47;break;case 220:B=L,C=42}break;case 42:47===h&&42===F&&B+2!==L&&(33===s.charCodeAt(B+2)&&(W+=s.substring(B,L+1)),y="",C=0)}}0===C&&(U+=y)}_=F,F=h,L++}if(0<(B=W.length)){if(V=a,0<x&&void 0!==(E=i(2,W,V,n,j,A,B,p,f,p))&&0===(W=E).length)return G+W+z;if(W=V.join(",")+"{"+W+"}",0!=M*D){switch(2!==M||o(W,2)||(D=0),D){case 111:W=W.replace(g,":-moz-$1")+W;break;case 112:W=W.replace(v,"::-webkit-input-$1")+W.replace(v,"::-moz-$1")+W.replace(v,":-ms-input-$1")+W}D=0}}return G+W+z}(k,a,n,0,0);return 0<x&&void 0!==(s=i(-2,p,a,a,j,A,p.length,0,0,0))&&(p=s),D=0,A=j=1,p}var l=/^\0+/g,c=/[\0\r\f]/g,p=/: */g,f=/zoo|gra/,d=/([,: ])(transform)/g,h=/,\r+?/g,b=/([\t\r\n ])*\f?&/g,m=/@(k\w+)\s*(\S*)\s*/,v=/::(place)/g,g=/:(read-only)/g,y=/[svh]\w+-[tblr]{2}/,O=/\(\s*(.*)\s*\)/g,E=/([\s\S]*?);/g,S=/-self|flex-/g,C=/[^]*?(:[rp][el]a[\w-]+)[^]*/,w=/stretch|:\s*\w+\-(?:conte|avail)/,P=/([^-])(image-set\()/,A=1,j=1,D=0,M=1,k=[],F=[],x=0,_=null,I=0;return s.use=function e(t){switch(t){case void 0:case null:x=F.length=0;break;default:switch(t.constructor){case Array:for(var n=0,r=t.length;n<r;++n)e(t[n]);break;case Function:F[x++]=t;break;case Boolean:I=0|!!t}}return e},s.set=a,void 0!==e&&a(e),s},a=n("TAZq"),s=n.n(a),l=/[A-Z]|^ms/g,c=r(function(e){return e.replace(l,"-$&").toLowerCase()}),p=function(e,t){return null==t||"boolean"==typeof t?"":1===o[e]||45===e.charCodeAt(1)||isNaN(t)||0===t?t:t+"px"},f=function e(t){for(var n=t.length,r=0,o="";r<n;r++){var u=t[r];if(null!=u){var i=void 0;switch(typeof u){case"boolean":break;case"function":0,i=e([u()]);break;case"object":if(Array.isArray(u))i=e(u);else for(var a in i="",u)u[a]&&a&&(i&&(i+=" "),i+=a);break;default:i=u}i&&(o&&(o+=" "),o+=i)}}return o},d="undefined"!=typeof document;function h(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key||""),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),(void 0!==e.container?e.container:document.head).appendChild(t),t}var b=function(){function e(e){this.isSpeedy=!0,this.tags=[],this.ctr=0,this.opts=e}var t=e.prototype;return t.inject=function(){if(this.injected)throw new Error("already injected!");this.tags[0]=h(this.opts),this.injected=!0},t.speedy=function(e){if(0!==this.ctr)throw new Error("cannot change speedy now");this.isSpeedy=!!e},t.insert=function(e,t){if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(this.tags[this.tags.length-1]);try{n.insertRule(e,n.cssRules.length)}catch(e){0}}else{var r=h(this.opts);this.tags.push(r),r.appendChild(document.createTextNode(e+(t||"")))}this.ctr++,this.ctr%65e3==0&&this.tags.push(h(this.opts))},t.flush=function(){this.tags.forEach(function(e){return e.parentNode.removeChild(e)}),this.tags=[],this.ctr=0,this.injected=!1},e}();t.a=function(e,t){if(void 0!==e.__SECRET_EMOTION__)return e.__SECRET_EMOTION__;void 0===t&&(t={});var n,r,o=t.key||"css",a=s()(function(e){n+=e,d&&h.insert(e,v)});void 0!==t.prefix&&(r={prefix:t.prefix});var l={registered:{},inserted:{},nonce:t.nonce,key:o},h=new b(t);d&&h.inject();var m=new i(r);m.use(t.stylisPlugins)(a);var v="";function g(e,t){if(null==e)return"";switch(typeof e){case"boolean":return"";case"function":if(void 0!==e.__emotion_styles){var n=e.toString();return n}return g.call(this,void 0===this?e():e(this.mergedProps,this.context),t);case"object":return function(e){if(E.has(e))return E.get(e);var t="";return Array.isArray(e)?e.forEach(function(e){t+=g.call(this,e,!1)},this):Object.keys(e).forEach(function(n){"object"!=typeof e[n]?void 0!==l.registered[e[n]]?t+=n+"{"+l.registered[e[n]]+"}":t+=c(n)+":"+p(n,e[n])+";":Array.isArray(e[n])&&"string"==typeof e[n][0]&&void 0===l.registered[e[n][0]]?e[n].forEach(function(e){t+=c(n)+":"+p(n,e)+";"}):t+=n+"{"+g.call(this,e[n],!1)+"}"},this),E.set(e,t),t}.call(this,e);default:var r=l.registered[e];return!1===t&&void 0!==r?r:e}}var y,O,E=new WeakMap,S=/label:\s*([^\s;\n{]+)\s*;/g,C=function(e){var t=!0,n="",r="";null==e||void 0===e.raw?(t=!1,n+=g.call(this,e,!1)):n+=e[0];for(var o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];return i.forEach(function(r,o){n+=g.call(this,r,46===n.charCodeAt(n.length-1)),!0===t&&void 0!==e[o+1]&&(n+=e[o+1])},this),O=n,n=n.replace(S,function(e,t){return r+="-"+t,""}),y=function(e,t){return u(e+t)+t}(n,r),n};function w(e,t){void 0===l.inserted[y]&&(n="",m(e,t),l.inserted[y]=n)}var P=function(){var e=C.apply(this,arguments),t=o+"-"+y;return void 0===l.registered[t]&&(l.registered[t]=O),w("."+t,e),t};function A(e,t){var n="";return t.split(" ").forEach(function(t){void 0!==l.registered[t]?e.push(t):n+=t+" "}),n}function j(e,t){var n=[],r=A(n,e);return n.length<2?e:r+P(n,t)}function D(e){l.inserted[e]=!0}if(d){var M=document.querySelectorAll("[data-emotion-"+o+"]");Array.prototype.forEach.call(M,function(e){h.tags[0].parentNode.insertBefore(e,h.tags[0]),e.getAttribute("data-emotion-"+o).split(" ").forEach(D)})}var k={flush:function(){d&&(h.flush(),h.inject()),l.inserted={},l.registered={}},hydrate:function(e){e.forEach(D)},cx:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return j(f(t))},merge:j,getRegisteredStyles:A,injectGlobal:function(){w("",C.apply(this,arguments))},keyframes:function(){var e=C.apply(this,arguments),t="animation-"+y;return w("","@keyframes "+t+"{"+e+"}"),t},css:P,sheet:h,caches:l};return e.__SECRET_EMOTION__=k,k}},rc6b:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.css=void 0;var r,o=(r=n("cDcd"))&&r.__esModule?r:{default:r},u=n("PAeb");function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}t.css=function(e){var t=e.isDisabled,n=e.isFocused,r=e.theme,o=r.colors,u=r.borderRadius,i=r.spacing;return{alignItems:"center",backgroundColor:t?o.neutral5:o.neutral0,borderColor:t?o.neutral10:n?o.primary:o.neutral20,borderRadius:u,borderStyle:"solid",borderWidth:1,boxShadow:n?"0 0 0 1px ".concat(o.primary):null,cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:i.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms","&:hover":{borderColor:n?o.primary:o.neutral30}}};var a=function(e){var t=e.children,n=e.cx,r=e.getStyles,a=e.className,s=e.isDisabled,l=e.isFocused,c=e.innerRef,p=e.innerProps,f=e.menuIsOpen;return o.default.createElement("div",i({ref:c,className:n((0,u.css)(r("control",e)),{control:!0,"control--is-disabled":s,"control--is-focused":l,"control--menu-is-open":f},a)},p),t)};t.default=a},tJT6:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"A11yText",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"DummyInput",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"NodeResolver",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"ScrollBlock",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"ScrollCaptor",{enumerable:!0,get:function(){return a.default}});var r=s(n("/+00")),o=s(n("H6Zs")),u=s(n("N3bB")),i=s(n("QcsS")),a=s(n("d6Hc"));function s(e){return e&&e.__esModule?e:{default:e}}},xEkU:function(e,t,n){(function(t){for(var r=n("bQgK"),o="undefined"==typeof window?t:window,u=["moz","webkit"],i="AnimationFrame",a=o["request"+i],s=o["cancel"+i]||o["cancelRequest"+i],l=0;!a&&l<u.length;l++)a=o[u[l]+"Request"+i],s=o[u[l]+"Cancel"+i]||o[u[l]+"CancelRequest"+i];if(!a||!s){var c=0,p=0,f=[];a=function(e){if(0===f.length){var t=r(),n=Math.max(0,1e3/60-(t-c));c=n+t,setTimeout(function(){var e=f.slice(0);f.length=0;for(var t=0;t<e.length;t++)if(!e[t].cancelled)try{e[t].callback(c)}catch(e){setTimeout(function(){throw e},0)}},Math.round(n))}return f.push({handle:++p,callback:e,cancelled:!1}),p},s=function(e){for(var t=0;t<f.length;t++)f[t].handle===e&&(f[t].cancelled=!0)}}e.exports=function(e){return a.call(o,e)},e.exports.cancel=function(){s.apply(o,arguments)},e.exports.polyfill=function(e){e||(e=o),e.requestAnimationFrame=a,e.cancelAnimationFrame=s}}).call(this,n("yLpj"))},yLpj:function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n}}]);
1
+ (window.itsecWebpackJsonP=window.itsecWebpackJsonP||[]).push([[8],{FUBA:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n("cDcd"),u=s(i),a=s(n("17x9"));function s(e){return e&&e.__esModule?e:{default:e}}var l={position:"absolute",top:0,left:0,visibility:"hidden",height:0,overflow:"scroll",whiteSpace:"pre"},c=["extraWidth","injectStyles","inputClassName","inputRef","inputStyle","minWidth","onAutosize","placeholderIsMinWidth"],p=function(e,t){t.style.fontSize=e.fontSize,t.style.fontFamily=e.fontFamily,t.style.fontWeight=e.fontWeight,t.style.fontStyle=e.fontStyle,t.style.letterSpacing=e.letterSpacing,t.style.textTransform=e.textTransform},d=!("undefined"==typeof window||!window.navigator)&&/MSIE |Trident\/|Edge\//.test(window.navigator.userAgent),f=function(){return d?"_"+Math.random().toString(36).substr(2,12):void 0},h=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.inputRef=function(e){n.input=e,"function"==typeof n.props.inputRef&&n.props.inputRef(e)},n.placeHolderSizerRef=function(e){n.placeHolderSizer=e},n.sizerRef=function(e){n.sizer=e},n.state={inputWidth:e.minWidth,inputId:e.id||f()},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.Component),o(t,[{key:"componentDidMount",value:function(){this.mounted=!0,this.copyInputStyles(),this.updateInputWidth()}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){var t=e.id;t!==this.props.id&&this.setState({inputId:t||f()})}},{key:"componentDidUpdate",value:function(e,t){t.inputWidth!==this.state.inputWidth&&"function"==typeof this.props.onAutosize&&this.props.onAutosize(this.state.inputWidth),this.updateInputWidth()}},{key:"componentWillUnmount",value:function(){this.mounted=!1}},{key:"copyInputStyles",value:function(){if(this.mounted&&window.getComputedStyle){var e=this.input&&window.getComputedStyle(this.input);e&&(p(e,this.sizer),this.placeHolderSizer&&p(e,this.placeHolderSizer))}}},{key:"updateInputWidth",value:function(){if(this.mounted&&this.sizer&&void 0!==this.sizer.scrollWidth){var e=void 0;e=this.props.placeholder&&(!this.props.value||this.props.value&&this.props.placeholderIsMinWidth)?Math.max(this.sizer.scrollWidth,this.placeHolderSizer.scrollWidth)+2:this.sizer.scrollWidth+2,(e+="number"===this.props.type&&void 0===this.props.extraWidth?16:parseInt(this.props.extraWidth)||0)<this.props.minWidth&&(e=this.props.minWidth),e!==this.state.inputWidth&&this.setState({inputWidth:e})}}},{key:"getInput",value:function(){return this.input}},{key:"focus",value:function(){this.input.focus()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"renderStyles",value:function(){var e=this.props.injectStyles;return d&&e?u.default.createElement("style",{dangerouslySetInnerHTML:{__html:"input#"+this.state.inputId+"::-ms-clear {display: none;}"}}):null}},{key:"render",value:function(){var e=[this.props.defaultValue,this.props.value,""].reduce(function(e,t){return null!=e?e:t}),t=r({},this.props.style);t.display||(t.display="inline-block");var n=r({boxSizing:"content-box",width:this.state.inputWidth+"px"},this.props.inputStyle),o=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(this.props,[]);return function(e){c.forEach(function(t){return delete e[t]})}(o),o.className=this.props.inputClassName,o.id=this.state.inputId,o.style=n,u.default.createElement("div",{className:this.props.className,style:t},this.renderStyles(),u.default.createElement("input",r({},o,{ref:this.inputRef})),u.default.createElement("div",{ref:this.sizerRef,style:l},e),this.props.placeholder?u.default.createElement("div",{ref:this.placeHolderSizerRef,style:l},this.props.placeholder):null)}}]),t}();h.propTypes={className:a.default.string,defaultValue:a.default.any,extraWidth:a.default.oneOfType([a.default.number,a.default.string]),id:a.default.string,injectStyles:a.default.bool,inputClassName:a.default.string,inputRef:a.default.func,inputStyle:a.default.object,minWidth:a.default.oneOfType([a.default.number,a.default.string]),onAutosize:a.default.func,onChange:a.default.func,placeholder:a.default.string,placeholderIsMinWidth:a.default.bool,style:a.default.object,value:a.default.any},h.defaultProps={minWidth:1,injectStyles:!0},t.default=h},VbXa:function(e,t){e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}},YK1D:function(e,t,n){"use strict";n.r(t);var r=n("cDcd"),o=n.n(r),i=n("VbXa"),u=n.n(i);var a=function(){function e(e){this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.before=null}var t=e.prototype;return t.insert=function(e){if(this.ctr%(this.isSpeedy?65e3:1)==0){var t,n=function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t}(this);t=0===this.tags.length?this.before:this.tags[this.tags.length-1].nextSibling,this.container.insertBefore(n,t),this.tags.push(n)}var r=this.tags[this.tags.length-1];if(this.isSpeedy){var o=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(r);try{var i=105===e.charCodeAt(1)&&64===e.charCodeAt(0);o.insertRule(e,i?0:o.cssRules.length)}catch(e){0}}else r.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach(function(e){return e.parentNode.removeChild(e)}),this.tags=[],this.ctr=0},e}();var s=function(e){function t(e,t,r){var o=t.trim().split(h);t=o;var i=o.length,u=e.length;switch(u){case 0:case 1:var a=0;for(e=0===u?"":e[0]+" ";a<i;++a)t[a]=n(e,t[a],r).trim();break;default:var s=a=0;for(t=[];a<i;++a)for(var l=0;l<u;++l)t[s++]=n(e[l]+" ",o[a],r).trim()}return t}function n(e,t,n){var r=t.charCodeAt(0);switch(33>r&&(r=(t=t.trim()).charCodeAt(0)),r){case 38:return t.replace(m,"$1"+e.trim());case 58:return e.trim()+t.replace(m,"$1"+e.trim());default:if(0<1*n&&0<t.indexOf("\f"))return t.replace(m,(58===e.charCodeAt(0)?"":"$1")+e.trim())}return e+t}function r(e,t,n,i){var u=e+";",a=2*t+3*n+4*i;if(944===a){e=u.indexOf(":",9)+1;var s=u.substring(e,u.length-1).trim();return s=u.substring(0,e).trim()+s+";",1===k||2===k&&o(s,1)?"-webkit-"+s+s:s}if(0===k||2===k&&!o(u,1))return u;switch(a){case 1015:return 97===u.charCodeAt(10)?"-webkit-"+u+u:u;case 951:return 116===u.charCodeAt(3)?"-webkit-"+u+u:u;case 963:return 110===u.charCodeAt(5)?"-webkit-"+u+u:u;case 1009:if(100!==u.charCodeAt(4))break;case 969:case 942:return"-webkit-"+u+u;case 978:return"-webkit-"+u+"-moz-"+u+u;case 1019:case 983:return"-webkit-"+u+"-moz-"+u+"-ms-"+u+u;case 883:if(45===u.charCodeAt(8))return"-webkit-"+u+u;if(0<u.indexOf("image-set(",11))return u.replace(w,"$1-webkit-$2")+u;break;case 932:if(45===u.charCodeAt(4))switch(u.charCodeAt(5)){case 103:return"-webkit-box-"+u.replace("-grow","")+"-webkit-"+u+"-ms-"+u.replace("grow","positive")+u;case 115:return"-webkit-"+u+"-ms-"+u.replace("shrink","negative")+u;case 98:return"-webkit-"+u+"-ms-"+u.replace("basis","preferred-size")+u}return"-webkit-"+u+"-ms-"+u+u;case 964:return"-webkit-"+u+"-ms-flex-"+u+u;case 1023:if(99!==u.charCodeAt(8))break;return"-webkit-box-pack"+(s=u.substring(u.indexOf(":",15)).replace("flex-","").replace("space-between","justify"))+"-webkit-"+u+"-ms-flex-pack"+s+u;case 1005:return d.test(u)?u.replace(p,":-webkit-")+u.replace(p,":-moz-")+u:u;case 1e3:switch(t=(s=u.substring(13).trim()).indexOf("-")+1,s.charCodeAt(0)+s.charCodeAt(t)){case 226:s=u.replace(E,"tb");break;case 232:s=u.replace(E,"tb-rl");break;case 220:s=u.replace(E,"lr");break;default:return u}return"-webkit-"+u+"-ms-"+s+u;case 1017:if(-1===u.indexOf("sticky",9))break;case 975:switch(t=(u=e).length-10,a=(s=(33===u.charCodeAt(t)?u.substring(0,t):u).substring(e.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|s.charCodeAt(7))){case 203:if(111>s.charCodeAt(8))break;case 115:u=u.replace(s,"-webkit-"+s)+";"+u;break;case 207:case 102:u=u.replace(s,"-webkit-"+(102<a?"inline-":"")+"box")+";"+u.replace(s,"-webkit-"+s)+";"+u.replace(s,"-ms-"+s+"box")+";"+u}return u+";";case 938:if(45===u.charCodeAt(5))switch(u.charCodeAt(6)){case 105:return s=u.replace("-items",""),"-webkit-"+u+"-webkit-box-"+s+"-ms-flex-"+s+u;case 115:return"-webkit-"+u+"-ms-flex-item-"+u.replace(C,"")+u;default:return"-webkit-"+u+"-ms-flex-line-pack"+u.replace("align-content","").replace(C,"")+u}break;case 973:case 989:if(45!==u.charCodeAt(3)||122===u.charCodeAt(4))break;case 931:case 953:if(!0===F.test(e))return 115===(s=e.substring(e.indexOf(":")+1)).charCodeAt(0)?r(e.replace("stretch","fill-available"),t,n,i).replace(":fill-available",":stretch"):u.replace(s,"-webkit-"+s)+u.replace(s,"-moz-"+s.replace("fill-",""))+u;break;case 962:if(u="-webkit-"+u+(102===u.charCodeAt(5)?"-ms-"+u:"")+u,211===n+i&&105===u.charCodeAt(13)&&0<u.indexOf("transform",10))return u.substring(0,u.indexOf(";",27)+1).replace(f,"$1-webkit-$2")+u}return u}function o(e,t){var n=e.indexOf(1===t?":":"{"),r=e.substring(0,3!==t?n:10);return n=e.substring(n+1,e.length-1),L(2!==t?r:r.replace(A,"$1"),n,t)}function i(e,t){var n=r(t,t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2));return n!==t+";"?n.replace(O," or ($1)").substring(4):"("+t+")"}function u(e,t,n,r,o,i,u,a,l,c){for(var p,d=0,f=t;d<P;++d)switch(p=M[d].call(s,e,f,n,r,o,i,u,a,l,c)){case void 0:case!1:case!0:case null:break;default:f=p}if(f!==t)return f}function a(e){return void 0!==(e=e.prefix)&&(L=null,e?"function"!=typeof e?k=1:(k=2,L=e):k=0),a}function s(e,n){var a=e;if(33>a.charCodeAt(0)&&(a=a.trim()),a=[a],0<P){var s=u(-1,n,a,a,x,S,0,0,0,0);void 0!==s&&"string"==typeof s&&(n=s)}var p=function e(n,a,s,p,d){for(var f,h,m,E,O,C=0,A=0,F=0,w=0,M=0,L=0,R=m=f=0,T=0,B=0,j=0,H=0,N=s.length,_=N-1,U="",W="",z="",G="";T<N;){if(h=s.charCodeAt(T),T===_&&0!==A+w+F+C&&(0!==A&&(h=47===A?10:47),w=F=C=0,N++,_++),0===A+w+F+C){if(T===_&&(0<B&&(U=U.replace(c,"")),0<U.trim().length)){switch(h){case 32:case 9:case 59:case 13:case 10:break;default:U+=s.charAt(T)}h=59}switch(h){case 123:for(f=(U=U.trim()).charCodeAt(0),m=1,H=++T;T<N;){switch(h=s.charCodeAt(T)){case 123:m++;break;case 125:m--;break;case 47:switch(h=s.charCodeAt(T+1)){case 42:case 47:e:{for(R=T+1;R<_;++R)switch(s.charCodeAt(R)){case 47:if(42===h&&42===s.charCodeAt(R-1)&&T+2!==R){T=R+1;break e}break;case 10:if(47===h){T=R+1;break e}}T=R}}break;case 91:h++;case 40:h++;case 34:case 39:for(;T++<_&&s.charCodeAt(T)!==h;);}if(0===m)break;T++}switch(m=s.substring(H,T),0===f&&(f=(U=U.replace(l,"").trim()).charCodeAt(0)),f){case 64:switch(0<B&&(U=U.replace(c,"")),h=U.charCodeAt(1)){case 100:case 109:case 115:case 45:B=a;break;default:B=I}if(H=(m=e(a,B,m,h,d+1)).length,0<P&&(O=u(3,m,B=t(I,U,j),a,x,S,H,h,d,p),U=B.join(""),void 0!==O&&0===(H=(m=O.trim()).length)&&(h=0,m="")),0<H)switch(h){case 115:U=U.replace(y,i);case 100:case 109:case 45:m=U+"{"+m+"}";break;case 107:m=(U=U.replace(g,"$1 $2"))+"{"+m+"}",m=1===k||2===k&&o("@"+m,3)?"@-webkit-"+m+"@"+m:"@"+m;break;default:m=U+m,112===p&&(W+=m,m="")}else m="";break;default:m=e(a,t(a,U,j),m,p,d+1)}z+=m,m=j=B=R=f=0,U="",h=s.charCodeAt(++T);break;case 125:case 59:if(1<(H=(U=(0<B?U.replace(c,""):U).trim()).length))switch(0===R&&(f=U.charCodeAt(0),45===f||96<f&&123>f)&&(H=(U=U.replace(" ",":")).length),0<P&&void 0!==(O=u(1,U,a,n,x,S,W.length,p,d,p))&&0===(H=(U=O.trim()).length)&&(U="\0\0"),f=U.charCodeAt(0),h=U.charCodeAt(1),f){case 0:break;case 64:if(105===h||99===h){G+=U+s.charAt(T);break}default:58!==U.charCodeAt(H-1)&&(W+=r(U,f,h,U.charCodeAt(2)))}j=B=R=f=0,U="",h=s.charCodeAt(++T)}}switch(h){case 13:case 10:47===A?A=0:0===1+f&&107!==p&&0<U.length&&(B=1,U+="\0"),0<P*V&&u(0,U,a,n,x,S,W.length,p,d,p),S=1,x++;break;case 59:case 125:if(0===A+w+F+C){S++;break}default:switch(S++,E=s.charAt(T),h){case 9:case 32:if(0===w+C+A)switch(M){case 44:case 58:case 9:case 32:E="";break;default:32!==h&&(E=" ")}break;case 0:E="\\0";break;case 12:E="\\f";break;case 11:E="\\v";break;case 38:0===w+A+C&&(B=j=1,E="\f"+E);break;case 108:if(0===w+A+C+D&&0<R)switch(T-R){case 2:112===M&&58===s.charCodeAt(T-3)&&(D=M);case 8:111===L&&(D=L)}break;case 58:0===w+A+C&&(R=T);break;case 44:0===A+F+w+C&&(B=1,E+="\r");break;case 34:case 39:0===A&&(w=w===h?0:0===w?h:w);break;case 91:0===w+A+F&&C++;break;case 93:0===w+A+F&&C--;break;case 41:0===w+A+C&&F--;break;case 40:if(0===w+A+C){if(0===f)switch(2*M+3*L){case 533:break;default:f=1}F++}break;case 64:0===A+F+w+C+R+m&&(m=1);break;case 42:case 47:if(!(0<w+C+F))switch(A){case 0:switch(2*h+3*s.charCodeAt(T+1)){case 235:A=47;break;case 220:H=T,A=42}break;case 42:47===h&&42===M&&H+2!==T&&(33===s.charCodeAt(H+2)&&(W+=s.substring(H,T+1)),E="",A=0)}}0===A&&(U+=E)}L=M,M=h,T++}if(0<(H=W.length)){if(B=a,0<P&&void 0!==(O=u(2,W,B,n,x,S,H,p,d,p))&&0===(W=O).length)return G+W+z;if(W=B.join(",")+"{"+W+"}",0!=k*D){switch(2!==k||o(W,2)||(D=0),D){case 111:W=W.replace(b,":-moz-$1")+W;break;case 112:W=W.replace(v,"::-webkit-input-$1")+W.replace(v,"::-moz-$1")+W.replace(v,":-ms-input-$1")+W}D=0}}return G+W+z}(I,a,n,0,0);return 0<P&&void 0!==(s=u(-2,p,a,a,x,S,p.length,0,0,0))&&(p=s),D=0,S=x=1,p}var l=/^\0+/g,c=/[\0\r\f]/g,p=/: */g,d=/zoo|gra/,f=/([,: ])(transform)/g,h=/,\r+?/g,m=/([\t\r\n ])*\f?&/g,g=/@(k\w+)\s*(\S*)\s*/,v=/::(place)/g,b=/:(read-only)/g,E=/[svh]\w+-[tblr]{2}/,y=/\(\s*(.*)\s*\)/g,O=/([\s\S]*?);/g,C=/-self|flex-/g,A=/[^]*?(:[rp][el]a[\w-]+)[^]*/,F=/stretch|:\s*\w+\-(?:conte|avail)/,w=/([^-])(image-set\()/,S=1,x=1,D=0,k=1,I=[],M=[],P=0,L=null,V=0;return s.use=function e(t){switch(t){case void 0:case null:P=M.length=0;break;default:if("function"==typeof t)M[P++]=t;else if("object"==typeof t)for(var n=0,r=t.length;n<r;++n)e(t[n]);else V=0|!!t}return e},s.set=a,void 0!==e&&a(e),s};function l(e){e&&c.current.insert(e+"}")}var c={current:null},p=function(e,t,n,r,o,i,u,a,s,p){switch(e){case 1:switch(t.charCodeAt(0)){case 64:return c.current.insert(t+";"),"";case 108:if(98===t.charCodeAt(2))return""}break;case 2:if(0===a)return t+"/*|*/";break;case 3:switch(a){case 102:case 112:return c.current.insert(n[0]+t),"";default:return t+(0===p?"/*|*/":"")}case-2:t.split("/*|*/}").forEach(l)}},d=function(e){void 0===e&&(e={});var t,n=e.key||"css";void 0!==e.prefix&&(t={prefix:e.prefix});var r=new s(t);var o,i={};o=e.container||document.head;var u,l=document.querySelectorAll("style[data-emotion-"+n+"]");Array.prototype.forEach.call(l,function(e){e.getAttribute("data-emotion-"+n).split(" ").forEach(function(e){i[e]=!0}),e.parentNode!==o&&o.appendChild(e)}),r.use(e.stylisPlugins)(p),u=function(e,t,n,o){var i=t.name;c.current=n,r(e,t.styles),o&&(d.inserted[i]=!0)};var d={key:n,sheet:new a({key:n,container:o,nonce:e.nonce,speedy:e.speedy}),nonce:e.nonce,inserted:i,registered:{},insert:u};return d};function f(e,t,n){var r="";return n.split(" ").forEach(function(n){void 0!==e[n]?t.push(e[n]):r+=n+" "}),r}var h=function(e,t,n){var r=e.key+"-"+t.name;if(!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles),void 0===e.inserted[t.name]){var o=t;do{e.insert("."+r,o,e.sheet,!0);o=o.next}while(void 0!==o)}};var m=function(e){for(var t,n=0,r=0,o=e.length;o>=4;++r,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(o){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)},g={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};var v=/[A-Z]|^ms/g,b=/_EMO_([^_]+?)_([^]*?)_EMO_/g,E=function(e){return 45===e.charCodeAt(1)},y=function(e){return null!=e&&"boolean"!=typeof e},O=function(e){var t={};return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}(function(e){return E(e)?e:e.replace(v,"-$&").toLowerCase()}),C=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(b,function(e,t,n){return F={name:t,styles:n,next:F},t})}return 1===g[e]||E(e)||"number"!=typeof t||0===t?t:t+"px"};function A(e,t,n,r){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return F={name:n.name,styles:n.styles,next:F},n.name;if(void 0!==n.styles){var o=n.next;if(void 0!==o)for(;void 0!==o;)F={name:o.name,styles:o.styles,next:F},o=o.next;return n.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o<n.length;o++)r+=A(e,t,n[o],!1);else for(var i in n){var u=n[i];if("object"!=typeof u)null!=t&&void 0!==t[u]?r+=i+"{"+t[u]+"}":y(u)&&(r+=O(i)+":"+C(i,u)+";");else if(!Array.isArray(u)||"string"!=typeof u[0]||null!=t&&void 0!==t[u[0]]){var a=A(e,t,u,!1);switch(i){case"animation":case"animationName":r+=O(i)+":"+a+";";break;default:r+=i+"{"+a+"}"}}else for(var s=0;s<u.length;s++)y(u[s])&&(r+=O(i)+":"+C(i,u[s])+";")}return r}(e,t,n);case"function":if(void 0!==e){var i=F,u=n(e);return F=i,A(e,t,u,r)}break;case"string":}if(null==t)return n;var a=t[n];return void 0===a||r?n:a}var F,w=/label:\s*([^\s;\n{]+)\s*;/g;var S=function(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var r=!0,o="";F=void 0;var i=e[0];null==i||void 0===i.raw?(r=!1,o+=A(n,t,i,!1)):o+=i[0];for(var u=1;u<e.length;u++)o+=A(n,t,e[u],46===o.charCodeAt(o.length-1)),r&&(o+=i[u]);w.lastIndex=0;for(var a,s="";null!==(a=w.exec(o));)s+="-"+a[1];return{name:m(o)+s,styles:o,next:F}};var x=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return S(t)},D=Object(r.createContext)("undefined"!=typeof HTMLElement?d():null),k=Object(r.createContext)({}),I=(D.Provider,function(e){return Object(r.forwardRef)(function(t,n){return Object(r.createElement)(D.Consumer,null,function(r){return e(t,r,n)})})}),M="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",P=Object.prototype.hasOwnProperty,L=function(e,t,n,o){var i=null===n?t.css:t.css(n);"string"==typeof i&&void 0!==e.registered[i]&&(i=e.registered[i]);var u=t[M],a=[i],s="";"string"==typeof t.className?s=f(e.registered,a,t.className):null!=t.className&&(s=t.className+" ");var l=S(a);h(e,l,"string"==typeof u);s+=e.key+"-"+l.name;var c={};for(var p in t)P.call(t,p)&&"css"!==p&&p!==M&&(c[p]=t[p]);return c.ref=o,c.className=s,Object(r.createElement)(u,c)},V=I(function(e,t,n){return"function"==typeof e.css?Object(r.createElement)(k.Consumer,null,function(r){return L(t,e,r,n)}):L(t,e,null,n)});var R=function(e,t){var n=arguments;if(null==t||!P.call(t,"css"))return r.createElement.apply(void 0,n);var o=n.length,i=new Array(o);i[0]=V;var u={};for(var a in t)P.call(t,a)&&(u[a]=t[a]);u[M]=e,i[1]=u;for(var s=2;s<o;s++)i[s]=n[s];return r.createElement.apply(null,i)};r.Component;var T=I(function(e,t){return Object(r.createElement)(k.Consumer,null,function(n){var r=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var o=S(n,t.registered);return h(t,o,!1),t.key+"-"+o.name},o={css:r,cx:function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return function(e,t,n){var r=[],o=f(e,r,n);return r.length<2?n:o+t(r)}(t.registered,r,function e(t){for(var n=t.length,r=0,o="";r<n;r++){var i=t[r];if(null!=i){var u=void 0;switch(typeof i){case"boolean":break;case"object":if(Array.isArray(i))u=e(i);else for(var a in u="",i)i[a]&&a&&(u&&(u+=" "),u+=a);break;default:u=i}u&&(o&&(o+=" "),o+=u)}}return o}(n))},theme:n},i=e.children(o);return!0,i})}),B=n("faye"),j=n("17x9"),H=n.n(j),N=function(){};function _(e,t){return t?"-"===t[0]?e+t:e+"__"+t:e}var U=function(e){return Array.isArray(e)?e.filter(Boolean):"object"==typeof e&&null!==e?[e]:[]};function W(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function z(e){return W(e)?window.pageYOffset:e.scrollTop}function G(e,t){W(e)?window.scrollTo(0,t):e.scrollTop=t}function Y(e,t,n,r){void 0===n&&(n=200),void 0===r&&(r=N);var o=z(e),i=t-o,u=10,a=0;!function t(){var s,l=i*((s=(s=a+=u)/n-1)*s*s+1)+o;G(e,l),a<n?window.requestAnimationFrame(t):r(e)}()}function $(){try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}}function X(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}var q=function(e,t){var n;void 0===t&&(t=X);var r,o=[],i=!1;return function(){for(var u=[],a=0;a<arguments.length;a++)u[a]=arguments[a];return i&&n===this&&t(u,o)?r:(r=e.apply(this,u),i=!0,n=this,o=u,r)}},K=n("FUBA"),J=n.n(K);function Z(){return(Z=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Q(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function ee(e){var t=e.maxHeight,n=e.menuEl,r=e.minHeight,o=e.placement,i=e.shouldScroll,u=e.isFixedPosition,a=e.theme.spacing,s=function(e){var t=getComputedStyle(e),n="absolute"===t.position,r=/(auto|scroll)/,o=document.documentElement;if("fixed"===t.position)return o;for(var i=e;i=i.parentElement;)if(t=getComputedStyle(i),(!n||"static"!==t.position)&&r.test(t.overflow+t.overflowY+t.overflowX))return i;return o}(n),l={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return l;var c=s.getBoundingClientRect().height,p=n.getBoundingClientRect(),d=p.bottom,f=p.height,h=p.top,m=n.offsetParent.getBoundingClientRect().top,g=window.innerHeight,v=z(s),b=parseInt(getComputedStyle(n).marginBottom,10),E=parseInt(getComputedStyle(n).marginTop,10),y=m-E,O=g-h,C=y+v,A=c-v-h,F=d-g+v+b,w=v+h-E;switch(o){case"auto":case"bottom":if(O>=f)return{placement:"bottom",maxHeight:t};if(A>=f&&!u)return i&&Y(s,F,160),{placement:"bottom",maxHeight:t};if(!u&&A>=r||u&&O>=r)return i&&Y(s,F,160),{placement:"bottom",maxHeight:u?O-b:A-b};if("auto"===o||u){var S=t,x=u?y:C;return x>=r&&(S=Math.min(x-b-a.controlHeight,t)),{placement:"top",maxHeight:S}}if("bottom"===o)return G(s,F),{placement:"bottom",maxHeight:t};break;case"top":if(y>=f)return{placement:"top",maxHeight:t};if(C>=f&&!u)return i&&Y(s,w,160),{placement:"top",maxHeight:t};if(!u&&C>=r||u&&y>=r){var D=t;return(!u&&C>=r||u&&y>=r)&&(D=u?y-E:C-E),i&&Y(s,w,160),{placement:"top",maxHeight:D}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'+o+'".')}return l}var te=function(e){return"auto"===e?"bottom":e},ne=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).state={maxHeight:t.props.maxMenuHeight,placement:null},t.getPlacement=function(e){var n=t.props,r=n.minMenuHeight,o=n.maxMenuHeight,i=n.menuPlacement,u=n.menuPosition,a=n.menuShouldScrollIntoView,s=n.theme,l=t.context.getPortalPlacement;if(e){var c="fixed"===u,p=ee({maxHeight:o,menuEl:e,minHeight:r,placement:i,shouldScroll:a&&!c,isFixedPosition:c,theme:s});l&&l(p),t.setState(p)}},t.getUpdatedProps=function(){var e=t.props.menuPlacement,n=t.state.placement||te(e);return Z({},t.props,{placement:n,maxHeight:t.state.maxHeight})},t}return Q(t,e),t.prototype.render=function(){return(0,this.props.children)({ref:this.getPlacement,placerProps:this.getUpdatedProps()})},t}(r.Component);ne.contextTypes={getPortalPlacement:H.a.func};var re=function(e){var t=e.theme,n=t.spacing.baseUnit;return{color:t.colors.neutral40,padding:2*n+"px "+3*n+"px",textAlign:"center"}},oe=re,ie=re,ue=function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,i=e.innerProps;return R("div",Z({css:o("noOptionsMessage",e),className:r({"menu-notice":!0,"menu-notice--no-options":!0},n)},i),t)};ue.defaultProps={children:"No options"};var ae=function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,i=e.innerProps;return R("div",Z({css:o("loadingMessage",e),className:r({"menu-notice":!0,"menu-notice--loading":!0},n)},i),t)};ae.defaultProps={children:"Loading..."};var se=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).state={placement:null},t.getPortalPlacement=function(e){var n=e.placement;n!==te(t.props.menuPlacement)&&t.setState({placement:n})},t}Q(t,e);var n=t.prototype;return n.getChildContext=function(){return{getPortalPlacement:this.getPortalPlacement}},n.render=function(){var e=this.props,t=e.appendTo,n=e.children,r=e.controlElement,o=e.menuPlacement,i=e.menuPosition,u=e.getStyles,a="fixed"===i;if(!t&&!a||!r)return null;var s=this.state.placement||te(o),l=function(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}(r),c=a?0:window.pageYOffset,p=l[s]+c,d=R("div",{css:u("menuPortal",{offset:p,position:i,rect:l})},n);return t?Object(B.createPortal)(d,t):d},t}(r.Component);se.childContextTypes={getPortalPlacement:H.a.func};var le=Array.isArray,ce=Object.keys,pe=Object.prototype.hasOwnProperty;function de(e,t){try{return function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){var r,o,i,u=le(t),a=le(n);if(u&&a){if((o=t.length)!=n.length)return!1;for(r=o;0!=r--;)if(!e(t[r],n[r]))return!1;return!0}if(u!=a)return!1;var s=t instanceof Date,l=n instanceof Date;if(s!=l)return!1;if(s&&l)return t.getTime()==n.getTime();var c=t instanceof RegExp,p=n instanceof RegExp;if(c!=p)return!1;if(c&&p)return t.toString()==n.toString();var d=ce(t);if((o=d.length)!==ce(n).length)return!1;for(r=o;0!=r--;)if(!pe.call(n,d[r]))return!1;for(r=o;0!=r--;)if(!("_owner"===(i=d[r])&&t.$$typeof||e(t[i],n[i])))return!1;return!0}return t!=t&&n!=n}(e,t)}catch(e){if(e.message&&e.message.match(/stack|recursion/i))return console.warn("Warning: react-fast-compare does not handle circular references.",e.name,e.message),!1;throw e}}function fe(){return(fe=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function he(){var e=function(e,t){t||(t=e.slice(0));return e.raw=t,e}(["\n 0%, 80%, 100% { opacity: 0; }\n 40% { opacity: 1; }\n"]);return he=function(){return e},e}function me(){return(me=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var ge={name:"19bqh2r",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0;"},ve=function(e){var t=e.size,n=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,["size"]);return R("svg",me({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:ge},n))},be=function(e){return R(ve,me({size:20},e),R("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},Ee=function(e){return R(ve,me({size:20},e),R("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},ye=function(e){var t=e.isFocused,n=e.theme,r=n.spacing.baseUnit,o=n.colors;return{label:"indicatorContainer",color:t?o.neutral60:o.neutral20,display:"flex",padding:2*r,transition:"color 150ms",":hover":{color:t?o.neutral80:o.neutral40}}},Oe=ye,Ce=ye,Ae=function(){var e=x.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}(he()),Fe=function(e){var t=e.delay,n=e.offset;return R("span",{css:x({animation:Ae+" 1s ease-in-out "+t+"ms infinite;",backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:n?"1em":null,height:"1em",verticalAlign:"top",width:"1em"},"")})},we=function(e){var t=e.className,n=e.cx,r=e.getStyles,o=e.innerProps,i=e.isRtl;return R("div",me({},o,{css:r("loadingIndicator",e),className:n({indicator:!0,"loading-indicator":!0},t)}),R(Fe,{delay:0,offset:i}),R(Fe,{delay:160,offset:!0}),R(Fe,{delay:320,offset:!i}))};function Se(){return(Se=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}we.defaultProps={size:4};function xe(){return(xe=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function De(){return(De=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var ke=function(e){return{label:"input",background:0,border:0,fontSize:"inherit",opacity:e?0:1,outline:0,padding:0,color:"inherit"}};function Ie(){return(Ie=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Me=function(e){var t=e.children,n=e.innerProps;return R("div",n,t)},Pe=Me,Le=Me;var Ve=function(e){var t=e.children,n=e.className,r=e.components,o=e.cx,i=e.data,u=e.getStyles,a=e.innerProps,s=e.isDisabled,l=e.removeProps,c=e.selectProps,p=r.Container,d=r.Label,f=r.Remove;return R(T,null,function(r){var h=r.css,m=r.cx;return R(p,{data:i,innerProps:Ie({},a,{className:m(h(u("multiValue",e)),o({"multi-value":!0,"multi-value--is-disabled":s},n))}),selectProps:c},R(d,{data:i,innerProps:{className:m(h(u("multiValueLabel",e)),o({"multi-value__label":!0},n))},selectProps:c},t),R(f,{data:i,innerProps:Ie({className:m(h(u("multiValueRemove",e)),o({"multi-value__remove":!0},n))},l),selectProps:c}))})};function Re(){return(Re=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}Ve.defaultProps={cropWithEllipsis:!0};function Te(){return(Te=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Be(){return(Be=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function je(){return(je=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var He={ClearIndicator:function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,i=e.innerProps;return R("div",me({},i,{css:o("clearIndicator",e),className:r({indicator:!0,"clear-indicator":!0},n)}),t||R(be,null))},Control:function(e){var t=e.children,n=e.cx,r=e.getStyles,o=e.className,i=e.isDisabled,u=e.isFocused,a=e.innerRef,s=e.innerProps,l=e.menuIsOpen;return R("div",Se({ref:a,css:r("control",e),className:n({control:!0,"control--is-disabled":i,"control--is-focused":u,"control--menu-is-open":l},o)},s),t)},DropdownIndicator:function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,i=e.innerProps;return R("div",me({},i,{css:o("dropdownIndicator",e),className:r({indicator:!0,"dropdown-indicator":!0},n)}),t||R(Ee,null))},DownChevron:Ee,CrossIcon:be,Group:function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,i=e.Heading,u=e.headingProps,a=e.label,s=e.theme,l=e.selectProps;return R("div",{css:o("group",e),className:r({group:!0},n)},R(i,xe({},u,{selectProps:l,theme:s,getStyles:o,cx:r}),a),R("div",null,t))},GroupHeading:function(e){var t=e.className,n=e.cx,r=e.getStyles,o=e.theme,i=(e.selectProps,function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,["className","cx","getStyles","theme","selectProps"]));return R("div",xe({css:r("groupHeading",xe({theme:o},i)),className:n({"group-heading":!0},t)},i))},IndicatorsContainer:function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles;return R("div",{css:o("indicatorsContainer",e),className:r({indicators:!0},n)},t)},IndicatorSeparator:function(e){var t=e.className,n=e.cx,r=e.getStyles,o=e.innerProps;return R("span",me({},o,{css:r("indicatorSeparator",e),className:n({"indicator-separator":!0},t)}))},Input:function(e){var t=e.className,n=e.cx,r=e.getStyles,o=e.innerRef,i=e.isHidden,u=e.isDisabled,a=e.theme,s=(e.selectProps,function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,["className","cx","getStyles","innerRef","isHidden","isDisabled","theme","selectProps"]));return R("div",{css:r("input",De({theme:a},s))},R(J.a,De({className:n({input:!0},t),inputRef:o,inputStyle:ke(i),disabled:u},s)))},LoadingIndicator:we,Menu:function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,i=e.innerRef,u=e.innerProps;return R("div",Z({css:o("menu",e),className:r({menu:!0},n)},u,{ref:i}),t)},MenuList:function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,i=e.isMulti,u=e.innerRef;return R("div",{css:o("menuList",e),className:r({"menu-list":!0,"menu-list--is-multi":i},n),ref:u},t)},MenuPortal:se,LoadingMessage:ae,NoOptionsMessage:ue,MultiValue:Ve,MultiValueContainer:Pe,MultiValueLabel:Le,MultiValueRemove:function(e){var t=e.children,n=e.innerProps;return R("div",n,t||R(be,{size:14}))},Option:function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,i=e.isDisabled,u=e.isFocused,a=e.isSelected,s=e.innerRef,l=e.innerProps;return R("div",Re({css:o("option",e),className:r({option:!0,"option--is-disabled":i,"option--is-focused":u,"option--is-selected":a},n),ref:s},l),t)},Placeholder:function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,i=e.innerProps;return R("div",Te({css:o("placeholder",e),className:r({placeholder:!0},n)},i),t)},SelectContainer:function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,i=e.innerProps,u=e.isDisabled,a=e.isRtl;return R("div",fe({css:o("container",e),className:r({"--is-disabled":u,"--is-rtl":a},n)},i),t)},SingleValue:function(e){var t=e.children,n=e.className,r=e.cx,o=e.getStyles,i=e.isDisabled,u=e.innerProps;return R("div",Be({css:o("singleValue",e),className:r({"single-value":!0,"single-value--is-disabled":i},n)},u),t)},ValueContainer:function(e){var t=e.children,n=e.className,r=e.cx,o=e.isMulti,i=e.getStyles,u=e.hasValue;return R("div",{css:i("valueContainer",e),className:r({"value-container":!0,"value-container--is-multi":o,"value-container--has-value":u},n)},t)}},Ne=function(e){return je({},He,e.components)},_e=[{base:"A",letters:/[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g},{base:"AA",letters:/[\uA732]/g},{base:"AE",letters:/[\u00C6\u01FC\u01E2]/g},{base:"AO",letters:/[\uA734]/g},{base:"AU",letters:/[\uA736]/g},{base:"AV",letters:/[\uA738\uA73A]/g},{base:"AY",letters:/[\uA73C]/g},{base:"B",letters:/[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g},{base:"C",letters:/[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g},{base:"D",letters:/[\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779]/g},{base:"DZ",letters:/[\u01F1\u01C4]/g},{base:"Dz",letters:/[\u01F2\u01C5]/g},{base:"E",letters:/[\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E]/g},{base:"F",letters:/[\u0046\u24BB\uFF26\u1E1E\u0191\uA77B]/g},{base:"G",letters:/[\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E]/g},{base:"H",letters:/[\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D]/g},{base:"I",letters:/[\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197]/g},{base:"J",letters:/[\u004A\u24BF\uFF2A\u0134\u0248]/g},{base:"K",letters:/[\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2]/g},{base:"L",letters:/[\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780]/g},{base:"LJ",letters:/[\u01C7]/g},{base:"Lj",letters:/[\u01C8]/g},{base:"M",letters:/[\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C]/g},{base:"N",letters:/[\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4]/g},{base:"NJ",letters:/[\u01CA]/g},{base:"Nj",letters:/[\u01CB]/g},{base:"O",letters:/[\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C]/g},{base:"OI",letters:/[\u01A2]/g},{base:"OO",letters:/[\uA74E]/g},{base:"OU",letters:/[\u0222]/g},{base:"P",letters:/[\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754]/g},{base:"Q",letters:/[\u0051\u24C6\uFF31\uA756\uA758\u024A]/g},{base:"R",letters:/[\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782]/g},{base:"S",letters:/[\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784]/g},{base:"T",letters:/[\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786]/g},{base:"TZ",letters:/[\uA728]/g},{base:"U",letters:/[\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244]/g},{base:"V",letters:/[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245]/g},{base:"VY",letters:/[\uA760]/g},{base:"W",letters:/[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72]/g},{base:"X",letters:/[\u0058\u24CD\uFF38\u1E8A\u1E8C]/g},{base:"Y",letters:/[\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE]/g},{base:"Z",letters:/[\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762]/g},{base:"a",letters:/[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g},{base:"aa",letters:/[\uA733]/g},{base:"ae",letters:/[\u00E6\u01FD\u01E3]/g},{base:"ao",letters:/[\uA735]/g},{base:"au",letters:/[\uA737]/g},{base:"av",letters:/[\uA739\uA73B]/g},{base:"ay",letters:/[\uA73D]/g},{base:"b",letters:/[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g},{base:"c",letters:/[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g},{base:"d",letters:/[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A]/g},{base:"dz",letters:/[\u01F3\u01C6]/g},{base:"e",letters:/[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD]/g},{base:"f",letters:/[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C]/g},{base:"g",letters:/[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F]/g},{base:"h",letters:/[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/g},{base:"hv",letters:/[\u0195]/g},{base:"i",letters:/[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131]/g},{base:"j",letters:/[\u006A\u24D9\uFF4A\u0135\u01F0\u0249]/g},{base:"k",letters:/[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3]/g},{base:"l",letters:/[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747]/g},{base:"lj",letters:/[\u01C9]/g},{base:"m",letters:/[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F]/g},{base:"n",letters:/[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5]/g},{base:"nj",letters:/[\u01CC]/g},{base:"o",letters:/[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275]/g},{base:"oi",letters:/[\u01A3]/g},{base:"ou",letters:/[\u0223]/g},{base:"oo",letters:/[\uA74F]/g},{base:"p",letters:/[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755]/g},{base:"q",letters:/[\u0071\u24E0\uFF51\u024B\uA757\uA759]/g},{base:"r",letters:/[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783]/g},{base:"s",letters:/[\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B]/g},{base:"t",letters:/[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787]/g},{base:"tz",letters:/[\uA729]/g},{base:"u",letters:/[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289]/g},{base:"v",letters:/[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C]/g},{base:"vy",letters:/[\uA761]/g},{base:"w",letters:/[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/g},{base:"x",letters:/[\u0078\u24E7\uFF58\u1E8B\u1E8D]/g},{base:"y",letters:/[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF]/g},{base:"z",letters:/[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763]/g}],Ue=function(e){for(var t=0;t<_e.length;t++)e=e.replace(_e[t].letters,_e[t].base);return e};function We(){return(We=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var ze=function(e){return e.replace(/^\s+|\s+$/g,"")},Ge=function(e){return e.label+" "+e.value};function Ye(){return(Ye=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var $e={name:"1laao21-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap;"},Xe=function(e){return R("span",Ye({css:$e},e))};function qe(){return(qe=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Ke(e){e.in,e.out,e.onExited,e.appear,e.enter,e.exit;var t=e.innerRef,n=(e.emotion,function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,["in","out","onExited","appear","enter","exit","innerRef","emotion"]));return R("input",qe({ref:t},n,{css:x({label:"dummyInput",background:0,border:0,fontSize:"inherit",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(0)"},"")}))}var Je=function(e){var t,n;function r(){return e.apply(this,arguments)||this}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var o=r.prototype;return o.componentDidMount=function(){this.props.innerRef(Object(B.findDOMNode)(this))},o.componentWillUnmount=function(){this.props.innerRef(null)},o.render=function(){return this.props.children},r}(r.Component),Ze=["boxSizing","height","overflow","paddingRight","position"],Qe={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function et(e){e.preventDefault()}function tt(e){e.stopPropagation()}function nt(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;0===e?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function rt(){return"ontouchstart"in window||navigator.maxTouchPoints}var ot=!(!window.document||!window.document.createElement),it=0,ut=function(e){var t,n;function r(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).originalStyles={},t.listenerOptions={capture:!1,passive:!1},t}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var o=r.prototype;return o.componentDidMount=function(){var e=this;if(ot){var t=this.props,n=t.accountForScrollbars,r=t.touchScrollTarget,o=document.body,i=o&&o.style;if(n&&Ze.forEach(function(t){var n=i&&i[t];e.originalStyles[t]=n}),n&&it<1){var u=parseInt(this.originalStyles.paddingRight,10)||0,a=document.body?document.body.clientWidth:0,s=window.innerWidth-a+u||0;Object.keys(Qe).forEach(function(e){var t=Qe[e];i&&(i[e]=t)}),i&&(i.paddingRight=s+"px")}o&&rt()&&(o.addEventListener("touchmove",et,this.listenerOptions),r&&(r.addEventListener("touchstart",nt,this.listenerOptions),r.addEventListener("touchmove",tt,this.listenerOptions))),it+=1}},o.componentWillUnmount=function(){var e=this;if(ot){var t=this.props,n=t.accountForScrollbars,r=t.touchScrollTarget,o=document.body,i=o&&o.style;it=Math.max(it-1,0),n&&it<1&&Ze.forEach(function(t){var n=e.originalStyles[t];i&&(i[t]=n)}),o&&rt()&&(o.removeEventListener("touchmove",et,this.listenerOptions),r&&(r.removeEventListener("touchstart",nt,this.listenerOptions),r.removeEventListener("touchmove",tt,this.listenerOptions)))}},o.render=function(){return null},r}(r.Component);ut.defaultProps={accountForScrollbars:!0};var at={name:"1dsbpcp",styles:"position:fixed;left:0;bottom:0;right:0;top:0;"},st=function(e){var t,n;function r(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).state={touchScrollTarget:null},t.getScrollTarget=function(e){e!==t.state.touchScrollTarget&&t.setState({touchScrollTarget:e})},t.blurSelectInput=function(){document.activeElement&&document.activeElement.blur()},t}return n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,r.prototype.render=function(){var e=this.props,t=e.children,n=e.isEnabled,r=this.state.touchScrollTarget;return n?R("div",null,R("div",{onClick:this.blurSelectInput,css:at}),R(Je,{innerRef:this.getScrollTarget},t),r?R(ut,{touchScrollTarget:r}):null):t},r}(r.PureComponent);var lt=function(e){var t,n;function r(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).isBottom=!1,t.isTop=!1,t.scrollTarget=void 0,t.touchStart=void 0,t.cancelScroll=function(e){e.preventDefault(),e.stopPropagation()},t.handleEventDelta=function(e,n){var r=t.props,o=r.onBottomArrive,i=r.onBottomLeave,u=r.onTopArrive,a=r.onTopLeave,s=t.scrollTarget,l=s.scrollTop,c=s.scrollHeight,p=s.clientHeight,d=t.scrollTarget,f=n>0,h=c-p-l,m=!1;h>n&&t.isBottom&&(i&&i(e),t.isBottom=!1),f&&t.isTop&&(a&&a(e),t.isTop=!1),f&&n>h?(o&&!t.isBottom&&o(e),d.scrollTop=c,m=!0,t.isBottom=!0):!f&&-n>l&&(u&&!t.isTop&&u(e),d.scrollTop=0,m=!0,t.isTop=!0),m&&t.cancelScroll(e)},t.onWheel=function(e){t.handleEventDelta(e,e.deltaY)},t.onTouchStart=function(e){t.touchStart=e.changedTouches[0].clientY},t.onTouchMove=function(e){var n=t.touchStart-e.changedTouches[0].clientY;t.handleEventDelta(e,n)},t.getScrollTarget=function(e){t.scrollTarget=e},t}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var i=r.prototype;return i.componentDidMount=function(){this.startListening(this.scrollTarget)},i.componentWillUnmount=function(){this.stopListening(this.scrollTarget)},i.startListening=function(e){e&&("function"==typeof e.addEventListener&&e.addEventListener("wheel",this.onWheel,!1),"function"==typeof e.addEventListener&&e.addEventListener("touchstart",this.onTouchStart,!1),"function"==typeof e.addEventListener&&e.addEventListener("touchmove",this.onTouchMove,!1))},i.stopListening=function(e){"function"==typeof e.removeEventListener&&e.removeEventListener("wheel",this.onWheel,!1),"function"==typeof e.removeEventListener&&e.removeEventListener("touchstart",this.onTouchStart,!1),"function"==typeof e.removeEventListener&&e.removeEventListener("touchmove",this.onTouchMove,!1)},i.render=function(){return o.a.createElement(Je,{innerRef:this.getScrollTarget},this.props.children)},r}(r.Component);function ct(e){var t=e.isEnabled,n=void 0===t||t,r=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,["isEnabled"]);return n?o.a.createElement(lt,r):r.children}var pt=function(e,t){void 0===t&&(t={});var n=t,r=n.isSearchable,o=n.isMulti,i=n.label,u=n.isDisabled;switch(e){case"menu":return"Use Up and Down to choose options"+(u?"":", press Enter to select the currently focused option")+", press Escape to exit the menu, press Tab to select the option and exit the menu.";case"input":return(i||"Select")+" is focused "+(r?",type to refine list":"")+", press Down to open the menu, "+(o?" press left to focus selected values":"");case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value"}},dt=function(e,t){var n=t.value,r=t.isDisabled;if(n)switch(e){case"deselect-option":case"pop-value":case"remove-value":return"option "+n+", deselected.";case"select-option":return r?"option "+n+" is disabled. Select another option.":"option "+n+", selected."}},ft=function(e){return!!e.isDisabled};var ht={clearIndicator:Ce,container:function(e){var t=e.isDisabled;return{label:"container",direction:e.isRtl?"rtl":null,pointerEvents:t?"none":null,position:"relative"}},control:function(e){var t=e.isDisabled,n=e.isFocused,r=e.theme,o=r.colors,i=r.borderRadius,u=r.spacing;return{label:"control",alignItems:"center",backgroundColor:t?o.neutral5:o.neutral0,borderColor:t?o.neutral10:n?o.primary:o.neutral20,borderRadius:i,borderStyle:"solid",borderWidth:1,boxShadow:n?"0 0 0 1px "+o.primary:null,cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:u.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms","&:hover":{borderColor:n?o.primary:o.neutral30}}},dropdownIndicator:Oe,group:function(e){var t=e.theme.spacing;return{paddingBottom:2*t.baseUnit,paddingTop:2*t.baseUnit}},groupHeading:function(e){var t=e.theme.spacing;return{label:"group",color:"#999",cursor:"default",display:"block",fontSize:"75%",fontWeight:"500",marginBottom:"0.25em",paddingLeft:3*t.baseUnit,paddingRight:3*t.baseUnit,textTransform:"uppercase"}},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(e){var t=e.isDisabled,n=e.theme,r=n.spacing.baseUnit,o=n.colors;return{label:"indicatorSeparator",alignSelf:"stretch",backgroundColor:t?o.neutral10:o.neutral20,marginBottom:2*r,marginTop:2*r,width:1}},input:function(e){var t=e.isDisabled,n=e.theme,r=n.spacing,o=n.colors;return{margin:r.baseUnit/2,paddingBottom:r.baseUnit/2,paddingTop:r.baseUnit/2,visibility:t?"hidden":"visible",color:o.neutral80}},loadingIndicator:function(e){var t=e.isFocused,n=e.size,r=e.theme,o=r.colors,i=r.spacing.baseUnit;return{label:"loadingIndicator",color:t?o.neutral60:o.neutral20,display:"flex",padding:2*i,transition:"color 150ms",alignSelf:"center",fontSize:n,lineHeight:1,marginRight:n,textAlign:"center",verticalAlign:"middle"}},loadingMessage:ie,menu:function(e){var t,n=e.placement,r=e.theme,o=r.borderRadius,i=r.spacing,u=r.colors;return(t={label:"menu"})[function(e){return e?{bottom:"top",top:"bottom"}[e]:"bottom"}(n)]="100%",t.backgroundColor=u.neutral0,t.borderRadius=o,t.boxShadow="0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",t.marginBottom=i.menuGutter,t.marginTop=i.menuGutter,t.position="absolute",t.width="100%",t.zIndex=1,t},menuList:function(e){var t=e.maxHeight,n=e.theme.spacing.baseUnit;return{maxHeight:t,overflowY:"auto",paddingBottom:n,paddingTop:n,position:"relative",WebkitOverflowScrolling:"touch"}},menuPortal:function(e){var t=e.rect,n=e.offset,r=e.position;return{left:t.left,position:r,top:n,width:t.width,zIndex:1}},multiValue:function(e){var t=e.theme,n=t.spacing,r=t.borderRadius;return{label:"multiValue",backgroundColor:t.colors.neutral10,borderRadius:r/2,display:"flex",margin:n.baseUnit/2,minWidth:0}},multiValueLabel:function(e){var t=e.theme,n=t.borderRadius,r=t.colors,o=e.cropWithEllipsis;return{borderRadius:n/2,color:r.neutral80,fontSize:"85%",overflow:"hidden",padding:3,paddingLeft:6,textOverflow:o?"ellipsis":null,whiteSpace:"nowrap"}},multiValueRemove:function(e){var t=e.theme,n=t.spacing,r=t.borderRadius,o=t.colors;return{alignItems:"center",borderRadius:r/2,backgroundColor:e.isFocused&&o.dangerLight,display:"flex",paddingLeft:n.baseUnit,paddingRight:n.baseUnit,":hover":{backgroundColor:o.dangerLight,color:o.danger}}},noOptionsMessage:oe,option:function(e){var t=e.isDisabled,n=e.isFocused,r=e.isSelected,o=e.theme,i=o.spacing,u=o.colors;return{label:"option",backgroundColor:r?u.primary:n?u.primary25:"transparent",color:t?u.neutral20:r?u.neutral0:"inherit",cursor:"default",display:"block",fontSize:"inherit",padding:2*i.baseUnit+"px "+3*i.baseUnit+"px",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)",":active":{backgroundColor:!t&&(r?u.primary:u.primary50)}}},placeholder:function(e){var t=e.theme,n=t.spacing;return{label:"placeholder",color:t.colors.neutral50,marginLeft:n.baseUnit/2,marginRight:n.baseUnit/2,position:"absolute",top:"50%",transform:"translateY(-50%)"}},singleValue:function(e){var t=e.isDisabled,n=e.theme,r=n.spacing,o=n.colors;return{label:"singleValue",color:t?o.neutral40:o.neutral80,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2,maxWidth:"calc(100% - "+2*r.baseUnit+"px)",overflow:"hidden",position:"absolute",textOverflow:"ellipsis",whiteSpace:"nowrap",top:"50%",transform:"translateY(-50%)"}},valueContainer:function(e){var t=e.theme.spacing;return{alignItems:"center",display:"flex",flex:1,flexWrap:"wrap",padding:t.baseUnit/2+"px "+2*t.baseUnit+"px",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"}}};var mt={borderRadius:4,colors:{primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},spacing:{baseUnit:4,controlHeight:38,menuGutter:8}};function gt(){return(gt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function vt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var bt,Et={backspaceRemovesValue:!0,blurInputOnSelect:$(),captureMenuScroll:!$(),closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(e,t){var n=We({ignoreCase:!0,ignoreAccents:!0,stringify:Ge,trim:!0,matchFrom:"any"},bt),r=n.ignoreCase,o=n.ignoreAccents,i=n.stringify,u=n.trim,a=n.matchFrom,s=u?ze(t):t,l=u?ze(i(e)):i(e);return r&&(s=s.toLowerCase(),l=l.toLowerCase()),o&&(s=Ue(s),l=Ue(l)),"start"===a?l.substr(0,s.length)===s:l.indexOf(s)>-1},formatGroupLabel:function(e){return e.label},getOptionLabel:function(e){return e.label},getOptionValue:function(e){return e.value},isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:ft,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(e){return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return t+" result"+(1!==t?"s":"")+" available"},styles:{},tabIndex:"0",tabSelectsValue:!0},yt=1,Ot=function(e){var t,n;function r(t){var n;(n=e.call(this,t)||this).state={ariaLiveSelection:"",ariaLiveContext:"",focusedOption:null,focusedValue:null,inputIsHidden:!1,isFocused:!1,menuOptions:{render:[],focusable:[]},selectValue:[]},n.blockOptionHover=!1,n.isComposing=!1,n.clearFocusValueOnUpdate=!1,n.commonProps=void 0,n.components=void 0,n.hasGroups=!1,n.initialTouchX=0,n.initialTouchY=0,n.inputIsHiddenAfterUpdate=void 0,n.instancePrefix="",n.openAfterFocus=!1,n.scrollToFocusedOptionOnUpdate=!1,n.userIsDragging=void 0,n.controlRef=null,n.getControlRef=function(e){n.controlRef=e},n.focusedOptionRef=null,n.getFocusedOptionRef=function(e){n.focusedOptionRef=e},n.menuListRef=null,n.getMenuListRef=function(e){n.menuListRef=e},n.inputRef=null,n.getInputRef=function(e){n.inputRef=e},n.cacheComponents=function(e){n.components=Ne({components:e})},n.focus=n.focusInput,n.blur=n.blurInput,n.onChange=function(e,t){var r=n.props;(0,r.onChange)(e,gt({},t,{name:r.name}))},n.setValue=function(e,t,r){void 0===t&&(t="set-value");var o=n.props,i=o.closeMenuOnSelect,u=o.isMulti;n.onInputChange("",{action:"set-value"}),i&&(n.inputIsHiddenAfterUpdate=!u,n.onMenuClose()),n.clearFocusValueOnUpdate=!0,n.onChange(e,{action:t,option:r})},n.selectOption=function(e){var t=n.props,r=t.blurInputOnSelect,o=t.isMulti,i=n.state.selectValue;if(o)if(n.isOptionSelected(e,i)){var u=n.getOptionValue(e);n.setValue(i.filter(function(e){return n.getOptionValue(e)!==u}),"deselect-option",e),n.announceAriaLiveSelection({event:"deselect-option",context:{value:n.getOptionLabel(e)}})}else n.isOptionDisabled(e,i)?n.announceAriaLiveSelection({event:"select-option",context:{value:n.getOptionLabel(e),isDisabled:!0}}):(n.setValue([].concat(i,[e]),"select-option",e),n.announceAriaLiveSelection({event:"select-option",context:{value:n.getOptionLabel(e)}}));else n.isOptionDisabled(e,i)?n.announceAriaLiveSelection({event:"select-option",context:{value:n.getOptionLabel(e),isDisabled:!0}}):(n.setValue(e,"select-option"),n.announceAriaLiveSelection({event:"select-option",context:{value:n.getOptionLabel(e)}}));r&&n.blurInput()},n.removeValue=function(e){var t=n.state.selectValue,r=n.getOptionValue(e),o=t.filter(function(e){return n.getOptionValue(e)!==r});n.onChange(o.length?o:null,{action:"remove-value",removedValue:e}),n.announceAriaLiveSelection({event:"remove-value",context:{value:e?n.getOptionLabel(e):""}}),n.focusInput()},n.clearValue=function(){var e=n.props.isMulti;n.onChange(e?[]:null,{action:"clear"})},n.popValue=function(){var e=n.state.selectValue,t=e[e.length-1],r=e.slice(0,e.length-1);n.announceAriaLiveSelection({event:"pop-value",context:{value:t?n.getOptionLabel(t):""}}),n.onChange(r.length?r:null,{action:"pop-value",removedValue:t})},n.getOptionLabel=function(e){return n.props.getOptionLabel(e)},n.getOptionValue=function(e){return n.props.getOptionValue(e)},n.getStyles=function(e,t){var r=ht[e](t);r.boxSizing="border-box";var o=n.props.styles[e];return o?o(r,t):r},n.getElementId=function(e){return n.instancePrefix+"-"+e},n.getActiveDescendentId=function(){var e=n.props.menuIsOpen,t=n.state,r=t.menuOptions,o=t.focusedOption;if(o&&e){var i=r.focusable.indexOf(o),u=r.render[i];return u&&u.key}},n.announceAriaLiveSelection=function(e){var t=e.event,r=e.context;n.setState({ariaLiveSelection:dt(t,r)})},n.announceAriaLiveContext=function(e){var t=e.event,r=e.context;n.setState({ariaLiveContext:pt(t,gt({},r,{label:n.props["aria-label"]}))})},n.onMenuMouseDown=function(e){0===e.button&&(e.stopPropagation(),e.preventDefault(),n.focusInput())},n.onMenuMouseMove=function(e){n.blockOptionHover=!1},n.onControlMouseDown=function(e){var t=n.props.openMenuOnClick;n.state.isFocused?n.props.menuIsOpen?"INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName&&n.onMenuClose():t&&n.openMenu("first"):(t&&(n.openAfterFocus=!0),n.focusInput()),"INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName&&e.preventDefault()},n.onDropdownIndicatorMouseDown=function(e){if(!(e&&"mousedown"===e.type&&0!==e.button||n.props.isDisabled)){var t=n.props,r=t.isMulti,o=t.menuIsOpen;n.focusInput(),o?(n.inputIsHiddenAfterUpdate=!r,n.onMenuClose()):n.openMenu("first"),e.preventDefault(),e.stopPropagation()}},n.onClearIndicatorMouseDown=function(e){e&&"mousedown"===e.type&&0!==e.button||(n.clearValue(),e.stopPropagation(),n.openAfterFocus=!1,"touchend"===e.type?n.focusInput():setTimeout(function(){return n.focusInput()}))},n.onScroll=function(e){"boolean"==typeof n.props.closeMenuOnScroll?e.target instanceof HTMLElement&&W(e.target)&&n.props.onMenuClose():"function"==typeof n.props.closeMenuOnScroll&&n.props.closeMenuOnScroll(e)&&n.props.onMenuClose()},n.onCompositionStart=function(){n.isComposing=!0},n.onCompositionEnd=function(){n.isComposing=!1},n.onTouchStart=function(e){var t=e.touches.item(0);t&&(n.initialTouchX=t.clientX,n.initialTouchY=t.clientY,n.userIsDragging=!1)},n.onTouchMove=function(e){var t=e.touches.item(0);if(t){var r=Math.abs(t.clientX-n.initialTouchX),o=Math.abs(t.clientY-n.initialTouchY);n.userIsDragging=r>5||o>5}},n.onTouchEnd=function(e){n.userIsDragging||(n.controlRef&&!n.controlRef.contains(e.target)&&n.menuListRef&&!n.menuListRef.contains(e.target)&&n.blurInput(),n.initialTouchX=0,n.initialTouchY=0)},n.onControlTouchEnd=function(e){n.userIsDragging||n.onControlMouseDown(e)},n.onClearIndicatorTouchEnd=function(e){n.userIsDragging||n.onClearIndicatorMouseDown(e)},n.onDropdownIndicatorTouchEnd=function(e){n.userIsDragging||n.onDropdownIndicatorMouseDown(e)},n.handleInputChange=function(e){var t=e.currentTarget.value;n.inputIsHiddenAfterUpdate=!1,n.onInputChange(t,{action:"input-change"}),n.onMenuOpen()},n.onInputFocus=function(e){var t=n.props,r=t.isSearchable,o=t.isMulti;n.props.onFocus&&n.props.onFocus(e),n.inputIsHiddenAfterUpdate=!1,n.announceAriaLiveContext({event:"input",context:{isSearchable:r,isMulti:o}}),n.setState({isFocused:!0}),(n.openAfterFocus||n.props.openMenuOnFocus)&&n.openMenu("first"),n.openAfterFocus=!1},n.onInputBlur=function(e){n.menuListRef&&n.menuListRef.contains(document.activeElement)?n.inputRef.focus():(n.props.onBlur&&n.props.onBlur(e),n.onInputChange("",{action:"input-blur"}),n.onMenuClose(),n.setState({focusedValue:null,isFocused:!1}))},n.onOptionHover=function(e){n.blockOptionHover||n.state.focusedOption===e||n.setState({focusedOption:e})},n.shouldHideSelectedOptions=function(){var e=n.props,t=e.hideSelectedOptions,r=e.isMulti;return void 0===t?r:t},n.onKeyDown=function(e){var t=n.props,r=t.isMulti,o=t.backspaceRemovesValue,i=t.escapeClearsValue,u=t.inputValue,a=t.isClearable,s=t.isDisabled,l=t.menuIsOpen,c=t.onKeyDown,p=t.tabSelectsValue,d=t.openMenuOnFocus,f=n.state,h=f.focusedOption,m=f.focusedValue,g=f.selectValue;if(!(s||"function"==typeof c&&(c(e),e.defaultPrevented))){switch(n.blockOptionHover=!0,e.key){case"ArrowLeft":if(!r||u)return;n.focusValue("previous");break;case"ArrowRight":if(!r||u)return;n.focusValue("next");break;case"Delete":case"Backspace":if(u)return;if(m)n.removeValue(m);else{if(!o)return;r?n.popValue():a&&n.clearValue()}break;case"Tab":if(n.isComposing)return;if(e.shiftKey||!l||!p||!h||d&&n.isOptionSelected(h,g))return;n.selectOption(h);break;case"Enter":if(229===e.keyCode)break;if(l){if(!h)return;if(n.isComposing)return;n.selectOption(h);break}return;case"Escape":l?(n.inputIsHiddenAfterUpdate=!1,n.onInputChange("",{action:"menu-close"}),n.onMenuClose()):a&&i&&n.clearValue();break;case" ":if(u)return;if(!l){n.openMenu("first");break}if(!h)return;n.selectOption(h);break;case"ArrowUp":l?n.focusOption("up"):n.openMenu("last");break;case"ArrowDown":l?n.focusOption("down"):n.openMenu("first");break;case"PageUp":if(!l)return;n.focusOption("pageup");break;case"PageDown":if(!l)return;n.focusOption("pagedown");break;case"Home":if(!l)return;n.focusOption("first");break;case"End":if(!l)return;n.focusOption("last");break;default:return}e.preventDefault()}},n.buildMenuOptions=function(e,t){var r=e.inputValue,o=void 0===r?"":r,i=e.options,u=function(e,r){var i=n.isOptionDisabled(e,t),u=n.isOptionSelected(e,t),a=n.getOptionLabel(e),s=n.getOptionValue(e);if(!(n.shouldHideSelectedOptions()&&u||!n.filterOption({label:a,value:s,data:e},o))){var l=i?void 0:function(){return n.onOptionHover(e)},c=i?void 0:function(){return n.selectOption(e)},p=n.getElementId("option")+"-"+r;return{innerProps:{id:p,onClick:c,onMouseMove:l,onMouseOver:l,tabIndex:-1},data:e,isDisabled:i,isSelected:u,key:p,label:a,type:"option",value:s}}};return i.reduce(function(e,t,r){if(t.options){n.hasGroups||(n.hasGroups=!0);var o=t.options.map(function(t,n){var o=u(t,r+"-"+n);return o&&e.focusable.push(t),o}).filter(Boolean);if(o.length){var i=n.getElementId("group")+"-"+r;e.render.push({type:"group",key:i,data:t,options:o})}}else{var a=u(t,""+r);a&&(e.render.push(a),e.focusable.push(t))}return e},{render:[],focusable:[]})};var r=t.value;n.cacheComponents=q(n.cacheComponents,de).bind(vt(vt(n))),n.cacheComponents(t.components),n.instancePrefix="react-select-"+(n.props.instanceId||++yt);var o=U(r);n.buildMenuOptions=q(n.buildMenuOptions,function(e,t){var n=e,r=n[0],o=n[1],i=t,u=i[0];return de(o,i[1])&&de(r.inputValue,u.inputValue)&&de(r.options,u.options)}).bind(vt(vt(n)));var i=t.menuIsOpen?n.buildMenuOptions(t,o):{render:[],focusable:[]};return n.state.menuOptions=i,n.state.selectValue=o,n}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var i=r.prototype;return i.componentDidMount=function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput()},i.UNSAFE_componentWillReceiveProps=function(e){var t=this.props,n=t.options,r=t.value,o=t.menuIsOpen,i=t.inputValue;if(this.cacheComponents(e.components),e.value!==r||e.options!==n||e.menuIsOpen!==o||e.inputValue!==i){var u=U(e.value),a=e.menuIsOpen?this.buildMenuOptions(e,u):{render:[],focusable:[]},s=this.getNextFocusedValue(u),l=this.getNextFocusedOption(a.focusable);this.setState({menuOptions:a,selectValue:u,focusedOption:l,focusedValue:s})}null!=this.inputIsHiddenAfterUpdate&&(this.setState({inputIsHidden:this.inputIsHiddenAfterUpdate}),delete this.inputIsHiddenAfterUpdate)},i.componentDidUpdate=function(e){var t,n,r,o,i,u=this.props,a=u.isDisabled,s=u.menuIsOpen,l=this.state.isFocused;(l&&!a&&e.isDisabled||l&&s&&!e.menuIsOpen)&&this.focusInput(),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(t=this.menuListRef,n=this.focusedOptionRef,r=t.getBoundingClientRect(),o=n.getBoundingClientRect(),i=n.offsetHeight/3,o.bottom+i>r.bottom?G(t,Math.min(n.offsetTop+n.clientHeight-t.offsetHeight+i,t.scrollHeight)):o.top-i<r.top&&G(t,Math.max(n.offsetTop-i,0)),this.scrollToFocusedOptionOnUpdate=!1)},i.componentWillUnmount=function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)},i.onMenuOpen=function(){this.props.onMenuOpen()},i.onMenuClose=function(){var e=this.props,t=e.isSearchable,n=e.isMulti;this.announceAriaLiveContext({event:"input",context:{isSearchable:t,isMulti:n}}),this.onInputChange("",{action:"menu-close"}),this.props.onMenuClose()},i.onInputChange=function(e,t){this.props.onInputChange(e,t)},i.focusInput=function(){this.inputRef&&this.inputRef.focus()},i.blurInput=function(){this.inputRef&&this.inputRef.blur()},i.openMenu=function(e){var t=this,n=this.state,r=n.selectValue,o=n.isFocused,i=this.buildMenuOptions(this.props,r),u=this.props.isMulti,a="first"===e?0:i.focusable.length-1;if(!u){var s=i.focusable.indexOf(r[0]);s>-1&&(a=s)}this.scrollToFocusedOptionOnUpdate=!(o&&this.menuListRef),this.inputIsHiddenAfterUpdate=!1,this.setState({menuOptions:i,focusedValue:null,focusedOption:i.focusable[a]},function(){t.onMenuOpen(),t.announceAriaLiveContext({event:"menu"})})},i.focusValue=function(e){var t=this.props,n=t.isMulti,r=t.isSearchable,o=this.state,i=o.selectValue,u=o.focusedValue;if(n){this.setState({focusedOption:null});var a=i.indexOf(u);u||(a=-1,this.announceAriaLiveContext({event:"value"}));var s=i.length-1,l=-1;if(i.length){switch(e){case"previous":l=0===a?0:-1===a?s:a-1;break;case"next":a>-1&&a<s&&(l=a+1)}-1===l&&this.announceAriaLiveContext({event:"input",context:{isSearchable:r,isMulti:n}}),this.setState({inputIsHidden:-1!==l,focusedValue:i[l]})}}},i.focusOption=function(e){void 0===e&&(e="first");var t=this.props.pageSize,n=this.state,r=n.focusedOption,o=n.menuOptions.focusable;if(o.length){var i=0,u=o.indexOf(r);r||(u=-1,this.announceAriaLiveContext({event:"menu"})),"up"===e?i=u>0?u-1:o.length-1:"down"===e?i=(u+1)%o.length:"pageup"===e?(i=u-t)<0&&(i=0):"pagedown"===e?(i=u+t)>o.length-1&&(i=o.length-1):"last"===e&&(i=o.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:o[i],focusedValue:null}),this.announceAriaLiveContext({event:"menu",context:{isDisabled:ft(o[i])}})}},i.getTheme=function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(mt):gt({},mt,this.props.theme):mt},i.getCommonProps=function(){var e=this.clearValue,t=this.getStyles,n=this.setValue,r=this.selectOption,o=this.props,i=o.classNamePrefix,u=o.isMulti,a=o.isRtl,s=o.options,l=this.state.selectValue,c=this.hasValue();return{cx:function(e,t,n){var r=[n];if(t&&e)for(var o in t)t.hasOwnProperty(o)&&t[o]&&r.push(""+_(e,o));return r.filter(function(e){return e}).map(function(e){return String(e).trim()}).join(" ")}.bind(null,i),clearValue:e,getStyles:t,getValue:function(){return l},hasValue:c,isMulti:u,isRtl:a,options:s,selectOption:r,setValue:n,selectProps:o,theme:this.getTheme()}},i.getNextFocusedValue=function(e){if(this.clearFocusValueOnUpdate)return this.clearFocusValueOnUpdate=!1,null;var t=this.state,n=t.focusedValue,r=t.selectValue.indexOf(n);if(r>-1){if(e.indexOf(n)>-1)return n;if(r<e.length)return e[r]}return null},i.getNextFocusedOption=function(e){var t=this.state.focusedOption;return t&&e.indexOf(t)>-1?t:e[0]},i.hasValue=function(){return this.state.selectValue.length>0},i.hasOptions=function(){return!!this.state.menuOptions.render.length},i.countOptions=function(){return this.state.menuOptions.focusable.length},i.isClearable=function(){var e=this.props,t=e.isClearable,n=e.isMulti;return void 0===t?n:t},i.isOptionDisabled=function(e,t){return"function"==typeof this.props.isOptionDisabled&&this.props.isOptionDisabled(e,t)},i.isOptionSelected=function(e,t){var n=this;if(t.indexOf(e)>-1)return!0;if("function"==typeof this.props.isOptionSelected)return this.props.isOptionSelected(e,t);var r=this.getOptionValue(e);return t.some(function(e){return n.getOptionValue(e)===r})},i.filterOption=function(e,t){return!this.props.filterOption||this.props.filterOption(e,t)},i.formatOptionLabel=function(e,t){if("function"==typeof this.props.formatOptionLabel){var n=this.props.inputValue,r=this.state.selectValue;return this.props.formatOptionLabel(e,{context:t,inputValue:n,selectValue:r})}return this.getOptionLabel(e)},i.formatGroupLabel=function(e){return this.props.formatGroupLabel(e)},i.startListeningComposition=function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))},i.stopListeningComposition=function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))},i.startListeningToTouch=function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))},i.stopListeningToTouch=function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))},i.constructAriaLiveMessage=function(){var e=this.state,t=e.ariaLiveContext,n=e.selectValue,r=e.focusedValue,o=e.focusedOption,i=this.props,u=i.options,a=i.menuIsOpen,s=i.inputValue,l=i.screenReaderStatus;return(r?function(e){var t=e.focusedValue,n=e.getOptionLabel,r=e.selectValue;return"value "+n(t)+" focused, "+(r.indexOf(t)+1)+" of "+r.length+"."}({focusedValue:r,getOptionLabel:this.getOptionLabel,selectValue:n}):"")+" "+(o&&a?function(e){var t=e.focusedOption,n=e.getOptionLabel,r=e.options;return"option "+n(t)+" focused"+(t.isDisabled?" disabled":"")+", "+(r.indexOf(t)+1)+" of "+r.length+"."}({focusedOption:o,getOptionLabel:this.getOptionLabel,options:u}):"")+" "+function(e){var t=e.inputValue;return e.screenReaderMessage+(t?" for search term "+t:"")+"."}({inputValue:s,screenReaderMessage:l({count:this.countOptions()})})+" "+t},i.renderInput=function(){var e=this.props,t=e.isDisabled,n=e.isSearchable,r=e.inputId,i=e.inputValue,u=e.tabIndex,a=this.components.Input,s=this.state.inputIsHidden,l=r||this.getElementId("input"),c={"aria-autocomplete":"list","aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"]};if(!n)return o.a.createElement(Ke,gt({id:l,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:N,onFocus:this.onInputFocus,readOnly:!0,disabled:t,tabIndex:u,value:""},c));var p=this.commonProps,d=p.cx,f=p.theme,h=p.selectProps;return o.a.createElement(a,gt({autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",cx:d,getStyles:this.getStyles,id:l,innerRef:this.getInputRef,isDisabled:t,isHidden:s,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,selectProps:h,spellCheck:"false",tabIndex:u,theme:f,type:"text",value:i},c))},i.renderPlaceholderOrValue=function(){var e=this,t=this.components,n=t.MultiValue,r=t.MultiValueContainer,i=t.MultiValueLabel,u=t.MultiValueRemove,a=t.SingleValue,s=t.Placeholder,l=this.commonProps,c=this.props,p=c.controlShouldRenderValue,d=c.isDisabled,f=c.isMulti,h=c.inputValue,m=c.placeholder,g=this.state,v=g.selectValue,b=g.focusedValue,E=g.isFocused;if(!this.hasValue()||!p)return h?null:o.a.createElement(s,gt({},l,{key:"placeholder",isDisabled:d,isFocused:E}),m);if(f)return v.map(function(t,a){var s=t===b;return o.a.createElement(n,gt({},l,{components:{Container:r,Label:i,Remove:u},isFocused:s,isDisabled:d,key:e.getOptionValue(t),index:a,removeProps:{onClick:function(){return e.removeValue(t)},onTouchEnd:function(){return e.removeValue(t)},onMouseDown:function(e){e.preventDefault(),e.stopPropagation()}},data:t}),e.formatOptionLabel(t,"value"))});if(h)return null;var y=v[0];return o.a.createElement(a,gt({},l,{data:y,isDisabled:d}),this.formatOptionLabel(y,"value"))},i.renderClearIndicator=function(){var e=this.components.ClearIndicator,t=this.commonProps,n=this.props,r=n.isDisabled,i=n.isLoading,u=this.state.isFocused;if(!this.isClearable()||!e||r||!this.hasValue()||i)return null;var a={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return o.a.createElement(e,gt({},t,{innerProps:a,isFocused:u}))},i.renderLoadingIndicator=function(){var e=this.components.LoadingIndicator,t=this.commonProps,n=this.props,r=n.isDisabled,i=n.isLoading,u=this.state.isFocused;if(!e||!i)return null;return o.a.createElement(e,gt({},t,{innerProps:{"aria-hidden":"true"},isDisabled:r,isFocused:u}))},i.renderIndicatorSeparator=function(){var e=this.components,t=e.DropdownIndicator,n=e.IndicatorSeparator;if(!t||!n)return null;var r=this.commonProps,i=this.props.isDisabled,u=this.state.isFocused;return o.a.createElement(n,gt({},r,{isDisabled:i,isFocused:u}))},i.renderDropdownIndicator=function(){var e=this.components.DropdownIndicator;if(!e)return null;var t=this.commonProps,n=this.props.isDisabled,r=this.state.isFocused,i={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return o.a.createElement(e,gt({},t,{innerProps:i,isDisabled:n,isFocused:r}))},i.renderMenu=function(){var e=this,t=this.components,n=t.Group,r=t.GroupHeading,i=t.Menu,u=t.MenuList,a=t.MenuPortal,s=t.LoadingMessage,l=t.NoOptionsMessage,c=t.Option,p=this.commonProps,d=this.state,f=d.focusedOption,h=d.menuOptions,m=this.props,g=m.captureMenuScroll,v=m.inputValue,b=m.isLoading,E=m.loadingMessage,y=m.minMenuHeight,O=m.maxMenuHeight,C=m.menuIsOpen,A=m.menuPlacement,F=m.menuPosition,w=m.menuPortalTarget,S=m.menuShouldBlockScroll,x=m.menuShouldScrollIntoView,D=m.noOptionsMessage,k=m.onMenuScrollToTop,I=m.onMenuScrollToBottom;if(!C)return null;var M,P=function(t){var n=f===t.data;return t.innerRef=n?e.getFocusedOptionRef:void 0,o.a.createElement(c,gt({},p,t,{isFocused:n}),e.formatOptionLabel(t.data,"menu"))};if(this.hasOptions())M=h.render.map(function(t){if("group"===t.type){t.type;var i=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(t,["type"]),u=t.key+"-heading";return o.a.createElement(n,gt({},p,i,{Heading:r,headingProps:{id:u},label:e.formatGroupLabel(t.data)}),t.options.map(function(e){return P(e)}))}if("option"===t.type)return P(t)});else if(b){var L=E({inputValue:v});if(null===L)return null;M=o.a.createElement(s,p,L)}else{var V=D({inputValue:v});if(null===V)return null;M=o.a.createElement(l,p,V)}var R={minMenuHeight:y,maxMenuHeight:O,menuPlacement:A,menuPosition:F,menuShouldScrollIntoView:x},T=o.a.createElement(ne,gt({},p,R),function(t){var n=t.ref,r=t.placerProps,a=r.placement,s=r.maxHeight;return o.a.createElement(i,gt({},p,R,{innerRef:n,innerProps:{onMouseDown:e.onMenuMouseDown,onMouseMove:e.onMenuMouseMove},isLoading:b,placement:a}),o.a.createElement(ct,{isEnabled:g,onTopArrive:k,onBottomArrive:I},o.a.createElement(st,{isEnabled:S},o.a.createElement(u,gt({},p,{innerRef:e.getMenuListRef,isLoading:b,maxHeight:s}),M))))});return w||"fixed"===F?o.a.createElement(a,gt({},p,{appendTo:w,controlElement:this.controlRef,menuPlacement:A,menuPosition:F}),T):T},i.renderFormField=function(){var e=this,t=this.props,n=t.delimiter,r=t.isDisabled,i=t.isMulti,u=t.name,a=this.state.selectValue;if(u&&!r){if(i){if(n){var s=a.map(function(t){return e.getOptionValue(t)}).join(n);return o.a.createElement("input",{name:u,type:"hidden",value:s})}var l=a.length>0?a.map(function(t,n){return o.a.createElement("input",{key:"i-"+n,name:u,type:"hidden",value:e.getOptionValue(t)})}):o.a.createElement("input",{name:u,type:"hidden"});return o.a.createElement("div",null,l)}var c=a[0]?this.getOptionValue(a[0]):"";return o.a.createElement("input",{name:u,type:"hidden",value:c})}},i.renderLiveRegion=function(){return this.state.isFocused?o.a.createElement(Xe,{"aria-live":"polite"},o.a.createElement("p",{id:"aria-selection-event"}," ",this.state.ariaLiveSelection),o.a.createElement("p",{id:"aria-context"}," ",this.constructAriaLiveMessage())):null},i.render=function(){var e=this.components,t=e.Control,n=e.IndicatorsContainer,r=e.SelectContainer,i=e.ValueContainer,u=this.props,a=u.className,s=u.id,l=u.isDisabled,c=u.menuIsOpen,p=this.state.isFocused,d=this.commonProps=this.getCommonProps();return o.a.createElement(r,gt({},d,{className:a,innerProps:{id:s,onKeyDown:this.onKeyDown},isDisabled:l,isFocused:p}),this.renderLiveRegion(),o.a.createElement(t,gt({},d,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:l,isFocused:p,menuIsOpen:c}),o.a.createElement(i,gt({},d,{isDisabled:l}),this.renderPlaceholderOrValue(),this.renderInput()),o.a.createElement(n,gt({},d,{isDisabled:l}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())},r}(r.Component);function Ct(){return(Ct=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}Ot.defaultProps=Et;var At={defaultInputValue:"",defaultMenuIsOpen:!1,defaultValue:null};function Ft(){return(Ft=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}n.d(t,"defaultProps",function(){return Dt}),n.d(t,"makeAsyncSelect",function(){return kt});var wt,St,xt,Dt={cacheOptions:!1,defaultOptions:!1,filterOption:null,isLoading:!1},kt=function(e){var t,n;return n=t=function(t){var n,r;function i(e){var n;return(n=t.call(this)||this).select=void 0,n.lastRequest=void 0,n.mounted=!1,n.optionsCache={},n.handleInputChange=function(e,t){var r=n.props,o=r.cacheOptions,i=function(e,t,n){if(n){var r=n(e,t);if("string"==typeof r)return r}return e}(e,t,r.onInputChange);if(!i)return delete n.lastRequest,void n.setState({inputValue:"",loadedInputValue:"",loadedOptions:[],isLoading:!1,passEmptyOptions:!1});if(o&&n.optionsCache[i])n.setState({inputValue:i,loadedInputValue:i,loadedOptions:n.optionsCache[i],isLoading:!1,passEmptyOptions:!1});else{var u=n.lastRequest={};n.setState({inputValue:i,isLoading:!0,passEmptyOptions:!n.state.loadedInputValue},function(){n.loadOptions(i,function(e){n.mounted&&(e&&(n.optionsCache[i]=e),u===n.lastRequest&&(delete n.lastRequest,n.setState({isLoading:!1,loadedInputValue:i,loadedOptions:e||[],passEmptyOptions:!1})))})})}return i},n.state={defaultOptions:Array.isArray(e.defaultOptions)?e.defaultOptions:void 0,inputValue:void 0!==e.inputValue?e.inputValue:"",isLoading:!0===e.defaultOptions,loadedOptions:[],passEmptyOptions:!1},n}r=t,(n=i).prototype=Object.create(r.prototype),n.prototype.constructor=n,n.__proto__=r;var u=i.prototype;return u.componentDidMount=function(){var e=this;this.mounted=!0;var t=this.props.defaultOptions,n=this.state.inputValue;!0===t&&this.loadOptions(n,function(t){if(e.mounted){var n=!!e.lastRequest;e.setState({defaultOptions:t||[],isLoading:n})}})},u.UNSAFE_componentWillReceiveProps=function(e){e.cacheOptions!==this.props.cacheOptions&&(this.optionsCache={}),e.defaultOptions!==this.props.defaultOptions&&this.setState({defaultOptions:Array.isArray(e.defaultOptions)?e.defaultOptions:void 0})},u.componentWillUnmount=function(){this.mounted=!1},u.focus=function(){this.select.focus()},u.blur=function(){this.select.blur()},u.loadOptions=function(e,t){var n=this.props.loadOptions;if(!n)return t();var r=n(e,t);r&&"function"==typeof r.then&&r.then(t,function(){return t()})},u.render=function(){var t=this,n=this.props,r=(n.loadOptions,n.isLoading),i=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(n,["loadOptions","isLoading"]),u=this.state,a=u.defaultOptions,s=u.inputValue,l=u.isLoading,c=u.loadedInputValue,p=u.loadedOptions,d=u.passEmptyOptions?[]:s&&c?p:a||[];return o.a.createElement(e,Ft({},i,{ref:function(e){t.select=e},options:d,isLoading:l||r,onInputChange:this.handleInputChange}))},i}(r.Component),t.defaultProps=Dt,n},It=(wt=Ot,xt=St=function(e){var t,n;function r(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).select=void 0,t.state={inputValue:void 0!==t.props.inputValue?t.props.inputValue:t.props.defaultInputValue,menuIsOpen:void 0!==t.props.menuIsOpen?t.props.menuIsOpen:t.props.defaultMenuIsOpen,value:void 0!==t.props.value?t.props.value:t.props.defaultValue},t.onChange=function(e,n){t.callProp("onChange",e,n),t.setState({value:e})},t.onInputChange=function(e,n){var r=t.callProp("onInputChange",e,n);t.setState({inputValue:void 0!==r?r:e})},t.onMenuOpen=function(){t.callProp("onMenuOpen"),t.setState({menuIsOpen:!0})},t.onMenuClose=function(){t.callProp("onMenuClose"),t.setState({menuIsOpen:!1})},t}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var i=r.prototype;return i.focus=function(){this.select.focus()},i.blur=function(){this.select.blur()},i.getProp=function(e){return void 0!==this.props[e]?this.props[e]:this.state[e]},i.callProp=function(e){if("function"==typeof this.props[e]){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return(t=this.props)[e].apply(t,r)}},i.render=function(){var e=this,t=this.props,n=(t.defaultInputValue,t.defaultMenuIsOpen,t.defaultValue,function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(t,["defaultInputValue","defaultMenuIsOpen","defaultValue"]));return o.a.createElement(wt,Ct({},n,{ref:function(t){e.select=t},inputValue:this.getProp("inputValue"),menuIsOpen:this.getProp("menuIsOpen"),onChange:this.onChange,onInputChange:this.onInputChange,onMenuClose:this.onMenuClose,onMenuOpen:this.onMenuOpen,value:this.getProp("value")}))},r}(r.Component),St.defaultProps=At,xt),Mt=kt(It);t.default=Mt}}]);
dist/core/admin-notices-api.min.js CHANGED
@@ -1 +1 @@
1
- this.itsec=this.itsec||{},this.itsec.core=this.itsec.core||{},this.itsec.core["admin-notices-api"]=function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s="M/oR")}({"1ZqX":function(t,e){!function(){t.exports=this.wp.data}()},"7W2i":function(t,e,n){var r=n("SksO");t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&r(t,e)}},"92Nh":function(t,e){t.exports=function(t,e,n){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");var r=e.get(t);if(!r.writable)throw new TypeError("attempted to set read only private field");return r.value=n,n}},Bnag:function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},EbDI:function(t,e){t.exports=function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}},Ijbi:function(t,e){t.exports=function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}},J4zp:function(t,e,n){var r=n("wTVA"),o=n("m0LI"),i=n("wkBT");t.exports=function(t,e){return r(t)||o(t,e)||i()}},"M/oR":function(t,e,n){"use strict";n.r(e);var r={};n.r(r),n.d(r,"receiveNotices",function(){return E}),n.d(r,"startNoticeAction",function(){return w}),n.d(r,"finishNoticeAction",function(){return O}),n.d(r,"failedNoticeAction",function(){return T}),n.d(r,"receiveMutedHighlights",function(){return _}),n.d(r,"startUpdateMutedHighlight",function(){return x}),n.d(r,"finishUpdateMutedHighlight",function(){return A}),n.d(r,"failedUpdateMutedHighlight",function(){return S}),n.d(r,"doNoticeAction",function(){return H}),n.d(r,"updateMutedHighlight",function(){return j}),n.d(r,"RECEIVE_NOTICES",function(){return P}),n.d(r,"START_NOTICE_ACTION",function(){return N}),n.d(r,"FINISH_NOTICE_ACTION",function(){return k}),n.d(r,"FAILED_NOTICE_ACTION",function(){return M}),n.d(r,"RECEIVE_MUTED_HIGHLIGHTS",function(){return R}),n.d(r,"START_UPDATE_MUTED_HIGHLIGHT",function(){return C}),n.d(r,"FINISH_UPDATE_MUTED_HIGHLIGHT",function(){return D}),n.d(r,"FAILED_UPDATE_MUTED_HIGHLIGHT",function(){return U});var o={};n.r(o),n.d(o,"isResolving",function(){return F}),n.d(o,"isResolved",function(){return L}),n.d(o,"getNotices",function(){return G}),n.d(o,"areNoticesLoaded",function(){return J}),n.d(o,"isDoingAction",function(){return q}),n.d(o,"getInProgressActions",function(){return W}),n.d(o,"getMutedHighlights",function(){return Z}),n.d(o,"getMutedHighlightUpdatesInFlight",function(){return B});var i={};n.r(i),n.d(i,"getNotices",function(){return z}),n.d(i,"getMutedHighlights",function(){return K});var u=n("1ZqX"),c=n("RIqP"),s=n.n(c),a=n("MVZn"),f=n.n(a),l=n("YLtl"),d=n("ywyh"),p=n.n(d),h=n("Td6G");function g(t){return{type:"API_FETCH",request:t}}var y={API_FETCH:function(t){var e=t.request;return p()(e).catch(h.e)},SELECT:function(t){var e,n=t.selectorName,r=t.args;return(e=Object(u.select)("ithemes-security/admin-notices"))[n].apply(e,s()(r))},CREATE_NOTICE:function(t){var e=t.status,n=t.content,r=t.options;r.autoDismiss&&(r.id=r.id||Object(l.uniqueId)("itsec-auto-dismiss-"),setTimeout(function(){return Object(u.dispatch)("core/notices").removeNotice(r.id,r.context)},r.autoDismiss)),Object(u.dispatch)("core/notices").createNotice(e,n,r)}},v=n("lSNA"),m=n.n(v),b=regeneratorRuntime.mark(H),I=regeneratorRuntime.mark(j);function E(t){return{type:P,notices:t}}function w(t,e){return{type:N,noticeId:t,actionId:e}}function O(t,e,n){return{type:k,noticeId:t,actionId:e,response:n}}function T(t,e,n){return{type:M,noticeId:t,actionId:e,error:n}}function _(t){return{type:R,mutedHighlights:t}}function x(t,e){return{type:C,slug:t,mute:e}}function A(t,e){return{type:D,slug:t,mute:e}}function S(t,e,n){return{type:U,slug:t,mute:e,error:n}}function H(t,e){var n,r,o=arguments;return regeneratorRuntime.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return n=o.length>2&&void 0!==o[2]?o[2]:{},i.next=3,w(t,e);case 3:return i.prev=3,i.next=6,g({path:"/ithemes-security/v1/admin-notices/".concat(t,"/").concat(e),method:"POST",data:n});case 6:r=i.sent,i.next=14;break;case 9:return i.prev=9,i.t0=i.catch(3),i.next=13,T(t,e,i.t0);case 13:return i.abrupt("return",i.t0);case 14:return i.next=16,O(t,e,r);case 16:return i.abrupt("return",r);case 17:case"end":return i.stop()}},b,this,[[3,9]])}function j(t,e){var n;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,x(t,e);case 2:return r.prev=2,r.next=5,g({path:"/ithemes-security/v1/admin-notices/settings",method:"PUT",data:{muted_highlights:m()({},t,e)}});case 5:n=r.sent,r.next=13;break;case 8:return r.prev=8,r.t0=r.catch(2),r.next=12,S(t,e,r.t0);case 12:return r.abrupt("return",r.t0);case 13:return r.next=15,A(t,e);case 15:return r.abrupt("return",n);case 16:case"end":return r.stop()}},I,this,[[2,8]])}var P="RECEIVE_NOTICES",N="START_NOTICE_ACTION",k="FINISH_NOTICE_ACTION",M="FAILED_NOTICE_ACTION",R="RECEIVE_MUTED_HIGHLIGHTS",C="START_UPDATE_MUTED_HIGHLIGHT",D="FINISH_UPDATE_MUTED_HIGHLIGHT",U="FAILED_UPDATE_MUTED_HIGHLIGHT";function F(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return Object(u.select)("core/data").isResolving("ithemes-security/admin-notices",t,n)}function L(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return Object(u.select)("core/data").hasFinishedResolution("ithemes-security/admin-notices",t,n)}function G(t){return t.notices}function J(){return L("getNotices")}function q(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return!!t.doingActions[e]&&(""===n||t.doingActions[e].includes(n))}var V=[];function W(t,e){return t.doingActions[e]||V}function Z(t){return t.mutedHighlights}function B(t){return t.mutedHighlightUpdatesInFlight}var Y={notices:[],doingActions:{},mutedHighlights:{},mutedHighlightUpdatesInFlight:{}};var X=regeneratorRuntime.mark(K),z={fulfill:regeneratorRuntime.mark(function t(){var e;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,g({path:"/ithemes-security/v1/admin-notices"});case 2:return e=t.sent,t.next=5,E(e);case 5:case"end":return t.stop()}},t,this)}),shouldInvalidate:function(t){return t.type===k||t.type===D}};function K(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,g({path:"/ithemes-security/v1/admin-notices/settings"});case 2:return t=e.sent,e.next=5,_(Object(l.isEmpty)(t.muted_highlights)?{}:t.muted_highlights);case 5:case"end":return e.stop()}},X,this)}Object(u.registerStore)("ithemes-security/admin-notices",{controls:y,actions:r,selectors:o,resolvers:i,reducer:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Y,e=arguments.length>1?arguments[1]:void 0;switch(e.type){case P:return f()({},t,{notices:s()(e.notices)});case N:return f()({},t,{doingActions:f()({},t.doingActions,m()({},e.noticeId,s()(t.doingActions[e.noticeId]||[]).concat([e.actionId])))});case k:case M:return f()({},t,{doingActions:f()({},t.doingActions,m()({},e.noticeId,(t.doingActions[e.noticeId]||[]).filter(function(t){return t!==e.actionId})))});case R:return f()({},t,{mutedHighlights:e.mutedHighlights});case C:return f()({},t,{mutedHighlightUpdatesInFlight:f()({},t.mutedHighlightUpdatesInFlight,m()({},e.slug,{mute:e.mute}))});case D:return f()({},t,{mutedHighlightUpdatesInFlight:Object(l.omit)(t.mutedHighlightUpdatesInFlight,e.slug),mutedHighlights:f()({},t.mutedHighlights,m()({},e.slug,e.mute))});case U:return f()({},t,{mutedHighlightUpdatesInFlight:Object(l.omit)(t.mutedHighlightUpdatesInFlight,e.slug)});default:return t}}});n.p=window.itsecWebpackPublicPath},MVZn:function(t,e,n){var r=n("lSNA");t.exports=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),o.forEach(function(e){r(t,e,n[e])})}return t}},Nsbk:function(t,e){function n(e){return t.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},n(e)}t.exports=n},PJYZ:function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}},RIqP:function(t,e,n){var r=n("Ijbi"),o=n("EbDI"),i=n("Bnag");t.exports=function(t){return r(t)||o(t)||i()}},SksO:function(t,e){function n(e,r){return t.exports=n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},n(e,r)}t.exports=n},Td6G:function(t,e,n){"use strict";n("J4zp");var r=n("YLtl"),o=n("RIqP"),i=n.n(o),u=n("lwsE"),c=n.n(u),s=n("W8MJ"),a=n.n(s),f=n("lSNA"),l=n.n(f),d=n("92Nh"),p=n.n(d),h=n("tmk3"),g=n.n(h),y=function(){function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;c()(this,t),v.set(this,{writable:!0,value:{}}),m.set(this,{writable:!0,value:{}}),l()(this,"getErrorCodes",function(){return Object.keys(g()(e,v))}),l()(this,"getErrorCode",function(){return e.getErrorCodes()[0]}),l()(this,"getErrorMessages",function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;if(t)return g()(e,v)[t];var n=[];for(var r in g()(e,v))g()(e,v).hasOwnProperty(r)&&n.concat(g()(e,v)[r]);return n}),l()(this,"getErrorMessage",function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return t=t||e.getErrorCode(),e.getErrorMessages(t)[0]}),l()(this,"getErrorData",function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return t=t||e.getErrorCode(),g()(e,m)[t]}),l()(this,"getAllErrorMessages",function(){var t=[];for(var n in g()(e,v))g()(e,v).hasOwnProperty(n)&&t.push.apply(t,i()(g()(e,v)[n]));return t}),n&&(r&&(g()(this,v)[n]=[r]),o&&(g()(this,m)[n]=o))}return a()(t,null,[{key:"fromPHPObject",value:function(e){var n=new t;return p()(n,v,e.errors),p()(n,m,e.error_data),n}},{key:"fromApiError",value:function(e){var n=new t;if(g()(n,v)[e.code]=[e.message],g()(n,m)[e.code]=e.data,e.additional_errors){var r=!0,o=!1,i=void 0;try{for(var u,c=e.additional_errors[Symbol.iterator]();!(r=(u=c.next()).done);r=!0){var s=u.value;g()(n,v)[s.code]=[s.message],g()(n,m)[s.code]=s.data}}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}}return n}}]),t}(),v=new WeakMap,m=new WeakMap,b=n("a1gu"),I=n.n(b),E=n("Nsbk"),w=n.n(E),O=n("7W2i"),T=n.n(O),_=n("PJYZ"),x=n.n(_),A=n("oShl"),S=n.n(A),H=n("l3Sj"),j=function(t){function e(t){var n,r;c()(this,e);for(var o=arguments.length,i=new Array(o>1?o-1:0),u=1;u<o;u++)i[u-1]=arguments[u];for(var s in r=I()(this,(n=w()(e)).call.apply(n,[this,t.message||Object(H.__)("An unknown error occurred.","better-wp-security")].concat(i))),Error.captureStackTrace&&Error.captureStackTrace(x()(x()(r)),e),r.__response=t,t)t.hasOwnProperty(s)&&Object.defineProperty(x()(x()(r)),s,{value:t[s],configurable:!0,enumerable:!0,writable:!0});return r}return T()(e,t),a()(e,[{key:"toString",value:function(){return this.__response.toString()}},{key:"getResponse",value:function(){return this.__response}}]),e}(S()(Error));function P(t){if(!Object(r.isPlainObject)(t))return!1;var e=Object.keys(t);return 2===e.length&&(e.includes("errors")&&e.includes("error_data"))}function N(t){return P(t)?y.fromPHPObject(t):function(t){if(!Object(r.isPlainObject)(t))return!1;var e=Object.keys(t);return(3===e.length||4===e.length)&&!(4===e.length&&!e.includes("additional_errors"))&&e.includes("code")&&e.includes("message")&&e.includes("data")}(t)?y.fromApiError(t):new y}function k(t,e){var n=[[],[]],r=!0,o=!1,i=void 0;try{for(var u,c=t[Symbol.iterator]();!(r=(u=c.next()).done);r=!0){var s=u.value;n[e(s)?0:1].push(s)}}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}function M(t){if(t instanceof Error)throw t;throw new j(t)}n.d(e,"d",function(){return P}),n.d(e,"b",function(){return N}),n.d(e,"a",function(){return k}),n.d(e,"e",function(){return M}),n.d(e,"c",function(){return R});function R(t,e){if(t&&t.links){var n=!0,r=!1,o=void 0;try{for(var i,u=t.links[Symbol.iterator]();!(n=(i=u.next()).done);n=!0){var c=i.value;if(c.rel===e)return c}}catch(t){r=!0,o=t}finally{try{n||null==u.return||u.return()}finally{if(r)throw o}}}}},W8MJ:function(t,e){function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}t.exports=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t}},YLtl:function(t,e){!function(){t.exports=this.lodash}()},a1gu:function(t,e,n){var r=n("cDf5"),o=n("PJYZ");t.exports=function(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?o(t):e}},cDf5:function(t,e){function n(t){return(n="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(e){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?t.exports=r=function(t){return n(t)}:t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":n(t)},r(e)}t.exports=r},l3Sj:function(t,e){!function(){t.exports=this.wp.i18n}()},lSNA:function(t,e){t.exports=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},lwsE:function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},m0LI:function(t,e){t.exports=function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var u,c=t[Symbol.iterator]();!(r=(u=c.next()).done)&&(n.push(u.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}},oShl:function(t,e,n){var r=n("Nsbk"),o=n("SksO"),i=n("xfeJ"),u=n("sXyB");function c(e){var n="function"==typeof Map?new Map:void 0;return t.exports=c=function(t){if(null===t||!i(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(t))return n.get(t);n.set(t,e)}function e(){return u(t,arguments,r(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),o(e,t)},c(e)}t.exports=c},sXyB:function(t,e,n){var r=n("SksO");function o(e,n,i){return!function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}()?t.exports=o=function(t,e,n){var o=[null];o.push.apply(o,e);var i=new(Function.bind.apply(t,o));return n&&r(i,n.prototype),i}:t.exports=o=Reflect.construct,o.apply(null,arguments)}t.exports=o},tmk3:function(t,e){t.exports=function(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t).value}},wTVA:function(t,e){t.exports=function(t){if(Array.isArray(t))return t}},wkBT:function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},xfeJ:function(t,e){t.exports=function(t){return-1!==Function.toString.call(t).indexOf("[native code]")}},ywyh:function(t,e){!function(){t.exports=this.wp.apiFetch}()}});
1
+ this.itsec=this.itsec||{},this.itsec.core=this.itsec.core||{},this.itsec.core["admin-notices-api"]=function(t){function e(e){for(var r,u,c=e[0],a=e[1],s=e[2],l=0,d=[];l<c.length;l++)u=c[l],i[u]&&d.push(i[u][0]),i[u]=0;for(r in a)Object.prototype.hasOwnProperty.call(a,r)&&(t[r]=a[r]);for(f&&f(e);d.length;)d.shift()();return o.push.apply(o,s||[]),n()}function n(){for(var t,e=0;e<o.length;e++){for(var n=o[e],r=!0,c=1;c<n.length;c++){var a=n[c];0!==i[a]&&(r=!1)}r&&(o.splice(e--,1),t=u(u.s=n[0]))}return t}var r={},i={2:0},o=[];function u(e){if(r[e])return r[e].exports;var n=r[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,u),n.l=!0,n.exports}u.m=t,u.c=r,u.d=function(t,e,n){u.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},u.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},u.t=function(t,e){if(1&e&&(t=u(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(u.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)u.d(n,r,function(e){return t[e]}.bind(null,r));return n},u.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return u.d(e,"a",e),e},u.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},u.p="";var c=window.itsecWebpackJsonP=window.itsecWebpackJsonP||[],a=c.push.bind(c);c.push=e,c=c.slice();for(var s=0;s<c.length;s++)e(c[s]);var f=a;return o.push(["M/oR",0]),n()}({"1ZqX":function(t,e){!function(){t.exports=this.wp.data}()},"M/oR":function(t,e,n){"use strict";n.r(e);var r={};n.r(r),n.d(r,"receiveNotices",function(){return O}),n.d(r,"startNoticeAction",function(){return E}),n.d(r,"finishNoticeAction",function(){return _}),n.d(r,"failedNoticeAction",function(){return A}),n.d(r,"receiveMutedHighlights",function(){return T}),n.d(r,"startUpdateMutedHighlight",function(){return w}),n.d(r,"finishUpdateMutedHighlight",function(){return H}),n.d(r,"failedUpdateMutedHighlight",function(){return j}),n.d(r,"doNoticeAction",function(){return S}),n.d(r,"updateMutedHighlight",function(){return P}),n.d(r,"RECEIVE_NOTICES",function(){return N}),n.d(r,"START_NOTICE_ACTION",function(){return x}),n.d(r,"FINISH_NOTICE_ACTION",function(){return M}),n.d(r,"FAILED_NOTICE_ACTION",function(){return C}),n.d(r,"RECEIVE_MUTED_HIGHLIGHTS",function(){return U}),n.d(r,"START_UPDATE_MUTED_HIGHLIGHT",function(){return D}),n.d(r,"FINISH_UPDATE_MUTED_HIGHLIGHT",function(){return k}),n.d(r,"FAILED_UPDATE_MUTED_HIGHLIGHT",function(){return R});var i={};n.r(i),n.d(i,"isResolving",function(){return F}),n.d(i,"isResolved",function(){return G}),n.d(i,"getNotices",function(){return L}),n.d(i,"areNoticesLoaded",function(){return q}),n.d(i,"isDoingAction",function(){return W}),n.d(i,"getInProgressActions",function(){return V}),n.d(i,"getMutedHighlights",function(){return Y}),n.d(i,"getMutedHighlightUpdatesInFlight",function(){return Z});var o={};n.r(o),n.d(o,"getNotices",function(){return K}),n.d(o,"getMutedHighlights",function(){return Q});var u=n("1ZqX"),c=n("RIqP"),a=n.n(c),s=n("lSNA"),f=n.n(s),l=n("YLtl"),d=n("ywyh"),h=n.n(d),g=n("Td6G");function p(t){return{type:"API_FETCH",request:t}}var v={API_FETCH:function(t){var e=t.request;return h()(e).catch(g.e)},SELECT:function(t){var e,n=t.selectorName,r=t.args;return(e=Object(u.select)("ithemes-security/admin-notices"))[n].apply(e,a()(r))},CREATE_NOTICE:function(t){var e=t.status,n=t.content,r=t.options;r.autoDismiss&&(r.id=r.id||Object(l.uniqueId)("itsec-auto-dismiss-"),setTimeout(function(){return Object(u.dispatch)("core/notices").removeNotice(r.id,r.context)},r.autoDismiss)),Object(u.dispatch)("core/notices").createNotice(e,n,r)}},y=n("o0o1"),m=n.n(y),b=m.a.mark(S),I=m.a.mark(P);function O(t){return{type:N,notices:t}}function E(t,e){return{type:x,noticeId:t,actionId:e}}function _(t,e,n){return{type:M,noticeId:t,actionId:e,response:n}}function A(t,e,n){return{type:C,noticeId:t,actionId:e,error:n}}function T(t){return{type:U,mutedHighlights:t}}function w(t,e){return{type:D,slug:t,mute:e}}function H(t,e){return{type:k,slug:t,mute:e}}function j(t,e,n){return{type:R,slug:t,mute:e,error:n}}function S(t,e){var n,r,i=arguments;return m.a.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return n=i.length>2&&void 0!==i[2]?i[2]:{},o.next=3,E(t,e);case 3:return o.prev=3,o.next=6,p({path:"/ithemes-security/v1/admin-notices/".concat(t,"/").concat(e),method:"POST",data:n});case 6:r=o.sent,o.next=14;break;case 9:return o.prev=9,o.t0=o.catch(3),o.next=13,A(t,e,o.t0);case 13:return o.abrupt("return",o.t0);case 14:return o.next=16,_(t,e,r);case 16:return o.abrupt("return",r);case 17:case"end":return o.stop()}},b,null,[[3,9]])}function P(t,e){var n;return m.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,w(t,e);case 2:return r.prev=2,r.next=5,p({path:"/ithemes-security/v1/admin-notices/settings",method:"PUT",data:{muted_highlights:f()({},t,e)}});case 5:n=r.sent,r.next=13;break;case 8:return r.prev=8,r.t0=r.catch(2),r.next=12,j(t,e,r.t0);case 12:return r.abrupt("return",r.t0);case 13:return r.next=15,H(t,e);case 15:return r.abrupt("return",n);case 16:case"end":return r.stop()}},I,null,[[2,8]])}var N="RECEIVE_NOTICES",x="START_NOTICE_ACTION",M="FINISH_NOTICE_ACTION",C="FAILED_NOTICE_ACTION",U="RECEIVE_MUTED_HIGHLIGHTS",D="START_UPDATE_MUTED_HIGHLIGHT",k="FINISH_UPDATE_MUTED_HIGHLIGHT",R="FAILED_UPDATE_MUTED_HIGHLIGHT";function F(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return Object(u.select)("core/data").isResolving("ithemes-security/admin-notices",t,n)}function G(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return Object(u.select)("core/data").hasFinishedResolution("ithemes-security/admin-notices",t,n)}function L(t){return t.notices}function q(){return G("getNotices")}function W(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return!!t.doingActions[e]&&(""===n||t.doingActions[e].includes(n))}var J=[];function V(t,e){return t.doingActions[e]||J}function Y(t){return t.mutedHighlights}function Z(t){return t.mutedHighlightUpdatesInFlight}function X(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 $(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?X(Object(n),!0).forEach(function(e){f()(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):X(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}var z={notices:[],doingActions:{},mutedHighlights:{},mutedHighlightUpdatesInFlight:{}};var B=m.a.mark(Q),K={fulfill:m.a.mark(function t(){var e;return m.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,p({path:"/ithemes-security/v1/admin-notices"});case 2:return e=t.sent,t.next=5,O(e);case 5:case"end":return t.stop()}},t)}),shouldInvalidate:function(t){return t.type===M||t.type===k}};function Q(){var t;return m.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p({path:"/ithemes-security/v1/admin-notices/settings"});case 2:return t=e.sent,e.next=5,T(Object(l.isEmpty)(t.muted_highlights)?{}:t.muted_highlights);case 5:case"end":return e.stop()}},B)}Object(u.registerStore)("ithemes-security/admin-notices",{controls:v,actions:r,selectors:i,resolvers:o,reducer:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:z,e=arguments.length>1?arguments[1]:void 0;switch(e.type){case N:return $($({},t),{},{notices:a()(e.notices)});case x:return $($({},t),{},{doingActions:$($({},t.doingActions),{},f()({},e.noticeId,[].concat(a()(t.doingActions[e.noticeId]||[]),[e.actionId])))});case M:case C:return $($({},t),{},{doingActions:$($({},t.doingActions),{},f()({},e.noticeId,(t.doingActions[e.noticeId]||[]).filter(function(t){return t!==e.actionId})))});case U:return $($({},t),{},{mutedHighlights:e.mutedHighlights});case D:return $($({},t),{},{mutedHighlightUpdatesInFlight:$($({},t.mutedHighlightUpdatesInFlight),{},f()({},e.slug,{mute:e.mute}))});case k:return $($({},t),{},{mutedHighlightUpdatesInFlight:Object(l.omit)(t.mutedHighlightUpdatesInFlight,e.slug),mutedHighlights:$($({},t.mutedHighlights),{},f()({},e.slug,e.mute))});case R:return $($({},t),{},{mutedHighlightUpdatesInFlight:Object(l.omit)(t.mutedHighlightUpdatesInFlight,e.slug)});default:return t}}});n.p=window.itsecWebpackPublicPath},Td6G:function(t,e,n){"use strict";n("J4zp");var r=n("YLtl"),i=n("RIqP"),o=n.n(i),u=n("lwsE"),c=n.n(u),a=n("W8MJ"),s=n.n(a),f=n("lSNA"),l=n.n(f),d=n("92Nh"),h=n.n(d),g=n("tmk3"),p=n.n(g);function v(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return y(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return y(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,u=!0,c=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return u=t.done,t},e:function(t){c=!0,o=t},f:function(){try{u||null==n.return||n.return()}finally{if(c)throw o}}}}function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var m=new WeakMap,b=new WeakMap,I=function(){function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;c()(this,t),m.set(this,{writable:!0,value:{}}),b.set(this,{writable:!0,value:{}}),l()(this,"getErrorCodes",function(){return Object.keys(p()(e,m))}),l()(this,"getErrorCode",function(){return e.getErrorCodes()[0]}),l()(this,"getErrorMessages",function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;if(t)return p()(e,m)[t];var n=[];for(var r in p()(e,m))p()(e,m).hasOwnProperty(r)&&n.concat(p()(e,m)[r]);return n}),l()(this,"getErrorMessage",function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return t=t||e.getErrorCode(),e.getErrorMessages(t)[0]}),l()(this,"getErrorData",function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return t=t||e.getErrorCode(),p()(e,b)[t]}),l()(this,"getAllErrorMessages",function(){var t=[];for(var n in p()(e,m))p()(e,m).hasOwnProperty(n)&&t.push.apply(t,o()(p()(e,m)[n]));return t}),n&&(r&&(p()(this,m)[n]=[r]),i&&(p()(this,b)[n]=i))}return s()(t,null,[{key:"fromPHPObject",value:function(e){var n=new t;return h()(n,m,e.errors),h()(n,b,e.error_data),n}},{key:"fromApiError",value:function(e){var n=new t;if(p()(n,m)[e.code]=[e.message],p()(n,b)[e.code]=e.data,e.additional_errors){var r,i=v(e.additional_errors);try{for(i.s();!(r=i.n()).done;){var o=r.value;p()(n,m)[o.code]=[o.message],p()(n,b)[o.code]=o.data}}catch(t){i.e(t)}finally{i.f()}}return n}}]),t}(),O=n("PJYZ"),E=n.n(O),_=n("7W2i"),A=n.n(_),T=n("a1gu"),w=n.n(T),H=n("Nsbk"),j=n.n(H),S=n("oShl"),P=n.n(S),N=n("l3Sj");function x(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}();return function(){var n,r=j()(t);if(e){var i=j()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return w()(this,n)}}var M=function(t){A()(n,t);var e=x(n);function n(t){var r;c()(this,n);for(var i=arguments.length,o=new Array(i>1?i-1:0),u=1;u<i;u++)o[u-1]=arguments[u];for(var a in r=e.call.apply(e,[this,t.message||Object(N.__)("An unknown error occurred.","better-wp-security")].concat(o)),Error.captureStackTrace&&Error.captureStackTrace(E()(r),n),r.__response=t,t)t.hasOwnProperty(a)&&Object.defineProperty(E()(r),a,{value:t[a],configurable:!0,enumerable:!0,writable:!0});return r}return s()(n,[{key:"toString",value:function(){return this.__response.toString()}},{key:"getResponse",value:function(){return this.__response}}]),n}(P()(Error));function C(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return U(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return U(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,u=!0,c=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return u=t.done,t},e:function(t){c=!0,o=t},f:function(){try{u||null==n.return||n.return()}finally{if(c)throw o}}}}function U(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function D(t){if(!Object(r.isPlainObject)(t))return!1;var e=Object.keys(t);return 2===e.length&&(e.includes("errors")&&e.includes("error_data"))}function k(t){return D(t)?I.fromPHPObject(t):function(t){if(!Object(r.isPlainObject)(t))return!1;var e=Object.keys(t);return(3===e.length||4===e.length)&&!(4===e.length&&!e.includes("additional_errors"))&&e.includes("code")&&e.includes("message")&&e.includes("data")}(t)?I.fromApiError(t):new I}function R(t,e){var n,r=[[],[]],i=C(t);try{for(i.s();!(n=i.n()).done;){var o=n.value;r[e(o)?0:1].push(o)}}catch(t){i.e(t)}finally{i.f()}return r}function F(t){if(t instanceof Error)throw t;throw new M(t)}n.d(e,"d",function(){return D}),n.d(e,"b",function(){return k}),n.d(e,"a",function(){return R}),n.d(e,"e",function(){return F}),n.d(e,"c",function(){return G});function G(t,e){if(t&&t.links){var n,r=C(t.links);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i.rel===e)return i}}catch(t){r.e(t)}finally{r.f()}}}},YLtl:function(t,e){!function(){t.exports=this.lodash}()},l3Sj:function(t,e){!function(){t.exports=this.wp.i18n}()},ywyh:function(t,e){!function(){t.exports=this.wp.apiFetch}()}});
dist/core/admin-notices-dashboard-admin-bar.min.css CHANGED
@@ -6,5 +6,5 @@
6
 
7
  @keyframes itsec-animation-fade-in-constant{from{opacity:0}to{opacity:1}}.itsec-admin-bar-admin-notices__content.components-popover::after{border-color:#E5EAEE !important}.itsec-admin-notice-panel{padding:1em;background:#E5EAEE;width:420px;box-sizing:border-box}.itsec-admin-notice-panel .itsec-admin-notice-panel__header{border-bottom:1px solid #7ABEED;margin-bottom:1em}.itsec-admin-notice-panel .itsec-admin-notice-panel__header h3{color:#0081E3;text-align:center}.itsec-admin-notice-panel .itsec-admin-notice-panel__header p{text-align:center;font-style:oblique}.is-mobile .itsec-admin-notice-panel{width:100%;overflow-x:auto;height:100%}.is-mobile .itsec-admin-notice-panel header h3{display:none}.is-mobile .itsec-admin-notice-panel header p{margin-top:0}.itsec-admin-notice-panel .itsec-admin-notice-panel__configure-trigger.components-button{padding:5px;height:30px;position:absolute;right:1em;top:1em;transition:opacity 400ms}.itsec-admin-notice-panel .itsec-admin-notice-panel__configure-trigger.components-button:hover{opacity:.5;box-shadow:none !important}.itsec-admin-notice-panel.itsec-admin-notice-panel--is-configuring .itsec-admin-notice-panel__configure-trigger.components-button{color:#0081E3}.itsec-admin-notice-panel.itsec-admin-notice-panel--is-configuring .itsec-admin-notice-panel__configure-trigger.components-button:hover{color:#0081E3}.itsec-admin-notice-panel .itsec-admin-notice-panel__configure-highlighted-logs{border-bottom:1px solid #7ABEED;margin-bottom:1em;padding-bottom:1em}.itsec-admin-notice-panel .itsec-admin-notice-panel__configure-highlighted-logs li{display:flex;justify-content:space-between;border-bottom:1px solid #ccc;margin-bottom:1em;padding-bottom:1em;padding-top:0;margin-top:0}.itsec-admin-notice-panel .itsec-admin-notice-panel__configure-highlighted-logs li:last-child{border-bottom:none;margin-bottom:0;padding-bottom:0}.itsec-admin-notice-panel .itsec-admin-notice-panel__configure-highlighted-logs li label{margin-left:calc(24px + 1em);font-size:14px;font-weight:bold}.itsec-admin-notice-panel .itsec-admin-notice-panel__configure-highlighted-logs li .components-form-toggle.is-checked .components-form-toggle__track{background-color:#0081E3;border-color:#0081E3}.itsec-admin-notice-panel .itsec-admin-notice-panel__configure-highlighted-logs li .components-form-toggle__input:disabled+.components-form-toggle__track{opacity:.5}
8
 
9
- .itsec-admin-bar__admin-notices{margin-left:auto}.itsec-admin-bar__admin-notices .itsec-admin-bar-admin-notices__trigger>.components-button{color:#0081E3;border:none;background:transparent}.itsec-admin-bar__admin-notices .itsec-admin-bar-admin-notices__trigger>.components-button:hover{color:#4ab1ff}.itsec-admin-bar__admin-notices .itsec-admin-bar-admin-notices__trigger>.components-button svg{margin-right:.5em}.itsec-admin-bar__admin-notices .itsec-admin-bar-admin-notices__trigger .components-button{position:relative}.itsec-admin-bar__admin-notices .itsec-admin-bar-admin-notices__trigger .components-button::before{content:'';background:#d8514f;height:5px;width:5px;border-radius:5px;vertical-align:middle;border:1px solid #f1f1f1;z-index:1;position:absolute;left:4px;top:3px;opacity:0;transition:opacity 1000ms ease-in-out}.itsec-admin-bar__admin-notices .itsec-admin-bar-admin-notices__trigger--has-notices .components-button::before{opacity:1}.itsec-admin-bar-admin-notices__content .components-popover__content{box-shadow:rgba(0,0,0,0.19) 0 4px 5px}@media screen and (max-width: 600px){.itsec-admin-bar .itsec-admin-bar__admin-notices{margin-left:0}}
10
 
6
 
7
  @keyframes itsec-animation-fade-in-constant{from{opacity:0}to{opacity:1}}.itsec-admin-bar-admin-notices__content.components-popover::after{border-color:#E5EAEE !important}.itsec-admin-notice-panel{padding:1em;background:#E5EAEE;width:420px;box-sizing:border-box}.itsec-admin-notice-panel .itsec-admin-notice-panel__header{border-bottom:1px solid #7ABEED;margin-bottom:1em}.itsec-admin-notice-panel .itsec-admin-notice-panel__header h3{color:#0081E3;text-align:center}.itsec-admin-notice-panel .itsec-admin-notice-panel__header p{text-align:center;font-style:oblique}.is-mobile .itsec-admin-notice-panel{width:100%;overflow-x:auto;height:100%}.is-mobile .itsec-admin-notice-panel header h3{display:none}.is-mobile .itsec-admin-notice-panel header p{margin-top:0}.itsec-admin-notice-panel .itsec-admin-notice-panel__configure-trigger.components-button{padding:5px;height:30px;position:absolute;right:1em;top:1em;transition:opacity 400ms}.itsec-admin-notice-panel .itsec-admin-notice-panel__configure-trigger.components-button:hover{opacity:.5;box-shadow:none !important}.itsec-admin-notice-panel.itsec-admin-notice-panel--is-configuring .itsec-admin-notice-panel__configure-trigger.components-button{color:#0081E3}.itsec-admin-notice-panel.itsec-admin-notice-panel--is-configuring .itsec-admin-notice-panel__configure-trigger.components-button:hover{color:#0081E3}.itsec-admin-notice-panel .itsec-admin-notice-panel__configure-highlighted-logs{border-bottom:1px solid #7ABEED;margin-bottom:1em;padding-bottom:1em}.itsec-admin-notice-panel .itsec-admin-notice-panel__configure-highlighted-logs li{display:flex;justify-content:space-between;border-bottom:1px solid #ccc;margin-bottom:1em;padding-bottom:1em;padding-top:0;margin-top:0}.itsec-admin-notice-panel .itsec-admin-notice-panel__configure-highlighted-logs li:last-child{border-bottom:none;margin-bottom:0;padding-bottom:0}.itsec-admin-notice-panel .itsec-admin-notice-panel__configure-highlighted-logs li label{margin-left:calc(24px + 1em);font-size:14px;font-weight:bold}.itsec-admin-notice-panel .itsec-admin-notice-panel__configure-highlighted-logs li .components-form-toggle.is-checked .components-form-toggle__track{background-color:#0081E3;border-color:#0081E3}.itsec-admin-notice-panel .itsec-admin-notice-panel__configure-highlighted-logs li .components-form-toggle__input:disabled+.components-form-toggle__track{opacity:.5}
8
 
9
+ .itsec-admin-bar__admin-notices{margin-left:auto}.itsec-admin-bar__admin-notices .itsec-admin-bar-admin-notices__trigger>.components-button{color:#0081E3;border:none;background:transparent !important;box-shadow:none}.itsec-admin-bar__admin-notices .itsec-admin-bar-admin-notices__trigger>.components-button:hover{color:#4ab1ff;box-shadow:none}.itsec-admin-bar__admin-notices .itsec-admin-bar-admin-notices__trigger>.components-button svg{margin-right:.5em}.itsec-admin-bar__admin-notices .itsec-admin-bar-admin-notices__trigger .components-button{position:relative}.itsec-admin-bar__admin-notices .itsec-admin-bar-admin-notices__trigger .components-button::before{content:'';background:#d8514f;height:5px;width:5px;border-radius:5px;vertical-align:middle;border:1px solid #f1f1f1;z-index:1;position:absolute;left:4px;top:3px;opacity:0;transition:opacity 1000ms ease-in-out}.itsec-admin-bar__admin-notices .itsec-admin-bar-admin-notices__trigger--has-notices .components-button::before{opacity:1}.itsec-admin-bar-admin-notices__content .components-popover__content{box-shadow:rgba(0,0,0,0.19) 0 4px 5px}@media screen and (max-width: 600px){.itsec-admin-bar .itsec-admin-bar__admin-notices{margin-left:0}}
10
 
dist/core/admin-notices-dashboard-admin-bar.min.js CHANGED
@@ -4,4 +4,4 @@ this.itsec=this.itsec||{},this.itsec.core=this.itsec.core||{},this.itsec.core["a
4
  Licensed under the MIT License (MIT), see
5
  http://jedwatson.github.io/classnames
6
  */
7
- !function(){"use strict";var t={}.hasOwnProperty;function n(){for(var e=[],i=0;i<arguments.length;i++){var c=arguments[i];if(c){var r=typeof c;if("string"===r||"number"===r)e.push(c);else if(Array.isArray(c)&&c.length){var a=n.apply(null,c);a&&e.push(a)}else if("object"===r)for(var o in c)t.call(c,o)&&c[o]&&e.push(o)}}return e.join(" ")}e.exports?(n.default=n,e.exports=n):"function"==typeof define&&"object"==typeof define.amd&&define.amd?define("classnames",[],function(){return n}):window.classNames=n}()},TvNi:function(e,t){!function(){e.exports=this.wp.plugins}()},UuzZ:function(e,t){!function(){e.exports=this.wp.autop}()},VwaH:function(e,t,n){},YLtl:function(e,t){!function(){e.exports=this.lodash}()},cruf:function(e,t){!function(){e.exports=this.itsec.dashboard.api}()},l3Sj:function(e,t){!function(){e.exports=this.wp.i18n}()},"o/Pk":function(e,t,n){},rE5z:function(e,t,n){"use strict";var i=n("GRId"),c=n("TSYQ"),r=n.n(c),a=n("YLtl"),o=n("l3Sj"),s=n("tI+e"),l=n("K9lf"),u=n("1ZqX"),m=n("UuzZ");n("VwaH");function d(e){var t=e.notice;return Object(i.createElement)("article",{className:"itsec-admin-notice itsec-admin-notice--severity-".concat(t.severity)},Object(i.createElement)("header",{className:"itsec-admin-notice__header"},Object(i.createElement)("div",{className:"itsec-admin-notice__header-inset"},Object(i.createElement)("h4",{dangerouslySetInnerHTML:{__html:t.title||f(t.message,t)}}),Object(a.map)(t.actions,function(e,t){return"primary"===e.style&&Object(i.createElement)(s.Button,{key:t,href:e.uri},e.title)}))),t.title&&t.message&&Object(i.createElement)("section",{className:"itsec-admin-notice__message",dangerouslySetInnerHTML:{__html:Object(m.autop)(f(t.message,t))}}),function(e){if(Object(a.isEmpty)(e.meta))return!1;if(1===Object(a.size)(e.meta)&&e.meta.hasOwnProperty("created_at"))return!1;return!0}(t)&&Object(i.createElement)("dl",{className:"itsec-admin-notice__meta"},Object(a.map)(t.meta,function(e,t){return"created_at"!==t&&Object(i.createElement)(i.Fragment,{key:t},Object(i.createElement)("dt",null,e.label),Object(i.createElement)("dd",null,e.formatted))})),t.meta.created_at&&Object(i.createElement)("footer",{className:"itsec-admin-notice__footer"},Object(i.createElement)("time",{dateTime:t.meta.created_at.value},t.meta.created_at.formatted)))}function f(e,t){for(var n in t.actions)t.actions.hasOwnProperty(n)&&""!==t.actions[n].uri&&(e=e.replace("{{ $"+n+" }}",t.actions[n].uri));return e}n("o/Pk");var b=Object(l.compose)([Object(u.withDispatch)(function(e){return{doAction:e("ithemes-security/admin-notices").doNoticeAction}}),Object(u.withSelect)(function(e,t){return{inProgress:e("ithemes-security/admin-notices").getInProgressActions(t.notice.id)}})])(function(e){var t=e.notice,n=e.doAction,c=e.inProgress,r=[],l=function(e){if(!t.actions.hasOwnProperty(e))return"continue";var a=t.actions[e];"close"===a.style&&r.push(Object(i.createElement)("li",{key:e},Object(i.createElement)(s.IconButton,{icon:"dismiss",label:a.title,onClick:function(){return n(t.id,e)},isBusy:c.includes(e)})))};for(var u in t.actions)l(u);var m=function(e){var t={};for(var n in e.actions)if(e.actions.hasOwnProperty(n)){var i=e.actions[n];"close"!==i.style&&"primary"!==i.style&&(t[n]=i)}return t}(t);return Object(a.isEmpty)(m)||r.push(Object(i.createElement)("li",{key:"more"},Object(i.createElement)(s.Dropdown,{position:"bottom right",className:"itsec-admin-notice-list-actions__more-menu",contentClassName:"itsec-admin-notice-list-actions__more-menu-items",renderToggle:function(e){var t=e.isOpen,n=e.onToggle;return Object(i.createElement)(s.IconButton,{icon:"ellipsis",label:Object(o.__)("More Actions","better-wp-security"),onClick:n,"aria-haspopup":!0,"aria-expanded":t})},renderContent:function(){return Object(i.createElement)(s.NavigableMenu,{role:"menu"},Object(a.map)(m,function(e,r){return e.uri?Object(i.createElement)(s.Button,{key:r,href:e.uri},e.title):Object(i.createElement)(s.Button,{key:r,onClick:function(){return n(t.id,r)},disabled:c.includes(r)},e.title,c.includes(r)&&Object(i.createElement)(s.Spinner,null))}))}}))),Object(i.createElement)("ul",{className:"itsec-admin-notice-list-actions"},r)});n("Ckse");var g=function(e){var t=e.notices;return Object(i.createElement)("ul",{className:"itsec-admin-notice-list"},t.map(function(e){return Object(i.createElement)("li",{className:"itsec-admin-notice-list-item-container",key:e.id},Object(i.createElement)(b,{notice:e}),Object(i.createElement)(d,{notice:e,noticeId:e.id}))}))};n("KTI5");t.a=Object(l.compose)([Object(l.withState)({isConfiguring:!1,checked:{}}),Object(u.withSelect)(function(e){return{mutedHighlights:e("ithemes-security/admin-notices").getMutedHighlights(),mutedHighlightUpdatesInFlight:e("ithemes-security/admin-notices").getMutedHighlightUpdatesInFlight()}}),Object(u.withDispatch)(function(e){return{updateMutedHighlight:e("ithemes-security/admin-notices").updateMutedHighlight}})])(function(e){var t=e.notices,n=e.loaded,c=e.mutedHighlights,l=e.mutedHighlightUpdatesInFlight,u=e.updateMutedHighlight,m=e.isConfiguring,d=e.setState;return Object(i.createElement)("div",{className:r()("itsec-admin-notice-panel",{"itsec-admin-notice-panel--is-configuring":m})},Object(i.createElement)(s.IconButton,{icon:"admin-generic",label:Object(o.__)("Configure","better-wp-security"),className:"itsec-admin-notice-panel__configure-trigger",style:{opacity:Object(a.size)(c)>0?1:0},onClick:function(){return d({isConfiguring:!m})}}),Object(i.createElement)("header",{className:"itsec-admin-notice-panel__header"},Object(i.createElement)("h3",null,Object(o.__)("Security Admin Messages","better-wp-security")),Object(i.createElement)("p",null,Object(o.__)("Important notices from iThemes Security","better-wp-security"))),m&&Object(i.createElement)("ul",{className:"itsec-admin-notice-panel__configure-highlighted-logs"},[{slug:"file-change-report",label:Object(o.__)("File Change Report","better-wp-security")},{slug:"notification-center-send-failed",label:Object(o.__)("Notification Center Errors","better-wp-security")},{slug:"malware-scan-report",label:Object(o.__)("Malware Scan Report","better-wp-security")},{slug:"malware-scan-failed",label:Object(o.__)("Malware Scan Failed","better-wp-security")}].map(function(e){var t=e.slug,r=e.label;return void 0!==c[t]&&Object(i.createElement)("li",null,Object(i.createElement)("label",{htmlFor:"itsec-mute-highlight-".concat(t)},r),Object(i.createElement)(s.FormToggle,{id:"itsec-mute-highlight-".concat(t),disabled:!n||l[t],checked:!Object(a.get)(l,[t,"mute"],c[t]),onChange:function(){return u(t,!c[t])}}))})),t.length>0?Object(i.createElement)(g,{notices:t}):n&&Object(i.createElement)("span",null,Object(o.__)("No notices at the moment.","better-wp-security")))})},"tI+e":function(e,t){!function(){e.exports=this.wp.components}()},vYuV:function(e,t,n){"use strict";function i(e){for(var t=e.parentNode;null!==t;){if(t.classList&&t.classList.contains("itsec-admin-notice-list-actions__more-menu-items"))return!0;t=t.parentNode}return!1}n.d(t,"a",function(){return i})}});
4
  Licensed under the MIT License (MIT), see
5
  http://jedwatson.github.io/classnames
6
  */
7
+ !function(){"use strict";var t={}.hasOwnProperty;function n(){for(var e=[],i=0;i<arguments.length;i++){var c=arguments[i];if(c){var r=typeof c;if("string"===r||"number"===r)e.push(c);else if(Array.isArray(c)&&c.length){var a=n.apply(null,c);a&&e.push(a)}else if("object"===r)for(var o in c)t.call(c,o)&&c[o]&&e.push(o)}}return e.join(" ")}e.exports?(n.default=n,e.exports=n):"function"==typeof define&&"object"==typeof define.amd&&define.amd?define("classnames",[],function(){return n}):window.classNames=n}()},TvNi:function(e,t){!function(){e.exports=this.wp.plugins}()},UuzZ:function(e,t){!function(){e.exports=this.wp.autop}()},VwaH:function(e,t,n){},YLtl:function(e,t){!function(){e.exports=this.lodash}()},cruf:function(e,t){!function(){e.exports=this.itsec.dashboard.api}()},l3Sj:function(e,t){!function(){e.exports=this.wp.i18n}()},"o/Pk":function(e,t,n){},rE5z:function(e,t,n){"use strict";var i=n("GRId"),c=n("TSYQ"),r=n.n(c),a=n("YLtl"),o=n("l3Sj"),s=n("tI+e"),l=n("K9lf"),u=n("1ZqX"),m=n("UuzZ");n("VwaH");function d(e){var t=e.notice;return Object(i.createElement)("article",{className:"itsec-admin-notice itsec-admin-notice--severity-".concat(t.severity)},Object(i.createElement)("header",{className:"itsec-admin-notice__header"},Object(i.createElement)("div",{className:"itsec-admin-notice__header-inset"},Object(i.createElement)("h4",{dangerouslySetInnerHTML:{__html:t.title||f(t.message,t)}}),Object(a.map)(t.actions,function(e,t){return"primary"===e.style&&Object(i.createElement)(s.Button,{key:t,href:e.uri},e.title)}))),t.title&&t.message&&Object(i.createElement)("section",{className:"itsec-admin-notice__message",dangerouslySetInnerHTML:{__html:Object(m.autop)(f(t.message,t))}}),function(e){if(Object(a.isEmpty)(e.meta))return!1;if(1===Object(a.size)(e.meta)&&e.meta.hasOwnProperty("created_at"))return!1;return!0}(t)&&Object(i.createElement)("dl",{className:"itsec-admin-notice__meta"},Object(a.map)(t.meta,function(e,t){return"created_at"!==t&&Object(i.createElement)(i.Fragment,{key:t},Object(i.createElement)("dt",null,e.label),Object(i.createElement)("dd",null,e.formatted))})),t.meta.created_at&&Object(i.createElement)("footer",{className:"itsec-admin-notice__footer"},Object(i.createElement)("time",{dateTime:t.meta.created_at.value},t.meta.created_at.formatted)))}function f(e,t){for(var n in t.actions)t.actions.hasOwnProperty(n)&&""!==t.actions[n].uri&&(e=e.replace("{{ $"+n+" }}",t.actions[n].uri));return e}n("o/Pk");var b=Object(l.compose)([Object(u.withDispatch)(function(e){return{doAction:e("ithemes-security/admin-notices").doNoticeAction}}),Object(u.withSelect)(function(e,t){return{inProgress:e("ithemes-security/admin-notices").getInProgressActions(t.notice.id)}})])(function(e){var t=e.notice,n=e.doAction,c=e.inProgress,r=[],l=function(e){if(!t.actions.hasOwnProperty(e))return"continue";var a=t.actions[e];"close"===a.style&&r.push(Object(i.createElement)("li",{key:e},Object(i.createElement)(s.IconButton,{icon:"dismiss",label:a.title,onClick:function(){return n(t.id,e)},isBusy:c.includes(e)})))};for(var u in t.actions)l(u);var m=function(e){var t={};for(var n in e.actions)if(e.actions.hasOwnProperty(n)){var i=e.actions[n];"close"!==i.style&&"primary"!==i.style&&(t[n]=i)}return t}(t);return Object(a.isEmpty)(m)||r.push(Object(i.createElement)("li",{key:"more"},Object(i.createElement)(s.Dropdown,{position:"bottom right",className:"itsec-admin-notice-list-actions__more-menu",contentClassName:"itsec-admin-notice-list-actions__more-menu-items",renderToggle:function(e){var t=e.isOpen,n=e.onToggle;return Object(i.createElement)(s.IconButton,{icon:"ellipsis",label:Object(o.__)("More Actions","better-wp-security"),onClick:n,"aria-haspopup":!0,"aria-expanded":t})},renderContent:function(){return Object(i.createElement)(s.NavigableMenu,{role:"menu"},Object(a.map)(m,function(e,r){return e.uri?Object(i.createElement)(s.Button,{key:r,href:e.uri},e.title):Object(i.createElement)(s.Button,{key:r,onClick:function(){return n(t.id,r)},disabled:c.includes(r)},e.title,c.includes(r)&&Object(i.createElement)(s.Spinner,null))}))}}))),Object(i.createElement)("ul",{className:"itsec-admin-notice-list-actions"},r)});n("Ckse");var g=function(e){var t=e.notices;return Object(i.createElement)("ul",{className:"itsec-admin-notice-list"},t.map(function(e){return Object(i.createElement)("li",{className:"itsec-admin-notice-list-item-container",key:e.id},Object(i.createElement)(b,{notice:e}),Object(i.createElement)(d,{notice:e,noticeId:e.id}))}))};n("KTI5");t.a=Object(l.compose)([Object(l.withState)({isConfiguring:!1,checked:{}}),Object(u.withSelect)(function(e){return{mutedHighlights:e("ithemes-security/admin-notices").getMutedHighlights(),mutedHighlightUpdatesInFlight:e("ithemes-security/admin-notices").getMutedHighlightUpdatesInFlight()}}),Object(u.withDispatch)(function(e){return{updateMutedHighlight:e("ithemes-security/admin-notices").updateMutedHighlight}})])(function(e){var t=e.notices,n=e.loaded,c=e.mutedHighlights,l=e.mutedHighlightUpdatesInFlight,u=e.updateMutedHighlight,m=e.isConfiguring,d=e.setState;return Object(i.createElement)("div",{className:r()("itsec-admin-notice-panel",{"itsec-admin-notice-panel--is-configuring":m})},Object(i.createElement)(s.IconButton,{icon:"admin-generic",label:Object(o.__)("Configure","better-wp-security"),className:"itsec-admin-notice-panel__configure-trigger",style:{opacity:Object(a.size)(c)>0?1:0},onClick:function(){return d({isConfiguring:!m})}}),Object(i.createElement)("header",{className:"itsec-admin-notice-panel__header"},Object(i.createElement)("h3",null,Object(o.__)("Security Admin Messages","better-wp-security")),Object(i.createElement)("p",null,Object(o.__)("Important notices from iThemes Security","better-wp-security"))),m&&Object(i.createElement)("ul",{className:"itsec-admin-notice-panel__configure-highlighted-logs"},[{slug:"file-change-report",label:Object(o.__)("File Change Report","better-wp-security")},{slug:"notification-center-send-failed",label:Object(o.__)("Notification Center Errors","better-wp-security")},{slug:"malware-scan-report",label:Object(o.__)("Malware Scan Report","better-wp-security")},{slug:"malware-scan-failed",label:Object(o.__)("Malware Scan Failed","better-wp-security")},{slug:"site-scanner-report",label:Object(o.__)("Site Scan Report","better-wp-security")}].map(function(e){var t=e.slug,r=e.label;return void 0!==c[t]&&Object(i.createElement)("li",null,Object(i.createElement)("label",{htmlFor:"itsec-mute-highlight-".concat(t)},r),Object(i.createElement)(s.FormToggle,{id:"itsec-mute-highlight-".concat(t),disabled:!n||l[t],checked:!Object(a.get)(l,[t,"mute"],c[t]),onChange:function(){return u(t,!c[t])}}))})),t.length>0?Object(i.createElement)(g,{notices:t}):n&&Object(i.createElement)("span",null,Object(o.__)("No notices at the moment.","better-wp-security")))})},"tI+e":function(e,t){!function(){e.exports=this.wp.components}()},vYuV:function(e,t,n){"use strict";function i(e){for(var t=e.parentNode;null!==t;){if(t.classList&&t.classList.contains("itsec-admin-notice-list-actions__more-menu-items"))return!0;t=t.parentNode}return!1}n.d(t,"a",function(){return i})}});
dist/core/admin-notices.min.js CHANGED
@@ -4,4 +4,4 @@ this.itsec=this.itsec||{},this.itsec.core=this.itsec.core||{},this.itsec.core["a
4
  Licensed under the MIT License (MIT), see
5
  http://jedwatson.github.io/classnames
6
  */
7
- !function(){"use strict";var t={}.hasOwnProperty;function n(){for(var e=[],i=0;i<arguments.length;i++){var c=arguments[i];if(c){var r=typeof c;if("string"===r||"number"===r)e.push(c);else if(Array.isArray(c)&&c.length){var o=n.apply(null,c);o&&e.push(o)}else if("object"===r)for(var a in c)t.call(c,a)&&c[a]&&e.push(a)}}return e.join(" ")}e.exports?(n.default=n,e.exports=n):"function"==typeof define&&"object"==typeof define.amd&&define.amd?define("classnames",[],function(){return n}):window.classNames=n}()},UuzZ:function(e,t){!function(){e.exports=this.wp.autop}()},VwaH:function(e,t,n){},Y8OO:function(e,t){!function(){e.exports=this.wp.domReady}()},YLtl:function(e,t){!function(){e.exports=this.lodash}()},dwGD:function(e,t,n){"use strict";n.r(t);var i=n("GRId"),c=n("l3Sj"),r=n("Y8OO"),o=n.n(r),a=n("tI+e"),s=(n("Hz6T"),n("TSYQ")),l=n.n(s),u=n("K9lf"),m=n("vYuV"),d=n("rE5z"),b=(n("6IbE"),n("1ZqX"));var f=Object(u.compose)([Object(b.withSelect)(function(e){return{notices:e("ithemes-security/admin-notices").getNotices(),noticesLoaded:e("ithemes-security/admin-notices").areNoticesLoaded()}}),Object(u.withState)({isToggled:!1})])(function(e){var t=e.notices,n=e.noticesLoaded,r=e.isToggled,o=e.setState;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(a.Button,{id:"itsec-admin-notices-toolbar-trigger",className:l()("ab-item ab-empty-item",{"itsec-admin-notices-toolbar--has-notices":t.length>0}),onClick:function(){return o({isToggled:!r})},"aria-expanded":r},Object(i.createElement)("span",{className:"it-icon-itsec"}),Object(i.createElement)("span",{className:"itsec-toolbar-text"},Object(c.__)("Security","better-wp-security")),t.length>0&&Object(i.createElement)("span",{className:"itsec-admin-notices-toolbar-bubble"},Object(i.createElement)("span",{className:"itsec-admin-notices-toolbar-bubble__count"},t.length))),r&&Object(i.createElement)(a.Popover,{className:"itsec-admin-notices-toolbar__popover",noArrow:!0,expandOnMobile:!0,focusOnMount:"container",position:"bottom center",headerTitle:Object(c.__)("Security","better-wp-security"),onClose:function(){return o({isToggled:!1})},onClickOutside:function(e){e.target&&("itsec-admin-notices-toolbar-trigger"===e.target.id||"itsec-admin-notices-toolbar-trigger"===e.target.parentNode.id||Object(m.a)(e.target))||o({isToggled:!1})},onFocusOutside:function(){var e=document.activeElement;"itsec-admin-notices-toolbar-trigger"===e.id||e.parentNode&&"itsec-admin-notices-toolbar-trigger"===e.parentNode.id||Object(m.a)(e)||o({isToggled:!1})}},Object(i.createElement)(d.a,{notices:t,loaded:n,close:function(){return o({isToggled:!1})}})))});n("1Zi1");var p=function(e){var t=e.portalEl;return Object(i.createElement)(a.SlotFillProvider,null,Object(i.createPortal)(Object(i.createElement)(a.Popover.Slot,null),t),Object(i.createElement)(f,null))};n.p=window.itsecWebpackPublicPath,Object(c.setLocaleData)({"":{}},"better-wp-security"),o()(function(){var e=document.getElementById("wp-admin-bar-itsec_admin_bar_menu"),t=document.getElementById("itsec-admin-notices-root");return Object(i.render)(Object(i.createElement)(p,{portalEl:t}),e)})},l3Sj:function(e,t){!function(){e.exports=this.wp.i18n}()},"o/Pk":function(e,t,n){},rE5z:function(e,t,n){"use strict";var i=n("GRId"),c=n("TSYQ"),r=n.n(c),o=n("YLtl"),a=n("l3Sj"),s=n("tI+e"),l=n("K9lf"),u=n("1ZqX"),m=n("UuzZ");n("VwaH");function d(e){var t=e.notice;return Object(i.createElement)("article",{className:"itsec-admin-notice itsec-admin-notice--severity-".concat(t.severity)},Object(i.createElement)("header",{className:"itsec-admin-notice__header"},Object(i.createElement)("div",{className:"itsec-admin-notice__header-inset"},Object(i.createElement)("h4",{dangerouslySetInnerHTML:{__html:t.title||b(t.message,t)}}),Object(o.map)(t.actions,function(e,t){return"primary"===e.style&&Object(i.createElement)(s.Button,{key:t,href:e.uri},e.title)}))),t.title&&t.message&&Object(i.createElement)("section",{className:"itsec-admin-notice__message",dangerouslySetInnerHTML:{__html:Object(m.autop)(b(t.message,t))}}),function(e){if(Object(o.isEmpty)(e.meta))return!1;if(1===Object(o.size)(e.meta)&&e.meta.hasOwnProperty("created_at"))return!1;return!0}(t)&&Object(i.createElement)("dl",{className:"itsec-admin-notice__meta"},Object(o.map)(t.meta,function(e,t){return"created_at"!==t&&Object(i.createElement)(i.Fragment,{key:t},Object(i.createElement)("dt",null,e.label),Object(i.createElement)("dd",null,e.formatted))})),t.meta.created_at&&Object(i.createElement)("footer",{className:"itsec-admin-notice__footer"},Object(i.createElement)("time",{dateTime:t.meta.created_at.value},t.meta.created_at.formatted)))}function b(e,t){for(var n in t.actions)t.actions.hasOwnProperty(n)&&""!==t.actions[n].uri&&(e=e.replace("{{ $"+n+" }}",t.actions[n].uri));return e}n("o/Pk");var f=Object(l.compose)([Object(u.withDispatch)(function(e){return{doAction:e("ithemes-security/admin-notices").doNoticeAction}}),Object(u.withSelect)(function(e,t){return{inProgress:e("ithemes-security/admin-notices").getInProgressActions(t.notice.id)}})])(function(e){var t=e.notice,n=e.doAction,c=e.inProgress,r=[],l=function(e){if(!t.actions.hasOwnProperty(e))return"continue";var o=t.actions[e];"close"===o.style&&r.push(Object(i.createElement)("li",{key:e},Object(i.createElement)(s.IconButton,{icon:"dismiss",label:o.title,onClick:function(){return n(t.id,e)},isBusy:c.includes(e)})))};for(var u in t.actions)l(u);var m=function(e){var t={};for(var n in e.actions)if(e.actions.hasOwnProperty(n)){var i=e.actions[n];"close"!==i.style&&"primary"!==i.style&&(t[n]=i)}return t}(t);return Object(o.isEmpty)(m)||r.push(Object(i.createElement)("li",{key:"more"},Object(i.createElement)(s.Dropdown,{position:"bottom right",className:"itsec-admin-notice-list-actions__more-menu",contentClassName:"itsec-admin-notice-list-actions__more-menu-items",renderToggle:function(e){var t=e.isOpen,n=e.onToggle;return Object(i.createElement)(s.IconButton,{icon:"ellipsis",label:Object(a.__)("More Actions","better-wp-security"),onClick:n,"aria-haspopup":!0,"aria-expanded":t})},renderContent:function(){return Object(i.createElement)(s.NavigableMenu,{role:"menu"},Object(o.map)(m,function(e,r){return e.uri?Object(i.createElement)(s.Button,{key:r,href:e.uri},e.title):Object(i.createElement)(s.Button,{key:r,onClick:function(){return n(t.id,r)},disabled:c.includes(r)},e.title,c.includes(r)&&Object(i.createElement)(s.Spinner,null))}))}}))),Object(i.createElement)("ul",{className:"itsec-admin-notice-list-actions"},r)});n("Ckse");var p=function(e){var t=e.notices;return Object(i.createElement)("ul",{className:"itsec-admin-notice-list"},t.map(function(e){return Object(i.createElement)("li",{className:"itsec-admin-notice-list-item-container",key:e.id},Object(i.createElement)(f,{notice:e}),Object(i.createElement)(d,{notice:e,noticeId:e.id}))}))};n("KTI5");t.a=Object(l.compose)([Object(l.withState)({isConfiguring:!1,checked:{}}),Object(u.withSelect)(function(e){return{mutedHighlights:e("ithemes-security/admin-notices").getMutedHighlights(),mutedHighlightUpdatesInFlight:e("ithemes-security/admin-notices").getMutedHighlightUpdatesInFlight()}}),Object(u.withDispatch)(function(e){return{updateMutedHighlight:e("ithemes-security/admin-notices").updateMutedHighlight}})])(function(e){var t=e.notices,n=e.loaded,c=e.mutedHighlights,l=e.mutedHighlightUpdatesInFlight,u=e.updateMutedHighlight,m=e.isConfiguring,d=e.setState;return Object(i.createElement)("div",{className:r()("itsec-admin-notice-panel",{"itsec-admin-notice-panel--is-configuring":m})},Object(i.createElement)(s.IconButton,{icon:"admin-generic",label:Object(a.__)("Configure","better-wp-security"),className:"itsec-admin-notice-panel__configure-trigger",style:{opacity:Object(o.size)(c)>0?1:0},onClick:function(){return d({isConfiguring:!m})}}),Object(i.createElement)("header",{className:"itsec-admin-notice-panel__header"},Object(i.createElement)("h3",null,Object(a.__)("Security Admin Messages","better-wp-security")),Object(i.createElement)("p",null,Object(a.__)("Important notices from iThemes Security","better-wp-security"))),m&&Object(i.createElement)("ul",{className:"itsec-admin-notice-panel__configure-highlighted-logs"},[{slug:"file-change-report",label:Object(a.__)("File Change Report","better-wp-security")},{slug:"notification-center-send-failed",label:Object(a.__)("Notification Center Errors","better-wp-security")},{slug:"malware-scan-report",label:Object(a.__)("Malware Scan Report","better-wp-security")},{slug:"malware-scan-failed",label:Object(a.__)("Malware Scan Failed","better-wp-security")}].map(function(e){var t=e.slug,r=e.label;return void 0!==c[t]&&Object(i.createElement)("li",null,Object(i.createElement)("label",{htmlFor:"itsec-mute-highlight-".concat(t)},r),Object(i.createElement)(s.FormToggle,{id:"itsec-mute-highlight-".concat(t),disabled:!n||l[t],checked:!Object(o.get)(l,[t,"mute"],c[t]),onChange:function(){return u(t,!c[t])}}))})),t.length>0?Object(i.createElement)(p,{notices:t}):n&&Object(i.createElement)("span",null,Object(a.__)("No notices at the moment.","better-wp-security")))})},"tI+e":function(e,t){!function(){e.exports=this.wp.components}()},vYuV:function(e,t,n){"use strict";function i(e){for(var t=e.parentNode;null!==t;){if(t.classList&&t.classList.contains("itsec-admin-notice-list-actions__more-menu-items"))return!0;t=t.parentNode}return!1}n.d(t,"a",function(){return i})}});
4
  Licensed under the MIT License (MIT), see
5
  http://jedwatson.github.io/classnames
6
  */
7
+ !function(){"use strict";var t={}.hasOwnProperty;function n(){for(var e=[],i=0;i<arguments.length;i++){var c=arguments[i];if(c){var r=typeof c;if("string"===r||"number"===r)e.push(c);else if(Array.isArray(c)&&c.length){var o=n.apply(null,c);o&&e.push(o)}else if("object"===r)for(var a in c)t.call(c,a)&&c[a]&&e.push(a)}}return e.join(" ")}e.exports?(n.default=n,e.exports=n):"function"==typeof define&&"object"==typeof define.amd&&define.amd?define("classnames",[],function(){return n}):window.classNames=n}()},UuzZ:function(e,t){!function(){e.exports=this.wp.autop}()},VwaH:function(e,t,n){},Y8OO:function(e,t){!function(){e.exports=this.wp.domReady}()},YLtl:function(e,t){!function(){e.exports=this.lodash}()},dwGD:function(e,t,n){"use strict";n.r(t);var i=n("GRId"),c=n("l3Sj"),r=n("Y8OO"),o=n.n(r),a=n("tI+e"),s=(n("Hz6T"),n("TSYQ")),l=n.n(s),u=n("K9lf"),m=n("vYuV"),d=n("rE5z"),b=(n("6IbE"),n("1ZqX"));var f=Object(u.compose)([Object(b.withSelect)(function(e){return{notices:e("ithemes-security/admin-notices").getNotices(),noticesLoaded:e("ithemes-security/admin-notices").areNoticesLoaded()}}),Object(u.withState)({isToggled:!1})])(function(e){var t=e.notices,n=e.noticesLoaded,r=e.isToggled,o=e.setState;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(a.Button,{id:"itsec-admin-notices-toolbar-trigger",className:l()("ab-item ab-empty-item",{"itsec-admin-notices-toolbar--has-notices":t.length>0}),onClick:function(){return o({isToggled:!r})},"aria-expanded":r},Object(i.createElement)("span",{className:"it-icon-itsec"}),Object(i.createElement)("span",{className:"itsec-toolbar-text"},Object(c.__)("Security","better-wp-security")),t.length>0&&Object(i.createElement)("span",{className:"itsec-admin-notices-toolbar-bubble"},Object(i.createElement)("span",{className:"itsec-admin-notices-toolbar-bubble__count"},t.length))),r&&Object(i.createElement)(a.Popover,{className:"itsec-admin-notices-toolbar__popover",noArrow:!0,expandOnMobile:!0,focusOnMount:"container",position:"bottom center",headerTitle:Object(c.__)("Security","better-wp-security"),onClose:function(){return o({isToggled:!1})},onClickOutside:function(e){e.target&&("itsec-admin-notices-toolbar-trigger"===e.target.id||"itsec-admin-notices-toolbar-trigger"===e.target.parentNode.id||Object(m.a)(e.target))||o({isToggled:!1})},onFocusOutside:function(){var e=document.activeElement;"itsec-admin-notices-toolbar-trigger"===e.id||e.parentNode&&"itsec-admin-notices-toolbar-trigger"===e.parentNode.id||Object(m.a)(e)||o({isToggled:!1})}},Object(i.createElement)(d.a,{notices:t,loaded:n,close:function(){return o({isToggled:!1})}})))});n("1Zi1");var p=function(e){var t=e.portalEl;return Object(i.createElement)(a.SlotFillProvider,null,Object(i.createPortal)(Object(i.createElement)(a.Popover.Slot,null),t),Object(i.createElement)(f,null))};n.p=window.itsecWebpackPublicPath,Object(c.setLocaleData)({"":{}},"better-wp-security"),o()(function(){var e=document.getElementById("wp-admin-bar-itsec_admin_bar_menu"),t=document.getElementById("itsec-admin-notices-root");return Object(i.render)(Object(i.createElement)(p,{portalEl:t}),e)})},l3Sj:function(e,t){!function(){e.exports=this.wp.i18n}()},"o/Pk":function(e,t,n){},rE5z:function(e,t,n){"use strict";var i=n("GRId"),c=n("TSYQ"),r=n.n(c),o=n("YLtl"),a=n("l3Sj"),s=n("tI+e"),l=n("K9lf"),u=n("1ZqX"),m=n("UuzZ");n("VwaH");function d(e){var t=e.notice;return Object(i.createElement)("article",{className:"itsec-admin-notice itsec-admin-notice--severity-".concat(t.severity)},Object(i.createElement)("header",{className:"itsec-admin-notice__header"},Object(i.createElement)("div",{className:"itsec-admin-notice__header-inset"},Object(i.createElement)("h4",{dangerouslySetInnerHTML:{__html:t.title||b(t.message,t)}}),Object(o.map)(t.actions,function(e,t){return"primary"===e.style&&Object(i.createElement)(s.Button,{key:t,href:e.uri},e.title)}))),t.title&&t.message&&Object(i.createElement)("section",{className:"itsec-admin-notice__message",dangerouslySetInnerHTML:{__html:Object(m.autop)(b(t.message,t))}}),function(e){if(Object(o.isEmpty)(e.meta))return!1;if(1===Object(o.size)(e.meta)&&e.meta.hasOwnProperty("created_at"))return!1;return!0}(t)&&Object(i.createElement)("dl",{className:"itsec-admin-notice__meta"},Object(o.map)(t.meta,function(e,t){return"created_at"!==t&&Object(i.createElement)(i.Fragment,{key:t},Object(i.createElement)("dt",null,e.label),Object(i.createElement)("dd",null,e.formatted))})),t.meta.created_at&&Object(i.createElement)("footer",{className:"itsec-admin-notice__footer"},Object(i.createElement)("time",{dateTime:t.meta.created_at.value},t.meta.created_at.formatted)))}function b(e,t){for(var n in t.actions)t.actions.hasOwnProperty(n)&&""!==t.actions[n].uri&&(e=e.replace("{{ $"+n+" }}",t.actions[n].uri));return e}n("o/Pk");var f=Object(l.compose)([Object(u.withDispatch)(function(e){return{doAction:e("ithemes-security/admin-notices").doNoticeAction}}),Object(u.withSelect)(function(e,t){return{inProgress:e("ithemes-security/admin-notices").getInProgressActions(t.notice.id)}})])(function(e){var t=e.notice,n=e.doAction,c=e.inProgress,r=[],l=function(e){if(!t.actions.hasOwnProperty(e))return"continue";var o=t.actions[e];"close"===o.style&&r.push(Object(i.createElement)("li",{key:e},Object(i.createElement)(s.IconButton,{icon:"dismiss",label:o.title,onClick:function(){return n(t.id,e)},isBusy:c.includes(e)})))};for(var u in t.actions)l(u);var m=function(e){var t={};for(var n in e.actions)if(e.actions.hasOwnProperty(n)){var i=e.actions[n];"close"!==i.style&&"primary"!==i.style&&(t[n]=i)}return t}(t);return Object(o.isEmpty)(m)||r.push(Object(i.createElement)("li",{key:"more"},Object(i.createElement)(s.Dropdown,{position:"bottom right",className:"itsec-admin-notice-list-actions__more-menu",contentClassName:"itsec-admin-notice-list-actions__more-menu-items",renderToggle:function(e){var t=e.isOpen,n=e.onToggle;return Object(i.createElement)(s.IconButton,{icon:"ellipsis",label:Object(a.__)("More Actions","better-wp-security"),onClick:n,"aria-haspopup":!0,"aria-expanded":t})},renderContent:function(){return Object(i.createElement)(s.NavigableMenu,{role:"menu"},Object(o.map)(m,function(e,r){return e.uri?Object(i.createElement)(s.Button,{key:r,href:e.uri},e.title):Object(i.createElement)(s.Button,{key:r,onClick:function(){return n(t.id,r)},disabled:c.includes(r)},e.title,c.includes(r)&&Object(i.createElement)(s.Spinner,null))}))}}))),Object(i.createElement)("ul",{className:"itsec-admin-notice-list-actions"},r)});n("Ckse");var p=function(e){var t=e.notices;return Object(i.createElement)("ul",{className:"itsec-admin-notice-list"},t.map(function(e){return Object(i.createElement)("li",{className:"itsec-admin-notice-list-item-container",key:e.id},Object(i.createElement)(f,{notice:e}),Object(i.createElement)(d,{notice:e,noticeId:e.id}))}))};n("KTI5");t.a=Object(l.compose)([Object(l.withState)({isConfiguring:!1,checked:{}}),Object(u.withSelect)(function(e){return{mutedHighlights:e("ithemes-security/admin-notices").getMutedHighlights(),mutedHighlightUpdatesInFlight:e("ithemes-security/admin-notices").getMutedHighlightUpdatesInFlight()}}),Object(u.withDispatch)(function(e){return{updateMutedHighlight:e("ithemes-security/admin-notices").updateMutedHighlight}})])(function(e){var t=e.notices,n=e.loaded,c=e.mutedHighlights,l=e.mutedHighlightUpdatesInFlight,u=e.updateMutedHighlight,m=e.isConfiguring,d=e.setState;return Object(i.createElement)("div",{className:r()("itsec-admin-notice-panel",{"itsec-admin-notice-panel--is-configuring":m})},Object(i.createElement)(s.IconButton,{icon:"admin-generic",label:Object(a.__)("Configure","better-wp-security"),className:"itsec-admin-notice-panel__configure-trigger",style:{opacity:Object(o.size)(c)>0?1:0},onClick:function(){return d({isConfiguring:!m})}}),Object(i.createElement)("header",{className:"itsec-admin-notice-panel__header"},Object(i.createElement)("h3",null,Object(a.__)("Security Admin Messages","better-wp-security")),Object(i.createElement)("p",null,Object(a.__)("Important notices from iThemes Security","better-wp-security"))),m&&Object(i.createElement)("ul",{className:"itsec-admin-notice-panel__configure-highlighted-logs"},[{slug:"file-change-report",label:Object(a.__)("File Change Report","better-wp-security")},{slug:"notification-center-send-failed",label:Object(a.__)("Notification Center Errors","better-wp-security")},{slug:"malware-scan-report",label:Object(a.__)("Malware Scan Report","better-wp-security")},{slug:"malware-scan-failed",label:Object(a.__)("Malware Scan Failed","better-wp-security")},{slug:"site-scanner-report",label:Object(a.__)("Site Scan Report","better-wp-security")}].map(function(e){var t=e.slug,r=e.label;return void 0!==c[t]&&Object(i.createElement)("li",null,Object(i.createElement)("label",{htmlFor:"itsec-mute-highlight-".concat(t)},r),Object(i.createElement)(s.FormToggle,{id:"itsec-mute-highlight-".concat(t),disabled:!n||l[t],checked:!Object(o.get)(l,[t,"mute"],c[t]),onChange:function(){return u(t,!c[t])}}))})),t.length>0?Object(i.createElement)(p,{notices:t}):n&&Object(i.createElement)("span",null,Object(a.__)("No notices at the moment.","better-wp-security")))})},"tI+e":function(e,t){!function(){e.exports=this.wp.components}()},vYuV:function(e,t,n){"use strict";function i(e){for(var t=e.parentNode;null!==t;){if(t.classList&&t.classList.contains("itsec-admin-notice-list-actions__more-menu-items"))return!0;t=t.parentNode}return!1}n.d(t,"a",function(){return i})}});
dist/manifest.php CHANGED
@@ -7,11 +7,11 @@
7
  0 => 'core/admin-notices.css',
8
  1 => 'core/admin-notices.js',
9
  ),
10
- 'hash' => '44625005dbb4e6a5d67ec06d66bb6318',
11
  'contentHash' =>
12
  array (
13
  'css/mini-extract' => '6fb57999347c20cedea4',
14
- 'javascript' => 'b7be7e1b3d28502c2bbb',
15
  ),
16
  'vendors' =>
17
  array (
@@ -36,14 +36,15 @@
36
  array (
37
  0 => 'core/admin-notices-api.js',
38
  ),
39
- 'hash' => '2c3247aed3d49189aa60feffcad7abed',
40
  'contentHash' =>
41
  array (
42
  'css/mini-extract' => '31d6cfe0d16ae931b73c',
43
- 'javascript' => '1e901721411a447176e1',
44
  ),
45
  'vendors' =>
46
  array (
 
47
  ),
48
  'dependencies' =>
49
  array (
@@ -61,11 +62,11 @@
61
  0 => 'core/admin-notices-dashboard-admin-bar.css',
62
  1 => 'core/admin-notices-dashboard-admin-bar.js',
63
  ),
64
- 'hash' => '0cd8b080ffd0f85953652b206e7440c1',
65
  'contentHash' =>
66
  array (
67
- 'css/mini-extract' => 'fb0322849abdb99593d3',
68
- 'javascript' => 'd0732cd3721b6c937acc',
69
  ),
70
  'vendors' =>
71
  array (
@@ -92,11 +93,11 @@
92
  0 => 'core/packages/components/site-scan-results/style.css',
93
  1 => 'core/packages/components/site-scan-results/style.js',
94
  ),
95
- 'hash' => '17241399d68eeb900f5f2c289b1748f7',
96
  'contentHash' =>
97
  array (
98
  'css/mini-extract' => '4938d7aee319aaa3968c',
99
- 'javascript' => '0ac75a114cf101452605',
100
  ),
101
  'vendors' =>
102
  array (
@@ -112,11 +113,11 @@
112
  array (
113
  0 => 'packages/preload.js',
114
  ),
115
- 'hash' => '2c905e0398d2196dc4279540a39e10a8',
116
  'contentHash' =>
117
  array (
118
  'css/mini-extract' => '31d6cfe0d16ae931b73c',
119
- 'javascript' => '53821da2f6c3984fa5e1',
120
  ),
121
  'vendors' =>
122
  array (
@@ -132,15 +133,15 @@
132
  array (
133
  0 => 'user-groups/api.js',
134
  ),
135
- 'hash' => 'c9198440d6d93418b23f8fc09c747a38',
136
  'contentHash' =>
137
  array (
138
  'css/mini-extract' => '31d6cfe0d16ae931b73c',
139
- 'javascript' => '4f635c3e11bebc2913be',
140
  ),
141
  'vendors' =>
142
  array (
143
- 0 => 'vendors/user-groups/api',
144
  ),
145
  'dependencies' =>
146
  array (
@@ -159,14 +160,15 @@
159
  0 => 'user-groups/settings.css',
160
  1 => 'user-groups/settings.js',
161
  ),
162
- 'hash' => '305ce83e45716bef87675e4537acb854',
163
  'contentHash' =>
164
  array (
165
- 'css/mini-extract' => '59a0798149a770d90ff7',
166
- 'javascript' => '91ae72c9f77f23fe2c64',
167
  ),
168
  'vendors' =>
169
  array (
 
170
  ),
171
  'dependencies' =>
172
  array (
@@ -187,18 +189,18 @@
187
  14 => 'wp-url',
188
  ),
189
  ),
190
- 'vendors/user-groups/api' =>
191
  array (
192
  'runtime' => false,
193
  'files' =>
194
  array (
195
- 0 => 'vendors/user-groups/api.js',
196
  ),
197
- 'hash' => '6e34397d56216708356fb62fb92c1b6c',
198
  'contentHash' =>
199
  array (
200
  'css/mini-extract' => '31d6cfe0d16ae931b73c',
201
- 'javascript' => 'a4cac444b9ecf3c4bda3',
202
  ),
203
  'vendors' =>
204
  array (
7
  0 => 'core/admin-notices.css',
8
  1 => 'core/admin-notices.js',
9
  ),
10
+ 'hash' => '20ed2bcbb93fed6fa1c83ba00be71557',
11
  'contentHash' =>
12
  array (
13
  'css/mini-extract' => '6fb57999347c20cedea4',
14
+ 'javascript' => 'b63492c857a2d1f804f1',
15
  ),
16
  'vendors' =>
17
  array (
36
  array (
37
  0 => 'core/admin-notices-api.js',
38
  ),
39
+ 'hash' => '38449dfb0b067a051e6a0546ad9ebcf1',
40
  'contentHash' =>
41
  array (
42
  'css/mini-extract' => '31d6cfe0d16ae931b73c',
43
+ 'javascript' => 'e7fc0106c45d5775d6c9',
44
  ),
45
  'vendors' =>
46
  array (
47
+ 0 => 'vendors/core/admin-notices-api~api~settings',
48
  ),
49
  'dependencies' =>
50
  array (
62
  0 => 'core/admin-notices-dashboard-admin-bar.css',
63
  1 => 'core/admin-notices-dashboard-admin-bar.js',
64
  ),
65
+ 'hash' => 'dfc4e70cdcd8e2f938a5762365eeee47',
66
  'contentHash' =>
67
  array (
68
+ 'css/mini-extract' => '830c959459f819ff3391',
69
+ 'javascript' => '1716c2402b7e2da76b40',
70
  ),
71
  'vendors' =>
72
  array (
93
  0 => 'core/packages/components/site-scan-results/style.css',
94
  1 => 'core/packages/components/site-scan-results/style.js',
95
  ),
96
+ 'hash' => '6fd2b6c542cc7ccefb83f37689260547',
97
  'contentHash' =>
98
  array (
99
  'css/mini-extract' => '4938d7aee319aaa3968c',
100
+ 'javascript' => '1e66b8293f8162780f86',
101
  ),
102
  'vendors' =>
103
  array (
113
  array (
114
  0 => 'packages/preload.js',
115
  ),
116
+ 'hash' => '890a1835e53709a15860043092142b92',
117
  'contentHash' =>
118
  array (
119
  'css/mini-extract' => '31d6cfe0d16ae931b73c',
120
+ 'javascript' => '72e8ae7434d0e8d64cc5',
121
  ),
122
  'vendors' =>
123
  array (
133
  array (
134
  0 => 'user-groups/api.js',
135
  ),
136
+ 'hash' => '5ac8c93545e4077dba504622a3005ef5',
137
  'contentHash' =>
138
  array (
139
  'css/mini-extract' => '31d6cfe0d16ae931b73c',
140
+ 'javascript' => 'da615ce1b1e259231621',
141
  ),
142
  'vendors' =>
143
  array (
144
+ 0 => 'vendors/core/admin-notices-api~api~settings',
145
  ),
146
  'dependencies' =>
147
  array (
160
  0 => 'user-groups/settings.css',
161
  1 => 'user-groups/settings.js',
162
  ),
163
+ 'hash' => 'ac0d0617c9024eada52ad99bb5ab2356',
164
  'contentHash' =>
165
  array (
166
+ 'css/mini-extract' => '1c9a81c56b3886010b20',
167
+ 'javascript' => 'a1309a2b4d0fd8b7e89a',
168
  ),
169
  'vendors' =>
170
  array (
171
+ 0 => 'vendors/core/admin-notices-api~api~settings',
172
  ),
173
  'dependencies' =>
174
  array (
189
  14 => 'wp-url',
190
  ),
191
  ),
192
+ 'vendors/core/admin-notices-api~api~settings' =>
193
  array (
194
  'runtime' => false,
195
  'files' =>
196
  array (
197
+ 0 => 'vendors/core/admin-notices-api~api~settings.js',
198
  ),
199
+ 'hash' => 'a26ce0df93f76f528549435ae6335f44',
200
  'contentHash' =>
201
  array (
202
  'css/mini-extract' => '31d6cfe0d16ae931b73c',
203
+ 'javascript' => 'c5d904b2839be81df49e',
204
  ),
205
  'vendors' =>
206
  array (
dist/user-groups/api.min.js CHANGED
@@ -1 +1 @@
1
- this.itsec=this.itsec||{},this.itsec["user-groups"]=this.itsec["user-groups"]||{},this.itsec["user-groups"].api=function(e){function t(t){for(var n,a,c=t[0],s=t[1],o=t[2],f=0,p=[];f<c.length;f++)a=c[f],u[a]&&p.push(u[a][0]),u[a]=0;for(n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n]);for(d&&d(t);p.length;)p.shift()();return i.push.apply(i,o||[]),r()}function r(){for(var e,t=0;t<i.length;t++){for(var r=i[t],n=!0,c=1;c<r.length;c++){var s=r[c];0!==u[s]&&(n=!1)}n&&(i.splice(t--,1),e=a(a.s=r[0]))}return e}var n={},u={5:0},i=[];function a(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.m=e,a.c=n,a.d=function(e,t,r){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(a.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)a.d(r,n,function(t){return e[t]}.bind(null,n));return r},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="";var c=window.itsecWebpackJsonP=window.itsecWebpackJsonP||[],s=c.push.bind(c);c.push=t,c=c.slice();for(var o=0;o<c.length;o++)t(c[o]);var d=s;return i.push(["Ntz8",7]),r()}({"1ZqX":function(e,t){!function(){e.exports=this.wp.data}()},Mmq9:function(e,t){!function(){e.exports=this.wp.url}()},Ntz8:function(e,t,r){"use strict";r.r(t);var n={};r.r(n),r.d(n,"path",function(){return G}),r.d(n,"query",function(){return R}),r.d(n,"appendToQuery",function(){return k}),r.d(n,"receiveQuery",function(){return U}),r.d(n,"processItem",function(){return A}),r.d(n,"receiveGroup",function(){return w}),r.d(n,"receiveMatchables",function(){return j}),r.d(n,"startCreateGroup",function(){return N}),r.d(n,"failedCreateGroup",function(){return C}),r.d(n,"finishCreateGroup",function(){return D}),r.d(n,"startUpdateGroup",function(){return F}),r.d(n,"failedUpdateGroup",function(){return H}),r.d(n,"finishUpdateGroup",function(){return L}),r.d(n,"startDeleteGroup",function(){return B}),r.d(n,"failedDeleteGroup",function(){return q}),r.d(n,"finishDeleteGroup",function(){return M}),r.d(n,"receiveGroupSettings",function(){return Y}),r.d(n,"startUpdateGroupSettings",function(){return Q}),r.d(n,"failedUpdateGroupSettings",function(){return K}),r.d(n,"finishUpdateGroupSettings",function(){return V}),r.d(n,"createGroup",function(){return W}),r.d(n,"updateGroup",function(){return J}),r.d(n,"deleteGroup",function(){return Z}),r.d(n,"updateGroupSettings",function(){return z}),r.d(n,"fetchGroupsSettings",function(){return X}),r.d(n,"startFetchGroupsSettings",function(){return $}),r.d(n,"finishFetchGroupsSettings",function(){return ee}),r.d(n,"failedFetchGroupsSettings",function(){return te}),r.d(n,"patchBulkGroupSettings",function(){return re}),r.d(n,"startPatchBulkGroupSettings",function(){return ne}),r.d(n,"finishPatchBulkGroupSettings",function(){return ue}),r.d(n,"failedPatchBulkGroupSettings",function(){return ie}),r.d(n,"RECEIVE_QUERY",function(){return ae}),r.d(n,"APPEND_TO_QUERY",function(){return ce}),r.d(n,"RECEIVE_MATCHABLES",function(){return se}),r.d(n,"START_CREATE_GROUP",function(){return oe}),r.d(n,"FINISH_CREATE_GROUP",function(){return de}),r.d(n,"FAILED_CREATE_GROUP",function(){return fe}),r.d(n,"RECEIVE_GROUP",function(){return pe}),r.d(n,"START_UPDATE_GROUP",function(){return le}),r.d(n,"FINISH_UPDATE_GROUP",function(){return ge}),r.d(n,"FAILED_UPDATE_GROUP",function(){return he}),r.d(n,"START_DELETE_GROUP",function(){return be}),r.d(n,"FINISH_DELETE_GROUP",function(){return ve}),r.d(n,"FAILED_DELETE_GROUP",function(){return ye}),r.d(n,"RECEIVE_GROUP_SETTINGS",function(){return me}),r.d(n,"START_UPDATE_GROUP_SETTINGS",function(){return _e}),r.d(n,"FINISH_UPDATE_GROUP_SETTINGS",function(){return Ee}),r.d(n,"FAILED_UPDATE_GROUP_SETTINGS",function(){return Se}),r.d(n,"START_FETCH_GROUPS_SETTINGS",function(){return Ie}),r.d(n,"FINISH_FETCH_GROUPS_SETTINGS",function(){return Te}),r.d(n,"FAILED_FETCH_GROUPS_SETTINGS",function(){return Pe}),r.d(n,"START_PATCH_BULK_GROUP_SETTINGS",function(){return Oe}),r.d(n,"FINISH_PATCH_BULK_GROUP_SETTINGS",function(){return xe}),r.d(n,"FAILED_PATCH_BULK_GROUP_SETTINGS",function(){return Ge});var u={};r.r(u),r.d(u,"getMatchables",function(){return ke}),r.d(u,"getMatchableType",function(){return Ue}),r.d(u,"getMatchableLabel",function(){return Ae}),r.d(u,"getGroups",function(){return we}),r.d(u,"getQueriedObjectIds",function(){return Ne}),r.d(u,"getGroup",function(){return Ce}),r.d(u,"getGroupAttribute",function(){return De}),r.d(u,"isUpdating",function(){return Fe}),r.d(u,"isDeleting",function(){return He}),r.d(u,"getGroupSettings",function(){return Le}),r.d(u,"getGroupSetting",function(){return Be}),r.d(u,"isUpdatingSettings",function(){return qe}),r.d(u,"isBulkPatchingSettings",function(){return Me}),r.d(u,"getGroupsBySetting",function(){return Ye});var i={};r.r(i),r.d(i,"getGroup",function(){return Ze}),r.d(i,"getMatchables",function(){return ze}),r.d(i,"getGroupSettings",function(){return Xe});var a=r("1ZqX"),c=r("RIqP"),s=r.n(c),o=r("ywyh"),d=r.n(o),f=r("Td6G");function p(e){return{type:"API_FETCH",request:e}}function l(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),u=2;u<r;u++)n[u-2]=arguments[u];return{type:"DISPATCH",storeKey:e,actionName:t,args:n}}var g={API_FETCH:function(e){var t=e.request;return d()(t).catch(f.e)},SELECT:function(e){var t,r=e.storeKey,n=e.selectorName,u=e.args;return(t=Object(a.select)(r))[n].apply(t,s()(u))},DISPATCH:function(e){var t,r=e.storeKey,n=e.actionName,u=e.args;return(t=Object(a.dispatch)(r))[n].apply(t,s()(u))}},h=r("YLtl"),b=r("qPad"),v=r.n(b),y=r("Mmq9"),m=regeneratorRuntime.mark(R),_=regeneratorRuntime.mark(k),E=regeneratorRuntime.mark(A),S=regeneratorRuntime.mark(W),I=regeneratorRuntime.mark(J),T=regeneratorRuntime.mark(Z),P=regeneratorRuntime.mark(z),O=regeneratorRuntime.mark(X),x=regeneratorRuntime.mark(re),G="/ithemes-security/v1/user-groups";function R(e,t){var r,n,u,i,a,c,s;return regeneratorRuntime.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,p({path:Object(y.addQueryArgs)(G,t)});case 2:return r=o.sent,o.next=5,U(e,r);case 5:n=!0,u=!1,i=void 0,o.prev=8,a=r[Symbol.iterator]();case 10:if(n=(c=a.next()).done){o.next=16;break}return s=c.value,o.delegateYield(A(s),"t0",13);case 13:n=!0,o.next=10;break;case 16:o.next=22;break;case 18:o.prev=18,o.t1=o.catch(8),u=!0,i=o.t1;case 22:o.prev=22,o.prev=23,n||null==a.return||a.return();case 25:if(o.prev=25,!u){o.next=28;break}throw i;case 28:return o.finish(25);case 29:return o.finish(22);case 30:return o.abrupt("return",r);case 31:case"end":return o.stop()}},m,this,[[8,18,22,30],[23,,25,29]])}function k(e,t){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,{type:ce,queryId:e,item:t};case 2:return r.delegateYield(A(t),"t0",3);case 3:case"end":return r.stop()}},_,this)}function U(e,t){return{type:ae,queryId:e,items:t}}function A(e){var t,r,n,u,i,a,c,s;return regeneratorRuntime.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:t=Object(h.get)(e,["_embedded","ithemes-security:user-group-member"],[]),r=Object(h.get)(e,["_embedded","ithemes-security:user-matchable-settings",0]),n=!0,u=!1,i=void 0,o.prev=5,a=t[Symbol.iterator]();case 7:if(n=(c=a.next()).done){o.next=14;break}return s=c.value,o.next=11,l("ithemes-security/core","receiveUser",s);case 11:n=!0,o.next=7;break;case 14:o.next=20;break;case 16:o.prev=16,o.t0=o.catch(5),u=!0,i=o.t0;case 20:o.prev=20,o.prev=21,n||null==a.return||a.return();case 23:if(o.prev=23,!u){o.next=26;break}throw i;case 26:return o.finish(23);case 27:return o.finish(20);case 28:if(!r){o.next=31;break}return o.next=31,Y(e.id,r);case 31:case"end":return o.stop()}},E,this,[[5,16,20,28],[21,,23,27]])}function w(e){return{type:pe,group:e}}function j(e){return{type:se,matchables:e}}function N(e){return{type:oe,group:e}}function C(e,t){return{type:fe,group:e,error:t}}function D(e,t){return{type:de,group:e,response:t}}function F(e,t){return{type:le,id:e,group:t}}function H(e,t){return{type:he,id:e,error:t}}function L(e,t){return{type:ge,id:e,response:t}}function B(e){return{type:be,id:e}}function q(e,t){return{type:ye,id:e,error:t}}function M(e){return{type:ve,id:e}}function Y(e,t){return{type:me,id:e,settings:t}}function Q(e,t){return{type:_e,id:e,settings:t}}function K(e,t){return{type:Se,id:e,error:t}}function V(e,t){return{type:Ee,id:e,response:t}}function W(e){var t;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,N(e);case 2:return r.prev=2,r.next=5,p({path:Object(y.addQueryArgs)(G,{_embed:1}),method:"POST",data:e});case 5:t=r.sent,r.next=13;break;case 8:return r.prev=8,r.t0=r.catch(2),r.next=12,C(e,r.t0);case 12:return r.abrupt("return",r.t0);case 13:return r.next=15,D(e,t);case 15:return r.next=17,w(t);case 17:return r.delegateYield(A(t),"t1",18);case 18:return r.abrupt("return",t);case 19:case"end":return r.stop()}},S,this,[[2,8]])}function J(e,t){var r;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,F(e,t);case 2:return n.prev=2,n.next=5,p({path:G+"/"+e,method:"PUT",data:t});case 5:r=n.sent,n.next=13;break;case 8:return n.prev=8,n.t0=n.catch(2),n.next=12,H(e,n.t0);case 12:return n.abrupt("return",n.t0);case 13:return n.next=15,L(e,r);case 15:return n.next=17,w(r);case 17:return n.abrupt("return",r);case 18:case"end":return n.stop()}},I,this,[[2,8]])}function Z(e){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,B(e);case 2:return t.prev=2,t.next=5,p({path:"".concat(G,"/").concat(e),method:"DELETE"});case 5:t.next=12;break;case 7:return t.prev=7,t.t0=t.catch(2),t.next=11,q(e,t.t0);case 11:return t.abrupt("return",t.t0);case 12:return t.next=14,M(e);case 14:return t.abrupt("return",null);case 15:case"end":return t.stop()}},T,this,[[2,7]])}function z(e,t){var r;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,Q(e,t);case 2:return n.prev=2,n.next=5,p({path:"ithemes-security/v1/user-matchable-settings/".concat(e),method:"PUT",data:t});case 5:r=n.sent,n.next=13;break;case 8:return n.prev=8,n.t0=n.catch(2),n.next=12,K(e,n.t0);case 12:return n.abrupt("return",n.t0);case 13:return n.next=15,V(e,r);case 15:return n.next=17,Y(e,r);case 17:return n.abrupt("return",r);case 18:case"end":return n.stop()}},P,this,[[2,8]])}function X(){var e,t,r,n,u=arguments;return regeneratorRuntime.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return e=u.length>0&&void 0!==u[0]?u[0]:[],i.next=3,$(e);case 3:return i.prev=3,r="ithemes-security/v1/user-matchable-settings",e.length>0&&(r=Object(y.addQueryArgs)(r,{include:e})),i.next=8,p({path:r});case 8:t=i.sent,i.next=16;break;case 11:return i.prev=11,i.t0=i.catch(3),i.next=15,te(e,i.t0);case 15:return i.abrupt("return",i.t0);case 16:return i.next=18,ee(e,t);case 18:i.t1=regeneratorRuntime.keys(t);case 19:if((i.t2=i.t1()).done){i.next=27;break}if(n=i.t2.value,t.hasOwnProperty(n)){i.next=23;break}return i.abrupt("continue",19);case 23:return i.next=25,Y(n,t[n]);case 25:i.next=19;break;case 27:return i.abrupt("return",t);case 28:case"end":return i.stop()}},O,this,[[3,11]])}function $(e){return{type:Ie,groupIds:e}}function ee(e,t){return{type:Te,groupIds:e,response:t}}function te(e,t){return{type:Pe,groupIds:e,error:t}}function re(e,t){var r,n,u,i,c,s,o,d,l,g,h;return regeneratorRuntime.wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return b.next=2,ne(e,t);case 2:return b.prev=2,b.next=5,p({path:Object(y.addQueryArgs)("ithemes-security/v1/user-matchable-settings",{include:e}),method:"PATCH",data:t});case 5:r=b.sent,b.next=13;break;case 8:return b.prev=8,b.t0=b.catch(2),b.next=12,ie(e,t,b.t0);case 12:return b.abrupt("return",b.t0);case 13:return b.next=15,ue(e,t,r);case 15:if(n=Object(a.select)("ithemes-security/core").getSchema("ithemes-security-user-group-settings"),u=Object(f.c)(n,"self")){b.next=19;break}return b.abrupt("return",r);case 19:i=new v.a(u.href),c=!0,s=!1,o=void 0,b.prev=23,d=r[Symbol.iterator]();case 25:if(c=(l=d.next()).done){b.next=37;break}if(200===(g=l.value).status){b.next=29;break}return b.abrupt("continue",34);case 29:if((h=i.fromUri(g.href)).id){b.next=32;break}return b.abrupt("continue",34);case 32:return b.next=34,Y(h.id,g.response);case 34:c=!0,b.next=25;break;case 37:b.next=43;break;case 39:b.prev=39,b.t1=b.catch(23),s=!0,o=b.t1;case 43:b.prev=43,b.prev=44,c||null==d.return||d.return();case 46:if(b.prev=46,!s){b.next=49;break}throw o;case 49:return b.finish(46);case 50:return b.finish(43);case 51:return b.abrupt("return",r);case 52:case"end":return b.stop()}},x,this,[[2,8],[23,39,43,51],[44,,46,50]])}function ne(e,t){return{type:Oe,groupIds:e,patch:t}}function ue(e,t,r){return{type:xe,groupIds:e,patch:t,response:r}}function ie(e,t,r){return{type:Ge,groupIds:e,patch:t,error:r}}var ae="RECEIVE_QUERY",ce="APPEND_TO_QUERY",se="RECEIVE_MATCHABLES",oe="START_CREATE_GROUP",de="FINISH_CREATE_GROUP",fe="FAILED_CREATE_GROUP",pe="RECEIVE_GROUP",le="START_UPDATE_GROUP",ge="FINISH_UPDATE_GROUP",he="FAILED_UPDATE_GROUP",be="START_DELETE_GROUP",ve="FINISH_DELETE_GROUP",ye="FAILED_DELETE_GROUP",me="RECEIVE_GROUP_SETTINGS",_e="START_UPDATE_GROUP_SETTINGS",Ee="FINISH_UPDATE_GROUP_SETTINGS",Se="FAILED_UPDATE_GROUP_SETTINGS",Ie="START_FETCH_GROUPS_SETTINGS",Te="FINISH_FETCH_GROUPS_SETTINGS",Pe="FAILED_FETCH_GROUPS_SETTINGS",Oe="START_PATCH_BULK_GROUP_SETTINGS",xe="FINISH_PATCH_BULK_GROUP_SETTINGS",Ge="FAILED_PATCH_BULK_GROUP_SETTINGS",Re=r("pPDe"),ke=Object(Re.a)(function(e){return Object(h.filter)(Object(h.map)(e.matchableIds,function(t){return e.matchablesById[t]}),h.isObject)},function(e){return[e.matchablesById,e.matchableIds]});function Ue(e,t){return(e.matchablesById[t]||{}).type}function Ae(e,t){return(e.matchablesById[t]||{}).label}var we=Object(Re.a)(function(e,t){return Object(h.filter)(Object(h.map)(e.queries[t],function(t){return e.byId[t]}),h.isObject)},function(e,t){return[e.queries[t],e.byId]}),je=[];function Ne(e,t){return e.queries[t]||je}function Ce(e,t){return e.byId[t]}function De(e,t,r){var n=Object(a.select)("ithemes-security/user-groups").getGroup(t);return n?n[r]:void 0}function Fe(e,t){return e.updating.includes(t)}function He(e,t){return e.deleting.includes(t)}function Le(e,t){return e.settings[t]}function Be(e,t,r,n){var u=Object(a.select)("ithemes-security/user-groups").getGroupSettings(t);return Object(h.get)(u,[r,n])}function qe(e,t){return e.updatingSettings.includes(t)}function Me(e,t,r){var n=t.join("_");return e.bulkPatchingSettings[n]===r}function Ye(e){var t={};for(var r in e.settings)if(e.settings.hasOwnProperty(r))for(var n in e.settings[r])if(e.settings[r].hasOwnProperty(n))for(var u in e.settings[r][n])e.settings[r][n].hasOwnProperty(u)&&(t[n]||(t[n]={}),t[n][u]||(t[n][u]=[]),e.settings[r][n][u]&&t[n][u].push(r));return t}var Qe=r("lSNA"),Ke=r.n(Qe),Ve=r("MVZn"),We=r.n(Ve),Je={matchablesById:{},matchableIds:[],byId:{},queries:{},creating:[],updating:[],deleting:[],settings:{},updatingSettings:[],bulkPatchingSettings:{}};var Ze={fulfill:regeneratorRuntime.mark(function e(t){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p({path:"".concat(G,"/").concat(t,"?_embed=1")});case 2:return r=e.sent,e.next=5,w(r);case 5:return e.delegateYield(A(r),"t0",6);case 6:case"end":return e.stop()}},e,this)}),isFulfilled:function(e,t){return e.byId.hasOwnProperty(t)}},ze={fulfill:regeneratorRuntime.mark(function e(){var t,r,n,u,i,a,c,s,o;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p({path:"/ithemes-security/v1/user-matchables?_embed=1"});case 2:return t=e.sent,e.next=5,j(t);case 5:r=!0,n=!1,u=void 0,e.prev=8,i=t[Symbol.iterator]();case 10:if(r=(a=i.next()).done){e.next=23;break}if(c=a.value,s=Object(h.get)(c,["_embedded","self",0]),o=Object(h.get)(c,["_embedded","ithemes-security:user-matchable-settings",0]),!s){e.next=17;break}return e.next=17,w(s);case 17:if(!o){e.next=20;break}return e.next=20,Y(c.id,o);case 20:r=!0,e.next=10;break;case 23:e.next=29;break;case 25:e.prev=25,e.t0=e.catch(8),n=!0,u=e.t0;case 29:e.prev=29,e.prev=30,r||null==i.return||i.return();case 32:if(e.prev=32,!n){e.next=35;break}throw u;case 35:return e.finish(32);case 36:return e.finish(29);case 37:case"end":return e.stop()}},e,this,[[8,25,29,37],[30,,32,36]])}),isFulfilled:function(e){return!Object(h.isEmpty)(e.matchablesById)}},Xe={fulfill:regeneratorRuntime.mark(function e(t){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p({path:"ithemes-security/v1/user-matchable-settings/".concat(t)});case 2:return r=e.sent,e.next=5,Y(t,r);case 5:case"end":return e.stop()}},e,this)}),isFulfilled:function(e,t){return e.settings.hasOwnProperty(t)}},$e=Object(a.registerStore)("ithemes-security/user-groups",{controls:g,actions:n,selectors:u,resolvers:i,reducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Je,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case se:return We()({},e,{matchableIds:Object(h.map)(t.matchables,"id"),matchablesById:Object(h.keyBy)(t.matchables,"id")});case ae:return We()({},e,{byId:We()({},e.byId,Object(h.keyBy)(t.items,"id")),queries:We()({},e.queries,Ke()({},t.queryId,Object(h.map)(t.items,"id")))});case ce:return We()({},e,{byId:We()({},e.byId,Ke()({},t.item.id,t.item)),queries:We()({},e.queries,Ke()({},t.queryId,s()(e.queries[t.queryId]||[]).concat([t.item.id])))});case pe:return We()({},e,{byId:We()({},e.byId,Ke()({},t.group.id,t.group)),matchablesById:e.matchablesById[t.group.id]?We()({},e.matchablesById,Ke()({},t.group.id,We()({},e.matchablesById[t.group.id],{label:t.group.label}))):e.matchablesById});case oe:return We()({},e,{creating:s()(e.creating).concat([t.group])});case de:return We()({},e,{creating:e.creating.filter(function(e){return e!==t.group}),matchablesById:We()({},e.matchablesById,Ke()({},t.response.id,{id:t.response.id,label:t.response.label,type:"user-group"})),matchableIds:s()(e.matchableIds).concat([[t.response.id]])});case fe:return We()({},e,{creating:e.creating.filter(function(e){return e!==t.group})});case le:return We()({},e,{updating:s()(e.updating).concat([t.id])});case ge:case he:return We()({},e,{updating:e.updating.filter(function(e){return e!==t.id})});case be:return We()({},e,{deleting:s()(e.deleting).concat([t.id])});case ve:return We()({},e,{deleting:e.deleting.filter(function(e){return e!==t.id}),byId:Object(h.omit)(e.byId,[t.id]),matchablesById:Object(h.omit)(e.matchablesById,[t.id]),matchableIds:e.matchableIds.filter(function(e){return e!==t.id}),settings:Object(h.omit)(e.settings,[t.id])});case ye:return We()({},e,{deleting:e.deleting.filter(function(e){return e!==t.id})});case me:return We()({},e,{settings:We()({},e.settings,Ke()({},t.id,t.settings))});case _e:return We()({},e,{updatingSettings:s()(e.updatingSettings).concat([t.id])});case Ee:case Se:return We()({},e,{updatingSettings:e.updatingSettings.filter(function(e){return e!==t.id})});case Oe:return We()({},e,{bulkPatchingSettings:We()({},e.bulkPatchingSettings,Ke()({},t.groupIds.join("_"),t.patch))});case xe:case Ge:return We()({},e,{bulkPatchingSettings:Object(h.omit)(e.bulkPatchingSettings,[t.groupIds.join("_")])});default:return e}}});r.d(t,"store",function(){return $e}),r.p=window.itsecWebpackPublicPath},Td6G:function(e,t,r){"use strict";r("J4zp");var n=r("YLtl"),u=r("RIqP"),i=r.n(u),a=r("lwsE"),c=r.n(a),s=r("W8MJ"),o=r.n(s),d=r("lSNA"),f=r.n(d),p=r("92Nh"),l=r.n(p),g=r("tmk3"),h=r.n(g),b=function(){function e(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;c()(this,e),v.set(this,{writable:!0,value:{}}),y.set(this,{writable:!0,value:{}}),f()(this,"getErrorCodes",function(){return Object.keys(h()(t,v))}),f()(this,"getErrorCode",function(){return t.getErrorCodes()[0]}),f()(this,"getErrorMessages",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;if(e)return h()(t,v)[e];var r=[];for(var n in h()(t,v))h()(t,v).hasOwnProperty(n)&&r.concat(h()(t,v)[n]);return r}),f()(this,"getErrorMessage",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return e=e||t.getErrorCode(),t.getErrorMessages(e)[0]}),f()(this,"getErrorData",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return e=e||t.getErrorCode(),h()(t,y)[e]}),f()(this,"getAllErrorMessages",function(){var e=[];for(var r in h()(t,v))h()(t,v).hasOwnProperty(r)&&e.push.apply(e,i()(h()(t,v)[r]));return e}),r&&(n&&(h()(this,v)[r]=[n]),u&&(h()(this,y)[r]=u))}return o()(e,null,[{key:"fromPHPObject",value:function(t){var r=new e;return l()(r,v,t.errors),l()(r,y,t.error_data),r}},{key:"fromApiError",value:function(t){var r=new e;if(h()(r,v)[t.code]=[t.message],h()(r,y)[t.code]=t.data,t.additional_errors){var n=!0,u=!1,i=void 0;try{for(var a,c=t.additional_errors[Symbol.iterator]();!(n=(a=c.next()).done);n=!0){var s=a.value;h()(r,v)[s.code]=[s.message],h()(r,y)[s.code]=s.data}}catch(e){u=!0,i=e}finally{try{n||null==c.return||c.return()}finally{if(u)throw i}}}return r}}]),e}(),v=new WeakMap,y=new WeakMap,m=r("a1gu"),_=r.n(m),E=r("Nsbk"),S=r.n(E),I=r("7W2i"),T=r.n(I),P=r("PJYZ"),O=r.n(P),x=r("oShl"),G=r.n(x),R=r("l3Sj"),k=function(e){function t(e){var r,n;c()(this,t);for(var u=arguments.length,i=new Array(u>1?u-1:0),a=1;a<u;a++)i[a-1]=arguments[a];for(var s in n=_()(this,(r=S()(t)).call.apply(r,[this,e.message||Object(R.__)("An unknown error occurred.","better-wp-security")].concat(i))),Error.captureStackTrace&&Error.captureStackTrace(O()(O()(n)),t),n.__response=e,e)e.hasOwnProperty(s)&&Object.defineProperty(O()(O()(n)),s,{value:e[s],configurable:!0,enumerable:!0,writable:!0});return n}return T()(t,e),o()(t,[{key:"toString",value:function(){return this.__response.toString()}},{key:"getResponse",value:function(){return this.__response}}]),t}(G()(Error));function U(e){if(!Object(n.isPlainObject)(e))return!1;var t=Object.keys(e);return 2===t.length&&(t.includes("errors")&&t.includes("error_data"))}function A(e){return U(e)?b.fromPHPObject(e):function(e){if(!Object(n.isPlainObject)(e))return!1;var t=Object.keys(e);return(3===t.length||4===t.length)&&!(4===t.length&&!t.includes("additional_errors"))&&t.includes("code")&&t.includes("message")&&t.includes("data")}(e)?b.fromApiError(e):new b}function w(e,t){var r=[[],[]],n=!0,u=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(n=(a=c.next()).done);n=!0){var s=a.value;r[t(s)?0:1].push(s)}}catch(e){u=!0,i=e}finally{try{n||null==c.return||c.return()}finally{if(u)throw i}}return r}function j(e){if(e instanceof Error)throw e;throw new k(e)}r.d(t,"d",function(){return U}),r.d(t,"b",function(){return A}),r.d(t,"a",function(){return w}),r.d(t,"e",function(){return j}),r.d(t,"c",function(){return N});function N(e,t){if(e&&e.links){var r=!0,n=!1,u=void 0;try{for(var i,a=e.links[Symbol.iterator]();!(r=(i=a.next()).done);r=!0){var c=i.value;if(c.rel===t)return c}}catch(e){n=!0,u=e}finally{try{r||null==a.return||a.return()}finally{if(n)throw u}}}}},YLtl:function(e,t){!function(){e.exports=this.lodash}()},l3Sj:function(e,t){!function(){e.exports=this.wp.i18n}()},ywyh:function(e,t){!function(){e.exports=this.wp.apiFetch}()}});
1
+ this.itsec=this.itsec||{},this.itsec["user-groups"]=this.itsec["user-groups"]||{},this.itsec["user-groups"].api=function(e){function t(t){for(var n,a,o=t[0],c=t[1],s=t[2],l=0,d=[];l<o.length;l++)a=o[l],u[a]&&d.push(u[a][0]),u[a]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(f&&f(t);d.length;)d.shift()();return i.push.apply(i,s||[]),r()}function r(){for(var e,t=0;t<i.length;t++){for(var r=i[t],n=!0,o=1;o<r.length;o++){var c=r[o];0!==u[c]&&(n=!1)}n&&(i.splice(t--,1),e=a(a.s=r[0]))}return e}var n={},u={6:0},i=[];function a(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.m=e,a.c=n,a.d=function(e,t,r){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(a.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)a.d(r,n,function(t){return e[t]}.bind(null,n));return r},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="";var o=window.itsecWebpackJsonP=window.itsecWebpackJsonP||[],c=o.push.bind(o);o.push=t,o=o.slice();for(var s=0;s<o.length;s++)t(o[s]);var f=c;return i.push(["Ntz8",0]),r()}({"1ZqX":function(e,t){!function(){e.exports=this.wp.data}()},Mmq9:function(e,t){!function(){e.exports=this.wp.url}()},Ntz8:function(e,t,r){"use strict";r.r(t);var n={};r.r(n),r.d(n,"path",function(){return R}),r.d(n,"query",function(){return j}),r.d(n,"appendToQuery",function(){return k}),r.d(n,"receiveQuery",function(){return C}),r.d(n,"processItem",function(){return D}),r.d(n,"receiveGroup",function(){return N}),r.d(n,"receiveMatchables",function(){return F}),r.d(n,"startCreateGroup",function(){return B}),r.d(n,"failedCreateGroup",function(){return H}),r.d(n,"finishCreateGroup",function(){return L}),r.d(n,"startUpdateGroup",function(){return q}),r.d(n,"failedUpdateGroup",function(){return M}),r.d(n,"finishUpdateGroup",function(){return Y}),r.d(n,"startDeleteGroup",function(){return Q}),r.d(n,"failedDeleteGroup",function(){return W}),r.d(n,"finishDeleteGroup",function(){return K}),r.d(n,"receiveGroupSettings",function(){return V}),r.d(n,"startUpdateGroupSettings",function(){return J}),r.d(n,"failedUpdateGroupSettings",function(){return $}),r.d(n,"finishUpdateGroupSettings",function(){return z}),r.d(n,"createGroup",function(){return Z}),r.d(n,"updateGroup",function(){return X}),r.d(n,"deleteGroup",function(){return ee}),r.d(n,"updateGroupSettings",function(){return te}),r.d(n,"fetchGroupsSettings",function(){return re}),r.d(n,"startFetchGroupsSettings",function(){return ne}),r.d(n,"finishFetchGroupsSettings",function(){return ue}),r.d(n,"failedFetchGroupsSettings",function(){return ie}),r.d(n,"patchBulkGroupSettings",function(){return ae}),r.d(n,"startPatchBulkGroupSettings",function(){return oe}),r.d(n,"finishPatchBulkGroupSettings",function(){return ce}),r.d(n,"failedPatchBulkGroupSettings",function(){return se}),r.d(n,"RECEIVE_QUERY",function(){return de}),r.d(n,"APPEND_TO_QUERY",function(){return pe}),r.d(n,"RECEIVE_MATCHABLES",function(){return he}),r.d(n,"START_CREATE_GROUP",function(){return ge}),r.d(n,"FINISH_CREATE_GROUP",function(){return be}),r.d(n,"FAILED_CREATE_GROUP",function(){return ye}),r.d(n,"RECEIVE_GROUP",function(){return ve}),r.d(n,"START_UPDATE_GROUP",function(){return me}),r.d(n,"FINISH_UPDATE_GROUP",function(){return Se}),r.d(n,"FAILED_UPDATE_GROUP",function(){return Ie}),r.d(n,"START_DELETE_GROUP",function(){return Ee}),r.d(n,"FINISH_DELETE_GROUP",function(){return _e}),r.d(n,"FAILED_DELETE_GROUP",function(){return Oe}),r.d(n,"RECEIVE_GROUP_SETTINGS",function(){return Te}),r.d(n,"START_UPDATE_GROUP_SETTINGS",function(){return Pe}),r.d(n,"FINISH_UPDATE_GROUP_SETTINGS",function(){return xe}),r.d(n,"FAILED_UPDATE_GROUP_SETTINGS",function(){return Ae}),r.d(n,"START_FETCH_GROUPS_SETTINGS",function(){return Ge}),r.d(n,"FINISH_FETCH_GROUPS_SETTINGS",function(){return Ue}),r.d(n,"FAILED_FETCH_GROUPS_SETTINGS",function(){return we}),r.d(n,"START_PATCH_BULK_GROUP_SETTINGS",function(){return Re}),r.d(n,"FINISH_PATCH_BULK_GROUP_SETTINGS",function(){return je}),r.d(n,"FAILED_PATCH_BULK_GROUP_SETTINGS",function(){return ke});var u={};r.r(u),r.d(u,"getMatchables",function(){return Be}),r.d(u,"getMatchableType",function(){return He}),r.d(u,"getMatchableLabel",function(){return Le}),r.d(u,"getGroups",function(){return qe}),r.d(u,"getQueriedObjectIds",function(){return Ye}),r.d(u,"getGroup",function(){return Qe}),r.d(u,"getGroupAttribute",function(){return We}),r.d(u,"isUpdating",function(){return Ke}),r.d(u,"isDeleting",function(){return Ve}),r.d(u,"getGroupSettings",function(){return Je}),r.d(u,"getGroupSetting",function(){return $e}),r.d(u,"isUpdatingSettings",function(){return ze}),r.d(u,"isBulkPatchingSettings",function(){return Ze}),r.d(u,"getGroupsBySetting",function(){return Xe});var i={};r.r(i),r.d(i,"getGroup",function(){return ot}),r.d(i,"getMatchables",function(){return ct}),r.d(i,"getGroupSettings",function(){return st});var a=r("1ZqX"),o=r("RIqP"),c=r.n(o),s=r("ywyh"),f=r.n(s),l=r("Td6G");function d(e){return{type:"API_FETCH",request:e}}function p(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),u=2;u<r;u++)n[u-2]=arguments[u];return{type:"DISPATCH",storeKey:e,actionName:t,args:n}}var h={API_FETCH:function(e){var t=e.request;return f()(t).catch(l.e)},SELECT:function(e){var t,r=e.storeKey,n=e.selectorName,u=e.args;return(t=Object(a.select)(r))[n].apply(t,c()(u))},DISPATCH:function(e){var t,r=e.storeKey,n=e.actionName,u=e.args;return(t=Object(a.dispatch)(r))[n].apply(t,c()(u))}},g=r("o0o1"),b=r.n(g),y=r("YLtl"),v=r("qPad"),m=r.n(v),S=r("Mmq9"),I=b.a.mark(j),E=b.a.mark(k),_=b.a.mark(D),O=b.a.mark(Z),T=b.a.mark(X),P=b.a.mark(ee),x=b.a.mark(te),A=b.a.mark(re),G=b.a.mark(ae);function U(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return w(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return w(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,u=function(){};return{s:u,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:u}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,o=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return a=e.done,e},e:function(e){o=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(o)throw i}}}}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var R="/ithemes-security/v1/user-groups";function j(e,t){var r,n,u,i;return b.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,d({path:Object(S.addQueryArgs)(R,t)});case 2:return r=a.sent,a.next=5,C(e,r);case 5:n=U(r),a.prev=6,n.s();case 8:if((u=n.n()).done){a.next=13;break}return i=u.value,a.delegateYield(D(i),"t0",11);case 11:a.next=8;break;case 13:a.next=18;break;case 15:a.prev=15,a.t1=a.catch(6),n.e(a.t1);case 18:return a.prev=18,n.f(),a.finish(18);case 21:return a.abrupt("return",r);case 22:case"end":return a.stop()}},I,null,[[6,15,18,21]])}function k(e,t){return b.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,{type:pe,queryId:e,item:t};case 2:return r.delegateYield(D(t),"t0",3);case 3:case"end":return r.stop()}},E)}function C(e,t){return{type:de,queryId:e,items:t}}function D(e){var t,r,n,u,i;return b.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:t=Object(y.get)(e,["_embedded","ithemes-security:user-group-member"],[]),r=Object(y.get)(e,["_embedded","ithemes-security:user-matchable-settings",0]),n=U(t),a.prev=3,n.s();case 5:if((u=n.n()).done){a.next=11;break}return i=u.value,a.next=9,p("ithemes-security/core","receiveUser",i);case 9:a.next=5;break;case 11:a.next=16;break;case 13:a.prev=13,a.t0=a.catch(3),n.e(a.t0);case 16:return a.prev=16,n.f(),a.finish(16);case 19:if(!r){a.next=22;break}return a.next=22,V(e.id,r);case 22:case"end":return a.stop()}},_,null,[[3,13,16,19]])}function N(e){return{type:ve,group:e}}function F(e){return{type:he,matchables:e}}function B(e){return{type:ge,group:e}}function H(e,t){return{type:ye,group:e,error:t}}function L(e,t){return{type:be,group:e,response:t}}function q(e,t){return{type:me,id:e,group:t}}function M(e,t){return{type:Ie,id:e,error:t}}function Y(e,t){return{type:Se,id:e,response:t}}function Q(e){return{type:Ee,id:e}}function W(e,t){return{type:Oe,id:e,error:t}}function K(e){return{type:_e,id:e}}function V(e,t){return{type:Te,id:e,settings:t}}function J(e,t){return{type:Pe,id:e,settings:t}}function $(e,t){return{type:Ae,id:e,error:t}}function z(e,t){return{type:xe,id:e,response:t}}function Z(e){var t;return b.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,B(e);case 2:return r.prev=2,r.next=5,d({path:Object(S.addQueryArgs)(R,{_embed:1}),method:"POST",data:e});case 5:t=r.sent,r.next=13;break;case 8:return r.prev=8,r.t0=r.catch(2),r.next=12,H(e,r.t0);case 12:return r.abrupt("return",r.t0);case 13:return r.next=15,L(e,t);case 15:return r.next=17,N(t);case 17:return r.delegateYield(D(t),"t1",18);case 18:return r.abrupt("return",t);case 19:case"end":return r.stop()}},O,null,[[2,8]])}function X(e,t){var r;return b.a.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,q(e,t);case 2:return n.prev=2,n.next=5,d({path:R+"/"+e,method:"PUT",data:t});case 5:r=n.sent,n.next=13;break;case 8:return n.prev=8,n.t0=n.catch(2),n.next=12,M(e,n.t0);case 12:return n.abrupt("return",n.t0);case 13:return n.next=15,Y(e,r);case 15:return n.next=17,N(r);case 17:return n.abrupt("return",r);case 18:case"end":return n.stop()}},T,null,[[2,8]])}function ee(e){return b.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Q(e);case 2:return t.prev=2,t.next=5,d({path:"".concat(R,"/").concat(e),method:"DELETE"});case 5:t.next=12;break;case 7:return t.prev=7,t.t0=t.catch(2),t.next=11,W(e,t.t0);case 11:return t.abrupt("return",t.t0);case 12:return t.next=14,K(e);case 14:return t.abrupt("return",null);case 15:case"end":return t.stop()}},P,null,[[2,7]])}function te(e,t){var r;return b.a.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,J(e,t);case 2:return n.prev=2,n.next=5,d({path:"ithemes-security/v1/user-matchable-settings/".concat(e),method:"PUT",data:t});case 5:r=n.sent,n.next=13;break;case 8:return n.prev=8,n.t0=n.catch(2),n.next=12,$(e,n.t0);case 12:return n.abrupt("return",n.t0);case 13:return n.next=15,z(e,r);case 15:return n.next=17,V(e,r);case 17:return n.abrupt("return",r);case 18:case"end":return n.stop()}},x,null,[[2,8]])}function re(){var e,t,r,n,u=arguments;return b.a.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return e=u.length>0&&void 0!==u[0]?u[0]:[],i.next=3,ne(e);case 3:return i.prev=3,r="ithemes-security/v1/user-matchable-settings",e.length>0&&(r=Object(S.addQueryArgs)(r,{include:e})),i.next=8,d({path:r});case 8:t=i.sent,i.next=16;break;case 11:return i.prev=11,i.t0=i.catch(3),i.next=15,ie(e,i.t0);case 15:return i.abrupt("return",i.t0);case 16:return i.next=18,ue(e,t);case 18:i.t1=b.a.keys(t);case 19:if((i.t2=i.t1()).done){i.next=27;break}if(n=i.t2.value,t.hasOwnProperty(n)){i.next=23;break}return i.abrupt("continue",19);case 23:return i.next=25,V(n,t[n]);case 25:i.next=19;break;case 27:return i.abrupt("return",t);case 28:case"end":return i.stop()}},A,null,[[3,11]])}function ne(e){return{type:Ge,groupIds:e}}function ue(e,t){return{type:Ue,groupIds:e,response:t}}function ie(e,t){return{type:we,groupIds:e,error:t}}function ae(e,t){var r,n,u,i,o,c,s,f;return b.a.wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return p.next=2,oe(e,t);case 2:return p.prev=2,p.next=5,d({path:Object(S.addQueryArgs)("ithemes-security/v1/user-matchable-settings",{include:e}),method:"PATCH",data:t});case 5:r=p.sent,p.next=13;break;case 8:return p.prev=8,p.t0=p.catch(2),p.next=12,se(e,t,p.t0);case 12:return p.abrupt("return",p.t0);case 13:return p.next=15,ce(e,t,r);case 15:if(n=Object(a.select)("ithemes-security/core").getSchema("ithemes-security-user-group-settings"),u=Object(l.c)(n,"self")){p.next=19;break}return p.abrupt("return",r);case 19:i=new m.a(u.href),o=U(r),p.prev=21,o.s();case 23:if((c=o.n()).done){p.next=34;break}if(200===(s=c.value).status){p.next=27;break}return p.abrupt("continue",32);case 27:if((f=i.fromUri(s.href)).id){p.next=30;break}return p.abrupt("continue",32);case 30:return p.next=32,V(f.id,s.response);case 32:p.next=23;break;case 34:p.next=39;break;case 36:p.prev=36,p.t1=p.catch(21),o.e(p.t1);case 39:return p.prev=39,o.f(),p.finish(39);case 42:return p.abrupt("return",r);case 43:case"end":return p.stop()}},G,null,[[2,8],[21,36,39,42]])}function oe(e,t){return{type:Re,groupIds:e,patch:t}}function ce(e,t,r){return{type:je,groupIds:e,patch:t,response:r}}function se(e,t,r){return{type:ke,groupIds:e,patch:t,error:r}}var fe,le,de="RECEIVE_QUERY",pe="APPEND_TO_QUERY",he="RECEIVE_MATCHABLES",ge="START_CREATE_GROUP",be="FINISH_CREATE_GROUP",ye="FAILED_CREATE_GROUP",ve="RECEIVE_GROUP",me="START_UPDATE_GROUP",Se="FINISH_UPDATE_GROUP",Ie="FAILED_UPDATE_GROUP",Ee="START_DELETE_GROUP",_e="FINISH_DELETE_GROUP",Oe="FAILED_DELETE_GROUP",Te="RECEIVE_GROUP_SETTINGS",Pe="START_UPDATE_GROUP_SETTINGS",xe="FINISH_UPDATE_GROUP_SETTINGS",Ae="FAILED_UPDATE_GROUP_SETTINGS",Ge="START_FETCH_GROUPS_SETTINGS",Ue="FINISH_FETCH_GROUPS_SETTINGS",we="FAILED_FETCH_GROUPS_SETTINGS",Re="START_PATCH_BULK_GROUP_SETTINGS",je="FINISH_PATCH_BULK_GROUP_SETTINGS",ke="FAILED_PATCH_BULK_GROUP_SETTINGS";function Ce(e){return[e]}function De(){var e={clear:function(){e.head=null}};return e}function Ne(e,t,r){var n;if(e.length!==t.length)return!1;for(n=r;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}fe={},le="undefined"!=typeof WeakMap;var Fe=function(e,t){var r,n;function u(){r=le?new WeakMap:De()}function i(){var r,u,i,a,o,c=arguments.length;for(a=new Array(c),i=0;i<c;i++)a[i]=arguments[i];for(o=t.apply(null,a),(r=n(o)).isUniqueByDependants||(r.lastDependants&&!Ne(o,r.lastDependants,0)&&r.clear(),r.lastDependants=o),u=r.head;u;){if(Ne(u.args,a,1))return u!==r.head&&(u.prev.next=u.next,u.next&&(u.next.prev=u.prev),u.next=r.head,u.prev=null,r.head.prev=u,r.head=u),u.val;u=u.next}return u={val:e.apply(null,a)},a[0]=null,u.args=a,r.head&&(r.head.prev=u,u.next=r.head),r.head=u,u.val}return t||(t=Ce),n=le?function(e){var t,n,u,i,a,o=r,c=!0;for(t=0;t<e.length;t++){if(n=e[t],!(a=n)||"object"!=typeof a){c=!1;break}o.has(n)?o=o.get(n):(u=new WeakMap,o.set(n,u),o=u)}return o.has(fe)||((i=De()).isUniqueByDependants=c,o.set(fe,i)),o.get(fe)}:function(){return r},i.getDependants=t,i.clear=u,u(),i},Be=Fe(function(e){return Object(y.filter)(Object(y.map)(e.matchableIds,function(t){return e.matchablesById[t]}),y.isObject)},function(e){return[e.matchablesById,e.matchableIds]});function He(e,t){return(e.matchablesById[t]||{}).type}function Le(e,t){return(e.matchablesById[t]||{}).label}var qe=Fe(function(e,t){return Object(y.filter)(Object(y.map)(e.queries[t],function(t){return e.byId[t]}),y.isObject)},function(e,t){return[e.queries[t],e.byId]}),Me=[];function Ye(e,t){return e.queries[t]||Me}function Qe(e,t){return e.byId[t]}function We(e,t,r){var n=Object(a.select)("ithemes-security/user-groups").getGroup(t);return n?n[r]:void 0}function Ke(e,t){return e.updating.includes(t)}function Ve(e,t){return e.deleting.includes(t)}function Je(e,t){return e.settings[t]}function $e(e,t,r,n){var u=Object(a.select)("ithemes-security/user-groups").getGroupSettings(t);return Object(y.get)(u,[r,n])}function ze(e,t){return e.updatingSettings.includes(t)}function Ze(e,t,r){var n=t.join("_");return e.bulkPatchingSettings[n]===r}function Xe(e){var t={};for(var r in e.settings)if(e.settings.hasOwnProperty(r))for(var n in e.settings[r])if(e.settings[r].hasOwnProperty(n))for(var u in e.settings[r][n])e.settings[r][n].hasOwnProperty(u)&&(t[n]||(t[n]={}),t[n][u]||(t[n][u]=[]),e.settings[r][n][u]&&t[n][u].push(r));return t}var et=r("lSNA"),tt=r.n(et);function rt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function nt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?rt(Object(r),!0).forEach(function(t){tt()(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rt(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var ut={matchablesById:{},matchableIds:[],byId:{},queries:{},creating:[],updating:[],deleting:[],settings:{},updatingSettings:[],bulkPatchingSettings:{}};function it(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return at(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return at(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,u=function(){};return{s:u,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:u}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,o=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return a=e.done,e},e:function(e){o=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(o)throw i}}}}function at(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var ot={fulfill:b.a.mark(function e(t){var r;return b.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d({path:"".concat(R,"/").concat(t,"?_embed=1")});case 2:return r=e.sent,e.next=5,N(r);case 5:return e.delegateYield(D(r),"t0",6);case 6:case"end":return e.stop()}},e)}),isFulfilled:function(e,t){return e.byId.hasOwnProperty(t)}},ct={fulfill:b.a.mark(function e(){var t,r,n,u,i,a;return b.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d({path:"/ithemes-security/v1/user-matchables?_embed=1"});case 2:return t=e.sent,e.next=5,F(t);case 5:r=it(t),e.prev=6,r.s();case 8:if((n=r.n()).done){e.next=20;break}if(u=n.value,i=Object(y.get)(u,["_embedded","self",0]),a=Object(y.get)(u,["_embedded","ithemes-security:user-matchable-settings",0]),!i){e.next=15;break}return e.next=15,N(i);case 15:if(!a){e.next=18;break}return e.next=18,V(u.id,a);case 18:e.next=8;break;case 20:e.next=25;break;case 22:e.prev=22,e.t0=e.catch(6),r.e(e.t0);case 25:return e.prev=25,r.f(),e.finish(25);case 28:case"end":return e.stop()}},e,null,[[6,22,25,28]])}),isFulfilled:function(e){return!Object(y.isEmpty)(e.matchablesById)}},st={fulfill:b.a.mark(function e(t){var r;return b.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d({path:"ithemes-security/v1/user-matchable-settings/".concat(t)});case 2:return r=e.sent,e.next=5,V(t,r);case 5:case"end":return e.stop()}},e)}),isFulfilled:function(e,t){return e.settings.hasOwnProperty(t)}},ft=Object(a.registerStore)("ithemes-security/user-groups",{controls:h,actions:n,selectors:u,resolvers:i,reducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ut,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case he:return nt(nt({},e),{},{matchableIds:Object(y.map)(t.matchables,"id"),matchablesById:Object(y.keyBy)(t.matchables,"id")});case de:return nt(nt({},e),{},{byId:nt(nt({},e.byId),Object(y.keyBy)(t.items,"id")),queries:nt(nt({},e.queries),{},tt()({},t.queryId,Object(y.map)(t.items,"id")))});case pe:return nt(nt({},e),{},{byId:nt(nt({},e.byId),{},tt()({},t.item.id,t.item)),queries:nt(nt({},e.queries),{},tt()({},t.queryId,[].concat(c()(e.queries[t.queryId]||[]),[t.item.id])))});case ve:return nt(nt({},e),{},{byId:nt(nt({},e.byId),{},tt()({},t.group.id,t.group)),matchablesById:e.matchablesById[t.group.id]?nt(nt({},e.matchablesById),{},tt()({},t.group.id,nt(nt({},e.matchablesById[t.group.id]),{},{label:t.group.label}))):e.matchablesById});case ge:return nt(nt({},e),{},{creating:[].concat(c()(e.creating),[t.group])});case be:return nt(nt({},e),{},{creating:e.creating.filter(function(e){return e!==t.group}),matchablesById:nt(nt({},e.matchablesById),{},tt()({},t.response.id,{id:t.response.id,label:t.response.label,type:"user-group"})),matchableIds:[].concat(c()(e.matchableIds),[[t.response.id]])});case ye:return nt(nt({},e),{},{creating:e.creating.filter(function(e){return e!==t.group})});case me:return nt(nt({},e),{},{updating:[].concat(c()(e.updating),[t.id])});case Se:case Ie:return nt(nt({},e),{},{updating:e.updating.filter(function(e){return e!==t.id})});case Ee:return nt(nt({},e),{},{deleting:[].concat(c()(e.deleting),[t.id])});case _e:return nt(nt({},e),{},{deleting:e.deleting.filter(function(e){return e!==t.id}),byId:Object(y.omit)(e.byId,[t.id]),matchablesById:Object(y.omit)(e.matchablesById,[t.id]),matchableIds:e.matchableIds.filter(function(e){return e!==t.id}),settings:Object(y.omit)(e.settings,[t.id])});case Oe:return nt(nt({},e),{},{deleting:e.deleting.filter(function(e){return e!==t.id})});case Te:return nt(nt({},e),{},{settings:nt(nt({},e.settings),{},tt()({},t.id,t.settings))});case Pe:return nt(nt({},e),{},{updatingSettings:[].concat(c()(e.updatingSettings),[t.id])});case xe:case Ae:return nt(nt({},e),{},{updatingSettings:e.updatingSettings.filter(function(e){return e!==t.id})});case Re:return nt(nt({},e),{},{bulkPatchingSettings:nt(nt({},e.bulkPatchingSettings),{},tt()({},t.groupIds.join("_"),t.patch))});case je:case ke:return nt(nt({},e),{},{bulkPatchingSettings:Object(y.omit)(e.bulkPatchingSettings,[t.groupIds.join("_")])});default:return e}}});r.d(t,"store",function(){return ft}),r.p=window.itsecWebpackPublicPath},Td6G:function(e,t,r){"use strict";r("J4zp");var n=r("YLtl"),u=r("RIqP"),i=r.n(u),a=r("lwsE"),o=r.n(a),c=r("W8MJ"),s=r.n(c),f=r("lSNA"),l=r.n(f),d=r("92Nh"),p=r.n(d),h=r("tmk3"),g=r.n(h);function b(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return y(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return y(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,u=function(){};return{s:u,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:u}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,o=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return a=e.done,e},e:function(e){o=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(o)throw i}}}}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var v=new WeakMap,m=new WeakMap,S=function(){function e(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;o()(this,e),v.set(this,{writable:!0,value:{}}),m.set(this,{writable:!0,value:{}}),l()(this,"getErrorCodes",function(){return Object.keys(g()(t,v))}),l()(this,"getErrorCode",function(){return t.getErrorCodes()[0]}),l()(this,"getErrorMessages",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;if(e)return g()(t,v)[e];var r=[];for(var n in g()(t,v))g()(t,v).hasOwnProperty(n)&&r.concat(g()(t,v)[n]);return r}),l()(this,"getErrorMessage",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return e=e||t.getErrorCode(),t.getErrorMessages(e)[0]}),l()(this,"getErrorData",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return e=e||t.getErrorCode(),g()(t,m)[e]}),l()(this,"getAllErrorMessages",function(){var e=[];for(var r in g()(t,v))g()(t,v).hasOwnProperty(r)&&e.push.apply(e,i()(g()(t,v)[r]));return e}),r&&(n&&(g()(this,v)[r]=[n]),u&&(g()(this,m)[r]=u))}return s()(e,null,[{key:"fromPHPObject",value:function(t){var r=new e;return p()(r,v,t.errors),p()(r,m,t.error_data),r}},{key:"fromApiError",value:function(t){var r=new e;if(g()(r,v)[t.code]=[t.message],g()(r,m)[t.code]=t.data,t.additional_errors){var n,u=b(t.additional_errors);try{for(u.s();!(n=u.n()).done;){var i=n.value;g()(r,v)[i.code]=[i.message],g()(r,m)[i.code]=i.data}}catch(e){u.e(e)}finally{u.f()}}return r}}]),e}(),I=r("PJYZ"),E=r.n(I),_=r("7W2i"),O=r.n(_),T=r("a1gu"),P=r.n(T),x=r("Nsbk"),A=r.n(x),G=r("oShl"),U=r.n(G),w=r("l3Sj");function R(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}();return function(){var r,n=A()(e);if(t){var u=A()(this).constructor;r=Reflect.construct(n,arguments,u)}else r=n.apply(this,arguments);return P()(this,r)}}var j=function(e){O()(r,e);var t=R(r);function r(e){var n;o()(this,r);for(var u=arguments.length,i=new Array(u>1?u-1:0),a=1;a<u;a++)i[a-1]=arguments[a];for(var c in n=t.call.apply(t,[this,e.message||Object(w.__)("An unknown error occurred.","better-wp-security")].concat(i)),Error.captureStackTrace&&Error.captureStackTrace(E()(n),r),n.__response=e,e)e.hasOwnProperty(c)&&Object.defineProperty(E()(n),c,{value:e[c],configurable:!0,enumerable:!0,writable:!0});return n}return s()(r,[{key:"toString",value:function(){return this.__response.toString()}},{key:"getResponse",value:function(){return this.__response}}]),r}(U()(Error));function k(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return C(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return C(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,u=function(){};return{s:u,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:u}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,o=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return a=e.done,e},e:function(e){o=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(o)throw i}}}}function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function D(e){if(!Object(n.isPlainObject)(e))return!1;var t=Object.keys(e);return 2===t.length&&(t.includes("errors")&&t.includes("error_data"))}function N(e){return D(e)?S.fromPHPObject(e):function(e){if(!Object(n.isPlainObject)(e))return!1;var t=Object.keys(e);return(3===t.length||4===t.length)&&!(4===t.length&&!t.includes("additional_errors"))&&t.includes("code")&&t.includes("message")&&t.includes("data")}(e)?S.fromApiError(e):new S}function F(e,t){var r,n=[[],[]],u=k(e);try{for(u.s();!(r=u.n()).done;){var i=r.value;n[t(i)?0:1].push(i)}}catch(e){u.e(e)}finally{u.f()}return n}function B(e){if(e instanceof Error)throw e;throw new j(e)}r.d(t,"d",function(){return D}),r.d(t,"b",function(){return N}),r.d(t,"a",function(){return F}),r.d(t,"e",function(){return B}),r.d(t,"c",function(){return H});function H(e,t){if(e&&e.links){var r,n=k(e.links);try{for(n.s();!(r=n.n()).done;){var u=r.value;if(u.rel===t)return u}}catch(e){n.e(e)}finally{n.f()}}}},YLtl:function(e,t){!function(){e.exports=this.lodash}()},l3Sj:function(e,t){!function(){e.exports=this.wp.i18n}()},qPad:function(e,t,r){var n,u;n=this,u=function(){var e={"+":!0,"#":!0,".":!0,"/":!0,";":!0,"?":!0,"&":!0},t={"*":!0};function r(e){return encodeURI(e).replace(/%25[0-9][0-9]/g,function(e){return"%"+e.substring(3)})}function n(e){return e=e.replace(/%../g,""),encodeURIComponent(e)===e}function u(u){var i="";e[u.charAt(0)]&&(i=u.charAt(0),u=u.substring(1));var a="",o="",c=!0,s=!1,f=!1;"+"==i?c=!1:"."==i?(o=".",a="."):"/"==i?(o="/",a="/"):"#"==i?(o="#",c=!1):";"==i?(o=";",a=";",s=!0,f=!0):"?"==i?(o="?",a="&",s=!0):"&"==i&&(o="&",a="&",s=!0);for(var l=[],d=u.split(","),p=[],h={},g=0;g<d.length;g++){var b=d[g],y=null;if(-1!=b.indexOf(":")){var v=b.split(":");b=v[0],y=parseInt(v[1])}for(var m={};t[b.charAt(b.length-1)];)m[b.charAt(b.length-1)]=!0,b=b.substring(0,b.length-1);var S={truncate:y,name:b,suffices:m};p.push(S),h[b]=S,l.push(b)}return{varNames:l,prefix:o,substitution:function(e){for(var t="",n=0,u=0;u<p.length;u++){var i=p[u],l=e(i.name);if(null==l||Array.isArray(l)&&0==l.length||"object"==typeof l&&0==Object.keys(l).length)n++;else if(t+=u==n?o:a||",",Array.isArray(l)){s&&(t+=i.name+"=");for(var d=0;d<l.length;d++)d>0&&(t+=i.suffices["*"]&&a||",",i.suffices["*"]&&s&&(t+=i.name+"=")),t+=c?encodeURIComponent(l[d]).replace(/!/g,"%21"):r(l[d])}else if("object"==typeof l){s&&!i.suffices["*"]&&(t+=i.name+"=");var h=!0;for(var g in l)h||(t+=i.suffices["*"]&&a||","),h=!1,t+=c?encodeURIComponent(g).replace(/!/g,"%21"):r(g),t+=i.suffices["*"]?"=":",",t+=c?encodeURIComponent(l[g]).replace(/!/g,"%21"):r(l[g])}else s&&(t+=i.name,f&&""==l||(t+="=")),null!=i.truncate&&(l=l.substring(0,i.truncate)),t+=c?encodeURIComponent(l).replace(/!/g,"%21"):r(l)}return t},unSubstitution:function(e,t,r){if(o&&(e=e.substring(o.length)),1==p.length&&p[0].suffices["*"]){for(var u=(_=p[0]).name,i=_.suffices["*"]?e.split(a||","):[e],f=c&&-1!=e.indexOf("="),l=1;l<i.length;l++)e=i[l],f&&-1==e.indexOf("=")&&(i[l-1]+=(a||",")+e,i.splice(l,1),l--);for(l=0;l<i.length;l++)e=i[l],c&&-1!=e.indexOf("=")&&(f=!0),1==(v=e.split(",")).length?i[l]=v[0]:i[l]=v;if(s||f){for(var d=t[u]||{},g=0;g<i.length;g++){var b=e;if(!s||b){if("string"==typeof i[g]){var y=(e=i[g]).split("=",1)[0];if(e=e.substring(y.length+1),c){if(r&&!n(e))return;e=decodeURIComponent(e)}b=e}else{if(y=(e=i[g][0]).split("=",1)[0],e=e.substring(y.length+1),c){if(r&&!n(e))return;e=decodeURIComponent(e)}i[g][0]=e,b=i[g]}if(c){if(r&&!n(y))return;y=decodeURIComponent(y)}void 0!==d[y]?Array.isArray(d[y])?d[y].push(b):d[y]=[d[y],b]:d[y]=b}}1==Object.keys(d).length&&void 0!==d[u]?t[u]=d[u]:t[u]=d}else{if(c)for(g=0;g<i.length;g++){var v=i[g];if(Array.isArray(v))for(var m=0;m<v.length;m++){if(r&&!n(v[m]))return;v[m]=decodeURIComponent(v[m])}else{if(r&&!n(v))return;i[g]=decodeURIComponent(v)}}void 0!==t[u]?Array.isArray(t[u])?t[u]=t[u].concat(i):t[u]=[t[u]].concat(i):1!=i.length||_.suffices["*"]?t[u]=i:t[u]=i[0]}}else{i=1==p.length?[e]:e.split(a||",");var S={};for(l=0;l<i.length;l++){for(var I=0;I<p.length-1&&I<l&&!p[I].suffices["*"];I++);if(I!=l){for(var E=p.length-1;E>0&&p.length-E<i.length-l&&!p[E].suffices["*"];E--);p.length-E!=i.length-l?S[l]=I:S[l]=E}else S[l]=l}for(l=0;l<i.length;l++)if((e=i[l])||!s){if(v=e.split(","),f=!1,s){u=(e=v[0]).split("=",1)[0],e=e.substring(u.length+1),v[0]=e;var _=h[u]||p[0]}else u=(_=p[S[l]]).name;for(g=0;g<v.length;g++)if(c){if(r&&!n(v[g]))return;v[g]=decodeURIComponent(v[g])}(s||_.suffices["*"])&&void 0!==t[u]?Array.isArray(t[u])?t[u]=t[u].concat(v):t[u]=[t[u]].concat(v):1!=v.length||_.suffices["*"]?t[u]=v:t[u]=v[0]}}return 1}}}function i(e){if(!(this instanceof i))return new i(e);for(var t=e.split("{"),r=[t.shift()],n=[],a=[],o=[],c=[];t.length>0;){var s=t.shift(),f=s.split("}")[0],l=s.substring(f.length+1),d=u(f);a.push(d.substitution),o.push(d.unSubstitution),n.push(d.prefix),r.push(l),c=c.concat(d.varNames)}this.fill=function(e){if(e&&"function"!=typeof e){var t=e;e=function(e){return t[e]}}for(var n=r[0],u=0;u<a.length;u++){n+=(0,a[u])(e),n+=r[u+1]}return n},this.fromUri=function(e,t){t=t||{};for(var u={},i=0;i<r.length;i++){var a=r[i];if(e.substring(0,a.length)!==a)return;if(e=e.substring(a.length),i>=r.length-1){if(""==e)break;return}var c=n[i];if(!c||e.substring(0,c.length)===c){for(var s=r[i+1],f=i;;){if(f==r.length-2){var l=e.substring(e.length-s.length);if(l!==s)return;var d=e.substring(0,e.length-s.length);e=l}else if(s){var p=e.indexOf(s);d=e.substring(0,p);e=e.substring(p)}else if(n[f+1]){-1===(p=e.indexOf(n[f+1]))&&(p=e.length);d=e.substring(0,p);e=e.substring(p)}else{if(r.length>f+2){s=r[++f+1];continue}d=e;e=""}break}if(!o[i](d,u,t.strict))return}}return u},this.varNames=c,this.template=e}return i.prototype={toString:function(){return this.template},fillFromObject:function(e){return this.fill(e)},test:function(e,t){return!!this.fromUri(e,t)}},i},"function"==typeof define&&define.amd?define("uri-templates",[],u):e.exports?e.exports=u():n.UriTemplate=u()},ywyh:function(e,t){!function(){e.exports=this.wp.apiFetch}()}});
dist/user-groups/settings.min.js CHANGED
@@ -1,7 +1,7 @@
1
- this.itsec=this.itsec||{},this.itsec["user-groups"]=this.itsec["user-groups"]||{},this.itsec["user-groups"].settings=function(e){function t(t){for(var n,i,o=t[0],s=t[1],c=0,u=[];c<o.length;c++)i=o[c],r[i]&&u.push(r[i][0]),r[i]=0;for(n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n]);for(a&&a(t);u.length;)u.shift()()}var n={},r={6:0,3:0};function i(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.e=function(e){var t=[],n=r[e];if(0!==n)if(n)t.push(n[2]);else{var o=new Promise(function(t,i){n=r[e]=[t,i]});t.push(n[2]=o);var s,c=document.createElement("script");c.charset="utf-8",c.timeout=120,i.nc&&c.setAttribute("nonce",i.nc),c.src=function(e){return i.p+""+({}[e]||e)+".min.js"}(e),s=function(t){c.onerror=c.onload=null,clearTimeout(a);var n=r[e];if(0!==n){if(n){var i=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src,s=new Error("Loading chunk "+e+" failed.\n("+i+": "+o+")");s.type=i,s.request=o,n[1](s)}r[e]=void 0}};var a=setTimeout(function(){s({type:"timeout",target:c})},12e4);c.onerror=c.onload=s,document.head.appendChild(c)}return Promise.all(t)},i.m=e,i.c=n,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i.oe=function(e){throw console.error(e),e};var o=window.itsecWebpackJsonP=window.itsecWebpackJsonP||[],s=o.push.bind(o);o.push=t,o=o.slice();for(var c=0;c<o.length;c++)t(o[c]);var a=s;return i(i.s="epig")}({"+VN0":function(e,t,n){},"16Al":function(e,t,n){"use strict";var r=n("WbBG");function i(){}e.exports=function(){function e(e,t,n,i,o,s){if(s!==r){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=i,n.PropTypes=n,n}},"17x9":function(e,t,n){e.exports=n("16Al")()},"1ZqX":function(e,t){!function(){e.exports=this.wp.data}()},"31KZ":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.withErrorBoundary=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n("cDcd"),o=c(i),s=c(n("Xvx9"));function c(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var u=n("cDcd").babelPluginFlowReactPropTypes_proptype_ComponentType||n("17x9").any,l=function(e){function t(){var e,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var i=arguments.length,o=Array(i),s=0;s<i;s++)o[s]=arguments[s];return n=r=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(o))),r.state={error:null,info:null},a(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.Component),r(t,[{key:"componentDidCatch",value:function(e,t){var n=this.props.onError;if("function"==typeof n)try{n.call(this,e,t?t.componentStack:"")}catch(e){}this.setState({error:e,info:t})}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.FallbackComponent,r=this.state,i=r.error,s=r.info;return null!==i?o.default.createElement(n,{componentStack:s?s.componentStack:"",error:i}):t}}]),t}();l.defaultProps={FallbackComponent:s.default},l.propTypes={error:"function"==typeof Error?n("17x9").instanceOf(Error):n("17x9").any,info:n("17x9").shape({componentStack:n("17x9").string.isRequired})},(t.withErrorBoundary=function(e,t,n){return function(r){return o.default.createElement(l,{FallbackComponent:t,onError:n},o.default.createElement(e,r))}}).propTypes=u===n("17x9").any?{}:u,t.default=l},"4eJC":function(e,t,n){e.exports=function(e,t){var n,r,i,o=0;function s(){var t,s,c=r,a=arguments.length;e:for(;c;){if(c.args.length===arguments.length){for(s=0;s<a;s++)if(c.args[s]!==arguments[s]){c=c.next;continue e}return c!==r&&(c===i&&(i=c.prev),c.prev.next=c.next,c.next&&(c.next.prev=c.prev),c.next=r,c.prev=null,r.prev=c,r=c),c.val}c=c.next}for(t=new Array(a),s=0;s<a;s++)t[s]=arguments[s];return c={args:t,val:e.apply(null,t)},r?(r.prev=c,c.next=r):i=c,o===n?(i=i.prev).next=null:o++,r=c,c.val}return t&&t.maxSize&&(n=t.maxSize),s.clear=function(){r=null,i=null,o=0},s}},"6ECA":function(e,t,n){},"7W2i":function(e,t,n){var r=n("SksO");e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}},"8OQS":function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}},"92Nh":function(e,t){e.exports=function(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");var r=t.get(e);if(!r.writable)throw new TypeError("attempted to set read only private field");return r.value=n,n}},A6yB:function(e,t,n){},Bnag:function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},DfSy:function(e,t,n){},Dfre:function(e,t,n){},ELjz:function(e,t,n){},EbDI:function(e,t){e.exports=function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}},GRId:function(e,t){!function(){e.exports=this.wp.element}()},"GjY+":function(e,t,n){},GrEf:function(e,t,n){},IXp0:function(e,t,n){},Ijbi:function(e,t){e.exports=function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}},J4zp:function(e,t,n){var r=n("wTVA"),i=n("m0LI"),o=n("wkBT");e.exports=function(e,t){return r(e)||i(e,t)||o()}},JVTk:function(e,t,n){var r=n("cDcd");function i(e){return r.createElement("svg",e,[r.createElement("defs",{key:0},r.createElement("style",null,".itsec-icon-logo-12f8d__path{fill:#1072ba;}.itsec-icon-logo-12f8d__path{fill:#69c;}")),r.createElement("g",{key:1},r.createElement("g",null,[r.createElement("path",{className:"itsec-icon-logo-12f8d__path",d:"M203.28,95V14.26a1.73,1.73,0,0,0-1.11-1.55c-4.38-1.44-21.5-6.6-46.22-8a1.1,1.1,0,0,0-1.17,1.11V20.1a1,1,0,0,1-1.16,1c-8-1.24-16.88-2.29-26.39-3a1.27,1.27,0,0,1-1.17-1.25V3a1.37,1.37,0,0,0-1.16-1.32A211.61,211.61,0,0,0,101,0,178.14,178.14,0,0,0,78.51,1.87a1.4,1.4,0,0,0-1.16,1.35V16.91a1.28,1.28,0,0,1-1.16,1.26c-9.51.72-18.34,1.78-26.38,3a1,1,0,0,1-1.16-1V5.79a1.1,1.1,0,0,0-1.17-1.11c-24.74,1.43-41.94,6.59-46.34,8A1.73,1.73,0,0,0,0,14.26V95s-2.3,54.32,34.61,97.07c32.69,37.86,60,46.91,65.84,48.5a5.16,5.16,0,0,0,2.28,0c5.82-1.58,33.16-10.63,65.83-48.5C205.51,149.35,203.28,95,203.28,95Z",key:0}),r.createElement("path",{className:"itsec-icon-logo-12f8d__path",d:"M101.38,68.5a21.75,21.75,0,1,0,21.7,21.81A21.77,21.77,0,0,0,101.38,68.5Z",key:1}),r.createElement("path",{className:"itsec-icon-logo-12f8d__path",d:"M182.44,87V42.75A1.92,1.92,0,0,0,181,41a385.2,385.2,0,0,0-78.26-8.05h-1.66a398.43,398.43,0,0,0-78.71,8.21,1.9,1.9,0,0,0-1.45,1.78l0,44.2v.24c0,3.27.09,54.82,33.38,93.35,18.71,21.67,35,33.81,46.15,40.44a2.79,2.79,0,0,0,2.56,0c11.14-6.61,27.36-18.74,46.12-40.45C183.22,141.12,182.46,87.63,182.44,87Zm-50.57,79.1c-2.69,3.13-5.32,6-7.87,8.69-.59.61-1.07.41-1.07-.44V155.78c0-14.05,13.64-21.19,18.14-23.17a2.49,2.49,0,0,0,1.42-2.11V116.39a1,1,0,0,0-1.41-.94c-37.93,15.49-72.25,3-79.51,0a.93.93,0,0,0-1.41.91V130.5a2.37,2.37,0,0,0,1.44,2.06c14.94,5.72,18,15.46,18,23.4v18.25c0,.85-.48,1-1.06.43-2.51-2.63-5.09-5.46-7.76-8.53-28.11-32.58-27.95-78.24-27.93-78.7V61.47a1.86,1.86,0,0,1,1.51-1.77,374.15,374.15,0,0,1,56.51-4.51h1.69a364.08,364.08,0,0,1,55.75,4.32,1.86,1.86,0,0,1,1.52,1.78v25.3C159.83,87.44,160.12,133.44,131.87,166.11Z",key:2})]))])}i.defaultProps={width:"200px",viewBox:"0 0 203.31 240.72"},e.exports=i,i.default=i},K9lf:function(e,t){!function(){e.exports=this.wp.compose}()},MVZn:function(e,t,n){var r=n("lSNA");e.exports=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),i.forEach(function(t){r(e,t,n[t])})}return e}},Mmq9:function(e,t){!function(){e.exports=this.wp.url}()},Nsbk:function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(t)}e.exports=n},PJYZ:function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},QILm:function(e,t,n){var r=n("8OQS");e.exports=function(e,t){if(null==e)return{};var n,i,o=r(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}},QmYb:function(e,t,n){},QxRw:function(e,t,n){},RIqP:function(e,t,n){var r=n("Ijbi"),i=n("EbDI"),o=n("Bnag");e.exports=function(e){return r(e)||i(e)||o()}},SksO:function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(t,r)}e.exports=n},TSYQ:function(e,t,n){
2
  /*!
3
  Copyright (c) 2017 Jed Watson.
4
  Licensed under the MIT License (MIT), see
5
  http://jedwatson.github.io/classnames
6
  */
7
- !function(){"use strict";var t={}.hasOwnProperty;function n(){for(var e=[],r=0;r<arguments.length;r++){var i=arguments[r];if(i){var o=typeof i;if("string"===o||"number"===o)e.push(i);else if(Array.isArray(i)&&i.length){var s=n.apply(null,i);s&&e.push(s)}else if("object"===o)for(var c in i)t.call(i,c)&&i[c]&&e.push(c)}}return e.join(" ")}e.exports?(n.default=n,e.exports=n):"function"==typeof define&&"object"==typeof define.amd&&define.amd?define("classnames",[],function(){return n}):window.classNames=n}()},Td6G:function(e,t,n){"use strict";n("J4zp");var r=n("YLtl"),i=n("RIqP"),o=n.n(i),s=n("lwsE"),c=n.n(s),a=n("W8MJ"),u=n.n(a),l=n("lSNA"),d=n.n(l),p=n("92Nh"),f=n.n(p),h=n("tmk3"),b=n.n(h),m=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;c()(this,e),v.set(this,{writable:!0,value:{}}),g.set(this,{writable:!0,value:{}}),d()(this,"getErrorCodes",function(){return Object.keys(b()(t,v))}),d()(this,"getErrorCode",function(){return t.getErrorCodes()[0]}),d()(this,"getErrorMessages",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;if(e)return b()(t,v)[e];var n=[];for(var r in b()(t,v))b()(t,v).hasOwnProperty(r)&&n.concat(b()(t,v)[r]);return n}),d()(this,"getErrorMessage",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return e=e||t.getErrorCode(),t.getErrorMessages(e)[0]}),d()(this,"getErrorData",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return e=e||t.getErrorCode(),b()(t,g)[e]}),d()(this,"getAllErrorMessages",function(){var e=[];for(var n in b()(t,v))b()(t,v).hasOwnProperty(n)&&e.push.apply(e,o()(b()(t,v)[n]));return e}),n&&(r&&(b()(this,v)[n]=[r]),i&&(b()(this,g)[n]=i))}return u()(e,null,[{key:"fromPHPObject",value:function(t){var n=new e;return f()(n,v,t.errors),f()(n,g,t.error_data),n}},{key:"fromApiError",value:function(t){var n=new e;if(b()(n,v)[t.code]=[t.message],b()(n,g)[t.code]=t.data,t.additional_errors){var r=!0,i=!1,o=void 0;try{for(var s,c=t.additional_errors[Symbol.iterator]();!(r=(s=c.next()).done);r=!0){var a=s.value;b()(n,v)[a.code]=[a.message],b()(n,g)[a.code]=a.data}}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}}return n}}]),e}(),v=new WeakMap,g=new WeakMap,y=n("a1gu"),O=n.n(y),E=n("Nsbk"),j=n.n(E),_=n("7W2i"),w=n.n(_),S=n("PJYZ"),k=n.n(S),I=n("oShl"),x=n.n(I),N=n("l3Sj"),C=function(e){function t(e){var n,r;c()(this,t);for(var i=arguments.length,o=new Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];for(var a in r=O()(this,(n=j()(t)).call.apply(n,[this,e.message||Object(N.__)("An unknown error occurred.","better-wp-security")].concat(o))),Error.captureStackTrace&&Error.captureStackTrace(k()(k()(r)),t),r.__response=e,e)e.hasOwnProperty(a)&&Object.defineProperty(k()(k()(r)),a,{value:e[a],configurable:!0,enumerable:!0,writable:!0});return r}return w()(t,e),u()(t,[{key:"toString",value:function(){return this.__response.toString()}},{key:"getResponse",value:function(){return this.__response}}]),t}(x()(Error));function T(e){if(!Object(r.isPlainObject)(e))return!1;var t=Object.keys(e);return 2===t.length&&(t.includes("errors")&&t.includes("error_data"))}function R(e){return T(e)?m.fromPHPObject(e):function(e){if(!Object(r.isPlainObject)(e))return!1;var t=Object.keys(e);return(3===t.length||4===t.length)&&!(4===t.length&&!t.includes("additional_errors"))&&t.includes("code")&&t.includes("message")&&t.includes("data")}(e)?m.fromApiError(e):new m}function L(e,t){var n=[[],[]],r=!0,i=!1,o=void 0;try{for(var s,c=e[Symbol.iterator]();!(r=(s=c.next()).done);r=!0){var a=s.value;n[t(a)?0:1].push(a)}}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}function P(e){if(e instanceof Error)throw e;throw new C(e)}n.d(t,"d",function(){return T}),n.d(t,"b",function(){return R}),n.d(t,"a",function(){return L}),n.d(t,"e",function(){return P}),n.d(t,"c",function(){return G});function G(e,t){if(e&&e.links){var n=!0,r=!1,i=void 0;try{for(var o,s=e.links[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var c=o.value;if(c.rel===t)return c}}catch(e){r=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(r)throw i}}}}},W8MJ:function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}},WbBG:function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},XO7p:function(e,t,n){},Xvx9:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n("cDcd"),o=(r=i)&&r.__esModule?r:{default:r};var s=function(e,t){return e.toString()+"\n\nThis is located at:"+t},c=function(e){var t=e.componentStack,n=e.error;return o.default.createElement("div",{style:a,title:s(n,t)},o.default.createElement("svg",{style:u,viewBox:"0 0 24 24",preserveAspectRatio:"xMidYMid"},o.default.createElement("path",{d:"M20,12A8,8 0 0,0 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,\n 12M22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2A10,10 0 0,1 22,\n 12M15.5,8C16.3,8 17,8.7 17,9.5C17,10.3 16.3,11 15.5,11C14.7,11 14,10.3 14,\n 9.5C14,8.7 14.7,8 15.5,8M10,9.5C10,10.3 9.3,11 8.5,11C7.7,11 7,10.3 7,9.5C7,\n 8.7 7.7,8 8.5,8C9.3,8 10,8.7 10,9.5M12,14C13.75,14 15.29,14.72 16.19,\n 15.81L14.77,17.23C14.32,16.5 13.25,16 12,16C10.75,16 9.68,16.5 9.23,\n 17.23L7.81,15.81C8.71,14.72 10.25,14 12,14Z"})))};c.propTypes={componentStack:n("17x9").string.isRequired,error:"function"==typeof Error?n("17x9").instanceOf(Error).isRequired:n("17x9").any.isRequired};var a={height:"100%",maxHeight:"100vh",width:"100%",maxWidth:"100vw",display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center",backgroundColor:"#C00",color:"#FFF",boxSizing:"border-box",cursor:"help"},u={fill:"currentColor",flex:"1 1 auto"};t.default=c},Y0od:function(e,t,n){},Y8OO:function(e,t){!function(){e.exports=this.wp.domReady}()},YLtl:function(e,t){!function(){e.exports=this.lodash}()},ZRc3:function(e,t,n){},a1gu:function(e,t,n){var r=n("cDf5"),i=n("PJYZ");e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?i(e):t}},"bJT+":function(e,t,n){},cDcd:function(e,t){!function(){e.exports=this.React}()},cDf5:function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(t){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?e.exports=r=function(e){return n(e)}:e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)},r(t)}e.exports=r},epig:function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"getUser",function(){return w}),n.d(r,"getIndex",function(){return S}),n.d(r,"getSchema",function(){return k}),n.d(r,"getRoles",function(){return I});var i={};n.r(i),n.d(i,"fetchIndex",function(){return N}),n.d(i,"receiveIndex",function(){return C}),n.d(i,"receiveUser",function(){return T}),n.d(i,"RECEIVE_INDEX",function(){return R}),n.d(i,"RECEIVE_USER",function(){return L});var o={};n.r(o),n.d(o,"getIndex",function(){return G}),n.d(o,"getUser",function(){return A});var s={};n.r(s),n.d(s,"selectGroup",function(){return ze}),n.d(s,"editGroup",function(){return Je}),n.d(s,"saveGroup",function(){return Ye}),n.d(s,"resetEdits",function(){return Ze}),n.d(s,"createGroup",function(){return Xe}),n.d(s,"editGroupSetting",function(){return Qe}),n.d(s,"saveGroupSettings",function(){return et}),n.d(s,"bulkEditGroupSetting",function(){return tt}),n.d(s,"resetBulkGroupSettingEdit",function(){return nt}),n.d(s,"resetBulkGroupSettingEdits",function(){return rt}),n.d(s,"saveBulkEdits",function(){return it}),n.d(s,"SELECT_GROUP",function(){return ot}),n.d(s,"EDIT_GROUP",function(){return st}),n.d(s,"RESET_EDITS",function(){return ct}),n.d(s,"START_SAVE_GROUP",function(){return at}),n.d(s,"FINISH_SAVE_GROUP",function(){return ut}),n.d(s,"FAILED_SAVE_GROUP",function(){return lt}),n.d(s,"START_CREATE_GROUP",function(){return dt}),n.d(s,"FINISH_CREATE_GROUP",function(){return pt}),n.d(s,"FAILED_CREATE_GROUP",function(){return ft}),n.d(s,"EDIT_GROUP_SETTING",function(){return ht}),n.d(s,"START_SAVE_GROUP_SETTINGS",function(){return bt}),n.d(s,"FINISH_SAVE_GROUP_SETTINGS",function(){return mt}),n.d(s,"FAILED_SAVE_GROUP_SETTINGS",function(){return vt}),n.d(s,"BULK_EDIT_GROUP_SETTING",function(){return gt}),n.d(s,"RESET_BULK_GROUP_SETTING_EDIT",function(){return yt}),n.d(s,"RESET_BULK_GROUP_SETTING_EDITS",function(){return Ot});var c={};n.r(c),n.d(c,"getSelectedGroup",function(){return Et}),n.d(c,"isCreating",function(){return jt}),n.d(c,"getEditedGroup",function(){return _t}),n.d(c,"getEditedGroupAttribute",function(){return wt}),n.d(c,"hasEdits",function(){return St}),n.d(c,"settingHasEdits",function(){return kt}),n.d(c,"getEditedGroupSettings",function(){return It}),n.d(c,"getEditedGroupSetting",function(){return xt}),n.d(c,"hasBulkSettingEdits",function(){return Nt}),n.d(c,"getBulkSettingEdits",function(){return Ct}),n.d(c,"getBulkSettingEdit",function(){return Tt}),n.d(c,"getBulkSettingValue",function(){return Rt}),n.d(c,"isSavingBulkEdits",function(){return Lt}),n.d(c,"getAvailableGroups",function(){return Pt});var a={};n.r(a),n.d(a,"getAvailableGroups",function(){return At});var u=n("GRId"),l=n("l3Sj"),d=n("Y8OO"),p=n.n(d),f=(n("onLe"),n("1ZqX")),h=n("RIqP"),b=n.n(h),m=n("MVZn"),v=n.n(m),g=n("YLtl"),y=n("ywyh"),O=n.n(y),E=n("Td6G");function j(e){return{type:"API_FETCH",request:e}}var _={API_FETCH:function(e){var t=e.request;return O()(t).catch(E.e)},SELECT:function(e){var t=e.storeKey,n=e.selectorName,r=e.args,i=Object(f.select)(t)[n];return i.hasResolver?function(e){var t=e.storeKey,n=e.selectorName,r=e.args;return new Promise(function(e){var i=function(){return Object(f.select)("core/data").hasFinishedResolution(t,n,r)},o=function(){return Object(f.select)(t)[n].apply(null,r)},s=o();if(i())return e(s);var c=Object(f.subscribe)(function(){i()&&(c(),e(o()))})})}({storeKey:t,selectorName:n,args:r}):i.apply(void 0,b()(r))},DISPATCH:function(e){var t,n=e.storeKey,r=e.actionName,i=e.args;return(t=Object(f.dispatch)(n))[r].apply(t,b()(i))},CREATE_NOTICE:function(e){var t=e.status,n=e.content,r=e.options;r.autoDismiss&&(r.id=r.id||Object(g.uniqueId)("itsec-auto-dismiss-"),setTimeout(function(){return Object(f.dispatch)("core/notices").removeNotice(r.id,r.context)},r.autoDismiss)),Object(f.dispatch)("core/notices").createNotice(t,n,r)}};function w(e,t){return e.users.byId[t]}function S(e){return e.index}function k(e,t){var n=Object(f.select)("ithemes-security/core").getIndex();if(!n)return null;for(var r in n.routes)if(n.routes.hasOwnProperty(r)){var i=n.routes[r].schema;if(i&&i.title===t)return i}return null}function I(){var e=Object(f.select)("ithemes-security/core").getIndex();return e?e.roles:null}var x=regeneratorRuntime.mark(N);function N(){var e,t,n,r=arguments;return regeneratorRuntime.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return e=r.length>0&&void 0!==r[0]&&r[0],t="/ithemes-security/v1?context=help",e&&(t+="&_="+Date.now()),i.next=5,j({path:t});case 5:return n=i.sent,i.next=8,C(n);case 8:return i.abrupt("return",n);case 9:case"end":return i.stop()}},x,this)}function C(e){return{type:R,index:e}}function T(e){return{type:L,user:e}}var R="RECEIVE_INDEX",L="RECEIVE_USER",P=regeneratorRuntime.mark(G);function G(){var e;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,j({path:"/ithemes-security/v1?context=help"});case 2:return e=t.sent,t.next=5,C(e);case 5:case"end":return t.stop()}},P,this)}var A={fulfill:regeneratorRuntime.mark(function e(t){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,j({path:"/wp/v2/users/".concat(t)});case 2:return n=e.sent,e.next=5,T(n);case 5:case"end":return e.stop()}},e,this)}),isFulfilled:function(e,t){return!!e.users.byId[t]}},D=n("lSNA"),M=n.n(D),B={users:{byId:{}},index:null};Object(f.registerStore)("ithemes-security/core",{controls:_,selectors:r,resolvers:o,actions:i,reducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:B,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case R:return v()({},e,{index:t.index});case L:return v()({},e,{users:v()({},e.users,{byId:v()({},e.users.byId,M()({},t.user.id,t.user))})});default:return e}}});n("sPxh");var U=n("lwsE"),H=n.n(U),V=n("W8MJ"),F=n.n(V),K=n("a1gu"),W=n.n(K),$=n("Nsbk"),q=n.n($),z=n("7W2i"),J=n.n(z),Y=n("PJYZ"),Z=n.n(Y),X=n("tI+e");n("6ECA");function Q(e,t,n){if(e!==t)throw new TypeError("Private static access of wrong provenance");return n.value}u.Component;var ee={writable:!0,value:{}},te=n("TSYQ"),ne=n.n(te),re=n("K9lf");Object(re.compose)([Object(re.withState)({isShowing:!1}),re.withInstanceId])(function(e){var t,n=e.type,r=e.status,i=e.description,o=e.isShowing,s=e.setState,c=e.instanceId,a=e.children;switch(r){case"clean":t=Object(l.__)("Clean","better-wp-security");break;case"warn":t=Object(l.__)("Warn","better-wp-security");break;case"error":t=Object(l.__)("Error","better-wp-security");break;default:t=r}var d=Object(u.createElement)("span",{className:"itsec-malware-scan-".concat(r)},t);return Object(u.createElement)("div",{className:ne()("itsec-malware-scan-results-section","itsec-malware-scan-results-".concat(n,"-section"))},Object(g.isEmpty)(a)?Object(u.createElement)("p",null,d," ",i):Object(u.createElement)(u.Fragment,null,Object(u.createElement)("p",null,d,i,Object(u.createElement)(X.Button,{isLink:!0,className:"itsec-malware-scan-toggle-details",onClick:function(){return s({isShowing:!o})},"aria-expanded":o,"aria-controls":"itsec-malware-scan-details--".concat(c)},o?Object(l.__)("Hide Details","better-wp-security"):Object(l.__)("Show Details","better-wp-security"))),Object(u.createElement)("div",{className:"itsec-malware-scan-details",id:"itsec-malware-scan-details--".concat(c),style:{display:o?"block":"none"}},a)))});var ie=n("J4zp"),oe=n.n(ie);n("rmEH");n("A6yB");function se(e){var t=e.id,n=e.isVisible,r=e.children;return Object(u.createElement)("div",{className:"itsec-site-scan__details",id:t,style:{display:n?"block":"none"}},Object(u.createElement)("ul",null,r))}Object(re.compose)([Object(re.withState)({isShowing:!1}),re.withInstanceId])(function(e){var t,n=e.type,r=e.status,i=e.description,o=e.isShowing,s=e.setState,c=e.instanceId,a=e.children;switch(r){case"clean":t=Object(l.__)("Clean","better-wp-security");break;case"warn":t=Object(l.__)("Warn","better-wp-security");break;case"error":t=Object(l.__)("Error","better-wp-security");break;default:t=r}var d=Object(u.createElement)("span",{className:"itsec-site-scan__status itsec-site-scan__status--".concat(r)},t);return Object(u.createElement)("div",{className:ne()("itsec-site-scan-results-section","itsec-site-scan-results-".concat(n,"-section"))},Object(g.isEmpty)(a)?Object(u.createElement)("p",null,d," ",i):Object(u.createElement)(u.Fragment,null,Object(u.createElement)("p",null,d,i,Object(u.createElement)(X.Button,{isLink:!0,className:"itsec-site-scan-toggle-details",onClick:function(){return s({isShowing:!o})},"aria-expanded":o,"aria-controls":"itsec-site-scan__details--".concat(c)},o?Object(l.__)("Hide Details","better-wp-security"):Object(l.__)("Show Details","better-wp-security"))),Object(u.createElement)(se,{id:"itsec-site-scan__details--".concat(c),isVisible:o},a)))});var ce=n("4eJC"),ae=n.n(ce);ae()(function(e){return b()(e).sort(function(e,t){return"blacklisted"===e.status&&"blacklisted"!==t.status?-1:"blacklisted"!==e.status&&"blacklisted"===t.status?1:0})});n("oaS/");n("bJT+");var ue=n("QILm"),le=n.n(ue),de=n("cDcd"),pe=n("urxu"),fe=n.n(pe),he=Object(de.lazy)(function(){return n.e(8).then(n.t.bind(null,"H0AD",7))});function be(){return Object(u.createElement)("span",null,Object(l.__)("Error when loading. Please refresh.","better-wp-security"))}function me(e){var t=e.addErrorBoundary,n=void 0===t||t,r=le()(e,["addErrorBoundary"]),i=Object(u.createElement)(de.Suspense,{fallback:Object(u.createElement)(X.Spinner,null)},Object(u.createElement)(he,r));return n?Object(u.createElement)(fe.a,{FallbackComponent:be},i):i}var ve=function(){},ge=function(e){function t(e){var n;return H()(this,t),(n=W()(this,q()(t).call(this,e))).state={isHovering:!1},n.onMouseEnter=n.onMouseEnter.bind(Z()(Z()(n))),n.onMouseLeave=n.onMouseLeave.bind(Z()(Z()(n))),n.onMouseOver=n.onMouseOver.bind(Z()(Z()(n))),n.onMouseOut=n.onMouseOut.bind(Z()(Z()(n))),n.setIsHovering=n.setIsHovering.bind(Z()(Z()(n))),n.unsetIsHovering=n.unsetIsHovering.bind(Z()(Z()(n))),n.componentWillUnmount=n.componentWillUnmount.bind(Z()(Z()(n))),n.timerIds=[],n}return J()(t,e),F()(t,[{key:"onMouseEnter",value:function(e){this.props.onMouseEnter({e:e,setIsHovering:this.setIsHovering,unsetIsHovering:this.unsetIsHovering})}},{key:"onMouseLeave",value:function(e){this.props.onMouseLeave({e:e,setIsHovering:this.setIsHovering,unsetIsHovering:this.unsetIsHovering})}},{key:"onMouseOver",value:function(e){this.props.onMouseOver({e:e,setIsHovering:this.setIsHovering,unsetIsHovering:this.unsetIsHovering})}},{key:"onMouseOut",value:function(e){this.props.onMouseOut({e:e,setIsHovering:this.setIsHovering,unsetIsHovering:this.unsetIsHovering})}},{key:"componentWillUnmount",value:function(){this.clearTimers()}},{key:"setIsHovering",value:function(){var e=this;this.clearTimers();var t=setTimeout(function(){var t={isHovering:!0};e.setState(t,function(){e.props.onHoverChanged(t)})},this.props.hoverDelayInMs);this.timerIds.push(t)}},{key:"unsetIsHovering",value:function(){var e=this;this.clearTimers();var t=setTimeout(function(){var t={isHovering:!1};e.setState(t,function(){e.props.onHoverChanged(t)})},this.props.hoverOffDelayInMs);this.timerIds.push(t)}},{key:"clearTimers",value:function(){for(var e=this.timerIds;e.length;)clearTimeout(e.pop())}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.className;return Object(u.createElement)("div",{className:n,onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,onMouseOver:this.onMouseOver,onMouseOut:this.onMouseOut},t)}}]),t}(u.Component);M()(ge,"displayName","HoverDetector"),M()(ge,"defaultProps",{hoverDelayInMs:0,hoverOffDelayInMs:0,onHoverChanged:ve,onMouseEnter:function(e){return(0,e.setIsHovering)()},onMouseLeave:function(e){return(0,e.unsetIsHovering)()},onMouseOver:ve,onMouseOut:ve,shouldDecorateChildren:!0});n("QxRw");n("JVTk"),n("lSb6");var ye=n("pVnL"),Oe=n.n(ye);n("Dfre");var Ee=Symbol.iterator,je=function(){function e(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];H()(this,e),M()(this,"tree",void 0),M()(this,"name",void 0),M()(this,"data",void 0),M()(this,"parent",void 0),M()(this,"children",void 0),this.tree=t,this.name=n,this.data=r,this.parent=i,this.children=o}return F()(e,[{key:"getParent",value:function(){return this.parent?this.tree.nodes[this.parent]:null}},{key:"getAllParents",value:function(){for(var e=[],t=this.getParent();t;)e.push(t.name),t=t.getParent();return e}},{key:"hasChildren",value:function(){return this.children.length>0}},{key:"getAllChildren",value:function(){var e=[];if(!this.hasChildren())return e;var t=!0,n=!1,r=void 0;try{for(var i,o=this[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var s=i.value;e.push.apply(e,[s.name].concat(b()(s.getAllChildren())))}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}return e}},{key:Ee,value:regeneratorRuntime.mark(function e(){var t,n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t=0;case 1:if(!(t<this.children.length)){e.next=8;break}return n=this.children[t],e.next=5,this.tree.nodes[n];case 5:t++,e.next=1;break;case 8:case"end":return e.stop()}},e,this)})}]),e}(),_e=Symbol.iterator,we=function(){function e(){H()(this,e),M()(this,"nodes",{}),M()(this,"ordered",[])}return F()(e,[{key:"add",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this.ordered.push(e),this.nodes[e]?(this.nodes[e].data=t,this.nodes[e].parent=n):this.nodes[e]=new je(this,e,t,n),n&&(this.nodes[n]?this.nodes[n].children.push(e):this.nodes[n]=new je(this,n))}},{key:_e,value:regeneratorRuntime.mark(function e(){var t,n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t=0;case 1:if(!(t<this.ordered.length)){e.next=9;break}if(n=this.ordered[t],this.nodes[n].parent){e.next=6;break}return e.next=6,this.nodes[n];case 6:t++,e.next=1;break;case 9:case"end":return e.stop()}},e,this)})}]),e}(),Se=ae()(function(e){var t=new we,n=!0,r=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var c=o.value;t.add(c.value,c,c.parent)}}catch(e){r=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(r)throw i}}return t}),ke=function(e){function t(){var e;return H()(this,t),e=W()(this,q()(t).apply(this,arguments)),M()(Z()(Z()(e)),"props",void 0),e.renderOption=e.renderOption.bind(Z()(Z()(e))),e.isChecked=e.isChecked.bind(Z()(Z()(e))),e.isIndeterminate=e.isIndeterminate.bind(Z()(Z()(e))),e.onChange=e.onChange.bind(Z()(Z()(e))),e}return J()(t,e),F()(t,[{key:"indeterminate",value:function(e){e.indeterminate=!0}},{key:"isChecked",value:function(e){return!!e&&(Object(g.isArray)(this.props.value)?this.props.value.includes(e.name)||this.isChecked(e.getParent()):this.props.value[e.name]||this.isChecked(e.getParent()))}},{key:"isIndeterminate",value:function(e){if(!e.hasChildren())return!1;var t=!0,n=!1,r=void 0;try{for(var i,o=e[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var s=i.value;if(this.isChecked(s))return!0;if(this.isIndeterminate(s))return!0}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}return!1}},{key:"onChange",value:function(e,t){var n,r=[e.name].concat(b()(e.getAllChildren())),i=t?[]:e.getAllParents();Object(g.isArray)(this.props.value)?(n=t?b()(this.props.value).concat(b()(r)):this.props.value.filter(function(e){return!r.includes(e)&&!i.includes(e)}),this.props.onChange(n)):this.props.onChange(v()({},this.props.value,r.reduce(function(e,n){return e[n]=t},{}),i.reduce(function(e,t){return e[t]=!1},{})))}},{key:"render",value:function(){var e=this.props,t=e.label,n=e.help,r=e.options,i=Se(r);return Object(u.createElement)("fieldset",{className:"components-base-control"},Object(u.createElement)("div",{className:"components-base-control__field"},Object(u.createElement)("legend",{className:"components-base-control__label"},t),n&&Object(u.createElement)("p",{className:"components-base-control__help"},n)),Object(u.createElement)("ul",{className:"components-hierarchical-checkbox-control__group"},Array.from(i,this.renderOption)))}},{key:"renderOption",value:function(e){var t=this,n=e.data,r=n.value,i=n.selectable,o=void 0===i||i,s=le()(n,["value","selectable"]),c=this.isChecked(e),a=!c&&this.isIndeterminate(e);return Object(u.createElement)("li",{key:r,className:ne()("components-hierarchical-checkbox-control__option",{"components-hierarchical-checkbox-control__option--has-children":e.hasChildren()})},Object(u.createElement)(Ce,Oe()({},s,{checked:!!o&&c,disabled:!o||this.props.disabled,indeterminate:a,onChange:function(n){return t.onChange(e,n)}})),e.hasChildren()&&Object(u.createElement)("ul",{className:"components-hierarchical-checkbox-control__group"},Array.from(e,this.renderOption)))}}]),t}(u.Component);Object(re.compose)([Object(f.withSelect)(function(e,t){var n=t.context,r=void 0===n?"ithemes-security":n;return{notices:e("core/notices").getNotices(r)}}),Object(f.withDispatch)(function(e,t){var n=t.context,r=void 0===n?"ithemes-security":n;return{onRemove:function(t){return e("core/notices").removeNotice(t,r)}}})])(function(e){var t=e.notices,n=e.onRemove,r=Object(g.filter)(t,function(e){return e.isDismissible&&(!e.type||"default"===e.type)}),i=Object(g.filter)(t,function(e){return!(e.isDismissible||e.type&&"default"!==e.type)}),o=X.SnackbarList?Object(g.filter)(t,{type:"snackbar"}):[];return Object(u.createElement)(u.Fragment,null,Object(u.createElement)(X.NoticeList,{notices:i,className:"components-editor-notices__pinned"}),Object(u.createElement)(X.NoticeList,{notices:r,className:"components-editor-notices__dismissible",onRemove:n}),X.SnackbarList&&Object(u.createElement)(X.SnackbarList,{notices:o,className:"components-editor-notices__snackbar",onRemove:n}))});var Ie=function(e){var t=e.className,n=e.status,r=e.children,i=e.onRemove,o=void 0===i?g.noop:i,s=e.isDismissible,c=void 0===s||s,a=e.actions,d=void 0===a?[]:a,p=ne()(t,"notice","notice-alt","notice-"+n,{"is-dismissible":c});return Object(u.createElement)("div",{className:p},Object(u.createElement)("p",null,r,d.map(function(e,t){var n=e.className,r=e.label,i=e.onClick,s=e.url,c=e.isLink,a=void 0!==c&&c;return Object(u.createElement)(X.Button,{key:t,href:s,isSmall:!a&&!s,isLink:a||s,onClick:s?void 0:function(){o(),i()},className:ne()("notice__action",n)},r)})),c&&Object(u.createElement)("button",{type:"button",className:"notice-dismiss",onClick:o},Object(u.createElement)("span",{className:"screen-reader-text"},Object(l.__)("Dismiss this notice","better-wp-security"))))};n("+VN0");var xe=Object(re.compose)([Object(f.withSelect)(function(e,t){var n=t.context,r=void 0===n?"ithemes-security":n;return{notices:e("core/notices").getNotices(r)}}),Object(f.withDispatch)(function(e,t){var n=t.context,r=void 0===n?"ithemes-security":n;return{onRemove:function(t){return e("core/notices").removeNotice(t,r)}}})])(function(e){var t,n,r=e.notices,i=e.onRemove,o=function(e){if(!X.SnackbarList)return e.length;var t=0,n=!0,r=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done);n=!0)"snackbar"!==o.value.type&&t++}catch(e){r=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(r)throw i}}return t}(r),s=(t=o,n=Object(u.useRef)(),Object(u.useEffect)(function(){n.current=t}),n.current);Object(u.useEffect)(function(){o>s&&window.itsecSettingsPage&&window.itsecSettingsPage.scrollTop()},[o,s]);var c=X.SnackbarList?Object(g.filter)(r,{type:"snackbar"}):[];return Object(u.createElement)(u.Fragment,null,Object(u.createElement)("div",{className:"itsec-module-settings-notice-list"},r.map(function(e){return"snackbar"===e.type&&X.SnackbarList?null:Object(u.createElement)(Ie,Oe()({},Object(g.omit)(e,["content"]),{key:e.id,onRemove:(t=e.id,function(){return i(t)})}),e.content);var t})),X.SnackbarList&&Object(u.createElement)(X.SnackbarList,{notices:c,className:"components-editor-notices__snackbar",onRemove:i}))}),Ne=(n("DfSy"),function(e){function t(){var e;return H()(this,t),(e=W()(this,q()(t).apply(this,arguments))).onChange=e.onChange.bind(Z()(Z()(e))),e}return J()(t,e),F()(t,[{key:"onChange",value:function(e){this.props.onChange&&this.props.onChange(e.target.checked)}},{key:"render",value:function(){var e,t,n=this.props,r=n.label,i=n.checked,o=n.help,s=n.instanceId,c=le()(n,["label","checked","help","instanceId"]),a="inspector-toggle-control-".concat(s);return o&&(e=a+"__help",t=Object(g.isFunction)(o)?o(i):o),Object(u.createElement)(X.BaseControl,{id:a,help:t,className:"components-toggle-control"},Object(u.createElement)(X.FormToggle,Oe()({},c,{id:a,checked:i,onChange:this.onChange,"aria-describedby":e})),Object(u.createElement)("label",{htmlFor:a,className:"components-toggle-control__label"},r))}}]),t}(u.Component));Object(re.withInstanceId)(Ne),n("IXp0");var Ce=Object(re.withInstanceId)(function(e){var t=e.label,n=e.className,r=e.heading,i=e.checked,o=e.help,s=e.instanceId,c=e.onChange,a=e.indeterminate,l=le()(e,["label","className","heading","checked","help","instanceId","onChange","indeterminate"]),d="inspector-checkbox-control-".concat(s);return Object(u.createElement)(X.BaseControl,{label:r,id:d,help:o,className:n},Object(u.createElement)("span",{className:"components-checkbox-control__input-container"},Object(u.createElement)("input",Oe()({id:d,className:"components-checkbox-control__input",type:"checkbox",value:"1",onChange:function(e){return c(e.target.checked)},checked:i,"aria-describedby":o?d+"__help":void 0,ref:function(e){e&&(e.indeterminate=a)}},l)),i?Object(u.createElement)(X.Dashicon,{icon:"yes",className:"components-checkbox-control__checked",role:"presentation"}):null,a?Object(u.createElement)(X.Dashicon,{icon:"minus",className:"components-checkbox-control__checked components-checkbox-control__checked--indeterminate",role:"presentation"}):null),Object(u.createElement)("label",{className:"components-checkbox-control__label",htmlFor:d},t))});function Te(e){var t=e.tabId,n=e.onClick,r=e.children,i=e.selected,o=le()(e,["tabId","onClick","children","selected"]);return Object(u.createElement)(X.Button,Oe()({role:"tab",tabIndex:i?null:-1,"aria-selected":i,id:t,onClick:n},o),r)}var Re=function(e){function t(){var e;return H()(this,t),(e=W()(this,q()(t).apply(this,arguments))).handleClick=e.handleClick.bind(Z()(Z()(e))),e.onNavigate=e.onNavigate.bind(Z()(Z()(e))),e.onKeyDown=e.onKeyDown.bind(Z()(Z()(e))),e}return J()(t,e),F()(t,[{key:"handleClick",value:function(e){var t=this.props.onSelect;(void 0===t?g.noop:t)(e)}},{key:"onNavigate",value:function(e,t){var n=this.event;n&&"tab"===n.target.getAttribute("role")&&n.preventDefault(),t.click()}},{key:"onKeyDown",value:function(e){this.event=e}},{key:"render",value:function(){var e=this,t=this.props,n=t.activeClass,r=void 0===n?"is-active":n,i=t.className,o=t.instanceId,s=t.orientation,c=void 0===s?"horizontal":s,a=t.tabs,l=t.selected,d=Object(g.find)(a,{name:l})||a[0],p=o+"-"+d.name;return Object(u.createElement)("div",{className:i},Object(u.createElement)(X.NavigableMenu,{role:"tablist",orientation:c,onNavigate:this.onNavigate,onKeyDown:this.onKeyDown,className:"components-tab-panel__tabs"},a.map(function(t){return Object(u.createElement)(Te,{className:ne()(t.className,M()({},r,t.name===d.name)),tabId:o+"-"+t.name,"aria-controls":o+"-"+t.name+"-view",selected:t.name===d.name,key:t.name,onClick:Object(g.partial)(e.handleClick,t.name)},t.title)})),d&&Object(u.createElement)("div",{"aria-labelledby":p,role:"tabpanel",id:p+"-view",className:"components-tab-panel__tab-content",tabIndex:"0"},this.props.children(d)))}}]),t}(u.Component),Le=Object(re.withInstanceId)(Re),Pe=n("rl8x"),Ge=n.n(Pe);Object(re.createHigherOrderComponent)(function(e){var t,n;return n=t=function(t){function n(){var e,t;H()(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=W()(this,(e=q()(n)).call.apply(e,[this].concat(i))),M()(Z()(Z()(t)),"state",{width:1280}),M()(Z()(Z()(t)),"mounted",!1),M()(Z()(Z()(t)),"ref",null),M()(Z()(Z()(t)),"onWindowResize",function(){if(t.mounted){var e=Object(u.findDOMNode)(Z()(Z()(t)));if(e instanceof window.HTMLElement){var n=e.offsetWidth;t.setState({width:n})}}}),t}return J()(n,t),F()(n,[{key:"componentDidMount",value:function(){this.mounted=!0,window.addEventListener("resize",this.onWindowResize),document.getElementById("collapse-button").addEventListener("click",this.onWindowResize),this.onWindowResize()}},{key:"componentWillUnmount",value:function(){this.mounted=!1,window.removeEventListener("resize",this.onWindowResize),document.getElementById("collapse-button").removeEventListener("click",this.onWindowResize)}},{key:"render",value:function(){var t=this.props,n=t.measureBeforeMount,r=le()(t,["measureBeforeMount"]);return n&&!this.mounted?Object(u.createElement)("div",{className:this.props.className,style:this.props.style}):Object(u.createElement)(e,Oe()({},r,{width:this.state.width+20}))}}]),n}(u.Component),M()(t,"defaultProps",{measureBeforeMount:!1}),n},"withWidth");var Ae=Object(re.createHigherOrderComponent)(function(e){return function(t){function n(){var e;return H()(this,n),e=W()(this,q()(n).apply(this,arguments)),M()(Z()(Z()(e)),"state",{pressed:{shift:!1,ctrl:!1,meta:!1,alt:!1}}),M()(Z()(Z()(e)),"mounted",!1),e.listener=e.listener.bind(Z()(Z()(e))),e.onBlur=e.onBlur.bind(Z()(Z()(e))),e}return J()(n,t),F()(n,[{key:"componentDidMount",value:function(){this.mounted=!0,window.addEventListener("keydown",this.listener),window.addEventListener("keyup",this.listener),window.addEventListener("click",this.listener),window.addEventListener("blur",this.onBlur)}},{key:"componentWillUnmount",value:function(){this.mounted=!1,window.removeEventListener("keydown",this.listener),window.removeEventListener("keyup",this.listener),window.removeEventListener("click",this.listener),window.removeEventListener("blur",this.onBlur)}},{key:"listener",value:function(e){this.mounted&&this.setState({pressed:{shift:e.shiftKey,ctrl:e.ctrlKey,meta:e.metaKey,alt:e.altKey}})}},{key:"onBlur",value:function(){this.setState({pressed:{shift:!1,ctrl:!1,meta:!1,alt:!1}})}},{key:"render",value:function(){return Object(u.createElement)(e,Oe()({pressedModifierKeys:this.state.pressed},this.props))}}]),n}(u.Component)},"withPressedModifierKeys"),De=function(e){function t(){var e;return H()(this,t),(e=W()(this,q()(t).apply(this,arguments))).handleClick=e.handleClick.bind(Z()(Z()(e))),e.onNavigate=e.onNavigate.bind(Z()(Z()(e))),e.onKeyDown=e.onKeyDown.bind(Z()(Z()(e))),e.toggleTab=e.toggleTab.bind(Z()(Z()(e))),e.getSelectedTabs=e.getSelectedTabs.bind(Z()(Z()(e))),e.isSelected=e.isSelected.bind(Z()(Z()(e))),e.getSelectedId=e.getSelectedId.bind(Z()(Z()(e))),e.getLabelledBy=e.getLabelledBy.bind(Z()(Z()(e))),e.getTabId=e.getTabId.bind(Z()(Z()(e))),e.getTabPanelId=e.getTabPanelId.bind(Z()(Z()(e))),e.isTabDisabled=e.isTabDisabled.bind(Z()(Z()(e))),e.isNonMultiSelectableTabSelected=e.isNonMultiSelectableTabSelected.bind(Z()(Z()(e))),e}return J()(t,e),F()(t,[{key:"handleClick",value:function(e,t){t.metaKey||t.ctrlKey?this.toggleTab(e):this.props.onSelect([e])}},{key:"onNavigate",value:function(e,t){var n=this.event;if(n){if("tab"===n.target.getAttribute("role")&&n.preventDefault(),n.ctrlKey)return;if(n.shiftKey){if(this.isTabDisabled(this.props.tabs[e]))return;var r=this.props.tabs[e].name;return void this.toggleTab(r)}}t.click()}},{key:"onKeyDown",value:function(e){if(!e.nativeEvent&&(this.event=e,e.ctrlKey&&("Space"===e.code||32===e.keyCode))){e.preventDefault();var t=e.target.dataset.tabname;t&&this.toggleTab(t)}}},{key:"toggleTab",value:function(e){var t=Object(g.find)(this.props.tabs,{name:e});t&&!1===t.allowMultiple||(this.props.selected.includes(e)?this.props.onSelect(this.props.selected.filter(function(t){return t!==e})):this.props.onSelect(b()(this.props.selected).concat([e])))}},{key:"getSelectedTabs",value:function(){var e=this,t=this.props.selected;!t.length&&this.props.initialTab&&t.push(this.props.initialTab);var n=[];return this.props.tabs.forEach(function(t){e.props.selected.includes(t.name)&&n.push(t)}),n}},{key:"isSelected",value:function(e,t){return e.some(function(e){return e.name===t.name})}},{key:"isTabDisabled",value:function(e){var t=this.props.pressedModifierKeys;if(this.props.selected.includes(e.name))return!1;if(!1!==e.allowMultiple&&!this.isNonMultiSelectableTabSelected())return!1;if(t.meta||t.ctrl)return!0;if(t.shift){var n=document.activeElement;if(n.parentElement&&n.parentElement.id==="components-tab-panel__tabs-".concat(this.props.instanceId))return!0}return!1}},{key:"isNonMultiSelectableTabSelected",value:function(){if(1!==this.props.selected.length)return!1;var e=Object(g.find)(this.props.tabs,{name:this.props.selected[0]});return e&&!1===e.allowMultiple}},{key:"getSelectedId",value:function(e){return 1===e.length?this.getTabPanelId(e[0].name):"components-tab-panel__panel-".concat(this.props.instanceId,"-").concat(Object(g.map)(e,"name").join("-"))}},{key:"getLabelledBy",value:function(e){var t=this;return e.map(function(e){return t.getTabId(e.name)}).join(",")}},{key:"getTabId",value:function(e){return"components-tab-panel__tab-".concat(this.props.instanceId,"-").concat(e)}},{key:"getTabPanelId",value:function(e){return"components-tab-panel__panel-".concat(this.props.instanceId,"-").concat(e)}},{key:"componentDidUpdate",value:function(e){if(1===this.props.selected.length&&Ge()(this.props.selected,e.selected)){var t=this.props.selected[0];if(!Object(g.find)(this.props.tabs,{name:t})){var n=Object(g.findIndex)(e.tabs,{name:t});if(-1!==n){var r=Math.max(n-1,0),i=this.props.tabs[r];i&&this.props.onSelect([i.name])}}}}},{key:"render",value:function(){var e=this,t=this.props,n=t.tabs,r=t.className,i=t.activeClass,o=void 0===i?"is-active":i,s=t.orientation,c=void 0===s?"horizontal":s,a=this.getSelectedTabs(),l=this.getSelectedId(a);return Object(u.createElement)("div",{className:r},Object(u.createElement)(X.NavigableMenu,{role:"tablist","aria-multiselectable":!0,orientation:c,onNavigate:this.onNavigate,onKeyDown:this.onKeyDown,className:"components-tab-panel__tabs",id:"components-tab-panel__tabs-".concat(this.props.instanceId)},n.map(function(t){var n=e.isSelected(a,t),r=n&&a.length>1?l:e.getTabPanelId(t.name);return Object(u.createElement)(Te,{className:ne()(t.className,M()({},o,n)),tabId:e.getTabId(t.name),"aria-controls":r,selected:n,disabled:e.isTabDisabled(t),key:t.name,onClick:Object(g.partial)(e.handleClick,t.name),"data-tabname":t.name},t.title)})),a.length>0&&Object(u.createElement)("div",{"aria-labelledby":this.getLabelledBy(a),role:"tabpanel",id:l,className:"components-tab-panel__tab-content",tabIndex:"0"},this.props.children(a)))}}]),t}(u.Component),Me=Object(re.compose)([re.withInstanceId,Ae])(De),Be=function(e){function t(){var e;return H()(this,t),e=W()(this,q()(t).apply(this,arguments)),M()(Z()(Z()(e)),"onSelect",function(t){e.setState({selected:t})}),e.state={selected:e.props.initialTab||""},e}return J()(t,e),F()(t,[{key:"render",value:function(){return Object(u.createElement)(Le,Oe()({},this.props,{selected:this.state.selected,onSelect:this.onSelect}))}}]),t}(u.Component);function Ue(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return{type:"SELECT",storeKey:e,selectorName:t,args:r}}function He(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return{type:"DISPATCH",storeKey:e,actionName:t,args:r}}function Ve(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"info",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return{type:"CREATE_NOTICE",status:e,content:t,options:v()({context:"ithemes-security"},n)}}var Fe={API_FETCH:function(e){var t=e.request;return O()(t).catch(E.e)},SELECT:function(e){var t,n=e.storeKey,r=e.selectorName,i=e.args;return(t=Object(f.select)(n))[r].apply(t,b()(i))},DISPATCH:function(e){var t,n=e.storeKey,r=e.actionName,i=e.args;return(t=Object(f.dispatch)(n))[r].apply(t,b()(i))},CREATE_NOTICE:function(e){var t=e.status,n=e.content,r=e.options;r.autoDismiss&&(r.id=r.id||Object(g.uniqueId)("itsec-auto-dismiss-"),setTimeout(function(){return Object(f.dispatch)("core/notices").removeNotice(r.id,r.context)},r.autoDismiss)),Object(f.dispatch)("core/notices").createNotice(t,n,r)}},Ke=regeneratorRuntime.mark(Ye),We=regeneratorRuntime.mark(Xe),$e=regeneratorRuntime.mark(et),qe=regeneratorRuntime.mark(it);function ze(e){return{type:ot,ids:e}}function Je(e,t){return{type:st,id:e,edit:t}}function Ye(e){var t,n;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,Ue("ithemes-security/user-groups-editor","getEditedGroup",e);case 2:if(t=r.sent){r.next=5;break}return r.abrupt("return");case 5:return r.next=7,{type:at,id:e};case 7:return r.next=9,He("ithemes-security/user-groups","updateGroup",e,t);case 9:if(!((n=r.sent)instanceof Error)){r.next=17;break}return r.next=13,Ve("error",n.message);case 13:return r.next=15,{type:lt,id:e,error:n};case 15:r.next=21;break;case 17:return r.next=19,{type:ut,id:e,updated:n};case 19:return r.next=21,Ve("success",Object(l.__)("Updated group.","better-wp-security"),{type:"snackbar"});case 21:return r.abrupt("return",n);case 22:case"end":return r.stop()}},Ke,this)}function Ze(e){return{type:ct,id:e}}function Xe(){var e,t,n,r=arguments;return regeneratorRuntime.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},i.next=3,Ue("ithemes-security/user-groups-editor","getEditedGroup","new");case 3:if(t=i.sent){i.next=6;break}return i.abrupt("return");case 6:return i.next=8,{type:dt};case 8:return i.next=10,He("ithemes-security/user-groups","createGroup",v()({},t,e));case 10:if(!((n=i.sent)instanceof Error)){i.next=23;break}if("rest_duplicate_user_group"!==n.code){i.next=17;break}return i.next=15,Ve("error",n.message,{actions:[{label:Object(l.__)("View Duplicate","better-wp-security"),isLink:!0,onClick:function(){var e=Object(g.get)(n,["_links","duplicate",0,"href"]).split("/").pop();Object(f.dispatch)("ithemes-security/user-groups-editor").selectGroup([e])}},{label:Object(l.__)("Create Anyway","better-wp-security"),onClick:function(){Object(f.dispatch)("ithemes-security/user-groups-editor").createGroup({ignore_duplicate:!0})}}]});case 15:i.next=19;break;case 17:return i.next=19,Ve("error",n.message);case 19:return i.next=21,{type:ft,error:n};case 21:i.next=31;break;case 23:return i.next=25,Ze("new");case 25:return i.next=27,{type:pt,created:n};case 27:return i.next=29,He("ithemes-security/user-groups-editor","selectGroup",n.id);case 29:return i.next=31,Ve("success",Object(l.__)("Created group.","better-wp-security"),{type:"snackbar"});case 31:return i.abrupt("return",n);case 32:case"end":return i.stop()}},We,this)}function Qe(e,t,n,r){return{type:ht,id:e,module:t,setting:n,value:r}}function et(e){var t,n;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,Ue("ithemes-security/user-groups-editor","getEditedGroupSettings",e);case 2:if(t=r.sent){r.next=5;break}return r.abrupt("return");case 5:return r.next=7,{type:bt,id:e};case 7:return r.next=9,He("ithemes-security/user-groups","updateGroupSettings",e,t);case 9:if(!((n=r.sent)instanceof Error)){r.next=17;break}return r.next=13,Ve("error",n.message);case 13:return r.next=15,{type:vt,id:e,error:n};case 15:r.next=21;break;case 17:return r.next=19,{type:mt,id:e,updated:n};case 19:return r.next=21,Ve("success",Object(l.__)("Updated group settings.","better-wp-security"),{type:"snackbar"});case 21:return r.abrupt("return",n);case 22:case"end":return r.stop()}},$e,this)}function tt(e,t,n){return{type:gt,module:e,setting:t,value:n}}function nt(e,t){return{type:yt,module:e,setting:t}}function rt(){return{type:Ot}}function it(e){var t,n,r,i;return regeneratorRuntime.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,Ue("ithemes-security/user-groups-editor","getBulkSettingEdits");case 2:return t=o.sent,o.next=5,He("ithemes-security/user-groups","patchBulkGroupSettings",e,t);case 5:if(!((n=o.sent)instanceof Error)){o.next=11;break}return o.next=9,Ve("error",n.message);case 9:o.next=25;break;case 11:if(!Object(g.map)(n,"status").every(function(e){return 200===e})){o.next=16;break}return o.next=14,Ve("success",Object(l.__)("Updated group settings.","better-wp-security"),{type:"snackbar"});case 14:o.next=25;break;case 16:if(r=n.filter(function(e){return 200!==e.status}).map(function(e){var t=e.error;return Object(E.b)(t)}),i=r.map(function(e){return e.getAllErrorMessages().join(" ")}).join(" "),r.length!==n.length){o.next=23;break}return o.next=21,Ve("error",i);case 21:o.next=25;break;case 23:return o.next=25,Ve("warning",Object(l.sprintf)(Object(l._n)("%1$d group was not updated: %2$s","%1$d groups were not updated: %2$s",r.length,"better-wp-security"),r.length,i));case 25:return o.next=27,rt();case 27:return o.abrupt("return",n);case 28:case"end":return o.stop()}},qe,this)}var ot="SELECT_GROUP",st="EDIT_GROUP",ct="RESET_EDITS",at="START_SAVE_GROUP",ut="FINISH_SAVE_GROUP",lt="FAILED_SAVE_GROUP",dt="START_CREATE_GROUP",pt="FINISH_CREATE_GROUP",ft="FAILED_CREATE_GROUP",ht="EDIT_GROUP_SETTING",bt="START_SAVE_GROUP_SETTINGS",mt="FINISH_SAVE_GROUP_SETTINGS",vt="FAILED_SAVE_GROUP_SETTINGS",gt="BULK_EDIT_GROUP_SETTING",yt="RESET_BULK_GROUP_SETTING_EDIT",Ot="RESET_BULK_GROUP_SETTING_EDITS";function Et(e){return e.selectedGroup}function jt(e){return e.creating}function _t(e,t){return e.edits[t]}function wt(e,t,n){var r=Object(g.get)(e,["edits",t,n]);return void 0!==r?r:"new"!==t?Object(f.select)("ithemes-security/user-groups").getGroupAttribute(t,n):void 0}function St(e,t){return!!e.edits[t]}function kt(e,t){return!!e.settingEdits[t]}function It(e,t){return e.settingEdits[t]}function xt(e,t,n,r){var i=Object(g.get)(e,["settingEdits",t,n,r]);return void 0!==i?i:Object(f.select)("ithemes-security/user-groups").getGroupSetting(t,n,r)}function Nt(e){return!Object(g.isEmpty)(e.bulkSettingEdits)}function Ct(e){return e.bulkSettingEdits}function Tt(e,t,n){return Object(g.get)(e,["bulkSettingEdits",t,n])}function Rt(e,t,n,r){var i=Tt(e,n,r);if(void 0!==i)return i;var o=function(e){return Object(f.select)("ithemes-security/user-groups").getGroupSetting(e,n,r)},s=o(t[0]);return t.every(function(e){return o(e)===s})?s:null}function Lt(e,t){var n=Ct(e);return Object(f.select)("ithemes-security/user-groups").isBulkPatchingSettings(t,n)}function Pt(){return Object(f.select)("ithemes-security/user-groups").getGroups("available")}var Gt=regeneratorRuntime.mark(At);function At(){var e;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,He("ithemes-security/user-groups","query","available",{_embed:1});case 2:if(!((e=t.sent).length>0)){t.next=6;break}return t.next=6,He("ithemes-security/user-groups-editor","selectGroup",[e[0].id]);case 6:return t.abrupt("return",e);case 7:case"end":return t.stop()}},Gt,this)}var Dt={edits:{},settingEdits:{},bulkSettingEdits:{},creating:!1,selectedGroup:[]};Object(f.registerStore)("ithemes-security/user-groups-editor",{controls:Fe,actions:s,selectors:c,resolvers:a,reducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Dt,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ot:return v()({},e,{selectedGroup:t.ids});case st:return v()({},e,{edits:v()({},e.edits,M()({},t.id,v()({},e.edits[t.id]||{},t.edit)))});case ut:return v()({},e,{edits:Object(g.omit)(e.edits,[t.id])});case ht:return v()({},e,{settingEdits:v()({},e.settingEdits,M()({},t.id,v()({},Object(g.get)(e,["settingEdits",t.id],{}),M()({},t.module,v()({},Object(g.get)(e,["settingEdits",t.id,t.module],{}),M()({},t.setting,t.value))))))});case mt:return v()({},e,{settingEdits:Object(g.omit)(e.settingEdits,[t.id])});case dt:return v()({},e,{creating:!0});case ft:case pt:return v()({},e,{creating:!1});case ct:return v()({},e,{edits:Object(g.omit)(e.edits,[t.id])});case gt:return v()({},e,{bulkSettingEdits:v()({},e.bulkSettingEdits,M()({},t.module,v()({},e.bulkSettingEdits[t.module]||{},M()({},t.setting,t.value))))});case yt:return v()({},e,{bulkSettingEdits:Object(g.omit)(e.bulkSettingEdits,"".concat(t.module,".").concat(t.setting))});case Ot:return v()({},e,{bulkSettingEdits:{}});default:return e}}});function Mt(){return Object(u.createElement)("div",null,Object(u.createElement)(Ut,null))}n("GjY+");var Bt=ae()(function(e){return e.sort(function(e,t){return e.type===t.type?0:"user-group"===e.type?-1:"user-group"===t.type?1:0}).map(function(e){return{name:e.id,title:e.label,className:"itsec-user-groups-list__item",group:e}}).concat({name:"new",title:Object(u.createElement)(u.Fragment,null,Object(u.createElement)(X.Icon,{icon:"plus"}),Object(l.__)("New Group","better-wp-security")),className:"itsec-user-groups-list__item itsec-user-groups-list__item--new",allowMultiple:!1})});var Ut=Object(re.compose)([Object(f.withSelect)(function(e){return{matchables:e("ithemes-security/user-groups").getMatchables(),resolvingMatchables:e("core/data").isResolving("ithemes-security/user-groups","getMatchables"),selectedGroup:e("ithemes-security/user-groups-editor").getSelectedGroup()}}),Object(f.withDispatch)(function(e){return{selectGroup:e("ithemes-security/user-groups-editor").selectGroup}})])(function(e){var t=e.matchables,n=e.resolvingMatchables,r=e.selectedGroup,i=e.selectGroup;if(Object(u.useEffect)(function(){!n&&t.length&&0===r.length&&i([t[0].id])},[n]),n&&!t.length)return null;var o=Bt(t);return Object(u.createElement)(Me,{tabs:o,selected:r,onSelect:i,allowMultiple:!0,orientation:"vertical",className:"itsec-user-groups-list"},function(e){if(e.length>1){var t=Object(g.filter)(e.map(function(e){var t=e.group;return t&&t.id}));return Object(u.createElement)(Kt,{groupIds:t})}return e[0]?Object(u.createElement)(Vt,{groupId:e[0].name,isNew:"new"===e[0].name}):null})}),Ht=(n("Y0od"),ae()(function(e,t){if("new"===e)return[{name:"create",title:Object(l.__)("Edit Group","better-wp-security"),className:"itsec-manage-user-group-tabs__tab",Component:qt}];var n=[{name:"settings",title:Object(l.__)("Features","better-wp-security"),className:"itsec-manage-user-group-tabs__tab",Component:Yt}];return"user-group"===t&&n.push({name:"edit",title:Object(l.__)("Edit Group","better-wp-security"),className:"itsec-manage-user-group-tabs__tab",Component:zt}),n}));var Vt=Object(re.compose)([Object(f.withSelect)(function(e,t){var n=t.groupId;return{type:e("ithemes-security/user-groups").getMatchableType(n)}})])(function(e){var t=e.groupId,n=e.type,r=e.isNew;return Object(u.createElement)("div",{className:"itsec-manage-user-group"},r?Object(u.createElement)(cn,null):Object(u.createElement)(sn,{groupId:t}),Object(u.createElement)(Be,{tabs:Ht(t,n),className:"itsec-manage-user-group-tabs"},function(e){var n=e.Component;return Object(u.createElement)(n,{groupId:t})}))}),Ft=ae()(function(){return[{name:"settings",title:Object(l.__)("Features","better-wp-security"),className:"itsec-manage-user-group-tabs__tab",Component:Xt}]});var Kt=function(e){var t=e.groupIds;return Object(u.createElement)("div",{className:"itsec-manage-multiple-user-groups"},Object(u.createElement)(an,{groupIds:t}),Object(u.createElement)(Be,{tabs:Ft(),className:"itsec-manage-user-group-tabs"},function(e){var n=e.Component;return Object(u.createElement)(n,{groupIds:t})}))};n("QmYb");var Wt=Object(re.compose)([Object(f.withSelect)(function(e,t){var n=t.groupId;return{label:e("ithemes-security/user-groups-editor").getEditedGroupAttribute(n,"label")||""}}),Object(f.withDispatch)(function(e,t){var n=t.groupId;return{edit:function(t){return e("ithemes-security/user-groups-editor").editGroup(n,t)}}})])(function(e){var t=e.label,n=e.edit,r=e.disabled,i=void 0!==r&&r;return Object(u.createElement)(X.TextControl,{label:Object(l.__)("Group Name","better-wp-security"),value:t,maxLength:50,disabled:i,onChange:function(e){return n({label:e})}})});n("ZRc3");function $t(e){var t,n=e.name,r=e.isLoading,i=e.children,o=ne()("itsec-user-groups-group-tab",(t={},M()(t,"itsec-user-groups-group-tab--".concat(n),n),M()(t,"itsec-user-groups-group-tab--is-loading",r),t));return Object(u.createElement)("div",{className:o},i)}$t.Row=function(e){var t=e.name,n=e.children;return Object(u.createElement)("div",{className:"itsec-user-groups-group-tab__row itsec-user-groups-group-tab__row--".concat(t)},n)};var qt=Object(re.compose)([Object(f.withSelect)(function(e){return{hasEdits:e("ithemes-security/user-groups-editor").hasEdits("new"),isSaving:e("ithemes-security/user-groups-editor").isCreating("new")}}),Object(f.withDispatch)(function(e){return{save:function(){e("ithemes-security/user-groups-editor").createGroup()}}})])(function(e){var t=e.hasEdits,n=e.save,r=e.isSaving;return Object(u.createElement)($t,{name:"create-group"},Object(u.createElement)(ln,{groupId:"new"}),Object(u.createElement)($t.Row,{name:"save"},Object(u.createElement)(X.Button,{disabled:!t,isPrimary:!0,onClick:n,isBusy:r},Object(l.__)("Create","better-wp-security"))))});var zt=Object(re.compose)([Object(f.withSelect)(function(e,t){var n=t.groupId;return{isLoading:e("core/data").isResolving("ithemes-security/user-groups","getGroup",[n])||e("core/data").isResolving("ithemes-security/core","getIndex"),hasEdits:e("ithemes-security/user-groups-editor").hasEdits(n),isSaving:e("ithemes-security/user-groups").isUpdating(n)}}),Object(f.withDispatch)(function(e,t){var n=t.groupId;return{save:function(){return e("ithemes-security/user-groups-editor").saveGroup(n)}}})])(function(e){var t=e.groupId,n=e.hasEdits,r=e.save,i=e.isSaving,o=e.isLoading;return Object(u.createElement)($t,{name:"edit-group",isLoading:o},Object(u.createElement)(ln,{groupId:t,disabled:o}),Object(u.createElement)($t.Row,{name:"save"},Object(u.createElement)(X.Button,{disabled:!n,isPrimary:!0,onClick:r,isBusy:i},Object(l.__)("Save","better-wp-security"))))});var Jt=Object(re.compose)([Object(f.withSelect)(function(e,t){var n=t.groupId,r=t.module,i=t.setting;return{value:e("ithemes-security/user-groups-editor").getEditedGroupSetting(n,r,i)}}),Object(f.withDispatch)(function(e,t){var n=t.groupId,r=t.module,i=t.setting;return{edit:function(t){return e("ithemes-security/user-groups-editor").editGroupSetting(n,r,i,t)}}})])(function(e){var t=e.schema,n=e.value,r=e.edit,i=e.disabled,o=void 0!==i&&i;return Object(u.createElement)(X.ToggleControl,{checked:!0===n,label:t.title,help:t.description,disabled:o,onChange:function(e){return r(e)}})});n("GrEf");var Yt=Object(re.compose)([Object(f.withSelect)(function(e,t){var n=t.groupId;return{groupSettings:e("ithemes-security/user-groups").getGroupSettings(n),isLoading:e("core/data").isResolving("ithemes-security/user-groups","getGroupSettings",[n]),schema:e("ithemes-security/core").getSchema("ithemes-security-user-group-settings"),hasEdits:e("ithemes-security/user-groups-editor").settingHasEdits(n),isSaving:e("ithemes-security/user-groups").isUpdatingSettings(n)}}),Object(f.withDispatch)(function(e,t){var n=t.groupId;return{save:function(){return e("ithemes-security/user-groups-editor").saveGroupSettings(n)}}})])(function(e){var t=e.schema,n=e.groupId,r=e.hasEdits,i=e.save,o=e.isSaving,s=e.isLoading;return t?Object(u.createElement)($t,{name:"settings",isLoading:s},Object(u.createElement)($t.Row,null,Object(u.createElement)(dn,{schema:t,settingComponent:Jt,groupId:n,disabled:s})),Object(u.createElement)($t.Row,{name:"save"},Object(u.createElement)(X.Button,{disabled:!r,isPrimary:!0,onClick:i,isBusy:o},Object(l.__)("Save","better-wp-security")))):null});var Zt=Object(re.compose)([Object(f.withSelect)(function(e,t){var n=t.module,r=t.setting,i=t.groupIds;return{value:e("ithemes-security/user-groups-editor").getBulkSettingValue(i,n,r)}}),Object(f.withDispatch)(function(e,t){var n=t.module,r=t.setting;return{edit:function(t){return e("ithemes-security/user-groups-editor").bulkEditGroupSetting(n,r,t)}}})])(function(e){var t=e.schema,n=e.value,r=e.edit,i=e.disabled,o=void 0!==i&&i;return Object(u.createElement)(Ce,{checked:!0===n,indeterminate:null==n,label:t.title,help:t.description,disabled:o,onChange:function(e){return r(e)}})});var Xt=Object(re.compose)([Object(f.withSelect)(function(e,t){var n=t.groupIds;return{schema:e("ithemes-security/core").getSchema("ithemes-security-user-group-settings"),hasEdits:e("ithemes-security/user-groups-editor").hasBulkSettingEdits(),isSaving:e("ithemes-security/user-groups-editor").isSavingBulkEdits(n)}}),Object(f.withDispatch)(function(e,t){var n=t.groupIds;return{save:function(){return e("ithemes-security/user-groups-editor").saveBulkEdits(n)}}})])(function(e){var t=e.schema,n=e.hasEdits,r=e.save,i=e.isSaving,o=e.groupIds;return t?Object(u.createElement)($t,{name:"settings"},Object(u.createElement)($t.Row,null,Object(u.createElement)(dn,{schema:t,settingComponent:Zt,groupIds:o})),Object(u.createElement)($t.Row,{name:"save"},Object(u.createElement)(X.Button,{disabled:!n,isPrimary:!0,onClick:r,isBusy:i},Object(l.__)("Save","better-wp-security")))):null});Object(re.compose)([Object(f.withSelect)(function(e,t){var n=t.groupId;return{minRole:e("ithemes-security/user-groups-editor").getEditedGroupAttribute(n,"min_role")}}),Object(f.withDispatch)(function(e,t){var n=t.groupId;return{onChange:function(t){return e("ithemes-security/user-groups-editor").editGroup(n,t)}}})])(function(e){var t=e.minRole,n=e.onChange;return Object(u.createElement)("div",null,Object(u.createElement)(X.SelectControl,{options:[{value:"administrator",label:Object(l._x)("Administrator","User role","default")},{value:"editor",label:Object(l._x)("Editor","User role","default")},{value:"author",label:Object(l._x)("Author","User role","default")},{value:"contributor",label:Object(l._x)("Contributor","User role","default")},{value:"subscriber",label:Object(l._x)("Subscriber","User role","default")}],label:Object(l.__)("Minimum Role","better-wp-security"),value:t,onChange:function(e){return n({min_role:e})},help:Object(l.__)("Add users with the selected minimum role to this group. To edit roles, go to Users in your WordPress Dashboard.","better-wp-security")}))});var Qt=ae()(function(e,t){var n=[{value:"$administrator$",label:Object(l.__)("Administrator Capabilities","better-wp-security")},{value:"$editor$",label:Object(l.__)("Editor Capabilities","better-wp-security")},{value:"$author$",label:Object(l.__)("Author Capabilities","better-wp-security")},{value:"$contributor$",label:Object(l.__)("Contributor Capabilities","better-wp-security")},{value:"$subscriber$",label:Object(l.__)("Subscriber Capabilities","better-wp-security")}];for(var r in t&&n.unshift({value:"$super-admin$",label:Object(l.__)("Super Admin","better-wp-security")}),Object(g.some)(e,function(e){return""===e.canonical})&&n.push({value:"$other$",label:Object(l.__)("Other","better-wp-security"),selectable:!1}),e)if(e.hasOwnProperty(r)){var i=e[r],o=i.canonical,s=i.label;n.push({value:r,parent:o.length>0?"$".concat(o,"$"):"$other$",label:s})}return Object.values(n)});var en=Object(re.compose)([Object(f.withSelect)(function(e,t){var n=t.groupId;return{roles:e("ithemes-security/user-groups-editor").getEditedGroupAttribute(n,"roles")||[],canonical:e("ithemes-security/user-groups-editor").getEditedGroupAttribute(n,"canonical")||[],available:e("ithemes-security/core").getRoles(),schema:e("ithemes-security/core").getSchema("ithemes-security-user-group")}}),Object(f.withDispatch)(function(e,t){var n=t.groupId;return{onChange:function(t){return e("ithemes-security/user-groups-editor").editGroup(n,t)}}})])(function(e){var t=e.canonical,n=e.roles,r=e.onChange,i=e.available,o=e.schema,s=e.disabled,c=void 0!==s&&s,a=Object(g.get)(o,["properties","canonical","items","enum"],[]).includes("super-admin"),d=b()(n).concat(b()(t.map(function(e){return"$".concat(e,"$")})));return Object(u.createElement)(ke,{label:Object(l.__)("Select Roles","better-wp-security"),help:Object(l.__)("Add users with the selected roles to this group.","better-wp-security"),value:d,disabled:c,options:Qt(i,a),onChange:function(e){var t=Object(E.a)(e,function(e){return e.startsWith("$")&&e.endsWith("$")}),n=oe()(t,2),i=n[0],o=n[1];r({roles:o,canonical:Object(g.without)(i.map(function(e){return e.slice(1,-1)}),"other")})}})}),tn=n("Mmq9");n("ELjz");function nn(e){return{value:e.id,label:e.name,user:e}}var rn=function(e){return new Promise(function(t,n){O()({path:Object(tn.addQueryArgs)("/wp/v2/users",{search:e,per_page:100,context:"embed",itsec_global:!0})}).then(function(e){return e.forEach(Object(f.dispatch)("ithemes-security/core").receiveUser),e}).then(function(e){return t(e.map(nn))}).catch(n)})};var on=Object(re.compose)([Object(re.withState)({selectSearch:""}),Object(f.withSelect)(function(e,t){var n=t.groupId,r=e("ithemes-security/user-groups-editor").getEditedGroupAttribute(n,"users")||[],i=[],o=!1;return r.forEach(function(t){var n=e("ithemes-security/core").getUser(t);n?i.push(n):e("core/data").isResolving("ithemes-security/core","getUser",[t])&&(o=!0)}),{users:i,userIds:r,loading:o}}),Object(f.withDispatch)(function(e,t){var n=t.groupId;return{receiveUser:e("ithemes-security/core").receiveUser,onChange:function(t){return e("ithemes-security/user-groups-editor").editGroup(n,t)}}}),re.withInstanceId])(function(e){var t=e.instanceId,n=e.users,r=e.loading,i=e.onChange,o=e.disabled,s=void 0!==o&&o,c=e.selectSearch,a=e.setState,d="itsec-user-group-panel-users__select-".concat(t),p=r?[]:n.map(nn);return Object(u.createElement)(X.BaseControl,{className:"itsec-user-group-panel-users__select-control",label:Object(l.__)("Select Users","better-wp-security"),help:Object(l.__)("Select specific users to add to this group.","better-wp-security"),id:d},Object(u.createElement)(me,{classNamePrefix:"components-itsec-async-select-control",inputId:d,isDisabled:s||r,isLoading:r,isMulti:!0,cacheOptions:!0,defaultOptions:!0,loadOptions:rn,value:p,onChange:function(e){return i({users:Object(g.map)(e,"value")})},inputValue:c,onInputChange:function(e){return a({selectSearch:e})}}))});n("mzAq");var sn=Object(re.compose)([Object(f.withSelect)(function(e,t){var n,r=t.groupId,i=e("ithemes-security/user-groups").getMatchableType(r),o="user-group"===i&&e("ithemes-security/user-groups").isDeleting(r);return"user-group"===i&&(n=e("ithemes-security/user-groups-editor").getEditedGroupAttribute(r,"label")),void 0===n&&(n=e("ithemes-security/user-groups").getMatchableLabel(r)),{type:i,label:n,isDeleting:o}}),Object(f.withDispatch)(function(e,t){var n=t.groupId;return{deleteGroup:function(){return e("ithemes-security/user-groups").deleteGroup(n)}}})])(function(e){var t=e.type,n=e.label,r=e.isDeleting,i=e.deleteGroup,o="user-group"===t;return n&&n.length||(n=Object(l.__)("Untitled","better-wp-security")),Object(u.createElement)(un,{label:n},o&&Object(u.createElement)(X.Button,{onClick:i,isBusy:r,isLink:!0,isDestructive:!0},Object(l.__)("Delete Group","better-wp-security")))});var cn=Object(re.compose)([Object(f.withSelect)(function(e){return{label:e("ithemes-security/user-groups-editor").getEditedGroupAttribute("new","label")}})])(function(e){var t=e.label;return t&&t.length||(t=Object(l.__)("New Group","better-wp-security")),Object(u.createElement)(un,{label:t})});var an=Object(re.compose)([Object(f.withSelect)(function(e,t){return{label:t.groupIds.map(e("ithemes-security/user-groups").getMatchableLabel).join(", ")}})])(function(e){var t=e.label;return Object(u.createElement)(un,{label:t})});function un(e){var t=e.label,n=e.children;return Object(u.createElement)("div",{className:"itsec-user-group-header"},Object(u.createElement)("h4",{className:"itsec-user-group-header__label"},t),n)}n("XO7p");var ln=function(e){var t=e.groupId,n=e.disabled;return Object(u.createElement)($t.Row,{name:"edit-fields"},Object(u.createElement)(Wt,{groupId:t,disabled:n}),Object(u.createElement)(en,{groupId:t,disabled:n}),Object(u.createElement)(on,{groupId:t,disabled:n}))};function dn(e){var t=e.schema,n=e.settingComponent,r=le()(e,["schema","settingComponent"]);return Object(u.createElement)("ul",{className:"itsec-user-groups-group-tab__modules-list"},Object(g.map)(t.properties,function(e,t){return Object(u.createElement)("li",{key:t},Object(u.createElement)("fieldset",null,Object(u.createElement)("legend",null,e.title),Object(u.createElement)("ul",null,Object(g.map)(e.properties,function(e,i){return Object(u.createElement)("li",{key:i},Object(u.createElement)(n,Oe()({schema:e,module:t,setting:i},r)))}))))}))}n("wM0a");var pn=function(e){var t=e.noticeEl;return Object(u.createElement)("div",{className:"itsec-user-groups-app"},Object(u.createPortal)(Object(u.createElement)(xe,null),t),Object(u.createElement)(Mt,null))};function fn(){var e=document.getElementById("itsec-user-groups-settings-root"),t=document.getElementById("itsec-module-messages-container-user-groups");return Object(u.render)(Object(u.createElement)(pn,{noticeEl:t}),e)}n.p=window.itsecWebpackPublicPath,Object(l.setLocaleData)({"":{}},"ithemes-security-pro"),p()(function(){fn(),window.itsecSettingsPage&&(window.itsecSettingsPage.events.on("modulesReloaded",fn),window.itsecSettingsPage.events.on("moduleReloaded",function(e,t){"user-groups"===t&&fn()}))})},faye:function(e,t){!function(){e.exports=this.ReactDOM}()},l3Sj:function(e,t){!function(){e.exports=this.wp.i18n}()},lSNA:function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},lSb6:function(e,t,n){},lwsE:function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},m0LI:function(e,t){e.exports=function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var s,c=e[Symbol.iterator]();!(r=(s=c.next()).done)&&(n.push(s.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}},mzAq:function(e,t,n){},oShl:function(e,t,n){var r=n("Nsbk"),i=n("SksO"),o=n("xfeJ"),s=n("sXyB");function c(t){var n="function"==typeof Map?new Map:void 0;return e.exports=c=function(e){if(null===e||!o(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return s(e,arguments,r(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),i(t,e)},c(t)}e.exports=c},"oaS/":function(e,t,n){},onLe:function(e,t){!function(){e.exports=this.wp.notices}()},pVnL:function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},n.apply(this,arguments)}e.exports=n},rl8x:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},rmEH:function(e,t){!function(){e.exports=this.wp.htmlEntities}()},sPxh:function(e,t){!function(){e.exports=this.itsec["user-groups"].api}()},sXyB:function(e,t,n){var r=n("SksO");function i(t,n,o){return!function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}()?e.exports=i=function(e,t,n){var i=[null];i.push.apply(i,t);var o=new(Function.bind.apply(e,i));return n&&r(o,n.prototype),o}:e.exports=i=Reflect.construct,i.apply(null,arguments)}e.exports=i},"tI+e":function(e,t){!function(){e.exports=this.wp.components}()},tmk3:function(e,t){e.exports=function(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e).value}},urxu:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorBoundaryFallbackComponent=t.withErrorBoundary=t.ErrorBoundary=void 0;var r=s(n("Xvx9")),i=n("31KZ"),o=s(i);function s(e){return e&&e.__esModule?e:{default:e}}t.default=o.default,t.ErrorBoundary=o.default,t.withErrorBoundary=i.withErrorBoundary,t.ErrorBoundaryFallbackComponent=r.default},wM0a:function(e,t,n){},wTVA:function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},wkBT:function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},xfeJ:function(e,t){e.exports=function(e){return-1!==Function.toString.call(e).indexOf("[native code]")}},ywyh:function(e,t){!function(){e.exports=this.wp.apiFetch}()}});
1
+ this.itsec=this.itsec||{},this.itsec["user-groups"]=this.itsec["user-groups"]||{},this.itsec["user-groups"].settings=function(e){function t(t){for(var r,c,s=t[0],a=t[1],u=t[2],d=0,p=[];d<s.length;d++)c=s[d],i[c]&&p.push(i[c][0]),i[c]=0;for(r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r]);for(l&&l(t);p.length;)p.shift()();return o.push.apply(o,u||[]),n()}function n(){for(var e,t=0;t<o.length;t++){for(var n=o[t],r=!0,s=1;s<n.length;s++){var a=n[s];0!==i[a]&&(r=!1)}r&&(o.splice(t--,1),e=c(c.s=n[0]))}return e}var r={},i={7:0,4:0},o=[];function c(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,c),n.l=!0,n.exports}c.e=function(e){var t=[],n=i[e];if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=i[e]=[t,r]});t.push(n[2]=r);var o,s=document.createElement("script");s.charset="utf-8",s.timeout=120,c.nc&&s.setAttribute("nonce",c.nc),s.src=function(e){return c.p+""+({}[e]||e)+".min.js"}(e),o=function(t){s.onerror=s.onload=null,clearTimeout(a);var n=i[e];if(0!==n){if(n){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src,c=new Error("Loading chunk "+e+" failed.\n("+r+": "+o+")");c.type=r,c.request=o,n[1](c)}i[e]=void 0}};var a=setTimeout(function(){o({type:"timeout",target:s})},12e4);s.onerror=s.onload=o,document.head.appendChild(s)}return Promise.all(t)},c.m=e,c.c=r,c.d=function(e,t,n){c.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},c.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.t=function(e,t){if(1&t&&(e=c(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(c.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)c.d(n,r,function(t){return e[t]}.bind(null,r));return n},c.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(t,"a",t),t},c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},c.p="",c.oe=function(e){throw console.error(e),e};var s=window.itsecWebpackJsonP=window.itsecWebpackJsonP||[],a=s.push.bind(s);s.push=t,s=s.slice();for(var u=0;u<s.length;u++)t(s[u]);var l=a;return o.push(["epig",0]),n()}({"+VN0":function(e,t,n){},"16Al":function(e,t,n){"use strict";var r=n("WbBG");function i(){}e.exports=function(){function e(e,t,n,i,o,c){if(c!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=i,n.PropTypes=n,n}},"17x9":function(e,t,n){e.exports=n("16Al")()},"1ZqX":function(e,t){!function(){e.exports=this.wp.data}()},"31KZ":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.withErrorBoundary=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n("cDcd"),o=s(i),c=s(n("Xvx9"));function s(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var u=n("cDcd").babelPluginFlowReactPropTypes_proptype_ComponentType||n("17x9").any,l=function(e){function t(){var e,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var i=arguments.length,o=Array(i),c=0;c<i;c++)o[c]=arguments[c];return n=r=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(o))),r.state={error:null,info:null},a(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.Component),r(t,[{key:"componentDidCatch",value:function(e,t){var n=this.props.onError;if("function"==typeof n)try{n.call(this,e,t?t.componentStack:"")}catch(e){}this.setState({error:e,info:t})}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.FallbackComponent,r=this.state,i=r.error,c=r.info;return null!==i?o.default.createElement(n,{componentStack:c?c.componentStack:"",error:i}):t}}]),t}();l.defaultProps={FallbackComponent:c.default},l.propTypes={error:"function"==typeof Error?n("17x9").instanceOf(Error):n("17x9").any,info:n("17x9").shape({componentStack:n("17x9").string.isRequired})},(t.withErrorBoundary=function(e,t,n){return function(r){return o.default.createElement(l,{FallbackComponent:t,onError:n},o.default.createElement(e,r))}}).propTypes=u===n("17x9").any?{}:u,t.default=l},"4eJC":function(e,t,n){e.exports=function(e,t){var n,r,i,o=0;function c(){var t,c,s=r,a=arguments.length;e:for(;s;){if(s.args.length===arguments.length){for(c=0;c<a;c++)if(s.args[c]!==arguments[c]){s=s.next;continue e}return s!==r&&(s===i&&(i=s.prev),s.prev.next=s.next,s.next&&(s.next.prev=s.prev),s.next=r,s.prev=null,r.prev=s,r=s),s.val}s=s.next}for(t=new Array(a),c=0;c<a;c++)t[c]=arguments[c];return s={args:t,val:e.apply(null,t)},r?(r.prev=s,s.next=r):i=s,o===n?(i=i.prev).next=null:o++,r=s,s.val}return t&&t.maxSize&&(n=t.maxSize),c.clear=function(){r=null,i=null,o=0},c}},"6ECA":function(e,t,n){},"8OQS":function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}},A6yB:function(e,t,n){},DfSy:function(e,t,n){},Dfre:function(e,t,n){},ELjz:function(e,t,n){},GRId:function(e,t){!function(){e.exports=this.wp.element}()},"GjY+":function(e,t,n){},GrEf:function(e,t,n){},IXp0:function(e,t,n){},JVTk:function(e,t,n){var r=n("cDcd");function i(e){return r.createElement("svg",e,[r.createElement("defs",{key:0},r.createElement("style",null,".itsec-icon-logo-12f8d__path{fill:#1072ba;}.itsec-icon-logo-12f8d__path{fill:#69c;}")),r.createElement("g",{key:1},r.createElement("g",null,[r.createElement("path",{className:"itsec-icon-logo-12f8d__path",d:"M203.28,95V14.26a1.73,1.73,0,0,0-1.11-1.55c-4.38-1.44-21.5-6.6-46.22-8a1.1,1.1,0,0,0-1.17,1.11V20.1a1,1,0,0,1-1.16,1c-8-1.24-16.88-2.29-26.39-3a1.27,1.27,0,0,1-1.17-1.25V3a1.37,1.37,0,0,0-1.16-1.32A211.61,211.61,0,0,0,101,0,178.14,178.14,0,0,0,78.51,1.87a1.4,1.4,0,0,0-1.16,1.35V16.91a1.28,1.28,0,0,1-1.16,1.26c-9.51.72-18.34,1.78-26.38,3a1,1,0,0,1-1.16-1V5.79a1.1,1.1,0,0,0-1.17-1.11c-24.74,1.43-41.94,6.59-46.34,8A1.73,1.73,0,0,0,0,14.26V95s-2.3,54.32,34.61,97.07c32.69,37.86,60,46.91,65.84,48.5a5.16,5.16,0,0,0,2.28,0c5.82-1.58,33.16-10.63,65.83-48.5C205.51,149.35,203.28,95,203.28,95Z",key:0}),r.createElement("path",{className:"itsec-icon-logo-12f8d__path",d:"M101.38,68.5a21.75,21.75,0,1,0,21.7,21.81A21.77,21.77,0,0,0,101.38,68.5Z",key:1}),r.createElement("path",{className:"itsec-icon-logo-12f8d__path",d:"M182.44,87V42.75A1.92,1.92,0,0,0,181,41a385.2,385.2,0,0,0-78.26-8.05h-1.66a398.43,398.43,0,0,0-78.71,8.21,1.9,1.9,0,0,0-1.45,1.78l0,44.2v.24c0,3.27.09,54.82,33.38,93.35,18.71,21.67,35,33.81,46.15,40.44a2.79,2.79,0,0,0,2.56,0c11.14-6.61,27.36-18.74,46.12-40.45C183.22,141.12,182.46,87.63,182.44,87Zm-50.57,79.1c-2.69,3.13-5.32,6-7.87,8.69-.59.61-1.07.41-1.07-.44V155.78c0-14.05,13.64-21.19,18.14-23.17a2.49,2.49,0,0,0,1.42-2.11V116.39a1,1,0,0,0-1.41-.94c-37.93,15.49-72.25,3-79.51,0a.93.93,0,0,0-1.41.91V130.5a2.37,2.37,0,0,0,1.44,2.06c14.94,5.72,18,15.46,18,23.4v18.25c0,.85-.48,1-1.06.43-2.51-2.63-5.09-5.46-7.76-8.53-28.11-32.58-27.95-78.24-27.93-78.7V61.47a1.86,1.86,0,0,1,1.51-1.77,374.15,374.15,0,0,1,56.51-4.51h1.69a364.08,364.08,0,0,1,55.75,4.32,1.86,1.86,0,0,1,1.52,1.78v25.3C159.83,87.44,160.12,133.44,131.87,166.11Z",key:2})]))])}i.defaultProps={width:"200px",viewBox:"0 0 203.31 240.72"},e.exports=i,i.default=i},K9lf:function(e,t){!function(){e.exports=this.wp.compose}()},Mmq9:function(e,t){!function(){e.exports=this.wp.url}()},QILm:function(e,t,n){var r=n("8OQS");e.exports=function(e,t){if(null==e)return{};var n,i,o=r(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(i=0;i<c.length;i++)n=c[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}},QmYb:function(e,t,n){},QxRw:function(e,t,n){},TSYQ:function(e,t,n){
2
  /*!
3
  Copyright (c) 2017 Jed Watson.
4
  Licensed under the MIT License (MIT), see
5
  http://jedwatson.github.io/classnames
6
  */
7
+ !function(){"use strict";var t={}.hasOwnProperty;function n(){for(var e=[],r=0;r<arguments.length;r++){var i=arguments[r];if(i){var o=typeof i;if("string"===o||"number"===o)e.push(i);else if(Array.isArray(i)&&i.length){var c=n.apply(null,i);c&&e.push(c)}else if("object"===o)for(var s in i)t.call(i,s)&&i[s]&&e.push(s)}}return e.join(" ")}e.exports?(n.default=n,e.exports=n):"function"==typeof define&&"object"==typeof define.amd&&define.amd?define("classnames",[],function(){return n}):window.classNames=n}()},Td6G:function(e,t,n){"use strict";n("J4zp");var r=n("YLtl"),i=n("RIqP"),o=n.n(i),c=n("lwsE"),s=n.n(c),a=n("W8MJ"),u=n.n(a),l=n("lSNA"),d=n.n(l),p=n("92Nh"),f=n.n(p),h=n("tmk3"),b=n.n(h);function m(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return v(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return v(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}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,c=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return c=e.done,e},e:function(e){s=!0,o=e},f:function(){try{c||null==n.return||n.return()}finally{if(s)throw o}}}}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var g=new WeakMap,y=new WeakMap,O=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;s()(this,e),g.set(this,{writable:!0,value:{}}),y.set(this,{writable:!0,value:{}}),d()(this,"getErrorCodes",function(){return Object.keys(b()(t,g))}),d()(this,"getErrorCode",function(){return t.getErrorCodes()[0]}),d()(this,"getErrorMessages",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;if(e)return b()(t,g)[e];var n=[];for(var r in b()(t,g))b()(t,g).hasOwnProperty(r)&&n.concat(b()(t,g)[r]);return n}),d()(this,"getErrorMessage",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return e=e||t.getErrorCode(),t.getErrorMessages(e)[0]}),d()(this,"getErrorData",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return e=e||t.getErrorCode(),b()(t,y)[e]}),d()(this,"getAllErrorMessages",function(){var e=[];for(var n in b()(t,g))b()(t,g).hasOwnProperty(n)&&e.push.apply(e,o()(b()(t,g)[n]));return e}),n&&(r&&(b()(this,g)[n]=[r]),i&&(b()(this,y)[n]=i))}return u()(e,null,[{key:"fromPHPObject",value:function(t){var n=new e;return f()(n,g,t.errors),f()(n,y,t.error_data),n}},{key:"fromApiError",value:function(t){var n=new e;if(b()(n,g)[t.code]=[t.message],b()(n,y)[t.code]=t.data,t.additional_errors){var r,i=m(t.additional_errors);try{for(i.s();!(r=i.n()).done;){var o=r.value;b()(n,g)[o.code]=[o.message],b()(n,y)[o.code]=o.data}}catch(e){i.e(e)}finally{i.f()}}return n}}]),e}(),j=n("PJYZ"),E=n.n(j),_=n("7W2i"),w=n.n(_),S=n("a1gu"),I=n.n(S),k=n("Nsbk"),x=n.n(k),N=n("oShl"),C=n.n(N),R=n("l3Sj");function P(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}();return function(){var n,r=x()(e);if(t){var i=x()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return I()(this,n)}}var T=function(e){w()(n,e);var t=P(n);function n(e){var r;s()(this,n);for(var i=arguments.length,o=new Array(i>1?i-1:0),c=1;c<i;c++)o[c-1]=arguments[c];for(var a in r=t.call.apply(t,[this,e.message||Object(R.__)("An unknown error occurred.","better-wp-security")].concat(o)),Error.captureStackTrace&&Error.captureStackTrace(E()(r),n),r.__response=e,e)e.hasOwnProperty(a)&&Object.defineProperty(E()(r),a,{value:e[a],configurable:!0,enumerable:!0,writable:!0});return r}return u()(n,[{key:"toString",value:function(){return this.__response.toString()}},{key:"getResponse",value:function(){return this.__response}}]),n}(C()(Error));function D(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return A(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return A(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}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,c=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return c=e.done,e},e:function(e){s=!0,o=e},f:function(){try{c||null==n.return||n.return()}finally{if(s)throw o}}}}function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function L(e){if(!Object(r.isPlainObject)(e))return!1;var t=Object.keys(e);return 2===t.length&&(t.includes("errors")&&t.includes("error_data"))}function G(e){return L(e)?O.fromPHPObject(e):function(e){if(!Object(r.isPlainObject)(e))return!1;var t=Object.keys(e);return(3===t.length||4===t.length)&&!(4===t.length&&!t.includes("additional_errors"))&&t.includes("code")&&t.includes("message")&&t.includes("data")}(e)?O.fromApiError(e):new O}function M(e,t){var n,r=[[],[]],i=D(e);try{for(i.s();!(n=i.n()).done;){var o=n.value;r[t(o)?0:1].push(o)}}catch(e){i.e(e)}finally{i.f()}return r}function B(e){if(e instanceof Error)throw e;throw new T(e)}n.d(t,"d",function(){return L}),n.d(t,"b",function(){return G}),n.d(t,"a",function(){return M}),n.d(t,"e",function(){return B}),n.d(t,"c",function(){return U});function U(e,t){if(e&&e.links){var n,r=D(e.links);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i.rel===t)return i}}catch(e){r.e(e)}finally{r.f()}}}},WbBG:function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},XO7p:function(e,t,n){},Xvx9:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n("cDcd"),o=(r=i)&&r.__esModule?r:{default:r};var c=function(e,t){return e.toString()+"\n\nThis is located at:"+t},s=function(e){var t=e.componentStack,n=e.error;return o.default.createElement("div",{style:a,title:c(n,t)},o.default.createElement("svg",{style:u,viewBox:"0 0 24 24",preserveAspectRatio:"xMidYMid"},o.default.createElement("path",{d:"M20,12A8,8 0 0,0 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,\n 12M22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2A10,10 0 0,1 22,\n 12M15.5,8C16.3,8 17,8.7 17,9.5C17,10.3 16.3,11 15.5,11C14.7,11 14,10.3 14,\n 9.5C14,8.7 14.7,8 15.5,8M10,9.5C10,10.3 9.3,11 8.5,11C7.7,11 7,10.3 7,9.5C7,\n 8.7 7.7,8 8.5,8C9.3,8 10,8.7 10,9.5M12,14C13.75,14 15.29,14.72 16.19,\n 15.81L14.77,17.23C14.32,16.5 13.25,16 12,16C10.75,16 9.68,16.5 9.23,\n 17.23L7.81,15.81C8.71,14.72 10.25,14 12,14Z"})))};s.propTypes={componentStack:n("17x9").string.isRequired,error:"function"==typeof Error?n("17x9").instanceOf(Error).isRequired:n("17x9").any.isRequired};var a={height:"100%",maxHeight:"100vh",width:"100%",maxWidth:"100vw",display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center",backgroundColor:"#C00",color:"#FFF",boxSizing:"border-box",cursor:"help"},u={fill:"currentColor",flex:"1 1 auto"};t.default=s},Y0od:function(e,t,n){},Y8OO:function(e,t){!function(){e.exports=this.wp.domReady}()},YLtl:function(e,t){!function(){e.exports=this.lodash}()},ZRc3:function(e,t,n){},"bJT+":function(e,t,n){},cDcd:function(e,t){!function(){e.exports=this.React}()},epig:function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"getUser",function(){return w}),n.d(r,"getIndex",function(){return S}),n.d(r,"getSchema",function(){return I}),n.d(r,"getRoles",function(){return k});var i={};n.r(i),n.d(i,"fetchIndex",function(){return R}),n.d(i,"receiveIndex",function(){return P}),n.d(i,"receiveUser",function(){return T}),n.d(i,"RECEIVE_INDEX",function(){return D}),n.d(i,"RECEIVE_USER",function(){return A});var o={};n.r(o),n.d(o,"getIndex",function(){return G}),n.d(o,"getUser",function(){return M});var c={};n.r(c),n.d(c,"selectGroup",function(){return bt}),n.d(c,"editGroup",function(){return mt}),n.d(c,"saveGroup",function(){return vt}),n.d(c,"resetEdits",function(){return gt}),n.d(c,"createGroup",function(){return yt}),n.d(c,"editGroupSetting",function(){return Ot}),n.d(c,"saveGroupSettings",function(){return jt}),n.d(c,"bulkEditGroupSetting",function(){return Et}),n.d(c,"resetBulkGroupSettingEdit",function(){return _t}),n.d(c,"resetBulkGroupSettingEdits",function(){return wt}),n.d(c,"saveBulkEdits",function(){return St}),n.d(c,"SELECT_GROUP",function(){return It}),n.d(c,"EDIT_GROUP",function(){return kt}),n.d(c,"RESET_EDITS",function(){return xt}),n.d(c,"START_SAVE_GROUP",function(){return Nt}),n.d(c,"FINISH_SAVE_GROUP",function(){return Ct}),n.d(c,"FAILED_SAVE_GROUP",function(){return Rt}),n.d(c,"START_CREATE_GROUP",function(){return Pt}),n.d(c,"FINISH_CREATE_GROUP",function(){return Tt}),n.d(c,"FAILED_CREATE_GROUP",function(){return Dt}),n.d(c,"EDIT_GROUP_SETTING",function(){return At}),n.d(c,"START_SAVE_GROUP_SETTINGS",function(){return Lt}),n.d(c,"FINISH_SAVE_GROUP_SETTINGS",function(){return Gt}),n.d(c,"FAILED_SAVE_GROUP_SETTINGS",function(){return Mt}),n.d(c,"BULK_EDIT_GROUP_SETTING",function(){return Bt}),n.d(c,"RESET_BULK_GROUP_SETTING_EDIT",function(){return Ut}),n.d(c,"RESET_BULK_GROUP_SETTING_EDITS",function(){return Ht});var s={};n.r(s),n.d(s,"getSelectedGroup",function(){return Kt}),n.d(s,"isCreating",function(){return Ft}),n.d(s,"getEditedGroup",function(){return Vt}),n.d(s,"getEditedGroupAttribute",function(){return Wt}),n.d(s,"hasEdits",function(){return $t}),n.d(s,"settingHasEdits",function(){return qt}),n.d(s,"getEditedGroupSettings",function(){return zt}),n.d(s,"getEditedGroupSetting",function(){return Yt}),n.d(s,"hasBulkSettingEdits",function(){return Jt}),n.d(s,"getBulkSettingEdits",function(){return Zt}),n.d(s,"getBulkSettingEdit",function(){return Qt}),n.d(s,"getBulkSettingValue",function(){return Xt}),n.d(s,"isSavingBulkEdits",function(){return en}),n.d(s,"getAvailableGroups",function(){return tn});var a={};n.r(a),n.d(a,"getAvailableGroups",function(){return rn});var u=n("GRId"),l=n("l3Sj"),d=n("Y8OO"),p=n.n(d),f=(n("onLe"),n("1ZqX")),h=n("RIqP"),b=n.n(h),m=n("lSNA"),v=n.n(m),g=n("YLtl"),y=n("ywyh"),O=n.n(y),j=n("Td6G");function E(e){return{type:"API_FETCH",request:e}}var _={API_FETCH:function(e){var t=e.request;return O()(t).catch(j.e)},SELECT:function(e){var t=e.storeKey,n=e.selectorName,r=e.args,i=Object(f.select)(t)[n];return i.hasResolver?function(e){var t=e.storeKey,n=e.selectorName,r=e.args;return new Promise(function(e){var i=function(){return Object(f.select)("core/data").hasFinishedResolution(t,n,r)},o=function(){return Object(f.select)(t)[n].apply(null,r)},c=o();if(i())return e(c);var s=Object(f.subscribe)(function(){i()&&(s(),e(o()))})})}({storeKey:t,selectorName:n,args:r}):i.apply(void 0,b()(r))},DISPATCH:function(e){var t,n=e.storeKey,r=e.actionName,i=e.args;return(t=Object(f.dispatch)(n))[r].apply(t,b()(i))},CREATE_NOTICE:function(e){var t=e.status,n=e.content,r=e.options;r.autoDismiss&&(r.id=r.id||Object(g.uniqueId)("itsec-auto-dismiss-"),setTimeout(function(){return Object(f.dispatch)("core/notices").removeNotice(r.id,r.context)},r.autoDismiss)),Object(f.dispatch)("core/notices").createNotice(t,n,r)}};function w(e,t){return e.users.byId[t]}function S(e){return e.index}function I(e,t){var n=Object(f.select)("ithemes-security/core").getIndex();if(!n)return null;for(var r in n.routes)if(n.routes.hasOwnProperty(r)){var i=n.routes[r].schema;if(i&&i.title===t)return i}return null}function k(){var e=Object(f.select)("ithemes-security/core").getIndex();return e?e.roles:null}var x=n("o0o1"),N=n.n(x),C=N.a.mark(R);function R(){var e,t,n,r=arguments;return N.a.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return e=r.length>0&&void 0!==r[0]&&r[0],t="/ithemes-security/v1?context=help",e&&(t+="&_="+Date.now()),i.next=5,E({path:t});case 5:return n=i.sent,i.next=8,P(n);case 8:return i.abrupt("return",n);case 9:case"end":return i.stop()}},C)}function P(e){return{type:D,index:e}}function T(e){return{type:A,user:e}}var D="RECEIVE_INDEX",A="RECEIVE_USER",L=N.a.mark(G);function G(){var e;return N.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,E({path:"/ithemes-security/v1?context=help"});case 2:return e=t.sent,t.next=5,P(e);case 5:case"end":return t.stop()}},L)}var M={fulfill:N.a.mark(function e(t){var n;return N.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,E({path:"/wp/v2/users/".concat(t)});case 2:return n=e.sent,e.next=5,T(n);case 5:case"end":return e.stop()}},e)}),isFulfilled:function(e,t){return!!e.users.byId[t]}};function B(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function U(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?B(Object(n),!0).forEach(function(t){v()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):B(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var H={users:{byId:{}},index:null};Object(f.registerStore)("ithemes-security/core",{controls:_,selectors:r,resolvers:o,actions:i,reducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:H,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case D:return U(U({},e),{},{index:t.index});case A:return U(U({},e),{},{users:U(U({},e.users),{},{byId:U(U({},e.users.byId),{},v()({},t.user.id,t.user))})});default:return e}}});n("sPxh");var K=n("lwsE"),F=n.n(K),V=n("W8MJ"),W=n.n(V),$=n("PJYZ"),q=n.n($),z=n("7W2i"),Y=n.n(z),J=n("a1gu"),Z=n.n(J),Q=n("Nsbk"),X=n.n(Q),ee=n("tI+e");n("6ECA");function te(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}();return function(){var n,r=X()(e);if(t){var i=X()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Z()(this,n)}}function ne(e,t,n){if(e!==t)throw new TypeError("Private static access of wrong provenance");return n.get?n.get.call(e):n.value}u.Component;var re={writable:!0,value:{}},ie=n("TSYQ"),oe=n.n(ie),ce=n("K9lf");Object(ce.compose)([Object(ce.withState)({isShowing:!1}),ce.withInstanceId])(function(e){var t,n=e.type,r=e.status,i=e.description,o=e.isShowing,c=e.setState,s=e.instanceId,a=e.children;switch(r){case"clean":t=Object(l.__)("Clean","better-wp-security");break;case"warn":t=Object(l.__)("Warn","better-wp-security");break;case"error":t=Object(l.__)("Error","better-wp-security");break;default:t=r}var d=Object(u.createElement)("span",{className:"itsec-malware-scan-".concat(r)},t);return Object(u.createElement)("div",{className:oe()("itsec-malware-scan-results-section","itsec-malware-scan-results-".concat(n,"-section"))},Object(g.isEmpty)(a)?Object(u.createElement)("p",null,d," ",i):Object(u.createElement)(u.Fragment,null,Object(u.createElement)("p",null,d,i,Object(u.createElement)(ee.Button,{isLink:!0,className:"itsec-malware-scan-toggle-details",onClick:function(){return c({isShowing:!o})},"aria-expanded":o,"aria-controls":"itsec-malware-scan-details--".concat(s)},o?Object(l.__)("Hide Details","better-wp-security"):Object(l.__)("Show Details","better-wp-security"))),Object(u.createElement)("div",{className:"itsec-malware-scan-details",id:"itsec-malware-scan-details--".concat(s),style:{display:o?"block":"none"}},a)))});var se=n("J4zp"),ae=n.n(se);n("rmEH");n("A6yB");function ue(e){var t=e.id,n=e.isVisible,r=e.children;return Object(u.createElement)("div",{className:"itsec-site-scan__details",id:t,style:{display:n?"block":"none"}},Object(u.createElement)("ul",null,r))}Object(ce.compose)([Object(ce.withState)({isShowing:!1}),ce.withInstanceId])(function(e){var t,n=e.type,r=e.status,i=e.description,o=e.isShowing,c=e.setState,s=e.instanceId,a=e.children;switch(r){case"clean":t=Object(l.__)("Clean","better-wp-security");break;case"warn":t=Object(l.__)("Warn","better-wp-security");break;case"error":t=Object(l.__)("Error","better-wp-security");break;default:t=r}var d=Object(u.createElement)("span",{className:"itsec-site-scan__status itsec-site-scan__status--".concat(r)},t);return Object(u.createElement)("div",{className:oe()("itsec-site-scan-results-section","itsec-site-scan-results-".concat(n,"-section"))},Object(g.isEmpty)(a)?Object(u.createElement)("p",null,d," ",i):Object(u.createElement)(u.Fragment,null,Object(u.createElement)("p",null,d,i,Object(u.createElement)(ee.Button,{isLink:!0,className:"itsec-site-scan-toggle-details",onClick:function(){return c({isShowing:!o})},"aria-expanded":o,"aria-controls":"itsec-site-scan__details--".concat(s)},o?Object(l.__)("Hide Details","better-wp-security"):Object(l.__)("Show Details","better-wp-security"))),Object(u.createElement)(ue,{id:"itsec-site-scan__details--".concat(s),isVisible:o},a)))});n("oaS/");n("bJT+");var le=n("QILm"),de=n.n(le),pe=n("cDcd"),fe=n("urxu"),he=n.n(fe),be=Object(pe.lazy)(function(){return n.e(8).then(n.bind(null,"YK1D"))});function me(){return Object(u.createElement)("span",null,Object(l.__)("Error when loading. Please refresh.","better-wp-security"))}function ve(e){var t=e.addErrorBoundary,n=void 0===t||t,r=de()(e,["addErrorBoundary"]),i=Object(u.createElement)(pe.Suspense,{fallback:Object(u.createElement)(ee.Spinner,null)},Object(u.createElement)(be,r));return n?Object(u.createElement)(he.a,{FallbackComponent:me},i):i}function ge(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}();return function(){var n,r=X()(e);if(t){var i=X()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Z()(this,n)}}var ye=function(){},Oe=function(e){Y()(n,e);var t=ge(n);function n(e){var r;return F()(this,n),(r=t.call(this,e)).state={isHovering:!1},r.onMouseEnter=r.onMouseEnter.bind(q()(r)),r.onMouseLeave=r.onMouseLeave.bind(q()(r)),r.onMouseOver=r.onMouseOver.bind(q()(r)),r.onMouseOut=r.onMouseOut.bind(q()(r)),r.setIsHovering=r.setIsHovering.bind(q()(r)),r.unsetIsHovering=r.unsetIsHovering.bind(q()(r)),r.componentWillUnmount=r.componentWillUnmount.bind(q()(r)),r.timerIds=[],r}return W()(n,[{key:"onMouseEnter",value:function(e){this.props.onMouseEnter({e:e,setIsHovering:this.setIsHovering,unsetIsHovering:this.unsetIsHovering})}},{key:"onMouseLeave",value:function(e){this.props.onMouseLeave({e:e,setIsHovering:this.setIsHovering,unsetIsHovering:this.unsetIsHovering})}},{key:"onMouseOver",value:function(e){this.props.onMouseOver({e:e,setIsHovering:this.setIsHovering,unsetIsHovering:this.unsetIsHovering})}},{key:"onMouseOut",value:function(e){this.props.onMouseOut({e:e,setIsHovering:this.setIsHovering,unsetIsHovering:this.unsetIsHovering})}},{key:"componentWillUnmount",value:function(){this.clearTimers()}},{key:"setIsHovering",value:function(){var e=this;this.clearTimers();var t=setTimeout(function(){var t={isHovering:!0};e.setState(t,function(){e.props.onHoverChanged(t)})},this.props.hoverDelayInMs);this.timerIds.push(t)}},{key:"unsetIsHovering",value:function(){var e=this;this.clearTimers();var t=setTimeout(function(){var t={isHovering:!1};e.setState(t,function(){e.props.onHoverChanged(t)})},this.props.hoverOffDelayInMs);this.timerIds.push(t)}},{key:"clearTimers",value:function(){for(var e=this.timerIds;e.length;)clearTimeout(e.pop())}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.className;return Object(u.createElement)("div",{className:n,onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,onMouseOver:this.onMouseOver,onMouseOut:this.onMouseOut},t)}}]),n}(u.Component);v()(Oe,"displayName","HoverDetector"),v()(Oe,"defaultProps",{hoverDelayInMs:0,hoverOffDelayInMs:0,onHoverChanged:ye,onMouseEnter:function(e){return(0,e.setIsHovering)()},onMouseLeave:function(e){return(0,e.unsetIsHovering)()},onMouseOver:ye,onMouseOut:ye,shouldDecorateChildren:!0});n("QxRw");n("JVTk"),n("lSb6");var je=n("pVnL"),Ee=n.n(je);var _e,we,Se=n("4eJC"),Ie=n.n(Se);n("Dfre");function ke(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function xe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ke(Object(n),!0).forEach(function(t){v()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ke(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ne(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}();return function(){var n,r=X()(e);if(t){var i=X()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Z()(this,n)}}function Ce(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Re(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Re(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}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,c=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return c=e.done,e},e:function(e){s=!0,o=e},f:function(){try{c||null==n.return||n.return()}finally{if(s)throw o}}}}function Re(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}_e=Symbol.iterator;var Pe=function(){function e(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];F()(this,e),v()(this,"tree",void 0),v()(this,"name",void 0),v()(this,"data",void 0),v()(this,"parent",void 0),v()(this,"children",void 0),this.tree=t,this.name=n,this.data=r,this.parent=i,this.children=o}return W()(e,[{key:"getParent",value:function(){return this.parent?this.tree.nodes[this.parent]:null}},{key:"getAllParents",value:function(){for(var e=[],t=this.getParent();t;)e.push(t.name),t=t.getParent();return e}},{key:"hasChildren",value:function(){return this.children.length>0}},{key:"getAllChildren",value:function(){var e=[];if(!this.hasChildren())return e;var t,n=Ce(this);try{for(n.s();!(t=n.n()).done;){var r=t.value;e.push.apply(e,[r.name].concat(b()(r.getAllChildren())))}}catch(e){n.e(e)}finally{n.f()}return e}},{key:_e,value:N.a.mark(function e(){var t,n;return N.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t=0;case 1:if(!(t<this.children.length)){e.next=8;break}return n=this.children[t],e.next=5,this.tree.nodes[n];case 5:t++,e.next=1;break;case 8:case"end":return e.stop()}},e,this)})}]),e}();we=Symbol.iterator;var Te=function(){function e(){F()(this,e),v()(this,"nodes",{}),v()(this,"ordered",[])}return W()(e,[{key:"add",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this.ordered.push(e),this.nodes[e]?(this.nodes[e].data=t,this.nodes[e].parent=n):this.nodes[e]=new Pe(this,e,t,n),n&&(this.nodes[n]?this.nodes[n].children.push(e):this.nodes[n]=new Pe(this,n))}},{key:we,value:N.a.mark(function e(){var t,n;return N.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t=0;case 1:if(!(t<this.ordered.length)){e.next=9;break}if(n=this.ordered[t],this.nodes[n].parent){e.next=6;break}return e.next=6,this.nodes[n];case 6:t++,e.next=1;break;case 9:case"end":return e.stop()}},e,this)})}]),e}(),De=Ie()(function(e){var t,n=new Te,r=Ce(e);try{for(r.s();!(t=r.n()).done;){var i=t.value;n.add(i.value,i,i.parent)}}catch(e){r.e(e)}finally{r.f()}return n}),Ae=function(e){Y()(n,e);var t=Ne(n);function n(){var e;return F()(this,n),e=t.apply(this,arguments),v()(q()(e),"props",void 0),e.renderOption=e.renderOption.bind(q()(e)),e.isChecked=e.isChecked.bind(q()(e)),e.isIndeterminate=e.isIndeterminate.bind(q()(e)),e.onChange=e.onChange.bind(q()(e)),e}return W()(n,[{key:"indeterminate",value:function(e){e.indeterminate=!0}},{key:"isChecked",value:function(e){return!!e&&(Object(g.isArray)(this.props.value)?this.props.value.includes(e.name)||this.isChecked(e.getParent()):this.props.value[e.name]||this.isChecked(e.getParent()))}},{key:"isIndeterminate",value:function(e){if(!e.hasChildren())return!1;var t,n=Ce(e);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(this.isChecked(r))return!0;if(this.isIndeterminate(r))return!0}}catch(e){n.e(e)}finally{n.f()}return!1}},{key:"onChange",value:function(e,t){var n,r=[e.name].concat(b()(e.getAllChildren())),i=t?[]:e.getAllParents();Object(g.isArray)(this.props.value)?(n=t?[].concat(b()(this.props.value),b()(r)):this.props.value.filter(function(e){return!r.includes(e)&&!i.includes(e)}),this.props.onChange(n)):this.props.onChange(xe(xe(xe({},this.props.value),r.reduce(function(e,n){return e[n]=t},{})),i.reduce(function(e,t){return e[t]=!1},{})))}},{key:"render",value:function(){var e=this.props,t=e.label,n=e.help,r=e.options,i=De(r);return Object(u.createElement)("fieldset",{className:"components-base-control"},Object(u.createElement)("div",{className:"components-base-control__field"},Object(u.createElement)("legend",{className:"components-base-control__label"},t),n&&Object(u.createElement)("p",{className:"components-base-control__help"},n)),Object(u.createElement)("ul",{className:"components-hierarchical-checkbox-control__group"},Array.from(i,this.renderOption)))}},{key:"renderOption",value:function(e){var t=this,n=e.data,r=n.value,i=n.selectable,o=void 0===i||i,c=de()(n,["value","selectable"]),s=this.isChecked(e),a=!s&&this.isIndeterminate(e);return Object(u.createElement)("li",{key:r,className:oe()("components-hierarchical-checkbox-control__option",{"components-hierarchical-checkbox-control__option--has-children":e.hasChildren()})},Object(u.createElement)(Ke,Ee()({},c,{checked:!!o&&s,disabled:!o||this.props.disabled,indeterminate:a,onChange:function(n){return t.onChange(e,n)}})),e.hasChildren()&&Object(u.createElement)("ul",{className:"components-hierarchical-checkbox-control__group"},Array.from(e,this.renderOption)))}}]),n}(u.Component);Object(ce.compose)([Object(f.withSelect)(function(e,t){var n=t.context,r=void 0===n?"ithemes-security":n;return{notices:e("core/notices").getNotices(r)}}),Object(f.withDispatch)(function(e,t){var n=t.context,r=void 0===n?"ithemes-security":n;return{onRemove:function(t){return e("core/notices").removeNotice(t,r)}}})])(function(e){var t=e.notices,n=e.onRemove,r=Object(g.filter)(t,function(e){return e.isDismissible&&(!e.type||"default"===e.type)}),i=Object(g.filter)(t,function(e){return!(e.isDismissible||e.type&&"default"!==e.type)}),o=ee.SnackbarList?Object(g.filter)(t,{type:"snackbar"}):[];return Object(u.createElement)(u.Fragment,null,Object(u.createElement)(ee.NoticeList,{notices:i,className:"components-editor-notices__pinned"}),Object(u.createElement)(ee.NoticeList,{notices:r,className:"components-editor-notices__dismissible",onRemove:n}),ee.SnackbarList&&Object(u.createElement)(ee.SnackbarList,{notices:o,className:"components-editor-notices__snackbar",onRemove:n}))});var Le=function(e){var t=e.className,n=e.status,r=e.children,i=e.onRemove,o=void 0===i?g.noop:i,c=e.isDismissible,s=void 0===c||c,a=e.actions,d=void 0===a?[]:a,p=oe()(t,"notice","notice-alt","notice-"+n,{"is-dismissible":s});return Object(u.createElement)("div",{className:p},Object(u.createElement)("p",null,r,d.map(function(e,t){var n=e.className,r=e.label,i=e.onClick,c=e.url,s=e.isLink,a=void 0!==s&&s;return Object(u.createElement)(ee.Button,{key:t,href:c,isSmall:!a&&!c,isLink:a||c,onClick:c?void 0:function(){o(),i()},className:oe()("notice__action",n)},r)})),s&&Object(u.createElement)("button",{type:"button",className:"notice-dismiss",onClick:o},Object(u.createElement)("span",{className:"screen-reader-text"},Object(l.__)("Dismiss this notice","better-wp-security"))))};n("+VN0");function Ge(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Me(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Me(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}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,c=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return c=e.done,e},e:function(e){s=!0,o=e},f:function(){try{c||null==n.return||n.return()}finally{if(s)throw o}}}}function Me(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Be=Object(ce.compose)([Object(f.withSelect)(function(e,t){var n=t.context,r=void 0===n?"ithemes-security":n;return{notices:e("core/notices").getNotices(r)}}),Object(f.withDispatch)(function(e,t){var n=t.context,r=void 0===n?"ithemes-security":n;return{onRemove:function(t){return e("core/notices").removeNotice(t,r)}}})])(function(e){var t,n,r=e.notices,i=e.onRemove,o=function(e){if(!ee.SnackbarList)return e.length;var t,n=0,r=Ge(e);try{for(r.s();!(t=r.n()).done;)"snackbar"!==t.value.type&&n++}catch(e){r.e(e)}finally{r.f()}return n}(r),c=(t=o,n=Object(u.useRef)(),Object(u.useEffect)(function(){n.current=t}),n.current);Object(u.useEffect)(function(){o>c&&window.itsecSettingsPage&&window.itsecSettingsPage.scrollTop()},[o,c]);var s=ee.SnackbarList?Object(g.filter)(r,{type:"snackbar"}):[];return Object(u.createElement)(u.Fragment,null,Object(u.createElement)("div",{className:"itsec-module-settings-notice-list"},r.map(function(e){return"snackbar"===e.type&&ee.SnackbarList?null:Object(u.createElement)(Le,Ee()({},Object(g.omit)(e,["content"]),{key:e.id,onRemove:(t=e.id,function(){return i(t)})}),e.content);var t})),ee.SnackbarList&&Object(u.createElement)(ee.SnackbarList,{notices:s,className:"components-editor-notices__snackbar",onRemove:i}))});n("DfSy");function Ue(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}();return function(){var n,r=X()(e);if(t){var i=X()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Z()(this,n)}}var He=function(e){Y()(n,e);var t=Ue(n);function n(){var e;return F()(this,n),(e=t.apply(this,arguments)).onChange=e.onChange.bind(q()(e)),e}return W()(n,[{key:"onChange",value:function(e){this.props.onChange&&this.props.onChange(e.target.checked)}},{key:"render",value:function(){var e,t,n=this.props,r=n.label,i=n.checked,o=n.help,c=n.instanceId,s=de()(n,["label","checked","help","instanceId"]),a="inspector-toggle-control-".concat(c);return o&&(e=a+"__help",t=Object(g.isFunction)(o)?o(i):o),Object(u.createElement)(ee.BaseControl,{id:a,help:t,className:"components-toggle-control"},Object(u.createElement)(ee.FormToggle,Ee()({},s,{id:a,checked:i,onChange:this.onChange,"aria-describedby":e})),Object(u.createElement)("label",{htmlFor:a,className:"components-toggle-control__label"},r))}}]),n}(u.Component);Object(ce.withInstanceId)(He),n("IXp0");var Ke=Object(ce.withInstanceId)(function(e){var t=e.label,n=e.className,r=e.heading,i=e.checked,o=e.help,c=e.instanceId,s=e.onChange,a=e.indeterminate,l=de()(e,["label","className","heading","checked","help","instanceId","onChange","indeterminate"]),d="inspector-checkbox-control-".concat(c);return Object(u.createElement)(ee.BaseControl,{label:r,id:d,help:o,className:n},Object(u.createElement)("span",{className:"components-checkbox-control__input-container"},Object(u.createElement)("input",Ee()({id:d,className:"components-checkbox-control__input",type:"checkbox",value:"1",onChange:function(e){return s(e.target.checked)},checked:i,"aria-describedby":o?d+"__help":void 0,ref:function(e){e&&(e.indeterminate=a)}},l)),i?Object(u.createElement)(ee.Dashicon,{icon:"yes",className:"components-checkbox-control__checked",role:"presentation"}):null,a?Object(u.createElement)(ee.Dashicon,{icon:"minus",className:"components-checkbox-control__checked components-checkbox-control__checked--indeterminate",role:"presentation"}):null),Object(u.createElement)("label",{className:"components-checkbox-control__label",htmlFor:d},t))});function Fe(e){var t=e.tabId,n=e.onClick,r=e.children,i=e.selected,o=de()(e,["tabId","onClick","children","selected"]);return Object(u.createElement)(ee.Button,Ee()({role:"tab",tabIndex:i?null:-1,"aria-selected":i,id:t,onClick:n},o),r)}function Ve(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}();return function(){var n,r=X()(e);if(t){var i=X()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Z()(this,n)}}var We=function(e){Y()(n,e);var t=Ve(n);function n(){var e;return F()(this,n),(e=t.apply(this,arguments)).handleClick=e.handleClick.bind(q()(e)),e.onNavigate=e.onNavigate.bind(q()(e)),e.onKeyDown=e.onKeyDown.bind(q()(e)),e}return W()(n,[{key:"handleClick",value:function(e){var t=this.props.onSelect;(void 0===t?g.noop:t)(e)}},{key:"onNavigate",value:function(e,t){var n=this.event;n&&"tab"===n.target.getAttribute("role")&&n.preventDefault(),t.click()}},{key:"onKeyDown",value:function(e){this.event=e}},{key:"render",value:function(){var e=this,t=this.props,n=t.activeClass,r=void 0===n?"is-active":n,i=t.className,o=t.instanceId,c=t.orientation,s=void 0===c?"horizontal":c,a=t.tabs,l=t.selected,d=Object(g.find)(a,{name:l})||a[0],p=o+"-"+d.name;return Object(u.createElement)("div",{className:i},Object(u.createElement)(ee.NavigableMenu,{role:"tablist",orientation:s,onNavigate:this.onNavigate,onKeyDown:this.onKeyDown,className:"components-tab-panel__tabs"},a.map(function(t){return Object(u.createElement)(Fe,{className:oe()(t.className,v()({},r,t.name===d.name)),tabId:o+"-"+t.name,"aria-controls":o+"-"+t.name+"-view",selected:t.name===d.name,key:t.name,onClick:Object(g.partial)(e.handleClick,t.name)},t.title)})),d&&Object(u.createElement)("div",{"aria-labelledby":p,role:"tabpanel",id:p+"-view",className:"components-tab-panel__tab-content",tabIndex:"0"},this.props.children(d)))}}]),n}(u.Component),$e=Object(ce.withInstanceId)(We),qe=n("rl8x"),ze=n.n(qe);function Ye(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}();return function(){var n,r=X()(e);if(t){var i=X()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Z()(this,n)}}Object(ce.createHigherOrderComponent)(function(e){var t,n;return n=t=function(t){Y()(r,t);var n=Ye(r);function r(){var e;F()(this,r);for(var t=arguments.length,i=new Array(t),o=0;o<t;o++)i[o]=arguments[o];return e=n.call.apply(n,[this].concat(i)),v()(q()(e),"state",{width:1280}),v()(q()(e),"mounted",!1),v()(q()(e),"ref",null),v()(q()(e),"onWindowResize",function(){if(e.mounted){var t=Object(u.findDOMNode)(q()(e));if(t instanceof window.HTMLElement){var n=t.offsetWidth;e.setState({width:n})}}}),e}return W()(r,[{key:"componentDidMount",value:function(){this.mounted=!0,window.addEventListener("resize",this.onWindowResize),document.getElementById("collapse-button").addEventListener("click",this.onWindowResize),this.onWindowResize()}},{key:"componentWillUnmount",value:function(){this.mounted=!1,window.removeEventListener("resize",this.onWindowResize),document.getElementById("collapse-button").removeEventListener("click",this.onWindowResize)}},{key:"render",value:function(){var t=this.props,n=t.measureBeforeMount,r=de()(t,["measureBeforeMount"]);return n&&!this.mounted?Object(u.createElement)("div",{className:this.props.className,style:this.props.style}):Object(u.createElement)(e,Ee()({},r,{width:this.state.width+20}))}}]),r}(u.Component),v()(t,"defaultProps",{measureBeforeMount:!1}),n},"withWidth");function Je(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}();return function(){var n,r=X()(e);if(t){var i=X()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Z()(this,n)}}var Ze=Object(ce.createHigherOrderComponent)(function(e){return function(t){Y()(r,t);var n=Je(r);function r(){var e;return F()(this,r),e=n.apply(this,arguments),v()(q()(e),"state",{pressed:{shift:!1,ctrl:!1,meta:!1,alt:!1}}),v()(q()(e),"mounted",!1),e.listener=e.listener.bind(q()(e)),e.onBlur=e.onBlur.bind(q()(e)),e}return W()(r,[{key:"componentDidMount",value:function(){this.mounted=!0,window.addEventListener("keydown",this.listener),window.addEventListener("keyup",this.listener),window.addEventListener("click",this.listener),window.addEventListener("blur",this.onBlur)}},{key:"componentWillUnmount",value:function(){this.mounted=!1,window.removeEventListener("keydown",this.listener),window.removeEventListener("keyup",this.listener),window.removeEventListener("click",this.listener),window.removeEventListener("blur",this.onBlur)}},{key:"listener",value:function(e){this.mounted&&this.setState({pressed:{shift:e.shiftKey,ctrl:e.ctrlKey,meta:e.metaKey,alt:e.altKey}})}},{key:"onBlur",value:function(){this.setState({pressed:{shift:!1,ctrl:!1,meta:!1,alt:!1}})}},{key:"render",value:function(){return Object(u.createElement)(e,Ee()({pressedModifierKeys:this.state.pressed},this.props))}}]),r}(u.Component)},"withPressedModifierKeys");function Qe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}();return function(){var n,r=X()(e);if(t){var i=X()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Z()(this,n)}}var Xe=function(e){Y()(n,e);var t=Qe(n);function n(){var e;return F()(this,n),(e=t.apply(this,arguments)).handleClick=e.handleClick.bind(q()(e)),e.onNavigate=e.onNavigate.bind(q()(e)),e.onKeyDown=e.onKeyDown.bind(q()(e)),e.toggleTab=e.toggleTab.bind(q()(e)),e.getSelectedTabs=e.getSelectedTabs.bind(q()(e)),e.isSelected=e.isSelected.bind(q()(e)),e.getSelectedId=e.getSelectedId.bind(q()(e)),e.getLabelledBy=e.getLabelledBy.bind(q()(e)),e.getTabId=e.getTabId.bind(q()(e)),e.getTabPanelId=e.getTabPanelId.bind(q()(e)),e.isTabDisabled=e.isTabDisabled.bind(q()(e)),e.isNonMultiSelectableTabSelected=e.isNonMultiSelectableTabSelected.bind(q()(e)),e}return W()(n,[{key:"handleClick",value:function(e,t){t.metaKey||t.ctrlKey?this.toggleTab(e):this.props.onSelect([e])}},{key:"onNavigate",value:function(e,t){var n=this.event;if(n){if("tab"===n.target.getAttribute("role")&&n.preventDefault(),n.ctrlKey)return;if(n.shiftKey){if(this.isTabDisabled(this.props.tabs[e]))return;var r=this.props.tabs[e].name;return void this.toggleTab(r)}}t.click()}},{key:"onKeyDown",value:function(e){if(!e.nativeEvent&&(this.event=e,e.ctrlKey&&("Space"===e.code||32===e.keyCode))){e.preventDefault();var t=e.target.dataset.tabname;t&&this.toggleTab(t)}}},{key:"toggleTab",value:function(e){var t=Object(g.find)(this.props.tabs,{name:e});t&&!1===t.allowMultiple||(this.props.selected.includes(e)?this.props.onSelect(this.props.selected.filter(function(t){return t!==e})):this.props.onSelect([].concat(b()(this.props.selected),[e])))}},{key:"getSelectedTabs",value:function(){var e=this,t=this.props.selected;!t.length&&this.props.initialTab&&t.push(this.props.initialTab);var n=[];return this.props.tabs.forEach(function(t){e.props.selected.includes(t.name)&&n.push(t)}),n}},{key:"isSelected",value:function(e,t){return e.some(function(e){return e.name===t.name})}},{key:"isTabDisabled",value:function(e){var t=this.props.pressedModifierKeys;if(this.props.selected.includes(e.name))return!1;if(!1!==e.allowMultiple&&!this.isNonMultiSelectableTabSelected())return!1;if(t.meta||t.ctrl)return!0;if(t.shift){var n=document.activeElement;if(n.parentElement&&n.parentElement.id==="components-tab-panel__tabs-".concat(this.props.instanceId))return!0}return!1}},{key:"isNonMultiSelectableTabSelected",value:function(){if(1!==this.props.selected.length)return!1;var e=Object(g.find)(this.props.tabs,{name:this.props.selected[0]});return e&&!1===e.allowMultiple}},{key:"getSelectedId",value:function(e){return 1===e.length?this.getTabPanelId(e[0].name):"components-tab-panel__panel-".concat(this.props.instanceId,"-").concat(Object(g.map)(e,"name").join("-"))}},{key:"getLabelledBy",value:function(e){var t=this;return e.map(function(e){return t.getTabId(e.name)}).join(",")}},{key:"getTabId",value:function(e){return"components-tab-panel__tab-".concat(this.props.instanceId,"-").concat(e)}},{key:"getTabPanelId",value:function(e){return"components-tab-panel__panel-".concat(this.props.instanceId,"-").concat(e)}},{key:"componentDidUpdate",value:function(e){if(1===this.props.selected.length&&ze()(this.props.selected,e.selected)){var t=this.props.selected[0];if(!Object(g.find)(this.props.tabs,{name:t})){var n=Object(g.findIndex)(e.tabs,{name:t});if(-1!==n){var r=Math.max(n-1,0),i=this.props.tabs[r];i&&this.props.onSelect([i.name])}}}}},{key:"render",value:function(){var e=this,t=this.props,n=t.tabs,r=t.className,i=t.activeClass,o=void 0===i?"is-active":i,c=t.orientation,s=void 0===c?"horizontal":c,a=this.getSelectedTabs(),l=this.getSelectedId(a);return Object(u.createElement)("div",{className:r},Object(u.createElement)(ee.NavigableMenu,{role:"tablist","aria-multiselectable":!0,orientation:s,onNavigate:this.onNavigate,onKeyDown:this.onKeyDown,className:"components-tab-panel__tabs",id:"components-tab-panel__tabs-".concat(this.props.instanceId)},n.map(function(t){var n=e.isSelected(a,t),r=n&&a.length>1?l:e.getTabPanelId(t.name);return Object(u.createElement)(Fe,{className:oe()(t.className,v()({},o,n)),tabId:e.getTabId(t.name),"aria-controls":r,selected:n,disabled:e.isTabDisabled(t),key:t.name,onClick:Object(g.partial)(e.handleClick,t.name),"data-tabname":t.name},t.title)})),a.length>0&&Object(u.createElement)("div",{"aria-labelledby":this.getLabelledBy(a),role:"tabpanel",id:l,className:"components-tab-panel__tab-content",tabIndex:"0"},this.props.children(a)))}}]),n}(u.Component),et=Object(ce.compose)([ce.withInstanceId,Ze])(Xe);function tt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}();return function(){var n,r=X()(e);if(t){var i=X()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Z()(this,n)}}var nt=function(e){Y()(n,e);var t=tt(n);function n(){var e;return F()(this,n),e=t.apply(this,arguments),v()(q()(e),"onSelect",function(t){e.setState({selected:t})}),e.state={selected:e.props.initialTab||""},e}return W()(n,[{key:"render",value:function(){return Object(u.createElement)($e,Ee()({},this.props,{selected:this.state.selected,onSelect:this.onSelect}))}}]),n}(u.Component);function rt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function it(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rt(Object(n),!0).forEach(function(t){v()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ot(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return{type:"SELECT",storeKey:e,selectorName:t,args:r}}function ct(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return{type:"DISPATCH",storeKey:e,actionName:t,args:r}}function st(){return{type:"CREATE_NOTICE",status:arguments.length>0&&void 0!==arguments[0]?arguments[0]:"info",content:arguments.length>1?arguments[1]:void 0,options:it({context:"ithemes-security"},arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})}}var at={API_FETCH:function(e){var t=e.request;return O()(t).catch(j.e)},SELECT:function(e){var t,n=e.storeKey,r=e.selectorName,i=e.args;return(t=Object(f.select)(n))[r].apply(t,b()(i))},DISPATCH:function(e){var t,n=e.storeKey,r=e.actionName,i=e.args;return(t=Object(f.dispatch)(n))[r].apply(t,b()(i))},CREATE_NOTICE:function(e){var t=e.status,n=e.content,r=e.options;r.autoDismiss&&(r.id=r.id||Object(g.uniqueId)("itsec-auto-dismiss-"),setTimeout(function(){return Object(f.dispatch)("core/notices").removeNotice(r.id,r.context)},r.autoDismiss)),Object(f.dispatch)("core/notices").createNotice(t,n,r)}};function ut(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 lt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ut(Object(n),!0).forEach(function(t){v()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ut(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var dt=N.a.mark(vt),pt=N.a.mark(yt),ft=N.a.mark(jt),ht=N.a.mark(St);function bt(e){return{type:It,ids:e}}function mt(e,t){return{type:kt,id:e,edit:t}}function vt(e){var t,n;return N.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,ot("ithemes-security/user-groups-editor","getEditedGroup",e);case 2:if(t=r.sent){r.next=5;break}return r.abrupt("return");case 5:return r.next=7,{type:Nt,id:e};case 7:return r.next=9,ct("ithemes-security/user-groups","updateGroup",e,t);case 9:if(!((n=r.sent)instanceof Error)){r.next=17;break}return r.next=13,st("error",n.message);case 13:return r.next=15,{type:Rt,id:e,error:n};case 15:r.next=21;break;case 17:return r.next=19,{type:Ct,id:e,updated:n};case 19:return r.next=21,st("success",Object(l.__)("Updated group.","better-wp-security"),{type:"snackbar"});case 21:return r.abrupt("return",n);case 22:case"end":return r.stop()}},dt)}function gt(e){return{type:xt,id:e}}function yt(){var e,t,n,r=arguments;return N.a.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},i.next=3,ot("ithemes-security/user-groups-editor","getEditedGroup","new");case 3:if(t=i.sent){i.next=6;break}return i.abrupt("return");case 6:return i.next=8,{type:Pt};case 8:return i.next=10,ct("ithemes-security/user-groups","createGroup",lt(lt({},t),e));case 10:if(!((n=i.sent)instanceof Error)){i.next=23;break}if("rest_duplicate_user_group"!==n.code){i.next=17;break}return i.next=15,st("error",n.message,{actions:[{label:Object(l.__)("View Duplicate","better-wp-security"),isLink:!0,onClick:function(){var e=Object(g.get)(n,["_links","duplicate",0,"href"]).split("/").pop();Object(f.dispatch)("ithemes-security/user-groups-editor").selectGroup([e])}},{label:Object(l.__)("Create Anyway","better-wp-security"),onClick:function(){Object(f.dispatch)("ithemes-security/user-groups-editor").createGroup({ignore_duplicate:!0})}}]});case 15:i.next=19;break;case 17:return i.next=19,st("error",n.message);case 19:return i.next=21,{type:Dt,error:n};case 21:i.next=31;break;case 23:return i.next=25,gt("new");case 25:return i.next=27,{type:Tt,created:n};case 27:return i.next=29,ct("ithemes-security/user-groups-editor","selectGroup",n.id);case 29:return i.next=31,st("success",Object(l.__)("Created group.","better-wp-security"),{type:"snackbar"});case 31:return i.abrupt("return",n);case 32:case"end":return i.stop()}},pt)}function Ot(e,t,n,r){return{type:At,id:e,module:t,setting:n,value:r}}function jt(e){var t,n;return N.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,ot("ithemes-security/user-groups-editor","getEditedGroupSettings",e);case 2:if(t=r.sent){r.next=5;break}return r.abrupt("return");case 5:return r.next=7,{type:Lt,id:e};case 7:return r.next=9,ct("ithemes-security/user-groups","updateGroupSettings",e,t);case 9:if(!((n=r.sent)instanceof Error)){r.next=17;break}return r.next=13,st("error",n.message);case 13:return r.next=15,{type:Mt,id:e,error:n};case 15:r.next=21;break;case 17:return r.next=19,{type:Gt,id:e,updated:n};case 19:return r.next=21,st("success",Object(l.__)("Updated group settings.","better-wp-security"),{type:"snackbar"});case 21:return r.abrupt("return",n);case 22:case"end":return r.stop()}},ft)}function Et(e,t,n){return{type:Bt,module:e,setting:t,value:n}}function _t(e,t){return{type:Ut,module:e,setting:t}}function wt(){return{type:Ht}}function St(e){var t,n,r,i;return N.a.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,ot("ithemes-security/user-groups-editor","getBulkSettingEdits");case 2:return t=o.sent,o.next=5,ct("ithemes-security/user-groups","patchBulkGroupSettings",e,t);case 5:if(!((n=o.sent)instanceof Error)){o.next=11;break}return o.next=9,st("error",n.message);case 9:o.next=25;break;case 11:if(!Object(g.map)(n,"status").every(function(e){return 200===e})){o.next=16;break}return o.next=14,st("success",Object(l.__)("Updated group settings.","better-wp-security"),{type:"snackbar"});case 14:o.next=25;break;case 16:if(r=n.filter(function(e){return 200!==e.status}).map(function(e){var t=e.error;return Object(j.b)(t)}),i=r.map(function(e){return e.getAllErrorMessages().join(" ")}).join(" "),r.length!==n.length){o.next=23;break}return o.next=21,st("error",i);case 21:o.next=25;break;case 23:return o.next=25,st("warning",Object(l.sprintf)(Object(l._n)("%1$d group was not updated: %2$s","%1$d groups were not updated: %2$s",r.length,"better-wp-security"),r.length,i));case 25:return o.next=27,wt();case 27:return o.abrupt("return",n);case 28:case"end":return o.stop()}},ht)}var It="SELECT_GROUP",kt="EDIT_GROUP",xt="RESET_EDITS",Nt="START_SAVE_GROUP",Ct="FINISH_SAVE_GROUP",Rt="FAILED_SAVE_GROUP",Pt="START_CREATE_GROUP",Tt="FINISH_CREATE_GROUP",Dt="FAILED_CREATE_GROUP",At="EDIT_GROUP_SETTING",Lt="START_SAVE_GROUP_SETTINGS",Gt="FINISH_SAVE_GROUP_SETTINGS",Mt="FAILED_SAVE_GROUP_SETTINGS",Bt="BULK_EDIT_GROUP_SETTING",Ut="RESET_BULK_GROUP_SETTING_EDIT",Ht="RESET_BULK_GROUP_SETTING_EDITS";function Kt(e){return e.selectedGroup}function Ft(e){return e.creating}function Vt(e,t){return e.edits[t]}function Wt(e,t,n){var r=Object(g.get)(e,["edits",t,n]);return void 0!==r?r:"new"!==t?Object(f.select)("ithemes-security/user-groups").getGroupAttribute(t,n):void 0}function $t(e,t){return!!e.edits[t]}function qt(e,t){return!!e.settingEdits[t]}function zt(e,t){return e.settingEdits[t]}function Yt(e,t,n,r){var i=Object(g.get)(e,["settingEdits",t,n,r]);return void 0!==i?i:Object(f.select)("ithemes-security/user-groups").getGroupSetting(t,n,r)}function Jt(e){return!Object(g.isEmpty)(e.bulkSettingEdits)}function Zt(e){return e.bulkSettingEdits}function Qt(e,t,n){return Object(g.get)(e,["bulkSettingEdits",t,n])}function Xt(e,t,n,r){var i=Qt(e,n,r);if(void 0!==i)return i;var o=function(e){return Object(f.select)("ithemes-security/user-groups").getGroupSetting(e,n,r)},c=o(t[0]);return t.every(function(e){return o(e)===c})?c:null}function en(e,t){var n=Zt(e);return Object(f.select)("ithemes-security/user-groups").isBulkPatchingSettings(t,n)}function tn(){return Object(f.select)("ithemes-security/user-groups").getGroups("available")}var nn=N.a.mark(rn);function rn(){var e;return N.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,ct("ithemes-security/user-groups","query","available",{_embed:1});case 2:if(!((e=t.sent).length>0)){t.next=6;break}return t.next=6,ct("ithemes-security/user-groups-editor","selectGroup",[e[0].id]);case 6:return t.abrupt("return",e);case 7:case"end":return t.stop()}},nn)}function on(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function cn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?on(Object(n),!0).forEach(function(t){v()(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):on(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var sn={edits:{},settingEdits:{},bulkSettingEdits:{},creating:!1,selectedGroup:[]};Object(f.registerStore)("ithemes-security/user-groups-editor",{controls:at,actions:c,selectors:s,resolvers:a,reducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:sn,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case It:return cn(cn({},e),{},{selectedGroup:t.ids});case kt:return cn(cn({},e),{},{edits:cn(cn({},e.edits),{},v()({},t.id,cn(cn({},e.edits[t.id]||{}),t.edit)))});case Ct:return cn(cn({},e),{},{edits:Object(g.omit)(e.edits,[t.id])});case At:return cn(cn({},e),{},{settingEdits:cn(cn({},e.settingEdits),{},v()({},t.id,cn(cn({},Object(g.get)(e,["settingEdits",t.id],{})),{},v()({},t.module,cn(cn({},Object(g.get)(e,["settingEdits",t.id,t.module],{})),{},v()({},t.setting,t.value))))))});case Gt:return cn(cn({},e),{},{settingEdits:Object(g.omit)(e.settingEdits,[t.id])});case Pt:return cn(cn({},e),{},{creating:!0});case Dt:case Tt:return cn(cn({},e),{},{creating:!1});case xt:return cn(cn({},e),{},{edits:Object(g.omit)(e.edits,[t.id])});case Bt:return cn(cn({},e),{},{bulkSettingEdits:cn(cn({},e.bulkSettingEdits),{},v()({},t.module,cn(cn({},e.bulkSettingEdits[t.module]||{}),{},v()({},t.setting,t.value))))});case Ut:return cn(cn({},e),{},{bulkSettingEdits:Object(g.omit)(e.bulkSettingEdits,"".concat(t.module,".").concat(t.setting))});case Ht:return cn(cn({},e),{},{bulkSettingEdits:{}});default:return e}}});function an(){return Object(u.createElement)("div",null,Object(u.createElement)(ln,null))}n("GjY+");var un=Ie()(function(e){return e.sort(function(e,t){return e.type===t.type?0:"user-group"===e.type?-1:"user-group"===t.type?1:0}).map(function(e){return{name:e.id,title:e.label,className:"itsec-user-groups-list__item",group:e}}).concat({name:"new",title:Object(u.createElement)(u.Fragment,null,Object(u.createElement)(ee.Icon,{icon:"plus"}),Object(l.__)("New Group","better-wp-security")),className:"itsec-user-groups-list__item itsec-user-groups-list__item--new",allowMultiple:!1})});var ln=Object(ce.compose)([Object(f.withSelect)(function(e){return{matchables:e("ithemes-security/user-groups").getMatchables(),resolvingMatchables:e("core/data").isResolving("ithemes-security/user-groups","getMatchables"),selectedGroup:e("ithemes-security/user-groups-editor").getSelectedGroup()}}),Object(f.withDispatch)(function(e){return{selectGroup:e("ithemes-security/user-groups-editor").selectGroup}})])(function(e){var t=e.matchables,n=e.resolvingMatchables,r=e.selectedGroup,i=e.selectGroup;if(Object(u.useEffect)(function(){!n&&t.length&&0===r.length&&i([t[0].id])},[n]),n&&!t.length)return null;var o=un(t);return Object(u.createElement)(et,{tabs:o,selected:r,onSelect:i,allowMultiple:!0,orientation:"vertical",className:"itsec-user-groups-list"},function(e){if(e.length>1){var t=Object(g.filter)(e.map(function(e){var t=e.group;return t&&t.id}));return Object(u.createElement)(hn,{groupIds:t})}return e[0]?Object(u.createElement)(pn,{groupId:e[0].name,isNew:"new"===e[0].name}):null})}),dn=(n("Y0od"),Ie()(function(e,t){if("new"===e)return[{name:"create",title:Object(l.__)("Edit Group","better-wp-security"),className:"itsec-manage-user-group-tabs__tab",Component:vn}];var n=[{name:"settings",title:Object(l.__)("Features","better-wp-security"),className:"itsec-manage-user-group-tabs__tab",Component:On}];return"user-group"===t&&n.push({name:"edit",title:Object(l.__)("Edit Group","better-wp-security"),className:"itsec-manage-user-group-tabs__tab",Component:gn}),n}));var pn=Object(ce.compose)([Object(f.withSelect)(function(e,t){var n=t.groupId;return{type:e("ithemes-security/user-groups").getMatchableType(n)}})])(function(e){var t=e.groupId,n=e.type,r=e.isNew;return Object(u.createElement)("div",{className:"itsec-manage-user-group"},r?Object(u.createElement)(Cn,null):Object(u.createElement)(Nn,{groupId:t}),Object(u.createElement)(nt,{tabs:dn(t,n),className:"itsec-manage-user-group-tabs"},function(e){var n=e.Component;return Object(u.createElement)(n,{groupId:t})}))}),fn=Ie()(function(){return[{name:"settings",title:Object(l.__)("Features","better-wp-security"),className:"itsec-manage-user-group-tabs__tab",Component:En}]});var hn=function(e){var t=e.groupIds;return Object(u.createElement)("div",{className:"itsec-manage-multiple-user-groups"},Object(u.createElement)(Rn,{groupIds:t}),Object(u.createElement)(nt,{tabs:fn(),className:"itsec-manage-user-group-tabs"},function(e){var n=e.Component;return Object(u.createElement)(n,{groupIds:t})}))};n("QmYb");var bn=Object(ce.compose)([Object(f.withSelect)(function(e,t){var n=t.groupId;return{label:e("ithemes-security/user-groups-editor").getEditedGroupAttribute(n,"label")||""}}),Object(f.withDispatch)(function(e,t){var n=t.groupId;return{edit:function(t){return e("ithemes-security/user-groups-editor").editGroup(n,t)}}})])(function(e){var t=e.label,n=e.edit,r=e.disabled,i=void 0!==r&&r;return Object(u.createElement)(ee.TextControl,{label:Object(l.__)("Group Name","better-wp-security"),value:t,maxLength:50,disabled:i,onChange:function(e){return n({label:e})}})});n("ZRc3");function mn(e){var t,n=e.name,r=e.isLoading,i=e.children,o=oe()("itsec-user-groups-group-tab",(t={},v()(t,"itsec-user-groups-group-tab--".concat(n),n),v()(t,"itsec-user-groups-group-tab--is-loading",r),t));return Object(u.createElement)("div",{className:o},i)}mn.Row=function(e){var t=e.name,n=e.children;return Object(u.createElement)("div",{className:"itsec-user-groups-group-tab__row itsec-user-groups-group-tab__row--".concat(t)},n)};var vn=Object(ce.compose)([Object(f.withSelect)(function(e){return{hasEdits:e("ithemes-security/user-groups-editor").hasEdits("new"),isSaving:e("ithemes-security/user-groups-editor").isCreating("new")}}),Object(f.withDispatch)(function(e){return{save:function(){e("ithemes-security/user-groups-editor").createGroup()}}})])(function(e){var t=e.hasEdits,n=e.save,r=e.isSaving;return Object(u.createElement)(mn,{name:"create-group"},Object(u.createElement)(Tn,{groupId:"new"}),Object(u.createElement)(mn.Row,{name:"save"},Object(u.createElement)(ee.Button,{disabled:!t,isPrimary:!0,onClick:n,isBusy:r},Object(l.__)("Create","better-wp-security"))))});var gn=Object(ce.compose)([Object(f.withSelect)(function(e,t){var n=t.groupId;return{isLoading:e("core/data").isResolving("ithemes-security/user-groups","getGroup",[n])||e("core/data").isResolving("ithemes-security/core","getIndex"),hasEdits:e("ithemes-security/user-groups-editor").hasEdits(n),isSaving:e("ithemes-security/user-groups").isUpdating(n)}}),Object(f.withDispatch)(function(e,t){var n=t.groupId;return{save:function(){return e("ithemes-security/user-groups-editor").saveGroup(n)}}})])(function(e){var t=e.groupId,n=e.hasEdits,r=e.save,i=e.isSaving,o=e.isLoading;return Object(u.createElement)(mn,{name:"edit-group",isLoading:o},Object(u.createElement)(Tn,{groupId:t,disabled:o}),Object(u.createElement)(mn.Row,{name:"save"},Object(u.createElement)(ee.Button,{disabled:!n,isPrimary:!0,onClick:r,isBusy:i},Object(l.__)("Save","better-wp-security"))))});var yn=Object(ce.compose)([Object(f.withSelect)(function(e,t){var n=t.groupId,r=t.module,i=t.setting;return{value:e("ithemes-security/user-groups-editor").getEditedGroupSetting(n,r,i)}}),Object(f.withDispatch)(function(e,t){var n=t.groupId,r=t.module,i=t.setting;return{edit:function(t){return e("ithemes-security/user-groups-editor").editGroupSetting(n,r,i,t)}}})])(function(e){var t=e.schema,n=e.value,r=e.edit,i=e.disabled,o=void 0!==i&&i;return Object(u.createElement)(ee.ToggleControl,{checked:!0===n,label:t.title,help:t.description,disabled:o,onChange:function(e){return r(e)}})});n("GrEf");var On=Object(ce.compose)([Object(f.withSelect)(function(e,t){var n=t.groupId;return{groupSettings:e("ithemes-security/user-groups").getGroupSettings(n),isLoading:e("core/data").isResolving("ithemes-security/user-groups","getGroupSettings",[n]),schema:e("ithemes-security/core").getSchema("ithemes-security-user-group-settings"),hasEdits:e("ithemes-security/user-groups-editor").settingHasEdits(n),isSaving:e("ithemes-security/user-groups").isUpdatingSettings(n)}}),Object(f.withDispatch)(function(e,t){var n=t.groupId;return{save:function(){return e("ithemes-security/user-groups-editor").saveGroupSettings(n)}}})])(function(e){var t=e.schema,n=e.groupId,r=e.hasEdits,i=e.save,o=e.isSaving,c=e.isLoading;return t?Object(u.createElement)(mn,{name:"settings",isLoading:c},Object(u.createElement)(mn.Row,null,Object(u.createElement)(Dn,{schema:t,settingComponent:yn,groupId:n,disabled:c})),Object(u.createElement)(mn.Row,{name:"save"},Object(u.createElement)(ee.Button,{disabled:!r,isPrimary:!0,onClick:i,isBusy:o},Object(l.__)("Save","better-wp-security")))):null});var jn=Object(ce.compose)([Object(f.withSelect)(function(e,t){var n=t.module,r=t.setting,i=t.groupIds;return{value:e("ithemes-security/user-groups-editor").getBulkSettingValue(i,n,r)}}),Object(f.withDispatch)(function(e,t){var n=t.module,r=t.setting;return{edit:function(t){return e("ithemes-security/user-groups-editor").bulkEditGroupSetting(n,r,t)}}})])(function(e){var t=e.schema,n=e.value,r=e.edit,i=e.disabled,o=void 0!==i&&i;return Object(u.createElement)(Ke,{checked:!0===n,indeterminate:null==n,label:t.title,help:t.description,disabled:o,onChange:function(e){return r(e)}})});var En=Object(ce.compose)([Object(f.withSelect)(function(e,t){var n=t.groupIds;return{schema:e("ithemes-security/core").getSchema("ithemes-security-user-group-settings"),hasEdits:e("ithemes-security/user-groups-editor").hasBulkSettingEdits(),isSaving:e("ithemes-security/user-groups-editor").isSavingBulkEdits(n)}}),Object(f.withDispatch)(function(e,t){var n=t.groupIds;return{save:function(){return e("ithemes-security/user-groups-editor").saveBulkEdits(n)}}})])(function(e){var t=e.schema,n=e.hasEdits,r=e.save,i=e.isSaving,o=e.groupIds;return t?Object(u.createElement)(mn,{name:"settings"},Object(u.createElement)(mn.Row,null,Object(u.createElement)(Dn,{schema:t,settingComponent:jn,groupIds:o})),Object(u.createElement)(mn.Row,{name:"save"},Object(u.createElement)(ee.Button,{disabled:!n,isPrimary:!0,onClick:r,isBusy:i},Object(l.__)("Save","better-wp-security")))):null});Object(ce.compose)([Object(f.withSelect)(function(e,t){var n=t.groupId;return{minRole:e("ithemes-security/user-groups-editor").getEditedGroupAttribute(n,"min_role")}}),Object(f.withDispatch)(function(e,t){var n=t.groupId;return{onChange:function(t){return e("ithemes-security/user-groups-editor").editGroup(n,t)}}})])(function(e){var t=e.minRole,n=e.onChange;return Object(u.createElement)("div",null,Object(u.createElement)(ee.SelectControl,{options:[{value:"administrator",label:Object(l._x)("Administrator","User role","default")},{value:"editor",label:Object(l._x)("Editor","User role","default")},{value:"author",label:Object(l._x)("Author","User role","default")},{value:"contributor",label:Object(l._x)("Contributor","User role","default")},{value:"subscriber",label:Object(l._x)("Subscriber","User role","default")}],label:Object(l.__)("Minimum Role","better-wp-security"),value:t,onChange:function(e){return n({min_role:e})},help:Object(l.__)("Add users with the selected minimum role to this group. To edit roles, go to Users in your WordPress Dashboard.","better-wp-security")}))});var _n=Ie()(function(e,t){var n=[{value:"$administrator$",label:Object(l.__)("Administrator Capabilities","better-wp-security")},{value:"$editor$",label:Object(l.__)("Editor Capabilities","better-wp-security")},{value:"$author$",label:Object(l.__)("Author Capabilities","better-wp-security")},{value:"$contributor$",label:Object(l.__)("Contributor Capabilities","better-wp-security")},{value:"$subscriber$",label:Object(l.__)("Subscriber Capabilities","better-wp-security")}];for(var r in t&&n.unshift({value:"$super-admin$",label:Object(l.__)("Super Admin","better-wp-security")}),Object(g.some)(e,function(e){return""===e.canonical})&&n.push({value:"$other$",label:Object(l.__)("Other","better-wp-security"),selectable:!1}),e)if(e.hasOwnProperty(r)){var i=e[r],o=i.canonical,c=i.label;n.push({value:r,parent:o.length>0?"$".concat(o,"$"):"$other$",label:c})}return Object.values(n)});var wn=Object(ce.compose)([Object(f.withSelect)(function(e,t){var n=t.groupId;return{roles:e("ithemes-security/user-groups-editor").getEditedGroupAttribute(n,"roles")||[],canonical:e("ithemes-security/user-groups-editor").getEditedGroupAttribute(n,"canonical")||[],available:e("ithemes-security/core").getRoles(),schema:e("ithemes-security/core").getSchema("ithemes-security-user-group")}}),Object(f.withDispatch)(function(e,t){var n=t.groupId;return{onChange:function(t){return e("ithemes-security/user-groups-editor").editGroup(n,t)}}})])(function(e){var t=e.canonical,n=e.roles,r=e.onChange,i=e.available,o=e.schema,c=e.disabled,s=void 0!==c&&c,a=Object(g.get)(o,["properties","canonical","items","enum"],[]).includes("super-admin"),d=[].concat(b()(n),b()(t.map(function(e){return"$".concat(e,"$")})));return Object(u.createElement)(Ae,{label:Object(l.__)("Select Roles","better-wp-security"),help:Object(l.__)("Add users with the selected roles to this group.","better-wp-security"),value:d,disabled:s,options:_n(i,a),onChange:function(e){var t=Object(j.a)(e,function(e){return e.startsWith("$")&&e.endsWith("$")}),n=ae()(t,2),i=n[0],o=n[1];r({roles:o,canonical:Object(g.without)(i.map(function(e){return e.slice(1,-1)}),"other")})}})}),Sn=n("Mmq9");n("ELjz");function In(e){return{value:e.id,label:e.name,user:e}}var kn=function(e){return new Promise(function(t,n){O()({path:Object(Sn.addQueryArgs)("/wp/v2/users",{search:e,per_page:100,context:"embed",itsec_global:!0})}).then(function(e){return e.forEach(Object(f.dispatch)("ithemes-security/core").receiveUser),e}).then(function(e){return t(e.map(In))}).catch(n)})};var xn=Object(ce.compose)([Object(ce.withState)({selectSearch:""}),Object(f.withSelect)(function(e,t){var n=t.groupId,r=e("ithemes-security/user-groups-editor").getEditedGroupAttribute(n,"users")||[],i=[],o=!1;return r.forEach(function(t){var n=e("ithemes-security/core").getUser(t);n?i.push(n):e("core/data").isResolving("ithemes-security/core","getUser",[t])&&(o=!0)}),{users:i,userIds:r,loading:o}}),Object(f.withDispatch)(function(e,t){var n=t.groupId;return{receiveUser:e("ithemes-security/core").receiveUser,onChange:function(t){return e("ithemes-security/user-groups-editor").editGroup(n,t)}}}),ce.withInstanceId])(function(e){var t=e.instanceId,n=e.users,r=e.loading,i=e.onChange,o=e.disabled,c=void 0!==o&&o,s=e.selectSearch,a=e.setState,d="itsec-user-group-panel-users__select-".concat(t),p=r?[]:n.map(In);return Object(u.createElement)(ee.BaseControl,{className:"itsec-user-group-panel-users__select-control",label:Object(l.__)("Select Users","better-wp-security"),help:Object(l.__)("Select specific users to add to this group.","better-wp-security"),id:d},Object(u.createElement)(ve,{classNamePrefix:"components-itsec-async-select-control",inputId:d,isDisabled:c||r,isLoading:r,isMulti:!0,cacheOptions:!0,defaultOptions:!0,loadOptions:kn,value:p,onChange:function(e){return i({users:Object(g.map)(e,"value")})},inputValue:s,onInputChange:function(e){return a({selectSearch:e})}}))});n("mzAq");var Nn=Object(ce.compose)([Object(f.withSelect)(function(e,t){var n,r=t.groupId,i=e("ithemes-security/user-groups").getMatchableType(r),o="user-group"===i&&e("ithemes-security/user-groups").isDeleting(r);return"user-group"===i&&(n=e("ithemes-security/user-groups-editor").getEditedGroupAttribute(r,"label")),void 0===n&&(n=e("ithemes-security/user-groups").getMatchableLabel(r)),{type:i,label:n,isDeleting:o}}),Object(f.withDispatch)(function(e,t){var n=t.groupId;return{deleteGroup:function(){return e("ithemes-security/user-groups").deleteGroup(n)}}})])(function(e){var t=e.type,n=e.label,r=e.isDeleting,i=e.deleteGroup,o="user-group"===t;return n&&n.length||(n=Object(l.__)("Untitled","better-wp-security")),Object(u.createElement)(Pn,{label:n},o&&Object(u.createElement)(ee.Button,{onClick:i,isBusy:r,isLink:!0,isDestructive:!0},Object(l.__)("Delete Group","better-wp-security")))});var Cn=Object(ce.compose)([Object(f.withSelect)(function(e){return{label:e("ithemes-security/user-groups-editor").getEditedGroupAttribute("new","label")}})])(function(e){var t=e.label;return t&&t.length||(t=Object(l.__)("New Group","better-wp-security")),Object(u.createElement)(Pn,{label:t})});var Rn=Object(ce.compose)([Object(f.withSelect)(function(e,t){return{label:t.groupIds.map(e("ithemes-security/user-groups").getMatchableLabel).join(", ")}})])(function(e){var t=e.label;return Object(u.createElement)(Pn,{label:t})});function Pn(e){var t=e.label,n=e.children;return Object(u.createElement)("div",{className:"itsec-user-group-header"},Object(u.createElement)("h4",{className:"itsec-user-group-header__label"},t),n)}n("XO7p");var Tn=function(e){var t=e.groupId,n=e.disabled;return Object(u.createElement)(mn.Row,{name:"edit-fields"},Object(u.createElement)(bn,{groupId:t,disabled:n}),Object(u.createElement)(wn,{groupId:t,disabled:n}),Object(u.createElement)(xn,{groupId:t,disabled:n}))};function Dn(e){var t=e.schema,n=e.settingComponent,r=de()(e,["schema","settingComponent"]);return Object(u.createElement)("ul",{className:"itsec-user-groups-group-tab__modules-list"},Object(g.map)(t.properties,function(e,t){return Object(u.createElement)("li",{key:t},Object(u.createElement)("fieldset",null,Object(u.createElement)("legend",null,e.title),Object(u.createElement)("ul",null,Object(g.map)(e.properties,function(e,i){return Object(u.createElement)("li",{key:i},Object(u.createElement)(n,Ee()({schema:e,module:t,setting:i},r)))}))))}))}n("wM0a");var An=function(e){var t=e.noticeEl;return Object(u.createElement)("div",{className:"itsec-user-groups-app"},Object(u.createPortal)(Object(u.createElement)(Be,null),t),Object(u.createElement)(an,null))};function Ln(){var e=document.getElementById("itsec-user-groups-settings-root"),t=document.getElementById("itsec-module-messages-container-user-groups");return Object(u.render)(Object(u.createElement)(An,{noticeEl:t}),e)}n.p=window.itsecWebpackPublicPath,Object(l.setLocaleData)({"":{}},"ithemes-security-pro"),p()(function(){Ln(),window.itsecSettingsPage&&(window.itsecSettingsPage.events.on("modulesReloaded",Ln),window.itsecSettingsPage.events.on("moduleReloaded",function(e,t){"user-groups"===t&&Ln()}))})},faye:function(e,t){!function(){e.exports=this.ReactDOM}()},l3Sj:function(e,t){!function(){e.exports=this.wp.i18n}()},lSb6:function(e,t,n){},mzAq:function(e,t,n){},"oaS/":function(e,t,n){},onLe:function(e,t){!function(){e.exports=this.wp.notices}()},pVnL:function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},n.apply(this,arguments)}e.exports=n},rl8x:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},rmEH:function(e,t){!function(){e.exports=this.wp.htmlEntities}()},sPxh:function(e,t){!function(){e.exports=this.itsec["user-groups"].api}()},"tI+e":function(e,t){!function(){e.exports=this.wp.components}()},urxu:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorBoundaryFallbackComponent=t.withErrorBoundary=t.ErrorBoundary=void 0;var r=c(n("Xvx9")),i=n("31KZ"),o=c(i);function c(e){return e&&e.__esModule?e:{default:e}}t.default=o.default,t.ErrorBoundary=o.default,t.withErrorBoundary=i.withErrorBoundary,t.ErrorBoundaryFallbackComponent=r.default},wM0a:function(e,t,n){},ywyh:function(e,t){!function(){e.exports=this.wp.apiFetch}()}});
dist/vendors/core/admin-notices-api~api~settings.min.js ADDED
@@ -0,0 +1 @@
 
1
+ (window.itsecWebpackJsonP=window.itsecWebpackJsonP||[]).push([[0],{"7W2i":function(t,r,e){var n=e("SksO");t.exports=function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),r&&n(t,r)}},"92Nh":function(t,r){t.exports=function(t,r,e){if(!r.has(t))throw new TypeError("attempted to set private field on non-instance");var n=r.get(t);if(!n.writable)throw new TypeError("attempted to set read only private field");return n.value=e,e}},Bnag:function(t,r){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},EbDI:function(t,r){t.exports=function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}},Ijbi:function(t,r){t.exports=function(t){if(Array.isArray(t)){for(var r=0,e=new Array(t.length);r<t.length;r++)e[r]=t[r];return e}}},J4zp:function(t,r,e){var n=e("wTVA"),o=e("m0LI"),i=e("wkBT");t.exports=function(t,r){return n(t)||o(t,r)||i()}},Nsbk:function(t,r){function e(r){return t.exports=e=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},e(r)}t.exports=e},PJYZ:function(t,r){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}},RIqP:function(t,r,e){var n=e("Ijbi"),o=e("EbDI"),i=e("Bnag");t.exports=function(t){return n(t)||o(t)||i()}},SksO:function(t,r){function e(r,n){return t.exports=e=Object.setPrototypeOf||function(t,r){return t.__proto__=r,t},e(r,n)}t.exports=e},W8MJ:function(t,r){function e(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}},a1gu:function(t,r,e){var n=e("cDf5"),o=e("PJYZ");t.exports=function(t,r){return!r||"object"!==n(r)&&"function"!=typeof r?o(t):r}},cDf5:function(t,r){function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(r){return"function"==typeof Symbol&&"symbol"===e(Symbol.iterator)?t.exports=n=function(t){return e(t)}:t.exports=n=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":e(t)},n(r)}t.exports=n},lSNA:function(t,r){t.exports=function(t,r,e){return r in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}},ls82:function(t,r){!function(r){"use strict";var e,n=Object.prototype,o=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},u=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag",f="object"==typeof t,s=r.regeneratorRuntime;if(s)f&&(t.exports=s);else{(s=r.regeneratorRuntime=f?t.exports:{}).wrap=b;var l="suspendedStart",p="suspendedYield",h="executing",y="completed",v={},m={};m[u]=function(){return this};var d=Object.getPrototypeOf,g=d&&d(d(R([])));g&&g!==n&&o.call(g,u)&&(m=g);var w=L.prototype=E.prototype=Object.create(m);O.prototype=w.constructor=L,L.constructor=O,L[a]=O.displayName="GeneratorFunction",s.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===O||"GeneratorFunction"===(r.displayName||r.name))},s.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,L):(t.__proto__=L,a in t||(t[a]="GeneratorFunction")),t.prototype=Object.create(w),t},s.awrap=function(t){return{__await:t}},S(j.prototype),j.prototype[c]=function(){return this},s.AsyncIterator=j,s.async=function(t,r,e,n){var o=new j(b(t,r,e,n));return s.isGeneratorFunction(r)?o:o.next().then(function(t){return t.done?t.value:o.next()})},S(w),w[a]="Generator",w[u]=function(){return this},w.toString=function(){return"[object Generator]"},s.keys=function(t){var r=[];for(var e in t)r.push(e);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},s.values=R,T.prototype={constructor:T,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!t)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var u=this.tryEntries[i],c=u.completion;if("root"===u.tryLoc)return n("end");if(u.tryLoc<=this.prev){var a=o.call(u,"catchLoc"),f=o.call(u,"finallyLoc");if(a&&f){if(this.prev<u.catchLoc)return n(u.catchLoc,!0);if(this.prev<u.finallyLoc)return n(u.finallyLoc)}else if(a){if(this.prev<u.catchLoc)return n(u.catchLoc,!0)}else{if(!f)throw new Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return n(u.finallyLoc)}}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=r&&r<=i.finallyLoc&&(i=null);var u=i?i.completion:{};return u.type=t,u.arg=r,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(u)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),v},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),P(e),v}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;P(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:R(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}}}function b(t,r,e,n){var o=r&&r.prototype instanceof E?r:E,i=Object.create(o.prototype),u=new T(n||[]);return i._invoke=function(t,r,e){var n=l;return function(o,i){if(n===h)throw new Error("Generator is already running");if(n===y){if("throw"===o)throw i;return N()}for(e.method=o,e.arg=i;;){var u=e.delegate;if(u){var c=_(u,e);if(c){if(c===v)continue;return c}}if("next"===e.method)e.sent=e._sent=e.arg;else if("throw"===e.method){if(n===l)throw n=y,e.arg;e.dispatchException(e.arg)}else"return"===e.method&&e.abrupt("return",e.arg);n=h;var a=x(t,r,e);if("normal"===a.type){if(n=e.done?y:p,a.arg===v)continue;return{value:a.arg,done:e.done}}"throw"===a.type&&(n=y,e.method="throw",e.arg=a.arg)}}}(t,e,u),i}function x(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}function E(){}function O(){}function L(){}function S(t){["next","throw","return"].forEach(function(r){t[r]=function(t){return this._invoke(r,t)}})}function j(t){var r;this._invoke=function(e,n){function i(){return new Promise(function(r,i){!function r(e,n,i,u){var c=x(t[e],t,n);if("throw"!==c.type){var a=c.arg,f=a.value;return f&&"object"==typeof f&&o.call(f,"__await")?Promise.resolve(f.__await).then(function(t){r("next",t,i,u)},function(t){r("throw",t,i,u)}):Promise.resolve(f).then(function(t){a.value=t,i(a)},function(t){return r("throw",t,i,u)})}u(c.arg)}(e,n,r,i)})}return r=r?r.then(i,i):i()}}function _(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,_(t,r),"throw"===r.method))return v;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var o=x(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,v):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function P(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function R(t){if(t){var r=t[u];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function r(){for(;++n<t.length;)if(o.call(t,n))return r.value=t[n],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}return{next:N}}function N(){return{value:e,done:!0}}}(function(){return this||"object"==typeof self&&self}()||Function("return this")())},lwsE:function(t,r){t.exports=function(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}},m0LI:function(t,r){t.exports=function(t,r){var e=[],n=!0,o=!1,i=void 0;try{for(var u,c=t[Symbol.iterator]();!(n=(u=c.next()).done)&&(e.push(u.value),!r||e.length!==r);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==c.return||c.return()}finally{if(o)throw i}}return e}},o0o1:function(t,r,e){t.exports=e("u938")},oShl:function(t,r,e){var n=e("Nsbk"),o=e("SksO"),i=e("xfeJ"),u=e("sXyB");function c(r){var e="function"==typeof Map?new Map:void 0;return t.exports=c=function(t){if(null===t||!i(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return u(t,arguments,n(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),o(r,t)},c(r)}t.exports=c},sXyB:function(t,r,e){var n=e("SksO");function o(r,e,i){return!function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}()?t.exports=o=function(t,r,e){var o=[null];o.push.apply(o,r);var i=new(Function.bind.apply(t,o));return e&&n(i,e.prototype),i}:t.exports=o=Reflect.construct,o.apply(null,arguments)}t.exports=o},tmk3:function(t,r){t.exports=function(t,r){if(!r.has(t))throw new TypeError("attempted to get private field on non-instance");return r.get(t).value}},u938:function(t,r,e){var n=function(){return this||"object"==typeof self&&self}()||Function("return this")(),o=n.regeneratorRuntime&&Object.getOwnPropertyNames(n).indexOf("regeneratorRuntime")>=0,i=o&&n.regeneratorRuntime;if(n.regeneratorRuntime=void 0,t.exports=e("ls82"),o)n.regeneratorRuntime=i;else try{delete n.regeneratorRuntime}catch(t){n.regeneratorRuntime=void 0}},wTVA:function(t,r){t.exports=function(t){if(Array.isArray(t))return t}},wkBT:function(t,r){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},xfeJ:function(t,r){t.exports=function(t){return-1!==Function.toString.call(t).indexOf("[native code]")}}}]);
dist/vendors/core/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden.
dist/vendors/user-groups/api.min.js DELETED
@@ -1 +0,0 @@
1
- (window.itsecWebpackJsonP=window.itsecWebpackJsonP||[]).push([[7],{"7W2i":function(t,e,n){var r=n("SksO");t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&r(t,e)}},"92Nh":function(t,e){t.exports=function(t,e,n){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");var r=e.get(t);if(!r.writable)throw new TypeError("attempted to set read only private field");return r.value=n,n}},Bnag:function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},EbDI:function(t,e){t.exports=function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}},Ijbi:function(t,e){t.exports=function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}},J4zp:function(t,e,n){var r=n("wTVA"),o=n("m0LI"),i=n("wkBT");t.exports=function(t,e){return r(t)||o(t,e)||i()}},MVZn:function(t,e,n){var r=n("lSNA");t.exports=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),o.forEach(function(e){r(t,e,n[e])})}return t}},Nsbk:function(t,e){function n(e){return t.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},n(e)}t.exports=n},PJYZ:function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}},RIqP:function(t,e,n){var r=n("Ijbi"),o=n("EbDI"),i=n("Bnag");t.exports=function(t){return r(t)||o(t)||i()}},SksO:function(t,e){function n(e,r){return t.exports=n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},n(e,r)}t.exports=n},W8MJ:function(t,e){function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}t.exports=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t}},a1gu:function(t,e,n){var r=n("cDf5"),o=n("PJYZ");t.exports=function(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?o(t):e}},cDf5:function(t,e){function n(t){return(n="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(e){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?t.exports=r=function(t){return n(t)}:t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":n(t)},r(e)}t.exports=r},lSNA:function(t,e){t.exports=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},lwsE:function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},m0LI:function(t,e){t.exports=function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var u,f=t[Symbol.iterator]();!(r=(u=f.next()).done)&&(n.push(u.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==f.return||f.return()}finally{if(o)throw i}}return n}},oShl:function(t,e,n){var r=n("Nsbk"),o=n("SksO"),i=n("xfeJ"),u=n("sXyB");function f(e){var n="function"==typeof Map?new Map:void 0;return t.exports=f=function(t){if(null===t||!i(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(t))return n.get(t);n.set(t,e)}function e(){return u(t,arguments,r(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),o(e,t)},f(e)}t.exports=f},pPDe:function(t,e,n){"use strict";var r,o;function i(t){return[t]}function u(){var t={clear:function(){t.head=null}};return t}function f(t,e,n){var r;if(t.length!==e.length)return!1;for(r=n;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}r={},o="undefined"!=typeof WeakMap,e.a=function(t,e){var n,s;function a(){n=o?new WeakMap:u()}function c(){var n,r,o,i,u,a=arguments.length;for(i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];for(u=e.apply(null,i),(n=s(u)).isUniqueByDependants||(n.lastDependants&&!f(u,n.lastDependants,0)&&n.clear(),n.lastDependants=u),r=n.head;r;){if(f(r.args,i,1))return r!==n.head&&(r.prev.next=r.next,r.next&&(r.next.prev=r.prev),r.next=n.head,r.prev=null,n.head.prev=r,n.head=r),r.val;r=r.next}return r={val:t.apply(null,i)},i[0]=null,r.args=i,n.head&&(n.head.prev=r,r.next=n.head),n.head=r,r.val}return e||(e=i),s=o?function(t){var e,o,i,f,s,a=n,c=!0;for(e=0;e<t.length;e++){if(o=t[e],!(s=o)||"object"!=typeof s){c=!1;break}a.has(o)?a=a.get(o):(i=new WeakMap,a.set(o,i),a=i)}return a.has(r)||((f=u()).isUniqueByDependants=c,a.set(r,f)),a.get(r)}:function(){return n},c.getDependants=e,c.clear=a,a(),c}},qPad:function(t,e,n){var r,o;r=this,o=function(){var t={"+":!0,"#":!0,".":!0,"/":!0,";":!0,"?":!0,"&":!0},e={"*":!0};function n(t){return encodeURI(t).replace(/%25[0-9][0-9]/g,function(t){return"%"+t.substring(3)})}function r(t){return t=t.replace(/%../g,""),encodeURIComponent(t)===t}function o(o){var i="";t[o.charAt(0)]&&(i=o.charAt(0),o=o.substring(1));var u="",f="",s=!0,a=!1,c=!1;"+"==i?s=!1:"."==i?(f=".",u="."):"/"==i?(f="/",u="/"):"#"==i?(f="#",s=!1):";"==i?(f=";",u=";",a=!0,c=!0):"?"==i?(f="?",u="&",a=!0):"&"==i&&(f="&",u="&",a=!0);for(var l=[],p=o.split(","),h=[],g={},y=0;y<p.length;y++){var b=p[y],v=null;if(-1!=b.indexOf(":")){var d=b.split(":");b=d[0],v=parseInt(d[1])}for(var m={};e[b.charAt(b.length-1)];)m[b.charAt(b.length-1)]=!0,b=b.substring(0,b.length-1);var x={truncate:v,name:b,suffices:m};h.push(x),g[b]=x,l.push(b)}return{varNames:l,prefix:f,substitution:function(t){for(var e="",r=0,o=0;o<h.length;o++){var i=h[o],l=t(i.name);if(null==l||Array.isArray(l)&&0==l.length||"object"==typeof l&&0==Object.keys(l).length)r++;else if(e+=o==r?f:u||",",Array.isArray(l)){a&&(e+=i.name+"=");for(var p=0;p<l.length;p++)p>0&&(e+=i.suffices["*"]&&u||",",i.suffices["*"]&&a&&(e+=i.name+"=")),e+=s?encodeURIComponent(l[p]).replace(/!/g,"%21"):n(l[p])}else if("object"==typeof l){a&&!i.suffices["*"]&&(e+=i.name+"=");var g=!0;for(var y in l)g||(e+=i.suffices["*"]&&u||","),g=!1,e+=s?encodeURIComponent(y).replace(/!/g,"%21"):n(y),e+=i.suffices["*"]?"=":",",e+=s?encodeURIComponent(l[y]).replace(/!/g,"%21"):n(l[y])}else a&&(e+=i.name,c&&""==l||(e+="=")),null!=i.truncate&&(l=l.substring(0,i.truncate)),e+=s?encodeURIComponent(l).replace(/!/g,"%21"):n(l)}return e},unSubstitution:function(t,e,n){if(f&&(t=t.substring(f.length)),1==h.length&&h[0].suffices["*"]){for(var o=(S=h[0]).name,i=S.suffices["*"]?t.split(u||","):[t],c=s&&-1!=t.indexOf("="),l=1;l<i.length;l++)t=i[l],c&&-1==t.indexOf("=")&&(i[l-1]+=(u||",")+t,i.splice(l,1),l--);for(l=0;l<i.length;l++)t=i[l],s&&-1!=t.indexOf("=")&&(c=!0),1==(d=t.split(",")).length?i[l]=d[0]:i[l]=d;if(a||c){for(var p=e[o]||{},y=0;y<i.length;y++){var b=t;if(!a||b){if("string"==typeof i[y]){var v=(t=i[y]).split("=",1)[0];if(t=t.substring(v.length+1),s){if(n&&!r(t))return;t=decodeURIComponent(t)}b=t}else{if(v=(t=i[y][0]).split("=",1)[0],t=t.substring(v.length+1),s){if(n&&!r(t))return;t=decodeURIComponent(t)}i[y][0]=t,b=i[y]}if(s){if(n&&!r(v))return;v=decodeURIComponent(v)}void 0!==p[v]?Array.isArray(p[v])?p[v].push(b):p[v]=[p[v],b]:p[v]=b}}1==Object.keys(p).length&&void 0!==p[o]?e[o]=p[o]:e[o]=p}else{if(s)for(y=0;y<i.length;y++){var d=i[y];if(Array.isArray(d))for(var m=0;m<d.length;m++){if(n&&!r(d[m]))return;d[m]=decodeURIComponent(d[m])}else{if(n&&!r(d))return;i[y]=decodeURIComponent(d)}}void 0!==e[o]?Array.isArray(e[o])?e[o]=e[o].concat(i):e[o]=[e[o]].concat(i):1!=i.length||S.suffices["*"]?e[o]=i:e[o]=i[0]}}else{i=1==h.length?[t]:t.split(u||",");var x={};for(l=0;l<i.length;l++){for(var w=0;w<h.length-1&&w<l&&!h[w].suffices["*"];w++);if(w!=l){for(var O=h.length-1;O>0&&h.length-O<i.length-l&&!h[O].suffices["*"];O--);h.length-O!=i.length-l?x[l]=w:x[l]=O}else x[l]=l}for(l=0;l<i.length;l++)if((t=i[l])||!a){if(d=t.split(","),c=!1,a){o=(t=d[0]).split("=",1)[0],t=t.substring(o.length+1),d[0]=t;var S=g[o]||h[0]}else o=(S=h[x[l]]).name;for(y=0;y<d.length;y++)if(s){if(n&&!r(d[y]))return;d[y]=decodeURIComponent(d[y])}(a||S.suffices["*"])&&void 0!==e[o]?Array.isArray(e[o])?e[o]=e[o].concat(d):e[o]=[e[o]].concat(d):1!=d.length||S.suffices["*"]?e[o]=d:e[o]=d[0]}}return 1}}}function i(t){if(!(this instanceof i))return new i(t);for(var e=t.split("{"),n=[e.shift()],r=[],u=[],f=[],s=[];e.length>0;){var a=e.shift(),c=a.split("}")[0],l=a.substring(c.length+1),p=o(c);u.push(p.substitution),f.push(p.unSubstitution),r.push(p.prefix),n.push(l),s=s.concat(p.varNames)}this.fill=function(t){if(t&&"function"!=typeof t){var e=t;t=function(t){return e[t]}}for(var r=n[0],o=0;o<u.length;o++){r+=(0,u[o])(t),r+=n[o+1]}return r},this.fromUri=function(t,e){e=e||{};for(var o={},i=0;i<n.length;i++){var u=n[i];if(t.substring(0,u.length)!==u)return;if(t=t.substring(u.length),i>=n.length-1){if(""==t)break;return}var s=r[i];if(!s||t.substring(0,s.length)===s){for(var a=n[i+1],c=i;;){if(c==n.length-2){var l=t.substring(t.length-a.length);if(l!==a)return;var p=t.substring(0,t.length-a.length);t=l}else if(a){var h=t.indexOf(a);p=t.substring(0,h);t=t.substring(h)}else if(r[c+1]){-1===(h=t.indexOf(r[c+1]))&&(h=t.length);p=t.substring(0,h);t=t.substring(h)}else{if(n.length>c+2){a=n[++c+1];continue}p=t;t=""}break}if(!f[i](p,o,e.strict))return}}return o},this.varNames=s,this.template=t}return i.prototype={toString:function(){return this.template},fillFromObject:function(t){return this.fill(t)},test:function(t,e){return!!this.fromUri(t,e)}},i},"function"==typeof define&&define.amd?define("uri-templates",[],o):t.exports?t.exports=o():r.UriTemplate=o()},sXyB:function(t,e,n){var r=n("SksO");function o(e,n,i){return!function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}()?t.exports=o=function(t,e,n){var o=[null];o.push.apply(o,e);var i=new(Function.bind.apply(t,o));return n&&r(i,n.prototype),i}:t.exports=o=Reflect.construct,o.apply(null,arguments)}t.exports=o},tmk3:function(t,e){t.exports=function(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t).value}},wTVA:function(t,e){t.exports=function(t){if(Array.isArray(t))return t}},wkBT:function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},xfeJ:function(t,e){t.exports=function(t){return-1!==Function.toString.call(t).indexOf("[native code]")}}}]);
 
history.txt CHANGED
@@ -884,3 +884,17 @@
884
  Bug Fix: Remove "get_magic_quotes()" call that existed for backwards compatibility with PHP versions 5.3 and earlier. This function call was causing a warning on PHP 7.4.
885
  Bug Fix: Warning when loading the settings page on PHP 7.4.
886
  Bug Fix: Warning when loading the debug page on PHP 7.4.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
884
  Bug Fix: Remove "get_magic_quotes()" call that existed for backwards compatibility with PHP versions 5.3 and earlier. This function call was causing a warning on PHP 7.4.
885
  Bug Fix: Warning when loading the settings page on PHP 7.4.
886
  Bug Fix: Warning when loading the debug page on PHP 7.4.
887
+ 7.7.1 - 2020-04-20 - Timothy Jacobs
888
+ Bug Fix: PHP warning when evaluating password requirements.
889
+ 7.8.0 - 2020-08-13 - Timothy Jacobs
890
+ New Feature: The new, improved WordPress Security Site Scan powered by iThemes checks if Google has detected malware and added your site to their threat list.
891
+ Enhancement: Remove quick bans. Persist banned hosts to .htaccess or nginx.conf on an hourly schedule.
892
+ Tweak: Cap banned hosts persisted to .htaccess or nginx.conf to the most recent 100. This number can be adjusted with the "itsec_ban_users_max_hosts_for_server_config" filter. Older banned hosts will be locked out after WordPress loads.
893
+ Tweak: Ensure randomly generated passwords are considered strong by the Strong Passwords library.
894
+ Tweak: Suggest a 32 character password when forcing a password change.
895
+ Tweak: Change insensitive language to be more inclusive.
896
+ Bug Fix: PHP warning when a user's email address is updated outside of the user edit admin page.
897
+ Bug Fix: Fix login interstitials on WP Engine when using a front-end login form.
898
+ Bug Fix: PHP warning when checking opaque tokens.
899
+ Bug Fix: PHP warning after successfully connecting a site to iThemes Sync via the login connection flow.
900
+ Bug Fix: File Change Security Message would not appear for new installs.
package.json CHANGED
@@ -7,26 +7,26 @@
7
  "extends @wordpress/browserslist-config"
8
  ],
9
  "dependencies": {
10
- "@wordpress/a11y": "*",
11
- "@wordpress/api-fetch": "*",
12
- "@wordpress/autop": "*",
13
- "@wordpress/components": "*",
14
- "@wordpress/compose": "*",
15
- "@wordpress/data": "*",
16
- "@wordpress/date": "*",
17
- "@wordpress/dom-ready": "*",
18
- "@wordpress/element": "*",
19
- "@wordpress/hooks": "*",
20
- "@wordpress/html-entities": "*",
21
- "@wordpress/i18n": "*",
22
- "@wordpress/is-shallow-equal": "*",
23
- "@wordpress/keycodes": "*",
24
- "@wordpress/notices": "*",
25
- "@wordpress/plugins": "*",
26
- "@wordpress/redux-routine": "*",
27
- "@wordpress/rich-text": "*",
28
- "@wordpress/url": "*",
29
- "@wordpress/viewport": "*",
30
  "classnames": "^2.2.6",
31
  "contrast": "^1.0.1",
32
  "li": "^1.3.0",
@@ -34,8 +34,8 @@
34
  "memize": "^1.0.5",
35
  "react": "^16.6.3",
36
  "react-error-boundary": "^1.2.3",
37
- "react-grid-layout": "^0.16.6",
38
- "react-select": "^2.4.1",
39
  "react-transition-group": "^2.0.0",
40
  "recharts": "^1.5.0",
41
  "rememo": "^3.0.0",
@@ -43,18 +43,21 @@
43
  "uuid": "^3.3.3"
44
  },
45
  "devDependencies": {
46
- "@babel/core": "^7.3.3",
47
- "@babel/plugin-proposal-class-properties": "^7.3.3",
48
- "@babel/plugin-proposal-export-default-from": "^7.8.3",
49
- "@babel/plugin-syntax-dynamic-import": "^7.2.0",
50
- "@babel/plugin-transform-react-jsx": "^7.3.0",
51
- "@babel/runtime-corejs2": "^7.3.1",
52
- "@wordpress/babel-plugin-import-jsx-pragma": "^1.1.3",
53
- "@wordpress/babel-preset-default": "^3.0.2",
54
- "@wordpress/browserslist-config": "^2.2.3",
55
- "@wordpress/custom-templated-path-webpack-plugin": "^1.2.0",
56
- "@wordpress/jest-preset-default": "^3.0.0",
57
- "@wordpress/scripts": "^2.4.4",
 
 
 
58
  "acorn": "^6.0.5",
59
  "autoprefixer": "^9.4.7",
60
  "babel-loader": "^8.0.5",
@@ -113,6 +116,7 @@
113
  "test-unit:update": "npm run test-unit -- --updateSnapshot",
114
  "test-unit:watch": "npm run test-unit -- --watch",
115
  "watch": "./node_modules/.bin/webpack --watch",
 
116
  "test-up": "./bin/test-up.sh",
117
  "test-wpunit": "docker-compose exec -T -w /var/www/html/wp-content/plugins/ithemes-security-pro wordpress ./vendor/bin/codecept run wpunit",
118
  "test-acceptance": "docker-compose exec -T -w /var/www/html/wp-content/plugins/ithemes-security-pro wordpress ./vendor/bin/codecept run acceptance",
7
  "extends @wordpress/browserslist-config"
8
  ],
9
  "dependencies": {
10
+ "@wordpress/a11y": "^2.11.0",
11
+ "@wordpress/api-fetch": "^3.18.0",
12
+ "@wordpress/autop": "^2.9.0",
13
+ "@wordpress/components": "^10.0.1",
14
+ "@wordpress/compose": "^3.19.1",
15
+ "@wordpress/data": "^4.22.1",
16
+ "@wordpress/date": "^3.10.0",
17
+ "@wordpress/dom-ready": "^2.10.0",
18
+ "@wordpress/element": "^2.16.0",
19
+ "@wordpress/hooks": "^2.9.0",
20
+ "@wordpress/html-entities": "^2.8.0",
21
+ "@wordpress/i18n": "^3.14.0",
22
+ "@wordpress/is-shallow-equal": "^2.1.0",
23
+ "@wordpress/keycodes": "^2.14.0",
24
+ "@wordpress/notices": "^2.8.1",
25
+ "@wordpress/plugins": "^2.20.1",
26
+ "@wordpress/redux-routine": "^3.10.0",
27
+ "@wordpress/rich-text": "^3.20.1",
28
+ "@wordpress/url": "^2.17.0",
29
+ "@wordpress/viewport": "^2.21.1",
30
  "classnames": "^2.2.6",
31
  "contrast": "^1.0.1",
32
  "li": "^1.3.0",
34
  "memize": "^1.0.5",
35
  "react": "^16.6.3",
36
  "react-error-boundary": "^1.2.3",
37
+ "react-grid-layout": "^0.18.0",
38
+ "react-select": "^3.1.0",
39
  "react-transition-group": "^2.0.0",
40
  "recharts": "^1.5.0",
41
  "rememo": "^3.0.0",
43
  "uuid": "^3.3.3"
44
  },
45
  "devDependencies": {
46
+ "@babel/core": "^7.10.5",
47
+ "@babel/plugin-proposal-class-properties": "^7.10.4",
48
+ "@babel/plugin-proposal-export-default-from": "^7.10.4",
49
+ "@babel/plugin-syntax-dynamic-import": "^7.8.3",
50
+ "@babel/plugin-transform-react-jsx": "^7.10.0",
51
+ "@babel/runtime-corejs2": "^7.10.5",
52
+ "@emotion/core": "^10.0.28",
53
+ "@emotion/styled": "^10.0.27",
54
+ "@emotion/stylis": "^0.8.5",
55
+ "@wordpress/babel-plugin-import-jsx-pragma": "^2.7.0",
56
+ "@wordpress/babel-preset-default": "^4.17.0",
57
+ "@wordpress/browserslist-config": "^2.7.0",
58
+ "@wordpress/custom-templated-path-webpack-plugin": "^1.7.0",
59
+ "@wordpress/jest-preset-default": "^6.2.0",
60
+ "@wordpress/scripts": "^12.1.1",
61
  "acorn": "^6.0.5",
62
  "autoprefixer": "^9.4.7",
63
  "babel-loader": "^8.0.5",
116
  "test-unit:update": "npm run test-unit -- --updateSnapshot",
117
  "test-unit:watch": "npm run test-unit -- --watch",
118
  "watch": "./node_modules/.bin/webpack --watch",
119
+ "packages-update": "wp-scripts packages-update",
120
  "test-up": "./bin/test-up.sh",
121
  "test-wpunit": "docker-compose exec -T -w /var/www/html/wp-content/plugins/ithemes-security-pro wordpress ./vendor/bin/codecept run wpunit",
122
  "test-acceptance": "docker-compose exec -T -w /var/www/html/wp-content/plugins/ithemes-security-pro wordpress ./vendor/bin/codecept run acceptance",
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: ithemes, chrisjean, mattdanner, timothyblynjacobs
3
  Tags: security, security plugin, malware, hack, secure, block, SSL, admin, htaccess, lockdown, login, protect, protection, anti virus, attack, injection, login security, maintenance, permissions, prevention, authentication, administration, password, brute force, ban, permissions, bots, user agents, xml rpc, security log
4
  Requires at least: 5.2
5
- Tested up to: 5.4
6
- Stable tag: 7.7.0
7
  Requires PHP: 5.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -43,9 +43,9 @@ Pro Features:
43
  * wp-cli Integration - Manage your site's security from the command line.
44
 
45
 
46
- = iThemes Sync Integration =
47
 
48
- Manage more than one WordPress site? Manage Away Mode, release lockouts and keep your themes, plugins and WordPress core up to date from one dashboard with iThemes Sync. <a href="http://ithemes.com/sync/">Start managing 10 WordPress sites for free with iThemes Sync</a>.
49
 
50
  = iThemes Brute Force Attack Protection Network =
51
 
@@ -189,6 +189,22 @@ Free support may be available with the help of the community in the <a href="htt
189
 
190
  == Changelog ==
191
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
192
  = 7.7.0 =
193
  * Important: iThemes Security requires PHP 5.6 or greater and WordPress 5.2 or greater.
194
  * New Feature: Save Time Securing WordPress With User Groups!
@@ -590,5 +606,5 @@ Free support may be available with the help of the community in the <a href="htt
590
 
591
  == Upgrade Notice ==
592
 
593
- = 7.7.0 =
594
- Version 7.7.0 contains new features and bug fixes. It is recommended for all users.
2
  Contributors: ithemes, chrisjean, mattdanner, timothyblynjacobs
3
  Tags: security, security plugin, malware, hack, secure, block, SSL, admin, htaccess, lockdown, login, protect, protection, anti virus, attack, injection, login security, maintenance, permissions, prevention, authentication, administration, password, brute force, ban, permissions, bots, user agents, xml rpc, security log
4
  Requires at least: 5.2
5
+ Tested up to: 5.5
6
+ Stable tag: 7.8.0
7
  Requires PHP: 5.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
43
  * wp-cli Integration - Manage your site's security from the command line.
44
 
45
 
46
+ = iThemes Sync Pro Integration =
47
 
48
+ Manage more than one WordPress site? Manage Away Mode, release lockouts and keep your themes, plugins and WordPress core up to date from one dashboard with iThemes Sync Pro. <a href="https://ithemes.com/sync/">Start your free trial of Themes Sync Pro</a>.
49
 
50
  = iThemes Brute Force Attack Protection Network =
51
 
189
 
190
  == Changelog ==
191
 
192
+ = 7.8.0 =
193
+ * New Feature: The new, improved WordPress Security Site Scan powered by iThemes checks if Google has detected malware and added your site to their threat list.
194
+ * Enhancement: Remove quick bans. Persist banned hosts to .htaccess or nginx.conf on an hourly schedule.
195
+ * Tweak: Cap banned hosts persisted to .htaccess or nginx.conf to the most recent 100. This number can be adjusted with the "itsec_ban_users_max_hosts_for_server_config" filter. Older banned hosts will be locked out after WordPress loads.
196
+ * Tweak: Ensure randomly generated passwords are considered strong by the Strong Passwords library.
197
+ * Tweak: Suggest a 32 character password when forcing a password change.
198
+ * Tweak: Change insensitive language to be more inclusive.
199
+ * Bug Fix: PHP warning when a user's email address is updated outside of the user edit admin page.
200
+ * Bug Fix: Fix login interstitials on WP Engine when using a front-end login form.
201
+ * Bug Fix: PHP warning when checking opaque tokens.
202
+ * Bug Fix: PHP warning after successfully connecting a site to iThemes Sync via the login connection flow.
203
+ * Bug Fix: File Change Security Message would not appear for new installs.
204
+
205
+ = 7.7.1 =
206
+ * Bug Fix: PHP warning when evaluating password requirements.
207
+
208
  = 7.7.0 =
209
  * Important: iThemes Security requires PHP 5.6 or greater and WordPress 5.2 or greater.
210
  * New Feature: Save Time Securing WordPress With User Groups!
606
 
607
  == Upgrade Notice ==
608
 
609
+ = 7.8.0 =
610
+ Version 7.8.0 contains new features and bug fixes. It is recommended for all users.
vendor-prod/composer/autoload_classmap.php CHANGED
@@ -15,6 +15,7 @@ return array(
15
  'ITSEC_Admin_Notice_Context' => $baseDir . '/core/lib/admin-notices/class-itsec-admin-notice-context.php',
16
  'ITSEC_Admin_Notice_Globally_Dismissible' => $baseDir . '/core/lib/admin-notices/class-itsec-admin-notice-globally-dismissible.php',
17
  'ITSEC_Admin_Notice_Highlighted_Log' => $baseDir . '/core/lib/admin-notices/class-itsec-admin-notice-highlighted-log.php',
 
18
  'ITSEC_Admin_Notice_Managers_Only' => $baseDir . '/core/lib/admin-notices/class-itsec-admin-notice-managers-only.php',
19
  'ITSEC_Admin_Notice_Network_Brute_Force_Promo' => $baseDir . '/core/modules/global/notices.php',
20
  'ITSEC_Admin_Notice_New_Feature_Core' => $baseDir . '/core/modules/core/notices.php',
@@ -114,7 +115,6 @@ return array(
114
  'ITSEC_IPCheck_Logs' => $baseDir . '/core/modules/ipcheck/logs.php',
115
  'ITSEC_IPCheck_Setup' => $baseDir . '/core/modules/ipcheck/setup.php',
116
  'ITSEC_IP_Detector' => $baseDir . '/core/lib/class-itsec-ip-detector.php',
117
- 'ITSEC_Import_Export_Settings_Page' => $baseDir . '/core/modules/pro/settings-page.php',
118
  'ITSEC_Ithemes_Sync_Upgrader_Skin' => $baseDir . '/core/modules/sync-connect/includes/upgrader-skin.php',
119
  'ITSEC_Job' => $baseDir . '/core/lib/class-itsec-job.php',
120
  'ITSEC_Lib_Admin_Notices' => $baseDir . '/core/lib/class-itsec-lib-admin-notices.php',
@@ -132,6 +132,7 @@ return array(
132
  'ITSEC_Lib_Highlighted_Logs' => $baseDir . '/core/lib/class-itsec-lib-highlighted-logs.php',
133
  'ITSEC_Lib_IP_Detector' => $baseDir . '/core/lib/class-itsec-lib-ip-detector.php',
134
  'ITSEC_Lib_IP_Tools' => $baseDir . '/core/lib/class-itsec-lib-ip-tools.php',
 
135
  'ITSEC_Lib_Login' => $baseDir . '/core/lib/class-itsec-lib-login.php',
136
  'ITSEC_Lib_Login_Interstitial' => $baseDir . '/core/lib/class-itsec-lib-login-interstitial.php',
137
  'ITSEC_Lib_Opaque_Tokens' => $baseDir . '/core/lib/class-itsec-lib-opaque-tokens.php',
@@ -139,6 +140,7 @@ return array(
139
  'ITSEC_Lib_REST' => $baseDir . '/core/lib/class-itsec-lib-rest.php',
140
  'ITSEC_Lib_Remote_Messages' => $baseDir . '/core/lib/class-itsec-lib-remote-messages.php',
141
  'ITSEC_Lib_Static_Map_API' => $baseDir . '/core/lib/class-itsec-lib-static-map-api.php',
 
142
  'ITSEC_Lib_User_Activity' => $baseDir . '/core/lib/class-itsec-lib-user-activity.php',
143
  'ITSEC_Lib_Utility' => $baseDir . '/core/lib/class-itsec-lib-utility.php',
144
  'ITSEC_Log' => $baseDir . '/core/lib/log.php',
@@ -146,15 +148,11 @@ return array(
146
  'ITSEC_Login_Interstitial' => $baseDir . '/core/lib/login-interstitial/abstract-itsec-login-interstitial.php',
147
  'ITSEC_Login_Interstitial_Config_Driven' => $baseDir . '/core/lib/login-interstitial/class-itsec-login-interstitial-config-driven.php',
148
  'ITSEC_Login_Interstitial_Session' => $baseDir . '/core/lib/login-interstitial/class-itsec-login-interstitial-session.php',
149
- 'ITSEC_Magic_Links_Settings_Page' => $baseDir . '/core/modules/pro/settings-page.php',
150
  'ITSEC_Mail' => $baseDir . '/core/lib/class-itsec-mail.php',
151
  'ITSEC_Malware' => $baseDir . '/core/modules/malware/class-itsec-malware.php',
152
  'ITSEC_Malware_Logs' => $baseDir . '/core/modules/malware/logs.php',
153
- 'ITSEC_Malware_Privacy' => $baseDir . '/core/modules/malware/privacy.php',
154
  'ITSEC_Malware_Scan_Results_Template' => $baseDir . '/core/modules/malware/class-itsec-malware-scan-results-template.php',
155
  'ITSEC_Malware_Scanner' => $baseDir . '/core/modules/malware/class-itsec-malware-scanner.php',
156
- 'ITSEC_Malware_Scheduling_Settings_Page' => $baseDir . '/core/modules/pro/settings-page.php',
157
- 'ITSEC_Malware_Setup' => $baseDir . '/core/modules/malware/setup.php',
158
  'ITSEC_Multisite_Tweaks' => $baseDir . '/core/modules/multisite-tweaks/class-itsec-multisite-tweaks.php',
159
  'ITSEC_Multisite_Tweaks_Settings' => $baseDir . '/core/modules/multisite-tweaks/settings.php',
160
  'ITSEC_Multisite_Tweaks_Settings_Page' => $baseDir . '/core/modules/multisite-tweaks/settings-page.php',
@@ -177,13 +175,9 @@ return array(
177
  'ITSEC_Password_Requirements_Settings' => $baseDir . '/core/modules/password-requirements/settings.php',
178
  'ITSEC_Password_Requirements_Settings_Page' => $baseDir . '/core/modules/password-requirements/settings-page.php',
179
  'ITSEC_Password_Requirements_Validator' => $baseDir . '/core/modules/password-requirements/validator.php',
180
- 'ITSEC_Passwordless_Login_Settings_Page' => $baseDir . '/core/modules/pro/settings-page.php',
181
  'ITSEC_Privacy' => $baseDir . '/core/modules/privacy/class-itsec-privacy.php',
182
  'ITSEC_Privacy_Util' => $baseDir . '/core/modules/privacy/util.php',
183
- 'ITSEC_Privilege_Escalation_Settings_Page' => $baseDir . '/core/modules/pro/settings-page.php',
184
- 'ITSEC_Pro_Setup' => $baseDir . '/core/modules/pro/setup.php',
185
  'ITSEC_REST_Core_Admin_Notices_Controller' => $baseDir . '/core/modules/core/class-rest-core-admin-notices-controller.php',
186
- 'ITSEC_Recaptcha_Settings_Page' => $baseDir . '/core/modules/pro/settings-page.php',
187
  'ITSEC_SSL' => $baseDir . '/core/modules/ssl/class-itsec-ssl.php',
188
  'ITSEC_SSL_Admin' => $baseDir . '/core/modules/ssl/class-itsec-ssl-admin.php',
189
  'ITSEC_SSL_Settings' => $baseDir . '/core/modules/ssl/settings.php',
@@ -210,9 +204,18 @@ return array(
210
  'ITSEC_Settings_Page_Sidebar_Widget_BackupBuddy_Cross_Promo' => $baseDir . '/core/modules/core/sidebar-widget-backupbuddy-cross-promo.php',
211
  'ITSEC_Settings_Page_Sidebar_Widget_Free_Support' => $baseDir . '/core/modules/core/sidebar-widget-support.php',
212
  'ITSEC_Settings_Page_Sidebar_Widget_Mail_List_Signup' => $baseDir . '/core/modules/core/sidebar-widget-mail-list-signup.php',
213
- 'ITSEC_Settings_Page_Sidebar_Widget_Malware_Scan' => $baseDir . '/core/modules/malware/settings-page.php',
214
  'ITSEC_Settings_Page_Sidebar_Widget_Pro_Upsell' => $baseDir . '/core/modules/core/sidebar-widget-pro-upsell.php',
 
215
  'ITSEC_Settings_Page_Sidebar_Widget_Sync_Cross_Promo' => $baseDir . '/core/modules/core/sidebar-widget-sync-cross-promo.php',
 
 
 
 
 
 
 
 
 
216
  'ITSEC_Static_Map_API' => $baseDir . '/core/lib/static-map-api/interface-itsec-static-map-api.php',
217
  'ITSEC_Storage' => $baseDir . '/core/lib/storage.php',
218
  'ITSEC_Strong_Passwords' => $baseDir . '/core/modules/strong-passwords/class-itsec-strong-passwords.php',
@@ -227,11 +230,8 @@ return array(
227
  'ITSEC_System_Tweaks_Settings_Page' => $baseDir . '/core/modules/system-tweaks/settings-page.php',
228
  'ITSEC_System_Tweaks_Setup' => $baseDir . '/core/modules/system-tweaks/setup.php',
229
  'ITSEC_System_Tweaks_Validator' => $baseDir . '/core/modules/system-tweaks/validator.php',
230
- 'ITSEC_Two_Factor_Settings_Page' => $baseDir . '/core/modules/pro/settings-page.php',
231
- 'ITSEC_User_Logging_Settings_Page' => $baseDir . '/core/modules/pro/settings-page.php',
232
- 'ITSEC_User_Security_Check_Settings_Page' => $baseDir . '/core/modules/pro/settings-page.php',
233
  'ITSEC_Validator' => $baseDir . '/core/lib/validator.php',
234
- 'ITSEC_Version_Management_Settings_Page' => $baseDir . '/core/modules/pro/settings-page.php',
235
  'ITSEC_WP_List_Table' => $baseDir . '/core/lib/class-itsec-wp-list-table.php',
236
  'ITSEC_WordPress_Salts_Settings' => $baseDir . '/core/modules/salts/settings.php',
237
  'ITSEC_WordPress_Salts_Settings_Page' => $baseDir . '/core/modules/salts/settings-page.php',
@@ -245,11 +245,9 @@ return array(
245
  'ITSEC_Wordpress_Tweaks_Settings' => $baseDir . '/core/modules/wordpress-tweaks/settings.php',
246
  'Ithemes_Sync_Verb_ITSEC_Do_Security_Check' => $baseDir . '/core/modules/security-check/sync-verbs/itsec-do-security-check.php',
247
  'Ithemes_Sync_Verb_ITSEC_Get_Away_Mode' => $baseDir . '/core/modules/away-mode/sync-verbs/itsec-get-away-mode.php',
248
- 'Ithemes_Sync_Verb_ITSEC_Get_Malware_Scan_Log' => $baseDir . '/core/modules/malware/sync-verbs/itsec-get-malware-scan-log.php',
249
  'Ithemes_Sync_Verb_ITSEC_Get_Security_Check_Feedback_Response' => $baseDir . '/core/modules/security-check/sync-verbs/itsec-get-security-check-feedback-response.php',
250
  'Ithemes_Sync_Verb_ITSEC_Get_Security_Check_Modules' => $baseDir . '/core/modules/security-check/sync-verbs/itsec-get-security-check-modules.php',
251
  'Ithemes_Sync_Verb_ITSEC_Latest_File_Scan' => $baseDir . '/core/modules/file-change/sync-verbs/itsec-latest-file-scan.php',
252
- 'Ithemes_Sync_Verb_ITSEC_Malware_Do_Scan' => $baseDir . '/core/modules/malware/sync-verbs/itsec-do-malware-scan.php',
253
  'Ithemes_Sync_Verb_ITSEC_Override_Away_Mode' => $baseDir . '/core/modules/away-mode/sync-verbs/itsec-override-away-mode.php',
254
  'Pimple\\Container' => $vendorDir . '/pimple/pimple/src/Pimple/Container.php',
255
  'Pimple\\Exception\\ExpectedInvokableException' => $vendorDir . '/pimple/pimple/src/Pimple/Exception/ExpectedInvokableException.php',
@@ -296,6 +294,26 @@ return array(
296
  'iThemesSecurity\\Lib\\Lockout\\Lockout' => $baseDir . '/core/lib/lockout/class-lockout.php',
297
  'iThemesSecurity\\Lib\\Lockout\\User_Context' => $baseDir . '/core/lib/lockout/class-user-context.php',
298
  'iThemesSecurity\\Lib\\Lockout\\Username_Context' => $baseDir . '/core/lib/lockout/class-username-context.php',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
299
  'iThemesSecurity\\User_Groups\\All_Users' => $baseDir . '/core/modules/user-groups/All_Users.php',
300
  'iThemesSecurity\\User_Groups\\Default_Matcher' => $baseDir . '/core/modules/user-groups/Match/Default_Matcher.php',
301
  'iThemesSecurity\\User_Groups\\Everybody_Else' => $baseDir . '/core/modules/user-groups/Everybody_Else.php',
15
  'ITSEC_Admin_Notice_Context' => $baseDir . '/core/lib/admin-notices/class-itsec-admin-notice-context.php',
16
  'ITSEC_Admin_Notice_Globally_Dismissible' => $baseDir . '/core/lib/admin-notices/class-itsec-admin-notice-globally-dismissible.php',
17
  'ITSEC_Admin_Notice_Highlighted_Log' => $baseDir . '/core/lib/admin-notices/class-itsec-admin-notice-highlighted-log.php',
18
+ 'ITSEC_Admin_Notice_Licensed_Hostname_Prompt' => $baseDir . '/core/modules/global/notices.php',
19
  'ITSEC_Admin_Notice_Managers_Only' => $baseDir . '/core/lib/admin-notices/class-itsec-admin-notice-managers-only.php',
20
  'ITSEC_Admin_Notice_Network_Brute_Force_Promo' => $baseDir . '/core/modules/global/notices.php',
21
  'ITSEC_Admin_Notice_New_Feature_Core' => $baseDir . '/core/modules/core/notices.php',
115
  'ITSEC_IPCheck_Logs' => $baseDir . '/core/modules/ipcheck/logs.php',
116
  'ITSEC_IPCheck_Setup' => $baseDir . '/core/modules/ipcheck/setup.php',
117
  'ITSEC_IP_Detector' => $baseDir . '/core/lib/class-itsec-ip-detector.php',
 
118
  'ITSEC_Ithemes_Sync_Upgrader_Skin' => $baseDir . '/core/modules/sync-connect/includes/upgrader-skin.php',
119
  'ITSEC_Job' => $baseDir . '/core/lib/class-itsec-job.php',
120
  'ITSEC_Lib_Admin_Notices' => $baseDir . '/core/lib/class-itsec-lib-admin-notices.php',
132
  'ITSEC_Lib_Highlighted_Logs' => $baseDir . '/core/lib/class-itsec-lib-highlighted-logs.php',
133
  'ITSEC_Lib_IP_Detector' => $baseDir . '/core/lib/class-itsec-lib-ip-detector.php',
134
  'ITSEC_Lib_IP_Tools' => $baseDir . '/core/lib/class-itsec-lib-ip-tools.php',
135
+ 'ITSEC_Lib_JWT' => $baseDir . '/core/lib/class-itsec-lib-jwt.php',
136
  'ITSEC_Lib_Login' => $baseDir . '/core/lib/class-itsec-lib-login.php',
137
  'ITSEC_Lib_Login_Interstitial' => $baseDir . '/core/lib/class-itsec-lib-login-interstitial.php',
138
  'ITSEC_Lib_Opaque_Tokens' => $baseDir . '/core/lib/class-itsec-lib-opaque-tokens.php',
140
  'ITSEC_Lib_REST' => $baseDir . '/core/lib/class-itsec-lib-rest.php',
141
  'ITSEC_Lib_Remote_Messages' => $baseDir . '/core/lib/class-itsec-lib-remote-messages.php',
142
  'ITSEC_Lib_Static_Map_API' => $baseDir . '/core/lib/class-itsec-lib-static-map-api.php',
143
+ 'ITSEC_Lib_Upgrader' => $baseDir . '/core/lib/class-itsec-lib-upgrader.php',
144
  'ITSEC_Lib_User_Activity' => $baseDir . '/core/lib/class-itsec-lib-user-activity.php',
145
  'ITSEC_Lib_Utility' => $baseDir . '/core/lib/class-itsec-lib-utility.php',
146
  'ITSEC_Log' => $baseDir . '/core/lib/log.php',
148
  'ITSEC_Login_Interstitial' => $baseDir . '/core/lib/login-interstitial/abstract-itsec-login-interstitial.php',
149
  'ITSEC_Login_Interstitial_Config_Driven' => $baseDir . '/core/lib/login-interstitial/class-itsec-login-interstitial-config-driven.php',
150
  'ITSEC_Login_Interstitial_Session' => $baseDir . '/core/lib/login-interstitial/class-itsec-login-interstitial-session.php',
 
151
  'ITSEC_Mail' => $baseDir . '/core/lib/class-itsec-mail.php',
152
  'ITSEC_Malware' => $baseDir . '/core/modules/malware/class-itsec-malware.php',
153
  'ITSEC_Malware_Logs' => $baseDir . '/core/modules/malware/logs.php',
 
154
  'ITSEC_Malware_Scan_Results_Template' => $baseDir . '/core/modules/malware/class-itsec-malware-scan-results-template.php',
155
  'ITSEC_Malware_Scanner' => $baseDir . '/core/modules/malware/class-itsec-malware-scanner.php',
 
 
156
  'ITSEC_Multisite_Tweaks' => $baseDir . '/core/modules/multisite-tweaks/class-itsec-multisite-tweaks.php',
157
  'ITSEC_Multisite_Tweaks_Settings' => $baseDir . '/core/modules/multisite-tweaks/settings.php',
158
  'ITSEC_Multisite_Tweaks_Settings_Page' => $baseDir . '/core/modules/multisite-tweaks/settings-page.php',
175
  'ITSEC_Password_Requirements_Settings' => $baseDir . '/core/modules/password-requirements/settings.php',
176
  'ITSEC_Password_Requirements_Settings_Page' => $baseDir . '/core/modules/password-requirements/settings-page.php',
177
  'ITSEC_Password_Requirements_Validator' => $baseDir . '/core/modules/password-requirements/validator.php',
 
178
  'ITSEC_Privacy' => $baseDir . '/core/modules/privacy/class-itsec-privacy.php',
179
  'ITSEC_Privacy_Util' => $baseDir . '/core/modules/privacy/util.php',
 
 
180
  'ITSEC_REST_Core_Admin_Notices_Controller' => $baseDir . '/core/modules/core/class-rest-core-admin-notices-controller.php',
 
181
  'ITSEC_SSL' => $baseDir . '/core/modules/ssl/class-itsec-ssl.php',
182
  'ITSEC_SSL_Admin' => $baseDir . '/core/modules/ssl/class-itsec-ssl-admin.php',
183
  'ITSEC_SSL_Settings' => $baseDir . '/core/modules/ssl/settings.php',
204
  'ITSEC_Settings_Page_Sidebar_Widget_BackupBuddy_Cross_Promo' => $baseDir . '/core/modules/core/sidebar-widget-backupbuddy-cross-promo.php',
205
  'ITSEC_Settings_Page_Sidebar_Widget_Free_Support' => $baseDir . '/core/modules/core/sidebar-widget-support.php',
206
  'ITSEC_Settings_Page_Sidebar_Widget_Mail_List_Signup' => $baseDir . '/core/modules/core/sidebar-widget-mail-list-signup.php',
 
207
  'ITSEC_Settings_Page_Sidebar_Widget_Pro_Upsell' => $baseDir . '/core/modules/core/sidebar-widget-pro-upsell.php',
208
+ 'ITSEC_Settings_Page_Sidebar_Widget_Site_Scanner' => $baseDir . '/core/modules/site-scanner/settings-page.php',
209
  'ITSEC_Settings_Page_Sidebar_Widget_Sync_Cross_Promo' => $baseDir . '/core/modules/core/sidebar-widget-sync-cross-promo.php',
210
+ 'ITSEC_Site_Scanner' => $baseDir . '/core/modules/site-scanner/class-itsec-site-scanner.php',
211
+ 'ITSEC_Site_Scanner_API' => $baseDir . '/core/modules/site-scanner/api.php',
212
+ 'ITSEC_Site_Scanner_Logs' => $baseDir . '/core/modules/site-scanner/logs.php',
213
+ 'ITSEC_Site_Scanner_Mail' => $baseDir . '/core/modules/site-scanner/mail.php',
214
+ 'ITSEC_Site_Scanner_Privacy' => $baseDir . '/core/modules/site-scanner/privacy.php',
215
+ 'ITSEC_Site_Scanner_Settings' => $baseDir . '/core/modules/site-scanner/settings.php',
216
+ 'ITSEC_Site_Scanner_Template' => $baseDir . '/core/modules/site-scanner/template.php',
217
+ 'ITSEC_Site_Scanner_Util' => $baseDir . '/core/modules/site-scanner/util.php',
218
+ 'ITSEC_Site_Scanner_Validator' => $baseDir . '/core/modules/site-scanner/validator.php',
219
  'ITSEC_Static_Map_API' => $baseDir . '/core/lib/static-map-api/interface-itsec-static-map-api.php',
220
  'ITSEC_Storage' => $baseDir . '/core/lib/storage.php',
221
  'ITSEC_Strong_Passwords' => $baseDir . '/core/modules/strong-passwords/class-itsec-strong-passwords.php',
230
  'ITSEC_System_Tweaks_Settings_Page' => $baseDir . '/core/modules/system-tweaks/settings-page.php',
231
  'ITSEC_System_Tweaks_Setup' => $baseDir . '/core/modules/system-tweaks/setup.php',
232
  'ITSEC_System_Tweaks_Validator' => $baseDir . '/core/modules/system-tweaks/validator.php',
233
+ 'ITSEC_Upgrader_Skin' => $baseDir . '/core/lib/upgrader-skin.php',
 
 
234
  'ITSEC_Validator' => $baseDir . '/core/lib/validator.php',
 
235
  'ITSEC_WP_List_Table' => $baseDir . '/core/lib/class-itsec-wp-list-table.php',
236
  'ITSEC_WordPress_Salts_Settings' => $baseDir . '/core/modules/salts/settings.php',
237
  'ITSEC_WordPress_Salts_Settings_Page' => $baseDir . '/core/modules/salts/settings-page.php',
245
  'ITSEC_Wordpress_Tweaks_Settings' => $baseDir . '/core/modules/wordpress-tweaks/settings.php',
246
  'Ithemes_Sync_Verb_ITSEC_Do_Security_Check' => $baseDir . '/core/modules/security-check/sync-verbs/itsec-do-security-check.php',
247
  'Ithemes_Sync_Verb_ITSEC_Get_Away_Mode' => $baseDir . '/core/modules/away-mode/sync-verbs/itsec-get-away-mode.php',
 
248
  'Ithemes_Sync_Verb_ITSEC_Get_Security_Check_Feedback_Response' => $baseDir . '/core/modules/security-check/sync-verbs/itsec-get-security-check-feedback-response.php',
249
  'Ithemes_Sync_Verb_ITSEC_Get_Security_Check_Modules' => $baseDir . '/core/modules/security-check/sync-verbs/itsec-get-security-check-modules.php',
250
  'Ithemes_Sync_Verb_ITSEC_Latest_File_Scan' => $baseDir . '/core/modules/file-change/sync-verbs/itsec-latest-file-scan.php',
 
251
  'Ithemes_Sync_Verb_ITSEC_Override_Away_Mode' => $baseDir . '/core/modules/away-mode/sync-verbs/itsec-override-away-mode.php',
252
  'Pimple\\Container' => $vendorDir . '/pimple/pimple/src/Pimple/Container.php',
253
  'Pimple\\Exception\\ExpectedInvokableException' => $vendorDir . '/pimple/pimple/src/Pimple/Exception/ExpectedInvokableException.php',
294
  'iThemesSecurity\\Lib\\Lockout\\Lockout' => $baseDir . '/core/lib/lockout/class-lockout.php',
295
  'iThemesSecurity\\Lib\\Lockout\\User_Context' => $baseDir . '/core/lib/lockout/class-user-context.php',
296
  'iThemesSecurity\\Lib\\Lockout\\Username_Context' => $baseDir . '/core/lib/lockout/class-username-context.php',
297
+ 'iThemesSecurity\\Site_Scanner\\Blacklist' => $baseDir . '/core/modules/site-scanner/Model/Blacklist.php',
298
+ 'iThemesSecurity\\Site_Scanner\\Entry' => $baseDir . '/core/modules/site-scanner/Model/Entry.php',
299
+ 'iThemesSecurity\\Site_Scanner\\Factory' => $baseDir . '/core/modules/site-scanner/Model/Factory.php',
300
+ 'iThemesSecurity\\Site_Scanner\\Fixer' => $baseDir . '/core/modules/site-scanner/Fixer/Fixer.php',
301
+ 'iThemesSecurity\\Site_Scanner\\Issue' => $baseDir . '/core/modules/site-scanner/Model/Issue.php',
302
+ 'iThemesSecurity\\Site_Scanner\\Issue_Trait' => $baseDir . '/core/modules/site-scanner/Model/Issue_Trait.php',
303
+ 'iThemesSecurity\\Site_Scanner\\Malware' => $baseDir . '/core/modules/site-scanner/Model/Malware.php',
304
+ 'iThemesSecurity\\Site_Scanner\\Multi_Fixer' => $baseDir . '/core/modules/site-scanner/Fixer/Multi_Fixer.php',
305
+ 'iThemesSecurity\\Site_Scanner\\REST\\Issues' => $baseDir . '/core/modules/site-scanner/REST/Issues.php',
306
+ 'iThemesSecurity\\Site_Scanner\\REST\\Muted_Issues' => $baseDir . '/core/modules/site-scanner/REST/Muted_Issues.php',
307
+ 'iThemesSecurity\\Site_Scanner\\REST\\REST' => $baseDir . '/core/modules/site-scanner/REST/REST.php',
308
+ 'iThemesSecurity\\Site_Scanner\\REST\\Scans' => $baseDir . '/core/modules/site-scanner/REST/Scans.php',
309
+ 'iThemesSecurity\\Site_Scanner\\Repository\\LatestScanRepository' => $baseDir . '/core/modules/site-scanner/Repository/LatestScanRepository.php',
310
+ 'iThemesSecurity\\Site_Scanner\\Repository\\LogRepository' => $baseDir . '/core/modules/site-scanner/Repository/LogRepository.php',
311
+ 'iThemesSecurity\\Site_Scanner\\Repository\\Options' => $baseDir . '/core/modules/site-scanner/Repository/Options.php',
312
+ 'iThemesSecurity\\Site_Scanner\\Repository\\Repository' => $baseDir . '/core/modules/site-scanner/Repository/Repository.php',
313
+ 'iThemesSecurity\\Site_Scanner\\Scan' => $baseDir . '/core/modules/site-scanner/Model/Scan.php',
314
+ 'iThemesSecurity\\Site_Scanner\\Status' => $baseDir . '/core/modules/site-scanner/Model/Status.php',
315
+ 'iThemesSecurity\\Site_Scanner\\Vulnerability' => $baseDir . '/core/modules/site-scanner/Model/Vulnerability.php',
316
+ 'iThemesSecurity\\Site_Scanner\\Vulnerability_Fixer' => $baseDir . '/core/modules/site-scanner/Fixer/Vulnerability_Fixer.php',
317
  'iThemesSecurity\\User_Groups\\All_Users' => $baseDir . '/core/modules/user-groups/All_Users.php',
318
  'iThemesSecurity\\User_Groups\\Default_Matcher' => $baseDir . '/core/modules/user-groups/Match/Default_Matcher.php',
319
  'iThemesSecurity\\User_Groups\\Everybody_Else' => $baseDir . '/core/modules/user-groups/Everybody_Else.php',
vendor-prod/composer/autoload_static.php CHANGED
@@ -48,6 +48,7 @@ class ComposerStaticInit35a2bd4feb347da0d3ea2d8ef023082f
48
  'ITSEC_Admin_Notice_Context' => __DIR__ . '/../..' . '/core/lib/admin-notices/class-itsec-admin-notice-context.php',
49
  'ITSEC_Admin_Notice_Globally_Dismissible' => __DIR__ . '/../..' . '/core/lib/admin-notices/class-itsec-admin-notice-globally-dismissible.php',
50
  'ITSEC_Admin_Notice_Highlighted_Log' => __DIR__ . '/../..' . '/core/lib/admin-notices/class-itsec-admin-notice-highlighted-log.php',
 
51
  'ITSEC_Admin_Notice_Managers_Only' => __DIR__ . '/../..' . '/core/lib/admin-notices/class-itsec-admin-notice-managers-only.php',
52
  'ITSEC_Admin_Notice_Network_Brute_Force_Promo' => __DIR__ . '/../..' . '/core/modules/global/notices.php',
53
  'ITSEC_Admin_Notice_New_Feature_Core' => __DIR__ . '/../..' . '/core/modules/core/notices.php',
@@ -147,7 +148,6 @@ class ComposerStaticInit35a2bd4feb347da0d3ea2d8ef023082f
147
  'ITSEC_IPCheck_Logs' => __DIR__ . '/../..' . '/core/modules/ipcheck/logs.php',
148
  'ITSEC_IPCheck_Setup' => __DIR__ . '/../..' . '/core/modules/ipcheck/setup.php',
149
  'ITSEC_IP_Detector' => __DIR__ . '/../..' . '/core/lib/class-itsec-ip-detector.php',
150
- 'ITSEC_Import_Export_Settings_Page' => __DIR__ . '/../..' . '/core/modules/pro/settings-page.php',
151
  'ITSEC_Ithemes_Sync_Upgrader_Skin' => __DIR__ . '/../..' . '/core/modules/sync-connect/includes/upgrader-skin.php',
152
  'ITSEC_Job' => __DIR__ . '/../..' . '/core/lib/class-itsec-job.php',
153
  'ITSEC_Lib_Admin_Notices' => __DIR__ . '/../..' . '/core/lib/class-itsec-lib-admin-notices.php',
@@ -165,6 +165,7 @@ class ComposerStaticInit35a2bd4feb347da0d3ea2d8ef023082f
165
  'ITSEC_Lib_Highlighted_Logs' => __DIR__ . '/../..' . '/core/lib/class-itsec-lib-highlighted-logs.php',
166
  'ITSEC_Lib_IP_Detector' => __DIR__ . '/../..' . '/core/lib/class-itsec-lib-ip-detector.php',
167
  'ITSEC_Lib_IP_Tools' => __DIR__ . '/../..' . '/core/lib/class-itsec-lib-ip-tools.php',
 
168
  'ITSEC_Lib_Login' => __DIR__ . '/../..' . '/core/lib/class-itsec-lib-login.php',
169
  'ITSEC_Lib_Login_Interstitial' => __DIR__ . '/../..' . '/core/lib/class-itsec-lib-login-interstitial.php',
170
  'ITSEC_Lib_Opaque_Tokens' => __DIR__ . '/../..' . '/core/lib/class-itsec-lib-opaque-tokens.php',
@@ -172,6 +173,7 @@ class ComposerStaticInit35a2bd4feb347da0d3ea2d8ef023082f
172
  'ITSEC_Lib_REST' => __DIR__ . '/../..' . '/core/lib/class-itsec-lib-rest.php',
173
  'ITSEC_Lib_Remote_Messages' => __DIR__ . '/../..' . '/core/lib/class-itsec-lib-remote-messages.php',
174
  'ITSEC_Lib_Static_Map_API' => __DIR__ . '/../..' . '/core/lib/class-itsec-lib-static-map-api.php',
 
175
  'ITSEC_Lib_User_Activity' => __DIR__ . '/../..' . '/core/lib/class-itsec-lib-user-activity.php',
176
  'ITSEC_Lib_Utility' => __DIR__ . '/../..' . '/core/lib/class-itsec-lib-utility.php',
177
  'ITSEC_Log' => __DIR__ . '/../..' . '/core/lib/log.php',
@@ -179,15 +181,11 @@ class ComposerStaticInit35a2bd4feb347da0d3ea2d8ef023082f
179
  'ITSEC_Login_Interstitial' => __DIR__ . '/../..' . '/core/lib/login-interstitial/abstract-itsec-login-interstitial.php',
180
  'ITSEC_Login_Interstitial_Config_Driven' => __DIR__ . '/../..' . '/core/lib/login-interstitial/class-itsec-login-interstitial-config-driven.php',
181
  'ITSEC_Login_Interstitial_Session' => __DIR__ . '/../..' . '/core/lib/login-interstitial/class-itsec-login-interstitial-session.php',
182
- 'ITSEC_Magic_Links_Settings_Page' => __DIR__ . '/../..' . '/core/modules/pro/settings-page.php',
183
  'ITSEC_Mail' => __DIR__ . '/../..' . '/core/lib/class-itsec-mail.php',
184
  'ITSEC_Malware' => __DIR__ . '/../..' . '/core/modules/malware/class-itsec-malware.php',
185
  'ITSEC_Malware_Logs' => __DIR__ . '/../..' . '/core/modules/malware/logs.php',
186
- 'ITSEC_Malware_Privacy' => __DIR__ . '/../..' . '/core/modules/malware/privacy.php',
187
  'ITSEC_Malware_Scan_Results_Template' => __DIR__ . '/../..' . '/core/modules/malware/class-itsec-malware-scan-results-template.php',
188
  'ITSEC_Malware_Scanner' => __DIR__ . '/../..' . '/core/modules/malware/class-itsec-malware-scanner.php',
189
- 'ITSEC_Malware_Scheduling_Settings_Page' => __DIR__ . '/../..' . '/core/modules/pro/settings-page.php',
190
- 'ITSEC_Malware_Setup' => __DIR__ . '/../..' . '/core/modules/malware/setup.php',
191
  'ITSEC_Multisite_Tweaks' => __DIR__ . '/../..' . '/core/modules/multisite-tweaks/class-itsec-multisite-tweaks.php',
192
  'ITSEC_Multisite_Tweaks_Settings' => __DIR__ . '/../..' . '/core/modules/multisite-tweaks/settings.php',
193
  'ITSEC_Multisite_Tweaks_Settings_Page' => __DIR__ . '/../..' . '/core/modules/multisite-tweaks/settings-page.php',
@@ -210,13 +208,9 @@ class ComposerStaticInit35a2bd4feb347da0d3ea2d8ef023082f
210
  'ITSEC_Password_Requirements_Settings' => __DIR__ . '/../..' . '/core/modules/password-requirements/settings.php',
211
  'ITSEC_Password_Requirements_Settings_Page' => __DIR__ . '/../..' . '/core/modules/password-requirements/settings-page.php',
212
  'ITSEC_Password_Requirements_Validator' => __DIR__ . '/../..' . '/core/modules/password-requirements/validator.php',
213
- 'ITSEC_Passwordless_Login_Settings_Page' => __DIR__ . '/../..' . '/core/modules/pro/settings-page.php',
214
  'ITSEC_Privacy' => __DIR__ . '/../..' . '/core/modules/privacy/class-itsec-privacy.php',
215
  'ITSEC_Privacy_Util' => __DIR__ . '/../..' . '/core/modules/privacy/util.php',
216
- 'ITSEC_Privilege_Escalation_Settings_Page' => __DIR__ . '/../..' . '/core/modules/pro/settings-page.php',
217
- 'ITSEC_Pro_Setup' => __DIR__ . '/../..' . '/core/modules/pro/setup.php',
218
  'ITSEC_REST_Core_Admin_Notices_Controller' => __DIR__ . '/../..' . '/core/modules/core/class-rest-core-admin-notices-controller.php',
219
- 'ITSEC_Recaptcha_Settings_Page' => __DIR__ . '/../..' . '/core/modules/pro/settings-page.php',
220
  'ITSEC_SSL' => __DIR__ . '/../..' . '/core/modules/ssl/class-itsec-ssl.php',
221
  'ITSEC_SSL_Admin' => __DIR__ . '/../..' . '/core/modules/ssl/class-itsec-ssl-admin.php',
222
  'ITSEC_SSL_Settings' => __DIR__ . '/../..' . '/core/modules/ssl/settings.php',
@@ -243,9 +237,18 @@ class ComposerStaticInit35a2bd4feb347da0d3ea2d8ef023082f
243
  'ITSEC_Settings_Page_Sidebar_Widget_BackupBuddy_Cross_Promo' => __DIR__ . '/../..' . '/core/modules/core/sidebar-widget-backupbuddy-cross-promo.php',
244
  'ITSEC_Settings_Page_Sidebar_Widget_Free_Support' => __DIR__ . '/../..' . '/core/modules/core/sidebar-widget-support.php',
245
  'ITSEC_Settings_Page_Sidebar_Widget_Mail_List_Signup' => __DIR__ . '/../..' . '/core/modules/core/sidebar-widget-mail-list-signup.php',
246
- 'ITSEC_Settings_Page_Sidebar_Widget_Malware_Scan' => __DIR__ . '/../..' . '/core/modules/malware/settings-page.php',
247
  'ITSEC_Settings_Page_Sidebar_Widget_Pro_Upsell' => __DIR__ . '/../..' . '/core/modules/core/sidebar-widget-pro-upsell.php',
 
248
  'ITSEC_Settings_Page_Sidebar_Widget_Sync_Cross_Promo' => __DIR__ . '/../..' . '/core/modules/core/sidebar-widget-sync-cross-promo.php',
 
 
 
 
 
 
 
 
 
249
  'ITSEC_Static_Map_API' => __DIR__ . '/../..' . '/core/lib/static-map-api/interface-itsec-static-map-api.php',
250
  'ITSEC_Storage' => __DIR__ . '/../..' . '/core/lib/storage.php',
251
  'ITSEC_Strong_Passwords' => __DIR__ . '/../..' . '/core/modules/strong-passwords/class-itsec-strong-passwords.php',
@@ -260,11 +263,8 @@ class ComposerStaticInit35a2bd4feb347da0d3ea2d8ef023082f
260
  'ITSEC_System_Tweaks_Settings_Page' => __DIR__ . '/../..' . '/core/modules/system-tweaks/settings-page.php',
261
  'ITSEC_System_Tweaks_Setup' => __DIR__ . '/../..' . '/core/modules/system-tweaks/setup.php',
262
  'ITSEC_System_Tweaks_Validator' => __DIR__ . '/../..' . '/core/modules/system-tweaks/validator.php',
263
- 'ITSEC_Two_Factor_Settings_Page' => __DIR__ . '/../..' . '/core/modules/pro/settings-page.php',
264
- 'ITSEC_User_Logging_Settings_Page' => __DIR__ . '/../..' . '/core/modules/pro/settings-page.php',
265
- 'ITSEC_User_Security_Check_Settings_Page' => __DIR__ . '/../..' . '/core/modules/pro/settings-page.php',
266
  'ITSEC_Validator' => __DIR__ . '/../..' . '/core/lib/validator.php',
267
- 'ITSEC_Version_Management_Settings_Page' => __DIR__ . '/../..' . '/core/modules/pro/settings-page.php',
268
  'ITSEC_WP_List_Table' => __DIR__ . '/../..' . '/core/lib/class-itsec-wp-list-table.php',
269
  'ITSEC_WordPress_Salts_Settings' => __DIR__ . '/../..' . '/core/modules/salts/settings.php',
270
  'ITSEC_WordPress_Salts_Settings_Page' => __DIR__ . '/../..' . '/core/modules/salts/settings-page.php',
@@ -278,11 +278,9 @@ class ComposerStaticInit35a2bd4feb347da0d3ea2d8ef023082f
278
  'ITSEC_Wordpress_Tweaks_Settings' => __DIR__ . '/../..' . '/core/modules/wordpress-tweaks/settings.php',
279
  'Ithemes_Sync_Verb_ITSEC_Do_Security_Check' => __DIR__ . '/../..' . '/core/modules/security-check/sync-verbs/itsec-do-security-check.php',
280
  'Ithemes_Sync_Verb_ITSEC_Get_Away_Mode' => __DIR__ . '/../..' . '/core/modules/away-mode/sync-verbs/itsec-get-away-mode.php',
281
- 'Ithemes_Sync_Verb_ITSEC_Get_Malware_Scan_Log' => __DIR__ . '/../..' . '/core/modules/malware/sync-verbs/itsec-get-malware-scan-log.php',
282
  'Ithemes_Sync_Verb_ITSEC_Get_Security_Check_Feedback_Response' => __DIR__ . '/../..' . '/core/modules/security-check/sync-verbs/itsec-get-security-check-feedback-response.php',
283
  'Ithemes_Sync_Verb_ITSEC_Get_Security_Check_Modules' => __DIR__ . '/../..' . '/core/modules/security-check/sync-verbs/itsec-get-security-check-modules.php',
284
  'Ithemes_Sync_Verb_ITSEC_Latest_File_Scan' => __DIR__ . '/../..' . '/core/modules/file-change/sync-verbs/itsec-latest-file-scan.php',
285
- 'Ithemes_Sync_Verb_ITSEC_Malware_Do_Scan' => __DIR__ . '/../..' . '/core/modules/malware/sync-verbs/itsec-do-malware-scan.php',
286
  'Ithemes_Sync_Verb_ITSEC_Override_Away_Mode' => __DIR__ . '/../..' . '/core/modules/away-mode/sync-verbs/itsec-override-away-mode.php',
287
  'Pimple\\Container' => __DIR__ . '/..' . '/pimple/pimple/src/Pimple/Container.php',
288
  'Pimple\\Exception\\ExpectedInvokableException' => __DIR__ . '/..' . '/pimple/pimple/src/Pimple/Exception/ExpectedInvokableException.php',
@@ -329,6 +327,26 @@ class ComposerStaticInit35a2bd4feb347da0d3ea2d8ef023082f
329
  'iThemesSecurity\\Lib\\Lockout\\Lockout' => __DIR__ . '/../..' . '/core/lib/lockout/class-lockout.php',
330
  'iThemesSecurity\\Lib\\Lockout\\User_Context' => __DIR__ . '/../..' . '/core/lib/lockout/class-user-context.php',
331
  'iThemesSecurity\\Lib\\Lockout\\Username_Context' => __DIR__ . '/../..' . '/core/lib/lockout/class-username-context.php',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
332
  'iThemesSecurity\\User_Groups\\All_Users' => __DIR__ . '/../..' . '/core/modules/user-groups/All_Users.php',
333
  'iThemesSecurity\\User_Groups\\Default_Matcher' => __DIR__ . '/../..' . '/core/modules/user-groups/Match/Default_Matcher.php',
334
  'iThemesSecurity\\User_Groups\\Everybody_Else' => __DIR__ . '/../..' . '/core/modules/user-groups/Everybody_Else.php',
48
  'ITSEC_Admin_Notice_Context' => __DIR__ . '/../..' . '/core/lib/admin-notices/class-itsec-admin-notice-context.php',
49
  'ITSEC_Admin_Notice_Globally_Dismissible' => __DIR__ . '/../..' . '/core/lib/admin-notices/class-itsec-admin-notice-globally-dismissible.php',
50
  'ITSEC_Admin_Notice_Highlighted_Log' => __DIR__ . '/../..' . '/core/lib/admin-notices/class-itsec-admin-notice-highlighted-log.php',
51
+ 'ITSEC_Admin_Notice_Licensed_Hostname_Prompt' => __DIR__ . '/../..' . '/core/modules/global/notices.php',
52
  'ITSEC_Admin_Notice_Managers_Only' => __DIR__ . '/../..' . '/core/lib/admin-notices/class-itsec-admin-notice-managers-only.php',
53
  'ITSEC_Admin_Notice_Network_Brute_Force_Promo' => __DIR__ . '/../..' . '/core/modules/global/notices.php',
54
  'ITSEC_Admin_Notice_New_Feature_Core' => __DIR__ . '/../..' . '/core/modules/core/notices.php',
148
  'ITSEC_IPCheck_Logs' => __DIR__ . '/../..' . '/core/modules/ipcheck/logs.php',
149
  'ITSEC_IPCheck_Setup' => __DIR__ . '/../..' . '/core/modules/ipcheck/setup.php',
150
  'ITSEC_IP_Detector' => __DIR__ . '/../..' . '/core/lib/class-itsec-ip-detector.php',
 
151
  'ITSEC_Ithemes_Sync_Upgrader_Skin' => __DIR__ . '/../..' . '/core/modules/sync-connect/includes/upgrader-skin.php',
152
  'ITSEC_Job' => __DIR__ . '/../..' . '/core/lib/class-itsec-job.php',
153
  'ITSEC_Lib_Admin_Notices' => __DIR__ . '/../..' . '/core/lib/class-itsec-lib-admin-notices.php',
165
  'ITSEC_Lib_Highlighted_Logs' => __DIR__ . '/../..' . '/core/lib/class-itsec-lib-highlighted-logs.php',
166
  'ITSEC_Lib_IP_Detector' => __DIR__ . '/../..' . '/core/lib/class-itsec-lib-ip-detector.php',
167
  'ITSEC_Lib_IP_Tools' => __DIR__ . '/../..' . '/core/lib/class-itsec-lib-ip-tools.php',
168
+ 'ITSEC_Lib_JWT' => __DIR__ . '/../..' . '/core/lib/class-itsec-lib-jwt.php',
169
  'ITSEC_Lib_Login' => __DIR__ . '/../..' . '/core/lib/class-itsec-lib-login.php',
170
  'ITSEC_Lib_Login_Interstitial' => __DIR__ . '/../..' . '/core/lib/class-itsec-lib-login-interstitial.php',
171
  'ITSEC_Lib_Opaque_Tokens' => __DIR__ . '/../..' . '/core/lib/class-itsec-lib-opaque-tokens.php',
173
  'ITSEC_Lib_REST' => __DIR__ . '/../..' . '/core/lib/class-itsec-lib-rest.php',
174
  'ITSEC_Lib_Remote_Messages' => __DIR__ . '/../..' . '/core/lib/class-itsec-lib-remote-messages.php',
175
  'ITSEC_Lib_Static_Map_API' => __DIR__ . '/../..' . '/core/lib/class-itsec-lib-static-map-api.php',
176
+ 'ITSEC_Lib_Upgrader' => __DIR__ . '/../..' . '/core/lib/class-itsec-lib-upgrader.php',
177
  'ITSEC_Lib_User_Activity' => __DIR__ . '/../..' . '/core/lib/class-itsec-lib-user-activity.php',
178
  'ITSEC_Lib_Utility' => __DIR__ . '/../..' . '/core/lib/class-itsec-lib-utility.php',
179
  'ITSEC_Log' => __DIR__ . '/../..' . '/core/lib/log.php',
181
  'ITSEC_Login_Interstitial' => __DIR__ . '/../..' . '/core/lib/login-interstitial/abstract-itsec-login-interstitial.php',
182
  'ITSEC_Login_Interstitial_Config_Driven' => __DIR__ . '/../..' . '/core/lib/login-interstitial/class-itsec-login-interstitial-config-driven.php',
183
  'ITSEC_Login_Interstitial_Session' => __DIR__ . '/../..' . '/core/lib/login-interstitial/class-itsec-login-interstitial-session.php',
 
184
  'ITSEC_Mail' => __DIR__ . '/../..' . '/core/lib/class-itsec-mail.php',
185
  'ITSEC_Malware' => __DIR__ . '/../..' . '/core/modules/malware/class-itsec-malware.php',
186
  'ITSEC_Malware_Logs' => __DIR__ . '/../..' . '/core/modules/malware/logs.php',
 
187
  'ITSEC_Malware_Scan_Results_Template' => __DIR__ . '/../..' . '/core/modules/malware/class-itsec-malware-scan-results-template.php',
188
  'ITSEC_Malware_Scanner' => __DIR__ . '/../..' . '/core/modules/malware/class-itsec-malware-scanner.php',
 
 
189
  'ITSEC_Multisite_Tweaks' => __DIR__ . '/../..' . '/core/modules/multisite-tweaks/class-itsec-multisite-tweaks.php',
190
  'ITSEC_Multisite_Tweaks_Settings' => __DIR__ . '/../..' . '/core/modules/multisite-tweaks/settings.php',
191
  'ITSEC_Multisite_Tweaks_Settings_Page' => __DIR__ . '/../..' . '/core/modules/multisite-tweaks/settings-page.php',
208
  'ITSEC_Password_Requirements_Settings' => __DIR__ . '/../..' . '/core/modules/password-requirements/settings.php',
209
  'ITSEC_Password_Requirements_Settings_Page' => __DIR__ . '/../..' . '/core/modules/password-requirements/settings-page.php',
210
  'ITSEC_Password_Requirements_Validator' => __DIR__ . '/../..' . '/core/modules/password-requirements/validator.php',
 
211
  'ITSEC_Privacy' => __DIR__ . '/../..' . '/core/modules/privacy/class-itsec-privacy.php',
212
  'ITSEC_Privacy_Util' => __DIR__ . '/../..' . '/core/modules/privacy/util.php',
 
 
213
  'ITSEC_REST_Core_Admin_Notices_Controller' => __DIR__ . '/../..' . '/core/modules/core/class-rest-core-admin-notices-controller.php',
 
214
  'ITSEC_SSL' => __DIR__ . '/../..' . '/core/modules/ssl/class-itsec-ssl.php',
215
  'ITSEC_SSL_Admin' => __DIR__ . '/../..' . '/core/modules/ssl/class-itsec-ssl-admin.php',
216
  'ITSEC_SSL_Settings' => __DIR__ . '/../..' . '/core/modules/ssl/settings.php',
237
  'ITSEC_Settings_Page_Sidebar_Widget_BackupBuddy_Cross_Promo' => __DIR__ . '/../..' . '/core/modules/core/sidebar-widget-backupbuddy-cross-promo.php',
238
  'ITSEC_Settings_Page_Sidebar_Widget_Free_Support' => __DIR__ . '/../..' . '/core/modules/core/sidebar-widget-support.php',
239
  'ITSEC_Settings_Page_Sidebar_Widget_Mail_List_Signup' => __DIR__ . '/../..' . '/core/modules/core/sidebar-widget-mail-list-signup.php',
 
240
  'ITSEC_Settings_Page_Sidebar_Widget_Pro_Upsell' => __DIR__ . '/../..' . '/core/modules/core/sidebar-widget-pro-upsell.php',
241
+ 'ITSEC_Settings_Page_Sidebar_Widget_Site_Scanner' => __DIR__ . '/../..' . '/core/modules/site-scanner/settings-page.php',
242
  'ITSEC_Settings_Page_Sidebar_Widget_Sync_Cross_Promo' => __DIR__ . '/../..' . '/core/modules/core/sidebar-widget-sync-cross-promo.php',
243
+ 'ITSEC_Site_Scanner' => __DIR__ . '/../..' . '/core/modules/site-scanner/class-itsec-site-scanner.php',
244
+ 'ITSEC_Site_Scanner_API' => __DIR__ . '/../..' . '/core/modules/site-scanner/api.php',
245
+ 'ITSEC_Site_Scanner_Logs' => __DIR__ . '/../..' . '/core/modules/site-scanner/logs.php',
246
+ 'ITSEC_Site_Scanner_Mail' => __DIR__ . '/../..' . '/core/modules/site-scanner/mail.php',
247
+ 'ITSEC_Site_Scanner_Privacy' => __DIR__ . '/../..' . '/core/modules/site-scanner/privacy.php',
248
+ 'ITSEC_Site_Scanner_Settings' => __DIR__ . '/../..' . '/core/modules/site-scanner/settings.php',
249
+ 'ITSEC_Site_Scanner_Template' => __DIR__ . '/../..' . '/core/modules/site-scanner/template.php',
250
+ 'ITSEC_Site_Scanner_Util' => __DIR__ . '/../..' . '/core/modules/site-scanner/util.php',
251
+ 'ITSEC_Site_Scanner_Validator' => __DIR__ . '/../..' . '/core/modules/site-scanner/validator.php',
252
  'ITSEC_Static_Map_API' => __DIR__ . '/../..' . '/core/lib/static-map-api/interface-itsec-static-map-api.php',
253
  'ITSEC_Storage' => __DIR__ . '/../..' . '/core/lib/storage.php',
254
  'ITSEC_Strong_Passwords' => __DIR__ . '/../..' . '/core/modules/strong-passwords/class-itsec-strong-passwords.php',
263
  'ITSEC_System_Tweaks_Settings_Page' => __DIR__ . '/../..' . '/core/modules/system-tweaks/settings-page.php',
264
  'ITSEC_System_Tweaks_Setup' => __DIR__ . '/../..' . '/core/modules/system-tweaks/setup.php',
265
  'ITSEC_System_Tweaks_Validator' => __DIR__ . '/../..' . '/core/modules/system-tweaks/validator.php',
266
+ 'ITSEC_Upgrader_Skin' => __DIR__ . '/../..' . '/core/lib/upgrader-skin.php',
 
 
267
  'ITSEC_Validator' => __DIR__ . '/../..' . '/core/lib/validator.php',
 
268
  'ITSEC_WP_List_Table' => __DIR__ . '/../..' . '/core/lib/class-itsec-wp-list-table.php',
269
  'ITSEC_WordPress_Salts_Settings' => __DIR__ . '/../..' . '/core/modules/salts/settings.php',
270
  'ITSEC_WordPress_Salts_Settings_Page' => __DIR__ . '/../..' . '/core/modules/salts/settings-page.php',
278
  'ITSEC_Wordpress_Tweaks_Settings' => __DIR__ . '/../..' . '/core/modules/wordpress-tweaks/settings.php',
279
  'Ithemes_Sync_Verb_ITSEC_Do_Security_Check' => __DIR__ . '/../..' . '/core/modules/security-check/sync-verbs/itsec-do-security-check.php',
280
  'Ithemes_Sync_Verb_ITSEC_Get_Away_Mode' => __DIR__ . '/../..' . '/core/modules/away-mode/sync-verbs/itsec-get-away-mode.php',
 
281
  'Ithemes_Sync_Verb_ITSEC_Get_Security_Check_Feedback_Response' => __DIR__ . '/../..' . '/core/modules/security-check/sync-verbs/itsec-get-security-check-feedback-response.php',
282
  'Ithemes_Sync_Verb_ITSEC_Get_Security_Check_Modules' => __DIR__ . '/../..' . '/core/modules/security-check/sync-verbs/itsec-get-security-check-modules.php',
283
  'Ithemes_Sync_Verb_ITSEC_Latest_File_Scan' => __DIR__ . '/../..' . '/core/modules/file-change/sync-verbs/itsec-latest-file-scan.php',
 
284
  'Ithemes_Sync_Verb_ITSEC_Override_Away_Mode' => __DIR__ . '/../..' . '/core/modules/away-mode/sync-verbs/itsec-override-away-mode.php',
285
  'Pimple\\Container' => __DIR__ . '/..' . '/pimple/pimple/src/Pimple/Container.php',
286
  'Pimple\\Exception\\ExpectedInvokableException' => __DIR__ . '/..' . '/pimple/pimple/src/Pimple/Exception/ExpectedInvokableException.php',
327
  'iThemesSecurity\\Lib\\Lockout\\Lockout' => __DIR__ . '/../..' . '/core/lib/lockout/class-lockout.php',
328
  'iThemesSecurity\\Lib\\Lockout\\User_Context' => __DIR__ . '/../..' . '/core/lib/lockout/class-user-context.php',
329
  'iThemesSecurity\\Lib\\Lockout\\Username_Context' => __DIR__ . '/../..' . '/core/lib/lockout/class-username-context.php',
330
+ 'iThemesSecurity\\Site_Scanner\\Blacklist' => __DIR__ . '/../..' . '/core/modules/site-scanner/Model/Blacklist.php',
331
+ 'iThemesSecurity\\Site_Scanner\\Entry' => __DIR__ . '/../..' . '/core/modules/site-scanner/Model/Entry.php',
332
+ 'iThemesSecurity\\Site_Scanner\\Factory' => __DIR__ . '/../..' . '/core/modules/site-scanner/Model/Factory.php',
333
+ 'iThemesSecurity\\Site_Scanner\\Fixer' => __DIR__ . '/../..' . '/core/modules/site-scanner/Fixer/Fixer.php',
334
+ 'iThemesSecurity\\Site_Scanner\\Issue' => __DIR__ . '/../..' . '/core/modules/site-scanner/Model/Issue.php',
335
+ 'iThemesSecurity\\Site_Scanner\\Issue_Trait' => __DIR__ . '/../..' . '/core/modules/site-scanner/Model/Issue_Trait.php',
336
+ 'iThemesSecurity\\Site_Scanner\\Malware' => __DIR__ . '/../..' . '/core/modules/site-scanner/Model/Malware.php',
337
+ 'iThemesSecurity\\Site_Scanner\\Multi_Fixer' => __DIR__ . '/../..' . '/core/modules/site-scanner/Fixer/Multi_Fixer.php',
338
+ 'iThemesSecurity\\Site_Scanner\\REST\\Issues' => __DIR__ . '/../..' . '/core/modules/site-scanner/REST/Issues.php',
339
+ 'iThemesSecurity\\Site_Scanner\\REST\\Muted_Issues' => __DIR__ . '/../..' . '/core/modules/site-scanner/REST/Muted_Issues.php',
340
+ 'iThemesSecurity\\Site_Scanner\\REST\\REST' => __DIR__ . '/../..' . '/core/modules/site-scanner/REST/REST.php',
341
+ 'iThemesSecurity\\Site_Scanner\\REST\\Scans' => __DIR__ . '/../..' . '/core/modules/site-scanner/REST/Scans.php',
342
+ 'iThemesSecurity\\Site_Scanner\\Repository\\LatestScanRepository' => __DIR__ . '/../..' . '/core/modules/site-scanner/Repository/LatestScanRepository.php',
343
+ 'iThemesSecurity\\Site_Scanner\\Repository\\LogRepository' => __DIR__ . '/../..' . '/core/modules/site-scanner/Repository/LogRepository.php',
344
+ 'iThemesSecurity\\Site_Scanner\\Repository\\Options' => __DIR__ . '/../..' . '/core/modules/site-scanner/Repository/Options.php',
345
+ 'iThemesSecurity\\Site_Scanner\\Repository\\Repository' => __DIR__ . '/../..' . '/core/modules/site-scanner/Repository/Repository.php',
346
+ 'iThemesSecurity\\Site_Scanner\\Scan' => __DIR__ . '/../..' . '/core/modules/site-scanner/Model/Scan.php',
347
+ 'iThemesSecurity\\Site_Scanner\\Status' => __DIR__ . '/../..' . '/core/modules/site-scanner/Model/Status.php',
348
+ 'iThemesSecurity\\Site_Scanner\\Vulnerability' => __DIR__ . '/../..' . '/core/modules/site-scanner/Model/Vulnerability.php',
349
+ 'iThemesSecurity\\Site_Scanner\\Vulnerability_Fixer' => __DIR__ . '/../..' . '/core/modules/site-scanner/Fixer/Vulnerability_Fixer.php',
350
  'iThemesSecurity\\User_Groups\\All_Users' => __DIR__ . '/../..' . '/core/modules/user-groups/All_Users.php',
351
  'iThemesSecurity\\User_Groups\\Default_Matcher' => __DIR__ . '/../..' . '/core/modules/user-groups/Match/Default_Matcher.php',
352
  'iThemesSecurity\\User_Groups\\Everybody_Else' => __DIR__ . '/../..' . '/core/modules/user-groups/Everybody_Else.php',