WooCommerce Services - Version 1.25.9

Version Description

  • 2021-03-17 =
  • Add - WC Admin notice about DHL live rates.
  • Add - Live rates section in settings page.
  • Tweak - Cleanup stripe functionality.
  • Tweak - Display better errors on checkout page when address fields are missing / invalid.
  • Tweak - Refresh on status page does not reload page.
  • Fix - UPS invoice number allows numbers and letters.
  • Add - Tracks shipping services used at checkout.
  • Add - Update the existing endpoint POST /connect/packages to create shipping label packages, and add an endpoint PUT /connect/packages to update shipping label packages.
  • Fix - Only display shipping validation errors on the cart or checkout pages.
  • Tweak - Removes deprecated Jetpack constant JETPACK_MASTER_USER
  • Fix - Revert radio button dot offset in the "Create shipping label" modal.
Download this release

Release Info

Developer ferdev
Plugin Icon 128x128 WooCommerce Services
Version 1.25.9
Comparing to
See all releases

Code changes from version 1.25.8 to 1.25.9

Files changed (60) hide show
  1. classes/class-wc-connect-account-settings.php +14 -14
  2. classes/class-wc-connect-api-client-live.php +7 -7
  3. classes/class-wc-connect-api-client.php +129 -103
  4. classes/class-wc-connect-compatibility-wc26.php +8 -8
  5. classes/class-wc-connect-compatibility-wc30.php +7 -7
  6. classes/class-wc-connect-compatibility.php +6 -6
  7. classes/class-wc-connect-continents.php +13 -10
  8. classes/class-wc-connect-debug-tools.php +29 -29
  9. classes/class-wc-connect-error-notice.php +10 -9
  10. classes/class-wc-connect-extension-compatibility.php +2 -2
  11. classes/class-wc-connect-functions.php +50 -6
  12. classes/class-wc-connect-help-view.php +72 -102
  13. classes/class-wc-connect-jetpack.php +51 -2
  14. classes/class-wc-connect-label-reports.php +13 -13
  15. classes/class-wc-connect-logger.php +3 -4
  16. classes/class-wc-connect-note-dhl-live-rates-available.php +52 -0
  17. classes/class-wc-connect-nux.php +113 -90
  18. classes/class-wc-connect-options.php +11 -10
  19. classes/class-wc-connect-order-presenter.php +6 -6
  20. classes/class-wc-connect-package-settings.php +6 -6
  21. classes/class-wc-connect-payment-methods-store.php +4 -4
  22. classes/class-wc-connect-paypal-ec.php +50 -39
  23. classes/class-wc-connect-privacy.php +13 -6
  24. classes/class-wc-connect-service-schemas-store.php +5 -5
  25. classes/class-wc-connect-service-schemas-validator.php +5 -5
  26. classes/class-wc-connect-service-settings-store.php +118 -86
  27. classes/class-wc-connect-settings-pages.php +32 -23
  28. classes/class-wc-connect-shipping-label.php +53 -48
  29. classes/class-wc-connect-shipping-method.php +63 -58
  30. classes/class-wc-connect-taxjar-integration.php +241 -207
  31. classes/class-wc-connect-tracks.php +11 -11
  32. classes/class-wc-rest-connect-account-settings-controller.php +13 -8
  33. classes/class-wc-rest-connect-address-normalization-controller.php +12 -12
  34. classes/class-wc-rest-connect-assets-controller.php +9 -6
  35. classes/class-wc-rest-connect-base-controller.php +44 -17
  36. classes/class-wc-rest-connect-packages-controller.php +118 -9
  37. classes/class-wc-rest-connect-self-help-controller.php +2 -1
  38. classes/class-wc-rest-connect-service-data-refresh-controller.php +46 -0
  39. classes/class-wc-rest-connect-services-controller.php +23 -13
  40. classes/class-wc-rest-connect-shipping-label-controller.php +37 -37
  41. classes/class-wc-rest-connect-shipping-label-preview-controller.php +9 -9
  42. classes/class-wc-rest-connect-shipping-label-print-controller.php +18 -18
  43. classes/class-wc-rest-connect-shipping-label-refund-controller.php +10 -7
  44. classes/class-wc-rest-connect-shipping-label-status-controller.php +3 -3
  45. classes/class-wc-rest-connect-shipping-rates-controller.php +24 -21
  46. classes/class-wc-rest-connect-subscriptions-controller.php +1 -1
  47. classes/class-wc-rest-connect-tos-controller.php +15 -9
  48. classes/wc-api-dev/class-wc-rest-dev-data-continents-controller.php +42 -34
  49. classes/wc-api-dev/class-wc-rest-dev-data-controller.php +15 -11
  50. dist/chunks/{dc2a98ccd7e966cd26b2.css → 12f4c44069a2151d0dc0.css} +0 -0
  51. dist/chunks/12f4c44069a2151d0dc0.min.js +1 -0
  52. dist/chunks/{02082a53c355ce31d812.min.js → 1ac21d3099c07d1537e8.min.js} +1 -1
  53. dist/chunks/{6a58e1413d18b2716d19.css → 3118174c136567950f4c.css} +0 -0
  54. dist/chunks/{6a58e1413d18b2716d19.min.js → 3118174c136567950f4c.min.js} +1 -1
  55. dist/chunks/{ce946dd5bc07a4877da7.css → 344ed6a2abda149eb6e6.css} +0 -0
  56. dist/chunks/344ed6a2abda149eb6e6.min.js +1 -0
  57. dist/chunks/{302365b06fa4a405a0ce.css → 770d88e09267ea1b3e21.css} +0 -0
  58. dist/chunks/{302365b06fa4a405a0ce.min.js → 770d88e09267ea1b3e21.min.js} +1 -1
  59. dist/chunks/{ca62601bd66f657259f7.css → 873ca02ffbab33229080.css} +0 -0
  60. dist/chunks/873ca02ffbab33229080.min.js +1 -0
classes/class-wc-connect-account-settings.php CHANGED
@@ -15,7 +15,7 @@ class WC_Connect_Account_Settings {
15
  WC_Connect_Service_Settings_Store $settings_store,
16
  WC_Connect_Payment_Methods_Store $payment_methods_store
17
  ) {
18
- $this->settings_store = $settings_store;
19
  $this->payment_methods_store = $payment_methods_store;
20
  }
21
 
@@ -28,25 +28,25 @@ class WC_Connect_Account_Settings {
28
  $payment_methods_warning = __( 'There was a problem updating your saved credit cards.', 'woocommerce-services' );
29
  }
30
 
31
- $master_user = WC_Connect_Jetpack::get_master_user();
32
  $connected_data = WC_Connect_Jetpack::get_connected_user_data( $master_user->ID );
33
- $last_box_id = get_user_meta( get_current_user_id(), 'wc_connect_last_box_id', true );
34
- $last_box_id = $last_box_id === "individual" ? "" : $last_box_id;
35
 
36
  return array(
37
  'storeOptions' => $this->settings_store->get_store_options(),
38
- 'formData' => $this->settings_store->get_account_settings(),
39
- 'formMeta' => array(
40
- 'can_manage_payments' => $this->settings_store->can_user_manage_payment_methods(),
41
- 'can_edit_settings' => true,
42
- 'master_user_name' => $master_user->display_name,
43
- 'master_user_login' => $master_user->user_login,
44
  'master_user_wpcom_login' => $connected_data['login'],
45
- 'master_user_email' => $connected_data['email'],
46
- 'payment_methods' => $this->payment_methods_store->get_payment_methods(),
47
- 'warnings' => array( 'payment_methods' => $payment_methods_warning ),
48
  ),
49
- 'userMeta' => array(
50
  'last_box_id' => $last_box_id,
51
  ),
52
  );
15
  WC_Connect_Service_Settings_Store $settings_store,
16
  WC_Connect_Payment_Methods_Store $payment_methods_store
17
  ) {
18
+ $this->settings_store = $settings_store;
19
  $this->payment_methods_store = $payment_methods_store;
20
  }
21
 
28
  $payment_methods_warning = __( 'There was a problem updating your saved credit cards.', 'woocommerce-services' );
29
  }
30
 
31
+ $master_user = WC_Connect_Jetpack::get_master_user();
32
  $connected_data = WC_Connect_Jetpack::get_connected_user_data( $master_user->ID );
33
+ $last_box_id = get_user_meta( get_current_user_id(), 'wc_connect_last_box_id', true );
34
+ $last_box_id = $last_box_id === 'individual' ? '' : $last_box_id;
35
 
36
  return array(
37
  'storeOptions' => $this->settings_store->get_store_options(),
38
+ 'formData' => $this->settings_store->get_account_settings(),
39
+ 'formMeta' => array(
40
+ 'can_manage_payments' => $this->settings_store->can_user_manage_payment_methods(),
41
+ 'can_edit_settings' => true,
42
+ 'master_user_name' => $master_user->display_name,
43
+ 'master_user_login' => $master_user->user_login,
44
  'master_user_wpcom_login' => $connected_data['login'],
45
+ 'master_user_email' => $connected_data['email'],
46
+ 'payment_methods' => $this->payment_methods_store->get_payment_methods(),
47
+ 'warnings' => array( 'payment_methods' => $payment_methods_warning ),
48
  ),
49
+ 'userMeta' => array(
50
  'last_box_id' => $last_box_id,
51
  ),
52
  );
classes/class-wc-connect-api-client-live.php CHANGED
@@ -10,7 +10,7 @@ if ( ! defined( 'WOOCOMMERCE_CONNECT_SERVER_URL' ) ) {
10
  }
11
 
12
  if ( ! class_exists( 'WC_Connect_API_Client_Live' ) ) {
13
- require_once( plugin_basename( 'class-wc-connect-api-client.php' ) );
14
 
15
  class WC_Connect_API_Client_Live extends WC_Connect_API_Client {
16
 
@@ -65,16 +65,16 @@ if ( ! class_exists( 'WC_Connect_API_Client_Live' ) ) {
65
  wc_set_time_limit( $http_timeout + 10 );
66
  }
67
  $args = array(
68
- 'headers' => $headers,
69
- 'method' => $method,
70
- 'body' => $body,
71
  'redirection' => 0,
72
- 'compress' => true,
73
- 'timeout' => $http_timeout,
74
  );
75
  $args = apply_filters( 'wc_connect_request_args', $args );
76
 
77
- $response = wp_remote_request( $url, $args );
78
  $response_code = wp_remote_retrieve_response_code( $response );
79
 
80
  // If the received response is not JSON, return the raw response
10
  }
11
 
12
  if ( ! class_exists( 'WC_Connect_API_Client_Live' ) ) {
13
+ require_once plugin_basename( 'class-wc-connect-api-client.php' );
14
 
15
  class WC_Connect_API_Client_Live extends WC_Connect_API_Client {
16
 
65
  wc_set_time_limit( $http_timeout + 10 );
66
  }
67
  $args = array(
68
+ 'headers' => $headers,
69
+ 'method' => $method,
70
+ 'body' => $body,
71
  'redirection' => 0,
72
+ 'compress' => true,
73
+ 'timeout' => $http_timeout,
74
  );
75
  $args = apply_filters( 'wc_connect_request_args', $args );
76
 
77
+ $response = wp_remote_request( $url, $args );
78
  $response_code = wp_remote_retrieve_response_code( $response );
79
 
80
  // If the received response is not JSON, return the raw response
classes/class-wc-connect-api-client.php CHANGED
@@ -25,7 +25,7 @@ if ( ! class_exists( 'WC_Connect_API_Client' ) ) {
25
  WC_Connect_Loader $wc_connect_loader
26
  ) {
27
 
28
- $this->validator = $validator;
29
  $this->wc_connect_loader = $wc_connect_loader;
30
 
31
  }
@@ -73,20 +73,20 @@ if ( ! class_exists( 'WC_Connect_API_Client' ) ) {
73
  * @param $package Package provided to WC_Shipping_Method::calculate_shipping()
74
  *
75
  * @return array|WP_Error {
76
- * @type float $height Product height.
77
- * @type float $width Product width.
78
- * @type float $length Product length.
79
- * @type int $product_id Product ID (or Variation ID).
80
- * @type int $quantity Quantity of product in shipment.
81
- * @type float $weight Product weight.
82
  * }
83
  */
84
  public function build_shipment_contents( $package ) {
85
  $contents = array();
86
 
87
- foreach ( $package[ 'contents' ] as $package_item ) {
88
- $product = $package_item[ 'data' ];
89
- $quantity = $package_item[ 'quantity' ];
90
 
91
  if ( ( $quantity > 0 ) && $product->needs_shipping() ) {
92
 
@@ -122,12 +122,12 @@ if ( ! class_exists( 'WC_Connect_API_Client' ) ) {
122
  $width = $product->get_width();
123
 
124
  $contents[] = array(
125
- 'height' => ( float ) $height,
126
  'product_id' => $product->get_id(),
127
- 'length' => ( float ) $length,
128
- 'quantity' => $package_item[ 'quantity' ],
129
- 'weight' => ( float ) $weight,
130
- 'width' => ( float ) $width,
131
  );
132
  }
133
  }
@@ -164,7 +164,7 @@ if ( ! class_exists( 'WC_Connect_API_Client' ) ) {
164
  // Then, make the request
165
  $body = array(
166
  'contents' => $contents,
167
- 'destination' => $package[ 'destination' ],
168
  'services' => $services,
169
  'boxes' => $custom_boxes,
170
  'predefined_boxes' => $predefined_boxes,
@@ -173,6 +173,24 @@ if ( ! class_exists( 'WC_Connect_API_Client' ) ) {
173
  return $this->request( 'POST', '/shipping/rates', $body );
174
  }
175
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
176
  public function send_shipping_label_request( $body ) {
177
  return $this->request( 'POST', '/shipping/label', $body );
178
  }
@@ -194,38 +212,38 @@ if ( ! class_exists( 'WC_Connect_API_Client' ) ) {
194
  * Gets shipping rates (for labels) from the WooCommerce Shipping & Tax Server
195
  *
196
  * @param array $request - array(
197
- * 'packages' => array(
198
- * array(
199
- * 'id' => 'box_1',
200
- * 'height' => 10,
201
- * 'length' => 10,
202
- * 'width' => 10,
203
- * 'weight' => 10,
204
- * ),
205
- * array(
206
- * 'id' => 'box_2',
207
- * 'box_id' => 'medium_flat_box_top',
208
- * 'weight' => 5,
209
- * ),
210
- * ...
211
- * ),
212
- * 'carrier' => 'usps',
213
- * 'origin' => array(
214
- * 'address' => '132 Hawthorne St',
215
- * 'address_2' => '',
216
- * 'city' => 'San Francisco',
217
- * 'state' => 'CA',
218
- * 'postcode' => '94107',
219
- * 'country' => 'US',
220
- * ),
221
- * 'destination' => array(
222
- * 'address' => '1550 Snow Creek Dr',
223
- * 'address_2' => '',
224
- * 'city' => 'Park City',
225
- * 'state' => 'UT',
226
- * 'postcode' => '84060',
227
- * 'country' => 'US',
228
- * ),
229
  * )
230
  * @return object|WP_Error
231
  */
@@ -313,6 +331,7 @@ if ( ! class_exists( 'WC_Connect_API_Client' ) ) {
313
 
314
  /**
315
  * Get a list of the subscriptions for WooCommerce.com linked account.
 
316
  * @param $body
317
  * @param object|WP_Error
318
  */
@@ -327,7 +346,7 @@ if ( ! class_exists( 'WC_Connect_API_Client' ) ) {
327
  *
328
  * @return object|WP_Error
329
  */
330
- public function get_carrier_types( ) {
331
  return $this->request( 'GET', '/shipping/carrier-types' );
332
  }
333
 
@@ -359,7 +378,7 @@ if ( ! class_exists( 'WC_Connect_API_Client' ) ) {
359
  }
360
 
361
  $is_alive_request = $this->is_alive();
362
- $new_is_alive = ! is_wp_error( $is_alive_request );
363
  if ( $new_is_alive ) {
364
  set_transient( 'connect_server_is_alive_transient', true, MINUTE_IN_SECONDS );
365
  }
@@ -407,7 +426,7 @@ if ( ! class_exists( 'WC_Connect_API_Client' ) ) {
407
  * @return array|WP_Error
408
  */
409
  public function proxy_request( $path, $args ) {
410
- $proxy_url = trailingslashit( WOOCOMMERCE_CONNECT_SERVER_URL );
411
  $proxy_url .= ltrim( $path, '/' );
412
 
413
  $authorization = $this->authorization_header();
@@ -416,7 +435,6 @@ if ( ! class_exists( 'WC_Connect_API_Client' ) ) {
416
  }
417
  $args['headers']['Authorization'] = $authorization;
418
 
419
-
420
  $http_timeout = 60; // 1 minute
421
 
422
  if ( function_exists( 'wc_set_time_limit' ) ) {
@@ -443,26 +461,28 @@ if ( ! class_exists( 'WC_Connect_API_Client' ) ) {
443
  $body = array_merge( $default_body, $initial_body );
444
 
445
  // Add interesting fields to the body of each request
446
- $body[ 'settings' ] = wp_parse_args( $body[ 'settings' ], array(
447
- 'store_guid' => $this->get_guid(),
448
- 'base_city' => WC()->countries->get_base_city(),
449
- 'base_country' => WC()->countries->get_base_country(),
450
- 'base_state' => WC()->countries->get_base_state(),
451
- 'base_postcode' => WC()->countries->get_base_postcode(),
452
- 'currency' => get_woocommerce_currency(),
453
- 'dimension_unit' => strtolower( get_option( 'woocommerce_dimension_unit' ) ),
454
- 'weight_unit' => strtolower( get_option( 'woocommerce_weight_unit' ) ),
455
- 'wcs_version' => WC_Connect_Loader::get_wcs_version(),
456
- 'jetpack_version' => JETPACK__VERSION,
457
- 'is_atomic' => WC_Connect_Jetpack::is_atomic_site(),
458
- 'wc_version' => WC()->version,
459
- 'wp_version' => get_bloginfo( 'version' ),
460
- 'last_services_update' => WC_Connect_Options::get_option( 'services_last_update', 0 ),
461
- 'last_heartbeat' => WC_Connect_Options::get_option( 'last_heartbeat', 0 ),
462
- 'last_rate_request' => WC_Connect_Options::get_option( 'last_rate_request', 0 ),
463
- 'active_services' => $this->wc_connect_loader->get_active_services(),
464
- 'disable_stats' => WC_Connect_Jetpack::is_staging_site(),
465
- 'taxes_enabled' => wc_tax_enabled() && 'yes' === get_option( 'wc_connect_taxes_enabled' ),
 
 
466
  )
467
  );
468
 
@@ -480,20 +500,20 @@ if ( ! class_exists( 'WC_Connect_API_Client' ) ) {
480
  return $authorization;
481
  }
482
 
483
- $headers = array();
484
- $locale = strtolower( str_replace( '_', '-', get_locale() ) );
485
- $locale_elements = explode( '-', $locale );
486
- $lang = $locale_elements[ 0 ];
487
- $headers[ 'Accept-Language' ] = $locale . ',' . $lang;
488
- $headers[ 'Content-Type' ] = 'application/json; charset=utf-8';
489
- $headers[ 'Accept' ] = 'application/vnd.woocommerce-connect.v' . static::API_VERSION;
490
- $headers[ 'Authorization' ] = $authorization;
491
 
492
  $wc_helper_auth_info = WC_Connect_Functions::get_wc_helper_auth_info();
493
  if ( ! is_wp_error( $wc_helper_auth_info ) ) {
494
- $headers[ 'X-Woo-Signature' ] = $this->request_signature_wccom( $wc_helper_auth_info['access_token_secret'], 'subscriptions', 'GET', array() );
495
- $headers[ 'X-Woo-Access-Token' ] = $wc_helper_auth_info['access_token'];
496
- $headers[ 'X-Woo-Site-Id' ] = $wc_helper_auth_info['site_id'];
497
  }
498
  return $headers;
499
  }
@@ -516,10 +536,10 @@ if ( ! class_exists( 'WC_Connect_API_Client' ) ) {
516
  }
517
 
518
  list( $token_key, $token_secret ) = explode( '.', $token->secret );
519
- $token_key = sprintf( '%s:%d:%d', $token_key, JETPACK__API_VERSION, $token->external_user_id );
520
- $time_diff = (int)Jetpack_Options::get_option( 'time_diff' );
521
- $timestamp = time() + $time_diff;
522
- $nonce = wp_generate_password( 10, false );
523
 
524
  $signature = $this->request_signature( $token_key, $token_secret, $timestamp, $nonce, $time_diff );
525
  if ( is_wp_error( $signature ) ) {
@@ -527,9 +547,9 @@ if ( ! class_exists( 'WC_Connect_API_Client' ) ) {
527
  }
528
 
529
  $auth = array(
530
- 'token' => $token_key,
531
  'timestamp' => $timestamp,
532
- 'nonce' => $nonce,
533
  'signature' => $signature,
534
  );
535
 
@@ -548,7 +568,7 @@ if ( ! class_exists( 'WC_Connect_API_Client' ) ) {
548
  * @param string $token_secret
549
  * @param string $endpoint
550
  * @param string $method
551
- * @param array $body
552
  * @return string
553
  */
554
  protected function request_signature_wccom( $token_secret, $endpoint, $method, $body = array() ) {
@@ -576,11 +596,14 @@ if ( ! class_exists( 'WC_Connect_API_Client' ) ) {
576
  );
577
  }
578
 
579
- $normalized_request_string = join( "\n", array(
 
 
580
  $token_key,
581
  $timestamp,
582
- $nonce
583
- ) ) . "\n";
 
584
 
585
  return base64_encode( hash_hmac( 'sha1', $normalized_request_string, $token_secret, true ) );
586
  }
@@ -603,16 +626,19 @@ if ( ! class_exists( 'WC_Connect_API_Client' ) ) {
603
  * @return string
604
  */
605
  private function generate_guid() {
606
- return strtolower( sprintf( '%04X%04X-%04X-%04X-%04X-%04X%04X%04X',
607
- mt_rand( 0, 65535 ),
608
- mt_rand( 0, 65535 ),
609
- mt_rand( 0, 65535 ),
610
- mt_rand( 16384, 20479 ),
611
- mt_rand( 32768, 49151 ),
612
- mt_rand( 0, 65535 ),
613
- mt_rand( 0, 65535 ),
614
- mt_rand( 0, 65535 )
615
- ) );
 
 
 
616
  }
617
  }
618
 
25
  WC_Connect_Loader $wc_connect_loader
26
  ) {
27
 
28
+ $this->validator = $validator;
29
  $this->wc_connect_loader = $wc_connect_loader;
30
 
31
  }
73
  * @param $package Package provided to WC_Shipping_Method::calculate_shipping()
74
  *
75
  * @return array|WP_Error {
76
+ * @type float $height Product height.
77
+ * @type float $width Product width.
78
+ * @type float $length Product length.
79
+ * @type int $product_id Product ID (or Variation ID).
80
+ * @type int $quantity Quantity of product in shipment.
81
+ * @type float $weight Product weight.
82
  * }
83
  */
84
  public function build_shipment_contents( $package ) {
85
  $contents = array();
86
 
87
+ foreach ( $package['contents'] as $package_item ) {
88
+ $product = $package_item['data'];
89
+ $quantity = $package_item['quantity'];
90
 
91
  if ( ( $quantity > 0 ) && $product->needs_shipping() ) {
92
 
122
  $width = $product->get_width();
123
 
124
  $contents[] = array(
125
+ 'height' => (float) $height,
126
  'product_id' => $product->get_id(),
127
+ 'length' => (float) $length,
128
+ 'quantity' => $package_item['quantity'],
129
+ 'weight' => (float) $weight,
130
+ 'width' => (float) $width,
131
  );
132
  }
133
  }
164
  // Then, make the request
165
  $body = array(
166
  'contents' => $contents,
167
+ 'destination' => $package['destination'],
168
  'services' => $services,
169
  'boxes' => $custom_boxes,
170
  'predefined_boxes' => $predefined_boxes,
173
  return $this->request( 'POST', '/shipping/rates', $body );
174
  }
175
 
176
+ /**
177
+ * Send rates request information to track subscription events
178
+ *
179
+ * @param array $services Array of service settings for shipping methods.
180
+ *
181
+ * @return object|WP_Error
182
+ */
183
+ public function track_subscription_event( $services ) {
184
+ if ( empty( $services ) ) {
185
+ return new WP_Error(
186
+ 'nothing_to_ship',
187
+ __( 'No shipping rate could be calculated. No items in the package are shippable.', 'woocommerce-services' )
188
+ );
189
+ }
190
+
191
+ return $this->request( 'POST', '/subscriptions/checkout', array( 'services' => $services ) );
192
+ }
193
+
194
  public function send_shipping_label_request( $body ) {
195
  return $this->request( 'POST', '/shipping/label', $body );
196
  }
212
  * Gets shipping rates (for labels) from the WooCommerce Shipping & Tax Server
213
  *
214
  * @param array $request - array(
215
+ * 'packages' => array(
216
+ * array(
217
+ * 'id' => 'box_1',
218
+ * 'height' => 10,
219
+ * 'length' => 10,
220
+ * 'width' => 10,
221
+ * 'weight' => 10,
222
+ * ),
223
+ * array(
224
+ * 'id' => 'box_2',
225
+ * 'box_id' => 'medium_flat_box_top',
226
+ * 'weight' => 5,
227
+ * ),
228
+ * ...
229
+ * ),
230
+ * 'carrier' => 'usps',
231
+ * 'origin' => array(
232
+ * 'address' => '132 Hawthorne St',
233
+ * 'address_2' => '',
234
+ * 'city' => 'San Francisco',
235
+ * 'state' => 'CA',
236
+ * 'postcode' => '94107',
237
+ * 'country' => 'US',
238
+ * ),
239
+ * 'destination' => array(
240
+ * 'address' => '1550 Snow Creek Dr',
241
+ * 'address_2' => '',
242
+ * 'city' => 'Park City',
243
+ * 'state' => 'UT',
244
+ * 'postcode' => '84060',
245
+ * 'country' => 'US',
246
+ * ),
247
  * )
248
  * @return object|WP_Error
249
  */
331
 
332
  /**
333
  * Get a list of the subscriptions for WooCommerce.com linked account.
334
+ *
335
  * @param $body
336
  * @param object|WP_Error
337
  */
346
  *
347
  * @return object|WP_Error
348
  */
349
+ public function get_carrier_types() {
350
  return $this->request( 'GET', '/shipping/carrier-types' );
351
  }
352
 
378
  }
379
 
380
  $is_alive_request = $this->is_alive();
381
+ $new_is_alive = ! is_wp_error( $is_alive_request );
382
  if ( $new_is_alive ) {
383
  set_transient( 'connect_server_is_alive_transient', true, MINUTE_IN_SECONDS );
384
  }
426
  * @return array|WP_Error
427
  */
428
  public function proxy_request( $path, $args ) {
429
+ $proxy_url = trailingslashit( WOOCOMMERCE_CONNECT_SERVER_URL );
430
  $proxy_url .= ltrim( $path, '/' );
431
 
432
  $authorization = $this->authorization_header();
435
  }
436
  $args['headers']['Authorization'] = $authorization;
437
 
 
438
  $http_timeout = 60; // 1 minute
439
 
440
  if ( function_exists( 'wc_set_time_limit' ) ) {
461
  $body = array_merge( $default_body, $initial_body );
462
 
463
  // Add interesting fields to the body of each request
464
+ $body['settings'] = wp_parse_args(
465
+ $body['settings'],
466
+ array(
467
+ 'store_guid' => $this->get_guid(),
468
+ 'base_city' => WC()->countries->get_base_city(),
469
+ 'base_country' => WC()->countries->get_base_country(),
470
+ 'base_state' => WC()->countries->get_base_state(),
471
+ 'base_postcode' => WC()->countries->get_base_postcode(),
472
+ 'currency' => get_woocommerce_currency(),
473
+ 'dimension_unit' => strtolower( get_option( 'woocommerce_dimension_unit' ) ),
474
+ 'weight_unit' => strtolower( get_option( 'woocommerce_weight_unit' ) ),
475
+ 'wcs_version' => WC_Connect_Loader::get_wcs_version(),
476
+ 'jetpack_version' => JETPACK__VERSION,
477
+ 'is_atomic' => WC_Connect_Jetpack::is_atomic_site(),
478
+ 'wc_version' => WC()->version,
479
+ 'wp_version' => get_bloginfo( 'version' ),
480
+ 'last_services_update' => WC_Connect_Options::get_option( 'services_last_update', 0 ),
481
+ 'last_heartbeat' => WC_Connect_Options::get_option( 'last_heartbeat', 0 ),
482
+ 'last_rate_request' => WC_Connect_Options::get_option( 'last_rate_request', 0 ),
483
+ 'active_services' => $this->wc_connect_loader->get_active_services(),
484
+ 'disable_stats' => WC_Connect_Jetpack::is_staging_site(),
485
+ 'taxes_enabled' => wc_tax_enabled() && 'yes' === get_option( 'wc_connect_taxes_enabled' ),
486
  )
487
  );
488
 
500
  return $authorization;
501
  }
502
 
503
+ $headers = array();
504
+ $locale = strtolower( str_replace( '_', '-', get_locale() ) );
505
+ $locale_elements = explode( '-', $locale );
506
+ $lang = $locale_elements[0];
507
+ $headers['Accept-Language'] = $locale . ',' . $lang;
508
+ $headers['Content-Type'] = 'application/json; charset=utf-8';
509
+ $headers['Accept'] = 'application/vnd.woocommerce-connect.v' . static::API_VERSION;
510
+ $headers['Authorization'] = $authorization;
511
 
512
  $wc_helper_auth_info = WC_Connect_Functions::get_wc_helper_auth_info();
513
  if ( ! is_wp_error( $wc_helper_auth_info ) ) {
514
+ $headers['X-Woo-Signature'] = $this->request_signature_wccom( $wc_helper_auth_info['access_token_secret'], 'subscriptions', 'GET', array() );
515
+ $headers['X-Woo-Access-Token'] = $wc_helper_auth_info['access_token'];
516
+ $headers['X-Woo-Site-Id'] = $wc_helper_auth_info['site_id'];
517
  }
518
  return $headers;
519
  }
536
  }
537
 
538
  list( $token_key, $token_secret ) = explode( '.', $token->secret );
539
+ $token_key = sprintf( '%s:%d:%d', $token_key, JETPACK__API_VERSION, $token->external_user_id );
540
+ $time_diff = (int) Jetpack_Options::get_option( 'time_diff' );
541
+ $timestamp = time() + $time_diff;
542
+ $nonce = wp_generate_password( 10, false );
543
 
544
  $signature = $this->request_signature( $token_key, $token_secret, $timestamp, $nonce, $time_diff );
545
  if ( is_wp_error( $signature ) ) {
547
  }
548
 
549
  $auth = array(
550
+ 'token' => $token_key,
551
  'timestamp' => $timestamp,
552
+ 'nonce' => $nonce,
553
  'signature' => $signature,
554
  );
555
 
568
  * @param string $token_secret
569
  * @param string $endpoint
570
  * @param string $method
571
+ * @param array $body
572
  * @return string
573
  */
574
  protected function request_signature_wccom( $token_secret, $endpoint, $method, $body = array() ) {
596
  );
597
  }
598
 
599
+ $normalized_request_string = join(
600
+ "\n",
601
+ array(
602
  $token_key,
603
  $timestamp,
604
+ $nonce,
605
+ )
606
+ ) . "\n";
607
 
608
  return base64_encode( hash_hmac( 'sha1', $normalized_request_string, $token_secret, true ) );
609
  }
626
  * @return string
627
  */
628
  private function generate_guid() {
629
+ return strtolower(
630
+ sprintf(
631
+ '%04X%04X-%04X-%04X-%04X-%04X%04X%04X',
632
+ mt_rand( 0, 65535 ),
633
+ mt_rand( 0, 65535 ),
634
+ mt_rand( 0, 65535 ),
635
+ mt_rand( 16384, 20479 ),
636
+ mt_rand( 32768, 49151 ),
637
+ mt_rand( 0, 65535 ),
638
+ mt_rand( 0, 65535 ),
639
+ mt_rand( 0, 65535 )
640
+ )
641
+ );
642
  }
643
  }
644
 
classes/class-wc-connect-compatibility-wc26.php CHANGED
@@ -48,7 +48,7 @@ if ( ! class_exists( 'WC_Connect_Compatibility_WC26' ) ) {
48
  /**
49
  * Retrieve the corresponding Product for the given Order Item.
50
  *
51
- * @param WC_Order $order
52
  * @param WC_Order_Item|WC_Order_Item_Product|array $item
53
  *
54
  * @return WC_Product
@@ -61,7 +61,7 @@ if ( ! class_exists( 'WC_Connect_Compatibility_WC26' ) ) {
61
  * Get formatted list of Product Variations, if applicable.
62
  *
63
  * @param WC_Product_Variation $product
64
- * @param bool $flat
65
  *
66
  * @return string
67
  */
@@ -100,15 +100,15 @@ if ( ! class_exists( 'WC_Connect_Compatibility_WC26' ) ) {
100
  * This is useful when an order has a product which was later deleted from the
101
  * store.
102
  *
103
- * @param int $product_id Product ID or variation ID
104
  * @param WC_Order $order
105
  * @return string The product (or variation) name, ready to print
106
  */
107
  public function get_product_name_from_order( $product_id, $order ) {
108
  foreach ( $order->get_items() as $line_item ) {
109
- if ( (int) $line_item[ 'product_id' ] === $product_id || (int) $line_item[ 'variation_id' ] === $product_id ) {
110
  /* translators: %1$d: Product ID, %2$s: Product Name */
111
- return sprintf( __( '#%1$d - %2$s', 'woocommerce-services' ), $product_id, $line_item[ 'name' ] );
112
  }
113
  }
114
 
@@ -119,14 +119,14 @@ if ( ! class_exists( 'WC_Connect_Compatibility_WC26' ) ) {
119
  /**
120
  * For a given product ID, it tries to find its price inside an order's line items.
121
  *
122
- * @param int $product_id Product ID or variation ID
123
  * @param WC_Order $order
124
  * @return float The product (or variation) price, or NULL if it wasn't found
125
  */
126
  public function get_product_price_from_order( $product_id, $order ) {
127
  foreach ( $order->get_items() as $line_item ) {
128
- if ( (int) $line_item[ 'product_id' ] === $product_id || (int) $line_item[ 'variation_id' ] === $product_id ) {
129
- return round( floatval( $line_item[ 'total' ] ) / $line_item[ 'qty' ], 2 );
130
  }
131
  }
132
  return null;
48
  /**
49
  * Retrieve the corresponding Product for the given Order Item.
50
  *
51
+ * @param WC_Order $order
52
  * @param WC_Order_Item|WC_Order_Item_Product|array $item
53
  *
54
  * @return WC_Product
61
  * Get formatted list of Product Variations, if applicable.
62
  *
63
  * @param WC_Product_Variation $product
64
+ * @param bool $flat
65
  *
66
  * @return string
67
  */
100
  * This is useful when an order has a product which was later deleted from the
101
  * store.
102
  *
103
+ * @param int $product_id Product ID or variation ID
104
  * @param WC_Order $order
105
  * @return string The product (or variation) name, ready to print
106
  */
107
  public function get_product_name_from_order( $product_id, $order ) {
108
  foreach ( $order->get_items() as $line_item ) {
109
+ if ( (int) $line_item['product_id'] === $product_id || (int) $line_item['variation_id'] === $product_id ) {
110
  /* translators: %1$d: Product ID, %2$s: Product Name */
111
+ return sprintf( __( '#%1$d - %2$s', 'woocommerce-services' ), $product_id, $line_item['name'] );
112
  }
113
  }
114
 
119
  /**
120
  * For a given product ID, it tries to find its price inside an order's line items.
121
  *
122
+ * @param int $product_id Product ID or variation ID
123
  * @param WC_Order $order
124
  * @return float The product (or variation) price, or NULL if it wasn't found
125
  */
126
  public function get_product_price_from_order( $product_id, $order ) {
127
  foreach ( $order->get_items() as $line_item ) {
128
+ if ( (int) $line_item['product_id'] === $product_id || (int) $line_item['variation_id'] === $product_id ) {
129
+ return round( floatval( $line_item['total'] ) / $line_item['qty'], 2 );
130
  }
131
  }
132
  return null;
classes/class-wc-connect-compatibility-wc30.php CHANGED
@@ -48,14 +48,14 @@ if ( ! class_exists( 'WC_Connect_Compatibility_WC30' ) ) {
48
  /**
49
  * Retrieve the corresponding Product for the given Order Item.
50
  *
51
- * @param WC_Order $order
52
  * @param WC_Order_Item|WC_Order_Item_Product|array $item
53
  *
54
  * @return WC_Product
55
  */
56
  public function get_item_product( WC_Order $order, $item ) {
57
  if ( is_array( $item ) ) {
58
- return wc_get_product( $item[ 'product_id' ] );
59
  }
60
  return $item->get_product();
61
  }
@@ -64,7 +64,7 @@ if ( ! class_exists( 'WC_Connect_Compatibility_WC30' ) ) {
64
  * Get formatted list of Product Variations, if applicable.
65
  *
66
  * @param WC_Product_Variation $product
67
- * @param bool $flat
68
  *
69
  * @return string
70
  */
@@ -103,13 +103,13 @@ if ( ! class_exists( 'WC_Connect_Compatibility_WC30' ) ) {
103
  * This is useful when an order has a product which was later deleted from the
104
  * store.
105
  *
106
- * @param int $product_id Product ID or variation ID
107
  * @param WC_Order $order
108
  * @return string The product (or variation) name, ready to print
109
  */
110
  public function get_product_name_from_order( $product_id, $order ) {
111
  foreach ( $order->get_items() as $line_item ) {
112
- $line_product_id = $line_item->get_product_id();
113
  $line_variation_id = $line_item->get_variation_id();
114
 
115
  if ( ! $line_product_id ) {
@@ -133,13 +133,13 @@ if ( ! class_exists( 'WC_Connect_Compatibility_WC30' ) ) {
133
  /**
134
  * For a given product ID, it tries to find its price inside an order's line items.
135
  *
136
- * @param int $product_id Product ID or variation ID
137
  * @param WC_Order $order
138
  * @return float The product (or variation) price, or NULL if it wasn't found
139
  */
140
  public function get_product_price_from_order( $product_id, $order ) {
141
  foreach ( $order->get_items() as $line_item ) {
142
- $line_product_id = $line_item->get_product_id();
143
  $line_variation_id = $line_item->get_variation_id();
144
 
145
  if ( ! $line_product_id ) {
48
  /**
49
  * Retrieve the corresponding Product for the given Order Item.
50
  *
51
+ * @param WC_Order $order
52
  * @param WC_Order_Item|WC_Order_Item_Product|array $item
53
  *
54
  * @return WC_Product
55
  */
56
  public function get_item_product( WC_Order $order, $item ) {
57
  if ( is_array( $item ) ) {
58
+ return wc_get_product( $item['product_id'] );
59
  }
60
  return $item->get_product();
61
  }
64
  * Get formatted list of Product Variations, if applicable.
65
  *
66
  * @param WC_Product_Variation $product
67
+ * @param bool $flat
68
  *
69
  * @return string
70
  */
103
  * This is useful when an order has a product which was later deleted from the
104
  * store.
105
  *
106
+ * @param int $product_id Product ID or variation ID
107
  * @param WC_Order $order
108
  * @return string The product (or variation) name, ready to print
109
  */
110
  public function get_product_name_from_order( $product_id, $order ) {
111
  foreach ( $order->get_items() as $line_item ) {
112
+ $line_product_id = $line_item->get_product_id();
113
  $line_variation_id = $line_item->get_variation_id();
114
 
115
  if ( ! $line_product_id ) {
133
  /**
134
  * For a given product ID, it tries to find its price inside an order's line items.
135
  *
136
+ * @param int $product_id Product ID or variation ID
137
  * @param WC_Order $order
138
  * @return float The product (or variation) price, or NULL if it wasn't found
139
  */
140
  public function get_product_price_from_order( $product_id, $order ) {
141
  foreach ( $order->get_items() as $line_item ) {
142
+ $line_product_id = $line_item->get_product_id();
143
  $line_variation_id = $line_item->get_variation_id();
144
 
145
  if ( ! $line_product_id ) {
classes/class-wc-connect-compatibility.php CHANGED
@@ -41,12 +41,12 @@ if ( ! class_exists( 'WC_Connect_Compatibility' ) ) {
41
 
42
  public static function set_version( $value ) {
43
  self::$singleton = null;
44
- self::$version = $value;
45
  }
46
 
47
  public static function reset_version() {
48
  self::$singleton = null;
49
- self::$version = WC_VERSION;
50
  }
51
 
52
  /**
@@ -79,7 +79,7 @@ if ( ! class_exists( 'WC_Connect_Compatibility' ) ) {
79
  /**
80
  * Retrieve the corresponding Product for the given Order Item.
81
  *
82
- * @param WC_Order $order
83
  * @param WC_Order_Item|WC_Order_Item_Product|array $item
84
  *
85
  * @return WC_Product
@@ -90,7 +90,7 @@ if ( ! class_exists( 'WC_Connect_Compatibility' ) ) {
90
  * Get formatted list of Product Variations, if applicable.
91
  *
92
  * @param WC_Product_Variation $product
93
- * @param bool $flat
94
  *
95
  * @return string
96
  */
@@ -123,7 +123,7 @@ if ( ! class_exists( 'WC_Connect_Compatibility' ) ) {
123
  * This is useful when an order has a product which was later deleted from the
124
  * store.
125
  *
126
- * @param int $product_id Product ID or variation ID
127
  * @param WC_Order $order
128
  * @return string The product (or variation) name, ready to print
129
  */
@@ -132,7 +132,7 @@ if ( ! class_exists( 'WC_Connect_Compatibility' ) ) {
132
  /**
133
  * For a given product ID, it tries to find its price inside an order's line items.
134
  *
135
- * @param int $product_id Product ID or variation ID
136
  * @param WC_Order $order
137
  * @return float The product (or variation) price, or NULL if it wasn't found
138
  */
41
 
42
  public static function set_version( $value ) {
43
  self::$singleton = null;
44
+ self::$version = $value;
45
  }
46
 
47
  public static function reset_version() {
48
  self::$singleton = null;
49
+ self::$version = WC_VERSION;
50
  }
51
 
52
  /**
79
  /**
80
  * Retrieve the corresponding Product for the given Order Item.
81
  *
82
+ * @param WC_Order $order
83
  * @param WC_Order_Item|WC_Order_Item_Product|array $item
84
  *
85
  * @return WC_Product
90
  * Get formatted list of Product Variations, if applicable.
91
  *
92
  * @param WC_Product_Variation $product
93
+ * @param bool $flat
94
  *
95
  * @return string
96
  */
123
  * This is useful when an order has a product which was later deleted from the
124
  * store.
125
  *
126
+ * @param int $product_id Product ID or variation ID
127
  * @param WC_Order $order
128
  * @return string The product (or variation) name, ready to print
129
  */
132
  /**
133
  * For a given product ID, it tries to find its price inside an order's line items.
134
  *
135
+ * @param int $product_id Product ID or variation ID
136
  * @param WC_Order $order
137
  * @return float The product (or variation) price, or NULL if it wasn't found
138
  */
classes/class-wc-connect-continents.php CHANGED
@@ -14,7 +14,7 @@ class WC_Connect_Continents {
14
  * Return the list of countries and states for a given continent.
15
  *
16
  * @since 3.1.0
17
- * @param string $continent_code
18
  * @return array|mixed Response data, ready for insertion into collection data.
19
  */
20
  public function get_continent( $continent_code = false ) {
@@ -46,15 +46,18 @@ class WC_Connect_Continents {
46
  // If we have detailed locale information include that in the response
47
  if ( array_key_exists( $country_code, $locale_info ) ) {
48
  // Defensive programming against unexpected changes in locale-info.php
49
- $country_data = wp_parse_args( $locale_info[ $country_code ], array(
50
- 'currency_code' => 'USD',
51
- 'currency_pos' => 'left',
52
- 'decimal_sep' => '.',
53
- 'dimension_unit' => 'in',
54
- 'num_decimals' => 2,
55
- 'thousand_sep' => ',',
56
- 'weight_unit' => 'lbs',
57
- ) );
 
 
 
58
 
59
  $country = array_merge( $country, $country_data );
60
  }
14
  * Return the list of countries and states for a given continent.
15
  *
16
  * @since 3.1.0
17
+ * @param string $continent_code
18
  * @return array|mixed Response data, ready for insertion into collection data.
19
  */
20
  public function get_continent( $continent_code = false ) {
46
  // If we have detailed locale information include that in the response
47
  if ( array_key_exists( $country_code, $locale_info ) ) {
48
  // Defensive programming against unexpected changes in locale-info.php
49
+ $country_data = wp_parse_args(
50
+ $locale_info[ $country_code ],
51
+ array(
52
+ 'currency_code' => 'USD',
53
+ 'currency_pos' => 'left',
54
+ 'decimal_sep' => '.',
55
+ 'dimension_unit' => 'in',
56
+ 'num_decimals' => 2,
57
+ 'thousand_sep' => ',',
58
+ 'weight_unit' => 'lbs',
59
+ )
60
+ );
61
 
62
  $country = array_merge( $country, $country_data );
63
  }
classes/class-wc-connect-debug-tools.php CHANGED
@@ -2,37 +2,37 @@
2
 
3
  // No direct access please
4
  if ( ! defined( 'ABSPATH' ) ) {
5
- exit;
6
  }
7
 
8
  if ( ! class_exists( 'WC_Connect_Debug_Tools' ) ) {
9
 
10
- class WC_Connect_Debug_Tools {
11
-
12
- function __construct( WC_Connect_API_Client $api_client ) {
13
- $this->api_client = $api_client;
14
-
15
- add_filter( 'woocommerce_debug_tools', array( $this, 'woocommerce_debug_tools' ) );
16
- }
17
-
18
- function woocommerce_debug_tools( $tools ) {
19
- $tools['test_wcc_connection'] = array(
20
- 'name' => __( 'Test your WooCommerce Shipping & Tax connection', 'woocommerce-services' ),
21
- 'button' => __( 'Test Connection', 'woocommerce-services' ),
22
- 'desc' => __( 'This will test your WooCommerce Shipping & Tax connection to ensure everything is working correctly', 'woocommerce-services' ),
23
- 'callback' => array( $this, 'test_connection' ),
24
- );
25
- return $tools;
26
- }
27
-
28
- function test_connection() {
29
- $test_request = $this->api_client->auth_test();
30
- if ( $test_request && ! is_wp_error( $test_request ) && $test_request->authorized ) {
31
- echo '<div class="updated inline"><p>' . __( 'Your site is succesfully communicating to the WooCommerce Shipping & Tax API.', 'woocommerce-services' ) . '</p></div>';
32
- } else {
33
- echo '<div class="error inline"><p>' . __( 'ERROR: Your site has a problem connecting to the WooCommerce Shipping & Tax API. Please make sure your Jetpack connection is working.', 'woocommerce-services' ) . '</p></div>';
34
- }
35
- }
36
-
37
- }
38
  }
2
 
3
  // No direct access please
4
  if ( ! defined( 'ABSPATH' ) ) {
5
+ exit;
6
  }
7
 
8
  if ( ! class_exists( 'WC_Connect_Debug_Tools' ) ) {
9
 
10
+ class WC_Connect_Debug_Tools {
11
+
12
+ function __construct( WC_Connect_API_Client $api_client ) {
13
+ $this->api_client = $api_client;
14
+
15
+ add_filter( 'woocommerce_debug_tools', array( $this, 'woocommerce_debug_tools' ) );
16
+ }
17
+
18
+ function woocommerce_debug_tools( $tools ) {
19
+ $tools['test_wcc_connection'] = array(
20
+ 'name' => __( 'Test your WooCommerce Shipping & Tax connection', 'woocommerce-services' ),
21
+ 'button' => __( 'Test Connection', 'woocommerce-services' ),
22
+ 'desc' => __( 'This will test your WooCommerce Shipping & Tax connection to ensure everything is working correctly', 'woocommerce-services' ),
23
+ 'callback' => array( $this, 'test_connection' ),
24
+ );
25
+ return $tools;
26
+ }
27
+
28
+ function test_connection() {
29
+ $test_request = $this->api_client->auth_test();
30
+ if ( $test_request && ! is_wp_error( $test_request ) && $test_request->authorized ) {
31
+ echo '<div class="updated inline"><p>' . __( 'Your site is succesfully communicating to the WooCommerce Shipping & Tax API.', 'woocommerce-services' ) . '</p></div>';
32
+ } else {
33
+ echo '<div class="error inline"><p>' . __( 'ERROR: Your site has a problem connecting to the WooCommerce Shipping & Tax API. Please make sure your Jetpack connection is working.', 'woocommerce-services' ) . '</p></div>';
34
+ }
35
+ }
36
+
37
+ }
38
  }
classes/class-wc-connect-error-notice.php CHANGED
@@ -61,12 +61,12 @@ if ( ! class_exists( 'WC_Connect_Error_Notice' ) ) {
61
  $message = false;
62
 
63
  if (
64
- 'product_missing_weight' === $error->get_error_code() ||
65
  'product_missing_dimension' === $error->get_error_code()
66
  ) {
67
  $error_data = $error->get_error_data();
68
- $id = $error_data['product_id'];
69
- $product = wc_get_product( $id );
70
 
71
  if (
72
  ! $product ||
@@ -82,10 +82,11 @@ if ( ! class_exists( 'WC_Connect_Error_Notice' ) ) {
82
  }
83
 
84
  $product_name = WC_Connect_Compatibility::instance()->get_product_name( $product );
85
- $product_id = is_a( $product, 'WC_Product_Variation' ) ? $product->get_parent_id() : $id;
86
- $message = sprintf(
87
  __( '<strong>"%2$s" is missing weight, length, width, or height.</strong><br />Shipping rates cannot be calculated. <a href="%1$s">Enter dimensions and weight for %2$s</a> so your customers can purchase this item.', 'woocommerce-services' ),
88
- get_edit_post_link( $product_id ), $product_name
 
89
  );
90
  }
91
 
@@ -98,13 +99,13 @@ if ( ! class_exists( 'WC_Connect_Error_Notice' ) ) {
98
  'strong' => array(),
99
  'br' => array(),
100
  );
101
- ?>
102
  <div class='notice notice-error' style="position: relative;">
103
  <a href="<?php echo esc_url( $link_dismiss ); ?>" style="text-decoration: none;" class="notice-dismiss" title="<?php esc_attr_e( 'Dismiss this notice', 'woocommerce-services' ); ?>"></a>
104
  <p><?php echo wp_kses( $message, $allowed_html ); ?></p>
105
  </div>
106
- <?php
107
- echo "";
108
  }
109
  }
110
 
61
  $message = false;
62
 
63
  if (
64
+ 'product_missing_weight' === $error->get_error_code() ||
65
  'product_missing_dimension' === $error->get_error_code()
66
  ) {
67
  $error_data = $error->get_error_data();
68
+ $id = $error_data['product_id'];
69
+ $product = wc_get_product( $id );
70
 
71
  if (
72
  ! $product ||
82
  }
83
 
84
  $product_name = WC_Connect_Compatibility::instance()->get_product_name( $product );
85
+ $product_id = is_a( $product, 'WC_Product_Variation' ) ? $product->get_parent_id() : $id;
86
+ $message = sprintf(
87
  __( '<strong>"%2$s" is missing weight, length, width, or height.</strong><br />Shipping rates cannot be calculated. <a href="%1$s">Enter dimensions and weight for %2$s</a> so your customers can purchase this item.', 'woocommerce-services' ),
88
+ get_edit_post_link( $product_id ),
89
+ $product_name
90
  );
91
  }
92
 
99
  'strong' => array(),
100
  'br' => array(),
101
  );
102
+ ?>
103
  <div class='notice notice-error' style="position: relative;">
104
  <a href="<?php echo esc_url( $link_dismiss ); ?>" style="text-decoration: none;" class="notice-dismiss" title="<?php esc_attr_e( 'Dismiss this notice', 'woocommerce-services' ); ?>"></a>
105
  <p><?php echo wp_kses( $message, $allowed_html ); ?></p>
106
  </div>
107
+ <?php
108
+ echo '';
109
  }
110
  }
111
 
classes/class-wc-connect-extension-compatibility.php CHANGED
@@ -10,9 +10,9 @@ if ( ! class_exists( 'WC_Connect_Extension_Compatibility' ) ) {
10
  * @param $tracking_number - tracking number string
11
  */
12
  public static function on_new_tracking_number( $order_id, $carrier_id, $tracking_number ) {
13
- //call WooCommerce Shipment Tracking if it's installed
14
  if ( function_exists( 'wc_st_add_tracking_number' ) ) {
15
- //note: the only carrier ID we use at the moment is 'usps', which is the same in WC_ST, but this might require a mapping
16
  wc_st_add_tracking_number( $order_id, $tracking_number, $carrier_id );
17
  }
18
  }
10
  * @param $tracking_number - tracking number string
11
  */
12
  public static function on_new_tracking_number( $order_id, $carrier_id, $tracking_number ) {
13
+ // call WooCommerce Shipment Tracking if it's installed
14
  if ( function_exists( 'wc_st_add_tracking_number' ) ) {
15
+ // note: the only carrier ID we use at the moment is 'usps', which is the same in WC_ST, but this might require a mapping
16
  wc_st_add_tracking_number( $order_id, $tracking_number, $carrier_id );
17
  }
18
  }
classes/class-wc-connect-functions.php CHANGED
@@ -4,18 +4,20 @@ if ( ! class_exists( 'WC_Connect_Functions' ) ) {
4
  class WC_Connect_Functions {
5
  /**
6
  * Checks if the potentially expensive Shipping/Tax API requests should be sent
7
- * based on the context in which they are initialized
 
8
  * @return bool true if the request can be sent, false otherwise
9
  */
10
  public static function should_send_cart_api_request() {
11
- return ! (
12
- // Skip for carts loaded from session in the dashboard
 
13
  ( is_admin() && did_action( 'woocommerce_cart_loaded_from_session' ) ) ||
14
- // Skip during Jetpack API requests
15
  ( false !== strpos( $_SERVER['REQUEST_URI'], 'jetpack/v4/' ) ) ||
16
- // Skip during REST API or XMLRPC requests
17
  ( defined( 'REST_REQUEST' ) || defined( 'REST_API_REQUEST' ) || defined( 'XMLRPC_REQUEST' ) ) ||
18
- // Skip during Jetpack REST API proxy requests
19
  ( isset( $_GET['rest_route'] ) && isset( $_GET['_for'] ) && ( 'jetpack' === $_GET['_for'] ) )
20
  );
21
  }
@@ -39,5 +41,47 @@ if ( ! class_exists( 'WC_Connect_Functions' ) ) {
39
  }
40
  return $helper_auth_data;
41
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  }
43
  }
4
  class WC_Connect_Functions {
5
  /**
6
  * Checks if the potentially expensive Shipping/Tax API requests should be sent
7
+ * based on the context in which they are initialized.
8
+ *
9
  * @return bool true if the request can be sent, false otherwise
10
  */
11
  public static function should_send_cart_api_request() {
12
+ // Allow if this is an API call to store/cart endpoint. Provides compatibility with WooCommerce Blocks.
13
+ return self::is_store_api_call() || ! (
14
+ // Skip for carts loaded from session in the dashboard.
15
  ( is_admin() && did_action( 'woocommerce_cart_loaded_from_session' ) ) ||
16
+ // Skip during Jetpack API requests.
17
  ( false !== strpos( $_SERVER['REQUEST_URI'], 'jetpack/v4/' ) ) ||
18
+ // Skip during REST API or XMLRPC requests.
19
  ( defined( 'REST_REQUEST' ) || defined( 'REST_API_REQUEST' ) || defined( 'XMLRPC_REQUEST' ) ) ||
20
+ // Skip during Jetpack REST API proxy requests.
21
  ( isset( $_GET['rest_route'] ) && isset( $_GET['_for'] ) && ( 'jetpack' === $_GET['_for'] ) )
22
  );
23
  }
41
  }
42
  return $helper_auth_data;
43
  }
44
+
45
+ /**
46
+ * Check if we are currently in Rest API request for the wc/store/cart or wc/store/checkout API call.
47
+ *
48
+ * @return bool
49
+ */
50
+ public static function is_store_api_call() {
51
+ if ( ! WC()->is_rest_api_request() && empty( $GLOBALS['wp']->query_vars['rest_route'] ) ) {
52
+ return false;
53
+ }
54
+ $rest_route = $GLOBALS['wp']->query_vars['rest_route'];
55
+ return (
56
+ false !== strpos( $rest_route, 'wc/store/cart' ) ||
57
+ false !== strpos( $rest_route, 'wc/store/checkout' )
58
+ );
59
+ }
60
+
61
+ /**
62
+ * Check if current page has woocommerce cart or checkout block.
63
+ *
64
+ * @return bool
65
+ */
66
+ public static function has_cart_or_checkout_block() {
67
+ $page = get_post();
68
+ if ( ! $page ) {
69
+ return false;
70
+ }
71
+
72
+ $blocks = parse_blocks( $page->post_content );
73
+ if ( ! $blocks ) {
74
+ return false;
75
+ }
76
+
77
+ foreach ( $blocks as $block ) {
78
+ $block_name = $block['blockName'];
79
+ if ( 'woocommerce/cart' === $block_name || 'woocommerce/checkout' === $block_name ) {
80
+ return true;
81
+ }
82
+ }
83
+
84
+ return false;
85
+ }
86
  }
87
  }
classes/class-wc-connect-help-view.php CHANGED
@@ -28,9 +28,9 @@ if ( ! class_exists( 'WC_Connect_Help_View' ) ) {
28
  WC_Connect_Service_Settings_Store $service_settings_store,
29
  WC_Connect_Logger $logger ) {
30
 
31
- $this->service_schemas_store = $service_schemas_store;
32
  $this->service_settings_store = $service_settings_store;
33
- $this->logger = $logger;
34
 
35
  add_filter( 'woocommerce_admin_status_tabs', array( $this, 'status_tabs' ) );
36
  add_action( 'woocommerce_admin_status_content_connect', array( $this, 'page' ) );
@@ -44,23 +44,23 @@ if ( ! class_exists( 'WC_Connect_Help_View' ) ) {
44
  // Check that WooCommerce is at least 2.6 or higher (feature-plugin only)
45
  // Check that WooCommerce base_country is set
46
  $base_country = WC()->countries->get_base_country();
47
- if ( version_compare( WC()->version, WOOCOMMERCE_CONNECT_MINIMUM_WOOCOMMERCE_VERSION, "<" ) ) {
48
  $health_item = array(
49
- 'state' => 'error',
50
  'message' => sprintf(
51
- __( 'WooCommerce %s or higher is required (You are running %s)', 'woocommerce-services' ),
52
  WOOCOMMERCE_CONNECT_MINIMUM_WOOCOMMERCE_VERSION,
53
  WC()->version
54
  ),
55
  );
56
- } else if ( empty( $base_country ) ) {
57
  $health_item = array(
58
- 'state' => 'error',
59
  'message' => __( 'Please set Base Location in WooCommerce Settings > General', 'woocommerce-services' ),
60
  );
61
  } else {
62
  $health_item = array(
63
- 'state' => 'success',
64
  'message' => sprintf(
65
  __( 'WooCommerce %s is configured correctly', 'woocommerce-services' ),
66
  WC()->version
@@ -73,38 +73,38 @@ if ( ! class_exists( 'WC_Connect_Help_View' ) ) {
73
  // Only one of the following should present
74
  // Check that Jetpack is active
75
  // Check that Jetpack is connected
76
- include_once ( ABSPATH . 'wp-admin/includes/plugin.php' ); // required for is_plugin_active
77
  $is_connected = WC_Connect_Jetpack::is_active() || WC_Connect_Jetpack::is_development_mode();
78
  if ( ! is_plugin_active( 'jetpack/jetpack.php' ) ) {
79
  $health_item = array(
80
- 'state' => 'error',
81
  'message' => sprintf(
82
  __( 'Please install and activate the Jetpack plugin, version %s or higher', 'woocommerce-services' ),
83
  WOOCOMMERCE_CONNECT_MINIMUM_JETPACK_VERSION
84
  ),
85
  );
86
- } else if ( version_compare( JETPACK__VERSION, WOOCOMMERCE_CONNECT_MINIMUM_JETPACK_VERSION, "<" ) ) {
87
  $health_item = array(
88
- 'state' => 'error',
89
  'message' => sprintf(
90
- __( 'Jetpack %s or higher is required (You are running %s)', 'woocommerce-services' ),
91
  WOOCOMMERCE_CONNECT_MINIMUM_JETPACK_VERSION,
92
  JETPACK__VERSION
93
  ),
94
  );
95
- } else if ( ! $is_connected ) {
96
  $health_item = array(
97
- 'state' => 'error',
98
  'message' => __( 'Jetpack is not connected to WordPress.com. Make sure the Jetpack plugin is installed, activated, and connected.', 'woocommerce-services' ),
99
  );
100
- } else if ( WC_Connect_Jetpack::is_staging_site() ) {
101
  $health_item = array(
102
- 'state' => 'warning',
103
  'message' => __( 'This is a Jetpack staging site', 'woocommerce-services' ),
104
  );
105
  } else {
106
  $health_item = array(
107
- 'state' => 'success',
108
  'message' => sprintf(
109
  __( 'Jetpack %s is connected and working correctly', 'woocommerce-services' ),
110
  JETPACK__VERSION
@@ -116,46 +116,14 @@ if ( ! class_exists( 'WC_Connect_Help_View' ) ) {
116
  // Lastly, do the WooCommerce Shipping & Tax health check
117
  // Check that we have schema
118
  // Check that we are able to talk to the WooCommerce Shipping & Tax server
119
- $schemas = $this->service_schemas_store->get_service_schemas();
120
- $last_fetch_timestamp = $this->service_schemas_store->get_last_fetch_timestamp();
121
- if ( isset( $_GET['refresh'] ) && 'failed' === $_GET['refresh'] ) {
122
- $health_item = array(
123
- 'state' => 'error',
124
- 'message' => __( 'An error occurred while refreshing service data.', 'woocommerce-services' ),
125
- 'timestamp' => $last_fetch_timestamp,
126
- );
127
- } else if ( is_null( $schemas ) ) {
128
- $health_item = array(
129
- 'state' => 'error',
130
- 'message' => __( 'No service data available', 'woocommerce-services' ),
131
- );
132
- } else if ( is_null( $last_fetch_timestamp ) ) {
133
- $health_item = array(
134
- 'state' => 'warning',
135
- 'message' => __( 'Service data was found, but may be out of date', 'woocommerce-services' ),
136
- 'timestamp' => $last_fetch_timestamp
137
- );
138
- } else if ( $last_fetch_timestamp < time() - WOOCOMMERCE_CONNECT_SCHEMA_AGE_ERROR_THRESHOLD ) {
139
- $health_item = array(
140
- 'state' => 'error',
141
- 'message' => __( 'Service data was found, but is more than three days old', 'woocommerce-services' ),
142
- 'timestamp' => $last_fetch_timestamp
143
- );
144
- } else if ( $last_fetch_timestamp < time() - WOOCOMMERCE_CONNECT_SCHEMA_AGE_WARNING_THRESHOLD ) {
145
- $health_item = array(
146
- 'state' => 'warning',
147
- 'message' => __( 'Service data was found, but is more than one day old', 'woocommerce-services' ),
148
- 'timestamp' => $last_fetch_timestamp
149
- );
150
- } else {
151
- $health_item = array(
152
- 'state' => 'success',
153
- 'message' => __( 'Service data is up-to-date', 'woocommerce-services' ),
154
- 'timestamp' => $last_fetch_timestamp
155
- );
156
- }
157
-
158
- $health_items['woocommerce_services'] = $health_item;
159
 
160
  return $health_items;
161
  }
@@ -173,28 +141,30 @@ if ( ! class_exists( 'WC_Connect_Help_View' ) ) {
173
  foreach ( (array) $enabled_services as $enabled_service ) {
174
  $last_failed_request_timestamp = intval( WC_Connect_Options::get_shipping_method_option( 'failure_timestamp', -1, $enabled_service->method_id, $enabled_service->instance_id ) );
175
 
176
- $service_settings_url = esc_url( add_query_arg(
177
- array(
178
- 'page' => 'wc-settings',
179
- 'tab' => 'shipping',
180
- 'instance_id' => $enabled_service->instance_id
181
- ),
182
- admin_url( 'admin.php' )
183
- ) );
 
 
184
 
185
  // Figure out if the service has any settings saved at all
186
  $service_settings = $this->service_settings_store->get_service_settings( $enabled_service->method_id, $enabled_service->instance_id );
187
  if ( empty( $service_settings ) ) {
188
- $state = 'error';
189
  $message = __( 'Setup for this service has not yet been completed', 'woocommerce-services' );
190
- } else if ( -1 === $last_failed_request_timestamp ) {
191
- $state = 'warning';
192
  $message = __( 'No rate requests have yet been made for this service', 'woocommerce-services' );
193
- } else if ( 0 === $last_failed_request_timestamp ) {
194
- $state = 'success';
195
  $message = __( 'The most recent rate request was successful', 'woocommerce-services' );
196
  } else {
197
- $state = 'error';
198
  $message = __( 'The most recent rate request failed', 'woocommerce-services' );
199
  }
200
 
@@ -204,12 +174,12 @@ if ( ! class_exists( 'WC_Connect_Help_View' ) ) {
204
  );
205
 
206
  $service_items[] = (object) array(
207
- 'title' => $enabled_service->title,
208
- 'subtitle' => $subtitle,
209
- 'state' => $state,
210
- 'message' => $message,
211
  'timestamp' => $last_failed_request_timestamp,
212
- 'url' => $service_settings_url,
213
  );
214
  }
215
 
@@ -220,7 +190,7 @@ if ( ! class_exists( 'WC_Connect_Help_View' ) ) {
220
  * Gets the last 10 lines from the WooCommerce Shipping & Tax log by feature, if it exists
221
  */
222
  protected function get_debug_log_data( $feature = '' ) {
223
- $data = new stdClass;
224
  $data->key = '';
225
  $data->file = null;
226
  $data->tail = array();
@@ -266,12 +236,12 @@ if ( ! class_exists( 'WC_Connect_Help_View' ) ) {
266
  }
267
 
268
  return array(
269
- 'tail' => implode( $log_tail ),
270
- 'url' => $url = add_query_arg(
271
  array(
272
  'page' => 'wc-status',
273
  'tab' => 'logs',
274
- 'log_file' => $data->key
275
  ),
276
  admin_url( 'admin.php' )
277
  ),
@@ -289,7 +259,7 @@ if ( ! class_exists( 'WC_Connect_Help_View' ) ) {
289
  if ( ! is_array( $tabs ) ) {
290
  $tabs = array();
291
  }
292
- $tabs[ 'connect' ] = _x( 'WooCommerce Shipping & Tax', 'The WooCommerce Shipping & Tax brandname', 'woocommerce-services' );
293
  return $tabs;
294
  }
295
 
@@ -299,45 +269,45 @@ if ( ! class_exists( 'WC_Connect_Help_View' ) ) {
299
  * @return array
300
  */
301
  protected function get_form_data() {
302
- $form_data = array(
303
  'health_items' => $this->get_health_items(),
304
  'services' => $this->get_services_items(),
305
  'logging_enabled' => $this->logger->is_logging_enabled(),
306
  'debug_enabled' => $this->logger->is_debug_enabled(),
307
  'logs' => array(
308
- 'shipping' => $this->get_debug_log_data( 'shipping' ),
309
- 'taxes' => $this->get_debug_log_data( 'taxes' ),
310
- 'other' => $this->get_debug_log_data(),
311
- )
312
  );
313
-
314
- return $form_data;
315
  }
316
 
317
  /**
318
  * Localizes the bootstrap, enqueues the script and styles for the help page
319
  */
320
  public function page() {
321
- if ( isset( $_GET['refresh'] ) && 'true' === $_GET['refresh'] ) {
322
- $fetched = $this->service_schemas_store->fetch_service_schemas_from_connect_server();
323
- $url = add_query_arg( 'refresh', $fetched ? false : 'failed' );
324
- wp_safe_redirect( $url );
325
- }
326
-
327
  ?>
328
  <h2>
329
  <?php _e( 'WooCommerce Shipping & Tax Status', 'woocommerce-services' ); ?>
330
  </h2>
331
  <?php
332
 
333
- do_action( 'enqueue_wc_connect_script', 'wc-connect-admin-status', array(
334
- 'formData' => $this->get_form_data(),
335
- ) );
 
 
 
 
336
 
337
- do_action( 'enqueue_wc_connect_script', 'wc-connect-admin-test-print', array(
338
- 'storeOptions' => $this->service_settings_store->get_store_options(),
339
- 'paperSize' => $this->service_settings_store->get_preferred_paper_size(),
340
- ) );
 
 
 
 
341
  }
342
 
343
  }
28
  WC_Connect_Service_Settings_Store $service_settings_store,
29
  WC_Connect_Logger $logger ) {
30
 
31
+ $this->service_schemas_store = $service_schemas_store;
32
  $this->service_settings_store = $service_settings_store;
33
+ $this->logger = $logger;
34
 
35
  add_filter( 'woocommerce_admin_status_tabs', array( $this, 'status_tabs' ) );
36
  add_action( 'woocommerce_admin_status_content_connect', array( $this, 'page' ) );
44
  // Check that WooCommerce is at least 2.6 or higher (feature-plugin only)
45
  // Check that WooCommerce base_country is set
46
  $base_country = WC()->countries->get_base_country();
47
+ if ( version_compare( WC()->version, WOOCOMMERCE_CONNECT_MINIMUM_WOOCOMMERCE_VERSION, '<' ) ) {
48
  $health_item = array(
49
+ 'state' => 'error',
50
  'message' => sprintf(
51
+ __( 'WooCommerce %1$s or higher is required (You are running %2$s)', 'woocommerce-services' ),
52
  WOOCOMMERCE_CONNECT_MINIMUM_WOOCOMMERCE_VERSION,
53
  WC()->version
54
  ),
55
  );
56
+ } elseif ( empty( $base_country ) ) {
57
  $health_item = array(
58
+ 'state' => 'error',
59
  'message' => __( 'Please set Base Location in WooCommerce Settings > General', 'woocommerce-services' ),
60
  );
61
  } else {
62
  $health_item = array(
63
+ 'state' => 'success',
64
  'message' => sprintf(
65
  __( 'WooCommerce %s is configured correctly', 'woocommerce-services' ),
66
  WC()->version
73
  // Only one of the following should present
74
  // Check that Jetpack is active
75
  // Check that Jetpack is connected
76
+ include_once ABSPATH . 'wp-admin/includes/plugin.php'; // required for is_plugin_active
77
  $is_connected = WC_Connect_Jetpack::is_active() || WC_Connect_Jetpack::is_development_mode();
78
  if ( ! is_plugin_active( 'jetpack/jetpack.php' ) ) {
79
  $health_item = array(
80
+ 'state' => 'error',
81
  'message' => sprintf(
82
  __( 'Please install and activate the Jetpack plugin, version %s or higher', 'woocommerce-services' ),
83
  WOOCOMMERCE_CONNECT_MINIMUM_JETPACK_VERSION
84
  ),
85
  );
86
+ } elseif ( version_compare( JETPACK__VERSION, WOOCOMMERCE_CONNECT_MINIMUM_JETPACK_VERSION, '<' ) ) {
87
  $health_item = array(
88
+ 'state' => 'error',
89
  'message' => sprintf(
90
+ __( 'Jetpack %1$s or higher is required (You are running %2$s)', 'woocommerce-services' ),
91
  WOOCOMMERCE_CONNECT_MINIMUM_JETPACK_VERSION,
92
  JETPACK__VERSION
93
  ),
94
  );
95
+ } elseif ( ! $is_connected ) {
96
  $health_item = array(
97
+ 'state' => 'error',
98
  'message' => __( 'Jetpack is not connected to WordPress.com. Make sure the Jetpack plugin is installed, activated, and connected.', 'woocommerce-services' ),
99
  );
100
+ } elseif ( WC_Connect_Jetpack::is_staging_site() ) {
101
  $health_item = array(
102
+ 'state' => 'warning',
103
  'message' => __( 'This is a Jetpack staging site', 'woocommerce-services' ),
104
  );
105
  } else {
106
  $health_item = array(
107
+ 'state' => 'success',
108
  'message' => sprintf(
109
  __( 'Jetpack %s is connected and working correctly', 'woocommerce-services' ),
110
  JETPACK__VERSION
116
  // Lastly, do the WooCommerce Shipping & Tax health check
117
  // Check that we have schema
118
  // Check that we are able to talk to the WooCommerce Shipping & Tax server
119
+ $schemas = $this->service_schemas_store->get_service_schemas();
120
+ $last_fetch_timestamp = $this->service_schemas_store->get_last_fetch_timestamp();
121
+ $health_items['woocommerce_services'] = array(
122
+ 'timestamp' => $last_fetch_timestamp,
123
+ 'has_service_schemas' => ! is_null( $schemas ),
124
+ 'error_threshold' => 3 * DAY_IN_SECONDS,
125
+ 'warning_threshold' => DAY_IN_SECONDS,
126
+ );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
127
 
128
  return $health_items;
129
  }
141
  foreach ( (array) $enabled_services as $enabled_service ) {
142
  $last_failed_request_timestamp = intval( WC_Connect_Options::get_shipping_method_option( 'failure_timestamp', -1, $enabled_service->method_id, $enabled_service->instance_id ) );
143
 
144
+ $service_settings_url = esc_url(
145
+ add_query_arg(
146
+ array(
147
+ 'page' => 'wc-settings',
148
+ 'tab' => 'shipping',
149
+ 'instance_id' => $enabled_service->instance_id,
150
+ ),
151
+ admin_url( 'admin.php' )
152
+ )
153
+ );
154
 
155
  // Figure out if the service has any settings saved at all
156
  $service_settings = $this->service_settings_store->get_service_settings( $enabled_service->method_id, $enabled_service->instance_id );
157
  if ( empty( $service_settings ) ) {
158
+ $state = 'error';
159
  $message = __( 'Setup for this service has not yet been completed', 'woocommerce-services' );
160
+ } elseif ( -1 === $last_failed_request_timestamp ) {
161
+ $state = 'warning';
162
  $message = __( 'No rate requests have yet been made for this service', 'woocommerce-services' );
163
+ } elseif ( 0 === $last_failed_request_timestamp ) {
164
+ $state = 'success';
165
  $message = __( 'The most recent rate request was successful', 'woocommerce-services' );
166
  } else {
167
+ $state = 'error';
168
  $message = __( 'The most recent rate request failed', 'woocommerce-services' );
169
  }
170
 
174
  );
175
 
176
  $service_items[] = (object) array(
177
+ 'title' => $enabled_service->title,
178
+ 'subtitle' => $subtitle,
179
+ 'state' => $state,
180
+ 'message' => $message,
181
  'timestamp' => $last_failed_request_timestamp,
182
+ 'url' => $service_settings_url,
183
  );
184
  }
185
 
190
  * Gets the last 10 lines from the WooCommerce Shipping & Tax log by feature, if it exists
191
  */
192
  protected function get_debug_log_data( $feature = '' ) {
193
+ $data = new stdClass();
194
  $data->key = '';
195
  $data->file = null;
196
  $data->tail = array();
236
  }
237
 
238
  return array(
239
+ 'tail' => implode( $log_tail ),
240
+ 'url' => $url = add_query_arg(
241
  array(
242
  'page' => 'wc-status',
243
  'tab' => 'logs',
244
+ 'log_file' => $data->key,
245
  ),
246
  admin_url( 'admin.php' )
247
  ),
259
  if ( ! is_array( $tabs ) ) {
260
  $tabs = array();
261
  }
262
+ $tabs['connect'] = _x( 'WooCommerce Shipping & Tax', 'The WooCommerce Shipping & Tax brandname', 'woocommerce-services' );
263
  return $tabs;
264
  }
265
 
269
  * @return array
270
  */
271
  protected function get_form_data() {
272
+ return array(
273
  'health_items' => $this->get_health_items(),
274
  'services' => $this->get_services_items(),
275
  'logging_enabled' => $this->logger->is_logging_enabled(),
276
  'debug_enabled' => $this->logger->is_debug_enabled(),
277
  'logs' => array(
278
+ 'shipping' => $this->get_debug_log_data( 'shipping' ),
279
+ 'taxes' => $this->get_debug_log_data( 'taxes' ),
280
+ 'other' => $this->get_debug_log_data(),
281
+ ),
282
  );
 
 
283
  }
284
 
285
  /**
286
  * Localizes the bootstrap, enqueues the script and styles for the help page
287
  */
288
  public function page() {
 
 
 
 
 
 
289
  ?>
290
  <h2>
291
  <?php _e( 'WooCommerce Shipping & Tax Status', 'woocommerce-services' ); ?>
292
  </h2>
293
  <?php
294
 
295
+ do_action(
296
+ 'enqueue_wc_connect_script',
297
+ 'wc-connect-admin-status',
298
+ array(
299
+ 'formData' => $this->get_form_data(),
300
+ )
301
+ );
302
 
303
+ do_action(
304
+ 'enqueue_wc_connect_script',
305
+ 'wc-connect-admin-test-print',
306
+ array(
307
+ 'storeOptions' => $this->service_settings_store->get_store_options(),
308
+ 'paperSize' => $this->service_settings_store->get_preferred_paper_size(),
309
+ )
310
+ );
311
  }
312
 
313
  }
classes/class-wc-connect-jetpack.php CHANGED
@@ -29,6 +29,7 @@ if ( ! class_exists( 'WC_Connect_Jetpack' ) ) {
29
 
30
  /**
31
  * Helper method to get if Jetpack is in development mode
 
32
  * @return bool
33
  */
34
  public static function is_development_mode() {
@@ -42,10 +43,11 @@ if ( ! class_exists( 'WC_Connect_Jetpack' ) ) {
42
 
43
  /**
44
  * Helper method to get if Jetpack is connected (aka active)
 
45
  * @return bool
46
  */
47
  public static function is_active() {
48
- if ( defined( 'WOOCOMMERCE_SERVICES_LOCAL_TEST_MODE') && WOOCOMMERCE_SERVICES_LOCAL_TEST_MODE ) {
49
  return true;
50
  }
51
  if ( method_exists( 'Jetpack', 'is_active' ) ) {
@@ -57,6 +59,7 @@ if ( ! class_exists( 'WC_Connect_Jetpack' ) ) {
57
 
58
  /**
59
  * Helper method to get if the current Jetpack website is marked as staging
 
60
  * @return bool
61
  */
62
  public static function is_staging_site() {
@@ -74,6 +77,7 @@ if ( ! class_exists( 'WC_Connect_Jetpack' ) ) {
74
 
75
  /**
76
  * Helper method to get whether the current site is an Atomic site
 
77
  * @return bool
78
  */
79
  public static function is_atomic_site() {
@@ -102,10 +106,11 @@ if ( ! class_exists( 'WC_Connect_Jetpack' ) ) {
102
 
103
  /**
104
  * Helper method to get the Jetpack master user, IF we are connected
 
105
  * @return WP_User | false
106
  */
107
  public static function get_master_user() {
108
- include_once ( ABSPATH . 'wp-admin/includes/plugin.php' );
109
  if ( self::is_active() && method_exists( 'Jetpack_Options', 'get_option' ) ) {
110
  $master_user_id = Jetpack_Options::get_option( 'master_user' );
111
  return get_userdata( $master_user_id );
@@ -117,6 +122,7 @@ if ( ! class_exists( 'WC_Connect_Jetpack' ) ) {
117
 
118
  /**
119
  * Builds a connect url
 
120
  * @param $redirect_url
121
  * @return string
122
  */
@@ -130,6 +136,7 @@ if ( ! class_exists( 'WC_Connect_Jetpack' ) ) {
130
 
131
  /**
132
  * Records a Tracks event
 
133
  * @param $user
134
  * @param $event_type
135
  * @param
@@ -145,5 +152,47 @@ if ( ! class_exists( 'WC_Connect_Jetpack' ) ) {
145
  }
146
  return false;
147
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
148
  }
149
  }
29
 
30
  /**
31
  * Helper method to get if Jetpack is in development mode
32
+ *
33
  * @return bool
34
  */
35
  public static function is_development_mode() {
43
 
44
  /**
45
  * Helper method to get if Jetpack is connected (aka active)
46
+ *
47
  * @return bool
48
  */
49
  public static function is_active() {
50
+ if ( defined( 'WOOCOMMERCE_SERVICES_LOCAL_TEST_MODE' ) && WOOCOMMERCE_SERVICES_LOCAL_TEST_MODE ) {
51
  return true;
52
  }
53
  if ( method_exists( 'Jetpack', 'is_active' ) ) {
59
 
60
  /**
61
  * Helper method to get if the current Jetpack website is marked as staging
62
+ *
63
  * @return bool
64
  */
65
  public static function is_staging_site() {
77
 
78
  /**
79
  * Helper method to get whether the current site is an Atomic site
80
+ *
81
  * @return bool
82
  */
83
  public static function is_atomic_site() {
106
 
107
  /**
108
  * Helper method to get the Jetpack master user, IF we are connected
109
+ *
110
  * @return WP_User | false
111
  */
112
  public static function get_master_user() {
113
+ include_once ABSPATH . 'wp-admin/includes/plugin.php';
114
  if ( self::is_active() && method_exists( 'Jetpack_Options', 'get_option' ) ) {
115
  $master_user_id = Jetpack_Options::get_option( 'master_user' );
116
  return get_userdata( $master_user_id );
122
 
123
  /**
124
  * Builds a connect url
125
+ *
126
  * @param $redirect_url
127
  * @return string
128
  */
136
 
137
  /**
138
  * Records a Tracks event
139
+ *
140
  * @param $user
141
  * @param $event_type
142
  * @param
152
  }
153
  return false;
154
  }
155
+
156
+ /**
157
+ * Determines if the current user is connected to Jetpack
158
+ *
159
+ * @return bool Whether or nor the current user is connected to Jetpack
160
+ */
161
+ public static function is_current_user_connected() {
162
+ if ( class_exists( '\Automattic\Jetpack\Connection\Manager' ) && method_exists( '\Automattic\Jetpack\Connection\Manager', 'is_user_connected' ) ) {
163
+ $connection = new Manager();
164
+
165
+ return $connection->is_user_connected();
166
+ }
167
+
168
+ if ( defined( JETPACK_MASTER_USER ) ) {
169
+ $user_token = self::get_master_user_access_token( JETPACK_MASTER_USER );
170
+
171
+ return ( isset( $user_token->external_user_id ) && get_current_user_id() === $user_token->external_user_id );
172
+ }
173
+
174
+ return false;
175
+ }
176
+
177
+ /**
178
+ * Determines if Jetpack is connected
179
+ *
180
+ * @return bool Whether or nor Jetpack is connected
181
+ */
182
+ public static function is_connected() {
183
+ if ( class_exists( '\Automattic\Jetpack\Connection\Manager' ) && method_exists( '\Automattic\Jetpack\Connection\Manager', 'is_connected' ) ) {
184
+ $connection = new Manager();
185
+
186
+ return $connection->is_connected();
187
+ }
188
+
189
+ if ( defined( JETPACK_MASTER_USER ) ) {
190
+ $user_token = self::get_master_user_access_token( JETPACK_MASTER_USER );
191
+
192
+ return isset( $user_token->external_user_id );
193
+ }
194
+
195
+ return false;
196
+ }
197
  }
198
  }
classes/class-wc-connect-label-reports.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
 
3
  if ( ! class_exists( 'WC_Connect_Label_Reports' ) ) {
4
- include_once( WC()->plugin_path() . '/includes/admin/reports/class-wc-admin-report.php' );
5
 
6
  class WC_Connect_Label_Reports extends WC_Admin_Report {
7
  const LABELS_TRANSIENT_KEY = 'wcs_label_reports';
@@ -35,9 +35,9 @@ if ( ! class_exists( 'WC_Connect_Label_Reports' ) ) {
35
 
36
  private function get_all_labels() {
37
  global $wpdb;
38
- $query = "SELECT post_id, meta_value FROM {$wpdb->postmeta} WHERE meta_key = 'wc_connect_labels'";
39
  $db_results = $wpdb->get_results( $query );
40
- $results = array();
41
 
42
  foreach ( $db_results as $meta ) {
43
  $labels = maybe_unserialize( $meta->meta_value );
@@ -60,16 +60,16 @@ if ( ! class_exists( 'WC_Connect_Label_Reports' ) ) {
60
  }
61
 
62
  private function query_labels() {
63
- $all_labels = get_transient( self::LABELS_TRANSIENT_KEY );
64
  if ( false === $all_labels ) {
65
  $all_labels = $this->get_all_labels();
66
- //set transient with ttl of 30 minutes
67
  set_transient( self::LABELS_TRANSIENT_KEY, $all_labels, 1800 );
68
  }
69
 
70
  // translate timestamps to JS timestapms
71
  $start_date = $this->start_date * 1000;
72
- $end_date = $this->end_date * 1000;
73
 
74
  $results = array();
75
  foreach ( $all_labels as $label ) {
@@ -78,19 +78,19 @@ if ( ! class_exists( 'WC_Connect_Label_Reports' ) ) {
78
  continue;
79
  }
80
 
81
- //labels are sorted in descending order, so if we reached the end, break the loop
82
  if ( $created < $start_date ) {
83
  break;
84
  }
85
 
86
- if ( isset( $label['error'] ) || //ignore the error labels
87
- ! isset( $label['rate'] ) ) { //labels where purchase hasn't completed for any reason
88
  continue;
89
  }
90
 
91
- //ignore labels with complete refunds
92
  if ( isset( $label['refund'] ) ) {
93
- $refund = ( array ) $label['refund'];
94
  if ( isset( $refund['status'] ) && 'completed' === $refund['status'] ) {
95
  continue;
96
  }
@@ -121,7 +121,7 @@ if ( ! class_exists( 'WC_Connect_Label_Reports' ) ) {
121
 
122
  $hide_sidebar = true;
123
 
124
- include( WC()->plugin_path() . '/includes/admin/views/html-report-by-date.php' );
125
  }
126
 
127
  private function get_order_url( $post_id ) {
@@ -134,7 +134,7 @@ if ( ! class_exists( 'WC_Connect_Label_Reports' ) ) {
134
  return '';
135
  }
136
 
137
- $refund = ( array ) $label['refund'];
138
 
139
  if ( isset( $refund['status'] ) &&
140
  ( 'rejected' === $refund['status'] || 'complete' === $refund['status'] ) ) {
1
  <?php
2
 
3
  if ( ! class_exists( 'WC_Connect_Label_Reports' ) ) {
4
+ include_once WC()->plugin_path() . '/includes/admin/reports/class-wc-admin-report.php';
5
 
6
  class WC_Connect_Label_Reports extends WC_Admin_Report {
7
  const LABELS_TRANSIENT_KEY = 'wcs_label_reports';
35
 
36
  private function get_all_labels() {
37
  global $wpdb;
38
+ $query = "SELECT post_id, meta_value FROM {$wpdb->postmeta} WHERE meta_key = 'wc_connect_labels'";
39
  $db_results = $wpdb->get_results( $query );
40
+ $results = array();
41
 
42
  foreach ( $db_results as $meta ) {
43
  $labels = maybe_unserialize( $meta->meta_value );
60
  }
61
 
62
  private function query_labels() {
63
+ $all_labels = get_transient( self::LABELS_TRANSIENT_KEY );
64
  if ( false === $all_labels ) {
65
  $all_labels = $this->get_all_labels();
66
+ // set transient with ttl of 30 minutes
67
  set_transient( self::LABELS_TRANSIENT_KEY, $all_labels, 1800 );
68
  }
69
 
70
  // translate timestamps to JS timestapms
71
  $start_date = $this->start_date * 1000;
72
+ $end_date = $this->end_date * 1000;
73
 
74
  $results = array();
75
  foreach ( $all_labels as $label ) {
78
  continue;
79
  }
80
 
81
+ // labels are sorted in descending order, so if we reached the end, break the loop
82
  if ( $created < $start_date ) {
83
  break;
84
  }
85
 
86
+ if ( isset( $label['error'] ) || // ignore the error labels
87
+ ! isset( $label['rate'] ) ) { // labels where purchase hasn't completed for any reason
88
  continue;
89
  }
90
 
91
+ // ignore labels with complete refunds
92
  if ( isset( $label['refund'] ) ) {
93
+ $refund = (array) $label['refund'];
94
  if ( isset( $refund['status'] ) && 'completed' === $refund['status'] ) {
95
  continue;
96
  }
121
 
122
  $hide_sidebar = true;
123
 
124
+ include WC()->plugin_path() . '/includes/admin/views/html-report-by-date.php';
125
  }
126
 
127
  private function get_order_url( $post_id ) {
134
  return '';
135
  }
136
 
137
+ $refund = (array) $label['refund'];
138
 
139
  if ( isset( $refund['status'] ) &&
140
  ( 'rejected' === $refund['status'] || 'complete' === $refund['status'] ) ) {
classes/class-wc-connect-logger.php CHANGED
@@ -50,11 +50,11 @@ if ( ! class_exists( 'WC_Connect_Logger' ) ) {
50
  public function enable_logging() {
51
  WC_Connect_Options::update_option( 'debug_logging_enabled', true );
52
  $this->is_logging_enabled = true;
53
- $this->log( "Logging enabled" );
54
  }
55
 
56
  public function disable_logging() {
57
- $this->log( "Logging disabled" );
58
  WC_Connect_Options::update_option( 'debug_logging_enabled', false );
59
  $this->is_logging_enabled = false;
60
  }
@@ -86,7 +86,7 @@ if ( ! class_exists( 'WC_Connect_Logger' ) ) {
86
  * @param string $type Notice type.
87
  */
88
  public function debug( $message, $type = 'notice' ) {
89
- if ( $this->is_debug_enabled() ) {
90
  wc_add_notice( $message, $type );
91
  }
92
  }
@@ -127,7 +127,6 @@ if ( ! class_exists( 'WC_Connect_Logger' ) ) {
127
 
128
  $this->logger->add( $log_file, $log_message );
129
 
130
-
131
  }
132
 
133
  }
50
  public function enable_logging() {
51
  WC_Connect_Options::update_option( 'debug_logging_enabled', true );
52
  $this->is_logging_enabled = true;
53
+ $this->log( 'Logging enabled' );
54
  }
55
 
56
  public function disable_logging() {
57
+ $this->log( 'Logging disabled' );
58
  WC_Connect_Options::update_option( 'debug_logging_enabled', false );
59
  $this->is_logging_enabled = false;
60
  }
86
  * @param string $type Notice type.
87
  */
88
  public function debug( $message, $type = 'notice' ) {
89
+ if ( $this->is_debug_enabled() ) {
90
  wc_add_notice( $message, $type );
91
  }
92
  }
127
 
128
  $this->logger->add( $log_file, $log_message );
129
 
 
130
  }
131
 
132
  }
classes/class-wc-connect-note-dhl-live-rates-available.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * WooCommerce Shipping note: DHL live rates available.
4
+ *
5
+ * Only for legacy customers that had the feature available.
6
+ */
7
+
8
+ class WC_Connect_Note_DHL_Live_Rates_Available {
9
+
10
+ use Automattic\WooCommerce\Admin\Notes\NoteTraits;
11
+
12
+ /**
13
+ * Name of the note for use in the database.
14
+ */
15
+ const NOTE_NAME = 'wc-services-dhl-live-rates-available';
16
+
17
+ /**
18
+ * Maybe add note to inform WooCommerce Shipping users with legacy live rates about new DHL live rates.
19
+ *
20
+ * @param WC_Connect_Service_Schemas_Store $schemas Store schemas.
21
+ */
22
+ public static function init( WC_Connect_Service_Schemas_Store $schemas ) {
23
+ // If store has DHL Express live rates.
24
+ $has_wc_services_dhl_express = in_array( 'wc_services_dhlexpress', $schemas->get_all_shipping_method_ids(), true );
25
+
26
+ if ( $has_wc_services_dhl_express ) {
27
+ self::possibly_add_note();
28
+ }
29
+ }
30
+
31
+ /**
32
+ * Get the note.
33
+ *
34
+ * @return Automattic\WooCommerce\Admin\Notes\Note
35
+ */
36
+ public static function get_note() {
37
+ $note = new Automattic\WooCommerce\Admin\Notes\Note();
38
+
39
+ $note->set_title( __( 'DHL Express live rates are now available', 'woocommerce-services' ) );
40
+ $note->set_content( __( 'Add DHL Express as a shipping method to selected shipping zones to display live rates at checkout.', 'woocommerce-services' ) );
41
+ $note->set_type( Automattic\WooCommerce\Admin\Notes\Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
42
+ $note->set_name( self::NOTE_NAME );
43
+ $note->set_source( 'woocommerce-services' );
44
+ $note->add_action(
45
+ 'go-to-shipping-zones',
46
+ __( 'Go to shipping zones', 'woocommerce-services' ),
47
+ admin_url( 'admin.php?page=wc-settings&tab=shipping' )
48
+ );
49
+
50
+ return $note;
51
+ }
52
+ }
classes/class-wc-connect-nux.php CHANGED
@@ -6,11 +6,11 @@ if ( ! class_exists( 'WC_Connect_Nux' ) ) {
6
  /**
7
  * Jetpack status constants.
8
  */
9
- const JETPACK_NOT_INSTALLED = 'uninstalled';
10
  const JETPACK_INSTALLED_NOT_ACTIVATED = 'installed';
11
  const JETPACK_ACTIVATED_NOT_CONNECTED = 'activated';
12
- const JETPACK_DEV = 'dev';
13
- const JETPACK_CONNECTED = 'connected';
14
 
15
  const IS_NEW_LABEL_USER = 'wcc_is_new_label_user';
16
 
@@ -31,7 +31,7 @@ if ( ! class_exists( 'WC_Connect_Nux' ) ) {
31
  private $shipping_label;
32
 
33
  function __construct( WC_Connect_Tracks $tracks, WC_Connect_Shipping_Label $shipping_label ) {
34
- $this->tracks = $tracks;
35
  $this->shipping_label = $shipping_label;
36
 
37
  $this->init_pointers();
@@ -54,7 +54,7 @@ if ( ! class_exists( 'WC_Connect_Nux' ) ) {
54
  }
55
 
56
  public function dismiss_notice( $notice ) {
57
- $notices = $this->get_notice_states();
58
  $notices[ $notice ] = true;
59
  update_user_meta( get_current_user_id(), 'wc_connect_nux_notices', $notices );
60
  }
@@ -75,7 +75,8 @@ if ( ! class_exists( 'WC_Connect_Nux' ) ) {
75
  }
76
 
77
  public function show_pointers( $hook ) {
78
- /* Get admin pointers for the current admin page.
 
79
  *
80
  * @since 0.9.6
81
  *
@@ -88,11 +89,11 @@ if ( ! class_exists( 'WC_Connect_Nux' ) ) {
88
  }
89
 
90
  $dismissed_pointers = $this->get_dismissed_pointers();
91
- $valid_pointers = array();
92
 
93
  foreach ( $pointers as $pointer ) {
94
  if ( ! in_array( $pointer['id'], $dismissed_pointers, true ) ) {
95
- $valid_pointers[] = $pointer;
96
  }
97
  }
98
 
@@ -126,7 +127,7 @@ if ( ! class_exists( 'WC_Connect_Nux' ) ) {
126
  }
127
 
128
  $dismissed_pointers[] = $pointer_to_dismiss;
129
- $dismissed_data = implode( ',', $dismissed_pointers );
130
  update_user_meta( get_current_user_id(), 'dismissed_wp_pointers', $dismissed_data );
131
  }
132
 
@@ -134,8 +135,8 @@ if ( ! class_exists( 'WC_Connect_Nux' ) ) {
134
  $is_new_user = get_transient( self::IS_NEW_LABEL_USER );
135
  if ( false === $is_new_user ) {
136
  global $wpdb;
137
- $query = "SELECT meta_key FROM {$wpdb->postmeta} WHERE meta_key = 'wc_connect_labels' LIMIT 1";
138
- $results = $wpdb->get_results( $query );
139
  $is_new_user = 0 === count( $results ) ? 'yes' : 'no';
140
  set_transient( self::IS_NEW_LABEL_USER, $is_new_user );
141
  }
@@ -161,16 +162,20 @@ if ( ! class_exists( 'WC_Connect_Nux' ) ) {
161
  }
162
 
163
  $pointers[] = array(
164
- 'id' => 'wc_services_labels_metabox',
165
- 'target' => '#woocommerce-order-label .button',
166
  'options' => array(
167
- 'content' => sprintf( '<h3>%s</h3><p>%s</p>',
168
- __( 'Discounted Shipping Labels' ,'woocommerce-services' ),
169
- sprintf( __( "When you're ready, purchase and print discounted labels from %s right here.", 'woocommerce-services' ), implode(' or ', $supported_carriers) )
 
 
 
 
 
170
  ),
171
- 'position' => array( 'edge' => 'top', 'align' => 'left' ),
172
  ),
173
- 'dim' => true,
174
  );
175
 
176
  return $pointers;
@@ -190,16 +195,20 @@ if ( ! class_exists( 'WC_Connect_Nux' ) ) {
190
  }
191
 
192
  $pointers[] = array(
193
- 'id' => 'wc_services_new_carrier_dhl_express',
194
- 'target' => '#woocommerce-order-label .button',
195
  'options' => array(
196
- 'content' => sprintf( '<h3>%s</h3><p>%s</p>',
197
- __( 'Discounted DHL Shipping Labels' ,'woocommerce-services' ),
198
- __( "WooCommerce Shipping now supports DHL labels for international shipments. Purchase and print discounted labels from DHL and USPS right here.", 'woocommerce-services' )
 
 
 
 
 
199
  ),
200
- 'position' => array( 'edge' => 'top', 'align' => 'left' ),
201
  ),
202
- 'dim' => true,
203
  );
204
 
205
  return $pointers;
@@ -228,11 +237,7 @@ if ( ! class_exists( 'WC_Connect_Nux' ) ) {
228
  return true;
229
  }
230
 
231
- $user_token = WC_Connect_Jetpack::get_master_user_access_token( JETPACK_MASTER_USER );
232
- $can_accept = (
233
- isset( $user_token->external_user_id ) &&
234
- get_current_user_id() === $user_token->external_user_id
235
- );
236
 
237
  return $can_accept;
238
  }
@@ -242,7 +247,8 @@ if ( ! class_exists( 'WC_Connect_Nux' ) ) {
242
  return false;
243
  }
244
 
245
- /* The NUX Flow:
 
246
  - Case 1: Jetpack not connected (with TOS or no TOS accepted):
247
  1. show_banner_before_connection()
248
  2. connect to JP
@@ -283,7 +289,7 @@ if ( ! class_exists( 'WC_Connect_Nux' ) ) {
283
 
284
  public function get_jetpack_install_status() {
285
  // we need to use validate_plugin to check that Jetpack is installed
286
- include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
287
 
288
  // check if jetpack is installed
289
  if ( 0 !== validate_plugin( 'jetpack/jetpack.php' ) ) {
@@ -302,8 +308,7 @@ if ( ! class_exists( 'WC_Connect_Nux' ) ) {
302
 
303
  // installed, activated, dev mode off
304
  // check if connected
305
- $user_token = WC_Connect_Jetpack::get_master_user_access_token( JETPACK_MASTER_USER );
306
- if ( ! isset( $user_token->external_user_id ) ) { // always an int
307
  return self::JETPACK_ACTIVATED_NOT_CONNECTED;
308
  }
309
 
@@ -372,23 +377,23 @@ if ( ! class_exists( 'WC_Connect_Nux' ) ) {
372
  $supports_taxes = $this->is_taxjar_supported_country( $country );
373
  $supports_labels = ( 'US' === $country );
374
 
375
- $is_ppec_active = is_plugin_active( 'woocommerce-gateway-paypal-express-checkout/woocommerce-gateway-paypal-express-checkout.php' );
376
- $ppec_settings = get_option( 'woocommerce_ppec_paypal_settings', array() );
377
- $supports_payments = $is_ppec_active && ( ! isset( $ppec_settings['enabled'] ) || 'yes' === $ppec_settings['enabled'] );
378
 
379
  if ( $supports_payments && $supports_taxes && $supports_labels ) {
380
  $feature_list = __( 'automated tax calculation, shipping label printing, and smoother payment setup', 'woocommerce-services' );
381
  } elseif ( $supports_payments && $supports_taxes ) {
382
  $feature_list = __( 'automated tax calculation and smoother payment setup', 'woocommerce-services' );
383
- } else if ( $supports_taxes && $supports_labels ) {
384
  $feature_list = __( 'automated tax calculation and shipping label printing', 'woocommerce-services' );
385
- } else if ( $supports_payments && $supports_labels ) {
386
  $feature_list = __( 'shipping label printing and smoother payment setup', 'woocommerce-services' );
387
- } else if ( $supports_payments ) {
388
  $feature_list = __( 'smoother payment setup', 'woocommerce-services' );
389
- } else if ( $supports_taxes ) {
390
  $feature_list = __( 'automated tax calculation', 'woocommerce-services' );
391
- } else if ( $supports_labels ) {
392
  $feature_list = __( 'shipping label printing', 'woocommerce-services' );
393
  }
394
 
@@ -399,7 +404,7 @@ if ( ! class_exists( 'WC_Connect_Nux' ) ) {
399
  $full_path = add_query_arg( array() );
400
  // Remove [...]/wp-admin so we can use admin_url().
401
  $new_index = strpos( $full_path, '/wp-admin' ) + strlen( '/wp-admin' );
402
- $path = substr( $full_path, $new_index );
403
  return admin_url( $path );
404
  }
405
 
@@ -417,12 +422,14 @@ if ( ! class_exists( 'WC_Connect_Nux' ) ) {
417
  return;
418
  }
419
 
420
- $banner_to_display = self::get_banner_type_to_display( array(
421
- 'jetpack_connection_status' => $jetpack_install_status,
422
- 'tos_accepted' => WC_Connect_Options::get_option( 'tos_accepted' ),
423
- 'can_accept_tos' => $this->can_accept_tos(),
424
- 'should_display_after_cxn_banner' => WC_Connect_Options::get_option( self::SHOULD_SHOW_AFTER_CXN_BANNER ),
425
- ) );
 
 
426
 
427
  switch ( $banner_to_display ) {
428
  case 'before_jetpack_connection':
@@ -439,10 +446,12 @@ if ( ! class_exists( 'WC_Connect_Nux' ) ) {
439
  );
440
  wp_enqueue_script( 'wc_connect_banner' );
441
  wp_localize_script( 'wc_connect_banner', 'wcs_nux_notice', $ajax_data );
442
- add_action( 'wp_ajax_woocommerce_services_activate_jetpack',
 
443
  array( $this, 'ajax_activate_jetpack' )
444
  );
445
- add_action( 'wp_ajax_woocommerce_services_get_jetpack_connect_url',
 
446
  array( $this, 'ajax_get_jetpack_connect_url' )
447
  );
448
  wp_enqueue_style( 'wc_connect_banner' );
@@ -490,10 +499,10 @@ if ( ! class_exists( 'WC_Connect_Nux' ) ) {
490
 
491
  switch ( $jetpack_status ) {
492
  case self::JETPACK_NOT_INSTALLED:
493
- $button_text = __( 'Install Jetpack and connect', 'woocommerce-services' );
494
  break;
495
  case self::JETPACK_INSTALLED_NOT_ACTIVATED:
496
- $button_text = __( 'Activate Jetpack and connect', 'woocommerce-services' );
497
  break;
498
  }
499
 
@@ -540,19 +549,24 @@ if ( ! class_exists( 'WC_Connect_Nux' ) ) {
540
  $description_base = __( 'You can now enjoy %s.', 'woocommerce-services' );
541
  $feature_list = $this->get_feature_list_for_country( $country );
542
 
543
- $this->show_nux_banner( array(
544
- 'title' => __( 'Setup complete.', 'woocommerce-services' ),
545
- 'description' => esc_html( sprintf( $description_base, $feature_list ) ),
546
- 'button_text' => __( 'Got it, thanks!', 'woocommerce-services' ),
547
- 'button_link' => add_query_arg( array(
548
- 'wcs-nux-notice' => 'dismiss',
549
- ) ),
550
- 'image_url' => plugins_url(
551
- 'images/wcs-notice.png', dirname( __FILE__ )
552
- ),
553
- 'should_show_jp' => false,
554
- 'should_show_terms' => false,
555
- ) );
 
 
 
 
 
556
  }
557
 
558
  public function show_tos_banner() {
@@ -578,19 +592,24 @@ if ( ! class_exists( 'WC_Connect_Nux' ) ) {
578
  $description_base = __( "WooCommerce Shipping & Tax is almost ready to go! Once you connect your store you'll have access to %s.", 'woocommerce-services' );
579
  $feature_list = $this->get_feature_list_for_country( $country );
580
 
581
- $this->show_nux_banner( array(
582
- 'title' => __( 'Connect your store to activate WooCommerce Shipping & Tax', 'woocommerce-services' ),
583
- 'description' => esc_html( sprintf( $description_base, $feature_list ) ),
584
- 'button_text' => __( 'Connect', 'woocommerce-services' ),
585
- 'button_link' => add_query_arg( array(
586
- 'wcs-nux-tos' => 'accept',
587
- ) ),
588
- 'image_url' => plugins_url(
589
- 'images/wcs-notice.png', dirname( __FILE__ )
590
- ),
591
- 'should_show_jp' => false,
592
- 'should_show_terms' => true,
593
- ) );
 
 
 
 
 
594
  }
595
 
596
  public function show_nux_banner( $content ) {
@@ -607,7 +626,7 @@ if ( ! class_exists( 'WC_Connect_Nux' ) ) {
607
  src="<?php echo esc_url( plugins_url( 'images/jetpack-logo.png', dirname( __FILE__ ) ) ); ?>"
608
  >
609
  <?php endif; ?>
610
- <img class="wcs-nux__notice-logo-graphic" src="<?php echo esc_url( $content['image_url'] ); ?>">
611
  </div>
612
  <div class="wcs-nux__notice-content">
613
  <h1 class="wcs-nux__notice-content-title">
@@ -617,19 +636,24 @@ if ( ! class_exists( 'WC_Connect_Nux' ) ) {
617
  <?php echo $content['description']; ?>
618
  </p>
619
  <?php if ( isset( $content['should_show_terms'] ) && $content['should_show_terms'] ) : ?>
620
- <p class="wcs-nux__notice-content-tos"><?php
 
621
  /* translators: %1$s example values include "Install Jetpack and CONNECT >", "Activate Jetpack and CONNECT >", "CONNECT >" */
622
  printf(
623
- wp_kses( __( 'By clicking "%1$s", you agree to the <a href="%2$s">Terms of Service</a> and to <a href="%3$s">share certain data and settings</a> with WordPress.com and/or third parties.', 'woocommerce-services' ),
 
624
  array(
625
- 'a' => array(
626
- 'href' => array(),
627
- ),
628
- ) ),
 
629
  esc_html( $content['button_text'] ),
630
  'https://wordpress.com/tos/',
631
  'https://jetpack.com/support/what-data-does-jetpack-sync/'
632
- ); ?></p>
 
 
633
  <?php endif; ?>
634
  <?php if ( isset( $content['button_link'] ) ) : ?>
635
  <a
@@ -651,7 +675,7 @@ if ( ! class_exists( 'WC_Connect_Nux' ) ) {
651
  if ( isset( $content['dismissible_id'] ) ) :
652
  // Add handler for dismissing banner. Only supports a single banner at a time
653
  wp_enqueue_script( 'wp-util' );
654
- ?>
655
  <script>
656
  ( function( $ ) {
657
  $( '.wcs-nux__notice' ).on( 'click', '.notice-dismiss', function() {
@@ -663,7 +687,7 @@ if ( ! class_exists( 'WC_Connect_Nux' ) ) {
663
  } );
664
  } )( jQuery );
665
  </script>
666
- <?php
667
  endif;
668
  }
669
 
@@ -691,7 +715,6 @@ if ( ! class_exists( 'WC_Connect_Nux' ) ) {
691
 
692
  /**
693
  * Get Jetpack connection URL.
694
- *
695
  */
696
  public function ajax_get_jetpack_connect_url() {
697
  check_ajax_referer( 'wcs_nux_notice' );
6
  /**
7
  * Jetpack status constants.
8
  */
9
+ const JETPACK_NOT_INSTALLED = 'uninstalled';
10
  const JETPACK_INSTALLED_NOT_ACTIVATED = 'installed';
11
  const JETPACK_ACTIVATED_NOT_CONNECTED = 'activated';
12
+ const JETPACK_DEV = 'dev';
13
+ const JETPACK_CONNECTED = 'connected';
14
 
15
  const IS_NEW_LABEL_USER = 'wcc_is_new_label_user';
16
 
31
  private $shipping_label;
32
 
33
  function __construct( WC_Connect_Tracks $tracks, WC_Connect_Shipping_Label $shipping_label ) {
34
+ $this->tracks = $tracks;
35
  $this->shipping_label = $shipping_label;
36
 
37
  $this->init_pointers();
54
  }
55
 
56
  public function dismiss_notice( $notice ) {
57
+ $notices = $this->get_notice_states();
58
  $notices[ $notice ] = true;
59
  update_user_meta( get_current_user_id(), 'wc_connect_nux_notices', $notices );
60
  }
75
  }
76
 
77
  public function show_pointers( $hook ) {
78
+ /*
79
+ Get admin pointers for the current admin page.
80
  *
81
  * @since 0.9.6
82
  *
89
  }
90
 
91
  $dismissed_pointers = $this->get_dismissed_pointers();
92
+ $valid_pointers = array();
93
 
94
  foreach ( $pointers as $pointer ) {
95
  if ( ! in_array( $pointer['id'], $dismissed_pointers, true ) ) {
96
+ $valid_pointers[] = $pointer;
97
  }
98
  }
99
 
127
  }
128
 
129
  $dismissed_pointers[] = $pointer_to_dismiss;
130
+ $dismissed_data = implode( ',', $dismissed_pointers );
131
  update_user_meta( get_current_user_id(), 'dismissed_wp_pointers', $dismissed_data );
132
  }
133
 
135
  $is_new_user = get_transient( self::IS_NEW_LABEL_USER );
136
  if ( false === $is_new_user ) {
137
  global $wpdb;
138
+ $query = "SELECT meta_key FROM {$wpdb->postmeta} WHERE meta_key = 'wc_connect_labels' LIMIT 1";
139
+ $results = $wpdb->get_results( $query );
140
  $is_new_user = 0 === count( $results ) ? 'yes' : 'no';
141
  set_transient( self::IS_NEW_LABEL_USER, $is_new_user );
142
  }
162
  }
163
 
164
  $pointers[] = array(
165
+ 'id' => 'wc_services_labels_metabox',
166
+ 'target' => '#woocommerce-order-label .button',
167
  'options' => array(
168
+ 'content' => sprintf(
169
+ '<h3>%s</h3><p>%s</p>',
170
+ __( 'Discounted Shipping Labels', 'woocommerce-services' ),
171
+ sprintf( __( "When you're ready, purchase and print discounted labels from %s right here.", 'woocommerce-services' ), implode( ' or ', $supported_carriers ) )
172
+ ),
173
+ 'position' => array(
174
+ 'edge' => 'top',
175
+ 'align' => 'left',
176
  ),
 
177
  ),
178
+ 'dim' => true,
179
  );
180
 
181
  return $pointers;
195
  }
196
 
197
  $pointers[] = array(
198
+ 'id' => 'wc_services_new_carrier_dhl_express',
199
+ 'target' => '#woocommerce-order-label .button',
200
  'options' => array(
201
+ 'content' => sprintf(
202
+ '<h3>%s</h3><p>%s</p>',
203
+ __( 'Discounted DHL Shipping Labels', 'woocommerce-services' ),
204
+ __( 'WooCommerce Shipping now supports DHL labels for international shipments. Purchase and print discounted labels from DHL and USPS right here.', 'woocommerce-services' )
205
+ ),
206
+ 'position' => array(
207
+ 'edge' => 'top',
208
+ 'align' => 'left',
209
  ),
 
210
  ),
211
+ 'dim' => true,
212
  );
213
 
214
  return $pointers;
237
  return true;
238
  }
239
 
240
+ $can_accept = WC_Connect_Jetpack::is_current_user_connected();
 
 
 
 
241
 
242
  return $can_accept;
243
  }
247
  return false;
248
  }
249
 
250
+ /*
251
+ The NUX Flow:
252
  - Case 1: Jetpack not connected (with TOS or no TOS accepted):
253
  1. show_banner_before_connection()
254
  2. connect to JP
289
 
290
  public function get_jetpack_install_status() {
291
  // we need to use validate_plugin to check that Jetpack is installed
292
+ include_once ABSPATH . 'wp-admin/includes/plugin.php';
293
 
294
  // check if jetpack is installed
295
  if ( 0 !== validate_plugin( 'jetpack/jetpack.php' ) ) {
308
 
309
  // installed, activated, dev mode off
310
  // check if connected
311
+ if ( ! WC_Connect_Jetpack::is_connected() ) {
 
312
  return self::JETPACK_ACTIVATED_NOT_CONNECTED;
313
  }
314
 
377
  $supports_taxes = $this->is_taxjar_supported_country( $country );
378
  $supports_labels = ( 'US' === $country );
379
 
380
+ $is_ppec_active = is_plugin_active( 'woocommerce-gateway-paypal-express-checkout/woocommerce-gateway-paypal-express-checkout.php' );
381
+ $ppec_settings = get_option( 'woocommerce_ppec_paypal_settings', array() );
382
+ $supports_payments = $is_ppec_active && ( ! isset( $ppec_settings['enabled'] ) || 'yes' === $ppec_settings['enabled'] );
383
 
384
  if ( $supports_payments && $supports_taxes && $supports_labels ) {
385
  $feature_list = __( 'automated tax calculation, shipping label printing, and smoother payment setup', 'woocommerce-services' );
386
  } elseif ( $supports_payments && $supports_taxes ) {
387
  $feature_list = __( 'automated tax calculation and smoother payment setup', 'woocommerce-services' );
388
+ } elseif ( $supports_taxes && $supports_labels ) {
389
  $feature_list = __( 'automated tax calculation and shipping label printing', 'woocommerce-services' );
390
+ } elseif ( $supports_payments && $supports_labels ) {
391
  $feature_list = __( 'shipping label printing and smoother payment setup', 'woocommerce-services' );
392
+ } elseif ( $supports_payments ) {
393
  $feature_list = __( 'smoother payment setup', 'woocommerce-services' );
394
+ } elseif ( $supports_taxes ) {
395
  $feature_list = __( 'automated tax calculation', 'woocommerce-services' );
396
+ } elseif ( $supports_labels ) {
397
  $feature_list = __( 'shipping label printing', 'woocommerce-services' );
398
  }
399
 
404
  $full_path = add_query_arg( array() );
405
  // Remove [...]/wp-admin so we can use admin_url().
406
  $new_index = strpos( $full_path, '/wp-admin' ) + strlen( '/wp-admin' );
407
+ $path = substr( $full_path, $new_index );
408
  return admin_url( $path );
409
  }
410
 
422
  return;
423
  }
424
 
425
+ $banner_to_display = self::get_banner_type_to_display(
426
+ array(
427
+ 'jetpack_connection_status' => $jetpack_install_status,
428
+ 'tos_accepted' => WC_Connect_Options::get_option( 'tos_accepted' ),
429
+ 'can_accept_tos' => $this->can_accept_tos(),
430
+ 'should_display_after_cxn_banner' => WC_Connect_Options::get_option( self::SHOULD_SHOW_AFTER_CXN_BANNER ),
431
+ )
432
+ );
433
 
434
  switch ( $banner_to_display ) {
435
  case 'before_jetpack_connection':
446
  );
447
  wp_enqueue_script( 'wc_connect_banner' );
448
  wp_localize_script( 'wc_connect_banner', 'wcs_nux_notice', $ajax_data );
449
+ add_action(
450
+ 'wp_ajax_woocommerce_services_activate_jetpack',
451
  array( $this, 'ajax_activate_jetpack' )
452
  );
453
+ add_action(
454
+ 'wp_ajax_woocommerce_services_get_jetpack_connect_url',
455
  array( $this, 'ajax_get_jetpack_connect_url' )
456
  );
457
  wp_enqueue_style( 'wc_connect_banner' );
499
 
500
  switch ( $jetpack_status ) {
501
  case self::JETPACK_NOT_INSTALLED:
502
+ $button_text = __( 'Install Jetpack and connect', 'woocommerce-services' );
503
  break;
504
  case self::JETPACK_INSTALLED_NOT_ACTIVATED:
505
+ $button_text = __( 'Activate Jetpack and connect', 'woocommerce-services' );
506
  break;
507
  }
508
 
549
  $description_base = __( 'You can now enjoy %s.', 'woocommerce-services' );
550
  $feature_list = $this->get_feature_list_for_country( $country );
551
 
552
+ $this->show_nux_banner(
553
+ array(
554
+ 'title' => __( 'Setup complete.', 'woocommerce-services' ),
555
+ 'description' => esc_html( sprintf( $description_base, $feature_list ) ),
556
+ 'button_text' => __( 'Got it, thanks!', 'woocommerce-services' ),
557
+ 'button_link' => add_query_arg(
558
+ array(
559
+ 'wcs-nux-notice' => 'dismiss',
560
+ )
561
+ ),
562
+ 'image_url' => plugins_url(
563
+ 'images/wcs-notice.png',
564
+ dirname( __FILE__ )
565
+ ),
566
+ 'should_show_jp' => false,
567
+ 'should_show_terms' => false,
568
+ )
569
+ );
570
  }
571
 
572
  public function show_tos_banner() {
592
  $description_base = __( "WooCommerce Shipping & Tax is almost ready to go! Once you connect your store you'll have access to %s.", 'woocommerce-services' );
593
  $feature_list = $this->get_feature_list_for_country( $country );
594
 
595
+ $this->show_nux_banner(
596
+ array(
597
+ 'title' => __( 'Connect your store to activate WooCommerce Shipping & Tax', 'woocommerce-services' ),
598
+ 'description' => esc_html( sprintf( $description_base, $feature_list ) ),
599
+ 'button_text' => __( 'Connect', 'woocommerce-services' ),
600
+ 'button_link' => add_query_arg(
601
+ array(
602
+ 'wcs-nux-tos' => 'accept',
603
+ )
604
+ ),
605
+ 'image_url' => plugins_url(
606
+ 'images/wcs-notice.png',
607
+ dirname( __FILE__ )
608
+ ),
609
+ 'should_show_jp' => false,
610
+ 'should_show_terms' => true,
611
+ )
612
+ );
613
  }
614
 
615
  public function show_nux_banner( $content ) {
626
  src="<?php echo esc_url( plugins_url( 'images/jetpack-logo.png', dirname( __FILE__ ) ) ); ?>"
627
  >
628
  <?php endif; ?>
629
+ <img class="wcs-nux__notice-logo-graphic" src="<?php echo esc_url( $content['image_url'] ); ?>">
630
  </div>
631
  <div class="wcs-nux__notice-content">
632
  <h1 class="wcs-nux__notice-content-title">
636
  <?php echo $content['description']; ?>
637
  </p>
638
  <?php if ( isset( $content['should_show_terms'] ) && $content['should_show_terms'] ) : ?>
639
+ <p class="wcs-nux__notice-content-tos">
640
+ <?php
641
  /* translators: %1$s example values include "Install Jetpack and CONNECT >", "Activate Jetpack and CONNECT >", "CONNECT >" */
642
  printf(
643
+ wp_kses(
644
+ __( 'By clicking "%1$s", you agree to the <a href="%2$s">Terms of Service</a> and to <a href="%3$s">share certain data and settings</a> with WordPress.com and/or third parties.', 'woocommerce-services' ),
645
  array(
646
+ 'a' => array(
647
+ 'href' => array(),
648
+ ),
649
+ )
650
+ ),
651
  esc_html( $content['button_text'] ),
652
  'https://wordpress.com/tos/',
653
  'https://jetpack.com/support/what-data-does-jetpack-sync/'
654
+ );
655
+ ?>
656
+ </p>
657
  <?php endif; ?>
658
  <?php if ( isset( $content['button_link'] ) ) : ?>
659
  <a
675
  if ( isset( $content['dismissible_id'] ) ) :
676
  // Add handler for dismissing banner. Only supports a single banner at a time
677
  wp_enqueue_script( 'wp-util' );
678
+ ?>
679
  <script>
680
  ( function( $ ) {
681
  $( '.wcs-nux__notice' ).on( 'click', '.notice-dismiss', function() {
687
  } );
688
  } )( jQuery );
689
  </script>
690
+ <?php
691
  endif;
692
  }
693
 
715
 
716
  /**
717
  * Get Jetpack connection URL.
 
718
  */
719
  public function ajax_get_jetpack_connect_url() {
720
  check_ajax_referer( 'wcs_nux_notice' );
classes/class-wc-connect-options.php CHANGED
@@ -4,6 +4,7 @@ if ( ! class_exists( 'WC_Connect_Options' ) ) {
4
  class WC_Connect_Options {
5
  /**
6
  * An array that maps a grouped option type to an option name.
 
7
  * @var array
8
  */
9
  private static $grouped_options = array(
@@ -60,8 +61,8 @@ if ( ! class_exists( 'WC_Connect_Options' ) ) {
60
  return;
61
  }
62
 
63
- foreach( self::$grouped_options as $group_key => $group ) {
64
- //delete legacy options
65
  foreach ( self::get_option_names( $group_key ) as $group_option ) {
66
  delete_option( "wc_connect_$group_option" );
67
  }
@@ -81,7 +82,7 @@ if ( ! class_exists( 'WC_Connect_Options' ) ) {
81
  * Returns the requested option. Looks in wc_connect_options or wc_connect_$name as appropriate.
82
  *
83
  * @param string $name Option name
84
- * @param mixed $default (optional)
85
  *
86
  * @return mixed
87
  */
@@ -104,11 +105,11 @@ if ( ! class_exists( 'WC_Connect_Options' ) ) {
104
  * Updates the single given option. Updates wc_connect_options or wc_connect_$name as appropriate.
105
  *
106
  * @param string $name Option name
107
- * @param mixed $value Option value
108
  *
109
  * @return bool Was the option successfully updated?
110
  */
111
- public static function update_option( $name, $value) {
112
  if ( self::is_valid( $name, 'non_compact' ) ) {
113
  return update_option( "wc_connect_$name", $value );
114
  }
@@ -231,8 +232,8 @@ if ( ! class_exists( 'WC_Connect_Options' ) ) {
231
  return $options[ $name ];
232
  }
233
 
234
- //make the grouped options backwards-compatible and migrate the old options
235
- $legacy_name = "wc_connect_$name";
236
  $legacy_option = get_option( $legacy_name, false );
237
  if ( ! $legacy_option ) {
238
  return $default;
@@ -254,7 +255,7 @@ if ( ! class_exists( 'WC_Connect_Options' ) ) {
254
  }
255
 
256
  private static function delete_grouped_option( $group, $names ) {
257
- $options = get_option( self::$grouped_options[ $group ], array() );
258
  $to_delete = array_intersect( $names, self::get_option_names( $group ), array_keys( $options ) );
259
  if ( $to_delete ) {
260
  foreach ( $to_delete as $name ) {
@@ -289,8 +290,8 @@ if ( ! class_exists( 'WC_Connect_Options' ) ) {
289
  /**
290
  * Is the option name valid?
291
  *
292
- * @param string $name The name of the option
293
- * @param string $group The name of the group that the option is in. Defaults to compact.
294
  *
295
  * @return bool Is the option name valid?
296
  */
4
  class WC_Connect_Options {
5
  /**
6
  * An array that maps a grouped option type to an option name.
7
+ *
8
  * @var array
9
  */
10
  private static $grouped_options = array(
61
  return;
62
  }
63
 
64
+ foreach ( self::$grouped_options as $group_key => $group ) {
65
+ // delete legacy options
66
  foreach ( self::get_option_names( $group_key ) as $group_option ) {
67
  delete_option( "wc_connect_$group_option" );
68
  }
82
  * Returns the requested option. Looks in wc_connect_options or wc_connect_$name as appropriate.
83
  *
84
  * @param string $name Option name
85
+ * @param mixed $default (optional)
86
  *
87
  * @return mixed
88
  */
105
  * Updates the single given option. Updates wc_connect_options or wc_connect_$name as appropriate.
106
  *
107
  * @param string $name Option name
108
+ * @param mixed $value Option value
109
  *
110
  * @return bool Was the option successfully updated?
111
  */
112
+ public static function update_option( $name, $value ) {
113
  if ( self::is_valid( $name, 'non_compact' ) ) {
114
  return update_option( "wc_connect_$name", $value );
115
  }
232
  return $options[ $name ];
233
  }
234
 
235
+ // make the grouped options backwards-compatible and migrate the old options
236
+ $legacy_name = "wc_connect_$name";
237
  $legacy_option = get_option( $legacy_name, false );
238
  if ( ! $legacy_option ) {
239
  return $default;
255
  }
256
 
257
  private static function delete_grouped_option( $group, $names ) {
258
+ $options = get_option( self::$grouped_options[ $group ], array() );
259
  $to_delete = array_intersect( $names, self::get_option_names( $group ), array_keys( $options ) );
260
  if ( $to_delete ) {
261
  foreach ( $to_delete as $name ) {
290
  /**
291
  * Is the option name valid?
292
  *
293
+ * @param string $name The name of the option
294
+ * @param string $group The name of the group that the option is in. Defaults to compact.
295
  *
296
  * @return bool Is the option name valid?
297
  */
classes/class-wc-connect-order-presenter.php CHANGED
@@ -13,7 +13,7 @@ if ( ! class_exists( 'WC_Connect_Order_Presenter' ) ) {
13
  */
14
  public function get_order_for_api( WC_Order $order ) {
15
  $decimal_point = 2;
16
- $order_data = array(
17
  'id' => $order->get_id(),
18
  'order_number' => $order->get_order_number(),
19
  'order_key' => $order->get_order_key(),
@@ -31,12 +31,12 @@ if ( ! class_exists( 'WC_Connect_Order_Presenter' ) ) {
31
  'shipping_tax' => wc_format_decimal( $order->get_shipping_tax(), $decimal_point ),
32
  'total_discount' => wc_format_decimal( $order->get_total_discount(), $decimal_point ),
33
  'shipping_methods' => $order->get_shipping_method(),
34
- 'payment_details' => array(
35
  'method_id' => $order->get_payment_method(),
36
  'method_title' => $order->get_payment_method_title(),
37
  'paid' => ! is_null( $order->get_date_paid() ),
38
  ),
39
- 'billing_address' => array(
40
  'first_name' => $order->get_billing_first_name(),
41
  'last_name' => $order->get_billing_last_name(),
42
  'company' => $order->get_billing_company(),
@@ -49,7 +49,7 @@ if ( ! class_exists( 'WC_Connect_Order_Presenter' ) ) {
49
  'email' => $order->get_billing_email(),
50
  'phone' => $order->get_billing_phone(),
51
  ),
52
- 'shipping_address' => array(
53
  'first_name' => $order->get_shipping_first_name(),
54
  'last_name' => $order->get_shipping_last_name(),
55
  'company' => $order->get_shipping_company(),
@@ -74,8 +74,8 @@ if ( ! class_exists( 'WC_Connect_Order_Presenter' ) ) {
74
 
75
  // Add line items.
76
  foreach ( $order->get_items() as $item_id => $item ) {
77
- $product = $item->get_product();
78
- $item_meta = $item->get_formatted_meta_data();
79
 
80
  foreach ( $item_meta as $key => $values ) {
81
  $item_meta[ $key ]->label = $values->display_key;
13
  */
14
  public function get_order_for_api( WC_Order $order ) {
15
  $decimal_point = 2;
16
+ $order_data = array(
17
  'id' => $order->get_id(),
18
  'order_number' => $order->get_order_number(),
19
  'order_key' => $order->get_order_key(),
31
  'shipping_tax' => wc_format_decimal( $order->get_shipping_tax(), $decimal_point ),
32
  'total_discount' => wc_format_decimal( $order->get_total_discount(), $decimal_point ),
33
  'shipping_methods' => $order->get_shipping_method(),
34
+ 'payment_details' => array(
35
  'method_id' => $order->get_payment_method(),
36
  'method_title' => $order->get_payment_method_title(),
37
  'paid' => ! is_null( $order->get_date_paid() ),
38
  ),
39
+ 'billing_address' => array(
40
  'first_name' => $order->get_billing_first_name(),
41
  'last_name' => $order->get_billing_last_name(),
42
  'company' => $order->get_billing_company(),
49
  'email' => $order->get_billing_email(),
50
  'phone' => $order->get_billing_phone(),
51
  ),
52
+ 'shipping_address' => array(
53
  'first_name' => $order->get_shipping_first_name(),
54
  'last_name' => $order->get_shipping_last_name(),
55
  'company' => $order->get_shipping_company(),
74
 
75
  // Add line items.
76
  foreach ( $order->get_items() as $item_id => $item ) {
77
+ $product = $item->get_product();
78
+ $item_meta = $item->get_formatted_meta_data();
79
 
80
  foreach ( $item_meta as $key => $values ) {
81
  $item_meta[ $key ]->label = $values->display_key;
classes/class-wc-connect-package-settings.php CHANGED
@@ -19,20 +19,20 @@ class WC_Connect_Package_Settings {
19
  WC_Connect_Service_Settings_Store $settings_store,
20
  WC_Connect_Service_Schemas_Store $service_schemas_store
21
  ) {
22
- $this->settings_store = $settings_store;
23
  $this->service_schemas_store = $service_schemas_store;
24
  }
25
  public function get() {
26
  return array(
27
  'storeOptions' => $this->settings_store->get_store_options(),
28
  'formSchema' => array(
29
- 'custom' => $this->service_schemas_store->get_packages_schema(),
30
- 'predefined' => $this->service_schemas_store->get_predefined_packages_schema()
31
  ),
32
  'formData' => array(
33
- 'custom' => $this->settings_store->get_packages(),
34
- 'predefined' => $this->settings_store->get_predefined_packages()
35
- )
36
  );
37
  }
38
  }
19
  WC_Connect_Service_Settings_Store $settings_store,
20
  WC_Connect_Service_Schemas_Store $service_schemas_store
21
  ) {
22
+ $this->settings_store = $settings_store;
23
  $this->service_schemas_store = $service_schemas_store;
24
  }
25
  public function get() {
26
  return array(
27
  'storeOptions' => $this->settings_store->get_store_options(),
28
  'formSchema' => array(
29
+ 'custom' => $this->service_schemas_store->get_packages_schema(),
30
+ 'predefined' => $this->service_schemas_store->get_predefined_packages_schema(),
31
  ),
32
  'formData' => array(
33
+ 'custom' => $this->settings_store->get_packages(),
34
+ 'predefined' => $this->settings_store->get_predefined_packages(),
35
+ ),
36
  );
37
  }
38
  }
classes/class-wc-connect-payment-methods-store.php CHANGED
@@ -48,7 +48,7 @@ if ( ! class_exists( 'WC_Connect_Payment_Methods_Store' ) ) {
48
  return false;
49
  }
50
 
51
- // If we made it this far, it is safe to store the object
52
  $this->update_payment_methods( $payment_methods );
53
 
54
  $this->potentially_update_selected_payment_method_from_payment_methods( $payment_methods );
@@ -66,19 +66,19 @@ if ( ! class_exists( 'WC_Connect_Payment_Methods_Store' ) ) {
66
  }
67
  }
68
 
69
- // No payment methods at all? Clear anything we have stored
70
  if ( 0 === count( $payment_method_ids ) ) {
71
  $this->service_settings_store->set_selected_payment_method_id( 0 );
72
  return;
73
  }
74
 
75
- // Has the stored method ID been removed, or is there only one available? Select the first available one
76
  $selected_payment_method_id = $this->service_settings_store->get_selected_payment_method_id();
77
  if (
78
  ( $selected_payment_method_id || 1 === count( $payment_method_ids ) ) &&
79
  ! in_array( $selected_payment_method_id, $payment_method_ids )
80
  ) {
81
- $this->service_settings_store->set_selected_payment_method_id( $payment_method_ids[ 0 ] );
82
  }
83
  }
84
 
48
  return false;
49
  }
50
 
51
+ // If we made it this far, it is safe to store the object.
52
  $this->update_payment_methods( $payment_methods );
53
 
54
  $this->potentially_update_selected_payment_method_from_payment_methods( $payment_methods );
66
  }
67
  }
68
 
69
+ // No payment methods at all? Clear anything we have stored.
70
  if ( 0 === count( $payment_method_ids ) ) {
71
  $this->service_settings_store->set_selected_payment_method_id( 0 );
72
  return;
73
  }
74
 
75
+ // Has the stored method ID been removed, or is there only one available? Select the first available one.
76
  $selected_payment_method_id = $this->service_settings_store->get_selected_payment_method_id();
77
  if (
78
  ( $selected_payment_method_id || 1 === count( $payment_method_ids ) ) &&
79
  ! in_array( $selected_payment_method_id, $payment_method_ids )
80
  ) {
81
+ $this->service_settings_store->set_selected_payment_method_id( $payment_method_ids[0] );
82
  }
83
  }
84
 
classes/class-wc-connect-paypal-ec.php CHANGED
@@ -30,7 +30,7 @@ if ( ! class_exists( 'WC_Connect_PayPal_EC' ) ) {
30
 
31
  public function __construct( WC_Connect_API_Client $api_client, WC_Connect_Nux $nux ) {
32
  $this->api_client = $api_client;
33
- $this->nux = $nux;
34
  }
35
 
36
  public function init() {
@@ -60,8 +60,8 @@ if ( ! class_exists( 'WC_Connect_PayPal_EC' ) ) {
60
  empty( $settings->sandbox_api_username ) &&
61
  empty( $settings->api_username )
62
  ) {
63
- $email = isset( $settings->email ) ? $settings->email : $settings->api_subject;
64
- $settings->api_subject = $email;
65
  $settings->sandbox_api_subject = $email;
66
  $settings->save();
67
  }
@@ -126,25 +126,29 @@ if ( ! class_exists( 'WC_Connect_PayPal_EC' ) ) {
126
  */
127
  public function register_refund_pointer( $pointers ) {
128
  $pointers[] = array(
129
- 'id' => 'wc_services_refund_via_ppec',
130
- 'target' => '.refund-actions > button:first-child',
131
- 'options' => array(
132
- 'content' => sprintf( '<h3>%s</h3><p>%s</p>',
133
- __( 'Link a PayPal account' ,'woocommerce-services' ),
 
134
  sprintf(
135
  wp_kses(
136
  __( 'To issue refunds via PayPal Checkout, you will need to <a href="%s">link a PayPal account</a> with the email address that received this payment.', 'woocommerce-services' ),
137
- array( 'a' => array( 'href' => array() ) )
138
  ),
139
  wc_gateway_ppec()->ips->get_signup_url( wc_gateway_ppec()->settings->environment )
140
  )
141
  ),
142
- 'position' => array( 'edge' => 'bottom', 'align' => 'top' ),
 
 
 
143
  ),
144
  'delayed_opening' => array(
145
- 'show_button' => '.refund-items',
146
- 'hide_button' => '.cancel-action',
147
- 'animating_container' => '.wc-order-refund-items',
148
  'delegation_container' => '#woocommerce-order-items',
149
  ),
150
  );
@@ -202,15 +206,17 @@ if ( ! class_exists( 'WC_Connect_PayPal_EC' ) ) {
202
  * Show a NUX banner prompting the merchant to link a PayPal account
203
  */
204
  public function banner() {
205
- $this->nux->show_nux_banner( array(
206
- 'title' => __( 'Link your PayPal account', 'woocommerce-services' ),
207
- 'description' => esc_html( __( 'Link a new or existing PayPal account to make sure future orders are marked “Processing” instead of “On hold”, and so refunds can be issued without leaving WooCommerce.', 'woocommerce-services' ) ),
208
- 'button_text' => __( 'Link account', 'woocommerce-services' ),
209
- 'button_link' => wc_gateway_ppec()->ips->get_signup_url( 'live' ),
210
- 'image_url' => plugins_url( 'images/cashier.svg', dirname( __FILE__ ) ),
211
- 'should_show_jp' => false,
212
- 'dismissible_id' => 'ppec',
213
- ) );
 
 
214
  }
215
 
216
  /**
@@ -225,7 +231,7 @@ if ( ! class_exists( 'WC_Connect_PayPal_EC' ) ) {
225
  return;
226
  } elseif ( ! isset( $settings['button_size'] ) ) { // Check if settings are initialized, represented by button_size as its absence would be first to affect the customer
227
  $payment_gateways = WC()->payment_gateways->payment_gateways();
228
- $gateway = $payment_gateways['ppec_paypal'];
229
 
230
  foreach ( $gateway->form_fields as $key => $form_field ) {
231
  if ( ! isset( $settings[ $key ] ) && isset( $form_field['default'] ) ) {
@@ -257,35 +263,40 @@ if ( ! class_exists( 'WC_Connect_PayPal_EC' ) ) {
257
  $form_fields = $this->adjust_api_subject_form_field( $form_fields );
258
 
259
  // Prevent user from changing Payment Action away from "Sale", the only option for which payments will work
260
- $form_fields['paymentaction']['disabled'] = true;
261
  $form_fields['paymentaction']['description'] = sprintf( __( '%s (Note that "authorizing payment only" requires linking a PayPal account.)', 'woocommerce-services' ), $form_fields['paymentaction']['description'] );
262
 
263
  // Communicate WCS proxying and provide option to disable
264
- $reset_link = add_query_arg(
265
- array( 'reroute_requests' => 'no', 'nonce' => wp_create_nonce( 'reroute_requests' ) ),
 
 
 
266
  wc_gateway_ppec()->get_admin_setting_link()
267
  );
268
  $api_creds_template = __( 'Payments will be authenticated by WooCommerce Shipping & Tax and directed to the following email address. To disable this feature and link a PayPal account, <a href="%s">click here</a>.', 'woocommerce-services' );
269
  if ( empty( $settings->api_username ) ) {
270
- $api_creds_text = sprintf( $api_creds_template, add_query_arg( 'environment', 'live', $reset_link ) );
271
  $form_fields['api_credentials']['description'] = $api_creds_text;
272
  unset( $form_fields['api_username'], $form_fields['api_password'], $form_fields['api_signature'], $form_fields['api_certificate'] );
273
  }
274
  if ( empty( $settings->sandbox_api_username ) ) {
275
- $api_creds_text = sprintf( $api_creds_template, add_query_arg( 'environment', 'sandbox', $reset_link ) );
276
  $form_fields['sandbox_api_credentials']['description'] = $api_creds_text;
277
  unset( $form_fields['sandbox_api_username'], $form_fields['sandbox_api_password'], $form_fields['sandbox_api_signature'], $form_fields['sandbox_api_certificate'] );
278
  }
279
-
280
  } else {
281
  // Provide option to enable request proxying
282
- $reset_link = add_query_arg(
283
- array( 'reroute_requests' => 'yes', 'nonce' => wp_create_nonce( 'reroute_requests' ) ),
 
 
 
284
  wc_gateway_ppec()->get_admin_setting_link()
285
  );
286
  $api_creds_template = __( 'To authenticate payments with WooCommerce Shipping & Tax, <a href="%s">click here</a>.', 'woocommerce-services' );
287
  if ( empty( $settings->api_username ) ) {
288
- $api_creds_text = sprintf( $api_creds_template, add_query_arg( 'environment', 'live', $reset_link ) );
289
  $form_fields['api_credentials']['description'] .= '<br /><br />' . $api_creds_text;
290
  }
291
  if ( empty( $settings->sandbox_api_username ) ) {
@@ -301,16 +312,16 @@ if ( ! class_exists( 'WC_Connect_PayPal_EC' ) ) {
301
  * Present the "API Subject" setting in a way that's simpler, more comprehensible, and more appropriate to the way it's being used
302
  */
303
  public function adjust_api_subject_form_field( $form_fields ) {
304
- $api_subject_title = __( 'Payment Email', 'woocommerce-services' );
305
- $form_fields['api_subject']['title'] = $api_subject_title;
306
  $form_fields['sandbox_api_subject']['title'] = $api_subject_title;
307
 
308
- $api_subject_description = __( 'Enter your email address at which to accept payments. You\'ll need to link your own account in order to perform anything other than "sale" transactions.', 'woocommerce-services' );
309
- $form_fields['api_subject']['description'] = $api_subject_description;
310
  $form_fields['sandbox_api_subject']['description'] = $api_subject_description;
311
 
312
- $api_subject_placeholder = __( 'Required', 'woocommerce-services' );
313
- $form_fields['api_subject']['placeholder'] = $api_subject_placeholder;
314
  $form_fields['sandbox_api_subject']['placeholder'] = $api_subject_placeholder;
315
 
316
  return $form_fields;
@@ -328,7 +339,7 @@ if ( ! class_exists( 'WC_Connect_PayPal_EC' ) ) {
328
  return;
329
  }
330
 
331
- $settings = wc_gateway_ppec()->settings;
332
  $settings->reroute_requests = 'yes' === $_GET['reroute_requests'] ? 'yes' : 'no';
333
  if ( isset( $_GET['environment'] ) ) {
334
  $settings->environment = 'sandbox' === $_GET['environment'] ? 'sandbox' : 'live';
30
 
31
  public function __construct( WC_Connect_API_Client $api_client, WC_Connect_Nux $nux ) {
32
  $this->api_client = $api_client;
33
+ $this->nux = $nux;
34
  }
35
 
36
  public function init() {
60
  empty( $settings->sandbox_api_username ) &&
61
  empty( $settings->api_username )
62
  ) {
63
+ $email = isset( $settings->email ) ? $settings->email : $settings->api_subject;
64
+ $settings->api_subject = $email;
65
  $settings->sandbox_api_subject = $email;
66
  $settings->save();
67
  }
126
  */
127
  public function register_refund_pointer( $pointers ) {
128
  $pointers[] = array(
129
+ 'id' => 'wc_services_refund_via_ppec',
130
+ 'target' => '.refund-actions > button:first-child',
131
+ 'options' => array(
132
+ 'content' => sprintf(
133
+ '<h3>%s</h3><p>%s</p>',
134
+ __( 'Link a PayPal account', 'woocommerce-services' ),
135
  sprintf(
136
  wp_kses(
137
  __( 'To issue refunds via PayPal Checkout, you will need to <a href="%s">link a PayPal account</a> with the email address that received this payment.', 'woocommerce-services' ),
138
+ array( 'a' => array( 'href' => array() ) )
139
  ),
140
  wc_gateway_ppec()->ips->get_signup_url( wc_gateway_ppec()->settings->environment )
141
  )
142
  ),
143
+ 'position' => array(
144
+ 'edge' => 'bottom',
145
+ 'align' => 'top',
146
+ ),
147
  ),
148
  'delayed_opening' => array(
149
+ 'show_button' => '.refund-items',
150
+ 'hide_button' => '.cancel-action',
151
+ 'animating_container' => '.wc-order-refund-items',
152
  'delegation_container' => '#woocommerce-order-items',
153
  ),
154
  );
206
  * Show a NUX banner prompting the merchant to link a PayPal account
207
  */
208
  public function banner() {
209
+ $this->nux->show_nux_banner(
210
+ array(
211
+ 'title' => __( 'Link your PayPal account', 'woocommerce-services' ),
212
+ 'description' => esc_html( __( 'Link a new or existing PayPal account to make sure future orders are marked “Processing” instead of “On hold”, and so refunds can be issued without leaving WooCommerce.', 'woocommerce-services' ) ),
213
+ 'button_text' => __( 'Link account', 'woocommerce-services' ),
214
+ 'button_link' => wc_gateway_ppec()->ips->get_signup_url( 'live' ),
215
+ 'image_url' => plugins_url( 'images/cashier.svg', dirname( __FILE__ ) ),
216
+ 'should_show_jp' => false,
217
+ 'dismissible_id' => 'ppec',
218
+ )
219
+ );
220
  }
221
 
222
  /**
231
  return;
232
  } elseif ( ! isset( $settings['button_size'] ) ) { // Check if settings are initialized, represented by button_size as its absence would be first to affect the customer
233
  $payment_gateways = WC()->payment_gateways->payment_gateways();
234
+ $gateway = $payment_gateways['ppec_paypal'];
235
 
236
  foreach ( $gateway->form_fields as $key => $form_field ) {
237
  if ( ! isset( $settings[ $key ] ) && isset( $form_field['default'] ) ) {
263
  $form_fields = $this->adjust_api_subject_form_field( $form_fields );
264
 
265
  // Prevent user from changing Payment Action away from "Sale", the only option for which payments will work
266
+ $form_fields['paymentaction']['disabled'] = true;
267
  $form_fields['paymentaction']['description'] = sprintf( __( '%s (Note that "authorizing payment only" requires linking a PayPal account.)', 'woocommerce-services' ), $form_fields['paymentaction']['description'] );
268
 
269
  // Communicate WCS proxying and provide option to disable
270
+ $reset_link = add_query_arg(
271
+ array(
272
+ 'reroute_requests' => 'no',
273
+ 'nonce' => wp_create_nonce( 'reroute_requests' ),
274
+ ),
275
  wc_gateway_ppec()->get_admin_setting_link()
276
  );
277
  $api_creds_template = __( 'Payments will be authenticated by WooCommerce Shipping & Tax and directed to the following email address. To disable this feature and link a PayPal account, <a href="%s">click here</a>.', 'woocommerce-services' );
278
  if ( empty( $settings->api_username ) ) {
279
+ $api_creds_text = sprintf( $api_creds_template, add_query_arg( 'environment', 'live', $reset_link ) );
280
  $form_fields['api_credentials']['description'] = $api_creds_text;
281
  unset( $form_fields['api_username'], $form_fields['api_password'], $form_fields['api_signature'], $form_fields['api_certificate'] );
282
  }
283
  if ( empty( $settings->sandbox_api_username ) ) {
284
+ $api_creds_text = sprintf( $api_creds_template, add_query_arg( 'environment', 'sandbox', $reset_link ) );
285
  $form_fields['sandbox_api_credentials']['description'] = $api_creds_text;
286
  unset( $form_fields['sandbox_api_username'], $form_fields['sandbox_api_password'], $form_fields['sandbox_api_signature'], $form_fields['sandbox_api_certificate'] );
287
  }
 
288
  } else {
289
  // Provide option to enable request proxying
290
+ $reset_link = add_query_arg(
291
+ array(
292
+ 'reroute_requests' => 'yes',
293
+ 'nonce' => wp_create_nonce( 'reroute_requests' ),
294
+ ),
295
  wc_gateway_ppec()->get_admin_setting_link()
296
  );
297
  $api_creds_template = __( 'To authenticate payments with WooCommerce Shipping & Tax, <a href="%s">click here</a>.', 'woocommerce-services' );
298
  if ( empty( $settings->api_username ) ) {
299
+ $api_creds_text = sprintf( $api_creds_template, add_query_arg( 'environment', 'live', $reset_link ) );
300
  $form_fields['api_credentials']['description'] .= '<br /><br />' . $api_creds_text;
301
  }
302
  if ( empty( $settings->sandbox_api_username ) ) {
312
  * Present the "API Subject" setting in a way that's simpler, more comprehensible, and more appropriate to the way it's being used
313
  */
314
  public function adjust_api_subject_form_field( $form_fields ) {
315
+ $api_subject_title = __( 'Payment Email', 'woocommerce-services' );
316
+ $form_fields['api_subject']['title'] = $api_subject_title;
317
  $form_fields['sandbox_api_subject']['title'] = $api_subject_title;
318
 
319
+ $api_subject_description = __( 'Enter your email address at which to accept payments. You\'ll need to link your own account in order to perform anything other than "sale" transactions.', 'woocommerce-services' );
320
+ $form_fields['api_subject']['description'] = $api_subject_description;
321
  $form_fields['sandbox_api_subject']['description'] = $api_subject_description;
322
 
323
+ $api_subject_placeholder = __( 'Required', 'woocommerce-services' );
324
+ $form_fields['api_subject']['placeholder'] = $api_subject_placeholder;
325
  $form_fields['sandbox_api_subject']['placeholder'] = $api_subject_placeholder;
326
 
327
  return $form_fields;
339
  return;
340
  }
341
 
342
+ $settings = wc_gateway_ppec()->settings;
343
  $settings->reroute_requests = 'yes' === $_GET['reroute_requests'] ? 'yes' : 'no';
344
  if ( isset( $_GET['environment'] ) ) {
345
  $settings->environment = 'sandbox' === $_GET['environment'] ? 'sandbox' : 'live';
classes/class-wc-connect-privacy.php CHANGED
@@ -17,7 +17,7 @@ class WC_Connect_Privacy {
17
 
18
  public function __construct( WC_Connect_Service_Settings_Store $settings_store, WC_Connect_API_Client $api_client ) {
19
  $this->settings_store = $settings_store;
20
- $this->api_client = $api_client;
21
 
22
  add_action( 'admin_init', array( $this, 'add_privacy_message' ) );
23
  add_action( 'admin_notices', array( $this, 'add_erasure_notice' ) );
@@ -33,12 +33,17 @@ class WC_Connect_Privacy {
33
  return;
34
  }
35
 
36
- $title = __( 'WooCommerce Shipping & Tax', 'woocommerce-services' );
37
  $content = wpautop(
38
  sprintf(
39
  wp_kses(
40
  __( 'By using this extension, you may be storing personal data or sharing data with external services. <a href="%s" target="_blank">Learn more about how this works, including what you may want to include in your privacy policy.</a>', 'woocommerce-services' ),
41
- array( 'a' => array( 'href' => array(), 'target' => array() ) )
 
 
 
 
 
42
  ),
43
  'https://jetpack.com/support/for-your-privacy-policy/#woocommerce-services'
44
  )
@@ -70,13 +75,14 @@ class WC_Connect_Privacy {
70
 
71
  /**
72
  * Filter for woocommerce_privacy_export_order_personal_data that adds WCS personal data to the exported orders
 
73
  * @param array $personal_data
74
  * @param object $order
75
  * @return array
76
  */
77
  public function label_data_exporter( $personal_data, $order ) {
78
  $order_id = $order->get_id();
79
- $labels = $this->settings_store->get_label_order_meta_data( $order_id );
80
 
81
  foreach ( $labels as $label ) {
82
  if ( empty( $label['tracking'] ) ) {
@@ -97,18 +103,19 @@ class WC_Connect_Privacy {
97
 
98
  /**
99
  * Hooks into woocommerce_privacy_before_remove_order_personal_data to remove WCS personal data from orders
 
100
  * @param object $order
101
  */
102
  public function label_data_eraser( $order ) {
103
  $order_id = $order->get_id();
104
- $labels = $this->settings_store->get_label_order_meta_data( $order_id );
105
  if ( empty( $labels ) ) {
106
  return;
107
  }
108
 
109
  foreach ( $labels as $label_idx => $label ) {
110
  $labels[ $label_idx ]['tracking'] = '';
111
- $labels[ $label_idx ]['status'] = 'ANONYMIZED';
112
  }
113
 
114
  $this->api_client->anonymize_order( $order_id );
17
 
18
  public function __construct( WC_Connect_Service_Settings_Store $settings_store, WC_Connect_API_Client $api_client ) {
19
  $this->settings_store = $settings_store;
20
+ $this->api_client = $api_client;
21
 
22
  add_action( 'admin_init', array( $this, 'add_privacy_message' ) );
23
  add_action( 'admin_notices', array( $this, 'add_erasure_notice' ) );
33
  return;
34
  }
35
 
36
+ $title = __( 'WooCommerce Shipping & Tax', 'woocommerce-services' );
37
  $content = wpautop(
38
  sprintf(
39
  wp_kses(
40
  __( 'By using this extension, you may be storing personal data or sharing data with external services. <a href="%s" target="_blank">Learn more about how this works, including what you may want to include in your privacy policy.</a>', 'woocommerce-services' ),
41
+ array(
42
+ 'a' => array(
43
+ 'href' => array(),
44
+ 'target' => array(),
45
+ ),
46
+ )
47
  ),
48
  'https://jetpack.com/support/for-your-privacy-policy/#woocommerce-services'
49
  )
75
 
76
  /**
77
  * Filter for woocommerce_privacy_export_order_personal_data that adds WCS personal data to the exported orders
78
+ *
79
  * @param array $personal_data
80
  * @param object $order
81
  * @return array
82
  */
83
  public function label_data_exporter( $personal_data, $order ) {
84
  $order_id = $order->get_id();
85
+ $labels = $this->settings_store->get_label_order_meta_data( $order_id );
86
 
87
  foreach ( $labels as $label ) {
88
  if ( empty( $label['tracking'] ) ) {
103
 
104
  /**
105
  * Hooks into woocommerce_privacy_before_remove_order_personal_data to remove WCS personal data from orders
106
+ *
107
  * @param object $order
108
  */
109
  public function label_data_eraser( $order ) {
110
  $order_id = $order->get_id();
111
+ $labels = $this->settings_store->get_label_order_meta_data( $order_id );
112
  if ( empty( $labels ) ) {
113
  return;
114
  }
115
 
116
  foreach ( $labels as $label_idx => $label ) {
117
  $labels[ $label_idx ]['tracking'] = '';
118
+ $labels[ $label_idx ]['status'] = 'ANONYMIZED';
119
  }
120
 
121
  $this->api_client->anonymize_order( $order_id );
classes/class-wc-connect-service-schemas-store.php CHANGED
@@ -36,7 +36,7 @@ if ( ! class_exists( 'WC_Connect_Service_Schemas_Store' ) ) {
36
 
37
  $old_schemas = $this->get_service_schemas();
38
  if ( $old_schemas == $response_body ) {
39
- //schemas weren't changed, but were fetched without problems
40
  return true;
41
  }
42
 
@@ -62,7 +62,7 @@ if ( ! class_exists( 'WC_Connect_Service_Schemas_Store' ) ) {
62
 
63
  protected function maybe_update_heartbeat() {
64
  $last_heartbeat = WC_Connect_Options::get_option( 'last_heartbeat' );
65
- $now = time();
66
 
67
  if ( ! $last_heartbeat ) {
68
  $should_update = true;
@@ -72,7 +72,7 @@ if ( ! class_exists( 'WC_Connect_Service_Schemas_Store' ) ) {
72
  // last heartbeat in the future? wacky
73
  $should_update = true;
74
  } else {
75
- $elapsed = $now - $last_heartbeat;
76
  $should_update = $elapsed > DAY_IN_SECONDS;
77
  }
78
  }
@@ -115,7 +115,7 @@ if ( ! class_exists( 'WC_Connect_Service_Schemas_Store' ) ) {
115
  */
116
  public function get_all_shipping_method_ids() {
117
  $shipping_method_ids = array();
118
- $service_schemas = $this->get_service_schemas();
119
  if ( ! is_object( $service_schemas ) || ! property_exists( $service_schemas, 'shipping' ) || ! is_array( $service_schemas->shipping ) ) {
120
  return $shipping_method_ids;
121
  }
@@ -236,7 +236,7 @@ if ( ! class_exists( 'WC_Connect_Service_Schemas_Store' ) ) {
236
  }
237
 
238
  $predefined_packages = array();
239
- foreach( $service_schemas->shipping as $service_schema ) {
240
  if ( ! isset( $service_schema->packages ) ) {
241
  continue;
242
  }
36
 
37
  $old_schemas = $this->get_service_schemas();
38
  if ( $old_schemas == $response_body ) {
39
+ // schemas weren't changed, but were fetched without problems
40
  return true;
41
  }
42
 
62
 
63
  protected function maybe_update_heartbeat() {
64
  $last_heartbeat = WC_Connect_Options::get_option( 'last_heartbeat' );
65
+ $now = time();
66
 
67
  if ( ! $last_heartbeat ) {
68
  $should_update = true;
72
  // last heartbeat in the future? wacky
73
  $should_update = true;
74
  } else {
75
+ $elapsed = $now - $last_heartbeat;
76
  $should_update = $elapsed > DAY_IN_SECONDS;
77
  }
78
  }
115
  */
116
  public function get_all_shipping_method_ids() {
117
  $shipping_method_ids = array();
118
+ $service_schemas = $this->get_service_schemas();
119
  if ( ! is_object( $service_schemas ) || ! property_exists( $service_schemas, 'shipping' ) || ! is_array( $service_schemas->shipping ) ) {
120
  return $shipping_method_ids;
121
  }
236
  }
237
 
238
  $predefined_packages = array();
239
+ foreach ( $service_schemas->shipping as $service_schema ) {
240
  if ( ! isset( $service_schema->packages ) ) {
241
  continue;
242
  }
classes/class-wc-connect-service-schemas-validator.php CHANGED
@@ -61,9 +61,9 @@ if ( ! class_exists( 'WC_Connect_Service_Schemas_Validator' ) ) {
61
  * Validates a particular service schema, especially the parts of the service that WC relies
62
  * on like id, method_title, method_description, etc
63
  *
64
- * @param string $service_type
65
  * @param integer $service_counter
66
- * @param object $service
67
  *
68
  * @return WP_Error|true
69
  */
@@ -73,7 +73,7 @@ if ( ! class_exists( 'WC_Connect_Service_Schemas_Validator' ) ) {
73
  'method_description' => 'string',
74
  'method_title' => 'string',
75
  'service_settings' => 'object',
76
- 'form_layout' => 'array'
77
  );
78
 
79
  foreach ( $required_properties as $required_property => $required_property_type ) {
@@ -121,7 +121,7 @@ if ( ! class_exists( 'WC_Connect_Service_Schemas_Validator' ) ) {
121
  $required_properties = array(
122
  'type' => 'string',
123
  'required' => 'array',
124
- 'properties' => 'object'
125
  );
126
 
127
  foreach ( $required_properties as $required_property => $required_property_type ) {
@@ -171,7 +171,7 @@ if ( ! class_exists( 'WC_Connect_Service_Schemas_Validator' ) ) {
171
  */
172
  protected function validate_service_settings_required_properties( $service_id, $service_settings_properties ) {
173
  $required_properties = array(
174
- 'title'
175
  );
176
 
177
  foreach ( $required_properties as $required_property ) {
61
  * Validates a particular service schema, especially the parts of the service that WC relies
62
  * on like id, method_title, method_description, etc
63
  *
64
+ * @param string $service_type
65
  * @param integer $service_counter
66
+ * @param object $service
67
  *
68
  * @return WP_Error|true
69
  */
73
  'method_description' => 'string',
74
  'method_title' => 'string',
75
  'service_settings' => 'object',
76
+ 'form_layout' => 'array',
77
  );
78
 
79
  foreach ( $required_properties as $required_property => $required_property_type ) {
121
  $required_properties = array(
122
  'type' => 'string',
123
  'required' => 'array',
124
+ 'properties' => 'object',
125
  );
126
 
127
  foreach ( $required_properties as $required_property => $required_property_type ) {
171
  */
172
  protected function validate_service_settings_required_properties( $service_id, $service_settings_properties ) {
173
  $required_properties = array(
174
+ 'title',
175
  );
176
 
177
  foreach ( $required_properties as $required_property ) {
classes/class-wc-connect-service-settings-store.php CHANGED
@@ -21,8 +21,8 @@ if ( ! class_exists( 'WC_Connect_Service_Settings_Store' ) ) {
21
 
22
  public function __construct( WC_Connect_Service_Schemas_Store $service_schemas_store, WC_Connect_API_Client $api_client, WC_Connect_Logger $logger ) {
23
  $this->service_schemas_store = $service_schemas_store;
24
- $this->api_client = $api_client;
25
- $this->logger = $logger;
26
  }
27
 
28
  /**
@@ -32,15 +32,15 @@ if ( ! class_exists( 'WC_Connect_Service_Settings_Store' ) ) {
32
  */
33
  public function get_store_options() {
34
  $currency_symbol = sanitize_text_field( html_entity_decode( get_woocommerce_currency_symbol() ) );
35
- $dimension_unit = sanitize_text_field( strtolower( get_option( 'woocommerce_dimension_unit' ) ) );
36
- $weight_unit = sanitize_text_field( strtolower( get_option( 'woocommerce_weight_unit' ) ) );
37
- $base_location = wc_get_base_location();
38
 
39
  return array(
40
  'currency_symbol' => $currency_symbol,
41
- 'dimension_unit' => $this->translate_unit( $dimension_unit ),
42
- 'weight_unit' => $this->translate_unit( $weight_unit ),
43
- 'origin_country' => $base_location['country'],
44
  );
45
  }
46
 
@@ -52,12 +52,12 @@ if ( ! class_exists( 'WC_Connect_Service_Settings_Store' ) ) {
52
  public function get_account_settings() {
53
  $default = array(
54
  'selected_payment_method_id' => 0,
55
- 'enabled' => true,
56
  );
57
 
58
- $result = WC_Connect_Options::get_option( 'account_settings', $default );
59
  $result['paper_size'] = $this->get_preferred_paper_size();
60
- $result = array_merge( $default, $result );
61
 
62
  if ( ! isset( $result['email_receipts'] ) ) {
63
  $result['email_receipts'] = true;
@@ -74,7 +74,7 @@ if ( ! class_exists( 'WC_Connect_Service_Settings_Store' ) ) {
74
  * @return true
75
  */
76
  public function update_account_settings( $settings ) {
77
- // simple validation for now
78
  if ( ! is_array( $settings ) ) {
79
  $this->logger->log( 'Array expected but not received', __FUNCTION__ );
80
  return false;
@@ -94,7 +94,7 @@ if ( ! class_exists( 'WC_Connect_Service_Settings_Store' ) ) {
94
 
95
  public function set_selected_payment_method_id( $new_payment_method_id ) {
96
  $new_payment_method_id = intval( $new_payment_method_id );
97
- $account_settings = $this->get_account_settings();
98
  $old_payment_method_id = intval( $account_settings['selected_payment_method_id'] );
99
  if ( $old_payment_method_id === $new_payment_method_id ) {
100
  return;
@@ -111,33 +111,33 @@ if ( ! class_exists( 'WC_Connect_Service_Settings_Store' ) ) {
111
  }
112
 
113
  public function get_origin_address() {
114
- $wc_address_fields = array();
115
  $wc_address_fields['company'] = html_entity_decode( get_bloginfo( 'name' ), ENT_QUOTES ); // HTML entities may be saved in the option.
116
- $wc_address_fields['name'] = wp_get_current_user()->display_name;
117
- $wc_address_fields['phone'] = '';
118
 
119
  $wc_countries = WC()->countries;
120
  // WC 3.2 introduces ability to configure a full address in the settings
121
  // Use it for address defaults if available
122
  if ( method_exists( $wc_countries, 'get_base_address' ) ) {
123
- $wc_address_fields['country'] = $wc_countries->get_base_country();
124
- $wc_address_fields['state'] = $wc_countries->get_base_state();
125
- $wc_address_fields['address'] = $wc_countries->get_base_address();
126
  $wc_address_fields['address_2'] = $wc_countries->get_base_address_2();
127
- $wc_address_fields['city'] = $wc_countries->get_base_city();
128
- $wc_address_fields['postcode'] = $wc_countries->get_base_postcode();
129
  } else {
130
- $base_location = wc_get_base_location();
131
- $wc_address_fields['country'] = $base_location['country'];
132
- $wc_address_fields['state'] = $base_location['state'];
133
- $wc_address_fields['address'] = '';
134
  $wc_address_fields['address_2'] = '';
135
- $wc_address_fields['city'] = '';
136
- $wc_address_fields['postcode'] = '';
137
  }
138
 
139
- $stored_address_fields = WC_Connect_Options::get_option( 'origin_address', array() );
140
- $merged_fields = array_merge( $wc_address_fields, $stored_address_fields );
141
  $merged_fields['company'] = html_entity_decode( $merged_fields['company'], ENT_QUOTES ); // Decode again for any existing stores that had some html entities saved in the option.
142
  return $merged_fields;
143
  }
@@ -148,7 +148,7 @@ if ( ! class_exists( 'WC_Connect_Service_Settings_Store' ) ) {
148
  return $paper_size;
149
  }
150
  // According to https://en.wikipedia.org/wiki/Letter_(paper_size) US, Mexico, Canada and Dominican Republic
151
- // use "Letter" size, and pretty much all the rest of the world use A4, so those are sensible defaults
152
  $base_location = wc_get_base_location();
153
  if ( in_array( $base_location['country'], array( 'US', 'CA', 'MX', 'DO' ), true ) ) {
154
  return 'letter';
@@ -172,10 +172,10 @@ if ( ! class_exists( 'WC_Connect_Service_Settings_Store' ) ) {
172
  $regex = '/"' . $field_name . '":"(.+?)","/';
173
  preg_match_all( $regex, $json, $match_groups );
174
  if ( 2 === count( $match_groups ) ) {
175
- foreach ( $match_groups[ 0 ] as $idx => $match ) {
176
- $value = $match_groups[ 1 ][ $idx ];
177
  $escaped_value = preg_replace( '/(?<!\\\)"/', '\\"', $value );
178
- $json = str_replace( $match, '"' . $field_name . '":"' . $escaped_value . '","', $json );
179
  }
180
  }
181
  return $json;
@@ -193,29 +193,29 @@ if ( ! class_exists( 'WC_Connect_Service_Settings_Store' ) ) {
193
  $regex = '/"' . $field_name . '":\["(.+?)"\]/';
194
  preg_match_all( $regex, $json, $match_groups );
195
  if ( 2 === count( $match_groups ) ) {
196
- foreach ( $match_groups[ 0 ] as $idx => $match ) {
197
- $array = $match_groups[ 1 ][ $idx ];
198
  $escaped_array = preg_replace( '/(?<![,\\\])"(?!,)/', '\\"', $array );
199
- $json = str_replace( '["' . $array . '"]', '["' . $escaped_array. '"]', $json );
200
  }
201
  }
202
  return $json;
203
  }
204
 
205
  public function try_deserialize_labels_json( $label_data ) {
206
- //attempt to decode the JSON (legacy way of storing the labels data)
207
  $decoded_labels = json_decode( $label_data, true );
208
  if ( $decoded_labels ) {
209
  return $decoded_labels;
210
  }
211
 
212
- $label_data = $this->try_recover_invalid_json_string( 'package_name', $label_data );
213
  $decoded_labels = json_decode( $label_data, true );
214
  if ( $decoded_labels ) {
215
  return $decoded_labels;
216
  }
217
 
218
- $label_data = $this->try_recover_invalid_json_array( 'product_names', $label_data );
219
  $decoded_labels = json_decode( $label_data, true );
220
  if ( $decoded_labels ) {
221
  return $decoded_labels;
@@ -232,13 +232,13 @@ if ( ! class_exists( 'WC_Connect_Service_Settings_Store' ) ) {
232
  * @return array
233
  */
234
  public function get_label_order_meta_data( $order_id ) {
235
- $label_data = get_post_meta( ( int ) $order_id, 'wc_connect_labels', true );
236
- //return an empty array if the data doesn't exist
237
  if ( ! $label_data ) {
238
  return array();
239
  }
240
 
241
- //labels stored as an array, return
242
  if ( is_array( $label_data ) ) {
243
  return $label_data;
244
  }
@@ -255,11 +255,11 @@ if ( ! class_exists( 'WC_Connect_Service_Settings_Store' ) ) {
255
  * @return array updated label info
256
  */
257
  public function update_label_order_meta_data( $order_id, $new_label_data ) {
258
- $result = $new_label_data;
259
  $labels_data = $this->get_label_order_meta_data( $order_id );
260
- foreach( $labels_data as $index => $label_data ) {
261
  if ( $label_data['label_id'] === $new_label_data->label_id ) {
262
- $result = array_merge( $label_data, (array) $new_label_data );
263
  $labels_data[ $index ] = $result;
264
 
265
  if ( ! isset( $label_data['tracking'] )
@@ -276,7 +276,7 @@ if ( ! class_exists( 'WC_Connect_Service_Settings_Store' ) ) {
276
  * Adds new labels to the order
277
  *
278
  * @param $order_id
279
- * @param array $new_labels - labels to be added
280
  */
281
  public function add_labels_to_order( $order_id, $new_labels ) {
282
  $labels_data = $this->get_label_order_meta_data( $order_id );
@@ -289,13 +289,13 @@ if ( ! class_exists( 'WC_Connect_Service_Settings_Store' ) ) {
289
  }
290
 
291
  public function update_destination_address( $order_id, $api_address ) {
292
- $order = wc_get_order( $order_id );
293
  $wc_address = $order->get_address( 'shipping' );
294
 
295
- $new_address = array_merge( array(), ( array ) $wc_address, ( array ) $api_address );
296
- //rename address to address_1
297
  $new_address['address_1'] = $new_address['address'];
298
- //remove api-specific fields
299
  unset( $new_address['address'], $new_address['name'] );
300
 
301
  $order->set_address( $new_address, 'shipping' );
@@ -346,7 +346,7 @@ if ( ! class_exists( 'WC_Connect_Service_Settings_Store' ) ) {
346
  $enabled_services = array();
347
 
348
  // Note: We use esc_sql here instead of prepare because we are using WHERE IN
349
- // https://codex.wordpress.org/Function_Reference/esc_sql
350
 
351
  $escaped_list = '';
352
  foreach ( $service_ids as $shipping_service ) {
@@ -362,7 +362,7 @@ if ( ! class_exists( 'WC_Connect_Service_Settings_Store' ) ) {
362
  "LEFT JOIN {$wpdb->prefix}woocommerce_shipping_zones " .
363
  "ON {$wpdb->prefix}woocommerce_shipping_zone_methods.zone_id = {$wpdb->prefix}woocommerce_shipping_zones.zone_id " .
364
  "WHERE method_id IN ({$escaped_list}) " .
365
- "ORDER BY zone_order, instance_id;"
366
  );
367
 
368
  if ( empty( $methods ) ) {
@@ -370,19 +370,19 @@ if ( ! class_exists( 'WC_Connect_Service_Settings_Store' ) ) {
370
  }
371
 
372
  foreach ( (array) $methods as $method ) {
373
- $service_schema = $this->service_schemas_store->get_service_schema_by_method_id( $method->method_id );
374
  $service_settings = $this->get_service_settings( $method->method_id, $method->instance_id );
375
  if ( is_object( $service_settings ) && property_exists( $service_settings, 'title' ) ) {
376
  $title = $service_settings->title;
377
- } else if ( is_object( $service_schema ) && property_exists( $service_schema, 'method_title' ) ) {
378
  $title = $service_schema->method_title;
379
  } else {
380
  $title = _x( 'Unknown', 'A service with an unknown title and unknown method_title', 'woocommerce-services' );
381
  }
382
  $method->service_type = 'shipping';
383
- $method->title = $title;
384
- $method->zone_name = empty( $method->zone_name ) ? __( 'Rest of the World', 'woocommerce-services' ) : $method->zone_name;
385
- $enabled_services[] = $method;
386
  }
387
 
388
  usort( $enabled_services, array( $this, 'sort_services' ) );
@@ -393,24 +393,24 @@ if ( ! class_exists( 'WC_Connect_Service_Settings_Store' ) ) {
393
  * Checks if the shipping method ids have been migrated to the "wc_services_*" format and migrates them
394
  */
395
  public function migrate_legacy_services() {
396
- if ( WC_Connect_Options::get_option( 'shipping_methods_migrated', false ) //check if the method have already been migrated
397
- || ! $this->service_schemas_store->fetch_service_schemas_from_connect_server() ) { //ensure the latest schemas are fetched
398
  return;
399
  }
400
 
401
  global $wpdb;
402
 
403
- //old services used the id field instead of method_id
404
  $shipping_service_ids = $this->service_schemas_store->get_all_service_ids_of_type( 'shipping' );
405
- $legacy_services = $this->get_enabled_services_by_ids( $shipping_service_ids );
406
 
407
  foreach ( $legacy_services as $legacy_service ) {
408
- $service_id = $legacy_service->method_id;
409
- $instance_id = $legacy_service->instance_id;
410
- $service_schema = $this->service_schemas_store->get_service_schema_by_id( $service_id );
411
  $service_settings = $this->get_service_settings( $service_id, $instance_id );
412
- if ( ( is_array( $service_settings ) && ! $service_settings ) //check for an empty array
413
- || ( ! is_array( $service_settings ) && ! is_object( $service_settings ) ) ) { //settings are neither an array nor an object
414
  continue;
415
  }
416
 
@@ -419,13 +419,17 @@ if ( ! class_exists( 'WC_Connect_Service_Settings_Store' ) ) {
419
  $wpdb->update(
420
  "{$wpdb->prefix}woocommerce_shipping_zone_methods",
421
  array( 'method_id' => $new_method_id ),
422
- array( 'instance_id' => $instance_id, 'method_id' => $service_id ),
 
 
 
423
  array( '%s' ),
424
- array( '%d', '%s' ) );
 
425
 
426
- //update the migrated service settings
427
  WC_Connect_Options::update_shipping_method_option( 'form_settings', $service_settings, $new_method_id, $instance_id );
428
- //delete the old service settings
429
  WC_Connect_Options::delete_shipping_method_options( $service_id, $instance_id );
430
  }
431
 
@@ -436,7 +440,7 @@ if ( ! class_exists( 'WC_Connect_Service_Settings_Store' ) ) {
436
  * Given a service's id and optional instance, returns the settings for that
437
  * service or an empty array
438
  *
439
- * @param string $service_id
440
  * @param integer $service_instance
441
  *
442
  * @return object|array
@@ -452,7 +456,7 @@ if ( ! class_exists( 'WC_Connect_Service_Settings_Store' ) ) {
452
  */
453
  public function validate_and_possibly_update_settings( $settings, $id, $instance = false ) {
454
 
455
- // Validate instance or at least id if no instance is given
456
  if ( ! empty( $instance ) ) {
457
  $service_schema = $this->service_schemas_store->get_service_schema_by_instance_id( $instance );
458
  if ( ! $service_schema ) {
@@ -465,7 +469,7 @@ if ( ! class_exists( 'WC_Connect_Service_Settings_Store' ) ) {
465
  }
466
  }
467
 
468
- // Validate settings with WCC server
469
  $response_body = $this->api_client->validate_service_settings( $service_schema->id, $settings );
470
 
471
  if ( is_wp_error( $response_body ) ) {
@@ -473,9 +477,9 @@ if ( ! class_exists( 'WC_Connect_Service_Settings_Store' ) ) {
473
  return $response_body;
474
  }
475
 
476
- // On success, save the settings to the database and exit
477
  WC_Connect_Options::update_shipping_method_option( 'form_settings', $settings, $id, $instance );
478
- // Invalidate shipping rates session cache
479
  WC_Cache_Helper::get_transient_version( 'shipping', /* $refresh = */ true );
480
  do_action( 'wc_connect_saved_service_settings', $id, $instance, $settings );
481
 
@@ -491,6 +495,20 @@ if ( ! class_exists( 'WC_Connect_Service_Settings_Store' ) ) {
491
  return WC_Connect_Options::get_option( 'packages', array() );
492
  }
493
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
494
  /**
495
  * Updates the global list of packages
496
  *
@@ -524,6 +542,20 @@ if ( ! class_exists( 'WC_Connect_Service_Settings_Store' ) ) {
524
  return $packages[ $service_id ];
525
  }
526
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
527
  /**
528
  * Updates the global list of enabled predefined packages for all services
529
  *
@@ -536,7 +568,7 @@ if ( ! class_exists( 'WC_Connect_Service_Settings_Store' ) ) {
536
  public function get_package_lookup() {
537
  $lookup = array();
538
 
539
- $custom_packages = $this->get_packages();
540
  foreach ( $custom_packages as $custom_package ) {
541
  $lookup[ $custom_package['name'] ] = $custom_package;
542
  }
@@ -549,7 +581,7 @@ if ( ! class_exists( 'WC_Connect_Service_Settings_Store' ) ) {
549
  foreach ( $predefined_packages_schema as $service_id => $groups ) {
550
  foreach ( $groups as $group ) {
551
  foreach ( $group->definitions as $predefined ) {
552
- $lookup[ $predefined->id ] = ( array ) $predefined;
553
  }
554
  }
555
  }
@@ -560,23 +592,23 @@ if ( ! class_exists( 'WC_Connect_Service_Settings_Store' ) ) {
560
  private function translate_unit( $value ) {
561
  switch ( $value ) {
562
  case 'kg':
563
- return __('kg', 'woocommerce-services');
564
  case 'g':
565
- return __('g', 'woocommerce-services');
566
  case 'lbs':
567
- return __('lbs', 'woocommerce-services');
568
  case 'oz':
569
- return __('oz', 'woocommerce-services');
570
  case 'm':
571
- return __('m', 'woocommerce-services');
572
  case 'cm':
573
- return __('cm', 'woocommerce-services');
574
  case 'mm':
575
- return __('mm', 'woocommerce-services');
576
  case 'in':
577
- return __('in', 'woocommerce-services');
578
  case 'yd':
579
- return __('yd', 'woocommerce-services');
580
  default:
581
  $this->logger->log( 'Unexpected measurement unit: ' . $value, __FUNCTION__ );
582
  return $value;
21
 
22
  public function __construct( WC_Connect_Service_Schemas_Store $service_schemas_store, WC_Connect_API_Client $api_client, WC_Connect_Logger $logger ) {
23
  $this->service_schemas_store = $service_schemas_store;
24
+ $this->api_client = $api_client;
25
+ $this->logger = $logger;
26
  }
27
 
28
  /**
32
  */
33
  public function get_store_options() {
34
  $currency_symbol = sanitize_text_field( html_entity_decode( get_woocommerce_currency_symbol() ) );
35
+ $dimension_unit = sanitize_text_field( strtolower( get_option( 'woocommerce_dimension_unit' ) ) );
36
+ $weight_unit = sanitize_text_field( strtolower( get_option( 'woocommerce_weight_unit' ) ) );
37
+ $base_location = wc_get_base_location();
38
 
39
  return array(
40
  'currency_symbol' => $currency_symbol,
41
+ 'dimension_unit' => $this->translate_unit( $dimension_unit ),
42
+ 'weight_unit' => $this->translate_unit( $weight_unit ),
43
+ 'origin_country' => $base_location['country'],
44
  );
45
  }
46
 
52
  public function get_account_settings() {
53
  $default = array(
54
  'selected_payment_method_id' => 0,
55
+ 'enabled' => true,
56
  );
57
 
58
+ $result = WC_Connect_Options::get_option( 'account_settings', $default );
59
  $result['paper_size'] = $this->get_preferred_paper_size();
60
+ $result = array_merge( $default, $result );
61
 
62
  if ( ! isset( $result['email_receipts'] ) ) {
63
  $result['email_receipts'] = true;
74
  * @return true
75
  */
76
  public function update_account_settings( $settings ) {
77
+ // simple validation for now.
78
  if ( ! is_array( $settings ) ) {
79
  $this->logger->log( 'Array expected but not received', __FUNCTION__ );
80
  return false;
94
 
95
  public function set_selected_payment_method_id( $new_payment_method_id ) {
96
  $new_payment_method_id = intval( $new_payment_method_id );
97
+ $account_settings = $this->get_account_settings();
98
  $old_payment_method_id = intval( $account_settings['selected_payment_method_id'] );
99
  if ( $old_payment_method_id === $new_payment_method_id ) {
100
  return;
111
  }
112
 
113
  public function get_origin_address() {
114
+ $wc_address_fields = array();
115
  $wc_address_fields['company'] = html_entity_decode( get_bloginfo( 'name' ), ENT_QUOTES ); // HTML entities may be saved in the option.
116
+ $wc_address_fields['name'] = wp_get_current_user()->display_name;
117
+ $wc_address_fields['phone'] = '';
118
 
119
  $wc_countries = WC()->countries;
120
  // WC 3.2 introduces ability to configure a full address in the settings
121
  // Use it for address defaults if available
122
  if ( method_exists( $wc_countries, 'get_base_address' ) ) {
123
+ $wc_address_fields['country'] = $wc_countries->get_base_country();
124
+ $wc_address_fields['state'] = $wc_countries->get_base_state();
125
+ $wc_address_fields['address'] = $wc_countries->get_base_address();
126
  $wc_address_fields['address_2'] = $wc_countries->get_base_address_2();
127
+ $wc_address_fields['city'] = $wc_countries->get_base_city();
128
+ $wc_address_fields['postcode'] = $wc_countries->get_base_postcode();
129
  } else {
130
+ $base_location = wc_get_base_location();
131
+ $wc_address_fields['country'] = $base_location['country'];
132
+ $wc_address_fields['state'] = $base_location['state'];
133
+ $wc_address_fields['address'] = '';
134
  $wc_address_fields['address_2'] = '';
135
+ $wc_address_fields['city'] = '';
136
+ $wc_address_fields['postcode'] = '';
137
  }
138
 
139
+ $stored_address_fields = WC_Connect_Options::get_option( 'origin_address', array() );
140
+ $merged_fields = array_merge( $wc_address_fields, $stored_address_fields );
141
  $merged_fields['company'] = html_entity_decode( $merged_fields['company'], ENT_QUOTES ); // Decode again for any existing stores that had some html entities saved in the option.
142
  return $merged_fields;
143
  }
148
  return $paper_size;
149
  }
150
  // According to https://en.wikipedia.org/wiki/Letter_(paper_size) US, Mexico, Canada and Dominican Republic
151
+ // use "Letter" size, and pretty much all the rest of the world use A4, so those are sensible defaults.
152
  $base_location = wc_get_base_location();
153
  if ( in_array( $base_location['country'], array( 'US', 'CA', 'MX', 'DO' ), true ) ) {
154
  return 'letter';
172
  $regex = '/"' . $field_name . '":"(.+?)","/';
173
  preg_match_all( $regex, $json, $match_groups );
174
  if ( 2 === count( $match_groups ) ) {
175
+ foreach ( $match_groups[0] as $idx => $match ) {
176
+ $value = $match_groups[1][ $idx ];
177
  $escaped_value = preg_replace( '/(?<!\\\)"/', '\\"', $value );
178
+ $json = str_replace( $match, '"' . $field_name . '":"' . $escaped_value . '","', $json );
179
  }
180
  }
181
  return $json;
193
  $regex = '/"' . $field_name . '":\["(.+?)"\]/';
194
  preg_match_all( $regex, $json, $match_groups );
195
  if ( 2 === count( $match_groups ) ) {
196
+ foreach ( $match_groups[0] as $idx => $match ) {
197
+ $array = $match_groups[1][ $idx ];
198
  $escaped_array = preg_replace( '/(?<![,\\\])"(?!,)/', '\\"', $array );
199
+ $json = str_replace( '["' . $array . '"]', '["' . $escaped_array . '"]', $json );
200
  }
201
  }
202
  return $json;
203
  }
204
 
205
  public function try_deserialize_labels_json( $label_data ) {
206
+ // attempt to decode the JSON (legacy way of storing the labels data).
207
  $decoded_labels = json_decode( $label_data, true );
208
  if ( $decoded_labels ) {
209
  return $decoded_labels;
210
  }
211
 
212
+ $label_data = $this->try_recover_invalid_json_string( 'package_name', $label_data );
213
  $decoded_labels = json_decode( $label_data, true );
214
  if ( $decoded_labels ) {
215
  return $decoded_labels;
216
  }
217
 
218
+ $label_data = $this->try_recover_invalid_json_array( 'product_names', $label_data );
219
  $decoded_labels = json_decode( $label_data, true );
220
  if ( $decoded_labels ) {
221
  return $decoded_labels;
232
  * @return array
233
  */
234
  public function get_label_order_meta_data( $order_id ) {
235
+ $label_data = get_post_meta( (int) $order_id, 'wc_connect_labels', true );
236
+ // return an empty array if the data doesn't exist.
237
  if ( ! $label_data ) {
238
  return array();
239
  }
240
 
241
+ // labels stored as an array, return.
242
  if ( is_array( $label_data ) ) {
243
  return $label_data;
244
  }
255
  * @return array updated label info
256
  */
257
  public function update_label_order_meta_data( $order_id, $new_label_data ) {
258
+ $result = $new_label_data;
259
  $labels_data = $this->get_label_order_meta_data( $order_id );
260
+ foreach ( $labels_data as $index => $label_data ) {
261
  if ( $label_data['label_id'] === $new_label_data->label_id ) {
262
+ $result = array_merge( $label_data, (array) $new_label_data );
263
  $labels_data[ $index ] = $result;
264
 
265
  if ( ! isset( $label_data['tracking'] )
276
  * Adds new labels to the order
277
  *
278
  * @param $order_id
279
+ * @param array $new_labels - labels to be added
280
  */
281
  public function add_labels_to_order( $order_id, $new_labels ) {
282
  $labels_data = $this->get_label_order_meta_data( $order_id );
289
  }
290
 
291
  public function update_destination_address( $order_id, $api_address ) {
292
+ $order = wc_get_order( $order_id );
293
  $wc_address = $order->get_address( 'shipping' );
294
 
295
+ $new_address = array_merge( array(), (array) $wc_address, (array) $api_address );
296
+ // rename address to address_1.
297
  $new_address['address_1'] = $new_address['address'];
298
+ // remove api-specific fields.
299
  unset( $new_address['address'], $new_address['name'] );
300
 
301
  $order->set_address( $new_address, 'shipping' );
346
  $enabled_services = array();
347
 
348
  // Note: We use esc_sql here instead of prepare because we are using WHERE IN
349
+ // https://codex.wordpress.org/Function_Reference/esc_sql.
350
 
351
  $escaped_list = '';
352
  foreach ( $service_ids as $shipping_service ) {
362
  "LEFT JOIN {$wpdb->prefix}woocommerce_shipping_zones " .
363
  "ON {$wpdb->prefix}woocommerce_shipping_zone_methods.zone_id = {$wpdb->prefix}woocommerce_shipping_zones.zone_id " .
364
  "WHERE method_id IN ({$escaped_list}) " .
365
+ 'ORDER BY zone_order, instance_id;'
366
  );
367
 
368
  if ( empty( $methods ) ) {
370
  }
371
 
372
  foreach ( (array) $methods as $method ) {
373
+ $service_schema = $this->service_schemas_store->get_service_schema_by_method_id( $method->method_id );
374
  $service_settings = $this->get_service_settings( $method->method_id, $method->instance_id );
375
  if ( is_object( $service_settings ) && property_exists( $service_settings, 'title' ) ) {
376
  $title = $service_settings->title;
377
+ } elseif ( is_object( $service_schema ) && property_exists( $service_schema, 'method_title' ) ) {
378
  $title = $service_schema->method_title;
379
  } else {
380
  $title = _x( 'Unknown', 'A service with an unknown title and unknown method_title', 'woocommerce-services' );
381
  }
382
  $method->service_type = 'shipping';
383
+ $method->title = $title;
384
+ $method->zone_name = empty( $method->zone_name ) ? __( 'Rest of the World', 'woocommerce-services' ) : $method->zone_name;
385
+ $enabled_services[] = $method;
386
  }
387
 
388
  usort( $enabled_services, array( $this, 'sort_services' ) );
393
  * Checks if the shipping method ids have been migrated to the "wc_services_*" format and migrates them
394
  */
395
  public function migrate_legacy_services() {
396
+ if ( WC_Connect_Options::get_option( 'shipping_methods_migrated', false ) // check if the method have already been migrated.
397
+ || ! $this->service_schemas_store->fetch_service_schemas_from_connect_server() ) { // ensure the latest schemas are fetched.
398
  return;
399
  }
400
 
401
  global $wpdb;
402
 
403
+ // old services used the id field instead of method_id.
404
  $shipping_service_ids = $this->service_schemas_store->get_all_service_ids_of_type( 'shipping' );
405
+ $legacy_services = $this->get_enabled_services_by_ids( $shipping_service_ids );
406
 
407
  foreach ( $legacy_services as $legacy_service ) {
408
+ $service_id = $legacy_service->method_id;
409
+ $instance_id = $legacy_service->instance_id;
410
+ $service_schema = $this->service_schemas_store->get_service_schema_by_id( $service_id );
411
  $service_settings = $this->get_service_settings( $service_id, $instance_id );
412
+ if ( ( is_array( $service_settings ) && ! $service_settings ) // check for an empty array.
413
+ || ( ! is_array( $service_settings ) && ! is_object( $service_settings ) ) ) { // settings are neither an array nor an object.
414
  continue;
415
  }
416
 
419
  $wpdb->update(
420
  "{$wpdb->prefix}woocommerce_shipping_zone_methods",
421
  array( 'method_id' => $new_method_id ),
422
+ array(
423
+ 'instance_id' => $instance_id,
424
+ 'method_id' => $service_id,
425
+ ),
426
  array( '%s' ),
427
+ array( '%d', '%s' )
428
+ );
429
 
430
+ // update the migrated service settings.
431
  WC_Connect_Options::update_shipping_method_option( 'form_settings', $service_settings, $new_method_id, $instance_id );
432
+ // delete the old service settings.
433
  WC_Connect_Options::delete_shipping_method_options( $service_id, $instance_id );
434
  }
435
 
440
  * Given a service's id and optional instance, returns the settings for that
441
  * service or an empty array
442
  *
443
+ * @param string $service_id
444
  * @param integer $service_instance
445
  *
446
  * @return object|array
456
  */
457
  public function validate_and_possibly_update_settings( $settings, $id, $instance = false ) {
458
 
459
+ // Validate instance or at least id if no instance is given.
460
  if ( ! empty( $instance ) ) {
461
  $service_schema = $this->service_schemas_store->get_service_schema_by_instance_id( $instance );
462
  if ( ! $service_schema ) {
469
  }
470
  }
471
 
472
+ // Validate settings with WCC server.
473
  $response_body = $this->api_client->validate_service_settings( $service_schema->id, $settings );
474
 
475
  if ( is_wp_error( $response_body ) ) {
477
  return $response_body;
478
  }
479
 
480
+ // On success, save the settings to the database and exit.
481
  WC_Connect_Options::update_shipping_method_option( 'form_settings', $settings, $id, $instance );
482
+ // Invalidate shipping rates session cache.
483
  WC_Cache_Helper::get_transient_version( 'shipping', /* $refresh = */ true );
484
  do_action( 'wc_connect_saved_service_settings', $id, $instance, $settings );
485
 
495
  return WC_Connect_Options::get_option( 'packages', array() );
496
  }
497
 
498
+ /**
499
+ * Extends the global list of packages with a list of new packages
500
+ *
501
+ * @param array new_packages - packages to extend
502
+ */
503
+ public function create_packages( $new_packages ) {
504
+ if ( is_null( $new_packages ) ) {
505
+ return;
506
+ }
507
+ $packages = $this->get_packages();
508
+ $packages = array_merge( $packages, $new_packages );
509
+ WC_Connect_Options::update_option( 'packages', $packages );
510
+ }
511
+
512
  /**
513
  * Updates the global list of packages
514
  *
542
  return $packages[ $service_id ];
543
  }
544
 
545
+ /**
546
+ * Extends the global list of enabled predefined packages with a list of new packages
547
+ *
548
+ * @param array new_packages - packages to extend
549
+ */
550
+ public function create_predefined_packages( $new_packages ) {
551
+ if ( is_null( $new_packages ) ) {
552
+ return;
553
+ }
554
+ $packages = $this->get_predefined_packages();
555
+ $packages = array_merge_recursive( $packages, $new_packages );
556
+ WC_Connect_Options::update_option( 'predefined_packages', $packages );
557
+ }
558
+
559
  /**
560
  * Updates the global list of enabled predefined packages for all services
561
  *
568
  public function get_package_lookup() {
569
  $lookup = array();
570
 
571
+ $custom_packages = $this->get_packages();
572
  foreach ( $custom_packages as $custom_package ) {
573
  $lookup[ $custom_package['name'] ] = $custom_package;
574
  }
581
  foreach ( $predefined_packages_schema as $service_id => $groups ) {
582
  foreach ( $groups as $group ) {
583
  foreach ( $group->definitions as $predefined ) {
584
+ $lookup[ $predefined->id ] = (array) $predefined;
585
  }
586
  }
587
  }
592
  private function translate_unit( $value ) {
593
  switch ( $value ) {
594
  case 'kg':
595
+ return __( 'kg', 'woocommerce-services' );
596
  case 'g':
597
+ return __( 'g', 'woocommerce-services' );
598
  case 'lbs':
599
+ return __( 'lbs', 'woocommerce-services' );
600
  case 'oz':
601
+ return __( 'oz', 'woocommerce-services' );
602
  case 'm':
603
+ return __( 'm', 'woocommerce-services' );
604
  case 'cm':
605
+ return __( 'cm', 'woocommerce-services' );
606
  case 'mm':
607
+ return __( 'mm', 'woocommerce-services' );
608
  case 'in':
609
+ return __( 'in', 'woocommerce-services' );
610
  case 'yd':
611
+ return __( 'yd', 'woocommerce-services' );
612
  default:
613
  $this->logger->log( 'Unexpected measurement unit: ' . $value, __FUNCTION__ );
614
  return $value;
classes/class-wc-connect-settings-pages.php CHANGED
@@ -4,9 +4,9 @@ if ( ! class_exists( 'WC_Connect_Settings_Pages' ) ) {
4
 
5
  class WC_Connect_Settings_Pages {
6
  /**
7
- * @array
8
  */
9
- protected $fieldsets;
10
 
11
  /**
12
  * @var WC_Connect_Continents
@@ -19,11 +19,12 @@ if ( ! class_exists( 'WC_Connect_Settings_Pages' ) ) {
19
  */
20
  protected $api_client;
21
 
22
- public function __construct( WC_Connect_API_Client $api_client ) {
23
- $this->id = 'connect';
24
- $this->label = _x( 'WooCommerce Shipping', 'The WooCommerce Shipping & Tax brandname', 'woocommerce-services' );
25
- $this->continents = new WC_Connect_Continents();
26
- $this->api_client = $api_client;
 
27
 
28
  add_filter( 'woocommerce_get_sections_shipping', array( $this, 'get_sections' ), 30 );
29
  add_action( 'woocommerce_settings_shipping', array( $this, 'output_settings_screen' ), 5 );
@@ -39,7 +40,7 @@ if ( ! class_exists( 'WC_Connect_Settings_Pages' ) ) {
39
  $shipping_tabs = array();
40
  }
41
 
42
- $shipping_tabs[ 'woocommerce-services-settings' ] = __( 'WooCommerce Shipping', 'woocommerce-services' );
43
  return $shipping_tabs;
44
  }
45
 
@@ -61,7 +62,7 @@ if ( ! class_exists( 'WC_Connect_Settings_Pages' ) ) {
61
  * Localizes the bootstrap, enqueues the script and styles for the settings page
62
  */
63
  public function output_shipping_settings_screen() {
64
- // hiding the save button because the react container has its own
65
  global $hide_save_button;
66
  $hide_save_button = true;
67
 
@@ -80,40 +81,48 @@ if ( ! class_exists( 'WC_Connect_Settings_Pages' ) ) {
80
  <?php
81
  }
82
 
83
- $extra_args = array();
 
 
 
84
  $carriers_response = $this->api_client->get_carrier_accounts();
85
  if ( ! is_wp_error( $carriers_response ) && $carriers_response ) {
86
- $extra_args[ 'carriers' ] = $carriers_response->carriers;
87
  }
88
 
89
  $subscriptions_usage_response = $this->api_client->get_wccom_subscriptions();
90
 
91
  if ( ! is_wp_error( $subscriptions_usage_response ) && $subscriptions_usage_response ) {
92
- $extra_args[ 'subscriptions' ] = $subscriptions_usage_response->subscriptions;
93
  }
94
 
95
  if ( isset( $_GET['from_order'] ) ) {
96
- $extra_args['order_id'] = $_GET['from_order'];
97
  $extra_args['order_href'] = get_edit_post_link( $_GET['from_order'] );
98
  }
99
 
100
- if ( !empty( $_GET['carrier'] ) ) {
101
  $extra_args['carrier'] = $_GET['carrier'];
102
  $extra_args['continents'] = $this->continents->get();
103
 
104
- $carrier_information = [];
105
- if( $extra_args[ 'carriers' ] ) {
106
- $carrier_information = array_values( array_filter( $extra_args[ 'carriers' ], function( $carrier ) {
107
- return $carrier->type === $_GET['carrier'];
108
- } ) );
 
 
 
 
 
109
  }
110
- if ( !empty( $carrier_information ) ) {
111
- ?>
112
  <h2>
113
  <a href="<?php echo esc_url( admin_url( 'admin.php?page=wc-settings&tab=shipping&section=woocommerce-services-settings' ) ); ?>"><?php esc_html_e( 'WooCommerce Shipping & Tax', 'woocommerce-services' ); ?></a> &gt;
114
- <span><?php echo esc_html( $carrier_information[0]->carrier ); ?></span>
115
  </h2>
116
- <?php
117
  }
118
  }
119
 
4
 
5
  class WC_Connect_Settings_Pages {
6
  /**
7
+ * @var WC_Connect_Service_Schemas_Store
8
  */
9
+ protected $service_schemas_store;
10
 
11
  /**
12
  * @var WC_Connect_Continents
19
  */
20
  protected $api_client;
21
 
22
+ public function __construct( WC_Connect_API_Client $api_client, WC_Connect_Service_Schemas_Store $service_schemas_store ) {
23
+ $this->id = 'connect';
24
+ $this->label = _x( 'WooCommerce Shipping', 'The WooCommerce Shipping & Tax brandname', 'woocommerce-services' );
25
+ $this->continents = new WC_Connect_Continents();
26
+ $this->api_client = $api_client;
27
+ $this->service_schemas_store = $service_schemas_store;
28
 
29
  add_filter( 'woocommerce_get_sections_shipping', array( $this, 'get_sections' ), 30 );
30
  add_action( 'woocommerce_settings_shipping', array( $this, 'output_settings_screen' ), 5 );
40
  $shipping_tabs = array();
41
  }
42
 
43
+ $shipping_tabs['woocommerce-services-settings'] = __( 'WooCommerce Shipping', 'woocommerce-services' );
44
  return $shipping_tabs;
45
  }
46
 
62
  * Localizes the bootstrap, enqueues the script and styles for the settings page
63
  */
64
  public function output_shipping_settings_screen() {
65
+ // hiding the save button because the react container has its own.
66
  global $hide_save_button;
67
  $hide_save_button = true;
68
 
81
  <?php
82
  }
83
 
84
+ $extra_args = array(
85
+ 'live_rates_types' => $this->service_schemas_store->get_all_shipping_method_ids(),
86
+ );
87
+
88
  $carriers_response = $this->api_client->get_carrier_accounts();
89
  if ( ! is_wp_error( $carriers_response ) && $carriers_response ) {
90
+ $extra_args['carrier_accounts'] = $carriers_response->carriers;
91
  }
92
 
93
  $subscriptions_usage_response = $this->api_client->get_wccom_subscriptions();
94
 
95
  if ( ! is_wp_error( $subscriptions_usage_response ) && $subscriptions_usage_response ) {
96
+ $extra_args['subscriptions'] = $subscriptions_usage_response->subscriptions;
97
  }
98
 
99
  if ( isset( $_GET['from_order'] ) ) {
100
+ $extra_args['order_id'] = $_GET['from_order'];
101
  $extra_args['order_href'] = get_edit_post_link( $_GET['from_order'] );
102
  }
103
 
104
+ if ( ! empty( $_GET['carrier'] ) ) {
105
  $extra_args['carrier'] = $_GET['carrier'];
106
  $extra_args['continents'] = $this->continents->get();
107
 
108
+ $carrier_information = array();
109
+ if ( ! empty( $extra_args['carrier_accounts'] ) ) {
110
+ $carrier_information = current(
111
+ array_filter(
112
+ $extra_args['carrier_accounts'],
113
+ function( $carrier ) {
114
+ return $carrier->type === $_GET['carrier'];
115
+ }
116
+ )
117
+ );
118
  }
119
+ if ( ! empty( $carrier_information ) ) {
120
+ ?>
121
  <h2>
122
  <a href="<?php echo esc_url( admin_url( 'admin.php?page=wc-settings&tab=shipping&section=woocommerce-services-settings' ) ); ?>"><?php esc_html_e( 'WooCommerce Shipping & Tax', 'woocommerce-services' ); ?></a> &gt;
123
+ <span><?php echo esc_html( $carrier_information->carrier ); ?></span>
124
  </h2>
125
+ <?php
126
  }
127
  }
128
 
classes/class-wc-connect-shipping-label.php CHANGED
@@ -52,18 +52,18 @@ if ( ! class_exists( 'WC_Connect_Shipping_Label' ) ) {
52
  WC_Connect_Service_Schemas_Store $service_schemas_store,
53
  WC_Connect_Payment_Methods_Store $payment_methods_store
54
  ) {
55
- $this->api_client = $api_client;
56
- $this->settings_store = $settings_store;
57
  $this->service_schemas_store = $service_schemas_store;
58
- $this->account_settings = new WC_Connect_Account_Settings(
59
- $settings_store,
60
- $payment_methods_store
61
  );
62
- $this->package_settings = new WC_Connect_Package_Settings(
63
- $settings_store,
64
- $service_schemas_store
65
  );
66
- $this->continents = new WC_Connect_Continents();
67
  }
68
 
69
  public function get_item_data( WC_Order $order, $item ) {
@@ -74,7 +74,7 @@ if ( ! class_exists( 'WC_Connect_Shipping_Label' ) ) {
74
  $height = 0;
75
  $length = 0;
76
  $weight = $product->get_weight();
77
- $width = 0;
78
 
79
  if ( $product->has_dimensions() ) {
80
  $height = $product->get_height();
@@ -110,25 +110,25 @@ if ( ! class_exists( 'WC_Connect_Shipping_Label' ) ) {
110
  return array();
111
  }
112
 
113
- // WC3 retrieves metadata as non-scalar values
114
  if ( is_array( $packages_data ) ) {
115
  return $packages_data;
116
  }
117
 
118
- // WC2.6 stores non-scalar values as string, but doesn't deserialize it on retrieval
119
  $packages = maybe_unserialize( $packages_data );
120
  if ( is_array( $packages ) ) {
121
  return $packages;
122
  }
123
 
124
- // legacy WCS stored the labels as JSON
125
  $packages = json_decode( $packages_data, true );
126
  if ( $packages ) {
127
  return $packages;
128
  }
129
 
130
  $packages_data = $this->settings_store->try_recover_invalid_json_string( 'box_id', $packages_data );
131
- $packages = json_decode( $packages_data, true );
132
  if ( $packages ) {
133
  return $packages;
134
  }
@@ -161,7 +161,7 @@ if ( ! class_exists( 'WC_Connect_Shipping_Label' ) ) {
161
  public function get_selected_packages( WC_Order $order ) {
162
  $packages = $this->get_packaging_metadata( $order );
163
  if ( ! $packages ) {
164
- $items = $this->get_all_items( $order );
165
  $weight = array_sum( wp_list_pluck( $items, 'weight' ) );
166
 
167
  $packages = array(
@@ -180,19 +180,19 @@ if ( ! class_exists( 'WC_Connect_Shipping_Label' ) ) {
180
  $formatted_packages = array();
181
 
182
  foreach ( $packages as $package_obj ) {
183
- $package = ( array ) $package_obj;
184
- $package_id = $package['id'];
185
  $formatted_packages[ $package_id ] = $package;
186
 
187
  foreach ( $package['items'] as $item_index => $item ) {
188
- $product_data = ( array ) $item;
189
- $product = WC_Connect_Compatibility::instance()->get_item_product( $order, $product_data );
190
 
191
  if ( $product ) {
192
  $product_data['name'] = $this->get_name( $product );
193
- $product_data['url'] = get_edit_post_link( WC_Connect_Compatibility::instance()->get_parent_product_id( $product ), null );
194
  if ( $product->is_type( 'variation' ) ) {
195
- $formatted = WC_Connect_Compatibility::instance()->get_formatted_variation( $product, true );
196
  $product_data['attributes'] = $formatted;
197
  }
198
  $customs_info = get_post_meta( $product_data['product_id'], 'wc_connect_customs_info', true );
@@ -236,12 +236,12 @@ if ( ! class_exists( 'WC_Connect_Shipping_Label' ) ) {
236
 
237
  public function get_selected_rates( WC_Order $order ) {
238
  $shipping_methods = $order->get_shipping_methods();
239
- $shipping_method = reset( $shipping_methods );
240
- $packages = $this->get_packaging_from_shipping_method( $shipping_method );
241
- $rates = array();
242
 
243
  foreach ( $packages as $idx => $package_obj ) {
244
- $package = ( array ) $package_obj;
245
  // Abort if the package data is malformed
246
  if ( ! isset( $package['id'] ) || ! isset( $package['service_id'] ) ) {
247
  return array();
@@ -254,7 +254,7 @@ if ( ! class_exists( 'WC_Connect_Shipping_Label' ) ) {
254
  }
255
 
256
  protected function format_address_for_api( $address ) {
257
- // Combine first and last name
258
  if ( ! isset( $address['name'] ) ) {
259
  $first_name = isset( $address['first_name'] ) ? trim( $address['first_name'] ) : '';
260
  $last_name = isset( $address['last_name'] ) ? trim( $address['last_name'] ) : '';
@@ -262,12 +262,12 @@ if ( ! class_exists( 'WC_Connect_Shipping_Label' ) ) {
262
  $address['name'] = $first_name . ' ' . $last_name;
263
  }
264
 
265
- // Rename address_1 to address
266
  if ( ! isset( $address['address'] ) && isset( $address['address_1'] ) ) {
267
  $address['address'] = $address['address_1'];
268
  }
269
 
270
- // Remove now defunct keys
271
  unset( $address['first_name'], $address['last_name'], $address['address_1'] );
272
 
273
  return $address;
@@ -287,24 +287,24 @@ if ( ! class_exists( 'WC_Connect_Shipping_Label' ) ) {
287
  }
288
 
289
  protected function get_form_data( WC_Order $order ) {
290
- $order_id = WC_Connect_Compatibility::instance()->get_order_id( $order );
291
- $selected_packages = $this->get_selected_packages( $order );
292
- $is_packed = ( false !== $this->get_packaging_metadata( $order ) );
293
- $origin = $this->get_origin_address();
294
- $selected_rates = $this->get_selected_rates( $order );
295
- $destination = $this->get_destination_address( $order );
296
 
297
  if ( ! $destination['country'] ) {
298
  $destination['country'] = $origin['country'];
299
  }
300
 
301
- $origin_normalized = ( bool ) WC_Connect_Options::get_option( 'origin_address', false );
302
- $destination_normalized = ( bool ) get_post_meta( $order_id, '_wc_connect_destination_normalized', true );
303
 
304
  $form_data = compact( 'is_packed', 'selected_packages', 'origin', 'destination', 'origin_normalized', 'destination_normalized' );
305
 
306
  $form_data['rates'] = array(
307
- 'selected' => (object) $selected_rates,
308
  );
309
 
310
  $form_data['order_id'] = $order_id;
@@ -323,17 +323,21 @@ if ( ! class_exists( 'WC_Connect_Shipping_Label' ) ) {
323
  public function is_dhl_express_available() {
324
  $dhl_express = $this->service_schemas_store->get_service_schema_by_id( 'dhlexpress' );
325
 
326
- return !! $dhl_express;
327
  }
328
 
329
  public function is_order_dhl_express_eligible() {
330
- if( ! $this-> is_dhl_express_available() ) return false;
 
 
331
 
332
  $order = wc_get_order();
333
- if ( ! $order ) return false;
 
 
334
 
335
- $origin = $this->get_origin_address();
336
- $destination = $this->get_destination_address( $order );
337
 
338
  return $origin['country'] !== $destination['country'];
339
  }
@@ -369,12 +373,12 @@ if ( ! class_exists( 'WC_Connect_Shipping_Label' ) ) {
369
  return false;
370
  }
371
 
372
- // If the order was created using WCS checkout rates, show the meta-box regardless of the products' state
373
  if ( $this->get_packaging_metadata( $order ) ) {
374
  return true;
375
  }
376
 
377
- // At this point (no packaging data), only show if there's at least one existing and shippable product
378
  foreach ( $order->get_items() as $item ) {
379
  $product = WC_Connect_Compatibility::instance()->get_item_product( $order, $item );
380
  if ( $product && $product->needs_shipping() ) {
@@ -392,13 +396,13 @@ if ( ! class_exists( 'WC_Connect_Shipping_Label' ) ) {
392
  }
393
 
394
  $order_id = WC_Connect_Compatibility::instance()->get_order_id( $order );
395
- $payload = array(
396
  'orderId' => $order_id,
397
  'paperSize' => $this->settings_store->get_preferred_paper_size(),
398
  'formData' => $this->get_form_data( $order ),
399
  'labelsData' => $this->settings_store->get_label_order_meta_data( $order_id ),
400
  'storeOptions' => $this->settings_store->get_store_options(),
401
- //for backwards compatibility, still disable the country dropdown for calypso users with older plugin versions
402
  'canChangeCountries' => true,
403
  );
404
 
@@ -435,7 +439,8 @@ if ( ! class_exists( 'WC_Connect_Shipping_Label' ) ) {
435
  $order_id = WC_Connect_Compatibility::instance()->get_order_id( $order );
436
  $items = array_filter( $order->get_items(), array( $this, 'filter_items_needing_shipping' ) );
437
  $items_count = array_reduce( $items, array( $this, 'reducer_items_quantity' ), 0 );
438
- $payload = apply_filters( 'wc_connect_meta_box_payload',
 
439
  array(
440
  'order' => $connect_order_presenter->get_order_for_api( $order ),
441
  'accountSettings' => $this->account_settings->get(),
@@ -443,7 +448,7 @@ if ( ! class_exists( 'WC_Connect_Shipping_Label' ) ) {
443
  'shippingLabelData' => $this->get_label_payload( $order_id ),
444
  'continents' => $this->continents->get(),
445
  'context' => $args['args']['context'],
446
- 'items' => $items_count
447
  ),
448
  $args,
449
  $order,
52
  WC_Connect_Service_Schemas_Store $service_schemas_store,
53
  WC_Connect_Payment_Methods_Store $payment_methods_store
54
  ) {
55
+ $this->api_client = $api_client;
56
+ $this->settings_store = $settings_store;
57
  $this->service_schemas_store = $service_schemas_store;
58
+ $this->account_settings = new WC_Connect_Account_Settings(
59
+ $settings_store,
60
+ $payment_methods_store
61
  );
62
+ $this->package_settings = new WC_Connect_Package_Settings(
63
+ $settings_store,
64
+ $service_schemas_store
65
  );
66
+ $this->continents = new WC_Connect_Continents();
67
  }
68
 
69
  public function get_item_data( WC_Order $order, $item ) {
74
  $height = 0;
75
  $length = 0;
76
  $weight = $product->get_weight();
77
+ $width = 0;
78
 
79
  if ( $product->has_dimensions() ) {
80
  $height = $product->get_height();
110
  return array();
111
  }
112
 
113
+ // WC3 retrieves metadata as non-scalar values.
114
  if ( is_array( $packages_data ) ) {
115
  return $packages_data;
116
  }
117
 
118
+ // WC2.6 stores non-scalar values as string, but doesn't deserialize it on retrieval.
119
  $packages = maybe_unserialize( $packages_data );
120
  if ( is_array( $packages ) ) {
121
  return $packages;
122
  }
123
 
124
+ // legacy WCS stored the labels as JSON.
125
  $packages = json_decode( $packages_data, true );
126
  if ( $packages ) {
127
  return $packages;
128
  }
129
 
130
  $packages_data = $this->settings_store->try_recover_invalid_json_string( 'box_id', $packages_data );
131
+ $packages = json_decode( $packages_data, true );
132
  if ( $packages ) {
133
  return $packages;
134
  }
161
  public function get_selected_packages( WC_Order $order ) {
162
  $packages = $this->get_packaging_metadata( $order );
163
  if ( ! $packages ) {
164
+ $items = $this->get_all_items( $order );
165
  $weight = array_sum( wp_list_pluck( $items, 'weight' ) );
166
 
167
  $packages = array(
180
  $formatted_packages = array();
181
 
182
  foreach ( $packages as $package_obj ) {
183
+ $package = (array) $package_obj;
184
+ $package_id = $package['id'];
185
  $formatted_packages[ $package_id ] = $package;
186
 
187
  foreach ( $package['items'] as $item_index => $item ) {
188
+ $product_data = (array) $item;
189
+ $product = WC_Connect_Compatibility::instance()->get_item_product( $order, $product_data );
190
 
191
  if ( $product ) {
192
  $product_data['name'] = $this->get_name( $product );
193
+ $product_data['url'] = get_edit_post_link( WC_Connect_Compatibility::instance()->get_parent_product_id( $product ), null );
194
  if ( $product->is_type( 'variation' ) ) {
195
+ $formatted = WC_Connect_Compatibility::instance()->get_formatted_variation( $product, true );
196
  $product_data['attributes'] = $formatted;
197
  }
198
  $customs_info = get_post_meta( $product_data['product_id'], 'wc_connect_customs_info', true );
236
 
237
  public function get_selected_rates( WC_Order $order ) {
238
  $shipping_methods = $order->get_shipping_methods();
239
+ $shipping_method = reset( $shipping_methods );
240
+ $packages = $this->get_packaging_from_shipping_method( $shipping_method );
241
+ $rates = array();
242
 
243
  foreach ( $packages as $idx => $package_obj ) {
244
+ $package = (array) $package_obj;
245
  // Abort if the package data is malformed
246
  if ( ! isset( $package['id'] ) || ! isset( $package['service_id'] ) ) {
247
  return array();
254
  }
255
 
256
  protected function format_address_for_api( $address ) {
257
+ // Combine first and last name.
258
  if ( ! isset( $address['name'] ) ) {
259
  $first_name = isset( $address['first_name'] ) ? trim( $address['first_name'] ) : '';
260
  $last_name = isset( $address['last_name'] ) ? trim( $address['last_name'] ) : '';
262
  $address['name'] = $first_name . ' ' . $last_name;
263
  }
264
 
265
+ // Rename address_1 to address.
266
  if ( ! isset( $address['address'] ) && isset( $address['address_1'] ) ) {
267
  $address['address'] = $address['address_1'];
268
  }
269
 
270
+ // Remove now defunct keys.
271
  unset( $address['first_name'], $address['last_name'], $address['address_1'] );
272
 
273
  return $address;
287
  }
288
 
289
  protected function get_form_data( WC_Order $order ) {
290
+ $order_id = WC_Connect_Compatibility::instance()->get_order_id( $order );
291
+ $selected_packages = $this->get_selected_packages( $order );
292
+ $is_packed = ( false !== $this->get_packaging_metadata( $order ) );
293
+ $origin = $this->get_origin_address();
294
+ $selected_rates = $this->get_selected_rates( $order );
295
+ $destination = $this->get_destination_address( $order );
296
 
297
  if ( ! $destination['country'] ) {
298
  $destination['country'] = $origin['country'];
299
  }
300
 
301
+ $origin_normalized = (bool) WC_Connect_Options::get_option( 'origin_address', false );
302
+ $destination_normalized = (bool) get_post_meta( $order_id, '_wc_connect_destination_normalized', true );
303
 
304
  $form_data = compact( 'is_packed', 'selected_packages', 'origin', 'destination', 'origin_normalized', 'destination_normalized' );
305
 
306
  $form_data['rates'] = array(
307
+ 'selected' => (object) $selected_rates,
308
  );
309
 
310
  $form_data['order_id'] = $order_id;
323
  public function is_dhl_express_available() {
324
  $dhl_express = $this->service_schemas_store->get_service_schema_by_id( 'dhlexpress' );
325
 
326
+ return ! ! $dhl_express;
327
  }
328
 
329
  public function is_order_dhl_express_eligible() {
330
+ if ( ! $this->is_dhl_express_available() ) {
331
+ return false;
332
+ }
333
 
334
  $order = wc_get_order();
335
+ if ( ! $order ) {
336
+ return false;
337
+ }
338
 
339
+ $origin = $this->get_origin_address();
340
+ $destination = $this->get_destination_address( $order );
341
 
342
  return $origin['country'] !== $destination['country'];
343
  }
373
  return false;
374
  }
375
 
376
+ // If the order was created using WCS checkout rates, show the meta-box regardless of the products' state.
377
  if ( $this->get_packaging_metadata( $order ) ) {
378
  return true;
379
  }
380
 
381
+ // At this point (no packaging data), only show if there's at least one existing and shippable product.
382
  foreach ( $order->get_items() as $item ) {
383
  $product = WC_Connect_Compatibility::instance()->get_item_product( $order, $item );
384
  if ( $product && $product->needs_shipping() ) {
396
  }
397
 
398
  $order_id = WC_Connect_Compatibility::instance()->get_order_id( $order );
399
+ $payload = array(
400
  'orderId' => $order_id,
401
  'paperSize' => $this->settings_store->get_preferred_paper_size(),
402
  'formData' => $this->get_form_data( $order ),
403
  'labelsData' => $this->settings_store->get_label_order_meta_data( $order_id ),
404
  'storeOptions' => $this->settings_store->get_store_options(),
405
+ // for backwards compatibility, still disable the country dropdown for calypso users with older plugin versions.
406
  'canChangeCountries' => true,
407
  );
408
 
439
  $order_id = WC_Connect_Compatibility::instance()->get_order_id( $order );
440
  $items = array_filter( $order->get_items(), array( $this, 'filter_items_needing_shipping' ) );
441
  $items_count = array_reduce( $items, array( $this, 'reducer_items_quantity' ), 0 );
442
+ $payload = apply_filters(
443
+ 'wc_connect_meta_box_payload',
444
  array(
445
  'order' => $connect_order_presenter->get_order_for_api( $order ),
446
  'accountSettings' => $this->account_settings->get(),
448
  'shippingLabelData' => $this->get_label_payload( $order_id ),
449
  'continents' => $this->continents->get(),
450
  'context' => $args['args']['context'],
451
+ 'items' => $items_count,
452
  ),
453
  $args,
454
  $order,
classes/class-wc-connect-shipping-method.php CHANGED
@@ -41,8 +41,8 @@ if ( ! class_exists( 'WC_Connect_Shipping_Method' ) ) {
41
  public function __construct( $id_or_instance_id = null ) {
42
  parent::__construct( $id_or_instance_id );
43
 
44
- // If $arg looks like a number, treat it as an instance_id
45
- // Otherwise, treat it as a (method) id (e.g. wc_connect_usps)
46
  if ( is_numeric( $id_or_instance_id ) ) {
47
  $this->instance_id = absint( $id_or_instance_id );
48
  } else {
@@ -67,30 +67,30 @@ if ( ! class_exists( 'WC_Connect_Shipping_Method' ) ) {
67
  'Error. A WC_Connect_Shipping_Method was constructed without an id or instance_id',
68
  __FUNCTION__
69
  );
70
- $this->id = 'wc_connect_uninitialized_shipping_method';
71
- $this->method_title = '';
72
  $this->method_description = '';
73
- $this->supports = array();
74
- $this->title = '';
75
  } else {
76
- $this->id = $this->service_schema->method_id;
77
- $this->method_title = $this->service_schema->method_title;
78
  $this->method_description = $this->service_schema->method_description;
79
- $this->supports = array(
80
  'shipping-zones',
81
- 'instance-settings'
82
  );
83
 
84
- // Set title to default value
85
  $this->title = $this->service_schema->method_title;
86
 
87
- // Load form values from options, updating title if present
88
  $this->init_form_settings();
89
 
90
  // Note - we cannot hook admin_enqueue_scripts here because we need an instance id
91
  // and this constructor is not called with an instance id until after
92
  // admin_enqueue_scripts has already fired. This is why WC_Connect_Loader
93
- // does it instead
94
  }
95
  $this->package_validation_errors = new WP_Error();
96
  }
@@ -151,7 +151,7 @@ if ( ! class_exists( 'WC_Connect_Shipping_Method' ) ) {
151
  *
152
  * @see WC_Connect_Logger::debug()
153
  * @param string|WP_Error $message
154
- * @param string $context
155
  */
156
  protected function log( $message, $context = '' ) {
157
 
@@ -175,14 +175,13 @@ if ( ! class_exists( 'WC_Connect_Shipping_Method' ) ) {
175
  /**
176
  * Restores any values persisted to the DB for this service instance
177
  * and sets up title for WC core to work properly
178
- *
179
  */
180
  protected function init_form_settings() {
181
 
182
  $form_settings = $this->get_service_settings();
183
 
184
  // We need to initialize the instance title ($this->title)
185
- // from the settings blob
186
  if ( property_exists( $form_settings, 'title' ) ) {
187
  $this->title = $form_settings->title;
188
  }
@@ -323,9 +322,9 @@ if ( ! class_exists( 'WC_Connect_Shipping_Method' ) ) {
323
  }
324
 
325
  private function lookup_product( $package, $product_id ) {
326
- foreach ( $package[ 'contents' ] as $item ) {
327
- if ( $item[ 'product_id' ] === $product_id || $item[ 'variation_id' ] === $product_id ) {
328
- return $item[ 'data' ];
329
  }
330
  }
331
 
@@ -379,9 +378,9 @@ if ( ! class_exists( 'WC_Connect_Shipping_Method' ) ) {
379
  $this->debug( 'No rates found, adding fallback.', 'error' );
380
 
381
  $rate_to_add = array(
382
- 'id' => self::format_rate_id( 'fallback', $this->id, 0 ),
383
- 'label' => self::format_rate_title( $this->service_schema->carrier_name ),
384
- 'cost' => $service_settings->fallback_rate,
385
  );
386
 
387
  $this->add_rate( $rate_to_add );
@@ -392,16 +391,20 @@ if ( ! class_exists( 'WC_Connect_Shipping_Method' ) ) {
392
  return;
393
  }
394
 
395
- $this->debug( sprintf(
396
- 'WooCommerce Shipping & Tax debug mode is on - to hide these messages, turn debug mode off in the <a href="%s" style="text-decoration: underline;">settings</a>.',
397
- admin_url( 'admin.php?page=wc-status&tab=connect' )
398
- ) );
 
 
399
 
400
  if ( ! $this->is_valid_package_destination( $package ) ) {
401
- foreach ( $this->package_validation_errors->errors as $code => $messages ) {
402
- $data = $this->package_validation_errors->get_error_data( $code );
403
- foreach ( $messages as $message ) {
404
- wc_add_notice( $message, 'error', $data );
 
 
405
  }
406
  }
407
  return;
@@ -423,7 +426,7 @@ if ( ! class_exists( 'WC_Connect_Shipping_Method' ) ) {
423
  }
424
 
425
  // TODO: Request rates for all WooCommerce Shipping & Tax powered methods in
426
- // the current shipping zone to avoid each method making an independent request
427
  $services = array(
428
  array(
429
  'id' => $this->service_schema->id,
@@ -432,13 +435,13 @@ if ( ! class_exists( 'WC_Connect_Shipping_Method' ) ) {
432
  ),
433
  );
434
 
435
- $custom_boxes = $this->service_settings_store->get_packages();
436
  $predefined_boxes = $this->service_settings_store->get_predefined_packages_for_service( $this->service_schema->id );
437
  $predefined_boxes = array_values( array_filter( $predefined_boxes, array( $this, 'filter_preset_boxes' ) ) );
438
 
439
- $cache_key = sprintf(
440
  'wcs_rates_%s',
441
- md5( serialize( array( $services, $package, $custom_boxes, $predefined_boxes ) ) )
442
  );
443
  $is_debug_mode = 'yes' === get_option( 'woocommerce_shipping_debug_mode', 'no' );
444
  $response_body = get_transient( $cache_key );
@@ -476,24 +479,24 @@ if ( ! class_exists( 'WC_Connect_Shipping_Method' ) ) {
476
  $measurements_format = '(%s x %s x %s ' . $dimension_unit . ', %s ' . $weight_unit . ')';
477
 
478
  foreach ( $rate->packages as $rate_package ) {
479
- $service_ids[] = $rate_package->service_id;
480
 
481
  $item_product_ids = array();
482
  $item_by_product = array();
483
  foreach ( $rate_package->items as $package_item ) {
484
- $item_product_ids[] = $package_item->product_id;
485
  $item_by_product[ $package_item->product_id ] = $package_item;
486
  }
487
 
488
  $product_summaries = array();
489
- $product_counts = array_count_values( $item_product_ids );
490
  foreach ( $product_counts as $product_id => $count ) {
491
  /** @var WC_Product $product */
492
  $product = $this->lookup_product( $package, $product_id );
493
  if ( $product ) {
494
- $item_name = WC_Connect_Compatibility::instance()->get_product_name( $product );
495
- $item = $item_by_product[ $product_id ];
496
- $item_measurements = sprintf( $measurements_format, $item->length, $item->width, $item->height, $item->weight );
497
  $product_summaries[] =
498
  ( $count > 1 ? sprintf( '<em>%d x</em> ', $count ) : '' ) .
499
  sprintf( '(ID: %d) <strong>%s</strong> %s', $product_id, esc_html( $item_name ), esc_html( $item_measurements ) );
@@ -504,13 +507,13 @@ if ( ! class_exists( 'WC_Connect_Shipping_Method' ) ) {
504
 
505
  if ( ! property_exists( $rate_package, 'box_id' ) ) {
506
  $package_name = __( 'Unknown package', 'woocommerce-services' );
507
- } else if ( 'individual' === $rate_package->box_id ) {
508
  $package_name = __( 'Individual packaging', 'woocommerce-services' );
509
- } else if (
510
  isset( $packaging_lookup[ $rate_package->box_id ] ) &&
511
  isset( $packaging_lookup[ $rate_package->box_id ]['name'] )
512
  ) {
513
- $package_name = $packaging_lookup[ $rate_package->box_id ]['name'];
514
  $package_measurements = sprintf(
515
  $measurements_format,
516
  $rate_package->length,
@@ -535,7 +538,7 @@ if ( ! class_exists( 'WC_Connect_Shipping_Method' ) ) {
535
  'label' => self::format_rate_title( $rate->title ),
536
  'cost' => $rate->rate,
537
  'meta_data' => array(
538
- 'wc_connect_packages' => $rate->packages,
539
  __( 'Packaging', 'woocommerce-services' ) => $packaging_info,
540
  'wc_connect_packing_log' => $box_packing_log,
541
  ),
@@ -594,7 +597,7 @@ if ( ! class_exists( 'WC_Connect_Shipping_Method' ) ) {
594
  }
595
 
596
  public function admin_options() {
597
- // hide WP native save button on settings page
598
  global $hide_save_button;
599
  $hide_save_button = true;
600
 
@@ -603,7 +606,7 @@ if ( ! class_exists( 'WC_Connect_Shipping_Method' ) ) {
603
 
604
  /**
605
  * @param string $method_id
606
- * @param int $instance_id
607
  * @param string $service_ids
608
  *
609
  * @return string
@@ -616,11 +619,11 @@ if ( ! class_exists( 'WC_Connect_Shipping_Method' ) ) {
616
  $formatted_title = wp_kses(
617
  html_entity_decode( $rate_title ),
618
  array(
619
- 'sup' => array(),
620
- 'del' => array(),
621
- 'small' => array(),
622
- 'em' => array(),
623
- 'i' => array(),
624
  'strong' => array(),
625
  )
626
  );
@@ -635,7 +638,7 @@ if ( ! class_exists( 'WC_Connect_Shipping_Method' ) ) {
635
  * @param string $type Notice type.
636
  */
637
  public function debug( $message, $type = 'notice' ) {
638
- if ( is_cart() || is_checkout() || isset( $_POST['update_cart'] ) ) {
639
  $debug_message = sprintf( '%s (%s:%d)', $message, esc_html( $this->title ), $this->instance_id );
640
 
641
  $this->logger->debug( $debug_message, $type );
@@ -679,7 +682,7 @@ if ( ! class_exists( 'WC_Connect_Shipping_Method' ) ) {
679
  return true;
680
  }
681
 
682
- // Go through the cart contents and check if all products are supported
683
  foreach ( $package['contents'] as $item ) {
684
  $shipping_class_id = $item['data']->get_shipping_class_id();
685
 
@@ -702,11 +705,13 @@ if ( ! class_exists( 'WC_Connect_Shipping_Method' ) ) {
702
  }
703
  }
704
 
705
- $method_classes = get_terms( array(
706
- 'taxonomy' => 'product_shipping_class',
707
- 'hide_empty' => false,
708
- 'include' => $method_classes,
709
- ) );
 
 
710
 
711
  if ( ! is_wp_error( $method_classes ) && ! empty( $method_classes ) ) {
712
  $class_names = implode( ', ', wp_list_pluck( $method_classes, 'name' ) );
41
  public function __construct( $id_or_instance_id = null ) {
42
  parent::__construct( $id_or_instance_id );
43
 
44
+ // If $arg looks like a number, treat it as an instance_id,
45
+ // otherwise, treat it as a (method) id (e.g. wc_connect_usps).
46
  if ( is_numeric( $id_or_instance_id ) ) {
47
  $this->instance_id = absint( $id_or_instance_id );
48
  } else {
67
  'Error. A WC_Connect_Shipping_Method was constructed without an id or instance_id',
68
  __FUNCTION__
69
  );
70
+ $this->id = 'wc_connect_uninitialized_shipping_method';
71
+ $this->method_title = '';
72
  $this->method_description = '';
73
+ $this->supports = array();
74
+ $this->title = '';
75
  } else {
76
+ $this->id = $this->service_schema->method_id;
77
+ $this->method_title = $this->service_schema->method_title;
78
  $this->method_description = $this->service_schema->method_description;
79
+ $this->supports = array(
80
  'shipping-zones',
81
+ 'instance-settings',
82
  );
83
 
84
+ // Set title to default value.
85
  $this->title = $this->service_schema->method_title;
86
 
87
+ // Load form values from options, updating title if present.
88
  $this->init_form_settings();
89
 
90
  // Note - we cannot hook admin_enqueue_scripts here because we need an instance id
91
  // and this constructor is not called with an instance id until after
92
  // admin_enqueue_scripts has already fired. This is why WC_Connect_Loader
93
+ // does it instead.
94
  }
95
  $this->package_validation_errors = new WP_Error();
96
  }
151
  *
152
  * @see WC_Connect_Logger::debug()
153
  * @param string|WP_Error $message
154
+ * @param string $context
155
  */
156
  protected function log( $message, $context = '' ) {
157
 
175
  /**
176
  * Restores any values persisted to the DB for this service instance
177
  * and sets up title for WC core to work properly
 
178
  */
179
  protected function init_form_settings() {
180
 
181
  $form_settings = $this->get_service_settings();
182
 
183
  // We need to initialize the instance title ($this->title)
184
+ // from the settings blob.
185
  if ( property_exists( $form_settings, 'title' ) ) {
186
  $this->title = $form_settings->title;
187
  }
322
  }
323
 
324
  private function lookup_product( $package, $product_id ) {
325
+ foreach ( $package['contents'] as $item ) {
326
+ if ( $item['product_id'] === $product_id || $item['variation_id'] === $product_id ) {
327
+ return $item['data'];
328
  }
329
  }
330
 
378
  $this->debug( 'No rates found, adding fallback.', 'error' );
379
 
380
  $rate_to_add = array(
381
+ 'id' => self::format_rate_id( 'fallback', $this->id, 0 ),
382
+ 'label' => self::format_rate_title( $this->service_schema->carrier_name ),
383
+ 'cost' => $service_settings->fallback_rate,
384
  );
385
 
386
  $this->add_rate( $rate_to_add );
391
  return;
392
  }
393
 
394
+ $this->debug(
395
+ sprintf(
396
+ 'WooCommerce Shipping & Tax debug mode is on - to hide these messages, turn debug mode off in the <a href="%s" style="text-decoration: underline;">settings</a>.',
397
+ admin_url( 'admin.php?page=wc-status&tab=connect' )
398
+ )
399
+ );
400
 
401
  if ( ! $this->is_valid_package_destination( $package ) ) {
402
+ if ( is_cart() || is_checkout() ) {
403
+ foreach ( $this->package_validation_errors->errors as $code => $messages ) {
404
+ $data = $this->package_validation_errors->get_error_data( $code );
405
+ foreach ( $messages as $message ) {
406
+ wc_add_notice( $message, 'error', $data );
407
+ }
408
  }
409
  }
410
  return;
426
  }
427
 
428
  // TODO: Request rates for all WooCommerce Shipping & Tax powered methods in
429
+ // the current shipping zone to avoid each method making an independent request.
430
  $services = array(
431
  array(
432
  'id' => $this->service_schema->id,
435
  ),
436
  );
437
 
438
+ $custom_boxes = $this->service_settings_store->get_packages();
439
  $predefined_boxes = $this->service_settings_store->get_predefined_packages_for_service( $this->service_schema->id );
440
  $predefined_boxes = array_values( array_filter( $predefined_boxes, array( $this, 'filter_preset_boxes' ) ) );
441
 
442
+ $cache_key = sprintf(
443
  'wcs_rates_%s',
444
+ md5( serialize( array( $services, $package, $custom_boxes, $predefined_boxes ) ) ) // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.serialize_serialize
445
  );
446
  $is_debug_mode = 'yes' === get_option( 'woocommerce_shipping_debug_mode', 'no' );
447
  $response_body = get_transient( $cache_key );
479
  $measurements_format = '(%s x %s x %s ' . $dimension_unit . ', %s ' . $weight_unit . ')';
480
 
481
  foreach ( $rate->packages as $rate_package ) {
482
+ $service_ids[] = $rate_package->service_id;
483
 
484
  $item_product_ids = array();
485
  $item_by_product = array();
486
  foreach ( $rate_package->items as $package_item ) {
487
+ $item_product_ids[] = $package_item->product_id;
488
  $item_by_product[ $package_item->product_id ] = $package_item;
489
  }
490
 
491
  $product_summaries = array();
492
+ $product_counts = array_count_values( $item_product_ids );
493
  foreach ( $product_counts as $product_id => $count ) {
494
  /** @var WC_Product $product */
495
  $product = $this->lookup_product( $package, $product_id );
496
  if ( $product ) {
497
+ $item_name = WC_Connect_Compatibility::instance()->get_product_name( $product );
498
+ $item = $item_by_product[ $product_id ];
499
+ $item_measurements = sprintf( $measurements_format, $item->length, $item->width, $item->height, $item->weight );
500
  $product_summaries[] =
501
  ( $count > 1 ? sprintf( '<em>%d x</em> ', $count ) : '' ) .
502
  sprintf( '(ID: %d) <strong>%s</strong> %s', $product_id, esc_html( $item_name ), esc_html( $item_measurements ) );
507
 
508
  if ( ! property_exists( $rate_package, 'box_id' ) ) {
509
  $package_name = __( 'Unknown package', 'woocommerce-services' );
510
+ } elseif ( 'individual' === $rate_package->box_id ) {
511
  $package_name = __( 'Individual packaging', 'woocommerce-services' );
512
+ } elseif (
513
  isset( $packaging_lookup[ $rate_package->box_id ] ) &&
514
  isset( $packaging_lookup[ $rate_package->box_id ]['name'] )
515
  ) {
516
+ $package_name = $packaging_lookup[ $rate_package->box_id ]['name'];
517
  $package_measurements = sprintf(
518
  $measurements_format,
519
  $rate_package->length,
538
  'label' => self::format_rate_title( $rate->title ),
539
  'cost' => $rate->rate,
540
  'meta_data' => array(
541
+ 'wc_connect_packages' => $rate->packages,
542
  __( 'Packaging', 'woocommerce-services' ) => $packaging_info,
543
  'wc_connect_packing_log' => $box_packing_log,
544
  ),
597
  }
598
 
599
  public function admin_options() {
600
+ // hide WP native save button on settings page.
601
  global $hide_save_button;
602
  $hide_save_button = true;
603
 
606
 
607
  /**
608
  * @param string $method_id
609
+ * @param int $instance_id
610
  * @param string $service_ids
611
  *
612
  * @return string
619
  $formatted_title = wp_kses(
620
  html_entity_decode( $rate_title ),
621
  array(
622
+ 'sup' => array(),
623
+ 'del' => array(),
624
+ 'small' => array(),
625
+ 'em' => array(),
626
+ 'i' => array(),
627
  'strong' => array(),
628
  )
629
  );
638
  * @param string $type Notice type.
639
  */
640
  public function debug( $message, $type = 'notice' ) {
641
+ if ( is_cart() || is_checkout() || isset( $_POST['update_cart'] ) || WC_Connect_Functions::has_cart_or_checkout_block() ) {
642
  $debug_message = sprintf( '%s (%s:%d)', $message, esc_html( $this->title ), $this->instance_id );
643
 
644
  $this->logger->debug( $debug_message, $type );
682
  return true;
683
  }
684
 
685
+ // Go through the cart contents and check if all products are supported.
686
  foreach ( $package['contents'] as $item ) {
687
  $shipping_class_id = $item['data']->get_shipping_class_id();
688
 
705
  }
706
  }
707
 
708
+ $method_classes = get_terms(
709
+ array(
710
+ 'taxonomy' => 'product_shipping_class',
711
+ 'hide_empty' => false,
712
+ 'include' => $method_classes,
713
+ )
714
+ );
715
 
716
  if ( ! is_wp_error( $method_classes ) && ! empty( $method_classes ) ) {
717
  $class_names = implode( ', ', wp_list_pluck( $method_classes, 'name' ) );
classes/class-wc-connect-taxjar-integration.php CHANGED
@@ -16,21 +16,21 @@ class WC_Connect_TaxJar_Integration {
16
 
17
  private $expected_options = array(
18
  // If automated taxes are enabled and user disables taxes we re-enable them
19
- 'woocommerce_calc_taxes' => 'yes',
20
  // Users can set either billing or shipping address for tax rates but not shop
21
- 'woocommerce_tax_based_on' => 'shipping',
22
  // Rate calculations assume tax not included
23
- 'woocommerce_prices_include_tax' => 'no',
24
  // Use no special handling on shipping taxes, our API handles that
25
- 'woocommerce_shipping_tax_class' => '',
26
  // API handles rounding precision
27
  'woocommerce_tax_round_at_subtotal' => 'no',
28
  // Rates are calculated in the cart assuming tax not included
29
- 'woocommerce_tax_display_shop' => 'excl',
30
  // TaxJar returns one total amount, not line item amounts
31
- 'woocommerce_tax_display_cart' => 'excl',
32
  // TaxJar returns one total amount, not line item amounts
33
- 'woocommerce_tax_total_display' => 'single',
34
  );
35
 
36
  const PROXY_PATH = 'taxjar/v2';
@@ -42,8 +42,8 @@ class WC_Connect_TaxJar_Integration {
42
  WC_Connect_Logger $logger,
43
  $wc_connect_base_url
44
  ) {
45
- $this->api_client = $api_client;
46
- $this->logger = $logger;
47
  $this->wc_connect_base_url = $wc_connect_base_url;
48
 
49
  // Cache rates for 1 hour.
@@ -69,7 +69,7 @@ class WC_Connect_TaxJar_Integration {
69
 
70
  // Fix tooltip with link on older WC.
71
  if ( version_compare( WOOCOMMERCE_VERSION, '4.4.0', '<' ) ) {
72
- add_action( 'admin_enqueue_scripts', array( $this, 'fix_tooltip_keepalive'), 11 );
73
  }
74
 
75
  // Settings values filter to handle the hardcoded settings
@@ -80,7 +80,6 @@ class WC_Connect_TaxJar_Integration {
80
  return;
81
  }
82
 
83
-
84
  // Scripts / Stylesheets
85
  add_action( 'admin_enqueue_scripts', array( $this, 'load_taxjar_admin_new_order_assets' ) );
86
 
@@ -153,7 +152,7 @@ class WC_Connect_TaxJar_Integration {
153
  if ( ! array_key_exists( $tax_setting['id'], $this->expected_options ) ) {
154
  continue;
155
  }
156
- $tax_settings[$index]['custom_attributes'] = array( 'disabled' => true );
157
  }
158
  }
159
 
@@ -165,10 +164,10 @@ class WC_Connect_TaxJar_Integration {
165
  */
166
  private function get_tax_tooltip() {
167
  $store_settings = $this->get_store_settings();
168
- $all_states = WC()->countries->get_states( $store_settings['country'] );
169
- $all_countries = WC()->countries->get_countries();
170
- $full_country = $all_countries[ $store_settings['country'] ];
171
- $full_state = isset( $all_states[ $store_settings['state'] ] ) ? $all_states[ $store_settings['state'] ] : '';
172
  if ( $full_state ) {
173
  /* translators: 1: Full state name 2: full country name */
174
  return sprintf( __( 'Your tax rates and settings will be automatically configured for %1$s, %2$s. <a href="https://docs.woocommerce.com/document/setting-up-taxes-in-woocommerce/#section-12">Learn more about setting up tax rates for additional nexuses</a>', 'woocommerce-services' ), $full_state, $full_country );
@@ -215,22 +214,22 @@ class WC_Connect_TaxJar_Integration {
215
  */
216
  public function sanitize_tax_option( $value, $option ) {
217
  if (
218
- //skip unrecognized option format
219
  ! is_array( $option )
220
- //skip if unexpected option format
221
  || ! isset( $option['id'] )
222
- //skip if not enabled or not being enabled in the current request
223
- || ! $this->is_enabled() && ( ! isset( $_POST[self::OPTION_NAME] ) || 'yes' != $_POST[self::OPTION_NAME] ) ) {
224
  return $value;
225
  }
226
 
227
- //the option is currently being enabled - backup the rates and flush the rates table
228
  if ( ! $this->is_enabled() && self::OPTION_NAME === $option['id'] && 'yes' === $value ) {
229
  $this->backup_existing_tax_rates();
230
  return $value;
231
  }
232
 
233
- //skip if unexpected option
234
  if ( ! array_key_exists( $option['id'], $this->expected_options ) ) {
235
  return $value;
236
  }
@@ -245,8 +244,8 @@ class WC_Connect_TaxJar_Integration {
245
  * See: https://github.com/taxjar/taxjar-woocommerce-plugin/blob/82bf7c58/includes/class-wc-taxjar-integration.php#L66-L91
246
  */
247
  public function configure_tax_settings() {
248
- foreach( $this->expected_options as $option => $value ) {
249
- //first check the option value - with default memory caching this should help to avoid unnecessary DB operations
250
  if ( get_option( $option ) !== $value ) {
251
  update_option( $option, $value );
252
  }
@@ -284,11 +283,11 @@ class WC_Connect_TaxJar_Integration {
284
  * @return array
285
  */
286
  public function get_store_settings() {
287
- $store_settings = array(
288
- 'street' => WC()->countries->get_base_address(),
289
- 'city' => WC()->countries->get_base_city(),
290
- 'state' => WC()->countries->get_base_state(),
291
- 'country' => WC()->countries->get_base_country(),
292
  'postcode' => WC()->countries->get_base_postcode(),
293
  );
294
 
@@ -310,11 +309,11 @@ class WC_Connect_TaxJar_Integration {
310
  public function _error( $message ) {
311
  $formatted_message = is_scalar( $message ) ? $message : json_encode( $message );
312
 
313
- //ignore error messages caused by customer input
314
  $state_zip_mismatch = false !== strpos( $formatted_message, 'to_zip' ) && false !== strpos( $formatted_message, 'is not used within to_state' );
315
- $invalid_postcode = false !== strpos( $formatted_message, 'isn\'t a valid postal code for' );
316
  if ( ! is_admin() && ( $state_zip_mismatch || $invalid_postcode ) ) {
317
- $fields = WC()->countries->get_address_fields();
318
  $postcode_field_name = __( 'ZIP/Postal code', 'woocommerce-services' );
319
  if ( isset( $fields['billing_postcode'] ) && isset( $fields['billing_postcode']['label'] ) ) {
320
  $postcode_field_name = $fields['billing_postcode']['label'];
@@ -358,12 +357,23 @@ class WC_Connect_TaxJar_Integration {
358
  * @return void
359
  */
360
  public function calculate_totals( $wc_cart_object ) {
361
- // If outside of cart and checkout page or within mini-cart, skip calculations
362
- if ( ( ! is_cart() && ! is_checkout() ) || ( is_cart() && is_ajax() ) ) {
 
 
 
 
 
 
 
 
 
 
 
363
  return;
364
  }
365
 
366
- $cart_taxes = array();
367
  $cart_tax_total = 0;
368
 
369
  foreach ( $wc_cart_object->coupons as $coupon ) {
@@ -376,38 +386,40 @@ class WC_Connect_TaxJar_Integration {
376
  }
377
  }
378
 
379
- $address = $this->get_address( $wc_cart_object );
380
  $line_items = $this->get_line_items( $wc_cart_object );
381
 
382
- $taxes = $this->calculate_tax( array(
383
- 'to_country' => $address['to_country'],
384
- 'to_zip' => $address['to_zip'],
385
- 'to_state' => $address['to_state'],
386
- 'to_city' => $address['to_city'],
387
- 'to_street' => $address['to_street'],
388
- 'shipping_amount' => WC()->shipping->shipping_total,
389
- 'line_items' => $line_items,
390
- ) );
 
 
391
 
392
  // Return if taxes could not be calculated.
393
  if ( false === $taxes ) {
394
  return;
395
  }
396
 
397
- $this->response_rate_ids = $taxes['rate_ids'];
398
  $this->response_line_items = $taxes['line_items'];
399
 
400
  if ( isset( $this->response_line_items ) ) {
401
  foreach ( $this->response_line_items as $response_line_item_key => $response_line_item ) {
402
  $line_item = $this->get_line_item( $response_line_item_key, $line_items );
403
- if ( isset( $line_item ) ) {
404
  $this->response_line_items[ $response_line_item_key ]->line_total = ( $line_item['unit_price'] * $line_item['quantity'] ) - $line_item['discount'];
405
  }
406
  }
407
  }
408
 
409
  foreach ( $wc_cart_object->get_cart() as $cart_item_key => $cart_item ) {
410
- $product = $cart_item['data'];
411
  $line_item_key = $product->get_id() . '-' . $cart_item_key;
412
  if ( isset( $taxes['line_items'][ $line_item_key ] ) && ! $taxes['line_items'][ $line_item_key ]->combined_tax_rate ) {
413
  if ( method_exists( $product, 'set_tax_status' ) ) {
@@ -446,29 +458,31 @@ class WC_Connect_TaxJar_Integration {
446
  * @return void
447
  */
448
  public function calculate_backend_totals( $order_id ) {
449
- $order = wc_get_order( $order_id );
450
- $address = $this->get_backend_address();
451
  $line_items = $this->get_backend_line_items( $order );
452
  if ( method_exists( $order, 'get_shipping_total' ) ) {
453
  $shipping = $order->get_shipping_total(); // Woo 3.0+
454
  } else {
455
  $shipping = $order->get_total_shipping(); // Woo 2.6
456
  }
457
- $taxes = $this->calculate_tax( array(
458
- 'to_country' => $address['to_country'],
459
- 'to_state' => $address['to_state'],
460
- 'to_zip' => $address['to_zip'],
461
- 'to_city' => $address['to_city'],
462
- 'to_street' => $address['to_street'],
463
- 'shipping_amount' => $shipping,
464
- 'line_items' => $line_items,
465
- ) );
 
 
466
  if ( class_exists( 'WC_Order_Item_Tax' ) ) { // Add tax rates manually for Woo 3.0+
467
  foreach ( $order->get_items() as $item_key => $item ) {
468
- $product_id = $item->get_product_id();
469
  $line_item_key = $product_id . '-' . $item_key;
470
  if ( isset( $taxes['rate_ids'][ $line_item_key ] ) ) {
471
- $rate_id = $taxes['rate_ids'][ $line_item_key ];
472
  $item_tax = new WC_Order_Item_Tax();
473
  $item_tax->set_rate( $rate_id );
474
  $item_tax->set_order_id( $order_id );
@@ -499,24 +513,24 @@ class WC_Connect_TaxJar_Integration {
499
  $taxable_address = is_array( $taxable_address ) ? $taxable_address : array();
500
 
501
  $to_country = isset( $taxable_address[0] ) && ! empty( $taxable_address[0] ) ? $taxable_address[0] : false;
502
- $to_state = isset( $taxable_address[1] ) && ! empty( $taxable_address[1] ) ? $taxable_address[1] : false;
503
- $to_zip = isset( $taxable_address[2] ) && ! empty( $taxable_address[2] ) ? $taxable_address[2] : false;
504
- $to_city = isset( $taxable_address[3] ) && ! empty( $taxable_address[3] ) ? $taxable_address[3] : false;
505
- $to_street = isset( $taxable_address[4] ) && ! empty( $taxable_address[4] ) ? $taxable_address[4] : false;
506
 
507
  return array(
508
  'to_country' => $to_country,
509
- 'to_state' => $to_state,
510
- 'to_zip' => $to_zip,
511
- 'to_city' => $to_city,
512
- 'to_street' => $to_street,
513
  );
514
  }
515
 
516
  /**
517
  * Allow street address to be passed when finding rates
518
  *
519
- * @param array $matched_tax_rates
520
  * @param string $tax_class
521
  * @return array
522
  */
@@ -524,26 +538,29 @@ class WC_Connect_TaxJar_Integration {
524
  $tax_class = sanitize_title( $tax_class );
525
  $location = WC_Tax::get_tax_location( $tax_class );
526
  $matched_tax_rates = array();
527
- if ( sizeof( $location ) >= 4 ) {
528
  list( $country, $state, $postcode, $city, $street ) = array_pad( $location, 5, '' );
529
- $matched_tax_rates = WC_Tax::find_rates( array(
530
- 'country' => $country,
531
- 'state' => $state,
532
- 'postcode' => $postcode,
533
- 'city' => $city,
534
- 'tax_class' => $tax_class,
535
- ) );
 
 
536
  }
537
- return $matched_tax_rates;
538
  }
539
 
540
  /**
541
  * Get taxable address.
 
542
  * @return array
543
  */
544
  public function get_taxable_address() {
545
  $tax_based_on = get_option( 'woocommerce_tax_based_on' );
546
- // Check shipping method at this point to see if we need special handling
547
  // See WC_Customer get_taxable_address()
548
  // wc_get_chosen_shipping_method_ids() available since Woo 2.6.2+
549
  if ( function_exists( 'wc_get_chosen_shipping_method_ids' ) ) {
@@ -558,11 +575,11 @@ class WC_Connect_TaxJar_Integration {
558
 
559
  if ( 'base' === $tax_based_on ) {
560
  $store_settings = $this->get_store_settings();
561
- $country = $store_settings['country'];
562
- $state = $store_settings['state'];
563
- $postcode = $store_settings['postcode'];
564
- $city = $store_settings['city'];
565
- $street = $store_settings['street'];
566
  } elseif ( 'billing' === $tax_based_on ) {
567
  $country = WC()->customer->get_billing_country();
568
  $state = WC()->customer->get_billing_state();
@@ -577,7 +594,7 @@ class WC_Connect_TaxJar_Integration {
577
  $street = WC()->customer->get_shipping_address();
578
  }
579
 
580
- return apply_filters( 'woocommerce_customer_taxable_address', array( $country, $state, $postcode, $city, $street ) );
581
  }
582
 
583
  /**
@@ -590,17 +607,17 @@ class WC_Connect_TaxJar_Integration {
590
  */
591
  protected function get_backend_address() {
592
  $to_country = isset( $_POST['country'] ) ? strtoupper( wc_clean( $_POST['country'] ) ) : false;
593
- $to_state = isset( $_POST['state'] ) ? strtoupper( wc_clean( $_POST['state'] ) ) : false;
594
- $to_zip = isset( $_POST['postcode'] ) ? strtoupper( wc_clean( $_POST['postcode'] ) ) : false;
595
- $to_city = isset( $_POST['city'] ) ? strtoupper( wc_clean( $_POST['city'] ) ) : false;
596
- $to_street = isset( $_POST['street'] ) ? strtoupper( wc_clean( $_POST['street'] ) ) : false;
597
 
598
  return array(
599
  'to_country' => $to_country,
600
- 'to_state' => $to_state,
601
- 'to_zip' => $to_zip,
602
- 'to_city' => $to_city,
603
- 'to_street' => $to_street,
604
  );
605
  }
606
 
@@ -616,14 +633,14 @@ class WC_Connect_TaxJar_Integration {
616
  $line_items = array();
617
 
618
  foreach ( $wc_cart_object->get_cart() as $cart_item_key => $cart_item ) {
619
- $product = $cart_item['data'];
620
- $id = $product->get_id();
621
- $quantity = $cart_item['quantity'];
622
- $unit_price = wc_format_decimal( $product->get_price() );
623
  $line_subtotal = wc_format_decimal( $cart_item['line_subtotal'] );
624
- $discount = wc_format_decimal( $cart_item['line_subtotal'] - $cart_item['line_total'] );
625
- $tax_class = explode( '-', $product->get_tax_class() );
626
- $tax_code = '';
627
 
628
  if ( isset( $tax_class ) && is_numeric( end( $tax_class ) ) ) {
629
  $tax_code = end( $tax_class );
@@ -644,13 +661,16 @@ class WC_Connect_TaxJar_Integration {
644
  }
645
 
646
  if ( $unit_price && $line_subtotal ) {
647
- array_push($line_items, array(
648
- 'id' => $id . '-' . $cart_item_key,
649
- 'quantity' => $quantity,
650
- 'product_tax_code' => $tax_code,
651
- 'unit_price' => $unit_price,
652
- 'discount' => $discount,
653
- ));
 
 
 
654
  }
655
  }
656
 
@@ -666,28 +686,28 @@ class WC_Connect_TaxJar_Integration {
666
  * @return array
667
  */
668
  protected function get_backend_line_items( $order ) {
669
- $line_items = array();
670
  $this->backend_tax_classes = array();
671
  foreach ( $order->get_items() as $item_key => $item ) {
672
  if ( is_object( $item ) ) { // Woo 3.0+
673
- $id = $item->get_product_id();
674
- $quantity = $item->get_quantity();
675
- $unit_price = wc_format_decimal( $item->get_subtotal() / $quantity );
676
- $discount = wc_format_decimal( $item->get_subtotal() - $item->get_total() );
677
  $tax_class_name = $item->get_tax_class();
678
- $tax_status = $item->get_tax_status();
679
  } else { // Woo 2.6
680
- $id = $item['product_id'];
681
- $quantity = $item['qty'];
682
- $unit_price = wc_format_decimal( $item['line_subtotal'] / $quantity );
683
- $discount = wc_format_decimal( $item['line_subtotal'] - $item['line_total'] );
684
  $tax_class_name = $item['tax_class'];
685
- $product = $order->get_product_from_item( $item );
686
- $tax_status = $product ? $product->get_tax_status() : 'taxable';
687
  }
688
- $this->backend_tax_classes[$id] = $tax_class_name;
689
- $tax_class = explode( '-', $tax_class_name );
690
- $tax_code = '';
691
  if ( isset( $tax_class[1] ) && is_numeric( $tax_class[1] ) ) {
692
  $tax_code = $tax_class[1];
693
  }
@@ -695,13 +715,16 @@ class WC_Connect_TaxJar_Integration {
695
  $tax_code = '99999';
696
  }
697
  if ( $unit_price ) {
698
- array_push($line_items, array(
699
- 'id' => $id . '-' . $item_key,
700
- 'quantity' => $quantity,
701
- 'product_tax_code' => $tax_code,
702
- 'unit_price' => $unit_price,
703
- 'discount' => $discount,
704
- ));
 
 
 
705
  }
706
  }
707
  return $line_items;
@@ -713,7 +736,7 @@ class WC_Connect_TaxJar_Integration {
713
  return $line_item;
714
  }
715
  }
716
- return null;
717
  }
718
 
719
  /**
@@ -728,9 +751,9 @@ class WC_Connect_TaxJar_Integration {
728
  public function override_woocommerce_tax_rates( $taxes, $price, $rates ) {
729
  if ( isset( $this->response_line_items ) && array_values( $rates ) ) {
730
  // Get tax rate ID for current item
731
- $keys = array_keys( $taxes );
732
  $tax_rate_id = $keys[0];
733
- $line_items = array();
734
 
735
  // Map line items using rate ID
736
  foreach ( $this->response_rate_ids as $line_item_key => $rate_id ) {
@@ -786,9 +809,9 @@ class WC_Connect_TaxJar_Integration {
786
 
787
  if ( 'base' == $tax_based_on ) {
788
  $store_settings = $this->get_store_settings();
789
- $postcode = $store_settings['postcode'];
790
- $city = strtoupper( $store_settings['city'] );
791
- $street = $store_settings['street'];
792
  }
793
 
794
  if ( '' != $street ) {
@@ -806,7 +829,6 @@ class WC_Connect_TaxJar_Integration {
806
  * Direct from the TaxJar plugin, without Nexus check.
807
  * See: https://github.com/taxjar/taxjar-woocommerce-plugin/blob/96b5d57/includes/class-wc-taxjar-integration.php#L247
808
  *
809
- *
810
  * @return void
811
  */
812
  public function calculate_tax( $options = array() ) {
@@ -815,25 +837,30 @@ class WC_Connect_TaxJar_Integration {
815
  // Process $options array and turn them into variables
816
  $options = is_array( $options ) ? $options : array();
817
 
818
- extract( array_replace_recursive(array(
819
- 'to_country' => null,
820
- 'to_state' => null,
821
- 'to_zip' => null,
822
- 'to_city' => null,
823
- 'to_street' => null,
824
- 'shipping_amount' => null, // WC()->shipping->shipping_total
825
- 'line_items' => null,
826
- ), $options) );
 
 
 
 
 
827
 
828
  $taxes = array(
829
  'freight_taxable' => 1,
830
- 'has_nexus' => 0,
831
- 'line_items' => array(),
832
- 'rate_ids' => array(),
833
- 'tax_rate' => 0,
834
  );
835
 
836
- // Strict conditions to be met before API call can be conducted
837
  if (
838
  empty( $to_country ) ||
839
  empty( $to_zip ) ||
@@ -843,32 +870,32 @@ class WC_Connect_TaxJar_Integration {
843
  return false;
844
  }
845
 
846
- $to_zip = explode( ',' , $to_zip );
847
- $to_zip = array_shift( $to_zip );
848
 
849
- $store_settings = $this->get_store_settings();
850
- $from_country = $store_settings['country'];
851
- $from_state = $store_settings['state'];
852
- $from_zip = $store_settings['postcode'];
853
- $from_city = $store_settings['city'];
854
- $from_street = $store_settings['street'];
855
- $shipping_amount = is_null( $shipping_amount ) ? 0.0 : $shipping_amount;
856
 
857
  $this->_log( ':::: TaxJar API called ::::' );
858
 
859
  $body = array(
860
  'from_country' => $from_country,
861
- 'from_state' => $from_state,
862
- 'from_zip' => $from_zip,
863
- 'from_city' => $from_city,
864
- 'from_street' => $from_street,
865
- 'to_country' => $to_country,
866
- 'to_state' => $to_state,
867
- 'to_zip' => $to_zip,
868
- 'to_city' => $to_city,
869
- 'to_street' => $to_street,
870
- 'shipping' => $shipping_amount,
871
- 'plugin' => 'woo',
872
  );
873
 
874
  // Either `amount` or `line_items` parameters are required to perform tax calculations.
@@ -885,13 +912,13 @@ class WC_Connect_TaxJar_Integration {
885
  $this->_log( 'Received: ' . $response['body'] );
886
 
887
  // Decode Response
888
- $taxjar_response = json_decode( $response['body'] );
889
- $taxjar_response = $taxjar_response->tax;
890
 
891
  // Update Properties based on Response
892
- $taxes['freight_taxable'] = (int) $taxjar_response->freight_taxable;
893
- $taxes['has_nexus'] = (int) $taxjar_response->has_nexus;
894
- $taxes['tax_rate'] = $taxjar_response->rate;
895
 
896
  if ( ! empty( $taxjar_response->breakdown ) ) {
897
  if ( ! empty( $taxjar_response->breakdown->line_items ) ) {
@@ -911,9 +938,9 @@ class WC_Connect_TaxJar_Integration {
911
  // Use Woo core to find matching rates for taxable address
912
  $location = array(
913
  'to_country' => $to_country,
914
- 'to_state' => $to_state,
915
- 'to_zip' => $to_zip,
916
- 'to_city' => $to_city,
917
  );
918
 
919
  if ( 'GB' === $to_country ) {
@@ -923,14 +950,14 @@ class WC_Connect_TaxJar_Integration {
923
  // Add line item tax rates
924
  foreach ( $taxes['line_items'] as $line_item_key => $line_item ) {
925
  $line_item_key_chunks = explode( '-', $line_item_key );
926
- $product_id = $line_item_key_chunks[0];
927
- $product = wc_get_product( $product_id );
928
 
929
  if ( $product ) {
930
  $tax_class = $product->get_tax_class();
931
  } else {
932
- if ( isset( $this->backend_tax_classes[$product_id] ) ) {
933
- $tax_class = $this->backend_tax_classes[$product_id];
934
  }
935
  }
936
 
@@ -968,23 +995,25 @@ class WC_Connect_TaxJar_Integration {
968
  */
969
  public function create_or_update_tax_rate( $location, $rate, $tax_class = '', $freight_taxable = 1 ) {
970
  $tax_rate = array(
971
- 'tax_rate_country' => $location['to_country'],
972
- 'tax_rate_state' => $location['to_state'],
973
- 'tax_rate_name' => sprintf( "%s Tax", $location['to_state'] ),
974
  'tax_rate_priority' => 1,
975
  'tax_rate_compound' => false,
976
  'tax_rate_shipping' => $freight_taxable,
977
- 'tax_rate' => $rate,
978
- 'tax_rate_class' => $tax_class,
979
  );
980
 
981
- $wc_rate = WC_Tax::find_rates( array(
982
- 'country' => $location['to_country'],
983
- 'state' => $location['to_state'],
984
- 'postcode' => $location['to_zip'],
985
- 'city' => $location['to_city'],
986
- 'tax_class' => $tax_class,
987
- ) );
 
 
988
 
989
  if ( ! empty( $wc_rate ) ) {
990
  $this->_log( ':: Tax Rate Found ::' );
@@ -1051,13 +1080,16 @@ class WC_Connect_TaxJar_Integration {
1051
 
1052
  $this->_log( 'Requesting: ' . $path . ' - ' . $json );
1053
 
1054
- $response = $this->api_client->proxy_request( $path, array(
1055
- 'method' => 'POST',
1056
- 'headers' => array(
1057
- 'Content-Type' => 'application/json',
1058
- ),
1059
- 'body' => $json,
1060
- ) );
 
 
 
1061
 
1062
  if ( is_wp_error( $response ) ) {
1063
  $this->_error( 'Error retrieving the tax rates. Received (' . $response->get_error_code() . '): ' . $response->get_error_message() );
@@ -1078,14 +1110,16 @@ class WC_Connect_TaxJar_Integration {
1078
  global $wpdb;
1079
 
1080
  // Export Tax Rates
1081
- $rates = $wpdb->get_results( $wpdb->prepare(
1082
- "SELECT * FROM {$wpdb->prefix}woocommerce_tax_rates
 
1083
  ORDER BY tax_rate_order
1084
  LIMIT %d, %d
1085
  ",
1086
- 0,
1087
- 10000
1088
- ) );
 
1089
 
1090
  ob_start();
1091
  $header =
16
 
17
  private $expected_options = array(
18
  // If automated taxes are enabled and user disables taxes we re-enable them
19
+ 'woocommerce_calc_taxes' => 'yes',
20
  // Users can set either billing or shipping address for tax rates but not shop
21
+ 'woocommerce_tax_based_on' => 'shipping',
22
  // Rate calculations assume tax not included
23
+ 'woocommerce_prices_include_tax' => 'no',
24
  // Use no special handling on shipping taxes, our API handles that
25
+ 'woocommerce_shipping_tax_class' => '',
26
  // API handles rounding precision
27
  'woocommerce_tax_round_at_subtotal' => 'no',
28
  // Rates are calculated in the cart assuming tax not included
29
+ 'woocommerce_tax_display_shop' => 'excl',
30
  // TaxJar returns one total amount, not line item amounts
31
+ 'woocommerce_tax_display_cart' => 'excl',
32
  // TaxJar returns one total amount, not line item amounts
33
+ 'woocommerce_tax_total_display' => 'single',
34
  );
35
 
36
  const PROXY_PATH = 'taxjar/v2';
42
  WC_Connect_Logger $logger,
43
  $wc_connect_base_url
44
  ) {
45
+ $this->api_client = $api_client;
46
+ $this->logger = $logger;
47
  $this->wc_connect_base_url = $wc_connect_base_url;
48
 
49
  // Cache rates for 1 hour.
69
 
70
  // Fix tooltip with link on older WC.
71
  if ( version_compare( WOOCOMMERCE_VERSION, '4.4.0', '<' ) ) {
72
+ add_action( 'admin_enqueue_scripts', array( $this, 'fix_tooltip_keepalive' ), 11 );
73
  }
74
 
75
  // Settings values filter to handle the hardcoded settings
80
  return;
81
  }
82
 
 
83
  // Scripts / Stylesheets
84
  add_action( 'admin_enqueue_scripts', array( $this, 'load_taxjar_admin_new_order_assets' ) );
85
 
152
  if ( ! array_key_exists( $tax_setting['id'], $this->expected_options ) ) {
153
  continue;
154
  }
155
+ $tax_settings[ $index ]['custom_attributes'] = array( 'disabled' => true );
156
  }
157
  }
158
 
164
  */
165
  private function get_tax_tooltip() {
166
  $store_settings = $this->get_store_settings();
167
+ $all_states = WC()->countries->get_states( $store_settings['country'] );
168
+ $all_countries = WC()->countries->get_countries();
169
+ $full_country = $all_countries[ $store_settings['country'] ];
170
+ $full_state = isset( $all_states[ $store_settings['state'] ] ) ? $all_states[ $store_settings['state'] ] : '';
171
  if ( $full_state ) {
172
  /* translators: 1: Full state name 2: full country name */
173
  return sprintf( __( 'Your tax rates and settings will be automatically configured for %1$s, %2$s. <a href="https://docs.woocommerce.com/document/setting-up-taxes-in-woocommerce/#section-12">Learn more about setting up tax rates for additional nexuses</a>', 'woocommerce-services' ), $full_state, $full_country );
214
  */
215
  public function sanitize_tax_option( $value, $option ) {
216
  if (
217
+ // skip unrecognized option format
218
  ! is_array( $option )
219
+ // skip if unexpected option format
220
  || ! isset( $option['id'] )
221
+ // skip if not enabled or not being enabled in the current request
222
+ || ! $this->is_enabled() && ( ! isset( $_POST[ self::OPTION_NAME ] ) || 'yes' != $_POST[ self::OPTION_NAME ] ) ) {
223
  return $value;
224
  }
225
 
226
+ // the option is currently being enabled - backup the rates and flush the rates table
227
  if ( ! $this->is_enabled() && self::OPTION_NAME === $option['id'] && 'yes' === $value ) {
228
  $this->backup_existing_tax_rates();
229
  return $value;
230
  }
231
 
232
+ // skip if unexpected option
233
  if ( ! array_key_exists( $option['id'], $this->expected_options ) ) {
234
  return $value;
235
  }
244
  * See: https://github.com/taxjar/taxjar-woocommerce-plugin/blob/82bf7c58/includes/class-wc-taxjar-integration.php#L66-L91
245
  */
246
  public function configure_tax_settings() {
247
+ foreach ( $this->expected_options as $option => $value ) {
248
+ // first check the option value - with default memory caching this should help to avoid unnecessary DB operations
249
  if ( get_option( $option ) !== $value ) {
250
  update_option( $option, $value );
251
  }
283
  * @return array
284
  */
285
  public function get_store_settings() {
286
+ $store_settings = array(
287
+ 'street' => WC()->countries->get_base_address(),
288
+ 'city' => WC()->countries->get_base_city(),
289
+ 'state' => WC()->countries->get_base_state(),
290
+ 'country' => WC()->countries->get_base_country(),
291
  'postcode' => WC()->countries->get_base_postcode(),
292
  );
293
 
309
  public function _error( $message ) {
310
  $formatted_message = is_scalar( $message ) ? $message : json_encode( $message );
311
 
312
+ // ignore error messages caused by customer input
313
  $state_zip_mismatch = false !== strpos( $formatted_message, 'to_zip' ) && false !== strpos( $formatted_message, 'is not used within to_state' );
314
+ $invalid_postcode = false !== strpos( $formatted_message, 'isn\'t a valid postal code for' );
315
  if ( ! is_admin() && ( $state_zip_mismatch || $invalid_postcode ) ) {
316
+ $fields = WC()->countries->get_address_fields();
317
  $postcode_field_name = __( 'ZIP/Postal code', 'woocommerce-services' );
318
  if ( isset( $fields['billing_postcode'] ) && isset( $fields['billing_postcode']['label'] ) ) {
319
  $postcode_field_name = $fields['billing_postcode']['label'];
357
  * @return void
358
  */
359
  public function calculate_totals( $wc_cart_object ) {
360
+ /*
361
+ * Don't calculate if we are outside cart and checkout page, or pages with WooCommerce Cart and Checkout blocks.
362
+ * Don't calculate if we are inside mini-cart.
363
+ * If this is an API call don't calculate unless this is store/cart request.
364
+ */
365
+ if (
366
+ ! WC_Connect_Functions::has_cart_or_checkout_block() &&
367
+ ! WC_Connect_Functions::is_store_api_call() &&
368
+ (
369
+ ( ! is_cart() && ! is_checkout() ) ||
370
+ ( is_cart() && is_ajax() )
371
+ )
372
+ ) {
373
  return;
374
  }
375
 
376
+ $cart_taxes = array();
377
  $cart_tax_total = 0;
378
 
379
  foreach ( $wc_cart_object->coupons as $coupon ) {
386
  }
387
  }
388
 
389
+ $address = $this->get_address( $wc_cart_object );
390
  $line_items = $this->get_line_items( $wc_cart_object );
391
 
392
+ $taxes = $this->calculate_tax(
393
+ array(
394
+ 'to_country' => $address['to_country'],
395
+ 'to_zip' => $address['to_zip'],
396
+ 'to_state' => $address['to_state'],
397
+ 'to_city' => $address['to_city'],
398
+ 'to_street' => $address['to_street'],
399
+ 'shipping_amount' => WC()->shipping->shipping_total,
400
+ 'line_items' => $line_items,
401
+ )
402
+ );
403
 
404
  // Return if taxes could not be calculated.
405
  if ( false === $taxes ) {
406
  return;
407
  }
408
 
409
+ $this->response_rate_ids = $taxes['rate_ids'];
410
  $this->response_line_items = $taxes['line_items'];
411
 
412
  if ( isset( $this->response_line_items ) ) {
413
  foreach ( $this->response_line_items as $response_line_item_key => $response_line_item ) {
414
  $line_item = $this->get_line_item( $response_line_item_key, $line_items );
415
+ if ( isset( $line_item ) ) {
416
  $this->response_line_items[ $response_line_item_key ]->line_total = ( $line_item['unit_price'] * $line_item['quantity'] ) - $line_item['discount'];
417
  }
418
  }
419
  }
420
 
421
  foreach ( $wc_cart_object->get_cart() as $cart_item_key => $cart_item ) {
422
+ $product = $cart_item['data'];
423
  $line_item_key = $product->get_id() . '-' . $cart_item_key;
424
  if ( isset( $taxes['line_items'][ $line_item_key ] ) && ! $taxes['line_items'][ $line_item_key ]->combined_tax_rate ) {
425
  if ( method_exists( $product, 'set_tax_status' ) ) {
458
  * @return void
459
  */
460
  public function calculate_backend_totals( $order_id ) {
461
+ $order = wc_get_order( $order_id );
462
+ $address = $this->get_backend_address();
463
  $line_items = $this->get_backend_line_items( $order );
464
  if ( method_exists( $order, 'get_shipping_total' ) ) {
465
  $shipping = $order->get_shipping_total(); // Woo 3.0+
466
  } else {
467
  $shipping = $order->get_total_shipping(); // Woo 2.6
468
  }
469
+ $taxes = $this->calculate_tax(
470
+ array(
471
+ 'to_country' => $address['to_country'],
472
+ 'to_state' => $address['to_state'],
473
+ 'to_zip' => $address['to_zip'],
474
+ 'to_city' => $address['to_city'],
475
+ 'to_street' => $address['to_street'],
476
+ 'shipping_amount' => $shipping,
477
+ 'line_items' => $line_items,
478
+ )
479
+ );
480
  if ( class_exists( 'WC_Order_Item_Tax' ) ) { // Add tax rates manually for Woo 3.0+
481
  foreach ( $order->get_items() as $item_key => $item ) {
482
+ $product_id = $item->get_product_id();
483
  $line_item_key = $product_id . '-' . $item_key;
484
  if ( isset( $taxes['rate_ids'][ $line_item_key ] ) ) {
485
+ $rate_id = $taxes['rate_ids'][ $line_item_key ];
486
  $item_tax = new WC_Order_Item_Tax();
487
  $item_tax->set_rate( $rate_id );
488
  $item_tax->set_order_id( $order_id );
513
  $taxable_address = is_array( $taxable_address ) ? $taxable_address : array();
514
 
515
  $to_country = isset( $taxable_address[0] ) && ! empty( $taxable_address[0] ) ? $taxable_address[0] : false;
516
+ $to_state = isset( $taxable_address[1] ) && ! empty( $taxable_address[1] ) ? $taxable_address[1] : false;
517
+ $to_zip = isset( $taxable_address[2] ) && ! empty( $taxable_address[2] ) ? $taxable_address[2] : false;
518
+ $to_city = isset( $taxable_address[3] ) && ! empty( $taxable_address[3] ) ? $taxable_address[3] : false;
519
+ $to_street = isset( $taxable_address[4] ) && ! empty( $taxable_address[4] ) ? $taxable_address[4] : false;
520
 
521
  return array(
522
  'to_country' => $to_country,
523
+ 'to_state' => $to_state,
524
+ 'to_zip' => $to_zip,
525
+ 'to_city' => $to_city,
526
+ 'to_street' => $to_street,
527
  );
528
  }
529
 
530
  /**
531
  * Allow street address to be passed when finding rates
532
  *
533
+ * @param array $matched_tax_rates
534
  * @param string $tax_class
535
  * @return array
536
  */
538
  $tax_class = sanitize_title( $tax_class );
539
  $location = WC_Tax::get_tax_location( $tax_class );
540
  $matched_tax_rates = array();
541
+ if ( sizeof( $location ) >= 4 ) {
542
  list( $country, $state, $postcode, $city, $street ) = array_pad( $location, 5, '' );
543
+ $matched_tax_rates = WC_Tax::find_rates(
544
+ array(
545
+ 'country' => $country,
546
+ 'state' => $state,
547
+ 'postcode' => $postcode,
548
+ 'city' => $city,
549
+ 'tax_class' => $tax_class,
550
+ )
551
+ );
552
  }
553
+ return $matched_tax_rates;
554
  }
555
 
556
  /**
557
  * Get taxable address.
558
+ *
559
  * @return array
560
  */
561
  public function get_taxable_address() {
562
  $tax_based_on = get_option( 'woocommerce_tax_based_on' );
563
+ // Check shipping method at this point to see if we need special handling
564
  // See WC_Customer get_taxable_address()
565
  // wc_get_chosen_shipping_method_ids() available since Woo 2.6.2+
566
  if ( function_exists( 'wc_get_chosen_shipping_method_ids' ) ) {
575
 
576
  if ( 'base' === $tax_based_on ) {
577
  $store_settings = $this->get_store_settings();
578
+ $country = $store_settings['country'];
579
+ $state = $store_settings['state'];
580
+ $postcode = $store_settings['postcode'];
581
+ $city = $store_settings['city'];
582
+ $street = $store_settings['street'];
583
  } elseif ( 'billing' === $tax_based_on ) {
584
  $country = WC()->customer->get_billing_country();
585
  $state = WC()->customer->get_billing_state();
594
  $street = WC()->customer->get_shipping_address();
595
  }
596
 
597
+ return apply_filters( 'woocommerce_customer_taxable_address', array( $country, $state, $postcode, $city, $street ) );
598
  }
599
 
600
  /**
607
  */
608
  protected function get_backend_address() {
609
  $to_country = isset( $_POST['country'] ) ? strtoupper( wc_clean( $_POST['country'] ) ) : false;
610
+ $to_state = isset( $_POST['state'] ) ? strtoupper( wc_clean( $_POST['state'] ) ) : false;
611
+ $to_zip = isset( $_POST['postcode'] ) ? strtoupper( wc_clean( $_POST['postcode'] ) ) : false;
612
+ $to_city = isset( $_POST['city'] ) ? strtoupper( wc_clean( $_POST['city'] ) ) : false;
613
+ $to_street = isset( $_POST['street'] ) ? strtoupper( wc_clean( $_POST['street'] ) ) : false;
614
 
615
  return array(
616
  'to_country' => $to_country,
617
+ 'to_state' => $to_state,
618
+ 'to_zip' => $to_zip,
619
+ 'to_city' => $to_city,
620
+ 'to_street' => $to_street,
621
  );
622
  }
623
 
633
  $line_items = array();
634
 
635
  foreach ( $wc_cart_object->get_cart() as $cart_item_key => $cart_item ) {
636
+ $product = $cart_item['data'];
637
+ $id = $product->get_id();
638
+ $quantity = $cart_item['quantity'];
639
+ $unit_price = wc_format_decimal( $product->get_price() );
640
  $line_subtotal = wc_format_decimal( $cart_item['line_subtotal'] );
641
+ $discount = wc_format_decimal( $cart_item['line_subtotal'] - $cart_item['line_total'] );
642
+ $tax_class = explode( '-', $product->get_tax_class() );
643
+ $tax_code = '';
644
 
645
  if ( isset( $tax_class ) && is_numeric( end( $tax_class ) ) ) {
646
  $tax_code = end( $tax_class );
661
  }
662
 
663
  if ( $unit_price && $line_subtotal ) {
664
+ array_push(
665
+ $line_items,
666
+ array(
667
+ 'id' => $id . '-' . $cart_item_key,
668
+ 'quantity' => $quantity,
669
+ 'product_tax_code' => $tax_code,
670
+ 'unit_price' => $unit_price,
671
+ 'discount' => $discount,
672
+ )
673
+ );
674
  }
675
  }
676
 
686
  * @return array
687
  */
688
  protected function get_backend_line_items( $order ) {
689
+ $line_items = array();
690
  $this->backend_tax_classes = array();
691
  foreach ( $order->get_items() as $item_key => $item ) {
692
  if ( is_object( $item ) ) { // Woo 3.0+
693
+ $id = $item->get_product_id();
694
+ $quantity = $item->get_quantity();
695
+ $unit_price = wc_format_decimal( $item->get_subtotal() / $quantity );
696
+ $discount = wc_format_decimal( $item->get_subtotal() - $item->get_total() );
697
  $tax_class_name = $item->get_tax_class();
698
+ $tax_status = $item->get_tax_status();
699
  } else { // Woo 2.6
700
+ $id = $item['product_id'];
701
+ $quantity = $item['qty'];
702
+ $unit_price = wc_format_decimal( $item['line_subtotal'] / $quantity );
703
+ $discount = wc_format_decimal( $item['line_subtotal'] - $item['line_total'] );
704
  $tax_class_name = $item['tax_class'];
705
+ $product = $order->get_product_from_item( $item );
706
+ $tax_status = $product ? $product->get_tax_status() : 'taxable';
707
  }
708
+ $this->backend_tax_classes[ $id ] = $tax_class_name;
709
+ $tax_class = explode( '-', $tax_class_name );
710
+ $tax_code = '';
711
  if ( isset( $tax_class[1] ) && is_numeric( $tax_class[1] ) ) {
712
  $tax_code = $tax_class[1];
713
  }
715
  $tax_code = '99999';
716
  }
717
  if ( $unit_price ) {
718
+ array_push(
719
+ $line_items,
720
+ array(
721
+ 'id' => $id . '-' . $item_key,
722
+ 'quantity' => $quantity,
723
+ 'product_tax_code' => $tax_code,
724
+ 'unit_price' => $unit_price,
725
+ 'discount' => $discount,
726
+ )
727
+ );
728
  }
729
  }
730
  return $line_items;
736
  return $line_item;
737
  }
738
  }
739
+ return null;
740
  }
741
 
742
  /**
751
  public function override_woocommerce_tax_rates( $taxes, $price, $rates ) {
752
  if ( isset( $this->response_line_items ) && array_values( $rates ) ) {
753
  // Get tax rate ID for current item
754
+ $keys = array_keys( $taxes );
755
  $tax_rate_id = $keys[0];
756
+ $line_items = array();
757
 
758
  // Map line items using rate ID
759
  foreach ( $this->response_rate_ids as $line_item_key => $rate_id ) {
809
 
810
  if ( 'base' == $tax_based_on ) {
811
  $store_settings = $this->get_store_settings();
812
+ $postcode = $store_settings['postcode'];
813
+ $city = strtoupper( $store_settings['city'] );
814
+ $street = $store_settings['street'];
815
  }
816
 
817
  if ( '' != $street ) {
829
  * Direct from the TaxJar plugin, without Nexus check.
830
  * See: https://github.com/taxjar/taxjar-woocommerce-plugin/blob/96b5d57/includes/class-wc-taxjar-integration.php#L247
831
  *
 
832
  * @return void
833
  */
834
  public function calculate_tax( $options = array() ) {
837
  // Process $options array and turn them into variables
838
  $options = is_array( $options ) ? $options : array();
839
 
840
+ extract(
841
+ array_replace_recursive(
842
+ array(
843
+ 'to_country' => null,
844
+ 'to_state' => null,
845
+ 'to_zip' => null,
846
+ 'to_city' => null,
847
+ 'to_street' => null,
848
+ 'shipping_amount' => null, // WC()->shipping->shipping_total
849
+ 'line_items' => null,
850
+ ),
851
+ $options
852
+ )
853
+ );
854
 
855
  $taxes = array(
856
  'freight_taxable' => 1,
857
+ 'has_nexus' => 0,
858
+ 'line_items' => array(),
859
+ 'rate_ids' => array(),
860
+ 'tax_rate' => 0,
861
  );
862
 
863
+ // Strict conditions to be met before API call can be conducted
864
  if (
865
  empty( $to_country ) ||
866
  empty( $to_zip ) ||
870
  return false;
871
  }
872
 
873
+ $to_zip = explode( ',', $to_zip );
874
+ $to_zip = array_shift( $to_zip );
875
 
876
+ $store_settings = $this->get_store_settings();
877
+ $from_country = $store_settings['country'];
878
+ $from_state = $store_settings['state'];
879
+ $from_zip = $store_settings['postcode'];
880
+ $from_city = $store_settings['city'];
881
+ $from_street = $store_settings['street'];
882
+ $shipping_amount = is_null( $shipping_amount ) ? 0.0 : $shipping_amount;
883
 
884
  $this->_log( ':::: TaxJar API called ::::' );
885
 
886
  $body = array(
887
  'from_country' => $from_country,
888
+ 'from_state' => $from_state,
889
+ 'from_zip' => $from_zip,
890
+ 'from_city' => $from_city,
891
+ 'from_street' => $from_street,
892
+ 'to_country' => $to_country,
893
+ 'to_state' => $to_state,
894
+ 'to_zip' => $to_zip,
895
+ 'to_city' => $to_city,
896
+ 'to_street' => $to_street,
897
+ 'shipping' => $shipping_amount,
898
+ 'plugin' => 'woo',
899
  );
900
 
901
  // Either `amount` or `line_items` parameters are required to perform tax calculations.
912
  $this->_log( 'Received: ' . $response['body'] );
913
 
914
  // Decode Response
915
+ $taxjar_response = json_decode( $response['body'] );
916
+ $taxjar_response = $taxjar_response->tax;
917
 
918
  // Update Properties based on Response
919
+ $taxes['freight_taxable'] = (int) $taxjar_response->freight_taxable;
920
+ $taxes['has_nexus'] = (int) $taxjar_response->has_nexus;
921
+ $taxes['tax_rate'] = $taxjar_response->rate;
922
 
923
  if ( ! empty( $taxjar_response->breakdown ) ) {
924
  if ( ! empty( $taxjar_response->breakdown->line_items ) ) {
938
  // Use Woo core to find matching rates for taxable address
939
  $location = array(
940
  'to_country' => $to_country,
941
+ 'to_state' => $to_state,
942
+ 'to_zip' => $to_zip,
943
+ 'to_city' => $to_city,
944
  );
945
 
946
  if ( 'GB' === $to_country ) {
950
  // Add line item tax rates
951
  foreach ( $taxes['line_items'] as $line_item_key => $line_item ) {
952
  $line_item_key_chunks = explode( '-', $line_item_key );
953
+ $product_id = $line_item_key_chunks[0];
954
+ $product = wc_get_product( $product_id );
955
 
956
  if ( $product ) {
957
  $tax_class = $product->get_tax_class();
958
  } else {
959
+ if ( isset( $this->backend_tax_classes[ $product_id ] ) ) {
960
+ $tax_class = $this->backend_tax_classes[ $product_id ];
961
  }
962
  }
963
 
995
  */
996
  public function create_or_update_tax_rate( $location, $rate, $tax_class = '', $freight_taxable = 1 ) {
997
  $tax_rate = array(
998
+ 'tax_rate_country' => $location['to_country'],
999
+ 'tax_rate_state' => $location['to_state'],
1000
+ 'tax_rate_name' => sprintf( '%s Tax', $location['to_state'] ),
1001
  'tax_rate_priority' => 1,
1002
  'tax_rate_compound' => false,
1003
  'tax_rate_shipping' => $freight_taxable,
1004
+ 'tax_rate' => $rate,
1005
+ 'tax_rate_class' => $tax_class,
1006
  );
1007
 
1008
+ $wc_rate = WC_Tax::find_rates(
1009
+ array(
1010
+ 'country' => $location['to_country'],
1011
+ 'state' => $location['to_state'],
1012
+ 'postcode' => $location['to_zip'],
1013
+ 'city' => $location['to_city'],
1014
+ 'tax_class' => $tax_class,
1015
+ )
1016
+ );
1017
 
1018
  if ( ! empty( $wc_rate ) ) {
1019
  $this->_log( ':: Tax Rate Found ::' );
1080
 
1081
  $this->_log( 'Requesting: ' . $path . ' - ' . $json );
1082
 
1083
+ $response = $this->api_client->proxy_request(
1084
+ $path,
1085
+ array(
1086
+ 'method' => 'POST',
1087
+ 'headers' => array(
1088
+ 'Content-Type' => 'application/json',
1089
+ ),
1090
+ 'body' => $json,
1091
+ )
1092
+ );
1093
 
1094
  if ( is_wp_error( $response ) ) {
1095
  $this->_error( 'Error retrieving the tax rates. Received (' . $response->get_error_code() . '): ' . $response->get_error_message() );
1110
  global $wpdb;
1111
 
1112
  // Export Tax Rates
1113
+ $rates = $wpdb->get_results(
1114
+ $wpdb->prepare(
1115
+ "SELECT * FROM {$wpdb->prefix}woocommerce_tax_rates
1116
  ORDER BY tax_rate_order
1117
  LIMIT %d, %d
1118
  ",
1119
+ 0,
1120
+ 10000
1121
+ )
1122
+ );
1123
 
1124
  ob_start();
1125
  $header =
classes/class-wc-connect-tracks.php CHANGED
@@ -16,7 +16,7 @@ if ( ! class_exists( 'WC_Connect_Tracks' ) ) {
16
  protected $logger;
17
 
18
  public function __construct( WC_Connect_Logger $logger, $plugin_file ) {
19
- $this->logger = $logger;
20
  $this->plugin_file = $plugin_file;
21
  }
22
 
@@ -70,7 +70,7 @@ if ( ! class_exists( 'WC_Connect_Tracks' ) ) {
70
  $this->debug( 'Error. jetpack_tracks_record_event is not defined.' );
71
  return;
72
  }
73
- $user = wp_get_current_user();
74
  $site_url = get_option( 'siteurl' );
75
 
76
  $wcs_version = WC_Connect_Loader::get_wcs_version();
@@ -97,16 +97,16 @@ if ( ! class_exists( 'WC_Connect_Tracks' ) ) {
97
  $data = array();
98
  }
99
 
100
- $data['_via_ua'] = isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : '';
101
- $data['_via_ip'] = isset( $_SERVER['REMOTE_ADDR'] ) ? $_SERVER['REMOTE_ADDR'] : '';
102
- $data['_lg'] = isset( $_SERVER['HTTP_ACCEPT_LANGUAGE'] ) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : '';
103
- $data['blog_url'] = $site_url;
104
- $data['blog_id'] = $jetpack_blog_id;
105
- $data['wcs_version'] = $wcs_version;
106
  $data['jetpack_version'] = $jp_version;
107
- $data['is_atomic'] = $is_atomic;
108
- $data['wc_version'] = $wc_version;
109
- $data['wp_version'] = get_bloginfo( 'version' );
110
 
111
  $event_type = self::$product_name . '_' . $event_type;
112
 
16
  protected $logger;
17
 
18
  public function __construct( WC_Connect_Logger $logger, $plugin_file ) {
19
+ $this->logger = $logger;
20
  $this->plugin_file = $plugin_file;
21
  }
22
 
70
  $this->debug( 'Error. jetpack_tracks_record_event is not defined.' );
71
  return;
72
  }
73
+ $user = wp_get_current_user();
74
  $site_url = get_option( 'siteurl' );
75
 
76
  $wcs_version = WC_Connect_Loader::get_wcs_version();
97
  $data = array();
98
  }
99
 
100
+ $data['_via_ua'] = isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : '';
101
+ $data['_via_ip'] = isset( $_SERVER['REMOTE_ADDR'] ) ? $_SERVER['REMOTE_ADDR'] : '';
102
+ $data['_lg'] = isset( $_SERVER['HTTP_ACCEPT_LANGUAGE'] ) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : '';
103
+ $data['blog_url'] = $site_url;
104
+ $data['blog_id'] = $jetpack_blog_id;
105
+ $data['wcs_version'] = $wcs_version;
106
  $data['jetpack_version'] = $jp_version;
107
+ $data['is_atomic'] = $is_atomic;
108
+ $data['wc_version'] = $wc_version;
109
+ $data['wp_version'] = get_bloginfo( 'version' );
110
 
111
  $event_type = self::$product_name . '_' . $event_type;
112
 
classes/class-wc-rest-connect-account-settings-controller.php CHANGED
@@ -27,15 +27,19 @@ class WC_REST_Connect_Account_Settings_Controller extends WC_REST_Connect_Base_C
27
  $this->payment_methods_store = $payment_methods_store;
28
 
29
  $this->account_settings = new WC_Connect_Account_Settings(
30
- $settings_store,
31
- $payment_methods_store );
 
32
  }
33
 
34
  public function get() {
35
- return new WP_REST_Response( array_merge(
36
- array( 'success' => true ),
37
- $this->account_settings->get()
38
- ), 200);
 
 
 
39
  }
40
 
41
  public function post( $request ) {
@@ -43,14 +47,15 @@ class WC_REST_Connect_Account_Settings_Controller extends WC_REST_Connect_Base_C
43
 
44
  if ( ! $this->settings_store->can_user_manage_payment_methods() ) {
45
  // Ignore the user-provided payment method ID if they don't have permission to change it
46
- $old_settings = $this->settings_store->get_account_settings();
47
  $settings['selected_payment_method_id'] = $old_settings['selected_payment_method_id'];
48
  }
49
 
50
  $result = $this->settings_store->update_account_settings( $settings );
51
 
52
  if ( is_wp_error( $result ) ) {
53
- $error = new WP_Error( 'save_failed',
 
54
  sprintf(
55
  __( 'Unable to update settings. %s', 'woocommerce-services' ),
56
  $result->get_error_message()
27
  $this->payment_methods_store = $payment_methods_store;
28
 
29
  $this->account_settings = new WC_Connect_Account_Settings(
30
+ $settings_store,
31
+ $payment_methods_store
32
+ );
33
  }
34
 
35
  public function get() {
36
+ return new WP_REST_Response(
37
+ array_merge(
38
+ array( 'success' => true ),
39
+ $this->account_settings->get()
40
+ ),
41
+ 200
42
+ );
43
  }
44
 
45
  public function post( $request ) {
47
 
48
  if ( ! $this->settings_store->can_user_manage_payment_methods() ) {
49
  // Ignore the user-provided payment method ID if they don't have permission to change it
50
+ $old_settings = $this->settings_store->get_account_settings();
51
  $settings['selected_payment_method_id'] = $old_settings['selected_payment_method_id'];
52
  }
53
 
54
  $result = $this->settings_store->update_account_settings( $settings );
55
 
56
  if ( is_wp_error( $result ) ) {
57
+ $error = new WP_Error(
58
+ 'save_failed',
59
  sprintf(
60
  __( 'Unable to update settings. %s', 'woocommerce-services' ),
61
  $result->get_error_message()
classes/class-wc-rest-connect-address-normalization-controller.php CHANGED
@@ -13,14 +13,14 @@ class WC_REST_Connect_Address_Normalization_Controller extends WC_REST_Connect_B
13
 
14
  public function post( $request ) {
15
  $data = $request->get_json_params();
16
- $address = $data[ 'address' ];
17
- $name = $address[ 'name' ];
18
- $company = $address[ 'company' ];
19
- $phone = $address[ 'phone' ];
20
 
21
- unset( $address[ 'name' ], $address[ 'company' ], $address[ 'phone' ] );
22
 
23
- $body = array(
24
  'destination' => $address,
25
  );
26
  $response = $this->api_client->send_address_normalization_request( $body );
@@ -38,19 +38,19 @@ class WC_REST_Connect_Address_Normalization_Controller extends WC_REST_Connect_B
38
  if ( isset( $response->field_errors ) ) {
39
  $this->logger->log( 'Address validation errors: ' . implode( '; ', array_values( (array) $response->field_errors ) ), __CLASS__ );
40
  return array(
41
- 'success' => true,
42
  'field_errors' => $response->field_errors,
43
  );
44
  }
45
 
46
- $response->normalized->name = $name;
47
  $response->normalized->company = $company;
48
- $response->normalized->phone = $phone;
49
- $is_trivial_normalization = isset( $response->is_trivial_normalization ) ? $response->is_trivial_normalization : false;
50
 
51
  return array(
52
- 'success' => true,
53
- 'normalized' => $response->normalized,
54
  'is_trivial_normalization' => $is_trivial_normalization,
55
  );
56
  }
13
 
14
  public function post( $request ) {
15
  $data = $request->get_json_params();
16
+ $address = $data['address'];
17
+ $name = $address['name'];
18
+ $company = $address['company'];
19
+ $phone = $address['phone'];
20
 
21
+ unset( $address['name'], $address['company'], $address['phone'] );
22
 
23
+ $body = array(
24
  'destination' => $address,
25
  );
26
  $response = $this->api_client->send_address_normalization_request( $body );
38
  if ( isset( $response->field_errors ) ) {
39
  $this->logger->log( 'Address validation errors: ' . implode( '; ', array_values( (array) $response->field_errors ) ), __CLASS__ );
40
  return array(
41
+ 'success' => true,
42
  'field_errors' => $response->field_errors,
43
  );
44
  }
45
 
46
+ $response->normalized->name = $name;
47
  $response->normalized->company = $company;
48
+ $response->normalized->phone = $phone;
49
+ $is_trivial_normalization = isset( $response->is_trivial_normalization ) ? $response->is_trivial_normalization : false;
50
 
51
  return array(
52
+ 'success' => true,
53
+ 'normalized' => $response->normalized,
54
  'is_trivial_normalization' => $is_trivial_normalization,
55
  );
56
  }
classes/class-wc-rest-connect-assets-controller.php CHANGED
@@ -14,12 +14,15 @@ class WC_REST_Connect_Assets_Controller extends WC_REST_Connect_Base_Controller
14
 
15
  public function get() {
16
 
17
- return new WP_REST_Response( array(
18
- 'success' => true,
19
- 'assets' => array(
20
- 'wc_connect_admin_script' => WC_Connect_Loader::get_wcs_admin_script_url(),
21
- 'wc_connect_admin_style' => WC_Connect_Loader::get_wcs_admin_style_url(),
 
 
22
  ),
23
- ), 200 );
 
24
  }
25
  }
14
 
15
  public function get() {
16
 
17
+ return new WP_REST_Response(
18
+ array(
19
+ 'success' => true,
20
+ 'assets' => array(
21
+ 'wc_connect_admin_script' => WC_Connect_Loader::get_wcs_admin_script_url(),
22
+ 'wc_connect_admin_style' => WC_Connect_Loader::get_wcs_admin_style_url(),
23
+ ),
24
  ),
25
+ 200
26
+ );
27
  }
28
  }
classes/class-wc-rest-connect-base-controller.php CHANGED
@@ -33,38 +33,59 @@ abstract class WC_REST_Connect_Base_Controller extends WP_REST_Controller {
33
  protected $logger;
34
 
35
  public function __construct( WC_Connect_API_Client $api_client, WC_Connect_Service_Settings_Store $settings_store, WC_Connect_Logger $logger ) {
36
- $this->api_client = $api_client;
37
  $this->settings_store = $settings_store;
38
- $this->logger = $logger;
39
  }
40
 
41
  public function register_routes() {
42
  if ( method_exists( $this, 'get' ) ) {
43
- register_rest_route( $this->namespace, '/' . $this->rest_base, array(
 
 
44
  array(
45
- 'methods' => 'GET',
46
- 'callback' => array( $this, 'get_internal' ),
47
- 'permission_callback' => array( $this, 'check_permission' ),
48
- ),
49
- ) );
 
 
50
  }
51
  if ( method_exists( $this, 'post' ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  register_rest_route( $this->namespace, '/' . $this->rest_base, array(
53
  array(
54
- 'methods' => 'POST',
55
- 'callback' => array( $this, 'post_internal' ),
56
  'permission_callback' => array( $this, 'check_permission' ),
57
  ),
58
  ) );
59
  }
60
  if ( method_exists( $this, 'delete' ) ) {
61
- register_rest_route( $this->namespace, '/' . $this->rest_base, array(
 
 
62
  array(
63
- 'methods' => 'DELETE',
64
- 'callback' => array( $this, 'delete_internal' ),
65
- 'permission_callback' => array( $this, 'check_permission' ),
66
- ),
67
- ) );
 
 
68
  }
69
  }
70
 
@@ -87,7 +108,7 @@ abstract class WC_REST_Connect_Base_Controller extends WP_REST_Controller {
87
  * See: https://pantheon.io/docs/cache-control/
88
  *
89
  * @param WP_REST_Response $response
90
- * @param WP_REST_Server $server
91
  *
92
  * @return WP_REST_Response passthrough $response parameter
93
  */
@@ -109,6 +130,12 @@ abstract class WC_REST_Connect_Base_Controller extends WP_REST_Controller {
109
  return $this->post( $request );
110
  }
111
 
 
 
 
 
 
 
112
  public function delete_internal( $request ) {
113
  $this->prevent_route_caching();
114
 
33
  protected $logger;
34
 
35
  public function __construct( WC_Connect_API_Client $api_client, WC_Connect_Service_Settings_Store $settings_store, WC_Connect_Logger $logger ) {
36
+ $this->api_client = $api_client;
37
  $this->settings_store = $settings_store;
38
+ $this->logger = $logger;
39
  }
40
 
41
  public function register_routes() {
42
  if ( method_exists( $this, 'get' ) ) {
43
+ register_rest_route(
44
+ $this->namespace,
45
+ '/' . $this->rest_base,
46
  array(
47
+ array(
48
+ 'methods' => 'GET',
49
+ 'callback' => array( $this, 'get_internal' ),
50
+ 'permission_callback' => array( $this, 'check_permission' ),
51
+ ),
52
+ )
53
+ );
54
  }
55
  if ( method_exists( $this, 'post' ) ) {
56
+ register_rest_route(
57
+ $this->namespace,
58
+ '/' . $this->rest_base,
59
+ array(
60
+ array(
61
+ 'methods' => 'POST',
62
+ 'callback' => array( $this, 'post_internal' ),
63
+ 'permission_callback' => array( $this, 'check_permission' ),
64
+ ),
65
+ )
66
+ );
67
+ }
68
+ if ( method_exists( $this, 'put' ) ) {
69
  register_rest_route( $this->namespace, '/' . $this->rest_base, array(
70
  array(
71
+ 'methods' => 'PUT',
72
+ 'callback' => array( $this, 'put_internal' ),
73
  'permission_callback' => array( $this, 'check_permission' ),
74
  ),
75
  ) );
76
  }
77
  if ( method_exists( $this, 'delete' ) ) {
78
+ register_rest_route(
79
+ $this->namespace,
80
+ '/' . $this->rest_base,
81
  array(
82
+ array(
83
+ 'methods' => 'DELETE',
84
+ 'callback' => array( $this, 'delete_internal' ),
85
+ 'permission_callback' => array( $this, 'check_permission' ),
86
+ ),
87
+ )
88
+ );
89
  }
90
  }
91
 
108
  * See: https://pantheon.io/docs/cache-control/
109
  *
110
  * @param WP_REST_Response $response
111
+ * @param WP_REST_Server $server
112
  *
113
  * @return WP_REST_Response passthrough $response parameter
114
  */
130
  return $this->post( $request );
131
  }
132
 
133
+ public function put_internal( $request ) {
134
+ $this->prevent_route_caching();
135
+
136
+ return $this->put( $request );
137
+ }
138
+
139
  public function delete_internal( $request ) {
140
  $this->prevent_route_caching();
141
 
classes/class-wc-rest-connect-packages-controller.php CHANGED
@@ -11,7 +11,7 @@ if ( class_exists( 'WC_REST_Connect_Packages_Controller' ) ) {
11
  class WC_REST_Connect_Packages_Controller extends WC_REST_Connect_Base_Controller {
12
  protected $rest_base = 'connect/packages';
13
 
14
- /*
15
  * @var WC_Connect_Package_Settings
16
  */
17
  protected $package_settings;
@@ -19,24 +19,133 @@ class WC_REST_Connect_Packages_Controller extends WC_REST_Connect_Base_Controlle
19
  public function __construct( WC_Connect_API_Client $api_client, WC_Connect_Service_Settings_Store $settings_store, WC_Connect_Logger $logger, WC_Connect_Service_Schemas_Store $service_schemas_store ) {
20
  parent::__construct( $api_client, $settings_store, $logger );
21
  $this->package_settings = new WC_Connect_Package_Settings(
22
- $settings_store, $service_schemas_store
 
23
  );
24
  }
25
 
26
  public function get() {
27
- return new WP_REST_Response( array_merge(
28
- array( 'success' => true ),
29
- $this->package_settings->get()
30
- ), 200 );
 
 
 
31
  }
32
 
33
- public function post( $request ) {
 
 
 
 
 
 
34
  $packages = $request->get_json_params();
35
 
36
- $this->settings_store->update_packages( $packages[ 'custom' ] );
37
- $this->settings_store->update_predefined_packages( $packages[ 'predefined' ] );
38
 
39
  return new WP_REST_Response( array( 'success' => true ), 200 );
40
  }
41
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  }
11
  class WC_REST_Connect_Packages_Controller extends WC_REST_Connect_Base_Controller {
12
  protected $rest_base = 'connect/packages';
13
 
14
+ /**
15
  * @var WC_Connect_Package_Settings
16
  */
17
  protected $package_settings;
19
  public function __construct( WC_Connect_API_Client $api_client, WC_Connect_Service_Settings_Store $settings_store, WC_Connect_Logger $logger, WC_Connect_Service_Schemas_Store $service_schemas_store ) {
20
  parent::__construct( $api_client, $settings_store, $logger );
21
  $this->package_settings = new WC_Connect_Package_Settings(
22
+ $settings_store,
23
+ $service_schemas_store
24
  );
25
  }
26
 
27
  public function get() {
28
+ return new WP_REST_Response(
29
+ array_merge(
30
+ array( 'success' => true ),
31
+ $this->package_settings->get()
32
+ ),
33
+ 200
34
+ );
35
  }
36
 
37
+ /**
38
+ * Update the existing custom and predefined packages.
39
+ *
40
+ * @param WP_REST_Request $request The request body contains the custom/predefined packages to replace.
41
+ * @return WP_REST_Response
42
+ */
43
+ public function put( $request ) {
44
  $packages = $request->get_json_params();
45
 
46
+ $this->settings_store->update_packages( $packages['custom'] );
47
+ $this->settings_store->update_predefined_packages( $packages['predefined'] );
48
 
49
  return new WP_REST_Response( array( 'success' => true ), 200 );
50
  }
51
 
52
+ /**
53
+ * Create custom and/or predefined packages.
54
+ *
55
+ * @param WP_REST_Request $request The request body contains the custom/predefined packages to create.
56
+ * @return WP_Error|WP_REST_Response
57
+ */
58
+ public function post( $request ) {
59
+ $packages = $request->get_json_params();
60
+
61
+ $custom_packages = isset( $packages['custom'] ) ? $packages['custom'] : array();
62
+ $predefined_packages = isset( $packages['predefined'] ) ? $packages['predefined'] : array();
63
+
64
+ // Handle new custom packages. The custom packages are structured as an array of packages as dictionaries.
65
+ if ( ! empty( $custom_packages ) ) {
66
+ // Validate that the new custom packages have unique names.
67
+ $map_package_name = function( $package ) {
68
+ return $package['name'];
69
+ };
70
+ $custom_package_names = array_map( $map_package_name, $custom_packages );
71
+ $unique_custom_package_names = array_unique( $custom_package_names );
72
+
73
+ if ( count( $unique_custom_package_names ) < count( $custom_package_names ) ) {
74
+ $duplicate_package_names = array_diff_assoc( $custom_package_names, $unique_custom_package_names );
75
+ $error = array(
76
+ 'code' => 'duplicate_custom_package_names',
77
+ 'message' => __( 'The new custom package names are not unique.' ),
78
+ 'data' => array( 'package_names' => array_values( $duplicate_package_names ) ),
79
+ );
80
+ return new WP_REST_Response( $error, 400 );
81
+ }
82
+
83
+ // Validate that the new custom packages do not have the same names as existing custom packages.
84
+ $existing_custom_packages = $this->settings_store->get_packages();
85
+ $existing_custom_package_names = array_map( $map_package_name, $existing_custom_packages );
86
+ $duplicate_package_names = array_intersect( $existing_custom_package_names, $custom_package_names );
87
+
88
+ if ( ! empty( $duplicate_package_names ) ) {
89
+ $error = array(
90
+ 'code' => 'duplicate_custom_package_names_of_existing_packages',
91
+ 'message' => __( 'At least one of the new custom packages has the same name as existing packages.' ),
92
+ 'data' => array( 'package_names' => array_values( $duplicate_package_names ) ),
93
+ );
94
+ return new WP_REST_Response( $error, 400 );
95
+ }
96
+
97
+ // If no duplicate custom packages, create the given packages.
98
+ $this->settings_store->create_packages( $custom_packages );
99
+ }
100
+
101
+ // Handle new predefined packages. The predefined packages are structured as a dictionary from carrier name to
102
+ // an array of package names.
103
+ if ( ! empty( $predefined_packages ) ) {
104
+ $duplicate_package_names_by_carrier = array();
105
+
106
+ // Validate that the new predefined packages have unique names for each carrier.
107
+ foreach ( $predefined_packages as $carrier => $package_names ) {
108
+ $unique_package_names = array_unique( $package_names );
109
+ if ( count( $unique_package_names ) < count( $package_names ) ) {
110
+ $duplicate_package_names = array_diff_assoc( $package_names, $unique_package_names );
111
+ $duplicate_package_names_by_carrier[ $carrier ] = array_values( $duplicate_package_names );
112
+ }
113
+ }
114
+
115
+ if ( ! empty( $duplicate_package_names_by_carrier ) ) {
116
+ $error = array(
117
+ 'code' => 'duplicate_predefined_package_names',
118
+ 'message' => __( 'The new predefined package names are not unique.' ),
119
+ 'data' => array( 'package_names_by_carrier' => $duplicate_package_names_by_carrier ),
120
+ );
121
+ return new WP_REST_Response( $error, 400 );
122
+ }
123
+
124
+ // Validate that the new predefined packages for each carrier do not have the same names as existing predefined packages.
125
+ $existing_predefined_packages = $this->settings_store->get_predefined_packages();
126
+ if ( ! empty( $existing_predefined_packages ) ) {
127
+ foreach ( $existing_predefined_packages as $carrier => $existing_package_names ) {
128
+ $new_package_names = isset( $predefined_packages[ $carrier ] ) ? $predefined_packages[ $carrier ] : array();
129
+ $duplicate_package_names = array_intersect( $existing_package_names, $new_package_names );
130
+ if ( ! empty( $duplicate_package_names ) ) {
131
+ $duplicate_package_names_by_carrier[ $carrier ] = array_values( $duplicate_package_names );
132
+ }
133
+ }
134
+ }
135
+
136
+ if ( ! empty( $duplicate_package_names_by_carrier ) ) {
137
+ $error = array(
138
+ 'code' => 'duplicate_predefined_package_names_of_existing_packages',
139
+ 'message' => __( 'At least one of the new predefined packages has the same name as existing packages.' ),
140
+ 'data' => array( 'package_names_by_carrier' => $duplicate_package_names_by_carrier ),
141
+ );
142
+ return new WP_REST_Response( $error, 400 );
143
+ }
144
+
145
+ // If no duplicate predefined packages, create the given packages.
146
+ $this->settings_store->create_predefined_packages( $predefined_packages );
147
+ }
148
+
149
+ return new WP_REST_Response( array( 'success' => true ), 200 );
150
+ }
151
  }
classes/class-wc-rest-connect-self-help-controller.php CHANGED
@@ -19,7 +19,8 @@ class WC_REST_Connect_Self_Help_Controller extends WC_REST_Connect_Base_Controll
19
  || ! array_key_exists( 'wcc_debug_on', $settings )
20
  || ! array_key_exists( 'wcc_logging_on', $settings )
21
  ) {
22
- $error = new WP_Error( 'bad_form_data',
 
23
  __( 'Unable to update settings. The form data could not be read.', 'woocommerce-services' ),
24
  array( 'status' => 400 )
25
  );
19
  || ! array_key_exists( 'wcc_debug_on', $settings )
20
  || ! array_key_exists( 'wcc_logging_on', $settings )
21
  ) {
22
+ $error = new WP_Error(
23
+ 'bad_form_data',
24
  __( 'Unable to update settings. The form data could not be read.', 'woocommerce-services' ),
25
  array( 'status' => 400 )
26
  );
classes/class-wc-rest-connect-service-data-refresh-controller.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ }
6
+
7
+ if ( class_exists( 'WC_REST_Connect_Service_Data_Refresh_Controller' ) ) {
8
+ return;
9
+ }
10
+
11
+ class WC_REST_Connect_Service_Data_Refresh_Controller extends WC_REST_Connect_Base_Controller {
12
+ protected $rest_base = 'connect/service-data-refresh';
13
+
14
+ /**
15
+ * @var WC_Connect_Service_Schemas_Store
16
+ */
17
+ protected $services_schemas_store;
18
+
19
+ public function set_service_schemas_store( $services_schemas_store ) {
20
+ $this->services_schemas_store = $services_schemas_store;
21
+ }
22
+
23
+ public function post() {
24
+ $result = $this->services_schemas_store->fetch_service_schemas_from_connect_server();
25
+ if ( $result === false ) {
26
+ return new WP_REST_Response(
27
+ [
28
+ 'success' => false,
29
+ ],
30
+ 500
31
+ );
32
+ }
33
+
34
+ $schemas = $this->services_schemas_store->get_service_schemas();
35
+
36
+ return new WP_REST_Response(
37
+ [
38
+ 'success' => true,
39
+ 'timestamp' => $this->services_schemas_store->get_last_fetch_timestamp(),
40
+ 'has_service_schemas' => ! is_null( $schemas ),
41
+ ],
42
+ 200
43
+ );
44
+ }
45
+
46
+ }
classes/class-wc-rest-connect-services-controller.php CHANGED
@@ -23,24 +23,31 @@ class WC_REST_Connect_Services_Controller extends WC_REST_Connect_Base_Controlle
23
  WC_Connect_Service_Schemas_Store $schemas_store
24
  ) {
25
  parent::__construct( $api_client, $settings_store, $logger );
26
- $this->service_schemas_store = $schemas_store;
27
  }
28
 
29
  public function get( $request ) {
30
- $method_id = $request[ 'id' ];
31
- $instance_id = isset( $request[ 'instance' ] ) ? $request[ 'instance' ] : false;
32
 
33
- $service_schema = $this->service_schemas_store->get_service_schema_by_id_or_instance_id( $instance_id
 
34
  ? $instance_id
35
- : $method_id );
 
36
 
37
  if ( ! $service_schema ) {
38
  return new WP_Error( 'schemas_not_found', __( 'Service schemas were not loaded', 'woocommerce-services' ), array( 'status' => 500 ) );
39
  }
40
 
41
- $payload = apply_filters( 'wc_connect_shipping_service_settings', array(
42
- 'success' => true,
43
- ), $method_id, $instance_id );
 
 
 
 
 
44
 
45
  return new WP_REST_Response( $payload, 200 );
46
  }
@@ -51,11 +58,12 @@ class WC_REST_Connect_Services_Controller extends WC_REST_Connect_Base_Controlle
51
  public function post( $request ) {
52
  $request_params = $request->get_params();
53
 
54
- $id = array_key_exists( 'id', $request_params ) ? $request_params['id'] : '';
55
  $instance = array_key_exists( 'instance', $request_params ) ? absint( $request_params['instance'] ) : false;
56
 
57
  if ( empty( $id ) ) {
58
- $error = new WP_Error( 'service_id_missing',
 
59
  __( 'Unable to update service settings. Form data is missing service ID.', 'woocommerce-services' ),
60
  array( 'status' => 400 )
61
  );
@@ -63,10 +71,11 @@ class WC_REST_Connect_Services_Controller extends WC_REST_Connect_Base_Controlle
63
  return $error;
64
  }
65
 
66
- $settings = ( object ) $request->get_json_params();
67
 
68
  if ( empty( $settings ) ) {
69
- $error = new WP_Error( 'bad_form_data',
 
70
  __( 'Unable to update service settings. The form data could not be read.', 'woocommerce-services' ),
71
  array( 'status' => 400 )
72
  );
@@ -77,7 +86,8 @@ class WC_REST_Connect_Services_Controller extends WC_REST_Connect_Base_Controlle
77
  $validation_result = $this->settings_store->validate_and_possibly_update_settings( $settings, $id, $instance );
78
 
79
  if ( is_wp_error( $validation_result ) ) {
80
- $error = new WP_Error( 'validation_failed',
 
81
  sprintf(
82
  __( 'Unable to update service settings. Validation failed. %s', 'woocommerce-services' ),
83
  $validation_result->get_error_message()
23
  WC_Connect_Service_Schemas_Store $schemas_store
24
  ) {
25
  parent::__construct( $api_client, $settings_store, $logger );
26
+ $this->service_schemas_store = $schemas_store;
27
  }
28
 
29
  public function get( $request ) {
30
+ $method_id = $request['id'];
31
+ $instance_id = isset( $request['instance'] ) ? $request['instance'] : false;
32
 
33
+ $service_schema = $this->service_schemas_store->get_service_schema_by_id_or_instance_id(
34
+ $instance_id
35
  ? $instance_id
36
+ : $method_id
37
+ );
38
 
39
  if ( ! $service_schema ) {
40
  return new WP_Error( 'schemas_not_found', __( 'Service schemas were not loaded', 'woocommerce-services' ), array( 'status' => 500 ) );
41
  }
42
 
43
+ $payload = apply_filters(
44
+ 'wc_connect_shipping_service_settings',
45
+ array(
46
+ 'success' => true,
47
+ ),
48
+ $method_id,
49
+ $instance_id
50
+ );
51
 
52
  return new WP_REST_Response( $payload, 200 );
53
  }
58
  public function post( $request ) {
59
  $request_params = $request->get_params();
60
 
61
+ $id = array_key_exists( 'id', $request_params ) ? $request_params['id'] : '';
62
  $instance = array_key_exists( 'instance', $request_params ) ? absint( $request_params['instance'] ) : false;
63
 
64
  if ( empty( $id ) ) {
65
+ $error = new WP_Error(
66
+ 'service_id_missing',
67
  __( 'Unable to update service settings. Form data is missing service ID.', 'woocommerce-services' ),
68
  array( 'status' => 400 )
69
  );
71
  return $error;
72
  }
73
 
74
+ $settings = (object) $request->get_json_params();
75
 
76
  if ( empty( $settings ) ) {
77
+ $error = new WP_Error(
78
+ 'bad_form_data',
79
  __( 'Unable to update service settings. The form data could not be read.', 'woocommerce-services' ),
80
  array( 'status' => 400 )
81
  );
86
  $validation_result = $this->settings_store->validate_and_possibly_update_settings( $settings, $id, $instance );
87
 
88
  if ( is_wp_error( $validation_result ) ) {
89
+ $error = new WP_Error(
90
+ 'validation_failed',
91
  sprintf(
92
  __( 'Unable to update service settings. Validation failed. %s', 'woocommerce-services' ),
93
  $validation_result->get_error_message()
classes/class-wc-rest-connect-shipping-label-controller.php CHANGED
@@ -23,38 +23,38 @@ class WC_REST_Connect_Shipping_Label_Controller extends WC_REST_Connect_Base_Con
23
 
24
  public function get( $request ) {
25
  $order_id = $request['order_id'];
26
- $payload = $this->shipping_label->get_label_payload( $order_id );
27
  if ( ! $payload ) {
28
  return new WP_Error( 'not_found', __( 'Order not found', 'woocommerce-services' ), array( 'status' => 404 ) );
29
  }
30
- $payload[ 'success' ] = true;
31
  return new WP_REST_Response( $payload, 200 );
32
  }
33
 
34
  public function post( $request ) {
35
- $settings = $request->get_json_params();
36
- $order_id = $request[ 'order_id' ];
37
- $settings[ 'order_id' ] = $order_id;
38
 
39
- if ( empty( $settings[ 'payment_method_id' ] ) || ! $this->settings_store->can_user_manage_payment_methods() ) {
40
- $settings[ 'payment_method_id' ] = $this->settings_store->get_selected_payment_method_id();
41
  } else {
42
- $this->settings_store->set_selected_payment_method_id( $settings[ 'payment_method_id' ] );
43
  }
44
 
45
- $last_box_id = '';
46
  $service_names = array();
47
- foreach ( $settings[ 'packages' ] as $index => $package ) {
48
- $service_names[] = $package[ 'service_name' ];
49
- unset( $package[ 'service_name' ] );
50
- $settings[ 'packages' ][ $index ] = $package;
51
 
52
  if ( empty( $last_box_id ) && ! empty( $package['box_id'] ) ) {
53
  $last_box_id = $package['box_id'];
54
  }
55
  }
56
 
57
- if ( ! empty( $last_box_id ) && $last_box_id !== "individual" ) {
58
  update_user_meta( get_current_user_id(), 'wc_connect_last_box_id', $last_box_id );
59
  }
60
 
@@ -70,9 +70,9 @@ class WC_REST_Connect_Shipping_Label_Controller extends WC_REST_Connect_Base_Con
70
  return $error;
71
  }
72
 
73
- $label_ids = array();
74
  $purchased_labels_meta = array();
75
- $package_lookup = $this->settings_store->get_package_lookup();
76
  foreach ( $response->labels as $index => $label_data ) {
77
  if ( isset( $label_data->error ) ) {
78
  $error = new WP_Error(
@@ -86,44 +86,44 @@ class WC_REST_Connect_Shipping_Label_Controller extends WC_REST_Connect_Base_Con
86
  $label_ids[] = $label_data->label->label_id;
87
 
88
  $label_meta = array(
89
- 'label_id' => $label_data->label->label_id,
90
- 'tracking' => $label_data->label->tracking_id,
91
- 'refundable_amount' => $label_data->label->refundable_amount,
92
- 'created' => $label_data->label->created,
93
- 'carrier_id' => $label_data->label->carrier_id,
94
- 'service_name' => $service_names[ $index ],
95
- 'status' => $label_data->label->status,
96
  'commercial_invoice_url' => $label_data->label->commercial_invoice_url,
97
  );
98
 
99
- $package = $settings[ 'packages' ][ $index ];
100
- $box_id = $package[ 'box_id' ];
101
  if ( 'individual' === $box_id ) {
102
- $label_meta[ 'package_name' ] = __( 'Individual packaging', 'woocommerce-services' );
103
- } else if ( isset( $package_lookup[ $box_id ] ) ) {
104
- $label_meta[ 'package_name' ] = $package_lookup[ $box_id ][ 'name' ];
105
  } else {
106
- $label_meta[ 'package_name' ] = __( 'Unknown package', 'woocommerce-services' );
107
  }
108
 
109
- $label_meta[ 'is_letter' ] = isset( $package[ 'is_letter' ] ) ? $package[ 'is_letter' ] : false;
110
 
111
  $product_names = array();
112
- $product_ids = array();
113
- foreach ( $package[ 'products' ] as $product_id ) {
114
- $product = wc_get_product( $product_id );
115
  $product_ids[] = $product_id;
116
 
117
  if ( $product ) {
118
  $product_names[] = $product->get_title();
119
  } else {
120
- $order = wc_get_order( $order_id );
121
  $product_names[] = WC_Connect_Compatibility::instance()->get_product_name_from_order( $product_id, $order );
122
  }
123
  }
124
 
125
- $label_meta[ 'product_names' ] = $product_names;
126
- $label_meta[ 'product_ids' ] = $product_ids;
127
 
128
  array_unshift( $purchased_labels_meta, $label_meta );
129
  }
@@ -131,7 +131,7 @@ class WC_REST_Connect_Shipping_Label_Controller extends WC_REST_Connect_Base_Con
131
  $this->settings_store->add_labels_to_order( $order_id, $purchased_labels_meta );
132
 
133
  return array(
134
- 'labels' => $purchased_labels_meta,
135
  'success' => true,
136
  );
137
  }
23
 
24
  public function get( $request ) {
25
  $order_id = $request['order_id'];
26
+ $payload = $this->shipping_label->get_label_payload( $order_id );
27
  if ( ! $payload ) {
28
  return new WP_Error( 'not_found', __( 'Order not found', 'woocommerce-services' ), array( 'status' => 404 ) );
29
  }
30
+ $payload['success'] = true;
31
  return new WP_REST_Response( $payload, 200 );
32
  }
33
 
34
  public function post( $request ) {
35
+ $settings = $request->get_json_params();
36
+ $order_id = $request['order_id'];
37
+ $settings['order_id'] = $order_id;
38
 
39
+ if ( empty( $settings['payment_method_id'] ) || ! $this->settings_store->can_user_manage_payment_methods() ) {
40
+ $settings['payment_method_id'] = $this->settings_store->get_selected_payment_method_id();
41
  } else {
42
+ $this->settings_store->set_selected_payment_method_id( $settings['payment_method_id'] );
43
  }
44
 
45
+ $last_box_id = '';
46
  $service_names = array();
47
+ foreach ( $settings['packages'] as $index => $package ) {
48
+ $service_names[] = $package['service_name'];
49
+ unset( $package['service_name'] );
50
+ $settings['packages'][ $index ] = $package;
51
 
52
  if ( empty( $last_box_id ) && ! empty( $package['box_id'] ) ) {
53
  $last_box_id = $package['box_id'];
54
  }
55
  }
56
 
57
+ if ( ! empty( $last_box_id ) && $last_box_id !== 'individual' ) {
58
  update_user_meta( get_current_user_id(), 'wc_connect_last_box_id', $last_box_id );
59
  }
60
 
70
  return $error;
71
  }
72
 
73
+ $label_ids = array();
74
  $purchased_labels_meta = array();
75
+ $package_lookup = $this->settings_store->get_package_lookup();
76
  foreach ( $response->labels as $index => $label_data ) {
77
  if ( isset( $label_data->error ) ) {
78
  $error = new WP_Error(
86
  $label_ids[] = $label_data->label->label_id;
87
 
88
  $label_meta = array(
89
+ 'label_id' => $label_data->label->label_id,
90
+ 'tracking' => $label_data->label->tracking_id,
91
+ 'refundable_amount' => $label_data->label->refundable_amount,
92
+ 'created' => $label_data->label->created,
93
+ 'carrier_id' => $label_data->label->carrier_id,
94
+ 'service_name' => $service_names[ $index ],
95
+ 'status' => $label_data->label->status,
96
  'commercial_invoice_url' => $label_data->label->commercial_invoice_url,
97
  );
98
 
99
+ $package = $settings['packages'][ $index ];
100
+ $box_id = $package['box_id'];
101
  if ( 'individual' === $box_id ) {
102
+ $label_meta['package_name'] = __( 'Individual packaging', 'woocommerce-services' );
103
+ } elseif ( isset( $package_lookup[ $box_id ] ) ) {
104
+ $label_meta['package_name'] = $package_lookup[ $box_id ]['name'];
105
  } else {
106
+ $label_meta['package_name'] = __( 'Unknown package', 'woocommerce-services' );
107
  }
108
 
109
+ $label_meta['is_letter'] = isset( $package['is_letter'] ) ? $package['is_letter'] : false;
110
 
111
  $product_names = array();
112
+ $product_ids = array();
113
+ foreach ( $package['products'] as $product_id ) {
114
+ $product = wc_get_product( $product_id );
115
  $product_ids[] = $product_id;
116
 
117
  if ( $product ) {
118
  $product_names[] = $product->get_title();
119
  } else {
120
+ $order = wc_get_order( $order_id );
121
  $product_names[] = WC_Connect_Compatibility::instance()->get_product_name_from_order( $product_id, $order );
122
  }
123
  }
124
 
125
+ $label_meta['product_names'] = $product_names;
126
+ $label_meta['product_ids'] = $product_ids;
127
 
128
  array_unshift( $purchased_labels_meta, $label_meta );
129
  }
131
  $this->settings_store->add_labels_to_order( $order_id, $purchased_labels_meta );
132
 
133
  return array(
134
+ 'labels' => $purchased_labels_meta,
135
  'success' => true,
136
  );
137
  }
classes/class-wc-rest-connect-shipping-label-preview-controller.php CHANGED
@@ -13,16 +13,16 @@ class WC_REST_Connect_Shipping_Label_Preview_Controller extends WC_REST_Connect_
13
 
14
  public function get( $request ) {
15
  $raw_params = $request->get_params();
16
- $params = array();
17
 
18
- $params[ 'paper_size' ] = $raw_params[ 'paper_size' ];
19
- $this->settings_store->set_preferred_paper_size( $params[ 'paper_size' ] );
20
- $params[ 'carrier' ] = 'usps';
21
- $params[ 'labels' ] = array();
22
- $captions = empty( $raw_params[ 'caption_csv' ] ) ? array() : explode( ',', $raw_params[ 'caption_csv' ] );
23
 
24
  foreach ( $captions as $caption ) {
25
- $params[ 'labels' ][] = array( 'caption' => urldecode( $caption ) );
26
  }
27
 
28
  $raw_response = $this->api_client->get_labels_preview_pdf( $params );
@@ -32,8 +32,8 @@ class WC_REST_Connect_Shipping_Label_Preview_Controller extends WC_REST_Connect_
32
  return $raw_response;
33
  }
34
 
35
- header( 'content-type: ' . $raw_response[ 'headers' ][ 'content-type' ] );
36
- echo $raw_response[ 'body' ];
37
  die();
38
  }
39
 
13
 
14
  public function get( $request ) {
15
  $raw_params = $request->get_params();
16
+ $params = array();
17
 
18
+ $params['paper_size'] = $raw_params['paper_size'];
19
+ $this->settings_store->set_preferred_paper_size( $params['paper_size'] );
20
+ $params['carrier'] = 'usps';
21
+ $params['labels'] = array();
22
+ $captions = empty( $raw_params['caption_csv'] ) ? array() : explode( ',', $raw_params['caption_csv'] );
23
 
24
  foreach ( $captions as $caption ) {
25
+ $params['labels'][] = array( 'caption' => urldecode( $caption ) );
26
  }
27
 
28
  $raw_response = $this->api_client->get_labels_preview_pdf( $params );
32
  return $raw_response;
33
  }
34
 
35
+ header( 'content-type: ' . $raw_response['headers']['content-type'] );
36
+ echo $raw_response['body'];
37
  die();
38
  }
39
 
classes/class-wc-rest-connect-shipping-label-print-controller.php CHANGED
@@ -13,36 +13,36 @@ class WC_REST_Connect_Shipping_Label_Print_Controller extends WC_REST_Connect_Ba
13
 
14
  public function get( $request ) {
15
  $raw_params = $request->get_params();
16
- $params = array();
17
 
18
- $params[ 'paper_size' ] = $raw_params[ 'paper_size' ];
19
- $this->settings_store->set_preferred_paper_size( $params[ 'paper_size' ] );
20
 
21
- $label_ids = ! empty( $raw_params[ 'label_id_csv' ] ) ? explode( ',', $raw_params[ 'label_id_csv' ] ) : array();
22
  $n_label_ids = count( $label_ids );
23
- $captions = ! empty( $raw_params[ 'caption_csv' ] ) ? explode( ',', $raw_params[ 'caption_csv' ] ) : array();
24
- $n_captions = count( $captions );
25
  // Either there are the same number of captions as labels, or no captions at all
26
  if ( ! $n_label_ids || ( $n_captions && $n_captions !== $n_label_ids ) ) {
27
  $message = __( 'Invalid PDF request.', 'woocommerce-services' );
28
- $error = new WP_Error(
29
  'invalid_pdf_request',
30
  $message,
31
  array(
32
  'message' => $message,
33
- 'status' => 400
34
  )
35
  );
36
  $this->logger->log( $error, __CLASS__ );
37
  return $error;
38
  }
39
- $params[ 'labels' ] = array();
40
  for ( $i = 0; $i < $n_label_ids; $i++ ) {
41
- $params[ 'labels' ][ $i ] = array();
42
- $params[ 'labels' ][ $i ][ 'label_id' ] = (int) $label_ids[ $i ];
43
 
44
  if ( $n_captions ) {
45
- $params[ 'labels' ][ $i ][ 'caption' ] = urldecode( $captions[ $i ] );
46
  }
47
  }
48
 
@@ -53,15 +53,15 @@ class WC_REST_Connect_Shipping_Label_Print_Controller extends WC_REST_Connect_Ba
53
  return $raw_response;
54
  }
55
 
56
- if ( isset( $raw_params[ 'json' ] ) && $raw_params[ 'json' ] ) {
57
  return array(
58
- 'mimeType' => $raw_response[ 'headers' ][ 'content-type' ],
59
- 'b64Content' => base64_encode( $raw_response[ 'body' ] ),
60
- 'success' => true,
61
  );
62
  } else {
63
- header( 'content-type: ' . $raw_response[ 'headers' ][ 'content-type' ] );
64
- echo $raw_response[ 'body' ];
65
  die();
66
  }
67
  }
13
 
14
  public function get( $request ) {
15
  $raw_params = $request->get_params();
16
+ $params = array();
17
 
18
+ $params['paper_size'] = $raw_params['paper_size'];
19
+ $this->settings_store->set_preferred_paper_size( $params['paper_size'] );
20
 
21
+ $label_ids = ! empty( $raw_params['label_id_csv'] ) ? explode( ',', $raw_params['label_id_csv'] ) : array();
22
  $n_label_ids = count( $label_ids );
23
+ $captions = ! empty( $raw_params['caption_csv'] ) ? explode( ',', $raw_params['caption_csv'] ) : array();
24
+ $n_captions = count( $captions );
25
  // Either there are the same number of captions as labels, or no captions at all
26
  if ( ! $n_label_ids || ( $n_captions && $n_captions !== $n_label_ids ) ) {
27
  $message = __( 'Invalid PDF request.', 'woocommerce-services' );
28
+ $error = new WP_Error(
29
  'invalid_pdf_request',
30
  $message,
31
  array(
32
  'message' => $message,
33
+ 'status' => 400,
34
  )
35
  );
36
  $this->logger->log( $error, __CLASS__ );
37
  return $error;
38
  }
39
+ $params['labels'] = array();
40
  for ( $i = 0; $i < $n_label_ids; $i++ ) {
41
+ $params['labels'][ $i ] = array();
42
+ $params['labels'][ $i ]['label_id'] = (int) $label_ids[ $i ];
43
 
44
  if ( $n_captions ) {
45
+ $params['labels'][ $i ]['caption'] = urldecode( $captions[ $i ] );
46
  }
47
  }
48
 
53
  return $raw_response;
54
  }
55
 
56
+ if ( isset( $raw_params['json'] ) && $raw_params['json'] ) {
57
  return array(
58
+ 'mimeType' => $raw_response['headers']['content-type'],
59
+ 'b64Content' => base64_encode( $raw_response['body'] ),
60
+ 'success' => true,
61
  );
62
  } else {
63
+ header( 'content-type: ' . $raw_response['headers']['content-type'] );
64
+ echo $raw_response['body'];
65
  die();
66
  }
67
  }
classes/class-wc-rest-connect-shipping-label-refund-controller.php CHANGED
@@ -12,7 +12,7 @@ class WC_REST_Connect_Shipping_Label_Refund_Controller extends WC_REST_Connect_B
12
  protected $rest_base = 'connect/label/(?P<order_id>\d+)/(?P<label_id>\d+)/refund';
13
 
14
  public function post( $request ) {
15
- $response = $this->api_client->send_shipping_label_refund_request( $request[ 'label_id' ] );
16
 
17
  if ( isset( $response->error ) ) {
18
  $response = new WP_Error(
@@ -22,9 +22,12 @@ class WC_REST_Connect_Shipping_Label_Refund_Controller extends WC_REST_Connect_B
22
  }
23
 
24
  if ( is_wp_error( $response ) ) {
25
- $response->add_data( array(
26
- 'message' => $response->get_error_message(),
27
- ), $response->get_error_code() );
 
 
 
28
 
29
  $this->logger->log( $response, __CLASS__ );
30
  return $response;
@@ -32,13 +35,13 @@ class WC_REST_Connect_Shipping_Label_Refund_Controller extends WC_REST_Connect_B
32
 
33
  $label_refund = (object) array(
34
  'label_id' => (int) $response->label->id,
35
- 'refund' => $response->refund ,
36
  );
37
- $this->settings_store->update_label_order_meta_data( $request[ 'order_id' ], $label_refund );
38
 
39
  return array(
40
  'success' => true,
41
- 'refund' => $response->refund,
42
  );
43
  }
44
 
12
  protected $rest_base = 'connect/label/(?P<order_id>\d+)/(?P<label_id>\d+)/refund';
13
 
14
  public function post( $request ) {
15
+ $response = $this->api_client->send_shipping_label_refund_request( $request['label_id'] );
16
 
17
  if ( isset( $response->error ) ) {
18
  $response = new WP_Error(
22
  }
23
 
24
  if ( is_wp_error( $response ) ) {
25
+ $response->add_data(
26
+ array(
27
+ 'message' => $response->get_error_message(),
28
+ ),
29
+ $response->get_error_code()
30
+ );
31
 
32
  $this->logger->log( $response, __CLASS__ );
33
  return $response;
35
 
36
  $label_refund = (object) array(
37
  'label_id' => (int) $response->label->id,
38
+ 'refund' => $response->refund,
39
  );
40
+ $this->settings_store->update_label_order_meta_data( $request['order_id'], $label_refund );
41
 
42
  return array(
43
  'success' => true,
44
+ 'refund' => $response->refund,
45
  );
46
  }
47
 
classes/class-wc-rest-connect-shipping-label-status-controller.php CHANGED
@@ -12,7 +12,7 @@ class WC_REST_Connect_Shipping_Label_Status_Controller extends WC_REST_Connect_B
12
  protected $rest_base = 'connect/label/(?P<order_id>\d+)/(?P<label_id>\d+)';
13
 
14
  public function get( $request ) {
15
- $response = $this->api_client->get_label_status( $request[ 'label_id' ] );
16
 
17
  if ( is_wp_error( $response ) ) {
18
  $error = new WP_Error(
@@ -24,11 +24,11 @@ class WC_REST_Connect_Shipping_Label_Status_Controller extends WC_REST_Connect_B
24
  return $error;
25
  }
26
 
27
- $label = $this->settings_store->update_label_order_meta_data( $request[ 'order_id' ], $response->label );
28
 
29
  return array(
30
  'success' => true,
31
- 'label' => $label,
32
  );
33
  }
34
 
12
  protected $rest_base = 'connect/label/(?P<order_id>\d+)/(?P<label_id>\d+)';
13
 
14
  public function get( $request ) {
15
+ $response = $this->api_client->get_label_status( $request['label_id'] );
16
 
17
  if ( is_wp_error( $response ) ) {
18
  $error = new WP_Error(
24
  return $error;
25
  }
26
 
27
+ $label = $this->settings_store->update_label_order_meta_data( $request['order_id'], $response->label );
28
 
29
  return array(
30
  'success' => true,
31
+ 'label' => $label,
32
  );
33
  }
34
 
classes/class-wc-rest-connect-shipping-rates-controller.php CHANGED
@@ -20,7 +20,7 @@ class WC_REST_Connect_Shipping_Rates_Controller extends WC_REST_Connect_Base_Con
20
  * Array of extra options to collect rates for.
21
  */
22
  protected $extra_rates = array(
23
- 'signature_required' => array(
24
  'signature' => 'yes',
25
  ),
26
  'adult_signature_required' => array(
@@ -38,29 +38,33 @@ class WC_REST_Connect_Shipping_Rates_Controller extends WC_REST_Connect_Base_Con
38
  * @return array|WP_Error
39
  */
40
  public function post( $request ) {
41
- $payload = $request->get_json_params();
42
- $payload[ 'payment_method_id' ] = $this->settings_store->get_selected_payment_method_id();
43
- $order_id = $request[ 'order_id' ];
44
 
45
  // This is the earliest point in the printing label flow where we are sure that
46
  // the merchant wants to ship from this exact address (normalized or otherwise)
47
- $this->settings_store->update_origin_address( $payload[ 'origin' ] );
48
- $this->settings_store->update_destination_address( $order_id, $payload[ 'destination' ] );
49
 
50
  // Update the customs information on all this order's products
51
  $updated_product_ids = array();
52
- foreach ( $payload[ 'packages' ] as $package_id => $package ) {
53
  if ( ! $this->has_customs_data( $package ) ) {
54
  break;
55
  }
56
- foreach ( $package[ 'items' ] as $index => $item ) {
57
- if ( ! isset( $updated_product_ids[ $item[ 'product_id' ] ] ) ) {
58
- $updated_product_ids[ $item[ 'product_id' ] ] = true;
59
- update_post_meta( $item[ 'product_id' ], 'wc_connect_customs_info', array(
60
- 'description' => $item[ 'description' ],
61
- 'hs_tariff_number' => $item[ 'hs_tariff_number' ],
62
- 'origin_country' => $item[ 'origin_country' ],
63
- ) );
 
 
 
 
64
  }
65
  }
66
  }
@@ -88,14 +92,14 @@ class WC_REST_Connect_Shipping_Rates_Controller extends WC_REST_Connect_Base_Con
88
  $original_package_names = [];
89
 
90
  // Add extra package requests with special options set.
91
- foreach( $this->extra_rates as $rate_name => $rate_option ) {
92
- foreach( $rate_option as $option_name => $option_value ) {
93
  foreach ( $payload['packages'] as $package_id => $package ) {
94
  $original_package_names[] = $package['id'];
95
  $new_package = $package;
96
  $new_package[ $option_name ] = $option_value;
97
 
98
- $new_package['id'] .= $this->SPECIAL_RATE_PREFIX . $rate_name;
99
  $signature_packages[] = $new_package;
100
  }
101
  }
@@ -128,19 +132,18 @@ class WC_REST_Connect_Shipping_Rates_Controller extends WC_REST_Connect_Base_Con
128
  public function merge_all_rates( $rates, $original_package_names ) {
129
  $parsed_rates = [];
130
 
131
- foreach( $original_package_names as $name ) {
132
  // Add a 'default' entry for the rate with no special options.
133
  $parsed_rates[ $name ] = array(
134
  'default' => $rates->{ $name },
135
  );
136
 
137
  // Get package for each extra rate to group them under the original package name.
138
- foreach( $this->extra_rates as $extra_rate_name => $option ) {
139
  $extra_rate_package_name = $name . $this->SPECIAL_RATE_PREFIX . $extra_rate_name;
140
  if ( isset( $rates->{ $extra_rate_package_name } ) ) {
141
  $parsed_rates[ $name ][ $extra_rate_name ] = $rates->{ $extra_rate_package_name };
142
  }
143
-
144
  }
145
  }
146
  return $parsed_rates;
20
  * Array of extra options to collect rates for.
21
  */
22
  protected $extra_rates = array(
23
+ 'signature_required' => array(
24
  'signature' => 'yes',
25
  ),
26
  'adult_signature_required' => array(
38
  * @return array|WP_Error
39
  */
40
  public function post( $request ) {
41
+ $payload = $request->get_json_params();
42
+ $payload['payment_method_id'] = $this->settings_store->get_selected_payment_method_id();
43
+ $order_id = $request['order_id'];
44
 
45
  // This is the earliest point in the printing label flow where we are sure that
46
  // the merchant wants to ship from this exact address (normalized or otherwise)
47
+ $this->settings_store->update_origin_address( $payload['origin'] );
48
+ $this->settings_store->update_destination_address( $order_id, $payload['destination'] );
49
 
50
  // Update the customs information on all this order's products
51
  $updated_product_ids = array();
52
+ foreach ( $payload['packages'] as $package_id => $package ) {
53
  if ( ! $this->has_customs_data( $package ) ) {
54
  break;
55
  }
56
+ foreach ( $package['items'] as $index => $item ) {
57
+ if ( ! isset( $updated_product_ids[ $item['product_id'] ] ) ) {
58
+ $updated_product_ids[ $item['product_id'] ] = true;
59
+ update_post_meta(
60
+ $item['product_id'],
61
+ 'wc_connect_customs_info',
62
+ array(
63
+ 'description' => $item['description'],
64
+ 'hs_tariff_number' => $item['hs_tariff_number'],
65
+ 'origin_country' => $item['origin_country'],
66
+ )
67
+ );
68
  }
69
  }
70
  }
92
  $original_package_names = [];
93
 
94
  // Add extra package requests with special options set.
95
+ foreach ( $this->extra_rates as $rate_name => $rate_option ) {
96
+ foreach ( $rate_option as $option_name => $option_value ) {
97
  foreach ( $payload['packages'] as $package_id => $package ) {
98
  $original_package_names[] = $package['id'];
99
  $new_package = $package;
100
  $new_package[ $option_name ] = $option_value;
101
 
102
+ $new_package['id'] .= $this->SPECIAL_RATE_PREFIX . $rate_name;
103
  $signature_packages[] = $new_package;
104
  }
105
  }
132
  public function merge_all_rates( $rates, $original_package_names ) {
133
  $parsed_rates = [];
134
 
135
+ foreach ( $original_package_names as $name ) {
136
  // Add a 'default' entry for the rate with no special options.
137
  $parsed_rates[ $name ] = array(
138
  'default' => $rates->{ $name },
139
  );
140
 
141
  // Get package for each extra rate to group them under the original package name.
142
+ foreach ( $this->extra_rates as $extra_rate_name => $option ) {
143
  $extra_rate_package_name = $name . $this->SPECIAL_RATE_PREFIX . $extra_rate_name;
144
  if ( isset( $rates->{ $extra_rate_package_name } ) ) {
145
  $parsed_rates[ $name ][ $extra_rate_name ] = $rates->{ $extra_rate_package_name };
146
  }
 
147
  }
148
  }
149
  return $parsed_rates;
classes/class-wc-rest-connect-subscriptions-controller.php CHANGED
@@ -20,7 +20,7 @@ class WC_REST_Connect_Subscriptions_Controller extends WC_REST_Connect_Base_Cont
20
 
21
  return new WP_REST_Response(
22
  array(
23
- 'success' => true,
24
  'subscriptions' => $response->subscriptions,
25
  )
26
  );
20
 
21
  return new WP_REST_Response(
22
  array(
23
+ 'success' => true,
24
  'subscriptions' => $response->subscriptions,
25
  )
26
  );
classes/class-wc-rest-connect-tos-controller.php CHANGED
@@ -13,25 +13,31 @@ class WC_REST_Connect_Tos_Controller extends WC_REST_Connect_Base_Controller {
13
  protected $rest_base = 'connect/tos';
14
 
15
  public function get() {
16
- return new WP_REST_Response( array(
17
- 'success' => true,
18
- 'accepted' => WC_Connect_Options::get_option( 'tos_accepted' ),
19
- ), 200 );
 
 
 
20
  }
21
 
22
  public function post( $request ) {
23
  $settings = $request->get_json_params();
24
 
25
- if ( ! $settings || ! isset( $settings[ 'accepted' ] ) || ! $settings[ 'accepted' ] ) {
26
  return new WP_Error( 'bad_request', __( 'Bad request', 'woocommerce-services' ), array( 'status' => 400 ) );
27
  }
28
 
29
  WC_Connect_Options::update_option( 'tos_accepted', true );
30
 
31
- return new WP_REST_Response( array(
32
- 'success' => true,
33
- 'accepted' => WC_Connect_Options::get_option( 'tos_accepted' ),
34
- ), 200 );
 
 
 
35
  }
36
 
37
  /**
13
  protected $rest_base = 'connect/tos';
14
 
15
  public function get() {
16
+ return new WP_REST_Response(
17
+ array(
18
+ 'success' => true,
19
+ 'accepted' => WC_Connect_Options::get_option( 'tos_accepted' ),
20
+ ),
21
+ 200
22
+ );
23
  }
24
 
25
  public function post( $request ) {
26
  $settings = $request->get_json_params();
27
 
28
+ if ( ! $settings || ! isset( $settings['accepted'] ) || ! $settings['accepted'] ) {
29
  return new WP_Error( 'bad_request', __( 'Bad request', 'woocommerce-services' ), array( 'status' => 400 ) );
30
  }
31
 
32
  WC_Connect_Options::update_option( 'tos_accepted', true );
33
 
34
+ return new WP_REST_Response(
35
+ array(
36
+ 'success' => true,
37
+ 'accepted' => WC_Connect_Options::get_option( 'tos_accepted' ),
38
+ ),
39
+ 200
40
+ );
41
  }
42
 
43
  /**
classes/wc-api-dev/class-wc-rest-dev-data-continents-controller.php CHANGED
@@ -54,28 +54,36 @@ class WC_REST_Dev_Data_Continents_Controller extends WC_REST_Dev_Data_Controller
54
  * @since 3.1.0
55
  */
56
  public function register_routes() {
57
- register_rest_route( $this->namespace, '/' . $this->rest_base, array(
 
 
58
  array(
59
- 'methods' => WP_REST_Server::READABLE,
60
- 'callback' => array( $this, 'get_items' ),
61
- 'permission_callback' => array( $this, 'get_items_permissions_check' ),
62
- ),
63
- 'schema' => array( $this, 'get_public_item_schema' ),
64
- ) );
65
- register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<location>[\w-]+)', array(
 
 
 
 
66
  array(
67
- 'methods' => WP_REST_Server::READABLE,
68
- 'callback' => array( $this, 'get_item' ),
69
- 'permission_callback' => array( $this, 'get_items_permissions_check' ),
70
- 'args' => array(
71
- 'continent' => array(
72
- 'description' => __( '2 character continent code.', 'woocommerce' ),
73
- 'type' => 'string',
 
 
74
  ),
75
  ),
76
- ),
77
- 'schema' => array( $this, 'get_public_item_schema' ),
78
- ) );
79
  }
80
 
81
  /**
@@ -117,7 +125,7 @@ class WC_REST_Dev_Data_Continents_Controller extends WC_REST_Dev_Data_Controller
117
  * Prepare the data object for response.
118
  *
119
  * @since 3.1.0
120
- * @param object $item Data object.
121
  * @param WP_REST_Request $request Request object.
122
  * @return WP_REST_Response $response Response data.
123
  */
@@ -148,8 +156,8 @@ class WC_REST_Dev_Data_Continents_Controller extends WC_REST_Dev_Data_Controller
148
  */
149
  protected function prepare_links( $item ) {
150
  $continent_code = strtolower( $item['code'] );
151
- $links = array(
152
- 'self' => array(
153
  'href' => rest_url( sprintf( '/%s/%s/%s', $this->namespace, $this->rest_base, $continent_code ) ),
154
  ),
155
  'collection' => array(
@@ -167,17 +175,17 @@ class WC_REST_Dev_Data_Continents_Controller extends WC_REST_Dev_Data_Controller
167
  */
168
  public function get_item_schema() {
169
  $schema = array(
170
- '$schema' => 'http://json-schema.org/draft-04/schema#',
171
- 'title' => 'data_continents',
172
  'type' => 'object',
173
  'properties' => array(
174
- 'code' => array(
175
  'type' => 'string',
176
  'description' => __( '2 character continent code.', 'woocommerce' ),
177
  'context' => array( 'view' ),
178
  'readonly' => true,
179
  ),
180
- 'name' => array(
181
  'type' => 'string',
182
  'description' => __( 'Full name of continent.', 'woocommerce' ),
183
  'context' => array( 'view' ),
@@ -193,25 +201,25 @@ class WC_REST_Dev_Data_Continents_Controller extends WC_REST_Dev_Data_Controller
193
  'context' => array( 'view' ),
194
  'readonly' => true,
195
  'properties' => array(
196
- 'code' => array(
197
  'type' => 'string',
198
  'description' => __( 'ISO3166 alpha-2 country code.', 'woocommerce' ),
199
  'context' => array( 'view' ),
200
  'readonly' => true,
201
  ),
202
- 'currency_code' => array(
203
  'type' => 'string',
204
  'description' => __( 'Default ISO4127 alpha-3 currency code for the country.', 'woocommerce' ),
205
  'context' => array( 'view' ),
206
  'readonly' => true,
207
  ),
208
- 'currency_pos' => array(
209
  'type' => 'string',
210
  'description' => __( 'Currency symbol position for this country.', 'woocommerce' ),
211
  'context' => array( 'view' ),
212
  'readonly' => true,
213
  ),
214
- 'decimal_sep' => array(
215
  'type' => 'string',
216
  'description' => __( 'Decimal separator for displayed prices for this country.', 'woocommerce' ),
217
  'context' => array( 'view' ),
@@ -223,19 +231,19 @@ class WC_REST_Dev_Data_Continents_Controller extends WC_REST_Dev_Data_Controller
223
  'context' => array( 'view' ),
224
  'readonly' => true,
225
  ),
226
- 'name' => array(
227
  'type' => 'string',
228
  'description' => __( 'Full name of country.', 'woocommerce' ),
229
  'context' => array( 'view' ),
230
  'readonly' => true,
231
  ),
232
- 'num_decimals' => array(
233
  'type' => 'integer',
234
  'description' => __( 'Number of decimal points shown in displayed prices for this country.', 'woocommerce' ),
235
  'context' => array( 'view' ),
236
  'readonly' => true,
237
  ),
238
- 'states' => array(
239
  'type' => 'array',
240
  'description' => __( 'List of states in this country.', 'woocommerce' ),
241
  'context' => array( 'view' ),
@@ -260,13 +268,13 @@ class WC_REST_Dev_Data_Continents_Controller extends WC_REST_Dev_Data_Controller
260
  ),
261
  ),
262
  ),
263
- 'thousand_sep' => array(
264
  'type' => 'string',
265
  'description' => __( 'Thousands separator for displayed prices in this country.', 'woocommerce' ),
266
  'context' => array( 'view' ),
267
  'readonly' => true,
268
  ),
269
- 'weight_unit' => array(
270
  'type' => 'string',
271
  'description' => __( 'The unit weights are defined in for this country.', 'woocommerce' ),
272
  'context' => array( 'view' ),
54
  * @since 3.1.0
55
  */
56
  public function register_routes() {
57
+ register_rest_route(
58
+ $this->namespace,
59
+ '/' . $this->rest_base,
60
  array(
61
+ array(
62
+ 'methods' => WP_REST_Server::READABLE,
63
+ 'callback' => array( $this, 'get_items' ),
64
+ 'permission_callback' => array( $this, 'get_items_permissions_check' ),
65
+ ),
66
+ 'schema' => array( $this, 'get_public_item_schema' ),
67
+ )
68
+ );
69
+ register_rest_route(
70
+ $this->namespace,
71
+ '/' . $this->rest_base . '/(?P<location>[\w-]+)',
72
  array(
73
+ array(
74
+ 'methods' => WP_REST_Server::READABLE,
75
+ 'callback' => array( $this, 'get_item' ),
76
+ 'permission_callback' => array( $this, 'get_items_permissions_check' ),
77
+ 'args' => array(
78
+ 'continent' => array(
79
+ 'description' => __( '2 character continent code.', 'woocommerce' ),
80
+ 'type' => 'string',
81
+ ),
82
  ),
83
  ),
84
+ 'schema' => array( $this, 'get_public_item_schema' ),
85
+ )
86
+ );
87
  }
88
 
89
  /**
125
  * Prepare the data object for response.
126
  *
127
  * @since 3.1.0
128
+ * @param object $item Data object.
129
  * @param WP_REST_Request $request Request object.
130
  * @return WP_REST_Response $response Response data.
131
  */
156
  */
157
  protected function prepare_links( $item ) {
158
  $continent_code = strtolower( $item['code'] );
159
+ $links = array(
160
+ 'self' => array(
161
  'href' => rest_url( sprintf( '/%s/%s/%s', $this->namespace, $this->rest_base, $continent_code ) ),
162
  ),
163
  'collection' => array(
175
  */
176
  public function get_item_schema() {
177
  $schema = array(
178
+ '$schema' => 'http://json-schema.org/draft-04/schema#',
179
+ 'title' => 'data_continents',
180
  'type' => 'object',
181
  'properties' => array(
182
+ 'code' => array(
183
  'type' => 'string',
184
  'description' => __( '2 character continent code.', 'woocommerce' ),
185
  'context' => array( 'view' ),
186
  'readonly' => true,
187
  ),
188
+ 'name' => array(
189
  'type' => 'string',
190
  'description' => __( 'Full name of continent.', 'woocommerce' ),
191
  'context' => array( 'view' ),
201
  'context' => array( 'view' ),
202
  'readonly' => true,
203
  'properties' => array(
204
+ 'code' => array(
205
  'type' => 'string',
206
  'description' => __( 'ISO3166 alpha-2 country code.', 'woocommerce' ),
207
  'context' => array( 'view' ),
208
  'readonly' => true,
209
  ),
210
+ 'currency_code' => array(
211
  'type' => 'string',
212
  'description' => __( 'Default ISO4127 alpha-3 currency code for the country.', 'woocommerce' ),
213
  'context' => array( 'view' ),
214
  'readonly' => true,
215
  ),
216
+ 'currency_pos' => array(
217
  'type' => 'string',
218
  'description' => __( 'Currency symbol position for this country.', 'woocommerce' ),
219
  'context' => array( 'view' ),
220
  'readonly' => true,
221
  ),
222
+ 'decimal_sep' => array(
223
  'type' => 'string',
224
  'description' => __( 'Decimal separator for displayed prices for this country.', 'woocommerce' ),
225
  'context' => array( 'view' ),
231
  'context' => array( 'view' ),
232
  'readonly' => true,
233
  ),
234
+ 'name' => array(
235
  'type' => 'string',
236
  'description' => __( 'Full name of country.', 'woocommerce' ),
237
  'context' => array( 'view' ),
238
  'readonly' => true,
239
  ),
240
+ 'num_decimals' => array(
241
  'type' => 'integer',
242
  'description' => __( 'Number of decimal points shown in displayed prices for this country.', 'woocommerce' ),
243
  'context' => array( 'view' ),
244
  'readonly' => true,
245
  ),
246
+ 'states' => array(
247
  'type' => 'array',
248
  'description' => __( 'List of states in this country.', 'woocommerce' ),
249
  'context' => array( 'view' ),
268
  ),
269
  ),
270
  ),
271
+ 'thousand_sep' => array(
272
  'type' => 'string',
273
  'description' => __( 'Thousands separator for displayed prices in this country.', 'woocommerce' ),
274
  'context' => array( 'view' ),
275
  'readonly' => true,
276
  ),
277
+ 'weight_unit' => array(
278
  'type' => 'string',
279
  'description' => __( 'The unit weights are defined in for this country.', 'woocommerce' ),
280
  'context' => array( 'view' ),
classes/wc-api-dev/class-wc-rest-dev-data-controller.php CHANGED
@@ -44,14 +44,18 @@ class WC_REST_Dev_Data_Controller extends WC_REST_Controller {
44
  * @since 3.1.0
45
  */
46
  public function register_routes() {
47
- register_rest_route( $this->namespace, '/' . $this->rest_base, array(
 
 
48
  array(
49
- 'methods' => WP_REST_Server::READABLE,
50
- 'callback' => array( $this, 'get_items' ),
51
- 'permission_callback' => array( $this, 'get_items_permissions_check' ),
52
- ),
53
- 'schema' => array( $this, 'get_public_item_schema' ),
54
- ) );
 
 
55
  }
56
 
57
  /**
@@ -90,7 +94,7 @@ class WC_REST_Dev_Data_Controller extends WC_REST_Controller {
90
  * @return WP_Error|WP_REST_Response
91
  */
92
  public function get_items( $request ) {
93
- $data = array();
94
  $resources = array(
95
  array(
96
  'slug' => 'continents',
@@ -117,7 +121,7 @@ class WC_REST_Dev_Data_Controller extends WC_REST_Controller {
117
  /**
118
  * Prepare a data resource object for serialization.
119
  *
120
- * @param stdClass $report Report data.
121
  * @param WP_REST_Request $request Request object.
122
  * @return WP_REST_Response $response Response data.
123
  */
@@ -145,7 +149,7 @@ class WC_REST_Dev_Data_Controller extends WC_REST_Controller {
145
  */
146
  protected function prepare_links( $item ) {
147
  $links = array(
148
- 'self' => array(
149
  'href' => rest_url( sprintf( '/%s/%s/%s', $this->namespace, $this->rest_base, $item->slug ) ),
150
  ),
151
  'collection' => array(
@@ -168,7 +172,7 @@ class WC_REST_Dev_Data_Controller extends WC_REST_Controller {
168
  'title' => 'data_index',
169
  'type' => 'object',
170
  'properties' => array(
171
- 'slug' => array(
172
  'description' => __( 'Data resource ID.', 'woocommerce' ),
173
  'type' => 'string',
174
  'context' => array( 'view' ),
44
  * @since 3.1.0
45
  */
46
  public function register_routes() {
47
+ register_rest_route(
48
+ $this->namespace,
49
+ '/' . $this->rest_base,
50
  array(
51
+ array(
52
+ 'methods' => WP_REST_Server::READABLE,
53
+ 'callback' => array( $this, 'get_items' ),
54
+ 'permission_callback' => array( $this, 'get_items_permissions_check' ),
55
+ ),
56
+ 'schema' => array( $this, 'get_public_item_schema' ),
57
+ )
58
+ );
59
  }
60
 
61
  /**
94
  * @return WP_Error|WP_REST_Response
95
  */
96
  public function get_items( $request ) {
97
+ $data = array();
98
  $resources = array(
99
  array(
100
  'slug' => 'continents',
121
  /**
122
  * Prepare a data resource object for serialization.
123
  *
124
+ * @param stdClass $report Report data.
125
  * @param WP_REST_Request $request Request object.
126
  * @return WP_REST_Response $response Response data.
127
  */
149
  */
150
  protected function prepare_links( $item ) {
151
  $links = array(
152
+ 'self' => array(
153
  'href' => rest_url( sprintf( '/%s/%s/%s', $this->namespace, $this->rest_base, $item->slug ) ),
154
  ),
155
  'collection' => array(
172
  'title' => 'data_index',
173
  'type' => 'object',
174
  'properties' => array(
175
+ 'slug' => array(
176
  'description' => __( 'Data resource ID.', 'woocommerce' ),
177
  'type' => 'string',
178
  'context' => array( 'view' ),
dist/chunks/{dc2a98ccd7e966cd26b2.css → 12f4c44069a2151d0dc0.css} RENAMED
File without changes
dist/chunks/12f4c44069a2151d0dc0.min.js ADDED
@@ -0,0 +1 @@
 
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[146],{532:function(e,t,n){"use strict";n.d(t,"a",function(){return r});n(1),n(560);function r(e){return e.ui.selectedSiteId}},535:function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return i}),n.d(t,"d",function(){return a}),n.d(t,"e",function(){return o}),n.d(t,"c",function(){return c}),n.d(t,"f",function(){return u}),n.d(t,"h",function(){return s}),n.d(t,"g",function(){return d}),n.d(t,"j",function(){return f}),n.d(t,"i",function(){return l}),n.d(t,"k",function(){return O}),n.d(t,"l",function(){return E}),n.d(t,"p",function(){return b}),n.d(t,"q",function(){return p}),n.d(t,"r",function(){return m}),n.d(t,"s",function(){return _}),n.d(t,"t",function(){return g}),n.d(t,"u",function(){return I}),n.d(t,"y",function(){return v}),n.d(t,"z",function(){return h}),n.d(t,"A",function(){return S}),n.d(t,"v",function(){return j}),n.d(t,"w",function(){return C}),n.d(t,"x",function(){return R}),n.d(t,"C",function(){return y}),n.d(t,"E",function(){return P}),n.d(t,"D",function(){return M}),n.d(t,"B",function(){return N}),n.d(t,"F",function(){return T}),n.d(t,"G",function(){return A}),n.d(t,"H",function(){return L}),n.d(t,"I",function(){return k}),n.d(t,"J",function(){return D}),n.d(t,"K",function(){return w}),n.d(t,"m",function(){return W}),n.d(t,"n",function(){return G}),n.d(t,"o",function(){return U}),n.d(t,"L",function(){return H}),n.d(t,"M",function(){return V}),n.d(t,"N",function(){return F}),n.d(t,"O",function(){return x}),n.d(t,"P",function(){return B}),n.d(t,"Q",function(){return z}),n.d(t,"R",function(){return q}),n.d(t,"W",function(){return Z}),n.d(t,"X",function(){return Q}),n.d(t,"Y",function(){return K}),n.d(t,"Z",function(){return Y}),n.d(t,"ab",function(){return J}),n.d(t,"bb",function(){return X}),n.d(t,"cb",function(){return $}),n.d(t,"db",function(){return ee}),n.d(t,"eb",function(){return te}),n.d(t,"fb",function(){return ne}),n.d(t,"gb",function(){return re}),n.d(t,"hb",function(){return ie}),n.d(t,"ib",function(){return ae}),n.d(t,"jb",function(){return oe}),n.d(t,"kb",function(){return ce}),n.d(t,"lb",function(){return ue}),n.d(t,"mb",function(){return se}),n.d(t,"nb",function(){return de}),n.d(t,"ob",function(){return fe}),n.d(t,"pb",function(){return le}),n.d(t,"rb",function(){return Oe}),n.d(t,"qb",function(){return Ee}),n.d(t,"sb",function(){return be}),n.d(t,"tb",function(){return pe}),n.d(t,"ub",function(){return me}),n.d(t,"vb",function(){return _e}),n.d(t,"wb",function(){return ge}),n.d(t,"xb",function(){return Ie}),n.d(t,"yb",function(){return ve}),n.d(t,"zb",function(){return he}),n.d(t,"Ab",function(){return Se}),n.d(t,"Bb",function(){return je}),n.d(t,"Cb",function(){return Ce}),n.d(t,"Db",function(){return Re}),n.d(t,"Eb",function(){return ye}),n.d(t,"Fb",function(){return Pe}),n.d(t,"Gb",function(){return Me}),n.d(t,"Hb",function(){return Ne}),n.d(t,"Ib",function(){return Te}),n.d(t,"U",function(){return Ae}),n.d(t,"V",function(){return Le}),n.d(t,"S",function(){return ke}),n.d(t,"T",function(){return De});var r="WOOCOMMERCE_ACTION_LIST_ANNOTATE",i="WOOCOMMERCE_ACTION_LIST_CLEAR",a="WOOCOMMERCE_ACTION_LIST_STEP_NEXT",o="WOOCOMMERCE_ACTION_LIST_STEP_SUCCESS",c="WOOCOMMERCE_ACTION_LIST_STEP_FAILURE",u="WOOCOMMERCE_COUNT_REQUEST",s="WOOCOMMERCE_COUNT_REQUEST_SUCCESS",d="WOOCOMMERCE_COUNT_REQUEST_FAILURE",f="WOOCOMMERCE_ERROR_SET",l="WOOCOMMERCE_ERROR_CLEAR",O="WOOCOMMERCE_LOCATIONS_REQUEST",E="WOOCOMMERCE_LOCATIONS_REQUEST_SUCCESS",b="WOOCOMMERCE_ORDER_DELETE",p="WOOCOMMERCE_ORDER_DELETE_FAILURE",m="WOOCOMMERCE_ORDER_DELETE_SUCCESS",_="WOOCOMMERCE_ORDER_INVOICE_SEND",g="WOOCOMMERCE_ORDER_INVOICE_SEND_FAILURE",I="WOOCOMMERCE_ORDER_INVOICE_SEND_SUCCESS",v="WOOCOMMERCE_ORDER_NOTE_CREATE",h="WOOCOMMERCE_ORDER_NOTE_CREATE_FAILURE",S="WOOCOMMERCE_ORDER_NOTE_CREATE_SUCCESS",j="WOOCOMMERCE_ORDER_NOTES_REQUEST",C="WOOCOMMERCE_ORDER_NOTES_REQUEST_FAILURE",R="WOOCOMMERCE_ORDER_NOTES_REQUEST_SUCCESS",y="WOOCOMMERCE_ORDER_REFUND_CREATE",P="WOOCOMMERCE_ORDER_REFUND_CREATE_SUCCESS",M="WOOCOMMERCE_ORDER_REFUND_CREATE_FAILURE",N="WOOCOMMERCE_ORDER_REFUNDS_REQUEST_SUCCESS",T="WOOCOMMERCE_ORDER_REQUEST",A="WOOCOMMERCE_ORDER_REQUEST_FAILURE",L="WOOCOMMERCE_ORDER_REQUEST_SUCCESS",k="WOOCOMMERCE_ORDER_UPDATE",D="WOOCOMMERCE_ORDER_UPDATE_FAILURE",w="WOOCOMMERCE_ORDER_UPDATE_SUCCESS",W="WOOCOMMERCE_ORDERS_REQUEST",G="WOOCOMMERCE_ORDERS_REQUEST_FAILURE",U="WOOCOMMERCE_ORDERS_REQUEST_SUCCESS",H="WOOCOMMERCE_SERVICES_SHIPPING_ACTION_LIST_CREATE",V="WOOCOMMERCE_SETTINGS_PRODUCTS_CHANGE_SETTING",F="WOOCOMMERCE_SETTINGS_PRODUCTS_REQUEST",x="WOOCOMMERCE_SETTINGS_PRODUCTS_REQUEST_SUCCESS",B="WOOCOMMERCE_SETTINGS_PRODUCTS_UPDATE_REQUEST",z="WOOCOMMERCE_SETTINGS_PRODUCTS_UPDATE_REQUEST_FAILURE",q="WOOCOMMERCE_SETTINGS_PRODUCTS_UPDATE_REQUEST_SUCCESS",Z="WOOCOMMERCE_SHIPPING_ZONE_ADD",Q="WOOCOMMERCE_SHIPPING_ZONE_CANCEL",K="WOOCOMMERCE_SHIPPING_ZONE_CLOSE",Y="WOOCOMMERCE_SHIPPING_ZONE_DELETED",J="WOOCOMMERCE_SHIPPING_ZONE_EDIT_NAME",X="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_CANCEL",$="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_CLOSE",ee="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_EDIT",te="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_EDIT_POSTCODE",ne="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_FILTER_BY_POSTCODE",re="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_FILTER_BY_STATE",ie="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_FILTER_BY_WHOLE_COUNTRY",ae="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_SELECT_CONTINENT",oe="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_SELECT_COUNTRY",ce="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_SELECT_STATE",ue="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_UPDATED",se="WOOCOMMERCE_SHIPPING_ZONE_METHODS_REQUEST",de="WOOCOMMERCE_SHIPPING_ZONE_METHODS_REQUEST_SUCCESS",fe="WOOCOMMERCE_SHIPPING_ZONE_METHOD_ADD",le="WOOCOMMERCE_SHIPPING_ZONE_METHOD_CANCEL",Oe="WOOCOMMERCE_SHIPPING_ZONE_METHOD_CLOSE",Ee="WOOCOMMERCE_SHIPPING_ZONE_METHOD_CHANGE_TYPE",be="WOOCOMMERCE_SHIPPING_ZONE_METHOD_CREATE",pe="WOOCOMMERCE_SHIPPING_ZONE_METHOD_DELETE",me="WOOCOMMERCE_SHIPPING_ZONE_METHOD_DELETED",_e="WOOCOMMERCE_SHIPPING_ZONE_METHOD_EDIT_TITLE",ge="WOOCOMMERCE_SHIPPING_ZONE_METHOD_OPEN",Ie="WOOCOMMERCE_SHIPPING_ZONE_METHOD_REMOVE",ve="WOOCOMMERCE_SHIPPING_ZONE_METHOD_SET_CONDITION",he="WOOCOMMERCE_SHIPPING_ZONE_METHOD_SET_COST",Se="WOOCOMMERCE_SHIPPING_ZONE_METHOD_SET_MIN_COST",je="WOOCOMMERCE_SHIPPING_ZONE_METHOD_SET_TAXABLE",Ce="WOOCOMMERCE_SHIPPING_ZONE_METHOD_TOGGLE_ENABLED",Re="WOOCOMMERCE_SHIPPING_ZONE_METHOD_TOGGLE_OPENED_ENABLED",ye="WOOCOMMERCE_SHIPPING_ZONE_METHOD_UPDATE",Pe="WOOCOMMERCE_SHIPPING_ZONE_METHOD_UPDATED",Me="WOOCOMMERCE_SHIPPING_ZONE_OPEN",Ne="WOOCOMMERCE_SHIPPING_ZONE_REMOVE",Te="WOOCOMMERCE_SHIPPING_ZONE_UPDATED",Ae="WOOCOMMERCE_SHIPPING_ZONES_REQUEST",Le="WOOCOMMERCE_SHIPPING_ZONES_REQUEST_SUCCESS",ke="WOOCOMMERCE_SHIPPING_CLASSES_REQUEST",De="WOOCOMMERCE_SHIPPING_CLASSES_REQUEST_SUCCESS"},537:function(e,t,n){"use strict";n.d(t,"j",function(){return E}),n.d(t,"t",function(){return b}),n.d(t,"s",function(){return p}),n.d(t,"r",function(){return m}),n.d(t,"h",function(){return _}),n.d(t,"g",function(){return g}),n.d(t,"v",function(){return I}),n.d(t,"u",function(){return v}),n.d(t,"m",function(){return h}),n.d(t,"e",function(){return S}),n.d(t,"l",function(){return j}),n.d(t,"p",function(){return C}),n.d(t,"n",function(){return M}),n.d(t,"f",function(){return A}),n.d(t,"o",function(){return L}),n.d(t,"q",function(){return k}),n.d(t,"d",function(){return D}),n.d(t,"b",function(){return w}),n.d(t,"i",function(){return W}),n.d(t,"c",function(){return G}),n.d(t,"k",function(){return U}),n.d(t,"a",function(){return H});var r=n(1),i=n(35),a=n(542),o=n(532),c=n(551),u=n(546),s=n(540),d=n(564),f=n(575),l=n(565),O=n(566),E=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e);return Object(r.get)(e,["extensions","woocommerce","woocommerceServices",n,"shippingLabel",t],null)},b=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),r=E(e,t,n);return r&&r.loaded},p=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),r=E(e,t,n);return r&&r.isFetching},m=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),r=E(e,t,n);return r&&r.error},_=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),r=E(e,t,n);return r&&r.loaded?r.labels:[]},g=function(e,t,n,r){return _(e,t,n).find(function(e){return e.label_id===r})},I=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),r=E(e,t,n);return r&&r.fulfillOrder},v=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),r=E(e,t,n);return r&&r.emailDetails},h=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),r=E(e,t,n);return r&&r.refreshedLabelStatus},S=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),r=E(e,t,n);return r&&r.form},j=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),a=S(e,t,n);if(!a)return null;var c=a.rates,u=c.values,s=c.available,d=[],f=0,l=0,O=function(e){if(!(e in s))return"continue";var t=u[e],n=t.serviceId,a=t.signatureRequired,o=s[e].default.rates,c=null,O=null;a in s[e]&&(c=s[e][a].rates,O=Object(r.find)(c,function(e){return n===e.service_id})||null);var E=Object(r.find)(o,function(e){return n===e.service_id});if(E){var b=E.retail_rate-E.rate,p=E.rate,m={title:E.title,retailRate:E.retail_rate,rateWithDiscount:p,addons:[],carrierId:E.carrier_id,carrierTitle:E.title.split("-")[0].trim()};null!==O&&(m.addons=[{title:Object(i.translate)("Signature Required"),rate:O.rate-E.rate}],p=O.rate),d.push(m),f+=Object(r.round)(b,2),l+=p}};for(var E in u)O(E);return d.length?{prices:d,discount:f,total:l}:null},C=Object(a.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),i=S(e,t,n);if(Object(r.isEmpty)(i))return!1;var a=Object(d.a)(i.origin),c=Object(d.a)(i.destination);return!("US"!==a.country||!Object(r.includes)(f.d,a.state))||(!("US"!==c.country||!Object(r.includes)(f.d,c.state))||a.country!==c.country&&(!Object(r.includes)(f.b,a.country)||!Object(r.includes)(f.b,c.country)))},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e);return[S(e,t,n)]}),R=function(e,t,n,a){var o=t.values,c=Object(d.a)(t),u=c.phone,s=c.postcode,O=c.state,E=c.country,b={};return["name","address","city","postcode","country"].forEach(function(e){o[e]||(b[e]=Object(i.translate)("This field is required"))}),Object(r.includes)(f.a,E)&&!/^\d{5}(?:-\d{4})?$/.test(s)&&(b.postcode=Object(i.translate)("Invalid ZIP/Postal code format")),!O&&Object(l.j)(e,E,n)&&(b.state=Object(i.translate)("This field is required")),a&&(u?10!==u.split(/\D+/g).join("").replace(/^1/,"").length&&(b.phone=Object(i.translate)("Customs forms require a 10-digit phone number. Please edit your phone number so it has at most 10 digits.")):b.phone=Object(i.translate)("Please enter a phone number for your origin address. It's required because this shipment requires a customs form.")),b},y=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=e.isNormalized,o=e.isUnverifiable,c=e.normalized,u=e.ignoreValidation,s=e.fieldErrors;if((a||o)&&!c&&s)return s;if(a&&!c)return{address:Object(i.translate)("This address is not recognized. Please try another.")};var d=R(t,e,n,r);return u&&Object.keys(d).forEach(function(e){u[e]&&delete d[e]}),d},P=function(e,t,n,a){var o=Object(r.uniq)(Object(r.flatten)(Object(r.map)(e,function(e){return Object(r.map)(e.items,"product_id")}))),c=Object(r.zipObject)(o,Object(r.fill)(Array(o.length),0));Object(r.forEach)(e,function(e){Object(r.forEach)(e.items,function(e){var n=e.quantity,r=e.product_id;return c[r]+=n*t.items[r].value})});var u={};return Object(r.forEach)(Object(r.pick)(t.items,o),function(e,t){e.tariffNumber&&6===e.tariffNumber.length&&(u[e.tariffNumber]||(u[e.tariffNumber]=0),u[e.tariffNumber]+=c[t])}),{packages:Object(r.mapValues)(e,function(e){var o={};"other"!==e.contentsType||e.contentsExplanation||(o.contentsExplanation=Object(i.translate)("Please describe what kind of goods this package contains")),"other"!==e.restrictionType||e.restrictionComments||(o.restrictionComments=Object(i.translate)("Please describe what kind of restrictions this package must have"));var c=new Set;return Object(r.forEach)(e.items,function(e){var n=e.product_id,r=t.items[n].tariffNumber;2500<u[r]&&c.add(r)}),e.itn?/^(?:(?:AES X\d{14})|(?:NOEEI 30\.\d{1,2}(?:\([a-z]\)(?:\(\d\))?)?))$/.test(e.itn)||(o.itn=Object(i.translate)("Invalid format")):"CA"!==n&&(Object(r.isEmpty)(c)?Object(r.includes)(f.c,n)&&(o.itn=Object(i.translate)("International Transaction Number is required for shipments to %(country)s",{args:{country:a}})):o.itn=Object(i.translate)("International Transaction Number is required for shipping items valued over $2,500 per tariff number. Products with tariff number %(code)s add up to more than $2,500.",{args:{code:c.values().next().value}})),o}),items:Object(r.mapValues)(Object(r.pick)(t.items,o),function(e,n){var a={};return e.description||(a.description=Object(i.translate)("This field is required")),t.ignoreWeightValidation[n]||(Object(r.isNil)(e.weight)||""===e.weight?a.weight=Object(i.translate)("This field is required"):parseFloat(e.weight)>0||(a.weight=Object(i.translate)("Weight must be greater than zero"))),t.ignoreValueValidation[n]||(Object(r.isNil)(e.value)||""===e.value?a.value=Object(i.translate)("This field is required"):parseFloat(e.value)>0||(a.value=Object(i.translate)("Declared value must be greater than zero"))),e.tariffNumber&&6!==e.tariffNumber.length&&(a.tariffNumber=Object(i.translate)("The tariff number must be 6 digits long")),a})}},M=function(e){var t=e.values,n=e.available,i=Object(r.map)(n,function(e,n){return t[n]});return!Object(r.isEmpty)(i)&&Object(r.every)(i)},N=function(e){var t=e.values,n=e.available;return Object(r.mapValues)(n,function(e,n){if(!Object(r.isEmpty)(e.default.errors)){var a=e.default.errors.map(function(e){return e.userMessage||e.message}).filter(Boolean);return a.length?a:["We couldn't get a rate for this package, please try again."]}return t[n]&&t[n].serviceId?[]:Object(r.isEmpty)(e.default.rates)?[Object(i.translate)("No rates available, please double check dimensions and weight or try using different packaging.")]:[Object(i.translate)("Please choose a rate")]})},T=function(e){var t={};return e||(t.paperSize=Object(i.translate)("This field is required")),t},A=Object(a.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e);if(!b(e,t,n))return{};var a=E(e,t,n),c=a.form,u=a.paperSize;if(Object(r.isEmpty)(c))return{};var s,d=c.destination.values.country,f=Object(l.g)(e,d,n),O=C(e,t,n);return{origin:y(c.origin,e,n,O),destination:y(c.destination,e,n),packages:(s=c.packages.selected,Object(r.mapValues)(s,function(e){var t={};"not_selected"===e.box_id&&(t.box_id=Object(i.translate)("Please select a package"));var n=function(e){return!Object(r.isFinite)(e)||0>=e};return n(e.weight)&&(t.weight=Object(i.translate)("Invalid weight")),Object(r.some)([e.length,e.width,e.height],n)&&(t.dimensions=Object(i.translate)("Package dimensions must be greater than zero")),t})),customs:P(c.packages.selected,c.customs,d,f),rates:N(c.rates),sidebar:T(u)}},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e);return[E(e,t,n)]}),L=Object(a.a)(function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Object(o.a)(e),i=E(e,t,r).form,a="origin"===n&&C(e,t,r),c=R(e,i[n],r,a);return 0===Object.keys(c).length},function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Object(o.a)(e);return[E(e,t,r).form[n]]}),k=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),i=S(e,t,n);if(!i)return!1;var a=Object(r.uniq)(Object(r.flatten)(Object(r.map)(i.packages.selected,function(e){return Object(r.map)(e.items,"product_id")})));return!Object(r.some)(a.map(function(e){return Object(r.isNil)(i.customs.items[e].tariffNumber)||i.customs.ignoreWeightValidation[e]||i.customs.ignoreValueValidation[e]}))},D=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),i=S(e,t,n);if(!i)return null;var a=A(e,t,n);return i.origin.isNormalized&&Object(r.isEqual)(i.origin.values,i.origin.normalized)&&!Object(c.a)(a.origin)?i.destination.isNormalized&&Object(r.isEqual)(i.destination.values,i.destination.normalized)&&!Object(c.a)(a.destination)?Object(c.a)(a.packages)?"packages":!C(e,t,n)||!Object(c.a)(a.customs)&&k(e,t,n)?Object(c.a)(a.rates)?"rates":null:"customs":"destination":"origin"},w=Object(a.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e),i=S(e,t,n);return!Object(r.isEmpty)(i)&&!D(e,t,n)&&!i.origin.normalizationInProgress&&!i.destination.normalizationInProgress&&!i.rates.retrievalInProgress&&!Object(r.isEmpty)(i.rates.available)},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e);return[S(e,t,n),D(e,t,n)]}),W=Object(a.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(o.a)(e),n=Object(l.d)(e,t);return Object(O.b)(e,t)?Object(r.pick)(n,f.a):Object(r.pick)(n,f.b)},[l.d,O.b]),G=Object(a.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(o.a)(e),n=Object(l.d)(e,t);return Object(O.b)(e,t)?n:Object(r.pick)(n,f.b)},[l.d,O.b]),U=Object(a.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e);if(!Object(l.j)(e,t,n))return null;var i=Object(l.i)(e,t,n),a={};return i.forEach(function(e){var t=e.code,n=e.name;return a[t]=n}),"US"!==t||Object(O.b)(e,n)?a:Object(r.omit)(a,f.d)},[l.i,O.b]),H=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e);return b(e,t,n)&&Object(u.d)(e,n)&&Object(s.i)(e,n)&&Object(l.b)(e,n)}},538:function(e,t,n){"use strict";n.d(t,"b",function(){return r}),n.d(t,"d",function(){return i}),n.d(t,"e",function(){return a}),n.d(t,"f",function(){return o}),n.d(t,"c",function(){return c}),n.d(t,"a",function(){return u}),n.d(t,"g",function(){return s}),n.d(t,"h",function(){return d}),n.d(t,"i",function(){return f}),n.d(t,"j",function(){return l}),n.d(t,"k",function(){return O}),n.d(t,"l",function(){return E}),n.d(t,"m",function(){return b}),n.d(t,"n",function(){return p}),n.d(t,"o",function(){return m}),n.d(t,"q",function(){return _}),n.d(t,"p",function(){return g}),n.d(t,"r",function(){return I}),n.d(t,"s",function(){return v}),n.d(t,"t",function(){return h}),n.d(t,"u",function(){return S}),n.d(t,"v",function(){return j}),n.d(t,"w",function(){return C}),n.d(t,"B",function(){return R}),n.d(t,"x",function(){return y}),n.d(t,"C",function(){return P}),n.d(t,"z",function(){return M}),n.d(t,"A",function(){return N}),n.d(t,"D",function(){return T}),n.d(t,"E",function(){return A}),n.d(t,"F",function(){return L}),n.d(t,"G",function(){return k}),n.d(t,"H",function(){return D}),n.d(t,"I",function(){return w}),n.d(t,"J",function(){return W}),n.d(t,"K",function(){return G}),n.d(t,"L",function(){return U}),n.d(t,"M",function(){return H}),n.d(t,"N",function(){return V}),n.d(t,"y",function(){return F}),n.d(t,"O",function(){return x}),n.d(t,"P",function(){return B}),n.d(t,"Q",function(){return z}),n.d(t,"R",function(){return q}),n.d(t,"S",function(){return Z}),n.d(t,"T",function(){return Q}),n.d(t,"U",function(){return K}),n.d(t,"Ob",function(){return Y}),n.d(t,"V",function(){return J}),n.d(t,"W",function(){return X}),n.d(t,"X",function(){return $}),n.d(t,"Y",function(){return ee}),n.d(t,"Z",function(){return te}),n.d(t,"ab",function(){return ne}),n.d(t,"bb",function(){return re}),n.d(t,"cb",function(){return ie}),n.d(t,"db",function(){return ae}),n.d(t,"eb",function(){return oe}),n.d(t,"fb",function(){return ce}),n.d(t,"gb",function(){return ue}),n.d(t,"hb",function(){return se}),n.d(t,"ib",function(){return de}),n.d(t,"jb",function(){return fe}),n.d(t,"kb",function(){return le}),n.d(t,"lb",function(){return Oe}),n.d(t,"nb",function(){return Ee}),n.d(t,"mb",function(){return be}),n.d(t,"ob",function(){return pe}),n.d(t,"pb",function(){return me}),n.d(t,"qb",function(){return _e}),n.d(t,"rb",function(){return ge}),n.d(t,"sb",function(){return Ie}),n.d(t,"tb",function(){return ve}),n.d(t,"ub",function(){return he}),n.d(t,"vb",function(){return Se}),n.d(t,"wb",function(){return je}),n.d(t,"xb",function(){return Ce}),n.d(t,"zb",function(){return Re}),n.d(t,"Ab",function(){return ye}),n.d(t,"Bb",function(){return Pe}),n.d(t,"Cb",function(){return Me}),n.d(t,"Db",function(){return Ne}),n.d(t,"Eb",function(){return Te}),n.d(t,"Fb",function(){return Ae}),n.d(t,"Gb",function(){return Le}),n.d(t,"Hb",function(){return ke}),n.d(t,"Ib",function(){return De}),n.d(t,"Jb",function(){return we}),n.d(t,"yb",function(){return We}),n.d(t,"Lb",function(){return Ge}),n.d(t,"Kb",function(){return Ue}),n.d(t,"Mb",function(){return He}),n.d(t,"Nb",function(){return Ve}),n.d(t,"Pb",function(){return Fe}),n.d(t,"Qb",function(){return xe}),n.d(t,"Rb",function(){return Be});var r="WOOCOMMERCE_SERVICES_LABELS_INIT_FORM",i="WOOCOMMERCE_SERVICES_LABELS_RESTORE_PRISTINE",a="WOOCOMMERCE_SERVICES_LABELS_SET_FORM_DATA_VALUE",o="WOOCOMMERCE_SERVICES_LABELS_SET_FORM_META_PROPERTY",c="WOOCOMMERCE_SERVICES_LABELS_OPEN_ADD_CARD_DIALOG",u="WOOCOMMERCE_SERVICES_LABELS_CLOSE_ADD_CARD_DIALOG",s="WOOCOMMERCE_SERVICES_PACKAGES_ADD_PACKAGE",d="WOOCOMMERCE_SERVICES_PACKAGES_DISMISS_MODAL",f="WOOCOMMERCE_SERVICES_PACKAGES_EDIT_PACKAGE",l="WOOCOMMERCE_SERVICES_PACKAGES_INIT_PACKAGES_FORM",O="WOOCOMMERCE_SERVICES_PACKAGES_REMOVE_PACKAGE",E="WOOCOMMERCE_SERVICES_PACKAGES_REMOVE_PREDEFINED",b="WOOCOMMERCE_SERVICES_PACKAGES_SAVE_PACKAGE",p="WOOCOMMERCE_SERVICES_PACKAGES_SAVE_PREDEFINED",m="WOOCOMMERCE_SERVICES_PACKAGES_SET_ADD_MODE",_="WOOCOMMERCE_SERVICES_PACKAGES_SET_IS_FETCH_ERROR",g="WOOCOMMERCE_SERVICES_PACKAGES_SET_IS_FETCHING",I="WOOCOMMERCE_SERVICES_PACKAGES_SET_IS_SAVING",v="WOOCOMMERCE_SERVICES_PACKAGES_SET_MODAL_ERROR",h="WOOCOMMERCE_SERVICES_PACKAGES_TOGGLE_ALL_PREDEFINED",S="WOOCOMMERCE_SERVICES_PACKAGES_TOGGLE_OUTER_DIMENSIONS",j="WOOCOMMERCE_SERVICES_PACKAGES_TOGGLE_PREDEFINED",C="WOOCOMMERCE_SERVICES_PACKAGES_UPDATE_PACKAGES_FIELD",R="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_ADD_ITEMS",y="WOOCOMMERCE_SERVICES_SERVICE_SETTINGS_UPDATE_FIELD",P="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_ADD_PACKAGE",M="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_ADDRESS_NORMALIZATION_COMPLETED",N="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_ADDRESS_NORMALIZATION_IN_PROGRESS",T="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLEAR_AVAILABLE_RATES",A="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_ADD_ITEM",L="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_DETAILS_DIALOG",k="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_ITEM_MOVE",D="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_REFUND_DIALOG",w="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_REPRINT_DIALOG",W="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CONFIRM_ADDRESS_SUGGESTION",G="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CONFIRM_REPRINT",U="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_EDIT_ADDRESS",H="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_EDIT_UNVERIFIABLE_ADDRESS",V="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_EXIT_PRINTING_FLOW",F="WOOCOMMERCE_SERVICES_SHIPPING_EXIT_TRACKING_FLOW",x="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_INIT",B="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_MOVE_ITEM",z="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_ADD_ITEM",q="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_DETAILS_DIALOG",Z="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_ITEM_MOVE",Q="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_PACKAGE",K="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_PRINTING_FLOW",Y="WOOCOMMERCE_SERVICES_SHIPPING_OPEN_TRACKING_FLOW",J="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_REFUND_DIALOG",X="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_REPRINT_DIALOG",$="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_PURCHASE_REQUEST",ee="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_PURCHASE_RESPONSE",te="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_RATES_RETRIEVAL_COMPLETED",ne="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_RATES_RETRIEVAL_IN_PROGRESS",re="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REFUND_REQUEST",ie="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REFUND_RESPONSE",ae="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REMOVE_IGNORE_VALIDATION",oe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REMOVE_PACKAGE",ce="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REPRINT_DIALOG_ERROR",ue="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REPRINT_DIALOG_READY",se="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SAVE_CUSTOMS",de="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SAVE_PACKAGES",fe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SELECT_NORMALIZED_ADDRESS",le="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_ABANDON_ON_NON_DELIVERY",Oe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_ADDED_ITEM",Ee="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CONTENTS_TYPE",be="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CONTENTS_EXPLANATION",pe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_DESCRIPTION",me="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_ORIGIN_COUNTRY",_e="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_TARIFF_NUMBER",ge="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_VALUE",Ie="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_WEIGHT",ve="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_EMAIL_DETAILS",he="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_FETCH_ERROR",Se="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_FULFILL_ORDER",je="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_IS_FETCHING",Ce="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_ITN",Re="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_PACKAGE_TYPE",ye="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_RATES",Pe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_RESTRICTION_COMMENTS",Me="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_RESTRICTION_TYPE",Ne="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_TARGET_PACKAGE",Te="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SHOW_PRINT_CONFIRMATION",Ae="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_STATUS_RESPONSE",Le="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_STATUS_RETRIEVAL_IN_PROGRESS",ke="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_TOGGLE_STEP",De="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_UPDATE_ADDRESS_VALUE",we="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_UPDATE_PACKAGE_WEIGHT",We="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_PACKAGE_SIGNATURE",Ge="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_UPDATE_RATE",Ue="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_UPDATE_PAPER_SIZE",He="WOOCOMMERCE_SERVICES_SHIPPING_METHOD_SCHEMA_REQUEST",Ve="WOOCOMMERCE_SERVICES_SHIPPING_METHOD_SCHEMA_REQUEST_SUCCESS",Fe="WOOCOMMERCE_SERVICES_SHIPPING_ZONE_METHOD_SETTINGS_REQUEST",xe="WOOCOMMERCE_SERVICES_SHIPPING_ZONE_METHOD_SETTINGS_REQUEST_SUCCESS",Be="WOOCOMMERCE_SERVICES_SHIPPING_ZONE_METHOD_UPDATE"},539:function(e,t,n){"use strict";n.d(t,"b",function(){return r}),n.d(t,"a",function(){return i});var r="LOADING",i="ERROR"},540:function(e,t,n){"use strict";n.d(t,"e",function(){return E}),n.d(t,"b",function(){return p}),n.d(t,"d",function(){return m}),n.d(t,"a",function(){return _}),n.d(t,"c",function(){return g}),n.d(t,"f",function(){return I}),n.d(t,"i",function(){return v}),n.d(t,"h",function(){return h}),n.d(t,"g",function(){return S});var r=n(110),i=n.n(r),a=n(36),o=n.n(a),c=n(1),u=n(35),s=n(542),d=n(532),f=n(575),l=n(564),O=n(537),E=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e);return Object(c.get)(e,["extensions","woocommerce","woocommerceServices",t,"packages"],null)},b=function(e){return e&&e.predefinedSchema?Object.keys(e.predefinedSchema):[]},p=Object(s.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=E(e,t);if(!n||!n.predefinedSchema||!n.packages)return null;var r=[];Object(c.forEach)(n.predefinedSchema,function(e,t){var i=(n.packages.predefined||{})[t]||[];Object(c.forEach)(e,function(e){var n=e.definitions;Object(c.forEach)(n,function(e){Object(c.includes)(i,e.id)&&r.push(o()({},e,{serviceId:t}))})})});var i=(n.packages.custom||[]).map(function(e,t){return o()({},e,{index:t})});return Object(c.orderBy)(r.concat(i),"name")},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=E(e,t);if(!n||!n.packages)return[];var r=b(n);return[].concat(i()(n.packages.custom||[]),i()(r.map(function(e){return(n.packages.predefined||{})[e]})))}),m=Object(s.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(d.a)(e),r=E(e,n);if(!r||!r.predefinedSchema||!r.packages)return null;var i=Object(O.e)(e,t,n),a=Object(l.a)(i.origin).country,o=Object(l.a)(i.destination).country,s=f.a.includes(a)&&!f.a.includes(o),b={custom:{title:Object(u.translate)("Custom Packages"),definitions:r.packages.custom}};return Object(c.forEach)(r.predefinedSchema,function(e,t){var n=(r.packages.predefined||{})[t]||[];Object(c.forEach)(e,function(e,t){var r=e.definitions,i={title:e.title,definitions:[]};Object(c.forEach)(r,function(e){s&&!1===e.can_ship_international||Object(c.includes)(n,e.id)&&i.definitions.push(e)}),i.definitions.length&&(b[t]=i)})}),b},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(d.a)(e),r=E(e,n);if(!r||!r.packages)return[];var a=b(r),o=Object(O.e)(e,t,n),c=Object(l.a)(o.origin).country,u=Object(l.a)(o.destination).country;return[].concat(i()(r.packages.custom||[]),i()(a.map(function(e){return(r.packages.predefined||{})[e]})),[c,u])}),_=Object(s.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=E(e,t);if(!n||!n.predefinedSchema||!n.packages)return null;var r={};return Object(c.forEach)(n.packages.custom,function(e){r[e.name]=e}),Object(c.forEach)(n.predefinedSchema,function(e){Object(c.forEach)(e,function(e){var t=e.definitions;Object(c.forEach)(t,function(e){r[e.id]=e})})}),r},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=E(e,t);if(!n||!n.packages)return[];var r=b(n);return[].concat(i()(n.packages.custom||[]),i()(r.map(function(e){return(n.packages.predefined||{})[e]})))}),g=Object(s.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=E(e,t);if(!n||!n.currentlyEditingPredefinedPackages)return null;var r={},i=n.predefinedSchema,a=n.currentlyEditingPredefinedPackages;return Object(c.forEach)(i,function(e,t){var n=a[t]||[];Object(c.forEach)(e,function(e,i){var a={groupId:i,serviceId:t,title:e.title,packages:[],total:e.definitions.length,selected:0};Object(c.forEach)(e.definitions,function(e){var r=Object(c.includes)(n,e.id);r&&a.selected++,a.packages.push(o()({},e,{selected:r,serviceId:t}))}),r["".concat(t,"-").concat(i)]=a})}),r},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=E(e,t);if(!n||!n.currentlyEditingPredefinedPackages)return[];var r=b(n);return i()(r.map(function(e){return n.currentlyEditingPredefinedPackages[e]}))}),I=Object(s.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=0,r=0,i=E(e,t);if(!i||!i.currentlyEditingPredefinedPackages)return{added:n,removed:r};var a=i.packages&&i.packages.predefined?i.packages.predefined:{},o=i.currentlyEditingPredefinedPackages;return Object.keys(o).forEach(function(e){var t=a[e],r=o[e];t?r.forEach(function(e){Object(c.includes)(t,e)||n++}):n+=r.length}),Object.keys(a).forEach(function(e){var t=a[e],n=o[e];n?t.forEach(function(e){Object(c.includes)(n,e)||r++}):r+=t.length}),{added:n,removed:r}},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=E(e,t);if(!n||!n.currentlyEditingPredefinedPackages)return[];var r=b(n);return[].concat(i()(r.map(function(e){return n.packages&&n.packages.predefined&&n.packages.predefined[e]})),i()(r.map(function(e){return n.currentlyEditingPredefinedPackages[e]})))}),v=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=E(e,t);return n&&n.isLoaded},h=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=E(e,t);return n&&n.isFetching},S=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(d.a)(e),n=E(e,t);return n&&n.isFetchError}},541:function(e,t,n){"use strict";n.d(t,"e",function(){return r}),n.d(t,"c",function(){return h}),n.d(t,"d",function(){return S}),n.d(t,"b",function(){return j}),n.d(t,"a",function(){return C});var r={};n.r(r),n.d(r,"accountSettings",function(){return a}),n.d(r,"packages",function(){return o}),n.d(r,"orderLabels",function(){return c}),n.d(r,"getLabelRates",function(){return u}),n.d(r,"labelStatus",function(){return s}),n.d(r,"labelRefund",function(){return d}),n.d(r,"labelsPrint",function(){return f}),n.d(r,"labelTestPrint",function(){return l}),n.d(r,"addressNormalization",function(){return O}),n.d(r,"serviceSettings",function(){return E}),n.d(r,"shippingCarrier",function(){return b}),n.d(r,"shippingCarriers",function(){return p}),n.d(r,"subscriptions",function(){return m}),n.d(r,"subscriptionActivate",function(){return _}),n.d(r,"shippingCarrierDelete",function(){return g}),n.d(r,"shippingCarrierTypes",function(){return I});var i=n(563),a="connect/account/settings",o="connect/packages",c=function(e){return"connect/label/".concat(e)},u=function(e){return"connect/label/".concat(e,"/rates")},s=function(e,t){return"connect/label/".concat(e,"/").concat(t)},d=function(e,t){return"connect/label/".concat(e,"/").concat(t,"/refund")},f=function(){return"connect/label/print"},l=function(){return"connect/label/preview"},O=function(){return"connect/normalize-address"},E=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"connect/services/".concat(e,"/").concat(t)},b=function(){return"connect/shipping/carrier"},p=function(){return"connect/shipping/carriers"},m=function(){return"connect/subscriptions"},_=function(e){return"connect/subscription/".concat(e,"/activate")},g=function(e){return"connect/shipping/carrier/".concat(e)},I=function(){return"connect/shipping/carrier-types"},v=function(e){if(e&&e.message)throw e.message;if(e&&e.data&&e.data.message)throw e.data.message;throw e},h=function(e,t,n){return Object(i.a)(e).post(t,n,"wc/v1").catch(v)},S=function(e,t,n){return Object(i.a)(e).put(t,n,"wc/v1").catch(v)},j=function(e,t){return Object(i.a)(e).get(t,"wc/v1").catch(v)},C=function(e,t){return Object(i.a)(e).del(t,"wc/v1").catch(v)}},542:function(e,t,n){"use strict";n.d(t,"a",function(){return s});var r=n(1),i=n(603),a=n.n(i),o=(n(113),function(e){return e}),c=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.join()},u=function(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return e.map(function(e){return e.apply(void 0,[t].concat(r))})}};function s(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:c,s=Object(r.memoize)(e,i);return Array.isArray(n)&&(n=u(n)),Object.assign(function(e){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];var c=n.apply(void 0,[e].concat(i));return Array.isArray(c)||(c=[c]),t&&!a()(c,t)&&s.cache.clear(),t=c,s.apply(void 0,[e].concat(i))},{memoizedSelector:s})}},543:function(e,t,n){"use strict";n.d(t,"q",function(){return y}),n.d(t,"U",function(){return P}),n.d(t,"x",function(){return L}),n.d(t,"A",function(){return k}),n.d(t,"o",function(){return D}),n.d(t,"p",function(){return w}),n.d(t,"V",function(){return W}),n.d(t,"C",function(){return G}),n.d(t,"m",function(){return U}),n.d(t,"n",function(){return H}),n.d(t,"g",function(){return V}),n.d(t,"T",function(){return F}),n.d(t,"W",function(){return x}),n.d(t,"w",function(){return B}),n.d(t,"v",function(){return z}),n.d(t,"s",function(){return q}),n.d(t,"d",function(){return Z}),n.d(t,"S",function(){return Q}),n.d(t,"t",function(){return K}),n.d(t,"b",function(){return Y}),n.d(t,"E",function(){return J}),n.d(t,"a",function(){return X}),n.d(t,"P",function(){return $}),n.d(t,"i",function(){return ee}),n.d(t,"G",function(){return te}),n.d(t,"F",function(){return ne}),n.d(t,"R",function(){return re}),n.d(t,"Q",function(){return ie}),n.d(t,"D",function(){return ae}),n.d(t,"O",function(){return oe}),n.d(t,"H",function(){return ce}),n.d(t,"J",function(){return ue}),n.d(t,"L",function(){return se}),n.d(t,"K",function(){return de}),n.d(t,"I",function(){return fe}),n.d(t,"h",function(){return le}),n.d(t,"Y",function(){return Oe}),n.d(t,"M",function(){return Ee}),n.d(t,"N",function(){return be}),n.d(t,"B",function(){return Se}),n.d(t,"j",function(){return je}),n.d(t,"y",function(){return Ce}),n.d(t,"r",function(){return Re}),n.d(t,"e",function(){return ye}),n.d(t,"k",function(){return Pe}),n.d(t,"z",function(){return Me}),n.d(t,"f",function(){return Ne}),n.d(t,"l",function(){return Te}),n.d(t,"X",function(){return Ae}),n.d(t,"u",function(){return Le}),n.d(t,"c",function(){return ke});var r=n(110),i=n.n(r),a=n(36),o=n.n(a),c=n(35),u=n(1),s=n(541),d=Object(u.memoize)(function(){if(Object(u.get)(window,"navigator.msSaveOrOpenBlob"))return"ie";if(/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream)return"addon";if(Object(u.includes)(navigator.userAgent,"Firefox"))return"addon";if(navigator.mimeTypes["application/pdf"])return"native";if(Object(u.includes)(navigator.userAgent,"Safari"))return"addon";var e=function(e){try{return new ActiveXObject(e)}catch(t){}};return!(!e("AcroPDF.PDF")&&!e("PDF.PdfCtrl"))&&"addon"}),f=null,l=function(e){return new Promise(function(t,n){f&&document.body.removeChild(f),(f=document.createElement("iframe")).src=e,f.style.position="fixed",f.style.left="-999px",f.onload=function(){t()},f.onerror=function(e){n(e)},document.body.appendChild(f)})},O=function(e,t){var n=function(e,t){for(var n=atob(e),r=n.length,i=new Uint8Array(new ArrayBuffer(r)),a=0;a<r;a++)i[a]=n.charCodeAt(a);return new Blob([i],{type:t})}(e.b64Content,e.mimeType),r="ie"!==d()?URL.createObjectURL(n):null;switch(d()){case"native":return l(r).then(function(){f.contentWindow.print(),URL.revokeObjectURL(r)});case"addon":var i=window.open(r);return setTimeout(function(){return URL.revokeObjectURL(r)},1e3),i?Promise.resolve():Promise.reject(new Error("Unable to open label PDF in new tab"));case"ie":return window.navigator.msSaveOrOpenBlob(n,t)?Promise.resolve():Promise.reject(new Error("Unable to download the PDF"));default:return l(r),setTimeout(function(){return URL.revokeObjectURL(r)},0),Promise.resolve()}},E=n(545),b=n(551),p=n(538),m=function(e,t,n,r,i){n({type:p.A,group:i,orderId:e,siteId:t});return s.c(t,s.e.addressNormalization(),{address:r,type:i}).then(function(r){n({type:p.z,siteId:t,orderId:e,group:i,requestSuccess:!0,fieldErrors:r.field_errors,normalized:r.normalized,isTrivialNormalization:r.is_trivial_normalization})}).catch(function(r){throw n(E.a(Object(c.translate)("Error validating %(group)s address: %(error)s",{args:{group:i,error:r}}))),n({type:p.z,siteId:t,orderId:e,group:i,requestSuccess:!1}),r})},_=n(616),g=n(537),I=n(680),v=n(637),h=n(540),S=n(546),j=n(564),C="label-image-download-failed",R="label-image-download-printing",y=function(e,t){return function(n){n({type:p.wb,orderId:e,siteId:t,isFetching:!0}),s.b(t,s.e.orderLabels(e)).then(function(r){n(o()({type:p.O,siteId:t,orderId:e},r))}).catch(function(r){n({type:p.ub,orderId:e,siteId:t,error:!0}),console.error(r)}).then(function(){return n({type:p.wb,orderId:e,siteId:t,isFetching:!1})})}},P=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return{type:p.Hb,siteId:t,orderId:e,stepName:n,expanded:r}},M=function(e,t,n,r){var i=r(),a=Object(g.j)(i,e,t).form,o=Object(g.d)(i,e,t);o&&!a[o].expanded&&n(P(e,t,o))},N=function(e,t){var n=Object(u.pick)(e,["id","box_id","service_id","length","width","height","weight","signature","is_letter"]);return t&&(n.contents_type=e.contentsType||"merchandise","other"===e.contentsType&&(n.contents_explanation=e.contentsExplanation),n.restriction_type=e.restrictionType||"none","other"===e.restrictionType&&(n.restriction_comments=e.restrictionComments),n.non_delivery_option=e.abandonOnNonDelivery?"abandon":"return",n.itn=e.itn||"",n.items=Object(u.uniqBy)(e.items,"product_id").map(function(n){var r=n.product_id,i=Object(u.sumBy)(Object(u.filter)(e.items,{product_id:r}),"quantity");return{description:t[r].description,quantity:i,value:i*t[r].value,weight:i*t[r].weight,hs_tariff_number:t[r].tariffNumber||"",origin_country:t[r].originCountry,product_id:r}})),n},T=function(e,t){return{type:p.D,orderId:e,siteId:t}},A=function e(t,n,r,i){var a=i(),o=Object(g.d)(a,t,n);if(o&&"rates"!==o)M(t,n,r,i);else{var d=Object(g.j)(a,t,n).form,f=d.origin,l=d.destination,O=d.packages,b=d.customs;r(E.c("wcs-label-rates"));var m=Object(g.p)(i(),t,n)?b.items:null,_=Object(u.map)(O.selected,function(e){return N(e,m)});(function(e,t,n,r,i,a){var o={origin:r,destination:i,packages:a};return n({type:p.ab,requestData:o,siteId:t,orderId:e}),new Promise(function(r,i){var a=null,c=function(c){c||(n({type:p.Z,requestData:o,siteId:t,orderId:e}),a?setTimeout(function(){return i(a)},0):setTimeout(r,0))};c(!0),s.c(t,s.e.getLabelRates(e),o).then(function(r){n({type:p.Ab,rates:r.rates,requestData:o,siteId:t,orderId:e})}).catch(function(e){return a=e}).then(function(){return c(!1)})})})(t,n,r,f.values,l.values,_).then(function(){return M(t,n,r,i)}).catch(function(a){console.error(a),r(E.a(a.toString(),{id:"wcs-label-rates",button:Object(c.translate)("Retry"),onClick:function(){return e(t,n,r,i)}}))})}},L=function(e,t){return function(n,r){var i,a=Object(g.j)(r(),e,t).form,o=a.origin,c=a.destination,u=Object(g.f)(r(),e,t),s=[];o.ignoreValidation||Object(b.a)(u.origin)||o.isNormalized||o.normalizationInProgress||s.push(m(e,t,n,o.values,"origin")),(o.ignoreValidation||Object(b.a)(u.origin))&&n(P(e,t,"origin")),c.ignoreValidation||Object(b.a)(u.destination)||c.isNormalized||c.normalizationInProgress||s.push(m(e,t,n,c.values,"destination")),(c.ignoreValidation||Object(b.a)(u.destination))&&n(P(e,t,"destination")),(i=s,Promise.all(i.map(function(e){return e.catch(function(e){return e})}))).then(function(){return A(e,t,n,r)}),n({type:p.U,orderId:e,siteId:t})}},k=function(e,t){return function(n){n({type:p.Ob,orderId:e,siteId:t})}},D=function(e,t,n){return function(r,i){r({type:p.N,orderId:e,siteId:t,force:n}),Object(g.j)(i(),e,t).form.needsPrintConfirmation&&r(T(e,t))}},w=function(e,t){return function(n){n({type:p.y,orderId:e,siteId:t})}},W=function(e,t,n,r,i){return{type:p.Ib,siteId:t,orderId:e,group:n,name:r,value:i}},G=function(e,t,n,r){return{type:p.jb,siteId:t,orderId:e,group:n,selectNormalized:r}},U=function(e,t,n){return{type:p.L,siteId:t,orderId:e,group:n}},H=function(e,t,n){return{type:p.M,siteId:t,orderId:e,group:n}},V=function(e,t,n){return function(r,i){r({type:p.J,siteId:t,orderId:e,group:n}),A(e,t,r,i)}},F=function(e,t,n){return function(r,i){var a=Object(g.j)(i(),e,t).form[n];if(a.ignoreValidation){r(function(e,t,n){return{type:p.db,siteId:t,orderId:e,group:n}}(e,t,n));var o=Object(g.f)(i(),e,t);if(Object(b.a)(o[n]))return;a=Object(g.j)(i(),e,t).form[n]}return m(e,t,r,Object(g.j)(i(),e,t).form[n].values,n).then(function(){var a=Object(g.j)(i(),e,t).form[n],o=a.values,c=a.normalized,s=a.expanded;Object(u.isEqual)(o,c)&&(s&&r(P(e,t,n)),A(e,t,r,i))})}},x=function(e,t,n,r){return{type:p.Jb,siteId:t,orderId:e,packageId:n,value:r}},B=function(e,t,n){return{type:p.T,siteId:t,orderId:e,openedPackageId:n}},z=function(e,t,n){return{type:p.S,siteId:t,orderId:e,movedItemIndex:n}},q=function(e,t,n,r,i){return{type:p.P,siteId:t,orderId:e,originPackageId:n,movedItemIndex:r,targetPackageId:i}},Z=function(e,t){return{type:p.G,siteId:t,orderId:e}},Q=function(e,t,n){return{type:p.Db,targetPackageId:n,siteId:t,orderId:e}},K=function(e,t){return{type:p.Q,siteId:t,orderId:e}},Y=function(e,t){return{type:p.E,siteId:t,orderId:e}},J=function(e,t,n,r,i){return{type:p.lb,siteId:t,orderId:e,sourcePackageId:n,movedItemIndex:r,added:i}},X=function(e,t,n){return{type:p.B,siteId:t,orderId:e,targetPackageId:n}},$=function(e,t,n,r){return function(i,a){var o=Object(h.a)(a(),t)[r];i({type:p.zb,siteId:t,orderId:e,packageId:n,boxTypeId:r,box:o})}},ee=function(e,t){return function(n,r){n(P(e,t,"packages")),n(function(e,t){return{type:p.ib,siteId:t,orderId:e}}(e,t)),A(e,t,n,r)}},te=function(e,t,n,r){return{type:p.nb,siteId:t,orderId:e,packageId:n,contentsType:r}},ne=function(e,t,n,r){return{type:p.mb,siteId:t,orderId:e,packageId:n,contentsExplanation:r}},re=function(e,t,n,r){return{type:p.Cb,siteId:t,orderId:e,packageId:n,restrictionType:r}},ie=function(e,t,n,r){return{type:p.Bb,siteId:t,orderId:e,packageId:n,restrictionComments:r}},ae=function(e,t,n,r){return{type:p.kb,siteId:t,orderId:e,packageId:n,abandonOnNonDelivery:r}},oe=function(e,t,n,r){return{type:p.xb,siteId:t,orderId:e,packageId:n,itn:r}},ce=function(e,t,n,r){return{type:p.ob,siteId:t,orderId:e,productId:n,description:r}},ue=function(e,t,n,r){return{type:p.qb,siteId:t,orderId:e,productId:n,tariffNumber:r}},se=function(e,t,n,r){return{type:p.sb,siteId:t,orderId:e,productId:n,weight:r}},de=function(e,t,n,r){return{type:p.rb,siteId:t,orderId:e,productId:n,value:r}},fe=function(e,t,n,r){return{type:p.pb,siteId:t,orderId:e,productId:n,originCountry:r}},le=function(e,t){return function(n,r){n(P(e,t,"customs")),n(function(e,t){return{type:p.hb,siteId:t,orderId:e}}(e,t)),A(e,t,n,r)}},Oe=function(e,t,n,r,i,a){return{type:p.Lb,siteId:t,carrierId:i,orderId:e,packageId:n,serviceId:r,signatureRequired:a}},Ee=function(e,t,n){return{type:p.tb,siteId:t,orderId:e,value:n}},be=function(e,t,n){return{type:p.vb,siteId:t,orderId:e,value:n}},pe=function(e,t,n,r){return{type:p.Y,orderId:e,siteId:t,response:n,error:r}},me=function(e,t,n,r,i){n(pe(e,t,null,!0));var a={button:Object(c.translate)("Go to Credit Cards settings."),onClick:function(){window.open("admin.php?page=wc-settings&tab=shipping&section=woocommerce-services-settings")}};n(E.a(i.toString(),a)),n(T(e,t)),A(e,t,n,r,u.noop)},_e=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return"order-#".concat(e,"-label")+(t?"-reprint":"")+".pdf"},ge=function(e,t,n,r,i,a){n(D(e,t,!0)),n(T(e,t)),i||(Object(g.u)(r(),e,t)&&n(Object(I.a)(t,e,{note:Object(c.translate)("Your order has been shipped. The tracking number is %(trackingNumbers)s.","Your order consisting of %(packageCount)d packages has been shipped. The tracking numbers are %(trackingNumbers)s.",{args:{packageCount:a.length,trackingNumbers:a.map(function(e){var t=e.tracking,n={usps:"USPS",ups:"UPS"}[e.carrier_id||""];return n?"".concat(t," (").concat(n,")"):t}).join(", ")},count:a.length}),customer_note:!0})),Object(g.v)(r(),e,t)&&n(Object(v.f)(t,{id:e,status:"completed"})))},Ie=function(e){return E.d(Object(c.translate)("Your shipping label was purchased successfully","Your %(count)d shipping labels were purchased successfully",{count:e,args:{count:e}}))},ve=function(e,t){var n=Object(c.translate)('Your shipping label was purchased successfully, but could not be printed automatically. Click "Reprint" to try again.','Your shipping labels were purchased successfully, but some of them could not be printed automatically. Click "Reprint" to try again.',{count:e});return E.a(n,{id:C,button:Object(c.translate)("Reprint"),onClick:t})};var he=function e(t,n,r,a,o){var f=Object(u.find)(o,{status:"PURCHASE_ERROR"});f?me(t,n,r,a,f.error):Object(u.every)(o,{status:"PURCHASED"})?(r(pe(t,n,o,!1)),function e(t,n,r,a,o){var u=arguments,f=1===o.length?[{labelId:o[0].label_id}]:o.map(function(e,t){return{caption:Object(c.translate)("PACKAGE %(num)d (OF %(total)d)",{args:{num:t+1,total:o.length}}),labelId:e.label_id}}),l=Object(g.j)(a(),t,n).paperSize,b=Object(_.b)(l,f),m=function(){r(Ie(f.length))},I=function(){r(E.c(C)),r(E.b(Object(c.translate)("Printing\u2026"),{id:R})),e.apply(void 0,i()(u))},v=!1,h=o.map(function(e){return e.commercial_invoice_url}).filter(function(e){return e});if(h&&0<h.length){r(E.b(Object(c.translate)("Note: A customs form will open in a new tab and must be printed and included on this international shipment."),{}));var S=!0,j=!1,y=void 0;try{for(var P,M=h[Symbol.iterator]();!(S=(P=M.next()).done);S=!0){var N=P.value;window.open(N)}}catch(A){j=!0,y=A}finally{try{S||null==M.return||M.return()}finally{if(j)throw y}}}s.b(n,b).then(function(e){r(E.c(R)),"addon"===d()?(m(),r({type:p.Eb,orderId:t,siteId:n,fileData:e,labels:o})):O(e,_e(t)).then(function(){m()}).catch(function(e){r(E.a(e.toString())),v=!0}).then(function(){ge(t,n,r,a,v,o)})}).catch(function(){r(D(t,n,!0)),r(T(t,n)),r(E.c(R)),r(ve(o.length,I))})}(t,n,r,a,o)):setTimeout(function(){var i=o.map(function(e){return"PURCHASED"===e.status?e:function e(t,n,r,i){var a=1e3;return 0===i&&(a=2e3),s.b(n,s.e.labelStatus(t,r)).then(function(e){return e.label}).catch(function(o){if(!Object(u.includes)(o,"cURL error 28")||i>=3)throw o;return new Promise(function(o){setTimeout(function(){return o(e(t,n,r,i+1))},a)})})}(t,n,e.label_id,0)});Promise.all(i).then(function(i){return e(t,n,r,a,i)}).catch(function(e){return me(t,n,r,a,e)})},1e3)},Se=function(e,t){return function(n,r){var i=null,a=null,c=function(e){return i=e},d=function(e){a=e.labels},f=function(o){o?n({type:p.X,orderId:e,siteId:t}):i?me(e,t,n,r,i):he(e,t,n,r,a)},l=Object(g.j)(r(),e,t).form,O=[];if(!l.origin.isNormalized){var b=m(e,t,n,l.origin.values,"origin");O.push(b)}if(!l.destination.isNormalized){var _=m(e,t,n,l.destination.values,"destination");O.push(_)}Promise.all(O).then(function(n){if(Object(u.every)(n)){l=Object(g.j)(r(),e,t).form;var i=Object(g.p)(r(),e,t)?l.customs.items:null,a={async:!0,origin:Object(j.a)(l.origin),destination:Object(j.a)(l.destination),packages:Object(u.map)(l.packages.selected,function(e,t){var n=l.rates.values[t],r=n.serviceId,a=n.signatureRequired,c=a in l.rates.available[t]?a:"default",s=N(e,i),d=Object(u.find)(l.rates.available[t][c].rates,function(e){return r===e.service_id});return o()({},s,{shipment_id:d.shipment_id,rate_id:d.rate_id,service_id:r,carrier_id:d.carrier_id,service_name:d.title,products:Object(u.flatten)(e.items.map(function(e){return Object(u.fill)(new Array(e.quantity),e.product_id)}))})})},O=Object(S.e)(r(),t);Object(u.isBoolean)(O)&&(a.email_receipt=O),f(!0),s.c(t,s.e.orderLabels(e),a).then(d).catch(c).then(function(){return f(!1)})}}).catch(function(e){console.error(e),n(E.a(e.toString()))})}},je=function(e,t){return function(n,r){var i=Object(g.j)(r(),e,t);O(i.form.fileData,_e(e)).then(function(){n(D(e,t,!0)),n(T(e,t)),ge(e,t,n,r,!1,i.form.labelsToPrint)}).catch(function(e){return n(E.a(e.toString()))})}},Ce=function(e,t,n){return{type:p.V,labelId:n,siteId:t,orderId:e}},Re=function(e,t){return function(n,r){var i=Object(g.j)(r(),e,t).labels.map(function(r){if(!r.statusUpdated&&!function(e){return Object(u.get)(e,"statusRetrivalInProgress",!1)}(r)){var i=r.label_id,a=null,o=null;return n({type:p.Gb,orderId:e,labelId:i}),s.b(t,s.e.labelStatus(e,i)).then(function(e){o=e.label}).catch(function(e){return a=e}).then(function(){if(n({type:p.Fb,orderId:e,siteId:t,labelId:i,response:o,error:a}),a)throw a})}});Promise.all(i).catch(function(e){n(E.a("Failed to retrieve shipping label refund status: ".concat(e)))})}},ye=function(e,t){return{type:p.H,orderId:e,siteId:t}},Pe=function(e,t){return function(n,r){var i=Object(g.j)(r(),e,t).refundDialog.labelId,a=null,o=null,u=function(r){r?n({type:p.bb,orderId:e,siteId:t}):(n({type:p.cb,response:o,error:a,orderId:e,siteId:t}),n(a?E.a(a.toString()):E.d(Object(c.translate)("The refund request has been sent successfully."),{duration:5e3})))};u(!0),s.c(t,s.e.labelRefund(e,i)).then(function(e){o=e.refund}).catch(function(e){a=e}).then(function(){return u(!1)})}},Me=function e(t,n,r){return function(i,a){i({type:p.W,labelId:r,orderId:t,siteId:n}),i(E.c("wcs-reprint-label"));var o=Object(g.j)(a(),t,n),u=Object(_.b)(o.paperSize,[{labelId:r}]);s.b(n,u).then(function(e){var c=Object(g.j)(a(),t,n);o.paperSize===c.paperSize&&i({type:p.gb,labelId:r,orderId:t,siteId:n,fileData:e})}).catch(function(a){i({type:p.fb,labelId:r,orderId:t,siteId:n}),i(E.a(a.toString(),{id:"wcs-reprint-label",button:Object(c.translate)("Retry"),onClick:function(){return i(e(t,n,r))}}))})}},Ne=function(e,t){return{type:p.I,orderId:e,siteId:t}},Te=function(e,t){return function(n,r){n({type:p.K,orderId:e,siteId:t});var i=Object(g.j)(r(),e,t);O(i.reprintDialog.fileData,_e(e,!0)).catch(function(e){console.error(e),n(E.a(e.toString()))}).then(function(){return n(Ne(e,t))})}},Ae=function(e,t,n){return function(r,i){r({type:p.Kb,siteId:t,orderId:e,value:n});var a=Object(g.j)(i(),e,t);null!=a.reprintDialog&&r(Me(e,t,a.reprintDialog.labelId))}},Le=function(e,t,n){return{type:p.R,labelId:n,siteId:t,orderId:e}},ke=function(e,t){return{type:p.F,orderId:e,siteId:t}}},544:function(e,t,n){"use strict";n.d(t,"a",function(){return C});var r=n(530),i=n.n(r),a=n(533),o=n.n(a),c=n(107),u=n.n(c),s=n(108),d=n.n(s),f=n(528),l=n.n(f),O=n(527),E=n.n(O),b=n(529),p=n.n(b),m=n(34),_=n.n(m),g=n(10),I=n.n(g),v=n(12),h=n.n(v),S=n(526),j=n.n(S),C=function(e){function t(){return u()(this,t),l()(this,E()(t).apply(this,arguments))}return p()(t,e),d()(t,[{key:"render",value:function(){var e=j()("button",this.props.className,{"is-compact":this.props.compact,"is-primary":this.props.primary,"is-scary":this.props.scary,"is-busy":this.props.busy,"is-borderless":this.props.borderless});if(this.props.href){var t=this.props,n=(t.compact,t.primary,t.scary,t.busy,t.borderless,t.type,o()(t,["compact","primary","scary","busy","borderless","type"])),r=n.target?(n.rel||"").replace(/noopener|noreferrer/g,"")+" noopener noreferrer":n.rel;return I.a.createElement("a",i()({},n,{rel:r,className:e}))}var a=this.props,c=(a.compact,a.primary,a.scary,a.busy,a.borderless,a.target,a.rel,o()(a,["compact","primary","scary","busy","borderless","target","rel"]));return I.a.createElement("button",i()({},c,{className:e}))}}]),t}(g.PureComponent);_()(C,"propTypes",{compact:h.a.bool,primary:h.a.bool,scary:h.a.bool,busy:h.a.bool,type:h.a.string,href:h.a.string,borderless:h.a.bool,target:h.a.string,rel:h.a.string}),_()(C,"defaultProps",{type:"button"})},545:function(e,t,n){"use strict";n.d(t,"c",function(){return u}),n.d(t,"d",function(){return d}),n.d(t,"a",function(){return f}),n.d(t,"b",function(){return l});var r=n(533),i=n.n(r),a=n(1),o={debounce:a.debounce,isPlainObject:a.isPlainObject,uniqueId:a.uniqueId},c=(n(46),o.uniqueId);function u(e){return{noticeId:e,type:"NOTICE_REMOVE"}}function s(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.id,a=i()(n,["id"]);return{type:"NOTICE_CREATE",notice:Object.assign({showDismiss:!0},a,{noticeId:r||c(),status:e,text:t})}}var d=s.bind(null,"is-success"),f=s.bind(null,"is-error"),l=s.bind(null,"is-info");s.bind(null,"is-warning"),s.bind(null,"is-plain")},546:function(e,t,n){"use strict";n.d(t,"f",function(){return o}),n.d(t,"g",function(){return c}),n.d(t,"h",function(){return u}),n.d(t,"i",function(){return s}),n.d(t,"d",function(){return d}),n.d(t,"c",function(){return f}),n.d(t,"b",function(){return l}),n.d(t,"a",function(){return O}),n.d(t,"n",function(){return E}),n.d(t,"o",function(){return b}),n.d(t,"e",function(){return p}),n.d(t,"q",function(){return m}),n.d(t,"p",function(){return _}),n.d(t,"k",function(){return g}),n.d(t,"l",function(){return I}),n.d(t,"m",function(){return v}),n.d(t,"j",function(){return h});var r=n(1),i=n(532),a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","woocommerceServices",t,"labelSettings"],null)},o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=a(e,t);return n&&n.data},c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=a(e,t);return n&&n.meta},u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=a(e,t);return n&&n.storeOptions},s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.user},d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.isLoaded},f=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.isFetching},l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.isFetchError},O=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=o(e,t);return n&&n.enabled},E=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=o(e,t);return n&&n.selected_payment_method_id},b=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.pristine},p=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=o(e,t);return n&&n.email_receipts},m=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.can_manage_payments},_=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.can_edit_settings},g=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=o(e,t);return n&&n.paper_size},I=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.payment_methods},v=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.warnings&&n.warnings.payment_methods},h=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return{masterUserName:n&&n.master_user_name,masterUserLogin:n&&n.master_user_login,masterUserEmail:n&&n.master_user_email,masterUserWpcomLogin:n&&n.master_user_wpcom_login}}},551:function(e,t,n){"use strict";n.d(t,"a",function(){return i});var r=n(1),i=function e(t){return!!t&&(Object(r.isArray)(t)?Object(r.some)(t,e):!Object(r.isPlainObject)(t)||Object(r.some)(Object(r.values)(t),e))}},553:function(e,t,n){"use strict";n.r(t),n.d(t,"addPackage",function(){return o}),n.d(t,"removePackage",function(){return c}),n.d(t,"editPackage",function(){return u}),n.d(t,"dismissModal",function(){return s}),n.d(t,"savePackage",function(){return d}),n.d(t,"updatePackagesField",function(){return f}),n.d(t,"toggleOuterDimensions",function(){return l}),n.d(t,"toggleAll",function(){return O}),n.d(t,"togglePackage",function(){return E}),n.d(t,"savePredefinedPackages",function(){return b}),n.d(t,"removePredefinedPackage",function(){return p}),n.d(t,"setModalErrors",function(){return m}),n.d(t,"setIsSaving",function(){return _}),n.d(t,"setIsFetching",function(){return g}),n.d(t,"setIsFetchError",function(){return I}),n.d(t,"setAddMode",function(){return v}),n.d(t,"fetchSettings",function(){return h}),n.d(t,"submit",function(){return S});var r=n(541),i=n(538),a=n(540),o=function(e){return{type:i.g,siteId:e}},c=function(e,t){return{type:i.k,index:t,siteId:e}},u=function(e,t){return{type:i.i,package:t,siteId:e}},s=function(e){return{type:i.h,siteId:e}},d=function(e,t){return{type:i.m,packageData:t,siteId:e}},f=function(e,t){return{type:i.w,values:t,siteId:e}},l=function(e){return{type:i.u,siteId:e}},O=function(e,t,n,r){return{type:i.t,serviceId:t,groupId:n,checked:r,siteId:e}},E=function(e,t,n){return{type:i.v,serviceId:t,packageId:n,siteId:e}},b=function(e){return{type:i.n,siteId:e}},p=function(e,t,n){return{type:i.l,serviceId:t,packageId:n,siteId:e}},m=function(e,t){return{type:i.s,value:t,siteId:e}},_=function(e,t){return{type:i.r,isSaving:t,siteId:e}},g=function(e,t){return{type:i.p,isFetching:t,siteId:e}},I=function(e,t){return{type:i.q,isFetchError:t,siteId:e}},v=function(e,t){return{type:i.o,siteId:e,mode:t}},h=function(e){return function(t,n){var o=Object(a.e)(n(),e);o&&(o.packages||o.isFetching)||(t(g(e,!0)),r.b(e,r.e.packages).then(function(n){var r=n.formData,a=n.formSchema,o=n.storeOptions;t({type:i.j,packages:r,dimensionUnit:o.dimension_unit,weightUnit:o.weight_unit,packageSchema:a.custom.items,predefinedSchema:a.predefined,siteId:e})}).catch(function(n){console.error(n),t(I(e,!0))}).then(function(){return t(g(e,!1))}))}},S=function(e,t,n){return function(i,o){var c=Object(a.e)(o(),e);i(_(e,!0)),r.d(e,r.e.packages,c.packages).then(t).catch(n).then(function(){return i(_(e,!1))})}}},554:function(e,t,n){"use strict";n.d(t,"a",function(){return i});var r=n(535);function i(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Date.now();return{type:r.j,siteId:e,originalAction:t,data:n,time:i}}},560:function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return i}),n.d(t,"c",function(){return a});var r=function(){return{}},i=function(){return""},a=function(){return!0}},563:function(e,t,n){"use strict";var r=n(75);t.a=r.a},564:function(e,t,n){"use strict";var r=n(1);t.a=function(e){return Object(r.isPlainObject)(e)&&(e.isNormalized&&e.selectNormalized&&e.normalized?e.normalized:e.values)||{}}},565:function(e,t,n){"use strict";n.d(t,"b",function(){return u}),n.d(t,"c",function(){return s}),n.d(t,"a",function(){return d}),n.d(t,"e",function(){return l}),n.d(t,"f",function(){return E}),n.d(t,"g",function(){return b}),n.d(t,"i",function(){return p}),n.d(t,"h",function(){return m}),n.d(t,"j",function(){return _}),n.d(t,"d",function(){return g});var r=n(1),i=n(542),a=n(532),o=n(539),c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",t,"data","locations"])},u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);return Object(r.isArray)(c(e,t))},s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);return o.b===c(e,t)},d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);return o.a===c(e,t)},f=function(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var a=r[e],o=u(t,a);return[o,o&&c(t,a)]}},l=Object(i.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);if(!u(e,t))return[];var n=c(e,t).map(function(e){return Object(r.omit)(e,"countries")});return Object(r.sortBy)(n,"name")},f(0)),O=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);if(!u(e,t))return[];var n=Object(r.flatMap)(c(e,t),"countries");return Object(r.sortBy)(n,"name")},E=Object(i.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);if(!u(e,n))return[];var i=Object(r.find)(c(e,n),{code:t});if(!i)return[];var o=i.countries.map(function(e){return Object(r.omit)(e,"states")});return Object(r.sortBy)(o,"name")},f(1)),b=Object(i.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);if(!u(e,n))return t;var i=Object(r.find)(Object(r.flatMap)(c(e,n),"countries"),{code:t});return i?i.name:t},f(1)),p=Object(i.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);if(!u(e,n))return[];var i=Object(r.find)(Object(r.flatMap)(c(e,n),"countries"),{code:t});return i?Object(r.sortBy)(i.states,"name"):[]},f(1)),m=Object(i.a)(function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Object(a.a)(e);if(!u(e,i))return n;var o=Object(r.find)(Object(r.flatMap)(c(e,i),"countries"),{code:t});if(!o)return n;var s=Object(r.find)(o.states,{code:n});return s?s.name:n},f(2)),_=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);return!Object(r.isEmpty)(p(e,t,n))},g=Object(i.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=O(e,t),r={};return n.forEach(function(e){var t=e.code,n=e.name;return r[t]=n}),r},f(0))},566:function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return i});var r=function(){return!0},i=function(){return!0}},567:function(e,t,n){"use strict";n.d(t,"d",function(){return o}),n.d(t,"a",function(){return u}),n.d(t,"e",function(){return s}),n.d(t,"c",function(){return d}),n.d(t,"b",function(){return f});var r=n(541),i=n(538),a=n(546),o=function(e,t,n){return{type:i.e,siteId:e,key:t,value:n}},c=function(e,t,n){return{type:i.f,siteId:e,key:t,value:n}},u=function(e){return function(t){t(c(e,"isFetching",!0)),r.b(e,r.e.accountSettings).then(function(n){var r=n.storeOptions,a=n.formMeta,o=n.formData,c=n.userMeta;t(function(e,t,n,r,a){return{type:i.b,siteId:e,storeOptions:t,formData:n,formMeta:r,userMeta:a}}(e,r,o,a,c))}).catch(function(n){t(c(e,"isFetchError",!0)),console.error(n)}).then(function(){return t(c(e,"isFetching",!1))})}},s=function(e,t,n){return function(i,o){i(c(e,"isSaving",!0)),i(c(e,"pristine",!0)),r.c(e,r.e.accountSettings,Object(a.f)(o())).then(t).catch(function(t){return i(c(e,"pristine",!1)),n(t)}).then(function(){i(c(e,"isSaving",!1))})}},d=function(e){return{type:i.d,siteId:e}},f=function(e){return{type:i.c,siteId:e}}},568:function(e,t,n){"use strict";n.d(t,"b",function(){return c}),n.d(t,"a",function(){return u}),n.d(t,"c",function(){return s});var r=n(1),i=n(532),a=n(539),o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","woocommerceServices",t,"shippingMethodSchemas"],{})},c=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return Object(r.isObject)(o(e,n)[t])},u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return c(e,t,n)?o(e,n)[t]:null},s=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return a.b===o(e,n)[t]}},575:function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return i}),n.d(t,"d",function(){return a}),n.d(t,"c",function(){return o});var r=["US","PR","VI","GU","AS","UM","MH","FM","MP"],i=["US","PR","VI"],a=["AA","AE","AP"],o=["IR","SY","KP","CU","SD"]},576:function(e,t,n){"use strict";n.d(t,"c",function(){return s}),n.d(t,"a",function(){return d}),n.d(t,"b",function(){return f});var r=n(1),i=n(532),a=n(584),o=n(539),c=n(566),u=n(585),s=function(e,t){var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",t,"shippingZoneMethods"])}(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e));return Object(r.isObject)(n)?n[t]:null},d=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e),o=Object(a.b)(e,n);if(!Object(r.isArray)(o))return!1;var d=Object(r.find)(o,{id:t});if(!d||!Object(r.isArray)(d.methodIds))return!1;if(!Object(c.a)(e,n))return!0;var f=d.methodIds.map(function(t){var i=s(e,t,n);return i&&Object(r.startsWith)(i.methodType,"wc_services")?i:null}).filter(Boolean);return Object(r.every)(f,function(t){var r=t.id;return Object(u.a)(e,r,n)})},f=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e),d=Object(a.b)(e,n);if(!Object(r.isArray)(d))return!1;var f=Object(r.find)(d,{id:t});if(!f)return!1;if(o.b===f.methodIds)return!0;if(!Object(c.a)(e,n)||!Object(r.isArray)(f.methodIds))return!1;var l=f.methodIds.map(function(t){var i=s(e,t,n);return i&&Object(r.startsWith)(i.methodType,"wc_services")?i:null}).filter(Boolean);return Object(r.some)(l,function(t){var r=t.id;return Object(u.b)(e,r,n)})}},584:function(e,t,n){"use strict";n.d(t,"b",function(){return c}),n.d(t,"a",function(){return u});var r=n(1),i=n(532),a=(n(539),n(576)),o=n(608),c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",t,"shippingZones"])},u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return Object(r.isArray)(n)&&Object(r.every)(n,function(n){return Object(a.a)(e,n.id,t)})&&Object(r.every)(n,function(n){return Object(o.a)(e,n.id,t)})}},585:function(e,t,n){"use strict";n.d(t,"a",function(){return c}),n.d(t,"b",function(){return u});var r=n(1),i=n(532),a=n(539),o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","woocommerceServices",t,"shippingZoneMethodSettings"],{})},c=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return!0===o(e,n)[t]},u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return a.b===o(e,n)[t]}},591:function(e,t,n){"use strict";var r,i=n(34),a=n.n(i),o=n(36),c=n.n(o),u=n(1),s=n(46),d=Object(s.b)({},(r={},a()(r,"NOTICE_CREATE",function(e,t){var n=t.notice;return c()({},e,a()({},n.noticeId,n))}),a()(r,"NOTICE_REMOVE",function(e,t){var n=t.noticeId;return e.hasOwnProperty(n)?Object(u.omit)(e,n):e}),a()(r,"ROUTE_SET",function(e){return Object(u.reduce)(e,function(e,t,n){if(!t.isPersistent&&!t.displayOnNextPage)return e;var r=t;return r.displayOnNextPage&&(r=c()({},r,{displayOnNextPage:!1})),e[n]=r,e},{})}),r)),f=Object(s.b)({},a()({},"NOTICE_CREATE",function(e,t){var n=t.notice;return c()({},e,a()({},n.noticeId,Date.now()))}));t.a=Object(s.a)({items:d,lastTimeShown:f})},592:function(e,t,n){"use strict";n.d(t,"d",function(){return i}),n.d(t,"b",function(){return a}),n.d(t,"a",function(){return o}),n.d(t,"e",function(){return c}),n.d(t,"c",function(){return u});var r=n(535);function i(e){return{type:r.d,actionList:e}}function a(){return{type:r.b}}function o(e){return{type:r.a,actionList:e}}function c(e){return{type:r.e,actionList:e}}function u(e,t){return{type:r.c,actionList:e,error:t}}},605:function(e,t,n){"use strict";n.d(t,"b",function(){return a}),n.d(t,"c",function(){return o}),n.d(t,"a",function(){return c});var r=n(1),i=n(532),a=(n(635),function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return!1===Object(r.get)(e,["extensions","woocommerce","sites",n,"orders","isLoading",t])}),o=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return!0===Object(r.get)(e,["extensions","woocommerce","sites",n,"orders","isLoading",t])},c=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",n,"orders","items",t],null)}},606:function(e,t,n){"use strict";n.d(t,"a",function(){return p});var r,i=n(36),a=n.n(i),o=n(533),c=n.n(o),u=n(651),s=n.n(u),d=n(1),f=n(46),l=n(113),O=function(e){return Object(d.get)(e,"meta.dataLayer.data",void 0)},E=function(e){return Object(d.get)(e,"meta.dataLayer.error",void 0)},b=function(e){return Object(d.get)(e,"meta.dataLayer.progress",void 0)},p=(Object(f.d)("meta.dataLayer.requestKey",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=(arguments.length>1?arguments[1]:void 0).meta,n=(t=void 0===t?{}:t).dataLayer,r=(n=void 0===n?{}:n).lastUpdated,i=n.pendingSince,o=n.status;return Object.assign(a()({},e),{status:o},r&&{lastUpdated:r},i&&{pendingSince:i})}),r=function(e){return function(t,n){if(!0!==Object(d.get)(n,"meta.dataLayer.trackRequest")||b(n))return e(t,n);var r=function(e){var t=e.meta,n=c()(e,["meta"]),r=Object(d.get)(t,"dataLayer.requestKey");return r||s()(n)}(n),i=function(e){return void 0!==E(e)?"failure":void 0!==O(e)?"success":"pending"}(n),o=Object.assign({requestKey:r,status:i},"pending"===i?{pendingSince:Date.now()}:{lastUpdated:Date.now()});e(a()({},t,{dispatch:function(e){return t.dispatch(Object(d.merge)(e,{meta:{dataLayer:o}}))}}),n)}},function(e){return e.fetch||Object(l.a)("fetch handler is not defined: no request will ever be issued"),e.onSuccess||Object(l.a)("onSuccess handler is not defined: response to the request is being ignored"),e.onError||Object(l.a)("onError handler is not defined: error during the request is being ignored"),r(function(t,n){var r=function(e,t){var n=e.fetch,r=void 0===n?d.noop:n,i=e.onSuccess,a=void 0===i?d.noop:i,o=e.onError,c=void 0===o?d.noop:o,u=e.onProgress,s=void 0===u?d.noop:u,f=e.fromApi,l=void 0===f?d.identity:f,p=E(t);if(p)return c(t,p);var m=O(t);if(m)try{return a(t,l(m))}catch(g){return c(t,g)}var _=b(t);return _?s(t,_):r(t)}(e,n);if(r)return Array.isArray(r)?r.map(t.dispatch):t.dispatch(r)})})},607:function(e,t,n){"use strict";n.d(t,"a",function(){return a});var r=n(1),i=function(e,t){return Object(r.isArray)(e)?e.concat(t):void 0},a=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.length>1?r.mergeWith.apply(void 0,[Object.create(null)].concat(t,[i])):t[0]}},608:function(e,t,n){"use strict";n.d(t,"c",function(){return o}),n.d(t,"a",function(){return c}),n.d(t,"b",function(){return u});var r=n(1),i=n(532),a=n(539),o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",t,"shippingZoneLocations"])},c=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e),a=o(e,n);return a&&Object(r.isObject)(a[t])},u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return o(e,n)&&a.b===o(e,n)[t]}},609:function(e,t,n){"use strict";n.d(t,"a",function(){return c});var r=n(541),i=n(554),a=n(538),o=n(585),c=function(e,t,n){return function(c,u){if(!Object(o.a)(u(),n,e)&&!Object(o.b)(u(),n,e)){var s={type:a.Pb,instanceId:n,siteId:e};return c(s),r.b(e,r.e.serviceSettings(t,n)).then(function(t){return c(function(e,t,n){return{type:a.Qb,siteId:e,instanceId:t,data:n}}(e,n,t))}).catch(function(t){return c(Object(i.a)(e,s,t))})}}}},610:function(e,t,n){"use strict";t.a=function(e,t){return function e(t,n,r){if(void 0===n||null===n||!t)return n;switch((t=function(e,t){if(e.$ref){var n=e.$ref.match(/^#\/definitions\/(.+)/);n&&t[n[1]]&&(e=t[n[1]])}return e}(t,r)).type){case"number":if(""===n)return;return isNaN(n)?n:parseFloat(n);case"boolean":return-1!==["true","True","TRUE","1",1,!0].indexOf(n)||-1===["false","False","FALSE","0",0,!1].indexOf(n)&&void 0;case"string":return n?n.toString():"";case"object":var i={};return Object.keys(n).forEach(function(a){var o=(t.properties||{})[a];i[a]=e(o,n[a],r)}),i;case"array":return n.map(function(n){return e(t.items,n,r)});default:return n}}({type:"object",properties:e.properties},t,e.definitions)}},615:function(e,t,n){"use strict";n.d(t,"a",function(){return o}),n.d(t,"b",function(){return c});n(1);var r=n(657),i=n.n(r),a=document.implementation&&document.implementation.createHTMLDocument?document.implementation.createHTMLDocument("").createElement("textarea"):document.createElement("textarea");function o(e){return"string"!==typeof e||-1===e.indexOf("&")?e:function(e){a.innerHTML=e;var t=a.textContent;return a.innerHTML="",t}(e)}function c(e){return i()(e)}String.fromCharCode(160)},616:function(e,t,n){"use strict";n.d(t,"a",function(){return u}),n.d(t,"b",function(){return d});var r=n(35),i=n(602),a=n(1),o=n(541),c={a4:{name:Object(r.translate)("A4"),exclude:function(e){return Object(a.includes)(["US","CA","MX","DO"],e)}},label:{name:Object(r.translate)('Label (4"x6")')},legal:{name:Object(r.translate)("Legal")},letter:{name:Object(r.translate)("Letter")}},u=function(e){return Object(a.reduce)(c,function(t,n,r){var i=n.name,a=n.exclude;return a&&a(e)||(t[r]=i),t},{})},s=function(e,t,n){if(!c[e])throw new Error("Invalid paper size: ".concat(e));var r={paper_size:e,label_id_csv:Object(a.filter)(Object(a.map)(t,"labelId")).join(","),caption_csv:Object(a.filter)(Object(a.map)(t,function(e){return e.caption?encodeURIComponent(e.caption):null})).join(","),json:!0};return n+"?"+Object(i.stringify)(r)},d=function(e,t){return s(e,t,o.e.labelsPrint())}},619:function(e,t,n){var r={"./af":[392,3],"./af.js":[392,3],"./ar":[399,4],"./ar-dz":[393,5],"./ar-dz.js":[393,5],"./ar-kw":[394,6],"./ar-kw.js":[394,6],"./ar-ly":[395,7],"./ar-ly.js":[395,7],"./ar-ma":[396,8],"./ar-ma.js":[396,8],"./ar-sa":[397,9],"./ar-sa.js":[397,9],"./ar-tn":[398,10],"./ar-tn.js":[398,10],"./ar.js":[399,4],"./az":[400,11],"./az.js":[400,11],"./be":[401,12],"./be.js":[401,12],"./bg":[402,13],"./bg.js":[402,13],"./bm":[403,14],"./bm.js":[403,14],"./bn":[404,15],"./bn.js":[404,15],"./bo":[405,16],"./bo.js":[405,16],"./br":[406,17],"./br.js":[406,17],"./bs":[407,18],"./bs.js":[407,18],"./ca":[408,19],"./ca.js":[408,19],"./cs":[409,20],"./cs.js":[409,20],"./cv":[410,21],"./cv.js":[410,21],"./cy":[411,22],"./cy.js":[411,22],"./da":[412,23],"./da.js":[412,23],"./de":[415,24],"./de-at":[413,25],"./de-at.js":[413,25],"./de-ch":[414,26],"./de-ch.js":[414,26],"./de.js":[415,24],"./dv":[416,27],"./dv.js":[416,27],"./el":[417,28],"./el.js":[417,28],"./en-au":[418,29],"./en-au.js":[418,29],"./en-ca":[419,30],"./en-ca.js":[419,30],"./en-gb":[420,31],"./en-gb.js":[420,31],"./en-ie":[421,32],"./en-ie.js":[421,32],"./en-il":[422,33],"./en-il.js":[422,33],"./en-in":[423,34],"./en-in.js":[423,34],"./en-nz":[424,35],"./en-nz.js":[424,35],"./en-sg":[425,36],"./en-sg.js":[425,36],"./eo":[426,37],"./eo.js":[426,37],"./es":[429,38],"./es-do":[427,39],"./es-do.js":[427,39],"./es-us":[428,40],"./es-us.js":[428,40],"./es.js":[429,38],"./et":[430,41],"./et.js":[430,41],"./eu":[431,42],"./eu.js":[431,42],"./fa":[432,43],"./fa.js":[432,43],"./fi":[433,44],"./fi.js":[433,44],"./fil":[434,45],"./fil.js":[434,45],"./fo":[435,46],"./fo.js":[435,46],"./fr":[438,47],"./fr-ca":[436,48],"./fr-ca.js":[436,48],"./fr-ch":[437,49],"./fr-ch.js":[437,49],"./fr.js":[438,47],"./fy":[439,50],"./fy.js":[439,50],"./ga":[440,51],"./ga.js":[440,51],"./gd":[441,52],"./gd.js":[441,52],"./gl":[442,53],"./gl.js":[442,53],"./gom-deva":[443,54],"./gom-deva.js":[443,54],"./gom-latn":[444,55],"./gom-latn.js":[444,55],"./gu":[445,56],"./gu.js":[445,56],"./he":[446,57],"./he.js":[446,57],"./hi":[447,58],"./hi.js":[447,58],"./hr":[448,59],"./hr.js":[448,59],"./hu":[449,60],"./hu.js":[449,60],"./hy-am":[450,61],"./hy-am.js":[450,61],"./id":[451,62],"./id.js":[451,62],"./is":[452,63],"./is.js":[452,63],"./it":[454,64],"./it-ch":[453,65],"./it-ch.js":[453,65],"./it.js":[454,64],"./ja":[455,66],"./ja.js":[455,66],"./jv":[456,67],"./jv.js":[456,67],"./ka":[457,68],"./ka.js":[457,68],"./kk":[458,69],"./kk.js":[458,69],"./km":[459,70],"./km.js":[459,70],"./kn":[460,71],"./kn.js":[460,71],"./ko":[461,72],"./ko.js":[461,72],"./ku":[462,73],"./ku.js":[462,73],"./ky":[463,74],"./ky.js":[463,74],"./lb":[464,75],"./lb.js":[464,75],"./lo":[465,76],"./lo.js":[465,76],"./lt":[466,77],"./lt.js":[466,77],"./lv":[467,78],"./lv.js":[467,78],"./me":[468,79],"./me.js":[468,79],"./mi":[469,80],"./mi.js":[469,80],"./mk":[470,81],"./mk.js":[470,81],"./ml":[471,82],"./ml.js":[471,82],"./mn":[472,83],"./mn.js":[472,83],"./mr":[473,84],"./mr.js":[473,84],"./ms":[475,85],"./ms-my":[474,86],"./ms-my.js":[474,86],"./ms.js":[475,85],"./mt":[476,87],"./mt.js":[476,87],"./my":[477,88],"./my.js":[477,88],"./nb":[478,89],"./nb.js":[478,89],"./ne":[479,90],"./ne.js":[479,90],"./nl":[481,91],"./nl-be":[480,92],"./nl-be.js":[480,92],"./nl.js":[481,91],"./nn":[482,93],"./nn.js":[482,93],"./oc-lnc":[483,94],"./oc-lnc.js":[483,94],"./pa-in":[484,95],"./pa-in.js":[484,95],"./pl":[485,96],"./pl.js":[485,96],"./pt":[487,97],"./pt-br":[486,98],"./pt-br.js":[486,98],"./pt.js":[487,97],"./ro":[488,99],"./ro.js":[488,99],"./ru":[489,100],"./ru.js":[489,100],"./sd":[490,101],"./sd.js":[490,101],"./se":[491,102],"./se.js":[491,102],"./si":[492,103],"./si.js":[492,103],"./sk":[493,104],"./sk.js":[493,104],"./sl":[494,105],"./sl.js":[494,105],"./sq":[495,106],"./sq.js":[495,106],"./sr":[497,107],"./sr-cyrl":[496,108],"./sr-cyrl.js":[496,108],"./sr.js":[497,107],"./ss":[498,109],"./ss.js":[498,109],"./sv":[499,110],"./sv.js":[499,110],"./sw":[500,111],"./sw.js":[500,111],"./ta":[501,112],"./ta.js":[501,112],"./te":[502,113],"./te.js":[502,113],"./tet":[503,114],"./tet.js":[503,114],"./tg":[504,115],"./tg.js":[504,115],"./th":[505,116],"./th.js":[505,116],"./tk":[506,117],"./tk.js":[506,117],"./tl-ph":[507,118],"./tl-ph.js":[507,118],"./tlh":[508,119],"./tlh.js":[508,119],"./tr":[509,120],"./tr.js":[509,120],"./tzl":[510,121],"./tzl.js":[510,121],"./tzm":[512,122],"./tzm-latn":[511,123],"./tzm-latn.js":[511,123],"./tzm.js":[512,122],"./ug-cn":[513,124],"./ug-cn.js":[513,124],"./uk":[514,125],"./uk.js":[514,125],"./ur":[515,126],"./ur.js":[515,126],"./uz":[517,127],"./uz-latn":[516,128],"./uz-latn.js":[516,128],"./uz.js":[517,127],"./vi":[518,129],"./vi.js":[518,129],"./x-pseudo":[519,130],"./x-pseudo.js":[519,130],"./yo":[520,131],"./yo.js":[520,131],"./zh-cn":[521,132],"./zh-cn.js":[521,132],"./zh-hk":[522,133],"./zh-hk.js":[522,133],"./zh-mo":[523,134],"./zh-mo.js":[523,134],"./zh-tw":[524,135],"./zh-tw.js":[524,135]};function i(e){if(!n.o(r,e))return Promise.resolve().then(function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t});var t=r[e],i=t[0];return n.e(t[1]).then(function(){return n.t(i,7)})}i.keys=function(){return Object.keys(r)},i.id=619,e.exports=i},620:function(e,t,n){"use strict";(function(e){var n={env:e?"production":"development",wpcom_concierge_schedule_id:1,languages:[],google_adwords_conversion_id:"",google_adwords_conversion_id_jetpack:""},r=function(e){if(e in n)return n[e];throw new Error("config key `"+e+"` does not exist")};r.isEnabled=function(){return!0},t.a=r}).call(this,n(112))},632:function(e,t,n){"use strict";var r=n(34),i=n.n(r),a=n(110),o=n.n(a),c=n(1),u=n(35),s=n(535),d=n(592),f=n(546),l=n(540),O=n(567),E=n(553),b=n(532),p=n(538);n(563),n(554),n(576),n(609),n(620);var m=n(541),_=n(36),g=n.n(_);function I(e,t,n,r){Object(c.isFunction)(n)?I(e,t,n(e,t,r),r):Object(c.isObject)(n)&&e(g()({},n,r))}var v,h=n(568),S=n(610),j=function(e,t){var n=Object(l.e)(e,t);return!n||n.pristine?[]:[{description:Object(u.translate)("Saving label settings"),onStep:function(e,n){e(Object(E.submit)(t,function(){return e(Object(d.e)(n))},function(){return e(Object(d.c)(n))}))}}]},C=function(e,t){var n=Object(b.a)(e);return t?o()(j(e,n)):[].concat(o()(function(e,t){var n=Object(f.g)(e,t);return!n||n.pristine||!n.can_edit_settings&&n.can_manage_payments?[]:[{description:Object(u.translate)("Saving label settings"),onStep:function(e,n){e(Object(O.e)(t,function(){return e(Object(d.e)(n))},function(){return e(Object(d.c)(n))}))}}]}(e,n)),o()(j(e,n)))};t.a=(v={},i()(v,s.L,[function(e,t){var n=t.successAction,r=t.failureAction,i=t.onlyPackages,a=function(e){e(n),e(Object(d.b)())},o=C(e.getState(),i);e.dispatch(Object(c.isEmpty)(o)?a:Object(d.d)({nextSteps:o,onSuccess:a,onFailure:function(e){e(r),e(Object(d.b)())}}))}]),i()(v,p.Rb,[function(e,t){var n=e.dispatch,r=e.getState,i=t.siteId,a=t.methodId,o=t.methodType,c=t.method,u=t.successAction,d=t.failureAction,f=Object(h.a)(r(),o,i).formSchema,l=Object(S.a)(f,c);m.c(i,m.e.serviceSettings(o,a),l).then(function(e){n(function(e,t,n){return{type:s.Fb,siteId:e,data:t,originatingAction:n}}(i,e,t)),I(n,r,u,{sentData:l,receivedData:e})}).catch(function(e){return I(n,r,d,{error:e})})}]),v)},633:function(e,t,n){"use strict";n.d(t,"b",function(){return A}),n.d(t,"a",function(){return N});var r=n(111),i=n.n(r),a=n(107),o=n.n(a),c=n(108),u=n.n(c),s=n(528),d=n.n(s),f=n(527),l=n.n(f),O=n(531),E=n.n(O),b=n(529),p=n.n(b),m=n(34),_=n.n(m),g=n(10),I=n.n(g),v=n(109),h=n(163),S=n.n(h),j=n(47),C=n.n(j),R=n(1),y=n(542),P=Object(y.a)(function(e){return Object(R.get)(e,"ui.language.localeSlug",null)},function(e){return e.ui.language}),M=C()("calypso:localized-moment"),N=I.a.createContext(S.a),T=function(e){function t(){var e,n;o()(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=d()(this,(e=l()(t)).call.apply(e,[this].concat(i))),_()(E()(n),"state",{moment:S.a,momentLocale:S.a.locale()}),n}return p()(t,e),u()(t,[{key:"checkAndLoad",value:function(){var e=i()(regeneratorRuntime.mark(function e(t){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if((r=this.props.currentLocale)!==t){e.next=3;break}return e.abrupt("return");case 3:if("en"!==r){e.next=7;break}this.loadingLocalePromise=Promise.resolve(),e.next=19;break;case 7:return M("Loading moment locale for %s",r),e.prev=8,this.loadingLocalePromise=n(619)("./".concat(r)),e.next=12,this.loadingLocalePromise;case 12:e.next=18;break;case 14:return e.prev=14,e.t0=e.catch(8),M("Failed to load moment locale for %s",r,e.t0),e.abrupt("return");case 18:M("Loaded moment locale for %s",r);case 19:r===this.props.currentLocale&&(S.a.locale()!==r&&S.a.locale(r),this.setState({momentLocale:r}));case 20:case"end":return e.stop()}},e,this,[[8,14]])}));return function(t){return e.apply(this,arguments)}}()},{key:"componentDidMount",value:function(){this.checkAndLoad(S.a.locale())}},{key:"componentDidUpdate",value:function(e){this.checkAndLoad(e.currentLocale)}},{key:"render",value:function(){return I.a.createElement(N.Provider,{value:this.state},this.props.children)}}]),t}(I.a.Component),A=Object(v.b)(function(e){return{currentLocale:P(e)}})(T)},634:function(e,t,n){"use strict";var r=n(533),i=n.n(r),a=n(75),o=n(46),c=function(e,t,n,r,c,u){var s=Object(a.b)();return u&&!u.endsWith("/")&&(u+="/"),u&&u.startsWith("/")&&(u=u.substr(1)),-1!==s.indexOf("?")&&(t=t.replace("?","&")),Object(o.c)(function(e){var t=e.url,n=e.method,r=e.headers,a=e.queryParams,o=e.body,c=e.withCredentials,u=e.onSuccess,s=e.onFailure,d=i()(e,["url","method","headers","queryParams","body","withCredentials","onSuccess","onFailure"]),f=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return{type:"HTTP_REQUEST",url:t,method:n,headers:r,queryParams:a,body:o,withCredentials:c,onSuccess:u||f,onFailure:s||f,options:d}}({url:s+u+t,method:e,headers:[["X-WP-Nonce",Object(a.c)()],["Content-Type","application/json"]],body:r&&JSON.stringify(r),withCredentials:!0},c),{meta:{localApiRequest:!0}})};t.a=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"wc/v1";return{get:function(e){return c("GET",e,0,null,t,n)},getWithHeaders:function(e){return function(e,t,n,r,i,a){return c(e,t+"&_envelope",0,r,i,a)}("GET",e,0,null,t,n)},post:function(e,r){return c("POST",e,0,r||{},t,n)},put:function(e,r){return c("PUT",e,0,r||{},t,n)},del:function(e){return c("DELETE",e,0,null,t,n)}}}},635:function(e,t,n){"use strict";n.d(t,"a",function(){return u}),n.d(t,"b",function(){return s}),n.d(t,"c",function(){return d}),n.d(t,"d",function(){return f}),n.d(t,"e",function(){return l}),n.d(t,"f",function(){return O});var r=n(36),i=n.n(r),a=n(1),o=n(681),c=n(636),u={page:1,per_page:50,search:"",status:"any"};function s(e){return e.status&&(e.status=Object(c.a)(e.status)),Object(a.omitBy)(e,function(e,t){return u[t]===e})}function d(){var e=s(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{});return JSON.stringify(e)}function f(e){for(var t=i()({},e),n=0,r=["line_items","fee_lines","coupon_lines","shipping_lines"];n<r.length;n++){var o=r[n];e[o]&&(t[o]=e[o].map(function(e){return Object(a.isFinite)(e.id)?e:Object(a.omit)(e,"id")}))}return t}function l(e){Object(a.forEach)(["cart_tax","discount_total","discount_tax","shipping_total","shipping_tax","total","total_tax"],function(t){(Object(a.isFinite)(e[t])||e[t])&&(e[t]=Object(o.b)(e[t],e.currency))});var t=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];return t.map(function(t){return Object(a.forEach)(n,function(e){(Object(a.isFinite)(t[e])||t[e])&&(t[e]=t[e].toString())}),Object(a.forEach)(r,function(n){(Object(a.isFinite)(t[n])||t[n])&&(t[n]=Object(o.b)(t[n],e.currency))}),Object(a.forEach)(i,function(e){(Object(a.isFinite)(t[e])||t[e])&&(t[e]=parseInt(t[e]))}),Object(a.forEach)(c,function(n){(Object(a.isFinite)(t[n])||t[n])&&(t[n]=Object(o.a)(t[n],e.currency))}),t})};return Object(a.isEmpty)(e.line_items)||(e.line_items=t(e.line_items,["name","tax_class"],["subtotal","subtotal_tax","total","total_tax"],["product_id","variation_id","quantity"],["price"])),Object(a.isEmpty)(e.shipping_lines)||(e.shipping_lines=t(e.shipping_lines,["method_title","method_id"],["total","total_tax"])),Object(a.isEmpty)(e.fee_lines)||(e.fee_lines=t(e.fee_lines,["name","tax_class","tax_status"],["total","total_tax"])),Object(a.isEmpty)(e.coupon_lines)||(e.coupon_lines=t(e.coupon_lines,["code"],["discount","discount_tax"])),Object(a.isEmpty)(e.refunds)||(e.refunds=t(e.refunds,["reason"],["total"])),e.billing&&""===e.billing.email&&delete e.billing.email,e}function O(e){var t=e.status,n=void 0===t?"":t;window.jQuery&&(n&&window.jQuery("#order_status").val("wc-"+n).trigger("change"),window.jQuery("#woocommerce-order-notes").length&&window.jQuery.get(window.location.href,function(e){var t=window.jQuery(e).find("#woocommerce-order-notes");window.jQuery("#woocommerce-order-notes").html(t.html())}))}},636:function(e,t,n){"use strict";n.d(t,"a",function(){return s}),n.d(t,"b",function(){return d});n(35),n(1);var r="unpaid",i="unfulfilled",a="finished",o=["on-hold","pending"],c=["processing"],u=["cancelled","completed","failed","refunded"];function s(e){return r===e?o.join(","):i===e?c.join(","):a===e?u.join(","):e}function d(e){return-1!==u.indexOf(e)}},637:function(e,t,n){"use strict";n.d(t,"a",function(){return u}),n.d(t,"b",function(){return s}),n.d(t,"d",function(){return d}),n.d(t,"j",function(){return f}),n.d(t,"e",function(){return l}),n.d(t,"c",function(){return O}),n.d(t,"i",function(){return E}),n.d(t,"f",function(){return b}),n.d(t,"g",function(){return p}),n.d(t,"h",function(){return m});var r=n(533),i=n.n(r),a=(n(36),n(1)),o=n(635),c=(n(636),n(535)),u=function(e,t,n){return{type:c.q,siteId:e,orderId:t,error:n}},s=function(e,t){return{type:c.r,siteId:e,orderId:t}},d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:c.n,siteId:e,query:Object(o.b)(t),error:n}},f=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return Object(a.isArray)(n)?{type:c.o,siteId:e,query:Object(o.b)(t),total:r,orders:n}:d(e,t,n)},l=function(e,t){return{type:c.F,siteId:e,orderId:t}},O=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:c.G,siteId:e,orderId:t,error:n}},E=function(e,t,n){return"undefined"===typeof n.id?O(e,t,n):{type:c.H,siteId:e,orderId:t,order:n}},b=function(e,t){var n=t.id,r=i()(t,["id"]),u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a.noop,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:a.noop;return r=Object(o.e)(Object(o.d)(r)),{type:c.I,siteId:e,orderId:n,order:r,onFailure:s,onSuccess:u}},p=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:c.J,siteId:e,orderId:t,error:n}},m=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return"undefined"===typeof n.id?p(e,t,n):(Object(o.f)(n),{type:c.K,siteId:e,orderId:t,order:n})}},638:function(e,t,n){"use strict";n.d(t,"a",function(){return r});n(36),n(1);function r(e){if(!e.data)throw new Error("Failure at remote site.",e);return e}},646:function(e,t,n){"use strict";n.d(t,"a",function(){return s}),n.d(t,"c",function(){return d}),n.d(t,"b",function(){return f});var r=n(1),i=n(532),a=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return!1===Object(r.get)(e,["extensions","woocommerce","sites",n,"orders","notes","isLoading",t])},o=n(605),c=n(537),u=n(566),s={CUSTOMER_NOTE:"CUSTOMER_NOTE",INTERNAL_NOTE:"INTERNAL_NOTE",LABEL_PURCHASING:"LABEL_PURCHASING",LABEL_PURCHASED:"LABEL_PURCHASED",LABEL_REFUND_REQUESTED:"LABEL_REFUND_REQUESTED",LABEL_REFUND_COMPLETED:"LABEL_REFUND_COMPLETED",LABEL_REFUND_REJECTED:"LABEL_REFUND_REJECTED",REFUND_NOTE:"REFUND_NOTE"},d=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return!!a(e,t,n)&&(!(u.a(e,n)&&!Object(c.r)(e,t,n))||Object(c.t)(e,t,n))},f=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e),d=Object(o.a)(e,t,n),f=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);if(!a(e,t,n))return[];var o=Object(r.get)(e,["extensions","woocommerce","sites",n,"orders","notes","items"],{});return Object(r.get)(e,["extensions","woocommerce","sites",n,"orders","notes","orders",t],[]).map(function(e){return o[e]})}(e,t,n).filter(function(e){return!1===e.customer_note}).map(function(e){return{key:e.id,type:s.INTERNAL_NOTE,timestamp:new Date(e.date_created_gmt+"Z").getTime(),content:e.note}});if(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",n,"orders","refunds",t,"items"],[])}(e,t,n).forEach(function(e){f.push({key:e.id,type:s.REFUND_NOTE,timestamp:new Date(e.date_created_gmt+"Z").getTime(),amount:e.amount,reason:e.reason,currency:d.currency})}),u.a(e,n)){var l=Object(c.h)(e,t,n);Object(r.filter)(l,function(e){return-1!==["PURCHASED","ANONYMIZED","PURCHASE_IN_PROGRESS"].indexOf(e.status)}).forEach(function(e,t,n){var r=n.length-1-t;if(e.refund)switch(e.refund.status){case"complete":f.push({key:e.label_id,type:s.LABEL_REFUND_COMPLETED,timestamp:e.refund.refund_date,serviceName:e.service_name,labelIndex:r,amount:parseFloat(e.refund.amount)||e.refundable_amount,currency:e.currency});break;case"rejected":f.push({key:e.label_id,type:s.LABEL_REFUND_REJECTED,timestamp:e.refund.refund_date,serviceName:e.service_name,labelIndex:r});break;default:f.push({key:e.label_id,type:s.LABEL_REFUND_REQUESTED,timestamp:e.refund.request_date,serviceName:e.service_name,labelIndex:r,amount:parseFloat(e.refund.amount)||e.refundable_amount,currency:e.currency})}if("PURCHASE_IN_PROGRESS"===e.status)return f.push({key:e.label_id,type:s.LABEL_PURCHASING,labelIndex:r,labelId:e.label_id,serviceName:e.service_name,carrierId:e.carrier_id});f.push({key:e.label_id,type:s.LABEL_PURCHASED,timestamp:e.created_date,createdDate:e.created_date,usedDate:e.used_date,expiryDate:e.expiry_date,labelIndex:r,labelId:e.label_id,productNames:e.product_names,packageName:e.package_name,isLetter:e.is_letter,receiptId:e.main_receipt_id,serviceName:e.service_name,tracking:e.tracking,carrierId:e.carrier_id,amount:e.rate,refundableAmount:e.refundable_amount,currency:e.currency,anonymized:"ANONYMIZED"===e.status,showDetails:!e.refund||"rejected"===e.refund.status||"unknown"===e.refund.status,commercialInvoiceUrl:e.commercial_invoice_url})})}return f}},649:function(e,t,n){"use strict";var r=n(110),i=n.n(r),a=n(36),o=n.n(a),c=n(1),u=n(538),s={modalErrors:{},pristine:!0},d=function(e){return null===e||""===Object(c.trim)(e)},f={};f[u.g]=function(e){var t=e.packages&&e.packages.predefined?e.packages.predefined:{},n=o()({},e,{showModal:!0,mode:"add-custom",currentlyEditingPredefinedPackages:Object(c.cloneDeep)(t)});return"edit"!==e.mode&&n.packageData||(n.packageData={is_user_defined:!0}),n},f[u.i]=function(e,t){return Object.assign({},e,{showModal:!0,modalReadOnly:!1,mode:"edit",packageData:t.package,showOuterDimensions:!1})},f[u.h]=function(e){return Object.assign({},e,{modalErrors:{},showModal:!1,showOuterDimensions:!1})},f[u.s]=function(e,t){return Object.assign({},e,{modalErrors:t.value})},f[u.w]=function(e,t){var n=Object.assign({},e.packageData,t.values),r=Object(c.omitBy)(n,d);return Object.assign({},e,{packageData:r,pristine:!1})},f[u.m]=function(e,t){var n=t.packageData,r=e.packages.custom||[];(n.box_weight&&(n.box_weight=Number.parseFloat(n.box_weight)),n.max_weight&&(n.max_weight=Number.parseFloat(n.max_weight)),"index"in n)?r[n.index]=Object(c.omit)(n,"index"):r.push(n);return e=f[u.h](e),o()({},e,{mode:"add-custom",packageData:{is_user_defined:!0},packages:o()({},e.packages,{custom:r}),pristine:!1})},f[u.u]=function(e){return o()({},e,{showOuterDimensions:!0})},f[u.k]=function(e,t){var n=i()(e.packages.custom);return n.splice(t.index,1),o()({},e,{packages:o()({},e.packages,{custom:n}),pristine:!1,showModal:!1})},f[u.t]=function(e,t){var n=t.serviceId,r=t.groupId,i=t.checked,a=e.predefinedSchema[n][r].definitions.map(function(e){return e.id}),u=e.currentlyEditingPredefinedPackages[n],s=i?Object(c.uniq)(Object(c.concat)(u,a)):Object(c.difference)(u,a),d=o()({},e.currentlyEditingPredefinedPackages);return d[n]=s,o()({},e,{currentlyEditingPredefinedPackages:d,pristine:!1})},f[u.v]=function(e,t){var n=t.serviceId,r=t.packageId,a=o()({},e.currentlyEditingPredefinedPackages),c=i()(a[n]||[]),u=c.indexOf(r);return-1===u?c.push(r):c.splice(u,1),a[n]=c,o()({},e,{currentlyEditingPredefinedPackages:a,pristine:!1})},f[u.l]=function(e,t){var n=t.serviceId,r=t.packageId,a=o()({},e.packages.predefined),c=i()(a[n]||[]),u=c.indexOf(r);return-1!==u&&c.splice(u,1),a[n]=c,o()({},e,{packages:o()({},e.packages,{predefined:a}),pristine:!1})},f[u.n]=function(e){var t=e.currentlyEditingPredefinedPackages;return e=f[u.h](e),o()({},e,{packages:o()({},e.packages,{predefined:t}),pristine:!1})},f[u.o]=function(e,t){var n=t.mode;return o()({},e,{mode:n})},f[u.r]=function(e,t){return Object.assign({},e,{isSaving:t.isSaving,pristine:!t.isSaving})},f[u.p]=function(e,t){var n=t.isFetching;return o()({},e,{isFetching:n})},f[u.q]=function(e,t){var n=t.isFetchError;return o()({},e,{isFetchError:n})},f[u.j]=function(e,t){var n=t.packages,r=t.dimensionUnit,i=t.weightUnit,a=t.packageSchema,c=t.predefinedSchema;return o()({},e,{packages:n,dimensionUnit:r,weightUnit:i,packageSchema:a,predefinedSchema:c,packageData:e.packageData||{is_user_defined:!0},isLoaded:!0})};t.a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s,t=arguments.length>1?arguments[1]:void 0;return"function"===typeof f[t.type]?f[t.type](e,t):e}},650:function(e,t,n){"use strict";var r=n(34),i=n.n(r),a=n(36),o=n.n(a),c=n(538),u={meta:{error:!1,fieldsStatus:!1,isSaving:!1,isFetching:!1,isLoaded:!1,isFetchError:!1,pristine:!0},data:null,pristineData:null},s={};s[c.b]=function(e,t){var n=t.storeOptions,r=t.formData,i=t.formMeta,a=t.userMeta;return o()({},e,{storeOptions:n,meta:o()({},e.meta,i,{pristine:!0,isLoaded:!0,user:a}),data:o()({},e.data,r)})},s[c.e]=function(e,t){var n=t.key,r=t.value,a=e.meta.pristine?e.data:e.pristineData;return o()({},e,{meta:o()({},e.meta,{pristine:!1}),data:o()({},e.data,i()({},n,r)),pristineData:a})},s[c.f]=function(e,t){var n=t.key,r=t.value;return o()({},e,{meta:o()({},e.meta,i()({},n,r))})},s[c.d]=function(e){return e.meta.pristine?e:o()({},e,{meta:o()({},e.meta,{pristine:!0}),data:e.pristineData,pristineData:null})},s[c.c]=function(e){return o()({},e,{addCardDialog:!0})},s[c.a]=function(e){return o()({},e,{addCardDialog:null})};t.a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,t=arguments.length>1?arguments[1]:void 0;return s[t.type]?s[t.type](e,t):e}},655:function(e,t,n){"use strict";var r,i=n(110),a=n.n(i),o=n(36),c=n.n(o),u=n(118),s=n.n(u),d=n(34),f=n.n(d),l=n(47),O=n.n(l),E=n(592),b=n(535),p=O()("woocommerce:action-list");t.a=(r={},f()(r,b.d,[function(e,t){var n=e.dispatch,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now(),i=t.actionList,a=i.prevSteps,o=i.currentStep,u=i.nextSteps||[],d=s()(u),f=d[0],l=d.slice(1);if(o)return void p("[handleStepNext] Warning: Attempting before current step finishes. Ignoring.");if(!f)return void p("[handleStepNext] Warning: Attempting with no nextSteps left. Ignoring.");var O=c()({},i,{prevSteps:a,currentStep:c()({},f,{startTime:r}),nextSteps:l});n(Object(E.a)(O)),f.onStep(n,O)}]),f()(r,b.e,[function(e,t){var n=e.dispatch,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now(),i=t.actionList,o=i.prevSteps,u=i.currentStep,s=i.nextSteps;if(!u)return void p("[handleStepSuccess] Warning: Attempting with no current step. Ignoring.");var d=c()({},i,{prevSteps:[].concat(a()(o||[]),[c()({},u,{endTime:r})]),currentStep:null,nextSteps:s});n(Object(E.a)(d)),s&&s.length>0?n(Object(E.d)(d)):i.onSuccess&&i.onSuccess(n,d)}]),f()(r,b.c,[function(e,t){var n=e.dispatch,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now(),i=t.actionList,o=t.error,u=i.prevSteps,s=i.currentStep,d=i.nextSteps;if(!s)return void p("[handleStepFailure] Warning: Attempting with no current step. Ignoring.");var f=c()({},i,{prevSteps:[].concat(a()(u||[]),[c()({},s,{endTime:r,error:o})]),currentStep:null,nextSteps:d});n(Object(E.a)(f)),i.onFailure&&i.onFailure(n,f)}]),r)},656:function(e,t,n){"use strict";var r,i=n(34),a=n.n(i),o=n(46),c=n(535),u=n(539),s=n(615);t.a=Object(o.b)(null,(r={},a()(r,c.k,function(){return u.b}),a()(r,c.l,function(e,t){return t.data.map(function(e){return{code:e.code,name:Object(s.a)(e.name),countries:e.countries.map(function(e){return{code:e.code,name:Object(s.a)(e.name),states:e.states.map(function(e){return{code:e.code,name:Object(s.a)(e.name)}})}})}})}),a()(r,c.j,function(e,t){var n=t.originalAction.type;return c.k===n?u.a:e}),r))},680:function(e,t,n){"use strict";n.d(t,"a",function(){return a}),n.d(t,"b",function(){return o}),n.d(t,"c",function(){return c}),n.d(t,"d",function(){return u}),n.d(t,"e",function(){return s});var r=n(535),i=n(635),a=function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return{type:r.y,siteId:e,orderId:t,note:n,onSuccess:i,onFailure:a}},o=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return{type:r.z,siteId:e,orderId:t,error:n}},c=function(e,t,n){return Object(i.f)({}),{type:r.A,siteId:e,orderId:t,note:n}},u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return{type:r.w,siteId:e,orderId:t,error:n}},s=function(e,t,n){return{type:r.x,siteId:e,orderId:t,notes:n}}},681:function(e,t,n){"use strict";n.d(t,"a",function(){return i}),n.d(t,"b",function(){return a});var r=n(604);function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"USD",n=Object(r.getCurrencyDefaults)(t).precision;return"number"!==typeof e&&(e=parseFloat(e)),isNaN(e)?0:Math.round(e*Math.pow(10,n))/Math.pow(10,n)}function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"USD",n=Object(r.getCurrencyDefaults)(t).precision;return"number"!==typeof e&&(e=parseFloat(e)),isNaN(e)?"":e.toFixed(n)}},682:function(e,t,n){"use strict";var r=n(76),i=n.n(r);t.a=function(e){var t=(e.outer_dimensions?e.outer_dimensions.match(/([-.0-9]+).+?([-.0-9]+).+?([-.0-9]+)/):e.inner_dimensions.match(/([-.0-9]+).+?([-.0-9]+).+?([-.0-9]+)/)).slice(1).map(Number),n=i()(t,3);return{length:n[0],width:n[1],height:n[2]}}},683:function(e,t,n){"use strict";n.d(t,"a",function(){return a}),n.d(t,"b",function(){return o}),n.d(t,"c",function(){return c});var r=n(554),i=n(535);function a(e){return{type:i.k,siteId:e}}function o(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=a(e);return Object(r.a)(e,n,t)}function c(e,t){return{type:i.l,siteId:e,data:t}}},713:function(e){e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","properties":{"data":{"items":{"properties":{"CTA":{"properties":{"hook":{"type":"string"},"message":{"type":"string"},"primary":{"type":"boolean"}},"type":"object"},"content":{"properties":{"classes":{"type":"string"},"description":{"type":"string"},"emblem":{"type":"null"},"icon":{"type":"string"},"message":{"type":"string"}},"type":"object"},"feature_class":{"type":"string"},"id":{"type":"string"},"jitm_stats_url":{"type":"string"},"template":{"type":"string"},"ttl":{"type":"integer"},"url":{"type":"string"}},"type":"object"},"type":"array"}},"type":"object"}')},714:function(e,t,n){},791:function(e,t,n){"use strict";n.r(t);var r=n(36),i=n.n(r),a=n(34),o=n.n(a),c=n(10),u=n.n(c),s=n(107),d=n.n(s),f=n(108),l=n.n(f),O=n(528),E=n.n(O),b=n(527),p=n.n(b),m=n(531),_=n.n(m),g=n(529),I=n.n(g),v=n(12),h=n.n(v),S=n(30),j=n(109),C=n(35),R=n(526),y=n.n(R),P=n(534),M=n.n(P),N=n(1),T=n(544),A=n(543),L=n(532),k=n(537),D=n(546),w=n(646),W=n(637),G=n(605),U=n(530),H=n.n(U),V=n(648),F=n(633),x=Object(V.a)(function(e){return function(t){return u.a.createElement(F.a.Consumer,null,function(n){return u.a.createElement(e,H()({},t,n))})}},"WithLocalizedMoment"),B=u.a.lazy(function(){return Promise.all([n.e(0),n.e(150),n.e(2),n.e(147)]).then(n.bind(null,789))}),z=u.a.lazy(function(){return Promise.all([n.e(0),n.e(136),n.e(2),n.e(138),n.e(154)]).then(n.bind(null,786))}),q=function(e){function t(){var e,n;d()(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=E()(this,(e=p()(t)).call.apply(e,[this].concat(i))),o()(_()(n),"renderLabelButton",function(e,t){var r=n.props,i=r.loaded,a=r.translate,o=r.items,s=r.orderId,d=r.siteId,f=y()("shipping-label__new-label-button",{"is-placeholder":!i});return i?wcConnectData.wcs_server_connection?e.length?t<o?u.a.createElement("div",{className:"shipping-label__multiple-buttons-container"},u.a.createElement(T.a,{className:f,primary:!0,busy:!i,disabled:!i,onClick:n.handleCreateLabelButtonClick},a("Create shipping label")),u.a.createElement(T.a,{onClick:n.handleTrackPackagesButtonClick},a("Track Package","Track Packages",{count:e.length})),u.a.createElement(c.Suspense,{fallback:u.a.createElement("div",null)},u.a.createElement(B,{orderId:s,siteId:d}),u.a.createElement(z,{orderId:s,siteId:d}))):u.a.createElement("div",null,u.a.createElement("span",{className:"shipping-label__redo-shipping-button"},u.a.createElement(T.a,{borderless:!0,onClick:n.handleCreateLabelButtonClick},a("Create new label"))),u.a.createElement(T.a,{onClick:n.handleTrackPackagesButtonClick},a("Track Package","Track Packages",{count:e.length})),u.a.createElement(c.Suspense,{fallback:u.a.createElement("div",null)},u.a.createElement(B,{orderId:s,siteId:d}),u.a.createElement(z,{orderId:s,siteId:d}))):u.a.createElement("div",null,u.a.createElement(T.a,{className:f,primary:!0,busy:!i,disabled:!i,onClick:n.handleCreateLabelButtonClick},a("Create shipping label")),u.a.createElement(c.Suspense,{fallback:u.a.createElement("div",null)},u.a.createElement(B,{orderId:s,siteId:d}))):u.a.createElement(T.a,null,a("Connection error: unable to create label at this time")):u.a.createElement(T.a,{className:"shipping-label__button-loading",primary:!0,busy:!0,disabled:!0})}),o()(_()(n),"handleCreateLabelButtonClick",function(){var e=n.props,t=e.orderId,r=e.siteId;n.props.openPrintingFlow(t,r)}),o()(_()(n),"handleTrackPackagesButtonClick",function(){var e=n.props,t=e.orderId,r=e.siteId;n.props.openTrackingFlow(t,r)}),n}return I()(t,e),l()(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.siteId,n=e.orderId,r=e.orderLoading,i=e.orderLoaded;t&&n&&!r&&!i&&this.props.fetchOrder(t,n)}},{key:"render",value:function(){var e,t=this.props,n=t.loaded,r=t.labelsEnabled,i=t.items,a=t.translate,o=t.events,c=t.moment,s=!n||r,d=Object(N.filter)(o,{type:"LABEL_PURCHASED"}),f=Object(N.filter)(o,{type:"LABEL_REFUND_REQUESTED"}),l=Object(N.differenceBy)(d,f,"labelIndex"),O=Object(N.sumBy)(l,function(e){return e.productNames.length}),E=!1;l.length>0&&i<=O&&(E=!0,e=c(Object(N.maxBy)(l,"createdDate").createdDate).format("ll"));return u.a.createElement("div",{className:"shipping-label__container"},u.a.createElement("div",{className:"shipping-label__banner-fulfilled-message"},u.a.createElement(M.a,{size:36,icon:"shipping"}),n&&(E?u.a.createElement("em",null,a("%(itemCount)d item was fulfilled on {{span}}%(createdDate)s{{/span}}","%(itemCount)d items were fulfilled on {{span}}%(createdDate)s{{/span}}",{count:i,args:{createdDate:e,itemCount:i},components:{span:u.a.createElement("span",{className:"shipping-label__banner-fulfilled-date"})}})):u.a.createElement("em",null,a("%(itemCount)d item is ready to be fulfilled","%(itemCount)d items are ready to be fulfilled",{count:i,args:{itemCount:i}})))),u.a.createElement("div",null,s&&this.renderLabelButton(l,O)))}}]),t}(c.Component);o()(q,"propTypes",{orderId:h.a.number.isRequired});var Z,Q=Object(j.b)(function(e,t){var n=t.orderId,r=Object(L.a)(e);return{siteId:r,loaded:Object(k.a)(e,n,r),events:Object(w.b)(e,n),orderLoading:Object(G.c)(e,n,r),orderLoaded:Object(G.b)(e,n,r),labelsEnabled:Object(D.a)(e,r)}},function(e){return i()({},Object(S.b)({openPrintingFlow:A.x,openTrackingFlow:A.A,setEmailDetailsOption:A.M,setFulfillOrderOption:A.N,fetchOrder:W.e},e))})(Object(C.localize)(x(q))),K=n(25),Y=n.n(K),J=n(538),X=(Z={},o()(Z,J.Y,function(e){e.error||window.wc_shipment_tracking_refresh&&window.wc_shipment_tracking_refresh()}),o()(Z,J.U,function(){var e=Y()("#woocommerce-order-label");e.pointer&&e.pointer().pointer("close")}),Z),$=function(){return function(e){return function(t){e(t);var n=X[t.type];n&&n(t)}}},ee=n(591),te=n(110),ne=n.n(te),re=n(46),ie=n(535),ae=n(682),oe=function(e){return Boolean(e&&e.name&&e.address&&e.city&&e.postcode&&e.country)},ce=function(e){if(!e)return{loaded:!1,isFetching:!1,error:!1,fulfillOrder:!1,emailDetails:!1};var t=e.formData,n=e.labelsData,r=e.paperSize,i=e.storeOptions,a=e.canChangeCountries,o=Boolean(t.origin_normalized||t.origin.phone),c=oe(t.origin),u=oe(t.destination),s={};return Object(N.forEach)(t.selected_packages,function(e){e.items.map(function(e){var n=e.product_id,r=e.weight,i=e.name,a=e.attributes,o=e.description,c=e.value,u=e.hs_tariff_number,d=e.origin_country,f=a?" ("+a+")":"",l=i.substring(i.indexOf("-")+1).trim()+f;s[n]={defaultDescription:l,description:o||l,weight:r,value:c,tariffNumber:u,originCountry:d||t.origin.country}})}),{loaded:!0,isFetching:!1,error:!1,fulfillOrder:!1,emailDetails:!1,refreshedLabelStatus:!1,labels:n||[],paperSize:r,storeOptions:i,form:{orderId:t.order_id,origin:{values:t.origin,isNormalized:o,normalized:o?t.origin:null,ignoreValidation:c?null:Object(N.mapValues)(t.origin,function(){return!0}),selectNormalized:!0,normalizationInProgress:!1,allowChangeCountry:Boolean(a)},destination:{values:t.destination,isNormalized:Boolean(t.destination_normalized),normalized:t.destination_normalized?t.destination:null,ignoreValidation:u?null:Object(N.mapValues)(t.destination,function(){return!0}),selectNormalized:!0,normalizationInProgress:!1,allowChangeCountry:Boolean(a)},packages:{all:t.all_packages,flatRateGroups:t.flat_rate_groups,selected:t.selected_packages,isPacked:t.is_packed,saved:!0},customs:{items:s,ignoreWeightValidation:Object(N.mapValues)(s,function(e){var t=e.weight;return!t||!parseFloat(t)}),ignoreValueValidation:Object(N.mapValues)(s,function(e){var t=e.value;return!t||!parseFloat(t)})},rates:{values:Object(N.isEmpty)(t.rates.selected)?Object(N.mapValues)(t.packages,function(){return{serviceId:"",signatureRequired:!1}}):t.rates.selected,available:{},retrievalInProgress:!1},rateOptions:{}},openedPackageId:Object.keys(t.selected_packages)[0]||""}},ue=n(636),se=function(e,t){for(var n=0;n<=t.length;n++)if(-1===t.indexOf(e+n))return e+n},de={};de[J.O]=function(e,t){return i()({},e,ce(Object(N.omit)(t,"type","siteId")))},de[J.wb]=function(e,t){var n=t.isFetching;return i()({},e,{isFetching:n})},de[J.ub]=function(e,t){var n=t.error;return i()({},e,{error:n})},de[J.U]=function(e){return i()({},e,{showPurchaseDialog:!0})},de[J.Ob]=function(e){return i()({},e,{showTrackingDialog:!0})},de[J.N]=function(e,t){return!t.force&&e.form.isSubmitting?e:i()({},e,{showPurchaseDialog:!1,form:i()({},e.form,{isSubmitting:!1})})},de[J.y]=function(e){return i()({},e,{showTrackingDialog:!1})},de[J.Hb]=function(e,t){var n=t.stepName,r=t.expanded,a=void 0===r?null:r;return i()({},e,{form:i()({},e.form,o()({},n,i()({},e.form[n],{expanded:Object(N.isBoolean)(a)?a:!e.form[n].expanded})))})},de[J.Ib]=function(e,t){var n=t.group,r=t.name,a=t.value,c=i()({},e,{form:i()({},e.form,o()({},n,i()({},e.form[n],{values:i()({},e.form[n].values,o()({},r,a)),isNormalized:!1,isUnverifiable:!1,normalized:null})))});return"country"===r?de[J.Ib](c,{group:n,name:"state",value:""}):(e.form[n].ignoreValidation&&(c.form[n].ignoreValidation=i()({},e.form[n].ignoreValidation,o()({},r,!1))),c)},de[J.db]=function(e,t){var n=t.group;return i()({},e,{form:i()({},e.form,o()({},n,i()({},e.form[n],{ignoreValidation:null})))})},de[J.A]=function(e,t){var n=t.group;return i()({},e,{form:i()({},e.form,o()({},n,i()({},e.form[n],{normalizationInProgress:!0})))})},de[J.z]=function(e,t){var n=t.group,r=t.requestSuccess,a=t.fieldErrors,c=t.normalized,u=t.isTrivialNormalization,s=i()({},e,{form:i()({},e.form,o()({},n,i()({},e.form[n],{isNormalized:r,normalizationInProgress:!1,fieldErrors:a,selectNormalized:r&&!a,normalized:c})))});return u&&(s.form[n].values=c),s},de[J.jb]=function(e,t){var n=t.group,r=t.selectNormalized;return i()({},e,{form:i()({},e.form,o()({},n,i()({},e.form[n],{selectNormalized:r})))})},de[J.L]=function(e,t){var n=t.group;return i()({},e,{form:i()({},e.form,o()({},n,i()({},e.form[n],{selectNormalized:!1,normalized:null,isNormalized:!1,isUnverifiable:!1})))})},de[J.M]=function(e,t){var n=t.group;return i()({},e,{form:i()({},e.form,o()({},n,i()({},e.form[n],{selectNormalized:!1,normalized:null,isNormalized:!1,isUnverifiable:!0})))})},de[J.J]=function(e,t){var n=t.group,r=i()({},e.form[n],{expanded:!1,isNormalized:!0});return r.selectNormalized&&r.normalized?r.values=r.normalized:r.normalized=r.values,i()({},e,{form:i()({},e.form,o()({},n,r))})},de[J.Jb]=function(e,t){var n=t.packageId,r=t.value,a=i()({},e.form.packages.selected);return a[n]=i()({},a[n],{weight:parseFloat(r),isUserSpecifiedWeight:!0}),i()({},e,{form:i()({},e.form,{packages:i()({},e.form.packages,{selected:a,saved:!1}),rates:i()({},e.form.rates,{values:i()({},e.form.rates.values,o()({},n,{serviceId:"",signatureRequired:!1})),available:{}})})})},de[J.yb]=function(e,t){var n=t.packageId,r=t.signature,a=i()({},e.form.packages.selected);return a[n]=i()({},a[n],{signature:r}),i()({},e,{form:i()({},e.form,{packages:i()({},e.form.packages,{selected:a,saved:!1}),rates:i()({},e.form.rates,{values:i()({},e.form.rates.values,o()({},n,{serviceId:"",signatureRequired:!1})),available:{}})})})},de[J.T]=function(e,t){var n=t.openedPackageId;return i()({},e,{openedPackageId:n})},de[J.S]=function(e,t){var n=t.movedItemIndex;return i()({},e,{showItemMoveDialog:!0,targetPackageId:e.openedPackageId,movedItemIndex:n})},de[J.P]=function(e,t){var n=t.originPackageId,r=t.movedItemIndex,a=t.targetPackageId;if(-1===r||n===a||void 0===n)return e;var o=i()({},e.form.packages.selected),c=null,u=e.openedPackageId,s=ne()(o[n].items),d=s.splice(r,1)[0];if(o[n]=i()({},o[n],{items:s,weight:Object(N.round)(o[n].weight-d.weight,8)}),"individual"===a){var f=Object.keys(o);c=se("client_individual_",f);var l=d.height,O=d.length,E=d.width,b=d.weight;o[c]={height:l,length:O,width:E,weight:b,id:c,box_id:"individual",items:[d]}}else if("new"===a){var p=Object.keys(o);o[c=se("client_custom_",p)]={height:0,length:0,width:0,weight:d.weight,id:c,box_id:"not_selected",items:[d]}}else if(a){var m=ne()(o[a].items);m.push(d),o[a]=i()({},o[a],{items:m,weight:Object(N.round)(o[a].weight+d.weight,8)})}return 0===o[n].items.length&&(delete o[n],u=c||a),i()({},e,{openedPackageId:u,addedPackageId:c,movedItemIndex:-1,showItemMoveDialog:!1,form:i()({},e.form,{needsPrintConfirmation:!1,packages:i()({},e.form.packages,{selected:o,saved:!1}),rates:i()({},e.form.rates,{values:Object(N.mapValues)(o,function(){return{serviceId:"",signatureRequired:!1}}),available:{}})})})},de[J.G]=function(e){return i()({},e,{movedItemIndex:-1,showItemMoveDialog:!1})},de[J.Db]=function(e,t){var n=t.targetPackageId;return i()({},e,{targetPackageId:n})},de[J.Q]=function(e){return i()({},e,{showAddItemDialog:!0,addedItems:{}})},de[J.E]=function(e){return i()({},e,{showAddItemDialog:!1})},de[J.lb]=function(e,t){var n,r=t.sourcePackageId,a=t.movedItemIndex;if(t.added){var c=e.addedItems[r]||[];n=Object(N.includes)(c,a)?c:[].concat(ne()(c),[a])}else n=Object(N.without)(e.addedItems[r],a);return i()({},e,{addedItems:i()({},e.addedItems,o()({},r,n))})},de[J.B]=function(e,t){var n=t.targetPackageId;return Object(N.each)(e.addedItems,function(t,r){Object(N.sortBy)(t,function(e){return-e}).forEach(function(t){e=de[J.P](e,{originPackageId:r,movedItemIndex:t,targetPackageId:n})})}),i()({},e,{showAddItemDialog:!1})},de[J.C]=function(e){var t=i()({},e.form.packages.selected),n=Object.keys(t),r=se("client_custom_",n),a=r;return t[r]={height:0,length:0,width:0,id:r,weight:0,box_id:"not_selected",items:[]},i()({},e,{openedPackageId:a,addedPackageId:r,form:i()({},e.form,{needsPrintConfirmation:!1,packages:i()({},e.form.packages,{selected:t,saved:!1}),rates:i()({},e.form.rates,{values:Object(N.mapValues)(t,function(){return{serviceId:"",signatureRequired:!1}}),available:{}})})})},de[J.eb]=function(e,t){var n=t.packageId,r=i()({},e.form.packages.selected),a=r[n].items;delete r[n];var o=Object.keys(r)[0]||"",c=i()({},r[o]);return c.items=c.items.concat(a),r[o]=c,i()({},e,{openedPackageId:o,form:i()({},e.form,{needsPrintConfirmation:!1,packages:i()({},e.form.packages,{selected:r,saved:!1}),rates:i()({},e.form.rates,{values:Object(N.mapValues)(r,function(){return{serviceId:"",signatureRequired:!1}}),available:{}})})})},de[J.zb]=function(e,t){var n=t.box,r=t.packageId,a=t.boxTypeId,o=i()({},e.form.packages.selected),c=o[r],u=Object(N.round)(c.isUserSpecifiedWeight?c.weight:(n?n.box_weight:0)+Object(N.sumBy)(c.items,"weight"),8);if("not_selected"!==a&&n){var s=Object(ae.a)(n),d=s.length,f=s.width,l=s.height;o[r]=i()({},Object(N.omit)(c,"service_id"),{height:l,length:d,width:f,weight:u,box_id:a,is_letter:n.is_letter})}else o[r]=i()({},Object(N.omit)(c,"service_id"),{height:0,length:0,width:0,weight:u,box_id:a});return i()({},e,{form:i()({},e.form,{needsPrintConfirmation:!1,packages:i()({},e.form.packages,{selected:o,saved:!1}),rates:i()({},e.form.rates,{values:Object(N.mapValues)(o,function(){return{serviceId:"",signatureRequired:!1}}),available:{}})})})},de[J.ib]=function(e){return i()({},e,{form:i()({},e.form,{packages:i()({},e.form.packages,{saved:!0})})})},de[J.nb]=function(e,t){var n=t.packageId,r=t.contentsType;return i()({},e,{form:i()({},e.form,{packages:i()({},e.form.packages,{selected:i()({},e.form.packages.selected,o()({},n,i()({},e.form.packages.selected[n],{contentsType:r})))})})})},de[J.mb]=function(e,t){var n=t.packageId,r=t.contentsExplanation;return i()({},e,{form:i()({},e.form,{packages:i()({},e.form.packages,{selected:i()({},e.form.packages.selected,o()({},n,i()({},e.form.packages.selected[n],{contentsExplanation:r})))})})})},de[J.Cb]=function(e,t){var n=t.packageId,r=t.restrictionType;return i()({},e,{form:i()({},e.form,{packages:i()({},e.form.packages,{selected:i()({},e.form.packages.selected,o()({},n,i()({},e.form.packages.selected[n],{restrictionType:r})))})})})},de[J.Bb]=function(e,t){var n=t.packageId,r=t.restrictionComments;return i()({},e,{form:i()({},e.form,{packages:i()({},e.form.packages,{selected:i()({},e.form.packages.selected,o()({},n,i()({},e.form.packages.selected[n],{restrictionComments:r})))})})})},de[J.kb]=function(e,t){var n=t.packageId,r=t.abandonOnNonDelivery;return i()({},e,{form:i()({},e.form,{packages:i()({},e.form.packages,{selected:i()({},e.form.packages.selected,o()({},n,i()({},e.form.packages.selected[n],{abandonOnNonDelivery:Boolean(r)})))})})})},de[J.xb]=function(e,t){var n=t.packageId,r=t.itn;return i()({},e,{form:i()({},e.form,{packages:i()({},e.form.packages,{selected:i()({},e.form.packages.selected,o()({},n,i()({},e.form.packages.selected[n],{itn:r})))})})})},de[J.ob]=function(e,t){var n=t.productId,r=t.description;return i()({},e,{form:i()({},e.form,{customs:i()({},e.form.customs,{items:i()({},e.form.customs.items,o()({},n,i()({},e.form.customs.items[n],{description:r})))})})})},de[J.qb]=function(e,t){var n=t.productId,r=t.tariffNumber;return i()({},e,{form:i()({},e.form,{customs:i()({},e.form.customs,{items:i()({},e.form.customs.items,o()({},n,i()({},e.form.customs.items[n],{tariffNumber:r.replace(/\D/g,"").substr(0,6)})))})})})},de[J.sb]=function(e,t){var n=t.productId,r=t.weight;return i()({},e,{form:i()({},e.form,{customs:i()({},e.form.customs,{items:i()({},e.form.customs.items,o()({},n,i()({},e.form.customs.items[n],{weight:r}))),ignoreWeightValidation:i()({},e.form.customs.ignoreWeightValidation,o()({},n,!1))})})})},de[J.rb]=function(e,t){var n=t.productId,r=t.value;return i()({},e,{form:i()({},e.form,{customs:i()({},e.form.customs,{items:i()({},e.form.customs.items,o()({},n,i()({},e.form.customs.items[n],{value:r}))),ignoreValueValidation:i()({},e.form.customs.ignoreValueValidation,o()({},n,!1))})})})},de[J.pb]=function(e,t){var n=t.productId,r=t.originCountry;return i()({},e,{form:i()({},e.form,{customs:i()({},e.form.customs,{items:i()({},e.form.customs.items,o()({},n,i()({},e.form.customs.items[n],{originCountry:r})))})})})},de[J.hb]=function(e){return i()({},e,{form:i()({},e.form,{customs:i()({},e.form.customs,{items:Object(N.mapValues)(e.form.customs.items,function(e){return i()({},e,{tariffNumber:e.tariffNumber||""})}),ignoreWeightValidation:{},ignoreValueValidation:{}})})})},de[J.Lb]=function(e,t){var n=t.packageId,r=t.serviceId,a=t.carrierId,o=t.signatureRequired,c=i()({},e.form.rates.values);return c[n]={serviceId:r,carrierId:a,signatureRequired:o},i()({},e,{form:i()({},e.form,{rates:i()({},e.form.rates,{values:c})})})},de[J.Kb]=function(e,t){var n=t.value;return i()({},e,{paperSize:n})},de[J.tb]=function(e,t){var n=t.value;return i()({},e,{emailDetails:n})},de[J.vb]=function(e,t){var n=t.value;return i()({},e,{fulfillOrder:n})},de[J.X]=function(e){return i()({},e,{form:i()({},e.form,{isSubmitting:!0})})},de[J.Y]=function(e,t){var n=t.response;return t.error?i()({},e,{form:i()({},e.form,{isSubmitting:!1})}):i()({},e,{labels:[].concat(ne()(n.map(function(e){return i()({},e,{statusUpdated:!0})})),ne()(e.labels))})},de[J.Eb]=function(e,t){var n=t.fileData,r=t.labels;return i()({},e,{form:i()({},e.form,{needsPrintConfirmation:!0,fileData:n,labelsToPrint:r,isSubmitting:!1})})},de[J.ab]=function(e,t){var n=t.requestData;return i()({},e,{form:i()({},e.form,{rates:i()({},e.form.rates,{retrievalInProgress:n})})})},de[J.Ab]=function(e,t){var n=t.rates,r=t.requestData;return Object(N.isEqual)(r,e.form.rates.retrievalInProgress)?i()({},e,{form:i()({},e.form,{rates:{values:Object(N.mapValues)(n,function(e){var t=Object(N.get)(e,"rates",[]),n=1===t.length?t[0]:Object(N.find)(t,function(e){return e.is_selected});return n?n.service_id:""}),available:n}})}):e},de[J.Z]=function(e,t){var n=t.requestData;return Object(N.isEqual)(n,e.form.rates.retrievalInProgress)?i()({},e,{form:i()({},e.form,{rates:i()({},e.form.rates,{retrievalInProgress:null})})}):e},de[J.D]=function(e){return i()({},e,{form:i()({},e.form,{needsPrintConfirmation:!1,rates:i()({},e.form.rates,{available:{}})})})},de[J.V]=function(e,t){var n=t.labelId;return i()({},e,{refundDialog:{labelId:n}})},de[J.H]=function(e){return e.refundDialog.isSubmitting?e:i()({},e,{refundDialog:null})},de[J.Gb]=function(e,t){var n=t.labelId,r=Object(N.findIndex)(e.labels,{label_id:n}),a=i()({},e.labels[r],{statusRetrivalInProgress:!0}),o=i()({},e,{labels:ne()(e.labels)});return o.labels[r]=a,o},de[J.Fb]=function(e,t){var n=t.labelId,r=t.response;t.error&&(r={});var a=Object(N.findIndex)(e.labels,{label_id:n}),o=i()({},e.labels[a],r,{statusUpdated:!0,statusRetrivalInProgress:!1}),c=i()({},e,{labels:ne()(e.labels),refreshedLabelStatus:!0});return c.labels[a]=o,c},de[J.bb]=function(e){return i()({},e,{refundDialog:i()({},e.refundDialog,{isSubmitting:!0})})},de[J.cb]=function(e,t){var n=t.response;if(t.error)return i()({},e,{refundDialog:i()({},e.refundDialog,{isSubmitting:!1})});var r=Object(N.findIndex)(e.labels,{label_id:e.refundDialog.labelId}),a=i()({},e.labels[r],{refund:n}),o=i()({},e,{refundDialog:null,labels:ne()(e.labels)});return o.labels[r]=a,o},de[J.W]=function(e,t){var n=t.labelId;return i()({},e,{reprintDialog:{labelId:n,isFetching:!0}})},de[J.gb]=function(e,t){var n=t.labelId,r=t.fileData;return Object(N.get)(e,"reprintDialog.labelId")!==n?e:i()({},e,{reprintDialog:{labelId:n,fileData:r,isFetching:!1}})},de[J.fb]=function(e,t){var n=t.labelId;return Object(N.get)(e,"reprintDialog.labelId")!==n?e:i()({},e,{reprintDialog:{labelId:n,isFetching:!1}})},de[J.I]=function(e){return i()({},e,{reprintDialog:null})},de[J.K]=function(e){return i()({},e,{reprintDialog:i()({},e.reprintDialog,{isFetching:!0})})},de[J.R]=function(e,t){var n=t.labelId;return i()({},e,{detailsDialog:{labelId:n}})},de[J.F]=function(e){return i()({},e,{detailsDialog:null})},de[ie.H]=function(e,t){var n=t.order.status;return i()({},e,{fulfillOrder:!Object(ue.b)(n),emailDetails:Object(ue.b)(n)})};var fe=Object(re.d)("orderId",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ce(),t=arguments.length>1?arguments[1]:void 0;return de[t.type]?de[t.type](e,t):e}),le=n(649),Oe=n(650),Ee=n(635);var be=Object(re.a)({isSending:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=t.type,r=t.orderId;switch(n){case ie.s:return i()({},e,o()({},r,!0));case ie.u:case ie.t:return i()({},e,o()({},r,!1));default:return e}}});var pe=Object(re.a)({isLoading:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.v:case ie.x:case ie.w:return Object.assign({},e,o()({},t.orderId,ie.v===t.type));default:return e}},isSaving:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.y:case ie.z:case ie.A:return Object.assign({},e,o()({},t.orderId,ie.y===t.type));default:return e}},items:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.x:var n=Object(N.keyBy)(t.notes,"id");return Object.assign({},e,n);case ie.A:var r=t.note;return Object.assign({},e,o()({},r.id,r));default:return e}},orders:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.x:var n=t.notes.map(function(e){return e.id});return Object.assign({},e,o()({},t.orderId,n));case ie.A:var r=t.note,i=t.orderId,a=[].concat(ne()(e[i]||[]),[r.id]);return Object.assign({},e,o()({},i,a));default:return e}}});var me=Object(re.d)("orderId",Object(re.a)({isSaving:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.C:case ie.E:case ie.D:return ie.C===t.type;default:return e}},items:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.B:return t.refunds;case ie.E:return[].concat(ne()(e),[t.refund]);default:return e}}}));var _e=Object(re.a)({invoice:be,isDeleting:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.p:case ie.q:case ie.r:return Object.assign({},e,o()({},t.orderId,ie.p===t.type));default:return e}},isQueryLoading:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.m:case ie.o:case ie.n:var n=Object(Ee.c)(t.query);return Object.assign({},e,o()({},n,ie.m===t.type));default:return e}},isLoading:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.F:case ie.H:case ie.G:return Object.assign({},e,o()({},t.orderId,ie.F===t.type));default:return e}},isUpdating:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=Object(N.isFinite)(t.orderId)?t.orderId:JSON.stringify(t.orderId);switch(t.type){case ie.I:case ie.K:case ie.J:return Object.assign({},e,o()({},n,ie.I===t.type));default:return e}},items:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;switch(n.type){case ie.o:return e=Object(N.keyBy)(n.orders,"id"),Object.assign({},t,e);case ie.H:case ie.K:return e=o()({},n.order.id,n.order),Object.assign({},t,e);default:return t}},queries:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.o:var n=t.orders.map(function(e){return e.id}),r=Object(Ee.c)(t.query);return Object.assign({},e,o()({},r,n));default:return e}},refunds:me,total:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie.o:var n=Object(Ee.c)(Object(N.omit)(t.query,"page"));return Object.assign({},e,o()({},n,t.total));default:return e}},notes:pe}),ge=n(47),Ie=n.n(ge),ve=n(602),he=n(606),Se=n(545);function je(e){return{type:ie.f,siteId:e}}var Ce=function(e){return Object(N.get)(e,"ui.route.path.current",null)},Re=n(710),ye=n.n(Re),Pe=n(115),Me=n.n(Pe),Ne=function(e){function t(e){var n;return d()(this,t),(n=E()(this,p()(t).call(this,"Failed to validate with JSON schema"))).schemaErrors=e,n}return I()(t,e),t}(ye()(Error)),Te=function(e){function t(e,n,r){var i;return d()(this,t),(i=E()(this,p()(t).call(this,e.message))).inputData=n,i.transformer=r,i}return I()(t,e),t}(ye()(Error));var Ae,Le,ke,De=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:N.identity,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(a){return t||function(){var a=Object.assign({greedy:!0,verbose:!0},i),o=Me()(e,a),c=Me.a.filter(Object.assign({},e,e.type&&"object"===e.type&&{additionalProperties:!1}));n=function(e){if(!o(e))throw new Ne(o.errors);return c(e)},t=function(e){try{return r(e)}catch(t){throw new Te(t,e,r)}}}(),t(n(a))}},we=n(713),We=n(533),Ge=n.n(We),Ue=function(e){var t=e.apiVersion,n=e.apiNamespace,r=e.body,a=e.method,o=e.path,c=e.query,u=void 0===c?{}:c,s=e.formData,d=e.onSuccess,f=e.onFailure,l=e.onProgress,O=Ge()(e,["apiVersion","apiNamespace","body","method","path","query","formData","onSuccess","onFailure","onProgress"]),E=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,b=n?{apiNamespace:n}:{apiVersion:t};return{type:"WPCOM_HTTP_REQUEST",body:r,method:a,path:o,query:i()({},u,b),formData:s,onSuccess:d||E,onFailure:f||E,onProgress:l||E,options:O}},He=n(560),Ve=n(607),Fe={},xe=new Set,Be={hasInitializedSites:!1,hasInitializedSection:!1,lastSection:null,lastSite:null},ze=["/jetpack/connect/user-type","/jetpack/connect/site-type","/jetpack/connect/site-topic"],qe=function(e){return e.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(t)})},Ze=function(e){return e.data.map(function(e){return{message:qe(e.content.message),description:qe(e.content.description),featureClass:e.feature_class,callToAction:qe(e.CTA.message),id:e.id}})},Qe=function(e){return function(t,n){if(Be.hasInitializedSites&&Be.hasInitializedSection){var r=Be.lastSite;if(Object(He.c)(n(),r)){var a=Ce(n());Object(N.some)(ze,function(e){return Object(N.startsWith)(a,e)})||t(Ue({apiNamespace:"rest",method:"GET",path:"/v1.1/jetpack-blogs/".concat(r,"/rest-api/"),query:{path:"/jetpack/v4/jitm",query:JSON.stringify({message_path:"calypso:".concat(Be.lastSection,":admin_notices")}),http_envelope:1}},i()({},e,{messagePath:Be.lastSection})))}}}},Ke=function(e,t){return function(n,r){n(function(e,t,n){return{type:"JITM_SET",keyedPath:t+e,jitms:n.map(function(e){return i()({},e,{lastUpdated:Date.now()})})}}(e.siteId||e.site_id||Object(L.a)(r()),e.messagePath,t))}},Ye=function(e){return function(t,n){t(function(e,t){return{type:"JITM_SET",keyedPath:t+e,jitms:[]}}(e.siteId||e.site_id||Object(L.a)(n()),e.messagePath))}};Le="state/data-layer/wpcom/sites/jitm/index.js",Ae={},o()(Ae,"SECTION_SET",[Object(he.a)({fetch:function(e){var t=Object(N.get)(e,["section","name"]);if(!Be.hasInitializedSection||!e.section||Be.lastSection!==t){switch(e.isLoading){case!1:return void(Be.hasInitializedSection=!0);case!0:return void(Be.hasInitializedSection=!1)}return Be.lastSection=t,Qe(e)}},onSuccess:Ke,onError:Ye,fromApi:De(we,Ze)})]),o()(Ae,"SELECTED_SITE_SET",[Object(he.a)({fetch:function(e){if(!Be.hasInitializedSites||Be.lastSite!==e.siteId)return Be.hasInitializedSites=!!e.siteId,Be.lastSite=e.siteId,Qe(e)},onSuccess:Ke,onError:Ye,fromApi:De(we,Ze)})]),o()(Ae,"JITM_DISMISS",[Object(he.a)({fetch:function(e){return Ue({apiNamespace:"rest",method:"POST",path:"/jetpack-blogs/".concat(e.siteId,"/rest-api/"),query:{path:"/jetpack/v4/jitm",body:JSON.stringify({feature_class:e.featureClass,id:e.id}),http_envelope:1,json:!1}},e)},onSuccess:N.noop,onError:N.noop})]),ke=Ae,xe.has(Le)||(xe.add(Le),Fe=Object(Ve.a)(Fe,ke));var Je,Xe=n(634),$e=n(638),et=Ie()("woocommerce:orders");function tt(e,t){if(et("API Error: ",t),e.failureAction)return i()({},e.failureAction,{error:t})}var nt,rt=(Je={},o()(Je,ie.p,[Object(he.a)({fetch:function(e){var t=e.siteId,n=e.orderId;return Object(Xe.a)(t,e).del("orders/".concat(n))},onSuccess:function(e){return function(t){var n=e.siteId,r=e.siteSlug,i=e.orderId;t(Object(W.b)(n,i)),t(je(n)),t({type:"NAVIGATE",path:"/store/orders/".concat(r)}),t(Object(Se.d)(Object(C.translate)("Order deleted."),{duration:8e3}))}},onError:function(e,t){return function(n){var r=e.siteId,i=e.orderId;n(Object(W.a)(r,i,t)),n(Object(Se.a)(Object(C.translate)("Unable to delete order."),{duration:8e3}))}},fromApi:$e.a})]),o()(Je,ie.F,[Object(he.a)({fetch:function(e){var t=e.siteId,n=e.orderId;return e.failureAction=Object(W.c)(t,n),Object(Xe.a)(t,e).get("orders/".concat(n))},onSuccess:function(e,t){var n=t.data,r=e.siteId,i=e.orderId;return Object(W.i)(r,i,n)},onError:tt})]),o()(Je,ie.I,[Object(he.a)({fetch:function(e){var t=e.siteId,n=e.orderId,r=e.order;return Object(N.isFinite)(n)?Object(Xe.a)(t,e).post("orders/".concat(n),r):Object(Xe.a)(t,e).post("orders",r)},onSuccess:function(e,t){var n=t.data;return function(t){var r=e.siteId,i=e.orderId;"function"===typeof e.onSuccess&&"undefined"!==typeof n.id&&e.onSuccess(t,n.id),t(je(r)),t(Object(W.h)(r,i,n))}},onError:function(e,t){return function(n){var r=e.siteId,i=e.orderId;"function"===typeof e.onFailure&&e.onFailure(n),et("API Error: ",t),n(Object(W.g)(r,i,t))}}})]),o()(Je,ie.m,[Object(he.a)({fetch:function(e){var t=e.siteId,n=e.query,r=Object(ve.stringify)(Object(N.omitBy)(n,function(e){return""===e}));return e.failureAction=Object(W.d)(t,n),Object(Xe.a)(t,e).getWithHeaders("orders?".concat(r))},onSuccess:function(e,t){var n=t.data,r=e.siteId,i=e.query,a=n.body,o=n.headers,c=Number(o["X-WP-Total"]);return Object(W.j)(r,i,a,c)},onError:tt})]),Je),it=n(680),at=(nt={},o()(nt,ie.v,[Object(he.a)({fetch:function(e){var t=e.siteId,n=e.orderId;return Object(Xe.a)(t,e).get("orders/".concat(n,"/notes"))},onSuccess:function(e,t){var n=t.data;return function(t){var r=e.siteId,i=e.orderId;t(Object(it.e)(r,i,n)),e.onSuccess&&t(e.onSuccess)}},onError:function(e,t){return function(n){var r=e.siteId,i=e.orderId;n(Object(it.d)(r,i,t)),e.onFailure&&n(e.onFailure)}},fromApi:$e.a})]),o()(nt,ie.y,[Object(he.a)({fetch:function(e){var t=e.siteId,n=e.orderId,r=e.note;return Object(Xe.a)(t,e).post("orders/".concat(n,"/notes"),r)},onSuccess:function(e,t){var n=t.data;return function(t){var r=e.siteId,i=e.orderId;t(Object(it.c)(r,i,n)),e.onSuccess&&t(e.onSuccess)}},onError:function(e,t){return function(n){var r=e.siteId,i=e.orderId;n(Object(it.b)(r,i,t)),e.onFailure&&n(e.onFailure)}},fromApi:$e.a})]),nt),ot=n(655),ct=n(632),ut=n(116),st=n(683),dt=o()({},ie.k,[Object(he.a)({fetch:function(e){var t=e.siteId;return Object(Xe.a)(t,e,"/wc/v3").get("data/continents")},onSuccess:function(e,t){var n=e.siteId,r=t.data;return Object(st.c)(n,r)},onError:function(e,t){var n=e.siteId;return Object(st.b)(n,t)}})]),ft=n(656),lt=(n(714),u.a.lazy(function(){return Promise.all([n.e(0),n.e(136),n.e(2),n.e(138),n.e(153)]).then(n.bind(null,794))}));t.default=function(e){var t=e.order,n=e.accountSettings,r=e.packagesSettings,a=e.shippingLabelData,s=e.continents,d=e.context,f=e.items,l=t?t.id:null,O=void 0!==n;return{getReducer:function(){return Object(re.a)({extensions:Object(re.a)({woocommerce:Object(re.a)({woocommerceServices:Object(re.a)({1:Object(re.a)({shippingLabel:fe,packages:le.a,labelSettings:Oe.a})}),sites:Object(re.a)({1:Object(re.a)({orders:_e,data:Object(re.a)({locations:ft.a})})})})}),notices:ee.a,ui:function(){return{selectedSiteId:1}}})},getInitialState:function(){var e={extensions:{woocommerce:{sites:{1:{orders:{notes:{isLoading:o()({},l,!1)}}}}}}};return O?function(e){var c=n.storeOptions,u=n.formMeta,d=n.userMeta,f=n.formData,O=r.formData,E=r.storeOptions.dimension_unit,b=r.storeOptions.weight_unit,p=r.formSchema.custom?r.formSchema.custom.items:void 0,m=r.formSchema.predefined;return e.extensions.woocommerce.woocommerceServices={1:{shippingLabel:o()({},l,ce(a)),labelSettings:{storeOptions:c,meta:i()({},u,{pristine:!0,isLoaded:!0,user:d}),data:i()({},f)},packages:{modalErrors:{},pristine:!0,packages:O,dimensionUnit:E,weightUnit:b,packageSchema:p,predefinedSchema:m,packageData:{is_user_defined:!0},isLoaded:!0}}},e.extensions.woocommerce.sites[1].orders.isLoading=o()({},l,!1),e.extensions.woocommerce.sites[1].orders.items=o()({},l,t),e.extensions.woocommerce.sites[1].data={locations:s},e}(e):e},getStateForPersisting:function(){return null},getStateKey:function(){return"wcs-label-".concat(l)},getMiddlewares:function(){return[$,Object(ut.b)(Object(Ve.a)(ct.a,ot.a,rt,at,dt))]},View:function(){return"shipment_tracking"===d?u.a.createElement(c.Suspense,{fallback:u.a.createElement("div",null)},u.a.createElement(lt,{orderId:l})):u.a.createElement(Q,{orderId:l,items:f})}}}}}]);
dist/chunks/{02082a53c355ce31d812.min.js → 1ac21d3099c07d1537e8.min.js} RENAMED
@@ -1 +1 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[0],{569:function(e,c,t){"use strict";function r(e,c){if(!(e instanceof c))throw new TypeError("Cannot call a class as a function")}t.d(c,"a",function(){return r})},570:function(e,c,t){"use strict";function r(e,c){for(var t=0;t<c.length;t++){var r=c[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function n(e,c,t){return c&&r(e.prototype,c),t&&r(e,t),e}t.d(c,"a",function(){return n})},571:function(e,c,t){"use strict";t.d(c,"a",function(){return a});var r=t(760),n=t(78);function a(e,c){return!c||"object"!==Object(r.a)(c)&&"function"!==typeof c?Object(n.a)(e):c}},572:function(e,c,t){"use strict";function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}t.d(c,"a",function(){return r})},573:function(e,c,t){"use strict";t.d(c,"a",function(){return n});var r=t(55);function n(e,c){if(null==e)return{};var t,n,a=Object(r.a)(e,c);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)t=o[n],c.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}},574:function(e,c,t){"use strict";function r(e,c){return(r=Object.setPrototypeOf||function(e,c){return e.__proto__=c,e})(e,c)}function n(e,c){if("function"!==typeof c&&null!==c)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(c&&c.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),c&&r(e,c)}t.d(c,"a",function(){return n})},612:function(e,c,t){"use strict";t.d(c,"a",function(){return n});var r=t(642);function n(e){for(var c=1;c<arguments.length;c++){var t=null!=arguments[c]?arguments[c]:{},n=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(c){Object(r.a)(e,c,t[c])})}return e}},630:function(e,c,t){"use strict";function r(e){return function(e){if(Array.isArray(e)){for(var c=0,t=new Array(e.length);c<e.length;c++)t[c]=e[c];return t}}(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")}()}t.d(c,"a",function(){return r})},642:function(e,c,t){"use strict";function r(e,c,t){return c in e?Object.defineProperty(e,c,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[c]=t,e}t.d(c,"a",function(){return r})},701:function(e,c,t){"use strict";t.d(c,"a",function(){return u});var r=t(37),n=t(573),a=t(569),o=t(570),s=t(571),i=t(572),l=t(574),h=t(10),v=t(783),u=function(e){function c(){return Object(a.a)(this,c),Object(s.a)(this,Object(i.a)(c).apply(this,arguments))}return Object(l.a)(c,e),Object(o.a)(c,[{key:"render",value:function(){var e,c=this.props,t=c.icon,a=c.size,o=void 0===a?20:a,s=c.className,i=Object(n.a)(c,["icon","size","className"]);switch(t){case"admin-appearance":e="M14.48 11.06L7.41 3.99l1.5-1.5c.5-.56 2.3-.47 3.51.32 1.21.8 1.43 1.28 2.91 2.1 1.18.64 2.45 1.26 4.45.85zm-.71.71L6.7 4.7 4.93 6.47c-.39.39-.39 1.02 0 1.41l1.06 1.06c.39.39.39 1.03 0 1.42-.6.6-1.43 1.11-2.21 1.69-.35.26-.7.53-1.01.84C1.43 14.23.4 16.08 1.4 17.07c.99 1 2.84-.03 4.18-1.36.31-.31.58-.66.85-1.02.57-.78 1.08-1.61 1.69-2.21.39-.39 1.02-.39 1.41 0l1.06 1.06c.39.39 1.02.39 1.41 0z";break;case"admin-collapse":e="M10 2.16c4.33 0 7.84 3.51 7.84 7.84s-3.51 7.84-7.84 7.84S2.16 14.33 2.16 10 5.71 2.16 10 2.16zm2 11.72V6.12L6.18 9.97z";break;case"admin-comments":e="M5 2h9c1.1 0 2 .9 2 2v7c0 1.1-.9 2-2 2h-2l-5 5v-5H5c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2z";break;case"admin-customizer":e="M18.33 3.57s.27-.8-.31-1.36c-.53-.52-1.22-.24-1.22-.24-.61.3-5.76 3.47-7.67 5.57-.86.96-2.06 3.79-1.09 4.82.92.98 3.96-.17 4.79-1 2.06-2.06 5.21-7.17 5.5-7.79zM1.4 17.65c2.37-1.56 1.46-3.41 3.23-4.64.93-.65 2.22-.62 3.08.29.63.67.8 2.57-.16 3.46-1.57 1.45-4 1.55-6.15.89z";break;case"admin-generic":e="M18 12h-2.18c-.17.7-.44 1.35-.81 1.93l1.54 1.54-2.1 2.1-1.54-1.54c-.58.36-1.23.63-1.91.79V19H8v-2.18c-.68-.16-1.33-.43-1.91-.79l-1.54 1.54-2.12-2.12 1.54-1.54c-.36-.58-.63-1.23-.79-1.91H1V9.03h2.17c.16-.7.44-1.35.8-1.94L2.43 5.55l2.1-2.1 1.54 1.54c.58-.37 1.24-.64 1.93-.81V2h3v2.18c.68.16 1.33.43 1.91.79l1.54-1.54 2.12 2.12-1.54 1.54c.36.59.64 1.24.8 1.94H18V12zm-8.5 1.5c1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3 1.34 3 3 3z";break;case"admin-home":e="M16 8.5l1.53 1.53-1.06 1.06L10 4.62l-6.47 6.47-1.06-1.06L10 2.5l4 4v-2h2v4zm-6-2.46l6 5.99V18H4v-5.97zM12 17v-5H8v5h4z";break;case"admin-links":e="M17.74 2.76c1.68 1.69 1.68 4.41 0 6.1l-1.53 1.52c-1.12 1.12-2.7 1.47-4.14 1.09l2.62-2.61.76-.77.76-.76c.84-.84.84-2.2 0-3.04-.84-.85-2.2-.85-3.04 0l-.77.76-3.38 3.38c-.37-1.44-.02-3.02 1.1-4.14l1.52-1.53c1.69-1.68 4.42-1.68 6.1 0zM8.59 13.43l5.34-5.34c.42-.42.42-1.1 0-1.52-.44-.43-1.13-.39-1.53 0l-5.33 5.34c-.42.42-.42 1.1 0 1.52.44.43 1.13.39 1.52 0zm-.76 2.29l4.14-4.15c.38 1.44.03 3.02-1.09 4.14l-1.52 1.53c-1.69 1.68-4.41 1.68-6.1 0-1.68-1.68-1.68-4.42 0-6.1l1.53-1.52c1.12-1.12 2.7-1.47 4.14-1.1l-4.14 4.15c-.85.84-.85 2.2 0 3.05.84.84 2.2.84 3.04 0z";break;case"admin-media":e="M13 11V4c0-.55-.45-1-1-1h-1.67L9 1H5L3.67 3H2c-.55 0-1 .45-1 1v7c0 .55.45 1 1 1h10c.55 0 1-.45 1-1zM7 4.5c1.38 0 2.5 1.12 2.5 2.5S8.38 9.5 7 9.5 4.5 8.38 4.5 7 5.62 4.5 7 4.5zM14 6h5v10.5c0 1.38-1.12 2.5-2.5 2.5S14 17.88 14 16.5s1.12-2.5 2.5-2.5c.17 0 .34.02.5.05V9h-3V6zm-4 8.05V13h2v3.5c0 1.38-1.12 2.5-2.5 2.5S7 17.88 7 16.5 8.12 14 9.5 14c.17 0 .34.02.5.05z";break;case"admin-multisite":e="M14.27 6.87L10 3.14 5.73 6.87 5 6.14l5-4.38 5 4.38zM14 8.42l-4.05 3.43L6 8.38v-.74l4-3.5 4 3.5v.78zM11 9.7V8H9v1.7h2zm-1.73 4.03L5 10 .73 13.73 0 13l5-4.38L10 13zm10 0L15 10l-4.27 3.73L10 13l5-4.38L20 13zM5 11l4 3.5V18H1v-3.5zm10 0l4 3.5V18h-8v-3.5zm-9 6v-2H4v2h2zm10 0v-2h-2v2h2z";break;case"admin-network":e="M16.95 2.58c1.96 1.95 1.96 5.12 0 7.07-1.51 1.51-3.75 1.84-5.59 1.01l-1.87 3.31-2.99.31L5 18H2l-1-2 7.95-7.69c-.92-1.87-.62-4.18.93-5.73 1.95-1.96 5.12-1.96 7.07 0zm-2.51 3.79c.74 0 1.33-.6 1.33-1.34 0-.73-.59-1.33-1.33-1.33-.73 0-1.33.6-1.33 1.33 0 .74.6 1.34 1.33 1.34z";break;case"admin-page":e="M6 15V2h10v13H6zm-1 1h8v2H3V5h2v11z";break;case"admin-plugins":e="M13.11 4.36L9.87 7.6 8 5.73l3.24-3.24c.35-.34 1.05-.2 1.56.32.52.51.66 1.21.31 1.55zm-8 1.77l.91-1.12 9.01 9.01-1.19.84c-.71.71-2.63 1.16-3.82 1.16H6.14L4.9 17.26c-.59.59-1.54.59-2.12 0-.59-.58-.59-1.53 0-2.12l1.24-1.24v-3.88c0-1.13.4-3.19 1.09-3.89zm7.26 3.97l3.24-3.24c.34-.35 1.04-.21 1.55.31.52.51.66 1.21.31 1.55l-3.24 3.25z";break;case"admin-post":e="M10.44 3.02l1.82-1.82 6.36 6.35-1.83 1.82c-1.05-.68-2.48-.57-3.41.36l-.75.75c-.92.93-1.04 2.35-.35 3.41l-1.83 1.82-2.41-2.41-2.8 2.79c-.42.42-3.38 2.71-3.8 2.29s1.86-3.39 2.28-3.81l2.79-2.79L4.1 9.36l1.83-1.82c1.05.69 2.48.57 3.4-.36l.75-.75c.93-.92 1.05-2.35.36-3.41z";break;case"admin-settings":e="M18 16V4c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h13c.55 0 1-.45 1-1zM8 11h1c.55 0 1 .45 1 1s-.45 1-1 1H8v1.5c0 .28-.22.5-.5.5s-.5-.22-.5-.5V13H6c-.55 0-1-.45-1-1s.45-1 1-1h1V5.5c0-.28.22-.5.5-.5s.5.22.5.5V11zm5-2h-1c-.55 0-1-.45-1-1s.45-1 1-1h1V5.5c0-.28.22-.5.5-.5s.5.22.5.5V7h1c.55 0 1 .45 1 1s-.45 1-1 1h-1v5.5c0 .28-.22.5-.5.5s-.5-.22-.5-.5V9z";break;case"admin-site-alt":e="M9 0C4.03 0 0 4.03 0 9s4.03 9 9 9 9-4.03 9-9-4.03-9-9-9zm7.5 6.48c-.274.896-.908 1.64-1.75 2.05-.45-1.69-1.658-3.074-3.27-3.75.13-.444.41-.83.79-1.09-.43-.28-1-.42-1.34.07-.53.69 0 1.61.21 2v.14c-.555-.337-.99-.84-1.24-1.44-.966-.03-1.922.208-2.76.69-.087-.565-.032-1.142.16-1.68.733.07 1.453-.23 1.92-.8.46-.52-.13-1.18-.59-1.58h.36c1.36-.01 2.702.335 3.89 1 1.36 1.005 2.194 2.57 2.27 4.26.24 0 .7-.55.91-.92.172.34.32.69.44 1.05zM9 16.84c-2.05-2.08.25-3.75-1-5.24-.92-.85-2.29-.26-3.11-1.23-.282-1.473.267-2.982 1.43-3.93.52-.44 4-1 5.42.22.83.715 1.415 1.674 1.67 2.74.46.035.918-.066 1.32-.29.41 2.98-3.15 6.74-5.73 7.73zM5.15 2.09c.786-.3 1.676-.028 2.16.66-.42.38-.94.63-1.5.72.02-.294.085-.584.19-.86l-.85-.52z";break;case"admin-site-alt2":e="M9 0C4.03 0 0 4.03 0 9s4.03 9 9 9 9-4.03 9-9-4.03-9-9-9zm2.92 12.34c0 .35.14.63.36.66.22.03.47-.22.58-.6l.2.08c.718.384 1.07 1.22.84 2-.15.69-.743 1.198-1.45 1.24-.49-1.21-2.11.06-3.56-.22-.612-.154-1.11-.6-1.33-1.19 1.19-.11 2.85-1.73 4.36-1.97zM8 11.27c.918 0 1.695-.68 1.82-1.59.44.54.41 1.324-.07 1.83-.255.223-.594.325-.93.28-.335-.047-.635-.236-.82-.52zm3-.76c.41.39 3-.06 3.52 1.09-.95-.2-2.95.61-3.47-1.08l-.05-.01zM9.73 5.45v.27c-.65-.77-1.33-1.07-1.61-.57-.28.5 1 1.11.76 1.88-.24.77-1.27.56-1.88 1.61-.61 1.05-.49 2.42 1.24 3.67-1.192-.132-2.19-.962-2.54-2.11-.4-1.2-.09-2.26-.78-2.46C4 7.46 3 8.71 3 9.8c-1.26-1.26.05-2.86-1.2-4.18C3.5 1.998 7.644.223 11.44 1.49c-1.1 1.02-1.722 2.458-1.71 3.96z";break;case"admin-site-alt3":e="M9 0C4.03 0 0 4.03 0 9s4.03 9 9 9 9-4.03 9-9-4.03-9-9-9zM1.11 9.68h2.51c.04.91.167 1.814.38 2.7H1.84c-.403-.85-.65-1.764-.73-2.7zm8.57-5.4V1.19c.964.366 1.756 1.08 2.22 2 .205.347.386.708.54 1.08l-2.76.01zm3.22 1.35c.232.883.37 1.788.41 2.7H9.68v-2.7h3.22zM8.32 1.19v3.09H5.56c.154-.372.335-.733.54-1.08.462-.924 1.255-1.64 2.22-2.01zm0 4.44v2.7H4.7c.04-.912.178-1.817.41-2.7h3.21zm-4.7 2.69H1.11c.08-.936.327-1.85.73-2.7H4c-.213.886-.34 1.79-.38 2.7zM4.7 9.68h3.62v2.7H5.11c-.232-.883-.37-1.788-.41-2.7zm3.63 4v3.09c-.964-.366-1.756-1.08-2.22-2-.205-.347-.386-.708-.54-1.08l2.76-.01zm1.35 3.09v-3.04h2.76c-.154.372-.335.733-.54 1.08-.464.92-1.256 1.634-2.22 2v-.04zm0-4.44v-2.7h3.62c-.04.912-.178 1.817-.41 2.7H9.68zm4.71-2.7h2.51c-.08.936-.327 1.85-.73 2.7H14c.21-.87.337-1.757.38-2.65l.01-.05zm0-1.35c-.046-.894-.176-1.78-.39-2.65h2.16c.403.85.65 1.764.73 2.7l-2.5-.05zm1-4H13.6c-.324-.91-.793-1.76-1.39-2.52 1.244.56 2.325 1.426 3.14 2.52h.04zm-9.6-2.52c-.597.76-1.066 1.61-1.39 2.52H2.65c.815-1.094 1.896-1.96 3.14-2.52zm-3.15 12H4.4c.324.91.793 1.76 1.39 2.52-1.248-.567-2.33-1.445-3.14-2.55l-.01.03zm9.56 2.52c.597-.76 1.066-1.61 1.39-2.52h1.76c-.82 1.08-1.9 1.933-3.14 2.48l-.01.04z";break;case"admin-site":e="M9 0C4.03 0 0 4.03 0 9s4.03 9 9 9 9-4.03 9-9-4.03-9-9-9zm3.46 11.95c0 1.47-.8 3.3-4.06 4.7.3-4.17-2.52-3.69-3.2-5 .126-1.1.804-2.063 1.8-2.55-1.552-.266-3-.96-4.18-2 .05.47.28.904.64 1.21-.782-.295-1.458-.817-1.94-1.5.977-3.225 3.883-5.482 7.25-5.63-.84 1.38-1.5 4.13 0 5.57C7.23 7 6.26 5 5.41 5.79c-1.13 1.06.33 2.51 3.42 3.08 3.29.59 3.66 1.58 3.63 3.08zm1.34-4c-.32-1.11.62-2.23 1.69-3.14 1.356 1.955 1.67 4.45.84 6.68-.77-1.89-2.17-2.32-2.53-3.57v.03z";break;case"admin-tools":e="M16.68 9.77c-1.34 1.34-3.3 1.67-4.95.99l-5.41 6.52c-.99.99-2.59.99-3.58 0s-.99-2.59 0-3.57l6.52-5.42c-.68-1.65-.35-3.61.99-4.95 1.28-1.28 3.12-1.62 4.72-1.06l-2.89 2.89 2.82 2.82 2.86-2.87c.53 1.58.18 3.39-1.08 4.65zM3.81 16.21c.4.39 1.04.39 1.43 0 .4-.4.4-1.04 0-1.43-.39-.4-1.03-.4-1.43 0-.39.39-.39 1.03 0 1.43z";break;case"admin-users":e="M10 9.25c-2.27 0-2.73-3.44-2.73-3.44C7 4.02 7.82 2 9.97 2c2.16 0 2.98 2.02 2.71 3.81 0 0-.41 3.44-2.68 3.44zm0 2.57L12.72 10c2.39 0 4.52 2.33 4.52 4.53v2.49s-3.65 1.13-7.24 1.13c-3.65 0-7.24-1.13-7.24-1.13v-2.49c0-2.25 1.94-4.48 4.47-4.48z";break;case"album":e="M0 18h10v-.26c1.52.4 3.17.35 4.76-.24 4.14-1.52 6.27-6.12 4.75-10.26-1.43-3.89-5.58-6-9.51-4.98V2H0v16zM9 3v14H1V3h8zm5.45 8.22c-.68 1.35-2.32 1.9-3.67 1.23-.31-.15-.57-.35-.78-.59V8.13c.8-.86 2.11-1.13 3.22-.58 1.35.68 1.9 2.32 1.23 3.67zm-2.75-.82c.22.16.53.12.7-.1.16-.22.12-.53-.1-.7s-.53-.12-.7.1c-.16.21-.12.53.1.7zm3.01 3.67c-1.17.78-2.56.99-3.83.69-.27-.06-.44-.34-.37-.61s.34-.43.62-.36l.17.04c.96.17 1.98-.01 2.86-.59.47-.32.86-.72 1.14-1.18.15-.23.45-.3.69-.16.23.15.3.46.16.69-.36.57-.84 1.08-1.44 1.48zm1.05 1.57c-1.48.99-3.21 1.32-4.84 1.06-.28-.05-.47-.32-.41-.6.05-.27.32-.45.61-.39l.22.04c1.31.15 2.68-.14 3.87-.94.71-.47 1.27-1.07 1.7-1.74.14-.24.45-.31.68-.16.24.14.31.45.16.69-.49.79-1.16 1.49-1.99 2.04z";break;case"align-center":e="M3 5h14V3H3v2zm12 8V7H5v6h10zM3 17h14v-2H3v2z";break;case"align-full-width":e="M17 13V3H3v10h14zM5 17h10v-2H5v2z";break;case"align-left":e="M3 5h14V3H3v2zm9 8V7H3v6h9zm2-4h3V7h-3v2zm0 4h3v-2h-3v2zM3 17h14v-2H3v2z";break;case"align-none":e="M3 5h14V3H3v2zm10 8V7H3v6h10zM3 17h14v-2H3v2z";break;case"align-pull-left":e="M9 16V4H3v12h6zm2-7h6V7h-6v2zm0 4h6v-2h-6v2z";break;case"align-pull-right":e="M17 16V4h-6v12h6zM9 7H3v2h6V7zm0 4H3v2h6v-2z";break;case"align-right":e="M3 5h14V3H3v2zm0 4h3V7H3v2zm14 4V7H8v6h9zM3 13h3v-2H3v2zm0 4h14v-2H3v2z";break;case"align-wide":e="M5 5h10V3H5v2zm12 8V7H3v6h14zM5 17h10v-2H5v2z";break;case"analytics":e="M18 18V2H2v16h16zM16 5H4V4h12v1zM7 7v3h3c0 1.66-1.34 3-3 3s-3-1.34-3-3 1.34-3 3-3zm1 2V7c1.1 0 2 .9 2 2H8zm8-1h-4V7h4v1zm0 3h-4V9h4v2zm0 2h-4v-1h4v1zm0 3H4v-1h12v1z";break;case"archive":e="M19 4v2H1V4h18zM2 7h16v10H2V7zm11 3V9H7v1h6z";break;case"arrow-down-alt":e="M9 2h2v12l4-4 2 1-7 7-7-7 2-1 4 4V2z";break;case"arrow-down-alt2":e="M5 6l5 5 5-5 2 1-7 7-7-7z";break;case"arrow-down":e="M15 8l-4.03 6L7 8h8z";break;case"arrow-left-alt":e="M18 9v2H6l4 4-1 2-7-7 7-7 1 2-4 4h12z";break;case"arrow-left-alt2":e="M14 5l-5 5 5 5-1 2-7-7 7-7z";break;case"arrow-left":e="M13 14L7 9.97 13 6v8z";break;case"arrow-right-alt":e="M2 11V9h12l-4-4 1-2 7 7-7 7-1-2 4-4H2z";break;case"arrow-right-alt2":e="M6 15l5-5-5-5 1-2 7 7-7 7z";break;case"arrow-right":e="M8 6l6 4.03L8 14V6z";break;case"arrow-up-alt":e="M11 18H9V6l-4 4-2-1 7-7 7 7-2 1-4-4v12z";break;case"arrow-up-alt2":e="M15 14l-5-5-5 5-2-1 7-7 7 7z";break;case"arrow-up":e="M7 13l4.03-6L15 13H7z";break;case"art":e="M8.55 3.06c1.01.34-1.95 2.01-.1 3.13 1.04.63 3.31-2.22 4.45-2.86.97-.54 2.67-.65 3.53 1.23 1.09 2.38.14 8.57-3.79 11.06-3.97 2.5-8.97 1.23-10.7-2.66-2.01-4.53 3.12-11.09 6.61-9.9zm1.21 6.45c.73 1.64 4.7-.5 3.79-2.8-.59-1.49-4.48 1.25-3.79 2.8z";break;case"awards":e="M4.46 5.16L5 7.46l-.54 2.29 2.01 1.24L7.7 13l2.3-.54 2.3.54 1.23-2.01 2.01-1.24L15 7.46l.54-2.3-2-1.24-1.24-2.01-2.3.55-2.29-.54-1.25 2zm5.55 6.34C7.79 11.5 6 9.71 6 7.49c0-2.2 1.79-3.99 4.01-3.99 2.2 0 3.99 1.79 3.99 3.99 0 2.22-1.79 4.01-3.99 4.01zm-.02-1C8.33 10.5 7 9.16 7 7.5c0-1.65 1.33-3 2.99-3S13 5.85 13 7.5c0 1.66-1.35 3-3.01 3zm3.84 1.1l-1.28 2.24-2.08-.47L13 19.2l1.4-2.2h2.5zm-7.7.07l1.25 2.25 2.13-.51L7 19.2 5.6 17H3.1z";break;case"backup":e="M13.65 2.88c3.93 2.01 5.48 6.84 3.47 10.77s-6.83 5.48-10.77 3.47c-1.87-.96-3.2-2.56-3.86-4.4l1.64-1.03c.45 1.57 1.52 2.95 3.08 3.76 3.01 1.54 6.69.35 8.23-2.66 1.55-3.01.36-6.69-2.65-8.24C9.78 3.01 6.1 4.2 4.56 7.21l1.88.97-4.95 3.08-.39-5.82 1.78.91C4.9 2.4 9.75.89 13.65 2.88zm-4.36 7.83C9.11 10.53 9 10.28 9 10c0-.07.03-.12.04-.19h-.01L10 5l.97 4.81L14 13l-4.5-2.12.02-.02c-.08-.04-.16-.09-.23-.15z";break;case"block-default":e="M15 6V4h-3v2H8V4H5v2H4c-.6 0-1 .4-1 1v8h14V7c0-.6-.4-1-1-1h-1z";break;case"book-alt":e="M5 17h13v2H5c-1.66 0-3-1.34-3-3V4c0-1.66 1.34-3 3-3h13v14H5c-.55 0-1 .45-1 1s.45 1 1 1zm2-3.5v-11c0-.28-.22-.5-.5-.5s-.5.22-.5.5v11c0 .28.22.5.5.5s.5-.22.5-.5z";break;case"book":e="M16 3h2v16H5c-1.66 0-3-1.34-3-3V4c0-1.66 1.34-3 3-3h9v14H5c-.55 0-1 .45-1 1s.45 1 1 1h11V3z";break;case"buddicons-activity":e="M8 1v7h2V6c0-1.52 1.45-3 3-3v.86c.55-.52 1.26-.86 2-.86v3h1c1.1 0 2 .9 2 2s-.9 2-2 2h-1v6c0 .55-.45 1-1 1s-1-.45-1-1v-2.18c-.31.11-.65.18-1 .18v2c0 .55-.45 1-1 1s-1-.45-1-1v-2H8v2c0 .55-.45 1-1 1s-1-.45-1-1v-2c-.35 0-.69-.07-1-.18V16c0 .55-.45 1-1 1s-1-.45-1-1v-4H2v-1c0-1.66 1.34-3 3-3h2V1h1zm5 7c.55 0 1-.45 1-1s-.45-1-1-1-1 .45-1 1 .45 1 1 1z";break;case"buddicons-bbpress-logo":e="M8.5 12.6c.3-1.3 0-2.3-1.1-2.3-.8 0-1.6.6-1.8 1.5l-.3 1.7c-.3 1 .3 1.5 1 1.5 1.2 0 1.9-1.1 2.2-2.4zm-4-6.4C3.7 7.3 3.3 8.6 3.3 10c0 1 .2 1.9.6 2.8l1-4.6c.3-1.7.4-2-.4-2zm9.3 6.4c.3-1.3 0-2.3-1.1-2.3-.8 0-1.6.6-1.8 1.5l-.4 1.7c-.2 1.1.4 1.6 1.1 1.6 1.1-.1 1.9-1.2 2.2-2.5zM10 3.3c-2 0-3.9.9-5.1 2.3.6-.1 1.4-.2 1.8-.3.2 0 .2.1.2.2 0 .2-1 4.8-1 4.8.5-.3 1.2-.7 1.8-.7.9 0 1.5.4 1.9.9l.5-2.4c.4-1.6.4-1.9-.4-1.9-.4 0-.4-.5 0-.6.6-.1 1.8-.2 2.3-.3.2 0 .2.1.2.2l-1 4.8c.5-.4 1.2-.7 1.9-.7 1.7 0 2.5 1.3 2.1 3-.3 1.7-2 3-3.8 3-1.3 0-2.1-.7-2.3-1.4-.7.8-1.7 1.3-2.8 1.4 1.1.7 2.4 1.1 3.7 1.1 3.7 0 6.7-3 6.7-6.7s-3-6.7-6.7-6.7zM10 2c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm0 15.5c-2.1 0-4-.8-5.3-2.2-.3-.4-.7-.8-1-1.2-.7-1.2-1.2-2.6-1.2-4.1 0-4.1 3.4-7.5 7.5-7.5s7.5 3.4 7.5 7.5-3.4 7.5-7.5 7.5z";break;case"buddicons-buddypress-logo":e="M10 0c5.52 0 10 4.48 10 10s-4.48 10-10 10S0 15.52 0 10 4.48 0 10 0zm0 .5C4.75.5.5 4.75.5 10s4.25 9.5 9.5 9.5 9.5-4.25 9.5-9.5S15.25.5 10 .5zm0 1c4.7 0 8.5 3.8 8.5 8.5s-3.8 8.5-8.5 8.5-8.5-3.8-8.5-8.5S5.3 1.5 10 1.5zm1.8 1.71c-.57 0-1.1.17-1.55.45 1.56.37 2.73 1.77 2.73 3.45 0 .69-.21 1.33-.55 1.87 1.31-.29 2.29-1.45 2.29-2.85 0-1.61-1.31-2.92-2.92-2.92zm-2.38 1c-1.61 0-2.92 1.31-2.92 2.93 0 1.61 1.31 2.92 2.92 2.92 1.62 0 2.93-1.31 2.93-2.92 0-1.62-1.31-2.93-2.93-2.93zm4.25 5.01l-.51.59c2.34.69 2.45 3.61 2.45 3.61h1.28c0-4.71-3.22-4.2-3.22-4.2zm-2.1.8l-2.12 2.09-2.12-2.09C3.12 10.24 3.89 15 3.89 15h11.08c.47-4.98-3.4-4.98-3.4-4.98z";break;case"buddicons-community":e="M9 3c0-.67-.47-1.43-1-2-.5.5-1 1.38-1 2 0 .48.45 1 1 1s1-.47 1-1zm4 0c0-.67-.47-1.43-1-2-.5.5-1 1.38-1 2 0 .48.45 1 1 1s1-.47 1-1zM9 9V5.5c0-.55-.45-1-1-1-.57 0-1 .49-1 1V9c0 .55.45 1 1 1 .57 0 1-.49 1-1zm4 0V5.5c0-.55-.45-1-1-1-.57 0-1 .49-1 1V9c0 .55.45 1 1 1 .57 0 1-.49 1-1zm4 1c0-1.48-1.41-2.77-3.5-3.46V9c0 .83-.67 1.5-1.5 1.5s-1.5-.67-1.5-1.5V6.01c-.17 0-.33-.01-.5-.01s-.33.01-.5.01V9c0 .83-.67 1.5-1.5 1.5S6.5 9.83 6.5 9V6.54C4.41 7.23 3 8.52 3 10c0 1.41.95 2.65 3.21 3.37 1.11.35 2.39 1.12 3.79 1.12s2.69-.78 3.79-1.13C16.04 12.65 17 11.41 17 10zm-7 5.43c1.43 0 2.74-.79 3.88-1.11 1.9-.53 2.49-1.34 3.12-2.32v3c0 2.21-3.13 4-7 4s-7-1.79-7-4v-3c.64.99 1.32 1.8 3.15 2.33 1.13.33 2.44 1.1 3.85 1.1z";break;case"buddicons-forums":e="M13.5 7h-7C5.67 7 5 6.33 5 5.5S5.67 4 6.5 4h1.59C8.04 3.84 8 3.68 8 3.5 8 2.67 8.67 2 9.5 2h1c.83 0 1.5.67 1.5 1.5 0 .18-.04.34-.09.5h1.59c.83 0 1.5.67 1.5 1.5S14.33 7 13.5 7zM4 8h12c.55 0 1 .45 1 1s-.45 1-1 1H4c-.55 0-1-.45-1-1s.45-1 1-1zm1 3h10c.55 0 1 .45 1 1s-.45 1-1 1H5c-.55 0-1-.45-1-1s.45-1 1-1zm2 3h6c.55 0 1 .45 1 1s-.45 1-1 1h-1.09c.05.16.09.32.09.5 0 .83-.67 1.5-1.5 1.5h-1c-.83 0-1.5-.67-1.5-1.5 0-.18.04-.34.09-.5H7c-.55 0-1-.45-1-1s.45-1 1-1z";break;case"buddicons-friends":e="M8.75 5.77C8.75 4.39 7 2 7 2S5.25 4.39 5.25 5.77 5.9 7.5 7 7.5s1.75-.35 1.75-1.73zm6 0C14.75 4.39 13 2 13 2s-1.75 2.39-1.75 3.77S11.9 7.5 13 7.5s1.75-.35 1.75-1.73zM9 17V9c0-.55-.45-1-1-1H6c-.55 0-1 .45-1 1v8c0 .55.45 1 1 1h2c.55 0 1-.45 1-1zm6 0V9c0-.55-.45-1-1-1h-2c-.55 0-1 .45-1 1v8c0 .55.45 1 1 1h2c.55 0 1-.45 1-1zm-9-6l2-1v2l-2 1v-2zm6 0l2-1v2l-2 1v-2zm-6 3l2-1v2l-2 1v-2zm6 0l2-1v2l-2 1v-2z";break;case"buddicons-groups":e="M15.45 6.25c1.83.94 1.98 3.18.7 4.98-.8 1.12-2.33 1.88-3.46 1.78L10.05 18H9l-2.65-4.99c-1.13.16-2.73-.63-3.55-1.79-1.28-1.8-1.13-4.04.71-4.97.48-.24.96-.33 1.43-.31-.01.4.01.8.07 1.21.26 1.69 1.41 3.53 2.86 4.37-.19.55-.49.99-.88 1.25L9 16.58v-5.66C7.64 10.55 6.26 8.76 6 7c-.4-2.65 1-5 3.5-5s3.9 2.35 3.5 5c-.26 1.76-1.64 3.55-3 3.92v5.77l2.07-3.84c-.44-.23-.77-.71-.99-1.3 1.48-.83 2.65-2.69 2.91-4.4.06-.41.08-.82.07-1.22.46-.01.92.08 1.39.32z";break;case"buddicons-pm":e="M10 2c3 0 8 5 8 5v11H2V7s5-5 8-5zm7 14.72l-3.73-2.92L17 11l-.43-.37-2.26 1.3.24-4.31-8.77-.52-.46 4.54-1.99-.95L3 11l3.73 2.8-3.44 2.85.4.43L10 13l6.53 4.15z";break;case"buddicons-replies":e="M17.54 10.29c1.17 1.17 1.17 3.08 0 4.25-1.18 1.17-3.08 1.17-4.25 0l-.34-.52c0 3.66-2 4.38-2.95 4.98-.82-.6-2.95-1.28-2.95-4.98l-.34.52c-1.17 1.17-3.07 1.17-4.25 0-1.17-1.17-1.17-3.08 0-4.25 0 0 1.02-.67 2.1-1.3C3.71 7.84 3.2 6.42 3.2 4.88c0-.34.03-.67.08-1C3.53 5.66 4.47 7.22 5.8 8.3c.67-.35 1.85-.83 2.37-.92H8c-1.1 0-2-.9-2-2s.9-2 2-2v-.5c0-.28.22-.5.5-.5s.5.22.5.5v.5h2v-.5c0-.28.22-.5.5-.5s.5.22.5.5v.5c1.1 0 2 .9 2 2s-.9 2-2 2h-.17c.51.09 1.78.61 2.38.92 1.33-1.08 2.27-2.64 2.52-4.42.05.33.08.66.08 1 0 1.54-.51 2.96-1.36 4.11 1.08.63 2.09 1.3 2.09 1.3zM8.5 6.38c.5 0 1-.45 1-1s-.45-1-1-1-1 .45-1 1 .45 1 1 1zm3-2c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1zm-2.3 5.73c-.12.11-.19.26-.19.43.02.25.23.46.49.46h1c.26 0 .47-.21.49-.46 0-.15-.07-.29-.19-.43-.08-.06-.18-.11-.3-.11h-1c-.12 0-.22.05-.3.11zM12 12.5c0-.12-.06-.28-.19-.38-.09-.07-.19-.12-.31-.12h-3c-.12 0-.22.05-.31.12-.11.1-.19.25-.19.38 0 .28.22.5.5.5h3c.28 0 .5-.22.5-.5zM8.5 15h3c.28 0 .5-.22.5-.5s-.22-.5-.5-.5h-3c-.28 0-.5.22-.5.5s.22.5.5.5zm1 2h1c.28 0 .5-.22.5-.5s-.22-.5-.5-.5h-1c-.28 0-.5.22-.5.5s.22.5.5.5z";break;case"buddicons-topics":e="M10.44 1.66c-.59-.58-1.54-.58-2.12 0L2.66 7.32c-.58.58-.58 1.53 0 2.12.6.6 1.56.56 2.12 0l5.66-5.66c.58-.58.59-1.53 0-2.12zm2.83 2.83c-.59-.59-1.54-.59-2.12 0l-5.66 5.66c-.59.58-.59 1.53 0 2.12.6.6 1.56.55 2.12 0l5.66-5.66c.58-.58.58-1.53 0-2.12zm1.06 6.72l4.18 4.18c.59.58.59 1.53 0 2.12s-1.54.59-2.12 0l-4.18-4.18-1.77 1.77c-.59.58-1.54.58-2.12 0-.59-.59-.59-1.54 0-2.13l5.66-5.65c.58-.59 1.53-.59 2.12 0 .58.58.58 1.53 0 2.12zM5 15c0-1.59-1.66-4-1.66-4S2 13.78 2 15s.6 2 1.34 2h.32C4.4 17 5 16.59 5 15z";break;case"buddicons-tracking":e="M10.98 6.78L15.5 15c-1 2-3.5 3-5.5 3s-4.5-1-5.5-3L9 6.82c-.75-1.23-2.28-1.98-4.29-2.03l2.46-2.92c1.68 1.19 2.46 2.32 2.97 3.31.56-.87 1.2-1.68 2.7-2.12l1.83 2.86c-1.42-.34-2.64.08-3.69.86zM8.17 10.4l-.93 1.69c.49.11 1 .16 1.54.16 1.35 0 2.58-.36 3.55-.95l-1.01-1.82c-.87.53-1.96.86-3.15.92zm.86 5.38c1.99 0 3.73-.74 4.74-1.86l-.98-1.76c-1 1.12-2.74 1.87-4.74 1.87-.62 0-1.21-.08-1.76-.21l-.63 1.15c.94.5 2.1.81 3.37.81z";break;case"building":e="M3 20h14V0H3v20zM7 3H5V1h2v2zm4 0H9V1h2v2zm4 0h-2V1h2v2zM7 6H5V4h2v2zm4 0H9V4h2v2zm4 0h-2V4h2v2zM7 9H5V7h2v2zm4 0H9V7h2v2zm4 0h-2V7h2v2zm-8 3H5v-2h2v2zm4 0H9v-2h2v2zm4 0h-2v-2h2v2zm-4 7H5v-6h6v6zm4-4h-2v-2h2v2zm0 3h-2v-2h2v2z";break;case"businessman":e="M7.3 6l-.03-.19c-.04-.37-.05-.73-.03-1.08.02-.36.1-.71.25-1.04.14-.32.31-.61.52-.86s.49-.46.83-.6c.34-.15.72-.23 1.13-.23.69 0 1.26.2 1.71.59s.76.87.91 1.44.18 1.16.09 1.78l-.03.19c-.01.09-.05.25-.11.48-.05.24-.12.47-.2.69-.08.21-.19.45-.34.72-.14.27-.3.49-.47.69-.18.19-.4.34-.67.48-.27.13-.55.19-.86.19s-.59-.06-.87-.19c-.26-.13-.49-.29-.67-.5-.18-.2-.34-.42-.49-.66-.15-.25-.26-.49-.34-.73-.09-.25-.16-.47-.21-.67-.06-.21-.1-.37-.12-.5zm9.2 6.24c.41.7.5 1.41.5 2.14v2.49c0 .03-.12.08-.29.13-.18.04-.42.13-.97.27-.55.12-1.1.24-1.65.34s-1.19.19-1.95.27c-.75.08-1.46.12-2.13.12-.68 0-1.39-.04-2.14-.12-.75-.07-1.4-.17-1.98-.27-.58-.11-1.08-.23-1.56-.34-.49-.11-.8-.21-1.06-.29L3 16.87v-2.49c0-.75.07-1.46.46-2.15s.81-1.25 1.5-1.68C5.66 10.12 7.19 10 8 10l1.67 1.67L9 13v3l1.02 1.08L11 16v-3l-.68-1.33L11.97 10c.77 0 2.2.07 2.9.52.71.45 1.21 1.02 1.63 1.72z";break;case"button":e="M17 5H3c-1.1 0-2 .9-2 2v6c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm1 7c0 .6-.4 1-1 1H3c-.6 0-1-.4-1-1V7c0-.6.4-1 1-1h14c.6 0 1 .4 1 1v5z";break;case"calendar-alt":e="M15 4h3v15H2V4h3V3c0-.41.15-.76.44-1.06.29-.29.65-.44 1.06-.44s.77.15 1.06.44c.29.3.44.65.44 1.06v1h4V3c0-.41.15-.76.44-1.06.29-.29.65-.44 1.06-.44s.77.15 1.06.44c.29.3.44.65.44 1.06v1zM6 3v2.5c0 .14.05.26.15.36.09.09.21.14.35.14s.26-.05.35-.14c.1-.1.15-.22.15-.36V3c0-.14-.05-.26-.15-.35-.09-.1-.21-.15-.35-.15s-.26.05-.35.15c-.1.09-.15.21-.15.35zm7 0v2.5c0 .14.05.26.14.36.1.09.22.14.36.14s.26-.05.36-.14c.09-.1.14-.22.14-.36V3c0-.14-.05-.26-.14-.35-.1-.1-.22-.15-.36-.15s-.26.05-.36.15c-.09.09-.14.21-.14.35zm4 15V8H3v10h14zM7 9v2H5V9h2zm2 0h2v2H9V9zm4 2V9h2v2h-2zm-6 1v2H5v-2h2zm2 0h2v2H9v-2zm4 2v-2h2v2h-2zm-6 1v2H5v-2h2zm4 2H9v-2h2v2zm4 0h-2v-2h2v2z";break;case"calendar":e="M15 4h3v14H2V4h3V3c0-.83.67-1.5 1.5-1.5S8 2.17 8 3v1h4V3c0-.83.67-1.5 1.5-1.5S15 2.17 15 3v1zM6 3v2.5c0 .28.22.5.5.5s.5-.22.5-.5V3c0-.28-.22-.5-.5-.5S6 2.72 6 3zm7 0v2.5c0 .28.22.5.5.5s.5-.22.5-.5V3c0-.28-.22-.5-.5-.5s-.5.22-.5.5zm4 14V8H3v9h14zM7 16V9H5v7h2zm4 0V9H9v7h2zm4 0V9h-2v7h2z";break;case"camera":e="M6 5V3H3v2h3zm12 10V4H9L7 6H2v9h16zm-7-8c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3z";break;case"carrot":e="M2 18.43c1.51 1.36 11.64-4.67 13.14-7.21.72-1.22-.13-3.01-1.52-4.44C15.2 5.73 16.59 9 17.91 8.31c.6-.32.99-1.31.7-1.92-.52-1.08-2.25-1.08-3.42-1.21.83-.2 2.82-1.05 2.86-2.25.04-.92-1.13-1.97-2.05-1.86-1.21.14-1.65 1.88-2.06 3-.05-.71-.2-2.27-.98-2.95-1.04-.91-2.29-.05-2.32 1.05-.04 1.33 2.82 2.07 1.92 3.67C11.04 4.67 9.25 4.03 8.1 4.7c-.49.31-1.05.91-1.63 1.69.89.94 2.12 2.07 3.09 2.72.2.14.26.42.11.62-.14.21-.42.26-.62.12-.99-.67-2.2-1.78-3.1-2.71-.45.67-.91 1.43-1.34 2.23.85.86 1.93 1.83 2.79 2.41.2.14.25.42.11.62-.14.21-.42.26-.63.12-.85-.58-1.86-1.48-2.71-2.32C2.4 13.69 1.1 17.63 2 18.43z";break;case"cart":e="M6 13h9c.55 0 1 .45 1 1s-.45 1-1 1H5c-.55 0-1-.45-1-1V4H2c-.55 0-1-.45-1-1s.45-1 1-1h3c.55 0 1 .45 1 1v2h13l-4 7H6v1zm-.5 3c.83 0 1.5.67 1.5 1.5S6.33 19 5.5 19 4 18.33 4 17.5 4.67 16 5.5 16zm9 0c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5-1.5-.67-1.5-1.5.67-1.5 1.5-1.5z";break;case"category":e="M5 7h13v10H2V4h7l2 2H4v9h1V7z";break;case"chart-area":e="M18 18l.01-12.28c.59-.35.99-.99.99-1.72 0-1.1-.9-2-2-2s-2 .9-2 2c0 .8.47 1.48 1.14 1.8l-4.13 6.58c-.33-.24-.73-.38-1.16-.38-.84 0-1.55.51-1.85 1.24l-2.14-1.53c.09-.22.14-.46.14-.71 0-1.11-.89-2-2-2-1.1 0-2 .89-2 2 0 .73.4 1.36.98 1.71L1 18h17zM17 3c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zM5 10c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm5.85 3c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1z";break;case"chart-bar":e="M18 18V2h-4v16h4zm-6 0V7H8v11h4zm-6 0v-8H2v8h4z";break;case"chart-line":e="M18 3.5c0 .62-.38 1.16-.92 1.38v13.11H1.99l4.22-6.73c-.13-.23-.21-.48-.21-.76C6 9.67 6.67 9 7.5 9S9 9.67 9 10.5c0 .13-.02.25-.05.37l1.44.63c.27-.3.67-.5 1.11-.5.18 0 .35.04.51.09l3.58-6.41c-.36-.27-.59-.7-.59-1.18 0-.83.67-1.5 1.5-1.5.19 0 .36.04.53.1l.05-.09v.11c.54.22.92.76.92 1.38zm-1.92 13.49V5.85l-3.29 5.89c.13.23.21.48.21.76 0 .83-.67 1.5-1.5 1.5s-1.5-.67-1.5-1.5l.01-.07-1.63-.72c-.25.18-.55.29-.88.29-.18 0-.35-.04-.51-.1l-3.2 5.09h12.29z";break;case"chart-pie":e="M10 10V3c3.87 0 7 3.13 7 7h-7zM9 4v7h7c0 3.87-3.13 7-7 7s-7-3.13-7-7 3.13-7 7-7z";break;case"clipboard":e="M11.9.39l1.4 1.4c1.61.19 3.5-.74 4.61.37s.18 3 .37 4.61l1.4 1.4c.39.39.39 1.02 0 1.41l-9.19 9.2c-.4.39-1.03.39-1.42 0L1.29 11c-.39-.39-.39-1.02 0-1.42l9.2-9.19c.39-.39 1.02-.39 1.41 0zm.58 2.25l-.58.58 4.95 4.95.58-.58c-.19-.6-.2-1.22-.15-1.82.02-.31.05-.62.09-.92.12-1 .18-1.63-.17-1.98s-.98-.29-1.98-.17c-.3.04-.61.07-.92.09-.6.05-1.22.04-1.82-.15zm4.02.93c.39.39.39 1.03 0 1.42s-1.03.39-1.42 0-.39-1.03 0-1.42 1.03-.39 1.42 0zm-6.72.36l-.71.7L15.44 11l.7-.71zM8.36 5.34l-.7.71 6.36 6.36.71-.7zM6.95 6.76l-.71.7 6.37 6.37.7-.71zM5.54 8.17l-.71.71 6.36 6.36.71-.71zM4.12 9.58l-.71.71 6.37 6.37.71-.71z";break;case"clock":e="M10 2c4.42 0 8 3.58 8 8s-3.58 8-8 8-8-3.58-8-8 3.58-8 8-8zm0 14c3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6 2.69 6 6 6zm-.71-5.29c.07.05.14.1.23.15l-.02.02L14 13l-3.03-3.19L10 5l-.97 4.81h.01c0 .02-.01.05-.02.09S9 9.97 9 10c0 .28.1.52.29.71z";break;case"cloud-saved":e="M14.8 9c.1-.3.2-.6.2-1 0-2.2-1.8-4-4-4-1.5 0-2.9.9-3.5 2.2-.3-.1-.7-.2-1-.2C5.1 6 4 7.1 4 8.5c0 .2 0 .4.1.5-1.8.3-3.1 1.7-3.1 3.5C1 14.4 2.6 16 4.5 16h10c1.9 0 3.5-1.6 3.5-3.5 0-1.8-1.4-3.3-3.2-3.5zm-6.3 5.9l-3.2-3.2 1.4-1.4 1.8 1.8 3.8-3.8 1.4 1.4-5.2 5.2z";break;case"cloud-upload":e="M14.8 9c.1-.3.2-.6.2-1 0-2.2-1.8-4-4-4-1.5 0-2.9.9-3.5 2.2-.3-.1-.7-.2-1-.2C5.1 6 4 7.1 4 8.5c0 .2 0 .4.1.5-1.8.3-3.1 1.7-3.1 3.5C1 14.4 2.6 16 4.5 16H8v-3H5l4.5-4.5L14 13h-3v3h3.5c1.9 0 3.5-1.6 3.5-3.5 0-1.8-1.4-3.3-3.2-3.5z";break;case"cloud":e="M14.9 9c1.8.2 3.1 1.7 3.1 3.5 0 1.9-1.6 3.5-3.5 3.5h-10C2.6 16 1 14.4 1 12.5 1 10.7 2.3 9.3 4.1 9 4 8.9 4 8.7 4 8.5 4 7.1 5.1 6 6.5 6c.3 0 .7.1.9.2C8.1 4.9 9.4 4 11 4c2.2 0 4 1.8 4 4 0 .4-.1.7-.1 1z";break;case"columns":e="M3 15h6V5H3v10zm8 0h6V5h-6v10z";break;case"controls-back":e="M2 10l10-6v3.6L18 4v12l-6-3.6V16z";break;case"controls-forward":e="M18 10L8 16v-3.6L2 16V4l6 3.6V4z";break;case"controls-pause":e="M5 16V4h3v12H5zm7-12h3v12h-3V4z";break;case"controls-play":e="M5 4l10 6-10 6V4z";break;case"controls-repeat":e="M5 7v3l-2 1.5V5h11V3l4 3.01L14 9V7H5zm10 6v-3l2-1.5V15H6v2l-4-3.01L6 11v2h9z";break;case"controls-skipback":e="M11.98 7.63l6-3.6v12l-6-3.6v3.6l-8-4.8v4.8h-2v-12h2v4.8l8-4.8v3.6z";break;case"controls-skipforward":e="M8 12.4L2 16V4l6 3.6V4l8 4.8V4h2v12h-2v-4.8L8 16v-3.6z";break;case"controls-volumeoff":e="M2 7h4l5-4v14l-5-4H2V7z";break;case"controls-volumeon":e="M2 7h4l5-4v14l-5-4H2V7zm12.69-2.46C14.82 4.59 18 5.92 18 10s-3.18 5.41-3.31 5.46c-.06.03-.13.04-.19.04-.2 0-.39-.12-.46-.31-.11-.26.02-.55.27-.65.11-.05 2.69-1.15 2.69-4.54 0-3.41-2.66-4.53-2.69-4.54-.25-.1-.38-.39-.27-.65.1-.25.39-.38.65-.27zM16 10c0 2.57-2.23 3.43-2.32 3.47-.06.02-.12.03-.18.03-.2 0-.39-.12-.47-.32-.1-.26.04-.55.29-.65.07-.02 1.68-.67 1.68-2.53s-1.61-2.51-1.68-2.53c-.25-.1-.38-.39-.29-.65.1-.25.39-.39.65-.29.09.04 2.32.9 2.32 3.47z";break;case"cover-image":e="M2.2 1h15.5c.7 0 1.3.6 1.3 1.2v11.5c0 .7-.6 1.2-1.2 1.2H2.2c-.6.1-1.2-.5-1.2-1.1V2.2C1 1.6 1.6 1 2.2 1zM17 13V3H3v10h14zm-4-4s0-5 3-5v7c0 .6-.4 1-1 1H5c-.6 0-1-.4-1-1V7c2 0 3 4 3 4s1-4 3-4 3 2 3 2zM4 17h12v2H4z";break;case"dashboard":e="M3.76 16h12.48c1.1-1.37 1.76-3.11 1.76-5 0-4.42-3.58-8-8-8s-8 3.58-8 8c0 1.89.66 3.63 1.76 5zM10 4c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zM6 6c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm8 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm-5.37 5.55L12 7v6c0 1.1-.9 2-2 2s-2-.9-2-2c0-.57.24-1.08.63-1.45zM4 10c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm12 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm-5 3c0-.55-.45-1-1-1s-1 .45-1 1 .45 1 1 1 1-.45 1-1z";break;case"desktop":e="M3 2h14c.55 0 1 .45 1 1v10c0 .55-.45 1-1 1h-5v2h2c.55 0 1 .45 1 1v1H5v-1c0-.55.45-1 1-1h2v-2H3c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1zm13 9V4H4v7h12zM5 5h9L5 9V5z";break;case"dismiss":e="M10 2c4.42 0 8 3.58 8 8s-3.58 8-8 8-8-3.58-8-8 3.58-8 8-8zm5 11l-3-3 3-3-2-2-3 3-3-3-2 2 3 3-3 3 2 2 3-3 3 3z";break;case"download":e="M14.01 4v6h2V2H4v8h2.01V4h8zm-2 2v6h3l-5 6-5-6h3V6h4z";break;case"edit":e="M13.89 3.39l2.71 2.72c.46.46.42 1.24.03 1.64l-8.01 8.02-5.56 1.16 1.16-5.58s7.6-7.63 7.99-8.03c.39-.39 1.22-.39 1.68.07zm-2.73 2.79l-5.59 5.61 1.11 1.11 5.54-5.65zm-2.97 8.23l5.58-5.6-1.07-1.08-5.59 5.6z";break;case"editor-aligncenter":e="M14 5V3H6v2h8zm3 4V7H3v2h14zm-3 4v-2H6v2h8zm3 4v-2H3v2h14z";break;case"editor-alignleft":e="M12 5V3H3v2h9zm5 4V7H3v2h14zm-5 4v-2H3v2h9zm5 4v-2H3v2h14z";break;case"editor-alignright":e="M17 5V3H8v2h9zm0 4V7H3v2h14zm0 4v-2H8v2h9zm0 4v-2H3v2h14z";break;case"editor-bold":e="M6 4v13h4.54c1.37 0 2.46-.33 3.26-1 .8-.66 1.2-1.58 1.2-2.77 0-.84-.17-1.51-.51-2.01s-.9-.85-1.67-1.03v-.09c.57-.1 1.02-.4 1.36-.9s.51-1.13.51-1.91c0-1.14-.39-1.98-1.17-2.5C12.75 4.26 11.5 4 9.78 4H6zm2.57 5.15V6.26h1.36c.73 0 1.27.11 1.61.32.34.22.51.58.51 1.07 0 .54-.16.92-.47 1.15s-.82.35-1.51.35h-1.5zm0 2.19h1.6c1.44 0 2.16.53 2.16 1.61 0 .6-.17 1.05-.51 1.34s-.86.43-1.57.43H8.57v-3.38z";break;case"editor-break":e="M16 4h2v9H7v3l-5-4 5-4v3h9V4z";break;case"editor-code":e="M9 6l-4 4 4 4-1 2-6-6 6-6zm2 8l4-4-4-4 1-2 6 6-6 6z";break;case"editor-contract":e="M15.75 6.75L18 3v14l-2.25-3.75L17 12h-4v4l1.25-1.25L18 17H2l3.75-2.25L7 16v-4H3l1.25 1.25L2 17V3l2.25 3.75L3 8h4V4L5.75 5.25 2 3h16l-3.75 2.25L13 4v4h4z";break;case"editor-customchar":e="M10 5.4c1.27 0 2.24.36 2.91 1.08.66.71 1 1.76 1 3.13 0 1.28-.23 2.37-.69 3.27-.47.89-1.27 1.52-2.22 2.12v2h6v-2h-3.69c.92-.64 1.62-1.34 2.12-2.34.49-1.01.74-2.13.74-3.35 0-1.78-.55-3.19-1.65-4.22S11.92 3.54 10 3.54s-3.43.53-4.52 1.57c-1.1 1.04-1.65 2.44-1.65 4.2 0 1.21.24 2.31.73 3.33.48 1.01 1.19 1.71 2.1 2.36H3v2h6v-2c-.98-.64-1.8-1.28-2.24-2.17-.45-.89-.67-1.96-.67-3.22 0-1.37.33-2.41 1-3.13C7.75 5.76 8.72 5.4 10 5.4z";break;case"editor-expand":e="M7 8h6v4H7zm-5 5v4h4l-1.2-1.2L7 12l-3.8 2.2M14 17h4v-4l-1.2 1.2L13 12l2.2 3.8M14 3l1.3 1.3L13 8l3.8-2.2L18 7V3M6 3H2v4l1.2-1.2L7 8 4.7 4.3";break;case"editor-help":e="M17 10c0-3.87-3.14-7-7-7-3.87 0-7 3.13-7 7s3.13 7 7 7c3.86 0 7-3.13 7-7zm-6.3 1.48H9.14v-.43c0-.38.08-.7.24-.98s.46-.57.88-.89c.41-.29.68-.53.81-.71.14-.18.2-.39.2-.62 0-.25-.09-.44-.28-.58-.19-.13-.45-.19-.79-.19-.58 0-1.25.19-2 .57l-.64-1.28c.87-.49 1.8-.74 2.77-.74.81 0 1.45.2 1.92.58.48.39.71.91.71 1.55 0 .43-.09.8-.29 1.11-.19.32-.57.67-1.11 1.06-.38.28-.61.49-.71.63-.1.15-.15.34-.15.57v.35zm-1.47 2.74c-.18-.17-.27-.42-.27-.73 0-.33.08-.58.26-.75s.43-.25.77-.25c.32 0 .57.09.75.26s.27.42.27.74c0 .3-.09.55-.27.72-.18.18-.43.27-.75.27-.33 0-.58-.09-.76-.26z";break;case"editor-indent":e="M3 5V3h9v2H3zm10-1V3h4v1h-4zm0 3h2V5l4 3.5-4 3.5v-2h-2V7zM3 8V6h9v2H3zm2 3V9h7v2H5zm-2 3v-2h9v2H3zm10 0v-1h4v1h-4zm-4 3v-2h3v2H9z";break;case"editor-insertmore":e="M17 7V3H3v4h14zM6 11V9H3v2h3zm6 0V9H8v2h4zm5 0V9h-3v2h3zm0 6v-4H3v4h14z";break;case"editor-italic":e="M14.78 6h-2.13l-2.8 9h2.12l-.62 2H4.6l.62-2h2.14l2.8-9H8.03l.62-2h6.75z";break;case"editor-justify":e="M2 3h16v2H2V3zm0 4h16v2H2V7zm0 4h16v2H2v-2zm0 4h16v2H2v-2z";break;case"editor-kitchensink":e="M19 2v6H1V2h18zm-1 5V3H2v4h16zM5 4v2H3V4h2zm3 0v2H6V4h2zm3 0v2H9V4h2zm3 0v2h-2V4h2zm3 0v2h-2V4h2zm2 5v9H1V9h18zm-1 8v-7H2v7h16zM5 11v2H3v-2h2zm3 0v2H6v-2h2zm3 0v2H9v-2h2zm6 0v2h-5v-2h5zm-6 3v2H3v-2h8zm3 0v2h-2v-2h2zm3 0v2h-2v-2h2z";break;case"editor-ltr":e="M5.52 2h7.43c.55 0 1 .45 1 1s-.45 1-1 1h-1v13c0 .55-.45 1-1 1s-1-.45-1-1V5c0-.55-.45-1-1-1s-1 .45-1 1v12c0 .55-.45 1-1 1s-1-.45-1-1v-5.96h-.43C3.02 11.04 1 9.02 1 6.52S3.02 2 5.52 2zM14 14l5-4-5-4v8z";break;case"editor-ol-rtl":e="M15.025 8.75a1.048 1.048 0 0 1 .45-.1.507.507 0 0 1 .35.11.455.455 0 0 1 .13.36.803.803 0 0 1-.06.3 1.448 1.448 0 0 1-.19.33c-.09.11-.29.32-.58.62l-.99 1v.58h2.76v-.7h-1.72v-.04l.51-.48a7.276 7.276 0 0 0 .7-.71 1.75 1.75 0 0 0 .3-.49 1.254 1.254 0 0 0 .1-.51.968.968 0 0 0-.16-.56 1.007 1.007 0 0 0-.44-.37 1.512 1.512 0 0 0-.65-.14 1.98 1.98 0 0 0-.51.06 1.9 1.9 0 0 0-.42.15 3.67 3.67 0 0 0-.48.35l.45.54a2.505 2.505 0 0 1 .45-.3zM16.695 15.29a1.29 1.29 0 0 0-.74-.3v-.02a1.203 1.203 0 0 0 .65-.37.973.973 0 0 0 .23-.65.81.81 0 0 0-.37-.71 1.72 1.72 0 0 0-1-.26 2.185 2.185 0 0 0-1.33.4l.4.6a1.79 1.79 0 0 1 .46-.23 1.18 1.18 0 0 1 .41-.07c.38 0 .58.15.58.46a.447.447 0 0 1-.22.43 1.543 1.543 0 0 1-.7.12h-.31v.66h.31a1.764 1.764 0 0 1 .75.12.433.433 0 0 1 .23.41.55.55 0 0 1-.2.47 1.084 1.084 0 0 1-.63.15 2.24 2.24 0 0 1-.57-.08 2.671 2.671 0 0 1-.52-.2v.74a2.923 2.923 0 0 0 1.18.22 1.948 1.948 0 0 0 1.22-.33 1.077 1.077 0 0 0 .43-.92.836.836 0 0 0-.26-.64zM15.005 4.17c.06-.05.16-.14.3-.28l-.02.42V7h.84V3h-.69l-1.29 1.03.4.51zM4.02 5h9v1h-9zM4.02 10h9v1h-9zM4.02 15h9v1h-9z";break;case"editor-ol":e="M6 7V3h-.69L4.02 4.03l.4.51.46-.37c.06-.05.16-.14.3-.28l-.02.42V7H6zm2-2h9v1H8V5zm-1.23 6.95v-.7H5.05v-.04l.51-.48c.33-.31.57-.54.7-.71.14-.17.24-.33.3-.49.07-.16.1-.33.1-.51 0-.21-.05-.4-.16-.56-.1-.16-.25-.28-.44-.37s-.41-.14-.65-.14c-.19 0-.36.02-.51.06-.15.03-.29.09-.42.15-.12.07-.29.19-.48.35l.45.54c.16-.13.31-.23.45-.3.15-.07.3-.1.45-.1.14 0 .26.03.35.11s.13.2.13.36c0 .1-.02.2-.06.3s-.1.21-.19.33c-.09.11-.29.32-.58.62l-.99 1v.58h2.76zM8 10h9v1H8v-1zm-1.29 3.95c0-.3-.12-.54-.37-.71-.24-.17-.58-.26-1-.26-.52 0-.96.13-1.33.4l.4.6c.17-.11.32-.19.46-.23.14-.05.27-.07.41-.07.38 0 .58.15.58.46 0 .2-.07.35-.22.43s-.38.12-.7.12h-.31v.66h.31c.34 0 .59.04.75.12.15.08.23.22.23.41 0 .22-.07.37-.2.47-.14.1-.35.15-.63.15-.19 0-.38-.03-.57-.08s-.36-.12-.52-.2v.74c.34.15.74.22 1.18.22.53 0 .94-.11 1.22-.33.29-.22.43-.52.43-.92 0-.27-.09-.48-.26-.64s-.42-.26-.74-.3v-.02c.27-.06.49-.19.65-.37.15-.18.23-.39.23-.65zM8 15h9v1H8v-1z";break;case"editor-outdent":e="M7 4V3H3v1h4zm10 1V3H8v2h9zM7 7H5V5L1 8.5 5 12v-2h2V7zm10 1V6H8v2h9zm-2 3V9H8v2h7zm2 3v-2H8v2h9zM7 14v-1H3v1h4zm4 3v-2H8v2h3z";break;case"editor-paragraph":e="M15 2H7.54c-.83 0-1.59.2-2.28.6-.7.41-1.25.96-1.65 1.65C3.2 4.94 3 5.7 3 6.52s.2 1.58.61 2.27c.4.69.95 1.24 1.65 1.64.69.41 1.45.61 2.28.61h.43V17c0 .27.1.51.29.71.2.19.44.29.71.29.28 0 .51-.1.71-.29.2-.2.3-.44.3-.71V5c0-.27.09-.51.29-.71.2-.19.44-.29.71-.29s.51.1.71.29c.19.2.29.44.29.71v12c0 .27.1.51.3.71.2.19.43.29.71.29.27 0 .51-.1.71-.29.19-.2.29-.44.29-.71V4H15c.27 0 .5-.1.7-.3.2-.19.3-.43.3-.7s-.1-.51-.3-.71C15.5 2.1 15.27 2 15 2z";break;case"editor-paste-text":e="M12.38 2L15 5v1H5V5l2.64-3h4.74zM10 5c.55 0 1-.44 1-1 0-.55-.45-1-1-1s-1 .45-1 1c0 .56.45 1 1 1zm5.45-1H17c.55 0 1 .45 1 1v12c0 .56-.45 1-1 1H3c-.55 0-1-.44-1-1V5c0-.55.45-1 1-1h1.55L4 4.63V7h12V4.63zM14 11V9H6v2h3v5h2v-5h3z";break;case"editor-paste-word":e="M12.38 2L15 5v1H5V5l2.64-3h4.74zM10 5c.55 0 1-.45 1-1s-.45-1-1-1-1 .45-1 1 .45 1 1 1zm8 12V5c0-.55-.45-1-1-1h-1.54l.54.63V7H4V4.62L4.55 4H3c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h14c.55 0 1-.45 1-1zm-3-8l-2 7h-2l-1-5-1 5H6.92L5 9h2l1 5 1-5h2l1 5 1-5h2z";break;case"editor-quote":e="M9.49 13.22c0-.74-.2-1.38-.61-1.9-.62-.78-1.83-.88-2.53-.72-.29-1.65 1.11-3.75 2.92-4.65L7.88 4c-2.73 1.3-5.42 4.28-4.96 8.05C3.21 14.43 4.59 16 6.54 16c.85 0 1.56-.25 2.12-.75s.83-1.18.83-2.03zm8.05 0c0-.74-.2-1.38-.61-1.9-.63-.78-1.83-.88-2.53-.72-.29-1.65 1.11-3.75 2.92-4.65L15.93 4c-2.73 1.3-5.41 4.28-4.95 8.05.29 2.38 1.66 3.95 3.61 3.95.85 0 1.56-.25 2.12-.75s.83-1.18.83-2.03z";break;case"editor-removeformatting":e="M14.29 4.59l1.1 1.11c.41.4.61.94.61 1.47v2.12c0 .53-.2 1.07-.61 1.47l-6.63 6.63c-.4.41-.94.61-1.47.61s-1.07-.2-1.47-.61l-1.11-1.1-1.1-1.11c-.41-.4-.61-.94-.61-1.47v-2.12c0-.54.2-1.07.61-1.48l6.63-6.62c.4-.41.94-.61 1.47-.61s1.06.2 1.47.61zm-6.21 9.7l6.42-6.42c.39-.39.39-1.03 0-1.43L12.36 4.3c-.19-.19-.45-.29-.72-.29s-.52.1-.71.29l-6.42 6.42c-.39.4-.39 1.04 0 1.43l2.14 2.14c.38.38 1.04.38 1.43 0z";break;case"editor-rtl":e="M5.52 2h7.43c.55 0 1 .45 1 1s-.45 1-1 1h-1v13c0 .55-.45 1-1 1s-1-.45-1-1V5c0-.55-.45-1-1-1s-1 .45-1 1v12c0 .55-.45 1-1 1s-1-.45-1-1v-5.96h-.43C3.02 11.04 1 9.02 1 6.52S3.02 2 5.52 2zM19 6l-5 4 5 4V6z";break;case"editor-spellcheck":e="M15.84 2.76c.25 0 .49.04.71.11.23.07.44.16.64.25l.35-.81c-.52-.26-1.08-.39-1.69-.39-.58 0-1.09.13-1.52.37-.43.25-.76.61-.99 1.08C13.11 3.83 13 4.38 13 5c0 .99.23 1.75.7 2.28s1.15.79 2.02.79c.6 0 1.13-.09 1.6-.26v-.84c-.26.08-.51.14-.74.19-.24.05-.49.08-.74.08-.59 0-1.04-.19-1.34-.57-.32-.37-.47-.93-.47-1.66 0-.7.16-1.25.48-1.65.33-.4.77-.6 1.33-.6zM6.5 8h1.04L5.3 2H4.24L2 8h1.03l.58-1.66H5.9zM8 2v6h2.17c.67 0 1.19-.15 1.57-.46.38-.3.56-.72.56-1.26 0-.4-.1-.72-.3-.95-.19-.24-.5-.39-.93-.47v-.04c.35-.06.6-.21.78-.44.18-.24.28-.53.28-.88 0-.52-.19-.9-.56-1.14-.36-.24-.96-.36-1.79-.36H8zm.98 2.48V2.82h.85c.44 0 .77.06.97.19.21.12.31.33.31.61 0 .31-.1.53-.29.66-.18.13-.48.2-.89.2h-.95zM5.64 5.5H3.9l.54-1.56c.14-.4.25-.76.32-1.1l.15.52c.07.23.13.4.17.51zm3.34-.23h.99c.44 0 .76.08.98.23.21.15.32.38.32.69 0 .34-.11.59-.32.75s-.52.24-.93.24H8.98V5.27zM4 13l5 5 9-8-1-1-8 6-4-3z";break;case"editor-strikethrough":e="M15.82 12.25c.26 0 .5-.02.74-.07.23-.05.48-.12.73-.2v.84c-.46.17-.99.26-1.58.26-.88 0-1.54-.26-2.01-.79-.39-.44-.62-1.04-.68-1.79h-.94c.12.21.18.48.18.79 0 .54-.18.95-.55 1.26-.38.3-.9.45-1.56.45H8v-2.5H6.59l.93 2.5H6.49l-.59-1.67H3.62L3.04 13H2l.93-2.5H2v-1h1.31l.93-2.49H5.3l.92 2.49H8V7h1.77c1 0 1.41.17 1.77.41.37.24.55.62.55 1.13 0 .35-.09.64-.27.87l-.08.09h1.29c.05-.4.15-.77.31-1.1.23-.46.55-.82.98-1.06.43-.25.93-.37 1.51-.37.61 0 1.17.12 1.69.38l-.35.81c-.2-.1-.42-.18-.64-.25s-.46-.11-.71-.11c-.55 0-.99.2-1.31.59-.23.29-.38.66-.44 1.11H17v1h-2.95c.06.5.2.9.44 1.19.3.37.75.56 1.33.56zM4.44 8.96l-.18.54H5.3l-.22-.61c-.04-.11-.09-.28-.17-.51-.07-.24-.12-.41-.14-.51-.08.33-.18.69-.33 1.09zm4.53-1.09V9.5h1.19c.28-.02.49-.09.64-.18.19-.13.28-.35.28-.66 0-.28-.1-.48-.3-.61-.2-.12-.53-.18-.97-.18h-.84zm-3.33 2.64v-.01H3.91v.01h1.73zm5.28.01l-.03-.02H8.97v1.68h1.04c.4 0 .71-.08.92-.23.21-.16.31-.4.31-.74 0-.31-.11-.54-.32-.69z";break;case"editor-table":e="M18 17V3H2v14h16zM16 7H4V5h12v2zm-7 4H4V9h5v2zm7 0h-5V9h5v2zm-7 4H4v-2h5v2zm7 0h-5v-2h5v2z";break;case"editor-textcolor":e="M13.23 15h1.9L11 4H9L5 15h1.88l1.07-3h4.18zm-1.53-4.54H8.51L10 5.6z";break;case"editor-ul":e="M5.5 7C4.67 7 4 6.33 4 5.5 4 4.68 4.67 4 5.5 4 6.32 4 7 4.68 7 5.5 7 6.33 6.32 7 5.5 7zM8 5h9v1H8V5zm-2.5 7c-.83 0-1.5-.67-1.5-1.5C4 9.68 4.67 9 5.5 9c.82 0 1.5.68 1.5 1.5 0 .83-.68 1.5-1.5 1.5zM8 10h9v1H8v-1zm-2.5 7c-.83 0-1.5-.67-1.5-1.5 0-.82.67-1.5 1.5-1.5.82 0 1.5.68 1.5 1.5 0 .83-.68 1.5-1.5 1.5zM8 15h9v1H8v-1z";break;case"editor-underline":e="M14 5h-2v5.71c0 1.99-1.12 2.98-2.45 2.98-1.32 0-2.55-1-2.55-2.96V5H5v5.87c0 1.91 1 4.54 4.48 4.54 3.49 0 4.52-2.58 4.52-4.5V5zm0 13v-2H5v2h9z";break;case"editor-unlink":e="M17.74 2.26c1.68 1.69 1.68 4.41 0 6.1l-1.53 1.52c-.32.33-.69.58-1.08.77L13 10l1.69-1.64.76-.77.76-.76c.84-.84.84-2.2 0-3.04-.84-.85-2.2-.85-3.04 0l-.77.76-.76.76L10 7l-.65-2.14c.19-.38.44-.75.77-1.07l1.52-1.53c1.69-1.68 4.42-1.68 6.1 0zM2 4l8 6-6-8zm4-2l4 8-2-8H6zM2 6l8 4-8-2V6zm7.36 7.69L10 13l.74 2.35-1.38 1.39c-1.69 1.68-4.41 1.68-6.1 0-1.68-1.68-1.68-4.42 0-6.1l1.39-1.38L7 10l-.69.64-1.52 1.53c-.85.84-.85 2.2 0 3.04.84.85 2.2.85 3.04 0zM18 16l-8-6 6 8zm-4 2l-4-8 2 8h2zm4-4l-8-4 8 2v2z";break;case"editor-video":e="M16 2h-3v1H7V2H4v15h3v-1h6v1h3V2zM6 3v1H5V3h1zm9 0v1h-1V3h1zm-2 1v5H7V4h6zM6 5v1H5V5h1zm9 0v1h-1V5h1zM6 7v1H5V7h1zm9 0v1h-1V7h1zM6 9v1H5V9h1zm9 0v1h-1V9h1zm-2 1v5H7v-5h6zm-7 1v1H5v-1h1zm9 0v1h-1v-1h1zm-9 2v1H5v-1h1zm9 0v1h-1v-1h1zm-9 2v1H5v-1h1zm9 0v1h-1v-1h1z";break;case"ellipsis":e="M5 10c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2zm12-2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-7 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z";break;case"email-alt":e="M19 14.5v-9c0-.83-.67-1.5-1.5-1.5H3.49c-.83 0-1.5.67-1.5 1.5v9c0 .83.67 1.5 1.5 1.5H17.5c.83 0 1.5-.67 1.5-1.5zm-1.31-9.11c.33.33.15.67-.03.84L13.6 9.95l3.9 4.06c.12.14.2.36.06.51-.13.16-.43.15-.56.05l-4.37-3.73-2.14 1.95-2.13-1.95-4.37 3.73c-.13.1-.43.11-.56-.05-.14-.15-.06-.37.06-.51l3.9-4.06-4.06-3.72c-.18-.17-.36-.51-.03-.84s.67-.17.95.07l6.24 5.04 6.25-5.04c.28-.24.62-.4.95-.07z";break;case"email-alt2":e="M18.01 11.18V2.51c0-1.19-.9-1.81-2-1.37L4 5.91c-1.1.44-2 1.77-2 2.97v8.66c0 1.2.9 1.81 2 1.37l12.01-4.77c1.1-.44 2-1.76 2-2.96zm-1.43-7.46l-6.04 9.33-6.65-4.6c-.1-.07-.36-.32-.17-.64.21-.36.65-.21.65-.21l6.3 2.32s4.83-6.34 5.11-6.7c.13-.17.43-.34.73-.13.29.2.16.49.07.63z";break;case"email":e="M3.87 4h13.25C18.37 4 19 4.59 19 5.79v8.42c0 1.19-.63 1.79-1.88 1.79H3.87c-1.25 0-1.88-.6-1.88-1.79V5.79c0-1.2.63-1.79 1.88-1.79zm6.62 8.6l6.74-5.53c.24-.2.43-.66.13-1.07-.29-.41-.82-.42-1.17-.17l-5.7 3.86L4.8 5.83c-.35-.25-.88-.24-1.17.17-.3.41-.11.87.13 1.07z";break;case"embed-audio":e="M17 4H3c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-7 3H7v4c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2c.4 0 .7.1 1 .3V5h4v2zm4 3.5L12.5 12l1.5 1.5V15l-3-3 3-3v1.5zm1 4.5v-1.5l1.5-1.5-1.5-1.5V9l3 3-3 3z";break;case"embed-generic":e="M17 4H3c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-3 6.5L12.5 12l1.5 1.5V15l-3-3 3-3v1.5zm1 4.5v-1.5l1.5-1.5-1.5-1.5V9l3 3-3 3z";break;case"embed-photo":e="M17 4H3c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-7 8H3V6h7v6zm4-1.5L12.5 12l1.5 1.5V15l-3-3 3-3v1.5zm1 4.5v-1.5l1.5-1.5-1.5-1.5V9l3 3-3 3zm-6-4V8.5L7.2 10 6 9.2 4 11h5zM4.6 8.6c.6 0 1-.4 1-1s-.4-1-1-1-1 .4-1 1 .4 1 1 1z";break;case"embed-post":e="M17 4H3c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM8.6 9l-.4.3c-.4.4-.5 1.1-.2 1.6l-.8.8-1.1-1.1-1.3 1.3c-.2.2-1.6 1.3-1.8 1.1-.2-.2.9-1.6 1.1-1.8l1.3-1.3-1.1-1.1.8-.8c.5.3 1.2.3 1.6-.2l.3-.3c.5-.5.5-1.2.2-1.7L8 5l3 2.9-.8.8c-.5-.2-1.2-.2-1.6.3zm5.4 1.5L12.5 12l1.5 1.5V15l-3-3 3-3v1.5zm1 4.5v-1.5l1.5-1.5-1.5-1.5V9l3 3-3 3z";break;case"embed-video":e="M17 4H3c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-7 6.5L8 9.1V11H3V6h5v1.8l2-1.3v4zm4 0L12.5 12l1.5 1.5V15l-3-3 3-3v1.5zm1 4.5v-1.5l1.5-1.5-1.5-1.5V9l3 3-3 3z";break;case"excerpt-view":e="M19 18V2c0-.55-.45-1-1-1H2c-.55 0-1 .45-1 1v16c0 .55.45 1 1 1h16c.55 0 1-.45 1-1zM4 3c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm13 0v6H6V3h11zM4 11c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm13 0v6H6v-6h11z";break;case"exit":e="M13 3v2h2v10h-2v2h4V3h-4zm0 8V9H5.4l4.3-4.3-1.4-1.4L1.6 10l6.7 6.7 1.4-1.4L5.4 11H13z";break;case"external":e="M9 3h8v8l-2-1V6.92l-5.6 5.59-1.41-1.41L14.08 5H10zm3 12v-3l2-2v7H3V6h8L9 8H5v7h7z";break;case"facebook-alt":e="M8.46 18h2.93v-7.3h2.45l.37-2.84h-2.82V6.04c0-.82.23-1.38 1.41-1.38h1.51V2.11c-.26-.03-1.15-.11-2.19-.11-2.18 0-3.66 1.33-3.66 3.76v2.1H6v2.84h2.46V18z";break;case"facebook":e="M2.89 2h14.23c.49 0 .88.39.88.88v14.24c0 .48-.39.88-.88.88h-4.08v-6.2h2.08l.31-2.41h-2.39V7.85c0-.7.2-1.18 1.2-1.18h1.28V4.51c-.22-.03-.98-.09-1.86-.09-1.85 0-3.11 1.12-3.11 3.19v1.78H8.46v2.41h2.09V18H2.89c-.49 0-.89-.4-.89-.88V2.88c0-.49.4-.88.89-.88z";break;case"feedback":e="M2 2h16c.55 0 1 .45 1 1v14c0 .55-.45 1-1 1H2c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1zm15 14V7H3v9h14zM4 8v1h3V8H4zm4 0v3h8V8H8zm-4 4v1h3v-1H4zm4 0v3h8v-3H8z";break;case"filter":e="M3 4.5v-2s3.34-1 7-1 7 1 7 1v2l-5 7.03v6.97s-1.22-.09-2.25-.59S8 16.5 8 16.5v-4.97z";break;case"flag":e="M5 18V3H3v15h2zm1-6V4c3-1 7 1 11 0v8c-3 1.27-8-1-11 0z";break;case"format-aside":e="M1 1h18v12l-6 6H1V1zm3 3v1h12V4H4zm0 4v1h12V8H4zm6 5v-1H4v1h6zm2 4l5-5h-5v5z";break;case"format-audio":e="M6.99 3.08l11.02-2c.55-.08.99.45.99 1V14.5c0 1.94-1.57 3.5-3.5 3.5S12 16.44 12 14.5c0-1.93 1.57-3.5 3.5-3.5.54 0 1.04.14 1.5.35V5.08l-9 2V16c-.24 1.7-1.74 3-3.5 3C2.57 19 1 17.44 1 15.5 1 13.57 2.57 12 4.5 12c.54 0 1.04.14 1.5.35V4.08c0-.55.44-.91.99-1z";break;case"format-chat":e="M11 6h-.82C9.07 6 8 7.2 8 8.16V10l-3 3v-3H3c-1.1 0-2-.9-2-2V3c0-1.1.9-2 2-2h6c1.1 0 2 .9 2 2v3zm0 1h6c1.1 0 2 .9 2 2v5c0 1.1-.9 2-2 2h-2v3l-3-3h-1c-1.1 0-2-.9-2-2V9c0-1.1.9-2 2-2z";break;case"format-gallery":e="M16 4h1.96c.57 0 1.04.47 1.04 1.04v12.92c0 .57-.47 1.04-1.04 1.04H5.04C4.47 19 4 18.53 4 17.96V16H2.04C1.47 16 1 15.53 1 14.96V2.04C1 1.47 1.47 1 2.04 1h12.92c.57 0 1.04.47 1.04 1.04V4zM3 14h11V3H3v11zm5-8.5C8 4.67 7.33 4 6.5 4S5 4.67 5 5.5 5.67 7 6.5 7 8 6.33 8 5.5zm2 4.5s1-5 3-5v8H4V7c2 0 2 3 2 3s.33-2 2-2 2 2 2 2zm7 7V6h-1v8.96c0 .57-.47 1.04-1.04 1.04H6v1h11z";break;case"format-image":e="M2.25 1h15.5c.69 0 1.25.56 1.25 1.25v15.5c0 .69-.56 1.25-1.25 1.25H2.25C1.56 19 1 18.44 1 17.75V2.25C1 1.56 1.56 1 2.25 1zM17 17V3H3v14h14zM10 6c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2zm3 5s0-6 3-6v10c0 .55-.45 1-1 1H5c-.55 0-1-.45-1-1V8c2 0 3 4 3 4s1-3 3-3 3 2 3 2z";break;case"format-quote":e="M8.54 12.74c0-.87-.24-1.61-.72-2.22-.73-.92-2.14-1.03-2.96-.85-.34-1.93 1.3-4.39 3.42-5.45L6.65 1.94C3.45 3.46.31 6.96.85 11.37 1.19 14.16 2.8 16 5.08 16c1 0 1.83-.29 2.48-.88.66-.59.98-1.38.98-2.38zm9.43 0c0-.87-.24-1.61-.72-2.22-.73-.92-2.14-1.03-2.96-.85-.34-1.93 1.3-4.39 3.42-5.45l-1.63-2.28c-3.2 1.52-6.34 5.02-5.8 9.43.34 2.79 1.95 4.63 4.23 4.63 1 0 1.83-.29 2.48-.88.66-.59.98-1.38.98-2.38z";break;case"format-status":e="M10 1c7 0 9 2.91 9 6.5S17 14 10 14s-9-2.91-9-6.5S3 1 10 1zM5.5 9C6.33 9 7 8.33 7 7.5S6.33 6 5.5 6 4 6.67 4 7.5 4.67 9 5.5 9zM10 9c.83 0 1.5-.67 1.5-1.5S10.83 6 10 6s-1.5.67-1.5 1.5S9.17 9 10 9zm4.5 0c.83 0 1.5-.67 1.5-1.5S15.33 6 14.5 6 13 6.67 13 7.5 13.67 9 14.5 9zM6 14.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5-1.5-.67-1.5-1.5.67-1.5 1.5-1.5zm-3 2c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1z";break;case"format-video":e="M2 1h16c.55 0 1 .45 1 1v16l-18-.02V2c0-.55.45-1 1-1zm4 1L4 5h1l2-3H6zm4 0H9L7 5h1zm3 0h-1l-2 3h1zm3 0h-1l-2 3h1zm1 14V6H3v10h14zM8 7l6 4-6 4V7z";break;case"forms":e="M2 2h7v7H2V2zm9 0v7h7V2h-7zM5.5 4.5L7 3H4zM12 8V3h5v5h-5zM4.5 5.5L3 4v3zM8 4L6.5 5.5 8 7V4zM5.5 6.5L4 8h3zM9 18v-7H2v7h7zm9 0h-7v-7h7v7zM8 12v5H3v-5h5zm6.5 1.5L16 12h-3zM12 16l1.5-1.5L12 13v3zm3.5-1.5L17 16v-3zm-1 1L13 17h3z";break;case"googleplus":e="M6.73 10h5.4c.05.29.09.57.09.95 0 3.27-2.19 5.6-5.49 5.6-3.17 0-5.73-2.57-5.73-5.73 0-3.17 2.56-5.73 5.73-5.73 1.54 0 2.84.57 3.83 1.5l-1.55 1.5c-.43-.41-1.17-.89-2.28-.89-1.96 0-3.55 1.62-3.55 3.62 0 1.99 1.59 3.61 3.55 3.61 2.26 0 3.11-1.62 3.24-2.47H6.73V10zM19 10v1.64h-1.64v1.63h-1.63v-1.63h-1.64V10h1.64V8.36h1.63V10H19z";break;case"grid-view":e="M2 1h16c.55 0 1 .45 1 1v16c0 .55-.45 1-1 1H2c-.55 0-1-.45-1-1V2c0-.55.45-1 1-1zm7.01 7.99v-6H3v6h6.01zm8 0v-6h-6v6h6zm-8 8.01v-6H3v6h6.01zm8 0v-6h-6v6h6z";break;case"groups":e="M8.03 4.46c-.29 1.28.55 3.46 1.97 3.46 1.41 0 2.25-2.18 1.96-3.46-.22-.98-1.08-1.63-1.96-1.63-.89 0-1.74.65-1.97 1.63zm-4.13.9c-.25 1.08.47 2.93 1.67 2.93s1.92-1.85 1.67-2.93c-.19-.83-.92-1.39-1.67-1.39s-1.48.56-1.67 1.39zm8.86 0c-.25 1.08.47 2.93 1.66 2.93 1.2 0 1.92-1.85 1.67-2.93-.19-.83-.92-1.39-1.67-1.39-.74 0-1.47.56-1.66 1.39zm-.59 11.43l1.25-4.3C14.2 10 12.71 8.47 10 8.47c-2.72 0-4.21 1.53-3.44 4.02l1.26 4.3C8.05 17.51 9 18 10 18c.98 0 1.94-.49 2.17-1.21zm-6.1-7.63c-.49.67-.96 1.83-.42 3.59l1.12 3.79c-.34.2-.77.31-1.2.31-.85 0-1.65-.41-1.85-1.03l-1.07-3.65c-.65-2.11.61-3.4 2.92-3.4.27 0 .54.02.79.06-.1.1-.2.22-.29.33zm8.35-.39c2.31 0 3.58 1.29 2.92 3.4l-1.07 3.65c-.2.62-1 1.03-1.85 1.03-.43 0-.86-.11-1.2-.31l1.11-3.77c.55-1.78.08-2.94-.42-3.61-.08-.11-.18-.23-.28-.33.25-.04.51-.06.79-.06z";break;case"hammer":e="M17.7 6.32l1.41 1.42-3.47 3.41-1.42-1.42.84-.82c-.32-.76-.81-1.57-1.51-2.31l-4.61 6.59-5.26 4.7c-.39.39-1.02.39-1.42 0l-1.2-1.21c-.39-.39-.39-1.02 0-1.41l10.97-9.92c-1.37-.86-3.21-1.46-5.67-1.48 2.7-.82 4.95-.93 6.58-.3 1.7.66 2.82 2.2 3.91 3.58z";break;case"heading":e="M12.5 4v5.2h-5V4H5v13h2.5v-5.2h5V17H15V4";break;case"heart":e="M10 17.12c3.33-1.4 5.74-3.79 7.04-6.21 1.28-2.41 1.46-4.81.32-6.25-1.03-1.29-2.37-1.78-3.73-1.74s-2.68.63-3.63 1.46c-.95-.83-2.27-1.42-3.63-1.46s-2.7.45-3.73 1.74c-1.14 1.44-.96 3.84.34 6.25 1.28 2.42 3.69 4.81 7.02 6.21z";break;case"hidden":e="M17.2 3.3l.16.17c.39.39.39 1.02 0 1.41L4.55 17.7c-.39.39-1.03.39-1.41 0l-.17-.17c-.39-.39-.39-1.02 0-1.41l1.59-1.6c-1.57-1-2.76-2.3-3.56-3.93.81-1.65 2.03-2.98 3.64-3.99S8.04 5.09 10 5.09c1.2 0 2.33.21 3.4.6l2.38-2.39c.39-.39 1.03-.39 1.42 0zm-7.09 4.01c-.23.25-.34.54-.34.88 0 .31.12.58.31.81l1.8-1.79c-.13-.12-.28-.21-.45-.26-.11-.01-.28-.03-.49-.04-.33.03-.6.16-.83.4zM2.4 10.59c.69 1.23 1.71 2.25 3.05 3.05l1.28-1.28c-.51-.69-.77-1.47-.77-2.36 0-1.06.36-1.98 1.09-2.76-1.04.27-1.96.7-2.76 1.26-.8.58-1.43 1.27-1.89 2.09zm13.22-2.13l.96-.96c1.02.86 1.83 1.89 2.42 3.09-.81 1.65-2.03 2.98-3.64 3.99s-3.4 1.51-5.36 1.51c-.63 0-1.24-.07-1.83-.18l1.07-1.07c.25.02.5.05.76.05 1.63 0 3.13-.4 4.5-1.21s2.4-1.84 3.1-3.09c-.46-.82-1.09-1.51-1.89-2.09-.03-.01-.06-.03-.09-.04zm-5.58 5.58l4-4c-.01 1.1-.41 2.04-1.18 2.81-.78.78-1.72 1.18-2.82 1.19z";break;case"html":e="M4 16v-2H2v2H1v-5h1v2h2v-2h1v5H4zM7 16v-4H5.6v-1h3.7v1H8v4H7zM10 16v-5h1l1.4 3.4h.1L14 11h1v5h-1v-3.1h-.1l-1.1 2.5h-.6l-1.1-2.5H11V16h-1zM19 16h-3v-5h1v4h2v1zM9.4 4.2L7.1 6.5l2.3 2.3-.6 1.2-3.5-3.5L8.8 3l.6 1.2zm1.2 4.6l2.3-2.3-2.3-2.3.6-1.2 3.5 3.5-3.5 3.5-.6-1.2z";break;case"id-alt":e="M18 18H2V2h16v16zM8.05 7.53c.13-.07.24-.15.33-.24.09-.1.17-.21.24-.34.07-.14.13-.26.17-.37s.07-.22.1-.34L8.95 6c0-.04.01-.07.01-.09.05-.32.03-.61-.04-.9-.08-.28-.23-.52-.46-.72C8.23 4.1 7.95 4 7.6 4c-.2 0-.39.04-.56.11-.17.08-.31.18-.41.3-.11.13-.2.27-.27.44-.07.16-.11.33-.12.51s0 .36.01.55l.02.09c.01.06.03.15.06.25s.06.21.1.33.1.25.17.37c.08.12.16.23.25.33s.2.19.34.25c.13.06.28.09.43.09s.3-.03.43-.09zM16 5V4h-5v1h5zm0 2V6h-5v1h5zM7.62 8.83l-1.38-.88c-.41 0-.79.11-1.14.32-.35.22-.62.5-.81.85-.19.34-.29.7-.29 1.07v1.25l.2.05c.13.04.31.09.55.14.24.06.51.12.8.17.29.06.62.1 1 .14.37.04.73.06 1.07.06s.69-.02 1.07-.06.7-.09.98-.14c.27-.05.54-.1.82-.17.27-.06.45-.11.54-.13.09-.03.16-.05.21-.06v-1.25c0-.36-.1-.72-.31-1.07s-.49-.64-.84-.86-.72-.33-1.11-.33zM16 9V8h-3v1h3zm0 2v-1h-3v1h3zm0 3v-1H4v1h12zm0 2v-1H4v1h12z";break;case"id":e="M18 16H2V4h16v12zM7.05 8.53c.13-.07.24-.15.33-.24.09-.1.17-.21.24-.34.07-.14.13-.26.17-.37s.07-.22.1-.34L7.95 7c0-.04.01-.07.01-.09.05-.32.03-.61-.04-.9-.08-.28-.23-.52-.46-.72C7.23 5.1 6.95 5 6.6 5c-.2 0-.39.04-.56.11-.17.08-.31.18-.41.3-.11.13-.2.27-.27.44-.07.16-.11.33-.12.51s0 .36.01.55l.02.09c.01.06.03.15.06.25s.06.21.1.33.1.25.17.37c.08.12.16.23.25.33s.2.19.34.25c.13.06.28.09.43.09s.3-.03.43-.09zM17 9V5h-5v4h5zm-10.38.83l-1.38-.88c-.41 0-.79.11-1.14.32-.35.22-.62.5-.81.85-.19.34-.29.7-.29 1.07v1.25l.2.05c.13.04.31.09.55.14.24.06.51.12.8.17.29.06.62.1 1 .14.37.04.73.06 1.07.06s.69-.02 1.07-.06.7-.09.98-.14c.27-.05.54-.1.82-.17.27-.06.45-.11.54-.13.09-.03.16-.05.21-.06v-1.25c0-.36-.1-.72-.31-1.07s-.49-.64-.84-.86-.72-.33-1.11-.33zM17 11v-1h-5v1h5zm0 2v-1h-5v1h5zm0 2v-1H3v1h14z";break;case"image-crop":e="M19 12v3h-4v4h-3v-4H4V7H0V4h4V0h3v4h7l3-3 1 1-3 3v7h4zm-8-5H7v4zm-3 5h4V8z";break;case"image-filter":e="M14 5.87c0-2.2-1.79-4-4-4s-4 1.8-4 4c0 2.21 1.79 4 4 4s4-1.79 4-4zM3.24 10.66c-1.92 1.1-2.57 3.55-1.47 5.46 1.11 1.92 3.55 2.57 5.47 1.47 1.91-1.11 2.57-3.55 1.46-5.47-1.1-1.91-3.55-2.56-5.46-1.46zm9.52 6.93c1.92 1.1 4.36.45 5.47-1.46 1.1-1.92.45-4.36-1.47-5.47-1.91-1.1-4.36-.45-5.46 1.46-1.11 1.92-.45 4.36 1.46 5.47z";break;case"image-flip-horizontal":e="M19 3v14h-8v3H9v-3H1V3h8V0h2v3h8zm-8.5 14V3h-1v14h1zM7 6.5L3 10l4 3.5v-7zM17 10l-4-3.5v7z";break;case"image-flip-vertical":e="M20 9v2h-3v8H3v-8H0V9h3V1h14v8h3zM6.5 7h7L10 3zM17 9.5H3v1h14v-1zM13.5 13h-7l3.5 4z";break;case"image-rotate-left":e="M7 5H5.05c0-1.74.85-2.9 2.95-2.9V0C4.85 0 2.96 2.11 2.96 5H1.18L3.8 8.39zm13-4v14h-5v5H1V10h9V1h10zm-2 2h-6v7h3v3h3V3zm-5 9H3v6h10v-6z";break;case"image-rotate-right":e="M15.95 5H14l3.2 3.39L19.82 5h-1.78c0-2.89-1.89-5-5.04-5v2.1c2.1 0 2.95 1.16 2.95 2.9zM1 1h10v9h9v10H6v-5H1V1zm2 2v10h3v-3h3V3H3zm5 9v6h10v-6H8z";break;case"image-rotate":e="M10.25 1.02c5.1 0 8.75 4.04 8.75 9s-3.65 9-8.75 9c-3.2 0-6.02-1.59-7.68-3.99l2.59-1.52c1.1 1.5 2.86 2.51 4.84 2.51 3.3 0 6-2.79 6-6s-2.7-6-6-6c-1.97 0-3.72 1-4.82 2.49L7 8.02l-6 2v-7L2.89 4.6c1.69-2.17 4.36-3.58 7.36-3.58z";break;case"images-alt":e="M4 15v-3H2V2h12v3h2v3h2v10H6v-3H4zm7-12c-1.1 0-2 .9-2 2h4c0-1.1-.89-2-2-2zm-7 8V6H3v5h1zm7-3h4c0-1.1-.89-2-2-2-1.1 0-2 .9-2 2zm-5 6V9H5v5h1zm9-1c1.1 0 2-.89 2-2 0-1.1-.9-2-2-2s-2 .9-2 2c0 1.11.9 2 2 2zm2 4v-2c-5 0-5-3-10-3v5h10z";break;case"images-alt2":e="M5 3h14v11h-2v2h-2v2H1V7h2V5h2V3zm13 10V4H6v9h12zm-3-4c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm1 6v-1H5V6H4v9h12zM7 6l10 6H7V6zm7 11v-1H3V8H2v9h12z";break;case"index-card":e="M1 3.17V18h18V4H8v-.83c0-.32-.12-.6-.35-.83S7.14 2 6.82 2H2.18c-.33 0-.6.11-.83.34-.24.23-.35.51-.35.83zM10 6v2H3V6h7zm7 0v10h-5V6h5zm-7 4v2H3v-2h7zm0 4v2H3v-2h7z";break;case"info-outline":e="M9 15h2V9H9v6zm1-10c-.5 0-1 .5-1 1s.5 1 1 1 1-.5 1-1-.5-1-1-1zm0-4c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 16c-3.9 0-7-3.1-7-7s3.1-7 7-7 7 3.1 7 7-3.1 7-7 7z";break;case"info":e="M10 2c4.42 0 8 3.58 8 8s-3.58 8-8 8-8-3.58-8-8 3.58-8 8-8zm1 4c0-.55-.45-1-1-1s-1 .45-1 1 .45 1 1 1 1-.45 1-1zm0 9V9H9v6h2z";break;case"insert-after":e="M9 12h2v-2h2V8h-2V6H9v2H7v2h2v2zm1 4c3.9 0 7-3.1 7-7s-3.1-7-7-7-7 3.1-7 7 3.1 7 7 7zm0-12c2.8 0 5 2.2 5 5s-2.2 5-5 5-5-2.2-5-5 2.2-5 5-5zM3 19h14v-2H3v2z";break;case"insert-before":e="M11 8H9v2H7v2h2v2h2v-2h2v-2h-2V8zm-1-4c-3.9 0-7 3.1-7 7s3.1 7 7 7 7-3.1 7-7-3.1-7-7-7zm0 12c-2.8 0-5-2.2-5-5s2.2-5 5-5 5 2.2 5 5-2.2 5-5 5zM3 1v2h14V1H3z";break;case"insert":e="M10 1c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 16c-3.9 0-7-3.1-7-7s3.1-7 7-7 7 3.1 7 7-3.1 7-7 7zm1-11H9v3H6v2h3v3h2v-3h3V9h-3V6z";break;case"instagram":e="M12.67 10A2.67 2.67 0 1 0 10 12.67 2.68 2.68 0 0 0 12.67 10zm1.43 0A4.1 4.1 0 1 1 10 5.9a4.09 4.09 0 0 1 4.1 4.1zm1.13-4.27a1 1 0 1 1-1-1 1 1 0 0 1 1 1zM10 3.44c-1.17 0-3.67-.1-4.72.32a2.67 2.67 0 0 0-1.52 1.52c-.42 1-.32 3.55-.32 4.72s-.1 3.67.32 4.72a2.74 2.74 0 0 0 1.52 1.52c1 .42 3.55.32 4.72.32s3.67.1 4.72-.32a2.83 2.83 0 0 0 1.52-1.52c.42-1.05.32-3.55.32-4.72s.1-3.67-.32-4.72a2.74 2.74 0 0 0-1.52-1.52c-1.05-.42-3.55-.32-4.72-.32zM18 10c0 1.1 0 2.2-.05 3.3a4.84 4.84 0 0 1-1.29 3.36A4.8 4.8 0 0 1 13.3 18H6.7a4.84 4.84 0 0 1-3.36-1.29 4.84 4.84 0 0 1-1.29-3.41C2 12.2 2 11.1 2 10V6.7a4.84 4.84 0 0 1 1.34-3.36A4.8 4.8 0 0 1 6.7 2.05C7.8 2 8.9 2 10 2h3.3a4.84 4.84 0 0 1 3.36 1.29A4.8 4.8 0 0 1 18 6.7V10z";break;case"keyboard-hide":e="M18,0 L2,0 C0.9,0 0.01,0.9 0.01,2 L0,12 C0,13.1 0.9,14 2,14 L18,14 C19.1,14 20,13.1 20,12 L20,2 C20,0.9 19.1,0 18,0 Z M18,12 L2,12 L2,2 L18,2 L18,12 Z M9,3 L11,3 L11,5 L9,5 L9,3 Z M9,6 L11,6 L11,8 L9,8 L9,6 Z M6,3 L8,3 L8,5 L6,5 L6,3 Z M6,6 L8,6 L8,8 L6,8 L6,6 Z M3,6 L5,6 L5,8 L3,8 L3,6 Z M3,3 L5,3 L5,5 L3,5 L3,3 Z M6,9 L14,9 L14,11 L6,11 L6,9 Z M12,6 L14,6 L14,8 L12,8 L12,6 Z M12,3 L14,3 L14,5 L12,5 L12,3 Z M15,6 L17,6 L17,8 L15,8 L15,6 Z M15,3 L17,3 L17,5 L15,5 L15,3 Z M10,20 L14,16 L6,16 L10,20 Z";break;case"laptop":e="M3 3h14c.6 0 1 .4 1 1v10c0 .6-.4 1-1 1H3c-.6 0-1-.4-1-1V4c0-.6.4-1 1-1zm13 2H4v8h12V5zm-3 1H5v4zm6 11v-1H1v1c0 .6.5 1 1.1 1h15.8c.6 0 1.1-.4 1.1-1z";break;case"layout":e="M2 2h5v11H2V2zm6 0h5v5H8V2zm6 0h4v16h-4V2zM8 8h5v5H8V8zm-6 6h11v4H2v-4z";break;case"leftright":e="M3 10.03L9 6v8zM11 6l6 4.03L11 14V6z";break;case"lightbulb":e="M10 1c3.11 0 5.63 2.52 5.63 5.62 0 1.84-2.03 4.58-2.03 4.58-.33.44-.6 1.25-.6 1.8v1c0 .55-.45 1-1 1H8c-.55 0-1-.45-1-1v-1c0-.55-.27-1.36-.6-1.8 0 0-2.02-2.74-2.02-4.58C4.38 3.52 6.89 1 10 1zM7 16.87V16h6v.87c0 .62-.13 1.13-.75 1.13H12c0 .62-.4 1-1.02 1h-2c-.61 0-.98-.38-.98-1h-.25c-.62 0-.75-.51-.75-1.13z";break;case"list-view":e="M2 19h16c.55 0 1-.45 1-1V2c0-.55-.45-1-1-1H2c-.55 0-1 .45-1 1v16c0 .55.45 1 1 1zM4 3c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm13 0v2H6V3h11zM4 7c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm13 0v2H6V7h11zM4 11c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm13 0v2H6v-2h11zM4 15c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm13 0v2H6v-2h11z";break;case"location-alt":e="M13 13.14l1.17-5.94c.79-.43 1.33-1.25 1.33-2.2 0-1.38-1.12-2.5-2.5-2.5S10.5 3.62 10.5 5c0 .95.54 1.77 1.33 2.2zm0-9.64c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5-1.5-.67-1.5-1.5.67-1.5 1.5-1.5zm1.72 4.8L18 6.97v9L13.12 18 7 15.97l-5 2v-9l5-2 4.27 1.41 1.73 7.3z";break;case"location":e="M10 2C6.69 2 4 4.69 4 8c0 2.02 1.17 3.71 2.53 4.89.43.37 1.18.96 1.85 1.83.74.97 1.41 2.01 1.62 2.71.21-.7.88-1.74 1.62-2.71.67-.87 1.42-1.46 1.85-1.83C14.83 11.71 16 10.02 16 8c0-3.31-2.69-6-6-6zm0 2.56c1.9 0 3.44 1.54 3.44 3.44S11.9 11.44 10 11.44 6.56 9.9 6.56 8 8.1 4.56 10 4.56z";break;case"lock":e="M14 9h1c.55 0 1 .45 1 1v7c0 .55-.45 1-1 1H5c-.55 0-1-.45-1-1v-7c0-.55.45-1 1-1h1V6c0-2.21 1.79-4 4-4s4 1.79 4 4v3zm-2 0V6c0-1.1-.9-2-2-2s-2 .9-2 2v3h4zm-1 7l-.36-2.15c.51-.24.86-.75.86-1.35 0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5c0 .6.35 1.11.86 1.35L9 16h2z";break;case"marker":e="M10 2c4.42 0 8 3.58 8 8s-3.58 8-8 8-8-3.58-8-8 3.58-8 8-8zm0 13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5z";break;case"media-archive":e="M12 2l4 4v12H4V2h8zm0 4h3l-3-3v3zM8 3.5v2l1.8-1zM11 5L9.2 6 11 7V5zM8 6.5v2l1.8-1zM11 8L9.2 9l1.8 1V8zM8 9.5v2l1.8-1zm3 1.5l-1.8 1 1.8 1v-2zm-1.5 6c.83 0 1.62-.72 1.5-1.63-.05-.38-.49-1.61-.49-1.61l-1.99-1.1s-.45 1.95-.52 2.71c-.07.77.67 1.63 1.5 1.63zm0-2.39c.42 0 .76.34.76.76 0 .43-.34.77-.76.77s-.76-.34-.76-.77c0-.42.34-.76.76-.76z";break;case"media-audio":e="M12 2l4 4v12H4V2h8zm0 4h3l-3-3v3zm1 7.26V8.09c0-.11-.04-.21-.12-.29-.07-.08-.16-.11-.27-.1 0 0-3.97.71-4.25.78C8.07 8.54 8 8.8 8 9v3.37c-.2-.09-.42-.07-.6-.07-.38 0-.7.13-.96.39-.26.27-.4.58-.4.96 0 .37.14.69.4.95.26.27.58.4.96.4.34 0 .7-.04.96-.26.26-.23.64-.65.64-1.12V10.3l3-.6V12c-.67-.2-1.17.04-1.44.31-.26.26-.39.58-.39.95 0 .38.13.69.39.96.27.26.71.39 1.08.39.38 0 .7-.13.96-.39.26-.27.4-.58.4-.96z";break;case"media-code":e="M12 2l4 4v12H4V2h8zM9 13l-2-2 2-2-1-1-3 3 3 3zm3 1l3-3-3-3-1 1 2 2-2 2z";break;case"media-default":e="M12 2l4 4v12H4V2h8zm0 4h3l-3-3v3z";break;case"media-document":e="M12 2l4 4v12H4V2h8zM5 3v1h6V3H5zm7 3h3l-3-3v3zM5 5v1h6V5H5zm10 3V7H5v1h10zM5 9v1h4V9H5zm10 3V9h-5v3h5zM5 11v1h4v-1H5zm10 3v-1H5v1h10zm-3 2v-1H5v1h7z";break;case"media-interactive":e="M12 2l4 4v12H4V2h8zm0 4h3l-3-3v3zm2 8V8H6v6h3l-1 2h1l1-2 1 2h1l-1-2h3zm-6-3c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm5-2v2h-3V9h3zm0 3v1H7v-1h6z";break;case"media-spreadsheet":e="M12 2l4 4v12H4V2h8zm-1 4V3H5v3h6zM8 8V7H5v1h3zm3 0V7H9v1h2zm4 0V7h-3v1h3zm-7 2V9H5v1h3zm3 0V9H9v1h2zm4 0V9h-3v1h3zm-7 2v-1H5v1h3zm3 0v-1H9v1h2zm4 0v-1h-3v1h3zm-7 2v-1H5v1h3zm3 0v-1H9v1h2zm4 0v-1h-3v1h3zm-7 2v-1H5v1h3zm3 0v-1H9v1h2z";break;case"media-text":e="M12 2l4 4v12H4V2h8zM5 3v1h6V3H5zm7 3h3l-3-3v3zM5 5v1h6V5H5zm10 3V7H5v1h10zm0 2V9H5v1h10zm0 2v-1H5v1h10zm-4 2v-1H5v1h6z";break;case"media-video":e="M12 2l4 4v12H4V2h8zm0 4h3l-3-3v3zm-1 8v-3c0-.27-.1-.51-.29-.71-.2-.19-.44-.29-.71-.29H7c-.27 0-.51.1-.71.29-.19.2-.29.44-.29.71v3c0 .27.1.51.29.71.2.19.44.29.71.29h3c.27 0 .51-.1.71-.29.19-.2.29-.44.29-.71zm3 1v-5l-2 2v1z";break;case"megaphone":e="M18.15 5.94c.46 1.62.38 3.22-.02 4.48-.42 1.28-1.26 2.18-2.3 2.48-.16.06-.26.06-.4.06-.06.02-.12.02-.18.02-.06.02-.14.02-.22.02h-6.8l2.22 5.5c.02.14-.06.26-.14.34-.08.1-.24.16-.34.16H6.95c-.1 0-.26-.06-.34-.16-.08-.08-.16-.2-.14-.34l-1-5.5H4.25l-.02-.02c-.5.06-1.08-.18-1.54-.62s-.88-1.08-1.06-1.88c-.24-.8-.2-1.56-.02-2.2.18-.62.58-1.08 1.06-1.3l.02-.02 9-5.4c.1-.06.18-.1.24-.16.06-.04.14-.08.24-.12.16-.08.28-.12.5-.18 1.04-.3 2.24.1 3.22.98s1.84 2.24 2.26 3.86zm-2.58 5.98h-.02c.4-.1.74-.34 1.04-.7.58-.7.86-1.76.86-3.04 0-.64-.1-1.3-.28-1.98-.34-1.36-1.02-2.5-1.78-3.24s-1.68-1.1-2.46-.88c-.82.22-1.4.96-1.7 2-.32 1.04-.28 2.36.06 3.72.38 1.36 1 2.5 1.8 3.24.78.74 1.62 1.1 2.48.88zm-2.54-7.08c.22-.04.42-.02.62.04.38.16.76.48 1.02 1s.42 1.2.42 1.78c0 .3-.04.56-.12.8-.18.48-.44.84-.86.94-.34.1-.8-.06-1.14-.4s-.64-.86-.78-1.5c-.18-.62-.12-1.24.02-1.72s.48-.84.82-.94z";break;case"menu-alt":e="M3 4h14v2H3V4zm0 5h14v2H3V9zm0 5h14v2H3v-2z";break;case"menu":e="M17 7V5H3v2h14zm0 4V9H3v2h14zm0 4v-2H3v2h14z";break;case"microphone":e="M12 9V3c0-1.1-.89-2-2-2-1.12 0-2 .94-2 2v6c0 1.1.9 2 2 2 1.13 0 2-.94 2-2zm4 0c0 2.97-2.16 5.43-5 5.91V17h2c.56 0 1 .45 1 1s-.44 1-1 1H7c-.55 0-1-.45-1-1s.45-1 1-1h2v-2.09C6.17 14.43 4 11.97 4 9c0-.55.45-1 1-1 .56 0 1 .45 1 1 0 2.21 1.8 4 4 4 2.21 0 4-1.79 4-4 0-.55.45-1 1-1 .56 0 1 .45 1 1z";break;case"migrate":e="M4 6h6V4H2v12.01h8V14H4V6zm2 2h6V5l6 5-6 5v-3H6V8z";break;case"minus":e="M4 9h12v2H4V9z";break;case"money":e="M0 3h20v12h-.75c0-1.79-1.46-3.25-3.25-3.25-1.31 0-2.42.79-2.94 1.91-.25-.1-.52-.16-.81-.16-.98 0-1.8.63-2.11 1.5H0V3zm8.37 3.11c-.06.15-.1.31-.11.47s-.01.33.01.5l.02.08c.01.06.02.14.05.23.02.1.06.2.1.31.03.11.09.22.15.33.07.12.15.22.23.31s.18.17.31.23c.12.06.25.09.4.09.14 0 .27-.03.39-.09s.22-.14.3-.22c.09-.09.16-.2.22-.32.07-.12.12-.23.16-.33s.07-.2.09-.31c.03-.11.04-.18.05-.22s.01-.07.01-.09c.05-.29.03-.56-.04-.82s-.21-.48-.41-.66c-.21-.18-.47-.27-.79-.27-.19 0-.36.03-.52.1-.15.07-.28.16-.38.28-.09.11-.17.25-.24.4zm4.48 6.04v-1.14c0-.33-.1-.66-.29-.98s-.45-.59-.77-.79c-.32-.21-.66-.31-1.02-.31l-1.24.84-1.28-.82c-.37 0-.72.1-1.04.3-.31.2-.56.46-.74.77-.18.32-.27.65-.27.99v1.14l.18.05c.12.04.29.08.51.14.23.05.47.1.74.15.26.05.57.09.91.13.34.03.67.05.99.05.3 0 .63-.02.98-.05.34-.04.64-.08.89-.13.25-.04.5-.1.76-.16l.5-.12c.08-.02.14-.04.19-.06zm3.15.1c1.52 0 2.75 1.23 2.75 2.75s-1.23 2.75-2.75 2.75c-.73 0-1.38-.3-1.87-.77.23-.35.37-.78.37-1.23 0-.77-.39-1.46-.99-1.86.43-.96 1.37-1.64 2.49-1.64zm-5.5 3.5c0-.96.79-1.75 1.75-1.75s1.75.79 1.75 1.75-.79 1.75-1.75 1.75-1.75-.79-1.75-1.75z";break;case"move":e="M19 10l-4 4v-3h-4v4h3l-4 4-4-4h3v-4H5v3l-4-4 4-4v3h4V5H6l4-4 4 4h-3v4h4V6z";break;case"nametag":e="M12 5V2c0-.55-.45-1-1-1H9c-.55 0-1 .45-1 1v3c0 .55.45 1 1 1h2c.55 0 1-.45 1-1zm-2-3c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm8 13V7c0-1.1-.9-2-2-2h-3v.33C13 6.25 12.25 7 11.33 7H8.67C7.75 7 7 6.25 7 5.33V5H4c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2zm-1-6v6H3V9h14zm-8 2c0-.55-.22-1-.5-1s-.5.45-.5 1 .22 1 .5 1 .5-.45.5-1zm3 0c0-.55-.22-1-.5-1s-.5.45-.5 1 .22 1 .5 1 .5-.45.5-1zm-5.96 1.21c.92.48 2.34.79 3.96.79s3.04-.31 3.96-.79c-.21 1-1.89 1.79-3.96 1.79s-3.75-.79-3.96-1.79z";break;case"networking":e="M18 13h1c.55 0 1 .45 1 1.01v2.98c0 .56-.45 1.01-1 1.01h-4c-.55 0-1-.45-1-1.01v-2.98c0-.56.45-1.01 1-1.01h1v-2h-5v2h1c.55 0 1 .45 1 1.01v2.98c0 .56-.45 1.01-1 1.01H8c-.55 0-1-.45-1-1.01v-2.98c0-.56.45-1.01 1-1.01h1v-2H4v2h1c.55 0 1 .45 1 1.01v2.98C6 17.55 5.55 18 5 18H1c-.55 0-1-.45-1-1.01v-2.98C0 13.45.45 13 1 13h1v-2c0-1.1.9-2 2-2h5V7H8c-.55 0-1-.45-1-1.01V3.01C7 2.45 7.45 2 8 2h4c.55 0 1 .45 1 1.01v2.98C13 6.55 12.55 7 12 7h-1v2h5c1.1 0 2 .9 2 2v2z";break;case"no-alt":e="M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z";break;case"no":e="M12.12 10l3.53 3.53-2.12 2.12L10 12.12l-3.54 3.54-2.12-2.12L7.88 10 4.34 6.46l2.12-2.12L10 7.88l3.54-3.53 2.12 2.12z";break;case"palmtree":e="M8.58 2.39c.32 0 .59.05.81.14 1.25.55 1.69 2.24 1.7 3.97.59-.82 2.15-2.29 3.41-2.29s2.94.73 3.53 3.55c-1.13-.65-2.42-.94-3.65-.94-1.26 0-2.45.32-3.29.89.4-.11.86-.16 1.33-.16 1.39 0 2.9.45 3.4 1.31.68 1.16.47 3.38-.76 4.14-.14-2.1-1.69-4.12-3.47-4.12-.44 0-.88.12-1.33.38C8 10.62 7 14.56 7 19H2c0-5.53 4.21-9.65 7.68-10.79-.56-.09-1.17-.15-1.82-.15C6.1 8.06 4.05 8.5 2 10c.76-2.96 2.78-4.1 4.69-4.1 1.25 0 2.45.5 3.2 1.29-.66-2.24-2.49-2.86-4.08-2.86-.8 0-1.55.16-2.05.35.91-1.29 3.31-2.29 4.82-2.29zM13 11.5c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5.67 1.5 1.5 1.5 1.5-.67 1.5-1.5z";break;case"paperclip":e="M17.05 2.7c1.93 1.94 1.93 5.13 0 7.07L10 16.84c-1.88 1.89-4.91 1.93-6.86.15-.06-.05-.13-.09-.19-.15-1.93-1.94-1.93-5.12 0-7.07l4.94-4.95c.91-.92 2.28-1.1 3.39-.58.3.15.59.33.83.58 1.17 1.17 1.17 3.07 0 4.24l-4.93 4.95c-.39.39-1.02.39-1.41 0s-.39-1.02 0-1.41l4.93-4.95c.39-.39.39-1.02 0-1.41-.38-.39-1.02-.39-1.4 0l-4.94 4.95c-.91.92-1.1 2.29-.57 3.4.14.3.32.59.57.84s.54.43.84.57c1.11.53 2.47.35 3.39-.57l7.05-7.07c1.16-1.17 1.16-3.08 0-4.25-.56-.55-1.28-.83-2-.86-.08.01-.16.01-.24 0-.22-.03-.43-.11-.6-.27-.39-.4-.38-1.05.02-1.45.16-.16.36-.24.56-.28.14-.02.27-.01.4.02 1.19.06 2.36.52 3.27 1.43z";break;case"performance":e="M3.76 17.01h12.48C17.34 15.63 18 13.9 18 12c0-4.41-3.58-8-8-8s-8 3.59-8 8c0 1.9.66 3.63 1.76 5.01zM9 6c0-.55.45-1 1-1s1 .45 1 1c0 .56-.45 1-1 1s-1-.44-1-1zM4 8c0-.55.45-1 1-1s1 .45 1 1c0 .56-.45 1-1 1s-1-.44-1-1zm4.52 3.4c.84-.83 6.51-3.5 6.51-3.5s-2.66 5.68-3.49 6.51c-.84.84-2.18.84-3.02 0-.83-.83-.83-2.18 0-3.01zM3 13c0-.55.45-1 1-1s1 .45 1 1c0 .56-.45 1-1 1s-1-.44-1-1zm6 0c0-.55.45-1 1-1s1 .45 1 1c0 .56-.45 1-1 1s-1-.44-1-1zm6 0c0-.55.45-1 1-1s1 .45 1 1c0 .56-.45 1-1 1s-1-.44-1-1z";break;case"phone":e="M12.06 6l-.21-.2c-.52-.54-.43-.79.08-1.3l2.72-2.75c.81-.82.96-1.21 1.73-.48l.21.2zm.53.45l4.4-4.4c.7.94 2.34 3.47 1.53 5.34-.73 1.67-1.09 1.75-2 3-1.85 2.11-4.18 4.37-6 6.07-1.26.91-1.31 1.33-3 2-1.8.71-4.4-.89-5.38-1.56l4.4-4.4 1.18 1.62c.34.46 1.2-.06 1.8-.66 1.04-1.05 3.18-3.18 4-4.07.59-.59 1.12-1.45.66-1.8zM1.57 16.5l-.21-.21c-.68-.74-.29-.9.52-1.7l2.74-2.72c.51-.49.75-.6 1.27-.11l.2.21z";break;case"playlist-audio":e="M17 3V1H2v2h15zm0 4V5H2v2h15zm-7 4V9H2v2h8zm7.45-1.96l-6 1.12c-.16.02-.19.03-.29.13-.11.09-.16.22-.16.37v4.59c-.29-.13-.66-.14-.93-.14-.54 0-1 .19-1.38.57s-.56.84-.56 1.38c0 .53.18.99.56 1.37s.84.57 1.38.57c.49 0 .92-.16 1.29-.48s.59-.71.65-1.19v-4.95L17 11.27v3.48c-.29-.13-.56-.19-.83-.19-.54 0-1.11.19-1.49.57-.38.37-.57.83-.57 1.37s.19.99.57 1.37.84.57 1.38.57c.53 0 .99-.19 1.37-.57s.57-.83.57-1.37V9.6c0-.16-.05-.3-.16-.41-.11-.12-.24-.17-.39-.15zM8 15v-2H2v2h6zm-2 4v-2H2v2h4z";break;case"playlist-video":e="M17 3V1H2v2h15zm0 4V5H2v2h15zM6 11V9H2v2h4zm2-2h9c.55 0 1 .45 1 1v8c0 .55-.45 1-1 1H8c-.55 0-1-.45-1-1v-8c0-.55.45-1 1-1zm3 7l3.33-2L11 12v4zm-5-1v-2H2v2h4zm0 4v-2H2v2h4z";break;case"plus-alt":e="M15.8 4.2c3.2 3.21 3.2 8.39 0 11.6-3.21 3.2-8.39 3.2-11.6 0C1 12.59 1 7.41 4.2 4.2 7.41 1 12.59 1 15.8 4.2zm-4.3 11.3v-4h4v-3h-4v-4h-3v4h-4v3h4v4h3z";break;case"plus-light":e="M17 9v2h-6v6H9v-6H3V9h6V3h2v6h6z";break;case"plus":e="M17 7v3h-5v5H9v-5H4V7h5V2h3v5h5z";break;case"portfolio":e="M4 5H.78c-.37 0-.74.32-.69.84l1.56 9.99S3.5 8.47 3.86 6.7c.11-.53.61-.7.98-.7H10s-.7-2.08-.77-2.31C9.11 3.25 8.89 3 8.45 3H5.14c-.36 0-.7.23-.8.64C4.25 4.04 4 5 4 5zm4.88 0h-4s.42-1 .87-1h2.13c.48 0 1 1 1 1zM2.67 16.25c-.31.47-.76.75-1.26.75h15.73c.54 0 .92-.31 1.03-.83.44-2.19 1.68-8.44 1.68-8.44.07-.5-.3-.73-.62-.73H16V5.53c0-.16-.26-.53-.66-.53h-3.76c-.52 0-.87.58-.87.58L10 7H5.59c-.32 0-.63.19-.69.5 0 0-1.59 6.7-1.72 7.33-.07.37-.22.99-.51 1.42zM15.38 7H11s.58-1 1.13-1h2.29c.71 0 .96 1 .96 1z";break;case"post-status":e="M14 6c0 1.86-1.28 3.41-3 3.86V16c0 1-2 2-2 2V9.86c-1.72-.45-3-2-3-3.86 0-2.21 1.79-4 4-4s4 1.79 4 4zM8 5c0 .55.45 1 1 1s1-.45 1-1-.45-1-1-1-1 .45-1 1z";break;case"pressthis":e="M14.76 1C16.55 1 18 2.46 18 4.25c0 1.78-1.45 3.24-3.24 3.24-.23 0-.47-.03-.7-.08L13 8.47V19H2V4h9.54c.13-2 1.52-3 3.22-3zm0 5.49C16 6.49 17 5.48 17 4.25 17 3.01 16 2 14.76 2s-2.24 1.01-2.24 2.25c0 .37.1.72.27 1.03L9.57 8.5c-.28.28-1.77 2.22-1.5 2.49.02.03.06.04.1.04.49 0 2.14-1.28 2.39-1.53l3.24-3.24c.29.14.61.23.96.23z";break;case"products":e="M17 8h1v11H2V8h1V6c0-2.76 2.24-5 5-5 .71 0 1.39.15 2 .42.61-.27 1.29-.42 2-.42 2.76 0 5 2.24 5 5v2zM5 6v2h2V6c0-1.13.39-2.16 1.02-3H8C6.35 3 5 4.35 5 6zm10 2V6c0-1.65-1.35-3-3-3h-.02c.63.84 1.02 1.87 1.02 3v2h2zm-5-4.22C9.39 4.33 9 5.12 9 6v2h2V6c0-.88-.39-1.67-1-2.22z";break;case"randomize":e="M18 6.01L14 9V7h-4l-5 8H2v-2h2l5-8h5V3zM2 5h3l1.15 2.17-1.12 1.8L4 7H2V5zm16 9.01L14 17v-2H9l-1.15-2.17 1.12-1.8L10 13h4v-2z";break;case"redo":e="M8 5h5V2l6 4-6 4V7H8c-2.2 0-4 1.8-4 4s1.8 4 4 4h5v2H8c-3.3 0-6-2.7-6-6s2.7-6 6-6z";break;case"rest-api":e="M3 4h2v12H3z";break;case"rss":e="M14.92 18H18C18 9.32 10.82 2.25 2 2.25v3.02c7.12 0 12.92 5.71 12.92 12.73zm-5.44 0h3.08C12.56 12.27 7.82 7.6 2 7.6v3.02c2 0 3.87.77 5.29 2.16C8.7 14.17 9.48 16.03 9.48 18zm-5.35-.02c1.17 0 2.13-.93 2.13-2.09 0-1.15-.96-2.09-2.13-2.09-1.18 0-2.13.94-2.13 2.09 0 1.16.95 2.09 2.13 2.09z";break;case"saved":e="M15.3 5.3l-6.8 6.8-2.8-2.8-1.4 1.4 4.2 4.2 8.2-8.2";break;case"schedule":e="M2 2h16v4H2V2zm0 10V8h4v4H2zm6-2V8h4v2H8zm6 3V8h4v5h-4zm-6 5v-6h4v6H8zm-6 0v-4h4v4H2zm12 0v-3h4v3h-4z";break;case"screenoptions":e="M9 9V3H3v6h6zm8 0V3h-6v6h6zm-8 8v-6H3v6h6zm8 0v-6h-6v6h6z";break;case"search":e="M12.14 4.18c1.87 1.87 2.11 4.75.72 6.89.12.1.22.21.36.31.2.16.47.36.81.59.34.24.56.39.66.47.42.31.73.57.94.78.32.32.6.65.84 1 .25.35.44.69.59 1.04.14.35.21.68.18 1-.02.32-.14.59-.36.81s-.49.34-.81.36c-.31.02-.65-.04-.99-.19-.35-.14-.7-.34-1.04-.59-.35-.24-.68-.52-1-.84-.21-.21-.47-.52-.77-.93-.1-.13-.25-.35-.47-.66-.22-.32-.4-.57-.56-.78-.16-.2-.29-.35-.44-.5-2.07 1.09-4.69.76-6.44-.98-2.14-2.15-2.14-5.64 0-7.78 2.15-2.15 5.63-2.15 7.78 0zm-1.41 6.36c1.36-1.37 1.36-3.58 0-4.95-1.37-1.37-3.59-1.37-4.95 0-1.37 1.37-1.37 3.58 0 4.95 1.36 1.37 3.58 1.37 4.95 0z";break;case"share-alt":e="M16.22 5.8c.47.69.29 1.62-.4 2.08-.69.47-1.62.29-2.08-.4-.16-.24-.35-.46-.55-.67-.21-.2-.43-.39-.67-.55s-.5-.3-.77-.41c-.27-.12-.55-.21-.84-.26-.59-.13-1.23-.13-1.82-.01-.29.06-.57.15-.84.27-.27.11-.53.25-.77.41s-.46.35-.66.55c-.21.21-.4.43-.56.67s-.3.5-.41.76c-.01.02-.01.03-.01.04-.1.24-.17.48-.23.72H1V6h2.66c.04-.07.07-.13.12-.2.27-.4.57-.77.91-1.11s.72-.65 1.11-.91c.4-.27.83-.51 1.28-.7s.93-.34 1.41-.43c.99-.21 2.03-.21 3.02 0 .48.09.96.24 1.41.43s.88.43 1.28.7c.39.26.77.57 1.11.91s.64.71.91 1.11zM12.5 10c0-1.38-1.12-2.5-2.5-2.5S7.5 8.62 7.5 10s1.12 2.5 2.5 2.5 2.5-1.12 2.5-2.5zm-8.72 4.2c-.47-.69-.29-1.62.4-2.09.69-.46 1.62-.28 2.08.41.16.24.35.46.55.67.21.2.43.39.67.55s.5.3.77.41c.27.12.55.2.84.26.59.13 1.23.12 1.82 0 .29-.06.57-.14.84-.26.27-.11.53-.25.77-.41s.46-.35.66-.55c.21-.21.4-.44.56-.67.16-.25.3-.5.41-.76.01-.02.01-.03.01-.04.1-.24.17-.48.23-.72H19v3h-2.66c-.04.06-.07.13-.12.2-.27.4-.57.77-.91 1.11s-.72.65-1.11.91c-.4.27-.83.51-1.28.7s-.93.33-1.41.43c-.99.21-2.03.21-3.02 0-.48-.1-.96-.24-1.41-.43s-.88-.43-1.28-.7c-.39-.26-.77-.57-1.11-.91s-.64-.71-.91-1.11z";break;case"share-alt2":e="M18 8l-5 4V9.01c-2.58.06-4.88.45-7 2.99.29-3.57 2.66-5.66 7-5.94V3zM4 14h11v-2l2-1.6V16H2V5h9.43c-1.83.32-3.31 1-4.41 2H4v7z";break;case"share":e="M14.5 12c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3c0-.24.03-.46.09-.69l-4.38-2.3c-.55.61-1.33.99-2.21.99-1.66 0-3-1.34-3-3s1.34-3 3-3c.88 0 1.66.39 2.21.99l4.38-2.3c-.06-.23-.09-.45-.09-.69 0-1.66 1.34-3 3-3s3 1.34 3 3-1.34 3-3 3c-.88 0-1.66-.39-2.21-.99l-4.38 2.3c.06.23.09.45.09.69s-.03.46-.09.69l4.38 2.3c.55-.61 1.33-.99 2.21-.99z";break;case"shield-alt":e="M10 2s3 2 7 2c0 11-7 14-7 14S3 15 3 4c4 0 7-2 7-2z";break;case"shield":e="M10 2s3 2 7 2c0 11-7 14-7 14S3 15 3 4c4 0 7-2 7-2zm0 8h5s1-1 1-5c0 0-5-1-6-2v7H5c1 4 5 7 5 7v-7z";break;case"shortcode":e="M6 14H4V6h2V4H2v12h4M7.1 17h2.1l3.7-14h-2.1M14 4v2h2v8h-2v2h4V4";break;case"slides":e="M5 14V6h10v8H5zm-3-1V7h2v6H2zm4-6v6h8V7H6zm10 0h2v6h-2V7zm-3 2V8H7v1h6zm0 3v-2H7v2h6z";break;case"smartphone":e="M6 2h8c.55 0 1 .45 1 1v14c0 .55-.45 1-1 1H6c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1zm7 12V4H7v10h6zM8 5h4l-4 5V5z";break;case"smiley":e="M7 5.2c1.1 0 2 .89 2 2 0 .37-.11.71-.28 1C8.72 8.2 8 8 7 8s-1.72.2-1.72.2c-.17-.29-.28-.63-.28-1 0-1.11.9-2 2-2zm6 0c1.11 0 2 .89 2 2 0 .37-.11.71-.28 1 0 0-.72-.2-1.72-.2s-1.72.2-1.72.2c-.17-.29-.28-.63-.28-1 0-1.11.89-2 2-2zm-3 13.7c3.72 0 7.03-2.36 8.23-5.88l-1.32-.46C15.9 15.52 13.12 17.5 10 17.5s-5.9-1.98-6.91-4.94l-1.32.46c1.2 3.52 4.51 5.88 8.23 5.88z";break;case"sort":e="M11 7H1l5 7zm-2 7h10l-5-7z";break;case"sos":e="M18 10c0-4.42-3.58-8-8-8s-8 3.58-8 8 3.58 8 8 8 8-3.58 8-8zM7.23 3.57L8.72 7.3c-.62.29-1.13.8-1.42 1.42L3.57 7.23c.71-1.64 2.02-2.95 3.66-3.66zm9.2 3.66L12.7 8.72c-.29-.62-.8-1.13-1.42-1.42l1.49-3.73c1.64.71 2.95 2.02 3.66 3.66zM10 12c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm-6.43.77l3.73-1.49c.29.62.8 1.13 1.42 1.42l-1.49 3.73c-1.64-.71-2.95-2.02-3.66-3.66zm9.2 3.66l-1.49-3.73c.62-.29 1.13-.8 1.42-1.42l3.73 1.49c-.71 1.64-2.02 2.95-3.66 3.66z";break;case"star-empty":e="M10 1L7 7l-6 .75 4.13 4.62L4 19l6-3 6 3-1.12-6.63L19 7.75 13 7zm0 2.24l2.34 4.69 4.65.58-3.18 3.56.87 5.15L10 14.88l-4.68 2.34.87-5.15-3.18-3.56 4.65-.58z";break;case"star-filled":e="M10 1l3 6 6 .75-4.12 4.62L16 19l-6-3-6 3 1.13-6.63L1 7.75 7 7z";break;case"star-half":e="M10 1L7 7l-6 .75 4.13 4.62L4 19l6-3 6 3-1.12-6.63L19 7.75 13 7zm0 2.24l2.34 4.69 4.65.58-3.18 3.56.87 5.15L10 14.88V3.24z";break;case"sticky":e="M5 3.61V1.04l8.99-.01-.01 2.58c-1.22.26-2.16 1.35-2.16 2.67v.5c.01 1.31.93 2.4 2.17 2.66l-.01 2.58h-3.41l-.01 2.57c0 .6-.47 4.41-1.06 4.41-.6 0-1.08-3.81-1.08-4.41v-2.56L5 12.02l.01-2.58c1.23-.25 2.15-1.35 2.15-2.66v-.5c0-1.31-.92-2.41-2.16-2.67z";break;case"store":e="M1 10c.41.29.96.43 1.5.43.55 0 1.09-.14 1.5-.43.62-.46 1-1.17 1-2 0 .83.37 1.54 1 2 .41.29.96.43 1.5.43.55 0 1.09-.14 1.5-.43.62-.46 1-1.17 1-2 0 .83.37 1.54 1 2 .41.29.96.43 1.51.43.54 0 1.08-.14 1.49-.43.62-.46 1-1.17 1-2 0 .83.37 1.54 1 2 .41.29.96.43 1.5.43.55 0 1.09-.14 1.5-.43.63-.46 1-1.17 1-2V7l-3-7H4L0 7v1c0 .83.37 1.54 1 2zm2 8.99h5v-5h4v5h5v-7c-.37-.05-.72-.22-1-.43-.63-.45-1-.73-1-1.56 0 .83-.38 1.11-1 1.56-.41.3-.95.43-1.49.44-.55 0-1.1-.14-1.51-.44-.63-.45-1-.73-1-1.56 0 .83-.38 1.11-1 1.56-.41.3-.95.43-1.5.44-.54 0-1.09-.14-1.5-.44-.63-.45-1-.73-1-1.57 0 .84-.38 1.12-1 1.57-.29.21-.63.38-1 .44v6.99z";break;case"table-col-after":e="M14.08 12.864V9.216h3.648V7.424H14.08V3.776h-1.728v3.648H8.64v1.792h3.712v3.648zM0 17.92V0h20.48v17.92H0zM6.4 1.28H1.28v3.84H6.4V1.28zm0 5.12H1.28v3.84H6.4V6.4zm0 5.12H1.28v3.84H6.4v-3.84zM19.2 1.28H7.68v14.08H19.2V1.28z";break;case"table-col-before":e="M6.4 3.776v3.648H2.752v1.792H6.4v3.648h1.728V9.216h3.712V7.424H8.128V3.776zM0 17.92V0h20.48v17.92H0zM12.8 1.28H1.28v14.08H12.8V1.28zm6.4 0h-5.12v3.84h5.12V1.28zm0 5.12h-5.12v3.84h5.12V6.4zm0 5.12h-5.12v3.84h5.12v-3.84z";break;case"table-col-delete":e="M6.4 9.98L7.68 8.7v-.256L6.4 7.164V9.98zm6.4-1.532l1.28-1.28V9.92L12.8 8.64v-.192zm7.68 9.472V0H0v17.92h20.48zm-1.28-2.56h-5.12v-1.024l-.256.256-1.024-1.024v1.792H7.68v-1.792l-1.024 1.024-.256-.256v1.024H1.28V1.28H6.4v2.368l.704-.704.576.576V1.216h5.12V3.52l.96-.96.32.32V1.216h5.12V15.36zm-5.76-2.112l-3.136-3.136-3.264 3.264-1.536-1.536 3.264-3.264L5.632 5.44l1.536-1.536 3.136 3.136 3.2-3.2 1.536 1.536-3.2 3.2 3.136 3.136-1.536 1.536z";break;case"table-row-after":e="M13.824 10.176h-2.88v-2.88H9.536v2.88h-2.88v1.344h2.88v2.88h1.408v-2.88h2.88zM0 17.92V0h20.48v17.92H0zM6.4 1.28H1.28v3.84H6.4V1.28zm6.4 0H7.68v3.84h5.12V1.28zm6.4 0h-5.12v3.84h5.12V1.28zm0 5.056H1.28v9.024H19.2V6.336z";break;case"table-row-before":e="M6.656 6.464h2.88v2.88h1.408v-2.88h2.88V5.12h-2.88V2.24H9.536v2.88h-2.88zM0 17.92V0h20.48v17.92H0zm7.68-2.56h5.12v-3.84H7.68v3.84zm-6.4 0H6.4v-3.84H1.28v3.84zM19.2 1.28H1.28v9.024H19.2V1.28zm0 10.24h-5.12v3.84h5.12v-3.84z";break;case"table-row-delete":e="M17.728 11.456L14.592 8.32l3.2-3.2-1.536-1.536-3.2 3.2L9.92 3.648 8.384 5.12l3.2 3.2-3.264 3.264 1.536 1.536 3.264-3.264 3.136 3.136 1.472-1.536zM0 17.92V0h20.48v17.92H0zm19.2-6.4h-.448l-1.28-1.28H19.2V6.4h-1.792l1.28-1.28h.512V1.28H1.28v3.84h6.208l1.28 1.28H1.28v3.84h7.424l-1.28 1.28H1.28v3.84H19.2v-3.84z";break;case"tablet":e="M4 2h12c.55 0 1 .45 1 1v14c0 .55-.45 1-1 1H4c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1zm11 14V4H5v12h10zM6 5h6l-6 5V5z";break;case"tag":e="M11 2h7v7L8 19l-7-7zm3 6c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z";break;case"tagcloud":e="M11 3v4H1V3h10zm8 0v4h-7V3h7zM7 8v3H1V8h6zm12 0v3H8V8h11zM9 12v2H1v-2h8zm10 0v2h-9v-2h9zM6 15v1H1v-1h5zm5 0v1H7v-1h4zm3 0v1h-2v-1h2zm5 0v1h-4v-1h4z";break;case"testimonial":e="M4 3h12c.55 0 1.02.2 1.41.59S18 4.45 18 5v7c0 .55-.2 1.02-.59 1.41S16.55 14 16 14h-1l-5 5v-5H4c-.55 0-1.02-.2-1.41-.59S2 12.55 2 12V5c0-.55.2-1.02.59-1.41S3.45 3 4 3zm11 2H4v1h11V5zm1 3H4v1h12V8zm-3 3H4v1h9v-1z";break;case"text":e="M18 3v2H2V3h16zm-6 4v2H2V7h10zm6 0v2h-4V7h4zM8 11v2H2v-2h6zm10 0v2h-8v-2h8zm-4 4v2H2v-2h12z";break;case"thumbs-down":e="M7.28 18c-.15.02-.26-.02-.41-.07-.56-.19-.83-.79-.66-1.35.17-.55 1-3.04 1-3.58 0-.53-.75-1-1.35-1h-3c-.6 0-1-.4-1-1s2-7 2-7c.17-.39.55-1 1-1H14v9h-2.14c-.41.41-3.3 4.71-3.58 5.27-.21.41-.6.68-1 .73zM18 12h-2V3h2v9z";break;case"thumbs-up":e="M12.72 2c.15-.02.26.02.41.07.56.19.83.79.66 1.35-.17.55-1 3.04-1 3.58 0 .53.75 1 1.35 1h3c.6 0 1 .4 1 1s-2 7-2 7c-.17.39-.55 1-1 1H6V8h2.14c.41-.41 3.3-4.71 3.58-5.27.21-.41.6-.68 1-.73zM2 8h2v9H2V8z";break;case"tickets-alt":e="M20 6.38L18.99 9.2v-.01c-.52-.19-1.03-.16-1.53.08s-.85.62-1.04 1.14-.16 1.03.07 1.53c.24.5.62.84 1.15 1.03v.01l-1.01 2.82-15.06-5.38.99-2.79c.52.19 1.03.16 1.53-.08.5-.23.84-.61 1.03-1.13s.16-1.03-.08-1.53c-.23-.49-.61-.83-1.13-1.02L4.93 1zm-4.97 5.69l1.37-3.76c.12-.31.1-.65-.04-.95s-.39-.53-.7-.65L8.14 3.98c-.64-.23-1.37.12-1.6.74L5.17 8.48c-.24.65.1 1.37.74 1.6l7.52 2.74c.14.05.28.08.43.08.52 0 1-.33 1.17-.83zM7.97 4.45l7.51 2.73c.19.07.34.21.43.39.08.18.09.38.02.57l-1.37 3.76c-.13.38-.58.59-.96.45L6.09 9.61c-.39-.14-.59-.57-.45-.96l1.37-3.76c.1-.29.39-.49.7-.49.09 0 .17.02.26.05zm6.82 12.14c.35.27.75.41 1.2.41H16v3H0v-2.96c.55 0 1.03-.2 1.41-.59.39-.38.59-.86.59-1.41s-.2-1.02-.59-1.41-.86-.59-1.41-.59V10h1.05l-.28.8 2.87 1.02c-.51.16-.89.62-.89 1.18v4c0 .69.56 1.25 1.25 1.25h8c.69 0 1.25-.56 1.25-1.25v-1.75l.83.3c.12.43.36.78.71 1.04zM3.25 17v-4c0-.41.34-.75.75-.75h.83l7.92 2.83V17c0 .41-.34.75-.75.75H4c-.41 0-.75-.34-.75-.75z";break;case"tickets":e="M20 5.38L18.99 8.2v-.01c-1.04-.37-2.19.18-2.57 1.22-.37 1.04.17 2.19 1.22 2.56v.01l-1.01 2.82L1.57 9.42l.99-2.79c1.04.38 2.19-.17 2.56-1.21s-.17-2.18-1.21-2.55L4.93 0zm-5.45 3.37c.74-2.08-.34-4.37-2.42-5.12-2.08-.74-4.37.35-5.11 2.42-.74 2.08.34 4.38 2.42 5.12 2.07.74 4.37-.35 5.11-2.42zm-2.56-4.74c.89.32 1.57.94 1.97 1.71-.01-.01-.02-.01-.04-.02-.33-.12-.67.09-.78.4-.1.28-.03.57.05.91.04.27.09.62-.06 1.04-.1.29-.33.58-.65 1l-.74 1.01.08-4.08.4.11c.19.04.26-.24.08-.29 0 0-.57-.15-.92-.28-.34-.12-.88-.36-.88-.36-.18-.08-.3.19-.12.27 0 0 .16.08.34.16l.01 1.63L9.2 9.18l.08-4.11c.2.06.4.11.4.11.19.04.26-.23.07-.29 0 0-.56-.15-.91-.28-.07-.02-.14-.05-.22-.08.93-.7 2.19-.94 3.37-.52zM7.4 6.19c.17-.49.44-.92.78-1.27l.04 5c-.94-.95-1.3-2.39-.82-3.73zm4.04 4.75l2.1-2.63c.37-.41.57-.77.69-1.12.05-.12.08-.24.11-.35.09.57.04 1.18-.17 1.77-.45 1.25-1.51 2.1-2.73 2.33zm-.7-3.22l.02 3.22c0 .02 0 .04.01.06-.4 0-.8-.07-1.2-.21-.33-.12-.63-.28-.9-.48zm1.24 6.08l2.1.75c.24.84 1 1.45 1.91 1.45H16v3H0v-2.96c1.1 0 2-.89 2-2 0-1.1-.9-2-2-2V9h1.05l-.28.8 4.28 1.52C4.4 12.03 4 12.97 4 14c0 2.21 1.79 4 4 4s4-1.79 4-4c0-.07-.02-.13-.02-.2zm-6.53-2.33l1.48.53c-.14.04-.15.27.03.28 0 0 .18.02.37.03l.56 1.54-.78 2.36-1.31-3.9c.21-.01.41-.03.41-.03.19-.02.17-.31-.02-.3 0 0-.59.05-.96.05-.07 0-.15 0-.23-.01.13-.2.28-.38.45-.55zM4.4 14c0-.52.12-1.02.32-1.46l1.71 4.7C5.23 16.65 4.4 15.42 4.4 14zm4.19-1.41l1.72.62c.07.17.12.37.12.61 0 .31-.12.66-.28 1.16l-.35 1.2zM11.6 14c0 1.33-.72 2.49-1.79 3.11l1.1-3.18c.06-.17.1-.31.14-.46l.52.19c.02.11.03.22.03.34zm-4.62 3.45l1.08-3.14 1.11 3.03c.01.02.01.04.02.05-.37.13-.77.21-1.19.21-.35 0-.69-.06-1.02-.15z";break;case"tide":e="M17 7.2V3H3v7.1c2.6-.5 4.5-1.5 6.4-2.6.2-.2.4-.3.6-.5v3c-1.9 1.1-4 2.2-7 2.8V17h14V9.9c-2.6.5-4.4 1.5-6.2 2.6-.3.1-.5.3-.8.4V10c2-1.1 4-2.2 7-2.8z";break;case"translation":e="M11 7H9.49c-.63 0-1.25.3-1.59.7L7 5H4.13l-2.39 7h1.69l.74-2H7v4H2c-1.1 0-2-.9-2-2V5c0-1.1.9-2 2-2h7c1.1 0 2 .9 2 2v2zM6.51 9H4.49l1-2.93zM10 8h7c1.1 0 2 .9 2 2v7c0 1.1-.9 2-2 2h-7c-1.1 0-2-.9-2-2v-7c0-1.1.9-2 2-2zm7.25 5v-1.08h-3.17V9.75h-1.16v2.17H9.75V13h1.28c.11.85.56 1.85 1.28 2.62-.87.36-1.89.62-2.31.62-.01.02.22.97.2 1.46.84 0 2.21-.5 3.28-1.15 1.09.65 2.48 1.15 3.34 1.15-.02-.49.2-1.44.2-1.46-.43 0-1.49-.27-2.38-.63.7-.77 1.14-1.77 1.25-2.61h1.36zm-3.81 1.93c-.5-.46-.85-1.13-1.01-1.93h2.09c-.17.8-.51 1.47-1 1.93l-.04.03s-.03-.02-.04-.03z";break;case"trash":e="M12 4h3c.6 0 1 .4 1 1v1H3V5c0-.6.5-1 1-1h3c.2-1.1 1.3-2 2.5-2s2.3.9 2.5 2zM8 4h3c-.2-.6-.9-1-1.5-1S8.2 3.4 8 4zM4 7h11l-.9 10.1c0 .5-.5.9-1 .9H5.9c-.5 0-.9-.4-1-.9L4 7z";break;case"twitter":e="M18.94 4.46c-.49.73-1.11 1.38-1.83 1.9.01.15.01.31.01.47 0 4.85-3.69 10.44-10.43 10.44-2.07 0-4-.61-5.63-1.65.29.03.58.05.88.05 1.72 0 3.3-.59 4.55-1.57-1.6-.03-2.95-1.09-3.42-2.55.22.04.45.07.69.07.33 0 .66-.05.96-.13-1.67-.34-2.94-1.82-2.94-3.6v-.04c.5.27 1.06.44 1.66.46-.98-.66-1.63-1.78-1.63-3.06 0-.67.18-1.3.5-1.84 1.81 2.22 4.51 3.68 7.56 3.83-.06-.27-.1-.55-.1-.84 0-2.02 1.65-3.66 3.67-3.66 1.06 0 2.01.44 2.68 1.16.83-.17 1.62-.47 2.33-.89-.28.85-.86 1.57-1.62 2.02.75-.08 1.45-.28 2.11-.57z";break;case"undo":e="M12 5H7V2L1 6l6 4V7h5c2.2 0 4 1.8 4 4s-1.8 4-4 4H7v2h5c3.3 0 6-2.7 6-6s-2.7-6-6-6z";break;case"universal-access-alt":e="M19 10c0-4.97-4.03-9-9-9s-9 4.03-9 9 4.03 9 9 9 9-4.03 9-9zm-9-7.4c.83 0 1.5.67 1.5 1.5s-.67 1.51-1.5 1.51c-.82 0-1.5-.68-1.5-1.51s.68-1.5 1.5-1.5zM3.4 7.36c0-.65 6.6-.76 6.6-.76s6.6.11 6.6.76-4.47 1.4-4.47 1.4 1.69 8.14 1.06 8.38c-.62.24-3.19-5.19-3.19-5.19s-2.56 5.43-3.18 5.19c-.63-.24 1.06-8.38 1.06-8.38S3.4 8.01 3.4 7.36z";break;case"universal-access":e="M10 2.6c.83 0 1.5.67 1.5 1.5s-.67 1.51-1.5 1.51c-.82 0-1.5-.68-1.5-1.51s.68-1.5 1.5-1.5zM3.4 7.36c0-.65 6.6-.76 6.6-.76s6.6.11 6.6.76-4.47 1.4-4.47 1.4 1.69 8.14 1.06 8.38c-.62.24-3.19-5.19-3.19-5.19s-2.56 5.43-3.18 5.19c-.63-.24 1.06-8.38 1.06-8.38S3.4 8.01 3.4 7.36z";break;case"unlock":e="M12 9V6c0-1.1-.9-2-2-2s-2 .9-2 2H6c0-2.21 1.79-4 4-4s4 1.79 4 4v3h1c.55 0 1 .45 1 1v7c0 .55-.45 1-1 1H5c-.55 0-1-.45-1-1v-7c0-.55.45-1 1-1h7zm-1 7l-.36-2.15c.51-.24.86-.75.86-1.35 0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5c0 .6.35 1.11.86 1.35L9 16h2z";break;case"update":e="M10.2 3.28c3.53 0 6.43 2.61 6.92 6h2.08l-3.5 4-3.5-4h2.32c-.45-1.97-2.21-3.45-4.32-3.45-1.45 0-2.73.71-3.54 1.78L4.95 5.66C6.23 4.2 8.11 3.28 10.2 3.28zm-.4 13.44c-3.52 0-6.43-2.61-6.92-6H.8l3.5-4c1.17 1.33 2.33 2.67 3.5 4H5.48c.45 1.97 2.21 3.45 4.32 3.45 1.45 0 2.73-.71 3.54-1.78l1.71 1.95c-1.28 1.46-3.15 2.38-5.25 2.38z";break;case"upload":e="M8 14V8H5l5-6 5 6h-3v6H8zm-2 2v-6H4v8h12.01v-8H14v6H6z";break;case"vault":e="M18 17V3c0-.55-.45-1-1-1H3c-.55 0-1 .45-1 1v14c0 .55.45 1 1 1h14c.55 0 1-.45 1-1zm-1 0H3V3h14v14zM4.75 4h10.5c.41 0 .75.34.75.75V6h-1v3h1v2h-1v3h1v1.25c0 .41-.34.75-.75.75H4.75c-.41 0-.75-.34-.75-.75V4.75c0-.41.34-.75.75-.75zM13 10c0-2.21-1.79-4-4-4s-4 1.79-4 4 1.79 4 4 4 4-1.79 4-4zM9 7l.77 1.15C10.49 8.46 11 9.17 11 10c0 1.1-.9 2-2 2s-2-.9-2-2c0-.83.51-1.54 1.23-1.85z";break;case"video-alt":e="M8 5c0-.55-.45-1-1-1H2c-.55 0-1 .45-1 1 0 .57.49 1 1 1h5c.55 0 1-.45 1-1zm6 5l4-4v10l-4-4v-2zm-1 4V8c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h8c.55 0 1-.45 1-1z";break;case"video-alt2":e="M12 13V7c0-1.1-.9-2-2-2H3c-1.1 0-2 .9-2 2v6c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2zm1-2.5l6 4.5V5l-6 4.5v1z";break;case"video-alt3":e="M19 15V5c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2zM8 14V6l6 4z";break;case"visibility":e="M19.7 9.4C17.7 6 14 3.9 10 3.9S2.3 6 .3 9.4L0 10l.3.6c2 3.4 5.7 5.5 9.7 5.5s7.7-2.1 9.7-5.5l.3-.6-.3-.6zM10 14.1c-3.1 0-6-1.6-7.7-4.1C3.6 8 5.7 6.6 8 6.1c-.9.6-1.5 1.7-1.5 2.9 0 1.9 1.6 3.5 3.5 3.5s3.5-1.6 3.5-3.5c0-1.2-.6-2.3-1.5-2.9 2.3.5 4.4 1.9 5.7 3.9-1.7 2.5-4.6 4.1-7.7 4.1z";break;case"warning":e="M10 2c4.42 0 8 3.58 8 8s-3.58 8-8 8-8-3.58-8-8 3.58-8 8-8zm1.13 9.38l.35-6.46H8.52l.35 6.46h2.26zm-.09 3.36c.24-.23.37-.55.37-.96 0-.42-.12-.74-.36-.97s-.59-.35-1.06-.35-.82.12-1.07.35-.37.55-.37.97c0 .41.13.73.38.96.26.23.61.34 1.06.34s.8-.11 1.05-.34z";break;case"welcome-add-page":e="M17 7V4h-2V2h-3v1H3v15h11V9h1V7h2zm-1-2v1h-2v2h-1V6h-2V5h2V3h1v2h2z";break;case"welcome-comments":e="M5 2h10c1.1 0 2 .9 2 2v8c0 1.1-.9 2-2 2h-2l-5 5v-5H5c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2zm8.5 8.5L11 8l2.5-2.5-1-1L10 7 7.5 4.5l-1 1L9 8l-2.5 2.5 1 1L10 9l2.5 2.5z";break;case"welcome-learn-more":e="M10 10L2.54 7.02 3 18H1l.48-11.41L0 6l10-4 10 4zm0-5c-.55 0-1 .22-1 .5s.45.5 1 .5 1-.22 1-.5-.45-.5-1-.5zm0 6l5.57-2.23c.71.94 1.2 2.07 1.36 3.3-.3-.04-.61-.07-.93-.07-2.55 0-4.78 1.37-6 3.41C8.78 13.37 6.55 12 4 12c-.32 0-.63.03-.93.07.16-1.23.65-2.36 1.36-3.3z";break;case"welcome-view-site":e="M18 14V4c0-.55-.45-1-1-1H3c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h14c.55 0 1-.45 1-1zm-8-8c2.3 0 4.4 1.14 6 3-1.6 1.86-3.7 3-6 3s-4.4-1.14-6-3c1.6-1.86 3.7-3 6-3zm2 3c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2zm2 8h3v1H3v-1h3v-1h8v1z";break;case"welcome-widgets-menus":e="M19 16V3c0-.55-.45-1-1-1H3c-.55 0-1 .45-1 1v13c0 .55.45 1 1 1h15c.55 0 1-.45 1-1zM4 4h13v4H4V4zm1 1v2h3V5H5zm4 0v2h3V5H9zm4 0v2h3V5h-3zm-8.5 5c.28 0 .5.22.5.5s-.22.5-.5.5-.5-.22-.5-.5.22-.5.5-.5zM6 10h4v1H6v-1zm6 0h5v5h-5v-5zm-7.5 2c.28 0 .5.22.5.5s-.22.5-.5.5-.5-.22-.5-.5.22-.5.5-.5zM6 12h4v1H6v-1zm7 0v2h3v-2h-3zm-8.5 2c.28 0 .5.22.5.5s-.22.5-.5.5-.5-.22-.5-.5.22-.5.5-.5zM6 14h4v1H6v-1z";break;case"welcome-write-blog":e="M16.89 1.2l1.41 1.41c.39.39.39 1.02 0 1.41L14 8.33V18H3V3h10.67l1.8-1.8c.4-.39 1.03-.4 1.42 0zm-5.66 8.48l5.37-5.36-1.42-1.42-5.36 5.37-.71 2.12z";break;case"wordpress-alt":e="M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z";break;case"wordpress":e="M20 10c0-5.52-4.48-10-10-10S0 4.48 0 10s4.48 10 10 10 10-4.48 10-10zM10 1.01c4.97 0 8.99 4.02 8.99 8.99s-4.02 8.99-8.99 8.99S1.01 14.97 1.01 10 5.03 1.01 10 1.01zM8.01 14.82L4.96 6.61c.49-.03 1.05-.08 1.05-.08.43-.05.38-1.01-.06-.99 0 0-1.29.1-2.13.1-.15 0-.33 0-.52-.01 1.44-2.17 3.9-3.6 6.7-3.6 2.09 0 3.99.79 5.41 2.09-.6-.08-1.45.35-1.45 1.42 0 .66.38 1.22.79 1.88.31.54.5 1.22.5 2.21 0 1.34-1.27 4.48-1.27 4.48l-2.71-7.5c.48-.03.75-.16.75-.16.43-.05.38-1.1-.05-1.08 0 0-1.3.11-2.14.11-.78 0-2.11-.11-2.11-.11-.43-.02-.48 1.06-.05 1.08l.84.08 1.12 3.04zm6.02 2.15L16.64 10s.67-1.69.39-3.81c.63 1.14.94 2.42.94 3.81 0 2.96-1.56 5.58-3.94 6.97zM2.68 6.77L6.5 17.25c-2.67-1.3-4.47-4.08-4.47-7.25 0-1.16.2-2.23.65-3.23zm7.45 4.53l2.29 6.25c-.75.27-1.57.42-2.42.42-.72 0-1.41-.11-2.06-.3z";break;case"yes-alt":e="M10 2c-4.42 0-8 3.58-8 8s3.58 8 8 8 8-3.58 8-8-3.58-8-8-8zm-.615 12.66h-1.34l-3.24-4.54 1.34-1.25 2.57 2.4 5.14-5.93 1.34.94-5.81 8.38z";break;case"yes":e="M14.83 4.89l1.34.94-5.81 8.38H9.02L5.78 9.67l1.34-1.25 2.57 2.4z"}if(!e)return null;var l=["dashicon","dashicons-"+t,s].filter(Boolean).join(" ");return Object(h.createElement)(v.b,Object(r.a)({"aria-hidden":!0,role:"img",focusable:"false",className:l,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 20 20"},i),Object(h.createElement)(v.a,{d:e}))}}]),c}(h.Component)},760:function(e,c,t){"use strict";function r(e){return(r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e){return(n="function"===typeof Symbol&&"symbol"===r(Symbol.iterator)?function(e){return r(e)}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":r(e)})(e)}t.d(c,"a",function(){return n})},761:function(e,c,t){e.exports=function(e,c){var t,r,n=0;function a(){var a,o,s=t,i=arguments.length;e:for(;s;){if(s.args.length===arguments.length){for(o=0;o<i;o++)if(s.args[o]!==arguments[o]){s=s.next;continue e}return s!==t&&(s===r&&(r=s.prev),s.prev.next=s.next,s.next&&(s.next.prev=s.prev),s.next=t,s.prev=null,t.prev=s,t=s),s.val}s=s.next}for(a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return s={args:a,val:e.apply(null,a)},t?(t.prev=s,s.next=t):r=s,n===c.maxSize?(r=r.prev).next=null:n++,t=s,s.val}return c=c||{},a.clear=function(){t=null,r=null,n=0},a}},762:function(e,c,t){!function(){"use strict";var e={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function t(c){return function(c,r){var n,a,o,s,i,l,h,v,u,z=1,m=c.length,b="";for(a=0;a<m;a++)if("string"===typeof c[a])b+=c[a];else if("object"===typeof c[a]){if((s=c[a]).keys)for(n=r[z],o=0;o<s.keys.length;o++){if(void 0==n)throw new Error(t('[sprintf] Cannot access property "%s" of undefined value "%s"',s.keys[o],s.keys[o-1]));n=n[s.keys[o]]}else n=s.param_no?r[s.param_no]:r[z++];if(e.not_type.test(s.type)&&e.not_primitive.test(s.type)&&n instanceof Function&&(n=n()),e.numeric_arg.test(s.type)&&"number"!==typeof n&&isNaN(n))throw new TypeError(t("[sprintf] expecting number but found %T",n));switch(e.number.test(s.type)&&(v=n>=0),s.type){case"b":n=parseInt(n,10).toString(2);break;case"c":n=String.fromCharCode(parseInt(n,10));break;case"d":case"i":n=parseInt(n,10);break;case"j":n=JSON.stringify(n,null,s.width?parseInt(s.width):0);break;case"e":n=s.precision?parseFloat(n).toExponential(s.precision):parseFloat(n).toExponential();break;case"f":n=s.precision?parseFloat(n).toFixed(s.precision):parseFloat(n);break;case"g":n=s.precision?String(Number(n.toPrecision(s.precision))):parseFloat(n);break;case"o":n=(parseInt(n,10)>>>0).toString(8);break;case"s":n=String(n),n=s.precision?n.substring(0,s.precision):n;break;case"t":n=String(!!n),n=s.precision?n.substring(0,s.precision):n;break;case"T":n=Object.prototype.toString.call(n).slice(8,-1).toLowerCase(),n=s.precision?n.substring(0,s.precision):n;break;case"u":n=parseInt(n,10)>>>0;break;case"v":n=n.valueOf(),n=s.precision?n.substring(0,s.precision):n;break;case"x":n=(parseInt(n,10)>>>0).toString(16);break;case"X":n=(parseInt(n,10)>>>0).toString(16).toUpperCase()}e.json.test(s.type)?b+=n:(!e.number.test(s.type)||v&&!s.sign?u="":(u=v?"+":"-",n=n.toString().replace(e.sign,"")),l=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",h=s.width-(u+n).length,i=s.width&&h>0?l.repeat(h):"",b+=s.align?u+n+i:"0"===l?u+i+n:i+u+n)}return b}(function(c){if(n[c])return n[c];var t,r=c,a=[],o=0;for(;r;){if(null!==(t=e.text.exec(r)))a.push(t[0]);else if(null!==(t=e.modulo.exec(r)))a.push("%");else{if(null===(t=e.placeholder.exec(r)))throw new SyntaxError("[sprintf] unexpected placeholder");if(t[2]){o|=1;var s=[],i=t[2],l=[];if(null===(l=e.key.exec(i)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(s.push(l[1]);""!==(i=i.substring(l[0].length));)if(null!==(l=e.key_access.exec(i)))s.push(l[1]);else{if(null===(l=e.index_access.exec(i)))throw new SyntaxError("[sprintf] failed to parse named argument key");s.push(l[1])}t[2]=s}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");a.push({placeholder:t[0],param_no:t[1],keys:t[2],sign:t[3],pad_char:t[4],align:t[5],width:t[6],precision:t[7],type:t[8]})}r=r.substring(t[0].length)}return n[c]=a}(c),arguments)}function r(e,c){return t.apply(null,[e].concat(c||[]))}var n=Object.create(null);c.sprintf=t,c.vsprintf=r,window.sprintf=t,window.vsprintf=r,"function"===typeof define&&define.amd&&define(function(){return{sprintf:t,vsprintf:r}})}()},781:function(e,c,t){"use strict";t.d(c,"a",function(){return H});var r=t(761),n=t.n(r);t(762),n()(console.error);var a,o,s,i,l=t(642);a={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},o=["(","?"],s={")":["("],":":["?","?:"]},i=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;var h={"!":function(e){return!e},"*":function(e,c){return e*c},"/":function(e,c){return e/c},"%":function(e,c){return e%c},"+":function(e,c){return e+c},"-":function(e,c){return e-c},"<":function(e,c){return e<c},"<=":function(e,c){return e<=c},">":function(e,c){return e>c},">=":function(e,c){return e>=c},"==":function(e,c){return e===c},"!=":function(e,c){return e!==c},"&&":function(e,c){return e&&c},"||":function(e,c){return e||c},"?:":function(e,c,t){if(e)throw c;return t}};function v(e){var c=function(e){for(var c,t,r,n,l=[],h=[];c=e.match(i);){for(t=c[0],(r=e.substr(0,c.index).trim())&&l.push(r);n=h.pop();){if(s[t]){if(s[t][0]===n){t=s[t][1]||t;break}}else if(o.indexOf(n)>=0||a[n]<a[t]){h.push(n);break}l.push(n)}s[t]||h.push(t),e=e.substr(c.index+t.length)}return(e=e.trim())&&l.push(e),l.concat(h.reverse())}(e);return function(e){return function(e,c){var t,r,n,a,o,s,i=[];for(t=0;t<e.length;t++){if(o=e[t],a=h[o]){for(r=a.length,n=Array(r);r--;)n[r]=i.pop();try{s=a.apply(null,n)}catch(l){return l}}else s=c.hasOwnProperty(o)?c[o]:+o;i.push(s)}return i[0]}(c,e)}}var u={contextDelimiter:"\x04",onMissingKey:null};function z(e,c){var t;for(t in this.data=e,this.pluralForms={},this.options={},u)this.options[t]=void 0!==c&&t in c?c[t]:u[t]}function m(e,c){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);c&&(r=r.filter(function(c){return Object.getOwnPropertyDescriptor(e,c).enumerable})),t.push.apply(t,r)}return t}function b(e){for(var c=1;c<arguments.length;c++){var t=null!=arguments[c]?arguments[c]:{};c%2?m(Object(t),!0).forEach(function(c){Object(l.a)(e,c,t[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):m(Object(t)).forEach(function(c){Object.defineProperty(e,c,Object.getOwnPropertyDescriptor(t,c))})}return e}z.prototype.getPluralForm=function(e,c){var t,r,n,a=this.pluralForms[e];return a||("function"!==typeof(n=(t=this.data[e][""])["Plural-Forms"]||t["plural-forms"]||t.plural_forms)&&(r=function(e){var c,t,r;for(c=e.split(";"),t=0;t<c.length;t++)if(0===(r=c[t].trim()).indexOf("plural="))return r.substr(7)}(t["Plural-Forms"]||t["plural-forms"]||t.plural_forms),n=function(e){var c=v(e);return function(e){return+c({n:e})}}(r)),a=this.pluralForms[e]=n),a(c)},z.prototype.dcnpgettext=function(e,c,t,r,n){var a,o,s;return a=void 0===n?0:this.getPluralForm(e,n),o=t,c&&(o=c+this.options.contextDelimiter+t),(s=this.data[e][o])&&s[a]?s[a]:(this.options.onMissingKey&&this.options.onMissingKey(t,e),0===a?t:r)};var d={"":{plural_forms:function(e){return 1===e?0:1}}},f=function(e,c){var t=new z({}),r=function(e){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default";t.data[c]=b({},d,{},t.data[c],{},e),t.data[c][""]=b({},d[""],{},t.data[c][""])},n=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",c=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;return t.data[e]||r(void 0,e),t.dcnpgettext(e,c,n,a,o)},a=function(e,c,t){return n(t,c,e)};return e&&r(e,c),{setLocaleData:r,__:function(e,c){return n(c,void 0,e)},_x:a,_n:function(e,c,t,r){return n(r,void 0,e,c,t)},_nx:function(e,c,t,r,a){return n(a,r,e,c,t)},isRTL:function(){return"rtl"===a("ltr","text direction")}}}(),H=(f.setLocaleData.bind(f),f.__.bind(f));f._x.bind(f),f._n.bind(f),f._nx.bind(f),f.isRTL.bind(f)},783:function(e,c,t){"use strict";t.d(c,"a",function(){return o}),t.d(c,"b",function(){return s});var r=t(612),n=t(1),a=t(10),o=function(e){return Object(a.createElement)("path",e)},s=function(e){var c=Object(r.a)({},e,{role:"img","aria-hidden":"true",focusable:"false"});return Object(a.createElement)("svg",Object(n.omit)(c,"__unstableActive"))}},788:function(e,c,t){"use strict";var r={};t.r(r),t.d(r,"find",function(){return O});var n={};t.r(n),t.d(n,"isTabbableIndex",function(){return y}),t.d(n,"find",function(){return x}),t.d(n,"findPrevious",function(){return E}),t.d(n,"findNext",function(){return _});var a=t(569),o=t(570),s=t(571),i=t(572),l=t(574),h=t(10),v=t(1),u=t(612),z=t(573);function m(){for(var e=arguments.length,c=new Array(e),t=0;t<e;t++)c[t]=arguments[t];return c.reduce(function(e,c,t){return h.Children.forEach(c,function(c,r){c&&"string"!==typeof c&&(c=Object(h.cloneElement)(c,{key:[t,r].join()})),e.push(c)}),e},[])}var b=t(37);function d(e,c){return function(e){if(Array.isArray(e))return e}(e)||function(e,c){var t=[],r=!0,n=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(t.push(o.value),!c||t.length!==c);r=!0);}catch(i){n=!0,a=i}finally{try{r||null==s.return||s.return()}finally{if(n)throw a}}return t}(e,c)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var f=t(526),H=t.n(f),p=window,M=(p.DOMParser,p.getComputedStyle,window.Node);M.TEXT_NODE,M.ELEMENT_NODE,M.DOCUMENT_POSITION_PRECEDING,M.DOCUMENT_POSITION_FOLLOWING;function V(e){if(!e.collapsed)return e.getBoundingClientRect();var c=e.startContainer;if("BR"===c.nodeName){var t=c.parentNode,r=Array.from(t.childNodes).indexOf(c);(e=document.createRange()).setStart(t,r),e.setEnd(t,r)}var n=e.getClientRects()[0];if(!n){var a=document.createTextNode("\u200b");(e=e.cloneRange()).insertNode(a),n=e.getClientRects()[0],a.parentNode.removeChild(a)}return n}var k=["[tabindex]","a[href]","button:not([disabled])",'input:not([type="hidden"]):not([disabled])',"select:not([disabled])","textarea:not([disabled])","iframe","object","embed","area[href]","[contenteditable]:not([contenteditable=false])"].join(",");function g(e){return e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0}function O(e){var c=e.querySelectorAll(k);return Array.from(c).filter(function(e){return!(!g(e)||function(e){return"iframe"===e.nodeName.toLowerCase()&&"-1"===e.getAttribute("tabindex")}(e))&&("AREA"!==e.nodeName||function(e){var c=e.closest("map[name]");if(!c)return!1;var t=document.querySelector('img[usemap="#'+c.name+'"]');return!!t&&g(t)}(e))})}function L(e){var c=e.getAttribute("tabindex");return null===c?0:parseInt(c,10)}function y(e){return-1!==L(e)}function j(e,c){return{element:e,index:c}}function w(e){return e.element}function C(e,c){var t=L(e.element),r=L(c.element);return t===r?e.index-c.index:t-r}function S(e){return e.filter(y).map(j).sort(C).map(w).reduce(function(){var e={};return function(c,t){var r=t.nodeName,n=t.type,a=t.checked,o=t.name;if("INPUT"!==r||"radio"!==n||!o)return c.concat(t);var s=e.hasOwnProperty(o);if(!a&&s)return c;if(s){var i=e[o];c=Object(v.without)(c,i)}return e[o]=t,c.concat(t)}}(),[])}function x(e){return S(O(e))}function E(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.activeElement,c=O(document.body),t=c.indexOf(e);return c.length=t,Object(v.last)(S(c))}function _(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.activeElement,c=O(document.body),t=c.indexOf(e),r=c.slice(t+1).filter(function(c){return!e.contains(c)});return Object(v.first)(S(r))}var F={focusable:r,tabbable:n},T=t(642),A=t(630),N=t(781);function I(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window).navigator.platform;return-1!==e.indexOf("Mac")||Object(v.includes)(["iPad","iPhone"],e)}var P="alt",B="ctrl",D="meta",R="shift",W={primary:function(e){return e()?[D]:[B]},primaryShift:function(e){return e()?[R,D]:[B,R]},primaryAlt:function(e){return e()?[P,D]:[B,P]},secondary:function(e){return e()?[R,P,D]:[B,R,P]},access:function(e){return e()?[B,P]:[R,P]},ctrl:function(){return[B]},alt:function(){return[P]},ctrlShift:function(){return[B,R]},shift:function(){return[R]},shiftAlt:function(){return[R,P]}},Z=(Object(v.mapValues)(W,function(e){return function(c){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:I;return[].concat(Object(A.a)(e(t)),[c.toLowerCase()]).join("+")}}),Object(v.mapValues)(W,function(e){return function(c){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:I,n=r(),a=(t={},Object(T.a)(t,P,n?"\u2325":"Alt"),Object(T.a)(t,B,n?"^":"Ctrl"),Object(T.a)(t,D,"\u2318"),Object(T.a)(t,R,n?"\u21e7":"Shift"),t),o=e(r).reduce(function(e,c){var t=Object(v.get)(a,c,c);return[].concat(Object(A.a)(e),n?[t]:[t,"+"])},[]),s=Object(v.capitalize)(c);return[].concat(Object(A.a)(o),[s])}}));Object(v.mapValues)(Z,function(e){return function(c){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:I;return e(c,t).join("")}}),Object(v.mapValues)(W,function(e){return function(c){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:I,n=r(),a=(t={},Object(T.a)(t,R,"Shift"),Object(T.a)(t,D,n?"Command":"Control"),Object(T.a)(t,B,"Control"),Object(T.a)(t,P,n?"Option":"Alt"),Object(T.a)(t,",",Object(N.a)("Comma")),Object(T.a)(t,".",Object(N.a)("Period")),Object(T.a)(t,"`",Object(N.a)("Backtick")),t);return[].concat(Object(A.a)(e(r)),[c]).map(function(e){return Object(v.capitalize)(Object(v.get)(a,e,e))}).join(n?" ":" + ")}});Object(v.mapValues)(W,function(e){return function(c,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:I,n=e(r),a=function(e){return[P,B,D,R].filter(function(c){return e["".concat(c,"Key")]})}(c);return!Object(v.xor)(n,a).length&&(t?c.key===t:Object(v.includes)(n,c.key.toLowerCase()))}});var U=function(e){return"string"!==typeof e||""===e?(console.error("The namespace must be a non-empty string."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(e)||(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)};var K=function(e){return"string"!==typeof e||""===e?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(e)?(console.error("The hook name cannot begin with `__`."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(e)||(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)};var q=function(e){return function(c,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10;if(K(c)&&U(t))if("function"===typeof r)if("number"===typeof n){var a={callback:r,priority:n,namespace:t};if(e[c]){var o,s=e[c].handlers;for(o=s.length;o>0&&!(n>=s[o-1].priority);o--);o===s.length?s[o]=a:s.splice(o,0,a),(e.__current||[]).forEach(function(e){e.name===c&&e.currentIndex>=o&&e.currentIndex++})}else e[c]={handlers:[a],runs:0};"hookAdded"!==c&&ce("hookAdded",c,t,r,n)}else console.error("If specified, the hook priority must be a number.");else console.error("The hook callback must be a function.")}};var X=function(e,c){return function(t,r){if(K(t)&&(c||U(r))){if(!e[t])return 0;var n=0;if(c)n=e[t].handlers.length,e[t]={runs:e[t].runs,handlers:[]};else for(var a=e[t].handlers,o=function(c){a[c].namespace===r&&(a.splice(c,1),n++,(e.__current||[]).forEach(function(e){e.name===t&&e.currentIndex>=c&&e.currentIndex--}))},s=a.length-1;s>=0;s--)o(s);return"hookRemoved"!==t&&ce("hookRemoved",t,r),n}}};var $=function(e){return function(c,t){return"undefined"!==typeof t?c in e&&e[c].handlers.some(function(e){return e.namespace===t}):c in e}};var J=function(e,c){return function(t){e[t]||(e[t]={handlers:[],runs:0}),e[t].runs++;for(var r=e[t].handlers,n=arguments.length,a=new Array(n>1?n-1:0),o=1;o<n;o++)a[o-1]=arguments[o];if(!r||!r.length)return c?a[0]:void 0;var s={name:t,currentIndex:0};for(e.__current.push(s);s.currentIndex<r.length;){var i=r[s.currentIndex].callback.apply(null,a);c&&(a[0]=i),s.currentIndex++}return e.__current.pop(),c?a[0]:void 0}};var G=function(e){return function(){return e.__current&&e.__current.length?e.__current[e.__current.length-1].name:null}};var Q=function(e){return function(c){return"undefined"===typeof c?"undefined"!==typeof e.__current[0]:!!e.__current[0]&&c===e.__current[0].name}};var Y=function(e){return function(c){if(K(c))return e[c]&&e[c].runs?e[c].runs:0}};var ee=function(){var e=Object.create(null),c=Object.create(null);return e.__current=[],c.__current=[],{addAction:q(e),addFilter:q(c),removeAction:X(e),removeFilter:X(c),hasAction:$(e),hasFilter:$(c),removeAllActions:X(e,!0),removeAllFilters:X(c,!0),doAction:J(e),applyFilters:J(c,!0),currentAction:G(e),currentFilter:G(c),doingAction:Q(e),doingFilter:Q(c),didAction:Y(e),didFilter:Y(c),actions:e,filters:c}}(),ce=(ee.addAction,ee.addFilter,ee.removeAction,ee.removeFilter,ee.hasAction,ee.hasFilter,ee.removeAllActions,ee.removeAllFilters,ee.doAction),te=(ee.applyFilters,ee.currentAction,ee.currentFilter,ee.doingAction,ee.doingFilter,ee.didAction,ee.didFilter,ee.actions,ee.filters,Object.create(null));var re={huge:1440,wide:1280,large:960,medium:782,small:600,mobile:480},ne={">=":"min-width","<":"max-width"},ae={">=":function(e,c){return c>=e},"<":function(e,c){return c<e}},oe=Object(h.createContext)(null),se=function(e){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:">=",t=Object(h.useContext)(oe),r=function(e){var c=d(Object(h.useState)(e&&window.matchMedia(e).matches),2),t=c[0],r=c[1];return Object(h.useEffect)(function(){if(e){var c=function(){return r(window.matchMedia(e).matches)};c();var t=window.matchMedia(e);return t.addListener(c),function(){t.removeListener(c)}}},[e]),e&&t}(!t&&"(".concat(ne[c],": ").concat(re[e],"px)"));return t?ae[c](re[e],t):r};se.__experimentalWidthProvider=oe.Provider;var ie=se,le=10,he=function(){return"rtl"===document.documentElement.dir};function ve(e,c){var t=d((arguments.length>2&&void 0!==arguments[2]?arguments[2]:"top").split(" "),2),r=t[0],n=t[1],a=void 0===n?"center":n,o=function(e,c,t){var r,n=c.height,a=e.top+e.height/2,o={popoverTop:a,contentHeight:(a-n/2>0?n/2:a)+(a+n/2>window.innerHeight?window.innerHeight-a:n/2)},s={popoverTop:e.top,contentHeight:e.top-le-n>0?n:e.top-le},i={popoverTop:e.bottom,contentHeight:e.bottom+le+n>window.innerHeight?window.innerHeight-le-e.bottom:n},l=null;if("middle"===t&&o.contentHeight===n)r="middle";else if("top"===t&&s.contentHeight===n)r="top";else if("bottom"===t&&i.contentHeight===n)r="bottom";else{var h="top"===(r=s.contentHeight>i.contentHeight?"top":"bottom")?s.contentHeight:i.contentHeight;l=h!==n?h:null}return{yAxis:r,popoverTop:"middle"===r?o.popoverTop:"top"===r?s.popoverTop:i.popoverTop,contentHeight:l}}(e,c,r),s=function(e,c,t,r){var n=c.width;"left"===t&&he()?t="right":"right"===t&&he()&&(t="left");var a,o=Math.round(e.left+e.width/2),s={popoverLeft:o,contentWidth:(o-n/2>0?n/2:o)+(o+n/2>window.innerWidth?window.innerWidth-o:n/2)},i="middle"===r?e.left:o,l={popoverLeft:i,contentWidth:i-n>0?n:i},h="middle"===r?e.right:o,v={popoverLeft:h,contentWidth:h+n>window.innerWidth?window.innerWidth-h:n},u=null;if("center"===t&&s.contentWidth===n)a="center";else if("left"===t&&l.contentWidth===n)a="left";else if("right"===t&&v.contentWidth===n)a="right";else{var z="left"===(a=l.contentWidth>v.contentWidth?"left":"right")?l.contentWidth:v.contentWidth;u=z!==n?z:null}return{xAxis:a,popoverLeft:"center"===a?s.popoverLeft:"left"===a?l.popoverLeft:v.popoverLeft,contentWidth:u}}(e,c,a,o.yAxis);return Object(u.a)({},s,o)}var ue=t(648),ze=t(78),me=Object(h.createContext)({focusHistory:[]}),be=me.Provider,de=me.Consumer;be.displayName="FocusReturnProvider",de.displayName="FocusReturnConsumer";h.Component;var fe=Object(ue.a)(function e(c){if((r=c)instanceof h.Component||"function"===typeof r){var t=c;return e({})(t)}var r,n=c.onFocusReturn,u=void 0===n?v.stubTrue:n;return function(e){var c=function(c){function t(){var e;return Object(a.a)(this,t),(e=Object(s.a)(this,Object(i.a)(t).apply(this,arguments))).ownFocusedElements=new Set,e.activeElementOnMount=document.activeElement,e.setIsFocusedFalse=function(){return e.isFocused=!1},e.setIsFocusedTrue=function(c){e.ownFocusedElements.add(c.target),e.isFocused=!0},e}return Object(l.a)(t,c),Object(o.a)(t,[{key:"componentWillUnmount",value:function(){var e=this.activeElementOnMount,c=this.isFocused,t=this.ownFocusedElements;if(c&&!1!==u())for(var r,n=[].concat(Object(A.a)(v.without.apply(void 0,[this.props.focus.focusHistory].concat(Object(A.a)(t)))),[e]);r=n.pop();)if(document.body.contains(r))return void r.focus()}},{key:"render",value:function(){return Object(h.createElement)("div",{onFocus:this.setIsFocusedTrue,onBlur:this.setIsFocusedFalse},Object(h.createElement)(e,this.props.childProps))}}]),t}(h.Component);return function(e){return Object(h.createElement)(de,null,function(t){return Object(h.createElement)(c,{childProps:e,focus:t})})}}},"withFocusReturn"),He=Object(ue.a)(function(e){return function(c){function t(){var e;return Object(a.a)(this,t),(e=Object(s.a)(this,Object(i.a)(t).apply(this,arguments))).focusContainRef=Object(h.createRef)(),e.handleTabBehaviour=e.handleTabBehaviour.bind(Object(ze.a)(e)),e}return Object(l.a)(t,c),Object(o.a)(t,[{key:"handleTabBehaviour",value:function(e){if(9===e.keyCode){var c=F.tabbable.find(this.focusContainRef.current);if(c.length){var t=c[0],r=c[c.length-1];e.shiftKey&&e.target===t?(e.preventDefault(),r.focus()):(e.shiftKey||e.target!==r)&&c.includes(e.target)||(e.preventDefault(),t.focus())}}}},{key:"render",value:function(){return Object(h.createElement)("div",{onKeyDown:this.handleTabBehaviour,ref:this.focusContainRef,tabIndex:"-1"},Object(h.createElement)(e,this.props))}}]),t}(h.Component)},"withConstrainedTabbing"),pe=["button","submit"];var Me=Object(ue.a)(function(e){return function(c){function t(){var e;return Object(a.a)(this,t),(e=Object(s.a)(this,Object(i.a)(t).apply(this,arguments))).bindNode=e.bindNode.bind(Object(ze.a)(e)),e.cancelBlurCheck=e.cancelBlurCheck.bind(Object(ze.a)(e)),e.queueBlurCheck=e.queueBlurCheck.bind(Object(ze.a)(e)),e.normalizeButtonFocus=e.normalizeButtonFocus.bind(Object(ze.a)(e)),e}return Object(l.a)(t,c),Object(o.a)(t,[{key:"componentWillUnmount",value:function(){this.cancelBlurCheck()}},{key:"bindNode",value:function(e){e?this.node=e:(delete this.node,this.cancelBlurCheck())}},{key:"queueBlurCheck",value:function(e){var c=this;e.persist(),this.preventBlurCheck||(this.blurCheckTimeout=setTimeout(function(){document.hasFocus()?"function"===typeof c.node.handleFocusOutside&&c.node.handleFocusOutside(e):e.preventDefault()},0))}},{key:"cancelBlurCheck",value:function(){clearTimeout(this.blurCheckTimeout)}},{key:"normalizeButtonFocus",value:function(e){var c=e.type,t=e.target;Object(v.includes)(["mouseup","touchend"],c)?this.preventBlurCheck=!1:function(e){switch(e.nodeName){case"A":case"BUTTON":return!0;case"INPUT":return Object(v.includes)(pe,e.type)}return!1}(t)&&(this.preventBlurCheck=!0)}},{key:"render",value:function(){return Object(h.createElement)("div",{onFocus:this.cancelBlurCheck,onMouseDown:this.normalizeButtonFocus,onMouseUp:this.normalizeButtonFocus,onTouchStart:this.normalizeButtonFocus,onTouchEnd:this.normalizeButtonFocus,onBlur:this.queueBlurCheck},Object(h.createElement)(e,Object(b.a)({ref:this.bindNode},this.props)))}}]),t}(h.Component)},"withFocusOutside")(function(e){function c(){return Object(a.a)(this,c),Object(s.a)(this,Object(i.a)(c).apply(this,arguments))}return Object(l.a)(c,e),Object(o.a)(c,[{key:"handleFocusOutside",value:function(e){this.props.onFocusOutside(e)}},{key:"render",value:function(){return this.props.children}}]),c}(h.Component));var Ve=Object(h.forwardRef)(function(e,c){var t=e.href,r=e.target,n=e.isPrimary,a=e.isLarge,o=e.isSmall,s=e.isTertiary,i=e.isToggled,l=e.isBusy,v=e.isDefault,m=e.isLink,b=e.isDestructive,d=e.className,f=e.disabled,p=Object(z.a)(e,["href","target","isPrimary","isLarge","isSmall","isTertiary","isToggled","isBusy","isDefault","isLink","isDestructive","className","disabled"]),M=H()("components-button",d,{"is-button":v||n||a||o,"is-default":v||!n&&(a||o),"is-primary":n,"is-large":a,"is-small":o,"is-tertiary":s,"is-toggled":i,"is-busy":l,"is-link":m,"is-destructive":b}),V=void 0===t||f?"button":"a",k="a"===V?{href:t,target:r}:{type:"button",disabled:f};return Object(h.createElement)(V,Object(u.a)({},k,p,{className:M,ref:c}))}),ke=t(701),ge=t(783);var Oe=function(e){var c=e.icon,t=void 0===c?null:c,r=e.size,n=Object(z.a)(e,["icon","size"]),a=r||20;if("string"===typeof t)return Object(h.createElement)(ke.a,Object(b.a)({icon:t,size:a},n));if(t&&ke.a===t.type)return Object(h.cloneElement)(t,Object(u.a)({size:a},n));var o=r||24;if("function"===typeof t)return t.prototype instanceof h.Component?Object(h.createElement)(t,Object(u.a)({size:o},n)):t(Object(u.a)({size:o},n));if(t&&("svg"===t.type||t.type===ge.b)){var s=Object(u.a)({width:o,height:o},t.props,n);return Object(h.createElement)(ge.b,s)}return Object(h.isValidElement)(t)?Object(h.cloneElement)(t,Object(u.a)({size:o},n)):t};var Le=Object(h.forwardRef)(function(e,c){var t=e.icon,r=e.children,n=e.label,a=e.className,o=e.tooltip,s=e.shortcut,i=e.labelPosition,l=e.size,u=Object(z.a)(e,["icon","children","label","className","tooltip","shortcut","labelPosition","size"]),m=H()("components-icon-button",a,{"has-text":r}),d=o||n,f=!u.disabled&&(o||s||!!n&&(!r||Object(v.isArray)(r)&&!r.length)&&!1!==o),p=Object(h.createElement)(Ve,Object(b.a)({"aria-label":n},u,{className:m,ref:c}),Object(h.createElement)(Oe,{icon:t,size:l}),r);return f&&(p=Object(h.createElement)(Ge,{text:d,shortcut:s,position:i},p)),p});var ye=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},c=e.htmlDocument,t=void 0===c?document:c,r=e.className,n=void 0===r?"lockscroll":r,v=0,u=0;function z(e){var c=t.scrollingElement||t.body;e&&(u=c.scrollTop);var r=e?"add":"remove";c.classList[r](n),t.documentElement.classList[r](n),e||(c.scrollTop=u)}return function(e){function c(){return Object(a.a)(this,c),Object(s.a)(this,Object(i.a)(c).apply(this,arguments))}return Object(l.a)(c,e),Object(o.a)(c,[{key:"componentDidMount",value:function(){0===v&&z(!0),++v}},{key:"componentWillUnmount",value:function(){1===v&&z(!1),--v}},{key:"render",value:function(){return null}}]),c}(h.Component)}();function je(e){e.stopPropagation()}var we=Object(h.forwardRef)(function(e,c){var t=e.children,r=Object(z.a)(e,["children"]);return Object(h.createElement)("div",Object(b.a)({},r,{ref:c,onMouseDown:je}),t)}),Ce=Object(h.createContext)({registerSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){},getSlot:function(){},getFills:function(){},subscribe:function(){}}),Se=Ce.Provider,xe=Ce.Consumer,Ee=(h.Component,function(e){var c=Object(h.useContext)(Ce),t=c.getSlot,r=c.subscribe,n=d(Object(h.useState)(t(e)),2),a=n[0],o=n[1];return Object(h.useEffect)(function(){return o(t(e)),r(function(){o(t(e))})},[e]),a}),_e=t(77),Fe=0;function Te(e){var c=e.name,t=e.children,r=e.registerFill,n=e.unregisterFill,a=Ee(c),o=Object(h.useRef)({name:c,children:t});return o.current.occurrence||(o.current.occurrence=++Fe),Object(h.useLayoutEffect)(function(){return r(c,o.current),function(){return n(c,o.current)}},[]),Object(h.useLayoutEffect)(function(){o.current.children=t,a&&!a.props.bubblesVirtually&&a.forceUpdate()},[t]),Object(h.useLayoutEffect)(function(){c!==o.current.name&&(n(o.current.name,o.current),o.current.name=c,r(c,o.current))},[c]),a&&a.node&&a.props.bubblesVirtually?(Object(v.isFunction)(t)&&(t=t(a.props.fillProps)),Object(_e.createPortal)(t,a.node)):null}var Ae=function(e){return Object(h.createElement)(xe,null,function(c){var t=c.registerFill,r=c.unregisterFill;return Object(h.createElement)(Te,Object(b.a)({},e,{registerFill:t,unregisterFill:r}))})},Ne=function(e){return!Object(v.isNumber)(e)&&(Object(v.isString)(e)||Object(v.isArray)(e)?!e.length:!e)},Ie=function(e){function c(){var e;return Object(a.a)(this,c),(e=Object(s.a)(this,Object(i.a)(c).apply(this,arguments))).bindNode=e.bindNode.bind(Object(ze.a)(e)),e}return Object(l.a)(c,e),Object(o.a)(c,[{key:"componentDidMount",value:function(){(0,this.props.registerSlot)(this.props.name,this)}},{key:"componentWillUnmount",value:function(){(0,this.props.unregisterSlot)(this.props.name,this)}},{key:"componentDidUpdate",value:function(e){var c=this.props,t=c.name,r=c.unregisterSlot,n=c.registerSlot;e.name!==t&&(r(e.name),n(t,this))}},{key:"bindNode",value:function(e){this.node=e}},{key:"render",value:function(){var e=this.props,c=e.children,t=e.name,r=e.bubblesVirtually,n=void 0!==r&&r,a=e.fillProps,o=void 0===a?{}:a,s=e.getFills,i=e.className;if(n)return Object(h.createElement)("div",{ref:this.bindNode,className:i});var l=Object(v.map)(s(t,this),function(e){var c=e.occurrence,t=Object(v.isFunction)(e.children)?e.children(o):e.children;return h.Children.map(t,function(e,t){if(!e||Object(v.isString)(e))return e;var r="".concat(c,"---").concat(e.key||t);return Object(h.cloneElement)(e,{key:r})})}).filter(Object(v.negate)(Ne));return Object(h.createElement)(h.Fragment,null,Object(v.isFunction)(c)?c(l):l)}}]),c}(h.Component),Pe=function(e){return Object(h.createElement)(xe,null,function(c){var t=c.registerSlot,r=c.unregisterSlot,n=c.getFills;return Object(h.createElement)(Ie,Object(b.a)({},e,{registerSlot:t,unregisterSlot:r,getFills:n}))})};var Be=function(e){var c=e.type,t=e.options,r=void 0===t?{}:t,n=e.children;if("appear"===c){var a,o=r.origin,s=d((void 0===o?"top":o).split(" "),2),i=s[0],l=s[1],h=void 0===l?"center":l;return n({className:H()("components-animate__appear",(a={},Object(T.a)(a,"is-from-"+h,"center"!==h),Object(T.a)(a,"is-from-"+i,"middle"!==i),a))})}if("slide-in"===c){var v=r.origin,u=void 0===v?"left":v;return n({className:H()("components-animate__slide-in","is-from-"+u)})}return n("loading"===c?{className:H()("components-animate__loading")}:{})},De=He(fe(function(e){return e.children}));function Re(e,c){var t=window.getComputedStyle(c),r=t.paddingTop,n=t.paddingBottom,a=t.paddingLeft,o=t.paddingRight,s=r?parseInt(r,10):0,i=n?parseInt(n,10):0,l=a?parseInt(a,10):0,h=o?parseInt(o,10):0;return{x:e.left+l,y:e.top+s,width:e.width-l-h,height:e.height-s-i,left:e.left+l,right:e.right-h,top:e.top+s,bottom:e.bottom-i}}function We(e,c,t){t?e.getAttribute(c)!==t&&e.setAttribute(c,t):e.hasAttribute(c)&&e.removeAttribute(c)}function Ze(e,c){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";e.style[c]!==t&&(e.style[c]=t)}function Ue(e,c,t){t?e.classList.contains(c)||e.classList.add(c):e.classList.contains(c)&&e.classList.remove(c)}var Ke=function(e){var c=e.headerTitle,t=e.onClose,r=e.onKeyDown,n=e.children,a=e.className,o=e.noArrow,s=void 0!==o&&o,i=e.position,l=void 0===i?"top":i,v=(e.range,e.focusOnMount),u=void 0===v?"firstElement":v,m=e.anchorRef,f=e.shouldAnchorIncludePadding,p=e.anchorVerticalBuffer,M=e.anchorHorizontalBuffer,k=e.anchorRect,g=e.getAnchorRect,O=e.expandOnMobile,L=e.animate,y=void 0===L||L,j=e.onClickOutside,w=e.onFocusOutside,C=Object(z.a)(e,["headerTitle","onClose","onKeyDown","children","className","noArrow","position","range","focusOnMount","anchorRef","shouldAnchorIncludePadding","anchorVerticalBuffer","anchorHorizontalBuffer","anchorRect","getAnchorRect","expandOnMobile","animate","onClickOutside","onFocusOutside"]),S=Object(h.useRef)(null),x=Object(h.useRef)(null),E=Object(h.useRef)(),_=Object(h.useRef)(),T=ie("medium","<"),A=d(Object(h.useState)(),2),N=A[0],I=A[1],P=O&&T;s=P||s,Object(h.useEffect)(function(){var e=E.current,c=x.current;if(P)return Ue(e,"is-without-arrow",s),We(e,"data-x-axis"),We(e,"data-y-axis"),Ze(e,"top"),Ze(e,"left"),Ze(c,"maxHeight"),void Ze(c,"maxWidth");var t=function(){var t=function(e,c,t){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=arguments.length>4?arguments[4]:void 0;if(c)return c;if(t){if(!e.current)return;return t(e.current)}if(!1!==r){if(!r)return;if(r instanceof window.Range)return V(r);var a=r.getBoundingClientRect();return n?a:Re(a,r)}if(e.current){var o=e.current.parentNode,s=o.getBoundingClientRect();return n?s:Re(s,o)}}(S,k,g,m,f);if(t){t=function(e){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return{x:e.left-t,y:e.top-c,width:e.width+2*t,height:e.height+2*c,left:e.left-t,right:e.right+t,top:e.top-c,bottom:e.bottom+c}}(t,p,M),_.current||(_.current=c.getBoundingClientRect());var r=ve(t,_.current,l),n=r.popoverTop,a=r.popoverLeft,o=r.xAxis,i=r.yAxis,h=r.contentHeight,v=r.contentWidth;Ue(e,"is-without-arrow",s||"center"===o&&"middle"===i),We(e,"data-x-axis",o),We(e,"data-y-axis",i),Ze(e,"top","number"===typeof n?n+"px":""),Ze(e,"left","number"===typeof a?a+"px":""),Ze(c,"maxHeight","number"===typeof h?h+"px":""),Ze(c,"maxWidth","number"===typeof v?v+"px":""),I(({left:"right",right:"left"}[o]||"center")+" "+({top:"bottom",bottom:"top"}[i]||"middle"))}},r=window.setTimeout(t),n=window.setInterval(t,500);return window.addEventListener("resize",t),window.addEventListener("scroll",t,!0),function(){window.clearTimeout(r),window.clearInterval(n),window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0)}},[P,k,g,m,f,p,M,l]),function(e,c){Object(h.useEffect)(function(){var t=setTimeout(function(){if(e&&c.current)if("firstElement"!==e)"container"===e&&c.current.focus();else{var t=F.tabbable.find(c.current)[0];t?t.focus():c.current.focus()}},0);return function(){return clearTimeout(t)}},[])}(u,x);var B=function(e){27===e.keyCode&&t&&(e.stopPropagation(),t()),r&&r(e)};var D=Object(h.createElement)(Me,{onFocusOutside:function(e){if(w)w(e);else if(j){var c;try{c=new window.MouseEvent("click")}catch(r){(c=document.createEvent("MouseEvent")).initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null)}Object.defineProperty(c,"target",{get:function(){return e.relatedTarget}}),function(e){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=c.version,r=c.alternative,n=c.plugin,a=c.link,o=c.hint,s=n?" from ".concat(n):"",i=t?" and will be removed".concat(s," in version ").concat(t):"",l=r?" Please use ".concat(r," instead."):"",h=a?" See: ".concat(a):"",v=o?" Note: ".concat(o):"",u="".concat(e," is deprecated").concat(i,".").concat(l).concat(h).concat(v);u in te||(ce("deprecated",e,c,u),console.warn(u),te[u]=!0)}("Popover onClickOutside prop",{alternative:"onFocusOutside"}),j(c)}else t&&t()}},Object(h.createElement)(Be,{type:y&&N?"appear":null,options:{origin:N}},function(e){var r=e.className;return Object(h.createElement)(we,Object(b.a)({className:H()("components-popover",a,r,{"is-expanded":P,"is-without-arrow":s})},C,{onKeyDown:B,ref:E}),P&&Object(h.createElement)("div",{className:"components-popover__header"},Object(h.createElement)("span",{className:"components-popover__header-title"},c),Object(h.createElement)(Le,{className:"components-popover__close",icon:"no-alt",onClick:t})),Object(h.createElement)("div",{ref:x,className:"components-popover__content",tabIndex:"-1"},n))}));return u&&(D=Object(h.createElement)(De,null,D)),Object(h.createElement)(xe,null,function(e){var c=e.getSlot;return c&&c("Popover")&&(D=Object(h.createElement)(Ae,{name:"Popover"},D)),Object(h.createElement)("span",{ref:S},D,T&&O&&Object(h.createElement)(ye,null))})};Ke.Slot=function(){return Object(h.createElement)(Pe,{bubblesVirtually:!0,name:"Popover"})};var qe=Ke;var Xe=function(e){var c,t,r=e.shortcut,n=e.className;return r?(Object(v.isString)(r)&&(c=r),Object(v.isObject)(r)&&(c=r.display,t=r.ariaLabel),Object(h.createElement)("span",{className:n,"aria-label":t},c)):null},$e=700,Je=function(e){function c(){var e;return Object(a.a)(this,c),(e=Object(s.a)(this,Object(i.a)(c).apply(this,arguments))).delayedSetIsOver=Object(v.debounce)(function(c){return e.setState({isOver:c})},$e),e.cancelIsMouseDown=e.createSetIsMouseDown(!1),e.isInMouseDown=!1,e.state={isOver:!1},e}return Object(l.a)(c,e),Object(o.a)(c,[{key:"componentWillUnmount",value:function(){this.delayedSetIsOver.cancel(),document.removeEventListener("mouseup",this.cancelIsMouseDown)}},{key:"emitToChild",value:function(e,c){var t=this.props.children;if(1===h.Children.count(t)){var r=h.Children.only(t);"function"===typeof r.props[e]&&r.props[e](c)}}},{key:"createToggleIsOver",value:function(e,c){var t=this;return function(r){if(t.emitToChild(e,r),!r.currentTarget.disabled&&("focus"!==r.type||!t.isInMouseDown)){t.delayedSetIsOver.cancel();var n=Object(v.includes)(["focus","mouseenter"],r.type);n!==t.state.isOver&&(c?t.delayedSetIsOver(n):t.setState({isOver:n}))}}}},{key:"createSetIsMouseDown",value:function(e){var c=this;return function(t){c.emitToChild(e?"onMouseDown":"onMouseUp",t),document[e?"addEventListener":"removeEventListener"]("mouseup",c.cancelIsMouseDown),c.isInMouseDown=e}}},{key:"render",value:function(){var e=this.props,c=e.children,t=e.position,r=e.text,n=e.shortcut;if(1!==h.Children.count(c))return c;var a=h.Children.only(c),o=this.state.isOver;return Object(h.cloneElement)(a,{onMouseEnter:this.createToggleIsOver("onMouseEnter",!0),onMouseLeave:this.createToggleIsOver("onMouseLeave"),onClick:this.createToggleIsOver("onClick"),onFocus:this.createToggleIsOver("onFocus"),onBlur:this.createToggleIsOver("onBlur"),onMouseDown:this.createSetIsMouseDown(!0),children:m(a.props.children,o&&Object(h.createElement)(qe,{focusOnMount:!1,position:t,className:"components-tooltip","aria-hidden":"true",animate:!1},r,Object(h.createElement)(Xe,{className:"components-tooltip__shortcut",shortcut:n})))})}}]),c}(h.Component),Ge=c.a=Je}}]);
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[0],{569:function(e,c,t){"use strict";function r(e,c){if(!(e instanceof c))throw new TypeError("Cannot call a class as a function")}t.d(c,"a",function(){return r})},570:function(e,c,t){"use strict";function r(e,c){for(var t=0;t<c.length;t++){var r=c[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function n(e,c,t){return c&&r(e.prototype,c),t&&r(e,t),e}t.d(c,"a",function(){return n})},571:function(e,c,t){"use strict";t.d(c,"a",function(){return a});var r=t(760),n=t(78);function a(e,c){return!c||"object"!==Object(r.a)(c)&&"function"!==typeof c?Object(n.a)(e):c}},572:function(e,c,t){"use strict";function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}t.d(c,"a",function(){return r})},573:function(e,c,t){"use strict";t.d(c,"a",function(){return n});var r=t(55);function n(e,c){if(null==e)return{};var t,n,a=Object(r.a)(e,c);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)t=o[n],c.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}},574:function(e,c,t){"use strict";function r(e,c){return(r=Object.setPrototypeOf||function(e,c){return e.__proto__=c,e})(e,c)}function n(e,c){if("function"!==typeof c&&null!==c)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(c&&c.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),c&&r(e,c)}t.d(c,"a",function(){return n})},612:function(e,c,t){"use strict";t.d(c,"a",function(){return n});var r=t(643);function n(e){for(var c=1;c<arguments.length;c++){var t=null!=arguments[c]?arguments[c]:{},n=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(c){Object(r.a)(e,c,t[c])})}return e}},631:function(e,c,t){"use strict";function r(e){return function(e){if(Array.isArray(e)){for(var c=0,t=new Array(e.length);c<e.length;c++)t[c]=e[c];return t}}(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")}()}t.d(c,"a",function(){return r})},643:function(e,c,t){"use strict";function r(e,c,t){return c in e?Object.defineProperty(e,c,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[c]=t,e}t.d(c,"a",function(){return r})},701:function(e,c,t){"use strict";t.d(c,"a",function(){return u});var r=t(37),n=t(573),a=t(569),o=t(570),s=t(571),i=t(572),l=t(574),h=t(10),v=t(783),u=function(e){function c(){return Object(a.a)(this,c),Object(s.a)(this,Object(i.a)(c).apply(this,arguments))}return Object(l.a)(c,e),Object(o.a)(c,[{key:"render",value:function(){var e,c=this.props,t=c.icon,a=c.size,o=void 0===a?20:a,s=c.className,i=Object(n.a)(c,["icon","size","className"]);switch(t){case"admin-appearance":e="M14.48 11.06L7.41 3.99l1.5-1.5c.5-.56 2.3-.47 3.51.32 1.21.8 1.43 1.28 2.91 2.1 1.18.64 2.45 1.26 4.45.85zm-.71.71L6.7 4.7 4.93 6.47c-.39.39-.39 1.02 0 1.41l1.06 1.06c.39.39.39 1.03 0 1.42-.6.6-1.43 1.11-2.21 1.69-.35.26-.7.53-1.01.84C1.43 14.23.4 16.08 1.4 17.07c.99 1 2.84-.03 4.18-1.36.31-.31.58-.66.85-1.02.57-.78 1.08-1.61 1.69-2.21.39-.39 1.02-.39 1.41 0l1.06 1.06c.39.39 1.02.39 1.41 0z";break;case"admin-collapse":e="M10 2.16c4.33 0 7.84 3.51 7.84 7.84s-3.51 7.84-7.84 7.84S2.16 14.33 2.16 10 5.71 2.16 10 2.16zm2 11.72V6.12L6.18 9.97z";break;case"admin-comments":e="M5 2h9c1.1 0 2 .9 2 2v7c0 1.1-.9 2-2 2h-2l-5 5v-5H5c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2z";break;case"admin-customizer":e="M18.33 3.57s.27-.8-.31-1.36c-.53-.52-1.22-.24-1.22-.24-.61.3-5.76 3.47-7.67 5.57-.86.96-2.06 3.79-1.09 4.82.92.98 3.96-.17 4.79-1 2.06-2.06 5.21-7.17 5.5-7.79zM1.4 17.65c2.37-1.56 1.46-3.41 3.23-4.64.93-.65 2.22-.62 3.08.29.63.67.8 2.57-.16 3.46-1.57 1.45-4 1.55-6.15.89z";break;case"admin-generic":e="M18 12h-2.18c-.17.7-.44 1.35-.81 1.93l1.54 1.54-2.1 2.1-1.54-1.54c-.58.36-1.23.63-1.91.79V19H8v-2.18c-.68-.16-1.33-.43-1.91-.79l-1.54 1.54-2.12-2.12 1.54-1.54c-.36-.58-.63-1.23-.79-1.91H1V9.03h2.17c.16-.7.44-1.35.8-1.94L2.43 5.55l2.1-2.1 1.54 1.54c.58-.37 1.24-.64 1.93-.81V2h3v2.18c.68.16 1.33.43 1.91.79l1.54-1.54 2.12 2.12-1.54 1.54c.36.59.64 1.24.8 1.94H18V12zm-8.5 1.5c1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3 1.34 3 3 3z";break;case"admin-home":e="M16 8.5l1.53 1.53-1.06 1.06L10 4.62l-6.47 6.47-1.06-1.06L10 2.5l4 4v-2h2v4zm-6-2.46l6 5.99V18H4v-5.97zM12 17v-5H8v5h4z";break;case"admin-links":e="M17.74 2.76c1.68 1.69 1.68 4.41 0 6.1l-1.53 1.52c-1.12 1.12-2.7 1.47-4.14 1.09l2.62-2.61.76-.77.76-.76c.84-.84.84-2.2 0-3.04-.84-.85-2.2-.85-3.04 0l-.77.76-3.38 3.38c-.37-1.44-.02-3.02 1.1-4.14l1.52-1.53c1.69-1.68 4.42-1.68 6.1 0zM8.59 13.43l5.34-5.34c.42-.42.42-1.1 0-1.52-.44-.43-1.13-.39-1.53 0l-5.33 5.34c-.42.42-.42 1.1 0 1.52.44.43 1.13.39 1.52 0zm-.76 2.29l4.14-4.15c.38 1.44.03 3.02-1.09 4.14l-1.52 1.53c-1.69 1.68-4.41 1.68-6.1 0-1.68-1.68-1.68-4.42 0-6.1l1.53-1.52c1.12-1.12 2.7-1.47 4.14-1.1l-4.14 4.15c-.85.84-.85 2.2 0 3.05.84.84 2.2.84 3.04 0z";break;case"admin-media":e="M13 11V4c0-.55-.45-1-1-1h-1.67L9 1H5L3.67 3H2c-.55 0-1 .45-1 1v7c0 .55.45 1 1 1h10c.55 0 1-.45 1-1zM7 4.5c1.38 0 2.5 1.12 2.5 2.5S8.38 9.5 7 9.5 4.5 8.38 4.5 7 5.62 4.5 7 4.5zM14 6h5v10.5c0 1.38-1.12 2.5-2.5 2.5S14 17.88 14 16.5s1.12-2.5 2.5-2.5c.17 0 .34.02.5.05V9h-3V6zm-4 8.05V13h2v3.5c0 1.38-1.12 2.5-2.5 2.5S7 17.88 7 16.5 8.12 14 9.5 14c.17 0 .34.02.5.05z";break;case"admin-multisite":e="M14.27 6.87L10 3.14 5.73 6.87 5 6.14l5-4.38 5 4.38zM14 8.42l-4.05 3.43L6 8.38v-.74l4-3.5 4 3.5v.78zM11 9.7V8H9v1.7h2zm-1.73 4.03L5 10 .73 13.73 0 13l5-4.38L10 13zm10 0L15 10l-4.27 3.73L10 13l5-4.38L20 13zM5 11l4 3.5V18H1v-3.5zm10 0l4 3.5V18h-8v-3.5zm-9 6v-2H4v2h2zm10 0v-2h-2v2h2z";break;case"admin-network":e="M16.95 2.58c1.96 1.95 1.96 5.12 0 7.07-1.51 1.51-3.75 1.84-5.59 1.01l-1.87 3.31-2.99.31L5 18H2l-1-2 7.95-7.69c-.92-1.87-.62-4.18.93-5.73 1.95-1.96 5.12-1.96 7.07 0zm-2.51 3.79c.74 0 1.33-.6 1.33-1.34 0-.73-.59-1.33-1.33-1.33-.73 0-1.33.6-1.33 1.33 0 .74.6 1.34 1.33 1.34z";break;case"admin-page":e="M6 15V2h10v13H6zm-1 1h8v2H3V5h2v11z";break;case"admin-plugins":e="M13.11 4.36L9.87 7.6 8 5.73l3.24-3.24c.35-.34 1.05-.2 1.56.32.52.51.66 1.21.31 1.55zm-8 1.77l.91-1.12 9.01 9.01-1.19.84c-.71.71-2.63 1.16-3.82 1.16H6.14L4.9 17.26c-.59.59-1.54.59-2.12 0-.59-.58-.59-1.53 0-2.12l1.24-1.24v-3.88c0-1.13.4-3.19 1.09-3.89zm7.26 3.97l3.24-3.24c.34-.35 1.04-.21 1.55.31.52.51.66 1.21.31 1.55l-3.24 3.25z";break;case"admin-post":e="M10.44 3.02l1.82-1.82 6.36 6.35-1.83 1.82c-1.05-.68-2.48-.57-3.41.36l-.75.75c-.92.93-1.04 2.35-.35 3.41l-1.83 1.82-2.41-2.41-2.8 2.79c-.42.42-3.38 2.71-3.8 2.29s1.86-3.39 2.28-3.81l2.79-2.79L4.1 9.36l1.83-1.82c1.05.69 2.48.57 3.4-.36l.75-.75c.93-.92 1.05-2.35.36-3.41z";break;case"admin-settings":e="M18 16V4c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h13c.55 0 1-.45 1-1zM8 11h1c.55 0 1 .45 1 1s-.45 1-1 1H8v1.5c0 .28-.22.5-.5.5s-.5-.22-.5-.5V13H6c-.55 0-1-.45-1-1s.45-1 1-1h1V5.5c0-.28.22-.5.5-.5s.5.22.5.5V11zm5-2h-1c-.55 0-1-.45-1-1s.45-1 1-1h1V5.5c0-.28.22-.5.5-.5s.5.22.5.5V7h1c.55 0 1 .45 1 1s-.45 1-1 1h-1v5.5c0 .28-.22.5-.5.5s-.5-.22-.5-.5V9z";break;case"admin-site-alt":e="M9 0C4.03 0 0 4.03 0 9s4.03 9 9 9 9-4.03 9-9-4.03-9-9-9zm7.5 6.48c-.274.896-.908 1.64-1.75 2.05-.45-1.69-1.658-3.074-3.27-3.75.13-.444.41-.83.79-1.09-.43-.28-1-.42-1.34.07-.53.69 0 1.61.21 2v.14c-.555-.337-.99-.84-1.24-1.44-.966-.03-1.922.208-2.76.69-.087-.565-.032-1.142.16-1.68.733.07 1.453-.23 1.92-.8.46-.52-.13-1.18-.59-1.58h.36c1.36-.01 2.702.335 3.89 1 1.36 1.005 2.194 2.57 2.27 4.26.24 0 .7-.55.91-.92.172.34.32.69.44 1.05zM9 16.84c-2.05-2.08.25-3.75-1-5.24-.92-.85-2.29-.26-3.11-1.23-.282-1.473.267-2.982 1.43-3.93.52-.44 4-1 5.42.22.83.715 1.415 1.674 1.67 2.74.46.035.918-.066 1.32-.29.41 2.98-3.15 6.74-5.73 7.73zM5.15 2.09c.786-.3 1.676-.028 2.16.66-.42.38-.94.63-1.5.72.02-.294.085-.584.19-.86l-.85-.52z";break;case"admin-site-alt2":e="M9 0C4.03 0 0 4.03 0 9s4.03 9 9 9 9-4.03 9-9-4.03-9-9-9zm2.92 12.34c0 .35.14.63.36.66.22.03.47-.22.58-.6l.2.08c.718.384 1.07 1.22.84 2-.15.69-.743 1.198-1.45 1.24-.49-1.21-2.11.06-3.56-.22-.612-.154-1.11-.6-1.33-1.19 1.19-.11 2.85-1.73 4.36-1.97zM8 11.27c.918 0 1.695-.68 1.82-1.59.44.54.41 1.324-.07 1.83-.255.223-.594.325-.93.28-.335-.047-.635-.236-.82-.52zm3-.76c.41.39 3-.06 3.52 1.09-.95-.2-2.95.61-3.47-1.08l-.05-.01zM9.73 5.45v.27c-.65-.77-1.33-1.07-1.61-.57-.28.5 1 1.11.76 1.88-.24.77-1.27.56-1.88 1.61-.61 1.05-.49 2.42 1.24 3.67-1.192-.132-2.19-.962-2.54-2.11-.4-1.2-.09-2.26-.78-2.46C4 7.46 3 8.71 3 9.8c-1.26-1.26.05-2.86-1.2-4.18C3.5 1.998 7.644.223 11.44 1.49c-1.1 1.02-1.722 2.458-1.71 3.96z";break;case"admin-site-alt3":e="M9 0C4.03 0 0 4.03 0 9s4.03 9 9 9 9-4.03 9-9-4.03-9-9-9zM1.11 9.68h2.51c.04.91.167 1.814.38 2.7H1.84c-.403-.85-.65-1.764-.73-2.7zm8.57-5.4V1.19c.964.366 1.756 1.08 2.22 2 .205.347.386.708.54 1.08l-2.76.01zm3.22 1.35c.232.883.37 1.788.41 2.7H9.68v-2.7h3.22zM8.32 1.19v3.09H5.56c.154-.372.335-.733.54-1.08.462-.924 1.255-1.64 2.22-2.01zm0 4.44v2.7H4.7c.04-.912.178-1.817.41-2.7h3.21zm-4.7 2.69H1.11c.08-.936.327-1.85.73-2.7H4c-.213.886-.34 1.79-.38 2.7zM4.7 9.68h3.62v2.7H5.11c-.232-.883-.37-1.788-.41-2.7zm3.63 4v3.09c-.964-.366-1.756-1.08-2.22-2-.205-.347-.386-.708-.54-1.08l2.76-.01zm1.35 3.09v-3.04h2.76c-.154.372-.335.733-.54 1.08-.464.92-1.256 1.634-2.22 2v-.04zm0-4.44v-2.7h3.62c-.04.912-.178 1.817-.41 2.7H9.68zm4.71-2.7h2.51c-.08.936-.327 1.85-.73 2.7H14c.21-.87.337-1.757.38-2.65l.01-.05zm0-1.35c-.046-.894-.176-1.78-.39-2.65h2.16c.403.85.65 1.764.73 2.7l-2.5-.05zm1-4H13.6c-.324-.91-.793-1.76-1.39-2.52 1.244.56 2.325 1.426 3.14 2.52h.04zm-9.6-2.52c-.597.76-1.066 1.61-1.39 2.52H2.65c.815-1.094 1.896-1.96 3.14-2.52zm-3.15 12H4.4c.324.91.793 1.76 1.39 2.52-1.248-.567-2.33-1.445-3.14-2.55l-.01.03zm9.56 2.52c.597-.76 1.066-1.61 1.39-2.52h1.76c-.82 1.08-1.9 1.933-3.14 2.48l-.01.04z";break;case"admin-site":e="M9 0C4.03 0 0 4.03 0 9s4.03 9 9 9 9-4.03 9-9-4.03-9-9-9zm3.46 11.95c0 1.47-.8 3.3-4.06 4.7.3-4.17-2.52-3.69-3.2-5 .126-1.1.804-2.063 1.8-2.55-1.552-.266-3-.96-4.18-2 .05.47.28.904.64 1.21-.782-.295-1.458-.817-1.94-1.5.977-3.225 3.883-5.482 7.25-5.63-.84 1.38-1.5 4.13 0 5.57C7.23 7 6.26 5 5.41 5.79c-1.13 1.06.33 2.51 3.42 3.08 3.29.59 3.66 1.58 3.63 3.08zm1.34-4c-.32-1.11.62-2.23 1.69-3.14 1.356 1.955 1.67 4.45.84 6.68-.77-1.89-2.17-2.32-2.53-3.57v.03z";break;case"admin-tools":e="M16.68 9.77c-1.34 1.34-3.3 1.67-4.95.99l-5.41 6.52c-.99.99-2.59.99-3.58 0s-.99-2.59 0-3.57l6.52-5.42c-.68-1.65-.35-3.61.99-4.95 1.28-1.28 3.12-1.62 4.72-1.06l-2.89 2.89 2.82 2.82 2.86-2.87c.53 1.58.18 3.39-1.08 4.65zM3.81 16.21c.4.39 1.04.39 1.43 0 .4-.4.4-1.04 0-1.43-.39-.4-1.03-.4-1.43 0-.39.39-.39 1.03 0 1.43z";break;case"admin-users":e="M10 9.25c-2.27 0-2.73-3.44-2.73-3.44C7 4.02 7.82 2 9.97 2c2.16 0 2.98 2.02 2.71 3.81 0 0-.41 3.44-2.68 3.44zm0 2.57L12.72 10c2.39 0 4.52 2.33 4.52 4.53v2.49s-3.65 1.13-7.24 1.13c-3.65 0-7.24-1.13-7.24-1.13v-2.49c0-2.25 1.94-4.48 4.47-4.48z";break;case"album":e="M0 18h10v-.26c1.52.4 3.17.35 4.76-.24 4.14-1.52 6.27-6.12 4.75-10.26-1.43-3.89-5.58-6-9.51-4.98V2H0v16zM9 3v14H1V3h8zm5.45 8.22c-.68 1.35-2.32 1.9-3.67 1.23-.31-.15-.57-.35-.78-.59V8.13c.8-.86 2.11-1.13 3.22-.58 1.35.68 1.9 2.32 1.23 3.67zm-2.75-.82c.22.16.53.12.7-.1.16-.22.12-.53-.1-.7s-.53-.12-.7.1c-.16.21-.12.53.1.7zm3.01 3.67c-1.17.78-2.56.99-3.83.69-.27-.06-.44-.34-.37-.61s.34-.43.62-.36l.17.04c.96.17 1.98-.01 2.86-.59.47-.32.86-.72 1.14-1.18.15-.23.45-.3.69-.16.23.15.3.46.16.69-.36.57-.84 1.08-1.44 1.48zm1.05 1.57c-1.48.99-3.21 1.32-4.84 1.06-.28-.05-.47-.32-.41-.6.05-.27.32-.45.61-.39l.22.04c1.31.15 2.68-.14 3.87-.94.71-.47 1.27-1.07 1.7-1.74.14-.24.45-.31.68-.16.24.14.31.45.16.69-.49.79-1.16 1.49-1.99 2.04z";break;case"align-center":e="M3 5h14V3H3v2zm12 8V7H5v6h10zM3 17h14v-2H3v2z";break;case"align-full-width":e="M17 13V3H3v10h14zM5 17h10v-2H5v2z";break;case"align-left":e="M3 5h14V3H3v2zm9 8V7H3v6h9zm2-4h3V7h-3v2zm0 4h3v-2h-3v2zM3 17h14v-2H3v2z";break;case"align-none":e="M3 5h14V3H3v2zm10 8V7H3v6h10zM3 17h14v-2H3v2z";break;case"align-pull-left":e="M9 16V4H3v12h6zm2-7h6V7h-6v2zm0 4h6v-2h-6v2z";break;case"align-pull-right":e="M17 16V4h-6v12h6zM9 7H3v2h6V7zm0 4H3v2h6v-2z";break;case"align-right":e="M3 5h14V3H3v2zm0 4h3V7H3v2zm14 4V7H8v6h9zM3 13h3v-2H3v2zm0 4h14v-2H3v2z";break;case"align-wide":e="M5 5h10V3H5v2zm12 8V7H3v6h14zM5 17h10v-2H5v2z";break;case"analytics":e="M18 18V2H2v16h16zM16 5H4V4h12v1zM7 7v3h3c0 1.66-1.34 3-3 3s-3-1.34-3-3 1.34-3 3-3zm1 2V7c1.1 0 2 .9 2 2H8zm8-1h-4V7h4v1zm0 3h-4V9h4v2zm0 2h-4v-1h4v1zm0 3H4v-1h12v1z";break;case"archive":e="M19 4v2H1V4h18zM2 7h16v10H2V7zm11 3V9H7v1h6z";break;case"arrow-down-alt":e="M9 2h2v12l4-4 2 1-7 7-7-7 2-1 4 4V2z";break;case"arrow-down-alt2":e="M5 6l5 5 5-5 2 1-7 7-7-7z";break;case"arrow-down":e="M15 8l-4.03 6L7 8h8z";break;case"arrow-left-alt":e="M18 9v2H6l4 4-1 2-7-7 7-7 1 2-4 4h12z";break;case"arrow-left-alt2":e="M14 5l-5 5 5 5-1 2-7-7 7-7z";break;case"arrow-left":e="M13 14L7 9.97 13 6v8z";break;case"arrow-right-alt":e="M2 11V9h12l-4-4 1-2 7 7-7 7-1-2 4-4H2z";break;case"arrow-right-alt2":e="M6 15l5-5-5-5 1-2 7 7-7 7z";break;case"arrow-right":e="M8 6l6 4.03L8 14V6z";break;case"arrow-up-alt":e="M11 18H9V6l-4 4-2-1 7-7 7 7-2 1-4-4v12z";break;case"arrow-up-alt2":e="M15 14l-5-5-5 5-2-1 7-7 7 7z";break;case"arrow-up":e="M7 13l4.03-6L15 13H7z";break;case"art":e="M8.55 3.06c1.01.34-1.95 2.01-.1 3.13 1.04.63 3.31-2.22 4.45-2.86.97-.54 2.67-.65 3.53 1.23 1.09 2.38.14 8.57-3.79 11.06-3.97 2.5-8.97 1.23-10.7-2.66-2.01-4.53 3.12-11.09 6.61-9.9zm1.21 6.45c.73 1.64 4.7-.5 3.79-2.8-.59-1.49-4.48 1.25-3.79 2.8z";break;case"awards":e="M4.46 5.16L5 7.46l-.54 2.29 2.01 1.24L7.7 13l2.3-.54 2.3.54 1.23-2.01 2.01-1.24L15 7.46l.54-2.3-2-1.24-1.24-2.01-2.3.55-2.29-.54-1.25 2zm5.55 6.34C7.79 11.5 6 9.71 6 7.49c0-2.2 1.79-3.99 4.01-3.99 2.2 0 3.99 1.79 3.99 3.99 0 2.22-1.79 4.01-3.99 4.01zm-.02-1C8.33 10.5 7 9.16 7 7.5c0-1.65 1.33-3 2.99-3S13 5.85 13 7.5c0 1.66-1.35 3-3.01 3zm3.84 1.1l-1.28 2.24-2.08-.47L13 19.2l1.4-2.2h2.5zm-7.7.07l1.25 2.25 2.13-.51L7 19.2 5.6 17H3.1z";break;case"backup":e="M13.65 2.88c3.93 2.01 5.48 6.84 3.47 10.77s-6.83 5.48-10.77 3.47c-1.87-.96-3.2-2.56-3.86-4.4l1.64-1.03c.45 1.57 1.52 2.95 3.08 3.76 3.01 1.54 6.69.35 8.23-2.66 1.55-3.01.36-6.69-2.65-8.24C9.78 3.01 6.1 4.2 4.56 7.21l1.88.97-4.95 3.08-.39-5.82 1.78.91C4.9 2.4 9.75.89 13.65 2.88zm-4.36 7.83C9.11 10.53 9 10.28 9 10c0-.07.03-.12.04-.19h-.01L10 5l.97 4.81L14 13l-4.5-2.12.02-.02c-.08-.04-.16-.09-.23-.15z";break;case"block-default":e="M15 6V4h-3v2H8V4H5v2H4c-.6 0-1 .4-1 1v8h14V7c0-.6-.4-1-1-1h-1z";break;case"book-alt":e="M5 17h13v2H5c-1.66 0-3-1.34-3-3V4c0-1.66 1.34-3 3-3h13v14H5c-.55 0-1 .45-1 1s.45 1 1 1zm2-3.5v-11c0-.28-.22-.5-.5-.5s-.5.22-.5.5v11c0 .28.22.5.5.5s.5-.22.5-.5z";break;case"book":e="M16 3h2v16H5c-1.66 0-3-1.34-3-3V4c0-1.66 1.34-3 3-3h9v14H5c-.55 0-1 .45-1 1s.45 1 1 1h11V3z";break;case"buddicons-activity":e="M8 1v7h2V6c0-1.52 1.45-3 3-3v.86c.55-.52 1.26-.86 2-.86v3h1c1.1 0 2 .9 2 2s-.9 2-2 2h-1v6c0 .55-.45 1-1 1s-1-.45-1-1v-2.18c-.31.11-.65.18-1 .18v2c0 .55-.45 1-1 1s-1-.45-1-1v-2H8v2c0 .55-.45 1-1 1s-1-.45-1-1v-2c-.35 0-.69-.07-1-.18V16c0 .55-.45 1-1 1s-1-.45-1-1v-4H2v-1c0-1.66 1.34-3 3-3h2V1h1zm5 7c.55 0 1-.45 1-1s-.45-1-1-1-1 .45-1 1 .45 1 1 1z";break;case"buddicons-bbpress-logo":e="M8.5 12.6c.3-1.3 0-2.3-1.1-2.3-.8 0-1.6.6-1.8 1.5l-.3 1.7c-.3 1 .3 1.5 1 1.5 1.2 0 1.9-1.1 2.2-2.4zm-4-6.4C3.7 7.3 3.3 8.6 3.3 10c0 1 .2 1.9.6 2.8l1-4.6c.3-1.7.4-2-.4-2zm9.3 6.4c.3-1.3 0-2.3-1.1-2.3-.8 0-1.6.6-1.8 1.5l-.4 1.7c-.2 1.1.4 1.6 1.1 1.6 1.1-.1 1.9-1.2 2.2-2.5zM10 3.3c-2 0-3.9.9-5.1 2.3.6-.1 1.4-.2 1.8-.3.2 0 .2.1.2.2 0 .2-1 4.8-1 4.8.5-.3 1.2-.7 1.8-.7.9 0 1.5.4 1.9.9l.5-2.4c.4-1.6.4-1.9-.4-1.9-.4 0-.4-.5 0-.6.6-.1 1.8-.2 2.3-.3.2 0 .2.1.2.2l-1 4.8c.5-.4 1.2-.7 1.9-.7 1.7 0 2.5 1.3 2.1 3-.3 1.7-2 3-3.8 3-1.3 0-2.1-.7-2.3-1.4-.7.8-1.7 1.3-2.8 1.4 1.1.7 2.4 1.1 3.7 1.1 3.7 0 6.7-3 6.7-6.7s-3-6.7-6.7-6.7zM10 2c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm0 15.5c-2.1 0-4-.8-5.3-2.2-.3-.4-.7-.8-1-1.2-.7-1.2-1.2-2.6-1.2-4.1 0-4.1 3.4-7.5 7.5-7.5s7.5 3.4 7.5 7.5-3.4 7.5-7.5 7.5z";break;case"buddicons-buddypress-logo":e="M10 0c5.52 0 10 4.48 10 10s-4.48 10-10 10S0 15.52 0 10 4.48 0 10 0zm0 .5C4.75.5.5 4.75.5 10s4.25 9.5 9.5 9.5 9.5-4.25 9.5-9.5S15.25.5 10 .5zm0 1c4.7 0 8.5 3.8 8.5 8.5s-3.8 8.5-8.5 8.5-8.5-3.8-8.5-8.5S5.3 1.5 10 1.5zm1.8 1.71c-.57 0-1.1.17-1.55.45 1.56.37 2.73 1.77 2.73 3.45 0 .69-.21 1.33-.55 1.87 1.31-.29 2.29-1.45 2.29-2.85 0-1.61-1.31-2.92-2.92-2.92zm-2.38 1c-1.61 0-2.92 1.31-2.92 2.93 0 1.61 1.31 2.92 2.92 2.92 1.62 0 2.93-1.31 2.93-2.92 0-1.62-1.31-2.93-2.93-2.93zm4.25 5.01l-.51.59c2.34.69 2.45 3.61 2.45 3.61h1.28c0-4.71-3.22-4.2-3.22-4.2zm-2.1.8l-2.12 2.09-2.12-2.09C3.12 10.24 3.89 15 3.89 15h11.08c.47-4.98-3.4-4.98-3.4-4.98z";break;case"buddicons-community":e="M9 3c0-.67-.47-1.43-1-2-.5.5-1 1.38-1 2 0 .48.45 1 1 1s1-.47 1-1zm4 0c0-.67-.47-1.43-1-2-.5.5-1 1.38-1 2 0 .48.45 1 1 1s1-.47 1-1zM9 9V5.5c0-.55-.45-1-1-1-.57 0-1 .49-1 1V9c0 .55.45 1 1 1 .57 0 1-.49 1-1zm4 0V5.5c0-.55-.45-1-1-1-.57 0-1 .49-1 1V9c0 .55.45 1 1 1 .57 0 1-.49 1-1zm4 1c0-1.48-1.41-2.77-3.5-3.46V9c0 .83-.67 1.5-1.5 1.5s-1.5-.67-1.5-1.5V6.01c-.17 0-.33-.01-.5-.01s-.33.01-.5.01V9c0 .83-.67 1.5-1.5 1.5S6.5 9.83 6.5 9V6.54C4.41 7.23 3 8.52 3 10c0 1.41.95 2.65 3.21 3.37 1.11.35 2.39 1.12 3.79 1.12s2.69-.78 3.79-1.13C16.04 12.65 17 11.41 17 10zm-7 5.43c1.43 0 2.74-.79 3.88-1.11 1.9-.53 2.49-1.34 3.12-2.32v3c0 2.21-3.13 4-7 4s-7-1.79-7-4v-3c.64.99 1.32 1.8 3.15 2.33 1.13.33 2.44 1.1 3.85 1.1z";break;case"buddicons-forums":e="M13.5 7h-7C5.67 7 5 6.33 5 5.5S5.67 4 6.5 4h1.59C8.04 3.84 8 3.68 8 3.5 8 2.67 8.67 2 9.5 2h1c.83 0 1.5.67 1.5 1.5 0 .18-.04.34-.09.5h1.59c.83 0 1.5.67 1.5 1.5S14.33 7 13.5 7zM4 8h12c.55 0 1 .45 1 1s-.45 1-1 1H4c-.55 0-1-.45-1-1s.45-1 1-1zm1 3h10c.55 0 1 .45 1 1s-.45 1-1 1H5c-.55 0-1-.45-1-1s.45-1 1-1zm2 3h6c.55 0 1 .45 1 1s-.45 1-1 1h-1.09c.05.16.09.32.09.5 0 .83-.67 1.5-1.5 1.5h-1c-.83 0-1.5-.67-1.5-1.5 0-.18.04-.34.09-.5H7c-.55 0-1-.45-1-1s.45-1 1-1z";break;case"buddicons-friends":e="M8.75 5.77C8.75 4.39 7 2 7 2S5.25 4.39 5.25 5.77 5.9 7.5 7 7.5s1.75-.35 1.75-1.73zm6 0C14.75 4.39 13 2 13 2s-1.75 2.39-1.75 3.77S11.9 7.5 13 7.5s1.75-.35 1.75-1.73zM9 17V9c0-.55-.45-1-1-1H6c-.55 0-1 .45-1 1v8c0 .55.45 1 1 1h2c.55 0 1-.45 1-1zm6 0V9c0-.55-.45-1-1-1h-2c-.55 0-1 .45-1 1v8c0 .55.45 1 1 1h2c.55 0 1-.45 1-1zm-9-6l2-1v2l-2 1v-2zm6 0l2-1v2l-2 1v-2zm-6 3l2-1v2l-2 1v-2zm6 0l2-1v2l-2 1v-2z";break;case"buddicons-groups":e="M15.45 6.25c1.83.94 1.98 3.18.7 4.98-.8 1.12-2.33 1.88-3.46 1.78L10.05 18H9l-2.65-4.99c-1.13.16-2.73-.63-3.55-1.79-1.28-1.8-1.13-4.04.71-4.97.48-.24.96-.33 1.43-.31-.01.4.01.8.07 1.21.26 1.69 1.41 3.53 2.86 4.37-.19.55-.49.99-.88 1.25L9 16.58v-5.66C7.64 10.55 6.26 8.76 6 7c-.4-2.65 1-5 3.5-5s3.9 2.35 3.5 5c-.26 1.76-1.64 3.55-3 3.92v5.77l2.07-3.84c-.44-.23-.77-.71-.99-1.3 1.48-.83 2.65-2.69 2.91-4.4.06-.41.08-.82.07-1.22.46-.01.92.08 1.39.32z";break;case"buddicons-pm":e="M10 2c3 0 8 5 8 5v11H2V7s5-5 8-5zm7 14.72l-3.73-2.92L17 11l-.43-.37-2.26 1.3.24-4.31-8.77-.52-.46 4.54-1.99-.95L3 11l3.73 2.8-3.44 2.85.4.43L10 13l6.53 4.15z";break;case"buddicons-replies":e="M17.54 10.29c1.17 1.17 1.17 3.08 0 4.25-1.18 1.17-3.08 1.17-4.25 0l-.34-.52c0 3.66-2 4.38-2.95 4.98-.82-.6-2.95-1.28-2.95-4.98l-.34.52c-1.17 1.17-3.07 1.17-4.25 0-1.17-1.17-1.17-3.08 0-4.25 0 0 1.02-.67 2.1-1.3C3.71 7.84 3.2 6.42 3.2 4.88c0-.34.03-.67.08-1C3.53 5.66 4.47 7.22 5.8 8.3c.67-.35 1.85-.83 2.37-.92H8c-1.1 0-2-.9-2-2s.9-2 2-2v-.5c0-.28.22-.5.5-.5s.5.22.5.5v.5h2v-.5c0-.28.22-.5.5-.5s.5.22.5.5v.5c1.1 0 2 .9 2 2s-.9 2-2 2h-.17c.51.09 1.78.61 2.38.92 1.33-1.08 2.27-2.64 2.52-4.42.05.33.08.66.08 1 0 1.54-.51 2.96-1.36 4.11 1.08.63 2.09 1.3 2.09 1.3zM8.5 6.38c.5 0 1-.45 1-1s-.45-1-1-1-1 .45-1 1 .45 1 1 1zm3-2c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1zm-2.3 5.73c-.12.11-.19.26-.19.43.02.25.23.46.49.46h1c.26 0 .47-.21.49-.46 0-.15-.07-.29-.19-.43-.08-.06-.18-.11-.3-.11h-1c-.12 0-.22.05-.3.11zM12 12.5c0-.12-.06-.28-.19-.38-.09-.07-.19-.12-.31-.12h-3c-.12 0-.22.05-.31.12-.11.1-.19.25-.19.38 0 .28.22.5.5.5h3c.28 0 .5-.22.5-.5zM8.5 15h3c.28 0 .5-.22.5-.5s-.22-.5-.5-.5h-3c-.28 0-.5.22-.5.5s.22.5.5.5zm1 2h1c.28 0 .5-.22.5-.5s-.22-.5-.5-.5h-1c-.28 0-.5.22-.5.5s.22.5.5.5z";break;case"buddicons-topics":e="M10.44 1.66c-.59-.58-1.54-.58-2.12 0L2.66 7.32c-.58.58-.58 1.53 0 2.12.6.6 1.56.56 2.12 0l5.66-5.66c.58-.58.59-1.53 0-2.12zm2.83 2.83c-.59-.59-1.54-.59-2.12 0l-5.66 5.66c-.59.58-.59 1.53 0 2.12.6.6 1.56.55 2.12 0l5.66-5.66c.58-.58.58-1.53 0-2.12zm1.06 6.72l4.18 4.18c.59.58.59 1.53 0 2.12s-1.54.59-2.12 0l-4.18-4.18-1.77 1.77c-.59.58-1.54.58-2.12 0-.59-.59-.59-1.54 0-2.13l5.66-5.65c.58-.59 1.53-.59 2.12 0 .58.58.58 1.53 0 2.12zM5 15c0-1.59-1.66-4-1.66-4S2 13.78 2 15s.6 2 1.34 2h.32C4.4 17 5 16.59 5 15z";break;case"buddicons-tracking":e="M10.98 6.78L15.5 15c-1 2-3.5 3-5.5 3s-4.5-1-5.5-3L9 6.82c-.75-1.23-2.28-1.98-4.29-2.03l2.46-2.92c1.68 1.19 2.46 2.32 2.97 3.31.56-.87 1.2-1.68 2.7-2.12l1.83 2.86c-1.42-.34-2.64.08-3.69.86zM8.17 10.4l-.93 1.69c.49.11 1 .16 1.54.16 1.35 0 2.58-.36 3.55-.95l-1.01-1.82c-.87.53-1.96.86-3.15.92zm.86 5.38c1.99 0 3.73-.74 4.74-1.86l-.98-1.76c-1 1.12-2.74 1.87-4.74 1.87-.62 0-1.21-.08-1.76-.21l-.63 1.15c.94.5 2.1.81 3.37.81z";break;case"building":e="M3 20h14V0H3v20zM7 3H5V1h2v2zm4 0H9V1h2v2zm4 0h-2V1h2v2zM7 6H5V4h2v2zm4 0H9V4h2v2zm4 0h-2V4h2v2zM7 9H5V7h2v2zm4 0H9V7h2v2zm4 0h-2V7h2v2zm-8 3H5v-2h2v2zm4 0H9v-2h2v2zm4 0h-2v-2h2v2zm-4 7H5v-6h6v6zm4-4h-2v-2h2v2zm0 3h-2v-2h2v2z";break;case"businessman":e="M7.3 6l-.03-.19c-.04-.37-.05-.73-.03-1.08.02-.36.1-.71.25-1.04.14-.32.31-.61.52-.86s.49-.46.83-.6c.34-.15.72-.23 1.13-.23.69 0 1.26.2 1.71.59s.76.87.91 1.44.18 1.16.09 1.78l-.03.19c-.01.09-.05.25-.11.48-.05.24-.12.47-.2.69-.08.21-.19.45-.34.72-.14.27-.3.49-.47.69-.18.19-.4.34-.67.48-.27.13-.55.19-.86.19s-.59-.06-.87-.19c-.26-.13-.49-.29-.67-.5-.18-.2-.34-.42-.49-.66-.15-.25-.26-.49-.34-.73-.09-.25-.16-.47-.21-.67-.06-.21-.1-.37-.12-.5zm9.2 6.24c.41.7.5 1.41.5 2.14v2.49c0 .03-.12.08-.29.13-.18.04-.42.13-.97.27-.55.12-1.1.24-1.65.34s-1.19.19-1.95.27c-.75.08-1.46.12-2.13.12-.68 0-1.39-.04-2.14-.12-.75-.07-1.4-.17-1.98-.27-.58-.11-1.08-.23-1.56-.34-.49-.11-.8-.21-1.06-.29L3 16.87v-2.49c0-.75.07-1.46.46-2.15s.81-1.25 1.5-1.68C5.66 10.12 7.19 10 8 10l1.67 1.67L9 13v3l1.02 1.08L11 16v-3l-.68-1.33L11.97 10c.77 0 2.2.07 2.9.52.71.45 1.21 1.02 1.63 1.72z";break;case"button":e="M17 5H3c-1.1 0-2 .9-2 2v6c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm1 7c0 .6-.4 1-1 1H3c-.6 0-1-.4-1-1V7c0-.6.4-1 1-1h14c.6 0 1 .4 1 1v5z";break;case"calendar-alt":e="M15 4h3v15H2V4h3V3c0-.41.15-.76.44-1.06.29-.29.65-.44 1.06-.44s.77.15 1.06.44c.29.3.44.65.44 1.06v1h4V3c0-.41.15-.76.44-1.06.29-.29.65-.44 1.06-.44s.77.15 1.06.44c.29.3.44.65.44 1.06v1zM6 3v2.5c0 .14.05.26.15.36.09.09.21.14.35.14s.26-.05.35-.14c.1-.1.15-.22.15-.36V3c0-.14-.05-.26-.15-.35-.09-.1-.21-.15-.35-.15s-.26.05-.35.15c-.1.09-.15.21-.15.35zm7 0v2.5c0 .14.05.26.14.36.1.09.22.14.36.14s.26-.05.36-.14c.09-.1.14-.22.14-.36V3c0-.14-.05-.26-.14-.35-.1-.1-.22-.15-.36-.15s-.26.05-.36.15c-.09.09-.14.21-.14.35zm4 15V8H3v10h14zM7 9v2H5V9h2zm2 0h2v2H9V9zm4 2V9h2v2h-2zm-6 1v2H5v-2h2zm2 0h2v2H9v-2zm4 2v-2h2v2h-2zm-6 1v2H5v-2h2zm4 2H9v-2h2v2zm4 0h-2v-2h2v2z";break;case"calendar":e="M15 4h3v14H2V4h3V3c0-.83.67-1.5 1.5-1.5S8 2.17 8 3v1h4V3c0-.83.67-1.5 1.5-1.5S15 2.17 15 3v1zM6 3v2.5c0 .28.22.5.5.5s.5-.22.5-.5V3c0-.28-.22-.5-.5-.5S6 2.72 6 3zm7 0v2.5c0 .28.22.5.5.5s.5-.22.5-.5V3c0-.28-.22-.5-.5-.5s-.5.22-.5.5zm4 14V8H3v9h14zM7 16V9H5v7h2zm4 0V9H9v7h2zm4 0V9h-2v7h2z";break;case"camera":e="M6 5V3H3v2h3zm12 10V4H9L7 6H2v9h16zm-7-8c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3z";break;case"carrot":e="M2 18.43c1.51 1.36 11.64-4.67 13.14-7.21.72-1.22-.13-3.01-1.52-4.44C15.2 5.73 16.59 9 17.91 8.31c.6-.32.99-1.31.7-1.92-.52-1.08-2.25-1.08-3.42-1.21.83-.2 2.82-1.05 2.86-2.25.04-.92-1.13-1.97-2.05-1.86-1.21.14-1.65 1.88-2.06 3-.05-.71-.2-2.27-.98-2.95-1.04-.91-2.29-.05-2.32 1.05-.04 1.33 2.82 2.07 1.92 3.67C11.04 4.67 9.25 4.03 8.1 4.7c-.49.31-1.05.91-1.63 1.69.89.94 2.12 2.07 3.09 2.72.2.14.26.42.11.62-.14.21-.42.26-.62.12-.99-.67-2.2-1.78-3.1-2.71-.45.67-.91 1.43-1.34 2.23.85.86 1.93 1.83 2.79 2.41.2.14.25.42.11.62-.14.21-.42.26-.63.12-.85-.58-1.86-1.48-2.71-2.32C2.4 13.69 1.1 17.63 2 18.43z";break;case"cart":e="M6 13h9c.55 0 1 .45 1 1s-.45 1-1 1H5c-.55 0-1-.45-1-1V4H2c-.55 0-1-.45-1-1s.45-1 1-1h3c.55 0 1 .45 1 1v2h13l-4 7H6v1zm-.5 3c.83 0 1.5.67 1.5 1.5S6.33 19 5.5 19 4 18.33 4 17.5 4.67 16 5.5 16zm9 0c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5-1.5-.67-1.5-1.5.67-1.5 1.5-1.5z";break;case"category":e="M5 7h13v10H2V4h7l2 2H4v9h1V7z";break;case"chart-area":e="M18 18l.01-12.28c.59-.35.99-.99.99-1.72 0-1.1-.9-2-2-2s-2 .9-2 2c0 .8.47 1.48 1.14 1.8l-4.13 6.58c-.33-.24-.73-.38-1.16-.38-.84 0-1.55.51-1.85 1.24l-2.14-1.53c.09-.22.14-.46.14-.71 0-1.11-.89-2-2-2-1.1 0-2 .89-2 2 0 .73.4 1.36.98 1.71L1 18h17zM17 3c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zM5 10c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm5.85 3c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1z";break;case"chart-bar":e="M18 18V2h-4v16h4zm-6 0V7H8v11h4zm-6 0v-8H2v8h4z";break;case"chart-line":e="M18 3.5c0 .62-.38 1.16-.92 1.38v13.11H1.99l4.22-6.73c-.13-.23-.21-.48-.21-.76C6 9.67 6.67 9 7.5 9S9 9.67 9 10.5c0 .13-.02.25-.05.37l1.44.63c.27-.3.67-.5 1.11-.5.18 0 .35.04.51.09l3.58-6.41c-.36-.27-.59-.7-.59-1.18 0-.83.67-1.5 1.5-1.5.19 0 .36.04.53.1l.05-.09v.11c.54.22.92.76.92 1.38zm-1.92 13.49V5.85l-3.29 5.89c.13.23.21.48.21.76 0 .83-.67 1.5-1.5 1.5s-1.5-.67-1.5-1.5l.01-.07-1.63-.72c-.25.18-.55.29-.88.29-.18 0-.35-.04-.51-.1l-3.2 5.09h12.29z";break;case"chart-pie":e="M10 10V3c3.87 0 7 3.13 7 7h-7zM9 4v7h7c0 3.87-3.13 7-7 7s-7-3.13-7-7 3.13-7 7-7z";break;case"clipboard":e="M11.9.39l1.4 1.4c1.61.19 3.5-.74 4.61.37s.18 3 .37 4.61l1.4 1.4c.39.39.39 1.02 0 1.41l-9.19 9.2c-.4.39-1.03.39-1.42 0L1.29 11c-.39-.39-.39-1.02 0-1.42l9.2-9.19c.39-.39 1.02-.39 1.41 0zm.58 2.25l-.58.58 4.95 4.95.58-.58c-.19-.6-.2-1.22-.15-1.82.02-.31.05-.62.09-.92.12-1 .18-1.63-.17-1.98s-.98-.29-1.98-.17c-.3.04-.61.07-.92.09-.6.05-1.22.04-1.82-.15zm4.02.93c.39.39.39 1.03 0 1.42s-1.03.39-1.42 0-.39-1.03 0-1.42 1.03-.39 1.42 0zm-6.72.36l-.71.7L15.44 11l.7-.71zM8.36 5.34l-.7.71 6.36 6.36.71-.7zM6.95 6.76l-.71.7 6.37 6.37.7-.71zM5.54 8.17l-.71.71 6.36 6.36.71-.71zM4.12 9.58l-.71.71 6.37 6.37.71-.71z";break;case"clock":e="M10 2c4.42 0 8 3.58 8 8s-3.58 8-8 8-8-3.58-8-8 3.58-8 8-8zm0 14c3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6 2.69 6 6 6zm-.71-5.29c.07.05.14.1.23.15l-.02.02L14 13l-3.03-3.19L10 5l-.97 4.81h.01c0 .02-.01.05-.02.09S9 9.97 9 10c0 .28.1.52.29.71z";break;case"cloud-saved":e="M14.8 9c.1-.3.2-.6.2-1 0-2.2-1.8-4-4-4-1.5 0-2.9.9-3.5 2.2-.3-.1-.7-.2-1-.2C5.1 6 4 7.1 4 8.5c0 .2 0 .4.1.5-1.8.3-3.1 1.7-3.1 3.5C1 14.4 2.6 16 4.5 16h10c1.9 0 3.5-1.6 3.5-3.5 0-1.8-1.4-3.3-3.2-3.5zm-6.3 5.9l-3.2-3.2 1.4-1.4 1.8 1.8 3.8-3.8 1.4 1.4-5.2 5.2z";break;case"cloud-upload":e="M14.8 9c.1-.3.2-.6.2-1 0-2.2-1.8-4-4-4-1.5 0-2.9.9-3.5 2.2-.3-.1-.7-.2-1-.2C5.1 6 4 7.1 4 8.5c0 .2 0 .4.1.5-1.8.3-3.1 1.7-3.1 3.5C1 14.4 2.6 16 4.5 16H8v-3H5l4.5-4.5L14 13h-3v3h3.5c1.9 0 3.5-1.6 3.5-3.5 0-1.8-1.4-3.3-3.2-3.5z";break;case"cloud":e="M14.9 9c1.8.2 3.1 1.7 3.1 3.5 0 1.9-1.6 3.5-3.5 3.5h-10C2.6 16 1 14.4 1 12.5 1 10.7 2.3 9.3 4.1 9 4 8.9 4 8.7 4 8.5 4 7.1 5.1 6 6.5 6c.3 0 .7.1.9.2C8.1 4.9 9.4 4 11 4c2.2 0 4 1.8 4 4 0 .4-.1.7-.1 1z";break;case"columns":e="M3 15h6V5H3v10zm8 0h6V5h-6v10z";break;case"controls-back":e="M2 10l10-6v3.6L18 4v12l-6-3.6V16z";break;case"controls-forward":e="M18 10L8 16v-3.6L2 16V4l6 3.6V4z";break;case"controls-pause":e="M5 16V4h3v12H5zm7-12h3v12h-3V4z";break;case"controls-play":e="M5 4l10 6-10 6V4z";break;case"controls-repeat":e="M5 7v3l-2 1.5V5h11V3l4 3.01L14 9V7H5zm10 6v-3l2-1.5V15H6v2l-4-3.01L6 11v2h9z";break;case"controls-skipback":e="M11.98 7.63l6-3.6v12l-6-3.6v3.6l-8-4.8v4.8h-2v-12h2v4.8l8-4.8v3.6z";break;case"controls-skipforward":e="M8 12.4L2 16V4l6 3.6V4l8 4.8V4h2v12h-2v-4.8L8 16v-3.6z";break;case"controls-volumeoff":e="M2 7h4l5-4v14l-5-4H2V7z";break;case"controls-volumeon":e="M2 7h4l5-4v14l-5-4H2V7zm12.69-2.46C14.82 4.59 18 5.92 18 10s-3.18 5.41-3.31 5.46c-.06.03-.13.04-.19.04-.2 0-.39-.12-.46-.31-.11-.26.02-.55.27-.65.11-.05 2.69-1.15 2.69-4.54 0-3.41-2.66-4.53-2.69-4.54-.25-.1-.38-.39-.27-.65.1-.25.39-.38.65-.27zM16 10c0 2.57-2.23 3.43-2.32 3.47-.06.02-.12.03-.18.03-.2 0-.39-.12-.47-.32-.1-.26.04-.55.29-.65.07-.02 1.68-.67 1.68-2.53s-1.61-2.51-1.68-2.53c-.25-.1-.38-.39-.29-.65.1-.25.39-.39.65-.29.09.04 2.32.9 2.32 3.47z";break;case"cover-image":e="M2.2 1h15.5c.7 0 1.3.6 1.3 1.2v11.5c0 .7-.6 1.2-1.2 1.2H2.2c-.6.1-1.2-.5-1.2-1.1V2.2C1 1.6 1.6 1 2.2 1zM17 13V3H3v10h14zm-4-4s0-5 3-5v7c0 .6-.4 1-1 1H5c-.6 0-1-.4-1-1V7c2 0 3 4 3 4s1-4 3-4 3 2 3 2zM4 17h12v2H4z";break;case"dashboard":e="M3.76 16h12.48c1.1-1.37 1.76-3.11 1.76-5 0-4.42-3.58-8-8-8s-8 3.58-8 8c0 1.89.66 3.63 1.76 5zM10 4c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zM6 6c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm8 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm-5.37 5.55L12 7v6c0 1.1-.9 2-2 2s-2-.9-2-2c0-.57.24-1.08.63-1.45zM4 10c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm12 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm-5 3c0-.55-.45-1-1-1s-1 .45-1 1 .45 1 1 1 1-.45 1-1z";break;case"desktop":e="M3 2h14c.55 0 1 .45 1 1v10c0 .55-.45 1-1 1h-5v2h2c.55 0 1 .45 1 1v1H5v-1c0-.55.45-1 1-1h2v-2H3c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1zm13 9V4H4v7h12zM5 5h9L5 9V5z";break;case"dismiss":e="M10 2c4.42 0 8 3.58 8 8s-3.58 8-8 8-8-3.58-8-8 3.58-8 8-8zm5 11l-3-3 3-3-2-2-3 3-3-3-2 2 3 3-3 3 2 2 3-3 3 3z";break;case"download":e="M14.01 4v6h2V2H4v8h2.01V4h8zm-2 2v6h3l-5 6-5-6h3V6h4z";break;case"edit":e="M13.89 3.39l2.71 2.72c.46.46.42 1.24.03 1.64l-8.01 8.02-5.56 1.16 1.16-5.58s7.6-7.63 7.99-8.03c.39-.39 1.22-.39 1.68.07zm-2.73 2.79l-5.59 5.61 1.11 1.11 5.54-5.65zm-2.97 8.23l5.58-5.6-1.07-1.08-5.59 5.6z";break;case"editor-aligncenter":e="M14 5V3H6v2h8zm3 4V7H3v2h14zm-3 4v-2H6v2h8zm3 4v-2H3v2h14z";break;case"editor-alignleft":e="M12 5V3H3v2h9zm5 4V7H3v2h14zm-5 4v-2H3v2h9zm5 4v-2H3v2h14z";break;case"editor-alignright":e="M17 5V3H8v2h9zm0 4V7H3v2h14zm0 4v-2H8v2h9zm0 4v-2H3v2h14z";break;case"editor-bold":e="M6 4v13h4.54c1.37 0 2.46-.33 3.26-1 .8-.66 1.2-1.58 1.2-2.77 0-.84-.17-1.51-.51-2.01s-.9-.85-1.67-1.03v-.09c.57-.1 1.02-.4 1.36-.9s.51-1.13.51-1.91c0-1.14-.39-1.98-1.17-2.5C12.75 4.26 11.5 4 9.78 4H6zm2.57 5.15V6.26h1.36c.73 0 1.27.11 1.61.32.34.22.51.58.51 1.07 0 .54-.16.92-.47 1.15s-.82.35-1.51.35h-1.5zm0 2.19h1.6c1.44 0 2.16.53 2.16 1.61 0 .6-.17 1.05-.51 1.34s-.86.43-1.57.43H8.57v-3.38z";break;case"editor-break":e="M16 4h2v9H7v3l-5-4 5-4v3h9V4z";break;case"editor-code":e="M9 6l-4 4 4 4-1 2-6-6 6-6zm2 8l4-4-4-4 1-2 6 6-6 6z";break;case"editor-contract":e="M15.75 6.75L18 3v14l-2.25-3.75L17 12h-4v4l1.25-1.25L18 17H2l3.75-2.25L7 16v-4H3l1.25 1.25L2 17V3l2.25 3.75L3 8h4V4L5.75 5.25 2 3h16l-3.75 2.25L13 4v4h4z";break;case"editor-customchar":e="M10 5.4c1.27 0 2.24.36 2.91 1.08.66.71 1 1.76 1 3.13 0 1.28-.23 2.37-.69 3.27-.47.89-1.27 1.52-2.22 2.12v2h6v-2h-3.69c.92-.64 1.62-1.34 2.12-2.34.49-1.01.74-2.13.74-3.35 0-1.78-.55-3.19-1.65-4.22S11.92 3.54 10 3.54s-3.43.53-4.52 1.57c-1.1 1.04-1.65 2.44-1.65 4.2 0 1.21.24 2.31.73 3.33.48 1.01 1.19 1.71 2.1 2.36H3v2h6v-2c-.98-.64-1.8-1.28-2.24-2.17-.45-.89-.67-1.96-.67-3.22 0-1.37.33-2.41 1-3.13C7.75 5.76 8.72 5.4 10 5.4z";break;case"editor-expand":e="M7 8h6v4H7zm-5 5v4h4l-1.2-1.2L7 12l-3.8 2.2M14 17h4v-4l-1.2 1.2L13 12l2.2 3.8M14 3l1.3 1.3L13 8l3.8-2.2L18 7V3M6 3H2v4l1.2-1.2L7 8 4.7 4.3";break;case"editor-help":e="M17 10c0-3.87-3.14-7-7-7-3.87 0-7 3.13-7 7s3.13 7 7 7c3.86 0 7-3.13 7-7zm-6.3 1.48H9.14v-.43c0-.38.08-.7.24-.98s.46-.57.88-.89c.41-.29.68-.53.81-.71.14-.18.2-.39.2-.62 0-.25-.09-.44-.28-.58-.19-.13-.45-.19-.79-.19-.58 0-1.25.19-2 .57l-.64-1.28c.87-.49 1.8-.74 2.77-.74.81 0 1.45.2 1.92.58.48.39.71.91.71 1.55 0 .43-.09.8-.29 1.11-.19.32-.57.67-1.11 1.06-.38.28-.61.49-.71.63-.1.15-.15.34-.15.57v.35zm-1.47 2.74c-.18-.17-.27-.42-.27-.73 0-.33.08-.58.26-.75s.43-.25.77-.25c.32 0 .57.09.75.26s.27.42.27.74c0 .3-.09.55-.27.72-.18.18-.43.27-.75.27-.33 0-.58-.09-.76-.26z";break;case"editor-indent":e="M3 5V3h9v2H3zm10-1V3h4v1h-4zm0 3h2V5l4 3.5-4 3.5v-2h-2V7zM3 8V6h9v2H3zm2 3V9h7v2H5zm-2 3v-2h9v2H3zm10 0v-1h4v1h-4zm-4 3v-2h3v2H9z";break;case"editor-insertmore":e="M17 7V3H3v4h14zM6 11V9H3v2h3zm6 0V9H8v2h4zm5 0V9h-3v2h3zm0 6v-4H3v4h14z";break;case"editor-italic":e="M14.78 6h-2.13l-2.8 9h2.12l-.62 2H4.6l.62-2h2.14l2.8-9H8.03l.62-2h6.75z";break;case"editor-justify":e="M2 3h16v2H2V3zm0 4h16v2H2V7zm0 4h16v2H2v-2zm0 4h16v2H2v-2z";break;case"editor-kitchensink":e="M19 2v6H1V2h18zm-1 5V3H2v4h16zM5 4v2H3V4h2zm3 0v2H6V4h2zm3 0v2H9V4h2zm3 0v2h-2V4h2zm3 0v2h-2V4h2zm2 5v9H1V9h18zm-1 8v-7H2v7h16zM5 11v2H3v-2h2zm3 0v2H6v-2h2zm3 0v2H9v-2h2zm6 0v2h-5v-2h5zm-6 3v2H3v-2h8zm3 0v2h-2v-2h2zm3 0v2h-2v-2h2z";break;case"editor-ltr":e="M5.52 2h7.43c.55 0 1 .45 1 1s-.45 1-1 1h-1v13c0 .55-.45 1-1 1s-1-.45-1-1V5c0-.55-.45-1-1-1s-1 .45-1 1v12c0 .55-.45 1-1 1s-1-.45-1-1v-5.96h-.43C3.02 11.04 1 9.02 1 6.52S3.02 2 5.52 2zM14 14l5-4-5-4v8z";break;case"editor-ol-rtl":e="M15.025 8.75a1.048 1.048 0 0 1 .45-.1.507.507 0 0 1 .35.11.455.455 0 0 1 .13.36.803.803 0 0 1-.06.3 1.448 1.448 0 0 1-.19.33c-.09.11-.29.32-.58.62l-.99 1v.58h2.76v-.7h-1.72v-.04l.51-.48a7.276 7.276 0 0 0 .7-.71 1.75 1.75 0 0 0 .3-.49 1.254 1.254 0 0 0 .1-.51.968.968 0 0 0-.16-.56 1.007 1.007 0 0 0-.44-.37 1.512 1.512 0 0 0-.65-.14 1.98 1.98 0 0 0-.51.06 1.9 1.9 0 0 0-.42.15 3.67 3.67 0 0 0-.48.35l.45.54a2.505 2.505 0 0 1 .45-.3zM16.695 15.29a1.29 1.29 0 0 0-.74-.3v-.02a1.203 1.203 0 0 0 .65-.37.973.973 0 0 0 .23-.65.81.81 0 0 0-.37-.71 1.72 1.72 0 0 0-1-.26 2.185 2.185 0 0 0-1.33.4l.4.6a1.79 1.79 0 0 1 .46-.23 1.18 1.18 0 0 1 .41-.07c.38 0 .58.15.58.46a.447.447 0 0 1-.22.43 1.543 1.543 0 0 1-.7.12h-.31v.66h.31a1.764 1.764 0 0 1 .75.12.433.433 0 0 1 .23.41.55.55 0 0 1-.2.47 1.084 1.084 0 0 1-.63.15 2.24 2.24 0 0 1-.57-.08 2.671 2.671 0 0 1-.52-.2v.74a2.923 2.923 0 0 0 1.18.22 1.948 1.948 0 0 0 1.22-.33 1.077 1.077 0 0 0 .43-.92.836.836 0 0 0-.26-.64zM15.005 4.17c.06-.05.16-.14.3-.28l-.02.42V7h.84V3h-.69l-1.29 1.03.4.51zM4.02 5h9v1h-9zM4.02 10h9v1h-9zM4.02 15h9v1h-9z";break;case"editor-ol":e="M6 7V3h-.69L4.02 4.03l.4.51.46-.37c.06-.05.16-.14.3-.28l-.02.42V7H6zm2-2h9v1H8V5zm-1.23 6.95v-.7H5.05v-.04l.51-.48c.33-.31.57-.54.7-.71.14-.17.24-.33.3-.49.07-.16.1-.33.1-.51 0-.21-.05-.4-.16-.56-.1-.16-.25-.28-.44-.37s-.41-.14-.65-.14c-.19 0-.36.02-.51.06-.15.03-.29.09-.42.15-.12.07-.29.19-.48.35l.45.54c.16-.13.31-.23.45-.3.15-.07.3-.1.45-.1.14 0 .26.03.35.11s.13.2.13.36c0 .1-.02.2-.06.3s-.1.21-.19.33c-.09.11-.29.32-.58.62l-.99 1v.58h2.76zM8 10h9v1H8v-1zm-1.29 3.95c0-.3-.12-.54-.37-.71-.24-.17-.58-.26-1-.26-.52 0-.96.13-1.33.4l.4.6c.17-.11.32-.19.46-.23.14-.05.27-.07.41-.07.38 0 .58.15.58.46 0 .2-.07.35-.22.43s-.38.12-.7.12h-.31v.66h.31c.34 0 .59.04.75.12.15.08.23.22.23.41 0 .22-.07.37-.2.47-.14.1-.35.15-.63.15-.19 0-.38-.03-.57-.08s-.36-.12-.52-.2v.74c.34.15.74.22 1.18.22.53 0 .94-.11 1.22-.33.29-.22.43-.52.43-.92 0-.27-.09-.48-.26-.64s-.42-.26-.74-.3v-.02c.27-.06.49-.19.65-.37.15-.18.23-.39.23-.65zM8 15h9v1H8v-1z";break;case"editor-outdent":e="M7 4V3H3v1h4zm10 1V3H8v2h9zM7 7H5V5L1 8.5 5 12v-2h2V7zm10 1V6H8v2h9zm-2 3V9H8v2h7zm2 3v-2H8v2h9zM7 14v-1H3v1h4zm4 3v-2H8v2h3z";break;case"editor-paragraph":e="M15 2H7.54c-.83 0-1.59.2-2.28.6-.7.41-1.25.96-1.65 1.65C3.2 4.94 3 5.7 3 6.52s.2 1.58.61 2.27c.4.69.95 1.24 1.65 1.64.69.41 1.45.61 2.28.61h.43V17c0 .27.1.51.29.71.2.19.44.29.71.29.28 0 .51-.1.71-.29.2-.2.3-.44.3-.71V5c0-.27.09-.51.29-.71.2-.19.44-.29.71-.29s.51.1.71.29c.19.2.29.44.29.71v12c0 .27.1.51.3.71.2.19.43.29.71.29.27 0 .51-.1.71-.29.19-.2.29-.44.29-.71V4H15c.27 0 .5-.1.7-.3.2-.19.3-.43.3-.7s-.1-.51-.3-.71C15.5 2.1 15.27 2 15 2z";break;case"editor-paste-text":e="M12.38 2L15 5v1H5V5l2.64-3h4.74zM10 5c.55 0 1-.44 1-1 0-.55-.45-1-1-1s-1 .45-1 1c0 .56.45 1 1 1zm5.45-1H17c.55 0 1 .45 1 1v12c0 .56-.45 1-1 1H3c-.55 0-1-.44-1-1V5c0-.55.45-1 1-1h1.55L4 4.63V7h12V4.63zM14 11V9H6v2h3v5h2v-5h3z";break;case"editor-paste-word":e="M12.38 2L15 5v1H5V5l2.64-3h4.74zM10 5c.55 0 1-.45 1-1s-.45-1-1-1-1 .45-1 1 .45 1 1 1zm8 12V5c0-.55-.45-1-1-1h-1.54l.54.63V7H4V4.62L4.55 4H3c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h14c.55 0 1-.45 1-1zm-3-8l-2 7h-2l-1-5-1 5H6.92L5 9h2l1 5 1-5h2l1 5 1-5h2z";break;case"editor-quote":e="M9.49 13.22c0-.74-.2-1.38-.61-1.9-.62-.78-1.83-.88-2.53-.72-.29-1.65 1.11-3.75 2.92-4.65L7.88 4c-2.73 1.3-5.42 4.28-4.96 8.05C3.21 14.43 4.59 16 6.54 16c.85 0 1.56-.25 2.12-.75s.83-1.18.83-2.03zm8.05 0c0-.74-.2-1.38-.61-1.9-.63-.78-1.83-.88-2.53-.72-.29-1.65 1.11-3.75 2.92-4.65L15.93 4c-2.73 1.3-5.41 4.28-4.95 8.05.29 2.38 1.66 3.95 3.61 3.95.85 0 1.56-.25 2.12-.75s.83-1.18.83-2.03z";break;case"editor-removeformatting":e="M14.29 4.59l1.1 1.11c.41.4.61.94.61 1.47v2.12c0 .53-.2 1.07-.61 1.47l-6.63 6.63c-.4.41-.94.61-1.47.61s-1.07-.2-1.47-.61l-1.11-1.1-1.1-1.11c-.41-.4-.61-.94-.61-1.47v-2.12c0-.54.2-1.07.61-1.48l6.63-6.62c.4-.41.94-.61 1.47-.61s1.06.2 1.47.61zm-6.21 9.7l6.42-6.42c.39-.39.39-1.03 0-1.43L12.36 4.3c-.19-.19-.45-.29-.72-.29s-.52.1-.71.29l-6.42 6.42c-.39.4-.39 1.04 0 1.43l2.14 2.14c.38.38 1.04.38 1.43 0z";break;case"editor-rtl":e="M5.52 2h7.43c.55 0 1 .45 1 1s-.45 1-1 1h-1v13c0 .55-.45 1-1 1s-1-.45-1-1V5c0-.55-.45-1-1-1s-1 .45-1 1v12c0 .55-.45 1-1 1s-1-.45-1-1v-5.96h-.43C3.02 11.04 1 9.02 1 6.52S3.02 2 5.52 2zM19 6l-5 4 5 4V6z";break;case"editor-spellcheck":e="M15.84 2.76c.25 0 .49.04.71.11.23.07.44.16.64.25l.35-.81c-.52-.26-1.08-.39-1.69-.39-.58 0-1.09.13-1.52.37-.43.25-.76.61-.99 1.08C13.11 3.83 13 4.38 13 5c0 .99.23 1.75.7 2.28s1.15.79 2.02.79c.6 0 1.13-.09 1.6-.26v-.84c-.26.08-.51.14-.74.19-.24.05-.49.08-.74.08-.59 0-1.04-.19-1.34-.57-.32-.37-.47-.93-.47-1.66 0-.7.16-1.25.48-1.65.33-.4.77-.6 1.33-.6zM6.5 8h1.04L5.3 2H4.24L2 8h1.03l.58-1.66H5.9zM8 2v6h2.17c.67 0 1.19-.15 1.57-.46.38-.3.56-.72.56-1.26 0-.4-.1-.72-.3-.95-.19-.24-.5-.39-.93-.47v-.04c.35-.06.6-.21.78-.44.18-.24.28-.53.28-.88 0-.52-.19-.9-.56-1.14-.36-.24-.96-.36-1.79-.36H8zm.98 2.48V2.82h.85c.44 0 .77.06.97.19.21.12.31.33.31.61 0 .31-.1.53-.29.66-.18.13-.48.2-.89.2h-.95zM5.64 5.5H3.9l.54-1.56c.14-.4.25-.76.32-1.1l.15.52c.07.23.13.4.17.51zm3.34-.23h.99c.44 0 .76.08.98.23.21.15.32.38.32.69 0 .34-.11.59-.32.75s-.52.24-.93.24H8.98V5.27zM4 13l5 5 9-8-1-1-8 6-4-3z";break;case"editor-strikethrough":e="M15.82 12.25c.26 0 .5-.02.74-.07.23-.05.48-.12.73-.2v.84c-.46.17-.99.26-1.58.26-.88 0-1.54-.26-2.01-.79-.39-.44-.62-1.04-.68-1.79h-.94c.12.21.18.48.18.79 0 .54-.18.95-.55 1.26-.38.3-.9.45-1.56.45H8v-2.5H6.59l.93 2.5H6.49l-.59-1.67H3.62L3.04 13H2l.93-2.5H2v-1h1.31l.93-2.49H5.3l.92 2.49H8V7h1.77c1 0 1.41.17 1.77.41.37.24.55.62.55 1.13 0 .35-.09.64-.27.87l-.08.09h1.29c.05-.4.15-.77.31-1.1.23-.46.55-.82.98-1.06.43-.25.93-.37 1.51-.37.61 0 1.17.12 1.69.38l-.35.81c-.2-.1-.42-.18-.64-.25s-.46-.11-.71-.11c-.55 0-.99.2-1.31.59-.23.29-.38.66-.44 1.11H17v1h-2.95c.06.5.2.9.44 1.19.3.37.75.56 1.33.56zM4.44 8.96l-.18.54H5.3l-.22-.61c-.04-.11-.09-.28-.17-.51-.07-.24-.12-.41-.14-.51-.08.33-.18.69-.33 1.09zm4.53-1.09V9.5h1.19c.28-.02.49-.09.64-.18.19-.13.28-.35.28-.66 0-.28-.1-.48-.3-.61-.2-.12-.53-.18-.97-.18h-.84zm-3.33 2.64v-.01H3.91v.01h1.73zm5.28.01l-.03-.02H8.97v1.68h1.04c.4 0 .71-.08.92-.23.21-.16.31-.4.31-.74 0-.31-.11-.54-.32-.69z";break;case"editor-table":e="M18 17V3H2v14h16zM16 7H4V5h12v2zm-7 4H4V9h5v2zm7 0h-5V9h5v2zm-7 4H4v-2h5v2zm7 0h-5v-2h5v2z";break;case"editor-textcolor":e="M13.23 15h1.9L11 4H9L5 15h1.88l1.07-3h4.18zm-1.53-4.54H8.51L10 5.6z";break;case"editor-ul":e="M5.5 7C4.67 7 4 6.33 4 5.5 4 4.68 4.67 4 5.5 4 6.32 4 7 4.68 7 5.5 7 6.33 6.32 7 5.5 7zM8 5h9v1H8V5zm-2.5 7c-.83 0-1.5-.67-1.5-1.5C4 9.68 4.67 9 5.5 9c.82 0 1.5.68 1.5 1.5 0 .83-.68 1.5-1.5 1.5zM8 10h9v1H8v-1zm-2.5 7c-.83 0-1.5-.67-1.5-1.5 0-.82.67-1.5 1.5-1.5.82 0 1.5.68 1.5 1.5 0 .83-.68 1.5-1.5 1.5zM8 15h9v1H8v-1z";break;case"editor-underline":e="M14 5h-2v5.71c0 1.99-1.12 2.98-2.45 2.98-1.32 0-2.55-1-2.55-2.96V5H5v5.87c0 1.91 1 4.54 4.48 4.54 3.49 0 4.52-2.58 4.52-4.5V5zm0 13v-2H5v2h9z";break;case"editor-unlink":e="M17.74 2.26c1.68 1.69 1.68 4.41 0 6.1l-1.53 1.52c-.32.33-.69.58-1.08.77L13 10l1.69-1.64.76-.77.76-.76c.84-.84.84-2.2 0-3.04-.84-.85-2.2-.85-3.04 0l-.77.76-.76.76L10 7l-.65-2.14c.19-.38.44-.75.77-1.07l1.52-1.53c1.69-1.68 4.42-1.68 6.1 0zM2 4l8 6-6-8zm4-2l4 8-2-8H6zM2 6l8 4-8-2V6zm7.36 7.69L10 13l.74 2.35-1.38 1.39c-1.69 1.68-4.41 1.68-6.1 0-1.68-1.68-1.68-4.42 0-6.1l1.39-1.38L7 10l-.69.64-1.52 1.53c-.85.84-.85 2.2 0 3.04.84.85 2.2.85 3.04 0zM18 16l-8-6 6 8zm-4 2l-4-8 2 8h2zm4-4l-8-4 8 2v2z";break;case"editor-video":e="M16 2h-3v1H7V2H4v15h3v-1h6v1h3V2zM6 3v1H5V3h1zm9 0v1h-1V3h1zm-2 1v5H7V4h6zM6 5v1H5V5h1zm9 0v1h-1V5h1zM6 7v1H5V7h1zm9 0v1h-1V7h1zM6 9v1H5V9h1zm9 0v1h-1V9h1zm-2 1v5H7v-5h6zm-7 1v1H5v-1h1zm9 0v1h-1v-1h1zm-9 2v1H5v-1h1zm9 0v1h-1v-1h1zm-9 2v1H5v-1h1zm9 0v1h-1v-1h1z";break;case"ellipsis":e="M5 10c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2zm12-2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-7 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z";break;case"email-alt":e="M19 14.5v-9c0-.83-.67-1.5-1.5-1.5H3.49c-.83 0-1.5.67-1.5 1.5v9c0 .83.67 1.5 1.5 1.5H17.5c.83 0 1.5-.67 1.5-1.5zm-1.31-9.11c.33.33.15.67-.03.84L13.6 9.95l3.9 4.06c.12.14.2.36.06.51-.13.16-.43.15-.56.05l-4.37-3.73-2.14 1.95-2.13-1.95-4.37 3.73c-.13.1-.43.11-.56-.05-.14-.15-.06-.37.06-.51l3.9-4.06-4.06-3.72c-.18-.17-.36-.51-.03-.84s.67-.17.95.07l6.24 5.04 6.25-5.04c.28-.24.62-.4.95-.07z";break;case"email-alt2":e="M18.01 11.18V2.51c0-1.19-.9-1.81-2-1.37L4 5.91c-1.1.44-2 1.77-2 2.97v8.66c0 1.2.9 1.81 2 1.37l12.01-4.77c1.1-.44 2-1.76 2-2.96zm-1.43-7.46l-6.04 9.33-6.65-4.6c-.1-.07-.36-.32-.17-.64.21-.36.65-.21.65-.21l6.3 2.32s4.83-6.34 5.11-6.7c.13-.17.43-.34.73-.13.29.2.16.49.07.63z";break;case"email":e="M3.87 4h13.25C18.37 4 19 4.59 19 5.79v8.42c0 1.19-.63 1.79-1.88 1.79H3.87c-1.25 0-1.88-.6-1.88-1.79V5.79c0-1.2.63-1.79 1.88-1.79zm6.62 8.6l6.74-5.53c.24-.2.43-.66.13-1.07-.29-.41-.82-.42-1.17-.17l-5.7 3.86L4.8 5.83c-.35-.25-.88-.24-1.17.17-.3.41-.11.87.13 1.07z";break;case"embed-audio":e="M17 4H3c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-7 3H7v4c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2c.4 0 .7.1 1 .3V5h4v2zm4 3.5L12.5 12l1.5 1.5V15l-3-3 3-3v1.5zm1 4.5v-1.5l1.5-1.5-1.5-1.5V9l3 3-3 3z";break;case"embed-generic":e="M17 4H3c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-3 6.5L12.5 12l1.5 1.5V15l-3-3 3-3v1.5zm1 4.5v-1.5l1.5-1.5-1.5-1.5V9l3 3-3 3z";break;case"embed-photo":e="M17 4H3c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-7 8H3V6h7v6zm4-1.5L12.5 12l1.5 1.5V15l-3-3 3-3v1.5zm1 4.5v-1.5l1.5-1.5-1.5-1.5V9l3 3-3 3zm-6-4V8.5L7.2 10 6 9.2 4 11h5zM4.6 8.6c.6 0 1-.4 1-1s-.4-1-1-1-1 .4-1 1 .4 1 1 1z";break;case"embed-post":e="M17 4H3c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM8.6 9l-.4.3c-.4.4-.5 1.1-.2 1.6l-.8.8-1.1-1.1-1.3 1.3c-.2.2-1.6 1.3-1.8 1.1-.2-.2.9-1.6 1.1-1.8l1.3-1.3-1.1-1.1.8-.8c.5.3 1.2.3 1.6-.2l.3-.3c.5-.5.5-1.2.2-1.7L8 5l3 2.9-.8.8c-.5-.2-1.2-.2-1.6.3zm5.4 1.5L12.5 12l1.5 1.5V15l-3-3 3-3v1.5zm1 4.5v-1.5l1.5-1.5-1.5-1.5V9l3 3-3 3z";break;case"embed-video":e="M17 4H3c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-7 6.5L8 9.1V11H3V6h5v1.8l2-1.3v4zm4 0L12.5 12l1.5 1.5V15l-3-3 3-3v1.5zm1 4.5v-1.5l1.5-1.5-1.5-1.5V9l3 3-3 3z";break;case"excerpt-view":e="M19 18V2c0-.55-.45-1-1-1H2c-.55 0-1 .45-1 1v16c0 .55.45 1 1 1h16c.55 0 1-.45 1-1zM4 3c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm13 0v6H6V3h11zM4 11c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm13 0v6H6v-6h11z";break;case"exit":e="M13 3v2h2v10h-2v2h4V3h-4zm0 8V9H5.4l4.3-4.3-1.4-1.4L1.6 10l6.7 6.7 1.4-1.4L5.4 11H13z";break;case"external":e="M9 3h8v8l-2-1V6.92l-5.6 5.59-1.41-1.41L14.08 5H10zm3 12v-3l2-2v7H3V6h8L9 8H5v7h7z";break;case"facebook-alt":e="M8.46 18h2.93v-7.3h2.45l.37-2.84h-2.82V6.04c0-.82.23-1.38 1.41-1.38h1.51V2.11c-.26-.03-1.15-.11-2.19-.11-2.18 0-3.66 1.33-3.66 3.76v2.1H6v2.84h2.46V18z";break;case"facebook":e="M2.89 2h14.23c.49 0 .88.39.88.88v14.24c0 .48-.39.88-.88.88h-4.08v-6.2h2.08l.31-2.41h-2.39V7.85c0-.7.2-1.18 1.2-1.18h1.28V4.51c-.22-.03-.98-.09-1.86-.09-1.85 0-3.11 1.12-3.11 3.19v1.78H8.46v2.41h2.09V18H2.89c-.49 0-.89-.4-.89-.88V2.88c0-.49.4-.88.89-.88z";break;case"feedback":e="M2 2h16c.55 0 1 .45 1 1v14c0 .55-.45 1-1 1H2c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1zm15 14V7H3v9h14zM4 8v1h3V8H4zm4 0v3h8V8H8zm-4 4v1h3v-1H4zm4 0v3h8v-3H8z";break;case"filter":e="M3 4.5v-2s3.34-1 7-1 7 1 7 1v2l-5 7.03v6.97s-1.22-.09-2.25-.59S8 16.5 8 16.5v-4.97z";break;case"flag":e="M5 18V3H3v15h2zm1-6V4c3-1 7 1 11 0v8c-3 1.27-8-1-11 0z";break;case"format-aside":e="M1 1h18v12l-6 6H1V1zm3 3v1h12V4H4zm0 4v1h12V8H4zm6 5v-1H4v1h6zm2 4l5-5h-5v5z";break;case"format-audio":e="M6.99 3.08l11.02-2c.55-.08.99.45.99 1V14.5c0 1.94-1.57 3.5-3.5 3.5S12 16.44 12 14.5c0-1.93 1.57-3.5 3.5-3.5.54 0 1.04.14 1.5.35V5.08l-9 2V16c-.24 1.7-1.74 3-3.5 3C2.57 19 1 17.44 1 15.5 1 13.57 2.57 12 4.5 12c.54 0 1.04.14 1.5.35V4.08c0-.55.44-.91.99-1z";break;case"format-chat":e="M11 6h-.82C9.07 6 8 7.2 8 8.16V10l-3 3v-3H3c-1.1 0-2-.9-2-2V3c0-1.1.9-2 2-2h6c1.1 0 2 .9 2 2v3zm0 1h6c1.1 0 2 .9 2 2v5c0 1.1-.9 2-2 2h-2v3l-3-3h-1c-1.1 0-2-.9-2-2V9c0-1.1.9-2 2-2z";break;case"format-gallery":e="M16 4h1.96c.57 0 1.04.47 1.04 1.04v12.92c0 .57-.47 1.04-1.04 1.04H5.04C4.47 19 4 18.53 4 17.96V16H2.04C1.47 16 1 15.53 1 14.96V2.04C1 1.47 1.47 1 2.04 1h12.92c.57 0 1.04.47 1.04 1.04V4zM3 14h11V3H3v11zm5-8.5C8 4.67 7.33 4 6.5 4S5 4.67 5 5.5 5.67 7 6.5 7 8 6.33 8 5.5zm2 4.5s1-5 3-5v8H4V7c2 0 2 3 2 3s.33-2 2-2 2 2 2 2zm7 7V6h-1v8.96c0 .57-.47 1.04-1.04 1.04H6v1h11z";break;case"format-image":e="M2.25 1h15.5c.69 0 1.25.56 1.25 1.25v15.5c0 .69-.56 1.25-1.25 1.25H2.25C1.56 19 1 18.44 1 17.75V2.25C1 1.56 1.56 1 2.25 1zM17 17V3H3v14h14zM10 6c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2zm3 5s0-6 3-6v10c0 .55-.45 1-1 1H5c-.55 0-1-.45-1-1V8c2 0 3 4 3 4s1-3 3-3 3 2 3 2z";break;case"format-quote":e="M8.54 12.74c0-.87-.24-1.61-.72-2.22-.73-.92-2.14-1.03-2.96-.85-.34-1.93 1.3-4.39 3.42-5.45L6.65 1.94C3.45 3.46.31 6.96.85 11.37 1.19 14.16 2.8 16 5.08 16c1 0 1.83-.29 2.48-.88.66-.59.98-1.38.98-2.38zm9.43 0c0-.87-.24-1.61-.72-2.22-.73-.92-2.14-1.03-2.96-.85-.34-1.93 1.3-4.39 3.42-5.45l-1.63-2.28c-3.2 1.52-6.34 5.02-5.8 9.43.34 2.79 1.95 4.63 4.23 4.63 1 0 1.83-.29 2.48-.88.66-.59.98-1.38.98-2.38z";break;case"format-status":e="M10 1c7 0 9 2.91 9 6.5S17 14 10 14s-9-2.91-9-6.5S3 1 10 1zM5.5 9C6.33 9 7 8.33 7 7.5S6.33 6 5.5 6 4 6.67 4 7.5 4.67 9 5.5 9zM10 9c.83 0 1.5-.67 1.5-1.5S10.83 6 10 6s-1.5.67-1.5 1.5S9.17 9 10 9zm4.5 0c.83 0 1.5-.67 1.5-1.5S15.33 6 14.5 6 13 6.67 13 7.5 13.67 9 14.5 9zM6 14.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5-1.5-.67-1.5-1.5.67-1.5 1.5-1.5zm-3 2c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1z";break;case"format-video":e="M2 1h16c.55 0 1 .45 1 1v16l-18-.02V2c0-.55.45-1 1-1zm4 1L4 5h1l2-3H6zm4 0H9L7 5h1zm3 0h-1l-2 3h1zm3 0h-1l-2 3h1zm1 14V6H3v10h14zM8 7l6 4-6 4V7z";break;case"forms":e="M2 2h7v7H2V2zm9 0v7h7V2h-7zM5.5 4.5L7 3H4zM12 8V3h5v5h-5zM4.5 5.5L3 4v3zM8 4L6.5 5.5 8 7V4zM5.5 6.5L4 8h3zM9 18v-7H2v7h7zm9 0h-7v-7h7v7zM8 12v5H3v-5h5zm6.5 1.5L16 12h-3zM12 16l1.5-1.5L12 13v3zm3.5-1.5L17 16v-3zm-1 1L13 17h3z";break;case"googleplus":e="M6.73 10h5.4c.05.29.09.57.09.95 0 3.27-2.19 5.6-5.49 5.6-3.17 0-5.73-2.57-5.73-5.73 0-3.17 2.56-5.73 5.73-5.73 1.54 0 2.84.57 3.83 1.5l-1.55 1.5c-.43-.41-1.17-.89-2.28-.89-1.96 0-3.55 1.62-3.55 3.62 0 1.99 1.59 3.61 3.55 3.61 2.26 0 3.11-1.62 3.24-2.47H6.73V10zM19 10v1.64h-1.64v1.63h-1.63v-1.63h-1.64V10h1.64V8.36h1.63V10H19z";break;case"grid-view":e="M2 1h16c.55 0 1 .45 1 1v16c0 .55-.45 1-1 1H2c-.55 0-1-.45-1-1V2c0-.55.45-1 1-1zm7.01 7.99v-6H3v6h6.01zm8 0v-6h-6v6h6zm-8 8.01v-6H3v6h6.01zm8 0v-6h-6v6h6z";break;case"groups":e="M8.03 4.46c-.29 1.28.55 3.46 1.97 3.46 1.41 0 2.25-2.18 1.96-3.46-.22-.98-1.08-1.63-1.96-1.63-.89 0-1.74.65-1.97 1.63zm-4.13.9c-.25 1.08.47 2.93 1.67 2.93s1.92-1.85 1.67-2.93c-.19-.83-.92-1.39-1.67-1.39s-1.48.56-1.67 1.39zm8.86 0c-.25 1.08.47 2.93 1.66 2.93 1.2 0 1.92-1.85 1.67-2.93-.19-.83-.92-1.39-1.67-1.39-.74 0-1.47.56-1.66 1.39zm-.59 11.43l1.25-4.3C14.2 10 12.71 8.47 10 8.47c-2.72 0-4.21 1.53-3.44 4.02l1.26 4.3C8.05 17.51 9 18 10 18c.98 0 1.94-.49 2.17-1.21zm-6.1-7.63c-.49.67-.96 1.83-.42 3.59l1.12 3.79c-.34.2-.77.31-1.2.31-.85 0-1.65-.41-1.85-1.03l-1.07-3.65c-.65-2.11.61-3.4 2.92-3.4.27 0 .54.02.79.06-.1.1-.2.22-.29.33zm8.35-.39c2.31 0 3.58 1.29 2.92 3.4l-1.07 3.65c-.2.62-1 1.03-1.85 1.03-.43 0-.86-.11-1.2-.31l1.11-3.77c.55-1.78.08-2.94-.42-3.61-.08-.11-.18-.23-.28-.33.25-.04.51-.06.79-.06z";break;case"hammer":e="M17.7 6.32l1.41 1.42-3.47 3.41-1.42-1.42.84-.82c-.32-.76-.81-1.57-1.51-2.31l-4.61 6.59-5.26 4.7c-.39.39-1.02.39-1.42 0l-1.2-1.21c-.39-.39-.39-1.02 0-1.41l10.97-9.92c-1.37-.86-3.21-1.46-5.67-1.48 2.7-.82 4.95-.93 6.58-.3 1.7.66 2.82 2.2 3.91 3.58z";break;case"heading":e="M12.5 4v5.2h-5V4H5v13h2.5v-5.2h5V17H15V4";break;case"heart":e="M10 17.12c3.33-1.4 5.74-3.79 7.04-6.21 1.28-2.41 1.46-4.81.32-6.25-1.03-1.29-2.37-1.78-3.73-1.74s-2.68.63-3.63 1.46c-.95-.83-2.27-1.42-3.63-1.46s-2.7.45-3.73 1.74c-1.14 1.44-.96 3.84.34 6.25 1.28 2.42 3.69 4.81 7.02 6.21z";break;case"hidden":e="M17.2 3.3l.16.17c.39.39.39 1.02 0 1.41L4.55 17.7c-.39.39-1.03.39-1.41 0l-.17-.17c-.39-.39-.39-1.02 0-1.41l1.59-1.6c-1.57-1-2.76-2.3-3.56-3.93.81-1.65 2.03-2.98 3.64-3.99S8.04 5.09 10 5.09c1.2 0 2.33.21 3.4.6l2.38-2.39c.39-.39 1.03-.39 1.42 0zm-7.09 4.01c-.23.25-.34.54-.34.88 0 .31.12.58.31.81l1.8-1.79c-.13-.12-.28-.21-.45-.26-.11-.01-.28-.03-.49-.04-.33.03-.6.16-.83.4zM2.4 10.59c.69 1.23 1.71 2.25 3.05 3.05l1.28-1.28c-.51-.69-.77-1.47-.77-2.36 0-1.06.36-1.98 1.09-2.76-1.04.27-1.96.7-2.76 1.26-.8.58-1.43 1.27-1.89 2.09zm13.22-2.13l.96-.96c1.02.86 1.83 1.89 2.42 3.09-.81 1.65-2.03 2.98-3.64 3.99s-3.4 1.51-5.36 1.51c-.63 0-1.24-.07-1.83-.18l1.07-1.07c.25.02.5.05.76.05 1.63 0 3.13-.4 4.5-1.21s2.4-1.84 3.1-3.09c-.46-.82-1.09-1.51-1.89-2.09-.03-.01-.06-.03-.09-.04zm-5.58 5.58l4-4c-.01 1.1-.41 2.04-1.18 2.81-.78.78-1.72 1.18-2.82 1.19z";break;case"html":e="M4 16v-2H2v2H1v-5h1v2h2v-2h1v5H4zM7 16v-4H5.6v-1h3.7v1H8v4H7zM10 16v-5h1l1.4 3.4h.1L14 11h1v5h-1v-3.1h-.1l-1.1 2.5h-.6l-1.1-2.5H11V16h-1zM19 16h-3v-5h1v4h2v1zM9.4 4.2L7.1 6.5l2.3 2.3-.6 1.2-3.5-3.5L8.8 3l.6 1.2zm1.2 4.6l2.3-2.3-2.3-2.3.6-1.2 3.5 3.5-3.5 3.5-.6-1.2z";break;case"id-alt":e="M18 18H2V2h16v16zM8.05 7.53c.13-.07.24-.15.33-.24.09-.1.17-.21.24-.34.07-.14.13-.26.17-.37s.07-.22.1-.34L8.95 6c0-.04.01-.07.01-.09.05-.32.03-.61-.04-.9-.08-.28-.23-.52-.46-.72C8.23 4.1 7.95 4 7.6 4c-.2 0-.39.04-.56.11-.17.08-.31.18-.41.3-.11.13-.2.27-.27.44-.07.16-.11.33-.12.51s0 .36.01.55l.02.09c.01.06.03.15.06.25s.06.21.1.33.1.25.17.37c.08.12.16.23.25.33s.2.19.34.25c.13.06.28.09.43.09s.3-.03.43-.09zM16 5V4h-5v1h5zm0 2V6h-5v1h5zM7.62 8.83l-1.38-.88c-.41 0-.79.11-1.14.32-.35.22-.62.5-.81.85-.19.34-.29.7-.29 1.07v1.25l.2.05c.13.04.31.09.55.14.24.06.51.12.8.17.29.06.62.1 1 .14.37.04.73.06 1.07.06s.69-.02 1.07-.06.7-.09.98-.14c.27-.05.54-.1.82-.17.27-.06.45-.11.54-.13.09-.03.16-.05.21-.06v-1.25c0-.36-.1-.72-.31-1.07s-.49-.64-.84-.86-.72-.33-1.11-.33zM16 9V8h-3v1h3zm0 2v-1h-3v1h3zm0 3v-1H4v1h12zm0 2v-1H4v1h12z";break;case"id":e="M18 16H2V4h16v12zM7.05 8.53c.13-.07.24-.15.33-.24.09-.1.17-.21.24-.34.07-.14.13-.26.17-.37s.07-.22.1-.34L7.95 7c0-.04.01-.07.01-.09.05-.32.03-.61-.04-.9-.08-.28-.23-.52-.46-.72C7.23 5.1 6.95 5 6.6 5c-.2 0-.39.04-.56.11-.17.08-.31.18-.41.3-.11.13-.2.27-.27.44-.07.16-.11.33-.12.51s0 .36.01.55l.02.09c.01.06.03.15.06.25s.06.21.1.33.1.25.17.37c.08.12.16.23.25.33s.2.19.34.25c.13.06.28.09.43.09s.3-.03.43-.09zM17 9V5h-5v4h5zm-10.38.83l-1.38-.88c-.41 0-.79.11-1.14.32-.35.22-.62.5-.81.85-.19.34-.29.7-.29 1.07v1.25l.2.05c.13.04.31.09.55.14.24.06.51.12.8.17.29.06.62.1 1 .14.37.04.73.06 1.07.06s.69-.02 1.07-.06.7-.09.98-.14c.27-.05.54-.1.82-.17.27-.06.45-.11.54-.13.09-.03.16-.05.21-.06v-1.25c0-.36-.1-.72-.31-1.07s-.49-.64-.84-.86-.72-.33-1.11-.33zM17 11v-1h-5v1h5zm0 2v-1h-5v1h5zm0 2v-1H3v1h14z";break;case"image-crop":e="M19 12v3h-4v4h-3v-4H4V7H0V4h4V0h3v4h7l3-3 1 1-3 3v7h4zm-8-5H7v4zm-3 5h4V8z";break;case"image-filter":e="M14 5.87c0-2.2-1.79-4-4-4s-4 1.8-4 4c0 2.21 1.79 4 4 4s4-1.79 4-4zM3.24 10.66c-1.92 1.1-2.57 3.55-1.47 5.46 1.11 1.92 3.55 2.57 5.47 1.47 1.91-1.11 2.57-3.55 1.46-5.47-1.1-1.91-3.55-2.56-5.46-1.46zm9.52 6.93c1.92 1.1 4.36.45 5.47-1.46 1.1-1.92.45-4.36-1.47-5.47-1.91-1.1-4.36-.45-5.46 1.46-1.11 1.92-.45 4.36 1.46 5.47z";break;case"image-flip-horizontal":e="M19 3v14h-8v3H9v-3H1V3h8V0h2v3h8zm-8.5 14V3h-1v14h1zM7 6.5L3 10l4 3.5v-7zM17 10l-4-3.5v7z";break;case"image-flip-vertical":e="M20 9v2h-3v8H3v-8H0V9h3V1h14v8h3zM6.5 7h7L10 3zM17 9.5H3v1h14v-1zM13.5 13h-7l3.5 4z";break;case"image-rotate-left":e="M7 5H5.05c0-1.74.85-2.9 2.95-2.9V0C4.85 0 2.96 2.11 2.96 5H1.18L3.8 8.39zm13-4v14h-5v5H1V10h9V1h10zm-2 2h-6v7h3v3h3V3zm-5 9H3v6h10v-6z";break;case"image-rotate-right":e="M15.95 5H14l3.2 3.39L19.82 5h-1.78c0-2.89-1.89-5-5.04-5v2.1c2.1 0 2.95 1.16 2.95 2.9zM1 1h10v9h9v10H6v-5H1V1zm2 2v10h3v-3h3V3H3zm5 9v6h10v-6H8z";break;case"image-rotate":e="M10.25 1.02c5.1 0 8.75 4.04 8.75 9s-3.65 9-8.75 9c-3.2 0-6.02-1.59-7.68-3.99l2.59-1.52c1.1 1.5 2.86 2.51 4.84 2.51 3.3 0 6-2.79 6-6s-2.7-6-6-6c-1.97 0-3.72 1-4.82 2.49L7 8.02l-6 2v-7L2.89 4.6c1.69-2.17 4.36-3.58 7.36-3.58z";break;case"images-alt":e="M4 15v-3H2V2h12v3h2v3h2v10H6v-3H4zm7-12c-1.1 0-2 .9-2 2h4c0-1.1-.89-2-2-2zm-7 8V6H3v5h1zm7-3h4c0-1.1-.89-2-2-2-1.1 0-2 .9-2 2zm-5 6V9H5v5h1zm9-1c1.1 0 2-.89 2-2 0-1.1-.9-2-2-2s-2 .9-2 2c0 1.11.9 2 2 2zm2 4v-2c-5 0-5-3-10-3v5h10z";break;case"images-alt2":e="M5 3h14v11h-2v2h-2v2H1V7h2V5h2V3zm13 10V4H6v9h12zm-3-4c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm1 6v-1H5V6H4v9h12zM7 6l10 6H7V6zm7 11v-1H3V8H2v9h12z";break;case"index-card":e="M1 3.17V18h18V4H8v-.83c0-.32-.12-.6-.35-.83S7.14 2 6.82 2H2.18c-.33 0-.6.11-.83.34-.24.23-.35.51-.35.83zM10 6v2H3V6h7zm7 0v10h-5V6h5zm-7 4v2H3v-2h7zm0 4v2H3v-2h7z";break;case"info-outline":e="M9 15h2V9H9v6zm1-10c-.5 0-1 .5-1 1s.5 1 1 1 1-.5 1-1-.5-1-1-1zm0-4c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 16c-3.9 0-7-3.1-7-7s3.1-7 7-7 7 3.1 7 7-3.1 7-7 7z";break;case"info":e="M10 2c4.42 0 8 3.58 8 8s-3.58 8-8 8-8-3.58-8-8 3.58-8 8-8zm1 4c0-.55-.45-1-1-1s-1 .45-1 1 .45 1 1 1 1-.45 1-1zm0 9V9H9v6h2z";break;case"insert-after":e="M9 12h2v-2h2V8h-2V6H9v2H7v2h2v2zm1 4c3.9 0 7-3.1 7-7s-3.1-7-7-7-7 3.1-7 7 3.1 7 7 7zm0-12c2.8 0 5 2.2 5 5s-2.2 5-5 5-5-2.2-5-5 2.2-5 5-5zM3 19h14v-2H3v2z";break;case"insert-before":e="M11 8H9v2H7v2h2v2h2v-2h2v-2h-2V8zm-1-4c-3.9 0-7 3.1-7 7s3.1 7 7 7 7-3.1 7-7-3.1-7-7-7zm0 12c-2.8 0-5-2.2-5-5s2.2-5 5-5 5 2.2 5 5-2.2 5-5 5zM3 1v2h14V1H3z";break;case"insert":e="M10 1c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 16c-3.9 0-7-3.1-7-7s3.1-7 7-7 7 3.1 7 7-3.1 7-7 7zm1-11H9v3H6v2h3v3h2v-3h3V9h-3V6z";break;case"instagram":e="M12.67 10A2.67 2.67 0 1 0 10 12.67 2.68 2.68 0 0 0 12.67 10zm1.43 0A4.1 4.1 0 1 1 10 5.9a4.09 4.09 0 0 1 4.1 4.1zm1.13-4.27a1 1 0 1 1-1-1 1 1 0 0 1 1 1zM10 3.44c-1.17 0-3.67-.1-4.72.32a2.67 2.67 0 0 0-1.52 1.52c-.42 1-.32 3.55-.32 4.72s-.1 3.67.32 4.72a2.74 2.74 0 0 0 1.52 1.52c1 .42 3.55.32 4.72.32s3.67.1 4.72-.32a2.83 2.83 0 0 0 1.52-1.52c.42-1.05.32-3.55.32-4.72s.1-3.67-.32-4.72a2.74 2.74 0 0 0-1.52-1.52c-1.05-.42-3.55-.32-4.72-.32zM18 10c0 1.1 0 2.2-.05 3.3a4.84 4.84 0 0 1-1.29 3.36A4.8 4.8 0 0 1 13.3 18H6.7a4.84 4.84 0 0 1-3.36-1.29 4.84 4.84 0 0 1-1.29-3.41C2 12.2 2 11.1 2 10V6.7a4.84 4.84 0 0 1 1.34-3.36A4.8 4.8 0 0 1 6.7 2.05C7.8 2 8.9 2 10 2h3.3a4.84 4.84 0 0 1 3.36 1.29A4.8 4.8 0 0 1 18 6.7V10z";break;case"keyboard-hide":e="M18,0 L2,0 C0.9,0 0.01,0.9 0.01,2 L0,12 C0,13.1 0.9,14 2,14 L18,14 C19.1,14 20,13.1 20,12 L20,2 C20,0.9 19.1,0 18,0 Z M18,12 L2,12 L2,2 L18,2 L18,12 Z M9,3 L11,3 L11,5 L9,5 L9,3 Z M9,6 L11,6 L11,8 L9,8 L9,6 Z M6,3 L8,3 L8,5 L6,5 L6,3 Z M6,6 L8,6 L8,8 L6,8 L6,6 Z M3,6 L5,6 L5,8 L3,8 L3,6 Z M3,3 L5,3 L5,5 L3,5 L3,3 Z M6,9 L14,9 L14,11 L6,11 L6,9 Z M12,6 L14,6 L14,8 L12,8 L12,6 Z M12,3 L14,3 L14,5 L12,5 L12,3 Z M15,6 L17,6 L17,8 L15,8 L15,6 Z M15,3 L17,3 L17,5 L15,5 L15,3 Z M10,20 L14,16 L6,16 L10,20 Z";break;case"laptop":e="M3 3h14c.6 0 1 .4 1 1v10c0 .6-.4 1-1 1H3c-.6 0-1-.4-1-1V4c0-.6.4-1 1-1zm13 2H4v8h12V5zm-3 1H5v4zm6 11v-1H1v1c0 .6.5 1 1.1 1h15.8c.6 0 1.1-.4 1.1-1z";break;case"layout":e="M2 2h5v11H2V2zm6 0h5v5H8V2zm6 0h4v16h-4V2zM8 8h5v5H8V8zm-6 6h11v4H2v-4z";break;case"leftright":e="M3 10.03L9 6v8zM11 6l6 4.03L11 14V6z";break;case"lightbulb":e="M10 1c3.11 0 5.63 2.52 5.63 5.62 0 1.84-2.03 4.58-2.03 4.58-.33.44-.6 1.25-.6 1.8v1c0 .55-.45 1-1 1H8c-.55 0-1-.45-1-1v-1c0-.55-.27-1.36-.6-1.8 0 0-2.02-2.74-2.02-4.58C4.38 3.52 6.89 1 10 1zM7 16.87V16h6v.87c0 .62-.13 1.13-.75 1.13H12c0 .62-.4 1-1.02 1h-2c-.61 0-.98-.38-.98-1h-.25c-.62 0-.75-.51-.75-1.13z";break;case"list-view":e="M2 19h16c.55 0 1-.45 1-1V2c0-.55-.45-1-1-1H2c-.55 0-1 .45-1 1v16c0 .55.45 1 1 1zM4 3c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm13 0v2H6V3h11zM4 7c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm13 0v2H6V7h11zM4 11c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm13 0v2H6v-2h11zM4 15c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm13 0v2H6v-2h11z";break;case"location-alt":e="M13 13.14l1.17-5.94c.79-.43 1.33-1.25 1.33-2.2 0-1.38-1.12-2.5-2.5-2.5S10.5 3.62 10.5 5c0 .95.54 1.77 1.33 2.2zm0-9.64c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5-1.5-.67-1.5-1.5.67-1.5 1.5-1.5zm1.72 4.8L18 6.97v9L13.12 18 7 15.97l-5 2v-9l5-2 4.27 1.41 1.73 7.3z";break;case"location":e="M10 2C6.69 2 4 4.69 4 8c0 2.02 1.17 3.71 2.53 4.89.43.37 1.18.96 1.85 1.83.74.97 1.41 2.01 1.62 2.71.21-.7.88-1.74 1.62-2.71.67-.87 1.42-1.46 1.85-1.83C14.83 11.71 16 10.02 16 8c0-3.31-2.69-6-6-6zm0 2.56c1.9 0 3.44 1.54 3.44 3.44S11.9 11.44 10 11.44 6.56 9.9 6.56 8 8.1 4.56 10 4.56z";break;case"lock":e="M14 9h1c.55 0 1 .45 1 1v7c0 .55-.45 1-1 1H5c-.55 0-1-.45-1-1v-7c0-.55.45-1 1-1h1V6c0-2.21 1.79-4 4-4s4 1.79 4 4v3zm-2 0V6c0-1.1-.9-2-2-2s-2 .9-2 2v3h4zm-1 7l-.36-2.15c.51-.24.86-.75.86-1.35 0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5c0 .6.35 1.11.86 1.35L9 16h2z";break;case"marker":e="M10 2c4.42 0 8 3.58 8 8s-3.58 8-8 8-8-3.58-8-8 3.58-8 8-8zm0 13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5z";break;case"media-archive":e="M12 2l4 4v12H4V2h8zm0 4h3l-3-3v3zM8 3.5v2l1.8-1zM11 5L9.2 6 11 7V5zM8 6.5v2l1.8-1zM11 8L9.2 9l1.8 1V8zM8 9.5v2l1.8-1zm3 1.5l-1.8 1 1.8 1v-2zm-1.5 6c.83 0 1.62-.72 1.5-1.63-.05-.38-.49-1.61-.49-1.61l-1.99-1.1s-.45 1.95-.52 2.71c-.07.77.67 1.63 1.5 1.63zm0-2.39c.42 0 .76.34.76.76 0 .43-.34.77-.76.77s-.76-.34-.76-.77c0-.42.34-.76.76-.76z";break;case"media-audio":e="M12 2l4 4v12H4V2h8zm0 4h3l-3-3v3zm1 7.26V8.09c0-.11-.04-.21-.12-.29-.07-.08-.16-.11-.27-.1 0 0-3.97.71-4.25.78C8.07 8.54 8 8.8 8 9v3.37c-.2-.09-.42-.07-.6-.07-.38 0-.7.13-.96.39-.26.27-.4.58-.4.96 0 .37.14.69.4.95.26.27.58.4.96.4.34 0 .7-.04.96-.26.26-.23.64-.65.64-1.12V10.3l3-.6V12c-.67-.2-1.17.04-1.44.31-.26.26-.39.58-.39.95 0 .38.13.69.39.96.27.26.71.39 1.08.39.38 0 .7-.13.96-.39.26-.27.4-.58.4-.96z";break;case"media-code":e="M12 2l4 4v12H4V2h8zM9 13l-2-2 2-2-1-1-3 3 3 3zm3 1l3-3-3-3-1 1 2 2-2 2z";break;case"media-default":e="M12 2l4 4v12H4V2h8zm0 4h3l-3-3v3z";break;case"media-document":e="M12 2l4 4v12H4V2h8zM5 3v1h6V3H5zm7 3h3l-3-3v3zM5 5v1h6V5H5zm10 3V7H5v1h10zM5 9v1h4V9H5zm10 3V9h-5v3h5zM5 11v1h4v-1H5zm10 3v-1H5v1h10zm-3 2v-1H5v1h7z";break;case"media-interactive":e="M12 2l4 4v12H4V2h8zm0 4h3l-3-3v3zm2 8V8H6v6h3l-1 2h1l1-2 1 2h1l-1-2h3zm-6-3c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm5-2v2h-3V9h3zm0 3v1H7v-1h6z";break;case"media-spreadsheet":e="M12 2l4 4v12H4V2h8zm-1 4V3H5v3h6zM8 8V7H5v1h3zm3 0V7H9v1h2zm4 0V7h-3v1h3zm-7 2V9H5v1h3zm3 0V9H9v1h2zm4 0V9h-3v1h3zm-7 2v-1H5v1h3zm3 0v-1H9v1h2zm4 0v-1h-3v1h3zm-7 2v-1H5v1h3zm3 0v-1H9v1h2zm4 0v-1h-3v1h3zm-7 2v-1H5v1h3zm3 0v-1H9v1h2z";break;case"media-text":e="M12 2l4 4v12H4V2h8zM5 3v1h6V3H5zm7 3h3l-3-3v3zM5 5v1h6V5H5zm10 3V7H5v1h10zm0 2V9H5v1h10zm0 2v-1H5v1h10zm-4 2v-1H5v1h6z";break;case"media-video":e="M12 2l4 4v12H4V2h8zm0 4h3l-3-3v3zm-1 8v-3c0-.27-.1-.51-.29-.71-.2-.19-.44-.29-.71-.29H7c-.27 0-.51.1-.71.29-.19.2-.29.44-.29.71v3c0 .27.1.51.29.71.2.19.44.29.71.29h3c.27 0 .51-.1.71-.29.19-.2.29-.44.29-.71zm3 1v-5l-2 2v1z";break;case"megaphone":e="M18.15 5.94c.46 1.62.38 3.22-.02 4.48-.42 1.28-1.26 2.18-2.3 2.48-.16.06-.26.06-.4.06-.06.02-.12.02-.18.02-.06.02-.14.02-.22.02h-6.8l2.22 5.5c.02.14-.06.26-.14.34-.08.1-.24.16-.34.16H6.95c-.1 0-.26-.06-.34-.16-.08-.08-.16-.2-.14-.34l-1-5.5H4.25l-.02-.02c-.5.06-1.08-.18-1.54-.62s-.88-1.08-1.06-1.88c-.24-.8-.2-1.56-.02-2.2.18-.62.58-1.08 1.06-1.3l.02-.02 9-5.4c.1-.06.18-.1.24-.16.06-.04.14-.08.24-.12.16-.08.28-.12.5-.18 1.04-.3 2.24.1 3.22.98s1.84 2.24 2.26 3.86zm-2.58 5.98h-.02c.4-.1.74-.34 1.04-.7.58-.7.86-1.76.86-3.04 0-.64-.1-1.3-.28-1.98-.34-1.36-1.02-2.5-1.78-3.24s-1.68-1.1-2.46-.88c-.82.22-1.4.96-1.7 2-.32 1.04-.28 2.36.06 3.72.38 1.36 1 2.5 1.8 3.24.78.74 1.62 1.1 2.48.88zm-2.54-7.08c.22-.04.42-.02.62.04.38.16.76.48 1.02 1s.42 1.2.42 1.78c0 .3-.04.56-.12.8-.18.48-.44.84-.86.94-.34.1-.8-.06-1.14-.4s-.64-.86-.78-1.5c-.18-.62-.12-1.24.02-1.72s.48-.84.82-.94z";break;case"menu-alt":e="M3 4h14v2H3V4zm0 5h14v2H3V9zm0 5h14v2H3v-2z";break;case"menu":e="M17 7V5H3v2h14zm0 4V9H3v2h14zm0 4v-2H3v2h14z";break;case"microphone":e="M12 9V3c0-1.1-.89-2-2-2-1.12 0-2 .94-2 2v6c0 1.1.9 2 2 2 1.13 0 2-.94 2-2zm4 0c0 2.97-2.16 5.43-5 5.91V17h2c.56 0 1 .45 1 1s-.44 1-1 1H7c-.55 0-1-.45-1-1s.45-1 1-1h2v-2.09C6.17 14.43 4 11.97 4 9c0-.55.45-1 1-1 .56 0 1 .45 1 1 0 2.21 1.8 4 4 4 2.21 0 4-1.79 4-4 0-.55.45-1 1-1 .56 0 1 .45 1 1z";break;case"migrate":e="M4 6h6V4H2v12.01h8V14H4V6zm2 2h6V5l6 5-6 5v-3H6V8z";break;case"minus":e="M4 9h12v2H4V9z";break;case"money":e="M0 3h20v12h-.75c0-1.79-1.46-3.25-3.25-3.25-1.31 0-2.42.79-2.94 1.91-.25-.1-.52-.16-.81-.16-.98 0-1.8.63-2.11 1.5H0V3zm8.37 3.11c-.06.15-.1.31-.11.47s-.01.33.01.5l.02.08c.01.06.02.14.05.23.02.1.06.2.1.31.03.11.09.22.15.33.07.12.15.22.23.31s.18.17.31.23c.12.06.25.09.4.09.14 0 .27-.03.39-.09s.22-.14.3-.22c.09-.09.16-.2.22-.32.07-.12.12-.23.16-.33s.07-.2.09-.31c.03-.11.04-.18.05-.22s.01-.07.01-.09c.05-.29.03-.56-.04-.82s-.21-.48-.41-.66c-.21-.18-.47-.27-.79-.27-.19 0-.36.03-.52.1-.15.07-.28.16-.38.28-.09.11-.17.25-.24.4zm4.48 6.04v-1.14c0-.33-.1-.66-.29-.98s-.45-.59-.77-.79c-.32-.21-.66-.31-1.02-.31l-1.24.84-1.28-.82c-.37 0-.72.1-1.04.3-.31.2-.56.46-.74.77-.18.32-.27.65-.27.99v1.14l.18.05c.12.04.29.08.51.14.23.05.47.1.74.15.26.05.57.09.91.13.34.03.67.05.99.05.3 0 .63-.02.98-.05.34-.04.64-.08.89-.13.25-.04.5-.1.76-.16l.5-.12c.08-.02.14-.04.19-.06zm3.15.1c1.52 0 2.75 1.23 2.75 2.75s-1.23 2.75-2.75 2.75c-.73 0-1.38-.3-1.87-.77.23-.35.37-.78.37-1.23 0-.77-.39-1.46-.99-1.86.43-.96 1.37-1.64 2.49-1.64zm-5.5 3.5c0-.96.79-1.75 1.75-1.75s1.75.79 1.75 1.75-.79 1.75-1.75 1.75-1.75-.79-1.75-1.75z";break;case"move":e="M19 10l-4 4v-3h-4v4h3l-4 4-4-4h3v-4H5v3l-4-4 4-4v3h4V5H6l4-4 4 4h-3v4h4V6z";break;case"nametag":e="M12 5V2c0-.55-.45-1-1-1H9c-.55 0-1 .45-1 1v3c0 .55.45 1 1 1h2c.55 0 1-.45 1-1zm-2-3c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm8 13V7c0-1.1-.9-2-2-2h-3v.33C13 6.25 12.25 7 11.33 7H8.67C7.75 7 7 6.25 7 5.33V5H4c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2zm-1-6v6H3V9h14zm-8 2c0-.55-.22-1-.5-1s-.5.45-.5 1 .22 1 .5 1 .5-.45.5-1zm3 0c0-.55-.22-1-.5-1s-.5.45-.5 1 .22 1 .5 1 .5-.45.5-1zm-5.96 1.21c.92.48 2.34.79 3.96.79s3.04-.31 3.96-.79c-.21 1-1.89 1.79-3.96 1.79s-3.75-.79-3.96-1.79z";break;case"networking":e="M18 13h1c.55 0 1 .45 1 1.01v2.98c0 .56-.45 1.01-1 1.01h-4c-.55 0-1-.45-1-1.01v-2.98c0-.56.45-1.01 1-1.01h1v-2h-5v2h1c.55 0 1 .45 1 1.01v2.98c0 .56-.45 1.01-1 1.01H8c-.55 0-1-.45-1-1.01v-2.98c0-.56.45-1.01 1-1.01h1v-2H4v2h1c.55 0 1 .45 1 1.01v2.98C6 17.55 5.55 18 5 18H1c-.55 0-1-.45-1-1.01v-2.98C0 13.45.45 13 1 13h1v-2c0-1.1.9-2 2-2h5V7H8c-.55 0-1-.45-1-1.01V3.01C7 2.45 7.45 2 8 2h4c.55 0 1 .45 1 1.01v2.98C13 6.55 12.55 7 12 7h-1v2h5c1.1 0 2 .9 2 2v2z";break;case"no-alt":e="M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z";break;case"no":e="M12.12 10l3.53 3.53-2.12 2.12L10 12.12l-3.54 3.54-2.12-2.12L7.88 10 4.34 6.46l2.12-2.12L10 7.88l3.54-3.53 2.12 2.12z";break;case"palmtree":e="M8.58 2.39c.32 0 .59.05.81.14 1.25.55 1.69 2.24 1.7 3.97.59-.82 2.15-2.29 3.41-2.29s2.94.73 3.53 3.55c-1.13-.65-2.42-.94-3.65-.94-1.26 0-2.45.32-3.29.89.4-.11.86-.16 1.33-.16 1.39 0 2.9.45 3.4 1.31.68 1.16.47 3.38-.76 4.14-.14-2.1-1.69-4.12-3.47-4.12-.44 0-.88.12-1.33.38C8 10.62 7 14.56 7 19H2c0-5.53 4.21-9.65 7.68-10.79-.56-.09-1.17-.15-1.82-.15C6.1 8.06 4.05 8.5 2 10c.76-2.96 2.78-4.1 4.69-4.1 1.25 0 2.45.5 3.2 1.29-.66-2.24-2.49-2.86-4.08-2.86-.8 0-1.55.16-2.05.35.91-1.29 3.31-2.29 4.82-2.29zM13 11.5c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5.67 1.5 1.5 1.5 1.5-.67 1.5-1.5z";break;case"paperclip":e="M17.05 2.7c1.93 1.94 1.93 5.13 0 7.07L10 16.84c-1.88 1.89-4.91 1.93-6.86.15-.06-.05-.13-.09-.19-.15-1.93-1.94-1.93-5.12 0-7.07l4.94-4.95c.91-.92 2.28-1.1 3.39-.58.3.15.59.33.83.58 1.17 1.17 1.17 3.07 0 4.24l-4.93 4.95c-.39.39-1.02.39-1.41 0s-.39-1.02 0-1.41l4.93-4.95c.39-.39.39-1.02 0-1.41-.38-.39-1.02-.39-1.4 0l-4.94 4.95c-.91.92-1.1 2.29-.57 3.4.14.3.32.59.57.84s.54.43.84.57c1.11.53 2.47.35 3.39-.57l7.05-7.07c1.16-1.17 1.16-3.08 0-4.25-.56-.55-1.28-.83-2-.86-.08.01-.16.01-.24 0-.22-.03-.43-.11-.6-.27-.39-.4-.38-1.05.02-1.45.16-.16.36-.24.56-.28.14-.02.27-.01.4.02 1.19.06 2.36.52 3.27 1.43z";break;case"performance":e="M3.76 17.01h12.48C17.34 15.63 18 13.9 18 12c0-4.41-3.58-8-8-8s-8 3.59-8 8c0 1.9.66 3.63 1.76 5.01zM9 6c0-.55.45-1 1-1s1 .45 1 1c0 .56-.45 1-1 1s-1-.44-1-1zM4 8c0-.55.45-1 1-1s1 .45 1 1c0 .56-.45 1-1 1s-1-.44-1-1zm4.52 3.4c.84-.83 6.51-3.5 6.51-3.5s-2.66 5.68-3.49 6.51c-.84.84-2.18.84-3.02 0-.83-.83-.83-2.18 0-3.01zM3 13c0-.55.45-1 1-1s1 .45 1 1c0 .56-.45 1-1 1s-1-.44-1-1zm6 0c0-.55.45-1 1-1s1 .45 1 1c0 .56-.45 1-1 1s-1-.44-1-1zm6 0c0-.55.45-1 1-1s1 .45 1 1c0 .56-.45 1-1 1s-1-.44-1-1z";break;case"phone":e="M12.06 6l-.21-.2c-.52-.54-.43-.79.08-1.3l2.72-2.75c.81-.82.96-1.21 1.73-.48l.21.2zm.53.45l4.4-4.4c.7.94 2.34 3.47 1.53 5.34-.73 1.67-1.09 1.75-2 3-1.85 2.11-4.18 4.37-6 6.07-1.26.91-1.31 1.33-3 2-1.8.71-4.4-.89-5.38-1.56l4.4-4.4 1.18 1.62c.34.46 1.2-.06 1.8-.66 1.04-1.05 3.18-3.18 4-4.07.59-.59 1.12-1.45.66-1.8zM1.57 16.5l-.21-.21c-.68-.74-.29-.9.52-1.7l2.74-2.72c.51-.49.75-.6 1.27-.11l.2.21z";break;case"playlist-audio":e="M17 3V1H2v2h15zm0 4V5H2v2h15zm-7 4V9H2v2h8zm7.45-1.96l-6 1.12c-.16.02-.19.03-.29.13-.11.09-.16.22-.16.37v4.59c-.29-.13-.66-.14-.93-.14-.54 0-1 .19-1.38.57s-.56.84-.56 1.38c0 .53.18.99.56 1.37s.84.57 1.38.57c.49 0 .92-.16 1.29-.48s.59-.71.65-1.19v-4.95L17 11.27v3.48c-.29-.13-.56-.19-.83-.19-.54 0-1.11.19-1.49.57-.38.37-.57.83-.57 1.37s.19.99.57 1.37.84.57 1.38.57c.53 0 .99-.19 1.37-.57s.57-.83.57-1.37V9.6c0-.16-.05-.3-.16-.41-.11-.12-.24-.17-.39-.15zM8 15v-2H2v2h6zm-2 4v-2H2v2h4z";break;case"playlist-video":e="M17 3V1H2v2h15zm0 4V5H2v2h15zM6 11V9H2v2h4zm2-2h9c.55 0 1 .45 1 1v8c0 .55-.45 1-1 1H8c-.55 0-1-.45-1-1v-8c0-.55.45-1 1-1zm3 7l3.33-2L11 12v4zm-5-1v-2H2v2h4zm0 4v-2H2v2h4z";break;case"plus-alt":e="M15.8 4.2c3.2 3.21 3.2 8.39 0 11.6-3.21 3.2-8.39 3.2-11.6 0C1 12.59 1 7.41 4.2 4.2 7.41 1 12.59 1 15.8 4.2zm-4.3 11.3v-4h4v-3h-4v-4h-3v4h-4v3h4v4h3z";break;case"plus-light":e="M17 9v2h-6v6H9v-6H3V9h6V3h2v6h6z";break;case"plus":e="M17 7v3h-5v5H9v-5H4V7h5V2h3v5h5z";break;case"portfolio":e="M4 5H.78c-.37 0-.74.32-.69.84l1.56 9.99S3.5 8.47 3.86 6.7c.11-.53.61-.7.98-.7H10s-.7-2.08-.77-2.31C9.11 3.25 8.89 3 8.45 3H5.14c-.36 0-.7.23-.8.64C4.25 4.04 4 5 4 5zm4.88 0h-4s.42-1 .87-1h2.13c.48 0 1 1 1 1zM2.67 16.25c-.31.47-.76.75-1.26.75h15.73c.54 0 .92-.31 1.03-.83.44-2.19 1.68-8.44 1.68-8.44.07-.5-.3-.73-.62-.73H16V5.53c0-.16-.26-.53-.66-.53h-3.76c-.52 0-.87.58-.87.58L10 7H5.59c-.32 0-.63.19-.69.5 0 0-1.59 6.7-1.72 7.33-.07.37-.22.99-.51 1.42zM15.38 7H11s.58-1 1.13-1h2.29c.71 0 .96 1 .96 1z";break;case"post-status":e="M14 6c0 1.86-1.28 3.41-3 3.86V16c0 1-2 2-2 2V9.86c-1.72-.45-3-2-3-3.86 0-2.21 1.79-4 4-4s4 1.79 4 4zM8 5c0 .55.45 1 1 1s1-.45 1-1-.45-1-1-1-1 .45-1 1z";break;case"pressthis":e="M14.76 1C16.55 1 18 2.46 18 4.25c0 1.78-1.45 3.24-3.24 3.24-.23 0-.47-.03-.7-.08L13 8.47V19H2V4h9.54c.13-2 1.52-3 3.22-3zm0 5.49C16 6.49 17 5.48 17 4.25 17 3.01 16 2 14.76 2s-2.24 1.01-2.24 2.25c0 .37.1.72.27 1.03L9.57 8.5c-.28.28-1.77 2.22-1.5 2.49.02.03.06.04.1.04.49 0 2.14-1.28 2.39-1.53l3.24-3.24c.29.14.61.23.96.23z";break;case"products":e="M17 8h1v11H2V8h1V6c0-2.76 2.24-5 5-5 .71 0 1.39.15 2 .42.61-.27 1.29-.42 2-.42 2.76 0 5 2.24 5 5v2zM5 6v2h2V6c0-1.13.39-2.16 1.02-3H8C6.35 3 5 4.35 5 6zm10 2V6c0-1.65-1.35-3-3-3h-.02c.63.84 1.02 1.87 1.02 3v2h2zm-5-4.22C9.39 4.33 9 5.12 9 6v2h2V6c0-.88-.39-1.67-1-2.22z";break;case"randomize":e="M18 6.01L14 9V7h-4l-5 8H2v-2h2l5-8h5V3zM2 5h3l1.15 2.17-1.12 1.8L4 7H2V5zm16 9.01L14 17v-2H9l-1.15-2.17 1.12-1.8L10 13h4v-2z";break;case"redo":e="M8 5h5V2l6 4-6 4V7H8c-2.2 0-4 1.8-4 4s1.8 4 4 4h5v2H8c-3.3 0-6-2.7-6-6s2.7-6 6-6z";break;case"rest-api":e="M3 4h2v12H3z";break;case"rss":e="M14.92 18H18C18 9.32 10.82 2.25 2 2.25v3.02c7.12 0 12.92 5.71 12.92 12.73zm-5.44 0h3.08C12.56 12.27 7.82 7.6 2 7.6v3.02c2 0 3.87.77 5.29 2.16C8.7 14.17 9.48 16.03 9.48 18zm-5.35-.02c1.17 0 2.13-.93 2.13-2.09 0-1.15-.96-2.09-2.13-2.09-1.18 0-2.13.94-2.13 2.09 0 1.16.95 2.09 2.13 2.09z";break;case"saved":e="M15.3 5.3l-6.8 6.8-2.8-2.8-1.4 1.4 4.2 4.2 8.2-8.2";break;case"schedule":e="M2 2h16v4H2V2zm0 10V8h4v4H2zm6-2V8h4v2H8zm6 3V8h4v5h-4zm-6 5v-6h4v6H8zm-6 0v-4h4v4H2zm12 0v-3h4v3h-4z";break;case"screenoptions":e="M9 9V3H3v6h6zm8 0V3h-6v6h6zm-8 8v-6H3v6h6zm8 0v-6h-6v6h6z";break;case"search":e="M12.14 4.18c1.87 1.87 2.11 4.75.72 6.89.12.1.22.21.36.31.2.16.47.36.81.59.34.24.56.39.66.47.42.31.73.57.94.78.32.32.6.65.84 1 .25.35.44.69.59 1.04.14.35.21.68.18 1-.02.32-.14.59-.36.81s-.49.34-.81.36c-.31.02-.65-.04-.99-.19-.35-.14-.7-.34-1.04-.59-.35-.24-.68-.52-1-.84-.21-.21-.47-.52-.77-.93-.1-.13-.25-.35-.47-.66-.22-.32-.4-.57-.56-.78-.16-.2-.29-.35-.44-.5-2.07 1.09-4.69.76-6.44-.98-2.14-2.15-2.14-5.64 0-7.78 2.15-2.15 5.63-2.15 7.78 0zm-1.41 6.36c1.36-1.37 1.36-3.58 0-4.95-1.37-1.37-3.59-1.37-4.95 0-1.37 1.37-1.37 3.58 0 4.95 1.36 1.37 3.58 1.37 4.95 0z";break;case"share-alt":e="M16.22 5.8c.47.69.29 1.62-.4 2.08-.69.47-1.62.29-2.08-.4-.16-.24-.35-.46-.55-.67-.21-.2-.43-.39-.67-.55s-.5-.3-.77-.41c-.27-.12-.55-.21-.84-.26-.59-.13-1.23-.13-1.82-.01-.29.06-.57.15-.84.27-.27.11-.53.25-.77.41s-.46.35-.66.55c-.21.21-.4.43-.56.67s-.3.5-.41.76c-.01.02-.01.03-.01.04-.1.24-.17.48-.23.72H1V6h2.66c.04-.07.07-.13.12-.2.27-.4.57-.77.91-1.11s.72-.65 1.11-.91c.4-.27.83-.51 1.28-.7s.93-.34 1.41-.43c.99-.21 2.03-.21 3.02 0 .48.09.96.24 1.41.43s.88.43 1.28.7c.39.26.77.57 1.11.91s.64.71.91 1.11zM12.5 10c0-1.38-1.12-2.5-2.5-2.5S7.5 8.62 7.5 10s1.12 2.5 2.5 2.5 2.5-1.12 2.5-2.5zm-8.72 4.2c-.47-.69-.29-1.62.4-2.09.69-.46 1.62-.28 2.08.41.16.24.35.46.55.67.21.2.43.39.67.55s.5.3.77.41c.27.12.55.2.84.26.59.13 1.23.12 1.82 0 .29-.06.57-.14.84-.26.27-.11.53-.25.77-.41s.46-.35.66-.55c.21-.21.4-.44.56-.67.16-.25.3-.5.41-.76.01-.02.01-.03.01-.04.1-.24.17-.48.23-.72H19v3h-2.66c-.04.06-.07.13-.12.2-.27.4-.57.77-.91 1.11s-.72.65-1.11.91c-.4.27-.83.51-1.28.7s-.93.33-1.41.43c-.99.21-2.03.21-3.02 0-.48-.1-.96-.24-1.41-.43s-.88-.43-1.28-.7c-.39-.26-.77-.57-1.11-.91s-.64-.71-.91-1.11z";break;case"share-alt2":e="M18 8l-5 4V9.01c-2.58.06-4.88.45-7 2.99.29-3.57 2.66-5.66 7-5.94V3zM4 14h11v-2l2-1.6V16H2V5h9.43c-1.83.32-3.31 1-4.41 2H4v7z";break;case"share":e="M14.5 12c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3c0-.24.03-.46.09-.69l-4.38-2.3c-.55.61-1.33.99-2.21.99-1.66 0-3-1.34-3-3s1.34-3 3-3c.88 0 1.66.39 2.21.99l4.38-2.3c-.06-.23-.09-.45-.09-.69 0-1.66 1.34-3 3-3s3 1.34 3 3-1.34 3-3 3c-.88 0-1.66-.39-2.21-.99l-4.38 2.3c.06.23.09.45.09.69s-.03.46-.09.69l4.38 2.3c.55-.61 1.33-.99 2.21-.99z";break;case"shield-alt":e="M10 2s3 2 7 2c0 11-7 14-7 14S3 15 3 4c4 0 7-2 7-2z";break;case"shield":e="M10 2s3 2 7 2c0 11-7 14-7 14S3 15 3 4c4 0 7-2 7-2zm0 8h5s1-1 1-5c0 0-5-1-6-2v7H5c1 4 5 7 5 7v-7z";break;case"shortcode":e="M6 14H4V6h2V4H2v12h4M7.1 17h2.1l3.7-14h-2.1M14 4v2h2v8h-2v2h4V4";break;case"slides":e="M5 14V6h10v8H5zm-3-1V7h2v6H2zm4-6v6h8V7H6zm10 0h2v6h-2V7zm-3 2V8H7v1h6zm0 3v-2H7v2h6z";break;case"smartphone":e="M6 2h8c.55 0 1 .45 1 1v14c0 .55-.45 1-1 1H6c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1zm7 12V4H7v10h6zM8 5h4l-4 5V5z";break;case"smiley":e="M7 5.2c1.1 0 2 .89 2 2 0 .37-.11.71-.28 1C8.72 8.2 8 8 7 8s-1.72.2-1.72.2c-.17-.29-.28-.63-.28-1 0-1.11.9-2 2-2zm6 0c1.11 0 2 .89 2 2 0 .37-.11.71-.28 1 0 0-.72-.2-1.72-.2s-1.72.2-1.72.2c-.17-.29-.28-.63-.28-1 0-1.11.89-2 2-2zm-3 13.7c3.72 0 7.03-2.36 8.23-5.88l-1.32-.46C15.9 15.52 13.12 17.5 10 17.5s-5.9-1.98-6.91-4.94l-1.32.46c1.2 3.52 4.51 5.88 8.23 5.88z";break;case"sort":e="M11 7H1l5 7zm-2 7h10l-5-7z";break;case"sos":e="M18 10c0-4.42-3.58-8-8-8s-8 3.58-8 8 3.58 8 8 8 8-3.58 8-8zM7.23 3.57L8.72 7.3c-.62.29-1.13.8-1.42 1.42L3.57 7.23c.71-1.64 2.02-2.95 3.66-3.66zm9.2 3.66L12.7 8.72c-.29-.62-.8-1.13-1.42-1.42l1.49-3.73c1.64.71 2.95 2.02 3.66 3.66zM10 12c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm-6.43.77l3.73-1.49c.29.62.8 1.13 1.42 1.42l-1.49 3.73c-1.64-.71-2.95-2.02-3.66-3.66zm9.2 3.66l-1.49-3.73c.62-.29 1.13-.8 1.42-1.42l3.73 1.49c-.71 1.64-2.02 2.95-3.66 3.66z";break;case"star-empty":e="M10 1L7 7l-6 .75 4.13 4.62L4 19l6-3 6 3-1.12-6.63L19 7.75 13 7zm0 2.24l2.34 4.69 4.65.58-3.18 3.56.87 5.15L10 14.88l-4.68 2.34.87-5.15-3.18-3.56 4.65-.58z";break;case"star-filled":e="M10 1l3 6 6 .75-4.12 4.62L16 19l-6-3-6 3 1.13-6.63L1 7.75 7 7z";break;case"star-half":e="M10 1L7 7l-6 .75 4.13 4.62L4 19l6-3 6 3-1.12-6.63L19 7.75 13 7zm0 2.24l2.34 4.69 4.65.58-3.18 3.56.87 5.15L10 14.88V3.24z";break;case"sticky":e="M5 3.61V1.04l8.99-.01-.01 2.58c-1.22.26-2.16 1.35-2.16 2.67v.5c.01 1.31.93 2.4 2.17 2.66l-.01 2.58h-3.41l-.01 2.57c0 .6-.47 4.41-1.06 4.41-.6 0-1.08-3.81-1.08-4.41v-2.56L5 12.02l.01-2.58c1.23-.25 2.15-1.35 2.15-2.66v-.5c0-1.31-.92-2.41-2.16-2.67z";break;case"store":e="M1 10c.41.29.96.43 1.5.43.55 0 1.09-.14 1.5-.43.62-.46 1-1.17 1-2 0 .83.37 1.54 1 2 .41.29.96.43 1.5.43.55 0 1.09-.14 1.5-.43.62-.46 1-1.17 1-2 0 .83.37 1.54 1 2 .41.29.96.43 1.51.43.54 0 1.08-.14 1.49-.43.62-.46 1-1.17 1-2 0 .83.37 1.54 1 2 .41.29.96.43 1.5.43.55 0 1.09-.14 1.5-.43.63-.46 1-1.17 1-2V7l-3-7H4L0 7v1c0 .83.37 1.54 1 2zm2 8.99h5v-5h4v5h5v-7c-.37-.05-.72-.22-1-.43-.63-.45-1-.73-1-1.56 0 .83-.38 1.11-1 1.56-.41.3-.95.43-1.49.44-.55 0-1.1-.14-1.51-.44-.63-.45-1-.73-1-1.56 0 .83-.38 1.11-1 1.56-.41.3-.95.43-1.5.44-.54 0-1.09-.14-1.5-.44-.63-.45-1-.73-1-1.57 0 .84-.38 1.12-1 1.57-.29.21-.63.38-1 .44v6.99z";break;case"table-col-after":e="M14.08 12.864V9.216h3.648V7.424H14.08V3.776h-1.728v3.648H8.64v1.792h3.712v3.648zM0 17.92V0h20.48v17.92H0zM6.4 1.28H1.28v3.84H6.4V1.28zm0 5.12H1.28v3.84H6.4V6.4zm0 5.12H1.28v3.84H6.4v-3.84zM19.2 1.28H7.68v14.08H19.2V1.28z";break;case"table-col-before":e="M6.4 3.776v3.648H2.752v1.792H6.4v3.648h1.728V9.216h3.712V7.424H8.128V3.776zM0 17.92V0h20.48v17.92H0zM12.8 1.28H1.28v14.08H12.8V1.28zm6.4 0h-5.12v3.84h5.12V1.28zm0 5.12h-5.12v3.84h5.12V6.4zm0 5.12h-5.12v3.84h5.12v-3.84z";break;case"table-col-delete":e="M6.4 9.98L7.68 8.7v-.256L6.4 7.164V9.98zm6.4-1.532l1.28-1.28V9.92L12.8 8.64v-.192zm7.68 9.472V0H0v17.92h20.48zm-1.28-2.56h-5.12v-1.024l-.256.256-1.024-1.024v1.792H7.68v-1.792l-1.024 1.024-.256-.256v1.024H1.28V1.28H6.4v2.368l.704-.704.576.576V1.216h5.12V3.52l.96-.96.32.32V1.216h5.12V15.36zm-5.76-2.112l-3.136-3.136-3.264 3.264-1.536-1.536 3.264-3.264L5.632 5.44l1.536-1.536 3.136 3.136 3.2-3.2 1.536 1.536-3.2 3.2 3.136 3.136-1.536 1.536z";break;case"table-row-after":e="M13.824 10.176h-2.88v-2.88H9.536v2.88h-2.88v1.344h2.88v2.88h1.408v-2.88h2.88zM0 17.92V0h20.48v17.92H0zM6.4 1.28H1.28v3.84H6.4V1.28zm6.4 0H7.68v3.84h5.12V1.28zm6.4 0h-5.12v3.84h5.12V1.28zm0 5.056H1.28v9.024H19.2V6.336z";break;case"table-row-before":e="M6.656 6.464h2.88v2.88h1.408v-2.88h2.88V5.12h-2.88V2.24H9.536v2.88h-2.88zM0 17.92V0h20.48v17.92H0zm7.68-2.56h5.12v-3.84H7.68v3.84zm-6.4 0H6.4v-3.84H1.28v3.84zM19.2 1.28H1.28v9.024H19.2V1.28zm0 10.24h-5.12v3.84h5.12v-3.84z";break;case"table-row-delete":e="M17.728 11.456L14.592 8.32l3.2-3.2-1.536-1.536-3.2 3.2L9.92 3.648 8.384 5.12l3.2 3.2-3.264 3.264 1.536 1.536 3.264-3.264 3.136 3.136 1.472-1.536zM0 17.92V0h20.48v17.92H0zm19.2-6.4h-.448l-1.28-1.28H19.2V6.4h-1.792l1.28-1.28h.512V1.28H1.28v3.84h6.208l1.28 1.28H1.28v3.84h7.424l-1.28 1.28H1.28v3.84H19.2v-3.84z";break;case"tablet":e="M4 2h12c.55 0 1 .45 1 1v14c0 .55-.45 1-1 1H4c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1zm11 14V4H5v12h10zM6 5h6l-6 5V5z";break;case"tag":e="M11 2h7v7L8 19l-7-7zm3 6c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z";break;case"tagcloud":e="M11 3v4H1V3h10zm8 0v4h-7V3h7zM7 8v3H1V8h6zm12 0v3H8V8h11zM9 12v2H1v-2h8zm10 0v2h-9v-2h9zM6 15v1H1v-1h5zm5 0v1H7v-1h4zm3 0v1h-2v-1h2zm5 0v1h-4v-1h4z";break;case"testimonial":e="M4 3h12c.55 0 1.02.2 1.41.59S18 4.45 18 5v7c0 .55-.2 1.02-.59 1.41S16.55 14 16 14h-1l-5 5v-5H4c-.55 0-1.02-.2-1.41-.59S2 12.55 2 12V5c0-.55.2-1.02.59-1.41S3.45 3 4 3zm11 2H4v1h11V5zm1 3H4v1h12V8zm-3 3H4v1h9v-1z";break;case"text":e="M18 3v2H2V3h16zm-6 4v2H2V7h10zm6 0v2h-4V7h4zM8 11v2H2v-2h6zm10 0v2h-8v-2h8zm-4 4v2H2v-2h12z";break;case"thumbs-down":e="M7.28 18c-.15.02-.26-.02-.41-.07-.56-.19-.83-.79-.66-1.35.17-.55 1-3.04 1-3.58 0-.53-.75-1-1.35-1h-3c-.6 0-1-.4-1-1s2-7 2-7c.17-.39.55-1 1-1H14v9h-2.14c-.41.41-3.3 4.71-3.58 5.27-.21.41-.6.68-1 .73zM18 12h-2V3h2v9z";break;case"thumbs-up":e="M12.72 2c.15-.02.26.02.41.07.56.19.83.79.66 1.35-.17.55-1 3.04-1 3.58 0 .53.75 1 1.35 1h3c.6 0 1 .4 1 1s-2 7-2 7c-.17.39-.55 1-1 1H6V8h2.14c.41-.41 3.3-4.71 3.58-5.27.21-.41.6-.68 1-.73zM2 8h2v9H2V8z";break;case"tickets-alt":e="M20 6.38L18.99 9.2v-.01c-.52-.19-1.03-.16-1.53.08s-.85.62-1.04 1.14-.16 1.03.07 1.53c.24.5.62.84 1.15 1.03v.01l-1.01 2.82-15.06-5.38.99-2.79c.52.19 1.03.16 1.53-.08.5-.23.84-.61 1.03-1.13s.16-1.03-.08-1.53c-.23-.49-.61-.83-1.13-1.02L4.93 1zm-4.97 5.69l1.37-3.76c.12-.31.1-.65-.04-.95s-.39-.53-.7-.65L8.14 3.98c-.64-.23-1.37.12-1.6.74L5.17 8.48c-.24.65.1 1.37.74 1.6l7.52 2.74c.14.05.28.08.43.08.52 0 1-.33 1.17-.83zM7.97 4.45l7.51 2.73c.19.07.34.21.43.39.08.18.09.38.02.57l-1.37 3.76c-.13.38-.58.59-.96.45L6.09 9.61c-.39-.14-.59-.57-.45-.96l1.37-3.76c.1-.29.39-.49.7-.49.09 0 .17.02.26.05zm6.82 12.14c.35.27.75.41 1.2.41H16v3H0v-2.96c.55 0 1.03-.2 1.41-.59.39-.38.59-.86.59-1.41s-.2-1.02-.59-1.41-.86-.59-1.41-.59V10h1.05l-.28.8 2.87 1.02c-.51.16-.89.62-.89 1.18v4c0 .69.56 1.25 1.25 1.25h8c.69 0 1.25-.56 1.25-1.25v-1.75l.83.3c.12.43.36.78.71 1.04zM3.25 17v-4c0-.41.34-.75.75-.75h.83l7.92 2.83V17c0 .41-.34.75-.75.75H4c-.41 0-.75-.34-.75-.75z";break;case"tickets":e="M20 5.38L18.99 8.2v-.01c-1.04-.37-2.19.18-2.57 1.22-.37 1.04.17 2.19 1.22 2.56v.01l-1.01 2.82L1.57 9.42l.99-2.79c1.04.38 2.19-.17 2.56-1.21s-.17-2.18-1.21-2.55L4.93 0zm-5.45 3.37c.74-2.08-.34-4.37-2.42-5.12-2.08-.74-4.37.35-5.11 2.42-.74 2.08.34 4.38 2.42 5.12 2.07.74 4.37-.35 5.11-2.42zm-2.56-4.74c.89.32 1.57.94 1.97 1.71-.01-.01-.02-.01-.04-.02-.33-.12-.67.09-.78.4-.1.28-.03.57.05.91.04.27.09.62-.06 1.04-.1.29-.33.58-.65 1l-.74 1.01.08-4.08.4.11c.19.04.26-.24.08-.29 0 0-.57-.15-.92-.28-.34-.12-.88-.36-.88-.36-.18-.08-.3.19-.12.27 0 0 .16.08.34.16l.01 1.63L9.2 9.18l.08-4.11c.2.06.4.11.4.11.19.04.26-.23.07-.29 0 0-.56-.15-.91-.28-.07-.02-.14-.05-.22-.08.93-.7 2.19-.94 3.37-.52zM7.4 6.19c.17-.49.44-.92.78-1.27l.04 5c-.94-.95-1.3-2.39-.82-3.73zm4.04 4.75l2.1-2.63c.37-.41.57-.77.69-1.12.05-.12.08-.24.11-.35.09.57.04 1.18-.17 1.77-.45 1.25-1.51 2.1-2.73 2.33zm-.7-3.22l.02 3.22c0 .02 0 .04.01.06-.4 0-.8-.07-1.2-.21-.33-.12-.63-.28-.9-.48zm1.24 6.08l2.1.75c.24.84 1 1.45 1.91 1.45H16v3H0v-2.96c1.1 0 2-.89 2-2 0-1.1-.9-2-2-2V9h1.05l-.28.8 4.28 1.52C4.4 12.03 4 12.97 4 14c0 2.21 1.79 4 4 4s4-1.79 4-4c0-.07-.02-.13-.02-.2zm-6.53-2.33l1.48.53c-.14.04-.15.27.03.28 0 0 .18.02.37.03l.56 1.54-.78 2.36-1.31-3.9c.21-.01.41-.03.41-.03.19-.02.17-.31-.02-.3 0 0-.59.05-.96.05-.07 0-.15 0-.23-.01.13-.2.28-.38.45-.55zM4.4 14c0-.52.12-1.02.32-1.46l1.71 4.7C5.23 16.65 4.4 15.42 4.4 14zm4.19-1.41l1.72.62c.07.17.12.37.12.61 0 .31-.12.66-.28 1.16l-.35 1.2zM11.6 14c0 1.33-.72 2.49-1.79 3.11l1.1-3.18c.06-.17.1-.31.14-.46l.52.19c.02.11.03.22.03.34zm-4.62 3.45l1.08-3.14 1.11 3.03c.01.02.01.04.02.05-.37.13-.77.21-1.19.21-.35 0-.69-.06-1.02-.15z";break;case"tide":e="M17 7.2V3H3v7.1c2.6-.5 4.5-1.5 6.4-2.6.2-.2.4-.3.6-.5v3c-1.9 1.1-4 2.2-7 2.8V17h14V9.9c-2.6.5-4.4 1.5-6.2 2.6-.3.1-.5.3-.8.4V10c2-1.1 4-2.2 7-2.8z";break;case"translation":e="M11 7H9.49c-.63 0-1.25.3-1.59.7L7 5H4.13l-2.39 7h1.69l.74-2H7v4H2c-1.1 0-2-.9-2-2V5c0-1.1.9-2 2-2h7c1.1 0 2 .9 2 2v2zM6.51 9H4.49l1-2.93zM10 8h7c1.1 0 2 .9 2 2v7c0 1.1-.9 2-2 2h-7c-1.1 0-2-.9-2-2v-7c0-1.1.9-2 2-2zm7.25 5v-1.08h-3.17V9.75h-1.16v2.17H9.75V13h1.28c.11.85.56 1.85 1.28 2.62-.87.36-1.89.62-2.31.62-.01.02.22.97.2 1.46.84 0 2.21-.5 3.28-1.15 1.09.65 2.48 1.15 3.34 1.15-.02-.49.2-1.44.2-1.46-.43 0-1.49-.27-2.38-.63.7-.77 1.14-1.77 1.25-2.61h1.36zm-3.81 1.93c-.5-.46-.85-1.13-1.01-1.93h2.09c-.17.8-.51 1.47-1 1.93l-.04.03s-.03-.02-.04-.03z";break;case"trash":e="M12 4h3c.6 0 1 .4 1 1v1H3V5c0-.6.5-1 1-1h3c.2-1.1 1.3-2 2.5-2s2.3.9 2.5 2zM8 4h3c-.2-.6-.9-1-1.5-1S8.2 3.4 8 4zM4 7h11l-.9 10.1c0 .5-.5.9-1 .9H5.9c-.5 0-.9-.4-1-.9L4 7z";break;case"twitter":e="M18.94 4.46c-.49.73-1.11 1.38-1.83 1.9.01.15.01.31.01.47 0 4.85-3.69 10.44-10.43 10.44-2.07 0-4-.61-5.63-1.65.29.03.58.05.88.05 1.72 0 3.3-.59 4.55-1.57-1.6-.03-2.95-1.09-3.42-2.55.22.04.45.07.69.07.33 0 .66-.05.96-.13-1.67-.34-2.94-1.82-2.94-3.6v-.04c.5.27 1.06.44 1.66.46-.98-.66-1.63-1.78-1.63-3.06 0-.67.18-1.3.5-1.84 1.81 2.22 4.51 3.68 7.56 3.83-.06-.27-.1-.55-.1-.84 0-2.02 1.65-3.66 3.67-3.66 1.06 0 2.01.44 2.68 1.16.83-.17 1.62-.47 2.33-.89-.28.85-.86 1.57-1.62 2.02.75-.08 1.45-.28 2.11-.57z";break;case"undo":e="M12 5H7V2L1 6l6 4V7h5c2.2 0 4 1.8 4 4s-1.8 4-4 4H7v2h5c3.3 0 6-2.7 6-6s-2.7-6-6-6z";break;case"universal-access-alt":e="M19 10c0-4.97-4.03-9-9-9s-9 4.03-9 9 4.03 9 9 9 9-4.03 9-9zm-9-7.4c.83 0 1.5.67 1.5 1.5s-.67 1.51-1.5 1.51c-.82 0-1.5-.68-1.5-1.51s.68-1.5 1.5-1.5zM3.4 7.36c0-.65 6.6-.76 6.6-.76s6.6.11 6.6.76-4.47 1.4-4.47 1.4 1.69 8.14 1.06 8.38c-.62.24-3.19-5.19-3.19-5.19s-2.56 5.43-3.18 5.19c-.63-.24 1.06-8.38 1.06-8.38S3.4 8.01 3.4 7.36z";break;case"universal-access":e="M10 2.6c.83 0 1.5.67 1.5 1.5s-.67 1.51-1.5 1.51c-.82 0-1.5-.68-1.5-1.51s.68-1.5 1.5-1.5zM3.4 7.36c0-.65 6.6-.76 6.6-.76s6.6.11 6.6.76-4.47 1.4-4.47 1.4 1.69 8.14 1.06 8.38c-.62.24-3.19-5.19-3.19-5.19s-2.56 5.43-3.18 5.19c-.63-.24 1.06-8.38 1.06-8.38S3.4 8.01 3.4 7.36z";break;case"unlock":e="M12 9V6c0-1.1-.9-2-2-2s-2 .9-2 2H6c0-2.21 1.79-4 4-4s4 1.79 4 4v3h1c.55 0 1 .45 1 1v7c0 .55-.45 1-1 1H5c-.55 0-1-.45-1-1v-7c0-.55.45-1 1-1h7zm-1 7l-.36-2.15c.51-.24.86-.75.86-1.35 0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5c0 .6.35 1.11.86 1.35L9 16h2z";break;case"update":e="M10.2 3.28c3.53 0 6.43 2.61 6.92 6h2.08l-3.5 4-3.5-4h2.32c-.45-1.97-2.21-3.45-4.32-3.45-1.45 0-2.73.71-3.54 1.78L4.95 5.66C6.23 4.2 8.11 3.28 10.2 3.28zm-.4 13.44c-3.52 0-6.43-2.61-6.92-6H.8l3.5-4c1.17 1.33 2.33 2.67 3.5 4H5.48c.45 1.97 2.21 3.45 4.32 3.45 1.45 0 2.73-.71 3.54-1.78l1.71 1.95c-1.28 1.46-3.15 2.38-5.25 2.38z";break;case"upload":e="M8 14V8H5l5-6 5 6h-3v6H8zm-2 2v-6H4v8h12.01v-8H14v6H6z";break;case"vault":e="M18 17V3c0-.55-.45-1-1-1H3c-.55 0-1 .45-1 1v14c0 .55.45 1 1 1h14c.55 0 1-.45 1-1zm-1 0H3V3h14v14zM4.75 4h10.5c.41 0 .75.34.75.75V6h-1v3h1v2h-1v3h1v1.25c0 .41-.34.75-.75.75H4.75c-.41 0-.75-.34-.75-.75V4.75c0-.41.34-.75.75-.75zM13 10c0-2.21-1.79-4-4-4s-4 1.79-4 4 1.79 4 4 4 4-1.79 4-4zM9 7l.77 1.15C10.49 8.46 11 9.17 11 10c0 1.1-.9 2-2 2s-2-.9-2-2c0-.83.51-1.54 1.23-1.85z";break;case"video-alt":e="M8 5c0-.55-.45-1-1-1H2c-.55 0-1 .45-1 1 0 .57.49 1 1 1h5c.55 0 1-.45 1-1zm6 5l4-4v10l-4-4v-2zm-1 4V8c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h8c.55 0 1-.45 1-1z";break;case"video-alt2":e="M12 13V7c0-1.1-.9-2-2-2H3c-1.1 0-2 .9-2 2v6c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2zm1-2.5l6 4.5V5l-6 4.5v1z";break;case"video-alt3":e="M19 15V5c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2zM8 14V6l6 4z";break;case"visibility":e="M19.7 9.4C17.7 6 14 3.9 10 3.9S2.3 6 .3 9.4L0 10l.3.6c2 3.4 5.7 5.5 9.7 5.5s7.7-2.1 9.7-5.5l.3-.6-.3-.6zM10 14.1c-3.1 0-6-1.6-7.7-4.1C3.6 8 5.7 6.6 8 6.1c-.9.6-1.5 1.7-1.5 2.9 0 1.9 1.6 3.5 3.5 3.5s3.5-1.6 3.5-3.5c0-1.2-.6-2.3-1.5-2.9 2.3.5 4.4 1.9 5.7 3.9-1.7 2.5-4.6 4.1-7.7 4.1z";break;case"warning":e="M10 2c4.42 0 8 3.58 8 8s-3.58 8-8 8-8-3.58-8-8 3.58-8 8-8zm1.13 9.38l.35-6.46H8.52l.35 6.46h2.26zm-.09 3.36c.24-.23.37-.55.37-.96 0-.42-.12-.74-.36-.97s-.59-.35-1.06-.35-.82.12-1.07.35-.37.55-.37.97c0 .41.13.73.38.96.26.23.61.34 1.06.34s.8-.11 1.05-.34z";break;case"welcome-add-page":e="M17 7V4h-2V2h-3v1H3v15h11V9h1V7h2zm-1-2v1h-2v2h-1V6h-2V5h2V3h1v2h2z";break;case"welcome-comments":e="M5 2h10c1.1 0 2 .9 2 2v8c0 1.1-.9 2-2 2h-2l-5 5v-5H5c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2zm8.5 8.5L11 8l2.5-2.5-1-1L10 7 7.5 4.5l-1 1L9 8l-2.5 2.5 1 1L10 9l2.5 2.5z";break;case"welcome-learn-more":e="M10 10L2.54 7.02 3 18H1l.48-11.41L0 6l10-4 10 4zm0-5c-.55 0-1 .22-1 .5s.45.5 1 .5 1-.22 1-.5-.45-.5-1-.5zm0 6l5.57-2.23c.71.94 1.2 2.07 1.36 3.3-.3-.04-.61-.07-.93-.07-2.55 0-4.78 1.37-6 3.41C8.78 13.37 6.55 12 4 12c-.32 0-.63.03-.93.07.16-1.23.65-2.36 1.36-3.3z";break;case"welcome-view-site":e="M18 14V4c0-.55-.45-1-1-1H3c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h14c.55 0 1-.45 1-1zm-8-8c2.3 0 4.4 1.14 6 3-1.6 1.86-3.7 3-6 3s-4.4-1.14-6-3c1.6-1.86 3.7-3 6-3zm2 3c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2zm2 8h3v1H3v-1h3v-1h8v1z";break;case"welcome-widgets-menus":e="M19 16V3c0-.55-.45-1-1-1H3c-.55 0-1 .45-1 1v13c0 .55.45 1 1 1h15c.55 0 1-.45 1-1zM4 4h13v4H4V4zm1 1v2h3V5H5zm4 0v2h3V5H9zm4 0v2h3V5h-3zm-8.5 5c.28 0 .5.22.5.5s-.22.5-.5.5-.5-.22-.5-.5.22-.5.5-.5zM6 10h4v1H6v-1zm6 0h5v5h-5v-5zm-7.5 2c.28 0 .5.22.5.5s-.22.5-.5.5-.5-.22-.5-.5.22-.5.5-.5zM6 12h4v1H6v-1zm7 0v2h3v-2h-3zm-8.5 2c.28 0 .5.22.5.5s-.22.5-.5.5-.5-.22-.5-.5.22-.5.5-.5zM6 14h4v1H6v-1z";break;case"welcome-write-blog":e="M16.89 1.2l1.41 1.41c.39.39.39 1.02 0 1.41L14 8.33V18H3V3h10.67l1.8-1.8c.4-.39 1.03-.4 1.42 0zm-5.66 8.48l5.37-5.36-1.42-1.42-5.36 5.37-.71 2.12z";break;case"wordpress-alt":e="M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z";break;case"wordpress":e="M20 10c0-5.52-4.48-10-10-10S0 4.48 0 10s4.48 10 10 10 10-4.48 10-10zM10 1.01c4.97 0 8.99 4.02 8.99 8.99s-4.02 8.99-8.99 8.99S1.01 14.97 1.01 10 5.03 1.01 10 1.01zM8.01 14.82L4.96 6.61c.49-.03 1.05-.08 1.05-.08.43-.05.38-1.01-.06-.99 0 0-1.29.1-2.13.1-.15 0-.33 0-.52-.01 1.44-2.17 3.9-3.6 6.7-3.6 2.09 0 3.99.79 5.41 2.09-.6-.08-1.45.35-1.45 1.42 0 .66.38 1.22.79 1.88.31.54.5 1.22.5 2.21 0 1.34-1.27 4.48-1.27 4.48l-2.71-7.5c.48-.03.75-.16.75-.16.43-.05.38-1.1-.05-1.08 0 0-1.3.11-2.14.11-.78 0-2.11-.11-2.11-.11-.43-.02-.48 1.06-.05 1.08l.84.08 1.12 3.04zm6.02 2.15L16.64 10s.67-1.69.39-3.81c.63 1.14.94 2.42.94 3.81 0 2.96-1.56 5.58-3.94 6.97zM2.68 6.77L6.5 17.25c-2.67-1.3-4.47-4.08-4.47-7.25 0-1.16.2-2.23.65-3.23zm7.45 4.53l2.29 6.25c-.75.27-1.57.42-2.42.42-.72 0-1.41-.11-2.06-.3z";break;case"yes-alt":e="M10 2c-4.42 0-8 3.58-8 8s3.58 8 8 8 8-3.58 8-8-3.58-8-8-8zm-.615 12.66h-1.34l-3.24-4.54 1.34-1.25 2.57 2.4 5.14-5.93 1.34.94-5.81 8.38z";break;case"yes":e="M14.83 4.89l1.34.94-5.81 8.38H9.02L5.78 9.67l1.34-1.25 2.57 2.4z"}if(!e)return null;var l=["dashicon","dashicons-"+t,s].filter(Boolean).join(" ");return Object(h.createElement)(v.b,Object(r.a)({"aria-hidden":!0,role:"img",focusable:"false",className:l,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 20 20"},i),Object(h.createElement)(v.a,{d:e}))}}]),c}(h.Component)},760:function(e,c,t){"use strict";function r(e){return(r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e){return(n="function"===typeof Symbol&&"symbol"===r(Symbol.iterator)?function(e){return r(e)}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":r(e)})(e)}t.d(c,"a",function(){return n})},761:function(e,c,t){e.exports=function(e,c){var t,r,n=0;function a(){var a,o,s=t,i=arguments.length;e:for(;s;){if(s.args.length===arguments.length){for(o=0;o<i;o++)if(s.args[o]!==arguments[o]){s=s.next;continue e}return s!==t&&(s===r&&(r=s.prev),s.prev.next=s.next,s.next&&(s.next.prev=s.prev),s.next=t,s.prev=null,t.prev=s,t=s),s.val}s=s.next}for(a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return s={args:a,val:e.apply(null,a)},t?(t.prev=s,s.next=t):r=s,n===c.maxSize?(r=r.prev).next=null:n++,t=s,s.val}return c=c||{},a.clear=function(){t=null,r=null,n=0},a}},762:function(e,c,t){!function(){"use strict";var e={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function t(c){return function(c,r){var n,a,o,s,i,l,h,v,u,z=1,m=c.length,b="";for(a=0;a<m;a++)if("string"===typeof c[a])b+=c[a];else if("object"===typeof c[a]){if((s=c[a]).keys)for(n=r[z],o=0;o<s.keys.length;o++){if(void 0==n)throw new Error(t('[sprintf] Cannot access property "%s" of undefined value "%s"',s.keys[o],s.keys[o-1]));n=n[s.keys[o]]}else n=s.param_no?r[s.param_no]:r[z++];if(e.not_type.test(s.type)&&e.not_primitive.test(s.type)&&n instanceof Function&&(n=n()),e.numeric_arg.test(s.type)&&"number"!==typeof n&&isNaN(n))throw new TypeError(t("[sprintf] expecting number but found %T",n));switch(e.number.test(s.type)&&(v=n>=0),s.type){case"b":n=parseInt(n,10).toString(2);break;case"c":n=String.fromCharCode(parseInt(n,10));break;case"d":case"i":n=parseInt(n,10);break;case"j":n=JSON.stringify(n,null,s.width?parseInt(s.width):0);break;case"e":n=s.precision?parseFloat(n).toExponential(s.precision):parseFloat(n).toExponential();break;case"f":n=s.precision?parseFloat(n).toFixed(s.precision):parseFloat(n);break;case"g":n=s.precision?String(Number(n.toPrecision(s.precision))):parseFloat(n);break;case"o":n=(parseInt(n,10)>>>0).toString(8);break;case"s":n=String(n),n=s.precision?n.substring(0,s.precision):n;break;case"t":n=String(!!n),n=s.precision?n.substring(0,s.precision):n;break;case"T":n=Object.prototype.toString.call(n).slice(8,-1).toLowerCase(),n=s.precision?n.substring(0,s.precision):n;break;case"u":n=parseInt(n,10)>>>0;break;case"v":n=n.valueOf(),n=s.precision?n.substring(0,s.precision):n;break;case"x":n=(parseInt(n,10)>>>0).toString(16);break;case"X":n=(parseInt(n,10)>>>0).toString(16).toUpperCase()}e.json.test(s.type)?b+=n:(!e.number.test(s.type)||v&&!s.sign?u="":(u=v?"+":"-",n=n.toString().replace(e.sign,"")),l=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",h=s.width-(u+n).length,i=s.width&&h>0?l.repeat(h):"",b+=s.align?u+n+i:"0"===l?u+i+n:i+u+n)}return b}(function(c){if(n[c])return n[c];var t,r=c,a=[],o=0;for(;r;){if(null!==(t=e.text.exec(r)))a.push(t[0]);else if(null!==(t=e.modulo.exec(r)))a.push("%");else{if(null===(t=e.placeholder.exec(r)))throw new SyntaxError("[sprintf] unexpected placeholder");if(t[2]){o|=1;var s=[],i=t[2],l=[];if(null===(l=e.key.exec(i)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(s.push(l[1]);""!==(i=i.substring(l[0].length));)if(null!==(l=e.key_access.exec(i)))s.push(l[1]);else{if(null===(l=e.index_access.exec(i)))throw new SyntaxError("[sprintf] failed to parse named argument key");s.push(l[1])}t[2]=s}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");a.push({placeholder:t[0],param_no:t[1],keys:t[2],sign:t[3],pad_char:t[4],align:t[5],width:t[6],precision:t[7],type:t[8]})}r=r.substring(t[0].length)}return n[c]=a}(c),arguments)}function r(e,c){return t.apply(null,[e].concat(c||[]))}var n=Object.create(null);c.sprintf=t,c.vsprintf=r,window.sprintf=t,window.vsprintf=r,"function"===typeof define&&define.amd&&define(function(){return{sprintf:t,vsprintf:r}})}()},781:function(e,c,t){"use strict";t.d(c,"a",function(){return H});var r=t(761),n=t.n(r);t(762),n()(console.error);var a,o,s,i,l=t(643);a={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},o=["(","?"],s={")":["("],":":["?","?:"]},i=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;var h={"!":function(e){return!e},"*":function(e,c){return e*c},"/":function(e,c){return e/c},"%":function(e,c){return e%c},"+":function(e,c){return e+c},"-":function(e,c){return e-c},"<":function(e,c){return e<c},"<=":function(e,c){return e<=c},">":function(e,c){return e>c},">=":function(e,c){return e>=c},"==":function(e,c){return e===c},"!=":function(e,c){return e!==c},"&&":function(e,c){return e&&c},"||":function(e,c){return e||c},"?:":function(e,c,t){if(e)throw c;return t}};function v(e){var c=function(e){for(var c,t,r,n,l=[],h=[];c=e.match(i);){for(t=c[0],(r=e.substr(0,c.index).trim())&&l.push(r);n=h.pop();){if(s[t]){if(s[t][0]===n){t=s[t][1]||t;break}}else if(o.indexOf(n)>=0||a[n]<a[t]){h.push(n);break}l.push(n)}s[t]||h.push(t),e=e.substr(c.index+t.length)}return(e=e.trim())&&l.push(e),l.concat(h.reverse())}(e);return function(e){return function(e,c){var t,r,n,a,o,s,i=[];for(t=0;t<e.length;t++){if(o=e[t],a=h[o]){for(r=a.length,n=Array(r);r--;)n[r]=i.pop();try{s=a.apply(null,n)}catch(l){return l}}else s=c.hasOwnProperty(o)?c[o]:+o;i.push(s)}return i[0]}(c,e)}}var u={contextDelimiter:"\x04",onMissingKey:null};function z(e,c){var t;for(t in this.data=e,this.pluralForms={},this.options={},u)this.options[t]=void 0!==c&&t in c?c[t]:u[t]}function m(e,c){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);c&&(r=r.filter(function(c){return Object.getOwnPropertyDescriptor(e,c).enumerable})),t.push.apply(t,r)}return t}function b(e){for(var c=1;c<arguments.length;c++){var t=null!=arguments[c]?arguments[c]:{};c%2?m(Object(t),!0).forEach(function(c){Object(l.a)(e,c,t[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):m(Object(t)).forEach(function(c){Object.defineProperty(e,c,Object.getOwnPropertyDescriptor(t,c))})}return e}z.prototype.getPluralForm=function(e,c){var t,r,n,a=this.pluralForms[e];return a||("function"!==typeof(n=(t=this.data[e][""])["Plural-Forms"]||t["plural-forms"]||t.plural_forms)&&(r=function(e){var c,t,r;for(c=e.split(";"),t=0;t<c.length;t++)if(0===(r=c[t].trim()).indexOf("plural="))return r.substr(7)}(t["Plural-Forms"]||t["plural-forms"]||t.plural_forms),n=function(e){var c=v(e);return function(e){return+c({n:e})}}(r)),a=this.pluralForms[e]=n),a(c)},z.prototype.dcnpgettext=function(e,c,t,r,n){var a,o,s;return a=void 0===n?0:this.getPluralForm(e,n),o=t,c&&(o=c+this.options.contextDelimiter+t),(s=this.data[e][o])&&s[a]?s[a]:(this.options.onMissingKey&&this.options.onMissingKey(t,e),0===a?t:r)};var d={"":{plural_forms:function(e){return 1===e?0:1}}},f=function(e,c){var t=new z({}),r=function(e){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default";t.data[c]=b({},d,{},t.data[c],{},e),t.data[c][""]=b({},d[""],{},t.data[c][""])},n=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",c=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;return t.data[e]||r(void 0,e),t.dcnpgettext(e,c,n,a,o)},a=function(e,c,t){return n(t,c,e)};return e&&r(e,c),{setLocaleData:r,__:function(e,c){return n(c,void 0,e)},_x:a,_n:function(e,c,t,r){return n(r,void 0,e,c,t)},_nx:function(e,c,t,r,a){return n(a,r,e,c,t)},isRTL:function(){return"rtl"===a("ltr","text direction")}}}(),H=(f.setLocaleData.bind(f),f.__.bind(f));f._x.bind(f),f._n.bind(f),f._nx.bind(f),f.isRTL.bind(f)},783:function(e,c,t){"use strict";t.d(c,"a",function(){return o}),t.d(c,"b",function(){return s});var r=t(612),n=t(1),a=t(10),o=function(e){return Object(a.createElement)("path",e)},s=function(e){var c=Object(r.a)({},e,{role:"img","aria-hidden":"true",focusable:"false"});return Object(a.createElement)("svg",Object(n.omit)(c,"__unstableActive"))}},788:function(e,c,t){"use strict";var r={};t.r(r),t.d(r,"find",function(){return O});var n={};t.r(n),t.d(n,"isTabbableIndex",function(){return y}),t.d(n,"find",function(){return x}),t.d(n,"findPrevious",function(){return E}),t.d(n,"findNext",function(){return _});var a=t(569),o=t(570),s=t(571),i=t(572),l=t(574),h=t(10),v=t(1),u=t(612),z=t(573);function m(){for(var e=arguments.length,c=new Array(e),t=0;t<e;t++)c[t]=arguments[t];return c.reduce(function(e,c,t){return h.Children.forEach(c,function(c,r){c&&"string"!==typeof c&&(c=Object(h.cloneElement)(c,{key:[t,r].join()})),e.push(c)}),e},[])}var b=t(37);function d(e,c){return function(e){if(Array.isArray(e))return e}(e)||function(e,c){var t=[],r=!0,n=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(t.push(o.value),!c||t.length!==c);r=!0);}catch(i){n=!0,a=i}finally{try{r||null==s.return||s.return()}finally{if(n)throw a}}return t}(e,c)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var f=t(526),H=t.n(f),p=window,M=(p.DOMParser,p.getComputedStyle,window.Node);M.TEXT_NODE,M.ELEMENT_NODE,M.DOCUMENT_POSITION_PRECEDING,M.DOCUMENT_POSITION_FOLLOWING;function V(e){if(!e.collapsed)return e.getBoundingClientRect();var c=e.startContainer;if("BR"===c.nodeName){var t=c.parentNode,r=Array.from(t.childNodes).indexOf(c);(e=document.createRange()).setStart(t,r),e.setEnd(t,r)}var n=e.getClientRects()[0];if(!n){var a=document.createTextNode("\u200b");(e=e.cloneRange()).insertNode(a),n=e.getClientRects()[0],a.parentNode.removeChild(a)}return n}var k=["[tabindex]","a[href]","button:not([disabled])",'input:not([type="hidden"]):not([disabled])',"select:not([disabled])","textarea:not([disabled])","iframe","object","embed","area[href]","[contenteditable]:not([contenteditable=false])"].join(",");function g(e){return e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0}function O(e){var c=e.querySelectorAll(k);return Array.from(c).filter(function(e){return!(!g(e)||function(e){return"iframe"===e.nodeName.toLowerCase()&&"-1"===e.getAttribute("tabindex")}(e))&&("AREA"!==e.nodeName||function(e){var c=e.closest("map[name]");if(!c)return!1;var t=document.querySelector('img[usemap="#'+c.name+'"]');return!!t&&g(t)}(e))})}function L(e){var c=e.getAttribute("tabindex");return null===c?0:parseInt(c,10)}function y(e){return-1!==L(e)}function j(e,c){return{element:e,index:c}}function w(e){return e.element}function C(e,c){var t=L(e.element),r=L(c.element);return t===r?e.index-c.index:t-r}function S(e){return e.filter(y).map(j).sort(C).map(w).reduce(function(){var e={};return function(c,t){var r=t.nodeName,n=t.type,a=t.checked,o=t.name;if("INPUT"!==r||"radio"!==n||!o)return c.concat(t);var s=e.hasOwnProperty(o);if(!a&&s)return c;if(s){var i=e[o];c=Object(v.without)(c,i)}return e[o]=t,c.concat(t)}}(),[])}function x(e){return S(O(e))}function E(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.activeElement,c=O(document.body),t=c.indexOf(e);return c.length=t,Object(v.last)(S(c))}function _(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.activeElement,c=O(document.body),t=c.indexOf(e),r=c.slice(t+1).filter(function(c){return!e.contains(c)});return Object(v.first)(S(r))}var F={focusable:r,tabbable:n},T=t(643),A=t(631),N=t(781);function I(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window).navigator.platform;return-1!==e.indexOf("Mac")||Object(v.includes)(["iPad","iPhone"],e)}var P="alt",B="ctrl",D="meta",R="shift",W={primary:function(e){return e()?[D]:[B]},primaryShift:function(e){return e()?[R,D]:[B,R]},primaryAlt:function(e){return e()?[P,D]:[B,P]},secondary:function(e){return e()?[R,P,D]:[B,R,P]},access:function(e){return e()?[B,P]:[R,P]},ctrl:function(){return[B]},alt:function(){return[P]},ctrlShift:function(){return[B,R]},shift:function(){return[R]},shiftAlt:function(){return[R,P]}},Z=(Object(v.mapValues)(W,function(e){return function(c){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:I;return[].concat(Object(A.a)(e(t)),[c.toLowerCase()]).join("+")}}),Object(v.mapValues)(W,function(e){return function(c){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:I,n=r(),a=(t={},Object(T.a)(t,P,n?"\u2325":"Alt"),Object(T.a)(t,B,n?"^":"Ctrl"),Object(T.a)(t,D,"\u2318"),Object(T.a)(t,R,n?"\u21e7":"Shift"),t),o=e(r).reduce(function(e,c){var t=Object(v.get)(a,c,c);return[].concat(Object(A.a)(e),n?[t]:[t,"+"])},[]),s=Object(v.capitalize)(c);return[].concat(Object(A.a)(o),[s])}}));Object(v.mapValues)(Z,function(e){return function(c){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:I;return e(c,t).join("")}}),Object(v.mapValues)(W,function(e){return function(c){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:I,n=r(),a=(t={},Object(T.a)(t,R,"Shift"),Object(T.a)(t,D,n?"Command":"Control"),Object(T.a)(t,B,"Control"),Object(T.a)(t,P,n?"Option":"Alt"),Object(T.a)(t,",",Object(N.a)("Comma")),Object(T.a)(t,".",Object(N.a)("Period")),Object(T.a)(t,"`",Object(N.a)("Backtick")),t);return[].concat(Object(A.a)(e(r)),[c]).map(function(e){return Object(v.capitalize)(Object(v.get)(a,e,e))}).join(n?" ":" + ")}});Object(v.mapValues)(W,function(e){return function(c,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:I,n=e(r),a=function(e){return[P,B,D,R].filter(function(c){return e["".concat(c,"Key")]})}(c);return!Object(v.xor)(n,a).length&&(t?c.key===t:Object(v.includes)(n,c.key.toLowerCase()))}});var U=function(e){return"string"!==typeof e||""===e?(console.error("The namespace must be a non-empty string."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(e)||(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)};var K=function(e){return"string"!==typeof e||""===e?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(e)?(console.error("The hook name cannot begin with `__`."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(e)||(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)};var q=function(e){return function(c,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10;if(K(c)&&U(t))if("function"===typeof r)if("number"===typeof n){var a={callback:r,priority:n,namespace:t};if(e[c]){var o,s=e[c].handlers;for(o=s.length;o>0&&!(n>=s[o-1].priority);o--);o===s.length?s[o]=a:s.splice(o,0,a),(e.__current||[]).forEach(function(e){e.name===c&&e.currentIndex>=o&&e.currentIndex++})}else e[c]={handlers:[a],runs:0};"hookAdded"!==c&&ce("hookAdded",c,t,r,n)}else console.error("If specified, the hook priority must be a number.");else console.error("The hook callback must be a function.")}};var X=function(e,c){return function(t,r){if(K(t)&&(c||U(r))){if(!e[t])return 0;var n=0;if(c)n=e[t].handlers.length,e[t]={runs:e[t].runs,handlers:[]};else for(var a=e[t].handlers,o=function(c){a[c].namespace===r&&(a.splice(c,1),n++,(e.__current||[]).forEach(function(e){e.name===t&&e.currentIndex>=c&&e.currentIndex--}))},s=a.length-1;s>=0;s--)o(s);return"hookRemoved"!==t&&ce("hookRemoved",t,r),n}}};var $=function(e){return function(c,t){return"undefined"!==typeof t?c in e&&e[c].handlers.some(function(e){return e.namespace===t}):c in e}};var J=function(e,c){return function(t){e[t]||(e[t]={handlers:[],runs:0}),e[t].runs++;for(var r=e[t].handlers,n=arguments.length,a=new Array(n>1?n-1:0),o=1;o<n;o++)a[o-1]=arguments[o];if(!r||!r.length)return c?a[0]:void 0;var s={name:t,currentIndex:0};for(e.__current.push(s);s.currentIndex<r.length;){var i=r[s.currentIndex].callback.apply(null,a);c&&(a[0]=i),s.currentIndex++}return e.__current.pop(),c?a[0]:void 0}};var G=function(e){return function(){return e.__current&&e.__current.length?e.__current[e.__current.length-1].name:null}};var Q=function(e){return function(c){return"undefined"===typeof c?"undefined"!==typeof e.__current[0]:!!e.__current[0]&&c===e.__current[0].name}};var Y=function(e){return function(c){if(K(c))return e[c]&&e[c].runs?e[c].runs:0}};var ee=function(){var e=Object.create(null),c=Object.create(null);return e.__current=[],c.__current=[],{addAction:q(e),addFilter:q(c),removeAction:X(e),removeFilter:X(c),hasAction:$(e),hasFilter:$(c),removeAllActions:X(e,!0),removeAllFilters:X(c,!0),doAction:J(e),applyFilters:J(c,!0),currentAction:G(e),currentFilter:G(c),doingAction:Q(e),doingFilter:Q(c),didAction:Y(e),didFilter:Y(c),actions:e,filters:c}}(),ce=(ee.addAction,ee.addFilter,ee.removeAction,ee.removeFilter,ee.hasAction,ee.hasFilter,ee.removeAllActions,ee.removeAllFilters,ee.doAction),te=(ee.applyFilters,ee.currentAction,ee.currentFilter,ee.doingAction,ee.doingFilter,ee.didAction,ee.didFilter,ee.actions,ee.filters,Object.create(null));var re={huge:1440,wide:1280,large:960,medium:782,small:600,mobile:480},ne={">=":"min-width","<":"max-width"},ae={">=":function(e,c){return c>=e},"<":function(e,c){return c<e}},oe=Object(h.createContext)(null),se=function(e){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:">=",t=Object(h.useContext)(oe),r=function(e){var c=d(Object(h.useState)(e&&window.matchMedia(e).matches),2),t=c[0],r=c[1];return Object(h.useEffect)(function(){if(e){var c=function(){return r(window.matchMedia(e).matches)};c();var t=window.matchMedia(e);return t.addListener(c),function(){t.removeListener(c)}}},[e]),e&&t}(!t&&"(".concat(ne[c],": ").concat(re[e],"px)"));return t?ae[c](re[e],t):r};se.__experimentalWidthProvider=oe.Provider;var ie=se,le=10,he=function(){return"rtl"===document.documentElement.dir};function ve(e,c){var t=d((arguments.length>2&&void 0!==arguments[2]?arguments[2]:"top").split(" "),2),r=t[0],n=t[1],a=void 0===n?"center":n,o=function(e,c,t){var r,n=c.height,a=e.top+e.height/2,o={popoverTop:a,contentHeight:(a-n/2>0?n/2:a)+(a+n/2>window.innerHeight?window.innerHeight-a:n/2)},s={popoverTop:e.top,contentHeight:e.top-le-n>0?n:e.top-le},i={popoverTop:e.bottom,contentHeight:e.bottom+le+n>window.innerHeight?window.innerHeight-le-e.bottom:n},l=null;if("middle"===t&&o.contentHeight===n)r="middle";else if("top"===t&&s.contentHeight===n)r="top";else if("bottom"===t&&i.contentHeight===n)r="bottom";else{var h="top"===(r=s.contentHeight>i.contentHeight?"top":"bottom")?s.contentHeight:i.contentHeight;l=h!==n?h:null}return{yAxis:r,popoverTop:"middle"===r?o.popoverTop:"top"===r?s.popoverTop:i.popoverTop,contentHeight:l}}(e,c,r),s=function(e,c,t,r){var n=c.width;"left"===t&&he()?t="right":"right"===t&&he()&&(t="left");var a,o=Math.round(e.left+e.width/2),s={popoverLeft:o,contentWidth:(o-n/2>0?n/2:o)+(o+n/2>window.innerWidth?window.innerWidth-o:n/2)},i="middle"===r?e.left:o,l={popoverLeft:i,contentWidth:i-n>0?n:i},h="middle"===r?e.right:o,v={popoverLeft:h,contentWidth:h+n>window.innerWidth?window.innerWidth-h:n},u=null;if("center"===t&&s.contentWidth===n)a="center";else if("left"===t&&l.contentWidth===n)a="left";else if("right"===t&&v.contentWidth===n)a="right";else{var z="left"===(a=l.contentWidth>v.contentWidth?"left":"right")?l.contentWidth:v.contentWidth;u=z!==n?z:null}return{xAxis:a,popoverLeft:"center"===a?s.popoverLeft:"left"===a?l.popoverLeft:v.popoverLeft,contentWidth:u}}(e,c,a,o.yAxis);return Object(u.a)({},s,o)}var ue=t(648),ze=t(78),me=Object(h.createContext)({focusHistory:[]}),be=me.Provider,de=me.Consumer;be.displayName="FocusReturnProvider",de.displayName="FocusReturnConsumer";h.Component;var fe=Object(ue.a)(function e(c){if((r=c)instanceof h.Component||"function"===typeof r){var t=c;return e({})(t)}var r,n=c.onFocusReturn,u=void 0===n?v.stubTrue:n;return function(e){var c=function(c){function t(){var e;return Object(a.a)(this,t),(e=Object(s.a)(this,Object(i.a)(t).apply(this,arguments))).ownFocusedElements=new Set,e.activeElementOnMount=document.activeElement,e.setIsFocusedFalse=function(){return e.isFocused=!1},e.setIsFocusedTrue=function(c){e.ownFocusedElements.add(c.target),e.isFocused=!0},e}return Object(l.a)(t,c),Object(o.a)(t,[{key:"componentWillUnmount",value:function(){var e=this.activeElementOnMount,c=this.isFocused,t=this.ownFocusedElements;if(c&&!1!==u())for(var r,n=[].concat(Object(A.a)(v.without.apply(void 0,[this.props.focus.focusHistory].concat(Object(A.a)(t)))),[e]);r=n.pop();)if(document.body.contains(r))return void r.focus()}},{key:"render",value:function(){return Object(h.createElement)("div",{onFocus:this.setIsFocusedTrue,onBlur:this.setIsFocusedFalse},Object(h.createElement)(e,this.props.childProps))}}]),t}(h.Component);return function(e){return Object(h.createElement)(de,null,function(t){return Object(h.createElement)(c,{childProps:e,focus:t})})}}},"withFocusReturn"),He=Object(ue.a)(function(e){return function(c){function t(){var e;return Object(a.a)(this,t),(e=Object(s.a)(this,Object(i.a)(t).apply(this,arguments))).focusContainRef=Object(h.createRef)(),e.handleTabBehaviour=e.handleTabBehaviour.bind(Object(ze.a)(e)),e}return Object(l.a)(t,c),Object(o.a)(t,[{key:"handleTabBehaviour",value:function(e){if(9===e.keyCode){var c=F.tabbable.find(this.focusContainRef.current);if(c.length){var t=c[0],r=c[c.length-1];e.shiftKey&&e.target===t?(e.preventDefault(),r.focus()):(e.shiftKey||e.target!==r)&&c.includes(e.target)||(e.preventDefault(),t.focus())}}}},{key:"render",value:function(){return Object(h.createElement)("div",{onKeyDown:this.handleTabBehaviour,ref:this.focusContainRef,tabIndex:"-1"},Object(h.createElement)(e,this.props))}}]),t}(h.Component)},"withConstrainedTabbing"),pe=["button","submit"];var Me=Object(ue.a)(function(e){return function(c){function t(){var e;return Object(a.a)(this,t),(e=Object(s.a)(this,Object(i.a)(t).apply(this,arguments))).bindNode=e.bindNode.bind(Object(ze.a)(e)),e.cancelBlurCheck=e.cancelBlurCheck.bind(Object(ze.a)(e)),e.queueBlurCheck=e.queueBlurCheck.bind(Object(ze.a)(e)),e.normalizeButtonFocus=e.normalizeButtonFocus.bind(Object(ze.a)(e)),e}return Object(l.a)(t,c),Object(o.a)(t,[{key:"componentWillUnmount",value:function(){this.cancelBlurCheck()}},{key:"bindNode",value:function(e){e?this.node=e:(delete this.node,this.cancelBlurCheck())}},{key:"queueBlurCheck",value:function(e){var c=this;e.persist(),this.preventBlurCheck||(this.blurCheckTimeout=setTimeout(function(){document.hasFocus()?"function"===typeof c.node.handleFocusOutside&&c.node.handleFocusOutside(e):e.preventDefault()},0))}},{key:"cancelBlurCheck",value:function(){clearTimeout(this.blurCheckTimeout)}},{key:"normalizeButtonFocus",value:function(e){var c=e.type,t=e.target;Object(v.includes)(["mouseup","touchend"],c)?this.preventBlurCheck=!1:function(e){switch(e.nodeName){case"A":case"BUTTON":return!0;case"INPUT":return Object(v.includes)(pe,e.type)}return!1}(t)&&(this.preventBlurCheck=!0)}},{key:"render",value:function(){return Object(h.createElement)("div",{onFocus:this.cancelBlurCheck,onMouseDown:this.normalizeButtonFocus,onMouseUp:this.normalizeButtonFocus,onTouchStart:this.normalizeButtonFocus,onTouchEnd:this.normalizeButtonFocus,onBlur:this.queueBlurCheck},Object(h.createElement)(e,Object(b.a)({ref:this.bindNode},this.props)))}}]),t}(h.Component)},"withFocusOutside")(function(e){function c(){return Object(a.a)(this,c),Object(s.a)(this,Object(i.a)(c).apply(this,arguments))}return Object(l.a)(c,e),Object(o.a)(c,[{key:"handleFocusOutside",value:function(e){this.props.onFocusOutside(e)}},{key:"render",value:function(){return this.props.children}}]),c}(h.Component));var Ve=Object(h.forwardRef)(function(e,c){var t=e.href,r=e.target,n=e.isPrimary,a=e.isLarge,o=e.isSmall,s=e.isTertiary,i=e.isToggled,l=e.isBusy,v=e.isDefault,m=e.isLink,b=e.isDestructive,d=e.className,f=e.disabled,p=Object(z.a)(e,["href","target","isPrimary","isLarge","isSmall","isTertiary","isToggled","isBusy","isDefault","isLink","isDestructive","className","disabled"]),M=H()("components-button",d,{"is-button":v||n||a||o,"is-default":v||!n&&(a||o),"is-primary":n,"is-large":a,"is-small":o,"is-tertiary":s,"is-toggled":i,"is-busy":l,"is-link":m,"is-destructive":b}),V=void 0===t||f?"button":"a",k="a"===V?{href:t,target:r}:{type:"button",disabled:f};return Object(h.createElement)(V,Object(u.a)({},k,p,{className:M,ref:c}))}),ke=t(701),ge=t(783);var Oe=function(e){var c=e.icon,t=void 0===c?null:c,r=e.size,n=Object(z.a)(e,["icon","size"]),a=r||20;if("string"===typeof t)return Object(h.createElement)(ke.a,Object(b.a)({icon:t,size:a},n));if(t&&ke.a===t.type)return Object(h.cloneElement)(t,Object(u.a)({size:a},n));var o=r||24;if("function"===typeof t)return t.prototype instanceof h.Component?Object(h.createElement)(t,Object(u.a)({size:o},n)):t(Object(u.a)({size:o},n));if(t&&("svg"===t.type||t.type===ge.b)){var s=Object(u.a)({width:o,height:o},t.props,n);return Object(h.createElement)(ge.b,s)}return Object(h.isValidElement)(t)?Object(h.cloneElement)(t,Object(u.a)({size:o},n)):t};var Le=Object(h.forwardRef)(function(e,c){var t=e.icon,r=e.children,n=e.label,a=e.className,o=e.tooltip,s=e.shortcut,i=e.labelPosition,l=e.size,u=Object(z.a)(e,["icon","children","label","className","tooltip","shortcut","labelPosition","size"]),m=H()("components-icon-button",a,{"has-text":r}),d=o||n,f=!u.disabled&&(o||s||!!n&&(!r||Object(v.isArray)(r)&&!r.length)&&!1!==o),p=Object(h.createElement)(Ve,Object(b.a)({"aria-label":n},u,{className:m,ref:c}),Object(h.createElement)(Oe,{icon:t,size:l}),r);return f&&(p=Object(h.createElement)(Ge,{text:d,shortcut:s,position:i},p)),p});var ye=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},c=e.htmlDocument,t=void 0===c?document:c,r=e.className,n=void 0===r?"lockscroll":r,v=0,u=0;function z(e){var c=t.scrollingElement||t.body;e&&(u=c.scrollTop);var r=e?"add":"remove";c.classList[r](n),t.documentElement.classList[r](n),e||(c.scrollTop=u)}return function(e){function c(){return Object(a.a)(this,c),Object(s.a)(this,Object(i.a)(c).apply(this,arguments))}return Object(l.a)(c,e),Object(o.a)(c,[{key:"componentDidMount",value:function(){0===v&&z(!0),++v}},{key:"componentWillUnmount",value:function(){1===v&&z(!1),--v}},{key:"render",value:function(){return null}}]),c}(h.Component)}();function je(e){e.stopPropagation()}var we=Object(h.forwardRef)(function(e,c){var t=e.children,r=Object(z.a)(e,["children"]);return Object(h.createElement)("div",Object(b.a)({},r,{ref:c,onMouseDown:je}),t)}),Ce=Object(h.createContext)({registerSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){},getSlot:function(){},getFills:function(){},subscribe:function(){}}),Se=Ce.Provider,xe=Ce.Consumer,Ee=(h.Component,function(e){var c=Object(h.useContext)(Ce),t=c.getSlot,r=c.subscribe,n=d(Object(h.useState)(t(e)),2),a=n[0],o=n[1];return Object(h.useEffect)(function(){return o(t(e)),r(function(){o(t(e))})},[e]),a}),_e=t(77),Fe=0;function Te(e){var c=e.name,t=e.children,r=e.registerFill,n=e.unregisterFill,a=Ee(c),o=Object(h.useRef)({name:c,children:t});return o.current.occurrence||(o.current.occurrence=++Fe),Object(h.useLayoutEffect)(function(){return r(c,o.current),function(){return n(c,o.current)}},[]),Object(h.useLayoutEffect)(function(){o.current.children=t,a&&!a.props.bubblesVirtually&&a.forceUpdate()},[t]),Object(h.useLayoutEffect)(function(){c!==o.current.name&&(n(o.current.name,o.current),o.current.name=c,r(c,o.current))},[c]),a&&a.node&&a.props.bubblesVirtually?(Object(v.isFunction)(t)&&(t=t(a.props.fillProps)),Object(_e.createPortal)(t,a.node)):null}var Ae=function(e){return Object(h.createElement)(xe,null,function(c){var t=c.registerFill,r=c.unregisterFill;return Object(h.createElement)(Te,Object(b.a)({},e,{registerFill:t,unregisterFill:r}))})},Ne=function(e){return!Object(v.isNumber)(e)&&(Object(v.isString)(e)||Object(v.isArray)(e)?!e.length:!e)},Ie=function(e){function c(){var e;return Object(a.a)(this,c),(e=Object(s.a)(this,Object(i.a)(c).apply(this,arguments))).bindNode=e.bindNode.bind(Object(ze.a)(e)),e}return Object(l.a)(c,e),Object(o.a)(c,[{key:"componentDidMount",value:function(){(0,this.props.registerSlot)(this.props.name,this)}},{key:"componentWillUnmount",value:function(){(0,this.props.unregisterSlot)(this.props.name,this)}},{key:"componentDidUpdate",value:function(e){var c=this.props,t=c.name,r=c.unregisterSlot,n=c.registerSlot;e.name!==t&&(r(e.name),n(t,this))}},{key:"bindNode",value:function(e){this.node=e}},{key:"render",value:function(){var e=this.props,c=e.children,t=e.name,r=e.bubblesVirtually,n=void 0!==r&&r,a=e.fillProps,o=void 0===a?{}:a,s=e.getFills,i=e.className;if(n)return Object(h.createElement)("div",{ref:this.bindNode,className:i});var l=Object(v.map)(s(t,this),function(e){var c=e.occurrence,t=Object(v.isFunction)(e.children)?e.children(o):e.children;return h.Children.map(t,function(e,t){if(!e||Object(v.isString)(e))return e;var r="".concat(c,"---").concat(e.key||t);return Object(h.cloneElement)(e,{key:r})})}).filter(Object(v.negate)(Ne));return Object(h.createElement)(h.Fragment,null,Object(v.isFunction)(c)?c(l):l)}}]),c}(h.Component),Pe=function(e){return Object(h.createElement)(xe,null,function(c){var t=c.registerSlot,r=c.unregisterSlot,n=c.getFills;return Object(h.createElement)(Ie,Object(b.a)({},e,{registerSlot:t,unregisterSlot:r,getFills:n}))})};var Be=function(e){var c=e.type,t=e.options,r=void 0===t?{}:t,n=e.children;if("appear"===c){var a,o=r.origin,s=d((void 0===o?"top":o).split(" "),2),i=s[0],l=s[1],h=void 0===l?"center":l;return n({className:H()("components-animate__appear",(a={},Object(T.a)(a,"is-from-"+h,"center"!==h),Object(T.a)(a,"is-from-"+i,"middle"!==i),a))})}if("slide-in"===c){var v=r.origin,u=void 0===v?"left":v;return n({className:H()("components-animate__slide-in","is-from-"+u)})}return n("loading"===c?{className:H()("components-animate__loading")}:{})},De=He(fe(function(e){return e.children}));function Re(e,c){var t=window.getComputedStyle(c),r=t.paddingTop,n=t.paddingBottom,a=t.paddingLeft,o=t.paddingRight,s=r?parseInt(r,10):0,i=n?parseInt(n,10):0,l=a?parseInt(a,10):0,h=o?parseInt(o,10):0;return{x:e.left+l,y:e.top+s,width:e.width-l-h,height:e.height-s-i,left:e.left+l,right:e.right-h,top:e.top+s,bottom:e.bottom-i}}function We(e,c,t){t?e.getAttribute(c)!==t&&e.setAttribute(c,t):e.hasAttribute(c)&&e.removeAttribute(c)}function Ze(e,c){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";e.style[c]!==t&&(e.style[c]=t)}function Ue(e,c,t){t?e.classList.contains(c)||e.classList.add(c):e.classList.contains(c)&&e.classList.remove(c)}var Ke=function(e){var c=e.headerTitle,t=e.onClose,r=e.onKeyDown,n=e.children,a=e.className,o=e.noArrow,s=void 0!==o&&o,i=e.position,l=void 0===i?"top":i,v=(e.range,e.focusOnMount),u=void 0===v?"firstElement":v,m=e.anchorRef,f=e.shouldAnchorIncludePadding,p=e.anchorVerticalBuffer,M=e.anchorHorizontalBuffer,k=e.anchorRect,g=e.getAnchorRect,O=e.expandOnMobile,L=e.animate,y=void 0===L||L,j=e.onClickOutside,w=e.onFocusOutside,C=Object(z.a)(e,["headerTitle","onClose","onKeyDown","children","className","noArrow","position","range","focusOnMount","anchorRef","shouldAnchorIncludePadding","anchorVerticalBuffer","anchorHorizontalBuffer","anchorRect","getAnchorRect","expandOnMobile","animate","onClickOutside","onFocusOutside"]),S=Object(h.useRef)(null),x=Object(h.useRef)(null),E=Object(h.useRef)(),_=Object(h.useRef)(),T=ie("medium","<"),A=d(Object(h.useState)(),2),N=A[0],I=A[1],P=O&&T;s=P||s,Object(h.useEffect)(function(){var e=E.current,c=x.current;if(P)return Ue(e,"is-without-arrow",s),We(e,"data-x-axis"),We(e,"data-y-axis"),Ze(e,"top"),Ze(e,"left"),Ze(c,"maxHeight"),void Ze(c,"maxWidth");var t=function(){var t=function(e,c,t){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=arguments.length>4?arguments[4]:void 0;if(c)return c;if(t){if(!e.current)return;return t(e.current)}if(!1!==r){if(!r)return;if(r instanceof window.Range)return V(r);var a=r.getBoundingClientRect();return n?a:Re(a,r)}if(e.current){var o=e.current.parentNode,s=o.getBoundingClientRect();return n?s:Re(s,o)}}(S,k,g,m,f);if(t){t=function(e){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return{x:e.left-t,y:e.top-c,width:e.width+2*t,height:e.height+2*c,left:e.left-t,right:e.right+t,top:e.top-c,bottom:e.bottom+c}}(t,p,M),_.current||(_.current=c.getBoundingClientRect());var r=ve(t,_.current,l),n=r.popoverTop,a=r.popoverLeft,o=r.xAxis,i=r.yAxis,h=r.contentHeight,v=r.contentWidth;Ue(e,"is-without-arrow",s||"center"===o&&"middle"===i),We(e,"data-x-axis",o),We(e,"data-y-axis",i),Ze(e,"top","number"===typeof n?n+"px":""),Ze(e,"left","number"===typeof a?a+"px":""),Ze(c,"maxHeight","number"===typeof h?h+"px":""),Ze(c,"maxWidth","number"===typeof v?v+"px":""),I(({left:"right",right:"left"}[o]||"center")+" "+({top:"bottom",bottom:"top"}[i]||"middle"))}},r=window.setTimeout(t),n=window.setInterval(t,500);return window.addEventListener("resize",t),window.addEventListener("scroll",t,!0),function(){window.clearTimeout(r),window.clearInterval(n),window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0)}},[P,k,g,m,f,p,M,l]),function(e,c){Object(h.useEffect)(function(){var t=setTimeout(function(){if(e&&c.current)if("firstElement"!==e)"container"===e&&c.current.focus();else{var t=F.tabbable.find(c.current)[0];t?t.focus():c.current.focus()}},0);return function(){return clearTimeout(t)}},[])}(u,x);var B=function(e){27===e.keyCode&&t&&(e.stopPropagation(),t()),r&&r(e)};var D=Object(h.createElement)(Me,{onFocusOutside:function(e){if(w)w(e);else if(j){var c;try{c=new window.MouseEvent("click")}catch(r){(c=document.createEvent("MouseEvent")).initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null)}Object.defineProperty(c,"target",{get:function(){return e.relatedTarget}}),function(e){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=c.version,r=c.alternative,n=c.plugin,a=c.link,o=c.hint,s=n?" from ".concat(n):"",i=t?" and will be removed".concat(s," in version ").concat(t):"",l=r?" Please use ".concat(r," instead."):"",h=a?" See: ".concat(a):"",v=o?" Note: ".concat(o):"",u="".concat(e," is deprecated").concat(i,".").concat(l).concat(h).concat(v);u in te||(ce("deprecated",e,c,u),console.warn(u),te[u]=!0)}("Popover onClickOutside prop",{alternative:"onFocusOutside"}),j(c)}else t&&t()}},Object(h.createElement)(Be,{type:y&&N?"appear":null,options:{origin:N}},function(e){var r=e.className;return Object(h.createElement)(we,Object(b.a)({className:H()("components-popover",a,r,{"is-expanded":P,"is-without-arrow":s})},C,{onKeyDown:B,ref:E}),P&&Object(h.createElement)("div",{className:"components-popover__header"},Object(h.createElement)("span",{className:"components-popover__header-title"},c),Object(h.createElement)(Le,{className:"components-popover__close",icon:"no-alt",onClick:t})),Object(h.createElement)("div",{ref:x,className:"components-popover__content",tabIndex:"-1"},n))}));return u&&(D=Object(h.createElement)(De,null,D)),Object(h.createElement)(xe,null,function(e){var c=e.getSlot;return c&&c("Popover")&&(D=Object(h.createElement)(Ae,{name:"Popover"},D)),Object(h.createElement)("span",{ref:S},D,T&&O&&Object(h.createElement)(ye,null))})};Ke.Slot=function(){return Object(h.createElement)(Pe,{bubblesVirtually:!0,name:"Popover"})};var qe=Ke;var Xe=function(e){var c,t,r=e.shortcut,n=e.className;return r?(Object(v.isString)(r)&&(c=r),Object(v.isObject)(r)&&(c=r.display,t=r.ariaLabel),Object(h.createElement)("span",{className:n,"aria-label":t},c)):null},$e=700,Je=function(e){function c(){var e;return Object(a.a)(this,c),(e=Object(s.a)(this,Object(i.a)(c).apply(this,arguments))).delayedSetIsOver=Object(v.debounce)(function(c){return e.setState({isOver:c})},$e),e.cancelIsMouseDown=e.createSetIsMouseDown(!1),e.isInMouseDown=!1,e.state={isOver:!1},e}return Object(l.a)(c,e),Object(o.a)(c,[{key:"componentWillUnmount",value:function(){this.delayedSetIsOver.cancel(),document.removeEventListener("mouseup",this.cancelIsMouseDown)}},{key:"emitToChild",value:function(e,c){var t=this.props.children;if(1===h.Children.count(t)){var r=h.Children.only(t);"function"===typeof r.props[e]&&r.props[e](c)}}},{key:"createToggleIsOver",value:function(e,c){var t=this;return function(r){if(t.emitToChild(e,r),!r.currentTarget.disabled&&("focus"!==r.type||!t.isInMouseDown)){t.delayedSetIsOver.cancel();var n=Object(v.includes)(["focus","mouseenter"],r.type);n!==t.state.isOver&&(c?t.delayedSetIsOver(n):t.setState({isOver:n}))}}}},{key:"createSetIsMouseDown",value:function(e){var c=this;return function(t){c.emitToChild(e?"onMouseDown":"onMouseUp",t),document[e?"addEventListener":"removeEventListener"]("mouseup",c.cancelIsMouseDown),c.isInMouseDown=e}}},{key:"render",value:function(){var e=this.props,c=e.children,t=e.position,r=e.text,n=e.shortcut;if(1!==h.Children.count(c))return c;var a=h.Children.only(c),o=this.state.isOver;return Object(h.cloneElement)(a,{onMouseEnter:this.createToggleIsOver("onMouseEnter",!0),onMouseLeave:this.createToggleIsOver("onMouseLeave"),onClick:this.createToggleIsOver("onClick"),onFocus:this.createToggleIsOver("onFocus"),onBlur:this.createToggleIsOver("onBlur"),onMouseDown:this.createSetIsMouseDown(!0),children:m(a.props.children,o&&Object(h.createElement)(qe,{focusOnMount:!1,position:t,className:"components-tooltip","aria-hidden":"true",animate:!1},r,Object(h.createElement)(Xe,{className:"components-tooltip__shortcut",shortcut:n})))})}}]),c}(h.Component),Ge=c.a=Je}}]);
dist/chunks/{6a58e1413d18b2716d19.css → 3118174c136567950f4c.css} RENAMED
File without changes
dist/chunks/{6a58e1413d18b2716d19.min.js → 3118174c136567950f4c.min.js} RENAMED
@@ -1 +1 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[153],{549:function(e,t,n){"use strict";var i=n(107),o=n.n(i),r=n(108),s=n.n(r),a=n(528),c=n.n(a),u=n(527),l=n.n(u),p=n(531),f=n.n(p),h=n(529),d=n.n(h),m=n(34),v=n.n(m),b=n(12),g=n.n(b),y=n(10),k=n.n(y),N=n(526),O=n.n(N),E=n(1),C=n(35),j=n(534),w=n.n(j),I=n(577),D=function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return n=c()(this,(e=l()(t)).call.apply(e,[this].concat(r))),v()(f()(n),"dismissTimeout",null),n}return d()(t,e),s()(t,[{key:"componentDidMount",value:function(){this.props.duration>0&&(this.dismissTimeout=setTimeout(this.props.onDismissClick,this.props.duration))}},{key:"componentWillUnmount",value:function(){this.dismissTimeout&&clearTimeout(this.dismissTimeout)}},{key:"componentDidUpdate",value:function(){clearTimeout(this.dismissTimeout),this.props.duration>0&&(this.dismissTimeout=setTimeout(this.props.onDismissClick,this.props.duration))}},{key:"getIcon",value:function(){var e;switch(this.props.status){case"is-info":e="info";break;case"is-success":e="checkmark";break;case"is-error":case"is-warning":e="notice";break;default:e="info"}return e}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,i=e.icon,o=e.isCompact,r=e.isLoading,s=e.onDismissClick,a=e.showDismiss,c=void 0===a?!o:a,u=e.status,l=e.text,p=e.translate,f=O()("notice",u,n,{"is-compact":o,"is-loading":r,"is-dismissable":c});return k.a.createElement("div",{className:f},k.a.createElement("span",{className:"notice__icon-wrapper"},k.a.createElement(w.a,{className:"notice__icon",icon:i||this.getIcon(),size:24})),k.a.createElement("span",{className:"notice__content"},k.a.createElement("span",{className:"notice__text"},l||t)),l?t:null,c&&k.a.createElement("span",{tabIndex:"0",className:"notice__dismiss",onClick:s},k.a.createElement(w.a,{icon:"cross",size:24}),k.a.createElement(I.a,null,p("Dismiss"))))}}]),t}(y.Component);v()(D,"defaultProps",{className:"",duration:0,icon:null,isCompact:!1,isLoading:!1,onDismissClick:E.noop,status:null,text:null}),v()(D,"propTypes",{className:g.a.string,duration:g.a.number,icon:g.a.string,isCompact:g.a.bool,isLoading:g.a.bool,onDismissClick:g.a.func,showDismiss:g.a.bool,status:g.a.oneOf(["is-error","is-info","is-success","is-warning","is-plain"]),text:g.a.oneOfType([g.a.arrayOf(g.a.oneOfType([g.a.string,g.a.node])),g.a.oneOfType([g.a.string,g.a.node])]),translate:g.a.func.isRequired}),t.a=Object(C.localize)(D)},558:function(e,t,n){"use strict";var i=n(47),o=n.n(i),r=n(1),s=n(114),a=o()("calypso:notices");a("initializing notices");var c,u={containerNames:{}};c=u,Object(r.assign)(c,s.EventEmitter.prototype),c.emitChange=function(){this.emit("change")},c.off=c.removeListener;var l=[],p={new:function(e,t,n){var i=t.overlay?"overlay-notices":"notices";u.containerNames[i]=i,a("creating notice",e,t,n),u[i]=[];var o={type:t.type||"message",status:n,text:e,duration:t.duration,container:i,button:t.button,href:t.href,onClick:function(e){if("function"===typeof t.onClick){var n=p.removeNotice.bind(p,o);return t.onClick(e,n)}},onRemoveCallback:t.onRemoveCallback||function(){},arrow:t.arrow,isCompact:t.isCompact,showDismiss:t.showDismiss,persistent:t.persistent};return t.displayOnNextPage?l.push(o):u[i].push(o),u.emit("change"),o},success:function(e,t){return t=t||{},this.new(e,t,"is-success")},error:function(e,t){return t=t||{},this.new(e,t,"is-error")},info:function(e,t){return t=t||{},this.new(e,t,"is-info")},warning:function(e,t){return t=t||{},this.new(e,t,"is-warning")},list:u,removeNotice:function(e){if(e.container){var t=u[e.container],n=t.indexOf(e);-1!==n&&(t.splice(n,1),u.emit("change"))}},clearNoticesOnNavigation:function(e,t){a("clearNoticesOnNavigation");var n=!1,i=function(e){return e.persistent};for(var o in u.containerNames){var r=u[o].length;u[o]=u[o].filter(i),r!==u[o].length&&(n=!0)}l.length&&(l.forEach(function(e){u[e.container]=[],u[e.container].push(e)}),l=[]),n&&u.emit("change"),t()},clearNotices:function(e){u[e]=[],u.emit("change")},getStatusHelper:function(e){return e.error?"is-error":e.warning?"is-warning":e.info?"is-info":e.success?"is-success":void 0}};t.a=p},586:function(e,t,n){"use strict";n.d(t,"a",function(){return N});var i=n(107),o=n.n(i),r=n(108),s=n.n(r),a=n(528),c=n.n(a),u=n(527),l=n.n(u),p=n(529),f=n.n(p),h=n(34),d=n.n(h),m=n(12),v=n.n(m),b=n(10),g=n.n(b),y=n(534),k=n.n(y),N=function(e){function t(){return o()(this,t),c()(this,l()(t).apply(this,arguments))}return f()(t,e),s()(t,[{key:"render",value:function(){var e={className:"notice__action",href:this.props.href,onClick:this.props.onClick};return this.props.external&&(e.target="_blank",e.rel="noopener noreferrer"),g.a.createElement("a",e,g.a.createElement("span",null,this.props.children),this.props.icon&&g.a.createElement(k.a,{icon:this.props.icon,size:24}),this.props.external&&g.a.createElement(k.a,{icon:"external",size:24}))}}]),t}(g.a.Component);d()(N,"displayName","NoticeAction"),d()(N,"propTypes",{href:v.a.string,onClick:v.a.func,external:v.a.bool,icon:v.a.string}),d()(N,"defaultProps",{external:!1})},592:function(e,t,n){},600:function(e,t,n){"use strict";var i=n(530),o=n.n(i),r=n(533),s=n.n(r),a=n(164),c=n.n(a),u=n(12),l=n.n(u),p=n(10),f=n.n(p),h=n(549),d=n(586),m=n(526),v=n.n(m);n(592);function b(e){var t=e.id,n=e.className,i=e.children;return f.a.createElement("div",{id:t,className:v()("global-notices",n)},i)}var g=n(558),y=n(47),k=n.n(y)()("calypso:data-observe"),N=n(109),O=n(1),E=n(542),C=Object(E.a)(function(e){return Object(O.values)(e.notices.items)},function(e){return e.notices.items}),j=(Object(E.a)(function(e,t){return e.notices.lastTimeShown[t]||0},function(e){return e.notices.lastTimeShown}),n(545)),w=c()({displayName:"GlobalNotices",mixins:[function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return{componentDidMount:function(){t.forEach(function(e){this.props[e]?this.props[e].on("change",this.update):k(e+" is not set.")},this)},componentWillUnmount:function(){t.forEach(function(e){this.props[e]&&this.props[e].off("change",this.update)},this)},componentWillReceiveProps:function(e){t.forEach(function(t){this.props[t]!==e[t]&&(this.props[t]&&this.props[t].off("change",this.update),e[t]&&e[t].on("change",this.update))},this)},update:function(){k("Re-rendering "+this.constructor.displayName+" component."),this.forceUpdate()}}}("notices")],propTypes:{id:l.a.string,notices:l.a.oneOfType([l.a.object,l.a.array]),removeNotice:l.a.func.isRequired,storeNotices:l.a.array.isRequired},getDefaultProps:function(){return{id:"overlay-notices",notices:Object.freeze([])}},removeNoticeStoreNotice:function(e){return function(){e&&g.a.removeNotice(e)}},removeReduxNotice:function(e,t){var n=this;return function(i){t&&t(i),n.props.removeNotice(e)}},render:function(){var e=(this.props.notices[this.props.id]||[]).map(function(e,t){return f.a.createElement(h.a,{key:"notice-old-"+t,status:e.status,duration:e.duration||null,text:e.text,isCompact:e.isCompact,onDismissClick:this.removeNoticeStoreNotice(e),showDismiss:e.showDismiss},e.button&&f.a.createElement(d.a,{href:e.href,onClick:e.onClick},e.button))},this);return(e=e.concat(this.props.storeNotices.map(function(e){var t=e.button,n=e.href,i=e.noticeId,r=e.onClick,a=e.onDismissClick,c=s()(e,["button","href","noticeId","onClick","onDismissClick"]);return f.a.createElement(h.a,o()({},c,{key:"notice-".concat(i),onDismissClick:this.removeReduxNotice(i,a)}),t&&f.a.createElement(d.a,{href:n,onClick:r},t))},this))).length?f.a.createElement(b,{id:this.props.id},e):null}});t.a=Object(N.b)(function(e){return{storeNotices:C(e)}},{removeNotice:j.c})(w)},672:function(e,t,n){"use strict";var i=n(107),o=n.n(i),r=n(108),s=n.n(r),a=n(528),c=n.n(a),u=n(527),l=n.n(u),p=n(529),f=n.n(p),h=n(10),d=n(12),m=n.n(d),v=n(109),b=n(30),g=n(567),y=n(546),k=function(e){function t(){return o()(this,t),c()(this,l()(t).apply(this,arguments))}return f()(t,e),s()(t,[{key:"fetch",value:function(e){var t=e.siteId,n=e.loaded,i=e.fetching,o=e.error;n||i||o||this.props.fetchSettings(t)}},{key:"UNSAFE_componentWillMount",value:function(){this.fetch(this.props)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.fetch(e)}},{key:"render",value:function(){return null}}]),t}(h.Component);k.propTypes={siteId:m.a.number.isRequired},t.a=Object(v.b)(function(e){return{loaded:Object(y.d)(e),fetching:Object(y.c)(e),error:Object(y.b)(e)}},function(e){return Object(b.b)({fetchSettings:g.a},e)})(k)},673:function(e,t,n){"use strict";var i=n(107),o=n.n(i),r=n(108),s=n.n(r),a=n(528),c=n.n(a),u=n(527),l=n.n(u),p=n(529),f=n.n(p),h=n(10),d=n(12),m=n.n(d),v=n(109),b=n(30),g=n(553),y=n(540),k=function(e){function t(){return o()(this,t),c()(this,l()(t).apply(this,arguments))}return f()(t,e),s()(t,[{key:"fetch",value:function(e){var t=e.siteId,n=e.loaded,i=e.fetching,o=e.error;n||i||o||this.props.fetchSettings(t)}},{key:"UNSAFE_componentWillMount",value:function(){this.fetch(this.props)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.fetch(e)}},{key:"render",value:function(){return null}}]),t}(h.Component);k.propTypes={siteId:m.a.number.isRequired},t.a=Object(v.b)(function(e){return{loaded:Object(y.i)(e),fetching:Object(y.h)(e),error:Object(y.g)(e)}},function(e){return Object(b.b)({fetchSettings:g.fetchSettings},e)})(k)},794:function(e,t,n){"use strict";n.r(t);var i=n(36),o=n.n(i),r=n(107),s=n.n(r),a=n(108),c=n.n(a),u=n(528),l=n.n(u),p=n(527),f=n.n(p),h=n(531),d=n.n(h),m=n(529),v=n.n(m),b=n(34),g=n.n(b),y=n(10),k=n.n(y),N=n(12),O=n.n(N),E=n(30),C=n(109),j=n(35),w=n(672),I=n(673),D=n(683),L=n(565),T=function(e){function t(){var e,n;s()(this,t);for(var i=arguments.length,o=new Array(i),r=0;r<i;r++)o[r]=arguments[r];return n=l()(this,(e=f()(t)).call.apply(e,[this].concat(o))),g()(d()(n),"fetch",function(){var e=n.props,t=e.fetchLocations,i=e.loadingLocations,o=e.locationsLoaded,r=e.siteId;!i&&!o&&t(r)}),g()(d()(n),"componentDidMount",function(){n.fetch()}),g()(d()(n),"componentDidUpdate",function(){n.fetch()}),g()(d()(n),"render",function(){return null}),n}return v()(t,e),t}(y.Component);g()(T,"propTypes",{fetchLocations:O.a.func,siteId:O.a.number.isRequired,loadingLocations:O.a.bool.isRequired,locationsLoaded:O.a.bool.isRequired});var _=Object(C.b)(function(e){return{loadingLocations:Object(L.c)(e),locationsLoaded:Object(L.b)(e)}},function(e){return Object(E.b)({fetchLocations:D.a},e)})(T),R=n(543),S=n(537),x=function(e){function t(){return s()(this,t),l()(this,f()(t).apply(this,arguments))}return v()(t,e),c()(t,[{key:"fetch",value:function(e){var t=e.orderId,n=e.siteId,i=e.loaded,o=e.fetching,r=e.error,s=e.refreshedLabelStatus;i||o||r?i&&!s&&this.props.fetchLabelsStatus(t,n):this.props.fetchLabelsData(t,n)}},{key:"UNSAFE_componentWillMount",value:function(){this.fetch(this.props)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.fetch(e)}},{key:"render",value:function(){var e=this.props.siteId;return k.a.createElement("div",null,k.a.createElement(w.a,{siteId:e}),k.a.createElement(I.a,{siteId:e}),k.a.createElement(_,{siteId:e}))}}]),t}(y.Component);x.propTypes={siteId:O.a.number.isRequired,orderId:O.a.number.isRequired};var A=Object(C.b)(function(e,t){var n=t.orderId;return{loaded:Object(S.t)(e,n),fetching:Object(S.s)(e,n),error:Object(S.r)(e,n),refreshedLabelStatus:Object(S.m)(e,n)}},function(e){return Object(E.b)({fetchLabelsData:R.q,fetchLabelsStatus:R.r},e)})(x),q=n(600),U=n(558),W=n(532),z=n(702),P=n(646),M=n(605),F=n(636),J=function(e){function t(){var e,n;s()(this,t);for(var i=arguments.length,o=new Array(i),r=0;r<i;r++)o[r]=arguments[r];return n=l()(this,(e=f()(t)).call.apply(e,[this].concat(o))),g()(d()(n),"renderActivityLog",function(){var e=n.props,t=e.siteId,i=e.orderId,o=e.events,r=e.translate;return 0===o.length?r("No tracking information available at this time"):k.a.createElement("div",{className:"shipment-tracking__dummy-class order-activity-log"},k.a.createElement(z.a,{orderId:i,siteId:t}))}),n}return v()(t,e),c()(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.siteId,n=e.orderId,i=e.orderLoading,o=e.orderLoaded;t&&n&&!i&&!o&&this.props.fetchOrder(t,n)}},{key:"render",value:function(){var e=this.props,t=e.siteId,n=e.orderId;return k.a.createElement("div",{className:"shipment-tracking__container"},k.a.createElement(q.a,{notices:U.a.list}),k.a.createElement(A,{orderId:n,siteId:t,origin:"tracking"}),this.renderActivityLog())}}]),t}(y.Component);g()(J,"propTypes",{orderId:O.a.number.isRequired});t.default=Object(C.b)(function(e,t){var n=t.orderId,i=Object(W.a)(e);return{siteId:i,events:Object(P.b)(e,n),orderLoading:Object(M.c)(e,n,i),orderLoaded:Object(M.b)(e,n,i)}},function(e){return o()({},Object(E.b)({fetchOrder:F.e},e))})(Object(j.localize)(J))}}]);
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[153],{549:function(e,t,n){"use strict";var i=n(107),o=n.n(i),r=n(108),s=n.n(r),a=n(528),c=n.n(a),u=n(527),l=n.n(u),p=n(531),f=n.n(p),h=n(529),d=n.n(h),m=n(34),v=n.n(m),b=n(12),g=n.n(b),y=n(10),k=n.n(y),N=n(526),O=n.n(N),E=n(1),C=n(35),j=n(534),w=n.n(j),I=n(577),D=function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return n=c()(this,(e=l()(t)).call.apply(e,[this].concat(r))),v()(f()(n),"dismissTimeout",null),n}return d()(t,e),s()(t,[{key:"componentDidMount",value:function(){this.props.duration>0&&(this.dismissTimeout=setTimeout(this.props.onDismissClick,this.props.duration))}},{key:"componentWillUnmount",value:function(){this.dismissTimeout&&clearTimeout(this.dismissTimeout)}},{key:"componentDidUpdate",value:function(){clearTimeout(this.dismissTimeout),this.props.duration>0&&(this.dismissTimeout=setTimeout(this.props.onDismissClick,this.props.duration))}},{key:"getIcon",value:function(){var e;switch(this.props.status){case"is-info":e="info";break;case"is-success":e="checkmark";break;case"is-error":case"is-warning":e="notice";break;default:e="info"}return e}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,i=e.icon,o=e.isCompact,r=e.isLoading,s=e.onDismissClick,a=e.showDismiss,c=void 0===a?!o:a,u=e.status,l=e.text,p=e.translate,f=O()("notice",u,n,{"is-compact":o,"is-loading":r,"is-dismissable":c});return k.a.createElement("div",{className:f},k.a.createElement("span",{className:"notice__icon-wrapper"},k.a.createElement(w.a,{className:"notice__icon",icon:i||this.getIcon(),size:24})),k.a.createElement("span",{className:"notice__content"},k.a.createElement("span",{className:"notice__text"},l||t)),l?t:null,c&&k.a.createElement("span",{tabIndex:"0",className:"notice__dismiss",onClick:s},k.a.createElement(w.a,{icon:"cross",size:24}),k.a.createElement(I.a,null,p("Dismiss"))))}}]),t}(y.Component);v()(D,"defaultProps",{className:"",duration:0,icon:null,isCompact:!1,isLoading:!1,onDismissClick:E.noop,status:null,text:null}),v()(D,"propTypes",{className:g.a.string,duration:g.a.number,icon:g.a.string,isCompact:g.a.bool,isLoading:g.a.bool,onDismissClick:g.a.func,showDismiss:g.a.bool,status:g.a.oneOf(["is-error","is-info","is-success","is-warning","is-plain"]),text:g.a.oneOfType([g.a.arrayOf(g.a.oneOfType([g.a.string,g.a.node])),g.a.oneOfType([g.a.string,g.a.node])]),translate:g.a.func.isRequired}),t.a=Object(C.localize)(D)},559:function(e,t,n){"use strict";var i=n(47),o=n.n(i),r=n(1),s=n(114),a=o()("calypso:notices");a("initializing notices");var c,u={containerNames:{}};c=u,Object(r.assign)(c,s.EventEmitter.prototype),c.emitChange=function(){this.emit("change")},c.off=c.removeListener;var l=[],p={new:function(e,t,n){var i=t.overlay?"overlay-notices":"notices";u.containerNames[i]=i,a("creating notice",e,t,n),u[i]=[];var o={type:t.type||"message",status:n,text:e,duration:t.duration,container:i,button:t.button,href:t.href,onClick:function(e){if("function"===typeof t.onClick){var n=p.removeNotice.bind(p,o);return t.onClick(e,n)}},onRemoveCallback:t.onRemoveCallback||function(){},arrow:t.arrow,isCompact:t.isCompact,showDismiss:t.showDismiss,persistent:t.persistent};return t.displayOnNextPage?l.push(o):u[i].push(o),u.emit("change"),o},success:function(e,t){return t=t||{},this.new(e,t,"is-success")},error:function(e,t){return t=t||{},this.new(e,t,"is-error")},info:function(e,t){return t=t||{},this.new(e,t,"is-info")},warning:function(e,t){return t=t||{},this.new(e,t,"is-warning")},list:u,removeNotice:function(e){if(e.container){var t=u[e.container],n=t.indexOf(e);-1!==n&&(t.splice(n,1),u.emit("change"))}},clearNoticesOnNavigation:function(e,t){a("clearNoticesOnNavigation");var n=!1,i=function(e){return e.persistent};for(var o in u.containerNames){var r=u[o].length;u[o]=u[o].filter(i),r!==u[o].length&&(n=!0)}l.length&&(l.forEach(function(e){u[e.container]=[],u[e.container].push(e)}),l=[]),n&&u.emit("change"),t()},clearNotices:function(e){u[e]=[],u.emit("change")},getStatusHelper:function(e){return e.error?"is-error":e.warning?"is-warning":e.info?"is-info":e.success?"is-success":void 0}};t.a=p},586:function(e,t,n){"use strict";n.d(t,"a",function(){return N});var i=n(107),o=n.n(i),r=n(108),s=n.n(r),a=n(528),c=n.n(a),u=n(527),l=n.n(u),p=n(529),f=n.n(p),h=n(34),d=n.n(h),m=n(12),v=n.n(m),b=n(10),g=n.n(b),y=n(534),k=n.n(y),N=function(e){function t(){return o()(this,t),c()(this,l()(t).apply(this,arguments))}return f()(t,e),s()(t,[{key:"render",value:function(){var e={className:"notice__action",href:this.props.href,onClick:this.props.onClick};return this.props.external&&(e.target="_blank",e.rel="noopener noreferrer"),g.a.createElement("a",e,g.a.createElement("span",null,this.props.children),this.props.icon&&g.a.createElement(k.a,{icon:this.props.icon,size:24}),this.props.external&&g.a.createElement(k.a,{icon:"external",size:24}))}}]),t}(g.a.Component);d()(N,"displayName","NoticeAction"),d()(N,"propTypes",{href:v.a.string,onClick:v.a.func,external:v.a.bool,icon:v.a.string}),d()(N,"defaultProps",{external:!1})},593:function(e,t,n){},601:function(e,t,n){"use strict";var i=n(530),o=n.n(i),r=n(533),s=n.n(r),a=n(164),c=n.n(a),u=n(12),l=n.n(u),p=n(10),f=n.n(p),h=n(549),d=n(586),m=n(526),v=n.n(m);n(593);function b(e){var t=e.id,n=e.className,i=e.children;return f.a.createElement("div",{id:t,className:v()("global-notices",n)},i)}var g=n(559),y=n(47),k=n.n(y)()("calypso:data-observe"),N=n(109),O=n(1),E=n(542),C=Object(E.a)(function(e){return Object(O.values)(e.notices.items)},function(e){return e.notices.items}),j=(Object(E.a)(function(e,t){return e.notices.lastTimeShown[t]||0},function(e){return e.notices.lastTimeShown}),n(545)),w=c()({displayName:"GlobalNotices",mixins:[function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return{componentDidMount:function(){t.forEach(function(e){this.props[e]?this.props[e].on("change",this.update):k(e+" is not set.")},this)},componentWillUnmount:function(){t.forEach(function(e){this.props[e]&&this.props[e].off("change",this.update)},this)},componentWillReceiveProps:function(e){t.forEach(function(t){this.props[t]!==e[t]&&(this.props[t]&&this.props[t].off("change",this.update),e[t]&&e[t].on("change",this.update))},this)},update:function(){k("Re-rendering "+this.constructor.displayName+" component."),this.forceUpdate()}}}("notices")],propTypes:{id:l.a.string,notices:l.a.oneOfType([l.a.object,l.a.array]),removeNotice:l.a.func.isRequired,storeNotices:l.a.array.isRequired},getDefaultProps:function(){return{id:"overlay-notices",notices:Object.freeze([])}},removeNoticeStoreNotice:function(e){return function(){e&&g.a.removeNotice(e)}},removeReduxNotice:function(e,t){var n=this;return function(i){t&&t(i),n.props.removeNotice(e)}},render:function(){var e=(this.props.notices[this.props.id]||[]).map(function(e,t){return f.a.createElement(h.a,{key:"notice-old-"+t,status:e.status,duration:e.duration||null,text:e.text,isCompact:e.isCompact,onDismissClick:this.removeNoticeStoreNotice(e),showDismiss:e.showDismiss},e.button&&f.a.createElement(d.a,{href:e.href,onClick:e.onClick},e.button))},this);return(e=e.concat(this.props.storeNotices.map(function(e){var t=e.button,n=e.href,i=e.noticeId,r=e.onClick,a=e.onDismissClick,c=s()(e,["button","href","noticeId","onClick","onDismissClick"]);return f.a.createElement(h.a,o()({},c,{key:"notice-".concat(i),onDismissClick:this.removeReduxNotice(i,a)}),t&&f.a.createElement(d.a,{href:n,onClick:r},t))},this))).length?f.a.createElement(b,{id:this.props.id},e):null}});t.a=Object(N.b)(function(e){return{storeNotices:C(e)}},{removeNotice:j.c})(w)},672:function(e,t,n){"use strict";var i=n(107),o=n.n(i),r=n(108),s=n.n(r),a=n(528),c=n.n(a),u=n(527),l=n.n(u),p=n(529),f=n.n(p),h=n(10),d=n(12),m=n.n(d),v=n(109),b=n(30),g=n(567),y=n(546),k=function(e){function t(){return o()(this,t),c()(this,l()(t).apply(this,arguments))}return f()(t,e),s()(t,[{key:"fetch",value:function(e){var t=e.siteId,n=e.loaded,i=e.fetching,o=e.error;n||i||o||this.props.fetchSettings(t)}},{key:"UNSAFE_componentWillMount",value:function(){this.fetch(this.props)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.fetch(e)}},{key:"render",value:function(){return null}}]),t}(h.Component);k.propTypes={siteId:m.a.number.isRequired},t.a=Object(v.b)(function(e){return{loaded:Object(y.d)(e),fetching:Object(y.c)(e),error:Object(y.b)(e)}},function(e){return Object(b.b)({fetchSettings:g.a},e)})(k)},673:function(e,t,n){"use strict";var i=n(107),o=n.n(i),r=n(108),s=n.n(r),a=n(528),c=n.n(a),u=n(527),l=n.n(u),p=n(529),f=n.n(p),h=n(10),d=n(12),m=n.n(d),v=n(109),b=n(30),g=n(553),y=n(540),k=function(e){function t(){return o()(this,t),c()(this,l()(t).apply(this,arguments))}return f()(t,e),s()(t,[{key:"fetch",value:function(e){var t=e.siteId,n=e.loaded,i=e.fetching,o=e.error;n||i||o||this.props.fetchSettings(t)}},{key:"UNSAFE_componentWillMount",value:function(){this.fetch(this.props)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.fetch(e)}},{key:"render",value:function(){return null}}]),t}(h.Component);k.propTypes={siteId:m.a.number.isRequired},t.a=Object(v.b)(function(e){return{loaded:Object(y.i)(e),fetching:Object(y.h)(e),error:Object(y.g)(e)}},function(e){return Object(b.b)({fetchSettings:g.fetchSettings},e)})(k)},794:function(e,t,n){"use strict";n.r(t);var i=n(36),o=n.n(i),r=n(107),s=n.n(r),a=n(108),c=n.n(a),u=n(528),l=n.n(u),p=n(527),f=n.n(p),h=n(531),d=n.n(h),m=n(529),v=n.n(m),b=n(34),g=n.n(b),y=n(10),k=n.n(y),N=n(12),O=n.n(N),E=n(30),C=n(109),j=n(35),w=n(672),I=n(673),D=n(683),L=n(565),T=function(e){function t(){var e,n;s()(this,t);for(var i=arguments.length,o=new Array(i),r=0;r<i;r++)o[r]=arguments[r];return n=l()(this,(e=f()(t)).call.apply(e,[this].concat(o))),g()(d()(n),"fetch",function(){var e=n.props,t=e.fetchLocations,i=e.loadingLocations,o=e.locationsLoaded,r=e.siteId;!i&&!o&&t(r)}),g()(d()(n),"componentDidMount",function(){n.fetch()}),g()(d()(n),"componentDidUpdate",function(){n.fetch()}),g()(d()(n),"render",function(){return null}),n}return v()(t,e),t}(y.Component);g()(T,"propTypes",{fetchLocations:O.a.func,siteId:O.a.number.isRequired,loadingLocations:O.a.bool.isRequired,locationsLoaded:O.a.bool.isRequired});var _=Object(C.b)(function(e){return{loadingLocations:Object(L.c)(e),locationsLoaded:Object(L.b)(e)}},function(e){return Object(E.b)({fetchLocations:D.a},e)})(T),R=n(543),S=n(537),x=function(e){function t(){return s()(this,t),l()(this,f()(t).apply(this,arguments))}return v()(t,e),c()(t,[{key:"fetch",value:function(e){var t=e.orderId,n=e.siteId,i=e.loaded,o=e.fetching,r=e.error,s=e.refreshedLabelStatus;i||o||r?i&&!s&&this.props.fetchLabelsStatus(t,n):this.props.fetchLabelsData(t,n)}},{key:"UNSAFE_componentWillMount",value:function(){this.fetch(this.props)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.fetch(e)}},{key:"render",value:function(){var e=this.props.siteId;return k.a.createElement("div",null,k.a.createElement(w.a,{siteId:e}),k.a.createElement(I.a,{siteId:e}),k.a.createElement(_,{siteId:e}))}}]),t}(y.Component);x.propTypes={siteId:O.a.number.isRequired,orderId:O.a.number.isRequired};var A=Object(C.b)(function(e,t){var n=t.orderId;return{loaded:Object(S.t)(e,n),fetching:Object(S.s)(e,n),error:Object(S.r)(e,n),refreshedLabelStatus:Object(S.m)(e,n)}},function(e){return Object(E.b)({fetchLabelsData:R.q,fetchLabelsStatus:R.r},e)})(x),q=n(601),U=n(559),W=n(532),z=n(702),P=n(646),M=n(605),F=n(637),J=function(e){function t(){var e,n;s()(this,t);for(var i=arguments.length,o=new Array(i),r=0;r<i;r++)o[r]=arguments[r];return n=l()(this,(e=f()(t)).call.apply(e,[this].concat(o))),g()(d()(n),"renderActivityLog",function(){var e=n.props,t=e.siteId,i=e.orderId,o=e.events,r=e.translate;return 0===o.length?r("No tracking information available at this time"):k.a.createElement("div",{className:"shipment-tracking__dummy-class order-activity-log"},k.a.createElement(z.a,{orderId:i,siteId:t}))}),n}return v()(t,e),c()(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.siteId,n=e.orderId,i=e.orderLoading,o=e.orderLoaded;t&&n&&!i&&!o&&this.props.fetchOrder(t,n)}},{key:"render",value:function(){var e=this.props,t=e.siteId,n=e.orderId;return k.a.createElement("div",{className:"shipment-tracking__container"},k.a.createElement(q.a,{notices:U.a.list}),k.a.createElement(A,{orderId:n,siteId:t,origin:"tracking"}),this.renderActivityLog())}}]),t}(y.Component);g()(J,"propTypes",{orderId:O.a.number.isRequired});t.default=Object(C.b)(function(e,t){var n=t.orderId,i=Object(W.a)(e);return{siteId:i,events:Object(P.b)(e,n),orderLoading:Object(M.c)(e,n,i),orderLoaded:Object(M.b)(e,n,i)}},function(e){return o()({},Object(E.b)({fetchOrder:F.e},e))})(Object(j.localize)(J))}}]);
dist/chunks/{ce946dd5bc07a4877da7.css → 344ed6a2abda149eb6e6.css} RENAMED
File without changes
dist/chunks/344ed6a2abda149eb6e6.min.js ADDED
@@ -0,0 +1 @@
 
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[145],{532:function(e,t,n){"use strict";n.d(t,"a",function(){return r});n(1),n(560);function r(e){return e.ui.selectedSiteId}},535:function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return a}),n.d(t,"d",function(){return i}),n.d(t,"e",function(){return c}),n.d(t,"c",function(){return s}),n.d(t,"f",function(){return o}),n.d(t,"h",function(){return u}),n.d(t,"g",function(){return l}),n.d(t,"j",function(){return d}),n.d(t,"i",function(){return m}),n.d(t,"k",function(){return p}),n.d(t,"l",function(){return f}),n.d(t,"p",function(){return E}),n.d(t,"q",function(){return _}),n.d(t,"r",function(){return O}),n.d(t,"s",function(){return b}),n.d(t,"t",function(){return g}),n.d(t,"u",function(){return h}),n.d(t,"y",function(){return v}),n.d(t,"z",function(){return S}),n.d(t,"A",function(){return C}),n.d(t,"v",function(){return j}),n.d(t,"w",function(){return N}),n.d(t,"x",function(){return I}),n.d(t,"C",function(){return y}),n.d(t,"E",function(){return R}),n.d(t,"D",function(){return P}),n.d(t,"B",function(){return M}),n.d(t,"F",function(){return k}),n.d(t,"G",function(){return T}),n.d(t,"H",function(){return A}),n.d(t,"I",function(){return L}),n.d(t,"J",function(){return w}),n.d(t,"K",function(){return D}),n.d(t,"m",function(){return x}),n.d(t,"n",function(){return W}),n.d(t,"o",function(){return U}),n.d(t,"L",function(){return G}),n.d(t,"M",function(){return V}),n.d(t,"N",function(){return H}),n.d(t,"O",function(){return F}),n.d(t,"P",function(){return z}),n.d(t,"Q",function(){return q}),n.d(t,"R",function(){return B}),n.d(t,"W",function(){return Z}),n.d(t,"X",function(){return K}),n.d(t,"Y",function(){return Q}),n.d(t,"Z",function(){return Y}),n.d(t,"ab",function(){return $}),n.d(t,"bb",function(){return X}),n.d(t,"cb",function(){return J}),n.d(t,"db",function(){return ee}),n.d(t,"eb",function(){return te}),n.d(t,"fb",function(){return ne}),n.d(t,"gb",function(){return re}),n.d(t,"hb",function(){return ae}),n.d(t,"ib",function(){return ie}),n.d(t,"jb",function(){return ce}),n.d(t,"kb",function(){return se}),n.d(t,"lb",function(){return oe}),n.d(t,"mb",function(){return ue}),n.d(t,"nb",function(){return le}),n.d(t,"ob",function(){return de}),n.d(t,"pb",function(){return me}),n.d(t,"rb",function(){return pe}),n.d(t,"qb",function(){return fe}),n.d(t,"sb",function(){return Ee}),n.d(t,"tb",function(){return _e}),n.d(t,"ub",function(){return Oe}),n.d(t,"vb",function(){return be}),n.d(t,"wb",function(){return ge}),n.d(t,"xb",function(){return he}),n.d(t,"yb",function(){return ve}),n.d(t,"zb",function(){return Se}),n.d(t,"Ab",function(){return Ce}),n.d(t,"Bb",function(){return je}),n.d(t,"Cb",function(){return Ne}),n.d(t,"Db",function(){return Ie}),n.d(t,"Eb",function(){return ye}),n.d(t,"Fb",function(){return Re}),n.d(t,"Gb",function(){return Pe}),n.d(t,"Hb",function(){return Me}),n.d(t,"Ib",function(){return ke}),n.d(t,"U",function(){return Te}),n.d(t,"V",function(){return Ae}),n.d(t,"S",function(){return Le}),n.d(t,"T",function(){return we});var r="WOOCOMMERCE_ACTION_LIST_ANNOTATE",a="WOOCOMMERCE_ACTION_LIST_CLEAR",i="WOOCOMMERCE_ACTION_LIST_STEP_NEXT",c="WOOCOMMERCE_ACTION_LIST_STEP_SUCCESS",s="WOOCOMMERCE_ACTION_LIST_STEP_FAILURE",o="WOOCOMMERCE_COUNT_REQUEST",u="WOOCOMMERCE_COUNT_REQUEST_SUCCESS",l="WOOCOMMERCE_COUNT_REQUEST_FAILURE",d="WOOCOMMERCE_ERROR_SET",m="WOOCOMMERCE_ERROR_CLEAR",p="WOOCOMMERCE_LOCATIONS_REQUEST",f="WOOCOMMERCE_LOCATIONS_REQUEST_SUCCESS",E="WOOCOMMERCE_ORDER_DELETE",_="WOOCOMMERCE_ORDER_DELETE_FAILURE",O="WOOCOMMERCE_ORDER_DELETE_SUCCESS",b="WOOCOMMERCE_ORDER_INVOICE_SEND",g="WOOCOMMERCE_ORDER_INVOICE_SEND_FAILURE",h="WOOCOMMERCE_ORDER_INVOICE_SEND_SUCCESS",v="WOOCOMMERCE_ORDER_NOTE_CREATE",S="WOOCOMMERCE_ORDER_NOTE_CREATE_FAILURE",C="WOOCOMMERCE_ORDER_NOTE_CREATE_SUCCESS",j="WOOCOMMERCE_ORDER_NOTES_REQUEST",N="WOOCOMMERCE_ORDER_NOTES_REQUEST_FAILURE",I="WOOCOMMERCE_ORDER_NOTES_REQUEST_SUCCESS",y="WOOCOMMERCE_ORDER_REFUND_CREATE",R="WOOCOMMERCE_ORDER_REFUND_CREATE_SUCCESS",P="WOOCOMMERCE_ORDER_REFUND_CREATE_FAILURE",M="WOOCOMMERCE_ORDER_REFUNDS_REQUEST_SUCCESS",k="WOOCOMMERCE_ORDER_REQUEST",T="WOOCOMMERCE_ORDER_REQUEST_FAILURE",A="WOOCOMMERCE_ORDER_REQUEST_SUCCESS",L="WOOCOMMERCE_ORDER_UPDATE",w="WOOCOMMERCE_ORDER_UPDATE_FAILURE",D="WOOCOMMERCE_ORDER_UPDATE_SUCCESS",x="WOOCOMMERCE_ORDERS_REQUEST",W="WOOCOMMERCE_ORDERS_REQUEST_FAILURE",U="WOOCOMMERCE_ORDERS_REQUEST_SUCCESS",G="WOOCOMMERCE_SERVICES_SHIPPING_ACTION_LIST_CREATE",V="WOOCOMMERCE_SETTINGS_PRODUCTS_CHANGE_SETTING",H="WOOCOMMERCE_SETTINGS_PRODUCTS_REQUEST",F="WOOCOMMERCE_SETTINGS_PRODUCTS_REQUEST_SUCCESS",z="WOOCOMMERCE_SETTINGS_PRODUCTS_UPDATE_REQUEST",q="WOOCOMMERCE_SETTINGS_PRODUCTS_UPDATE_REQUEST_FAILURE",B="WOOCOMMERCE_SETTINGS_PRODUCTS_UPDATE_REQUEST_SUCCESS",Z="WOOCOMMERCE_SHIPPING_ZONE_ADD",K="WOOCOMMERCE_SHIPPING_ZONE_CANCEL",Q="WOOCOMMERCE_SHIPPING_ZONE_CLOSE",Y="WOOCOMMERCE_SHIPPING_ZONE_DELETED",$="WOOCOMMERCE_SHIPPING_ZONE_EDIT_NAME",X="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_CANCEL",J="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_CLOSE",ee="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_EDIT",te="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_EDIT_POSTCODE",ne="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_FILTER_BY_POSTCODE",re="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_FILTER_BY_STATE",ae="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_FILTER_BY_WHOLE_COUNTRY",ie="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_SELECT_CONTINENT",ce="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_SELECT_COUNTRY",se="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_SELECT_STATE",oe="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_UPDATED",ue="WOOCOMMERCE_SHIPPING_ZONE_METHODS_REQUEST",le="WOOCOMMERCE_SHIPPING_ZONE_METHODS_REQUEST_SUCCESS",de="WOOCOMMERCE_SHIPPING_ZONE_METHOD_ADD",me="WOOCOMMERCE_SHIPPING_ZONE_METHOD_CANCEL",pe="WOOCOMMERCE_SHIPPING_ZONE_METHOD_CLOSE",fe="WOOCOMMERCE_SHIPPING_ZONE_METHOD_CHANGE_TYPE",Ee="WOOCOMMERCE_SHIPPING_ZONE_METHOD_CREATE",_e="WOOCOMMERCE_SHIPPING_ZONE_METHOD_DELETE",Oe="WOOCOMMERCE_SHIPPING_ZONE_METHOD_DELETED",be="WOOCOMMERCE_SHIPPING_ZONE_METHOD_EDIT_TITLE",ge="WOOCOMMERCE_SHIPPING_ZONE_METHOD_OPEN",he="WOOCOMMERCE_SHIPPING_ZONE_METHOD_REMOVE",ve="WOOCOMMERCE_SHIPPING_ZONE_METHOD_SET_CONDITION",Se="WOOCOMMERCE_SHIPPING_ZONE_METHOD_SET_COST",Ce="WOOCOMMERCE_SHIPPING_ZONE_METHOD_SET_MIN_COST",je="WOOCOMMERCE_SHIPPING_ZONE_METHOD_SET_TAXABLE",Ne="WOOCOMMERCE_SHIPPING_ZONE_METHOD_TOGGLE_ENABLED",Ie="WOOCOMMERCE_SHIPPING_ZONE_METHOD_TOGGLE_OPENED_ENABLED",ye="WOOCOMMERCE_SHIPPING_ZONE_METHOD_UPDATE",Re="WOOCOMMERCE_SHIPPING_ZONE_METHOD_UPDATED",Pe="WOOCOMMERCE_SHIPPING_ZONE_OPEN",Me="WOOCOMMERCE_SHIPPING_ZONE_REMOVE",ke="WOOCOMMERCE_SHIPPING_ZONE_UPDATED",Te="WOOCOMMERCE_SHIPPING_ZONES_REQUEST",Ae="WOOCOMMERCE_SHIPPING_ZONES_REQUEST_SUCCESS",Le="WOOCOMMERCE_SHIPPING_CLASSES_REQUEST",we="WOOCOMMERCE_SHIPPING_CLASSES_REQUEST_SUCCESS"},537:function(e,t,n){"use strict";n.d(t,"j",function(){return f}),n.d(t,"t",function(){return E}),n.d(t,"s",function(){return _}),n.d(t,"r",function(){return O}),n.d(t,"h",function(){return b}),n.d(t,"g",function(){return g}),n.d(t,"v",function(){return h}),n.d(t,"u",function(){return v}),n.d(t,"m",function(){return S}),n.d(t,"e",function(){return C}),n.d(t,"l",function(){return j}),n.d(t,"p",function(){return N}),n.d(t,"n",function(){return P}),n.d(t,"f",function(){return T}),n.d(t,"o",function(){return A}),n.d(t,"q",function(){return L}),n.d(t,"d",function(){return w}),n.d(t,"b",function(){return D}),n.d(t,"i",function(){return x}),n.d(t,"c",function(){return W}),n.d(t,"k",function(){return U}),n.d(t,"a",function(){return G});var r=n(1),a=n(35),i=n(542),c=n(532),s=n(551),o=n(546),u=n(540),l=n(564),d=n(575),m=n(565),p=n(566),f=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e);return Object(r.get)(e,["extensions","woocommerce","woocommerceServices",n,"shippingLabel",t],null)},E=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),r=f(e,t,n);return r&&r.loaded},_=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),r=f(e,t,n);return r&&r.isFetching},O=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),r=f(e,t,n);return r&&r.error},b=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),r=f(e,t,n);return r&&r.loaded?r.labels:[]},g=function(e,t,n,r){return b(e,t,n).find(function(e){return e.label_id===r})},h=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),r=f(e,t,n);return r&&r.fulfillOrder},v=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),r=f(e,t,n);return r&&r.emailDetails},S=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),r=f(e,t,n);return r&&r.refreshedLabelStatus},C=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),r=f(e,t,n);return r&&r.form},j=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),i=C(e,t,n);if(!i)return null;var s=i.rates,o=s.values,u=s.available,l=[],d=0,m=0,p=function(e){if(!(e in u))return"continue";var t=o[e],n=t.serviceId,i=t.signatureRequired,c=u[e].default.rates,s=null,p=null;i in u[e]&&(s=u[e][i].rates,p=Object(r.find)(s,function(e){return n===e.service_id})||null);var f=Object(r.find)(c,function(e){return n===e.service_id});if(f){var E=f.retail_rate-f.rate,_=f.rate,O={title:f.title,retailRate:f.retail_rate,rateWithDiscount:_,addons:[],carrierId:f.carrier_id,carrierTitle:f.title.split("-")[0].trim()};null!==p&&(O.addons=[{title:Object(a.translate)("Signature Required"),rate:p.rate-f.rate}],_=p.rate),l.push(O),d+=Object(r.round)(E,2),m+=_}};for(var f in o)p(f);return l.length?{prices:l,discount:d,total:m}:null},N=Object(i.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),a=C(e,t,n);if(Object(r.isEmpty)(a))return!1;var i=Object(l.a)(a.origin),s=Object(l.a)(a.destination);return!("US"!==i.country||!Object(r.includes)(d.d,i.state))||(!("US"!==s.country||!Object(r.includes)(d.d,s.state))||i.country!==s.country&&(!Object(r.includes)(d.b,i.country)||!Object(r.includes)(d.b,s.country)))},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e);return[C(e,t,n)]}),I=function(e,t,n,i){var c=t.values,s=Object(l.a)(t),o=s.phone,u=s.postcode,p=s.state,f=s.country,E={};return["name","address","city","postcode","country"].forEach(function(e){c[e]||(E[e]=Object(a.translate)("This field is required"))}),Object(r.includes)(d.a,f)&&!/^\d{5}(?:-\d{4})?$/.test(u)&&(E.postcode=Object(a.translate)("Invalid ZIP/Postal code format")),!p&&Object(m.j)(e,f,n)&&(E.state=Object(a.translate)("This field is required")),i&&(o?10!==o.split(/\D+/g).join("").replace(/^1/,"").length&&(E.phone=Object(a.translate)("Customs forms require a 10-digit phone number. Please edit your phone number so it has at most 10 digits.")):E.phone=Object(a.translate)("Please enter a phone number for your origin address. It's required because this shipment requires a customs form.")),E},y=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=e.isNormalized,c=e.isUnverifiable,s=e.normalized,o=e.ignoreValidation,u=e.fieldErrors;if((i||c)&&!s&&u)return u;if(i&&!s)return{address:Object(a.translate)("This address is not recognized. Please try another.")};var l=I(t,e,n,r);return o&&Object.keys(l).forEach(function(e){o[e]&&delete l[e]}),l},R=function(e,t,n,i){var c=Object(r.uniq)(Object(r.flatten)(Object(r.map)(e,function(e){return Object(r.map)(e.items,"product_id")}))),s=Object(r.zipObject)(c,Object(r.fill)(Array(c.length),0));Object(r.forEach)(e,function(e){Object(r.forEach)(e.items,function(e){var n=e.quantity,r=e.product_id;return s[r]+=n*t.items[r].value})});var o={};return Object(r.forEach)(Object(r.pick)(t.items,c),function(e,t){e.tariffNumber&&6===e.tariffNumber.length&&(o[e.tariffNumber]||(o[e.tariffNumber]=0),o[e.tariffNumber]+=s[t])}),{packages:Object(r.mapValues)(e,function(e){var c={};"other"!==e.contentsType||e.contentsExplanation||(c.contentsExplanation=Object(a.translate)("Please describe what kind of goods this package contains")),"other"!==e.restrictionType||e.restrictionComments||(c.restrictionComments=Object(a.translate)("Please describe what kind of restrictions this package must have"));var s=new Set;return Object(r.forEach)(e.items,function(e){var n=e.product_id,r=t.items[n].tariffNumber;2500<o[r]&&s.add(r)}),e.itn?/^(?:(?:AES X\d{14})|(?:NOEEI 30\.\d{1,2}(?:\([a-z]\)(?:\(\d\))?)?))$/.test(e.itn)||(c.itn=Object(a.translate)("Invalid format")):"CA"!==n&&(Object(r.isEmpty)(s)?Object(r.includes)(d.c,n)&&(c.itn=Object(a.translate)("International Transaction Number is required for shipments to %(country)s",{args:{country:i}})):c.itn=Object(a.translate)("International Transaction Number is required for shipping items valued over $2,500 per tariff number. Products with tariff number %(code)s add up to more than $2,500.",{args:{code:s.values().next().value}})),c}),items:Object(r.mapValues)(Object(r.pick)(t.items,c),function(e,n){var i={};return e.description||(i.description=Object(a.translate)("This field is required")),t.ignoreWeightValidation[n]||(Object(r.isNil)(e.weight)||""===e.weight?i.weight=Object(a.translate)("This field is required"):parseFloat(e.weight)>0||(i.weight=Object(a.translate)("Weight must be greater than zero"))),t.ignoreValueValidation[n]||(Object(r.isNil)(e.value)||""===e.value?i.value=Object(a.translate)("This field is required"):parseFloat(e.value)>0||(i.value=Object(a.translate)("Declared value must be greater than zero"))),e.tariffNumber&&6!==e.tariffNumber.length&&(i.tariffNumber=Object(a.translate)("The tariff number must be 6 digits long")),i})}},P=function(e){var t=e.values,n=e.available,a=Object(r.map)(n,function(e,n){return t[n]});return!Object(r.isEmpty)(a)&&Object(r.every)(a)},M=function(e){var t=e.values,n=e.available;return Object(r.mapValues)(n,function(e,n){if(!Object(r.isEmpty)(e.default.errors)){var i=e.default.errors.map(function(e){return e.userMessage||e.message}).filter(Boolean);return i.length?i:["We couldn't get a rate for this package, please try again."]}return t[n]&&t[n].serviceId?[]:Object(r.isEmpty)(e.default.rates)?[Object(a.translate)("No rates available, please double check dimensions and weight or try using different packaging.")]:[Object(a.translate)("Please choose a rate")]})},k=function(e){var t={};return e||(t.paperSize=Object(a.translate)("This field is required")),t},T=Object(i.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e);if(!E(e,t,n))return{};var i=f(e,t,n),s=i.form,o=i.paperSize;if(Object(r.isEmpty)(s))return{};var u,l=s.destination.values.country,d=Object(m.g)(e,l,n),p=N(e,t,n);return{origin:y(s.origin,e,n,p),destination:y(s.destination,e,n),packages:(u=s.packages.selected,Object(r.mapValues)(u,function(e){var t={};"not_selected"===e.box_id&&(t.box_id=Object(a.translate)("Please select a package"));var n=function(e){return!Object(r.isFinite)(e)||0>=e};return n(e.weight)&&(t.weight=Object(a.translate)("Invalid weight")),Object(r.some)([e.length,e.width,e.height],n)&&(t.dimensions=Object(a.translate)("Package dimensions must be greater than zero")),t})),customs:R(s.packages.selected,s.customs,l,d),rates:M(s.rates),sidebar:k(o)}},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e);return[f(e,t,n)]}),A=Object(i.a)(function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Object(c.a)(e),a=f(e,t,r).form,i="origin"===n&&N(e,t,r),s=I(e,a[n],r,i);return 0===Object.keys(s).length},function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Object(c.a)(e);return[f(e,t,r).form[n]]}),L=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),a=C(e,t,n);if(!a)return!1;var i=Object(r.uniq)(Object(r.flatten)(Object(r.map)(a.packages.selected,function(e){return Object(r.map)(e.items,"product_id")})));return!Object(r.some)(i.map(function(e){return Object(r.isNil)(a.customs.items[e].tariffNumber)||a.customs.ignoreWeightValidation[e]||a.customs.ignoreValueValidation[e]}))},w=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),a=C(e,t,n);if(!a)return null;var i=T(e,t,n);return a.origin.isNormalized&&Object(r.isEqual)(a.origin.values,a.origin.normalized)&&!Object(s.a)(i.origin)?a.destination.isNormalized&&Object(r.isEqual)(a.destination.values,a.destination.normalized)&&!Object(s.a)(i.destination)?Object(s.a)(i.packages)?"packages":!N(e,t,n)||!Object(s.a)(i.customs)&&L(e,t,n)?Object(s.a)(i.rates)?"rates":null:"customs":"destination":"origin"},D=Object(i.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e),a=C(e,t,n);return!Object(r.isEmpty)(a)&&!w(e,t,n)&&!a.origin.normalizationInProgress&&!a.destination.normalizationInProgress&&!a.rates.retrievalInProgress&&!Object(r.isEmpty)(a.rates.available)},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e);return[C(e,t,n),w(e,t,n)]}),x=Object(i.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(c.a)(e),n=Object(m.d)(e,t);return Object(p.b)(e,t)?Object(r.pick)(n,d.a):Object(r.pick)(n,d.b)},[m.d,p.b]),W=Object(i.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(c.a)(e),n=Object(m.d)(e,t);return Object(p.b)(e,t)?n:Object(r.pick)(n,d.b)},[m.d,p.b]),U=Object(i.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e);if(!Object(m.j)(e,t,n))return null;var a=Object(m.i)(e,t,n),i={};return a.forEach(function(e){var t=e.code,n=e.name;return i[t]=n}),"US"!==t||Object(p.b)(e,n)?i:Object(r.omit)(i,d.d)},[m.i,p.b]),G=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(c.a)(e);return E(e,t,n)&&Object(o.d)(e,n)&&Object(u.i)(e,n)&&Object(m.b)(e,n)}},538:function(e,t,n){"use strict";n.d(t,"b",function(){return r}),n.d(t,"d",function(){return a}),n.d(t,"e",function(){return i}),n.d(t,"f",function(){return c}),n.d(t,"c",function(){return s}),n.d(t,"a",function(){return o}),n.d(t,"g",function(){return u}),n.d(t,"h",function(){return l}),n.d(t,"i",function(){return d}),n.d(t,"j",function(){return m}),n.d(t,"k",function(){return p}),n.d(t,"l",function(){return f}),n.d(t,"m",function(){return E}),n.d(t,"n",function(){return _}),n.d(t,"o",function(){return O}),n.d(t,"q",function(){return b}),n.d(t,"p",function(){return g}),n.d(t,"r",function(){return h}),n.d(t,"s",function(){return v}),n.d(t,"t",function(){return S}),n.d(t,"u",function(){return C}),n.d(t,"v",function(){return j}),n.d(t,"w",function(){return N}),n.d(t,"B",function(){return I}),n.d(t,"x",function(){return y}),n.d(t,"C",function(){return R}),n.d(t,"z",function(){return P}),n.d(t,"A",function(){return M}),n.d(t,"D",function(){return k}),n.d(t,"E",function(){return T}),n.d(t,"F",function(){return A}),n.d(t,"G",function(){return L}),n.d(t,"H",function(){return w}),n.d(t,"I",function(){return D}),n.d(t,"J",function(){return x}),n.d(t,"K",function(){return W}),n.d(t,"L",function(){return U}),n.d(t,"M",function(){return G}),n.d(t,"N",function(){return V}),n.d(t,"y",function(){return H}),n.d(t,"O",function(){return F}),n.d(t,"P",function(){return z}),n.d(t,"Q",function(){return q}),n.d(t,"R",function(){return B}),n.d(t,"S",function(){return Z}),n.d(t,"T",function(){return K}),n.d(t,"U",function(){return Q}),n.d(t,"Ob",function(){return Y}),n.d(t,"V",function(){return $}),n.d(t,"W",function(){return X}),n.d(t,"X",function(){return J}),n.d(t,"Y",function(){return ee}),n.d(t,"Z",function(){return te}),n.d(t,"ab",function(){return ne}),n.d(t,"bb",function(){return re}),n.d(t,"cb",function(){return ae}),n.d(t,"db",function(){return ie}),n.d(t,"eb",function(){return ce}),n.d(t,"fb",function(){return se}),n.d(t,"gb",function(){return oe}),n.d(t,"hb",function(){return ue}),n.d(t,"ib",function(){return le}),n.d(t,"jb",function(){return de}),n.d(t,"kb",function(){return me}),n.d(t,"lb",function(){return pe}),n.d(t,"nb",function(){return fe}),n.d(t,"mb",function(){return Ee}),n.d(t,"ob",function(){return _e}),n.d(t,"pb",function(){return Oe}),n.d(t,"qb",function(){return be}),n.d(t,"rb",function(){return ge}),n.d(t,"sb",function(){return he}),n.d(t,"tb",function(){return ve}),n.d(t,"ub",function(){return Se}),n.d(t,"vb",function(){return Ce}),n.d(t,"wb",function(){return je}),n.d(t,"xb",function(){return Ne}),n.d(t,"zb",function(){return Ie}),n.d(t,"Ab",function(){return ye}),n.d(t,"Bb",function(){return Re}),n.d(t,"Cb",function(){return Pe}),n.d(t,"Db",function(){return Me}),n.d(t,"Eb",function(){return ke}),n.d(t,"Fb",function(){return Te}),n.d(t,"Gb",function(){return Ae}),n.d(t,"Hb",function(){return Le}),n.d(t,"Ib",function(){return we}),n.d(t,"Jb",function(){return De}),n.d(t,"yb",function(){return xe}),n.d(t,"Lb",function(){return We}),n.d(t,"Kb",function(){return Ue}),n.d(t,"Mb",function(){return Ge}),n.d(t,"Nb",function(){return Ve}),n.d(t,"Pb",function(){return He}),n.d(t,"Qb",function(){return Fe}),n.d(t,"Rb",function(){return ze});var r="WOOCOMMERCE_SERVICES_LABELS_INIT_FORM",a="WOOCOMMERCE_SERVICES_LABELS_RESTORE_PRISTINE",i="WOOCOMMERCE_SERVICES_LABELS_SET_FORM_DATA_VALUE",c="WOOCOMMERCE_SERVICES_LABELS_SET_FORM_META_PROPERTY",s="WOOCOMMERCE_SERVICES_LABELS_OPEN_ADD_CARD_DIALOG",o="WOOCOMMERCE_SERVICES_LABELS_CLOSE_ADD_CARD_DIALOG",u="WOOCOMMERCE_SERVICES_PACKAGES_ADD_PACKAGE",l="WOOCOMMERCE_SERVICES_PACKAGES_DISMISS_MODAL",d="WOOCOMMERCE_SERVICES_PACKAGES_EDIT_PACKAGE",m="WOOCOMMERCE_SERVICES_PACKAGES_INIT_PACKAGES_FORM",p="WOOCOMMERCE_SERVICES_PACKAGES_REMOVE_PACKAGE",f="WOOCOMMERCE_SERVICES_PACKAGES_REMOVE_PREDEFINED",E="WOOCOMMERCE_SERVICES_PACKAGES_SAVE_PACKAGE",_="WOOCOMMERCE_SERVICES_PACKAGES_SAVE_PREDEFINED",O="WOOCOMMERCE_SERVICES_PACKAGES_SET_ADD_MODE",b="WOOCOMMERCE_SERVICES_PACKAGES_SET_IS_FETCH_ERROR",g="WOOCOMMERCE_SERVICES_PACKAGES_SET_IS_FETCHING",h="WOOCOMMERCE_SERVICES_PACKAGES_SET_IS_SAVING",v="WOOCOMMERCE_SERVICES_PACKAGES_SET_MODAL_ERROR",S="WOOCOMMERCE_SERVICES_PACKAGES_TOGGLE_ALL_PREDEFINED",C="WOOCOMMERCE_SERVICES_PACKAGES_TOGGLE_OUTER_DIMENSIONS",j="WOOCOMMERCE_SERVICES_PACKAGES_TOGGLE_PREDEFINED",N="WOOCOMMERCE_SERVICES_PACKAGES_UPDATE_PACKAGES_FIELD",I="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_ADD_ITEMS",y="WOOCOMMERCE_SERVICES_SERVICE_SETTINGS_UPDATE_FIELD",R="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_ADD_PACKAGE",P="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_ADDRESS_NORMALIZATION_COMPLETED",M="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_ADDRESS_NORMALIZATION_IN_PROGRESS",k="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLEAR_AVAILABLE_RATES",T="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_ADD_ITEM",A="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_DETAILS_DIALOG",L="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_ITEM_MOVE",w="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_REFUND_DIALOG",D="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_REPRINT_DIALOG",x="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CONFIRM_ADDRESS_SUGGESTION",W="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CONFIRM_REPRINT",U="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_EDIT_ADDRESS",G="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_EDIT_UNVERIFIABLE_ADDRESS",V="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_EXIT_PRINTING_FLOW",H="WOOCOMMERCE_SERVICES_SHIPPING_EXIT_TRACKING_FLOW",F="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_INIT",z="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_MOVE_ITEM",q="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_ADD_ITEM",B="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_DETAILS_DIALOG",Z="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_ITEM_MOVE",K="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_PACKAGE",Q="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_PRINTING_FLOW",Y="WOOCOMMERCE_SERVICES_SHIPPING_OPEN_TRACKING_FLOW",$="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_REFUND_DIALOG",X="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_REPRINT_DIALOG",J="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_PURCHASE_REQUEST",ee="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_PURCHASE_RESPONSE",te="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_RATES_RETRIEVAL_COMPLETED",ne="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_RATES_RETRIEVAL_IN_PROGRESS",re="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REFUND_REQUEST",ae="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REFUND_RESPONSE",ie="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REMOVE_IGNORE_VALIDATION",ce="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REMOVE_PACKAGE",se="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REPRINT_DIALOG_ERROR",oe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REPRINT_DIALOG_READY",ue="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SAVE_CUSTOMS",le="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SAVE_PACKAGES",de="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SELECT_NORMALIZED_ADDRESS",me="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_ABANDON_ON_NON_DELIVERY",pe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_ADDED_ITEM",fe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CONTENTS_TYPE",Ee="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CONTENTS_EXPLANATION",_e="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_DESCRIPTION",Oe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_ORIGIN_COUNTRY",be="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_TARIFF_NUMBER",ge="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_VALUE",he="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_WEIGHT",ve="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_EMAIL_DETAILS",Se="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_FETCH_ERROR",Ce="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_FULFILL_ORDER",je="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_IS_FETCHING",Ne="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_ITN",Ie="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_PACKAGE_TYPE",ye="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_RATES",Re="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_RESTRICTION_COMMENTS",Pe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_RESTRICTION_TYPE",Me="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_TARGET_PACKAGE",ke="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SHOW_PRINT_CONFIRMATION",Te="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_STATUS_RESPONSE",Ae="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_STATUS_RETRIEVAL_IN_PROGRESS",Le="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_TOGGLE_STEP",we="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_UPDATE_ADDRESS_VALUE",De="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_UPDATE_PACKAGE_WEIGHT",xe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_PACKAGE_SIGNATURE",We="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_UPDATE_RATE",Ue="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_UPDATE_PAPER_SIZE",Ge="WOOCOMMERCE_SERVICES_SHIPPING_METHOD_SCHEMA_REQUEST",Ve="WOOCOMMERCE_SERVICES_SHIPPING_METHOD_SCHEMA_REQUEST_SUCCESS",He="WOOCOMMERCE_SERVICES_SHIPPING_ZONE_METHOD_SETTINGS_REQUEST",Fe="WOOCOMMERCE_SERVICES_SHIPPING_ZONE_METHOD_SETTINGS_REQUEST_SUCCESS",ze="WOOCOMMERCE_SERVICES_SHIPPING_ZONE_METHOD_UPDATE"},539:function(e,t,n){"use strict";n.d(t,"b",function(){return r}),n.d(t,"a",function(){return a});var r="LOADING",a="ERROR"},540:function(e,t,n){"use strict";n.d(t,"e",function(){return f}),n.d(t,"b",function(){return _}),n.d(t,"d",function(){return O}),n.d(t,"a",function(){return b}),n.d(t,"c",function(){return g}),n.d(t,"f",function(){return h}),n.d(t,"i",function(){return v}),n.d(t,"h",function(){return S}),n.d(t,"g",function(){return C});var r=n(110),a=n.n(r),i=n(36),c=n.n(i),s=n(1),o=n(35),u=n(542),l=n(532),d=n(575),m=n(564),p=n(537),f=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e);return Object(s.get)(e,["extensions","woocommerce","woocommerceServices",t,"packages"],null)},E=function(e){return e&&e.predefinedSchema?Object.keys(e.predefinedSchema):[]},_=Object(u.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=f(e,t);if(!n||!n.predefinedSchema||!n.packages)return null;var r=[];Object(s.forEach)(n.predefinedSchema,function(e,t){var a=(n.packages.predefined||{})[t]||[];Object(s.forEach)(e,function(e){var n=e.definitions;Object(s.forEach)(n,function(e){Object(s.includes)(a,e.id)&&r.push(c()({},e,{serviceId:t}))})})});var a=(n.packages.custom||[]).map(function(e,t){return c()({},e,{index:t})});return Object(s.orderBy)(r.concat(a),"name")},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=f(e,t);if(!n||!n.packages)return[];var r=E(n);return[].concat(a()(n.packages.custom||[]),a()(r.map(function(e){return(n.packages.predefined||{})[e]})))}),O=Object(u.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(l.a)(e),r=f(e,n);if(!r||!r.predefinedSchema||!r.packages)return null;var a=Object(p.e)(e,t,n),i=Object(m.a)(a.origin).country,c=Object(m.a)(a.destination).country,u=d.a.includes(i)&&!d.a.includes(c),E={custom:{title:Object(o.translate)("Custom Packages"),definitions:r.packages.custom}};return Object(s.forEach)(r.predefinedSchema,function(e,t){var n=(r.packages.predefined||{})[t]||[];Object(s.forEach)(e,function(e,t){var r=e.definitions,a={title:e.title,definitions:[]};Object(s.forEach)(r,function(e){u&&!1===e.can_ship_international||Object(s.includes)(n,e.id)&&a.definitions.push(e)}),a.definitions.length&&(E[t]=a)})}),E},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(l.a)(e),r=f(e,n);if(!r||!r.packages)return[];var i=E(r),c=Object(p.e)(e,t,n),s=Object(m.a)(c.origin).country,o=Object(m.a)(c.destination).country;return[].concat(a()(r.packages.custom||[]),a()(i.map(function(e){return(r.packages.predefined||{})[e]})),[s,o])}),b=Object(u.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=f(e,t);if(!n||!n.predefinedSchema||!n.packages)return null;var r={};return Object(s.forEach)(n.packages.custom,function(e){r[e.name]=e}),Object(s.forEach)(n.predefinedSchema,function(e){Object(s.forEach)(e,function(e){var t=e.definitions;Object(s.forEach)(t,function(e){r[e.id]=e})})}),r},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=f(e,t);if(!n||!n.packages)return[];var r=E(n);return[].concat(a()(n.packages.custom||[]),a()(r.map(function(e){return(n.packages.predefined||{})[e]})))}),g=Object(u.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=f(e,t);if(!n||!n.currentlyEditingPredefinedPackages)return null;var r={},a=n.predefinedSchema,i=n.currentlyEditingPredefinedPackages;return Object(s.forEach)(a,function(e,t){var n=i[t]||[];Object(s.forEach)(e,function(e,a){var i={groupId:a,serviceId:t,title:e.title,packages:[],total:e.definitions.length,selected:0};Object(s.forEach)(e.definitions,function(e){var r=Object(s.includes)(n,e.id);r&&i.selected++,i.packages.push(c()({},e,{selected:r,serviceId:t}))}),r["".concat(t,"-").concat(a)]=i})}),r},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=f(e,t);if(!n||!n.currentlyEditingPredefinedPackages)return[];var r=E(n);return a()(r.map(function(e){return n.currentlyEditingPredefinedPackages[e]}))}),h=Object(u.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=0,r=0,a=f(e,t);if(!a||!a.currentlyEditingPredefinedPackages)return{added:n,removed:r};var i=a.packages&&a.packages.predefined?a.packages.predefined:{},c=a.currentlyEditingPredefinedPackages;return Object.keys(c).forEach(function(e){var t=i[e],r=c[e];t?r.forEach(function(e){Object(s.includes)(t,e)||n++}):n+=r.length}),Object.keys(i).forEach(function(e){var t=i[e],n=c[e];n?t.forEach(function(e){Object(s.includes)(n,e)||r++}):r+=t.length}),{added:n,removed:r}},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=f(e,t);if(!n||!n.currentlyEditingPredefinedPackages)return[];var r=E(n);return[].concat(a()(r.map(function(e){return n.packages&&n.packages.predefined&&n.packages.predefined[e]})),a()(r.map(function(e){return n.currentlyEditingPredefinedPackages[e]})))}),v=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=f(e,t);return n&&n.isLoaded},S=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=f(e,t);return n&&n.isFetching},C=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=f(e,t);return n&&n.isFetchError}},541:function(e,t,n){"use strict";n.d(t,"e",function(){return r}),n.d(t,"c",function(){return S}),n.d(t,"d",function(){return C}),n.d(t,"b",function(){return j}),n.d(t,"a",function(){return N});var r={};n.r(r),n.d(r,"accountSettings",function(){return i}),n.d(r,"packages",function(){return c}),n.d(r,"orderLabels",function(){return s}),n.d(r,"getLabelRates",function(){return o}),n.d(r,"labelStatus",function(){return u}),n.d(r,"labelRefund",function(){return l}),n.d(r,"labelsPrint",function(){return d}),n.d(r,"labelTestPrint",function(){return m}),n.d(r,"addressNormalization",function(){return p}),n.d(r,"serviceSettings",function(){return f}),n.d(r,"shippingCarrier",function(){return E}),n.d(r,"shippingCarriers",function(){return _}),n.d(r,"subscriptions",function(){return O}),n.d(r,"subscriptionActivate",function(){return b}),n.d(r,"shippingCarrierDelete",function(){return g}),n.d(r,"shippingCarrierTypes",function(){return h});var a=n(563),i="connect/account/settings",c="connect/packages",s=function(e){return"connect/label/".concat(e)},o=function(e){return"connect/label/".concat(e,"/rates")},u=function(e,t){return"connect/label/".concat(e,"/").concat(t)},l=function(e,t){return"connect/label/".concat(e,"/").concat(t,"/refund")},d=function(){return"connect/label/print"},m=function(){return"connect/label/preview"},p=function(){return"connect/normalize-address"},f=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"connect/services/".concat(e,"/").concat(t)},E=function(){return"connect/shipping/carrier"},_=function(){return"connect/shipping/carriers"},O=function(){return"connect/subscriptions"},b=function(e){return"connect/subscription/".concat(e,"/activate")},g=function(e){return"connect/shipping/carrier/".concat(e)},h=function(){return"connect/shipping/carrier-types"},v=function(e){if(e&&e.message)throw e.message;if(e&&e.data&&e.data.message)throw e.data.message;throw e},S=function(e,t,n){return Object(a.a)(e).post(t,n,"wc/v1").catch(v)},C=function(e,t,n){return Object(a.a)(e).put(t,n,"wc/v1").catch(v)},j=function(e,t){return Object(a.a)(e).get(t,"wc/v1").catch(v)},N=function(e,t){return Object(a.a)(e).del(t,"wc/v1").catch(v)}},542:function(e,t,n){"use strict";n.d(t,"a",function(){return u});var r=n(1),a=n(603),i=n.n(a),c=(n(113),function(e){return e}),s=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.join()},o=function(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return e.map(function(e){return e.apply(void 0,[t].concat(r))})}};function u(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s,u=Object(r.memoize)(e,a);return Array.isArray(n)&&(n=o(n)),Object.assign(function(e){for(var r=arguments.length,a=new Array(r>1?r-1:0),c=1;c<r;c++)a[c-1]=arguments[c];var s=n.apply(void 0,[e].concat(a));return Array.isArray(s)||(s=[s]),t&&!i()(s,t)&&u.cache.clear(),t=s,u.apply(void 0,[e].concat(a))},{memoizedSelector:u})}},544:function(e,t,n){"use strict";n.d(t,"a",function(){return N});var r=n(530),a=n.n(r),i=n(533),c=n.n(i),s=n(107),o=n.n(s),u=n(108),l=n.n(u),d=n(528),m=n.n(d),p=n(527),f=n.n(p),E=n(529),_=n.n(E),O=n(34),b=n.n(O),g=n(10),h=n.n(g),v=n(12),S=n.n(v),C=n(526),j=n.n(C),N=function(e){function t(){return o()(this,t),m()(this,f()(t).apply(this,arguments))}return _()(t,e),l()(t,[{key:"render",value:function(){var e=j()("button",this.props.className,{"is-compact":this.props.compact,"is-primary":this.props.primary,"is-scary":this.props.scary,"is-busy":this.props.busy,"is-borderless":this.props.borderless});if(this.props.href){var t=this.props,n=(t.compact,t.primary,t.scary,t.busy,t.borderless,t.type,c()(t,["compact","primary","scary","busy","borderless","type"])),r=n.target?(n.rel||"").replace(/noopener|noreferrer/g,"")+" noopener noreferrer":n.rel;return h.a.createElement("a",a()({},n,{rel:r,className:e}))}var i=this.props,s=(i.compact,i.primary,i.scary,i.busy,i.borderless,i.target,i.rel,c()(i,["compact","primary","scary","busy","borderless","target","rel"]));return h.a.createElement("button",a()({},s,{className:e}))}}]),t}(g.PureComponent);b()(N,"propTypes",{compact:S.a.bool,primary:S.a.bool,scary:S.a.bool,busy:S.a.bool,type:S.a.string,href:S.a.string,borderless:S.a.bool,target:S.a.string,rel:S.a.string}),b()(N,"defaultProps",{type:"button"})},545:function(e,t,n){"use strict";n.d(t,"c",function(){return o}),n.d(t,"d",function(){return l}),n.d(t,"a",function(){return d}),n.d(t,"b",function(){return m});var r=n(533),a=n.n(r),i=n(1),c={debounce:i.debounce,isPlainObject:i.isPlainObject,uniqueId:i.uniqueId},s=(n(46),c.uniqueId);function o(e){return{noticeId:e,type:"NOTICE_REMOVE"}}function u(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.id,i=a()(n,["id"]);return{type:"NOTICE_CREATE",notice:Object.assign({showDismiss:!0},i,{noticeId:r||s(),status:e,text:t})}}var l=u.bind(null,"is-success"),d=u.bind(null,"is-error"),m=u.bind(null,"is-info");u.bind(null,"is-warning"),u.bind(null,"is-plain")},546:function(e,t,n){"use strict";n.d(t,"f",function(){return c}),n.d(t,"g",function(){return s}),n.d(t,"h",function(){return o}),n.d(t,"i",function(){return u}),n.d(t,"d",function(){return l}),n.d(t,"c",function(){return d}),n.d(t,"b",function(){return m}),n.d(t,"a",function(){return p}),n.d(t,"n",function(){return f}),n.d(t,"o",function(){return E}),n.d(t,"e",function(){return _}),n.d(t,"q",function(){return O}),n.d(t,"p",function(){return b}),n.d(t,"k",function(){return g}),n.d(t,"l",function(){return h}),n.d(t,"m",function(){return v}),n.d(t,"j",function(){return S});var r=n(1),a=n(532),i=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);return Object(r.get)(e,["extensions","woocommerce","woocommerceServices",t,"labelSettings"],null)},c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=i(e,t);return n&&n.data},s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=i(e,t);return n&&n.meta},o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=i(e,t);return n&&n.storeOptions},u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=s(e,t);return n&&n.user},l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=s(e,t);return n&&n.isLoaded},d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=s(e,t);return n&&n.isFetching},m=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=s(e,t);return n&&n.isFetchError},p=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=c(e,t);return n&&n.enabled},f=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=c(e,t);return n&&n.selected_payment_method_id},E=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=s(e,t);return n&&n.pristine},_=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=c(e,t);return n&&n.email_receipts},O=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=s(e,t);return n&&n.can_manage_payments},b=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=s(e,t);return n&&n.can_edit_settings},g=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=c(e,t);return n&&n.paper_size},h=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=s(e,t);return n&&n.payment_methods},v=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=s(e,t);return n&&n.warnings&&n.warnings.payment_methods},S=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=s(e,t);return{masterUserName:n&&n.master_user_name,masterUserLogin:n&&n.master_user_login,masterUserEmail:n&&n.master_user_email,masterUserWpcomLogin:n&&n.master_user_wpcom_login}}},547:function(e,t,n){"use strict";var r=n(530),a=n.n(r),i=n(533),c=n.n(i),s=n(36),o=n.n(s),u=n(10),l=n.n(u),d=n(12),m=n.n(d),p=n(526),f=n.n(p),E=n(35),_=n(1),O=function(e){var t=e.children,n=e.required,r=e.optional,i=e.translate,s=e.className,u=c()(e,["children","required","optional","translate","className"]);return t=l.a.Children.toArray(t)||[],n&&t.push(function(e){return l.a.createElement("small",{className:"form-label__required"},e("Required"))}(i)),r&&t.push(function(e){return l.a.createElement("small",{className:"form-label__optional"},e("Optional"))}(i)),l.a.createElement("label",a()({},Object(_.omit)(u,"moment","numberFormat"),{className:f()(s,"form-label")}),t.length?t.map(function(e,t){return Object(_.isObject)(e)?o()({},e,{key:t}):e}):null)};O.propTypes={required:m.a.bool},t.a=Object(E.localize)(O)},549:function(e,t,n){"use strict";var r=n(107),a=n.n(r),i=n(108),c=n.n(i),s=n(528),o=n.n(s),u=n(527),l=n.n(u),d=n(531),m=n.n(d),p=n(529),f=n.n(p),E=n(34),_=n.n(E),O=n(12),b=n.n(O),g=n(10),h=n.n(g),v=n(526),S=n.n(v),C=n(1),j=n(35),N=n(534),I=n.n(N),y=n(577),R=function(e){function t(){var e,n;a()(this,t);for(var r=arguments.length,i=new Array(r),c=0;c<r;c++)i[c]=arguments[c];return n=o()(this,(e=l()(t)).call.apply(e,[this].concat(i))),_()(m()(n),"dismissTimeout",null),n}return f()(t,e),c()(t,[{key:"componentDidMount",value:function(){this.props.duration>0&&(this.dismissTimeout=setTimeout(this.props.onDismissClick,this.props.duration))}},{key:"componentWillUnmount",value:function(){this.dismissTimeout&&clearTimeout(this.dismissTimeout)}},{key:"componentDidUpdate",value:function(){clearTimeout(this.dismissTimeout),this.props.duration>0&&(this.dismissTimeout=setTimeout(this.props.onDismissClick,this.props.duration))}},{key:"getIcon",value:function(){var e;switch(this.props.status){case"is-info":e="info";break;case"is-success":e="checkmark";break;case"is-error":case"is-warning":e="notice";break;default:e="info"}return e}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,r=e.icon,a=e.isCompact,i=e.isLoading,c=e.onDismissClick,s=e.showDismiss,o=void 0===s?!a:s,u=e.status,l=e.text,d=e.translate,m=S()("notice",u,n,{"is-compact":a,"is-loading":i,"is-dismissable":o});return h.a.createElement("div",{className:m},h.a.createElement("span",{className:"notice__icon-wrapper"},h.a.createElement(I.a,{className:"notice__icon",icon:r||this.getIcon(),size:24})),h.a.createElement("span",{className:"notice__content"},h.a.createElement("span",{className:"notice__text"},l||t)),l?t:null,o&&h.a.createElement("span",{tabIndex:"0",className:"notice__dismiss",onClick:c},h.a.createElement(I.a,{icon:"cross",size:24}),h.a.createElement(y.a,null,d("Dismiss"))))}}]),t}(g.Component);_()(R,"defaultProps",{className:"",duration:0,icon:null,isCompact:!1,isLoading:!1,onDismissClick:C.noop,status:null,text:null}),_()(R,"propTypes",{className:b.a.string,duration:b.a.number,icon:b.a.string,isCompact:b.a.bool,isLoading:b.a.bool,onDismissClick:b.a.func,showDismiss:b.a.bool,status:b.a.oneOf(["is-error","is-info","is-success","is-warning","is-plain"]),text:b.a.oneOfType([b.a.arrayOf(b.a.oneOfType([b.a.string,b.a.node])),b.a.oneOfType([b.a.string,b.a.node])]),translate:b.a.func.isRequired}),t.a=Object(j.localize)(R)},551:function(e,t,n){"use strict";n.d(t,"a",function(){return a});var r=n(1),a=function e(t){return!!t&&(Object(r.isArray)(t)?Object(r.some)(t,e):!Object(r.isPlainObject)(t)||Object(r.some)(Object(r.values)(t),e))}},553:function(e,t,n){"use strict";n.r(t),n.d(t,"addPackage",function(){return c}),n.d(t,"removePackage",function(){return s}),n.d(t,"editPackage",function(){return o}),n.d(t,"dismissModal",function(){return u}),n.d(t,"savePackage",function(){return l}),n.d(t,"updatePackagesField",function(){return d}),n.d(t,"toggleOuterDimensions",function(){return m}),n.d(t,"toggleAll",function(){return p}),n.d(t,"togglePackage",function(){return f}),n.d(t,"savePredefinedPackages",function(){return E}),n.d(t,"removePredefinedPackage",function(){return _}),n.d(t,"setModalErrors",function(){return O}),n.d(t,"setIsSaving",function(){return b}),n.d(t,"setIsFetching",function(){return g}),n.d(t,"setIsFetchError",function(){return h}),n.d(t,"setAddMode",function(){return v}),n.d(t,"fetchSettings",function(){return S}),n.d(t,"submit",function(){return C});var r=n(541),a=n(538),i=n(540),c=function(e){return{type:a.g,siteId:e}},s=function(e,t){return{type:a.k,index:t,siteId:e}},o=function(e,t){return{type:a.i,package:t,siteId:e}},u=function(e){return{type:a.h,siteId:e}},l=function(e,t){return{type:a.m,packageData:t,siteId:e}},d=function(e,t){return{type:a.w,values:t,siteId:e}},m=function(e){return{type:a.u,siteId:e}},p=function(e,t,n,r){return{type:a.t,serviceId:t,groupId:n,checked:r,siteId:e}},f=function(e,t,n){return{type:a.v,serviceId:t,packageId:n,siteId:e}},E=function(e){return{type:a.n,siteId:e}},_=function(e,t,n){return{type:a.l,serviceId:t,packageId:n,siteId:e}},O=function(e,t){return{type:a.s,value:t,siteId:e}},b=function(e,t){return{type:a.r,isSaving:t,siteId:e}},g=function(e,t){return{type:a.p,isFetching:t,siteId:e}},h=function(e,t){return{type:a.q,isFetchError:t,siteId:e}},v=function(e,t){return{type:a.o,siteId:e,mode:t}},S=function(e){return function(t,n){var c=Object(i.e)(n(),e);c&&(c.packages||c.isFetching)||(t(g(e,!0)),r.b(e,r.e.packages).then(function(n){var r=n.formData,i=n.formSchema,c=n.storeOptions;t({type:a.j,packages:r,dimensionUnit:c.dimension_unit,weightUnit:c.weight_unit,packageSchema:i.custom.items,predefinedSchema:i.predefined,siteId:e})}).catch(function(n){console.error(n),t(h(e,!0))}).then(function(){return t(g(e,!1))}))}},C=function(e,t,n){return function(a,c){var s=Object(i.e)(c(),e);a(b(e,!0)),r.d(e,r.e.packages,s.packages).then(t).catch(n).then(function(){return a(b(e,!1))})}}},554:function(e,t,n){"use strict";n.d(t,"a",function(){return a});var r=n(535);function a(e,t,n){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Date.now();return{type:r.j,siteId:e,originalAction:t,data:n,time:a}}},555:function(e,t,n){"use strict";n.d(t,"a",function(){return I});var r=n(530),a=n.n(r),i=n(107),c=n.n(i),s=n(108),o=n.n(s),u=n(528),l=n.n(u),d=n(527),m=n.n(d),p=n(531),f=n.n(p),E=n(529),_=n.n(E),O=n(34),b=n.n(O),g=n(10),h=n.n(g),v=n(12),S=n.n(v),C=n(526),j=n.n(C),N=n(1),I=function(e){function t(){var e;return c()(this,t),(e=l()(this,m()(t).apply(this,arguments))).selectOnFocus=e.selectOnFocus.bind(f()(e)),e}return _()(t,e),o()(t,[{key:"focus",value:function(){this.refs.textField.focus()}},{key:"selectOnFocus",value:function(e){this.props.selectOnFocus&&e.target.select()}},{key:"render",value:function(){var e=this.props.inputRef,t=Object(N.omit)(this.props,"isError","isValid","selectOnFocus","inputRef"),n=j()("form-text-input",this.props.className,{"is-error":this.props.isError,"is-valid":this.props.isValid});return h.a.createElement("input",a()({type:"text"},t,{ref:e||"textField",className:n,onClick:this.selectOnFocus}))}}]),t}(g.PureComponent);b()(I,"propTypes",{isError:S.a.bool,isValid:S.a.bool,selectOnFocus:S.a.bool,className:S.a.string})},559:function(e,t,n){"use strict";var r=n(47),a=n.n(r),i=n(1),c=n(114),s=a()("calypso:notices");s("initializing notices");var o,u={containerNames:{}};o=u,Object(i.assign)(o,c.EventEmitter.prototype),o.emitChange=function(){this.emit("change")},o.off=o.removeListener;var l=[],d={new:function(e,t,n){var r=t.overlay?"overlay-notices":"notices";u.containerNames[r]=r,s("creating notice",e,t,n),u[r]=[];var a={type:t.type||"message",status:n,text:e,duration:t.duration,container:r,button:t.button,href:t.href,onClick:function(e){if("function"===typeof t.onClick){var n=d.removeNotice.bind(d,a);return t.onClick(e,n)}},onRemoveCallback:t.onRemoveCallback||function(){},arrow:t.arrow,isCompact:t.isCompact,showDismiss:t.showDismiss,persistent:t.persistent};return t.displayOnNextPage?l.push(a):u[r].push(a),u.emit("change"),a},success:function(e,t){return t=t||{},this.new(e,t,"is-success")},error:function(e,t){return t=t||{},this.new(e,t,"is-error")},info:function(e,t){return t=t||{},this.new(e,t,"is-info")},warning:function(e,t){return t=t||{},this.new(e,t,"is-warning")},list:u,removeNotice:function(e){if(e.container){var t=u[e.container],n=t.indexOf(e);-1!==n&&(t.splice(n,1),u.emit("change"))}},clearNoticesOnNavigation:function(e,t){s("clearNoticesOnNavigation");var n=!1,r=function(e){return e.persistent};for(var a in u.containerNames){var i=u[a].length;u[a]=u[a].filter(r),i!==u[a].length&&(n=!0)}l.length&&(l.forEach(function(e){u[e.container]=[],u[e.container].push(e)}),l=[]),n&&u.emit("change"),t()},clearNotices:function(e){u[e]=[],u.emit("change")},getStatusHelper:function(e){return e.error?"is-error":e.warning?"is-warning":e.info?"is-info":e.success?"is-success":void 0}};t.a=d},560:function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return a}),n.d(t,"c",function(){return i});var r=function(){return{}},a=function(){return""},i=function(){return!0}},563:function(e,t,n){"use strict";var r=n(75);t.a=r.a},564:function(e,t,n){"use strict";var r=n(1);t.a=function(e){return Object(r.isPlainObject)(e)&&(e.isNormalized&&e.selectNormalized&&e.normalized?e.normalized:e.values)||{}}},565:function(e,t,n){"use strict";n.d(t,"b",function(){return o}),n.d(t,"c",function(){return u}),n.d(t,"a",function(){return l}),n.d(t,"e",function(){return m}),n.d(t,"f",function(){return f}),n.d(t,"g",function(){return E}),n.d(t,"i",function(){return _}),n.d(t,"h",function(){return O}),n.d(t,"j",function(){return b}),n.d(t,"d",function(){return g});var r=n(1),a=n(542),i=n(532),c=n(539),s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",t,"data","locations"])},o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(r.isArray)(s(e,t))},u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return c.b===s(e,t)},l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return c.a===s(e,t)},d=function(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];var i=r[e],c=o(t,i);return[c,c&&s(t,i)]}},m=Object(a.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);if(!o(e,t))return[];var n=s(e,t).map(function(e){return Object(r.omit)(e,"countries")});return Object(r.sortBy)(n,"name")},d(0)),p=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);if(!o(e,t))return[];var n=Object(r.flatMap)(s(e,t),"countries");return Object(r.sortBy)(n,"name")},f=Object(a.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);if(!o(e,n))return[];var a=Object(r.find)(s(e,n),{code:t});if(!a)return[];var c=a.countries.map(function(e){return Object(r.omit)(e,"states")});return Object(r.sortBy)(c,"name")},d(1)),E=Object(a.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);if(!o(e,n))return t;var a=Object(r.find)(Object(r.flatMap)(s(e,n),"countries"),{code:t});return a?a.name:t},d(1)),_=Object(a.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);if(!o(e,n))return[];var a=Object(r.find)(Object(r.flatMap)(s(e,n),"countries"),{code:t});return a?Object(r.sortBy)(a.states,"name"):[]},d(1)),O=Object(a.a)(function(e,t,n){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Object(i.a)(e);if(!o(e,a))return n;var c=Object(r.find)(Object(r.flatMap)(s(e,a),"countries"),{code:t});if(!c)return n;var u=Object(r.find)(c.states,{code:n});return u?u.name:n},d(2)),b=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return!Object(r.isEmpty)(_(e,t,n))},g=Object(a.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=p(e,t),r={};return n.forEach(function(e){var t=e.code,n=e.name;return r[t]=n}),r},d(0))},566:function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return a});var r=function(){return!0},a=function(){return!0}},567:function(e,t,n){"use strict";n.d(t,"d",function(){return c}),n.d(t,"a",function(){return o}),n.d(t,"e",function(){return u}),n.d(t,"c",function(){return l}),n.d(t,"b",function(){return d});var r=n(541),a=n(538),i=n(546),c=function(e,t,n){return{type:a.e,siteId:e,key:t,value:n}},s=function(e,t,n){return{type:a.f,siteId:e,key:t,value:n}},o=function(e){return function(t){t(s(e,"isFetching",!0)),r.b(e,r.e.accountSettings).then(function(n){var r=n.storeOptions,i=n.formMeta,c=n.formData,s=n.userMeta;t(function(e,t,n,r,i){return{type:a.b,siteId:e,storeOptions:t,formData:n,formMeta:r,userMeta:i}}(e,r,c,i,s))}).catch(function(n){t(s(e,"isFetchError",!0)),console.error(n)}).then(function(){return t(s(e,"isFetching",!1))})}},u=function(e,t,n){return function(a,c){a(s(e,"isSaving",!0)),a(s(e,"pristine",!0)),r.c(e,r.e.accountSettings,Object(i.f)(c())).then(t).catch(function(t){return a(s(e,"pristine",!1)),n(t)}).then(function(){a(s(e,"isSaving",!1))})}},l=function(e){return{type:a.d,siteId:e}},d=function(e){return{type:a.c,siteId:e}}},568:function(e,t,n){"use strict";n.d(t,"b",function(){return s}),n.d(t,"a",function(){return o}),n.d(t,"c",function(){return u});var r=n(1),a=n(532),i=n(539),c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);return Object(r.get)(e,["extensions","woocommerce","woocommerceServices",t,"shippingMethodSchemas"],{})},s=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);return Object(r.isObject)(c(e,n)[t])},o=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);return s(e,t,n)?c(e,n)[t]:null},u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);return i.b===c(e,n)[t]}},575:function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return a}),n.d(t,"d",function(){return i}),n.d(t,"c",function(){return c});var r=["US","PR","VI","GU","AS","UM","MH","FM","MP"],a=["US","PR","VI"],i=["AA","AE","AP"],c=["IR","SY","KP","CU","SD"]},576:function(e,t,n){"use strict";n.d(t,"c",function(){return u}),n.d(t,"a",function(){return l}),n.d(t,"b",function(){return d});var r=n(1),a=n(532),i=n(584),c=n(539),s=n(566),o=n(585),u=function(e,t){var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",t,"shippingZoneMethods"])}(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e));return Object(r.isObject)(n)?n[t]:null},l=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e),c=Object(i.b)(e,n);if(!Object(r.isArray)(c))return!1;var l=Object(r.find)(c,{id:t});if(!l||!Object(r.isArray)(l.methodIds))return!1;if(!Object(s.a)(e,n))return!0;var d=l.methodIds.map(function(t){var a=u(e,t,n);return a&&Object(r.startsWith)(a.methodType,"wc_services")?a:null}).filter(Boolean);return Object(r.every)(d,function(t){var r=t.id;return Object(o.a)(e,r,n)})},d=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e),l=Object(i.b)(e,n);if(!Object(r.isArray)(l))return!1;var d=Object(r.find)(l,{id:t});if(!d)return!1;if(c.b===d.methodIds)return!0;if(!Object(s.a)(e,n)||!Object(r.isArray)(d.methodIds))return!1;var m=d.methodIds.map(function(t){var a=u(e,t,n);return a&&Object(r.startsWith)(a.methodType,"wc_services")?a:null}).filter(Boolean);return Object(r.some)(m,function(t){var r=t.id;return Object(o.b)(e,r,n)})}},578:function(e,t,n){"use strict";var r=n(10),a=n.n(r),i=n(12),c=n.n(i),s=n(548),o=n(547),u=n(555),l=n(550),d=n(556),m=function(e){var t=e.id,n=e.title,i=e.description,c=e.value,m=e.placeholder,p=e.updateValue,f=e.error,E=e.className,_=e.defaultValue,O=Object(r.useCallback)(function(e){return p(e.target.value,e)},[p]);return a.a.createElement(s.a,{className:E},a.a.createElement(o.a,{htmlFor:t},n),a.a.createElement(u.a,{id:t,name:t,placeholder:m,value:c,onChange:O,isError:Boolean(f),defaultValue:_}),f&&"string"===typeof f&&a.a.createElement(l.a,{text:f}),!f&&i&&a.a.createElement(d.a,null,i))};m.propTypes={id:c.a.string.isRequired,title:c.a.node,description:c.a.string,value:c.a.string,defaultValue:c.a.string,updateValue:c.a.func,error:c.a.oneOfType([c.a.string,c.a.bool]),className:c.a.string},t.a=m},581:function(e,t,n){"use strict";var r=n(530),a=n.n(r),i=n(533),c=n.n(i),s=n(107),o=n.n(s),u=n(108),l=n.n(u),d=n(528),m=n.n(d),p=n(527),f=n.n(p),E=n(531),_=n.n(E),O=n(529),b=n.n(O),g=n(34),h=n.n(g),v=n(526),S=n.n(v),C=n(35),j=n(1),N=n(10),I=n.n(N),y=n(544),R=function(e){function t(){var e,n;o()(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=m()(this,(e=f()(t)).call.apply(e,[this].concat(a))),h()(_()(n),"getDefaultButtonAction",function(){return n.props.isSubmitting?n.props.translate("Saving\u2026"):n.props.translate("Save Settings")}),n}return b()(t,e),l()(t,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,r=e.isPrimary,i=c()(e,["children","className","isPrimary"]),s=S()(n,"form-button");return I.a.createElement(y.a,a()({},Object(j.omit)(i,["isSubmitting","moment","numberFormat","translate"]),{primary:r,className:s}),N.Children.count(t)?t:this.getDefaultButtonAction())}}]),t}(I.a.Component);h()(R,"defaultProps",{isSubmitting:!1,isPrimary:!0,type:"submit"}),t.a=Object(C.localize)(R)},584:function(e,t,n){"use strict";n.d(t,"b",function(){return s}),n.d(t,"a",function(){return o});var r=n(1),a=n(532),i=(n(539),n(576)),c=n(608),s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",t,"shippingZones"])},o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=s(e,t);return Object(r.isArray)(n)&&Object(r.every)(n,function(n){return Object(i.a)(e,n.id,t)})&&Object(r.every)(n,function(n){return Object(c.a)(e,n.id,t)})}},585:function(e,t,n){"use strict";n.d(t,"a",function(){return s}),n.d(t,"b",function(){return o});var r=n(1),a=n(532),i=n(539),c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);return Object(r.get)(e,["extensions","woocommerce","woocommerceServices",t,"shippingZoneMethodSettings"],{})},s=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);return!0===c(e,n)[t]},o=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);return i.b===c(e,n)[t]}},586:function(e,t,n){"use strict";n.d(t,"a",function(){return v});var r=n(107),a=n.n(r),i=n(108),c=n.n(i),s=n(528),o=n.n(s),u=n(527),l=n.n(u),d=n(529),m=n.n(d),p=n(34),f=n.n(p),E=n(12),_=n.n(E),O=n(10),b=n.n(O),g=n(534),h=n.n(g),v=function(e){function t(){return a()(this,t),o()(this,l()(t).apply(this,arguments))}return m()(t,e),c()(t,[{key:"render",value:function(){var e={className:"notice__action",href:this.props.href,onClick:this.props.onClick};return this.props.external&&(e.target="_blank",e.rel="noopener noreferrer"),b.a.createElement("a",e,b.a.createElement("span",null,this.props.children),this.props.icon&&b.a.createElement(h.a,{icon:this.props.icon,size:24}),this.props.external&&b.a.createElement(h.a,{icon:"external",size:24}))}}]),t}(b.a.Component);f()(v,"displayName","NoticeAction"),f()(v,"propTypes",{href:_.a.string,onClick:_.a.func,external:_.a.bool,icon:_.a.string}),f()(v,"defaultProps",{external:!1})},588:function(e,t,n){"use strict";n.d(t,"a",function(){return j});var r=n(533),a=n.n(r),i=n(107),c=n.n(i),s=n(108),o=n.n(s),u=n(528),l=n.n(u),d=n(527),m=n.n(d),p=n(529),f=n.n(p),E=n(34),_=n.n(E),O=n(10),b=n.n(O),g=n(12),h=n.n(g),v=n(526),S=n.n(v),C=n(555),j=function(e){function t(){return c()(this,t),l()(this,m()(t).apply(this,arguments))}return f()(t,e),o()(t,[{key:"render",value:function(){var e=this.props,t=e.noWrap,n=e.prefix,r=e.suffix,i=a()(e,["noWrap","prefix","suffix"]);return b.a.createElement("div",{className:S()("form-text-input-with-affixes",{"no-wrap":t})},n&&b.a.createElement("span",{className:"form-text-input-with-affixes__prefix"},n),b.a.createElement(C.a,i),r&&b.a.createElement("span",{className:"form-text-input-with-affixes__suffix"},r))}}]),t}(b.a.Component);_()(j,"displayName","FormTextInputWithAffixes"),_()(j,"propTypes",{noWrap:h.a.bool,prefix:h.a.node,suffix:h.a.node})},591:function(e,t,n){"use strict";var r,a=n(34),i=n.n(a),c=n(36),s=n.n(c),o=n(1),u=n(46),l=Object(u.b)({},(r={},i()(r,"NOTICE_CREATE",function(e,t){var n=t.notice;return s()({},e,i()({},n.noticeId,n))}),i()(r,"NOTICE_REMOVE",function(e,t){var n=t.noticeId;return e.hasOwnProperty(n)?Object(o.omit)(e,n):e}),i()(r,"ROUTE_SET",function(e){return Object(o.reduce)(e,function(e,t,n){if(!t.isPersistent&&!t.displayOnNextPage)return e;var r=t;return r.displayOnNextPage&&(r=s()({},r,{displayOnNextPage:!1})),e[n]=r,e},{})}),r)),d=Object(u.b)({},i()({},"NOTICE_CREATE",function(e,t){var n=t.notice;return s()({},e,i()({},n.noticeId,Date.now()))}));t.a=Object(u.a)({items:l,lastTimeShown:d})},592:function(e,t,n){"use strict";n.d(t,"d",function(){return a}),n.d(t,"b",function(){return i}),n.d(t,"a",function(){return c}),n.d(t,"e",function(){return s}),n.d(t,"c",function(){return o});var r=n(535);function a(e){return{type:r.d,actionList:e}}function i(){return{type:r.b}}function c(e){return{type:r.a,actionList:e}}function s(e){return{type:r.e,actionList:e}}function o(e,t){return{type:r.c,actionList:e,error:t}}},593:function(e,t,n){},599:function(e,t,n){"use strict";var r=n(530),a=n.n(r),i=n(10),c=n.n(i),s=n(12),o=n.n(s),u=n(526),l=n.n(u),d=n(534),m=n.n(d),p=n(1),f=function(e){var t=e.className,n=e.disabled,r=e.checked,i=e.partialChecked,s=Object(p.omit)(e,["className","partialChecked"]);return c.a.createElement("span",{className:l()(t,"form-checkbox",{"is-disabled":n})},c.a.createElement("input",a()({},s,{type:"checkbox"})),r&&c.a.createElement(m.a,{icon:"checkmark",size:14}),!r&&i&&c.a.createElement(m.a,{icon:"minus-small",size:16}))};f.propTypes={checked:o.a.bool.isRequired,partialChecked:o.a.bool,onChange:o.a.func.isRequired,className:o.a.string},t.a=f},601:function(e,t,n){"use strict";var r=n(530),a=n.n(r),i=n(533),c=n.n(i),s=n(164),o=n.n(s),u=n(12),l=n.n(u),d=n(10),m=n.n(d),p=n(549),f=n(586),E=n(526),_=n.n(E);n(593);function O(e){var t=e.id,n=e.className,r=e.children;return m.a.createElement("div",{id:t,className:_()("global-notices",n)},r)}var b=n(559),g=n(47),h=n.n(g)()("calypso:data-observe"),v=n(109),S=n(1),C=n(542),j=Object(C.a)(function(e){return Object(S.values)(e.notices.items)},function(e){return e.notices.items}),N=(Object(C.a)(function(e,t){return e.notices.lastTimeShown[t]||0},function(e){return e.notices.lastTimeShown}),n(545)),I=o()({displayName:"GlobalNotices",mixins:[function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return{componentDidMount:function(){t.forEach(function(e){this.props[e]?this.props[e].on("change",this.update):h(e+" is not set.")},this)},componentWillUnmount:function(){t.forEach(function(e){this.props[e]&&this.props[e].off("change",this.update)},this)},componentWillReceiveProps:function(e){t.forEach(function(t){this.props[t]!==e[t]&&(this.props[t]&&this.props[t].off("change",this.update),e[t]&&e[t].on("change",this.update))},this)},update:function(){h("Re-rendering "+this.constructor.displayName+" component."),this.forceUpdate()}}}("notices")],propTypes:{id:l.a.string,notices:l.a.oneOfType([l.a.object,l.a.array]),removeNotice:l.a.func.isRequired,storeNotices:l.a.array.isRequired},getDefaultProps:function(){return{id:"overlay-notices",notices:Object.freeze([])}},removeNoticeStoreNotice:function(e){return function(){e&&b.a.removeNotice(e)}},removeReduxNotice:function(e,t){var n=this;return function(r){t&&t(r),n.props.removeNotice(e)}},render:function(){var e=(this.props.notices[this.props.id]||[]).map(function(e,t){return m.a.createElement(p.a,{key:"notice-old-"+t,status:e.status,duration:e.duration||null,text:e.text,isCompact:e.isCompact,onDismissClick:this.removeNoticeStoreNotice(e),showDismiss:e.showDismiss},e.button&&m.a.createElement(f.a,{href:e.href,onClick:e.onClick},e.button))},this);return(e=e.concat(this.props.storeNotices.map(function(e){var t=e.button,n=e.href,r=e.noticeId,i=e.onClick,s=e.onDismissClick,o=c()(e,["button","href","noticeId","onClick","onDismissClick"]);return m.a.createElement(p.a,a()({},o,{key:"notice-".concat(r),onDismissClick:this.removeReduxNotice(r,s)}),t&&m.a.createElement(f.a,{href:n,onClick:i},t))},this))).length?m.a.createElement(O,{id:this.props.id},e):null}});t.a=Object(v.b)(function(e){return{storeNotices:j(e)}},{removeNotice:N.c})(I)},607:function(e,t,n){"use strict";n.d(t,"a",function(){return i});var r=n(1),a=function(e,t){return Object(r.isArray)(e)?e.concat(t):void 0},i=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.length>1?r.mergeWith.apply(void 0,[Object.create(null)].concat(t,[a])):t[0]}},608:function(e,t,n){"use strict";n.d(t,"c",function(){return c}),n.d(t,"a",function(){return s}),n.d(t,"b",function(){return o});var r=n(1),a=n(532),i=n(539),c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",t,"shippingZoneLocations"])},s=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e),i=c(e,n);return i&&Object(r.isObject)(i[t])},o=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);return c(e,n)&&i.b===c(e,n)[t]}},609:function(e,t,n){"use strict";n.d(t,"a",function(){return s});var r=n(541),a=n(554),i=n(538),c=n(585),s=function(e,t,n){return function(s,o){if(!Object(c.a)(o(),n,e)&&!Object(c.b)(o(),n,e)){var u={type:i.Pb,instanceId:n,siteId:e};return s(u),r.b(e,r.e.serviceSettings(t,n)).then(function(t){return s(function(e,t,n){return{type:i.Qb,siteId:e,instanceId:t,data:n}}(e,n,t))}).catch(function(t){return s(Object(a.a)(e,u,t))})}}}},610:function(e,t,n){"use strict";t.a=function(e,t){return function e(t,n,r){if(void 0===n||null===n||!t)return n;switch((t=function(e,t){if(e.$ref){var n=e.$ref.match(/^#\/definitions\/(.+)/);n&&t[n[1]]&&(e=t[n[1]])}return e}(t,r)).type){case"number":if(""===n)return;return isNaN(n)?n:parseFloat(n);case"boolean":return-1!==["true","True","TRUE","1",1,!0].indexOf(n)||-1===["false","False","FALSE","0",0,!1].indexOf(n)&&void 0;case"string":return n?n.toString():"";case"object":var a={};return Object.keys(n).forEach(function(i){var c=(t.properties||{})[i];a[i]=e(c,n[i],r)}),a;case"array":return n.map(function(n){return e(t.items,n,r)});default:return n}}({type:"object",properties:e.properties},t,e.definitions)}},613:function(e,t,n){"use strict";var r=n(530),a=n.n(r),i=n(533),c=n.n(i),s=n(10),o=n.n(s),u=n(526),l=n.n(u);t.a=function(e){var t=e.className,n=c()(e,["className"]);return o.a.createElement("input",a()({},n,{type:"checkbox",className:l()(t,"form-checkbox")}))}},615:function(e,t,n){"use strict";n.d(t,"a",function(){return c}),n.d(t,"b",function(){return s});n(1);var r=n(657),a=n.n(r),i=document.implementation&&document.implementation.createHTMLDocument?document.implementation.createHTMLDocument("").createElement("textarea"):document.createElement("textarea");function c(e){return"string"!==typeof e||-1===e.indexOf("&")?e:function(e){i.innerHTML=e;var t=i.textContent;return i.innerHTML="",t}(e)}function s(e){return a()(e)}String.fromCharCode(160)},616:function(e,t,n){"use strict";n.d(t,"a",function(){return o}),n.d(t,"b",function(){return l});var r=n(35),a=n(602),i=n(1),c=n(541),s={a4:{name:Object(r.translate)("A4"),exclude:function(e){return Object(i.includes)(["US","CA","MX","DO"],e)}},label:{name:Object(r.translate)('Label (4"x6")')},legal:{name:Object(r.translate)("Legal")},letter:{name:Object(r.translate)("Letter")}},o=function(e){return Object(i.reduce)(s,function(t,n,r){var a=n.name,i=n.exclude;return i&&i(e)||(t[r]=a),t},{})},u=function(e,t,n){if(!s[e])throw new Error("Invalid paper size: ".concat(e));var r={paper_size:e,label_id_csv:Object(i.filter)(Object(i.map)(t,"labelId")).join(","),caption_csv:Object(i.filter)(Object(i.map)(t,function(e){return e.caption?encodeURIComponent(e.caption):null})).join(","),json:!0};return n+"?"+Object(a.stringify)(r)},l=function(e,t){return u(e,t,c.e.labelsPrint())}},619:function(e,t,n){var r={"./af":[392,3],"./af.js":[392,3],"./ar":[399,4],"./ar-dz":[393,5],"./ar-dz.js":[393,5],"./ar-kw":[394,6],"./ar-kw.js":[394,6],"./ar-ly":[395,7],"./ar-ly.js":[395,7],"./ar-ma":[396,8],"./ar-ma.js":[396,8],"./ar-sa":[397,9],"./ar-sa.js":[397,9],"./ar-tn":[398,10],"./ar-tn.js":[398,10],"./ar.js":[399,4],"./az":[400,11],"./az.js":[400,11],"./be":[401,12],"./be.js":[401,12],"./bg":[402,13],"./bg.js":[402,13],"./bm":[403,14],"./bm.js":[403,14],"./bn":[404,15],"./bn.js":[404,15],"./bo":[405,16],"./bo.js":[405,16],"./br":[406,17],"./br.js":[406,17],"./bs":[407,18],"./bs.js":[407,18],"./ca":[408,19],"./ca.js":[408,19],"./cs":[409,20],"./cs.js":[409,20],"./cv":[410,21],"./cv.js":[410,21],"./cy":[411,22],"./cy.js":[411,22],"./da":[412,23],"./da.js":[412,23],"./de":[415,24],"./de-at":[413,25],"./de-at.js":[413,25],"./de-ch":[414,26],"./de-ch.js":[414,26],"./de.js":[415,24],"./dv":[416,27],"./dv.js":[416,27],"./el":[417,28],"./el.js":[417,28],"./en-au":[418,29],"./en-au.js":[418,29],"./en-ca":[419,30],"./en-ca.js":[419,30],"./en-gb":[420,31],"./en-gb.js":[420,31],"./en-ie":[421,32],"./en-ie.js":[421,32],"./en-il":[422,33],"./en-il.js":[422,33],"./en-in":[423,34],"./en-in.js":[423,34],"./en-nz":[424,35],"./en-nz.js":[424,35],"./en-sg":[425,36],"./en-sg.js":[425,36],"./eo":[426,37],"./eo.js":[426,37],"./es":[429,38],"./es-do":[427,39],"./es-do.js":[427,39],"./es-us":[428,40],"./es-us.js":[428,40],"./es.js":[429,38],"./et":[430,41],"./et.js":[430,41],"./eu":[431,42],"./eu.js":[431,42],"./fa":[432,43],"./fa.js":[432,43],"./fi":[433,44],"./fi.js":[433,44],"./fil":[434,45],"./fil.js":[434,45],"./fo":[435,46],"./fo.js":[435,46],"./fr":[438,47],"./fr-ca":[436,48],"./fr-ca.js":[436,48],"./fr-ch":[437,49],"./fr-ch.js":[437,49],"./fr.js":[438,47],"./fy":[439,50],"./fy.js":[439,50],"./ga":[440,51],"./ga.js":[440,51],"./gd":[441,52],"./gd.js":[441,52],"./gl":[442,53],"./gl.js":[442,53],"./gom-deva":[443,54],"./gom-deva.js":[443,54],"./gom-latn":[444,55],"./gom-latn.js":[444,55],"./gu":[445,56],"./gu.js":[445,56],"./he":[446,57],"./he.js":[446,57],"./hi":[447,58],"./hi.js":[447,58],"./hr":[448,59],"./hr.js":[448,59],"./hu":[449,60],"./hu.js":[449,60],"./hy-am":[450,61],"./hy-am.js":[450,61],"./id":[451,62],"./id.js":[451,62],"./is":[452,63],"./is.js":[452,63],"./it":[454,64],"./it-ch":[453,65],"./it-ch.js":[453,65],"./it.js":[454,64],"./ja":[455,66],"./ja.js":[455,66],"./jv":[456,67],"./jv.js":[456,67],"./ka":[457,68],"./ka.js":[457,68],"./kk":[458,69],"./kk.js":[458,69],"./km":[459,70],"./km.js":[459,70],"./kn":[460,71],"./kn.js":[460,71],"./ko":[461,72],"./ko.js":[461,72],"./ku":[462,73],"./ku.js":[462,73],"./ky":[463,74],"./ky.js":[463,74],"./lb":[464,75],"./lb.js":[464,75],"./lo":[465,76],"./lo.js":[465,76],"./lt":[466,77],"./lt.js":[466,77],"./lv":[467,78],"./lv.js":[467,78],"./me":[468,79],"./me.js":[468,79],"./mi":[469,80],"./mi.js":[469,80],"./mk":[470,81],"./mk.js":[470,81],"./ml":[471,82],"./ml.js":[471,82],"./mn":[472,83],"./mn.js":[472,83],"./mr":[473,84],"./mr.js":[473,84],"./ms":[475,85],"./ms-my":[474,86],"./ms-my.js":[474,86],"./ms.js":[475,85],"./mt":[476,87],"./mt.js":[476,87],"./my":[477,88],"./my.js":[477,88],"./nb":[478,89],"./nb.js":[478,89],"./ne":[479,90],"./ne.js":[479,90],"./nl":[481,91],"./nl-be":[480,92],"./nl-be.js":[480,92],"./nl.js":[481,91],"./nn":[482,93],"./nn.js":[482,93],"./oc-lnc":[483,94],"./oc-lnc.js":[483,94],"./pa-in":[484,95],"./pa-in.js":[484,95],"./pl":[485,96],"./pl.js":[485,96],"./pt":[487,97],"./pt-br":[486,98],"./pt-br.js":[486,98],"./pt.js":[487,97],"./ro":[488,99],"./ro.js":[488,99],"./ru":[489,100],"./ru.js":[489,100],"./sd":[490,101],"./sd.js":[490,101],"./se":[491,102],"./se.js":[491,102],"./si":[492,103],"./si.js":[492,103],"./sk":[493,104],"./sk.js":[493,104],"./sl":[494,105],"./sl.js":[494,105],"./sq":[495,106],"./sq.js":[495,106],"./sr":[497,107],"./sr-cyrl":[496,108],"./sr-cyrl.js":[496,108],"./sr.js":[497,107],"./ss":[498,109],"./ss.js":[498,109],"./sv":[499,110],"./sv.js":[499,110],"./sw":[500,111],"./sw.js":[500,111],"./ta":[501,112],"./ta.js":[501,112],"./te":[502,113],"./te.js":[502,113],"./tet":[503,114],"./tet.js":[503,114],"./tg":[504,115],"./tg.js":[504,115],"./th":[505,116],"./th.js":[505,116],"./tk":[506,117],"./tk.js":[506,117],"./tl-ph":[507,118],"./tl-ph.js":[507,118],"./tlh":[508,119],"./tlh.js":[508,119],"./tr":[509,120],"./tr.js":[509,120],"./tzl":[510,121],"./tzl.js":[510,121],"./tzm":[512,122],"./tzm-latn":[511,123],"./tzm-latn.js":[511,123],"./tzm.js":[512,122],"./ug-cn":[513,124],"./ug-cn.js":[513,124],"./uk":[514,125],"./uk.js":[514,125],"./ur":[515,126],"./ur.js":[515,126],"./uz":[517,127],"./uz-latn":[516,128],"./uz-latn.js":[516,128],"./uz.js":[517,127],"./vi":[518,129],"./vi.js":[518,129],"./x-pseudo":[519,130],"./x-pseudo.js":[519,130],"./yo":[520,131],"./yo.js":[520,131],"./zh-cn":[521,132],"./zh-cn.js":[521,132],"./zh-hk":[522,133],"./zh-hk.js":[522,133],"./zh-mo":[523,134],"./zh-mo.js":[523,134],"./zh-tw":[524,135],"./zh-tw.js":[524,135]};function a(e){if(!n.o(r,e))return Promise.resolve().then(function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t});var t=r[e],a=t[0];return n.e(t[1]).then(function(){return n.t(a,7)})}a.keys=function(){return Object.keys(r)},a.id=619,e.exports=a},620:function(e,t,n){"use strict";(function(e){var n={env:e?"production":"development",wpcom_concierge_schedule_id:1,languages:[],google_adwords_conversion_id:"",google_adwords_conversion_id_jetpack:""},r=function(e){if(e in n)return n[e];throw new Error("config key `"+e+"` does not exist")};r.isEnabled=function(){return!0},t.a=r}).call(this,n(112))},629:function(e,t,n){"use strict";var r=n(10),a=n.n(r),i=n(12),c=n.n(i),s=n(674),o=n.n(s),u=n(675),l=n.n(u),d=n(676),m=n.n(d),p={ups:o.a,usps:l.a,dhlexpress:m.a,dhlecommerce:m.a,dhlecommerceasia:m.a},f=function(e){var t=e.carrier,n=e.size;if(!t||!p[t.toLowerCase()])return a.a.createElement("span",null);var r="".concat(function(e){switch(e){case"small":return 24;case"big":return 40;case"medium":default:return 30}}(n),"px");return a.a.createElement("div",{style:{width:r},className:"carrier-icon"},a.a.createElement("img",{src:p[t.toLowerCase()],alt:t,className:"carrier-icon__logo"}))};f.propTypes={carrier:c.a.string.isRequired,size:c.a.number},t.a=f},632:function(e,t,n){"use strict";var r=n(34),a=n.n(r),i=n(110),c=n.n(i),s=n(1),o=n(35),u=n(535),l=n(592),d=n(546),m=n(540),p=n(567),f=n(553),E=n(532),_=n(538);n(563),n(554),n(576),n(609),n(620);var O=n(541),b=n(36),g=n.n(b);function h(e,t,n,r){Object(s.isFunction)(n)?h(e,t,n(e,t,r),r):Object(s.isObject)(n)&&e(g()({},n,r))}var v,S=n(568),C=n(610),j=function(e,t){var n=Object(m.e)(e,t);return!n||n.pristine?[]:[{description:Object(o.translate)("Saving label settings"),onStep:function(e,n){e(Object(f.submit)(t,function(){return e(Object(l.e)(n))},function(){return e(Object(l.c)(n))}))}}]},N=function(e,t){var n=Object(E.a)(e);return t?c()(j(e,n)):[].concat(c()(function(e,t){var n=Object(d.g)(e,t);return!n||n.pristine||!n.can_edit_settings&&n.can_manage_payments?[]:[{description:Object(o.translate)("Saving label settings"),onStep:function(e,n){e(Object(p.e)(t,function(){return e(Object(l.e)(n))},function(){return e(Object(l.c)(n))}))}}]}(e,n)),c()(j(e,n)))};t.a=(v={},a()(v,u.L,[function(e,t){var n=t.successAction,r=t.failureAction,a=t.onlyPackages,i=function(e){e(n),e(Object(l.b)())},c=N(e.getState(),a);e.dispatch(Object(s.isEmpty)(c)?i:Object(l.d)({nextSteps:c,onSuccess:i,onFailure:function(e){e(r),e(Object(l.b)())}}))}]),a()(v,_.Rb,[function(e,t){var n=e.dispatch,r=e.getState,a=t.siteId,i=t.methodId,c=t.methodType,s=t.method,o=t.successAction,l=t.failureAction,d=Object(S.a)(r(),c,a).formSchema,m=Object(C.a)(d,s);O.c(a,O.e.serviceSettings(c,i),m).then(function(e){n(function(e,t,n){return{type:u.Fb,siteId:e,data:t,originatingAction:n}}(a,e,t)),h(n,r,o,{sentData:m,receivedData:e})}).catch(function(e){return h(n,r,l,{error:e})})}]),v)},633:function(e,t,n){"use strict";n.d(t,"b",function(){return T}),n.d(t,"a",function(){return M});var r=n(111),a=n.n(r),i=n(107),c=n.n(i),s=n(108),o=n.n(s),u=n(528),l=n.n(u),d=n(527),m=n.n(d),p=n(531),f=n.n(p),E=n(529),_=n.n(E),O=n(34),b=n.n(O),g=n(10),h=n.n(g),v=n(109),S=n(163),C=n.n(S),j=n(47),N=n.n(j),I=n(1),y=n(542),R=Object(y.a)(function(e){return Object(I.get)(e,"ui.language.localeSlug",null)},function(e){return e.ui.language}),P=N()("calypso:localized-moment"),M=h.a.createContext(C.a),k=function(e){function t(){var e,n;c()(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=l()(this,(e=m()(t)).call.apply(e,[this].concat(a))),b()(f()(n),"state",{moment:C.a,momentLocale:C.a.locale()}),n}return _()(t,e),o()(t,[{key:"checkAndLoad",value:function(){var e=a()(regeneratorRuntime.mark(function e(t){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if((r=this.props.currentLocale)!==t){e.next=3;break}return e.abrupt("return");case 3:if("en"!==r){e.next=7;break}this.loadingLocalePromise=Promise.resolve(),e.next=19;break;case 7:return P("Loading moment locale for %s",r),e.prev=8,this.loadingLocalePromise=n(619)("./".concat(r)),e.next=12,this.loadingLocalePromise;case 12:e.next=18;break;case 14:return e.prev=14,e.t0=e.catch(8),P("Failed to load moment locale for %s",r,e.t0),e.abrupt("return");case 18:P("Loaded moment locale for %s",r);case 19:r===this.props.currentLocale&&(C.a.locale()!==r&&C.a.locale(r),this.setState({momentLocale:r}));case 20:case"end":return e.stop()}},e,this,[[8,14]])}));return function(t){return e.apply(this,arguments)}}()},{key:"componentDidMount",value:function(){this.checkAndLoad(C.a.locale())}},{key:"componentDidUpdate",value:function(e){this.checkAndLoad(e.currentLocale)}},{key:"render",value:function(){return h.a.createElement(M.Provider,{value:this.state},this.props.children)}}]),t}(h.a.Component),T=Object(v.b)(function(e){return{currentLocale:R(e)}})(k)},644:function(e,t,n){"use strict";var r=n(10),a=n.n(r),i=n(12),c=n.n(i),s=n(35),o=n(1),u=n(534),l=n.n(u),d=n(526),m=n.n(d),p=function(e){var t=e.isPlaceholder,n=e.data,r=e.dimensionUnit,i=e.prefixActions,c=(e.hasError,e.children),s=e.translate;if(t)return a.a.createElement("div",{className:"packages__packages-row placeholder"},a.a.createElement("div",{className:"packages__packages-row-icon"},a.a.createElement(l.a,{icon:"product",size:18})),a.a.createElement("div",{className:"packages__packages-row-details"},a.a.createElement("div",{className:"packages__packages-row-details-name"},a.a.createElement("span",null))),a.a.createElement("div",{className:"packages__packages-row-dimensions"},a.a.createElement("span",null)),a.a.createElement("div",{className:"packages__packages-row-actions"},c));var u,d=function(){return a.a.createElement("div",{className:"packages__packages-row-actions"},c)};return a.a.createElement("div",{className:m()("packages__packages-row",{prefixed:i})},i?d():null,a.a.createElement("div",{className:"packages__packages-row-icon"},function(e){var t=e?"mail":"product";return a.a.createElement(l.a,{icon:t,size:18})}(n.is_letter)),a.a.createElement("div",{className:"packages__packages-row-details"},a.a.createElement("div",{className:"packages__packages-row-details-name"},(u=n.name)&&""!==Object(o.trim)(u)?u:s("Untitled"))),a.a.createElement("div",{className:"packages__packages-row-dimensions"},n.inner_dimensions," ",r),i?null:d())};p.propTypes={siteId:c.a.number.isRequired,isPlaceholder:c.a.bool,data:c.a.shape({name:c.a.string,is_letter:c.a.bool,inner_dimensions:c.a.string}).isRequired,prefixActions:c.a.bool,dimensionUnit:c.a.string},t.a=Object(s.localize)(p)},645:function(e,t,n){"use strict";n.d(t,"a",function(){return a});var r=n(535);function a(e,t,n){return{type:r.L,successAction:e,failureAction:t,onlyPackages:n||!1}}},649:function(e,t,n){"use strict";var r=n(110),a=n.n(r),i=n(36),c=n.n(i),s=n(1),o=n(538),u={modalErrors:{},pristine:!0},l=function(e){return null===e||""===Object(s.trim)(e)},d={};d[o.g]=function(e){var t=e.packages&&e.packages.predefined?e.packages.predefined:{},n=c()({},e,{showModal:!0,mode:"add-custom",currentlyEditingPredefinedPackages:Object(s.cloneDeep)(t)});return"edit"!==e.mode&&n.packageData||(n.packageData={is_user_defined:!0}),n},d[o.i]=function(e,t){return Object.assign({},e,{showModal:!0,modalReadOnly:!1,mode:"edit",packageData:t.package,showOuterDimensions:!1})},d[o.h]=function(e){return Object.assign({},e,{modalErrors:{},showModal:!1,showOuterDimensions:!1})},d[o.s]=function(e,t){return Object.assign({},e,{modalErrors:t.value})},d[o.w]=function(e,t){var n=Object.assign({},e.packageData,t.values),r=Object(s.omitBy)(n,l);return Object.assign({},e,{packageData:r,pristine:!1})},d[o.m]=function(e,t){var n=t.packageData,r=e.packages.custom||[];(n.box_weight&&(n.box_weight=Number.parseFloat(n.box_weight)),n.max_weight&&(n.max_weight=Number.parseFloat(n.max_weight)),"index"in n)?r[n.index]=Object(s.omit)(n,"index"):r.push(n);return e=d[o.h](e),c()({},e,{mode:"add-custom",packageData:{is_user_defined:!0},packages:c()({},e.packages,{custom:r}),pristine:!1})},d[o.u]=function(e){return c()({},e,{showOuterDimensions:!0})},d[o.k]=function(e,t){var n=a()(e.packages.custom);return n.splice(t.index,1),c()({},e,{packages:c()({},e.packages,{custom:n}),pristine:!1,showModal:!1})},d[o.t]=function(e,t){var n=t.serviceId,r=t.groupId,a=t.checked,i=e.predefinedSchema[n][r].definitions.map(function(e){return e.id}),o=e.currentlyEditingPredefinedPackages[n],u=a?Object(s.uniq)(Object(s.concat)(o,i)):Object(s.difference)(o,i),l=c()({},e.currentlyEditingPredefinedPackages);return l[n]=u,c()({},e,{currentlyEditingPredefinedPackages:l,pristine:!1})},d[o.v]=function(e,t){var n=t.serviceId,r=t.packageId,i=c()({},e.currentlyEditingPredefinedPackages),s=a()(i[n]||[]),o=s.indexOf(r);return-1===o?s.push(r):s.splice(o,1),i[n]=s,c()({},e,{currentlyEditingPredefinedPackages:i,pristine:!1})},d[o.l]=function(e,t){var n=t.serviceId,r=t.packageId,i=c()({},e.packages.predefined),s=a()(i[n]||[]),o=s.indexOf(r);return-1!==o&&s.splice(o,1),i[n]=s,c()({},e,{packages:c()({},e.packages,{predefined:i}),pristine:!1})},d[o.n]=function(e){var t=e.currentlyEditingPredefinedPackages;return e=d[o.h](e),c()({},e,{packages:c()({},e.packages,{predefined:t}),pristine:!1})},d[o.o]=function(e,t){var n=t.mode;return c()({},e,{mode:n})},d[o.r]=function(e,t){return Object.assign({},e,{isSaving:t.isSaving,pristine:!t.isSaving})},d[o.p]=function(e,t){var n=t.isFetching;return c()({},e,{isFetching:n})},d[o.q]=function(e,t){var n=t.isFetchError;return c()({},e,{isFetchError:n})},d[o.j]=function(e,t){var n=t.packages,r=t.dimensionUnit,a=t.weightUnit,i=t.packageSchema,s=t.predefinedSchema;return c()({},e,{packages:n,dimensionUnit:r,weightUnit:a,packageSchema:i,predefinedSchema:s,packageData:e.packageData||{is_user_defined:!0},isLoaded:!0})};t.a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,t=arguments.length>1?arguments[1]:void 0;return"function"===typeof d[t.type]?d[t.type](e,t):e}},650:function(e,t,n){"use strict";var r=n(34),a=n.n(r),i=n(36),c=n.n(i),s=n(538),o={meta:{error:!1,fieldsStatus:!1,isSaving:!1,isFetching:!1,isLoaded:!1,isFetchError:!1,pristine:!0},data:null,pristineData:null},u={};u[s.b]=function(e,t){var n=t.storeOptions,r=t.formData,a=t.formMeta,i=t.userMeta;return c()({},e,{storeOptions:n,meta:c()({},e.meta,a,{pristine:!0,isLoaded:!0,user:i}),data:c()({},e.data,r)})},u[s.e]=function(e,t){var n=t.key,r=t.value,i=e.meta.pristine?e.data:e.pristineData;return c()({},e,{meta:c()({},e.meta,{pristine:!1}),data:c()({},e.data,a()({},n,r)),pristineData:i})},u[s.f]=function(e,t){var n=t.key,r=t.value;return c()({},e,{meta:c()({},e.meta,a()({},n,r))})},u[s.d]=function(e){return e.meta.pristine?e:c()({},e,{meta:c()({},e.meta,{pristine:!0}),data:e.pristineData,pristineData:null})},u[s.c]=function(e){return c()({},e,{addCardDialog:!0})},u[s.a]=function(e){return c()({},e,{addCardDialog:null})};t.a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o,t=arguments.length>1?arguments[1]:void 0;return u[t.type]?u[t.type](e,t):e}},655:function(e,t,n){"use strict";var r,a=n(110),i=n.n(a),c=n(36),s=n.n(c),o=n(118),u=n.n(o),l=n(34),d=n.n(l),m=n(47),p=n.n(m),f=n(592),E=n(535),_=p()("woocommerce:action-list");t.a=(r={},d()(r,E.d,[function(e,t){var n=e.dispatch,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now(),a=t.actionList,i=a.prevSteps,c=a.currentStep,o=a.nextSteps||[],l=u()(o),d=l[0],m=l.slice(1);if(c)return void _("[handleStepNext] Warning: Attempting before current step finishes. Ignoring.");if(!d)return void _("[handleStepNext] Warning: Attempting with no nextSteps left. Ignoring.");var p=s()({},a,{prevSteps:i,currentStep:s()({},d,{startTime:r}),nextSteps:m});n(Object(f.a)(p)),d.onStep(n,p)}]),d()(r,E.e,[function(e,t){var n=e.dispatch,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now(),a=t.actionList,c=a.prevSteps,o=a.currentStep,u=a.nextSteps;if(!o)return void _("[handleStepSuccess] Warning: Attempting with no current step. Ignoring.");var l=s()({},a,{prevSteps:[].concat(i()(c||[]),[s()({},o,{endTime:r})]),currentStep:null,nextSteps:u});n(Object(f.a)(l)),u&&u.length>0?n(Object(f.d)(l)):a.onSuccess&&a.onSuccess(n,l)}]),d()(r,E.c,[function(e,t){var n=e.dispatch,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now(),a=t.actionList,c=t.error,o=a.prevSteps,u=a.currentStep,l=a.nextSteps;if(!u)return void _("[handleStepFailure] Warning: Attempting with no current step. Ignoring.");var d=s()({},a,{prevSteps:[].concat(i()(o||[]),[s()({},u,{endTime:r,error:c})]),currentStep:null,nextSteps:l});n(Object(f.a)(d)),a.onFailure&&a.onFailure(n,d)}]),r)},656:function(e,t,n){"use strict";var r,a=n(34),i=n.n(a),c=n(46),s=n(535),o=n(539),u=n(615);t.a=Object(c.b)(null,(r={},i()(r,s.k,function(){return o.b}),i()(r,s.l,function(e,t){return t.data.map(function(e){return{code:e.code,name:Object(u.a)(e.name),countries:e.countries.map(function(e){return{code:e.code,name:Object(u.a)(e.name),states:e.states.map(function(e){return{code:e.code,name:Object(u.a)(e.name)}})}})}})}),i()(r,s.j,function(e,t){var n=t.originalAction.type;return s.k===n?o.a:e}),r))},668:function(e,t,n){"use strict";n.d(t,"a",function(){return k});n(530);var r=n(107),a=n.n(r),i=n(108),c=n.n(i),s=n(528),o=n.n(s),u=n(527),l=n.n(u),d=(n(531),n(529)),m=n.n(d),p=n(34),f=n.n(p),E=n(12),_=n.n(E),O=n(10),b=n(47),g=n.n(b),h=(n(669),n(35)),v=n.n(h),S=n(1),C=g()("calypso:protect-form"),j=[],N=0;function I(e){if(j.length){C("unsaved form changes detected");var t=v.a.translate("You have unsaved changes.");return(e||window.event).returnValue=t,t}}function y(){0===N&&window.addEventListener("beforeunload",I),N++}function R(){0===--N&&window.removeEventListener("beforeunload",I)}function P(e){Object(S.includes)(j,e)||j.push(e)}function M(e){j=Object(S.without)(j,e)}var k=function(e){function t(){return a()(this,t),o()(this,l()(t).apply(this,arguments))}return m()(t,e),c()(t,[{key:"componentDidMount",value:function(){y(),this.props.isChanged&&P(this)}},{key:"componentWillUnmount",value:function(){R(),M(this)}},{key:"componentWillReceiveProps",value:function(e){e.isChanged!==this.props.isChanged&&(e.isChanged?P(this):M(this))}},{key:"render",value:function(){return null}}]),t}(O.Component);f()(k,"propTypes",{isChanged:_.a.bool.isRequired})},670:function(e,t,n){"use strict";n.d(t,"a",function(){return j});var r=n(107),a=n.n(r),i=n(108),c=n.n(i),s=n(528),o=n.n(s),u=n(527),l=n.n(u),d=n(531),m=n.n(d),p=n(529),f=n.n(p),E=n(34),_=n.n(E),O=n(10),b=n.n(O),g=n(12),h=n.n(g),v=n(526),S=n.n(v),C=n(1),j=function(e){function t(){var e,n;a()(this,t);for(var r=arguments.length,i=new Array(r),c=0;c<r;c++)i[c]=arguments[c];return n=o()(this,(e=l()(t)).call.apply(e,[this].concat(i))),_()(m()(n),"onKeyDown",function(e){n.props.disabled||("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),n.props.onChange(!n.props.checked)),n.props.onKeyDown(e))}),_()(m()(n),"onClick",function(e){e&&e.stopPropagation&&e.stopPropagation(),n.props.disabled||n.props.onChange(!n.props.checked)}),_()(m()(n),"onLabelClick",function(e){if(!n.props.disabled){var t=e.target.nodeName.toLowerCase();"a"!==t&&"input"!==t&&"select"!==t&&(e.preventDefault(),n.props.onChange(!n.props.checked))}}),n}return f()(t,e),c()(t,[{key:"componentWillMount",value:function(){this.id=this.constructor.idNum++}},{key:"render",value:function(){var e=this.props.id||"toggle-"+this.id,t=S()("form-toggle__wrapper",this.props.wrapperClassName,{"is-disabled":this.props.disabled}),n=S()("form-toggle",this.props.className,{"is-toggling":this.props.toggling});return b.a.createElement("span",{className:t},b.a.createElement("input",{id:e,className:n,type:"checkbox",checked:this.props.checked,readOnly:!0,disabled:this.props.disabled}),b.a.createElement("label",{className:"form-toggle__label",htmlFor:e},b.a.createElement("span",{className:"form-toggle__switch",onClick:this.onClick,onKeyDown:this.onKeyDown,role:"checkbox","aria-checked":this.props.checked,"aria-label":this.props["aria-label"],tabIndex:this.props.disabled?-1:0}),this.props.children&&b.a.createElement("span",{className:"form-toggle__label-content",onClick:this.onLabelClick},this.props.children)))}}]),t}(O.PureComponent);_()(j,"propTypes",{onChange:h.a.func,onKeyDown:h.a.func,checked:h.a.bool,disabled:h.a.bool,id:h.a.string,className:h.a.string,wrapperClassName:h.a.string,toggling:h.a.bool,"aria-label":h.a.string}),_()(j,"defaultProps",{checked:!1,disabled:!1,onKeyDown:C.noop,onChange:C.noop}),_()(j,"idNum",0)},672:function(e,t,n){"use strict";var r=n(107),a=n.n(r),i=n(108),c=n.n(i),s=n(528),o=n.n(s),u=n(527),l=n.n(u),d=n(529),m=n.n(d),p=n(10),f=n(12),E=n.n(f),_=n(109),O=n(30),b=n(567),g=n(546),h=function(e){function t(){return a()(this,t),o()(this,l()(t).apply(this,arguments))}return m()(t,e),c()(t,[{key:"fetch",value:function(e){var t=e.siteId,n=e.loaded,r=e.fetching,a=e.error;n||r||a||this.props.fetchSettings(t)}},{key:"UNSAFE_componentWillMount",value:function(){this.fetch(this.props)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.fetch(e)}},{key:"render",value:function(){return null}}]),t}(p.Component);h.propTypes={siteId:E.a.number.isRequired},t.a=Object(_.b)(function(e){return{loaded:Object(g.d)(e),fetching:Object(g.c)(e),error:Object(g.b)(e)}},function(e){return Object(O.b)({fetchSettings:b.a},e)})(h)},673:function(e,t,n){"use strict";var r=n(107),a=n.n(r),i=n(108),c=n.n(i),s=n(528),o=n.n(s),u=n(527),l=n.n(u),d=n(529),m=n.n(d),p=n(10),f=n(12),E=n.n(f),_=n(109),O=n(30),b=n(553),g=n(540),h=function(e){function t(){return a()(this,t),o()(this,l()(t).apply(this,arguments))}return m()(t,e),c()(t,[{key:"fetch",value:function(e){var t=e.siteId,n=e.loaded,r=e.fetching,a=e.error;n||r||a||this.props.fetchSettings(t)}},{key:"UNSAFE_componentWillMount",value:function(){this.fetch(this.props)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.fetch(e)}},{key:"render",value:function(){return null}}]),t}(p.Component);h.propTypes={siteId:E.a.number.isRequired},t.a=Object(_.b)(function(e){return{loaded:Object(g.i)(e),fetching:Object(g.h)(e),error:Object(g.g)(e)}},function(e){return Object(O.b)({fetchSettings:b.fetchSettings},e)})(h)},674:function(e,t,n){e.exports=n.p+"images/881843a7135b8abd4794bd2d33dc8b3c.png"},675:function(e,t,n){e.exports=n.p+"images/41c6838923ebde874f7fc71db18dcae5.png"},676:function(e,t,n){e.exports=n.p+"images/224d57e46d3ace2d89e5c790bd828d32.png"},678:function(e,t,n){"use strict";var r=n(36),a=n.n(r),i=n(10),c=n.n(i),s=n(12),o=n.n(s),u=n(109),l=n(35),d=n(1),m=n(534),p=n.n(m),f=n(34),E=n.n(f),_=n(107),O=n.n(_),b=n(108),g=n.n(b),h=n(528),v=n.n(h),S=n(527),C=n.n(S),j=n(529),N=n.n(j),I=n(30),y=n(526),R=n.n(y),P=n(555),M=n(588);function k(e){return Object(d.get)(e,["currentUser","id"])}function T(e){var t=k(e);return t?function(e,t){return e.users.items[t]}(e,t):null}var A=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(n){var r=T(n);return Object(d.get)(r,e,t)}};A("localeSlug"),A("localeVariant"),A("user_ip_country_code");A("date"),A("username"),A("email");A("email_verified",!1);var L=n(532),w=n(560);function D(e){var t=Object(L.a)(e);return t||1!==function(e){var t=T(e);return t?t.site_count||0:null}(e)||(t=function(e){var t=T(e);return Object(d.get)(t,"primary_blog",null)}(e)),Object(w.a)(e,t)}var x=n(539),W=function(e,t){return Object(d.get)(e,["extensions","woocommerce","sites",t,"settings","products"])},U=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(L.a)(e);return Object(d.isArray)(W(e,t))},G=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(L.a)(e);return x.b===W(e,t)};function V(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(L.a)(e),n=W(e,t);return Object(d.find)(n,function(e){return"woocommerce_dimension_unit"===e.id})||{}}var H=n(563),F=n(554),z=n(535),q=function(e){return function(t,n){if(!U(n(),e)&&!G(n(),e)){var r={type:z.N,siteId:e};return t(r),Object(H.a)(e).get("settings/products").then(function(n){t({type:z.O,siteId:e,data:n})}).catch(function(n){t(Object(F.a)(e,r,n))})}}},B=function(e){function t(){return O()(this,t),v()(this,C()(t).apply(this,arguments))}return N()(t,e),g()(t,[{key:"componentDidMount",value:function(){var e=this.props.siteId;e&&this.props.fetchSettingsProducts(e)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){e.siteId!==this.props.siteId&&this.props.fetchSettingsProducts(e.siteId)}},{key:"render",value:function(){var e=this.props,t=e.className,n=e.noWrap,r=e.dimensions,a=e.onChange,i=e.translate,s=e.dimensionsUnit,o=R()("form-dimensions-input",t,{"no-wrap":n});return c.a.createElement("div",{className:o},c.a.createElement(P.a,{name:"length",placeholder:i("L",{comment:"Length placeholder for dimensions input"}),type:"number",value:r&&r.length||"",onChange:a,className:"form-dimensions-input__length"}),c.a.createElement(P.a,{name:"width",placeholder:i("W",{comment:"Width placeholder for dimensions input"}),type:"number",value:r&&r.width||"",onChange:a,className:"form-dimensions-input__width"}),c.a.createElement(M.a,{name:"height",placeholder:i("H",{comment:"Height placeholder for dimensions input"}),suffix:s,type:"number",noWrap:n,value:r&&r.height||"",onChange:a,className:"form-dimensions-input__height"}))}}]),t}(i.Component);E()(B,"propTypes",{className:o.a.string,dimensions:o.a.shape({width:o.a.string,height:o.a.string,length:o.a.string}),dimensionsUnit:o.a.string,onChange:o.a.func.isRequired,noWrap:o.a.bool}),E()(B,"defaultProps",{value:"",className:"",onChange:d.noop,noWrap:!1});var Z=Object(u.b)(function(e,t){var n=t.dimensionsUnit,r=D(e);if(!n){var a=r&&V(e,r.ID);n=a&&a.value||"in"}return{siteId:r&&r.ID,dimensionsUnit:n}},function(e){return Object(I.b)({fetchSettingsProducts:q},e)})(Object(l.localize)(B)),K=n(548),Q=n(547),Y=n(580),$=n(550),X=/^\.\d+$/,J=/^\d+\.$/,ee=function(e){return e=Object(d.trim)(e),X.test(e)?e="0"+e:J.test(e)&&(e=e.slice(0,e.length-1)),e},te=/^\s*(\S+)\s*x\s*(\S+)\s*x\s*(\S+)\s*$/,ne=/^\s*(\S+)?\s*x\s*(\S+)?\s*x\s*(\S+)?\s*$/,re=function(e){return isNaN(e)?"":0>e?"":e},ae=function(e){var t="",n="",r="",a=ne.exec(e);return a&&4===a.length&&(t=re(a[1]),n=re(a[2]),r=re(a[3])),{length:t,width:n,height:r}},ie=function(e){return Object(d.trim)(e)},ce=ee,se=function(e){var t=te.exec(e);return t?[t[1],t[2],t[3]].map(ee).join(" x "):e},oe=ae,ue=function(e){var t=ae(e),n=t.length,r=t.width,a=t.height;return 0<n&&0<r&&0<a},le=function(e){var t=e.siteId,n=e.form,r=e.setModalErrors,a=e.updatePackagesField,i=e.translate,s=n.mode,o=n.modalErrors,u=n.dimensionUnit,l=n.weightUnit,m=n.packageData,p=m.name,f=m.inner_dimensions,_=m.box_weight,O=m.is_letter,b=function(e,n){r(t,Object(d.omit)(o,e)),a(t,E()({},e,n))},g=function(e){var t=e.target.name,n=e.target.value;b(t,n)},h=function(e,t){var n=t||i("Invalid value."),r=""===Object(d.trim)(m[e])?i("This field is required."):n;return o[e]?c.a.createElement($.a,{text:r}):null},v=function(e){a(t,{is_letter:"envelope"===e.target.value})};return c.a.createElement("div",{className:"packages__properties-group"},"add-custom"===s?c.a.createElement(K.a,null,c.a.createElement(Q.a,{htmlFor:"package_type"},i("Type of package")),c.a.createElement(Y.a,{id:"package_type",onChange:v,value:O?"envelope":"box"},c.a.createElement("option",{value:"box"},i("Box")),c.a.createElement("option",{value:"envelope"},i("Envelope")))):null,c.a.createElement(K.a,null,c.a.createElement(Q.a,{htmlFor:"name"},i("Package name")),c.a.createElement(P.a,{id:"name",name:"name",placeholder:i("Unique package name"),value:p||"",onChange:g,isError:o.name}),h("name",i("This field must be unique"))),c.a.createElement(K.a,{className:"packages__add-package-weight-group"},c.a.createElement("div",{className:"packages__add-package-weight"},c.a.createElement(Q.a,null,i("Dimensions (L x W x H)")),function(e,t,n,r){var a=oe(t),i=a.length,s=a.width,o=a.height;return c.a.createElement(Z,{dimensionsUnit:n,dimensions:{width:s,height:o,length:i},onChange:function(t){var n=t.target.name,a=t.target.value;r(e,["length"===n?a:i,"width"===n?a:s,"height"===n?a:o].join(" x "))}})}("inner_dimensions",f,u,b),h("inner_dimensions")),c.a.createElement("div",{className:"packages__add-package-weight"},c.a.createElement(Q.a,{htmlFor:"box_weight"},i("Weight of empty package")),c.a.createElement(M.a,{id:"box_weight",name:"box_weight",placeholder:i("0.0"),value:_||"",onChange:g,isError:o.box_weight,type:"number",noWrap:!0,suffix:l}),h("box_weight"))))};le.propTypes={siteId:o.a.number.isRequired,form:o.a.object.isRequired,updatePackagesField:o.a.func.isRequired,packageData:o.a.shape({name:o.a.string.isRequired,inner_dimensions:o.a.string.isRequired,box_weight:o.a.number.isRequired,is_user_defined:o.a.bool.isRequired,is_letter:o.a.bool.isRequired}),setModalErrors:o.a.func.isRequired};var de=Object(l.localize)(le),me=n(115),pe=n.n(me),fe=Object(d.memoize)(function(e){return pe()(e,{greedy:!0})}),Ee=function(e){return e&&""!==Object(d.trim)(e)?e:null},_e=function(e,t){return e=Ee(e),Object(d.some)(t,function(t){return t===e})?null:e},Oe=/^\d+(\.\d+)?$/,be=function(e){return Oe.test(e)?Number.parseFloat(e):null},ge=function(e,t,n){var r,a=fe(n);return a(function(e,t){var n=be(e.box_weight),r=be(e.max_weight);n&&r&&r<=n&&(r=null);var a={name:_e(e.name,t),inner_dimensions:e.inner_dimensions,outer_dimensions:Ee(e.outer_dimensions),box_weight:n,max_weight:r};return Object(d.omitBy)(a,function(e){return null===e})}(e,t)),r=a.errors,Object(d.reduce)(r,function(e,t){if(t.field){var n,r=t.field.replace("data.","");Object.assign(e,(n={},E()(n,r,!0),E()(n,"any",!0),n))}return e},{})},he=n(562),ve=n(552),Se=n(581),Ce=function(e){var t=e.className,n=e.disabled,r=e.id,a=e.onToggle,i=e.readOnly,s=e.selectedElements,o=e.totalElements,u=s&&s===o,l=s&&s<o,d=R()("bulk-select__box",{"is-checked":u}),m=R()("bulk-select__some-checked-icon",{"is-disabled":n}),f=R()("bulk-select",t);return c.a.createElement("span",{className:f},c.a.createElement("span",{className:"bulk-select__container"},c.a.createElement("input",{id:r,type:"checkbox",className:d,onChange:function(e){i||a(!(l||u),e)},checked:u,disabled:n}),l?c.a.createElement(p.a,{className:m,icon:"minus-small",size:18}):null))};Ce.propTypes={totalElements:o.a.number.isRequired,selectedElements:o.a.number.isRequired,onToggle:o.a.func,readOnly:o.a.bool,className:o.a.string,disabled:o.a.bool};var je=Ce,Ne=n(611),Ie=n(613),ye=n(644),Re=n(540),Pe=function(e){var t=e.siteId,n=e.form,r=e.toggleAll,a=e.togglePackage,i=e.currentlyEditingPredefinedPackages,s=e.translate,o=n.dimensionUnit,u=function(e){var n="group-".concat(e.serviceId,"-").concat(e.groupId);return c.a.createElement("div",{className:"packages__group-header"},c.a.createElement("label",{htmlFor:n,onClick:function(e){return e.stopPropagation()}},c.a.createElement(je,{id:n,totalElements:e.total,selectedElements:e.selected,onToggle:function(n,a){a.stopPropagation(),r(t,e.serviceId,e.groupId,a.target.checked)},className:"packages__group-header-checkbox"}),e.title))};return c.a.createElement("div",null,function(){var e=[];return Object(d.forEach)(i,function(n,r){var i,l,d=(i=n.selected,l=n.total,i===l?s("All packages selected"):s("%(selectedCount)d package selected","%(selectedCount)d packages selected",{count:i,args:{selectedCount:i}}));e.push(c.a.createElement(Ne.a,{className:"packages__predefined-packages",key:r,header:u(n),summary:d,expandedSummary:d,clickableHeader:!0,expanded:!1,screenReaderText:s("Expand Services"),icon:"chevron-down"},function(e){return e.packages.map(function(e,n){return c.a.createElement(ye.a,{key:n,siteId:t,data:e,dimensionUnit:o,prefixActions:!0},c.a.createElement(Ie.a,{checked:e.selected,onChange:function(){return a(t,e.serviceId,e.id)}}))})}(n)))}),e}())};Pe.propTypes={siteId:o.a.number.isRequired,toggleAll:o.a.func.isRequired,togglePackage:o.a.func.isRequired,form:o.a.shape({dimensionUnit:o.a.string}).isRequired};var Me=Object(u.b)(function(e){return{currentlyEditingPredefinedPackages:Object(Re.c)(e)}})(Object(l.localize)(Pe)),ke=n(531),Te=n.n(ke),Ae=function(e){function t(){var e,n;O()(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=v()(this,(e=C()(t)).call.apply(e,[this].concat(a))),E()(Te()(n),"handleKeyEvent",function(e){switch(e.keyCode){case 13:case 32:e.preventDefault(),document.activeElement.click()}}),n}return N()(t,e),g()(t,[{key:"render",value:function(){var e=R()({"segmented-control__item":!0,"is-selected":this.props.selected}),t=R()("segmented-control__link",E()({},"item-index-".concat(this.props.index),null!=this.props.index));return c.a.createElement("li",{className:e},c.a.createElement("a",{href:this.props.path,className:t,onClick:this.props.onClick,title:this.props.title,"data-e2e-value":this.props.value,role:"radio",tabIndex:0,"aria-checked":this.props.selected,onKeyDown:this.handleKeyEvent},c.a.createElement("span",{className:"segmented-control__text"},this.props.children)))}}]),t}(c.a.Component);E()(Ae,"propTypes",{children:o.a.node.isRequired,path:o.a.string,selected:o.a.bool,title:o.a.string,value:o.a.string,onClick:o.a.func,index:o.a.number}),E()(Ae,"defaultProps",{selected:!1});var Le=Ae,we=function(e){function t(){var e,n;O()(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=v()(this,(e=C()(t)).call.apply(e,[this].concat(a))),E()(Te()(n),"state",{selected:n.props.initialSelected||n.props.options[0].value}),n}return N()(t,e),g()(t,[{key:"renderOptions",value:function(){var e=this;return this.props.options.map(function(t,n){return c.a.createElement(Le,{index:n,key:n,onClick:function(){e.setState({selected:t.value}),e.props.onSelect&&e.props.onSelect(t)},path:t.path,selected:e.state.selected===t.value,value:t.value},t.label)})}},{key:"render",value:function(){var e={"is-compact":this.props.compact,"is-primary":this.props.primary};return c.a.createElement("ul",{className:R()("segmented-control",e,this.props.className),style:this.props.style,role:"radiogroup"},this.renderOptions())}}]),t}(c.a.Component);E()(we,"propTypes",{className:o.a.string,compact:o.a.bool,initialSelected:o.a.string,onSelect:o.a.func,options:o.a.arrayOf(o.a.shape({value:o.a.string.isRequired,label:o.a.string.isRequired,path:o.a.string})).isRequired,style:o.a.object});var De=n(645),xe=n(545),We=n(553),Ue=function(e){var t,n=e.siteId,r=e.form,a=e.predefinedPackagesSummary,i=e.setModalErrors,s=e.savePackage,o=e.savePredefinedPackages,u=e.dismissModal,l=e.removePackage,m=e.setAddMode,f=e.updatePackagesField,E=e.translate,_=r.showModal,O=r.mode,b=r.packages,g=r.packageSchema,h=r.predefinedSchema,v=r.packageData,S=v.index,C=b.custom,j="edit"===O,N="add-custom"===O,I="add-predefined"===O,y=function(){var t={duration:5e3};e.createWcsShippingSaveActionList(function(){return"function"===typeof e.onSaveSuccess&&"name"in v&&e.onSaveSuccess(v.name),e.successNotice(E("Your shipping packages have been saved."),t)},function(){return e.errorNotice(E("Unable to save your shipping packages. Please try again."),t)},!0)},R=function(){u(n)},P=E(j?"Edit package":"Add a package"),M=N||I,k=N||j,T=I;t=N||I&&0===a.removed?E("Add package","Add packages",{count:N?1:a.added}):E("Done");var A=[c.a.createElement(Se.a,{onClick:function(){if(I)return o(n),void(e.persistOnSave&&y());var t="number"===typeof v.index?C[v.index].name:null,r=Object(d.concat)(Object(d.difference)(C.map(function(e){return e.name}),[t]),Object(d.flatten)(Object(d.map)(h,function(e){return Object(d.map)(e,function(e){return e.definitions})})),["individual"]),a=Object.assign({},v,{name:ie(v.name),inner_dimensions:se(v.inner_dimensions),outer_dimensions:se(v.outer_dimensions),box_weight:ce(v.box_weight),max_weight:0}),c=ge(a,r,g);if(ue(a.inner_dimensions)||(c.any=!0,c.inner_dimensions=!0),c.any)return f(n,a),void i(n,c);s(n,a),e.persistOnSave&&y()}},t),c.a.createElement(Se.a,{onClick:R,isPrimary:!1},E("Cancel"))];return j&&A.unshift({action:"delete",label:c.a.createElement("span",null,E("{{icon/}} Delete this package",{components:{icon:c.a.createElement(p.a,{icon:"trash"})}})),onClick:function(){return l(n,S)},additionalClassNames:"packages__delete is-scary is-borderless"}),c.a.createElement(he.a,{isVisible:_,additionalClassNames:"packages__add-edit-dialog woocommerce wcc-root",onClose:R,buttons:A},c.a.createElement(ve.a,{className:"packages__add-edit-title"},P),M&&c.a.createElement(we,{primary:!0,className:"packages__mode-select",initialSelected:O,onSelect:function(e){m(n,e.value)},options:[{value:"add-custom",label:"Custom package"},{value:"add-predefined",label:"Service package"}]}),k&&c.a.createElement(de,e),T&&c.a.createElement(Me,e))};Ue.propTypes={siteId:o.a.number.isRequired,dismissModal:o.a.func.isRequired,form:o.a.object.isRequired,updatePackagesField:o.a.func.isRequired,savePackage:o.a.func.isRequired,packageData:o.a.shape({index:o.a.number.isRequired}),setModalErrors:o.a.func.isRequired,removePackage:o.a.func.isRequired,setAddMode:o.a.func.isRequired};t.a=Object(u.b)(function(e){return{predefinedPackagesSummary:Object(Re.f)(e)}},function(e){return Object(I.b)(a()({createWcsShippingSaveActionList:De.a,errorNotice:xe.a,successNotice:xe.d},We),e)})(Object(l.localize)(Ue))},768:function(e,t,n){},769:function(e,t,n){},790:function(e,t,n){"use strict";n.r(t);var r=n(10),a=n.n(r),i=n(107),c=n.n(i),s=n(108),o=n.n(s),u=n(528),l=n.n(u),d=n(527),m=n.n(d),p=n(531),f=n.n(p),E=n(529),_=n.n(E),O=n(34),b=n.n(O),g=n(109),h=n(30),v=n(35),S=n.n(v),C=n(544),j=n(601),N=n(12),I=n.n(N),y=n(526),R=n.n(y),P=n(1),M=n(558),k=n(530),T=n.n(k),A=n(561),L=n(533),w=n.n(L),D={en:{symbol:"K",grouping:",",decimal:"."},es:{symbol:" mil",grouping:".",decimal:","},"pt-br":{symbol:" mil",grouping:".",decimal:","},de:{symbol:" Tsd.",grouping:".",decimal:","},fr:{symbol:" k",grouping:" ",decimal:","},he:{symbol:"K",grouping:",",decimal:"."},ja:{symbol:"\u4e07",unitValue:1e4,grouping:",",decimal:"."},nl:{symbol:"K",grouping:".",decimal:","},tr:{symbol:" B",grouping:".",decimal:","},id:{symbol:" rb",grouping:".",decimal:","},"zh-cn":{symbol:"\u4e07",unitValue:1e4,grouping:",",decimal:"."},"zh-tw":{symbol:"\u842c",unitValue:1e4,grouping:",",decimal:"."},ko:{symbol:"\ucc9c",grouping:",",decimal:"."},ar:{symbol:" \u0623\u0644\u0641",grouping:"\u066c",decimal:"\u066b"},sv:{symbol:" tn",grouping:" ",decimal:","}};n(768);var x=function(e){var t=e.count,n=e.compact,r=e.numberFormat,i=e.primary,c=w()(e,["count","compact","numberFormat","primary"]);return a.a.createElement("span",T()({className:R()("count",{"is-primary":i})},Object(P.omit)(c,["translate","moment"])),n&&function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:S.a.getLocaleSlug();if(isNaN(e)||!D[t])return null;var n=D[t],r=n.decimal,a=n.grouping,i=n.symbol,c=n.unitValue,s=void 0===c?1e3:c,o=e<0?"-":"",u=Math.abs(e);if(u<s)return"".concat(o).concat(u);var l=u<10*s?1:0,d=Object(v.numberFormat)(u/s,{decimals:l,thousandsSep:a,decPoint:r});return"".concat(o).concat(d).concat(i)}(t)||r(t))};x.propTypes={count:I.a.number.isRequired,numberFormat:I.a.func,primary:I.a.bool,compact:I.a.bool},x.defaultProps={primary:!1,compact:!1};var W=Object(v.localize)(x),U=(n(769),function(e){function t(){return c()(this,t),l()(this,m()(t).apply(this,arguments))}return _()(t,e),o()(t,[{key:"render",value:function(){var e="number"===typeof this.props.count,t=!(this.props.label||e||this.props.children),n=R()(this.props.className,"section-header",{"is-empty":t}),r={id:this.props.id};return a.a.createElement(A.a,T()({className:n,href:this.props.href},r),a.a.createElement("div",{className:"section-header__label"},a.a.createElement("span",{className:"section-header__label-text"},this.props.label),e&&a.a.createElement(W,{count:this.props.count})),a.a.createElement("div",{className:"section-header__actions"},this.props.children))}}]),t}(r.PureComponent));b()(U,"defaultProps",{label:"",href:null});var G=function(e){function t(){return c()(this,t),l()(this,m()(t).apply(this,arguments))}return _()(t,e),o()(t,[{key:"render",value:function(){var e=this.props,t=e.label,n=e.description,r=e.children,i=a.a.createElement("div",null,a.a.createElement("div",{className:"extended-header__header"},t),a.a.createElement("div",{className:"extended-header__header-description"},n));return a.a.createElement(U,{className:"extended-header",label:i},r)}}]),t}(r.Component),V=n(670),H=n(36),F=n.n(H),z=n(534),q=n.n(z),B=n(616),Z=n(613),K=n(548),Q=n(547),Y=n(580),$=n(549),X=n(586),J={alipay:"Alipay",amex:"American Express",bancontact:"Bancontact","brazil-tef":"Transfer\xeancia banc\xe1ria",diners:"Diners Club",discover:"Discover",eps:"eps",giropay:"Giropay",ideal:"iDEAL",jcb:"JCB",mastercard:"Mastercard",p24:"Przelewy24",paypal:"PayPal",placeholder:"",unionpay:"UnionPay",visa:"Visa",wechat:S.a.translate("WeChat Pay",{comment:"Name for WeChat Pay - https://pay.weixin.qq.com/"}),sofort:"Sofort"},ee=Object(P.keys)(J),te=function(e){function t(){return c()(this,t),l()(this,m()(t).apply(this,arguments))}return _()(t,e),o()(t,[{key:"render",value:function(){var e=this.props,t=e.altText,n=e.className,r=e.isCompact,i=e.type,c=R()("payment-logo","is-".concat(i),{"is-compact":r},n);return a.a.createElement("div",{className:c,"aria-label":t||J[i]||""})}}]),t}(a.a.Component);b()(te,"propTypes",{className:I.a.string,type:I.a.oneOf(ee),altText:I.a.string,isCompact:I.a.bool});var ne=te,re=function(e,t,n){var r={amex:e("American Express"),discover:e("Discover"),mastercard:e("MasterCard"),visa:e("VISA"),paypal:e("PayPal")};return r[t]?n?e("%(card)s ****%(digits)s",{args:{card:r[t],digits:n}}):r[t]:null},ae=function(e){var t=e.translate,n=e.selected,r=e.isLoading,i=e.type,c=e.digits,s=e.name,o=e.expiry,u=e.onSelect;if(r)return a.a.createElement(A.a,{className:"label-settings__card"},a.a.createElement(Z.a,{className:"label-settings__card-checkbox"}),a.a.createElement(ne,{className:"label-settings__card-logo",type:"placeholder",altText:""}),a.a.createElement("div",{className:"label-settings__card-details"},a.a.createElement("p",{className:"label-settings__card-number"}),a.a.createElement("p",{className:"label-settings__card-name"})),a.a.createElement("div",{className:"label-settings__card-date"},a.a.createElement("p",null)));var l=re(t,i,c),d=l?i:"placeholder",m=l||i;return a.a.createElement(A.a,{className:"label-settings__card",onClick:u},a.a.createElement(Z.a,{className:"label-settings__card-checkbox",checked:n,onChange:u}),a.a.createElement(ne,{className:"label-settings__card-logo",type:d,altText:l}),a.a.createElement("div",{className:"label-settings__card-details"},a.a.createElement("p",{className:"label-settings__card-number"},m),a.a.createElement("p",{className:"label-settings__card-name"},s)),a.a.createElement("div",{className:"label-settings__card-date"},t("Expires %(date)s",{args:{date:o},context:"date is of the form MM/YY"})))};ae.propTypes={selected:I.a.bool.isRequired,isLoading:I.a.bool,type:I.a.string,digits:I.a.string,name:I.a.string,expiry:I.a.string,onSelect:I.a.func};var ie=Object(v.localize)(ae),ce=n(671),se=n(567),oe=n(546),ue=function(){return null},le=function(){return null},de=function(e){function t(){var e,n;c()(this,t);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=l()(this,(e=m()(t)).call.apply(e,[this].concat(i))),b()(f()(n),"renderPaymentPermissionNotice",function(){var e=n.props,t=e.canEditPayments,r=e.canEditSettings,i=e.masterUserName,c=e.masterUserLogin,s=e.translate;return!r||t?null:a.a.createElement($.a,{showDismiss:!1},s("Only the site owner can manage shipping label payment methods. Please contact %(ownerName)s (%(ownerLogin)s) to manage payment methods.",{args:{ownerName:i,ownerLogin:c}}))}),b()(f()(n),"refetchSettings",function(){n.props.fetchSettings(n.props.siteId)}),b()(f()(n),"renderPaymentWarningNotice",function(){var e=n.props,t=e.paymentMethodsWarning,r=e.translate;if(t)return a.a.createElement($.a,{status:"is-warning",showDismiss:!1,text:t},a.a.createElement(X.a,{onClick:n.refetchSettings},r("Retry")))}),b()(f()(n),"renderSettingsPermissionNotice",function(){var e=n.props,t=e.canEditSettings,r=e.masterUserName,i=e.masterUserLogin,c=e.translate;return t?null:a.a.createElement($.a,{showDismiss:!1},c("Only the site owner can change these settings. Please contact %(ownerName)s (%(ownerLogin)s) to change the shipping label settings.",{args:{ownerName:r,ownerLogin:i}}))}),b()(f()(n),"renderAddCardExternalInfo",function(){var e=n.props,t=e.masterUserWpcomLogin,r=e.masterUserEmail,i=e.translate;return t?a.a.createElement("p",null,i("Credit cards are retrieved from the following WordPress.com account: %(wpcomLogin)s <%(wpcomEmail)s>",{args:{wpcomLogin:t,wpcomEmail:r}})):null}),b()(f()(n),"onVisibilityChange",function(){document.hidden||n.refetchSettings(),n.addCreditCardWindow&&n.addCreditCardWindow.closed&&document.removeEventListener("visibilitychange",n.onVisibilityChange)}),b()(f()(n),"renderPaymentsSection",function(){var e=n.props,t=e.siteId,r=e.canEditPayments,i=e.paymentMethods,c=e.selectedPaymentMethod,s=e.isReloading,o=e.translate;if(!n.state.expanded){var u;if(c){var l=Object(P.find)(i,{payment_method_id:c}),d=l.card_type,m=l.card_digits;u=o("We'll charge the credit card on your account (%(card)s) to pay for the labels you print",{args:{card:re(o,d,m)}})}else u=o("To purchase shipping labels, add a credit card.");return a.a.createElement("div",null,n.renderPaymentPermissionNotice(),a.a.createElement("p",{className:"label-settings__credit-card-description"},u),r&&a.a.createElement("p",{className:"label-settings__credit-card-description"},a.a.createElement(C.a,{onClick:function(e){e.preventDefault(),n.setState({expanded:!0})},borderless:!0},o("Choose a different card"))))}var p,f;i.length?(p=o("To purchase shipping labels, choose a credit card you have on file or add a new card."),f=o("Add another credit card")):(p=o("To purchase shipping labels, add a credit card."),f=o("Add a credit card"));return a.a.createElement("div",null,n.renderPaymentPermissionNotice(),a.a.createElement("p",{className:"label-settings__credit-card-description"},p),!s&&n.renderPaymentWarningNotice(),a.a.createElement(ue,null),s?a.a.createElement("div",{className:"label-settings__placeholder"},a.a.createElement(ie,{selected:!1,isLoading:!0}),a.a.createElement(ie,{selected:!1,isLoading:!0})):i.map(function(e,t){return a.a.createElement(ie,{key:t,selected:c===e.payment_method_id,type:e.card_type,name:e.name,digits:e.card_digits,expiry:e.expiry,onSelect:function(){return t=e.payment_method_id,n.props.setValue("selected_payment_method_id",t);var t}})}),a.a.createElement(le,{siteId:t}),a.a.createElement(C.a,{className:"label-settings__internal",onClick:function(){n.props.openAddCardDialog(t)},compact:!0},f),a.a.createElement("div",{className:"label-settings__credit-card-description label-settings__external"},n.renderAddCardExternalInfo(),a.a.createElement(C.a,{onClick:function(){n.addCreditCardWindow=window.open(Object(ce.a)()+"/me/purchases/add-credit-card"),document.addEventListener("visibilitychange",n.onVisibilityChange)},compact:!0},f," ",a.a.createElement(q.a,{icon:"external"}))))}),b()(f()(n),"renderEmailReceiptsSection",function(){var e=n.props,t=e.emailReceipts,r=e.translate,i=e.masterUserName,c=e.masterUserLogin,s=e.masterUserEmail,o=e.canEditSettings,u=e.canEditPayments;if(!Object(P.isBoolean)(t))return null;return a.a.createElement(K.a,null,a.a.createElement(Q.a,{className:"label-settings__cards-label"},r("Email Receipts")),a.a.createElement(Q.a,null,a.a.createElement(Z.a,{checked:t,onChange:function(){return n.props.setValue("email_receipts",!t)},disabled:!u&&!o}),a.a.createElement("span",{className:"label-settings__credit-card-description"},r("Email the label purchase receipts to %(ownerName)s (%(ownerLogin)s) at %(ownerEmail)s",{args:{ownerName:i,ownerLogin:c,ownerEmail:s}}))))}),b()(f()(n),"renderContent",function(){var e=n.props,t=e.canEditSettings,r=e.isLoading,i=e.paperSize,c=e.storeOptions,s=e.translate;if(r)return n.renderPlaceholder();var o=Object(B.a)(c.origin_country);return a.a.createElement("div",null,a.a.createElement(K.a,null,n.renderSettingsPermissionNotice(),a.a.createElement(Q.a,{className:"label-settings__cards-label"},s("Paper size")),a.a.createElement(Y.a,{onChange:function(e){return n.props.setValue("paper_size",e.target.value)},value:i,disabled:!t},Object.keys(o).map(function(e){return a.a.createElement("option",{value:e,key:e},o[e])}))),a.a.createElement(K.a,null,a.a.createElement(Q.a,{className:"label-settings__cards-label"},s("Payment")),n.renderPaymentsSection()),n.renderEmailReceiptsSection())}),n}return _()(t,e),o()(t,[{key:"UNSAFE_componentWillMount",value:function(){this.setState({expanded:this.isExpanded(this.props)})}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){e.selectedPaymentMethod!==this.props.selectedPaymentMethod&&this.setState({expanded:this.isExpanded(e)})}},{key:"isExpanded",value:function(e){var t=e.canEditPayments,n=e.pristine,r=e.selectedPaymentMethod;return t&&(!r||!n)}},{key:"renderPlaceholder",value:function(){return a.a.createElement("div",{className:"label-settings__placeholder"},a.a.createElement(K.a,null,a.a.createElement(Q.a,{className:"label-settings__cards-label"},a.a.createElement("span",null)),a.a.createElement(Y.a,null)),a.a.createElement(K.a,null,a.a.createElement(Q.a,{className:"label-settings__cards-label"},a.a.createElement("span",null)),a.a.createElement("p",{className:"label-settings__credit-card-description"}),a.a.createElement(ie,{selected:!1,isLoading:!0}),a.a.createElement(ie,{selected:!1,isLoading:!0}),a.a.createElement(C.a,{compact:!0})))}},{key:"render",value:function(){return a.a.createElement("div",{className:"label-settings__labels-container"},this.renderContent())}}]),t}(r.Component);de.propTypes={siteId:I.a.number.isRequired,setValue:I.a.func.isRequired};var me=Object(g.b)(function(e,t){var n=t.siteId;return F()({isLoading:Object(oe.c)(e,n)&&!Object(oe.d)(e,n),isReloading:Object(oe.c)(e,n)&&Object(oe.d)(e,n),pristine:Object(oe.o)(e,n),paymentMethods:Object(oe.l)(e,n),paymentMethodsWarning:Object(oe.m)(e,n),selectedPaymentMethod:Object(oe.n)(e,n),paperSize:Object(oe.k)(e,n),storeOptions:Object(oe.h)(e,n),canEditPayments:Object(oe.q)(e,n),canEditSettings:Object(oe.q)(e,n)||Object(oe.p)(e,n),emailReceipts:Object(oe.e)(e,n)},Object(oe.j)(e,n))},function(e){return Object(h.b)({openAddCardDialog:se.b,fetchSettings:se.a},e)})(Object(v.localize)(de)),pe=n(672),fe=n(532),Ee=function(e){function t(){var e,n;c()(this,t);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=l()(this,(e=m()(t)).call.apply(e,[this].concat(i))),b()(f()(n),"setValue",function(e,t){n.props.onChange(),n.props.setFormDataValue(n.props.siteId,e,t)}),b()(f()(n),"onEnabledToggle",function(){n.props.onChange(),n.props.setFormDataValue(n.props.siteId,"enabled",!n.props.labelsEnabled)}),b()(f()(n),"renderContent",function(){var e=n.props,t=e.isFetchError,r=e.siteId,i=e.translate;return t?a.a.createElement("p",null,i("Unable to get your settings. Please refresh the page to try again.")):a.a.createElement(me,{siteId:r,setValue:n.setValue})}),n}return _()(t,e),o()(t,[{key:"componentWillUnmount",value:function(){this.props.restorePristineSettings(this.props.siteId)}},{key:"render",value:function(){var e=this.props,t=e.formMeta,n=e.canManagePayments,r=e.canEditSettings,i=e.labelsEnabled,c=e.siteId,s=e.translate;if(!t)return a.a.createElement(pe.a,{siteId:c});var o=Object(P.isBoolean)(i),u=Object(P.isBoolean)(i)&&!i;return a.a.createElement("div",null,a.a.createElement(pe.a,{siteId:c}),a.a.createElement(G,{label:s("Shipping Labels"),description:s("Print shipping labels yourself and save a trip to the post office")},o&&a.a.createElement(V.a,{checked:i,onChange:this.onEnabledToggle,disabled:Boolean(!n&&!r)})),a.a.createElement(M.a,{className:R()("label-settings__labels-container",{hidden:u})},this.renderContent()))}}]),t}(r.Component);Ee.propTypes={onChange:I.a.func.isRequired,submit:I.a.func};var _e=Object(g.b)(function(e){return{siteId:Object(fe.a)(e),formMeta:Object(oe.g)(e),labelsEnabled:Object(oe.a)(e),isFetchError:Object(oe.b)(e),canManagePayments:Object(oe.q)(e),canEditSettings:Object(oe.p)(e)}},function(e){return Object(h.b)({setFormDataValue:se.d,restorePristineSettings:se.c},e)})(Object(v.localize)(Ee)),Oe=n(559),be=n(678),ge=n(644),he=n(673),ve=n(553),Se=n(540),Ce=function(e){function t(){var e,n;c()(this,t);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=l()(this,(e=m()(t)).call.apply(e,[this].concat(i))),b()(f()(n),"renderListHeader",function(e){var t=n.props.translate;return e&&e.length?a.a.createElement("div",{className:"packages__packages-row packages__packages-header"},a.a.createElement("div",{className:"packages__packages-row-icon"}),a.a.createElement("div",{className:"packages__packages-row-details"},t("Name")),a.a.createElement("div",{className:"packages__packages-row-dimensions"},t("Dimensions")),a.a.createElement("div",{className:"packages__packages-row-actions"})):null}),b()(f()(n),"renderListItem",function(e,t){var r=n.props,i=r.siteId,c=r.isFetching,s=r.form,o=r.translate,u=s.dimensionUnit,l=null;if(e.is_user_defined){l=a.a.createElement(C.a,{compact:!0,onClick:function(){n.props.onChange(),n.props.editPackage(i,e)}},o("Edit"))}else{l=a.a.createElement(C.a,{compact:!0,onClick:function(){n.props.onChange(),n.props.removePredefinedPackage(i,e.serviceId,e.id)}},o("Remove"))}return a.a.createElement(ge.a,{key:t,siteId:i,isPlaceholder:c,data:e,dimensionUnit:u},l)}),n}return _()(t,e),o()(t,[{key:"render",value:function(){var e=this,t=this.props,n=t.isFetching,r=t.fetchError,i=t.siteId,c=t.allSelectedPackages,s=t.translate;if(r)return null;var o=n?[{},{},{}]:c;return a.a.createElement("div",null,a.a.createElement(he.a,{siteId:i}),a.a.createElement(G,{label:s("Packaging"),description:s("Add boxes, envelopes, and other packages you use most frequently")},a.a.createElement(C.a,{onClick:function(){e.props.onChange(),e.props.addPackage(i)},disabled:n},s("Add package"))),a.a.createElement(M.a,{className:"packages__packages"},this.renderListHeader(o),o.map(this.renderListItem),!n&&a.a.createElement(be.a,this.props)))}}]),t}(r.Component);Ce.propTypes={addPackage:I.a.func.isRequired,removePackage:I.a.func.isRequired,editPackage:I.a.func.isRequired,dismissModal:I.a.func.isRequired,onChange:I.a.func.isRequired,savePackage:I.a.func.isRequired,updatePackagesField:I.a.func.isRequired,toggleOuterDimensions:I.a.func.isRequired,setModalErrors:I.a.func.isRequired,showModal:I.a.bool,form:I.a.shape({packages:I.a.object,dimensionUnit:I.a.string,weightUnit:I.a.string,packageSchema:I.a.object,predefinedSchema:I.a.oneOfType([I.a.object,I.a.array])}).isRequired};var je=Object(g.b)(function(e){var t=Object(fe.a)(e),n=Object(Se.e)(e,t)||{};return{siteId:t,isFetching:!n.packages||n.isFetching,fetchError:Object(Se.g)(e,t),form:n,allSelectedPackages:Object(Se.b)(e,t)||[]}},function(e){return F()({},Object(h.b)(ve,e))})(Object(v.localize)(Ce)),Ne=n(111),Ie=n.n(Ne),ye=n(76),Re=n.n(ye),Pe=n(629),Me=n(562),ke=n(541),Te=n(545),Ae=function(e){var t=e.accountData,n=e.translate,r=e.errorNotice,i=e.successNotice,c=e.siteId,s=a.a.useState(!1),o=Re()(s,2),u=o[0],l=o[1],d=a.a.useState(!1),m=Re()(d,2),p=m[0],f=m[1],E=a.a.useState(t.id),_=Re()(E,2),O=_[0],b=_[1],g=a.a.useCallback(function(){l(!0)},[l]),h=a.a.useCallback(function(){l(!1)},[l]),v=a.a.useCallback(function(){(function(){var e=Ie()(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return f(!0),e.prev=1,e.next=4,ke.a(c,ke.e.shippingCarrierDelete(O));case 4:l(!1),i(n("Your carrier account was disconnected succesfully.")),b(null),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(1),r(n("There was an error trying to disconnect your carrier account"));case 12:f(!1);case 13:case"end":return e.stop()}},e,null,[[1,9]])}));return function(){return e.apply(this,arguments)}})()()},[l,r,i,f,c,b,O]),S=a.a.useMemo(function(){return[a.a.createElement(C.a,{compact:!0,primary:!0,disabled:p,onClick:h},n("Cancel")),a.a.createElement(C.a,{compact:!0,primary:!0,scary:!0,disabled:p,busy:p,onClick:v},n("Disconnect"))]},[h,v,p]);return a.a.createElement("div",{className:"carrier-accounts__list-item"},a.a.createElement("div",{className:"carrier-accounts__list-item-carrier-icon"},a.a.createElement(Pe.a,{carrier:{DhlExpressAccount:"dhlexpress",DhlEcsAccount:"dhlecommerce",DhlEcommerceAsiaAccount:"dhlecommerceasia",UpsAccount:"ups"}[t.type],size:18})),a.a.createElement("div",{className:"carrier-accounts__list-item-name"},a.a.createElement("span",null,t.carrier)),a.a.createElement("div",{className:"carrier-accounts__list-item-credentials"},a.a.createElement("span",null,O?t.account:null)),a.a.createElement("div",{className:"carrier-accounts__list-item-actions"},O?a.a.createElement(C.a,{onClick:g,compact:!0,scary:!0,borderless:!0},n("Disconnect")):a.a.createElement("a",{href:"admin.php?page=wc-settings&tab=shipping&section=woocommerce-services-settings&carrier=".concat(t.type),className:"button is-compact"},n("Connect"))),a.a.createElement(Me.a,{isVisible:u,additionalClassNames:"carrier-accounts__settings-cancel-dialog",onClose:h,buttons:S},a.a.createElement("div",{className:"carrier-accounts__settings-cancel-dialog-header"},a.a.createElement("h2",{className:"carrier-accounts__settings-cancel-dialog-title"},n("Disconnect your %(carrier_name)s account",{args:{carrier_name:t.carrier}})),a.a.createElement("button",{className:"carrier-accounts__settings-cancel-dialog-close-button",onClick:h},a.a.createElement(q.a,{icon:"cross"}))),a.a.createElement("p",{className:"carrier-accounts__settings-cancel-dialog-description"},n("This will remove the connection with %(carrier_name)s. All of your %(carrier_name)s account information will be deleted and you won\u2019t see %(carrier_name)s rates.",{args:{carrier_name:t.carrier}}))))};Ae.propTypes={errorNotice:I.a.func.isRequired,successNotice:I.a.func.isRequired,siteId:I.a.number.isRequired,accountData:I.a.shape({id:I.a.string,carrier:I.a.string.isRequired,account:I.a.string,type:I.a.string}).isRequired};var Le={errorNotice:Te.a,successNotice:Te.d},we=Object(h.d)(Object(g.b)(function(e){return{siteId:Object(fe.a)(e)}},Le),v.localize)(Ae),De=function(e){var t=e.translate,n=e.accounts,r=void 0===n?[]:n;return 0===r.length?null:a.a.createElement("div",null,a.a.createElement(G,{label:t("Carrier account"),description:t("Set up your own carrier account by adding your credentials here")}),a.a.createElement(M.a,{className:"carrier-accounts__list"},a.a.createElement("div",{className:"carrier-accounts__header"},a.a.createElement("div",{className:"carrier-accounts__header-icon"}),a.a.createElement("div",{className:"carrier-accounts__header-name"},t("Name")),Object(P.some)(r,"account")&&a.a.createElement("div",{className:"carrier-accounts__header-credentials"},t("Credentials")),a.a.createElement("div",{className:"carrier-accounts__header-actions"})),r.map(function(e,t){return a.a.createElement(we,{key:t,accountData:e})})))};De.propTypes={accounts:I.a.arrayOf(I.a.shape({id:I.a.string,carrier:I.a.string.isRequired,account:I.a.string,type:I.a.string}))};var xe=Object(v.localize)(De),We=n(788),Ue=Object(v.localize)(function(e){var t=e.translate;return a.a.createElement(a.a.Fragment,null,a.a.createElement("a",{className:"button is-compact",href:"admin.php?page=wc-settings&tab=shipping&section"},t("Add to shipping zones")),a.a.createElement(We.a,{position:"top left",text:t("To be displayed at checkout, this carrier must be added as a shipping method to selected shipping zones")},a.a.createElement("div",null,a.a.createElement(q.a,{icon:"help-outline",size:18}))))}),Ge=Object(v.localize)(function(e){return(0,e.translate)("Discounted %(carrierName)s shipping labels",{args:{carrierName:e.name}})}),Ve={wc_services_usps:function(e){var t=e.translate;return a.a.createElement("div",{className:"live-rates-carriers-list__element element-usps"},a.a.createElement("div",{className:"live-rates-carriers-list__icon"},a.a.createElement(Pe.a,{carrier:"usps",size:18})),a.a.createElement("div",{className:"live-rates-carriers-list__carrier"},t("USPS")),a.a.createElement("div",{className:"live-rates-carriers-list__features"},a.a.createElement("ul",null,a.a.createElement("li",null,t("Ship with the largest delivery network in the United States")),a.a.createElement("li",null,a.a.createElement(Ge,{name:t("USPS")})),a.a.createElement("li",null,t("Live rates for %(carrierName)s at checkout",{args:{carrierName:t("USPS")}})))),a.a.createElement("div",{className:"live-rates-carriers-list__actions"},a.a.createElement(Ue,null)))},wc_services_dhlexpress:function(e){var t=e.translate;return a.a.createElement("div",{className:"live-rates-carriers-list__element element-dhlexpress"},a.a.createElement("div",{className:"live-rates-carriers-list__icon"},a.a.createElement(Pe.a,{carrier:"dhlexpress",size:18})),a.a.createElement("div",{className:"live-rates-carriers-list__carrier"},t("DHL Express")),a.a.createElement("div",{className:"live-rates-carriers-list__features"},a.a.createElement("ul",null,a.a.createElement("li",null,t("Express delivery from the experts in international shipping")),a.a.createElement("li",null,a.a.createElement(Ge,{name:t("DHL Express")})),a.a.createElement("li",null,t("Live rates for %(carrierName)s at checkout",{args:{carrierName:t("DHL Express")}})))),a.a.createElement("div",{className:"live-rates-carriers-list__actions"},a.a.createElement(Ue,null)))}},He=Object(v.localize)(function(e){var t=e.translate,n=e.carrierIds;return a.a.createElement(M.a,{className:"live-rates-carriers-list__wrapper"},a.a.createElement("div",{className:"live-rates-carriers-list__heading"},a.a.createElement("div",{className:"live-rates-carriers-list__icon"}),a.a.createElement("div",{className:"live-rates-carriers-list__carrier"},t("Carrier")),a.a.createElement("div",{className:"live-rates-carriers-list__features"},t("Features")),a.a.createElement("div",{className:"live-rates-carriers-list__actions"})),n.map(function(e){var n=Ve[e];return n?a.a.createElement(n,{key:e,translate:t}):null}))}),Fe=["wc_services_usps","wc_services_dhlexpress"],ze=Object(v.localize)(function(e){var t=e.translate,n=e.carrierIds;return!1===n.some(function(e){return Fe.includes(e)})?null:a.a.createElement("div",null,a.a.createElement(G,{label:t("Live rates at checkout"),description:t("Show live rates directly on your store - never under or overcharge for shipping again")}),a.a.createElement(He,{carrierIds:n}))}),qe=function(e){var t=e.translate,n=e.data,r=e.errorNotice,i=e.successNotice,c=e.siteId,s=a.a.useState(n.is_active),o=Re()(s,2),u=o[0],l=o[1],d=a.a.useState(!1),m=Re()(d,2),p=m[0],f=m[1],E=[],_=!1;return n.usage_data.forEach(function(e,t){E.push(a.a.createElement("div",{key:t},e.label,": ",e.count,"/",e.limit)),_=_||e.count>e.limit}),a.a.createElement("div",{className:"subscriptions-usage__list-item"},a.a.createElement("div",{className:"subscriptions-usage__list-item-carrier-icon"},a.a.createElement(Pe.a,{carrier:function(e){var t=[[/^DHL/g,"dhlexpress"],[/^UPS/g,"ups"],[/^USPS/g,"usps"]],n=t.findIndex(function(t){return Re()(t,1)[0].test(e)});return n>-1?t[n][1]:""}(n.product_name),size:18})),a.a.createElement("div",{className:"subscriptions-usage__list-item-name"},a.a.createElement("span",null,n.product_name)),a.a.createElement("div",{className:R()("subscriptions-usage__list-item-usage",{"is-over-limit":_})},a.a.createElement("span",{className:"subscriptions-usage__list-item-usage-numbers"},E),a.a.createElement(We.a,{text:t("Your store is over the limit for rate calls this month and your account will be charged for overages. To prevent future overage charges you can upgrade your plan.")},a.a.createElement("span",{className:"subscriptions-usage__list-item-usage-icon"},a.a.createElement(q.a,{icon:"info-outline",size:18})))),a.a.createElement("div",{className:"subscriptions-usage__list-item-actions"},u?a.a.createElement("a",{href:"https://woocommerce.com/my-account/my-subscriptions/",className:"button is-compact"},t("Manage")):a.a.createElement(C.a,{onClick:function(){!function(){var e=Ie()(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return f(!0),e.prev=1,e.next=4,ke.c(c,ke.e.subscriptionActivate(n.product_key));case 4:l(!0),i(t("Your subscription was succesfully activated.")),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),r(t("There was an error trying to activate your subscription."));case 11:f(!1);case 12:case"end":return e.stop()}},e,null,[[1,8]])}));return function(){return e.apply(this,arguments)}}()()},disabled:p,busy:p,compact:!0},t("Activate"))))};qe.propTypes={errorNotice:I.a.func.isRequired,successNotice:I.a.func.isRequired,siteId:I.a.number.isRequired,data:I.a.shape({product_name:I.a.string.isRequired,is_active:I.a.bool.isRequired,usage_data:I.a.arrayOf(I.a.shape({limit:I.a.number,count:I.a.number,label:I.a.string}))}).isRequired};var Be={errorNotice:Te.a,successNotice:Te.d},Ze=Object(h.d)(Object(g.b)(function(e){return{siteId:Object(fe.a)(e)}},Be),v.localize)(qe),Ke=function(e){var t=e.translate,n=e.subscriptions,r=void 0===n?[]:n;return 0===r.length?null:a.a.createElement("div",null,a.a.createElement(G,{label:t("Shipping method"),description:t("View and manage your subscription usage")}),a.a.createElement(M.a,{className:"subscriptions-usage__list"},a.a.createElement("div",{className:"subscriptions-usage__header"},a.a.createElement("div",{className:"subscriptions-usage__header-icon"}),a.a.createElement("div",{className:"subscriptions-usage__header-name"},t("Name")),a.a.createElement("div",{className:"subscriptions-usage__header-usage"},t("Usage")),a.a.createElement("div",{className:"subscriptions-usage__header-actions"})),r.map(function(e,t){return a.a.createElement(Ze,{key:t,data:e})})))};Ke.propTypes={subscriptions:I.a.arrayOf(I.a.shape({product_name:I.a.string.isRequired,usage_limit:I.a.number,usage_count:I.a.number}))};var Qe=Object(v.localize)(Ke),Ye=n(614),$e=n(599),Xe=n(578),Je=n(537),et=n(615),tt=/(?:[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/,nt=/^\d{5}$/,rt=/^[a-zA-Z0-9]{6}$/,at=/^([a-zA-Z0-9]{9}|[a-zA-Z0-9]{13})$/,it=/^\d{10}$/,ct=/^(19|20)\d\d-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])$/,st=/^(?:(?:(?:https?|ftp):)?\/\/)*(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[\/?#]\S*)?$/i,ot=Object(v.localize)(function(e){var t=e.isVisible,n=e.onCancel,i=e.onConfirm,c=e.translate,s=Object(r.useMemo)(function(){return[a.a.createElement(C.a,{compact:!0,onClick:n,key:"cancel"},c("Cancel")),a.a.createElement(C.a,{compact:!0,primary:!0,scary:!0,onClick:i,key:"ok"},c("Ok"))]},[n,i,c]);return a.a.createElement(Me.a,{isVisible:t,additionalClassNames:"carrier-accounts__settings-cancel-dialog",onClose:n,buttons:s},a.a.createElement("div",{className:"carrier-accounts__settings-cancel-dialog-header"},a.a.createElement("h2",{className:"carrier-accounts__settings-cancel-dialog-title"},c("Cancel connection")),a.a.createElement("button",{className:"carrier-accounts__settings-cancel-dialog-close-button",onClick:n},a.a.createElement(q.a,{icon:"cross"}))),a.a.createElement("p",{className:"carrier-accounts__settings-cancel-dialog-description"},c("This action will delete any information entered on the form.")))}),ut=Object(h.d)(Object(g.b)(function(e,t){return{stateNames:Object(Je.k)(e,t.countryValue)}}),v.localize)(function(e){var t=e.onUpdate,n=e.error,i=e.stateNames,c=e.translate,s=e.value,o=Object(r.useMemo)(function(){return i?F()({"":c("Select one\u2026")},i):i},[i,c]);return o?a.a.createElement(Ye.a,{id:"state",title:c("State"),value:s,valuesMap:o,updateValue:t,error:n}):a.a.createElement(Xe.a,{id:"state",title:c("State"),updateValue:t,error:n})}),lt=function(e){var t=e.translate,n=e.errorNotice,i=e.successNotice,c=e.countryNames,s=e.siteId,o=Object(r.useState)(!1),u=Re()(o,2),l=u[0],d=u[1],m=Object(r.useState)(!1),p=Re()(m,2),f=p[0],E=p[1],_=Object(r.useState)(!1),O=Re()(_,2),g=O[0],h=O[1],v=Object(r.useState)({country:"US"}),S=Re()(v,2),j=S[0],N=S[1],I=function(e,t,n){var r={},a=["account_number","name","street1","city","state","country","postal_code","phone","email","title","website",t&&"invoice_number",t&&"invoice_date"].filter(Boolean),i=!0,c=!1,s=void 0;try{for(var o,u=a[Symbol.iterator]();!(i=(o=u.next()).done);i=!0){var l=o.value,d=e[l];(!d||"string"===typeof d&&""===d.trim())&&(r[l]=n("This field is required"))}}catch(m){c=!0,s=m}finally{try{i||null==u.return||u.return()}finally{if(c)throw s}}return e.account_number&&!e.account_number.match(rt)&&(r.account_number=n("The UPS account number needs to be 6 letters and digits in length")),e.phone&&!e.phone.match(it)&&(r.phone=n("The phone number needs to be 10 digits in length")),"US"===e.country&&e.postal_code&&!e.postal_code.match(nt)&&(r.postal_code=n("The ZIP/Postal code needs to be 5 digits in length")),e.email&&!e.email.match(tt)&&(r.email=n("The email format is not valid")),e.website&&!e.website.match(st)&&(r.website=n("The company website format is not valid")),t&&e.invoice_number&&!e.invoice_number.match(at)&&(r.invoice_number=n("The invoice number needs to be 9 or 13 letters and digits in length")),t&&e.invoice_date&&!e.invoice_date.match(ct)&&(r.invoice_date=n("The date must be a valid date in the format YYYY-MM-DD")),r}(j,f,t),y=function(e){return j[e]?Object(et.a)(j[e]):""},R=Object(r.useCallback)(function(e,t){var n=t.currentTarget.id;N(function(t){return F()({},t,b()({},n,e))})},[N]),P=Object(r.useCallback)(function(){(function(){var e=Ie()(regeneratorRuntime.mark(function e(){var r,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return d(!0),e.prev=1,r=F()({},j,{type:"UpsAccount"}),f&&(delete j.invoice_number,delete j.invoice_date,delete j.invoice_amount,delete j.invoice_currency,delete j.invoice_control_id),e.next=6,ke.c(s,ke.e.shippingCarrier(),r);case 6:if(e.sent.success){e.next=9;break}throw new Error;case 9:i(t("Your carrier account was connected successfully.")),(a=new URL(window.location.href)).searchParams.delete("carrier"),window.onbeforeunload=null,window.location.href=a.href,e.next=20;break;case 16:e.prev=16,e.t0=e.catch(1),d(!1),n(t("There was an error connecting to your %(carrierName)s account. Please check that all of the information entered matches your %(carrierName)s account and try to connect again.",{args:{carrierName:"UPS"}}));case 20:case"end":return e.stop()}},e,null,[[1,16]])}));return function(){return e.apply(this,arguments)}})()()},[d,n,i,t,j,f]),M=Object(r.useCallback)(function(){E(function(e){return!e})},[E]),k=Object(r.useCallback)(function(){h(!1)},[h]),T=Object(r.useCallback)(function(){var e=new URL(window.location.href);e.searchParams.delete("carrier"),window.onbeforeunload=null,window.location.href=e.href},[]),L=Object(r.useCallback)(function(){h(!0)},[h]);return a.a.createElement("div",{className:"carrier-accounts__settings-container"},a.a.createElement("div",{className:"carrier-accounts__settings"},a.a.createElement("div",{className:"carrier-accounts__settings-info"},a.a.createElement("h4",{className:"carrier-accounts__settings-subheader-above-description"},t("Connect your UPS account")),a.a.createElement("p",{className:"carrier-accounts__settings-subheader-description"},t("Set up your own UPS carrier account to compare rates and print labels from multiple carriers in WooCommerce Shipping. Learn more about adding {{a}}carrier accounts{{/a}}.",{components:{a:a.a.createElement("a",{href:"https://docs.woocommerce.com/document/productid-type-permalinks/using-your-own-ups-account-in-woocommerce-shipping/"})}})),a.a.createElement("p",{className:"carrier-accounts__settings-subheader-description"},t("If you need a UPS account number, go to {{a}}UPS.com{{/a}} to create a new account.",{components:{a:a.a.createElement("a",{href:"https://ups.com/"})}}))),a.a.createElement("div",{className:"carrier-accounts__settings-form"},a.a.createElement(A.a,null,a.a.createElement("h4",{className:"carrier-accounts__settings-subheader"},t("General information")),a.a.createElement("p",{className:"carrier-accounts__settings-subheader-description"},t("This is the account number and address from your UPS profile"))),a.a.createElement(A.a,{className:"carrier-accounts__settings-account-number"},a.a.createElement(Xe.a,{id:"account_number",title:t("Account number"),updateValue:R,error:"string"===typeof j.account_number?I.account_number:void 0})),a.a.createElement(A.a,{className:"carrier-accounts__settings-address"},a.a.createElement(Xe.a,{id:"name",title:t("Name"),updateValue:R,error:"string"===typeof j.name?I.name:void 0}),a.a.createElement(Xe.a,{id:"street1",title:t("Address"),updateValue:R,error:"string"===typeof j.street1?I.street1:void 0}),a.a.createElement("div",{className:"carrier-accounts__settings-two-columns"},a.a.createElement(Xe.a,{id:"street2",title:t("Address 2 (optional)"),updateValue:R,error:"string"===typeof j.street2?I.street2:void 0}),a.a.createElement(Xe.a,{id:"city",title:t("City"),updateValue:R,error:"string"===typeof j.city?I.city:void 0})),a.a.createElement("div",{className:"carrier-accounts__settings-two-columns"},a.a.createElement(ut,{countryValue:j.country,value:y("state"),onUpdate:R,error:"string"===typeof j.state?I.state:void 0}),a.a.createElement(Ye.a,{id:"country",title:t("Country"),value:y("country"),valuesMap:c,updateValue:R,error:"string"===typeof j.country?I.country:void 0})),a.a.createElement("div",{className:"carrier-accounts__settings-two-columns"},a.a.createElement(Xe.a,{id:"postal_code",title:t("ZIP/Postal code"),updateValue:R,error:"string"===typeof j.postal_code?I.postal_code:void 0}),a.a.createElement(Xe.a,{id:"phone",title:t("Phone"),updateValue:R,error:"string"===typeof j.phone?I.phone:void 0})),a.a.createElement(Xe.a,{id:"email",title:t("Email"),updateValue:R,error:"string"===typeof j.email?I.email:void 0})),a.a.createElement(A.a,{className:"carrier-accounts__settings-company-info"},a.a.createElement("div",{className:"carrier-accounts__settings-header"},a.a.createElement("h4",{className:"carrier-accounts__settings-subheader"},t("Company information")),a.a.createElement("p",{className:"carrier-accounts__settings-subheader-description"},t("This is the company info you used to create your UPS account"))),a.a.createElement(Xe.a,{id:"company",title:t("Company name"),updateValue:R,error:"string"===typeof j.company?I.company:void 0}),a.a.createElement("div",{className:"carrier-accounts__settings-two-columns"},a.a.createElement(Xe.a,{id:"title",title:t("Job title"),updateValue:R,error:"string"===typeof j.title?I.title:void 0}),a.a.createElement(Xe.a,{id:"website",title:t("Company website"),updateValue:R,error:"string"===typeof j.website?I.website:void 0}))),a.a.createElement(A.a,{className:"carrier-accounts__settings-ups-info"},a.a.createElement("div",{className:"carrier-accounts__settings-header"},a.a.createElement("h4",{className:"carrier-accounts__settings-subheader"},t("UPS account information")),a.a.createElement($e.a,{id:"enable_ups_invoice_fields",checked:f,onChange:M}),a.a.createElement("span",null,t("I have been issued an invoice from UPS within the past 90 days"))),f&&a.a.createElement("div",{className:"carrier-accounts__settings-ups-invoice"},a.a.createElement("div",{className:"carrier-accounts__settings-two-columns"},a.a.createElement(Xe.a,{id:"invoice_number",title:t("UPS invoice number"),updateValue:R,error:"string"===typeof j.invoice_number?I.invoice_number:void 0}),a.a.createElement(Xe.a,{id:"invoice_date",title:t("UPS invoice date"),updateValue:R,error:"string"===typeof j.invoice_date?I.invoice_date:void 0,placeholder:"YYYY-MM-DD"})),a.a.createElement("div",{className:"carrier-accounts__settings-two-columns"},a.a.createElement(Xe.a,{id:"invoice_amount",title:t("UPS invoice amount"),updateValue:R,error:"string"===typeof j.invoice_amount?I.invoice_amount:void 0}),a.a.createElement(Xe.a,{id:"invoice_currency",title:t("UPS invoice currency"),updateValue:R,error:"string"===typeof j.invoice_currency?I.invoice_currency:void 0})),a.a.createElement(Xe.a,{id:"invoice_control_id",title:t("UPS invoice control id"),updateValue:R,error:"string"===typeof j.invoice_control_id?I.invoice_control_id:void 0}))),a.a.createElement(A.a,{className:"carrier-accounts__settings-actions"},a.a.createElement(C.a,{compact:!0,primary:!0,onClick:P,disabled:Object.keys(I).length>0||l,busy:l},t("Connect")),a.a.createElement(C.a,{compact:!0,onClick:L},t("Cancel")))),a.a.createElement(ot,{isVisible:g,onConfirm:T,onCancel:k})))};lt.propTypes={siteId:I.a.number,countryNames:I.a.object,translate:I.a.func,errorNotice:I.a.func,successNotice:I.a.func};var dt={errorNotice:Te.a,successNotice:Te.d},mt=Object(h.d)(Object(g.b)(function(e){return{countryNames:Object(Je.c)(e),siteId:Object(fe.a)(e)}},dt),v.localize)(lt),pt=function(e){var t=e.visibility,n=e.label,i=e.id,c=e.value,s=e.onChange,o=Object(r.useCallback)(function(){s(i,!c)},[i,c,s]),u=Object(r.useCallback)(function(e){s(i,e)},[i,c,s]);switch(t){case"select":case"checkbox":return a.a.createElement(a.a.Fragment,null,a.a.createElement($e.a,{id:i,onChange:o,checked:c||!1}),a.a.createElement("label",{htmlFor:i},a.a.createElement("span",null,n)));case"invisible":case"masked":case"readonly":case"password":case"visible":default:return a.a.createElement(Xe.a,{id:i,title:n,updateValue:u})}},ft=function(e){var t=e.translate,n=e.siteId,i=e.carrierType,c=e.errorNotice,s=e.successNotice,o=e.carrierName,u=e.carrierDescription,l=e.registrationFields,d=Object(r.useState)({}),m=Re()(d,2),p=m[0],f=m[1],E=Object(r.useState)(!1),_=Re()(E,2),O=_[0],g=_[1],h=Object(r.useCallback)(function(e,t){f(function(n){return F()({},n,b()({},e,t))})},[f]),v=Object(r.useCallback)(function(){(function(){var e=Ie()(regeneratorRuntime.mark(function e(){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return g(!0),e.prev=1,e.next=4,ke.c(n,ke.e.shippingCarrier(),F()({},p,{type:i}));case 4:if(e.sent.success){e.next=7;break}throw new Error;case 7:s(t("Your carrier account was connected successfully.")),(r=new URL(window.location.href)).searchParams.delete("carrier"),window.onbeforeunload=null,window.location.href=r.href,e.next=17;break;case 14:e.prev=14,e.t0=e.catch(1),c(t("There was an error connecting to your %(carrierName)s account. Please check that all of the information entered matches your %(carrierName)s account and try to connect again.",{args:{carrierName:o}}));case 17:g(!1);case 18:case"end":return e.stop()}},e,null,[[1,14]])}));return function(){return e.apply(this,arguments)}})()()},[O,g,n,i,o,p,c,t]),S=Object(r.useCallback)(function(){history.back()},[]);return a.a.createElement("div",{className:"carrier-accounts__settings-container"},a.a.createElement("div",{className:"carrier-accounts__settings"},a.a.createElement("div",{className:"carrier-accounts__settings-info"},a.a.createElement("h4",{className:"carrier-accounts__settings-subheader-above-description"},t("Connect your %(carrierName)s account",{args:{carrierName:o}})),a.a.createElement("p",{className:"carrier-accounts__settings-subheader-description"},u||t("Set up your own carrier account to compare rates and print labels from multiple carriers in WooCommerce Shipping. Learn more about adding {{a}}carrier accounts{{/a}}.",{components:{a:a.a.createElement("a",{href:"https://docs.woocommerce.com/document/using-your-own-carrier-account-in-woocommerce-shipping"})}}))),a.a.createElement("div",{className:"carrier-accounts__settings-form"},a.a.createElement(A.a,null,a.a.createElement("h4",{className:"carrier-accounts__settings-subheader"},t("General Information"))),a.a.createElement(A.a,null,l&&Object.entries(l).map(function(e){var t=Re()(e,2),n=t[0],r=t[1];return a.a.createElement(pt,{key:n,id:n,visibility:r.visibility,label:r.label,value:p[n],onChange:h})})),a.a.createElement(A.a,{className:"carrier-accounts__settings-actions"},a.a.createElement(C.a,{compact:!0,primary:!0,onClick:v,disabled:O},t("Connect")),a.a.createElement(C.a,{compact:!0,onClick:S},t("Cancel"))))))},Et={errorNotice:Te.a,successNotice:Te.d};ft.propTypes={errorNotice:I.a.func,successNotice:I.a.func,carrierType:I.a.string,carrierName:I.a.string,carrierDescription:I.a.string,registrationFields:I.a.object,siteId:I.a.number,translate:I.a.func};var _t=Object(h.d)(Object(g.b)(function(e){return{siteId:Object(fe.a)(e)}},Et),v.localize)(ft),Ot=function(e){var t=e.translate,n=Object(r.useState)([]),i=Re()(n,2),c=i[0],s=i[1];if(Object(r.useEffect)(function(){(function(){var t=Ie()(regeneratorRuntime.mark(function t(){var n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,ke.b(e.siteId,ke.e.shippingCarrierTypes());case 2:n=t.sent,s(n.carriers);case 4:case"end":return t.stop()}},t)}));return function(){return t.apply(this,arguments)}})()()},[e.siteId,s]),!c||0===c.length)return a.a.createElement("div",null,t("Loading"),"...");var o=c.filter(function(t){return t.type===e.carrier}),u=Re()(o,1)[0];return u?a.a.createElement("div",null,a.a.createElement(_t,{carrierType:u.type,carrierName:u.name,carrierDescription:u.description,registrationFields:u.fields})):a.a.createElement("div",null,t("%(carrierName)s not supported.",{args:{carrierName:e.carrier}}))};Ot.propTypes={carrier:I.a.string.isRequired,siteId:I.a.number};var bt=Object(g.b)(function(e){return{siteId:Object(fe.a)(e)}})(Object(v.localize)(Ot)),gt=n(668),ht=n(645),vt=function(e){function t(e){var n;return c()(this,t),n=l()(this,m()(t).call(this,e)),b()(f()(n),"onChange",function(){n.setState({pristine:!1})}),b()(f()(n),"onSaveSuccess",function(){var e=n.props,t=e.translate,r=e.orderId,a=e.orderHref,i=e.paymentMethodSelected,c=a&&i?{button:t("Return to Order #%(orderId)s",{args:{orderId:r}}),href:a}:{duration:5e3};return n.setState({pristine:!0}),n.props.successNotice(t("Your shipping settings have been saved."),c)}),b()(f()(n),"onSaveFailure",function(){var e=n.props.translate;return n.props.errorNotice(e("Unable to save your shipping settings. Please try again."))}),b()(f()(n),"onSaveChanges",function(){n.props.createWcsShippingSaveActionList(n.onSaveSuccess,n.onSaveFailure)}),n.state={pristine:!0},n}return _()(t,e),o()(t,[{key:"render",value:function(){var e=this.props,t=e.carrier,n=e.carrierAccounts,r=e.liveRatesTypes,i=e.subscriptions,c=e.isSaving,s=e.translate;return t?"UpsAccount"===t?a.a.createElement("div",null,a.a.createElement(j.a,{id:"notices",notices:Oe.a.list}),a.a.createElement(mt,null)):a.a.createElement("div",null,a.a.createElement(j.a,{id:"notices",notices:Oe.a.list}),a.a.createElement(bt,{carrier:t})):a.a.createElement("div",null,a.a.createElement(j.a,{id:"notices",notices:Oe.a.list}),a.a.createElement(_e,{onChange:this.onChange}),a.a.createElement(je,{onChange:this.onChange}),a.a.createElement(ze,{carrierIds:r}),a.a.createElement(xe,{accounts:n}),a.a.createElement(Qe,{subscriptions:i}),a.a.createElement(C.a,{primary:!0,onClick:this.onSaveChanges,busy:c,disabled:c},s("Save changes")),a.a.createElement(gt.a,{isChanged:!this.state.pristine}))}}]),t}(r.Component),St=Object(g.b)(function(e){var t=Object(oe.g)(e),n=Object(Se.e)(e);return{isSaving:t.isSaving||n.isSaving,paymentMethodSelected:Boolean(Object(oe.n)(e))}},function(e){return Object(h.b)({createWcsShippingSaveActionList:ht.a,errorNotice:Te.a,successNotice:Te.d},e)})(Object(v.localize)(vt)),Ct=n(650),jt=n(649),Nt=n(591),It=n(655),yt=n(632),Rt=n(656),Pt=n(607),Mt=n(116),kt=n(46);t.default=function(e){var t=e.order_id,n=e.order_href,r=e.carrier,i=e.continents,c=e.carrier_accounts,s=e.live_rates_types,o=e.subscriptions;return{getReducer:function(){return Object(kt.a)({extensions:Object(kt.a)({woocommerce:Object(kt.a)({woocommerceServices:Object(kt.a)({1:Object(kt.a)({packages:jt.a,labelSettings:Ct.a})}),sites:Object(kt.a)({1:Object(kt.a)({data:Object(kt.a)({locations:Rt.a})})})})}),notices:Nt.a,ui:function(){return{selectedSiteId:1}}})},getInitialState:function(){return{extensions:{woocommerce:{sites:{1:{data:{locations:i}}}}}}},getStateForPersisting:function(e){return delete e.notices,e},getStateKey:function(){return"wcs-account-settings"},getMiddlewares:function(){return[Object(Mt.b)(Object(Pt.a)(yt.a,It.a))]},View:function(){return a.a.createElement(St,{orderId:t,orderHref:n,carrier:r,carrierAccounts:c,liveRatesTypes:s,subscriptions:o})}}}}}]);
dist/chunks/{302365b06fa4a405a0ce.css → 770d88e09267ea1b3e21.css} RENAMED
File without changes
dist/chunks/{302365b06fa4a405a0ce.min.js → 770d88e09267ea1b3e21.min.js} RENAMED
@@ -1 +1 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[138],{629:function(e,t,n){"use strict";var i=n(107),o=n.n(i),r=n(108),a=n.n(r),s=n(528),l=n.n(s),c=n(527),u=n.n(c),p=n(529),d=n.n(p),m=n(34),h=n.n(m),f=n(10),b=n.n(f),g=n(12),v=n.n(g),y=n(526),w=n.n(y),k=n(1),E=n(534),C=n.n(E),R=(n(677),function(e){function t(){return o()(this,t),l()(this,u()(t).apply(this,arguments))}return d()(t,e),a()(t,[{key:"render",value:function(){var e=w()("external-link",this.props.className,{"icon-first":!!this.props.showIconFirst},{"has-icon":!!this.props.icon}),t=Object(k.assign)({},Object(k.omit)(this.props,"icon","iconSize","showIconFirst","iconClassName"),{className:e,rel:"external"});t.target&&(t.rel=t.rel.concat(" noopener noreferrer"));var n=b.a.createElement(C.a,{className:this.props.iconClassName,icon:"external",size:this.props.iconSize});return b.a.createElement("a",t,this.props.icon&&this.props.showIconFirst&&n,this.props.children,this.props.icon&&!this.props.showIconFirst&&n)}}]),t}(f.Component));h()(R,"defaultProps",{iconSize:18,showIconFirst:!1}),h()(R,"propTypes",{className:v.a.string,href:v.a.string,onClick:v.a.func,icon:v.a.bool,iconSize:v.a.number,target:v.a.string,showIconFirst:v.a.bool,iconClassName:v.a.string}),t.a=R},677:function(e,t,n){},679:function(e,t,n){"use strict";var i=n(107),o=n.n(i),r=n(108),a=n.n(r),s=n(528),l=n.n(s),c=n(527),u=n.n(c),p=n(531),d=n.n(p),m=n(529),h=n.n(m),f=n(34),b=n.n(f),g=n(12),v=n.n(g),y=n(10),w=n.n(y),k=n(77),E=n.n(k),C=n(109),R=n(47),I=n.n(R),N=n(526),D=n.n(N),_=n(684),O=n.n(_),P=n(1),x=n(641),j=n(76),T=n.n(j),q=n(700),L=n.n(q),S=I()("calypso:popover:util");function M(){var e={};return e.top=window.scrollY,e.left=window.scrollX,e.width=window.innerWidth,e.height=window.innerHeight,e.right=e.left+e.width,e.bottom=e.top+e.height,S("viewport: %o",e),e}var z={top:"bottom",bottom:"top",left:"right",right:"left"},A={top:"right",left:"top",bottom:"left",right:"bottom"},V=M();function U(){V=M()}var B=!1,F=function(){if(B)return S("window events already bound");B=!0,S("bind handlers to `resize` and `scroll` events"),window.addEventListener("resize",U,!0),window.addEventListener("scroll",U,!0)},H=function(){if(!B)return S("window events are not bound");B=!1,S("unbind handlers to `resize` and `scroll` events"),window.removeEventListener("resize",U,!0),window.removeEventListener("scroll",U,!0)},K=function(e,t,n){var i=L()(n),o=t.clientHeight,r=t.clientWidth,a={top:i.top-o,bottom:V.height-i.bottom-o,left:i.left-r,right:V.width-i.right-r},s=e.split(/\s+/),l=T()(s,1)[0],c=T()(s,2)[1],u=function(e,t){for(var n,i=[e,z[e],A[e],z[A[e]]],o=-1/0,r=0,a=i.length;r<a;r++){var s=i[r],l=t[s];if(l>0)return s;l>o&&(o=l,n=e)}return n}(l,a);return c!==u&&c!==z[u]||(c=null),function(e,t,n,i,o,r){for(var a,s="top"===e||"bottom"===e,l=t?[s?"".concat(e," ").concat(t):"".concat(t," ").concat(e),e,s?"".concat(e," ").concat(z[t]):"".concat(z[t]," ").concat(e)]:[e,s?"".concat(e," ").concat(A[e]):"".concat(A[e]," ").concat(e),s?"".concat(e," ").concat(z[A[e]]):"".concat(z[A[e]]," ").concat(e)],c=0,u=o*r,p=0,d=l.length;p<d;p++){var m=l[p],h=W(m,n,i),f=h.left+o,b=h.top+r,g=Math.min(h.top<V.top?b-V.top:V.bottom-h.top,r),v=Math.min(h.left<V.left?f-V.left:V.right-h.left,o),y=v*g;if(y===u)return m;y>c&&(c=y,a=m)}return a}(u,c,t,n,r,o)||e};function W(e,t,n,i){var o=L()(t);if(!o)throw new Error("could not get bounding client rect of Tip element");var r=o.width,a=o.height,s=L()(n);if(!s)throw new Error("could not get bounding client rect of `target`");var l=s.width,c=s.height,u=function(e,t){var n=t.body||t.getElementsByTagName("body")[0],i=t.documentElement||n.parentNode,o=i.clientTop||n.clientTop||0,r=i.clientLeft||n.clientLeft||0,a=window.pageYOffset||i.scrollTop,s=window.pageXOffset||i.scrollLeft;return{top:e.top+a-o,left:e.left+s-r}}(s,document);if(!u)throw new Error("could not determine page offset of `target`");var p={};switch(e){case"top":p={top:u.top-a,left:i&&i.left?u.left+i.left:u.left+l/2-r/2};break;case"bottom":p={top:u.top+c,left:i&&i.left?u.left+i.left:u.left+l/2-r/2};break;case"right":p={top:u.top+c/2-a/2,left:u.left+l};break;case"left":p={top:u.top+c/2-a/2,left:u.left-r};break;case"top left":p={top:u.top-a,left:u.left+l/2-r+15};break;case"top right":p={top:u.top-a,left:u.left+l/2-15};break;case"bottom left":p={top:u.top+c,left:u.left+l/2-r+15};break;case"bottom right":p={top:u.top+c,left:u.left+l/2-15};break;case"left top":p={top:u.top+c/2-a,left:u.left-r};break;case"left bottom":p={top:u.top+c/2,left:u.left-r};break;case"right top":p={top:u.top+c/2-a,left:u.left+l};break;case"right bottom":p={top:u.top+c/2,left:u.left+l};break;default:throw new Error('invalid position "'.concat(e,'"'))}return p}var Y=function(){},J=I()("calypso:popover"),X=new Set,G=function(e){function t(e){var n;return o()(this,t),n=l()(this,u()(t).call(this,e)),b()(d()(n),"isUpdatingPosition",!1),n.setPopoverId(e.id),n.setDOMBehavior=n.setDOMBehavior.bind(d()(n)),n.setPosition=n.setPosition.bind(d()(n)),n.onClickout=n.onClickout.bind(d()(n)),n.onKeydown=n.onKeydown.bind(d()(n)),n.onWindowChange=n.onWindowChange.bind(d()(n)),n.state={show:e.isVisible,left:-99999,top:-99999,positionClass:n.getPositionClass(e.position)},n}return h()(t,e),a()(t,[{key:"componentDidMount",value:function(){this.state.show&&(this.bindEscKeyListener(),this.bindDebouncedReposition(),F())}},{key:"componentWillReceiveProps",value:function(e){if(this.domContext=E.a.findDOMNode(e.context),!e.isVisible)return null;this.setPosition()}},{key:"componentDidUpdate",value:function(e,t){var n=this,i=this.props.isVisible;return!t.show&&this.state.show&&(this.bindEscKeyListener(),this.bindDebouncedReposition(),F()),i!==e.isVisible&&(i?this.show():this.hide()),this.domContainer&&this.domContext&&i?void(this.isUpdatingPosition||(this.debug("requesting to update position after render completes"),requestAnimationFrame(function(){X.has(n.id)&&n.domContainer&&n.domContext&&i?(n.setPosition(),n.isUpdatingPosition=!1):n.isUpdatingPosition=!1}),this.isUpdatingPosition=!0)):null}},{key:"componentWillUnmount",value:function(){this.debug("unmounting .... "),this.unbindClickoutHandler(),this.unbindDebouncedReposition(),this.unbindEscKeyListener(),H(),X.delete(this.id),J("current popover instances: ",X.size)}},{key:"bindEscKeyListener",value:function(){if(!this.props.closeOnEsc)return null;this.debug("adding escKey listener ..."),document.addEventListener("keydown",this.onKeydown,!0)}},{key:"unbindEscKeyListener",value:function(){if(!this.props.closeOnEsc)return null;this.debug("unbinding `escKey` listener ..."),document.removeEventListener("keydown",this.onKeydown,!0)}},{key:"onKeydown",value:function(e){if(27!==e.keyCode)return null;this.close(!0)}},{key:"bindClickoutHandler",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.domContainer;return e?this._clickoutHandlerReference?(this.debug("clickout event already bound"),null):(this.debug("binding `clickout` event"),void(this._clickoutHandlerReference=O()(e,this.onClickout))):(this.debug("no element to bind clickout "),null)}},{key:"unbindClickoutHandler",value:function(){this._clickoutHandlerReference&&(this.debug("unbinding `clickout` listener ..."),this._clickoutHandlerReference(),this._clickoutHandlerReference=null)}},{key:"onClickout",value:function(e){var t=this.domContext&&this.domContext.contains&&!this.domContext.contains(e.target);if(this.props.ignoreContext&&t){var n=E.a.findDOMNode(this.props.ignoreContext);t=t&&n&&n.contains&&!n.contains(e.target)}t&&this.close()}},{key:"bindDebouncedReposition",value:function(){window.addEventListener("scroll",this.onWindowChange,!0),window.addEventListener("resize",this.onWindowChange,!0)}},{key:"unbindDebouncedReposition",value:function(){this.willReposition&&(window.cancelAnimationFrame(this.willReposition),this.willReposition=null),window.removeEventListener("scroll",this.onWindowChange,!0),window.removeEventListener("resize",this.onWindowChange,!0),this.debug("unbinding `debounce reposition` ...")}},{key:"onWindowChange",value:function(){this.willReposition=window.requestAnimationFrame(this.setPosition)}},{key:"setDOMBehavior",value:function(e){if(!e)return this.unbindClickoutHandler(),null;this.debug("setting DOM behavior"),this.bindClickoutHandler(e),this.domContainer=e,this.domContext=E.a.findDOMNode(this.props.context),this.setPosition()}},{key:"getPositionClass",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.position;return"is-".concat(e.replace(/\s+/g,"-"))}},{key:"adjustRtlPosition",value:function(e){if(this.props.isRtl)switch(e){case"top right":case"right top":return"top left";case"right":return"left";case"bottom right":case"right bottom":return"bottom left";case"bottom left":case"left bottom":return"bottom right";case"left":return"right";case"top left":case"left top":return"top right"}return e}},{key:"computePosition",value:function(){if(!this.props.isVisible)return null;var e=this.domContainer,t=this.domContext,n=this.props,i=n.position,o=n.relativePosition;if(!e||!t)return this.debug("[WARN] no DOM elements to work"),null;var r=i;this.debug("position: %o",r),this.props.autoRtl&&(r=this.adjustRtlPosition(r),this.debug("RTL adjusted position: %o",r)),this.props.autoPosition&&(r=K(r,e,t),this.debug("suggested position: %o",r));var a=Object.assign({},function(e,t){var n=L()(t).width;return e.left=Math.max(0,Math.min(e.left,V.width-n)),e}(W(r,e,t,o),e),{positionClass:this.getPositionClass(r)});return this.debug("updating reposition: ",a),a}},{key:"debug",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];J.apply(void 0,["[%s] ".concat(e),this.id].concat(n))}},{key:"setPopoverId",value:function(e){this.id=e||"pop__".concat(Object(P.uniqueId)()),X.add(this.id),this.debug("creating ..."),J("current popover instances: ",X.size)}},{key:"setPosition",value:function(){var e;if(this.debug("updating position"),!(e=this.props.customPosition?Object.assign({positionClass:this.getPositionClass(this.constructor.defaultProps.position)},this.props.customPosition):this.computePosition()))return null;this.willReposition=null,this.setState(e)}},{key:"getStylePosition",value:function(){var e=this.state;return{left:e.left,top:e.top}}},{key:"show",value:function(){var e=this;if(!this.props.showDelay)return this.setState({show:!0}),null;this.debug("showing in %o","".concat(this.props.showDelay,"ms")),this.clearShowTimer(),this._openDelayTimer=setTimeout(function(){e.setState({show:!0})},this.props.showDelay)}},{key:"hide",value:function(){this.unbindClickoutHandler(),this.unbindDebouncedReposition(),this.unbindEscKeyListener(),H(),this.setState({show:!1}),this.clearShowTimer()}},{key:"clearShowTimer",value:function(){if(!this._openDelayTimer)return null;clearTimeout(this._openDelayTimer),this._openDelayTimer=null}},{key:"close",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.props.isVisible)return this.debug("popover should be already closed"),null;this.props.onClose(e)}},{key:"render",value:function(){if(!this.state.show)return this.debug("is hidden. return no render"),null;if(!this.props.context)return this.debug("No `context` to tie. return no render"),null;var e=D()("popover",this.props.className,this.state.positionClass);return this.debug("rendering ..."),w.a.createElement(x.a,{className:this.props.rootClassName},w.a.createElement("div",{style:this.getStylePosition(),className:e},w.a.createElement("div",{className:"popover__arrow"}),w.a.createElement("div",{ref:this.setDOMBehavior,className:"popover__inner"},this.props.children)))}}]),t}(y.Component);b()(G,"propTypes",{autoPosition:v.a.bool,autoRtl:v.a.bool,className:v.a.string,closeOnEsc:v.a.bool,id:v.a.string,ignoreContext:v.a.shape({getDOMNode:v.a.function}),isRtl:v.a.bool,isVisible:v.a.bool,position:v.a.oneOf(["top","top right","right","bottom right","bottom","bottom left","left","top left"]),rootClassName:v.a.string,showDelay:v.a.number,onClose:v.a.func,onShow:v.a.func,relativePosition:v.a.shape({left:v.a.number}),customPosition:v.a.shape({top:v.a.number,left:v.a.number,positionClass:v.a.oneOf(["top","right","bottom","left"])})}),b()(G,"defaultProps",{autoPosition:!0,autoRtl:!0,className:"",closeOnEsc:!0,isRtl:!1,isVisible:!1,position:"top",showDelay:0,onClose:Y,onShow:Y});t.a=Object(C.b)(function(e){return{isRtl:document.body.classList.contains("rtl")}})(G)},702:function(e,t,n){"use strict";var i=n(107),o=n.n(i),r=n(108),a=n.n(r),s=n(528),l=n.n(s),c=n(527),u=n.n(c),p=n(531),d=n.n(p),m=n(529),h=n.n(m),f=n(34),b=n.n(f),g=n(109),v=n(35),y=n(12),w=n.n(y),k=n(10),E=n.n(k),C=n(1),R=(n(771),n(646)),I=n(534),N=n.n(I),D=n(604),_=n.n(D),O=n(30),P=n(788),x=n(526),j=n.n(x),T=n(544),q=n(679),L=function(e){return"HR"===e.tagName},S=function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return n=l()(this,(e=u()(t)).call.apply(e,[this].concat(r))),b()(d()(n),"menu",E.a.createRef()),b()(d()(n),"_setPropsOnChild",function(e){if(null==e)return e;var t=n._onClose.bind(d()(n),e.props.action),i=t;return e.props.onClick&&(i=Object(C.over)([e.props.onClick,t])),E.a.cloneElement(e,{onClick:i})}),b()(d()(n),"_onShow",function(){var e=n.menu.current;n._previouslyFocusedElement=document.activeElement,e&&e.focus()}),b()(d()(n),"_getClosestSibling",function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=n.menu.current,o=i.firstChild,r=i.lastChild;if(t||(o=i.lastChild,r=i.firstChild),e===i)return o;var a=e[t?"nextSibling":"previousSibling"]||r;return L(a)?n._getClosestSibling(a,t):a}),b()(d()(n),"_onKeyDown",function(e){var t,i=e.target,o=!1;switch(e.keyCode){case 9:n.props.onClose(),o=!0;break;case 38:t=n._getClosestSibling(i,!1),o=!0;break;case 40:t=n._getClosestSibling(i,!0),o=!0}t&&t.focus(),o&&e.preventDefault()}),b()(d()(n),"_onClose",function(e){n._previouslyFocusedElement&&(n._previouslyFocusedElement.focus(),n._previouslyFocusedElement=null),n.props.onClose&&n.props.onClose(e)}),n}return h()(t,e),a()(t,[{key:"componentWillUnmount",value:function(){this._previouslyFocusedElement=null}},{key:"render",value:function(){var e=this.props,t=e.popoverComponent,n=e.autoPosition,i=e.className,o=e.context,r=e.customPosition,a=e.isVisible,s=e.popoverTitle,l=e.position,c=e.rootClassName;return E.a.createElement(t,{onClose:this._onClose,onShow:this._onShow,autoPosition:n,className:i,context:o,customPosition:r,isVisible:a,popoverTitle:s,position:l,rootClassName:c},E.a.createElement("div",{ref:this.menu,role:"menu",className:"popover__menu",onKeyDown:this._onKeyDown,tabIndex:"-1"},E.a.Children.map(this.props.children,this._setPropsOnChild,this)))}}]),t}(k.Component);b()(S,"propTypes",{autoPosition:w.a.bool,isVisible:w.a.bool.isRequired,onClose:w.a.func.isRequired,position:w.a.string,className:w.a.string,rootClassName:w.a.string,popoverComponent:w.a.func,popoverTitle:w.a.string,customPosition:w.a.object}),b()(S,"defaultProps",{autoPosition:!0,position:"top",popoverComponent:q.a});var M=S,z=(n(772),function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return n=l()(this,(e=u()(t)).call.apply(e,[this].concat(r))),b()(d()(n),"state",{isMenuVisible:!1}),b()(d()(n),"popoverContext",E.a.createRef()),b()(d()(n),"handleClick",function(e){var t=n.props.onClick,i=n.state.isMenuVisible;t(e),i?n.hideMenu():n.showMenu()}),b()(d()(n),"hideMenu",function(){return n.toggleMenu(!1)}),b()(d()(n),"showMenu",function(){return n.toggleMenu(!0)}),n}return h()(t,e),a()(t,[{key:"toggleMenu",value:function(e){this.props.disabled||(this.setState({isMenuVisible:e}),this.props.onToggle(e))}},{key:"render",value:function(){var e=this.props,t=e.toggleTitle,n=e.translate,i=e.position,o=e.children,r=e.disabled,a=e.className,s=e.popoverClassName,l=this.state.isMenuVisible,c=j()("ellipsis-menu",a,{"is-menu-visible":l,"is-disabled":r}),u=j()("ellipsis-menu__menu","popover",s);return E.a.createElement("span",{className:c},E.a.createElement(T.a,{ref:this.popoverContext,onClick:this.handleClick,title:t||n("Toggle menu"),borderless:!0,disabled:r,className:"ellipsis-menu__toggle"},E.a.createElement(N.a,{icon:"ellipsis",className:"ellipsis-menu__toggle-icon"})),E.a.createElement(M,{isVisible:l,onClose:this.hideMenu,position:i,context:this.popoverContext.current,className:u},o))}}]),t}(k.Component));b()(z,"propTypes",{translate:w.a.func,toggleTitle:w.a.string,position:w.a.string,disabled:w.a.bool,onClick:w.a.func,onToggle:w.a.func,popoverClassName:w.a.string}),b()(z,"defaultProps",{onClick:C.noop,onToggle:C.noop});var A=Object(v.localize)(z),V=n(530),U=n.n(V),B=n(629),F=function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return n=l()(this,(e=u()(t)).call.apply(e,[this].concat(r))),b()(d()(n),"handleMouseOver",function(e){n.props.focusOnHover&&e.target.focus(),n.props.onMouseOver()}),n}return h()(t,e),a()(t,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,i=e.href,o=e.icon,r=e.isSelected,a=e.isExternalLink,s=Object(C.omit)(this.props,"icon","focusOnHover","isSelected","isExternalLink","className","itemComponent"),l=j()("popover__menu-item",n,{"is-selected":r}),c=this.props.itemComponent;return a&&i?(c=B.a,s.icon=!0):i&&(c="a"),E.a.createElement(c,U()({role:"menuitem",onMouseOver:this.handleMouseOver,tabIndex:"-1",className:l},s),o&&E.a.createElement(N.a,{icon:o,size:18}),t)}}]),t}(k.Component);b()(F,"propTypes",{href:w.a.string,className:w.a.string,isSelected:w.a.bool,icon:w.a.string,focusOnHover:w.a.bool,onMouseOver:w.a.func,isExternalLink:w.a.bool,itemComponent:w.a.oneOfType([w.a.func,w.a.string])}),b()(F,"defaultProps",{isSelected:!1,focusOnHover:!0,onMouseOver:C.noop,itemComponent:"button"});var H=n(562),K=n(552),W=n(543),Y=n(537),J=function(e){var t=e.orderId,n=e.siteId,i=e.refundDialog,o=e.createdDate,r=e.refundableAmount,a=e.currency,s=e.labelId,l=e.translate,c=e.moment,u=e.label,p=void 0===u?{}:u,d=function(){return _()(r,a)},m=function(){return e.closeRefundDialog(t,n)},h=[{action:"cancel",label:l("Cancel"),onClick:m},{action:"confirm",onClick:function(){return e.confirmRefund(t,n)},isPrimary:!0,disabled:i&&i.isSubmitting,additionalClassNames:i&&i.isSubmitting?"is-busy":"",label:l("Refund label (-%(amount)s)",{args:{amount:d()}})}];return E.a.createElement(H.a,{additionalClassNames:"label-refund-modal woocommerce wcc-root",isVisible:Boolean(i&&i.labelId===s),onClose:m,buttons:h},E.a.createElement(K.a,null,l("Request a refund")),E.a.createElement("p",null,l("You can request a refund for a shipping label that has not been used to ship a package. It will take at least %(days)s days to process.",{args:{days:"dhlexpress"===p.carrier_id?"31":"14"}})),E.a.createElement("dl",null,E.a.createElement("dt",null,l("Purchase date")),E.a.createElement("dd",null,c(o).format("LLL")),E.a.createElement("dt",null,l("Amount eligible for refund")),E.a.createElement("dd",null,d())))};J.propTypes={siteId:w.a.number.isRequired,orderId:w.a.number.isRequired,refundDialog:w.a.object,createdDate:w.a.number,refundableAmount:w.a.number,currency:w.a.string,labelId:w.a.number,closeRefundDialog:w.a.func.isRequired,confirmRefund:w.a.func.isRequired};var X=Object(g.b)(function(e,t){var n=t.orderId,i=t.siteId,o=t.labelId,r=Object(Y.t)(e,n,i),a=Object(Y.j)(e,n,i);return{refundDialog:r?a.refundDialog:{},label:Object(Y.g)(e,n,i,o)}},function(e){return Object(O.b)({closeRefundDialog:W.e,confirmRefund:W.k},e)})(Object(v.localize)(J)),G=n(614),Q=n(616),Z=function(e){var t=e.orderId,n=e.siteId,i=e.reprintDialog,o=e.paperSize,r=e.storeOptions,a=e.labelId,s=e.translate,l=function(){return e.closeReprintDialog(t,n)},c=[{action:"cancel",label:s("Cancel"),onClick:l},{action:"confirm",onClick:function(){return e.confirmReprint(t,n)},isPrimary:!0,disabled:i&&!i.fileData,additionalClassNames:i&&i.isFetching?"is-busy":"",label:s("Print")}];return E.a.createElement(H.a,{isVisible:Boolean(i&&i.labelId===a),onClose:l,buttons:c,additionalClassNames:"label-reprint-modal woocommerce wcc-root"},E.a.createElement(K.a,null,s("Reprint shipping label")),E.a.createElement("p",null,s("If there was a printing error when you purchased the label, you can print it again.")),E.a.createElement("p",{className:"shipping-label__reprint-modal-notice"},s("NOTE: If you already used the label in a package, printing and using it again is a violation of our terms of service and may result in criminal charges.")),E.a.createElement(G.a,{id:"paper_size",valuesMap:Object(Q.a)(r.origin_country),title:s("Paper size"),value:o,updateValue:function(i){return e.updatePaperSize(t,n,i)}}))};Z.propTypes={siteId:w.a.number.isRequired,orderId:w.a.number.isRequired,reprintDialog:w.a.object,paperSize:w.a.string.isRequired,storeOptions:w.a.object.isRequired,labelId:w.a.number,closeReprintDialog:w.a.func.isRequired,confirmReprint:w.a.func.isRequired};var $=Object(g.b)(function(e,t){var n=t.orderId,i=t.siteId,o=Object(Y.t)(e,n,i),r=Object(Y.j)(e,n,i);return{reprintDialog:o?r.reprintDialog:{},paperSize:r.paperSize,storeOptions:o?r.storeOptions:{}}},function(e){return Object(O.b)({closeReprintDialog:W.f,confirmReprint:W.l,updatePaperSize:W.X},e)})(Object(v.localize)(Z)),ee=n(671),te=n(546),ne=function(e){var t=e.orderId,n=e.siteId,i=e.isVisible,o=e.labelIndex,r=e.serviceName,a=e.packageName,s=e.productNames,l=e.canManagePayments,c=e.receiptId,u=e.translate,p=function(){return e.closeDetailsDialog(t,n)},d=[{action:"close",label:u("Close"),onClick:p}];return E.a.createElement(H.a,{additionalClassNames:"label-details-modal woocommerce wcc-root",isVisible:i,onClose:p,buttons:d},E.a.createElement(K.a,{className:"shipping-label__label-details-modal-heading"},E.a.createElement("span",{className:"shipping-label__label-details-modal-heading-title"},u("Label #%(labelIndex)s details",{args:{labelIndex:o+1}})),l&&c?E.a.createElement("a",{href:"".concat(Object(ee.a)(),"/me/purchases/billing/").concat(c),target:"_blank",rel:"noopener noreferrer"},u("Receipt")):null),E.a.createElement("dl",null,E.a.createElement("dt",null,u("Service")),E.a.createElement("dd",null,r),E.a.createElement("dt",null,u("Package")),E.a.createElement("dd",null,a),E.a.createElement("dt",null,u("Items")),E.a.createElement("dd",null,E.a.createElement("ul",null,s.map(function(e,t){return E.a.createElement("li",{key:t},e)})))))};ne.propTypes={siteId:w.a.number.isRequired,orderId:w.a.number.isRequired,isVisible:w.a.bool,serviceName:w.a.string,packageName:w.a.string,productNames:w.a.array,closeDetailsDialog:w.a.func.isRequired,receiptId:w.a.number};var ie=Object(g.b)(function(e,t){var n=t.orderId,i=t.siteId,o=t.labelId,r=Object(Y.t)(e,n,i),a=Object(Y.j)(e,n,i).detailsDialog;return{isVisible:Boolean(r&&a&&a.labelId===o),canManagePayments:Object(te.q)(e,i)}},function(e){return Object(O.b)({closeDetailsDialog:W.c},e)})(Object(v.localize)(ne)),oe={usps:function(e){return"https://tools.usps.com/go/TrackConfirmAction.action?tLabels=".concat(e)},fedex:function(e){return"https://www.fedex.com/apps/fedextrack/?action=track&tracknumbers=".concat(e)},ups:function(e){return"https://www.ups.com/track?loc=en_US&tracknum=".concat(e)},dhlexpress:function(e){return"https://www.dhl.com/en/express/tracking.html?AWB=".concat(e,"&brand=DHL")}},re=function(e){var t=e.tracking,n=e.carrierId,i=e.translate;if(!t)return E.a.createElement("span",null,i("N/A"));var o=oe[n](t);return o?E.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:o},t," ",E.a.createElement(N.a,{icon:"external",size:12})):E.a.createElement("span",null,t)};re.propTypes={tracking:w.a.string,carrierId:w.a.string};var ae=Object(v.localize)(re),se=function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return n=l()(this,(e=u()(t)).call.apply(e,[this].concat(r))),b()(d()(n),"renderRefund",function(e,t,i,o){var r=n.props,a=r.orderId,s=r.siteId,l=r.translate,c="",u=!1;if(t?(c=l("Labels older than 30 days cannot be refunded."),u=!0):"usps"!==i||o||(c=l("USPS labels without tracking are not eligible for refund."),u=!0),u)return E.a.createElement(P.a,{position:"top left",text:c},E.a.createElement("button",{className:"popover__menu-item shipping-label__item-menu-reprint-expired",role:"menuitem",tabIndex:"-1"},E.a.createElement(N.a,{icon:"refund",size:18}),E.a.createElement("span",null," ",l("Request refund")," ")));return E.a.createElement(F,{onClick:function(){n.props.openRefundDialog(a,s,e)},icon:"refund"},l("Request refund"))}),b()(d()(n),"renderReprint",function(e,t){var i=n.props,o=i.orderId,r=i.siteId,a=i.translate;if(t)return E.a.createElement(P.a,{position:"top left",text:a("Label images older than 180 days are deleted by our technology partners for general security and data privacy concerns.")},E.a.createElement("button",{className:"popover__menu-item shipping-label__item-menu-reprint-expired",role:"menuitem",tabIndex:"-1"},E.a.createElement(N.a,{icon:"print",size:18}),E.a.createElement("span",null," ",a("Reprint")," ")));return E.a.createElement(F,{onClick:function(){n.props.openReprintDialog(o,r,e)},icon:"print"},a("Reprint shipping label"))}),b()(d()(n),"renderLabelDetails",function(e){var t=n.props,i=t.orderId,o=t.siteId,r=t.translate;return E.a.createElement(F,{onClick:function(){n.props.openDetailsDialog(i,o,e)},icon:"info-outline"},r("View details"))}),b()(d()(n),"renderPickup",function(e){var t=n.props.translate,i={usps:"https://tools.usps.com/schedule-pickup-steps.htm",fedex:"https://www.fedex.com/en-us/shipping/schedule-manage-pickups.html",ups:"https://wwwapps.ups.com/pickup/request",dhlexpress:"https://mydhl.express.dhl/us/en/home.html#/schedulePickupTab"};if(!i.hasOwnProperty(e))return null;return E.a.createElement(F,{onClick:function(){window.open(i[e],"_blank")},icon:"external"},t("Schedule a pickup"))}),n}return h()(t,e),a()(t,[{key:"renderCommercialInvoiceLink",value:function(){var e=this.props,t=e.translate,n=e.label.commercialInvoiceUrl;if(!n)return null;return E.a.createElement(F,{onClick:function(){window.open(n)},icon:"print"},t("Print customs form"))}},{key:"render",value:function(){var e=this.props,t=e.label,n=t.labelIndex,i=t.serviceName,o=t.packageName,r=t.productNames,a=t.receiptId,s=t.labelId,l=t.createdDate,c=t.refundableAmount,u=t.currency,p=t.showDetails,d=t.expiryDate,m=t.anonymized,h=t.usedDate,f=t.tracking,b=t.carrierId,g=t.commercialInvoiceUrl,v=e.siteId,y=e.orderId,w=e.translate,k=e.isModal,C=(new Date).getTime(),R=!1,I=!1;(m||h||d&&d<C)&&(R=!0);var N=(new Date).setDate((new Date).getDate()-30);return(m||h||l&&l<N)&&(I=!0),E.a.createElement("div",{className:"shipping-label__item"},E.a.createElement("p",{className:"shipping-label__item-detail"},w("%(service)s label (#%(labelIndex)d)",{args:{service:i,labelIndex:n+1}}),p&&E.a.createElement("span",null,!k&&E.a.createElement(A,{position:"bottom left"},this.renderLabelDetails(s),this.renderPickup(b),this.renderRefund(s,I,b,f),this.renderReprint(s,R),this.renderCommercialInvoiceLink(g)),E.a.createElement(ie,{siteId:v,orderId:y,labelIndex:n,serviceName:i,packageName:o,productNames:r,receiptId:a,labelId:s}),E.a.createElement(X,{siteId:v,orderId:y,createdDate:l,refundableAmount:c,currency:u,labelId:s}),E.a.createElement($,{siteId:v,orderId:y,labelId:s}))),p&&E.a.createElement("p",{className:"shipping-label__item-tracking"},w("Tracking #: {{trackingLink/}}",{components:{trackingLink:E.a.createElement(ae,{carrierId:b,tracking:f})}})))}}]),t}(k.Component);se.propTypes={siteId:w.a.number.isRequired,orderId:w.a.number.isRequired,label:w.a.shape({serviceName:w.a.string.isRequired,labelIndex:w.a.number.isRequired,packageName:w.a.string.isRequired,productNames:w.a.string.isRequired,receiptId:w.a.number.isRequired,labelId:w.a.number.isRequired,createdDate:w.a.string.isRequired,refundableAmount:w.a.number.isRequired,currency:w.a.string.isRequired,showDetails:w.a.bool.isRequired,expiryDate:w.a.string.isRequired,anonymized:w.a.bool.isRequired,usedDate:w.a.string.isRequired,tracking:w.a.string.isRequired,carrierId:w.a.string.isRequired,commercialInvoiceUrl:w.a.string}).isRequired,isModal:w.a.bool.isRequired,openRefundDialog:w.a.func.isRequired,openReprintDialog:w.a.func.isRequired,openDetailsDialog:w.a.func.isRequired};var le=Object(g.b)(null,function(e){return Object(O.b)({openRefundDialog:W.y,openReprintDialog:W.z,openDetailsDialog:W.u},e)})(Object(v.localize)(se)),ce=function(e){function t(){return o()(this,t),l()(this,u()(t).apply(this,arguments))}return h()(t,e),a()(t,[{key:"render",value:function(){var e=this.props,t=e.label,n=e.translate,i=t.serviceName,o=t.labelIndex;return E.a.createElement("div",{className:"shipping-label__item"},E.a.createElement("p",{className:"shipping-label__item-detail"},n("%(service)s label (#%(labelIndex)d)",{args:{service:i,labelIndex:o+1}}),E.a.createElement("br",null),n("Purchasing\u2026")))}}]),t}(se);se.propTypes={label:w.a.object.isRequired};var ue=Object(v.localize)(ce),pe=n(615),de=function(e){function t(){var e,n,i;o()(this,t);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=l()(this,(e=u()(t)).call.apply(e,[this].concat(a))),b()(d()(i),"eventPropsByType",(n={},b()(n,R.a.INTERNAL_NOTE,function(e){return{icon:"aside",heading:(0,i.props.translate)("Internal note"),content:Object(pe.a)(Object(pe.b)(e.content))}}),b()(n,R.a.CUSTOMER_NOTE,function(e){return{icon:"mail",heading:(0,i.props.translate)("Note sent to customer"),content:Object(pe.a)(Object(pe.b)(e.content))}}),b()(n,R.a.LABEL_PURCHASING,function(e){return{icon:"sync",content:E.a.createElement(ue,{label:e,orderId:i.props.orderId,siteId:i.props.siteId})}}),b()(n,R.a.LABEL_PURCHASED,function(e){return{icon:"print",content:E.a.createElement(le,{label:e,orderId:i.props.orderId,siteId:i.props.siteId,isModal:i.props.isModal})}}),b()(n,R.a.LABEL_REFUND_REQUESTED,function(e){var t=i.props.translate;return{icon:"time",content:E.a.createElement("div",null,t("%(service)s label (#%(labelNum)d) refund requested (%(amount)s)",{args:{service:e.serviceName,labelNum:e.labelIndex+1,amount:_()(e.amount,e.currency)}}))}}),b()(n,R.a.LABEL_REFUND_COMPLETED,function(e){var t=i.props.translate;return{icon:"refund",content:E.a.createElement("div",null,t("%(service)s label (#%(labelNum)d) refunded (%(amount)s)",{args:{service:e.serviceName,labelNum:e.labelIndex+1,amount:_()(e.amount,e.currency)}}))}}),b()(n,R.a.LABEL_REFUND_REJECTED,function(e){var t=i.props.translate;return{icon:"cross-small",content:E.a.createElement("div",null,t("%(service)s label (#%(labelNum)d) refund rejected",{service:e.serviceName,args:{labelNum:e.labelIndex+1}}))}}),b()(n,R.a.REFUND_NOTE,function(e){var t=i.props.translate;return{icon:"credit-card",heading:t("Refund"),content:E.a.createElement("div",null,t("Refunded %(amount)s",{args:{amount:_()(e.amount,e.currency)}}),E.a.createElement("br",null),e.reason)}}),b()(n,void 0,function(){return{}}),n)),b()(d()(i),"renderDefaultEvent",function(e){return{icon:"aside",heading:(0,i.props.translate)("Note"),content:e.content}}),i}return h()(t,e),a()(t,[{key:"render",value:function(){var e=this.props,t=e.moment,n=e.event,i=(this.eventPropsByType[n.type]||this.renderDefaultEvent)(n),o=i.icon,r=i.heading,a=i.content;return E.a.createElement("div",{className:"order-activity-log__note"},E.a.createElement("div",{className:"order-activity-log__note-meta"},E.a.createElement("span",{className:"order-activity-log__note-time"},t(n.timestamp).format("LT")),o&&E.a.createElement(N.a,{icon:o,size:24})),E.a.createElement("div",{className:"order-activity-log__note-body"},E.a.createElement("div",{className:"order-activity-log__note-type"},r),E.a.createElement("div",{className:"order-activity-log__note-content"},a)))}}]),t}(k.Component);b()(de,"propTypes",{customer_note:w.a.bool,date_created_gmt:w.a.string,note:w.a.string.isRequired}),b()(de,"propTypes",{event:w.a.object}),b()(de,"defaultProps",{event:{}});var me=Object(v.localize)(de),he=n(611),fe=function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return n=l()(this,(e=u()(t)).call.apply(e,[this].concat(r))),b()(d()(n),"onClick",function(){n.props.onClick(n.props.date)}),n}return h()(t,e),a()(t,[{key:"render",value:function(){var e=this.props,t=e.count,n=e.date,i=e.isOpen,o=e.moment,r=e.translate,a=o(n,"YYYYMMDD").format("ll"),s=E.a.createElement("div",null,E.a.createElement("h3",null,a),E.a.createElement("small",null,r("%(count)s event","%(count)s events",{count:t,args:{count:t}})));return E.a.createElement("div",{className:"order-activity-log__day"},E.a.createElement(he.a,{onClick:this.onClick,className:"order-activity-log__day-header",expanded:i,header:s,screenReaderText:r("Show notes from %(date)s",{args:{date:a}})},this.props.children))}}]),t}(k.Component);b()(fe,"propTypes",{count:w.a.number.isRequired,date:w.a.string.isRequired,isOpen:w.a.bool.isRequired,onClick:w.a.func.isRequired});var be=Object(v.localize)(fe);var ge=function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return n=l()(this,(e=u()(t)).call.apply(e,[this].concat(r))),b()(d()(n),"toggleOpenDay",function(e){n.setState(function(){return{openDay:e}})}),b()(d()(n),"renderNotes",function(){var e=n.props,t=e.days,i=e.eventsByDay,o=e.translate;return t.length?E.a.createElement("div",null,t.map(function(e){var t=i[e];return E.a.createElement(be,{key:e,count:t.length,date:e,isOpen:e===n.state.openDay,onClick:n.toggleOpenDay},t.map(function(e){return E.a.createElement(me,{key:"".concat(e.type,"-").concat(e.key),event:e,orderId:n.props.orderId,siteId:n.props.siteId,isModal:n.props.isModal})}))})):E.a.createElement("p",null,o("No activity yet"))}),b()(d()(n),"renderPlaceholder",function(){return E.a.createElement("div",{className:"is-placeholder"},E.a.createElement(be,{count:0,date:"",isOpen:!0,index:1,onClick:C.noop},E.a.createElement(me,null)))}),n}return h()(t,e),a()(t,[{key:"UNSAFE_componentWillMount",value:function(){this.setState({openDay:Object(C.last)(Object(C.keys)(this.props.eventsByDay))})}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){var t=Object(C.last)(Object(C.keys)(e.eventsByDay));this.props.eventsByDay[t]||this.setState({openDay:t})}},{key:"render",value:function(){return this.props.isLoaded?this.renderNotes():this.renderPlaceholder()}}]),t}(k.Component);b()(ge,"propTypes",{orderId:w.a.number.isRequired,siteId:w.a.number.isRequired});t.a=Object(g.b)(function(e,t){var n=t.orderId||!1,i=Object(R.c)(e,n),o=Object(R.b)(e,n),r=o.length?function(e){var t={};return e.forEach(function(e){var n=Object(v.moment)(e.timestamp).format("YYYYMMDD");t[n]?t[n].push(e):t[n]=[e]}),Object(C.keys)(t).forEach(function(e){t[e]=Object(C.sortBy)(t[e],["timestamp","key"]).reverse()}),t}(o):{},a=r?Object(C.keys)(r):[];return a.sort().reverse(),{isLoaded:i,days:a,events:o,eventsByDay:r}})(Object(v.localize)(ge))},771:function(e,t,n){},772:function(e,t,n){}}]);
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[138],{630:function(e,t,n){"use strict";var i=n(107),o=n.n(i),r=n(108),a=n.n(r),s=n(528),l=n.n(s),c=n(527),u=n.n(c),p=n(529),d=n.n(p),m=n(34),h=n.n(m),f=n(10),b=n.n(f),g=n(12),v=n.n(g),y=n(526),w=n.n(y),k=n(1),E=n(534),C=n.n(E),R=(n(677),function(e){function t(){return o()(this,t),l()(this,u()(t).apply(this,arguments))}return d()(t,e),a()(t,[{key:"render",value:function(){var e=w()("external-link",this.props.className,{"icon-first":!!this.props.showIconFirst},{"has-icon":!!this.props.icon}),t=Object(k.assign)({},Object(k.omit)(this.props,"icon","iconSize","showIconFirst","iconClassName"),{className:e,rel:"external"});t.target&&(t.rel=t.rel.concat(" noopener noreferrer"));var n=b.a.createElement(C.a,{className:this.props.iconClassName,icon:"external",size:this.props.iconSize});return b.a.createElement("a",t,this.props.icon&&this.props.showIconFirst&&n,this.props.children,this.props.icon&&!this.props.showIconFirst&&n)}}]),t}(f.Component));h()(R,"defaultProps",{iconSize:18,showIconFirst:!1}),h()(R,"propTypes",{className:v.a.string,href:v.a.string,onClick:v.a.func,icon:v.a.bool,iconSize:v.a.number,target:v.a.string,showIconFirst:v.a.bool,iconClassName:v.a.string}),t.a=R},677:function(e,t,n){},679:function(e,t,n){"use strict";var i=n(107),o=n.n(i),r=n(108),a=n.n(r),s=n(528),l=n.n(s),c=n(527),u=n.n(c),p=n(531),d=n.n(p),m=n(529),h=n.n(m),f=n(34),b=n.n(f),g=n(12),v=n.n(g),y=n(10),w=n.n(y),k=n(77),E=n.n(k),C=n(109),R=n(47),I=n.n(R),N=n(526),D=n.n(N),_=n(684),O=n.n(_),P=n(1),x=n(642),j=n(76),T=n.n(j),q=n(700),L=n.n(q),S=I()("calypso:popover:util");function M(){var e={};return e.top=window.scrollY,e.left=window.scrollX,e.width=window.innerWidth,e.height=window.innerHeight,e.right=e.left+e.width,e.bottom=e.top+e.height,S("viewport: %o",e),e}var z={top:"bottom",bottom:"top",left:"right",right:"left"},A={top:"right",left:"top",bottom:"left",right:"bottom"},V=M();function U(){V=M()}var B=!1,F=function(){if(B)return S("window events already bound");B=!0,S("bind handlers to `resize` and `scroll` events"),window.addEventListener("resize",U,!0),window.addEventListener("scroll",U,!0)},H=function(){if(!B)return S("window events are not bound");B=!1,S("unbind handlers to `resize` and `scroll` events"),window.removeEventListener("resize",U,!0),window.removeEventListener("scroll",U,!0)},K=function(e,t,n){var i=L()(n),o=t.clientHeight,r=t.clientWidth,a={top:i.top-o,bottom:V.height-i.bottom-o,left:i.left-r,right:V.width-i.right-r},s=e.split(/\s+/),l=T()(s,1)[0],c=T()(s,2)[1],u=function(e,t){for(var n,i=[e,z[e],A[e],z[A[e]]],o=-1/0,r=0,a=i.length;r<a;r++){var s=i[r],l=t[s];if(l>0)return s;l>o&&(o=l,n=e)}return n}(l,a);return c!==u&&c!==z[u]||(c=null),function(e,t,n,i,o,r){for(var a,s="top"===e||"bottom"===e,l=t?[s?"".concat(e," ").concat(t):"".concat(t," ").concat(e),e,s?"".concat(e," ").concat(z[t]):"".concat(z[t]," ").concat(e)]:[e,s?"".concat(e," ").concat(A[e]):"".concat(A[e]," ").concat(e),s?"".concat(e," ").concat(z[A[e]]):"".concat(z[A[e]]," ").concat(e)],c=0,u=o*r,p=0,d=l.length;p<d;p++){var m=l[p],h=W(m,n,i),f=h.left+o,b=h.top+r,g=Math.min(h.top<V.top?b-V.top:V.bottom-h.top,r),v=Math.min(h.left<V.left?f-V.left:V.right-h.left,o),y=v*g;if(y===u)return m;y>c&&(c=y,a=m)}return a}(u,c,t,n,r,o)||e};function W(e,t,n,i){var o=L()(t);if(!o)throw new Error("could not get bounding client rect of Tip element");var r=o.width,a=o.height,s=L()(n);if(!s)throw new Error("could not get bounding client rect of `target`");var l=s.width,c=s.height,u=function(e,t){var n=t.body||t.getElementsByTagName("body")[0],i=t.documentElement||n.parentNode,o=i.clientTop||n.clientTop||0,r=i.clientLeft||n.clientLeft||0,a=window.pageYOffset||i.scrollTop,s=window.pageXOffset||i.scrollLeft;return{top:e.top+a-o,left:e.left+s-r}}(s,document);if(!u)throw new Error("could not determine page offset of `target`");var p={};switch(e){case"top":p={top:u.top-a,left:i&&i.left?u.left+i.left:u.left+l/2-r/2};break;case"bottom":p={top:u.top+c,left:i&&i.left?u.left+i.left:u.left+l/2-r/2};break;case"right":p={top:u.top+c/2-a/2,left:u.left+l};break;case"left":p={top:u.top+c/2-a/2,left:u.left-r};break;case"top left":p={top:u.top-a,left:u.left+l/2-r+15};break;case"top right":p={top:u.top-a,left:u.left+l/2-15};break;case"bottom left":p={top:u.top+c,left:u.left+l/2-r+15};break;case"bottom right":p={top:u.top+c,left:u.left+l/2-15};break;case"left top":p={top:u.top+c/2-a,left:u.left-r};break;case"left bottom":p={top:u.top+c/2,left:u.left-r};break;case"right top":p={top:u.top+c/2-a,left:u.left+l};break;case"right bottom":p={top:u.top+c/2,left:u.left+l};break;default:throw new Error('invalid position "'.concat(e,'"'))}return p}var Y=function(){},J=I()("calypso:popover"),X=new Set,G=function(e){function t(e){var n;return o()(this,t),n=l()(this,u()(t).call(this,e)),b()(d()(n),"isUpdatingPosition",!1),n.setPopoverId(e.id),n.setDOMBehavior=n.setDOMBehavior.bind(d()(n)),n.setPosition=n.setPosition.bind(d()(n)),n.onClickout=n.onClickout.bind(d()(n)),n.onKeydown=n.onKeydown.bind(d()(n)),n.onWindowChange=n.onWindowChange.bind(d()(n)),n.state={show:e.isVisible,left:-99999,top:-99999,positionClass:n.getPositionClass(e.position)},n}return h()(t,e),a()(t,[{key:"componentDidMount",value:function(){this.state.show&&(this.bindEscKeyListener(),this.bindDebouncedReposition(),F())}},{key:"componentWillReceiveProps",value:function(e){if(this.domContext=E.a.findDOMNode(e.context),!e.isVisible)return null;this.setPosition()}},{key:"componentDidUpdate",value:function(e,t){var n=this,i=this.props.isVisible;return!t.show&&this.state.show&&(this.bindEscKeyListener(),this.bindDebouncedReposition(),F()),i!==e.isVisible&&(i?this.show():this.hide()),this.domContainer&&this.domContext&&i?void(this.isUpdatingPosition||(this.debug("requesting to update position after render completes"),requestAnimationFrame(function(){X.has(n.id)&&n.domContainer&&n.domContext&&i?(n.setPosition(),n.isUpdatingPosition=!1):n.isUpdatingPosition=!1}),this.isUpdatingPosition=!0)):null}},{key:"componentWillUnmount",value:function(){this.debug("unmounting .... "),this.unbindClickoutHandler(),this.unbindDebouncedReposition(),this.unbindEscKeyListener(),H(),X.delete(this.id),J("current popover instances: ",X.size)}},{key:"bindEscKeyListener",value:function(){if(!this.props.closeOnEsc)return null;this.debug("adding escKey listener ..."),document.addEventListener("keydown",this.onKeydown,!0)}},{key:"unbindEscKeyListener",value:function(){if(!this.props.closeOnEsc)return null;this.debug("unbinding `escKey` listener ..."),document.removeEventListener("keydown",this.onKeydown,!0)}},{key:"onKeydown",value:function(e){if(27!==e.keyCode)return null;this.close(!0)}},{key:"bindClickoutHandler",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.domContainer;return e?this._clickoutHandlerReference?(this.debug("clickout event already bound"),null):(this.debug("binding `clickout` event"),void(this._clickoutHandlerReference=O()(e,this.onClickout))):(this.debug("no element to bind clickout "),null)}},{key:"unbindClickoutHandler",value:function(){this._clickoutHandlerReference&&(this.debug("unbinding `clickout` listener ..."),this._clickoutHandlerReference(),this._clickoutHandlerReference=null)}},{key:"onClickout",value:function(e){var t=this.domContext&&this.domContext.contains&&!this.domContext.contains(e.target);if(this.props.ignoreContext&&t){var n=E.a.findDOMNode(this.props.ignoreContext);t=t&&n&&n.contains&&!n.contains(e.target)}t&&this.close()}},{key:"bindDebouncedReposition",value:function(){window.addEventListener("scroll",this.onWindowChange,!0),window.addEventListener("resize",this.onWindowChange,!0)}},{key:"unbindDebouncedReposition",value:function(){this.willReposition&&(window.cancelAnimationFrame(this.willReposition),this.willReposition=null),window.removeEventListener("scroll",this.onWindowChange,!0),window.removeEventListener("resize",this.onWindowChange,!0),this.debug("unbinding `debounce reposition` ...")}},{key:"onWindowChange",value:function(){this.willReposition=window.requestAnimationFrame(this.setPosition)}},{key:"setDOMBehavior",value:function(e){if(!e)return this.unbindClickoutHandler(),null;this.debug("setting DOM behavior"),this.bindClickoutHandler(e),this.domContainer=e,this.domContext=E.a.findDOMNode(this.props.context),this.setPosition()}},{key:"getPositionClass",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.position;return"is-".concat(e.replace(/\s+/g,"-"))}},{key:"adjustRtlPosition",value:function(e){if(this.props.isRtl)switch(e){case"top right":case"right top":return"top left";case"right":return"left";case"bottom right":case"right bottom":return"bottom left";case"bottom left":case"left bottom":return"bottom right";case"left":return"right";case"top left":case"left top":return"top right"}return e}},{key:"computePosition",value:function(){if(!this.props.isVisible)return null;var e=this.domContainer,t=this.domContext,n=this.props,i=n.position,o=n.relativePosition;if(!e||!t)return this.debug("[WARN] no DOM elements to work"),null;var r=i;this.debug("position: %o",r),this.props.autoRtl&&(r=this.adjustRtlPosition(r),this.debug("RTL adjusted position: %o",r)),this.props.autoPosition&&(r=K(r,e,t),this.debug("suggested position: %o",r));var a=Object.assign({},function(e,t){var n=L()(t).width;return e.left=Math.max(0,Math.min(e.left,V.width-n)),e}(W(r,e,t,o),e),{positionClass:this.getPositionClass(r)});return this.debug("updating reposition: ",a),a}},{key:"debug",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];J.apply(void 0,["[%s] ".concat(e),this.id].concat(n))}},{key:"setPopoverId",value:function(e){this.id=e||"pop__".concat(Object(P.uniqueId)()),X.add(this.id),this.debug("creating ..."),J("current popover instances: ",X.size)}},{key:"setPosition",value:function(){var e;if(this.debug("updating position"),!(e=this.props.customPosition?Object.assign({positionClass:this.getPositionClass(this.constructor.defaultProps.position)},this.props.customPosition):this.computePosition()))return null;this.willReposition=null,this.setState(e)}},{key:"getStylePosition",value:function(){var e=this.state;return{left:e.left,top:e.top}}},{key:"show",value:function(){var e=this;if(!this.props.showDelay)return this.setState({show:!0}),null;this.debug("showing in %o","".concat(this.props.showDelay,"ms")),this.clearShowTimer(),this._openDelayTimer=setTimeout(function(){e.setState({show:!0})},this.props.showDelay)}},{key:"hide",value:function(){this.unbindClickoutHandler(),this.unbindDebouncedReposition(),this.unbindEscKeyListener(),H(),this.setState({show:!1}),this.clearShowTimer()}},{key:"clearShowTimer",value:function(){if(!this._openDelayTimer)return null;clearTimeout(this._openDelayTimer),this._openDelayTimer=null}},{key:"close",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.props.isVisible)return this.debug("popover should be already closed"),null;this.props.onClose(e)}},{key:"render",value:function(){if(!this.state.show)return this.debug("is hidden. return no render"),null;if(!this.props.context)return this.debug("No `context` to tie. return no render"),null;var e=D()("popover",this.props.className,this.state.positionClass);return this.debug("rendering ..."),w.a.createElement(x.a,{className:this.props.rootClassName},w.a.createElement("div",{style:this.getStylePosition(),className:e},w.a.createElement("div",{className:"popover__arrow"}),w.a.createElement("div",{ref:this.setDOMBehavior,className:"popover__inner"},this.props.children)))}}]),t}(y.Component);b()(G,"propTypes",{autoPosition:v.a.bool,autoRtl:v.a.bool,className:v.a.string,closeOnEsc:v.a.bool,id:v.a.string,ignoreContext:v.a.shape({getDOMNode:v.a.function}),isRtl:v.a.bool,isVisible:v.a.bool,position:v.a.oneOf(["top","top right","right","bottom right","bottom","bottom left","left","top left"]),rootClassName:v.a.string,showDelay:v.a.number,onClose:v.a.func,onShow:v.a.func,relativePosition:v.a.shape({left:v.a.number}),customPosition:v.a.shape({top:v.a.number,left:v.a.number,positionClass:v.a.oneOf(["top","right","bottom","left"])})}),b()(G,"defaultProps",{autoPosition:!0,autoRtl:!0,className:"",closeOnEsc:!0,isRtl:!1,isVisible:!1,position:"top",showDelay:0,onClose:Y,onShow:Y});t.a=Object(C.b)(function(e){return{isRtl:document.body.classList.contains("rtl")}})(G)},702:function(e,t,n){"use strict";var i=n(107),o=n.n(i),r=n(108),a=n.n(r),s=n(528),l=n.n(s),c=n(527),u=n.n(c),p=n(531),d=n.n(p),m=n(529),h=n.n(m),f=n(34),b=n.n(f),g=n(109),v=n(35),y=n(12),w=n.n(y),k=n(10),E=n.n(k),C=n(1),R=(n(771),n(646)),I=n(534),N=n.n(I),D=n(604),_=n.n(D),O=n(30),P=n(788),x=n(526),j=n.n(x),T=n(544),q=n(679),L=function(e){return"HR"===e.tagName},S=function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return n=l()(this,(e=u()(t)).call.apply(e,[this].concat(r))),b()(d()(n),"menu",E.a.createRef()),b()(d()(n),"_setPropsOnChild",function(e){if(null==e)return e;var t=n._onClose.bind(d()(n),e.props.action),i=t;return e.props.onClick&&(i=Object(C.over)([e.props.onClick,t])),E.a.cloneElement(e,{onClick:i})}),b()(d()(n),"_onShow",function(){var e=n.menu.current;n._previouslyFocusedElement=document.activeElement,e&&e.focus()}),b()(d()(n),"_getClosestSibling",function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=n.menu.current,o=i.firstChild,r=i.lastChild;if(t||(o=i.lastChild,r=i.firstChild),e===i)return o;var a=e[t?"nextSibling":"previousSibling"]||r;return L(a)?n._getClosestSibling(a,t):a}),b()(d()(n),"_onKeyDown",function(e){var t,i=e.target,o=!1;switch(e.keyCode){case 9:n.props.onClose(),o=!0;break;case 38:t=n._getClosestSibling(i,!1),o=!0;break;case 40:t=n._getClosestSibling(i,!0),o=!0}t&&t.focus(),o&&e.preventDefault()}),b()(d()(n),"_onClose",function(e){n._previouslyFocusedElement&&(n._previouslyFocusedElement.focus(),n._previouslyFocusedElement=null),n.props.onClose&&n.props.onClose(e)}),n}return h()(t,e),a()(t,[{key:"componentWillUnmount",value:function(){this._previouslyFocusedElement=null}},{key:"render",value:function(){var e=this.props,t=e.popoverComponent,n=e.autoPosition,i=e.className,o=e.context,r=e.customPosition,a=e.isVisible,s=e.popoverTitle,l=e.position,c=e.rootClassName;return E.a.createElement(t,{onClose:this._onClose,onShow:this._onShow,autoPosition:n,className:i,context:o,customPosition:r,isVisible:a,popoverTitle:s,position:l,rootClassName:c},E.a.createElement("div",{ref:this.menu,role:"menu",className:"popover__menu",onKeyDown:this._onKeyDown,tabIndex:"-1"},E.a.Children.map(this.props.children,this._setPropsOnChild,this)))}}]),t}(k.Component);b()(S,"propTypes",{autoPosition:w.a.bool,isVisible:w.a.bool.isRequired,onClose:w.a.func.isRequired,position:w.a.string,className:w.a.string,rootClassName:w.a.string,popoverComponent:w.a.func,popoverTitle:w.a.string,customPosition:w.a.object}),b()(S,"defaultProps",{autoPosition:!0,position:"top",popoverComponent:q.a});var M=S,z=(n(772),function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return n=l()(this,(e=u()(t)).call.apply(e,[this].concat(r))),b()(d()(n),"state",{isMenuVisible:!1}),b()(d()(n),"popoverContext",E.a.createRef()),b()(d()(n),"handleClick",function(e){var t=n.props.onClick,i=n.state.isMenuVisible;t(e),i?n.hideMenu():n.showMenu()}),b()(d()(n),"hideMenu",function(){return n.toggleMenu(!1)}),b()(d()(n),"showMenu",function(){return n.toggleMenu(!0)}),n}return h()(t,e),a()(t,[{key:"toggleMenu",value:function(e){this.props.disabled||(this.setState({isMenuVisible:e}),this.props.onToggle(e))}},{key:"render",value:function(){var e=this.props,t=e.toggleTitle,n=e.translate,i=e.position,o=e.children,r=e.disabled,a=e.className,s=e.popoverClassName,l=this.state.isMenuVisible,c=j()("ellipsis-menu",a,{"is-menu-visible":l,"is-disabled":r}),u=j()("ellipsis-menu__menu","popover",s);return E.a.createElement("span",{className:c},E.a.createElement(T.a,{ref:this.popoverContext,onClick:this.handleClick,title:t||n("Toggle menu"),borderless:!0,disabled:r,className:"ellipsis-menu__toggle"},E.a.createElement(N.a,{icon:"ellipsis",className:"ellipsis-menu__toggle-icon"})),E.a.createElement(M,{isVisible:l,onClose:this.hideMenu,position:i,context:this.popoverContext.current,className:u},o))}}]),t}(k.Component));b()(z,"propTypes",{translate:w.a.func,toggleTitle:w.a.string,position:w.a.string,disabled:w.a.bool,onClick:w.a.func,onToggle:w.a.func,popoverClassName:w.a.string}),b()(z,"defaultProps",{onClick:C.noop,onToggle:C.noop});var A=Object(v.localize)(z),V=n(530),U=n.n(V),B=n(630),F=function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return n=l()(this,(e=u()(t)).call.apply(e,[this].concat(r))),b()(d()(n),"handleMouseOver",function(e){n.props.focusOnHover&&e.target.focus(),n.props.onMouseOver()}),n}return h()(t,e),a()(t,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,i=e.href,o=e.icon,r=e.isSelected,a=e.isExternalLink,s=Object(C.omit)(this.props,"icon","focusOnHover","isSelected","isExternalLink","className","itemComponent"),l=j()("popover__menu-item",n,{"is-selected":r}),c=this.props.itemComponent;return a&&i?(c=B.a,s.icon=!0):i&&(c="a"),E.a.createElement(c,U()({role:"menuitem",onMouseOver:this.handleMouseOver,tabIndex:"-1",className:l},s),o&&E.a.createElement(N.a,{icon:o,size:18}),t)}}]),t}(k.Component);b()(F,"propTypes",{href:w.a.string,className:w.a.string,isSelected:w.a.bool,icon:w.a.string,focusOnHover:w.a.bool,onMouseOver:w.a.func,isExternalLink:w.a.bool,itemComponent:w.a.oneOfType([w.a.func,w.a.string])}),b()(F,"defaultProps",{isSelected:!1,focusOnHover:!0,onMouseOver:C.noop,itemComponent:"button"});var H=n(562),K=n(552),W=n(543),Y=n(537),J=function(e){var t=e.orderId,n=e.siteId,i=e.refundDialog,o=e.createdDate,r=e.refundableAmount,a=e.currency,s=e.labelId,l=e.translate,c=e.moment,u=e.label,p=void 0===u?{}:u,d=function(){return _()(r,a)},m=function(){return e.closeRefundDialog(t,n)},h=[{action:"cancel",label:l("Cancel"),onClick:m},{action:"confirm",onClick:function(){return e.confirmRefund(t,n)},isPrimary:!0,disabled:i&&i.isSubmitting,additionalClassNames:i&&i.isSubmitting?"is-busy":"",label:l("Refund label (-%(amount)s)",{args:{amount:d()}})}];return E.a.createElement(H.a,{additionalClassNames:"label-refund-modal woocommerce wcc-root",isVisible:Boolean(i&&i.labelId===s),onClose:m,buttons:h},E.a.createElement(K.a,null,l("Request a refund")),E.a.createElement("p",null,l("You can request a refund for a shipping label that has not been used to ship a package. It will take at least %(days)s days to process.",{args:{days:"dhlexpress"===p.carrier_id?"31":"14"}})),E.a.createElement("dl",null,E.a.createElement("dt",null,l("Purchase date")),E.a.createElement("dd",null,c(o).format("LLL")),E.a.createElement("dt",null,l("Amount eligible for refund")),E.a.createElement("dd",null,d())))};J.propTypes={siteId:w.a.number.isRequired,orderId:w.a.number.isRequired,refundDialog:w.a.object,createdDate:w.a.number,refundableAmount:w.a.number,currency:w.a.string,labelId:w.a.number,closeRefundDialog:w.a.func.isRequired,confirmRefund:w.a.func.isRequired};var X=Object(g.b)(function(e,t){var n=t.orderId,i=t.siteId,o=t.labelId,r=Object(Y.t)(e,n,i),a=Object(Y.j)(e,n,i);return{refundDialog:r?a.refundDialog:{},label:Object(Y.g)(e,n,i,o)}},function(e){return Object(O.b)({closeRefundDialog:W.e,confirmRefund:W.k},e)})(Object(v.localize)(J)),G=n(614),Q=n(616),Z=function(e){var t=e.orderId,n=e.siteId,i=e.reprintDialog,o=e.paperSize,r=e.storeOptions,a=e.labelId,s=e.translate,l=function(){return e.closeReprintDialog(t,n)},c=[{action:"cancel",label:s("Cancel"),onClick:l},{action:"confirm",onClick:function(){return e.confirmReprint(t,n)},isPrimary:!0,disabled:i&&!i.fileData,additionalClassNames:i&&i.isFetching?"is-busy":"",label:s("Print")}];return E.a.createElement(H.a,{isVisible:Boolean(i&&i.labelId===a),onClose:l,buttons:c,additionalClassNames:"label-reprint-modal woocommerce wcc-root"},E.a.createElement(K.a,null,s("Reprint shipping label")),E.a.createElement("p",null,s("If there was a printing error when you purchased the label, you can print it again.")),E.a.createElement("p",{className:"shipping-label__reprint-modal-notice"},s("NOTE: If you already used the label in a package, printing and using it again is a violation of our terms of service and may result in criminal charges.")),E.a.createElement(G.a,{id:"paper_size",valuesMap:Object(Q.a)(r.origin_country),title:s("Paper size"),value:o,updateValue:function(i){return e.updatePaperSize(t,n,i)}}))};Z.propTypes={siteId:w.a.number.isRequired,orderId:w.a.number.isRequired,reprintDialog:w.a.object,paperSize:w.a.string.isRequired,storeOptions:w.a.object.isRequired,labelId:w.a.number,closeReprintDialog:w.a.func.isRequired,confirmReprint:w.a.func.isRequired};var $=Object(g.b)(function(e,t){var n=t.orderId,i=t.siteId,o=Object(Y.t)(e,n,i),r=Object(Y.j)(e,n,i);return{reprintDialog:o?r.reprintDialog:{},paperSize:r.paperSize,storeOptions:o?r.storeOptions:{}}},function(e){return Object(O.b)({closeReprintDialog:W.f,confirmReprint:W.l,updatePaperSize:W.X},e)})(Object(v.localize)(Z)),ee=n(671),te=n(546),ne=function(e){var t=e.orderId,n=e.siteId,i=e.isVisible,o=e.labelIndex,r=e.serviceName,a=e.packageName,s=e.productNames,l=e.canManagePayments,c=e.receiptId,u=e.translate,p=function(){return e.closeDetailsDialog(t,n)},d=[{action:"close",label:u("Close"),onClick:p}];return E.a.createElement(H.a,{additionalClassNames:"label-details-modal woocommerce wcc-root",isVisible:i,onClose:p,buttons:d},E.a.createElement(K.a,{className:"shipping-label__label-details-modal-heading"},E.a.createElement("span",{className:"shipping-label__label-details-modal-heading-title"},u("Label #%(labelIndex)s details",{args:{labelIndex:o+1}})),l&&c?E.a.createElement("a",{href:"".concat(Object(ee.a)(),"/me/purchases/billing/").concat(c),target:"_blank",rel:"noopener noreferrer"},u("Receipt")):null),E.a.createElement("dl",null,E.a.createElement("dt",null,u("Service")),E.a.createElement("dd",null,r),E.a.createElement("dt",null,u("Package")),E.a.createElement("dd",null,a),E.a.createElement("dt",null,u("Items")),E.a.createElement("dd",null,E.a.createElement("ul",null,s.map(function(e,t){return E.a.createElement("li",{key:t},e)})))))};ne.propTypes={siteId:w.a.number.isRequired,orderId:w.a.number.isRequired,isVisible:w.a.bool,serviceName:w.a.string,packageName:w.a.string,productNames:w.a.array,closeDetailsDialog:w.a.func.isRequired,receiptId:w.a.number};var ie=Object(g.b)(function(e,t){var n=t.orderId,i=t.siteId,o=t.labelId,r=Object(Y.t)(e,n,i),a=Object(Y.j)(e,n,i).detailsDialog;return{isVisible:Boolean(r&&a&&a.labelId===o),canManagePayments:Object(te.q)(e,i)}},function(e){return Object(O.b)({closeDetailsDialog:W.c},e)})(Object(v.localize)(ne)),oe={usps:function(e){return"https://tools.usps.com/go/TrackConfirmAction.action?tLabels=".concat(e)},fedex:function(e){return"https://www.fedex.com/apps/fedextrack/?action=track&tracknumbers=".concat(e)},ups:function(e){return"https://www.ups.com/track?loc=en_US&tracknum=".concat(e)},dhlexpress:function(e){return"https://www.dhl.com/en/express/tracking.html?AWB=".concat(e,"&brand=DHL")}},re=function(e){var t=e.tracking,n=e.carrierId,i=e.translate;if(!t)return E.a.createElement("span",null,i("N/A"));var o=oe[n](t);return o?E.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:o},t," ",E.a.createElement(N.a,{icon:"external",size:12})):E.a.createElement("span",null,t)};re.propTypes={tracking:w.a.string,carrierId:w.a.string};var ae=Object(v.localize)(re),se=function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return n=l()(this,(e=u()(t)).call.apply(e,[this].concat(r))),b()(d()(n),"renderRefund",function(e,t,i,o){var r=n.props,a=r.orderId,s=r.siteId,l=r.translate,c="",u=!1;if(t?(c=l("Labels older than 30 days cannot be refunded."),u=!0):"usps"!==i||o||(c=l("USPS labels without tracking are not eligible for refund."),u=!0),u)return E.a.createElement(P.a,{position:"top left",text:c},E.a.createElement("button",{className:"popover__menu-item shipping-label__item-menu-reprint-expired",role:"menuitem",tabIndex:"-1"},E.a.createElement(N.a,{icon:"refund",size:18}),E.a.createElement("span",null," ",l("Request refund")," ")));return E.a.createElement(F,{onClick:function(){n.props.openRefundDialog(a,s,e)},icon:"refund"},l("Request refund"))}),b()(d()(n),"renderReprint",function(e,t){var i=n.props,o=i.orderId,r=i.siteId,a=i.translate;if(t)return E.a.createElement(P.a,{position:"top left",text:a("Label images older than 180 days are deleted by our technology partners for general security and data privacy concerns.")},E.a.createElement("button",{className:"popover__menu-item shipping-label__item-menu-reprint-expired",role:"menuitem",tabIndex:"-1"},E.a.createElement(N.a,{icon:"print",size:18}),E.a.createElement("span",null," ",a("Reprint")," ")));return E.a.createElement(F,{onClick:function(){n.props.openReprintDialog(o,r,e)},icon:"print"},a("Reprint shipping label"))}),b()(d()(n),"renderLabelDetails",function(e){var t=n.props,i=t.orderId,o=t.siteId,r=t.translate;return E.a.createElement(F,{onClick:function(){n.props.openDetailsDialog(i,o,e)},icon:"info-outline"},r("View details"))}),b()(d()(n),"renderPickup",function(e){var t=n.props.translate,i={usps:"https://tools.usps.com/schedule-pickup-steps.htm",fedex:"https://www.fedex.com/en-us/shipping/schedule-manage-pickups.html",ups:"https://wwwapps.ups.com/pickup/request",dhlexpress:"https://mydhl.express.dhl/us/en/home.html#/schedulePickupTab"};if(!i.hasOwnProperty(e))return null;return E.a.createElement(F,{onClick:function(){window.open(i[e],"_blank")},icon:"external"},t("Schedule a pickup"))}),n}return h()(t,e),a()(t,[{key:"renderCommercialInvoiceLink",value:function(){var e=this.props,t=e.translate,n=e.label.commercialInvoiceUrl;if(!n)return null;return E.a.createElement(F,{onClick:function(){window.open(n)},icon:"print"},t("Print customs form"))}},{key:"render",value:function(){var e=this.props,t=e.label,n=t.labelIndex,i=t.serviceName,o=t.packageName,r=t.productNames,a=t.receiptId,s=t.labelId,l=t.createdDate,c=t.refundableAmount,u=t.currency,p=t.showDetails,d=t.expiryDate,m=t.anonymized,h=t.usedDate,f=t.tracking,b=t.carrierId,g=t.commercialInvoiceUrl,v=e.siteId,y=e.orderId,w=e.translate,k=e.isModal,C=(new Date).getTime(),R=!1,I=!1;(m||h||d&&d<C)&&(R=!0);var N=(new Date).setDate((new Date).getDate()-30);return(m||h||l&&l<N)&&(I=!0),E.a.createElement("div",{className:"shipping-label__item"},E.a.createElement("p",{className:"shipping-label__item-detail"},w("%(service)s label (#%(labelIndex)d)",{args:{service:i,labelIndex:n+1}}),p&&E.a.createElement("span",null,!k&&E.a.createElement(A,{position:"bottom left"},this.renderLabelDetails(s),this.renderPickup(b),this.renderRefund(s,I,b,f),this.renderReprint(s,R),this.renderCommercialInvoiceLink(g)),E.a.createElement(ie,{siteId:v,orderId:y,labelIndex:n,serviceName:i,packageName:o,productNames:r,receiptId:a,labelId:s}),E.a.createElement(X,{siteId:v,orderId:y,createdDate:l,refundableAmount:c,currency:u,labelId:s}),E.a.createElement($,{siteId:v,orderId:y,labelId:s}))),p&&E.a.createElement("p",{className:"shipping-label__item-tracking"},w("Tracking #: {{trackingLink/}}",{components:{trackingLink:E.a.createElement(ae,{carrierId:b,tracking:f})}})))}}]),t}(k.Component);se.propTypes={siteId:w.a.number.isRequired,orderId:w.a.number.isRequired,label:w.a.shape({serviceName:w.a.string.isRequired,labelIndex:w.a.number.isRequired,packageName:w.a.string.isRequired,productNames:w.a.string.isRequired,receiptId:w.a.number.isRequired,labelId:w.a.number.isRequired,createdDate:w.a.string.isRequired,refundableAmount:w.a.number.isRequired,currency:w.a.string.isRequired,showDetails:w.a.bool.isRequired,expiryDate:w.a.string.isRequired,anonymized:w.a.bool.isRequired,usedDate:w.a.string.isRequired,tracking:w.a.string.isRequired,carrierId:w.a.string.isRequired,commercialInvoiceUrl:w.a.string}).isRequired,isModal:w.a.bool.isRequired,openRefundDialog:w.a.func.isRequired,openReprintDialog:w.a.func.isRequired,openDetailsDialog:w.a.func.isRequired};var le=Object(g.b)(null,function(e){return Object(O.b)({openRefundDialog:W.y,openReprintDialog:W.z,openDetailsDialog:W.u},e)})(Object(v.localize)(se)),ce=function(e){function t(){return o()(this,t),l()(this,u()(t).apply(this,arguments))}return h()(t,e),a()(t,[{key:"render",value:function(){var e=this.props,t=e.label,n=e.translate,i=t.serviceName,o=t.labelIndex;return E.a.createElement("div",{className:"shipping-label__item"},E.a.createElement("p",{className:"shipping-label__item-detail"},n("%(service)s label (#%(labelIndex)d)",{args:{service:i,labelIndex:o+1}}),E.a.createElement("br",null),n("Purchasing\u2026")))}}]),t}(se);se.propTypes={label:w.a.object.isRequired};var ue=Object(v.localize)(ce),pe=n(615),de=function(e){function t(){var e,n,i;o()(this,t);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=l()(this,(e=u()(t)).call.apply(e,[this].concat(a))),b()(d()(i),"eventPropsByType",(n={},b()(n,R.a.INTERNAL_NOTE,function(e){return{icon:"aside",heading:(0,i.props.translate)("Internal note"),content:Object(pe.a)(Object(pe.b)(e.content))}}),b()(n,R.a.CUSTOMER_NOTE,function(e){return{icon:"mail",heading:(0,i.props.translate)("Note sent to customer"),content:Object(pe.a)(Object(pe.b)(e.content))}}),b()(n,R.a.LABEL_PURCHASING,function(e){return{icon:"sync",content:E.a.createElement(ue,{label:e,orderId:i.props.orderId,siteId:i.props.siteId})}}),b()(n,R.a.LABEL_PURCHASED,function(e){return{icon:"print",content:E.a.createElement(le,{label:e,orderId:i.props.orderId,siteId:i.props.siteId,isModal:i.props.isModal})}}),b()(n,R.a.LABEL_REFUND_REQUESTED,function(e){var t=i.props.translate;return{icon:"time",content:E.a.createElement("div",null,t("%(service)s label (#%(labelNum)d) refund requested (%(amount)s)",{args:{service:e.serviceName,labelNum:e.labelIndex+1,amount:_()(e.amount,e.currency)}}))}}),b()(n,R.a.LABEL_REFUND_COMPLETED,function(e){var t=i.props.translate;return{icon:"refund",content:E.a.createElement("div",null,t("%(service)s label (#%(labelNum)d) refunded (%(amount)s)",{args:{service:e.serviceName,labelNum:e.labelIndex+1,amount:_()(e.amount,e.currency)}}))}}),b()(n,R.a.LABEL_REFUND_REJECTED,function(e){var t=i.props.translate;return{icon:"cross-small",content:E.a.createElement("div",null,t("%(service)s label (#%(labelNum)d) refund rejected",{service:e.serviceName,args:{labelNum:e.labelIndex+1}}))}}),b()(n,R.a.REFUND_NOTE,function(e){var t=i.props.translate;return{icon:"credit-card",heading:t("Refund"),content:E.a.createElement("div",null,t("Refunded %(amount)s",{args:{amount:_()(e.amount,e.currency)}}),E.a.createElement("br",null),e.reason)}}),b()(n,void 0,function(){return{}}),n)),b()(d()(i),"renderDefaultEvent",function(e){return{icon:"aside",heading:(0,i.props.translate)("Note"),content:e.content}}),i}return h()(t,e),a()(t,[{key:"render",value:function(){var e=this.props,t=e.moment,n=e.event,i=(this.eventPropsByType[n.type]||this.renderDefaultEvent)(n),o=i.icon,r=i.heading,a=i.content;return E.a.createElement("div",{className:"order-activity-log__note"},E.a.createElement("div",{className:"order-activity-log__note-meta"},E.a.createElement("span",{className:"order-activity-log__note-time"},t(n.timestamp).format("LT")),o&&E.a.createElement(N.a,{icon:o,size:24})),E.a.createElement("div",{className:"order-activity-log__note-body"},E.a.createElement("div",{className:"order-activity-log__note-type"},r),E.a.createElement("div",{className:"order-activity-log__note-content"},a)))}}]),t}(k.Component);b()(de,"propTypes",{customer_note:w.a.bool,date_created_gmt:w.a.string,note:w.a.string.isRequired}),b()(de,"propTypes",{event:w.a.object}),b()(de,"defaultProps",{event:{}});var me=Object(v.localize)(de),he=n(611),fe=function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return n=l()(this,(e=u()(t)).call.apply(e,[this].concat(r))),b()(d()(n),"onClick",function(){n.props.onClick(n.props.date)}),n}return h()(t,e),a()(t,[{key:"render",value:function(){var e=this.props,t=e.count,n=e.date,i=e.isOpen,o=e.moment,r=e.translate,a=o(n,"YYYYMMDD").format("ll"),s=E.a.createElement("div",null,E.a.createElement("h3",null,a),E.a.createElement("small",null,r("%(count)s event","%(count)s events",{count:t,args:{count:t}})));return E.a.createElement("div",{className:"order-activity-log__day"},E.a.createElement(he.a,{onClick:this.onClick,className:"order-activity-log__day-header",expanded:i,header:s,screenReaderText:r("Show notes from %(date)s",{args:{date:a}})},this.props.children))}}]),t}(k.Component);b()(fe,"propTypes",{count:w.a.number.isRequired,date:w.a.string.isRequired,isOpen:w.a.bool.isRequired,onClick:w.a.func.isRequired});var be=Object(v.localize)(fe);var ge=function(e){function t(){var e,n;o()(this,t);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return n=l()(this,(e=u()(t)).call.apply(e,[this].concat(r))),b()(d()(n),"toggleOpenDay",function(e){n.setState(function(){return{openDay:e}})}),b()(d()(n),"renderNotes",function(){var e=n.props,t=e.days,i=e.eventsByDay,o=e.translate;return t.length?E.a.createElement("div",null,t.map(function(e){var t=i[e];return E.a.createElement(be,{key:e,count:t.length,date:e,isOpen:e===n.state.openDay,onClick:n.toggleOpenDay},t.map(function(e){return E.a.createElement(me,{key:"".concat(e.type,"-").concat(e.key),event:e,orderId:n.props.orderId,siteId:n.props.siteId,isModal:n.props.isModal})}))})):E.a.createElement("p",null,o("No activity yet"))}),b()(d()(n),"renderPlaceholder",function(){return E.a.createElement("div",{className:"is-placeholder"},E.a.createElement(be,{count:0,date:"",isOpen:!0,index:1,onClick:C.noop},E.a.createElement(me,null)))}),n}return h()(t,e),a()(t,[{key:"UNSAFE_componentWillMount",value:function(){this.setState({openDay:Object(C.last)(Object(C.keys)(this.props.eventsByDay))})}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){var t=Object(C.last)(Object(C.keys)(e.eventsByDay));this.props.eventsByDay[t]||this.setState({openDay:t})}},{key:"render",value:function(){return this.props.isLoaded?this.renderNotes():this.renderPlaceholder()}}]),t}(k.Component);b()(ge,"propTypes",{orderId:w.a.number.isRequired,siteId:w.a.number.isRequired});t.a=Object(g.b)(function(e,t){var n=t.orderId||!1,i=Object(R.c)(e,n),o=Object(R.b)(e,n),r=o.length?function(e){var t={};return e.forEach(function(e){var n=Object(v.moment)(e.timestamp).format("YYYYMMDD");t[n]?t[n].push(e):t[n]=[e]}),Object(C.keys)(t).forEach(function(e){t[e]=Object(C.sortBy)(t[e],["timestamp","key"]).reverse()}),t}(o):{},a=r?Object(C.keys)(r):[];return a.sort().reverse(),{isLoaded:i,days:a,events:o,eventsByDay:r}})(Object(v.localize)(ge))},771:function(e,t,n){},772:function(e,t,n){}}]);
dist/chunks/{ca62601bd66f657259f7.css → 873ca02ffbab33229080.css} RENAMED
File without changes
dist/chunks/873ca02ffbab33229080.min.js ADDED
@@ -0,0 +1 @@
 
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[144],{532:function(e,t,n){"use strict";n.d(t,"a",function(){return r});n(1),n(560);function r(e){return e.ui.selectedSiteId}},535:function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return i}),n.d(t,"d",function(){return o}),n.d(t,"e",function(){return a}),n.d(t,"c",function(){return c}),n.d(t,"f",function(){return s}),n.d(t,"h",function(){return u}),n.d(t,"g",function(){return l}),n.d(t,"j",function(){return d}),n.d(t,"i",function(){return f}),n.d(t,"k",function(){return p}),n.d(t,"l",function(){return h}),n.d(t,"p",function(){return E}),n.d(t,"q",function(){return O}),n.d(t,"r",function(){return b}),n.d(t,"s",function(){return m}),n.d(t,"t",function(){return v}),n.d(t,"u",function(){return g}),n.d(t,"y",function(){return _}),n.d(t,"z",function(){return y}),n.d(t,"A",function(){return C}),n.d(t,"v",function(){return j}),n.d(t,"w",function(){return S}),n.d(t,"x",function(){return I}),n.d(t,"C",function(){return R}),n.d(t,"E",function(){return T}),n.d(t,"D",function(){return N}),n.d(t,"B",function(){return M}),n.d(t,"F",function(){return P}),n.d(t,"G",function(){return w}),n.d(t,"H",function(){return k}),n.d(t,"I",function(){return A}),n.d(t,"J",function(){return L}),n.d(t,"K",function(){return x}),n.d(t,"m",function(){return D}),n.d(t,"n",function(){return W}),n.d(t,"o",function(){return V}),n.d(t,"L",function(){return H}),n.d(t,"M",function(){return G}),n.d(t,"N",function(){return U}),n.d(t,"O",function(){return B}),n.d(t,"P",function(){return F}),n.d(t,"Q",function(){return z}),n.d(t,"R",function(){return q}),n.d(t,"W",function(){return K}),n.d(t,"X",function(){return Z}),n.d(t,"Y",function(){return Q}),n.d(t,"Z",function(){return Y}),n.d(t,"ab",function(){return $}),n.d(t,"bb",function(){return J}),n.d(t,"cb",function(){return X}),n.d(t,"db",function(){return ee}),n.d(t,"eb",function(){return te}),n.d(t,"fb",function(){return ne}),n.d(t,"gb",function(){return re}),n.d(t,"hb",function(){return ie}),n.d(t,"ib",function(){return oe}),n.d(t,"jb",function(){return ae}),n.d(t,"kb",function(){return ce}),n.d(t,"lb",function(){return se}),n.d(t,"mb",function(){return ue}),n.d(t,"nb",function(){return le}),n.d(t,"ob",function(){return de}),n.d(t,"pb",function(){return fe}),n.d(t,"rb",function(){return pe}),n.d(t,"qb",function(){return he}),n.d(t,"sb",function(){return Ee}),n.d(t,"tb",function(){return Oe}),n.d(t,"ub",function(){return be}),n.d(t,"vb",function(){return me}),n.d(t,"wb",function(){return ve}),n.d(t,"xb",function(){return ge}),n.d(t,"yb",function(){return _e}),n.d(t,"zb",function(){return ye}),n.d(t,"Ab",function(){return Ce}),n.d(t,"Bb",function(){return je}),n.d(t,"Cb",function(){return Se}),n.d(t,"Db",function(){return Ie}),n.d(t,"Eb",function(){return Re}),n.d(t,"Fb",function(){return Te}),n.d(t,"Gb",function(){return Ne}),n.d(t,"Hb",function(){return Me}),n.d(t,"Ib",function(){return Pe}),n.d(t,"U",function(){return we}),n.d(t,"V",function(){return ke}),n.d(t,"S",function(){return Ae}),n.d(t,"T",function(){return Le});var r="WOOCOMMERCE_ACTION_LIST_ANNOTATE",i="WOOCOMMERCE_ACTION_LIST_CLEAR",o="WOOCOMMERCE_ACTION_LIST_STEP_NEXT",a="WOOCOMMERCE_ACTION_LIST_STEP_SUCCESS",c="WOOCOMMERCE_ACTION_LIST_STEP_FAILURE",s="WOOCOMMERCE_COUNT_REQUEST",u="WOOCOMMERCE_COUNT_REQUEST_SUCCESS",l="WOOCOMMERCE_COUNT_REQUEST_FAILURE",d="WOOCOMMERCE_ERROR_SET",f="WOOCOMMERCE_ERROR_CLEAR",p="WOOCOMMERCE_LOCATIONS_REQUEST",h="WOOCOMMERCE_LOCATIONS_REQUEST_SUCCESS",E="WOOCOMMERCE_ORDER_DELETE",O="WOOCOMMERCE_ORDER_DELETE_FAILURE",b="WOOCOMMERCE_ORDER_DELETE_SUCCESS",m="WOOCOMMERCE_ORDER_INVOICE_SEND",v="WOOCOMMERCE_ORDER_INVOICE_SEND_FAILURE",g="WOOCOMMERCE_ORDER_INVOICE_SEND_SUCCESS",_="WOOCOMMERCE_ORDER_NOTE_CREATE",y="WOOCOMMERCE_ORDER_NOTE_CREATE_FAILURE",C="WOOCOMMERCE_ORDER_NOTE_CREATE_SUCCESS",j="WOOCOMMERCE_ORDER_NOTES_REQUEST",S="WOOCOMMERCE_ORDER_NOTES_REQUEST_FAILURE",I="WOOCOMMERCE_ORDER_NOTES_REQUEST_SUCCESS",R="WOOCOMMERCE_ORDER_REFUND_CREATE",T="WOOCOMMERCE_ORDER_REFUND_CREATE_SUCCESS",N="WOOCOMMERCE_ORDER_REFUND_CREATE_FAILURE",M="WOOCOMMERCE_ORDER_REFUNDS_REQUEST_SUCCESS",P="WOOCOMMERCE_ORDER_REQUEST",w="WOOCOMMERCE_ORDER_REQUEST_FAILURE",k="WOOCOMMERCE_ORDER_REQUEST_SUCCESS",A="WOOCOMMERCE_ORDER_UPDATE",L="WOOCOMMERCE_ORDER_UPDATE_FAILURE",x="WOOCOMMERCE_ORDER_UPDATE_SUCCESS",D="WOOCOMMERCE_ORDERS_REQUEST",W="WOOCOMMERCE_ORDERS_REQUEST_FAILURE",V="WOOCOMMERCE_ORDERS_REQUEST_SUCCESS",H="WOOCOMMERCE_SERVICES_SHIPPING_ACTION_LIST_CREATE",G="WOOCOMMERCE_SETTINGS_PRODUCTS_CHANGE_SETTING",U="WOOCOMMERCE_SETTINGS_PRODUCTS_REQUEST",B="WOOCOMMERCE_SETTINGS_PRODUCTS_REQUEST_SUCCESS",F="WOOCOMMERCE_SETTINGS_PRODUCTS_UPDATE_REQUEST",z="WOOCOMMERCE_SETTINGS_PRODUCTS_UPDATE_REQUEST_FAILURE",q="WOOCOMMERCE_SETTINGS_PRODUCTS_UPDATE_REQUEST_SUCCESS",K="WOOCOMMERCE_SHIPPING_ZONE_ADD",Z="WOOCOMMERCE_SHIPPING_ZONE_CANCEL",Q="WOOCOMMERCE_SHIPPING_ZONE_CLOSE",Y="WOOCOMMERCE_SHIPPING_ZONE_DELETED",$="WOOCOMMERCE_SHIPPING_ZONE_EDIT_NAME",J="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_CANCEL",X="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_CLOSE",ee="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_EDIT",te="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_EDIT_POSTCODE",ne="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_FILTER_BY_POSTCODE",re="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_FILTER_BY_STATE",ie="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_FILTER_BY_WHOLE_COUNTRY",oe="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_SELECT_CONTINENT",ae="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_SELECT_COUNTRY",ce="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_SELECT_STATE",se="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_UPDATED",ue="WOOCOMMERCE_SHIPPING_ZONE_METHODS_REQUEST",le="WOOCOMMERCE_SHIPPING_ZONE_METHODS_REQUEST_SUCCESS",de="WOOCOMMERCE_SHIPPING_ZONE_METHOD_ADD",fe="WOOCOMMERCE_SHIPPING_ZONE_METHOD_CANCEL",pe="WOOCOMMERCE_SHIPPING_ZONE_METHOD_CLOSE",he="WOOCOMMERCE_SHIPPING_ZONE_METHOD_CHANGE_TYPE",Ee="WOOCOMMERCE_SHIPPING_ZONE_METHOD_CREATE",Oe="WOOCOMMERCE_SHIPPING_ZONE_METHOD_DELETE",be="WOOCOMMERCE_SHIPPING_ZONE_METHOD_DELETED",me="WOOCOMMERCE_SHIPPING_ZONE_METHOD_EDIT_TITLE",ve="WOOCOMMERCE_SHIPPING_ZONE_METHOD_OPEN",ge="WOOCOMMERCE_SHIPPING_ZONE_METHOD_REMOVE",_e="WOOCOMMERCE_SHIPPING_ZONE_METHOD_SET_CONDITION",ye="WOOCOMMERCE_SHIPPING_ZONE_METHOD_SET_COST",Ce="WOOCOMMERCE_SHIPPING_ZONE_METHOD_SET_MIN_COST",je="WOOCOMMERCE_SHIPPING_ZONE_METHOD_SET_TAXABLE",Se="WOOCOMMERCE_SHIPPING_ZONE_METHOD_TOGGLE_ENABLED",Ie="WOOCOMMERCE_SHIPPING_ZONE_METHOD_TOGGLE_OPENED_ENABLED",Re="WOOCOMMERCE_SHIPPING_ZONE_METHOD_UPDATE",Te="WOOCOMMERCE_SHIPPING_ZONE_METHOD_UPDATED",Ne="WOOCOMMERCE_SHIPPING_ZONE_OPEN",Me="WOOCOMMERCE_SHIPPING_ZONE_REMOVE",Pe="WOOCOMMERCE_SHIPPING_ZONE_UPDATED",we="WOOCOMMERCE_SHIPPING_ZONES_REQUEST",ke="WOOCOMMERCE_SHIPPING_ZONES_REQUEST_SUCCESS",Ae="WOOCOMMERCE_SHIPPING_CLASSES_REQUEST",Le="WOOCOMMERCE_SHIPPING_CLASSES_REQUEST_SUCCESS"},537:function(e,t,n){"use strict";n.d(t,"j",function(){return h}),n.d(t,"t",function(){return E}),n.d(t,"s",function(){return O}),n.d(t,"r",function(){return b}),n.d(t,"h",function(){return m}),n.d(t,"g",function(){return v}),n.d(t,"v",function(){return g}),n.d(t,"u",function(){return _}),n.d(t,"m",function(){return y}),n.d(t,"e",function(){return C}),n.d(t,"l",function(){return j}),n.d(t,"p",function(){return S}),n.d(t,"n",function(){return N}),n.d(t,"f",function(){return w}),n.d(t,"o",function(){return k}),n.d(t,"q",function(){return A}),n.d(t,"d",function(){return L}),n.d(t,"b",function(){return x}),n.d(t,"i",function(){return D}),n.d(t,"c",function(){return W}),n.d(t,"k",function(){return V}),n.d(t,"a",function(){return H});var r=n(1),i=n(35),o=n(542),a=n(532),c=n(551),s=n(546),u=n(540),l=n(564),d=n(575),f=n(565),p=n(566),h=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);return Object(r.get)(e,["extensions","woocommerce","woocommerceServices",n,"shippingLabel",t],null)},E=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e),r=h(e,t,n);return r&&r.loaded},O=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e),r=h(e,t,n);return r&&r.isFetching},b=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e),r=h(e,t,n);return r&&r.error},m=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e),r=h(e,t,n);return r&&r.loaded?r.labels:[]},v=function(e,t,n,r){return m(e,t,n).find(function(e){return e.label_id===r})},g=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e),r=h(e,t,n);return r&&r.fulfillOrder},_=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e),r=h(e,t,n);return r&&r.emailDetails},y=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e),r=h(e,t,n);return r&&r.refreshedLabelStatus},C=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e),r=h(e,t,n);return r&&r.form},j=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e),o=C(e,t,n);if(!o)return null;var c=o.rates,s=c.values,u=c.available,l=[],d=0,f=0,p=function(e){if(!(e in u))return"continue";var t=s[e],n=t.serviceId,o=t.signatureRequired,a=u[e].default.rates,c=null,p=null;o in u[e]&&(c=u[e][o].rates,p=Object(r.find)(c,function(e){return n===e.service_id})||null);var h=Object(r.find)(a,function(e){return n===e.service_id});if(h){var E=h.retail_rate-h.rate,O=h.rate,b={title:h.title,retailRate:h.retail_rate,rateWithDiscount:O,addons:[],carrierId:h.carrier_id,carrierTitle:h.title.split("-")[0].trim()};null!==p&&(b.addons=[{title:Object(i.translate)("Signature Required"),rate:p.rate-h.rate}],O=p.rate),l.push(b),d+=Object(r.round)(E,2),f+=O}};for(var h in s)p(h);return l.length?{prices:l,discount:d,total:f}:null},S=Object(o.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e),i=C(e,t,n);if(Object(r.isEmpty)(i))return!1;var o=Object(l.a)(i.origin),c=Object(l.a)(i.destination);return!("US"!==o.country||!Object(r.includes)(d.d,o.state))||(!("US"!==c.country||!Object(r.includes)(d.d,c.state))||o.country!==c.country&&(!Object(r.includes)(d.b,o.country)||!Object(r.includes)(d.b,c.country)))},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);return[C(e,t,n)]}),I=function(e,t,n,o){var a=t.values,c=Object(l.a)(t),s=c.phone,u=c.postcode,p=c.state,h=c.country,E={};return["name","address","city","postcode","country"].forEach(function(e){a[e]||(E[e]=Object(i.translate)("This field is required"))}),Object(r.includes)(d.a,h)&&!/^\d{5}(?:-\d{4})?$/.test(u)&&(E.postcode=Object(i.translate)("Invalid ZIP/Postal code format")),!p&&Object(f.j)(e,h,n)&&(E.state=Object(i.translate)("This field is required")),o&&(s?10!==s.split(/\D+/g).join("").replace(/^1/,"").length&&(E.phone=Object(i.translate)("Customs forms require a 10-digit phone number. Please edit your phone number so it has at most 10 digits.")):E.phone=Object(i.translate)("Please enter a phone number for your origin address. It's required because this shipment requires a customs form.")),E},R=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=e.isNormalized,a=e.isUnverifiable,c=e.normalized,s=e.ignoreValidation,u=e.fieldErrors;if((o||a)&&!c&&u)return u;if(o&&!c)return{address:Object(i.translate)("This address is not recognized. Please try another.")};var l=I(t,e,n,r);return s&&Object.keys(l).forEach(function(e){s[e]&&delete l[e]}),l},T=function(e,t,n,o){var a=Object(r.uniq)(Object(r.flatten)(Object(r.map)(e,function(e){return Object(r.map)(e.items,"product_id")}))),c=Object(r.zipObject)(a,Object(r.fill)(Array(a.length),0));Object(r.forEach)(e,function(e){Object(r.forEach)(e.items,function(e){var n=e.quantity,r=e.product_id;return c[r]+=n*t.items[r].value})});var s={};return Object(r.forEach)(Object(r.pick)(t.items,a),function(e,t){e.tariffNumber&&6===e.tariffNumber.length&&(s[e.tariffNumber]||(s[e.tariffNumber]=0),s[e.tariffNumber]+=c[t])}),{packages:Object(r.mapValues)(e,function(e){var a={};"other"!==e.contentsType||e.contentsExplanation||(a.contentsExplanation=Object(i.translate)("Please describe what kind of goods this package contains")),"other"!==e.restrictionType||e.restrictionComments||(a.restrictionComments=Object(i.translate)("Please describe what kind of restrictions this package must have"));var c=new Set;return Object(r.forEach)(e.items,function(e){var n=e.product_id,r=t.items[n].tariffNumber;2500<s[r]&&c.add(r)}),e.itn?/^(?:(?:AES X\d{14})|(?:NOEEI 30\.\d{1,2}(?:\([a-z]\)(?:\(\d\))?)?))$/.test(e.itn)||(a.itn=Object(i.translate)("Invalid format")):"CA"!==n&&(Object(r.isEmpty)(c)?Object(r.includes)(d.c,n)&&(a.itn=Object(i.translate)("International Transaction Number is required for shipments to %(country)s",{args:{country:o}})):a.itn=Object(i.translate)("International Transaction Number is required for shipping items valued over $2,500 per tariff number. Products with tariff number %(code)s add up to more than $2,500.",{args:{code:c.values().next().value}})),a}),items:Object(r.mapValues)(Object(r.pick)(t.items,a),function(e,n){var o={};return e.description||(o.description=Object(i.translate)("This field is required")),t.ignoreWeightValidation[n]||(Object(r.isNil)(e.weight)||""===e.weight?o.weight=Object(i.translate)("This field is required"):parseFloat(e.weight)>0||(o.weight=Object(i.translate)("Weight must be greater than zero"))),t.ignoreValueValidation[n]||(Object(r.isNil)(e.value)||""===e.value?o.value=Object(i.translate)("This field is required"):parseFloat(e.value)>0||(o.value=Object(i.translate)("Declared value must be greater than zero"))),e.tariffNumber&&6!==e.tariffNumber.length&&(o.tariffNumber=Object(i.translate)("The tariff number must be 6 digits long")),o})}},N=function(e){var t=e.values,n=e.available,i=Object(r.map)(n,function(e,n){return t[n]});return!Object(r.isEmpty)(i)&&Object(r.every)(i)},M=function(e){var t=e.values,n=e.available;return Object(r.mapValues)(n,function(e,n){if(!Object(r.isEmpty)(e.default.errors)){var o=e.default.errors.map(function(e){return e.userMessage||e.message}).filter(Boolean);return o.length?o:["We couldn't get a rate for this package, please try again."]}return t[n]&&t[n].serviceId?[]:Object(r.isEmpty)(e.default.rates)?[Object(i.translate)("No rates available, please double check dimensions and weight or try using different packaging.")]:[Object(i.translate)("Please choose a rate")]})},P=function(e){var t={};return e||(t.paperSize=Object(i.translate)("This field is required")),t},w=Object(o.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);if(!E(e,t,n))return{};var o=h(e,t,n),c=o.form,s=o.paperSize;if(Object(r.isEmpty)(c))return{};var u,l=c.destination.values.country,d=Object(f.g)(e,l,n),p=S(e,t,n);return{origin:R(c.origin,e,n,p),destination:R(c.destination,e,n),packages:(u=c.packages.selected,Object(r.mapValues)(u,function(e){var t={};"not_selected"===e.box_id&&(t.box_id=Object(i.translate)("Please select a package"));var n=function(e){return!Object(r.isFinite)(e)||0>=e};return n(e.weight)&&(t.weight=Object(i.translate)("Invalid weight")),Object(r.some)([e.length,e.width,e.height],n)&&(t.dimensions=Object(i.translate)("Package dimensions must be greater than zero")),t})),customs:T(c.packages.selected,c.customs,l,d),rates:M(c.rates),sidebar:P(s)}},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);return[h(e,t,n)]}),k=Object(o.a)(function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Object(a.a)(e),i=h(e,t,r).form,o="origin"===n&&S(e,t,r),c=I(e,i[n],r,o);return 0===Object.keys(c).length},function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Object(a.a)(e);return[h(e,t,r).form[n]]}),A=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e),i=C(e,t,n);if(!i)return!1;var o=Object(r.uniq)(Object(r.flatten)(Object(r.map)(i.packages.selected,function(e){return Object(r.map)(e.items,"product_id")})));return!Object(r.some)(o.map(function(e){return Object(r.isNil)(i.customs.items[e].tariffNumber)||i.customs.ignoreWeightValidation[e]||i.customs.ignoreValueValidation[e]}))},L=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e),i=C(e,t,n);if(!i)return null;var o=w(e,t,n);return i.origin.isNormalized&&Object(r.isEqual)(i.origin.values,i.origin.normalized)&&!Object(c.a)(o.origin)?i.destination.isNormalized&&Object(r.isEqual)(i.destination.values,i.destination.normalized)&&!Object(c.a)(o.destination)?Object(c.a)(o.packages)?"packages":!S(e,t,n)||!Object(c.a)(o.customs)&&A(e,t,n)?Object(c.a)(o.rates)?"rates":null:"customs":"destination":"origin"},x=Object(o.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e),i=C(e,t,n);return!Object(r.isEmpty)(i)&&!L(e,t,n)&&!i.origin.normalizationInProgress&&!i.destination.normalizationInProgress&&!i.rates.retrievalInProgress&&!Object(r.isEmpty)(i.rates.available)},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);return[C(e,t,n),L(e,t,n)]}),D=Object(o.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=Object(f.d)(e,t);return Object(p.b)(e,t)?Object(r.pick)(n,d.a):Object(r.pick)(n,d.b)},[f.d,p.b]),W=Object(o.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=Object(f.d)(e,t);return Object(p.b)(e,t)?n:Object(r.pick)(n,d.b)},[f.d,p.b]),V=Object(o.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);if(!Object(f.j)(e,t,n))return null;var i=Object(f.i)(e,t,n),o={};return i.forEach(function(e){var t=e.code,n=e.name;return o[t]=n}),"US"!==t||Object(p.b)(e,n)?o:Object(r.omit)(o,d.d)},[f.i,p.b]),H=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);return E(e,t,n)&&Object(s.d)(e,n)&&Object(u.i)(e,n)&&Object(f.b)(e,n)}},538:function(e,t,n){"use strict";n.d(t,"b",function(){return r}),n.d(t,"d",function(){return i}),n.d(t,"e",function(){return o}),n.d(t,"f",function(){return a}),n.d(t,"c",function(){return c}),n.d(t,"a",function(){return s}),n.d(t,"g",function(){return u}),n.d(t,"h",function(){return l}),n.d(t,"i",function(){return d}),n.d(t,"j",function(){return f}),n.d(t,"k",function(){return p}),n.d(t,"l",function(){return h}),n.d(t,"m",function(){return E}),n.d(t,"n",function(){return O}),n.d(t,"o",function(){return b}),n.d(t,"q",function(){return m}),n.d(t,"p",function(){return v}),n.d(t,"r",function(){return g}),n.d(t,"s",function(){return _}),n.d(t,"t",function(){return y}),n.d(t,"u",function(){return C}),n.d(t,"v",function(){return j}),n.d(t,"w",function(){return S}),n.d(t,"B",function(){return I}),n.d(t,"x",function(){return R}),n.d(t,"C",function(){return T}),n.d(t,"z",function(){return N}),n.d(t,"A",function(){return M}),n.d(t,"D",function(){return P}),n.d(t,"E",function(){return w}),n.d(t,"F",function(){return k}),n.d(t,"G",function(){return A}),n.d(t,"H",function(){return L}),n.d(t,"I",function(){return x}),n.d(t,"J",function(){return D}),n.d(t,"K",function(){return W}),n.d(t,"L",function(){return V}),n.d(t,"M",function(){return H}),n.d(t,"N",function(){return G}),n.d(t,"y",function(){return U}),n.d(t,"O",function(){return B}),n.d(t,"P",function(){return F}),n.d(t,"Q",function(){return z}),n.d(t,"R",function(){return q}),n.d(t,"S",function(){return K}),n.d(t,"T",function(){return Z}),n.d(t,"U",function(){return Q}),n.d(t,"Ob",function(){return Y}),n.d(t,"V",function(){return $}),n.d(t,"W",function(){return J}),n.d(t,"X",function(){return X}),n.d(t,"Y",function(){return ee}),n.d(t,"Z",function(){return te}),n.d(t,"ab",function(){return ne}),n.d(t,"bb",function(){return re}),n.d(t,"cb",function(){return ie}),n.d(t,"db",function(){return oe}),n.d(t,"eb",function(){return ae}),n.d(t,"fb",function(){return ce}),n.d(t,"gb",function(){return se}),n.d(t,"hb",function(){return ue}),n.d(t,"ib",function(){return le}),n.d(t,"jb",function(){return de}),n.d(t,"kb",function(){return fe}),n.d(t,"lb",function(){return pe}),n.d(t,"nb",function(){return he}),n.d(t,"mb",function(){return Ee}),n.d(t,"ob",function(){return Oe}),n.d(t,"pb",function(){return be}),n.d(t,"qb",function(){return me}),n.d(t,"rb",function(){return ve}),n.d(t,"sb",function(){return ge}),n.d(t,"tb",function(){return _e}),n.d(t,"ub",function(){return ye}),n.d(t,"vb",function(){return Ce}),n.d(t,"wb",function(){return je}),n.d(t,"xb",function(){return Se}),n.d(t,"zb",function(){return Ie}),n.d(t,"Ab",function(){return Re}),n.d(t,"Bb",function(){return Te}),n.d(t,"Cb",function(){return Ne}),n.d(t,"Db",function(){return Me}),n.d(t,"Eb",function(){return Pe}),n.d(t,"Fb",function(){return we}),n.d(t,"Gb",function(){return ke}),n.d(t,"Hb",function(){return Ae}),n.d(t,"Ib",function(){return Le}),n.d(t,"Jb",function(){return xe}),n.d(t,"yb",function(){return De}),n.d(t,"Lb",function(){return We}),n.d(t,"Kb",function(){return Ve}),n.d(t,"Mb",function(){return He}),n.d(t,"Nb",function(){return Ge}),n.d(t,"Pb",function(){return Ue}),n.d(t,"Qb",function(){return Be}),n.d(t,"Rb",function(){return Fe});var r="WOOCOMMERCE_SERVICES_LABELS_INIT_FORM",i="WOOCOMMERCE_SERVICES_LABELS_RESTORE_PRISTINE",o="WOOCOMMERCE_SERVICES_LABELS_SET_FORM_DATA_VALUE",a="WOOCOMMERCE_SERVICES_LABELS_SET_FORM_META_PROPERTY",c="WOOCOMMERCE_SERVICES_LABELS_OPEN_ADD_CARD_DIALOG",s="WOOCOMMERCE_SERVICES_LABELS_CLOSE_ADD_CARD_DIALOG",u="WOOCOMMERCE_SERVICES_PACKAGES_ADD_PACKAGE",l="WOOCOMMERCE_SERVICES_PACKAGES_DISMISS_MODAL",d="WOOCOMMERCE_SERVICES_PACKAGES_EDIT_PACKAGE",f="WOOCOMMERCE_SERVICES_PACKAGES_INIT_PACKAGES_FORM",p="WOOCOMMERCE_SERVICES_PACKAGES_REMOVE_PACKAGE",h="WOOCOMMERCE_SERVICES_PACKAGES_REMOVE_PREDEFINED",E="WOOCOMMERCE_SERVICES_PACKAGES_SAVE_PACKAGE",O="WOOCOMMERCE_SERVICES_PACKAGES_SAVE_PREDEFINED",b="WOOCOMMERCE_SERVICES_PACKAGES_SET_ADD_MODE",m="WOOCOMMERCE_SERVICES_PACKAGES_SET_IS_FETCH_ERROR",v="WOOCOMMERCE_SERVICES_PACKAGES_SET_IS_FETCHING",g="WOOCOMMERCE_SERVICES_PACKAGES_SET_IS_SAVING",_="WOOCOMMERCE_SERVICES_PACKAGES_SET_MODAL_ERROR",y="WOOCOMMERCE_SERVICES_PACKAGES_TOGGLE_ALL_PREDEFINED",C="WOOCOMMERCE_SERVICES_PACKAGES_TOGGLE_OUTER_DIMENSIONS",j="WOOCOMMERCE_SERVICES_PACKAGES_TOGGLE_PREDEFINED",S="WOOCOMMERCE_SERVICES_PACKAGES_UPDATE_PACKAGES_FIELD",I="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_ADD_ITEMS",R="WOOCOMMERCE_SERVICES_SERVICE_SETTINGS_UPDATE_FIELD",T="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_ADD_PACKAGE",N="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_ADDRESS_NORMALIZATION_COMPLETED",M="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_ADDRESS_NORMALIZATION_IN_PROGRESS",P="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLEAR_AVAILABLE_RATES",w="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_ADD_ITEM",k="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_DETAILS_DIALOG",A="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_ITEM_MOVE",L="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_REFUND_DIALOG",x="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CLOSE_REPRINT_DIALOG",D="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CONFIRM_ADDRESS_SUGGESTION",W="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_CONFIRM_REPRINT",V="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_EDIT_ADDRESS",H="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_EDIT_UNVERIFIABLE_ADDRESS",G="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_EXIT_PRINTING_FLOW",U="WOOCOMMERCE_SERVICES_SHIPPING_EXIT_TRACKING_FLOW",B="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_INIT",F="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_MOVE_ITEM",z="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_ADD_ITEM",q="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_DETAILS_DIALOG",K="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_ITEM_MOVE",Z="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_PACKAGE",Q="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_PRINTING_FLOW",Y="WOOCOMMERCE_SERVICES_SHIPPING_OPEN_TRACKING_FLOW",$="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_REFUND_DIALOG",J="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_OPEN_REPRINT_DIALOG",X="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_PURCHASE_REQUEST",ee="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_PURCHASE_RESPONSE",te="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_RATES_RETRIEVAL_COMPLETED",ne="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_RATES_RETRIEVAL_IN_PROGRESS",re="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REFUND_REQUEST",ie="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REFUND_RESPONSE",oe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REMOVE_IGNORE_VALIDATION",ae="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REMOVE_PACKAGE",ce="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REPRINT_DIALOG_ERROR",se="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_REPRINT_DIALOG_READY",ue="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SAVE_CUSTOMS",le="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SAVE_PACKAGES",de="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SELECT_NORMALIZED_ADDRESS",fe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_ABANDON_ON_NON_DELIVERY",pe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_ADDED_ITEM",he="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CONTENTS_TYPE",Ee="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CONTENTS_EXPLANATION",Oe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_DESCRIPTION",be="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_ORIGIN_COUNTRY",me="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_TARIFF_NUMBER",ve="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_VALUE",ge="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_CUSTOMS_ITEM_WEIGHT",_e="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_EMAIL_DETAILS",ye="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_FETCH_ERROR",Ce="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_FULFILL_ORDER",je="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_IS_FETCHING",Se="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_ITN",Ie="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_PACKAGE_TYPE",Re="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_RATES",Te="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_RESTRICTION_COMMENTS",Ne="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_RESTRICTION_TYPE",Me="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_TARGET_PACKAGE",Pe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SHOW_PRINT_CONFIRMATION",we="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_STATUS_RESPONSE",ke="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_STATUS_RETRIEVAL_IN_PROGRESS",Ae="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_TOGGLE_STEP",Le="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_UPDATE_ADDRESS_VALUE",xe="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_UPDATE_PACKAGE_WEIGHT",De="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_SET_PACKAGE_SIGNATURE",We="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_UPDATE_RATE",Ve="WOOCOMMERCE_SERVICES_SHIPPING_LABEL_UPDATE_PAPER_SIZE",He="WOOCOMMERCE_SERVICES_SHIPPING_METHOD_SCHEMA_REQUEST",Ge="WOOCOMMERCE_SERVICES_SHIPPING_METHOD_SCHEMA_REQUEST_SUCCESS",Ue="WOOCOMMERCE_SERVICES_SHIPPING_ZONE_METHOD_SETTINGS_REQUEST",Be="WOOCOMMERCE_SERVICES_SHIPPING_ZONE_METHOD_SETTINGS_REQUEST_SUCCESS",Fe="WOOCOMMERCE_SERVICES_SHIPPING_ZONE_METHOD_UPDATE"},539:function(e,t,n){"use strict";n.d(t,"b",function(){return r}),n.d(t,"a",function(){return i});var r="LOADING",i="ERROR"},540:function(e,t,n){"use strict";n.d(t,"e",function(){return h}),n.d(t,"b",function(){return O}),n.d(t,"d",function(){return b}),n.d(t,"a",function(){return m}),n.d(t,"c",function(){return v}),n.d(t,"f",function(){return g}),n.d(t,"i",function(){return _}),n.d(t,"h",function(){return y}),n.d(t,"g",function(){return C});var r=n(110),i=n.n(r),o=n(36),a=n.n(o),c=n(1),s=n(35),u=n(542),l=n(532),d=n(575),f=n(564),p=n(537),h=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e);return Object(c.get)(e,["extensions","woocommerce","woocommerceServices",t,"packages"],null)},E=function(e){return e&&e.predefinedSchema?Object.keys(e.predefinedSchema):[]},O=Object(u.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=h(e,t);if(!n||!n.predefinedSchema||!n.packages)return null;var r=[];Object(c.forEach)(n.predefinedSchema,function(e,t){var i=(n.packages.predefined||{})[t]||[];Object(c.forEach)(e,function(e){var n=e.definitions;Object(c.forEach)(n,function(e){Object(c.includes)(i,e.id)&&r.push(a()({},e,{serviceId:t}))})})});var i=(n.packages.custom||[]).map(function(e,t){return a()({},e,{index:t})});return Object(c.orderBy)(r.concat(i),"name")},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=h(e,t);if(!n||!n.packages)return[];var r=E(n);return[].concat(i()(n.packages.custom||[]),i()(r.map(function(e){return(n.packages.predefined||{})[e]})))}),b=Object(u.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(l.a)(e),r=h(e,n);if(!r||!r.predefinedSchema||!r.packages)return null;var i=Object(p.e)(e,t,n),o=Object(f.a)(i.origin).country,a=Object(f.a)(i.destination).country,u=d.a.includes(o)&&!d.a.includes(a),E={custom:{title:Object(s.translate)("Custom Packages"),definitions:r.packages.custom}};return Object(c.forEach)(r.predefinedSchema,function(e,t){var n=(r.packages.predefined||{})[t]||[];Object(c.forEach)(e,function(e,t){var r=e.definitions,i={title:e.title,definitions:[]};Object(c.forEach)(r,function(e){u&&!1===e.can_ship_international||Object(c.includes)(n,e.id)&&i.definitions.push(e)}),i.definitions.length&&(E[t]=i)})}),E},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(l.a)(e),r=h(e,n);if(!r||!r.packages)return[];var o=E(r),a=Object(p.e)(e,t,n),c=Object(f.a)(a.origin).country,s=Object(f.a)(a.destination).country;return[].concat(i()(r.packages.custom||[]),i()(o.map(function(e){return(r.packages.predefined||{})[e]})),[c,s])}),m=Object(u.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=h(e,t);if(!n||!n.predefinedSchema||!n.packages)return null;var r={};return Object(c.forEach)(n.packages.custom,function(e){r[e.name]=e}),Object(c.forEach)(n.predefinedSchema,function(e){Object(c.forEach)(e,function(e){var t=e.definitions;Object(c.forEach)(t,function(e){r[e.id]=e})})}),r},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=h(e,t);if(!n||!n.packages)return[];var r=E(n);return[].concat(i()(n.packages.custom||[]),i()(r.map(function(e){return(n.packages.predefined||{})[e]})))}),v=Object(u.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=h(e,t);if(!n||!n.currentlyEditingPredefinedPackages)return null;var r={},i=n.predefinedSchema,o=n.currentlyEditingPredefinedPackages;return Object(c.forEach)(i,function(e,t){var n=o[t]||[];Object(c.forEach)(e,function(e,i){var o={groupId:i,serviceId:t,title:e.title,packages:[],total:e.definitions.length,selected:0};Object(c.forEach)(e.definitions,function(e){var r=Object(c.includes)(n,e.id);r&&o.selected++,o.packages.push(a()({},e,{selected:r,serviceId:t}))}),r["".concat(t,"-").concat(i)]=o})}),r},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=h(e,t);if(!n||!n.currentlyEditingPredefinedPackages)return[];var r=E(n);return i()(r.map(function(e){return n.currentlyEditingPredefinedPackages[e]}))}),g=Object(u.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=0,r=0,i=h(e,t);if(!i||!i.currentlyEditingPredefinedPackages)return{added:n,removed:r};var o=i.packages&&i.packages.predefined?i.packages.predefined:{},a=i.currentlyEditingPredefinedPackages;return Object.keys(a).forEach(function(e){var t=o[e],r=a[e];t?r.forEach(function(e){Object(c.includes)(t,e)||n++}):n+=r.length}),Object.keys(o).forEach(function(e){var t=o[e],n=a[e];n?t.forEach(function(e){Object(c.includes)(n,e)||r++}):r+=t.length}),{added:n,removed:r}},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=h(e,t);if(!n||!n.currentlyEditingPredefinedPackages)return[];var r=E(n);return[].concat(i()(r.map(function(e){return n.packages&&n.packages.predefined&&n.packages.predefined[e]})),i()(r.map(function(e){return n.currentlyEditingPredefinedPackages[e]})))}),_=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=h(e,t);return n&&n.isLoaded},y=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=h(e,t);return n&&n.isFetching},C=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=h(e,t);return n&&n.isFetchError}},541:function(e,t,n){"use strict";n.d(t,"e",function(){return r}),n.d(t,"c",function(){return y}),n.d(t,"d",function(){return C}),n.d(t,"b",function(){return j}),n.d(t,"a",function(){return S});var r={};n.r(r),n.d(r,"accountSettings",function(){return o}),n.d(r,"packages",function(){return a}),n.d(r,"orderLabels",function(){return c}),n.d(r,"getLabelRates",function(){return s}),n.d(r,"labelStatus",function(){return u}),n.d(r,"labelRefund",function(){return l}),n.d(r,"labelsPrint",function(){return d}),n.d(r,"labelTestPrint",function(){return f}),n.d(r,"addressNormalization",function(){return p}),n.d(r,"serviceSettings",function(){return h}),n.d(r,"shippingCarrier",function(){return E}),n.d(r,"shippingCarriers",function(){return O}),n.d(r,"subscriptions",function(){return b}),n.d(r,"subscriptionActivate",function(){return m}),n.d(r,"shippingCarrierDelete",function(){return v}),n.d(r,"shippingCarrierTypes",function(){return g});var i=n(563),o="connect/account/settings",a="connect/packages",c=function(e){return"connect/label/".concat(e)},s=function(e){return"connect/label/".concat(e,"/rates")},u=function(e,t){return"connect/label/".concat(e,"/").concat(t)},l=function(e,t){return"connect/label/".concat(e,"/").concat(t,"/refund")},d=function(){return"connect/label/print"},f=function(){return"connect/label/preview"},p=function(){return"connect/normalize-address"},h=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"connect/services/".concat(e,"/").concat(t)},E=function(){return"connect/shipping/carrier"},O=function(){return"connect/shipping/carriers"},b=function(){return"connect/subscriptions"},m=function(e){return"connect/subscription/".concat(e,"/activate")},v=function(e){return"connect/shipping/carrier/".concat(e)},g=function(){return"connect/shipping/carrier-types"},_=function(e){if(e&&e.message)throw e.message;if(e&&e.data&&e.data.message)throw e.data.message;throw e},y=function(e,t,n){return Object(i.a)(e).post(t,n,"wc/v1").catch(_)},C=function(e,t,n){return Object(i.a)(e).put(t,n,"wc/v1").catch(_)},j=function(e,t){return Object(i.a)(e).get(t,"wc/v1").catch(_)},S=function(e,t){return Object(i.a)(e).del(t,"wc/v1").catch(_)}},542:function(e,t,n){"use strict";n.d(t,"a",function(){return u});var r=n(1),i=n(603),o=n.n(i),a=(n(113),function(e){return e}),c=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.join()},s=function(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return e.map(function(e){return e.apply(void 0,[t].concat(r))})}};function u(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:c,u=Object(r.memoize)(e,i);return Array.isArray(n)&&(n=s(n)),Object.assign(function(e){for(var r=arguments.length,i=new Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];var c=n.apply(void 0,[e].concat(i));return Array.isArray(c)||(c=[c]),t&&!o()(c,t)&&u.cache.clear(),t=c,u.apply(void 0,[e].concat(i))},{memoizedSelector:u})}},544:function(e,t,n){"use strict";n.d(t,"a",function(){return S});var r=n(530),i=n.n(r),o=n(533),a=n.n(o),c=n(107),s=n.n(c),u=n(108),l=n.n(u),d=n(528),f=n.n(d),p=n(527),h=n.n(p),E=n(529),O=n.n(E),b=n(34),m=n.n(b),v=n(10),g=n.n(v),_=n(12),y=n.n(_),C=n(526),j=n.n(C),S=function(e){function t(){return s()(this,t),f()(this,h()(t).apply(this,arguments))}return O()(t,e),l()(t,[{key:"render",value:function(){var e=j()("button",this.props.className,{"is-compact":this.props.compact,"is-primary":this.props.primary,"is-scary":this.props.scary,"is-busy":this.props.busy,"is-borderless":this.props.borderless});if(this.props.href){var t=this.props,n=(t.compact,t.primary,t.scary,t.busy,t.borderless,t.type,a()(t,["compact","primary","scary","busy","borderless","type"])),r=n.target?(n.rel||"").replace(/noopener|noreferrer/g,"")+" noopener noreferrer":n.rel;return g.a.createElement("a",i()({},n,{rel:r,className:e}))}var o=this.props,c=(o.compact,o.primary,o.scary,o.busy,o.borderless,o.target,o.rel,a()(o,["compact","primary","scary","busy","borderless","target","rel"]));return g.a.createElement("button",i()({},c,{className:e}))}}]),t}(v.PureComponent);m()(S,"propTypes",{compact:y.a.bool,primary:y.a.bool,scary:y.a.bool,busy:y.a.bool,type:y.a.string,href:y.a.string,borderless:y.a.bool,target:y.a.string,rel:y.a.string}),m()(S,"defaultProps",{type:"button"})},545:function(e,t,n){"use strict";n.d(t,"c",function(){return s}),n.d(t,"d",function(){return l}),n.d(t,"a",function(){return d}),n.d(t,"b",function(){return f});var r=n(533),i=n.n(r),o=n(1),a={debounce:o.debounce,isPlainObject:o.isPlainObject,uniqueId:o.uniqueId},c=(n(46),a.uniqueId);function s(e){return{noticeId:e,type:"NOTICE_REMOVE"}}function u(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.id,o=i()(n,["id"]);return{type:"NOTICE_CREATE",notice:Object.assign({showDismiss:!0},o,{noticeId:r||c(),status:e,text:t})}}var l=u.bind(null,"is-success"),d=u.bind(null,"is-error"),f=u.bind(null,"is-info");u.bind(null,"is-warning"),u.bind(null,"is-plain")},546:function(e,t,n){"use strict";n.d(t,"f",function(){return a}),n.d(t,"g",function(){return c}),n.d(t,"h",function(){return s}),n.d(t,"i",function(){return u}),n.d(t,"d",function(){return l}),n.d(t,"c",function(){return d}),n.d(t,"b",function(){return f}),n.d(t,"a",function(){return p}),n.d(t,"n",function(){return h}),n.d(t,"o",function(){return E}),n.d(t,"e",function(){return O}),n.d(t,"q",function(){return b}),n.d(t,"p",function(){return m}),n.d(t,"k",function(){return v}),n.d(t,"l",function(){return g}),n.d(t,"m",function(){return _}),n.d(t,"j",function(){return y});var r=n(1),i=n(532),o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","woocommerceServices",t,"labelSettings"],null)},a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=o(e,t);return n&&n.data},c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=o(e,t);return n&&n.meta},s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=o(e,t);return n&&n.storeOptions},u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.user},l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.isLoaded},d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.isFetching},f=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.isFetchError},p=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=a(e,t);return n&&n.enabled},h=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=a(e,t);return n&&n.selected_payment_method_id},E=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.pristine},O=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=a(e,t);return n&&n.email_receipts},b=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.can_manage_payments},m=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.can_edit_settings},v=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=a(e,t);return n&&n.paper_size},g=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.payment_methods},_=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.warnings&&n.warnings.payment_methods},y=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return{masterUserName:n&&n.master_user_name,masterUserLogin:n&&n.master_user_login,masterUserEmail:n&&n.master_user_email,masterUserWpcomLogin:n&&n.master_user_wpcom_login}}},547:function(e,t,n){"use strict";var r=n(530),i=n.n(r),o=n(533),a=n.n(o),c=n(36),s=n.n(c),u=n(10),l=n.n(u),d=n(12),f=n.n(d),p=n(526),h=n.n(p),E=n(35),O=n(1),b=function(e){var t=e.children,n=e.required,r=e.optional,o=e.translate,c=e.className,u=a()(e,["children","required","optional","translate","className"]);return t=l.a.Children.toArray(t)||[],n&&t.push(function(e){return l.a.createElement("small",{className:"form-label__required"},e("Required"))}(o)),r&&t.push(function(e){return l.a.createElement("small",{className:"form-label__optional"},e("Optional"))}(o)),l.a.createElement("label",i()({},Object(O.omit)(u,"moment","numberFormat"),{className:h()(c,"form-label")}),t.length?t.map(function(e,t){return Object(O.isObject)(e)?s()({},e,{key:t}):e}):null)};b.propTypes={required:f.a.bool},t.a=Object(E.localize)(b)},548:function(e,t,n){"use strict";var r=n(530),i=n.n(r),o=n(533),a=n.n(o),c=n(10),s=n.n(c),u=n(526),l=n.n(u);t.a=function(e){var t=e.className,n=e.children,r=a()(e,["className","children"]);return s.a.createElement("fieldset",i()({},r,{className:l()(t,"form-fieldset")}),n)}},549:function(e,t,n){"use strict";var r=n(107),i=n.n(r),o=n(108),a=n.n(o),c=n(528),s=n.n(c),u=n(527),l=n.n(u),d=n(531),f=n.n(d),p=n(529),h=n.n(p),E=n(34),O=n.n(E),b=n(12),m=n.n(b),v=n(10),g=n.n(v),_=n(526),y=n.n(_),C=n(1),j=n(35),S=n(534),I=n.n(S),R=n(577),T=function(e){function t(){var e,n;i()(this,t);for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];return n=s()(this,(e=l()(t)).call.apply(e,[this].concat(o))),O()(f()(n),"dismissTimeout",null),n}return h()(t,e),a()(t,[{key:"componentDidMount",value:function(){this.props.duration>0&&(this.dismissTimeout=setTimeout(this.props.onDismissClick,this.props.duration))}},{key:"componentWillUnmount",value:function(){this.dismissTimeout&&clearTimeout(this.dismissTimeout)}},{key:"componentDidUpdate",value:function(){clearTimeout(this.dismissTimeout),this.props.duration>0&&(this.dismissTimeout=setTimeout(this.props.onDismissClick,this.props.duration))}},{key:"getIcon",value:function(){var e;switch(this.props.status){case"is-info":e="info";break;case"is-success":e="checkmark";break;case"is-error":case"is-warning":e="notice";break;default:e="info"}return e}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,r=e.icon,i=e.isCompact,o=e.isLoading,a=e.onDismissClick,c=e.showDismiss,s=void 0===c?!i:c,u=e.status,l=e.text,d=e.translate,f=y()("notice",u,n,{"is-compact":i,"is-loading":o,"is-dismissable":s});return g.a.createElement("div",{className:f},g.a.createElement("span",{className:"notice__icon-wrapper"},g.a.createElement(I.a,{className:"notice__icon",icon:r||this.getIcon(),size:24})),g.a.createElement("span",{className:"notice__content"},g.a.createElement("span",{className:"notice__text"},l||t)),l?t:null,s&&g.a.createElement("span",{tabIndex:"0",className:"notice__dismiss",onClick:a},g.a.createElement(I.a,{icon:"cross",size:24}),g.a.createElement(R.a,null,d("Dismiss"))))}}]),t}(v.Component);O()(T,"defaultProps",{className:"",duration:0,icon:null,isCompact:!1,isLoading:!1,onDismissClick:C.noop,status:null,text:null}),O()(T,"propTypes",{className:m.a.string,duration:m.a.number,icon:m.a.string,isCompact:m.a.bool,isLoading:m.a.bool,onDismissClick:m.a.func,showDismiss:m.a.bool,status:m.a.oneOf(["is-error","is-info","is-success","is-warning","is-plain"]),text:m.a.oneOfType([m.a.arrayOf(m.a.oneOfType([m.a.string,m.a.node])),m.a.oneOfType([m.a.string,m.a.node])]),translate:m.a.func.isRequired}),t.a=Object(j.localize)(T)},550:function(e,t,n){"use strict";var r=n(10),i=n.n(r),o=n(12),a=n.n(o),c=n(526),s=n.n(c),u=n(534),l=n.n(u),d=function(e){var t=e.text,n=e.type,r=void 0===n?"input-validation":n;return i.a.createElement("div",{className:s()("field-error","field-error__".concat(r))},i.a.createElement(l.a,{size:24,icon:"notice-outline"})," ",i.a.createElement("span",null,t))};d.propTypes={text:a.a.string.isRequired,type:a.a.string},t.a=d},551:function(e,t,n){"use strict";n.d(t,"a",function(){return i});var r=n(1),i=function e(t){return!!t&&(Object(r.isArray)(t)?Object(r.some)(t,e):!Object(r.isPlainObject)(t)||Object(r.some)(Object(r.values)(t),e))}},552:function(e,t,n){"use strict";var r=n(530),i=n.n(r),o=n(533),a=n.n(o),c=n(10),s=n.n(c),u=n(526),l=n.n(u);t.a=function(e){var t=e.className,n=e.children,r=a()(e,["className","children"]);return s.a.createElement("h3",i()({},r,{className:l()(t,"form-section-heading")}),n)}},553:function(e,t,n){"use strict";n.r(t),n.d(t,"addPackage",function(){return a}),n.d(t,"removePackage",function(){return c}),n.d(t,"editPackage",function(){return s}),n.d(t,"dismissModal",function(){return u}),n.d(t,"savePackage",function(){return l}),n.d(t,"updatePackagesField",function(){return d}),n.d(t,"toggleOuterDimensions",function(){return f}),n.d(t,"toggleAll",function(){return p}),n.d(t,"togglePackage",function(){return h}),n.d(t,"savePredefinedPackages",function(){return E}),n.d(t,"removePredefinedPackage",function(){return O}),n.d(t,"setModalErrors",function(){return b}),n.d(t,"setIsSaving",function(){return m}),n.d(t,"setIsFetching",function(){return v}),n.d(t,"setIsFetchError",function(){return g}),n.d(t,"setAddMode",function(){return _}),n.d(t,"fetchSettings",function(){return y}),n.d(t,"submit",function(){return C});var r=n(541),i=n(538),o=n(540),a=function(e){return{type:i.g,siteId:e}},c=function(e,t){return{type:i.k,index:t,siteId:e}},s=function(e,t){return{type:i.i,package:t,siteId:e}},u=function(e){return{type:i.h,siteId:e}},l=function(e,t){return{type:i.m,packageData:t,siteId:e}},d=function(e,t){return{type:i.w,values:t,siteId:e}},f=function(e){return{type:i.u,siteId:e}},p=function(e,t,n,r){return{type:i.t,serviceId:t,groupId:n,checked:r,siteId:e}},h=function(e,t,n){return{type:i.v,serviceId:t,packageId:n,siteId:e}},E=function(e){return{type:i.n,siteId:e}},O=function(e,t,n){return{type:i.l,serviceId:t,packageId:n,siteId:e}},b=function(e,t){return{type:i.s,value:t,siteId:e}},m=function(e,t){return{type:i.r,isSaving:t,siteId:e}},v=function(e,t){return{type:i.p,isFetching:t,siteId:e}},g=function(e,t){return{type:i.q,isFetchError:t,siteId:e}},_=function(e,t){return{type:i.o,siteId:e,mode:t}},y=function(e){return function(t,n){var a=Object(o.e)(n(),e);a&&(a.packages||a.isFetching)||(t(v(e,!0)),r.b(e,r.e.packages).then(function(n){var r=n.formData,o=n.formSchema,a=n.storeOptions;t({type:i.j,packages:r,dimensionUnit:a.dimension_unit,weightUnit:a.weight_unit,packageSchema:o.custom.items,predefinedSchema:o.predefined,siteId:e})}).catch(function(n){console.error(n),t(g(e,!0))}).then(function(){return t(v(e,!1))}))}},C=function(e,t,n){return function(i,a){var c=Object(o.e)(a(),e);i(m(e,!0)),r.d(e,r.e.packages,c.packages).then(t).catch(n).then(function(){return i(m(e,!1))})}}},554:function(e,t,n){"use strict";n.d(t,"a",function(){return i});var r=n(535);function i(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Date.now();return{type:r.j,siteId:e,originalAction:t,data:n,time:i}}},555:function(e,t,n){"use strict";n.d(t,"a",function(){return I});var r=n(530),i=n.n(r),o=n(107),a=n.n(o),c=n(108),s=n.n(c),u=n(528),l=n.n(u),d=n(527),f=n.n(d),p=n(531),h=n.n(p),E=n(529),O=n.n(E),b=n(34),m=n.n(b),v=n(10),g=n.n(v),_=n(12),y=n.n(_),C=n(526),j=n.n(C),S=n(1),I=function(e){function t(){var e;return a()(this,t),(e=l()(this,f()(t).apply(this,arguments))).selectOnFocus=e.selectOnFocus.bind(h()(e)),e}return O()(t,e),s()(t,[{key:"focus",value:function(){this.refs.textField.focus()}},{key:"selectOnFocus",value:function(e){this.props.selectOnFocus&&e.target.select()}},{key:"render",value:function(){var e=this.props.inputRef,t=Object(S.omit)(this.props,"isError","isValid","selectOnFocus","inputRef"),n=j()("form-text-input",this.props.className,{"is-error":this.props.isError,"is-valid":this.props.isValid});return g.a.createElement("input",i()({type:"text"},t,{ref:e||"textField",className:n,onClick:this.selectOnFocus}))}}]),t}(v.PureComponent);m()(I,"propTypes",{isError:y.a.bool,isValid:y.a.bool,selectOnFocus:y.a.bool,className:y.a.string})},556:function(e,t,n){"use strict";n.d(t,"a",function(){return j});var r=n(530),i=n.n(r),o=n(107),a=n.n(o),c=n(108),s=n.n(c),u=n(528),l=n.n(u),d=n(527),f=n.n(d),p=n(529),h=n.n(p),E=n(34),O=n.n(E),b=n(10),m=n.n(b),v=n(12),g=n.n(v),_=n(526),y=n.n(_),C=n(1),j=function(e){function t(){return a()(this,t),l()(this,f()(t).apply(this,arguments))}return h()(t,e),s()(t,[{key:"render",value:function(){var e=y()(this.props.className,"form-setting-explanation",{"no-validate":this.props.noValidate,"is-indented":this.props.isIndented});return m.a.createElement("p",i()({},Object(C.omit)(this.props,"className","noValidate","isIndented"),{className:e}),this.props.children)}}]),t}(m.a.Component);O()(j,"displayName","FormSettingExplanation"),O()(j,"propTypes",{noValidate:g.a.bool,isIndented:g.a.bool,className:g.a.string}),O()(j,"defaultProps",{noValidate:!1,isIndented:!1})},557:function(e,t,n){"use strict";var r=n(530),i=n.n(r),o=n(533),a=n.n(o),c=n(10),s=n.n(c),u=n(526),l=n.n(u);t.a=function(e){var t=e.className,n=e.children,r=a()(e,["className","children"]);return s.a.createElement("legend",i()({},r,{className:l()(t,"form-legend")}),n)}},558:function(e,t,n){"use strict";var r=n(530),i=n.n(r),o=n(533),a=n.n(o),c=n(107),s=n.n(c),u=n(108),l=n.n(u),d=n(528),f=n.n(d),p=n(527),h=n.n(p),E=n(529),O=n.n(E),b=n(34),m=n.n(b),v=n(10),g=n.n(v),_=n(526),y=n.n(_),C=n(534),j=n.n(C),S=n(12),I=n.n(S),R=function(e){var t=e.className,n=e.compact,r=e.displayAsLink,i=e.highlight,o=e.href,a=e.onClick;return y()("card",t,{"is-card-link":r||!!o,"is-clickable":!!a,"is-compact":n,"is-highlight":i},!!i&&"is-"+i)},T=function(e){function t(){return s()(this,t),f()(this,h()(t).apply(this,arguments))}return O()(t,e),l()(t,[{key:"render",value:function(){var e=this.props,t=e.children,n=(e.compact,e.displayAsLink),r=(e.highlight,e.tagName),o=e.href,c=e.target,s=a()(e,["children","compact","displayAsLink","highlight","tagName","href","target"]);return o?g.a.createElement("a",i()({},s,{href:o,target:c,className:R(this.props)}),g.a.createElement(j.a,{className:"card__link-indicator",icon:c?"external":"chevron-right"}),t):g.a.createElement(r,i()({},s,{className:R(this.props)}),n&&g.a.createElement(j.a,{className:"card__link-indicator",icon:c?"external":"chevron-right"}),t)}}]),t}(v.PureComponent);m()(T,"propTypes",{className:I.a.string,displayAsLink:I.a.bool,href:I.a.string,tagName:I.a.oneOfType([I.a.func,I.a.string]).isRequired,target:I.a.string,compact:I.a.bool,highlight:I.a.oneOf([!1,"error","info","success","warning"])}),m()(T,"defaultProps",{tagName:"div",highlight:!1}),t.a=T},559:function(e,t,n){"use strict";var r=n(47),i=n.n(r),o=n(1),a=n(114),c=i()("calypso:notices");c("initializing notices");var s,u={containerNames:{}};s=u,Object(o.assign)(s,a.EventEmitter.prototype),s.emitChange=function(){this.emit("change")},s.off=s.removeListener;var l=[],d={new:function(e,t,n){var r=t.overlay?"overlay-notices":"notices";u.containerNames[r]=r,c("creating notice",e,t,n),u[r]=[];var i={type:t.type||"message",status:n,text:e,duration:t.duration,container:r,button:t.button,href:t.href,onClick:function(e){if("function"===typeof t.onClick){var n=d.removeNotice.bind(d,i);return t.onClick(e,n)}},onRemoveCallback:t.onRemoveCallback||function(){},arrow:t.arrow,isCompact:t.isCompact,showDismiss:t.showDismiss,persistent:t.persistent};return t.displayOnNextPage?l.push(i):u[r].push(i),u.emit("change"),i},success:function(e,t){return t=t||{},this.new(e,t,"is-success")},error:function(e,t){return t=t||{},this.new(e,t,"is-error")},info:function(e,t){return t=t||{},this.new(e,t,"is-info")},warning:function(e,t){return t=t||{},this.new(e,t,"is-warning")},list:u,removeNotice:function(e){if(e.container){var t=u[e.container],n=t.indexOf(e);-1!==n&&(t.splice(n,1),u.emit("change"))}},clearNoticesOnNavigation:function(e,t){c("clearNoticesOnNavigation");var n=!1,r=function(e){return e.persistent};for(var i in u.containerNames){var o=u[i].length;u[i]=u[i].filter(r),o!==u[i].length&&(n=!0)}l.length&&(l.forEach(function(e){u[e.container]=[],u[e.container].push(e)}),l=[]),n&&u.emit("change"),t()},clearNotices:function(e){u[e]=[],u.emit("change")},getStatusHelper:function(e){return e.error?"is-error":e.warning?"is-warning":e.info?"is-info":e.success?"is-success":void 0}};t.a=d},560:function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return i}),n.d(t,"c",function(){return o});var r=function(){return{}},i=function(){return""},o=function(){return!0}},561:function(e,t,n){"use strict";n.d(t,"a",function(){return l});var r=n(530),i=n.n(r),o=n(10),a=n.n(o),c=n(526),s=n.n(c),u=n(558);function l(e){return a.a.createElement(u.a,i()({},e,{className:s()(e.className,"is-compact")}),e.children)}},563:function(e,t,n){"use strict";var r=n(75);t.a=r.a},564:function(e,t,n){"use strict";var r=n(1);t.a=function(e){return Object(r.isPlainObject)(e)&&(e.isNormalized&&e.selectNormalized&&e.normalized?e.normalized:e.values)||{}}},565:function(e,t,n){"use strict";n.d(t,"b",function(){return s}),n.d(t,"c",function(){return u}),n.d(t,"a",function(){return l}),n.d(t,"e",function(){return f}),n.d(t,"f",function(){return h}),n.d(t,"g",function(){return E}),n.d(t,"i",function(){return O}),n.d(t,"h",function(){return b}),n.d(t,"j",function(){return m}),n.d(t,"d",function(){return v});var r=n(1),i=n(542),o=n(532),a=n(539),c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(o.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",t,"data","locations"])},s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(o.a)(e);return Object(r.isArray)(c(e,t))},u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(o.a)(e);return a.b===c(e,t)},l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(o.a)(e);return a.a===c(e,t)},d=function(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var o=r[e],a=s(t,o);return[a,a&&c(t,o)]}},f=Object(i.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(o.a)(e);if(!s(e,t))return[];var n=c(e,t).map(function(e){return Object(r.omit)(e,"countries")});return Object(r.sortBy)(n,"name")},d(0)),p=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(o.a)(e);if(!s(e,t))return[];var n=Object(r.flatMap)(c(e,t),"countries");return Object(r.sortBy)(n,"name")},h=Object(i.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e);if(!s(e,n))return[];var i=Object(r.find)(c(e,n),{code:t});if(!i)return[];var a=i.countries.map(function(e){return Object(r.omit)(e,"states")});return Object(r.sortBy)(a,"name")},d(1)),E=Object(i.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e);if(!s(e,n))return t;var i=Object(r.find)(Object(r.flatMap)(c(e,n),"countries"),{code:t});return i?i.name:t},d(1)),O=Object(i.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e);if(!s(e,n))return[];var i=Object(r.find)(Object(r.flatMap)(c(e,n),"countries"),{code:t});return i?Object(r.sortBy)(i.states,"name"):[]},d(1)),b=Object(i.a)(function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Object(o.a)(e);if(!s(e,i))return n;var a=Object(r.find)(Object(r.flatMap)(c(e,i),"countries"),{code:t});if(!a)return n;var u=Object(r.find)(a.states,{code:n});return u?u.name:n},d(2)),m=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e);return!Object(r.isEmpty)(O(e,t,n))},v=Object(i.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(o.a)(e),n=p(e,t),r={};return n.forEach(function(e){var t=e.code,n=e.name;return r[t]=n}),r},d(0))},566:function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return i});var r=function(){return!0},i=function(){return!0}},567:function(e,t,n){"use strict";n.d(t,"d",function(){return a}),n.d(t,"a",function(){return s}),n.d(t,"e",function(){return u}),n.d(t,"c",function(){return l}),n.d(t,"b",function(){return d});var r=n(541),i=n(538),o=n(546),a=function(e,t,n){return{type:i.e,siteId:e,key:t,value:n}},c=function(e,t,n){return{type:i.f,siteId:e,key:t,value:n}},s=function(e){return function(t){t(c(e,"isFetching",!0)),r.b(e,r.e.accountSettings).then(function(n){var r=n.storeOptions,o=n.formMeta,a=n.formData,c=n.userMeta;t(function(e,t,n,r,o){return{type:i.b,siteId:e,storeOptions:t,formData:n,formMeta:r,userMeta:o}}(e,r,a,o,c))}).catch(function(n){t(c(e,"isFetchError",!0)),console.error(n)}).then(function(){return t(c(e,"isFetching",!1))})}},u=function(e,t,n){return function(i,a){i(c(e,"isSaving",!0)),i(c(e,"pristine",!0)),r.c(e,r.e.accountSettings,Object(o.f)(a())).then(t).catch(function(t){return i(c(e,"pristine",!1)),n(t)}).then(function(){i(c(e,"isSaving",!1))})}},l=function(e){return{type:i.d,siteId:e}},d=function(e){return{type:i.c,siteId:e}}},568:function(e,t,n){"use strict";n.d(t,"b",function(){return c}),n.d(t,"a",function(){return s}),n.d(t,"c",function(){return u});var r=n(1),i=n(532),o=n(539),a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","woocommerceServices",t,"shippingMethodSchemas"],{})},c=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return Object(r.isObject)(a(e,n)[t])},s=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return c(e,t,n)?a(e,n)[t]:null},u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return o.b===a(e,n)[t]}},575:function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return i}),n.d(t,"d",function(){return o}),n.d(t,"c",function(){return a});var r=["US","PR","VI","GU","AS","UM","MH","FM","MP"],i=["US","PR","VI"],o=["AA","AE","AP"],a=["IR","SY","KP","CU","SD"]},576:function(e,t,n){"use strict";n.d(t,"c",function(){return u}),n.d(t,"a",function(){return l}),n.d(t,"b",function(){return d});var r=n(1),i=n(532),o=n(584),a=n(539),c=n(566),s=n(585),u=function(e,t){var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",t,"shippingZoneMethods"])}(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e));return Object(r.isObject)(n)?n[t]:null},l=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e),a=Object(o.b)(e,n);if(!Object(r.isArray)(a))return!1;var l=Object(r.find)(a,{id:t});if(!l||!Object(r.isArray)(l.methodIds))return!1;if(!Object(c.a)(e,n))return!0;var d=l.methodIds.map(function(t){var i=u(e,t,n);return i&&Object(r.startsWith)(i.methodType,"wc_services")?i:null}).filter(Boolean);return Object(r.every)(d,function(t){var r=t.id;return Object(s.a)(e,r,n)})},d=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e),l=Object(o.b)(e,n);if(!Object(r.isArray)(l))return!1;var d=Object(r.find)(l,{id:t});if(!d)return!1;if(a.b===d.methodIds)return!0;if(!Object(c.a)(e,n)||!Object(r.isArray)(d.methodIds))return!1;var f=d.methodIds.map(function(t){var i=u(e,t,n);return i&&Object(r.startsWith)(i.methodType,"wc_services")?i:null}).filter(Boolean);return Object(r.some)(f,function(t){var r=t.id;return Object(s.b)(e,r,n)})}},577:function(e,t,n){"use strict";n.d(t,"a",function(){return o});var r=n(10),i=n.n(r);n(621);function o(e){var t=e.children;return i.a.createElement("span",{className:"screen-reader-text"},t)}},578:function(e,t,n){"use strict";var r=n(10),i=n.n(r),o=n(12),a=n.n(o),c=n(548),s=n(547),u=n(555),l=n(550),d=n(556),f=function(e){var t=e.id,n=e.title,o=e.description,a=e.value,f=e.placeholder,p=e.updateValue,h=e.error,E=e.className,O=e.defaultValue,b=Object(r.useCallback)(function(e){return p(e.target.value,e)},[p]);return i.a.createElement(c.a,{className:E},i.a.createElement(s.a,{htmlFor:t},n),i.a.createElement(u.a,{id:t,name:t,placeholder:f,value:a,onChange:b,isError:Boolean(h),defaultValue:O}),h&&"string"===typeof h&&i.a.createElement(l.a,{text:h}),!h&&o&&i.a.createElement(d.a,null,o))};f.propTypes={id:a.a.string.isRequired,title:a.a.node,description:a.a.string,value:a.a.string,defaultValue:a.a.string,updateValue:a.a.func,error:a.a.oneOfType([a.a.string,a.a.bool]),className:a.a.string},t.a=f},580:function(e,t,n){"use strict";var r=n(530),i=n.n(r),o=n(533),a=n.n(o),c=n(107),s=n.n(c),u=n(108),l=n.n(u),d=n(528),f=n.n(d),p=n(527),h=n.n(p),E=n(529),O=n.n(E),b=n(34),m=n.n(b),v=n(10),g=n.n(v),_=n(526),y=n.n(_),C=function(e){function t(){return s()(this,t),f()(this,h()(t).apply(this,arguments))}return O()(t,e),l()(t,[{key:"render",value:function(){var e=this.props,t=e.inputRef,n=e.className,r=e.isError,o=a()(e,["inputRef","className","isError"]),c=y()(n,"form-select",{"is-error":r});return g.a.createElement("select",i()({},o,{ref:t,className:c}),this.props.children)}}]),t}(g.a.Component);m()(C,"defaultProps",{isError:!1}),t.a=C},584:function(e,t,n){"use strict";n.d(t,"b",function(){return c}),n.d(t,"a",function(){return s});var r=n(1),i=n(532),o=(n(539),n(576)),a=n(608),c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",t,"shippingZones"])},s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return Object(r.isArray)(n)&&Object(r.every)(n,function(n){return Object(o.a)(e,n.id,t)})&&Object(r.every)(n,function(n){return Object(a.a)(e,n.id,t)})}},585:function(e,t,n){"use strict";n.d(t,"a",function(){return c}),n.d(t,"b",function(){return s});var r=n(1),i=n(532),o=n(539),a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","woocommerceServices",t,"shippingZoneMethodSettings"],{})},c=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return!0===a(e,n)[t]},s=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return o.b===a(e,n)[t]}},586:function(e,t,n){"use strict";n.d(t,"a",function(){return _});var r=n(107),i=n.n(r),o=n(108),a=n.n(o),c=n(528),s=n.n(c),u=n(527),l=n.n(u),d=n(529),f=n.n(d),p=n(34),h=n.n(p),E=n(12),O=n.n(E),b=n(10),m=n.n(b),v=n(534),g=n.n(v),_=function(e){function t(){return i()(this,t),s()(this,l()(t).apply(this,arguments))}return f()(t,e),a()(t,[{key:"render",value:function(){var e={className:"notice__action",href:this.props.href,onClick:this.props.onClick};return this.props.external&&(e.target="_blank",e.rel="noopener noreferrer"),m.a.createElement("a",e,m.a.createElement("span",null,this.props.children),this.props.icon&&m.a.createElement(g.a,{icon:this.props.icon,size:24}),this.props.external&&m.a.createElement(g.a,{icon:"external",size:24}))}}]),t}(m.a.Component);h()(_,"displayName","NoticeAction"),h()(_,"propTypes",{href:O.a.string,onClick:O.a.func,external:O.a.bool,icon:O.a.string}),h()(_,"defaultProps",{external:!1})},591:function(e,t,n){"use strict";var r,i=n(34),o=n.n(i),a=n(36),c=n.n(a),s=n(1),u=n(46),l=Object(u.b)({},(r={},o()(r,"NOTICE_CREATE",function(e,t){var n=t.notice;return c()({},e,o()({},n.noticeId,n))}),o()(r,"NOTICE_REMOVE",function(e,t){var n=t.noticeId;return e.hasOwnProperty(n)?Object(s.omit)(e,n):e}),o()(r,"ROUTE_SET",function(e){return Object(s.reduce)(e,function(e,t,n){if(!t.isPersistent&&!t.displayOnNextPage)return e;var r=t;return r.displayOnNextPage&&(r=c()({},r,{displayOnNextPage:!1})),e[n]=r,e},{})}),r)),d=Object(u.b)({},o()({},"NOTICE_CREATE",function(e,t){var n=t.notice;return c()({},e,o()({},n.noticeId,Date.now()))}));t.a=Object(u.a)({items:l,lastTimeShown:d})},592:function(e,t,n){"use strict";n.d(t,"d",function(){return i}),n.d(t,"b",function(){return o}),n.d(t,"a",function(){return a}),n.d(t,"e",function(){return c}),n.d(t,"c",function(){return s});var r=n(535);function i(e){return{type:r.d,actionList:e}}function o(){return{type:r.b}}function a(e){return{type:r.a,actionList:e}}function c(e){return{type:r.e,actionList:e}}function s(e,t){return{type:r.c,actionList:e,error:t}}},593:function(e,t,n){},594:function(e,t,n){"use strict";var r=n(658),i=["a","strong","em","u","tt","s"],o=["target","href"];t.a=function(e){return{__html:Object(r.sanitize)(e,{ALLOWED_TAGS:i,ALLOWED_ATTR:o})}}},599:function(e,t,n){"use strict";var r=n(530),i=n.n(r),o=n(10),a=n.n(o),c=n(12),s=n.n(c),u=n(526),l=n.n(u),d=n(534),f=n.n(d),p=n(1),h=function(e){var t=e.className,n=e.disabled,r=e.checked,o=e.partialChecked,c=Object(p.omit)(e,["className","partialChecked"]);return a.a.createElement("span",{className:l()(t,"form-checkbox",{"is-disabled":n})},a.a.createElement("input",i()({},c,{type:"checkbox"})),r&&a.a.createElement(f.a,{icon:"checkmark",size:14}),!r&&o&&a.a.createElement(f.a,{icon:"minus-small",size:16}))};h.propTypes={checked:s.a.bool.isRequired,partialChecked:s.a.bool,onChange:s.a.func.isRequired,className:s.a.string},t.a=h},600:function(e,t,n){"use strict";var r=n(10),i=n.n(r),o=n(12),a=n.n(o),c=n(526),s=n.n(c),u=n(561),l=n(552),d=function(e){var t=e.heading,n=e.children;return i.a.createElement(u.a,{className:"settings-group-card"},t&&i.a.createElement(l.a,{className:"settings-group-card__heading"},t),i.a.createElement("div",{className:s()("settings-group-card__content",{"is-full-width":!t})},n))};d.propTypes={heading:a.a.node},t.a=d},601:function(e,t,n){"use strict";var r=n(530),i=n.n(r),o=n(533),a=n.n(o),c=n(164),s=n.n(c),u=n(12),l=n.n(u),d=n(10),f=n.n(d),p=n(549),h=n(586),E=n(526),O=n.n(E);n(593);function b(e){var t=e.id,n=e.className,r=e.children;return f.a.createElement("div",{id:t,className:O()("global-notices",n)},r)}var m=n(559),v=n(47),g=n.n(v)()("calypso:data-observe"),_=n(109),y=n(1),C=n(542),j=Object(C.a)(function(e){return Object(y.values)(e.notices.items)},function(e){return e.notices.items}),S=(Object(C.a)(function(e,t){return e.notices.lastTimeShown[t]||0},function(e){return e.notices.lastTimeShown}),n(545)),I=s()({displayName:"GlobalNotices",mixins:[function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return{componentDidMount:function(){t.forEach(function(e){this.props[e]?this.props[e].on("change",this.update):g(e+" is not set.")},this)},componentWillUnmount:function(){t.forEach(function(e){this.props[e]&&this.props[e].off("change",this.update)},this)},componentWillReceiveProps:function(e){t.forEach(function(t){this.props[t]!==e[t]&&(this.props[t]&&this.props[t].off("change",this.update),e[t]&&e[t].on("change",this.update))},this)},update:function(){g("Re-rendering "+this.constructor.displayName+" component."),this.forceUpdate()}}}("notices")],propTypes:{id:l.a.string,notices:l.a.oneOfType([l.a.object,l.a.array]),removeNotice:l.a.func.isRequired,storeNotices:l.a.array.isRequired},getDefaultProps:function(){return{id:"overlay-notices",notices:Object.freeze([])}},removeNoticeStoreNotice:function(e){return function(){e&&m.a.removeNotice(e)}},removeReduxNotice:function(e,t){var n=this;return function(r){t&&t(r),n.props.removeNotice(e)}},render:function(){var e=(this.props.notices[this.props.id]||[]).map(function(e,t){return f.a.createElement(p.a,{key:"notice-old-"+t,status:e.status,duration:e.duration||null,text:e.text,isCompact:e.isCompact,onDismissClick:this.removeNoticeStoreNotice(e),showDismiss:e.showDismiss},e.button&&f.a.createElement(h.a,{href:e.href,onClick:e.onClick},e.button))},this);return(e=e.concat(this.props.storeNotices.map(function(e){var t=e.button,n=e.href,r=e.noticeId,o=e.onClick,c=e.onDismissClick,s=a()(e,["button","href","noticeId","onClick","onDismissClick"]);return f.a.createElement(p.a,i()({},s,{key:"notice-".concat(r),onDismissClick:this.removeReduxNotice(r,c)}),t&&f.a.createElement(h.a,{href:n,onClick:o},t))},this))).length?f.a.createElement(b,{id:this.props.id},e):null}});t.a=Object(_.b)(function(e){return{storeNotices:j(e)}},{removeNotice:S.c})(I)},606:function(e,t,n){"use strict";n.d(t,"a",function(){return O});var r,i=n(36),o=n.n(i),a=n(533),c=n.n(a),s=n(651),u=n.n(s),l=n(1),d=n(46),f=n(113),p=function(e){return Object(l.get)(e,"meta.dataLayer.data",void 0)},h=function(e){return Object(l.get)(e,"meta.dataLayer.error",void 0)},E=function(e){return Object(l.get)(e,"meta.dataLayer.progress",void 0)},O=(Object(d.d)("meta.dataLayer.requestKey",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=(arguments.length>1?arguments[1]:void 0).meta,n=(t=void 0===t?{}:t).dataLayer,r=(n=void 0===n?{}:n).lastUpdated,i=n.pendingSince,a=n.status;return Object.assign(o()({},e),{status:a},r&&{lastUpdated:r},i&&{pendingSince:i})}),r=function(e){return function(t,n){if(!0!==Object(l.get)(n,"meta.dataLayer.trackRequest")||E(n))return e(t,n);var r=function(e){var t=e.meta,n=c()(e,["meta"]),r=Object(l.get)(t,"dataLayer.requestKey");return r||u()(n)}(n),i=function(e){return void 0!==h(e)?"failure":void 0!==p(e)?"success":"pending"}(n),a=Object.assign({requestKey:r,status:i},"pending"===i?{pendingSince:Date.now()}:{lastUpdated:Date.now()});e(o()({},t,{dispatch:function(e){return t.dispatch(Object(l.merge)(e,{meta:{dataLayer:a}}))}}),n)}},function(e){return e.fetch||Object(f.a)("fetch handler is not defined: no request will ever be issued"),e.onSuccess||Object(f.a)("onSuccess handler is not defined: response to the request is being ignored"),e.onError||Object(f.a)("onError handler is not defined: error during the request is being ignored"),r(function(t,n){var r=function(e,t){var n=e.fetch,r=void 0===n?l.noop:n,i=e.onSuccess,o=void 0===i?l.noop:i,a=e.onError,c=void 0===a?l.noop:a,s=e.onProgress,u=void 0===s?l.noop:s,d=e.fromApi,f=void 0===d?l.identity:d,O=h(t);if(O)return c(t,O);var b=p(t);if(b)try{return o(t,f(b))}catch(v){return c(t,v)}var m=E(t);return m?u(t,m):r(t)}(e,n);if(r)return Array.isArray(r)?r.map(t.dispatch):t.dispatch(r)})})},607:function(e,t,n){"use strict";n.d(t,"a",function(){return o});var r=n(1),i=function(e,t){return Object(r.isArray)(e)?e.concat(t):void 0},o=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.length>1?r.mergeWith.apply(void 0,[Object.create(null)].concat(t,[i])):t[0]}},608:function(e,t,n){"use strict";n.d(t,"c",function(){return a}),n.d(t,"a",function(){return c}),n.d(t,"b",function(){return s});var r=n(1),i=n(532),o=n(539),a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",t,"shippingZoneLocations"])},c=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e),o=a(e,n);return o&&Object(r.isObject)(o[t])},s=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return a(e,n)&&o.b===a(e,n)[t]}},609:function(e,t,n){"use strict";n.d(t,"a",function(){return c});var r=n(541),i=n(554),o=n(538),a=n(585),c=function(e,t,n){return function(c,s){if(!Object(a.a)(s(),n,e)&&!Object(a.b)(s(),n,e)){var u={type:o.Pb,instanceId:n,siteId:e};return c(u),r.b(e,r.e.serviceSettings(t,n)).then(function(t){return c(function(e,t,n){return{type:o.Qb,siteId:e,instanceId:t,data:n}}(e,n,t))}).catch(function(t){return c(Object(i.a)(e,u,t))})}}}},610:function(e,t,n){"use strict";t.a=function(e,t){return function e(t,n,r){if(void 0===n||null===n||!t)return n;switch((t=function(e,t){if(e.$ref){var n=e.$ref.match(/^#\/definitions\/(.+)/);n&&t[n[1]]&&(e=t[n[1]])}return e}(t,r)).type){case"number":if(""===n)return;return isNaN(n)?n:parseFloat(n);case"boolean":return-1!==["true","True","TRUE","1",1,!0].indexOf(n)||-1===["false","False","FALSE","0",0,!1].indexOf(n)&&void 0;case"string":return n?n.toString():"";case"object":var i={};return Object.keys(n).forEach(function(o){var a=(t.properties||{})[o];i[o]=e(a,n[o],r)}),i;case"array":return n.map(function(n){return e(t.items,n,r)});default:return n}}({type:"object",properties:e.properties},t,e.definitions)}},611:function(e,t,n){"use strict";var r=n(107),i=n.n(r),o=n(108),a=n.n(o),c=n(528),s=n.n(c),u=n(527),l=n.n(u),d=n(531),f=n.n(d),p=n(529),h=n.n(p),E=n(34),O=n.n(E),b=n(12),m=n.n(b),v=n(10),g=n.n(v),_=n(526),y=n.n(_),C=n(35),j=n(1),S=n(558),I=n(561),R=n(534),T=n.n(R),N=n(577),M=function(e){function t(){var e,n;i()(this,t);for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];return n=s()(this,(e=l()(t)).call.apply(e,[this].concat(o))),O()(f()(n),"state",{expanded:n.props.expanded}),O()(f()(n),"onClick",function(){n.props.children&&n.setState({expanded:!n.state.expanded}),n.props.onClick&&n.props.onClick(),n.state.expanded?n.props.onClose(n.props.cardKey):n.props.onOpen(n.props.cardKey)}),n}return h()(t,e),a()(t,[{key:"componentWillReceiveProps",value:function(e){e.expanded!==this.props.expanded&&this.setState({expanded:e.expanded})}},{key:"getClickAction",value:function(){if(!this.props.disabled)return this.onClick}},{key:"getActionButton",value:function(){return this.state.expanded&&this.props.actionButtonExpanded||this.props.actionButton}},{key:"renderActionButton",value:function(){var e=this.props.clickableHeader?null:this.getClickAction();if(this.props.actionButton)return g.a.createElement("div",{className:"foldable-card__action",onClick:e},this.getActionButton());if(this.props.children){var t=this.props.screenReaderText||this.props.translate("More");return g.a.createElement("button",{disabled:this.props.disabled,type:"button",className:"foldable-card__action foldable-card__expand",onClick:e},g.a.createElement(N.a,null,t),g.a.createElement(T.a,{icon:this.props.icon,size:24}))}}},{key:"renderContent",value:function(){return g.a.createElement("div",{className:"foldable-card__content"},this.props.children)}},{key:"renderHeader",value:function(){var e=this.props.summary?g.a.createElement("span",{className:"foldable-card__summary"},this.props.summary," "):null,t=this.props.expandedSummary?g.a.createElement("span",{className:"foldable-card__summary-expanded"},this.props.expandedSummary," "):null,n=this.props.clickableHeader?this.getClickAction():null,r=y()("foldable-card__header",{"is-clickable":!!this.props.clickableHeader,"has-border":!!this.props.summary});return g.a.createElement("div",{className:r,onClick:n},g.a.createElement("span",{className:"foldable-card__main"},this.props.header," "),g.a.createElement("span",{className:"foldable-card__secondary"},e,t,this.renderActionButton()))}},{key:"render",value:function(){var e=this.props.compact?I.a:S.a,t=y()("foldable-card",this.props.className,{"is-disabled":!!this.props.disabled,"is-expanded":!!this.state.expanded,"has-expanded-summary":!!this.props.expandedSummary});return g.a.createElement(e,{className:t},this.renderHeader(),this.state.expanded&&this.renderContent())}}]),t}(v.Component);O()(M,"displayName","FoldableCard"),O()(M,"propTypes",{actionButton:m.a.element,actionButtonExpanded:m.a.element,cardKey:m.a.string,compact:m.a.bool,disabled:m.a.bool,expandedSummary:m.a.oneOfType([m.a.string,m.a.element]),expanded:m.a.bool,icon:m.a.string,onClick:m.a.func,onClose:m.a.func,onOpen:m.a.func,screenReaderText:m.a.oneOfType([m.a.string,m.a.bool]),summary:m.a.oneOfType([m.a.string,m.a.element])}),O()(M,"defaultProps",{onOpen:j.noop,onClose:j.noop,cardKey:"",icon:"chevron-down",expanded:!1,screenReaderText:!1}),t.a=Object(C.localize)(M)},619:function(e,t,n){var r={"./af":[392,3],"./af.js":[392,3],"./ar":[399,4],"./ar-dz":[393,5],"./ar-dz.js":[393,5],"./ar-kw":[394,6],"./ar-kw.js":[394,6],"./ar-ly":[395,7],"./ar-ly.js":[395,7],"./ar-ma":[396,8],"./ar-ma.js":[396,8],"./ar-sa":[397,9],"./ar-sa.js":[397,9],"./ar-tn":[398,10],"./ar-tn.js":[398,10],"./ar.js":[399,4],"./az":[400,11],"./az.js":[400,11],"./be":[401,12],"./be.js":[401,12],"./bg":[402,13],"./bg.js":[402,13],"./bm":[403,14],"./bm.js":[403,14],"./bn":[404,15],"./bn.js":[404,15],"./bo":[405,16],"./bo.js":[405,16],"./br":[406,17],"./br.js":[406,17],"./bs":[407,18],"./bs.js":[407,18],"./ca":[408,19],"./ca.js":[408,19],"./cs":[409,20],"./cs.js":[409,20],"./cv":[410,21],"./cv.js":[410,21],"./cy":[411,22],"./cy.js":[411,22],"./da":[412,23],"./da.js":[412,23],"./de":[415,24],"./de-at":[413,25],"./de-at.js":[413,25],"./de-ch":[414,26],"./de-ch.js":[414,26],"./de.js":[415,24],"./dv":[416,27],"./dv.js":[416,27],"./el":[417,28],"./el.js":[417,28],"./en-au":[418,29],"./en-au.js":[418,29],"./en-ca":[419,30],"./en-ca.js":[419,30],"./en-gb":[420,31],"./en-gb.js":[420,31],"./en-ie":[421,32],"./en-ie.js":[421,32],"./en-il":[422,33],"./en-il.js":[422,33],"./en-in":[423,34],"./en-in.js":[423,34],"./en-nz":[424,35],"./en-nz.js":[424,35],"./en-sg":[425,36],"./en-sg.js":[425,36],"./eo":[426,37],"./eo.js":[426,37],"./es":[429,38],"./es-do":[427,39],"./es-do.js":[427,39],"./es-us":[428,40],"./es-us.js":[428,40],"./es.js":[429,38],"./et":[430,41],"./et.js":[430,41],"./eu":[431,42],"./eu.js":[431,42],"./fa":[432,43],"./fa.js":[432,43],"./fi":[433,44],"./fi.js":[433,44],"./fil":[434,45],"./fil.js":[434,45],"./fo":[435,46],"./fo.js":[435,46],"./fr":[438,47],"./fr-ca":[436,48],"./fr-ca.js":[436,48],"./fr-ch":[437,49],"./fr-ch.js":[437,49],"./fr.js":[438,47],"./fy":[439,50],"./fy.js":[439,50],"./ga":[440,51],"./ga.js":[440,51],"./gd":[441,52],"./gd.js":[441,52],"./gl":[442,53],"./gl.js":[442,53],"./gom-deva":[443,54],"./gom-deva.js":[443,54],"./gom-latn":[444,55],"./gom-latn.js":[444,55],"./gu":[445,56],"./gu.js":[445,56],"./he":[446,57],"./he.js":[446,57],"./hi":[447,58],"./hi.js":[447,58],"./hr":[448,59],"./hr.js":[448,59],"./hu":[449,60],"./hu.js":[449,60],"./hy-am":[450,61],"./hy-am.js":[450,61],"./id":[451,62],"./id.js":[451,62],"./is":[452,63],"./is.js":[452,63],"./it":[454,64],"./it-ch":[453,65],"./it-ch.js":[453,65],"./it.js":[454,64],"./ja":[455,66],"./ja.js":[455,66],"./jv":[456,67],"./jv.js":[456,67],"./ka":[457,68],"./ka.js":[457,68],"./kk":[458,69],"./kk.js":[458,69],"./km":[459,70],"./km.js":[459,70],"./kn":[460,71],"./kn.js":[460,71],"./ko":[461,72],"./ko.js":[461,72],"./ku":[462,73],"./ku.js":[462,73],"./ky":[463,74],"./ky.js":[463,74],"./lb":[464,75],"./lb.js":[464,75],"./lo":[465,76],"./lo.js":[465,76],"./lt":[466,77],"./lt.js":[466,77],"./lv":[467,78],"./lv.js":[467,78],"./me":[468,79],"./me.js":[468,79],"./mi":[469,80],"./mi.js":[469,80],"./mk":[470,81],"./mk.js":[470,81],"./ml":[471,82],"./ml.js":[471,82],"./mn":[472,83],"./mn.js":[472,83],"./mr":[473,84],"./mr.js":[473,84],"./ms":[475,85],"./ms-my":[474,86],"./ms-my.js":[474,86],"./ms.js":[475,85],"./mt":[476,87],"./mt.js":[476,87],"./my":[477,88],"./my.js":[477,88],"./nb":[478,89],"./nb.js":[478,89],"./ne":[479,90],"./ne.js":[479,90],"./nl":[481,91],"./nl-be":[480,92],"./nl-be.js":[480,92],"./nl.js":[481,91],"./nn":[482,93],"./nn.js":[482,93],"./oc-lnc":[483,94],"./oc-lnc.js":[483,94],"./pa-in":[484,95],"./pa-in.js":[484,95],"./pl":[485,96],"./pl.js":[485,96],"./pt":[487,97],"./pt-br":[486,98],"./pt-br.js":[486,98],"./pt.js":[487,97],"./ro":[488,99],"./ro.js":[488,99],"./ru":[489,100],"./ru.js":[489,100],"./sd":[490,101],"./sd.js":[490,101],"./se":[491,102],"./se.js":[491,102],"./si":[492,103],"./si.js":[492,103],"./sk":[493,104],"./sk.js":[493,104],"./sl":[494,105],"./sl.js":[494,105],"./sq":[495,106],"./sq.js":[495,106],"./sr":[497,107],"./sr-cyrl":[496,108],"./sr-cyrl.js":[496,108],"./sr.js":[497,107],"./ss":[498,109],"./ss.js":[498,109],"./sv":[499,110],"./sv.js":[499,110],"./sw":[500,111],"./sw.js":[500,111],"./ta":[501,112],"./ta.js":[501,112],"./te":[502,113],"./te.js":[502,113],"./tet":[503,114],"./tet.js":[503,114],"./tg":[504,115],"./tg.js":[504,115],"./th":[505,116],"./th.js":[505,116],"./tk":[506,117],"./tk.js":[506,117],"./tl-ph":[507,118],"./tl-ph.js":[507,118],"./tlh":[508,119],"./tlh.js":[508,119],"./tr":[509,120],"./tr.js":[509,120],"./tzl":[510,121],"./tzl.js":[510,121],"./tzm":[512,122],"./tzm-latn":[511,123],"./tzm-latn.js":[511,123],"./tzm.js":[512,122],"./ug-cn":[513,124],"./ug-cn.js":[513,124],"./uk":[514,125],"./uk.js":[514,125],"./ur":[515,126],"./ur.js":[515,126],"./uz":[517,127],"./uz-latn":[516,128],"./uz-latn.js":[516,128],"./uz.js":[517,127],"./vi":[518,129],"./vi.js":[518,129],"./x-pseudo":[519,130],"./x-pseudo.js":[519,130],"./yo":[520,131],"./yo.js":[520,131],"./zh-cn":[521,132],"./zh-cn.js":[521,132],"./zh-hk":[522,133],"./zh-hk.js":[522,133],"./zh-mo":[523,134],"./zh-mo.js":[523,134],"./zh-tw":[524,135],"./zh-tw.js":[524,135]};function i(e){if(!n.o(r,e))return Promise.resolve().then(function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t});var t=r[e],i=t[0];return n.e(t[1]).then(function(){return n.t(i,7)})}i.keys=function(){return Object.keys(r)},i.id=619,e.exports=i},620:function(e,t,n){"use strict";(function(e){var n={env:e?"production":"development",wpcom_concierge_schedule_id:1,languages:[],google_adwords_conversion_id:"",google_adwords_conversion_id_jetpack:""},r=function(e){if(e in n)return n[e];throw new Error("config key `"+e+"` does not exist")};r.isEnabled=function(){return!0},t.a=r}).call(this,n(112))},621:function(e,t,n){},622:function(e,t,n){"use strict";var r=n(10),i=n.n(r),o=n(12),a=n.n(o),c=n(556),s=n(594),u=function(e){var t=e.text;return t?i.a.createElement(c.a,{dangerouslySetInnerHTML:Object(s.a)(t)}):null};u.propTypes={text:a.a.string},t.a=u},632:function(e,t,n){"use strict";var r=n(34),i=n.n(r),o=n(110),a=n.n(o),c=n(1),s=n(35),u=n(535),l=n(592),d=n(546),f=n(540),p=n(567),h=n(553),E=n(532),O=n(538);n(563),n(554),n(576),n(609),n(620);var b=n(541),m=n(36),v=n.n(m);function g(e,t,n,r){Object(c.isFunction)(n)?g(e,t,n(e,t,r),r):Object(c.isObject)(n)&&e(v()({},n,r))}var _,y=n(568),C=n(610),j=function(e,t){var n=Object(f.e)(e,t);return!n||n.pristine?[]:[{description:Object(s.translate)("Saving label settings"),onStep:function(e,n){e(Object(h.submit)(t,function(){return e(Object(l.e)(n))},function(){return e(Object(l.c)(n))}))}}]},S=function(e,t){var n=Object(E.a)(e);return t?a()(j(e,n)):[].concat(a()(function(e,t){var n=Object(d.g)(e,t);return!n||n.pristine||!n.can_edit_settings&&n.can_manage_payments?[]:[{description:Object(s.translate)("Saving label settings"),onStep:function(e,n){e(Object(p.e)(t,function(){return e(Object(l.e)(n))},function(){return e(Object(l.c)(n))}))}}]}(e,n)),a()(j(e,n)))};t.a=(_={},i()(_,u.L,[function(e,t){var n=t.successAction,r=t.failureAction,i=t.onlyPackages,o=function(e){e(n),e(Object(l.b)())},a=S(e.getState(),i);e.dispatch(Object(c.isEmpty)(a)?o:Object(l.d)({nextSteps:a,onSuccess:o,onFailure:function(e){e(r),e(Object(l.b)())}}))}]),i()(_,O.Rb,[function(e,t){var n=e.dispatch,r=e.getState,i=t.siteId,o=t.methodId,a=t.methodType,c=t.method,s=t.successAction,l=t.failureAction,d=Object(y.a)(r(),a,i).formSchema,f=Object(C.a)(d,c);b.c(i,b.e.serviceSettings(a,o),f).then(function(e){n(function(e,t,n){return{type:u.Fb,siteId:e,data:t,originatingAction:n}}(i,e,t)),g(n,r,s,{sentData:f,receivedData:e})}).catch(function(e){return g(n,r,l,{error:e})})}]),_)},633:function(e,t,n){"use strict";n.d(t,"b",function(){return w}),n.d(t,"a",function(){return M});var r=n(111),i=n.n(r),o=n(107),a=n.n(o),c=n(108),s=n.n(c),u=n(528),l=n.n(u),d=n(527),f=n.n(d),p=n(531),h=n.n(p),E=n(529),O=n.n(E),b=n(34),m=n.n(b),v=n(10),g=n.n(v),_=n(109),y=n(163),C=n.n(y),j=n(47),S=n.n(j),I=n(1),R=n(542),T=Object(R.a)(function(e){return Object(I.get)(e,"ui.language.localeSlug",null)},function(e){return e.ui.language}),N=S()("calypso:localized-moment"),M=g.a.createContext(C.a),P=function(e){function t(){var e,n;a()(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=l()(this,(e=f()(t)).call.apply(e,[this].concat(i))),m()(h()(n),"state",{moment:C.a,momentLocale:C.a.locale()}),n}return O()(t,e),s()(t,[{key:"checkAndLoad",value:function(){var e=i()(regeneratorRuntime.mark(function e(t){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if((r=this.props.currentLocale)!==t){e.next=3;break}return e.abrupt("return");case 3:if("en"!==r){e.next=7;break}this.loadingLocalePromise=Promise.resolve(),e.next=19;break;case 7:return N("Loading moment locale for %s",r),e.prev=8,this.loadingLocalePromise=n(619)("./".concat(r)),e.next=12,this.loadingLocalePromise;case 12:e.next=18;break;case 14:return e.prev=14,e.t0=e.catch(8),N("Failed to load moment locale for %s",r,e.t0),e.abrupt("return");case 18:N("Loaded moment locale for %s",r);case 19:r===this.props.currentLocale&&(C.a.locale()!==r&&C.a.locale(r),this.setState({momentLocale:r}));case 20:case"end":return e.stop()}},e,this,[[8,14]])}));return function(t){return e.apply(this,arguments)}}()},{key:"componentDidMount",value:function(){this.checkAndLoad(C.a.locale())}},{key:"componentDidUpdate",value:function(e){this.checkAndLoad(e.currentLocale)}},{key:"render",value:function(){return g.a.createElement(M.Provider,{value:this.state},this.props.children)}}]),t}(g.a.Component),w=Object(_.b)(function(e){return{currentLocale:T(e)}})(P)},634:function(e,t,n){"use strict";var r=n(533),i=n.n(r),o=n(75),a=n(46),c=function(e,t,n,r,c,s){var u=Object(o.b)();return s&&!s.endsWith("/")&&(s+="/"),s&&s.startsWith("/")&&(s=s.substr(1)),-1!==u.indexOf("?")&&(t=t.replace("?","&")),Object(a.c)(function(e){var t=e.url,n=e.method,r=e.headers,o=e.queryParams,a=e.body,c=e.withCredentials,s=e.onSuccess,u=e.onFailure,l=i()(e,["url","method","headers","queryParams","body","withCredentials","onSuccess","onFailure"]),d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return{type:"HTTP_REQUEST",url:t,method:n,headers:r,queryParams:o,body:a,withCredentials:c,onSuccess:s||d,onFailure:u||d,options:l}}({url:u+s+t,method:e,headers:[["X-WP-Nonce",Object(o.c)()],["Content-Type","application/json"]],body:r&&JSON.stringify(r),withCredentials:!0},c),{meta:{localApiRequest:!0}})};t.a=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"wc/v1";return{get:function(e){return c("GET",e,0,null,t,n)},getWithHeaders:function(e){return function(e,t,n,r,i,o){return c(e,t+"&_envelope",0,r,i,o)}("GET",e,0,null,t,n)},post:function(e,r){return c("POST",e,0,r||{},t,n)},put:function(e,r){return c("PUT",e,0,r||{},t,n)},del:function(e){return c("DELETE",e,0,null,t,n)}}}},638:function(e,t,n){"use strict";n.d(t,"a",function(){return r});n(36),n(1);function r(e){if(!e.data)throw new Error("Failure at remote site.",e);return e}},639:function(e,t,n){"use strict";var r=n(530),i=n.n(r),o=n(533),a=n.n(o),c=n(10),s=n.n(c),u=n(526),l=n.n(u);t.a=function(e){var t=e.className,n=a()(e,["className"]);return s.a.createElement("input",i()({},n,{type:"radio",className:l()(t,"form-radio")}))}},642:function(e,t,n){"use strict";n.d(t,"a",function(){return S});var r=n(107),i=n.n(r),o=n(108),a=n.n(o),c=n(528),s=n.n(c),u=n(527),l=n.n(u),d=n(531),f=n.n(d),p=n(529),h=n.n(p),E=n(34),O=n.n(E),b=n(77),m=n.n(b),v=n(12),g=n.n(v),_=n(10),y=n.n(_),C=n(109),j=n(633),S=function(e){function t(){var e,n;i()(this,t);for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];return n=s()(this,(e=l()(t)).call.apply(e,[this].concat(o))),O()(f()(n),"renderChildren",function(){var e;e=n.props&&(Object.keys(n.props).length>1||!n.props.children)?y.a.createElement("div",n.props,n.props.children):n.props.children,n.context.store&&(e=y.a.createElement(C.a,{store:n.context.store},y.a.createElement(j.b,null,e))),m.a.render(e,n.container)}),n}return h()(t,e),a()(t,[{key:"componentDidMount",value:function(){this.container=document.createElement("div"),document.body.appendChild(this.container),this.renderChildren()}},{key:"componentDidUpdate",value:function(){this.renderChildren()}},{key:"componentWillUnmount",value:function(){this.container&&(m.a.unmountComponentAtNode(this.container),document.body.removeChild(this.container),delete this.container)}},{key:"render",value:function(){return null}}]),t}(y.a.Component);O()(S,"contextTypes",{store:g.a.object})},648:function(e,t,n){"use strict";var r=n(1);t.a=function(e,t){return function(n){var i=e(n),o=n.displayName,a=void 0===o?n.name||"Component":o;return i.displayName="".concat(Object(r.upperFirst)(Object(r.camelCase)(t)),"(").concat(a,")"),i}}},651:function(e,t,n){var r="undefined"!==typeof JSON?JSON:n(652);e.exports=function(e,t){t||(t={}),"function"===typeof t&&(t={cmp:t});var n=t.space||"";"number"===typeof n&&(n=Array(n+1).join(" "));var a,c="boolean"===typeof t.cycles&&t.cycles,s=t.replacer||function(e,t){return t},u=t.cmp&&(a=t.cmp,function(e){return function(t,n){var r={key:t,value:e[t]},i={key:n,value:e[n]};return a(r,i)}}),l=[];return function e(t,a,d,f){var p=n?"\n"+new Array(f+1).join(n):"",h=n?": ":":";if(d&&d.toJSON&&"function"===typeof d.toJSON&&(d=d.toJSON()),void 0!==(d=s.call(t,a,d))){if("object"!==typeof d||null===d)return r.stringify(d);if(i(d)){for(var E=[],O=0;O<d.length;O++){var b=e(d,O,d[O],f+1)||r.stringify(null);E.push(p+n+b)}return"["+E.join(",")+p+"]"}if(-1!==l.indexOf(d)){if(c)return r.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}l.push(d);var m=o(d).sort(u&&u(d));for(E=[],O=0;O<m.length;O++){var v=e(d,a=m[O],d[a],f+1);if(v){var g=r.stringify(a)+h+v;E.push(p+n+g)}}return l.splice(l.indexOf(d),1),"{"+E.join(",")+p+"}"}}({"":e},"",e,0)};var i=Array.isArray||function(e){return"[object Array]"==={}.toString.call(e)},o=Object.keys||function(e){var t=Object.prototype.hasOwnProperty||function(){return!0},n=[];for(var r in e)t.call(e,r)&&n.push(r);return n}},652:function(e,t,n){t.parse=n(653),t.stringify=n(654)},653:function(e,t){var n,r,i,o,a={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},c=function(e){throw{name:"SyntaxError",message:e,at:n,text:i}},s=function(e){return e&&e!==r&&c("Expected '"+e+"' instead of '"+r+"'"),r=i.charAt(n),n+=1,r},u=function(){var e,t="";for("-"===r&&(t="-",s("-"));r>="0"&&r<="9";)t+=r,s();if("."===r)for(t+=".";s()&&r>="0"&&r<="9";)t+=r;if("e"===r||"E"===r)for(t+=r,s(),"-"!==r&&"+"!==r||(t+=r,s());r>="0"&&r<="9";)t+=r,s();if(e=+t,isFinite(e))return e;c("Bad number")},l=function(){var e,t,n,i="";if('"'===r)for(;s();){if('"'===r)return s(),i;if("\\"===r)if(s(),"u"===r){for(n=0,t=0;t<4&&(e=parseInt(s(),16),isFinite(e));t+=1)n=16*n+e;i+=String.fromCharCode(n)}else{if("string"!==typeof a[r])break;i+=a[r]}else i+=r}c("Bad string")},d=function(){for(;r&&r<=" ";)s()};o=function(){switch(d(),r){case"{":return function(){var e,t={};if("{"===r){if(s("{"),d(),"}"===r)return s("}"),t;for(;r;){if(e=l(),d(),s(":"),Object.hasOwnProperty.call(t,e)&&c('Duplicate key "'+e+'"'),t[e]=o(),d(),"}"===r)return s("}"),t;s(","),d()}}c("Bad object")}();case"[":return function(){var e=[];if("["===r){if(s("["),d(),"]"===r)return s("]"),e;for(;r;){if(e.push(o()),d(),"]"===r)return s("]"),e;s(","),d()}}c("Bad array")}();case'"':return l();case"-":return u();default:return r>="0"&&r<="9"?u():function(){switch(r){case"t":return s("t"),s("r"),s("u"),s("e"),!0;case"f":return s("f"),s("a"),s("l"),s("s"),s("e"),!1;case"n":return s("n"),s("u"),s("l"),s("l"),null}c("Unexpected '"+r+"'")}()}},e.exports=function(e,t){var a;return i=e,n=0,r=" ",a=o(),d(),r&&c("Syntax error"),"function"===typeof t?function e(n,r){var i,o,a=n[r];if(a&&"object"===typeof a)for(i in a)Object.prototype.hasOwnProperty.call(a,i)&&(void 0!==(o=e(a,i))?a[i]=o:delete a[i]);return t.call(n,r,a)}({"":a},""):a}},654:function(e,t){var n,r,i,o=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,a={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function c(e){return o.lastIndex=0,o.test(e)?'"'+e.replace(o,function(e){var t=a[e];return"string"===typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}e.exports=function(e,t,o){var a;if(n="",r="","number"===typeof o)for(a=0;a<o;a+=1)r+=" ";else"string"===typeof o&&(r=o);if(i=t,t&&"function"!==typeof t&&("object"!==typeof t||"number"!==typeof t.length))throw new Error("JSON.stringify");return function e(t,o){var a,s,u,l,d,f=n,p=o[t];switch(p&&"object"===typeof p&&"function"===typeof p.toJSON&&(p=p.toJSON(t)),"function"===typeof i&&(p=i.call(o,t,p)),typeof p){case"string":return c(p);case"number":return isFinite(p)?String(p):"null";case"boolean":case"null":return String(p);case"object":if(!p)return"null";if(n+=r,d=[],"[object Array]"===Object.prototype.toString.apply(p)){for(l=p.length,a=0;a<l;a+=1)d[a]=e(a,p)||"null";return u=0===d.length?"[]":n?"[\n"+n+d.join(",\n"+n)+"\n"+f+"]":"["+d.join(",")+"]",n=f,u}if(i&&"object"===typeof i)for(l=i.length,a=0;a<l;a+=1)"string"===typeof(s=i[a])&&(u=e(s,p))&&d.push(c(s)+(n?": ":":")+u);else for(s in p)Object.prototype.hasOwnProperty.call(p,s)&&(u=e(s,p))&&d.push(c(s)+(n?": ":":")+u);return u=0===d.length?"{}":n?"{\n"+n+d.join(",\n"+n)+"\n"+f+"}":"{"+d.join(",")+"}",n=f,u}}("",{"":e})}},668:function(e,t,n){"use strict";n.d(t,"a",function(){return P});n(530);var r=n(107),i=n.n(r),o=n(108),a=n.n(o),c=n(528),s=n.n(c),u=n(527),l=n.n(u),d=(n(531),n(529)),f=n.n(d),p=n(34),h=n.n(p),E=n(12),O=n.n(E),b=n(10),m=n(47),v=n.n(m),g=(n(669),n(35)),_=n.n(g),y=n(1),C=v()("calypso:protect-form"),j=[],S=0;function I(e){if(j.length){C("unsaved form changes detected");var t=_.a.translate("You have unsaved changes.");return(e||window.event).returnValue=t,t}}function R(){0===S&&window.addEventListener("beforeunload",I),S++}function T(){0===--S&&window.removeEventListener("beforeunload",I)}function N(e){Object(y.includes)(j,e)||j.push(e)}function M(e){j=Object(y.without)(j,e)}var P=function(e){function t(){return i()(this,t),s()(this,l()(t).apply(this,arguments))}return f()(t,e),a()(t,[{key:"componentDidMount",value:function(){R(),this.props.isChanged&&N(this)}},{key:"componentWillUnmount",value:function(){T(),M(this)}},{key:"componentWillReceiveProps",value:function(e){e.isChanged!==this.props.isChanged&&(e.isChanged?N(this):M(this))}},{key:"render",value:function(){return null}}]),t}(b.Component);h()(P,"propTypes",{isChanged:O.a.bool.isRequired})},669:function(e,t,n){(function(t){e.exports=function(){"use strict";var e=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)},n=E,r=s,i=function(e){return u(s(e))},o=u,a=h,c=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^()])+)\\))?|\\(((?:\\\\.|[^()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function s(e){for(var t,n=[],r=0,i=0,o="";null!=(t=c.exec(e));){var a=t[0],s=t[1],u=t.index;if(o+=e.slice(i,u),i=u+a.length,s)o+=s[1];else{o&&(n.push(o),o="");var l=t[2],f=t[3],p=t[4],h=t[5],E=t[6],O=t[7],b="+"===E||"*"===E,m="?"===E||"*"===E,v=l||"/",g=p||h||(O?".*":"[^"+v+"]+?");n.push({name:f||r++,prefix:l||"",delimiter:v,optional:m,repeat:b,pattern:d(g)})}}return i<e.length&&(o+=e.substr(i)),o&&n.push(o),n}function u(t){for(var n=new Array(t.length),r=0;r<t.length;r++)"object"===typeof t[r]&&(n[r]=new RegExp("^"+t[r].pattern+"$"));return function(r){for(var i="",o=r||{},a=0;a<t.length;a++){var c=t[a];if("string"!==typeof c){var s,u=o[c.name];if(null==u){if(c.optional)continue;throw new TypeError('Expected "'+c.name+'" to be defined')}if(e(u)){if(!c.repeat)throw new TypeError('Expected "'+c.name+'" to not repeat, but received "'+u+'"');if(0===u.length){if(c.optional)continue;throw new TypeError('Expected "'+c.name+'" to not be empty')}for(var l=0;l<u.length;l++){if(s=encodeURIComponent(u[l]),!n[a].test(s))throw new TypeError('Expected all "'+c.name+'" to match "'+c.pattern+'", but received "'+s+'"');i+=(0===l?c.prefix:c.delimiter)+s}}else{if(s=encodeURIComponent(u),!n[a].test(s))throw new TypeError('Expected "'+c.name+'" to match "'+c.pattern+'", but received "'+s+'"');i+=c.prefix+s}}else i+=c}return i}}function l(e){return e.replace(/([.+*?=^!:${}()[\]|\/])/g,"\\$1")}function d(e){return e.replace(/([=!:$\/()])/g,"\\$1")}function f(e,t){return e.keys=t,e}function p(e){return e.sensitive?"":"i"}function h(e,t){for(var n=(t=t||{}).strict,r=!1!==t.end,i="",o=e[e.length-1],a="string"===typeof o&&/\/$/.test(o),c=0;c<e.length;c++){var s=e[c];if("string"===typeof s)i+=l(s);else{var u=l(s.prefix),d=s.pattern;s.repeat&&(d+="(?:"+u+d+")*"),d=s.optional?u?"(?:"+u+"("+d+"))?":"("+d+")?":u+"("+d+")",i+=d}}return n||(i=(a?i.slice(0,-2):i)+"(?:\\/(?=$))?"),i+=r?"$":n&&a?"":"(?=\\/|$)",new RegExp("^"+i,p(t))}function E(t,n,r){return e(n=n||[])?r||(r={}):(r=n,n=[]),t instanceof RegExp?function(e,t){var n=e.source.match(/\((?!\?)/g);if(n)for(var r=0;r<n.length;r++)t.push({name:r,prefix:null,delimiter:null,optional:!1,repeat:!1,pattern:null});return f(e,t)}(t,n):e(t)?function(e,t,n){for(var r=[],i=0;i<e.length;i++)r.push(E(e[i],t,n).source);return f(new RegExp("(?:"+r.join("|")+")",p(n)),t)}(t,n,r):function(e,t,n){for(var r=s(e),i=h(r,n),o=0;o<r.length;o++)"string"!==typeof r[o]&&t.push(r[o]);return f(i,t)}(t,n,r)}n.parse=r,n.compile=i,n.tokensToFunction=o,n.tokensToRegExp=a;var O="undefined"!==typeof document,b="undefined"!==typeof history,m="undefined"!==typeof t,v=O&&document.ontouchstart?"touchstart":"click",g=!(!window.history.location&&!window.location);function _(){this.callbacks=[],this.exits=[],this.current="",this.len=0,this._decodeURLComponents=!0,this._base="",this._strict=!1,this._running=!1,this._hashbang=!1,this.clickHandler=this.clickHandler.bind(this),this._onpopstate=this._onpopstate.bind(this)}function y(e,t){if("function"===typeof e)return y.call(this,"*",e);if("function"===typeof t)for(var n=new j(e,null,this),r=1;r<arguments.length;++r)this.callbacks.push(n.middleware(arguments[r]));else"string"===typeof e?this["string"===typeof t?"redirect":"show"](e,t):this.start(e)}function C(e,t,n){var r=this.page=n||y,i=r._window,o=r._hashbang,a=r._getBase();"/"===e[0]&&0!==e.indexOf(a)&&(e=a+(o?"#!":"")+e);var c=e.indexOf("?");this.canonicalPath=e;var s=new RegExp("^"+a.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1"));if(this.path=e.replace(s,"")||"/",o&&(this.path=this.path.replace("#!","")||"/"),this.title=O&&i.document.title,this.state=t||{},this.state.path=e,this.querystring=~c?r._decodeURLEncodedURIComponent(e.slice(c+1)):"",this.pathname=r._decodeURLEncodedURIComponent(~c?e.slice(0,c):e),this.params={},this.hash="",!o){if(!~this.path.indexOf("#"))return;var u=this.path.split("#");this.path=this.pathname=u[0],this.hash=r._decodeURLEncodedURIComponent(u[1])||"",this.querystring=this.querystring.split("#")[0]}}function j(e,t,r){this.page=r||S;var i=t||{};i.strict=i.strict||r._strict,this.path="*"===e?"(.*)":e,this.method="GET",this.regexp=n(this.path,this.keys=[],i)}_.prototype.configure=function(e){var t=e||{};this._window=t.window||window,this._decodeURLComponents=!1!==t.decodeURLComponents,this._popstate=!1!==t.popstate&&!0,this._click=!1!==t.click&&O,this._hashbang=!!t.hashbang;var n=this._window;this._popstate?n.addEventListener("popstate",this._onpopstate,!1):n.removeEventListener("popstate",this._onpopstate,!1),this._click?n.document.addEventListener(v,this.clickHandler,!1):O&&n.document.removeEventListener(v,this.clickHandler,!1),this._hashbang&&!b?n.addEventListener("hashchange",this._onpopstate,!1):n.removeEventListener("hashchange",this._onpopstate,!1)},_.prototype.base=function(e){if(0===arguments.length)return this._base;this._base=e},_.prototype._getBase=function(){var e=this._base;if(e)return e;var t=this._window&&this._window.location;return this._hashbang&&t&&"file:"===t.protocol&&(e=t.pathname),e},_.prototype.strict=function(e){if(0===arguments.length)return this._strict;this._strict=e},_.prototype.start=function(e){var t=e||{};if(this.configure(t),!1!==t.dispatch){var n;if(this._running=!0,g){var r=this._window,i=r.location;n=this._hashbang&&~i.hash.indexOf("#!")?i.hash.substr(2)+i.search:this._hashbang?i.search+i.hash:i.pathname+i.search+i.hash}this.replace(n,null,!0,t.dispatch)}},_.prototype.stop=function(){if(this._running){this.current="",this.len=0,this._running=!1;var e=this._window;this._click&&e.document.removeEventListener(v,this.clickHandler,!1),e.removeEventListener("popstate",this._onpopstate,!1),e.removeEventListener("hashchange",this._onpopstate,!1)}},_.prototype.show=function(e,t,n,r){var i=new C(e,t,this),o=this.prevContext;return this.prevContext=i,this.current=i.path,!1!==n&&this.dispatch(i,o),!1!==i.handled&&!1!==r&&i.pushState(),i},_.prototype.back=function(e,t){var n=this;if(this.len>0){var r=this._window;b&&r.history.back(),this.len--}else e?setTimeout(function(){n.show(e,t)}):setTimeout(function(){n.show(n._getBase(),t)})},_.prototype.redirect=function(e,t){var n=this;"string"===typeof e&&"string"===typeof t&&y.call(this,e,function(e){setTimeout(function(){n.replace(t)},0)}),"string"===typeof e&&"undefined"===typeof t&&setTimeout(function(){n.replace(e)},0)},_.prototype.replace=function(e,t,n,r){var i=new C(e,t,this),o=this.prevContext;return this.prevContext=i,this.current=i.path,i.init=n,i.save(),!1!==r&&this.dispatch(i,o),i},_.prototype.dispatch=function(e,t){var n=0,r=0,i=this;function o(){var t=i.callbacks[n++];if(e.path===i.current)return t?void t(e,o):function(e){if(!e.handled){var t=this._window;(this._hashbang?g&&this._getBase()+t.location.hash.replace("#!",""):g&&t.location.pathname+t.location.search)!==e.canonicalPath&&(this.stop(),e.handled=!1,g&&(t.location.href=e.canonicalPath))}}.call(i,e);e.handled=!1}t?function e(){var n=i.exits[r++];if(!n)return o();n(t,e)}():o()},_.prototype.exit=function(e,t){if("function"===typeof e)return this.exit("*",e);for(var n=new j(e,null,this),r=1;r<arguments.length;++r)this.exits.push(n.middleware(arguments[r]))},_.prototype.clickHandler=function(e){if(1===this._which(e)&&!(e.metaKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented){var t=e.target,n=e.path||(e.composedPath?e.composedPath():null);if(n)for(var r=0;r<n.length;r++)if(n[r].nodeName&&"A"===n[r].nodeName.toUpperCase()&&n[r].href){t=n[r];break}for(;t&&"A"!==t.nodeName.toUpperCase();)t=t.parentNode;if(t&&"A"===t.nodeName.toUpperCase()){var i="object"===typeof t.href&&"SVGAnimatedString"===t.href.constructor.name;if(!t.hasAttribute("download")&&"external"!==t.getAttribute("rel")){var o=t.getAttribute("href");if((this._hashbang||!this._samePath(t)||!t.hash&&"#"!==o)&&!(o&&o.indexOf("mailto:")>-1)&&(i?!t.target.baseVal:!t.target)&&(i||this.sameOrigin(t.href))){var a=i?t.href.baseVal:t.pathname+t.search+(t.hash||"");a="/"!==a[0]?"/"+a:a,m&&a.match(/^\/[a-zA-Z]:\//)&&(a=a.replace(/^\/[a-zA-Z]:\//,"/"));var c=a,s=this._getBase();0===a.indexOf(s)&&(a=a.substr(s.length)),this._hashbang&&(a=a.replace("#!","")),(!s||c!==a||g&&"file:"===this._window.location.protocol)&&(e.preventDefault(),this.show(c))}}}}},_.prototype._onpopstate=function(){var e=!1;return O&&"complete"===document.readyState?e=!0:window.addEventListener("load",function(){setTimeout(function(){e=!0},0)}),function(t){if(e)if(t.state){var n=t.state.path;this.replace(n,t.state)}else if(g){var r=this._window.location;this.show(r.pathname+r.search+r.hash,void 0,void 0,!1)}}}(),_.prototype._which=function(e){return null==(e=e||this._window.event).which?e.button:e.which},_.prototype._toURL=function(e){var t=this._window;if("function"===typeof URL&&g)return new URL(e,t.location.toString());if(O){var n=t.document.createElement("a");return n.href=e,n}},_.prototype.sameOrigin=function(e){if(!e||!g)return!1;var t=this._toURL(e),n=this._window,r=n.location;return r.protocol===t.protocol&&r.hostname===t.hostname&&r.port===t.port},_.prototype._samePath=function(e){if(!g)return!1;var t=this._window,n=t.location;return e.pathname===n.pathname&&e.search===n.search},_.prototype._decodeURLEncodedURIComponent=function(e){return"string"!==typeof e?e:this._decodeURLComponents?decodeURIComponent(e.replace(/\+/g," ")):e},C.prototype.pushState=function(){var e=this.page,t=e._window,n=e._hashbang;e.len++,b&&t.history.pushState(this.state,this.title,n&&"/"!==this.path?"#!"+this.path:this.canonicalPath)},C.prototype.save=function(){var e=this.page;b&&e._window.history.replaceState(this.state,this.title,e._hashbang&&"/"!==this.path?"#!"+this.path:this.canonicalPath)},j.prototype.middleware=function(e){var t=this;return function(n,r){if(t.match(n.path,n.params))return e(n,r);r()}},j.prototype.match=function(e,t){var n=this.keys,r=e.indexOf("?"),i=~r?e.slice(0,r):e,o=this.regexp.exec(decodeURIComponent(i));if(!o)return!1;for(var a=1,c=o.length;a<c;++a){var s=n[a-1],u=this.page._decodeURLEncodedURIComponent(o[a]);void 0===u&&hasOwnProperty.call(t,s.name)||(t[s.name]=u)}return!0};var S=function e(){var t=new _;function n(){return y.apply(t,arguments)}return n.callbacks=t.callbacks,n.exits=t.exits,n.base=t.base.bind(t),n.strict=t.strict.bind(t),n.start=t.start.bind(t),n.stop=t.stop.bind(t),n.show=t.show.bind(t),n.back=t.back.bind(t),n.redirect=t.redirect.bind(t),n.replace=t.replace.bind(t),n.dispatch=t.dispatch.bind(t),n.exit=t.exit.bind(t),n.configure=t.configure.bind(t),n.sameOrigin=t.sameOrigin.bind(t),n.clickHandler=t.clickHandler.bind(t),n.create=e,Object.defineProperty(n,"len",{get:function(){return t.len},set:function(e){t.len=e}}),Object.defineProperty(n,"current",{get:function(){return t.current},set:function(e){t.current=e}}),n.Context=C,n.Route=j,n}(),I=S,R=S;return I.default=R,I}()}).call(this,n(112))},679:function(e,t,n){"use strict";var r=n(107),i=n.n(r),o=n(108),a=n.n(o),c=n(528),s=n.n(c),u=n(527),l=n.n(u),d=n(531),f=n.n(d),p=n(529),h=n.n(p),E=n(34),O=n.n(E),b=n(12),m=n.n(b),v=n(10),g=n.n(v),_=n(77),y=n.n(_),C=n(109),j=n(47),S=n.n(j),I=n(526),R=n.n(I),T=n(684),N=n.n(T),M=n(1),P=n(642),w=n(76),k=n.n(w),A=n(700),L=n.n(A),x=S()("calypso:popover:util");function D(){var e={};return e.top=window.scrollY,e.left=window.scrollX,e.width=window.innerWidth,e.height=window.innerHeight,e.right=e.left+e.width,e.bottom=e.top+e.height,x("viewport: %o",e),e}var W={top:"bottom",bottom:"top",left:"right",right:"left"},V={top:"right",left:"top",bottom:"left",right:"bottom"},H=D();function G(){H=D()}var U=!1,B=function(){if(U)return x("window events already bound");U=!0,x("bind handlers to `resize` and `scroll` events"),window.addEventListener("resize",G,!0),window.addEventListener("scroll",G,!0)},F=function(){if(!U)return x("window events are not bound");U=!1,x("unbind handlers to `resize` and `scroll` events"),window.removeEventListener("resize",G,!0),window.removeEventListener("scroll",G,!0)},z=function(e,t,n){var r=L()(n),i=t.clientHeight,o=t.clientWidth,a={top:r.top-i,bottom:H.height-r.bottom-i,left:r.left-o,right:H.width-r.right-o},c=e.split(/\s+/),s=k()(c,1)[0],u=k()(c,2)[1],l=function(e,t){for(var n,r=[e,W[e],V[e],W[V[e]]],i=-1/0,o=0,a=r.length;o<a;o++){var c=r[o],s=t[c];if(s>0)return c;s>i&&(i=s,n=e)}return n}(s,a);return u!==l&&u!==W[l]||(u=null),function(e,t,n,r,i,o){for(var a,c="top"===e||"bottom"===e,s=t?[c?"".concat(e," ").concat(t):"".concat(t," ").concat(e),e,c?"".concat(e," ").concat(W[t]):"".concat(W[t]," ").concat(e)]:[e,c?"".concat(e," ").concat(V[e]):"".concat(V[e]," ").concat(e),c?"".concat(e," ").concat(W[V[e]]):"".concat(W[V[e]]," ").concat(e)],u=0,l=i*o,d=0,f=s.length;d<f;d++){var p=s[d],h=q(p,n,r),E=h.left+i,O=h.top+o,b=Math.min(h.top<H.top?O-H.top:H.bottom-h.top,o),m=Math.min(h.left<H.left?E-H.left:H.right-h.left,i),v=m*b;if(v===l)return p;v>u&&(u=v,a=p)}return a}(l,u,t,n,o,i)||e};function q(e,t,n,r){var i=L()(t);if(!i)throw new Error("could not get bounding client rect of Tip element");var o=i.width,a=i.height,c=L()(n);if(!c)throw new Error("could not get bounding client rect of `target`");var s=c.width,u=c.height,l=function(e,t){var n=t.body||t.getElementsByTagName("body")[0],r=t.documentElement||n.parentNode,i=r.clientTop||n.clientTop||0,o=r.clientLeft||n.clientLeft||0,a=window.pageYOffset||r.scrollTop,c=window.pageXOffset||r.scrollLeft;return{top:e.top+a-i,left:e.left+c-o}}(c,document);if(!l)throw new Error("could not determine page offset of `target`");var d={};switch(e){case"top":d={top:l.top-a,left:r&&r.left?l.left+r.left:l.left+s/2-o/2};break;case"bottom":d={top:l.top+u,left:r&&r.left?l.left+r.left:l.left+s/2-o/2};break;case"right":d={top:l.top+u/2-a/2,left:l.left+s};break;case"left":d={top:l.top+u/2-a/2,left:l.left-o};break;case"top left":d={top:l.top-a,left:l.left+s/2-o+15};break;case"top right":d={top:l.top-a,left:l.left+s/2-15};break;case"bottom left":d={top:l.top+u,left:l.left+s/2-o+15};break;case"bottom right":d={top:l.top+u,left:l.left+s/2-15};break;case"left top":d={top:l.top+u/2-a,left:l.left-o};break;case"left bottom":d={top:l.top+u/2,left:l.left-o};break;case"right top":d={top:l.top+u/2-a,left:l.left+s};break;case"right bottom":d={top:l.top+u/2,left:l.left+s};break;default:throw new Error('invalid position "'.concat(e,'"'))}return d}var K=function(){},Z=S()("calypso:popover"),Q=new Set,Y=function(e){function t(e){var n;return i()(this,t),n=s()(this,l()(t).call(this,e)),O()(f()(n),"isUpdatingPosition",!1),n.setPopoverId(e.id),n.setDOMBehavior=n.setDOMBehavior.bind(f()(n)),n.setPosition=n.setPosition.bind(f()(n)),n.onClickout=n.onClickout.bind(f()(n)),n.onKeydown=n.onKeydown.bind(f()(n)),n.onWindowChange=n.onWindowChange.bind(f()(n)),n.state={show:e.isVisible,left:-99999,top:-99999,positionClass:n.getPositionClass(e.position)},n}return h()(t,e),a()(t,[{key:"componentDidMount",value:function(){this.state.show&&(this.bindEscKeyListener(),this.bindDebouncedReposition(),B())}},{key:"componentWillReceiveProps",value:function(e){if(this.domContext=y.a.findDOMNode(e.context),!e.isVisible)return null;this.setPosition()}},{key:"componentDidUpdate",value:function(e,t){var n=this,r=this.props.isVisible;return!t.show&&this.state.show&&(this.bindEscKeyListener(),this.bindDebouncedReposition(),B()),r!==e.isVisible&&(r?this.show():this.hide()),this.domContainer&&this.domContext&&r?void(this.isUpdatingPosition||(this.debug("requesting to update position after render completes"),requestAnimationFrame(function(){Q.has(n.id)&&n.domContainer&&n.domContext&&r?(n.setPosition(),n.isUpdatingPosition=!1):n.isUpdatingPosition=!1}),this.isUpdatingPosition=!0)):null}},{key:"componentWillUnmount",value:function(){this.debug("unmounting .... "),this.unbindClickoutHandler(),this.unbindDebouncedReposition(),this.unbindEscKeyListener(),F(),Q.delete(this.id),Z("current popover instances: ",Q.size)}},{key:"bindEscKeyListener",value:function(){if(!this.props.closeOnEsc)return null;this.debug("adding escKey listener ..."),document.addEventListener("keydown",this.onKeydown,!0)}},{key:"unbindEscKeyListener",value:function(){if(!this.props.closeOnEsc)return null;this.debug("unbinding `escKey` listener ..."),document.removeEventListener("keydown",this.onKeydown,!0)}},{key:"onKeydown",value:function(e){if(27!==e.keyCode)return null;this.close(!0)}},{key:"bindClickoutHandler",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.domContainer;return e?this._clickoutHandlerReference?(this.debug("clickout event already bound"),null):(this.debug("binding `clickout` event"),void(this._clickoutHandlerReference=N()(e,this.onClickout))):(this.debug("no element to bind clickout "),null)}},{key:"unbindClickoutHandler",value:function(){this._clickoutHandlerReference&&(this.debug("unbinding `clickout` listener ..."),this._clickoutHandlerReference(),this._clickoutHandlerReference=null)}},{key:"onClickout",value:function(e){var t=this.domContext&&this.domContext.contains&&!this.domContext.contains(e.target);if(this.props.ignoreContext&&t){var n=y.a.findDOMNode(this.props.ignoreContext);t=t&&n&&n.contains&&!n.contains(e.target)}t&&this.close()}},{key:"bindDebouncedReposition",value:function(){window.addEventListener("scroll",this.onWindowChange,!0),window.addEventListener("resize",this.onWindowChange,!0)}},{key:"unbindDebouncedReposition",value:function(){this.willReposition&&(window.cancelAnimationFrame(this.willReposition),this.willReposition=null),window.removeEventListener("scroll",this.onWindowChange,!0),window.removeEventListener("resize",this.onWindowChange,!0),this.debug("unbinding `debounce reposition` ...")}},{key:"onWindowChange",value:function(){this.willReposition=window.requestAnimationFrame(this.setPosition)}},{key:"setDOMBehavior",value:function(e){if(!e)return this.unbindClickoutHandler(),null;this.debug("setting DOM behavior"),this.bindClickoutHandler(e),this.domContainer=e,this.domContext=y.a.findDOMNode(this.props.context),this.setPosition()}},{key:"getPositionClass",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.position;return"is-".concat(e.replace(/\s+/g,"-"))}},{key:"adjustRtlPosition",value:function(e){if(this.props.isRtl)switch(e){case"top right":case"right top":return"top left";case"right":return"left";case"bottom right":case"right bottom":return"bottom left";case"bottom left":case"left bottom":return"bottom right";case"left":return"right";case"top left":case"left top":return"top right"}return e}},{key:"computePosition",value:function(){if(!this.props.isVisible)return null;var e=this.domContainer,t=this.domContext,n=this.props,r=n.position,i=n.relativePosition;if(!e||!t)return this.debug("[WARN] no DOM elements to work"),null;var o=r;this.debug("position: %o",o),this.props.autoRtl&&(o=this.adjustRtlPosition(o),this.debug("RTL adjusted position: %o",o)),this.props.autoPosition&&(o=z(o,e,t),this.debug("suggested position: %o",o));var a=Object.assign({},function(e,t){var n=L()(t).width;return e.left=Math.max(0,Math.min(e.left,H.width-n)),e}(q(o,e,t,i),e),{positionClass:this.getPositionClass(o)});return this.debug("updating reposition: ",a),a}},{key:"debug",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];Z.apply(void 0,["[%s] ".concat(e),this.id].concat(n))}},{key:"setPopoverId",value:function(e){this.id=e||"pop__".concat(Object(M.uniqueId)()),Q.add(this.id),this.debug("creating ..."),Z("current popover instances: ",Q.size)}},{key:"setPosition",value:function(){var e;if(this.debug("updating position"),!(e=this.props.customPosition?Object.assign({positionClass:this.getPositionClass(this.constructor.defaultProps.position)},this.props.customPosition):this.computePosition()))return null;this.willReposition=null,this.setState(e)}},{key:"getStylePosition",value:function(){var e=this.state;return{left:e.left,top:e.top}}},{key:"show",value:function(){var e=this;if(!this.props.showDelay)return this.setState({show:!0}),null;this.debug("showing in %o","".concat(this.props.showDelay,"ms")),this.clearShowTimer(),this._openDelayTimer=setTimeout(function(){e.setState({show:!0})},this.props.showDelay)}},{key:"hide",value:function(){this.unbindClickoutHandler(),this.unbindDebouncedReposition(),this.unbindEscKeyListener(),F(),this.setState({show:!1}),this.clearShowTimer()}},{key:"clearShowTimer",value:function(){if(!this._openDelayTimer)return null;clearTimeout(this._openDelayTimer),this._openDelayTimer=null}},{key:"close",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.props.isVisible)return this.debug("popover should be already closed"),null;this.props.onClose(e)}},{key:"render",value:function(){if(!this.state.show)return this.debug("is hidden. return no render"),null;if(!this.props.context)return this.debug("No `context` to tie. return no render"),null;var e=R()("popover",this.props.className,this.state.positionClass);return this.debug("rendering ..."),g.a.createElement(P.a,{className:this.props.rootClassName},g.a.createElement("div",{style:this.getStylePosition(),className:e},g.a.createElement("div",{className:"popover__arrow"}),g.a.createElement("div",{ref:this.setDOMBehavior,className:"popover__inner"},this.props.children)))}}]),t}(v.Component);O()(Y,"propTypes",{autoPosition:m.a.bool,autoRtl:m.a.bool,className:m.a.string,closeOnEsc:m.a.bool,id:m.a.string,ignoreContext:m.a.shape({getDOMNode:m.a.function}),isRtl:m.a.bool,isVisible:m.a.bool,position:m.a.oneOf(["top","top right","right","bottom right","bottom","bottom left","left","top left"]),rootClassName:m.a.string,showDelay:m.a.number,onClose:m.a.func,onShow:m.a.func,relativePosition:m.a.shape({left:m.a.number}),customPosition:m.a.shape({top:m.a.number,left:m.a.number,positionClass:m.a.oneOf(["top","right","bottom","left"])})}),O()(Y,"defaultProps",{autoPosition:!0,autoRtl:!0,className:"",closeOnEsc:!0,isRtl:!1,isVisible:!1,position:"top",showDelay:0,onClose:K,onShow:K});t.a=Object(C.b)(function(e){return{isRtl:document.body.classList.contains("rtl")}})(Y)},715:function(e,t,n){},716:function(e,t,n){"use strict";e.exports=n(717)},717:function(e,t,n){"use strict";var r=n(718);e.exports=function(e,t,n){n=n||{},9===t.nodeType&&(t=r.getWindow(t));var i=n.allowHorizontalScroll,o=n.onlyScrollIfNeeded,a=n.alignWithTop,c=n.alignWithLeft,s=n.offsetTop||0,u=n.offsetLeft||0,l=n.offsetBottom||0,d=n.offsetRight||0;i=void 0===i||i;var f=r.isWindow(t),p=r.offset(e),h=r.outerHeight(e),E=r.outerWidth(e),O=void 0,b=void 0,m=void 0,v=void 0,g=void 0,_=void 0,y=void 0,C=void 0,j=void 0,S=void 0;f?(y=t,S=r.height(y),j=r.width(y),C={left:r.scrollLeft(y),top:r.scrollTop(y)},g={left:p.left-C.left-u,top:p.top-C.top-s},_={left:p.left+E-(C.left+j)+d,top:p.top+h-(C.top+S)+l},v=C):(O=r.offset(t),b=t.clientHeight,m=t.clientWidth,v={left:t.scrollLeft,top:t.scrollTop},g={left:p.left-(O.left+(parseFloat(r.css(t,"borderLeftWidth"))||0))-u,top:p.top-(O.top+(parseFloat(r.css(t,"borderTopWidth"))||0))-s},_={left:p.left+E-(O.left+m+(parseFloat(r.css(t,"borderRightWidth"))||0))+d,top:p.top+h-(O.top+b+(parseFloat(r.css(t,"borderBottomWidth"))||0))+l}),g.top<0||_.top>0?!0===a?r.scrollTop(t,v.top+g.top):!1===a?r.scrollTop(t,v.top+_.top):g.top<0?r.scrollTop(t,v.top+g.top):r.scrollTop(t,v.top+_.top):o||((a=void 0===a||!!a)?r.scrollTop(t,v.top+g.top):r.scrollTop(t,v.top+_.top)),i&&(g.left<0||_.left>0?!0===c?r.scrollLeft(t,v.left+g.left):!1===c?r.scrollLeft(t,v.left+_.left):g.left<0?r.scrollLeft(t,v.left+g.left):r.scrollLeft(t,v.left+_.left):o||((c=void 0===c||!!c)?r.scrollLeft(t,v.left+g.left):r.scrollLeft(t,v.left+_.left)))}},718:function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function o(e,t){var n=e["page"+(t?"Y":"X")+"Offset"],r="scroll"+(t?"Top":"Left");if("number"!==typeof n){var i=e.document;"number"!==typeof(n=i.documentElement[r])&&(n=i.body[r])}return n}function a(e){return o(e)}function c(e){return o(e,!0)}function s(e){var t=function(e){var t,n=void 0,r=void 0,i=e.ownerDocument,o=i.body,a=i&&i.documentElement;return n=(t=e.getBoundingClientRect()).left,r=t.top,{left:n-=a.clientLeft||o.clientLeft||0,top:r-=a.clientTop||o.clientTop||0}}(e),n=e.ownerDocument,r=n.defaultView||n.parentWindow;return t.left+=a(r),t.top+=c(r),t}var u=new RegExp("^("+/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source+")(?!px)[a-z%]+$","i"),l=/^(top|right|bottom|left)$/,d="currentStyle",f="runtimeStyle",p="left",h="px";var E=void 0;function O(e,t){for(var n=0;n<e.length;n++)t(e[n])}function b(e){return"border-box"===E(e,"boxSizing")}E=window.getComputedStyle?function(e,t,n){var r="",i=e.ownerDocument,o=n||i.defaultView.getComputedStyle(e,null);return o&&(r=o.getPropertyValue(t)||o[t]),r}:function(e,t){var n=e[d]&&e[d][t];if(u.test(n)&&!l.test(t)){var r=e.style,i=r[p],o=e[f][p];e[f][p]=e[d][p],r[p]="fontSize"===t?"1em":n||0,n=r.pixelLeft+h,r[p]=i,e[f][p]=o}return""===n?"auto":n};var m=["margin","border","padding"],v=-1,g=2,_=1;function y(e,t,n){var r=0,i=void 0,o=void 0,a=void 0;for(o=0;o<t.length;o++)if(i=t[o])for(a=0;a<n.length;a++){var c=void 0;c="border"===i?i+n[a]+"Width":i+n[a],r+=parseFloat(E(e,c))||0}return r}function C(e){return null!=e&&e==e.window}var j={};function S(e,t,n){if(C(e))return"width"===t?j.viewportWidth(e):j.viewportHeight(e);if(9===e.nodeType)return"width"===t?j.docWidth(e):j.docHeight(e);var r="width"===t?["Left","Right"]:["Top","Bottom"],i="width"===t?e.offsetWidth:e.offsetHeight,o=(E(e),b(e)),a=0;(null==i||i<=0)&&(i=void 0,(null==(a=E(e,t))||Number(a)<0)&&(a=e.style[t]||0),a=parseFloat(a)||0),void 0===n&&(n=o?_:v);var c=void 0!==i||o,s=i||a;if(n===v)return c?s-y(e,["border","padding"],r):a;if(c){var u=n===g?-y(e,["border"],r):y(e,["margin"],r);return s+(n===_?0:u)}return a+y(e,m.slice(n),r)}O(["Width","Height"],function(e){j["doc"+e]=function(t){var n=t.document;return Math.max(n.documentElement["scroll"+e],n.body["scroll"+e],j["viewport"+e](n))},j["viewport"+e]=function(t){var n="client"+e,r=t.document,i=r.body,o=r.documentElement[n];return"CSS1Compat"===r.compatMode&&o||i&&i[n]||o}});var I={position:"absolute",visibility:"hidden",display:"block"};function R(e){var t=void 0,n=arguments;return 0!==e.offsetWidth?t=S.apply(void 0,n):function(e,t,n){var r={},i=e.style,o=void 0;for(o in t)t.hasOwnProperty(o)&&(r[o]=i[o],i[o]=t[o]);for(o in n.call(e),t)t.hasOwnProperty(o)&&(i[o]=r[o])}(e,I,function(){t=S.apply(void 0,n)}),t}function T(e,t,n){var r=n;if("object"!==("undefined"===typeof t?"undefined":i(t)))return"undefined"!==typeof r?("number"===typeof r&&(r+="px"),void(e.style[t]=r)):E(e,t);for(var o in t)t.hasOwnProperty(o)&&T(e,o,t[o])}O(["width","height"],function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);j["outer"+t]=function(t,n){return t&&R(t,e,n?0:_)};var n="width"===e?["Left","Right"]:["Top","Bottom"];j[e]=function(t,r){if(void 0===r)return t&&R(t,e,v);if(t){E(t);return b(t)&&(r+=y(t,["padding","border"],n)),T(t,e,r)}}}),e.exports=r({getWindow:function(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},offset:function(e,t){if("undefined"===typeof t)return s(e);!function(e,t){"static"===T(e,"position")&&(e.style.position="relative");var n=s(e),r={},i=void 0,o=void 0;for(o in t)t.hasOwnProperty(o)&&(i=parseFloat(T(e,o))||0,r[o]=i+t[o]-n[o]);T(e,r)}(e,t)},isWindow:C,each:O,css:T,clone:function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);if(e.overflow)for(var n in e)e.hasOwnProperty(n)&&(t.overflow[n]=e.overflow[n]);return t},scrollLeft:function(e,t){if(C(e)){if(void 0===t)return a(e);window.scrollTo(t,c(e))}else{if(void 0===t)return e.scrollLeft;e.scrollLeft=t}},scrollTop:function(e,t){if(C(e)){if(void 0===t)return c(e);window.scrollTo(a(e),t)}else{if(void 0===t)return e.scrollTop;e.scrollTop=t}},viewportWidth:0,viewportHeight:0},j)},759:function(e,t,n){},763:function(e,t,n){e.exports=n(764).ObjectPath},764:function(e,t,n){"use strict";!function(e){var n={"'":/\\\'/g,'"':/\\\"/g},r={parse:function(e){if("string"!==typeof e)throw new TypeError("ObjectPath.parse must be passed a string");for(var t,r,i,o,a=0,c=[];a<e.length;)if(t=e.indexOf(".",a),r=e.indexOf("[",a),-1===t&&-1===r)c.push(e.slice(a,e.length)),a=e.length;else if(-1===r||-1!==t&&t<r)c.push(e.slice(a,t)),a=t+1;else if(r>a&&(c.push(e.slice(a,r)),a=r),'"'!==(i=e.slice(r+1,r+2))&&"'"!==i)-1===(o=e.indexOf("]",r))&&(o=e.length),c.push(e.slice(a+1,o)),a="."===e.slice(o+1,o+2)?o+2:o+1;else{for(-1===(o=e.indexOf(i+"]",r))&&(o=e.length);"\\"===e.slice(o-1,o)&&r<e.length;)r++,o=e.indexOf(i+"]",r);c.push(e.slice(a+2,o).replace(n[i],i)),a="."===e.slice(o+2,o+3)?o+3:o+2}return c},stringify:function(e,t){return Array.isArray(e)||(e=[e.toString()]),t='"'===t?'"':"'",e.map(function(e){return"["+t+e.toString().replace(new RegExp(t,"g"),"\\"+t)+t+"]"}).join("")},normalize:function(e,t){return r.stringify(Array.isArray(e)?e:r.parse(e),t)},registerModule:function(e){e.module("ObjectPath",[]).provider("ObjectPath",function(){this.parse=r.parse,this.stringify=r.stringify,this.normalize=r.normalize,this.$get=function(){return r}})}};"function"===typeof define&&define.amd?define(function(){return{ObjectPath:r,parse:r.parse,stringify:r.stringify,normalize:r.normalize}}):t.ObjectPath=r}()},787:function(e,t,n){"use strict";n.r(t);var r=n(36),i=n.n(r),o=n(34),a=n.n(o),c=n(10),s=n.n(c),u=(n(715),n(107)),l=n.n(u),d=n(108),f=n.n(d),p=n(528),h=n.n(p),E=n(527),O=n.n(E),b=n(531),m=n.n(b),v=n(529),g=n.n(v),_=n(109),y=n(35),C=n(1),j=n(110),S=n.n(j),I=n(542),R=n(532),T=n(584),N=n(566),M=n(539),P=n(568),w={wc_services_usps:Object(y.translate)("USPS",{comment:"United States Postal Services"}),wc_services_canada_post:Object(y.translate)("Canada Post"),wc_services_fedex:Object(y.translate)("FedEx"),wc_services_ups:Object(y.translate)("UPS"),wc_services_dhlexpress:Object(y.translate)("DHL Express")},k=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(R.a)(e),n=Object(C.get)(e,["extensions","woocommerce","sites",t,"shippingMethods"]);return Object(C.isArray)(n)?(Object(N.a)(e,t)?n:Object(C.filter)(n,function(e){var t=e.id;return!Object(C.startsWith)(t,"wc_services")})).map(function(e){return i()({},e,{title:w[e.id]||e.title})}):n},A=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(R.a)(e);if(!Object(C.isArray)(k(e,t)))return!1;var n=Object(C.filter)(k(e,t),function(e){var t=e.id;return Object(C.startsWith)(t,"wc_services")});return Object(C.every)(n,function(n){var r=n.id;return Object(P.b)(e,r,t)})},L=(Object(I.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(R.a)(e);if(!A(e,t))return function(e){return e};var n=k(e,t).reduce(function(e,t){var n=t.id,r=t.title;return e[n]=r,e},{});return function(e){return n[e]||e}},[A,k]),n(576)),x=n(533),D=n.n(x),W=n(76),V=n.n(W),H=n(608),G=n(565),U=n(46),B=n(535),F=function(e,t){if(!t||t.pristine)return e;var n=e.journal,r=e.states,i=t.journal,o=t.states,a=t.postcode,c=null;return null!==o&&(null===r?c=o:(c={add:o.removeAll?[]:S()(r.add),remove:o.removeAll?[]:S()(r.remove),removeAll:r.removeAll||o.removeAll},Object(C.pullAll)(c.add,o.remove),Object(C.pullAll)(c.remove,o.add),c.add=Object(C.union)(c.add,o.add),c.remove=Object(C.union)(c.remove,o.remove))),{journal:[].concat(S()(n),S()(i)),states:c,postcode:a,pristine:t.pristine&&e.pristine}},z="ADD_CONTINENT",q="REMOVE_CONTINENT",K="ADD_COUNTRY",Z="REMOVE_COUNTRY",Q={journal:[],states:null,postcode:null,pristine:!0},Y={};Y[B.db]=function(e){return i()({},e,{temporaryChanges:i()({},Q)})},Y[B.cb]=function(e){var t=e.temporaryChanges,n=D()(e,["temporaryChanges"]);return F(n,t)},Y[B.bb]=function(e){return i()({},e,{temporaryChanges:null})},Y[B.ib]=function(e,t){var n=t.continentCode,r=t.selected;return i()({},e,{temporaryChanges:i()({},e.temporaryChanges,{states:null,postcode:null,journal:[].concat(S()(e.temporaryChanges.journal),[{action:r?z:q,code:n}])})})},Y[B.jb]=function(e,t){var n=t.countryCode,r=t.selected;return i()({},e,{temporaryChanges:i()({},e.temporaryChanges,{states:null,postcode:null,journal:[].concat(S()(e.temporaryChanges.journal),[{action:r?K:Z,code:n}])})})},Y[B.kb]=function(e,t){var n=t.stateCode,r=t.selected,o=e.temporaryChanges.states||{add:[],remove:[],removeAll:!1},a=S()(o.add),c=S()(o.remove),s=o.removeAll;return r?(Object(C.find)(a,n)||a.push(n),Object(C.pull)(c,n)):(Object(C.find)(c,n)||c.push(n),Object(C.pull)(a,n)),i()({},e,{temporaryChanges:i()({},e.temporaryChanges,{states:{add:a,remove:c,removeAll:s}})})},Y[B.eb]=function(e,t){var n=t.postcode;return i()({},e,{temporaryChanges:i()({},e.temporaryChanges,{postcode:n})})},Y[B.hb]=function(e){return i()({},e,{temporaryChanges:i()({},e.temporaryChanges,{postcode:null,states:null})})},Y[B.gb]=function(e){return i()({},e,{temporaryChanges:i()({},e.temporaryChanges,{postcode:null,states:{add:[],remove:[],removeAll:!0}})})},Y[B.fb]=function(e){return i()({},e,{temporaryChanges:i()({},e.temporaryChanges,{postcode:"",states:null})})};var $=Object(U.b)(Q,Y),J=Object(I.a)(function(e,t){var n={},r=fe(e,t);return Object(C.forIn)(Object(H.c)(e,t),function(e,t){var i=e.continent;if(r.id!==Number(t)){var o=!0,a=!1,c=void 0;try{for(var s,u=i[Symbol.iterator]();!(o=(s=u.next()).done);o=!0){var l=s.value;n[l]=Number(t)}}catch(d){a=!0,c=d}finally{try{o||null==u.return||u.return()}finally{if(a)throw c}}}}),n},function(e,t){return[fe(e,t),Object(H.c)(e,t)]}),X=Object(I.a)(function(e,t){var n={},r=fe(e,t);return Object(C.forIn)(Object(H.c)(e,t),function(e,t){var i=e.country,o=e.postcode;if(r.id!==Number(t)&&Object(C.isEmpty)(o)){var a=!0,c=!1,s=void 0;try{for(var u,l=i[Symbol.iterator]();!(a=(u=l.next()).done);a=!0){var d=u.value;n[d]=Number(t)}}catch(f){c=!0,s=f}finally{try{a||null==l.return||l.return()}finally{if(c)throw s}}}}),n},function(e,t){return[fe(e,t),Object(H.c)(e,t)]}),ee=Object(I.a)(function(e,t,n){var r={},i=fe(e,t);return Object(C.forIn)(Object(H.c)(e,t),function(e,t){if(i.id!==Number(t)){var o=!0,a=!1,c=void 0;try{for(var s,u=e.state[Symbol.iterator]();!(o=(s=u.next()).done);o=!0){var l=s.value.split(":"),d=V()(l,2),f=d[0],p=d[1];f===n&&(r[p]=Number(t))}}catch(h){a=!0,c=h}finally{try{o||null==u.return||u.return()}finally{if(a)throw c}}}}),r},function(e,t){return[fe(e,t),Object(H.c)(e,t)]},function(e,t,n){return[t,n].join()}),te=Object(I.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(R.a)(e);if(!Object(T.a)(e,n))return null;var r=Object(H.c)(e,n)[t]||{continent:[],country:[],state:[],postcode:[]},o=new Set(r.country),a=new Set;return r.state.forEach(function(e){var t=e.split(":"),n=V()(t,2),r=n[0],i=n[1];o.add(r),a.add(i)}),i()({},r,{country:Array.from(o),state:Array.from(a)})},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(R.a)(e),r=Object(T.a)(e,n);return[r,r&&Object(H.c)(e,n)]},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(R.a)(e),r=Object(C.isObject)(t)?"i".concat(t.index):t;return"".concat(r).concat(n)}),ne=Object(I.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(R.a)(e),n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!Object(T.a)(e,t))return null;var r=fe(e,t);if(!r)return null;var i=te(e,r.id,t),o=new Set(i.continent),a=new Set(i.country),c=new Set(i.state),s=ue(e,t).currentlyEditingChanges.locations,u=s.temporaryChanges,l=D()(s,["temporaryChanges"]),d=n?F(l,u):l;if(d.pristine)return{continent:Array.from(o),country:Array.from(a),state:Array.from(c),postcode:i.postcode};var f=new Set(Object.keys(X(e,t)));return d.journal.forEach(function(n){var r=n.action,i=n.code;switch(r){case z:Object(G.f)(e,i,t).forEach(function(e){return a.delete(e.code)}),a.size?Object(G.f)(e,i,t).forEach(function(e){f.has(e.code)||a.add(e.code)}):o.add(i);break;case q:o.delete(i),Object(G.f)(e,i,t).forEach(function(e){return a.delete(e.code)});break;case K:f.forEach(function(e){a.delete(e)}),a.add(i),o.forEach(function(n){Object(G.f)(e,n,t).forEach(function(e){f.has(e.code)||a.add(e.code)})}),o.clear();break;case Z:var c=!1,s=!0,u=!1,l=void 0;try{for(var d,p=o[Symbol.iterator]();!(s=(d=p.next()).done);s=!0){var h=d.value;if(c)break;var E=!0,O=!1,b=void 0;try{for(var m,v=Object(G.f)(e,h,t)[Symbol.iterator]();!(E=(m=v.next()).done);E=!0){if(m.value.code===i){c=!0;break}}}catch(g){O=!0,b=g}finally{try{E||null==v.return||v.return()}finally{if(O)throw b}}}}catch(g){u=!0,l=g}finally{try{s||null==p.return||p.return()}finally{if(u)throw l}}c&&(o.forEach(function(n){Object(G.f)(e,n,t).forEach(function(e){f.has(e.code)||a.add(e.code)})}),o.clear()),a.delete(i)}}),d.states&&!d.states.removeAll&&Object(C.isEmpty)(d.journal)||c.clear(),d.states&&(d.states.add.forEach(function(e){return c.add(e)}),d.states.remove.forEach(function(e){return c.delete(e)})),{continent:Array.from(o),country:Array.from(a),state:Array.from(c),postcode:null===d.postcode?[]:[d.postcode]}},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(R.a)(e),n=Object(T.a)(e,t),r=n&&fe(e,t);return[n,r,r&&te(e,r.id,t),r&&ue(e,t),r&&X(e,t)]},function(e){return[arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(R.a)(e),!(arguments.length>2&&void 0!==arguments[2])||arguments[2]].join()}),re=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(R.a)(e);if(!function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(R.a)(e);return!(!Object(T.a)(e,t)||!fe(e,t))&&Boolean(ue(e,t).currentlyEditingChanges.locations.temporaryChanges)}(e,t))return!1;var n=ne(e,t);return n&&Object(C.isEmpty)(n.continent)&&1===n.country.length},ie=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(R.a)(e);if(!re(e,t))return null;var n=ne(e,t);return X(e,t)[n.country[0]]},oe=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(R.a)(e);if(!re(e,t))return!1;var n=ne(e,t);return n&&Object(G.j)(e,n.country[0],t)},ae=Object(I.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(R.a)(e);if(!re(e,t))return!1;var n=fe(e,t),r=Object(H.c)(e,t)[n.id],i=ue(e,t).currentlyEditingChanges.locations,o=i.temporaryChanges,a=D()(i,["temporaryChanges"]),c=F(a,o);return c.pristine?!Object(C.isEmpty)(r.postcode):null!==c.postcode||!oe(e,t)&&Boolean(ie(e,t))},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(R.a)(e),n=re(e,t);return[n,n&&fe(e,t),n&&Object(H.c)(e,t),n&&ue(e,t),n&&oe(e,t),n&&ie(e,t)]}),ce=Object(I.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(R.a)(e);if(!re(e,t)||!oe(e,t))return!1;var n=fe(e,t),r=Object(H.c)(e,t)[n.id],i=ue(e,t).currentlyEditingChanges.locations,o=i.temporaryChanges,a=D()(i,["temporaryChanges"]),c=F(a,o);return c.pristine?!Object(C.isEmpty)(r.state):null!==c.states||!ae(e,t)&&Boolean(ie(e,t))},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(R.a)(e),n=re(e,t);return[n,n&&oe(e,t),n&&fe(e,t),n&&Object(H.c)(e,t),n&&ue(e,t),n&&ae(e,t),n&&ie(e,t)]}),se=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:999,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Object(R.a)(e);if(!t)return[];var i=new Set(t.continent);if(i.size)return Object(G.e)(e,r).filter(function(e){var t=e.code;return i.has(t)}).map(function(e){return{type:"continent",code:e.code,name:e.name}});var o=new Set(t.state);if(o.size){var a=t.country[0],c=Object(G.g)(e,a,r);return Object(G.i)(e,a,r).filter(function(e){var t=e.code;return o.has(t)}).map(function(e){return{type:"state",code:e.code,name:e.name,countryName:c,countryCode:a}})}if(t.postcode[0])return t.country.map(function(n){return{type:"country",code:n,name:Object(G.g)(e,n,r),postcodeFilter:t.postcode[0]}});var s=new Set(t.country);if(!s.size)return[];var u=[];return Object(G.e)(e,r).forEach(function(t){var i=t.code,o=t.name,a=Object(G.f)(e,i,r),c=a.filter(function(e){var t=e.code;return s.has(t)}).map(function(e){return{type:"country",code:e.code,name:e.name,postcodeFilter:void 0}});c.length<n?u=u.concat(c):u.push({type:"continent",code:i,name:o,countryCount:a.length,selectedCountryCount:c.length})}),u},ue=(Object(I.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:999,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Object(R.a)(e),i=te(e,t,r);return se(e,i,n,r)},function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Object(R.a)(e);return[te(e,t,r)]},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:999,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Object(R.a)(e),i=Object(C.isObject)(t)?"i".concat(t.index):t;return"".concat(i).concat(n).concat(r)}),Object(I.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:999,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(R.a)(e),r=ne(e,n,!1);return se(e,r,t,n)},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(R.a)(e);return[ne(e,n,!1)]},function(e){return[arguments.length>1&&void 0!==arguments[1]?arguments[1]:999,arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(R.a)(e)].join()}),Object(I.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(R.a)(e),n=ne(e,t);if(!n)return[];var r=new Set(n.continent),i=new Set(n.country),o=J(e,t),a=X(e,t),c=[],s=0===r.size&&0===i.size;return Object(G.e)(e,t).forEach(function(n){var u=n.code,l=n.name,d=r.has(u),f=Object(G.f)(e,u,t),p=0,h=c.push({code:u,name:l,selected:d,disabled:Boolean(o[u]),ownerZoneId:o[u],type:"continent",countryCount:f.length});f.forEach(function(e){var t=e.code,n=e.name,r=d||i.has(t);r&&p++,c.push({code:t,name:n,selected:r,disabled:!s&&Boolean(a[t]),ownerZoneId:a[t],type:"country"})}),c[h-1].selectedCountryCount=p}),c},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(R.a)(e);return[ne(e,t),J(e,t),X(e,t)]}),Object(I.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(R.a)(e);if(!ce(e,t))return[];var n=ne(e,t);if(!n)return[];var r=n.country[0],i=new Set(n.state),o=ee(e,t,r);return Object(G.i)(e,r,t).map(function(e){var t=e.code;return{code:t,name:e.name,selected:i.has(t),disabled:Boolean(o[t]),ownerZoneId:o[t]}})},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(R.a)(e);return[ce(e,t),ne(e,t),ee(e,t)]}),function(e,t){return Object(C.get)(e,["extensions","woocommerce","ui","shipping",t,"zones"])}),le=function(e){return S()(e).sort(function(e,t){return Object(C.isNumber)(e.id)||Object(C.isNumber)(t.id)?Object(C.isNumber)(e.id)?Object(C.isNumber)(t.id)?0===e.id?1:0===t.id?-1:e.order===t.order?e.id-t.id:e.order-t.order:1:-1:e.id.index-t.id.index})},de=Object(I.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(R.a)(e);if(!Object(T.a)(e,t))return[];var n=S()(Object(T.b)(e,t)),r=ue(e,t);if(!r)return le(n);var o=r.creates,a=r.updates;return r.deletes.forEach(function(e){var t=e.id;return Object(C.remove)(n,{id:t})}),a.forEach(function(e){var t=Object(C.findIndex)(n,{id:e.id});-1!==t&&(n[t]=i()({},n[t],e))}),le([].concat(S()(n),S()(o)))},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(R.a)(e),n=Object(T.a)(e,t);return[t,n,n&&Object(T.b)(e,t),n&&ue(e,t)]}),fe=Object(I.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(R.a)(e),n=ue(e,t);if(!n)return null;if(null===n.currentlyEditingId)return null;var r=Object(C.find)(de(e,t),{id:n.currentlyEditingId});return r?i()({},r,n.currentlyEditingChanges):i()({id:n.currentlyEditingId},n.currentlyEditingChanges)},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(R.a)(e),n=ue(e,t);return[t,n,n&&null!==n.currentlyEditingId&&de(e,t)]});function pe(e){return e&&!Object(C.isObject)(e.id)?"updates":"creates"}var he={};he[B.Bb]=function(e,t){var n=t.isTaxable;return i()({},e,{tax_status:n?"taxable":"none"})},he[B.zb]=function(e,t){var n=t.cost;return i()({},e,{cost:n})};var Ee=Object(U.b)({tax_status:"none",cost:5},he),Oe={};Oe[B.yb]=function(e,t){var n=t.condition;return i()({},e,{requires:n})},Oe[B.Ab]=function(e,t){var n=t.cost;return i()({},e,{min_amount:n})};var be=Object(U.b)({requires:"",min_amount:0},Oe),me={};me[B.Bb]=function(e,t){var n=t.isTaxable;return i()({},e,{tax_status:n?"taxable":"none"})},me[B.zb]=function(e,t){var n=t.cost;return i()({},e,{cost:n})};var ve=Object(U.b)({tax_status:"none",cost:0},me),ge=n(538),_e={};_e[ge.x]=function(e,t){return Object(C.setWith)(Object(C.clone)(e),t.path,t.value,C.clone)};var ye=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"function"===typeof _e[t.type]?_e[t.type](e,t):e},Ce={flat_rate:Ee,free_shipping:be,local_pickup:ve,wc_services_usps:ye,wc_services_canada_post:ye,wc_services_fedex:ye,wc_services_ups:ye,wc_services_dhlexpress:ye},je={creates:[],updates:[],deletes:[],currentlyEditingId:null,currentlyEditingNew:!1,currentlyEditingChangedType:!1},Se={},Ie=function(e){return{index:Object(C.isEmpty)(e.creates)?0:e.creates[e.creates.length-1].id.index+1}};Se[B.ob]=function(e,t){var n=t.methodType,r=t.title,o=Ie(e),a={id:o,methodType:n};return Ce[n]&&(a=i()({},a,{title:r},Ce[n](void 0,t))),i()({},e,{currentlyEditingId:o,currentlyEditingNew:!0,currentlyEditingChangedType:!1,currentlyEditingChanges:a})},Se[B.wb]=function(e,t){return i()({},e,{currentlyEditingId:t.methodId,currentlyEditingChanges:{},currentlyEditingChangedType:!1,currentlyEditingNew:!1})},Se[B.pb]=function(e){return i()({},e,{currentlyEditingId:null,currentlyEditingChangedType:!1,currentlyEditingNew:!1})},Se[B.rb]=function(e){var t=e,n=t.currentlyEditingId,r=t.currentlyEditingChanges,o=t.currentlyEditingNew,c=t.currentlyEditingChangedType;if(null===n)return e;if(Object(C.isEmpty)(r))return i()({},e,{currentlyEditingChangedType:!1,currentlyEditingNew:!1,currentlyEditingId:null});var s=pe({id:n});if(o)return i()({},e,{creates:[].concat(S()(e.creates),[r]),currentlyEditingId:null,currentlyEditingNew:!1,currentlyEditingChangedType:!1,currentlyEditingChanges:{}});if(c){var u=Object(C.find)(e[s],{id:n}),l=n;return u&&!Object(C.isNil)(u._originalId)&&(l=u._originalId),e=Se[B.xb](e,{methodId:n}),i()({},e,{currentlyEditingId:null,currentlyEditingChangedType:!1,currentlyEditingNew:!1,creates:[].concat(S()(e.creates),[i()({},r,{enabled:Object(C.isNil)(r.enabled)?u&&u.enabled:r.enabled,id:Ie(e),_originalId:l})])})}var d=!1,f=e[s].map(function(e){return Object(C.isEqual)(n,e.id)?(d=!0,i()({},e,r)):e});return d||f.push(i()({id:n},r)),i()({},e,a()({currentlyEditingId:null,currentlyEditingChangedType:!1,currentlyEditingNew:!1},s,f))},Se[B.xb]=function(e,t){var n=t.methodId,r=i()({},e,{currentlyEditingId:null}),o=pe({id:n});return"updates"===o&&(r.deletes=[].concat(S()(e.deletes),[{id:n}])),r[o]=Object(C.reject)(e[o],{id:n}),r},Se[B.qb]=function(e,t){var n=t.methodType,r=t.title;if(!Ce[n])return e;var o=i()({},Ce[n](void 0,t),{id:e.currentlyEditingId,title:r,methodType:n,enabled:e.currentlyEditingChanges&&e.currentlyEditingChanges.enabled});return i()({},e,{currentlyEditingChangedType:!0,currentlyEditingChanges:o})},Se[B.vb]=function(e,t){var n=t.title;return i()({},e,{currentlyEditingChanges:i()({},e.currentlyEditingChanges,{title:n})})},Se[B.Db]=function(e,t){var n=t.enabled;return i()({},e,{currentlyEditingChanges:i()({},e.currentlyEditingChanges,{enabled:n})})},Se[B.Cb]=function(e,t){var n=t.methodId,r=t.enabled,o=pe({id:n}),c=Object(C.findIndex)(e[o],{id:n});if(-1===c)return i()({},e,a()({},o,[].concat(S()(e[o]),[{id:n,enabled:r}])));var s=i()({},e[o][c],{enabled:r});return i()({},e,a()({},o,[].concat(S()(e[o].slice(0,c)),[s],S()(e[o].slice(c+1)))))},Se[B.Fb]=function(e,t){var n=t.data,r=t.originatingAction,o=r.methodId,a=r.method,c=pe({id:o}),s=i()({},e,{currentlyEditingId:null});if("creates"===c){var u=Object(C.find)(e.creates,{id:o});u&&(s.updates=[].concat(S()(e.updates),[i()({},u,{id:n.id})])),s.creates=Object(C.reject)(e[c],{id:o})}else{var l=Object(C.find)(e.updates,{id:o}),d=Object(C.omit)(l,Object.keys(a));if(Object(C.isEmpty)(Object(C.omit)(d,["id","methodType"])))s.updates=Object(C.reject)(e.updates,{id:o});else{var f=Object(C.findIndex)(e.updates,{id:o});s.updates=[].concat(S()(e[c].slice(0,f)),[d],S()(e[c].slice(f+1)))}}return s},Se[B.ub]=function(e,t){var n=t.originatingAction.methodId;return i()({},e,{creates:Object(C.reject)(e.creates,{id:n}),updates:Object(C.reject)(e.updates,{id:n}),deletes:Object(C.reject)(e.deletes,{id:n}),currentlyEditingId:null})};var Re=Object(U.b)(je,Se),Te=function(e,t){if(!t)return e;var n=e.creates,r=e.updates,i=e.deletes,o=t.creates,a=t.updates,c=t.deletes,s=t.currentlyEditingId,u=t.currentlyEditingNew,l=t.currentlyEditingChangedType,d={creates:S()(n),updates:S()(r),deletes:S()(i),currentlyEditingId:s,currentlyEditingNew:u,currentlyEditingChangedType:l};return c.forEach(function(e){var t=e.id,n=pe({id:t});"updates"===n&&d.deletes.push({id:t}),Object(C.remove)(d[n],{id:t})}),o.forEach(function(e){var t=Object(C.findIndex)(n,{id:e.id});-1===t?d.creates.push(e):d.creates[t]=Object(C.merge)({},d.creates[t],e)}),a.forEach(function(e){var t=Object(C.findIndex)(r,{id:e.id});-1===t?d.updates.push(e):d.updates[t]=Object(C.merge)({},d.updates[t],e)}),d};function Ne(e){switch(e.type){case"boolean":return e.default||!1;case"number":return e.default||0;case"string":case"textarea":return e.default||"";case"array":return e.default||[];case"object":return Object(C.mapValues)(Object(C.get)(e,"properties",{}),Ne);default:return null}}var Me=function(e){return Object(C.mapValues)(e.properties,Ne)},Pe=Object(I.a)(function(e,t,n){return Object(T.a)(e,n)?null===t?fe(e,n):Object(C.find)(Object(T.b)(e,n),{id:t}):null},function(e,t,n){var r=Object(T.a)(e,n);return[r,r&&fe(e,n),r&&Object(T.b)(e,n)]},function(e,t,n){return Object(C.isNumber)(t)?"".concat(t).concat(n):"i".concat(t.index).concat(n)}),we=function(e,t,n,r){var o=S()(t.methodIds||[]),a=function(e,t,n){var r=ue(e,n);if(r){var i=Object(C.find)(r[pe({id:t})],{id:t});if(i&&!Object(C.isEmpty)(i.methods))return i.methods}return{creates:[],updates:[],deletes:[],currentlyEditingId:null}}(e,t.id,n),c=Te(a,r),s=c.creates,u=c.updates,l=c.deletes;Object(C.pullAll)(o,Object(C.map)(l,"id"));var d=o.map(function(t){return Object(L.c)(e,t,n)});u.forEach(function(e){var t=o.indexOf(e.id);-1!==t&&(d[t]=i()({},d[t],e))});var f=[].concat(S()(d),S()(s)).map(function(t){var r=t.enabled;Object(C.isNil)(r)&&"number"===typeof t._originalId&&(r=Object(L.c)(e,t._originalId,n).enabled);var i=Object(C.startsWith)(t.methodType,"wc_services")?Me(Object(P.a)(e,t.methodType,n).formSchema):{};return Object(C.merge)({},i,t,{enabled:!1!==r})});return function(e,t,n){return n.sort(function(n,r){var i=Object(C.isNil)(n._originalId)?n.id:n._originalId,o=Object(C.isNil)(r._originalId)?r.id:r._originalId;return Object(C.isNumber)(i)?Object(C.isNumber)(o)?Object(L.c)(e,i,t).order-Object(L.c)(e,o,t).order:-1:Object(C.isNumber)(o)?1:i.index-o.index})}(e,n,f)},ke=(Object(I.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(R.a)(e);if(!Object(T.a)(e,n))return[];var r=Pe(e,t,n)||{id:t,methodIds:[]};return we(e,r,n)},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(R.a)(e),r=Object(T.a)(e,n);return[r,r&&Pe(e,n),r&&ue(e,n)]},function(e,t,n){return Object(C.isNumber)(t)?"".concat(t).concat(n):"i".concat(t.index).concat(n)}),Object(I.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(R.a)(e);if(!Object(T.a)(e,t))return[];var n=fe(e,t);if(!n)return[];var r=ue(e,t).currentlyEditingChanges.methods;return we(e,n,t,r)},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(R.a)(e),n=Object(T.a)(e,t),r=n&&fe(e,t);return[n,r,r&&ue(e,t)]})),Ae=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(R.a)(e);if(!Object(T.a)(e,t))return null;var n=fe(e,t);if(!n||!n.methods||!n.methods.currentlyEditingId)return null;var r=n.methods.currentlyEditingChanges.methodType,i=Object(C.startsWith)(r,"wc_services")?Me(Object(P.a)(e,r,t).formSchema):{};if(n.methods.currentlyEditingNew)return Object(C.merge)({},i,n.methods.currentlyEditingChanges,{enabled:!1!==n.methods.currentlyEditingChanges.enabled});var o=ke(e),a=Object(C.find)(o,{id:n.methods.currentlyEditingId});if(!a)return null;var c=Object(C.isNil)(n.methods.currentlyEditingChanges.enabled)?!1!==a.enabled:!1!==n.methods.currentlyEditingChanges.enabled;return Object(C.mergeWith)({},i,a,n.methods.currentlyEditingChanges,{enabled:c},function(e,t){if(Object(C.isArray)(e))return t})},Le=n(601),xe=n(559),De=n(530),We=n.n(De),Ve=n(12),He=n.n(Ve),Ge=n(30),Ue=n(548),Be=n(547),Fe=n(555),ze=function(e){function t(){var e,n;l()(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=h()(this,(e=O()(t)).call.apply(e,[this].concat(i))),a()(m()(n),"state",{focused:!1,text:n.props.value}),a()(m()(n),"handleChange",function(e){n.setState({text:e.target.value}),n.props.onChange(e)}),a()(m()(n),"handleBlur",function(e){n.setState({focused:!1,text:n.props.value}),n.props.onChange(e)}),a()(m()(n),"handleFocus",function(){n.setState({focused:!0})}),n}return g()(t,e),f()(t,[{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.state.focused||e.value===this.props.value||this.setState({text:e.value})}},{key:"render",value:function(){return s.a.createElement(Fe.a,We()({},this.props,{value:this.state.text,onChange:this.handleChange,onBlur:this.handleBlur,onFocus:this.handleFocus}))}}]),t}(c.Component);a()(ze,"propTypes",{onChange:He.a.func}),a()(ze,"defaultProps",{onChange:function(){}});var qe=n(550),Ke=n(622),Ze=n(594),Qe=function(e){var t=e.id,n=e.title,r=e.description,i=e.value,o=e.placeholder,a=e.updateValue,c=e.error,u=e.className;return s.a.createElement(Ue.a,{className:u},s.a.createElement(Be.a,{htmlFor:t,dangerouslySetInnerHTML:Object(Ze.a)(n)}),s.a.createElement(ze,{id:t,name:t,placeholder:o,value:i,onChange:function(e){return a(function(e){if(""===e)return 0;var t=Number.parseFloat(e);return isNaN(t)?e:t}(e.target.value))},isError:Boolean(c)}),c?s.a.createElement(qe.a,{text:c}):s.a.createElement(Ke.a,{text:r}))};Qe.propTypes={id:He.a.string.isRequired,title:He.a.string,description:He.a.string,value:He.a.oneOfType([He.a.string,He.a.number]).isRequired,updateValue:He.a.func,error:He.a.oneOfType([He.a.string,He.a.bool]),className:He.a.string};var Ye=Qe,$e=n(557),Je=function(e){var t,n=e.id,r=e.title,i=e.className,o=e.value;return s.a.createElement(Ue.a,null,function(e){return e?s.a.createElement($e.a,{dangerouslySetInnerHTML:Object(Ze.a)(e)}):null}(r),s.a.createElement("p",{id:n,className:i},(t=o,s.a.createElement("span",{dangerouslySetInnerHTML:Object(Ze.a)(t)}))))};Je.propTypes={id:He.a.string.isRequired,title:He.a.string,className:He.a.string,value:He.a.string.isRequired};var Xe=Je,et=n(578),tt=n(639),nt=function(e){var t=e.value,n=e.currentValue,r=e.setValue,i=e.description;return s.a.createElement(Be.a,null,s.a.createElement(tt.a,{value:t,checked:t===n,onChange:function(){return r(t)}}),s.a.createElement("span",{dangerouslySetInnerHTML:Object(Ze.a)(i)}))},rt=function(e){var t=e.valuesMap,n=e.title,r=e.description,i=e.value,o=e.setValue,a=e.className;return s.a.createElement(Ue.a,{className:a},s.a.createElement($e.a,{dangerouslySetInnerHTML:Object(Ze.a)(n)}),s.a.createElement(Ke.a,{text:r}),Object.keys(t).map(function(e){return s.a.createElement(nt,{key:e,value:e,currentValue:i,setValue:o,description:t[e]})}))};rt.propTypes={valuesMap:He.a.object.isRequired,title:He.a.string,description:He.a.string,value:He.a.string.isRequired,setValue:He.a.func.isRequired,className:He.a.string};var it=rt,ot=n(526),at=n.n(ot),ct=n(47),st=n.n(ct),ut=n(716),lt=n.n(ut),dt=function(e){function t(){var e,n;l()(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=h()(this,(e=O()(t)).call.apply(e,[this].concat(i))),a()(m()(n),"_computeSuggestionMatch",function(e){var t,r=n.props.displayTransform(n.props.match||"").toLocaleLowerCase();return 0===r.length?null:(t=(e=n.props.displayTransform(e)).toLocaleLowerCase().indexOf(r),{suggestionBeforeMatch:e.substring(0,t),suggestionMatch:e.substring(t,t+r.length),suggestionAfterMatch:e.substring(t+r.length)})}),a()(m()(n),"_renderSuggestions",function(){return Object(C.map)(n.props.suggestions,function(e,t){var n=this._computeSuggestionMatch(e),r=at()("token-field__suggestion",{"is-selected":t===this.props.selectedIndex});return s.a.createElement("li",{className:r,key:e,onMouseDown:this._handleMouseDown,onClick:this._handleClick(e),onMouseEnter:this._handleHover(e)},n?s.a.createElement("span",null,n.suggestionBeforeMatch,s.a.createElement("strong",{className:"token-field__suggestion-match"},n.suggestionMatch),n.suggestionAfterMatch):this.props.displayTransform(e))}.bind(m()(n)))}),a()(m()(n),"_handleHover",function(e){return function(){this._scrollingIntoView||this.props.onHover(e)}.bind(m()(n))}),a()(m()(n),"_handleClick",function(e){return function(){this.props.onSelect(e)}.bind(m()(n))}),a()(m()(n),"_handleMouseDown",function(e){e.preventDefault()}),n}return g()(t,e),f()(t,[{key:"componentDidUpdate",value:function(e){var t;e.isExpanded&&this.props.isExpanded&&this.props.selectedIndex>-1&&this.props.scrollIntoView&&(this._scrollingIntoView=!0,t=this.refs.list,lt()(t.children[this.props.selectedIndex],t,{onlyScrollIfNeeded:!0}),setTimeout(function(){this._scrollingIntoView=!1}.bind(this),100))}},{key:"render",value:function(){var e=at()("token-field__suggestions-list",{"is-expanded":this.props.isExpanded&&this.props.suggestions.length>0});return s.a.createElement("ul",{ref:"list",className:e,tabIndex:"-1"},this._renderSuggestions())}}]),t}(s.a.PureComponent);a()(dt,"propTypes",{isExpanded:He.a.bool,match:He.a.string,displayTransform:He.a.func.isRequired,onSelect:He.a.func,suggestions:He.a.array,selectedIndex:He.a.number}),a()(dt,"defaultProps",{isExpanded:!1,match:"",onHover:function(){},onSelect:function(){},suggestions:Object.freeze([])});var ft=dt,pt=n(534),ht=n.n(pt),Et=n(679),Ot=n(648),bt=769,mt="<480px",vt=">960px",gt=!window.matchMedia,_t=function(){return null};function yt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.min,n=e.max;return void 0!==t&&void 0!==n?gt?{matches:bt>t&&bt<=n}:window.matchMedia("(min-width: ".concat(t+1,"px) and (max-width: ").concat(n,"px)")):void 0!==t?gt?{matches:bt>t}:window.matchMedia("(min-width: ".concat(t+1,"px)")):void 0!==n&&(gt?{matches:bt<=n}:window.matchMedia("(max-width: ".concat(n,"px)")))}var Ct={"<480px":yt({max:480}),"<660px":yt({max:660}),"<800px":yt({max:800}),"<960px":yt({max:960}),"<1040px":yt({max:1040}),"<1280px":yt({max:1280}),"<1400px":yt({max:1400}),">480px":yt({min:480}),">660px":yt({min:660}),">800px":yt({min:800}),">960px":yt({min:960}),">1040px":yt({min:1040}),">1280px":yt({min:1280}),">1400px":yt({min:1400}),"480px-660px":yt({min:480,max:660}),"660px-960px":yt({min:660,max:960}),"480px-960px":yt({min:480,max:960})};function jt(e){if(Ct.hasOwnProperty(e))return Ct[e];try{console.warn("Undefined breakpoint used in `mobile-first-breakpoint`",e)}catch(t){}}function St(e){var t=jt(e);return t?t.matches:void 0}function It(e,t){if(!t)return _t;var n=jt(e);if(n&&!gt){var r=function(e){return t(e.matches)};return n.addListener(r),function(){return n.removeListener(r)}}return _t}function Rt(e){var t=Object(c.useState)(function(){return{isActive:St(e),breakpoint:e}}),n=V()(t,2),r=n[0],i=n[1];return Object(c.useEffect)(function(){return It(e,function(t){i(function(n){return n.isActive===t&&n.breakpoint===e?n:{isActive:t,breakpoint:e}})})},[e]),e===r.breakpoint?r.isActive:St(e)}Object(Ot.a)(function(e){return function(t){var n=Rt(mt);return s.a.createElement(e,We()({},t,{isBreakpointActive:n}))}},"WithMobileBreakpoint"),Object(Ot.a)(function(e){return function(t){var n=Rt(vt);return s.a.createElement(e,We()({},t,{isBreakpointActive:n}))}},"WithDesktopBreakpoint");function Tt(e){var t=Rt(mt);if(!e.showOnMobile&&t)return null;var n=at()("popover","tooltip","is-".concat(e.status),"is-".concat(e.position),e.className);return s.a.createElement(Et.a,{autoPosition:e.autoPosition,className:n,rootClassName:e.rootClassName,context:e.context,id:e.id,isVisible:e.isVisible,position:e.position,showDelay:e.showDelay},e.children)}Tt.propTypes={autoPosition:He.a.bool,className:He.a.string,id:He.a.string,isVisible:He.a.bool,position:He.a.string,rootClassName:He.a.string,status:He.a.string,showDelay:He.a.number,showOnMobile:He.a.bool},Tt.defaultProps={showDelay:100,position:"top",showOnMobile:!1};var Nt=Tt,Mt=function(e){function t(){var e,n;l()(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=h()(this,(e=O()(t)).call.apply(e,[this].concat(i))),a()(m()(n),"_onClickRemove",function(){n.props.onClickRemove({value:n.props.value})}),n}return g()(t,e),f()(t,[{key:"render",value:function(){var e=this.props,t=e.value,n=e.status,r=e.isBorderless,i=e.tooltip,o=e.displayTransform,a=at()("token-field__token",{"is-error":"error"===n,"is-success":"success"===n,"is-validating":"validating"===n,"is-borderless":r,"is-disabled":this.props.disabled});return s.a.createElement("span",{className:a,tabIndex:"-1",onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave},s.a.createElement("span",{className:"token-field__token-text"},o(t)),s.a.createElement(ht.a,{icon:"cross-small",size:24,className:"token-field__remove-token",onClick:this.props.disabled?null:this._onClickRemove}),i&&s.a.createElement(Nt,{showOnMobile:!0,context:this,status:n,isVisible:!0,position:"bottom"},i))}}]),t}(s.a.PureComponent);a()(Mt,"displayName","Token"),a()(Mt,"propTypes",{value:He.a.string.isRequired,displayTransform:He.a.func.isRequired,onClickRemove:He.a.func,status:He.a.oneOf(["error","success","validating"]),isBorderless:He.a.bool,tooltip:He.a.string,disabled:He.a.bool}),a()(Mt,"defaultProps",{onClickRemove:function(){},isBorderless:!1,disabled:!1});var Pt=function(e){function t(){var e,n;l()(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=h()(this,(e=O()(t)).call.apply(e,[this].concat(i))),a()(m()(n),"setTextInput",function(e){n.textInput=e}),a()(m()(n),"onChange",function(e){n.props.onChange({value:e.target.value})}),n}return g()(t,e),f()(t,[{key:"componentDidUpdate",value:function(){this.props.hasFocus&&this.textInput.focus()}},{key:"render",value:function(){var e=this.props,t=e.placeholder,n=e.value,r=(0===n.length&&t&&t.length||n.length)+1;return s.a.createElement("input",We()({className:"token-field__input",onChange:this.onChange,ref:this.setTextInput,size:r,type:"text"},Object(C.omit)(this.props,["hasFocus","onChange"])))}}]),t}(s.a.PureComponent);a()(Pt,"propTypes",{disabled:He.a.bool,hasFocus:He.a.bool,onChange:He.a.func,onBlur:He.a.func,placeholder:He.a.string,value:He.a.string}),a()(Pt,"defaultProps",{disabled:!1,hasFocus:!1,onChange:C.noop,onBlur:C.noop,placeholder:"",value:""});var wt=Pt,kt=(n(759),st()("calypso:token-field")),At=function(e){function t(){var e,n;l()(this,t);for(var r=arguments.length,o=new Array(r),c=0;c<r;c++)o[c]=arguments[c];return n=h()(this,(e=O()(t)).call.apply(e,[this].concat(o))),a()(m()(n),"state",n.constructor.initialState),a()(m()(n),"_renderTokensAndInput",function(){var e=Object(C.map)(n.props.value,n._renderToken);return e.splice(n._getIndexOfInput(),0,n._renderInput()),e}),a()(m()(n),"_renderToken",function(e){var t=n._getTokenValue(e),r=e.status?e.status:void 0;return s.a.createElement(Mt,{key:"token-"+t,value:t,status:r,tooltip:e.tooltip,displayTransform:n.props.displayTransform,onClickRemove:n._onTokenClickRemove,isBorderless:e.isBorderless||n.props.isBorderless,onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,disabled:"error"!==r&&n.props.disabled})}),a()(m()(n),"_renderInput",function(){var e=n.props,t=e.autoCapitalize,r=e.autoComplete,o=e.autoCorrect,a=e.id,c=e.maxLength,u=e.placeholder,l=e.spellCheck,d=e.value,f={autoCapitalize:t,autoComplete:r,autoCorrect:o,disabled:n.props.disabled,hasFocus:n.state.tokenInputHasFocus,id:a,key:"input",onBlur:n._onBlur,spellCheck:l,value:n.state.incompleteTokenValue};return 0===d.length&&u&&(f.placeholder=u),c&&d.length>=c||(f=i()({},f,{onChange:n._onInputChange})),s.a.createElement(wt,f)}),a()(m()(n),"setTokensAndInput",function(e){n.tokensAndInput=e}),a()(m()(n),"_onFocus",function(e){n.setState({isActive:!0,tokenInputHasFocus:!0}),"function"===typeof n.props.onFocus&&n.props.onFocus(e)}),a()(m()(n),"_onBlur",function(){n._inputHasValidValue()?(kt("_onBlur adding current token"),n.setState({isActive:!1},n._addCurrentToken)):(kt("_onBlur not adding current token"),n.setState(n.constructor.initialState))}),a()(m()(n),"_onTokenClickRemove",function(e){n._deleteToken(e.value)}),a()(m()(n),"_onSuggestionHovered",function(e){var t=n._getMatchingSuggestions().indexOf(e);t>=0&&n.setState({selectedSuggestionIndex:t,selectedSuggestionScroll:!1})}),a()(m()(n),"_onSuggestionSelected",function(e){kt("_onSuggestionSelected",e),n._addNewToken(e)}),a()(m()(n),"_onInputChange",function(e){var t=e.value,r=n.props.tokenizeOnSpace?/[ ,\t]+/:/[,\t]+/,i=t.split(r);i.length>1&&n._addNewTokens(i.slice(0,-1)),n.setState({incompleteTokenValue:Object(C.last)(i)||"",selectedSuggestionIndex:-1,selectedSuggestionScroll:!1})}),a()(m()(n),"_onContainerTouched",function(e){e.target===n.tokensAndInput&&n.state.isActive&&e.preventDefault()}),a()(m()(n),"_onKeyDown",function(e){var t=!1;switch(e.keyCode){case 8:t=n._handleDeleteKey(n._deleteTokenBeforeInput);break;case 9:case 13:t=n._addCurrentToken();break;case 37:t=n._handleLeftArrowKey();break;case 38:t=n._handleUpArrowKey();break;case 39:t=n._handleRightArrowKey();break;case 40:t=n._handleDownArrowKey();break;case 46:t=n._handleDeleteKey(n._deleteTokenAfterInput);break;case 32:n.props.tokenizeOnSpace&&(t=n._addCurrentToken())}t&&e.preventDefault()}),a()(m()(n),"_onKeyPress",function(e){var t=!1;switch(e.charCode){case 44:t=n._handleCommaKey()}t&&e.preventDefault()}),a()(m()(n),"_handleDeleteKey",function(e){var t=!1;return n.state.tokenInputHasFocus&&n._isInputEmpty()&&(e(),t=!0),t}),a()(m()(n),"_getMatchingSuggestions",function(){var e=n.props.suggestions,t=n.props.saveTransform(n.state.incompleteTokenValue),r=[],i=[];return 0===t.length?e=Object(C.difference)(e,n.props.value):(t=t.toLocaleLowerCase(),Object(C.each)(e,function(e){var n=e.toLocaleLowerCase().indexOf(t);-1===this.props.value.indexOf(e)&&(0===n?r.push(e):n>0&&i.push(e))}.bind(m()(n))),e=r.concat(i)),Object(C.take)(e,n.props.maxSuggestions)}),a()(m()(n),"_getSelectedSuggestion",function(){if(-1!==n.state.selectedSuggestionIndex)return n._getMatchingSuggestions()[n.state.selectedSuggestionIndex]}),a()(m()(n),"_addCurrentToken",function(){var e=!1,t=n._getSelectedSuggestion();return t?(n._addNewToken(t),e=!0):n._inputHasValidValue()&&(n._addNewToken(n.state.incompleteTokenValue),e=!0),e}),a()(m()(n),"_handleLeftArrowKey",function(){var e=!1;return n._isInputEmpty()&&(n._moveInputBeforePreviousToken(),e=!0),e}),a()(m()(n),"_handleRightArrowKey",function(){var e=!1;return n._isInputEmpty()&&(n._moveInputAfterNextToken(),e=!0),e}),a()(m()(n),"_handleUpArrowKey",function(){return n.setState({selectedSuggestionIndex:Math.max((n.state.selectedSuggestionIndex||0)-1,0),selectedSuggestionScroll:!0}),!0}),a()(m()(n),"_handleDownArrowKey",function(){return n.setState({selectedSuggestionIndex:Math.min(n.state.selectedSuggestionIndex+1||0,n._getMatchingSuggestions().length-1),selectedSuggestionScroll:!0}),!0}),a()(m()(n),"_handleCommaKey",function(){return n._inputHasValidValue()&&n._addNewToken(n.state.incompleteTokenValue),!0}),a()(m()(n),"_isInputEmpty",function(){return 0===n.state.incompleteTokenValue.length}),a()(m()(n),"_inputHasValidValue",function(){return n.props.saveTransform(n.state.incompleteTokenValue).length>0}),a()(m()(n),"_deleteTokenBeforeInput",function(){var e=n._getIndexOfInput()-1;e>-1&&n._deleteToken(n.props.value[e])}),a()(m()(n),"_deleteTokenAfterInput",function(){var e=n._getIndexOfInput();e<n.props.value.length&&(n._deleteToken(n.props.value[e]),n._moveInputToIndex(e))}),a()(m()(n),"_deleteToken",function(e){var t=n.props.value.filter(function(t){return n._getTokenValue(t)!==n._getTokenValue(e)});n.props.onChange(t)}),a()(m()(n),"_moveInputToIndex",function(e){n.setState({inputOffsetFromEnd:n.props.value.length-Math.max(e,-1)-1})}),a()(m()(n),"_moveInputBeforePreviousToken",function(){n.setState({inputOffsetFromEnd:Math.min(n.state.inputOffsetFromEnd+1,n.props.value.length)})}),a()(m()(n),"_moveInputAfterNextToken",function(){n.setState({inputOffsetFromEnd:Math.max(n.state.inputOffsetFromEnd-1,0)})}),a()(m()(n),"_addNewTokens",function(e){var t=Object(C.uniq)(e.map(n.props.saveTransform).filter(Boolean).filter(function(e){return!n._valueContainsToken(e)}));if(kt("_addNewTokens: tokensToAdd",t),t.length>0){var r=Object(C.clone)(n.props.value);r.splice.apply(r,[n._getIndexOfInput(),0].concat(t)),kt("_addNewTokens: onChange",r),n.props.onChange(r)}}),a()(m()(n),"_addNewToken",function(e){n._addNewTokens([e]),n.setState({incompleteTokenValue:"",selectedSuggestionIndex:-1,selectedSuggestionScroll:!1}),n.state.isActive&&(kt("_addNewToken focusing input"),n.setState({tokenInputHasFocus:!0}))}),a()(m()(n),"_valueContainsToken",function(e){return Object(C.some)(n.props.value,function(t){return n._getTokenValue(e)===n._getTokenValue(t)})}),a()(m()(n),"_getTokenValue",function(e){return"object"===typeof e?e.value:e}),a()(m()(n),"_getIndexOfInput",function(){return n.props.value.length-n.state.inputOffsetFromEnd}),n}return g()(t,e),f()(t,[{key:"componentWillReceiveProps",value:function(e){e.disabled&&this.state.isActive&&this.setState({isActive:!1,incompleteTokenValue:""})}},{key:"render",value:function(){var e={ref:"main",className:at()("token-field",{"is-active":this.state.isActive,"is-disabled":this.props.disabled}),tabIndex:"-1"};return this.props.disabled||(e=Object.assign({},e,{onKeyDown:this._onKeyDown,onKeyPress:this._onKeyPress,onFocus:this._onFocus})),s.a.createElement("div",e,s.a.createElement("div",{ref:this.setTokensAndInput,className:"token-field__input-container",tabIndex:"-1",onMouseDown:this._onContainerTouched,onTouchStart:this._onContainerTouched},this._renderTokensAndInput()),s.a.createElement(ft,{match:this.props.saveTransform(this.state.incompleteTokenValue),displayTransform:this.props.displayTransform,suggestions:this._getMatchingSuggestions(),selectedIndex:this.state.selectedSuggestionIndex,scrollIntoView:this.state.selectedSuggestionScroll,isExpanded:this.props.isExpanded||this.state.isActive,onHover:this._onSuggestionHovered,onSelect:this._onSuggestionSelected}))}}]),t}(c.PureComponent);a()(At,"propTypes",{suggestions:He.a.array,maxSuggestions:He.a.number,displayTransform:He.a.func,saveTransform:He.a.func,onChange:He.a.func,isBorderless:He.a.bool,maxLength:He.a.number,onFocus:He.a.func,disabled:He.a.bool,tokenizeOnSpace:He.a.bool,placeholder:He.a.string,id:He.a.string,isExpanded:He.a.bool,value:function(e){var t=e.value;if(!Array.isArray(t))return new Error("Value prop is expected to be an array.");Object(C.forEach)(t,function(e){if("object"===typeof e&&!("value"in e))return new Error("When using object for value prop, each object is expected to have a 'value' property.")})}}),a()(At,"defaultProps",{suggestions:Object.freeze([]),maxSuggestions:100,value:Object.freeze([]),placeholder:"",displayTransform:C.identity,saveTransform:function(e){return e.trim()},onChange:function(){},isBorderless:!1,disabled:!1,tokenizeOnSpace:!1,isExpanded:!1}),a()(At,"initialState",{incompleteTokenValue:"",inputOffsetFromEnd:0,isActive:!1,selectedSuggestionIndex:-1,selectedSuggestionScroll:!1,tokenInputHasFocus:!1});var Lt=At,xt=n(556),Dt=function(e){function t(){var e,n;l()(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=h()(this,(e=O()(t)).call.apply(e,[this].concat(i))),a()(m()(n),"prepareValueForTokenField",function(e){return Object(C.filter)(Object(C.map)(e,n.getNameFromId))}),a()(m()(n),"getNameFromId",function(e){var t=Object(C.find)(n.props.options,{id:e});return t?t.name:null}),a()(m()(n),"getIdFromName",function(e){var t=e.toLowerCase(),r=Object(C.find)(n.props.options,function(e){return e.name.toLowerCase()===t});return r?r.id:null}),a()(m()(n),"transformForDisplay",function(e){var t=Object(C.find)(n.props.options,{slug:e});return t?t.name:e}),a()(m()(n),"onChange",function(e){(0,n.props.updateValue)(Object(C.uniq)(Object(C.filter)(Object(C.map)(e,n.getIdFromName))))}),n}return g()(t,e),f()(t,[{key:"render",value:function(){var e=this.props,t=e.id,n=e.title,r=e.description,i=e.value,o=e.placeholder,a=e.options;return!1===a||0===a.length?null:s.a.createElement(Ue.a,null,s.a.createElement(Be.a,{htmlFor:t},n),s.a.createElement(Lt,{id:t,name:t,placeholder:o,value:this.prepareValueForTokenField(i),suggestions:Object(C.uniq)(Object(C.map)(a,"name")),onChange:this.onChange,displayTransform:this.transformForDisplay}),r&&s.a.createElement(xt.a,null,r))}}]),t}(s.a.Component);a()(Dt,"propTypes",{id:He.a.string.isRequired,title:He.a.string,description:He.a.string,value:He.a.array.isRequired,updateValue:He.a.func,options:He.a.array});var Wt=n(788),Vt=n(599),Ht=n(580),Gt=function(e){var t=e.currencySymbol,n=e.updateValue,r=e.errors,i=e.service,o=i.enabled,a=i.name,c=i.adjustment,u=i.adjustment_type,l=Boolean(r[i.id]),d="service_"+Object(C.snakeCase)(i.name);return s.a.createElement("div",{className:at()("shipping-services__entry",{"wcc-error":l})},s.a.createElement("label",{className:"shipping-services__entry-title",htmlFor:d},s.a.createElement(Vt.a,{id:d,checked:o,onChange:function(e){return n("enabled",e.target.checked)}}),s.a.createElement("span",null,a)),l?s.a.createElement(ht.a,{icon:"notice"}):null,s.a.createElement(ze,{disabled:!o,value:c,onChange:function(e){return n("adjustment",e.target.value)},isError:l}),s.a.createElement(Ht.a,{disabled:!o,value:u,onChange:function(e){return n("adjustment_type",e.target.value)}},s.a.createElement("option",{value:"flat"},t),s.a.createElement("option",{value:"percentage"},"%")))};Gt.propTypes={service:He.a.shape({id:He.a.string.isRequired,name:He.a.string.isRequired,enabled:He.a.bool,adjustment:He.a.oneOfType([He.a.string,He.a.number]),adjustment_type:He.a.string}),currencySymbol:He.a.string.isRequired,updateValue:He.a.func.isRequired,settingsKey:He.a.string.isRequired},Gt.defaultProps={enabled:!1,adjustment:0,adjustment_type:"flat"};var Ut=Gt,Bt=n(611),Ft=function(e){var t=e.title,n=e.deliveryEstimate,r=e.services,i=e.updateValue,o=e.errors,a=e.translate,c=r.reduce(function(e,t){return e+(t.enabled?1:0)},0),u=function(e){return e.stopPropagation()},l=function(e){return function(e,t,n){n.forEach(function(n){t([n.id,"enabled"],e.target.checked)})}(e,i,r)},d=function(e,t,n){return t===e.length?n("All services selected"):n("%(numSelected)d service selected","%(numSelected)d services selected",{count:t,args:{numSelected:t}})}(r,c,a);return s.a.createElement("div",{className:at()({"is-error":!Object(C.isEmpty)(o)})},s.a.createElement(Bt.a,{header:s.a.createElement("div",null,s.a.createElement(Vt.a,{checked:r.length===c,partialChecked:Boolean(c),onChange:l,onClick:u}),t,n&&s.a.createElement("small",{className:"shipping-services__delivery-estimate"},"(",n,")")),summary:d,expandedSummary:d,clickableHeader:!0,compact:!0,screenReaderText:a("Expand Services")},s.a.createElement("div",{className:"shipping-services__entry shipping-services__entry-header-container"},s.a.createElement("span",{className:"shipping-services__entry-header"},a("Service")),s.a.createElement("span",{className:"shipping-services__entry-header shipping-services__entry-price-adjustment"},a("Price adjustment"),s.a.createElement(Wt.a,{position:"top left",text:a("Increase the rates calculated by the carrier to account for packaging and handling costs. You can also add a negative amount to save your customers money.")},s.a.createElement("span",null,s.a.createElement(ht.a,{icon:"info-outline",size:18}))))),r.map(function(t,n){return s.a.createElement(Ut,We()({},e,{service:t},{updateValue:function(e,n){return i([t.id].concat(e),n)},key:n}))})))};Ft.propTypes={title:He.a.string.isRequired,deliveryEstimate:He.a.string,services:He.a.arrayOf(He.a.shape({id:He.a.string.isRequired,name:He.a.string.isRequired,enabled:He.a.bool,adjustment:He.a.oneOfType([He.a.string,He.a.number]),adjustment_type:He.a.string})).isRequired,updateValue:He.a.func.isRequired};var zt=Object(y.localize)(Ft),qt=function(e){var t=e.title,n=e.description,r=e.services,i=e.settings,o=e.currencySymbol,a=e.updateValue,c=e.settingsKey,u=e.errors,l=e.generalError,d=r.map(function(e){return Object.assign({},e,i[e.id])}),f=Object(C.groupBy)(d,function(e){return e.group});return s.a.createElement("div",{className:"shipping-services"},s.a.createElement($e.a,{dangerouslySetInnerHTML:Object(Ze.a)(t)}),s.a.createElement(Ke.a,{text:n}),s.a.createElement("div",{className:at()("shipping-services__inner",{"is-error":l})},Object.keys(f).sort().map(function(e){var t=Object(C.map)(f[e],"id"),n={};return t.forEach(function(e){u[e]&&(n[e]=u[e])}),s.a.createElement(zt,{key:e,title:f[e][0].group_name,deliveryEstimate:f[e][0].group_estimate||"",services:f[e],currencySymbol:o,updateValue:a,settingsKey:c,errors:n})})),l?s.a.createElement(qe.a,{text:l}):null)};qt.propTypes={title:He.a.string,description:He.a.string,services:He.a.array.isRequired,settings:He.a.object.isRequired,currencySymbol:He.a.string,updateValue:He.a.func.isRequired,settingsKey:He.a.string.isRequired},qt.defaultProps={currencySymbol:"$",settings:{}};var Kt=qt,Zt=function(e){var t=e.formData,n=e.layout,r=e.schema,i=e.formValueActions,o=e.storeOptions,a=e.errors,c=e.translate,u=(e.site,e.shippingClasses),l=n.key?n.key:n,d=function(e){return i.updateField(l,e)},f=t[l],p=r.properties[l],h=n.type||p.type||"",E=!!a[""]&&(a[""].value||n.validation_hint||"");switch(h){case"radios":return s.a.createElement(it,{valuesMap:n.titleMap,title:p.title,description:p.description,value:f,setValue:d,error:E});case"shipping_services":return s.a.createElement(Kt,{services:r.definitions.services,title:p.title,description:p.description,settings:f,currencySymbol:o.currency_symbol,updateValue:function(e,t){return i.updateField([l].concat(e),t)},settingsKey:l,errors:a,generalError:E});case"packages":return s.a.createElement("div",null,s.a.createElement($e.a,null,c("Saved Packages")),c("Add and edit saved packages using the {{a}}Packaging Manager{{/a}}.",{components:{a:s.a.createElement("a",{href:"admin.php?page=wc-settings&tab=shipping&section=woocommerce-services-settings"})}}));case"text":return s.a.createElement(Xe,{id:l,title:n.title,className:n.class,value:f||n.description});case"number":return s.a.createElement(Ye,{id:l,title:p.title,description:p.description,value:f,placeholder:n.placeholder,updateValue:d,error:E});case"shipping_classes":return s.a.createElement(Dt,{id:l,title:p.title,description:p.description,value:f,options:u,updateValue:d});default:return s.a.createElement(et.a,{id:l,title:p.title,description:p.description,value:f,placeholder:n.placeholder,updateValue:d,error:E})}};Zt.propTypes={layout:He.a.oneOfType([He.a.string.isRequired,He.a.object.isRequired]).isRequired,schema:He.a.object.isRequired,storeOptions:He.a.object.isRequired,formValueActions:He.a.object.isRequired,errors:He.a.object};var Qt=Object(y.localize)(Zt),Yt=n(600),$t=function(e){var t=e.group,n=e.errors,r=function(){return t.items.map(function(t,r){return s.a.createElement("div",{className:"settings-form__row",key:r},function(t){var r=t.key?t.key:t;return s.a.createElement(Qt,We()({},e,{key:r,layout:t,errors:n[r]||{}}))}(t))})};switch(t.type){case"fieldset":return s.a.createElement(Yt.a,{heading:t.title},r());case"actions":return null;default:return s.a.createElement("div",null,r())}};$t.propTypes={group:He.a.shape({title:He.a.string,items:He.a.array}),schema:He.a.object.isRequired,storeOptions:He.a.object.isRequired,errors:He.a.object,site:He.a.object.isRequired};var Jt=$t,Xt=n(545),en=function(e,t,n,r){return{type:ge.x,siteId:e,methodId:t,methodType:"wc_services_usps",path:n,value:r}},tn=n(115),nn=n.n(tn),rn=n(763),on=n.n(rn),an=n(610),cn={level:"error"};Object.freeze(cn);var sn=function(e,t,n){var r=nn()(e,{greedy:!0}),i=r(Object(an.a)(e,t)),o={};return!i&&r.errors&&r.errors.length&&r.errors.forEach(function(e){var t=function(e){var t=on.a.parse(e);return"data"===t[0]?t[1]||null:t[0]}(e.field);t&&!n[t]||(o[e.field]=cn)}),n.services&&!Object(C.some)(t.services,"enabled")&&(o.services=Object(y.translate)("Select at least one service.")),o},un=Object(I.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(R.a)(e),n=fe(e,t);if(!n||!n.methods||!n.methods.currentlyEditingId)return{};var r=Ae(e,t),i=Object(P.a)(e,r.methodType,t).formSchema,o=Object(C.omit)(n.methods.currentlyEditingChanges,["id","methodType","enabled"]),a=Object(C.mapValues)(o,function(){return!0});return function(e){if(!Object(C.isObject)(e))return{};var t={};return Object.keys(e).forEach(function(n){var r=on.a.parse(n),i=r;"data"===r[0]&&(i=r.slice(1));var o=t;i.forEach(function(e){o[e]||(o[e]={}),o=o[e]}),o[""]=e[n]}),t}(sn(i,r,a))},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(R.a)(e);return[t,fe(e,t)]}),ln=n(560),dn=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(R.a)(e);return Object(C.get)(e,["extensions","woocommerce","sites",t,"shippingClasses"],!1)},fn=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(R.a)(e);return Object(C.isArray)(dn(e,t))},pn=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(R.a)(e),n=dn(e,t);return Object(C.isArray)(n)?n:[]},hn=function(e){return s.a.createElement("div",null,e.layout.map(function(t,n){return r=n,s.a.createElement(Jt,We()({},e,{group:e.layout[r],key:r}));var r}))};hn.propTypes={siteId:He.a.number.isRequired,method:He.a.object.isRequired};var En,On=Object(_.b)(function(e,t){var n=Object(P.a)(e,t.method.methodType,t.siteId),r=n.storeOptions,i=n.formSchema,o=n.formLayout;return{formData:Ae(e,t.siteId),shippingClasses:pn(e,t.siteId),errors:un(e,t.siteId),storeOptions:r,schema:i,layout:o,site:Object(ln.a)(e,t.siteId)}},function(e,t){return{noticeActions:Object(Ge.b)({successNotice:Xt.d,errorNotice:Xt.a},e),formValueActions:{updateField:function(n,r){return e(en(t.siteId,t.method.id,n,r))}}}})(hn),bn=n(544),mn=n(668),vn=function(e,t){return{type:B.wb,siteId:e,methodId:t}},gn=n(551),_n=n(561),yn=function(e){function t(e){var n;return l()(this,t),n=h()(this,O()(t).call(this,e)),a()(m()(n),"onSave",function(){var e=n.props.translate;n.setState({isSaving:!0}),n.props.saveChanges(function(t){n.setState({isSaving:!1}),t(Object(Xt.d)(e("Your changes have been saved."),{duration:4e3}))},function(t,r,i){var o=i.error;n.setState({isSaving:!1}),o&&t(Object(Xt.a)(Object(C.isString)(o)?o:e("There was a problem with one or more entries. Please fix the errors below and try saving again.")))})}),a()(m()(n),"renderPlaceholder",function(){return s.a.createElement("div",{className:"settings__placeholder"},s.a.createElement(Yt.a,{heading:" "},s.a.createElement(et.a,{id:"placeholder1",title:"Lorem",value:""}),s.a.createElement(et.a,{id:"placeholder1",title:"Ipsum",value:""})))}),n.state={isSaving:!1},n}return g()(t,e),f()(t,[{key:"render",value:function(){var e=this.props,t=e.siteId,n=e.method,r=e.translate,i=e.hasEdits,o=e.anyErrors,a=e.isLoaded;return s.a.createElement("div",null,s.a.createElement(Le.a,{id:"notices",notices:xe.a.list}),n?s.a.createElement(On,{method:n,siteId:t}):this.renderPlaceholder(),s.a.createElement(_n.a,{className:"settings__button-row"},s.a.createElement(bn.a,{primary:!0,onClick:this.onSave,busy:this.state.isSaving,disabled:this.state.isSaving||!a||o},r("Save changes"))),s.a.createElement(mn.a,{isChanged:i}))}}]),t}(c.Component),Cn=function(e){var t=fe(e).methods;return!Object(C.isEmpty)(t.currentlyEditingChanges)||!(Object(C.isEmpty)(t.updates)||Object(C.isEmpty)(t.updates[0]))},jn=function(e,t){return function(n,r){if(Cn(r())){var i=Object(R.a)(r()),o=Ae(r());n(function(e){return function(t,n){var r=Ae(n(),e);if(Object(C.startsWith)(r.methodType,"wc_services")){var i=Object(C.omit)(r,["id","enabled","methodType"]);if(Object(C.forEach)(i,function(n,i){return t(en(e,r.id,i,n))}),!Object(C.isEmpty)(un(n(),e)))return t(Object(Xt.a)(Object(y.translate)("There was a problem with one or more entries. Please fix the errors below and try saving again."),{duration:5e3}))}t({type:B.rb,siteId:e})}}(i)),Ae(r())?n(t):(n(vn(i,o.id)),n(function(e,t,n,r,i,o){return{type:ge.Rb,siteId:e,methodId:t,methodType:n,method:r,successAction:i,failureAction:o}}(i,o.id,o.methodType,Object(C.omit)(o,["id","methodType","enabled"]),e,t)))}else n(e)}},Sn=Object(_.b)(function(e){var t=Object(R.a)(e),n=A(e,t)&&fn(e,t);return{siteId:t,isLoaded:n,method:n&&Ae(e),hasEdits:n&&Cn(e),anyErrors:n&&Object(gn.a)(un(e))}},function(e){return{saveChanges:function(){return e(jn.apply(void 0,arguments))}}})(Object(y.localize)(yn)),In=(n(541),n(554),function(e,t,n){return{type:ge.Nb,siteId:e,methodId:t,data:n}}),Rn=(En={},a()(En,ge.Qb,function(e,t){var n=e.siteId,r=e.data;t(In(n,r.methodId,r))}),a()(En,B.Fb,function(e,t){var n=e.siteId,r=e.originatingAction.methodId;t(vn(n,r))}),En),Tn=function(e){var t=e.dispatch;return function(e){return function(n){e(n);var r=Rn[n.type];r&&r(n,t)}}},Nn={};Nn[B.nb]=function(e,t){var n=t.data,r=i()({},e);return n.forEach(function(e){r[e.id]=i()({id:e.id,order:e.order,enabled:e.enabled,methodType:e.method_id},Object(C.mapValues)(e.settings,"value"))}),r},Nn[B.Fb]=function(e,t){var n=t.data,r=t.originatingAction;return n.id?Nn[B.nb](e,{data:[n]}):i()({},e,a()({},r.methodId,i()({},e[r.methodId],{id:r.methodId,methodType:r.methodType},r.method)))},Nn[ge.Qb]=function(e,t){var n=t.instanceId,r=t.data;return i()({},e,a()({},n,i()({},e[n],r.formData)))};var Mn,Pn=Object(U.b)({},Nn),wn=function(e){return 0!==e.id?e:i()({},e,{name:Object(y.translate)("Locations not covered by your other zones")})},kn=Object(U.b)(null,(Mn={},a()(Mn,B.mb,function(e,t){var n=t.zoneId;if(!Object(C.isArray)(e))return e;var r=Object(C.findIndex)(e,{id:n});if(-1===r)return e;var o=i()({},e[r],{methodIds:M.b});return[].concat(S()(e.slice(0,r)),[o],S()(e.slice(r+1)))}),a()(Mn,B.nb,function(e,t){var n=t.zoneId,r=t.data;if(!Object(C.isArray)(e))return e;var o=Object(C.findIndex)(e,{id:n});if(-1===o)return e;var a=i()({},e[o],{methodIds:r.map(function(e){return e.id})});return[].concat(S()(e.slice(0,o)),[a],S()(e.slice(o+1)))}),a()(Mn,B.Ib,function(e,t){var n=t.data,r=t.originatingAction.zone;if(n=wn(n),!Object(C.isArray)(e))return e;if("number"!==typeof r.id)return[].concat(S()(e),[i()({},n,{methodIds:[]})]);var o=Object(C.findIndex)(e,{id:r.id});return-1===o?e:[].concat(S()(e.slice(0,o)),[i()({},n,{methodIds:e[o].methodIds})],S()(e.slice(o+1)))}),a()(Mn,B.Z,function(e,t){var n=t.originatingAction.zone;if(!Object(C.isArray)(e))return e;var r=Object(C.findIndex)(e,{id:n.id});return-1===r?e:[].concat(S()(e.slice(0,r)),S()(e.slice(r+1)))}),a()(Mn,B.Fb,function(e,t){var n=t.data,r=t.originatingAction.zoneId;if(!Object(C.isArray)(e))return e;var o=Object(C.findIndex)(e,{id:r});return-1===o?e:-1!==e[o].methodIds.indexOf(n.id)?e:[].concat(S()(e.slice(0,o)),[i()({},e[o],{methodIds:[].concat(S()(e[o].methodIds),[n.id])})],S()(e.slice(o+1)))}),a()(Mn,B.ub,function(e,t){var n=t.originatingAction,r=n.zoneId,o=n.methodId;if(!Object(C.isArray)(e))return e;var a=Object(C.findIndex)(e,{id:r});if(-1===a)return e;var c=e[a].methodIds.indexOf(o);return-1===c?e:[].concat(S()(e.slice(0,a)),[i()({},e[a],{methodIds:[].concat(S()(e[a].methodIds.slice(0,c)),S()(e[a].methodIds.slice(c+1)))})],S()(e.slice(a+1)))}),a()(Mn,B.U,function(){return M.b}),a()(Mn,B.V,function(e,t){return t.data.map(wn)}),Mn)),An={};An[ge.Pb]=function(e,t){var n=t.instanceId;return i()({},e,a()({},n,M.b))},An[ge.Qb]=function(e,t){var n=t.instanceId;return i()({},e,a()({},n,!0))},An[B.Fb]=function(e,t){var n=t.data;return An[ge.Qb](e,{instanceId:n.id})};var Ln=Object(U.b)({},An),xn={creates:[],updates:[],deletes:[],currentlyEditingId:null},Dn={};Dn[B.W]=function(e){var t={index:(e.creates||[]).length};return Dn[B.Gb](e,{id:t})},Dn[B.X]=function(e){return Dn[B.Y](i()({},e,{currentlyEditingChanges:{}}))},Dn[B.Y]=function(e){var t=e.currentlyEditingChanges,n=e.currentlyEditingId;if(null===n)return