Stripe Payments For WooCommerce by Checkout Plugins - Version 1.4.6

Version Description

  • THURSDAY, 9TH JUNE 2022 =
  • Fix: Add payment method console error.
  • Fix: Redirecting to onboarding wizard on plugin reactivation even if the Stripe is connected.
  • Fix: Inconsistent order notes for the refund process.
Download this release

Release Info

Developer brainstormworg
Plugin Icon 128x128 Stripe Payments For WooCommerce by Checkout Plugins
Version 1.4.6
Comparing to
See all releases

Code changes from version 1.4.5 to 1.4.6

autoloader.php CHANGED
@@ -206,7 +206,8 @@ class CPSW_Loader {
206
  * @since 1.3.0
207
  */
208
  public function install() {
209
- if ( get_option( 'cpsw_setup_status', false ) || apply_filters( 'cpsw_prevent_onboarding_redirect', false ) ) {
 
210
  return;
211
  }
212
 
206
  * @since 1.3.0
207
  */
208
  public function install() {
209
+ $admin_controller = Admin_Controller::get_instance();
210
+ if ( get_option( 'cpsw_setup_status', false ) || apply_filters( 'cpsw_prevent_onboarding_redirect', false ) || $admin_controller->is_stripe_connected() ) {
211
  return;
212
  }
213
 
checkout-plugins-stripe-woo.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Checkout Plugins - Stripe for WooCommerce
4
  * Plugin URI: https://www.checkoutplugins.com/
5
  * Description: Stripe for WooCommerce delivers a simple, secure way to accept credit card payments in your WooCommerce store. Reduce payment friction and boost conversions using this free plugin!
6
- * Version: 1.4.5
7
  * Author: Checkout Plugins
8
  * Author URI: https://checkoutplugins.com/
9
  * License: GPLv2 or later
@@ -20,6 +20,6 @@ define( 'CPSW_FILE', __FILE__ );
20
  define( 'CPSW_BASE', plugin_basename( CPSW_FILE ) );
21
  define( 'CPSW_DIR', plugin_dir_path( CPSW_FILE ) );
22
  define( 'CPSW_URL', plugins_url( '/', CPSW_FILE ) );
23
- define( 'CPSW_VERSION', '1.4.5' );
24
 
25
  require_once 'autoloader.php';
3
  * Plugin Name: Checkout Plugins - Stripe for WooCommerce
4
  * Plugin URI: https://www.checkoutplugins.com/
5
  * Description: Stripe for WooCommerce delivers a simple, secure way to accept credit card payments in your WooCommerce store. Reduce payment friction and boost conversions using this free plugin!
6
+ * Version: 1.4.6
7
  * Author: Checkout Plugins
8
  * Author URI: https://checkoutplugins.com/
9
  * License: GPLv2 or later
20
  define( 'CPSW_BASE', plugin_basename( CPSW_FILE ) );
21
  define( 'CPSW_DIR', plugin_dir_path( CPSW_FILE ) );
22
  define( 'CPSW_URL', plugins_url( '/', CPSW_FILE ) );
23
+ define( 'CPSW_VERSION', '1.4.6' );
24
 
25
  require_once 'autoloader.php';
gateway/abstract-payment-gateway.php CHANGED
@@ -47,6 +47,7 @@ abstract class Abstract_Payment_Gateway extends WC_Payment_Gateway {
47
  add_filter( 'woocommerce_payment_gateways', [ $this, 'add_gateway_class' ], 999 );
48
  add_action( 'woocommerce_update_options_payment_gateways_' . $this->id, [ $this, 'process_admin_options' ] );
49
  add_action( 'woocommerce_admin_order_totals_after_total', [ $this, 'get_stripe_order_data' ] );
 
50
  }
51
 
52
  /**
@@ -250,6 +251,7 @@ abstract class Abstract_Payment_Gateway extends WC_Payment_Gateway {
250
  }
251
 
252
  try {
 
253
  $order = wc_get_order( $order_id );
254
  $intent_secret = $order->get_meta( '_cpsw_intent_secret', true );
255
  $response = $this->create_refund_request( $order, $amount, $reason, $intent_secret['id'] );
@@ -262,6 +264,8 @@ abstract class Abstract_Payment_Gateway extends WC_Payment_Gateway {
262
  }
263
 
264
  $refund_time = gmdate( 'Y-m-d H:i:s', time() );
 
 
265
  $order->update_meta_data( '_cpsw_refund_id', $refund_response->id );
266
  $order->add_order_note( __( 'Reason : ', 'checkout-plugins-stripe-woo' ) . $reason . '.<br>' . __( 'Amount : ', 'checkout-plugins-stripe-woo' ) . get_woocommerce_currency_symbol() . $amount . '.<br>' . __( 'Status : ', 'checkout-plugins-stripe-woo' ) . ucfirst( $refund_response->status ) . ' [ ' . $refund_time . ' ] ' . ( is_null( $refund_response->id ) ? '' : '<br>' . __( 'Transaction ID : ', 'checkout-plugins-stripe-woo' ) . $refund_response->id ) );
267
  Logger::info( __( 'Refund initiated: ', 'checkout-plugins-stripe-woo' ) . __( 'Reason : ', 'checkout-plugins-stripe-woo' ) . $reason . __( 'Amount : ', 'checkout-plugins-stripe-woo' ) . get_woocommerce_currency_symbol() . $amount . __( 'Status : ', 'checkout-plugins-stripe-woo' ) . ucfirst( $refund_response->status ) . ' [ ' . $refund_time . ' ] ' . ( is_null( $refund_response->id ) ? '' : __( 'Transaction ID : ', 'checkout-plugins-stripe-woo' ) . $refund_response->id ), true );
@@ -1142,4 +1146,23 @@ abstract class Abstract_Payment_Gateway extends WC_Payment_Gateway {
1142
  'api_error' === $error->type
1143
  );
1144
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1145
  }
47
  add_filter( 'woocommerce_payment_gateways', [ $this, 'add_gateway_class' ], 999 );
48
  add_action( 'woocommerce_update_options_payment_gateways_' . $this->id, [ $this, 'process_admin_options' ] );
49
  add_action( 'woocommerce_admin_order_totals_after_total', [ $this, 'get_stripe_order_data' ] );
50
+ add_action( 'wp_ajax_create_setup_intent', [ $this, 'create_setup_intent' ] );
51
  }
52
 
53
  /**
251
  }
252
 
253
  try {
254
+ $reason = empty( $reason ) ? __( 'N/A', 'checkout-plugins-stripe-woo' ) : '';
255
  $order = wc_get_order( $order_id );
256
  $intent_secret = $order->get_meta( '_cpsw_intent_secret', true );
257
  $response = $this->create_refund_request( $order, $amount, $reason, $intent_secret['id'] );
264
  }
265
 
266
  $refund_time = gmdate( 'Y-m-d H:i:s', time() );
267
+ set_transient( '_cpsw_refund_id_cache_' . $order_id, $refund_response->id, 60 );
268
+ set_transient( '_cpsw_refund_status_cache_' . $order_id, $refund_response->status, 60 );
269
  $order->update_meta_data( '_cpsw_refund_id', $refund_response->id );
270
  $order->add_order_note( __( 'Reason : ', 'checkout-plugins-stripe-woo' ) . $reason . '.<br>' . __( 'Amount : ', 'checkout-plugins-stripe-woo' ) . get_woocommerce_currency_symbol() . $amount . '.<br>' . __( 'Status : ', 'checkout-plugins-stripe-woo' ) . ucfirst( $refund_response->status ) . ' [ ' . $refund_time . ' ] ' . ( is_null( $refund_response->id ) ? '' : '<br>' . __( 'Transaction ID : ', 'checkout-plugins-stripe-woo' ) . $refund_response->id ) );
271
  Logger::info( __( 'Refund initiated: ', 'checkout-plugins-stripe-woo' ) . __( 'Reason : ', 'checkout-plugins-stripe-woo' ) . $reason . __( 'Amount : ', 'checkout-plugins-stripe-woo' ) . get_woocommerce_currency_symbol() . $amount . __( 'Status : ', 'checkout-plugins-stripe-woo' ) . ucfirst( $refund_response->status ) . ' [ ' . $refund_time . ' ] ' . ( is_null( $refund_response->id ) ? '' : __( 'Transaction ID : ', 'checkout-plugins-stripe-woo' ) . $refund_response->id ), true );
1146
  'api_error' === $error->type
1147
  );
1148
  }
1149
+
1150
+ /**
1151
+ * Creates setup intent for update payment method
1152
+ *
1153
+ * @return json
1154
+ */
1155
+ public function create_setup_intent() {
1156
+ if ( ! isset( $_POST['_security'] ) || ! wp_verify_nonce( sanitize_text_field( $_POST['_security'] ), 'cpsw_js_error_nonce' ) ) {
1157
+ return wp_send_json_error( [ 'message' => __( 'Invalid Nonce', 'checkout-plugins-stripe-woo' ) ] );
1158
+ }
1159
+
1160
+ if ( isset( $_POST['paymentMethod'] ) ) {
1161
+ $stripe_api = new Stripe_Api();
1162
+ $response = $stripe_api->setup_intents( 'create', [ [ 'payment_method_types' => [ 'card' ] ] ] );
1163
+ $response = $response['success'] ? $response['data'] : false;
1164
+ return wp_send_json_success( [ 'client_secret' => $response->client_secret ] );
1165
+ }
1166
+ exit();
1167
+ }
1168
  }
gateway/stripe/stripe-api.php CHANGED
@@ -10,6 +10,7 @@ namespace CPSW\Gateway\Stripe;
10
 
11
  use CPSW\Inc\Logger;
12
  use \Stripe\StripeClient;
 
13
 
14
  /**
15
  * Stripe Api Class
@@ -97,7 +98,6 @@ class Stripe_Api {
97
  $get_error = $e->getError();
98
  $error_message = is_null( $e->getError() ) ? $e->getMessage() : $e->getError()->message;
99
  Logger::error( $error_message, true );
100
- $error_type = is_null( $e->getError() ) ? '' : $e->getError()->param;
101
  } catch ( \Stripe\Exception\ApiErrorException $e ) {
102
  Logger::error( $e->getError()->message, true );
103
  $get_error = $e->getError();
@@ -106,9 +106,8 @@ class Stripe_Api {
106
  // yourself an email.
107
  } catch ( Exception $e ) {
108
  // Something else happened, completely unrelated to Stripe.
109
- Logger::error( $e->getError()->message, true );
110
- $get_error = $e->getError();
111
- $error_message = $e->getError()->message;
112
  }
113
 
114
  if ( is_wp_error( $response ) ) {
10
 
11
  use CPSW\Inc\Logger;
12
  use \Stripe\StripeClient;
13
+ use Exception;
14
 
15
  /**
16
  * Stripe Api Class
98
  $get_error = $e->getError();
99
  $error_message = is_null( $e->getError() ) ? $e->getMessage() : $e->getError()->message;
100
  Logger::error( $error_message, true );
 
101
  } catch ( \Stripe\Exception\ApiErrorException $e ) {
102
  Logger::error( $e->getError()->message, true );
103
  $get_error = $e->getError();
106
  // yourself an email.
107
  } catch ( Exception $e ) {
108
  // Something else happened, completely unrelated to Stripe.
109
+ Logger::error( $e->getMessage(), true );
110
+ $error_message = $e->getMessage();
 
111
  }
112
 
113
  if ( is_wp_error( $response ) ) {
gateway/stripe/webhook.php CHANGED
@@ -294,7 +294,8 @@ class Webhook extends Abstract_Payment_Gateway {
294
  if ( 0 === strpos( $order->get_payment_method(), 'cpsw_' ) ) {
295
  $transaction_id = $order->get_transaction_id();
296
  $captured = $charge->captured;
297
- $refund_id = $order->get_meta( '_cpsw_refund_id' );
 
298
  $currency = strtoupper( $charge->currency );
299
  $raw_amount = $charge->refunds->data[0]->amount;
300
 
@@ -315,7 +316,7 @@ class Webhook extends Abstract_Payment_Gateway {
315
  }
316
 
317
  // If the refund ID matches, don't continue to prevent double refunding.
318
- if ( $charge->refunds->data[0]->id === $refund_id ) {
319
  return;
320
  }
321
 
@@ -336,16 +337,14 @@ class Webhook extends Abstract_Payment_Gateway {
336
  }
337
 
338
  $refund_id = $charge->refunds->data[0]->id;
 
339
  $order->update_meta_data( '_cpsw_refund_id', $refund_id );
340
 
341
  if ( isset( $charge->refunds->data[0]->balance_transaction ) ) {
342
  $this->update_balance( $order, $charge->refunds->data[0]->balance_transaction );
343
  }
344
- if ( 'cpsw_stripe' === $order->get_payment_method() ) {
345
- return;
346
- }
347
 
348
- $status = 'cpsw_sepa' === $order->get_payment_method() ? __( 'Pending to Success', 'checkout-plugins-stripe-woo' ) : __( 'Success', 'checkout-plugins-stripe-woo' );
349
  $refund_time = gmdate( 'Y-m-d H:i:s', time() );
350
  $order->add_order_note( __( 'Reason : ', 'checkout-plugins-stripe-woo' ) . $reason . '.<br>' . __( 'Amount : ', 'checkout-plugins-stripe-woo' ) . $amount . '.<br>' . __( 'Status : ', 'checkout-plugins-stripe-woo' ) . $status . ' [ ' . $refund_time . ' ] <br>' . __( 'Transaction ID : ', 'checkout-plugins-stripe-woo' ) . $refund_id );
351
  Logger::info( $reason . ' : ' . __( 'Amount : ', 'checkout-plugins-stripe-woo' ) . get_woocommerce_currency_symbol() . str_pad( $raw_amount, 2, 0 ) . __( ' Transaction ID : ', 'checkout-plugins-stripe-woo' ) . $refund_id, true );
294
  if ( 0 === strpos( $order->get_payment_method(), 'cpsw_' ) ) {
295
  $transaction_id = $order->get_transaction_id();
296
  $captured = $charge->captured;
297
+ $refund_id = get_transient( '_cpsw_refund_id_cache_' . $order_id );
298
+ $refund_status = get_transient( '_cpsw_refund_status_cache_' . $order_id );
299
  $currency = strtoupper( $charge->currency );
300
  $raw_amount = $charge->refunds->data[0]->amount;
301
 
316
  }
317
 
318
  // If the refund ID matches, don't continue to prevent double refunding.
319
+ if ( false !== $refund_id && $charge->refunds->data[0]->id === $refund_id && 'pending' !== $refund_status ) {
320
  return;
321
  }
322
 
337
  }
338
 
339
  $refund_id = $charge->refunds->data[0]->id;
340
+ set_transient( '_cpsw_refund_id_cache_' . $order_id, $refund_id, 60 );
341
  $order->update_meta_data( '_cpsw_refund_id', $refund_id );
342
 
343
  if ( isset( $charge->refunds->data[0]->balance_transaction ) ) {
344
  $this->update_balance( $order, $charge->refunds->data[0]->balance_transaction );
345
  }
 
 
 
346
 
347
+ $status = __( 'Success', 'checkout-plugins-stripe-woo' );
348
  $refund_time = gmdate( 'Y-m-d H:i:s', time() );
349
  $order->add_order_note( __( 'Reason : ', 'checkout-plugins-stripe-woo' ) . $reason . '.<br>' . __( 'Amount : ', 'checkout-plugins-stripe-woo' ) . $amount . '.<br>' . __( 'Status : ', 'checkout-plugins-stripe-woo' ) . $status . ' [ ' . $refund_time . ' ] <br>' . __( 'Transaction ID : ', 'checkout-plugins-stripe-woo' ) . $refund_id );
350
  Logger::info( $reason . ' : ' . __( 'Amount : ', 'checkout-plugins-stripe-woo' ) . get_woocommerce_currency_symbol() . str_pad( $raw_amount, 2, 0 ) . __( ' Transaction ID : ', 'checkout-plugins-stripe-woo' ) . $refund_id, true );
inc/traits/subscriptions.php CHANGED
@@ -45,7 +45,6 @@ trait Subscriptions {
45
 
46
  add_action( 'template_redirect', [ $this, 'remove_order_pay_var' ], 99 );
47
  add_action( 'template_redirect', [ $this, 'restore_order_pay_var' ], 101 );
48
- add_action( 'wp_ajax_create_setup_intent', [ $this, 'create_setup_intent' ] );
49
  }
50
 
51
  /**
@@ -340,25 +339,6 @@ trait Subscriptions {
340
  return $intent;
341
  }
342
 
343
- /**
344
- * Creates setup intent for update payment method
345
- *
346
- * @return json
347
- */
348
- public function create_setup_intent() {
349
- if ( ! isset( $_POST['_security'] ) || ! wp_verify_nonce( sanitize_text_field( $_POST['_security'] ), 'cpsw_js_error_nonce' ) ) {
350
- return wp_send_json_error( [ 'message' => __( 'Invalid Nonce', 'checkout-plugins-stripe-woo' ) ] );
351
- }
352
-
353
- if ( isset( $_POST['paymentMethod'] ) ) {
354
- $stripe_api = new Stripe_Api();
355
- $response = $stripe_api->setup_intents( 'create', [ [ 'payment_method_types' => [ 'card' ] ] ] );
356
- $response = $response['success'] ? $response['data'] : false;
357
- return wp_send_json_success( [ 'client_secret' => $response->client_secret ] );
358
- }
359
- exit();
360
- }
361
-
362
  /**
363
  * Check if authentication is required for payment
364
  *
45
 
46
  add_action( 'template_redirect', [ $this, 'remove_order_pay_var' ], 99 );
47
  add_action( 'template_redirect', [ $this, 'restore_order_pay_var' ], 101 );
 
48
  }
49
 
50
  /**
339
  return $intent;
340
  }
341
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
342
  /**
343
  * Check if authentication is required for payment
344
  *
languages/checkout-plugins-stripe-woo.pot CHANGED
@@ -2,14 +2,14 @@
2
  # This file is distributed under the GPLv2 or later.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Checkout Plugins - Stripe for WooCommerce 1.4.5\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/checkout-plugins-stripe-woo\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "POT-Creation-Date: 2022-06-03T12:30:57+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.6.0\n"
15
  "X-Domain: checkout-plugins-stripe-woo\n"
@@ -392,7 +392,7 @@ msgid "Stripe keys are reset successfully."
392
  msgstr ""
393
 
394
  #: admin/admin-controller.php:1218
395
- #: inc/traits/subscriptions.php:350
396
  msgid "Invalid Nonce"
397
  msgstr ""
398
 
@@ -616,16 +616,16 @@ msgstr ""
616
  msgid "Add separator text for Checkout page. If empty will show default separator text."
617
  msgstr ""
618
 
619
- #: autoloader.php:144
620
  msgid "Settings"
621
  msgstr ""
622
 
623
- #: autoloader.php:145
624
  msgid "Documentation"
625
  msgstr ""
626
 
627
  #. translators: 1$-2$: opening and closing <strong> tags, 3$-4$: link tags, takes to woocommerce plugin on wp.org, 5$-6$: opening and closing link tags, leads to plugins.php in admin.
628
- #: autoloader.php:202
629
  msgid "%1$sCheckout Plugins - Stripe for WooCommerce is inactive.%2$s The %3$sWooCommerce plugin%4$s must be active for Checkout Plugins - Stripe for WooCommerce to work. Please %5$sinstall & activate WooCommerce &raquo;%6$s"
630
  msgstr ""
631
 
@@ -655,135 +655,139 @@ msgstr ""
655
  msgid "%1$1sApple Pay domain verification failed! %2$2sReason%3$3s: %4$4s"
656
  msgstr ""
657
 
658
- #: gateway/abstract-payment-gateway.php:75
659
  msgid "Order "
660
  msgstr ""
661
 
662
- #: gateway/abstract-payment-gateway.php:266
663
- #: gateway/abstract-payment-gateway.php:267
664
- #: gateway/abstract-payment-gateway.php:275
665
- #: gateway/stripe/webhook.php:350
 
 
 
 
666
  msgid "Reason : "
667
  msgstr ""
668
 
669
- #: gateway/abstract-payment-gateway.php:266
670
- #: gateway/abstract-payment-gateway.php:267
671
- #: gateway/abstract-payment-gateway.php:275
 
672
  #: gateway/stripe/webhook.php:350
673
- #: gateway/stripe/webhook.php:351
674
  msgid "Amount : "
675
  msgstr ""
676
 
677
- #: gateway/abstract-payment-gateway.php:266
678
- #: gateway/abstract-payment-gateway.php:267
679
- #: gateway/stripe/webhook.php:350
680
  msgid "Status : "
681
  msgstr ""
682
 
683
- #: gateway/abstract-payment-gateway.php:266
684
- #: gateway/abstract-payment-gateway.php:267
685
- #: gateway/stripe/webhook.php:350
686
  msgid "Transaction ID : "
687
  msgstr ""
688
 
689
- #: gateway/abstract-payment-gateway.php:267
690
  msgid "Refund initiated: "
691
  msgstr ""
692
 
693
- #: gateway/abstract-payment-gateway.php:272
694
  msgid "Your refund process is "
695
  msgstr ""
696
 
697
- #: gateway/abstract-payment-gateway.php:275
698
  msgid " Status : Failed "
699
  msgstr ""
700
 
701
- #: gateway/abstract-payment-gateway.php:318
702
  #: gateway/stripe/sepa.php:573
703
  msgid "Payment will be completed once payment_intent.succeeded webhook received from Stripe."
704
  msgstr ""
705
 
706
  #. translators: transaction id, other info
707
- #: gateway/abstract-payment-gateway.php:321
708
  #: gateway/stripe/sepa.php:576
709
  msgid "Stripe charge awaiting payment: %1$s. %2$s"
710
  msgstr ""
711
 
712
  #. translators: transaction id
713
- #: gateway/abstract-payment-gateway.php:330
714
  #: gateway/stripe/webhook.php:266
715
  msgid "Stripe charge complete (Charge ID: %s)"
716
  msgstr ""
717
 
718
- #: gateway/abstract-payment-gateway.php:336
719
- #: inc/traits/subscriptions.php:333
720
  msgid "Payment processing failed. Please retry."
721
  msgstr ""
722
 
723
  #. translators: transaction id
724
- #: gateway/abstract-payment-gateway.php:348
725
  msgid "Stripe charge awaiting payment: %1$s. Payment will be completed once payment_intent.succeeded webhook received from Stripe."
726
  msgstr ""
727
 
728
  #. translators: transaction id
729
- #: gateway/abstract-payment-gateway.php:348
730
  msgid "Stripe charge authorized (Charge ID: %s). Process order to take payment, or cancel to remove the pre-authorization. Attempting to refund the order in part or in full will release the authorization and cancel the payment."
731
  msgstr ""
732
 
733
- #: gateway/abstract-payment-gateway.php:402
734
  msgid "An error has occurred internally, due to which you are not redirected to the order received page."
735
  msgstr ""
736
 
737
- #: gateway/abstract-payment-gateway.php:550
738
- #: gateway/abstract-payment-gateway.php:551
739
  msgid "Uncaptured Amount cannot be refunded"
740
  msgstr ""
741
 
742
  #. translators: order id
743
- #: gateway/abstract-payment-gateway.php:625
744
  msgid "Payment successful Order id - %1s"
745
  msgstr ""
746
 
747
- #: gateway/abstract-payment-gateway.php:629
748
  msgid "Payment Status: "
749
  msgstr ""
750
 
751
- #: gateway/abstract-payment-gateway.php:629
752
  msgid "Source: Payment is Completed via "
753
  msgstr ""
754
 
755
  #. translators: transaction id
756
- #: gateway/abstract-payment-gateway.php:632
757
  msgid "Charge authorized (Charge ID: %s). Process order to take payment, or cancel to remove the pre-authorization. Attempting to refund the order in part or in full will release the authorization and cancel the payment."
758
  msgstr ""
759
 
760
  #. translators: transaction id
761
- #: gateway/abstract-payment-gateway.php:634
762
  msgid "Charge authorized Order id - %1s"
763
  msgstr ""
764
 
765
  #. translators: %1$1s order id, %2$2s order total amount
766
- #: gateway/abstract-payment-gateway.php:779
767
  msgid "Begin processing payment with saved payment method for order %1$1s for the amount of %2$2s"
768
  msgstr ""
769
 
770
- #: gateway/abstract-payment-gateway.php:905
771
  msgid "Fee charged by stripe for this order."
772
  msgstr ""
773
 
774
- #: gateway/abstract-payment-gateway.php:906
775
  msgid "Stripe Fee:"
776
  msgstr ""
777
 
778
- #: gateway/abstract-payment-gateway.php:915
779
  msgid "Net amount that will be credited to your Stripe bank account."
780
  msgstr ""
781
 
782
- #: gateway/abstract-payment-gateway.php:916
783
  msgid "Stripe Payout:"
784
  msgstr ""
785
 
786
- #: gateway/abstract-payment-gateway.php:995
787
  msgid "Unable to update stripe transaction balance"
788
  msgstr ""
789
 
@@ -1343,63 +1347,59 @@ msgid "Stripe charge completely captured Order id - %1s"
1343
  msgstr ""
1344
 
1345
  #. translators: amount (including currency symbol)
1346
- #: gateway/stripe/webhook.php:310
1347
  msgid "Pre-Authorization for %s voided from the Stripe Dashboard."
1348
  msgstr ""
1349
 
1350
- #: gateway/stripe/webhook.php:323
1351
  msgid "Refunded via stripe dashboard"
1352
  msgstr ""
1353
 
1354
- #: gateway/stripe/webhook.php:348
1355
- msgid "Pending to Success"
1356
- msgstr ""
1357
-
1358
- #: gateway/stripe/webhook.php:348
1359
  msgid "Success"
1360
  msgstr ""
1361
 
1362
- #: gateway/stripe/webhook.php:351
1363
  msgid " Transaction ID : "
1364
  msgstr ""
1365
 
1366
- #: gateway/stripe/webhook.php:372
1367
  msgid "This order is under dispute. Please respond via stripe dashboard."
1368
  msgstr ""
1369
 
1370
- #: gateway/stripe/webhook.php:396
1371
  msgid "The disputed order lost or accepted."
1372
  msgstr ""
1373
 
1374
- #: gateway/stripe/webhook.php:400
1375
  msgid "The disputed order resolved in your favour."
1376
  msgstr ""
1377
 
1378
- #: gateway/stripe/webhook.php:404
1379
  msgid "The inquiry or retrieval closed."
1380
  msgstr ""
1381
 
1382
  #. translators: transaction id, order id
1383
- #: gateway/stripe/webhook.php:443
1384
  msgid "Stripe PaymentIntent %1$1s succeeded for order %2$2s"
1385
  msgstr ""
1386
 
1387
  #. translators: The error message that was received from Stripe.
1388
- #: gateway/stripe/webhook.php:465
1389
  msgid "Reason: %s"
1390
  msgstr ""
1391
 
1392
  #. translators: The error message that was received from Stripe.
1393
- #: gateway/stripe/webhook.php:467
1394
  msgid "Stripe SCA authentication failed. %s"
1395
  msgstr ""
1396
 
1397
- #: gateway/stripe/webhook.php:489
1398
  msgid "This order is under review. Please respond via stripe dashboard."
1399
  msgstr ""
1400
 
1401
  #. translators: Review reson from stripe
1402
- #: gateway/stripe/webhook.php:511
1403
  msgid "Review for this order has been resolved. Reason: %s"
1404
  msgstr ""
1405
 
@@ -1644,41 +1644,41 @@ msgstr ""
1644
  msgid "SEPA IBAN ending in %s"
1645
  msgstr ""
1646
 
1647
- #: inc/traits/subscriptions.php:62
1648
  msgid "Update the payment method used for all of my active subscriptions."
1649
  msgstr ""
1650
 
1651
- #: inc/traits/subscriptions.php:209
1652
  msgid "Customer not found"
1653
  msgstr ""
1654
 
1655
- #: inc/traits/subscriptions.php:233
1656
  msgid "Sorry, we are unable to process your payment at this time. Please retry later."
1657
  msgstr ""
1658
 
1659
- #: inc/traits/subscriptions.php:245
1660
  msgid "This transaction requires authentication."
1661
  msgstr ""
1662
 
1663
  #. translators: %s is the stripe charge Id
1664
- #: inc/traits/subscriptions.php:254
1665
- #: inc/traits/subscriptions.php:657
1666
  msgid "Stripe charge awaiting authentication by user: %s."
1667
  msgstr ""
1668
 
1669
- #: inc/traits/subscriptions.php:586
1670
  msgid "A \"Stripe Customer ID\" value is required."
1671
  msgstr ""
1672
 
1673
- #: inc/traits/subscriptions.php:589
1674
  msgid "Invalid customer ID. A valid \"Stripe Customer ID\" must begin with \"cus_\"."
1675
  msgstr ""
1676
 
1677
- #: inc/traits/subscriptions.php:599
1678
  msgid "Invalid source ID. A valid source \"Stripe Source ID\" must begin with \"src_\", \"pm_\", or \"card_\"."
1679
  msgstr ""
1680
 
1681
- #: inc/traits/subscriptions.php:780
1682
  msgid "Invalid payment method. Please input a new card number."
1683
  msgstr ""
1684
 
2
  # This file is distributed under the GPLv2 or later.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Checkout Plugins - Stripe for WooCommerce 1.4.6\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/checkout-plugins-stripe-woo\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "POT-Creation-Date: 2022-06-09T11:46:07+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.6.0\n"
15
  "X-Domain: checkout-plugins-stripe-woo\n"
392
  msgstr ""
393
 
394
  #: admin/admin-controller.php:1218
395
+ #: gateway/abstract-payment-gateway.php:1157
396
  msgid "Invalid Nonce"
397
  msgstr ""
398
 
616
  msgid "Add separator text for Checkout page. If empty will show default separator text."
617
  msgstr ""
618
 
619
+ #: autoloader.php:143
620
  msgid "Settings"
621
  msgstr ""
622
 
623
+ #: autoloader.php:144
624
  msgid "Documentation"
625
  msgstr ""
626
 
627
  #. translators: 1$-2$: opening and closing <strong> tags, 3$-4$: link tags, takes to woocommerce plugin on wp.org, 5$-6$: opening and closing link tags, leads to plugins.php in admin.
628
+ #: autoloader.php:197
629
  msgid "%1$sCheckout Plugins - Stripe for WooCommerce is inactive.%2$s The %3$sWooCommerce plugin%4$s must be active for Checkout Plugins - Stripe for WooCommerce to work. Please %5$sinstall & activate WooCommerce &raquo;%6$s"
630
  msgstr ""
631
 
655
  msgid "%1$1sApple Pay domain verification failed! %2$2sReason%3$3s: %4$4s"
656
  msgstr ""
657
 
658
+ #: gateway/abstract-payment-gateway.php:76
659
  msgid "Order "
660
  msgstr ""
661
 
662
+ #: gateway/abstract-payment-gateway.php:254
663
+ msgid "N/A"
664
+ msgstr ""
665
+
666
+ #: gateway/abstract-payment-gateway.php:270
667
+ #: gateway/abstract-payment-gateway.php:271
668
+ #: gateway/abstract-payment-gateway.php:279
669
+ #: gateway/stripe/webhook.php:349
670
  msgid "Reason : "
671
  msgstr ""
672
 
673
+ #: gateway/abstract-payment-gateway.php:270
674
+ #: gateway/abstract-payment-gateway.php:271
675
+ #: gateway/abstract-payment-gateway.php:279
676
+ #: gateway/stripe/webhook.php:349
677
  #: gateway/stripe/webhook.php:350
 
678
  msgid "Amount : "
679
  msgstr ""
680
 
681
+ #: gateway/abstract-payment-gateway.php:270
682
+ #: gateway/abstract-payment-gateway.php:271
683
+ #: gateway/stripe/webhook.php:349
684
  msgid "Status : "
685
  msgstr ""
686
 
687
+ #: gateway/abstract-payment-gateway.php:270
688
+ #: gateway/abstract-payment-gateway.php:271
689
+ #: gateway/stripe/webhook.php:349
690
  msgid "Transaction ID : "
691
  msgstr ""
692
 
693
+ #: gateway/abstract-payment-gateway.php:271
694
  msgid "Refund initiated: "
695
  msgstr ""
696
 
697
+ #: gateway/abstract-payment-gateway.php:276
698
  msgid "Your refund process is "
699
  msgstr ""
700
 
701
+ #: gateway/abstract-payment-gateway.php:279
702
  msgid " Status : Failed "
703
  msgstr ""
704
 
705
+ #: gateway/abstract-payment-gateway.php:322
706
  #: gateway/stripe/sepa.php:573
707
  msgid "Payment will be completed once payment_intent.succeeded webhook received from Stripe."
708
  msgstr ""
709
 
710
  #. translators: transaction id, other info
711
+ #: gateway/abstract-payment-gateway.php:325
712
  #: gateway/stripe/sepa.php:576
713
  msgid "Stripe charge awaiting payment: %1$s. %2$s"
714
  msgstr ""
715
 
716
  #. translators: transaction id
717
+ #: gateway/abstract-payment-gateway.php:334
718
  #: gateway/stripe/webhook.php:266
719
  msgid "Stripe charge complete (Charge ID: %s)"
720
  msgstr ""
721
 
722
+ #: gateway/abstract-payment-gateway.php:340
723
+ #: inc/traits/subscriptions.php:332
724
  msgid "Payment processing failed. Please retry."
725
  msgstr ""
726
 
727
  #. translators: transaction id
728
+ #: gateway/abstract-payment-gateway.php:352
729
  msgid "Stripe charge awaiting payment: %1$s. Payment will be completed once payment_intent.succeeded webhook received from Stripe."
730
  msgstr ""
731
 
732
  #. translators: transaction id
733
+ #: gateway/abstract-payment-gateway.php:352
734
  msgid "Stripe charge authorized (Charge ID: %s). Process order to take payment, or cancel to remove the pre-authorization. Attempting to refund the order in part or in full will release the authorization and cancel the payment."
735
  msgstr ""
736
 
737
+ #: gateway/abstract-payment-gateway.php:406
738
  msgid "An error has occurred internally, due to which you are not redirected to the order received page."
739
  msgstr ""
740
 
741
+ #: gateway/abstract-payment-gateway.php:554
742
+ #: gateway/abstract-payment-gateway.php:555
743
  msgid "Uncaptured Amount cannot be refunded"
744
  msgstr ""
745
 
746
  #. translators: order id
747
+ #: gateway/abstract-payment-gateway.php:629
748
  msgid "Payment successful Order id - %1s"
749
  msgstr ""
750
 
751
+ #: gateway/abstract-payment-gateway.php:633
752
  msgid "Payment Status: "
753
  msgstr ""
754
 
755
+ #: gateway/abstract-payment-gateway.php:633
756
  msgid "Source: Payment is Completed via "
757
  msgstr ""
758
 
759
  #. translators: transaction id
760
+ #: gateway/abstract-payment-gateway.php:636
761
  msgid "Charge authorized (Charge ID: %s). Process order to take payment, or cancel to remove the pre-authorization. Attempting to refund the order in part or in full will release the authorization and cancel the payment."
762
  msgstr ""
763
 
764
  #. translators: transaction id
765
+ #: gateway/abstract-payment-gateway.php:638
766
  msgid "Charge authorized Order id - %1s"
767
  msgstr ""
768
 
769
  #. translators: %1$1s order id, %2$2s order total amount
770
+ #: gateway/abstract-payment-gateway.php:783
771
  msgid "Begin processing payment with saved payment method for order %1$1s for the amount of %2$2s"
772
  msgstr ""
773
 
774
+ #: gateway/abstract-payment-gateway.php:909
775
  msgid "Fee charged by stripe for this order."
776
  msgstr ""
777
 
778
+ #: gateway/abstract-payment-gateway.php:910
779
  msgid "Stripe Fee:"
780
  msgstr ""
781
 
782
+ #: gateway/abstract-payment-gateway.php:919
783
  msgid "Net amount that will be credited to your Stripe bank account."
784
  msgstr ""
785
 
786
+ #: gateway/abstract-payment-gateway.php:920
787
  msgid "Stripe Payout:"
788
  msgstr ""
789
 
790
+ #: gateway/abstract-payment-gateway.php:999
791
  msgid "Unable to update stripe transaction balance"
792
  msgstr ""
793
 
1347
  msgstr ""
1348
 
1349
  #. translators: amount (including currency symbol)
1350
+ #: gateway/stripe/webhook.php:311
1351
  msgid "Pre-Authorization for %s voided from the Stripe Dashboard."
1352
  msgstr ""
1353
 
1354
+ #: gateway/stripe/webhook.php:324
1355
  msgid "Refunded via stripe dashboard"
1356
  msgstr ""
1357
 
1358
+ #: gateway/stripe/webhook.php:347
 
 
 
 
1359
  msgid "Success"
1360
  msgstr ""
1361
 
1362
+ #: gateway/stripe/webhook.php:350
1363
  msgid " Transaction ID : "
1364
  msgstr ""
1365
 
1366
+ #: gateway/stripe/webhook.php:371
1367
  msgid "This order is under dispute. Please respond via stripe dashboard."
1368
  msgstr ""
1369
 
1370
+ #: gateway/stripe/webhook.php:395
1371
  msgid "The disputed order lost or accepted."
1372
  msgstr ""
1373
 
1374
+ #: gateway/stripe/webhook.php:399
1375
  msgid "The disputed order resolved in your favour."
1376
  msgstr ""
1377
 
1378
+ #: gateway/stripe/webhook.php:403
1379
  msgid "The inquiry or retrieval closed."
1380
  msgstr ""
1381
 
1382
  #. translators: transaction id, order id
1383
+ #: gateway/stripe/webhook.php:442
1384
  msgid "Stripe PaymentIntent %1$1s succeeded for order %2$2s"
1385
  msgstr ""
1386
 
1387
  #. translators: The error message that was received from Stripe.
1388
+ #: gateway/stripe/webhook.php:464
1389
  msgid "Reason: %s"
1390
  msgstr ""
1391
 
1392
  #. translators: The error message that was received from Stripe.
1393
+ #: gateway/stripe/webhook.php:466
1394
  msgid "Stripe SCA authentication failed. %s"
1395
  msgstr ""
1396
 
1397
+ #: gateway/stripe/webhook.php:488
1398
  msgid "This order is under review. Please respond via stripe dashboard."
1399
  msgstr ""
1400
 
1401
  #. translators: Review reson from stripe
1402
+ #: gateway/stripe/webhook.php:510
1403
  msgid "Review for this order has been resolved. Reason: %s"
1404
  msgstr ""
1405
 
1644
  msgid "SEPA IBAN ending in %s"
1645
  msgstr ""
1646
 
1647
+ #: inc/traits/subscriptions.php:61
1648
  msgid "Update the payment method used for all of my active subscriptions."
1649
  msgstr ""
1650
 
1651
+ #: inc/traits/subscriptions.php:208
1652
  msgid "Customer not found"
1653
  msgstr ""
1654
 
1655
+ #: inc/traits/subscriptions.php:232
1656
  msgid "Sorry, we are unable to process your payment at this time. Please retry later."
1657
  msgstr ""
1658
 
1659
+ #: inc/traits/subscriptions.php:244
1660
  msgid "This transaction requires authentication."
1661
  msgstr ""
1662
 
1663
  #. translators: %s is the stripe charge Id
1664
+ #: inc/traits/subscriptions.php:253
1665
+ #: inc/traits/subscriptions.php:637
1666
  msgid "Stripe charge awaiting authentication by user: %s."
1667
  msgstr ""
1668
 
1669
+ #: inc/traits/subscriptions.php:566
1670
  msgid "A \"Stripe Customer ID\" value is required."
1671
  msgstr ""
1672
 
1673
+ #: inc/traits/subscriptions.php:569
1674
  msgid "Invalid customer ID. A valid \"Stripe Customer ID\" must begin with \"cus_\"."
1675
  msgstr ""
1676
 
1677
+ #: inc/traits/subscriptions.php:579
1678
  msgid "Invalid source ID. A valid source \"Stripe Source ID\" must begin with \"src_\", \"pm_\", or \"card_\"."
1679
  msgstr ""
1680
 
1681
+ #: inc/traits/subscriptions.php:760
1682
  msgid "Invalid payment method. Please input a new card number."
1683
  msgstr ""
1684
 
readme.txt CHANGED
@@ -1,22 +1,22 @@
1
- === Checkout Plugins - Stripe for WooCommerce ===
2
  Contributors: brainstormforce
3
  Tags: stripe, credit card, apple pay, google pay, express checkout
4
  Requires at least: 5.4
5
  Tested up to: 6.0
6
- Stable tag: 1.4.5
7
  Requires PHP: 5.6
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
11
- Stripe for WooCommerce delivers a simple, secure way to accept credit card payments, Apple Pay, and Google Pay on your WooCommerce store. Reduce payment friction and boost conversions using this free plugin!
12
 
13
  == Description ==
14
 
15
  <strong>Accept credit card payments in your store with Stripe for WooCommerce.<strong>
16
 
17
- The smoother the checkout process, the higher the chance of a sale, and offering multiple payment options is a proven way to boost sales. This is where Stripe for WooCommerce comes in.
18
 
19
- Stripe for WooCommerce is a payment plugin that delivers a simple, secure way to accept credit card payments using the Stripe service.
20
 
21
  With Stripe you can accept payments from several card brands, from large global networks like Visa and Mastercard to local networks like Cartes Bancaires in France or Interac in Canada. Stripe also supports American Express, Discover, JCB, Diners Club and UnionPay.
22
 
@@ -50,17 +50,23 @@ Checkout Plugins is part of the Brainstorm Force family of products which are us
50
 
51
  Here are some of our products:
52
 
53
- * **Astra Theme**
54
- Currently used by nearly 2 million websites, Astra Theme is the most popular WordPress theme and is also the most popular WooCommerce theme. Stripe for WooCommerce was made to work perfectly with Astra Theme. [Visit Astra Theme](https://wpastra.com)
55
-
56
  * **CartFlows**
57
- Currently used by nearly 300,000 store owners to get more orders and increase the order value through our conversion optimized checkout replacement for WooCommerce, checkout order bumps, one-click post purchase upsells, and A/B split testing engine. [Visit CartFlows](https://cartflows.com)
58
 
59
  * **Cart Abandonment Recovery**
60
- Currently used by nearly 400,000 store owners to capture lost revenue caused by buyers that don’t complete their checkout. Cart Abandonment Recovery captures these lost orders and automatically contacts the lost buyers to get them to complete their order. [Visit Cart Abandonment Recovery](https://wordpress.org/plugins/woo-cart-abandonment-recovery/)
 
 
 
 
 
 
61
 
62
  * **Starter Templates**
63
- Currently used by nearly 2 million websites, Starter Templates offers hundreds of complete website templates, including over 50 website designs for WooCommerce stores. [Visit Starter Templates](https://wordpress.org/plugins/astra-sites/)
 
 
 
64
 
65
  As you can see, we know WooCommerce inside and out and help thousands of store owners build highly profitable stores everyday.
66
 
@@ -68,7 +74,7 @@ Stripe for WooCommerce supports WooCommerce Subscriptions where users can make r
68
 
69
  == Installation ==
70
 
71
- 1. Install the `Checkout Plugins - Stripe for WooCommerce` either via the WordPress plugin directory or by uploading `checkout-plugins-stripe-woo.zip` to the `/wp-content/plugins/` directory
72
  2. Activate the plugin through the 'Plugins' menu in WordPress
73
  3. Make sure to disable caching on your checkout and thank you steps
74
 
@@ -108,6 +114,11 @@ We understand the need for a quality product backed by dedicated support that ca
108
 
109
  == Changelog ==
110
 
 
 
 
 
 
111
  = 1.4.5 - MONDAY, 6TH JUNE 2022 =
112
  * Improvement: Added free trial/zero amount subscription support.
113
 
1
+ === Stripe Payments For WooCommerce by Checkout Plugins ===
2
  Contributors: brainstormforce
3
  Tags: stripe, credit card, apple pay, google pay, express checkout
4
  Requires at least: 5.4
5
  Tested up to: 6.0
6
+ Stable tag: 1.4.6
7
  Requires PHP: 5.6
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
11
+ Stripe Payments For WooCommerce delivers a simple, secure way to accept credit card payments, Apple Pay, and Google Pay on your WooCommerce store. Reduce payment friction and boost conversions using this free plugin!
12
 
13
  == Description ==
14
 
15
  <strong>Accept credit card payments in your store with Stripe for WooCommerce.<strong>
16
 
17
+ The smoother the checkout process, the higher the chance of a sale, and offering multiple payment options is a proven way to boost sales. This is where Stripe WooCommerce comes in.
18
 
19
+ Stripe Payments For WooCommerce is a payment plugin that delivers a simple, secure way to accept credit card payments using the Stripe service.
20
 
21
  With Stripe you can accept payments from several card brands, from large global networks like Visa and Mastercard to local networks like Cartes Bancaires in France or Interac in Canada. Stripe also supports American Express, Discover, JCB, Diners Club and UnionPay.
22
 
50
 
51
  Here are some of our products:
52
 
 
 
 
53
  * **CartFlows**
54
+ Currently used by nearly 300,000 store owners to get more orders and increase the order value through our conversion optimized checkout replacement for WooCommerce, checkout order bumps, one-click post purchase upsells, and A/B split testing engine. [Try CartFlows](https://cartflows.com)
55
 
56
  * **Cart Abandonment Recovery**
57
+ Currently used by nearly 400,000 store owners to capture lost revenue caused by buyers that don’t complete their checkout. Cart Abandonment Recovery captures these lost orders and automatically contacts the lost buyers to get them to complete their order. [Try Cart Abandonment Recovery](https://wordpress.org/plugins/woo-cart-abandonment-recovery/)
58
+
59
+ * **Variation Swatches For WooCommerce**
60
+ Instantly convert traditional dropdown attributes to visually appealing swatches. This plugin provides options to convert woocommerce variation attributes to swatches. We provide multiple options like image, color, label type swatches for both product page and shop page. [Try Variation Swatches For WooCommerce](https://wordpress.org/plugins/variation-swatches-woo/)
61
+
62
+ * **Astra Theme**
63
+ Currently used by nearly 2 million websites, Astra Theme is the most popular WordPress theme and is also the most popular WooCommerce theme. Stripe for WooCommerce was made to work perfectly with Astra Theme. [Visit Astra Theme](https://wpastra.com)
64
 
65
  * **Starter Templates**
66
+ Currently used by nearly 2 million websites, Starter Templates offers hundreds of complete website templates, including over 50 website designs for WooCommerce stores. [Try Starter Templates](https://wordpress.org/plugins/astra-sites/)
67
+
68
+ * **SureCart**
69
+ Make ecommerce easy with a simple to use, all-in-one platform, that anyone can set up in just a few minutes! [Try SureCart](https://wordpress.org/plugins/surecart/)
70
 
71
  As you can see, we know WooCommerce inside and out and help thousands of store owners build highly profitable stores everyday.
72
 
74
 
75
  == Installation ==
76
 
77
+ 1. Install the `Stripe Payments For WooCommerce by Checkout Plugins` either via the WordPress plugin directory or by uploading `checkout-plugins-stripe-woo.zip` to the `/wp-content/plugins/` directory
78
  2. Activate the plugin through the 'Plugins' menu in WordPress
79
  3. Make sure to disable caching on your checkout and thank you steps
80
 
114
 
115
  == Changelog ==
116
 
117
+ = 1.4.6 - THURSDAY, 9TH JUNE 2022 =
118
+ * Fix: Add payment method console error.
119
+ * Fix: Redirecting to onboarding wizard on plugin reactivation even if the Stripe is connected.
120
+ * Fix: Inconsistent order notes for the refund process.
121
+
122
  = 1.4.5 - MONDAY, 6TH JUNE 2022 =
123
  * Improvement: Added free trial/zero amount subscription support.
124
 
wizard/build/app.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('react', 'react-dom', 'wp-api-fetch', 'wp-element', 'wp-i18n'), 'version' => 'bbe89647a0cdd39a568dc1cdfa6fd45f');
1
+ <?php return array('dependencies' => array('react', 'react-dom', 'wp-api-fetch', 'wp-element', 'wp-i18n'), 'version' => 'd6fec05cb9f53b98348d85fce5db895b');
wizard/build/app.css CHANGED
@@ -1,5 +1,5 @@
1
  /*
2
- ! tailwindcss v3.0.23 | MIT License | https://tailwindcss.com
3
  *//*
4
  1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
5
  2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
1
  /*
2
+ ! tailwindcss v3.0.12 | MIT License | https://tailwindcss.com
3
  *//*
4
  1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
5
  2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
wizard/build/app.js CHANGED
@@ -1 +1 @@
1
- !function(){"use strict";var e,t={n:function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,{a:n}),n},d:function(e,n){for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},n=window.wp.element,r=window.React,a=window.ReactDOM,o=t.n(a);function l(){return l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l.apply(this,arguments)}!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(e||(e={}));var i="beforeunload";function s(e){e.preventDefault(),e.returnValue=""}function u(){var e=[];return{get length(){return e.length},push:function(t){return e.push(t),function(){e=e.filter((function(e){return e!==t}))}},call:function(t){e.forEach((function(e){return e&&e(t)}))}}}function c(e){var t={};if(e){var n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));var r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function d(e,t){if(!e)throw new Error(t)}const p=(0,r.createContext)(null),m=(0,r.createContext)(null),f=(0,r.createContext)({outlet:null,matches:[]});function b(t){let{basename:n="/",children:a=null,location:o,navigationType:l=e.Pop,navigator:i,static:s=!1}=t;v()&&d(!1);let u=y(n),f=(0,r.useMemo)((()=>({basename:u,navigator:i,static:s})),[u,i,s]);"string"==typeof o&&(o=c(o));let{pathname:b="/",search:x="",hash:g="",state:h=null,key:w="default"}=o,E=(0,r.useMemo)((()=>{let e=function(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=e.charAt(t.length);return n&&"/"!==n?null:e.slice(t.length)||"/"}(b,u);return null==e?null:{pathname:e,search:x,hash:g,state:h,key:w}}),[u,b,x,g,h,w]);return null==E?null:(0,r.createElement)(p.Provider,{value:f},(0,r.createElement)(m.Provider,{children:a,value:{location:E,navigationType:l}}))}function v(){return null!=(0,r.useContext)(m)}function x(){return v()||d(!1),(0,r.useContext)(m).location}function g(){v()||d(!1);let{basename:e,navigator:t}=(0,r.useContext)(p),{matches:n}=(0,r.useContext)(f),{pathname:a}=x(),o=JSON.stringify(n.map((e=>e.pathnameBase))),l=(0,r.useRef)(!1);(0,r.useEffect)((()=>{l.current=!0}));let i=(0,r.useCallback)((function(n,r){if(void 0===r&&(r={}),!l.current)return;if("number"==typeof n)return void t.go(n);let i=function(e,t,n){let r,a="string"==typeof e?c(e):e,o=""===e||""===a.pathname?"/":a.pathname;if(null==o)r=n;else{let e=t.length-1;if(o.startsWith("..")){let t=o.split("/");for(;".."===t[0];)t.shift(),e-=1;a.pathname=t.join("/")}r=e>=0?t[e]:"/"}let l=function(e,t){void 0===t&&(t="/");let{pathname:n,search:r="",hash:a=""}="string"==typeof e?c(e):e,o=n?n.startsWith("/")?n:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(n,t):t;return{pathname:o,search:w(r),hash:E(a)}}(a,r);return o&&"/"!==o&&o.endsWith("/")&&!l.pathname.endsWith("/")&&(l.pathname+="/"),l}(n,JSON.parse(o),a);"/"!==e&&(i.pathname=h([e,i.pathname])),(r.replace?t.replace:t.push)(i,r.state)}),[e,t,o,a]);return i}const h=e=>e.join("/").replace(/\/\/+/g,"/"),y=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),w=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",E=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";var k=window.wp.i18n,C=function(){return(0,n.createElement)("svg",{className:"animate-spin ml-2 mr-3 h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},(0,n.createElement)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,n.createElement)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"}))},_=function(){const[e,t]=(0,r.useState)(!1),a=g();return(0,n.createElement)("main",{className:"mt-10 mx-auto w-auto max-w-7xl px-4 sm:mt-12 sm:px-6 md:mt-16 lg:mt-20 lg:px-8 xl:mt-28"},(0,n.createElement)("div",{className:"text-center"},(0,n.createElement)("h1",{className:"text-4xl tracking-tight font-extrabold text-gray-900 sm:text-5xl md:text-6xl"},(0,n.createElement)("span",{className:"block xl"}," ",(0,k.__)("Let's Connect","checkout-plugins-stripe-woo")),(0,n.createElement)("span",{className:"block text-cart-500 xl:inline"},(0,k.__)("with Stripe","checkout-plugins-stripe-woo"))),(0,n.createElement)("p",{className:"mt-3 text-base text-gray-500 sm:mt-5 sm:text-lg sm:mx-auto md:mt-5 md:text-xl lg:mx-0"},(0,n.createElement)("span",{className:"block"},(0,n.createElement)("span",{className:"block text-gray-700 inline font-bold"},(0,k.__)("Checkout Plugins","checkout-plugins-stripe-woo"))," ",(0,k.__)("recommends to connect with","checkout-plugins-stripe-woo")," ",(0,n.createElement)("span",{className:"block text-gray-700 xl:inline font-bold"},(0,k.__)("Stripe connect.","checkout-plugins-stripe-woo"))),(0,n.createElement)("span",null,(0,k.__)("One click onboarding solution provided by","checkout-plugins-stripe-woo")," ",(0,n.createElement)("span",{className:"block text-gray-700 xl:inline font-bold"},(0,k.__)("Stripe.","checkout-plugins-stripe-woo")))),(0,n.createElement)("div",{className:"mt-5 sm:mt-8 sm:inline-block lg:inline-block sm:justify-center lg:justify-center"},(0,n.createElement)("div",{className:"rounded-md shadow"},e?(0,n.createElement)("button",{className:"disabled w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-wait"},(0,k.__)("Connecting…","checkout-plugins-stripe-woo"),(0,n.createElement)(C,null)):(0,n.createElement)("button",{onClick:function(){t(!0),""===onboarding_vars.woocommerce_installed||""===onboarding_vars.woocommerce_activated?a(onboarding_vars.navigator_base+"&cpsw_call=setup-woocommerce"):window.location.replace(onboarding_vars.authorization_url)},className:"w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-pointer"},(0,k.__)("Connect with Stripe","checkout-plugins-stripe-woo"))),(0,n.createElement)("div",{className:"mt-3 sm:mt-0 sm:ml-3"},(0,n.createElement)("a",{href:onboarding_vars.settings_url,className:"w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-slate-300 md:py-4 md:text-lg md:px-10"},(0,k.__)("Leave onboarding process","checkout-plugins-stripe-woo"))))))};function I(){let e=[],t=[],n={enqueue(e){t.push(e)},requestAnimationFrame(...e){let t=requestAnimationFrame(...e);n.add((()=>cancelAnimationFrame(t)))},nextFrame(...e){n.requestAnimationFrame((()=>{n.requestAnimationFrame(...e)}))},setTimeout(...e){let t=setTimeout(...e);n.add((()=>clearTimeout(t)))},add(t){e.push(t)},dispose(){for(let t of e.splice(0))t()},async workQueue(){for(let e of t.splice(0))await e()}};return n}function S(){let[e]=(0,r.useState)(I);return(0,r.useEffect)((()=>()=>e.dispose()),[e]),e}var R="undefined"!=typeof window?r.useLayoutEffect:r.useEffect,N={serverHandoffComplete:!1};function P(){let[e,t]=(0,r.useState)(N.serverHandoffComplete);return(0,r.useEffect)((()=>{!0!==e&&t(!0)}),[e]),(0,r.useEffect)((()=>{!1===N.serverHandoffComplete&&(N.serverHandoffComplete=!0)}),[]),e}var T=0;function D(){return++T}function O(){let e=P(),[t,n]=(0,r.useState)(e?D:null);return R((()=>{null===t&&n(D())}),[t]),null!=t?""+t:void 0}function F(e){let t=(0,r.useRef)(e);return(0,r.useEffect)((()=>{t.current=e}),[e]),t}function L(e,t){let[n,a]=(0,r.useState)(e),o=F(e);return R((()=>a(o.current)),[o,a,...t]),n}function M(...e){let t=(0,r.useRef)(e);return(0,r.useEffect)((()=>{t.current=e}),[e]),(0,r.useCallback)((e=>{for(let n of t.current)null!=n&&("function"==typeof n?n(e):n.current=e)}),[t])}function A(e,t,...n){if(e in t){let r=t[e];return"function"==typeof r?r(...n):r}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map((e=>`"${e}"`)).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,A),r}function j({props:e,slot:t,defaultTag:n,features:r,visible:a=!0,name:o}){if(a)return $(e,t,n,o);let l=null!=r?r:0;if(2&l){let{static:r=!1,...a}=e;if(r)return $(a,t,n,o)}if(1&l){let{unmount:r=!0,...a}=e;return A(r?0:1,{0:()=>null,1:()=>$({...a,hidden:!0,style:{display:"none"}},t,n,o)})}return $(e,t,n,o)}function $(e,t={},n,a){let{as:o=n,children:l,refName:i="ref",...s}=W(e,["unmount","static"]),u=void 0!==e.ref?{[i]:e.ref}:{},c="function"==typeof l?l(t):l;if(s.className&&"function"==typeof s.className&&(s.className=s.className(t)),o===r.Fragment&&Object.keys(s).length>0){if(!(0,r.isValidElement)(c)||Array.isArray(c)&&c.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${a} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(s).map((e=>` - ${e}`)).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map((e=>` - ${e}`)).join("\n")].join("\n"));return(0,r.cloneElement)(c,Object.assign({},function(e,t,n){let r=Object.assign({},e);for(let n of["onClick"])void 0!==e[n]&&void 0!==t[n]&&Object.assign(r,{[n](r){r.defaultPrevented||e[n](r),r.defaultPrevented||t[n](r)}});return r}(function(e){let t=Object.assign({},e);for(let e in t)void 0===t[e]&&delete t[e];return t}(W(s,["ref"])),c.props),u))}return(0,r.createElement)(o,Object.assign({},W(s,["ref"]),o!==r.Fragment&&u),c)}function B(e){var t;return Object.assign((0,r.forwardRef)(e),{displayName:null!=(t=e.displayName)?t:e.name})}function W(e,t=[]){let n=Object.assign({},e);for(let e of t)e in n&&delete n[e];return n}function U(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),a=null!=r?r:-1,o=(()=>{switch(e.focus){case 0:return n.findIndex((e=>!t.resolveDisabled(e)));case 1:{let e=n.slice().reverse().findIndex(((e,n,r)=>!(-1!==a&&r.length-n-1>=a||t.resolveDisabled(e))));return-1===e?e:n.length-1-e}case 2:return n.findIndex(((e,n)=>!(n<=a||t.resolveDisabled(e))));case 3:{let e=n.slice().reverse().findIndex((e=>!t.resolveDisabled(e)));return-1===e?e:n.length-1-e}case 4:return n.findIndex((n=>t.resolveId(n)===e.id));case 5:return null;default:!function(e){throw new Error("Unexpected object: "+e)}(e)}})();return-1===o?r:o}function G(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=""===(null==t?void 0:t.getAttribute("disabled"));return(!r||!function(e){if(!e)return!1;let t=e.previousElementSibling;for(;null!==t;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}(n))&&r}function K(e,t,n){let a=(0,r.useRef)(t);a.current=t,(0,r.useEffect)((()=>{function t(e){a.current.call(window,e)}return window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)}),[e,n])}var H=(0,r.createContext)(null);function Q(){return(0,r.useContext)(H)}function q({value:e,children:t}){return r.createElement(H.Provider,{value:e},t)}function z(e){var t;if(e.type)return e.type;let n=null!=(t=e.as)?t:"button";return"string"==typeof n&&"button"===n.toLowerCase()?"button":void 0}function V(e,t){let[n,a]=(0,r.useState)((()=>z(e)));return R((()=>{a(z(e))}),[e.type,e.as]),R((()=>{n||!t.current||t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&a("button")}),[n,t]),n}function Y({container:e,accept:t,walk:n,enabled:a=!0}){let o=(0,r.useRef)(t),l=(0,r.useRef)(n);(0,r.useEffect)((()=>{o.current=t,l.current=n}),[t,n]),R((()=>{if(!e||!a)return;let t=o.current,n=l.current,r=Object.assign((e=>t(e)),{acceptNode:t}),i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,r,!1);for(;i.nextNode();)n(i.currentNode)}),[e,a,o,l])}H.displayName="OpenClosedContext";var J={1:e=>e.disabled||1===e.comboboxState?e:{...e,activeOptionIndex:null,comboboxState:1},0:e=>e.disabled||0===e.comboboxState?e:{...e,comboboxState:0},2:(e,t)=>e.disabled===t.disabled?e:{...e,disabled:t.disabled},3(e,t){if(e.disabled||e.optionsRef.current&&!e.optionsPropsRef.current.static&&1===e.comboboxState)return e;let n=U(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});return e.activeOptionIndex===n?e:{...e,activeOptionIndex:n}},4:(e,t)=>{var n;let r=null!==e.activeOptionIndex?e.options[e.activeOptionIndex]:null,a=Array.from(null==(n=e.optionsRef.current)?void 0:n.querySelectorAll('[id^="headlessui-combobox-option-"]')).reduce(((e,t,n)=>Object.assign(e,{[t.id]:n})),{}),o=[...e.options,{id:t.id,dataRef:t.dataRef}].sort(((e,t)=>a[e.id]-a[t.id]));return{...e,options:o,activeOptionIndex:null===r?null:o.indexOf(r)}},5:(e,t)=>{let n=e.options.slice(),r=null!==e.activeOptionIndex?n[e.activeOptionIndex]:null,a=n.findIndex((e=>e.id===t.id));return-1!==a&&n.splice(a,1),{...e,options:n,activeOptionIndex:a===e.activeOptionIndex||null===r?null:n.indexOf(r)}}},X=(0,r.createContext)(null);function Z(e){let t=(0,r.useContext)(X);if(null===t){let t=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Z),t}return t}X.displayName="ComboboxContext";var ee=(0,r.createContext)(null);function te(){let e=(0,r.useContext)(ee);if(null===e){let e=new Error("ComboboxActions is missing a parent <Combobox /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(e,te),e}return e}function ne(e,t){return A(t.type,J,e,t)}ee.displayName="ComboboxActions";var re=r.Fragment,ae=B((function(e,t){let{value:n,onChange:a,disabled:o=!1,...l}=e,i=(0,r.useRef)({value:n,onChange:a}),s=(0,r.useRef)({static:!1,hold:!1}),u=(0,r.useRef)({displayValue:void 0}),c=(0,r.useReducer)(ne,{comboboxState:1,comboboxPropsRef:i,optionsPropsRef:s,inputPropsRef:u,labelRef:(0,r.createRef)(),inputRef:(0,r.createRef)(),buttonRef:(0,r.createRef)(),optionsRef:(0,r.createRef)(),disabled:o,options:[],activeOptionIndex:null}),[{comboboxState:d,options:p,activeOptionIndex:m,optionsRef:f,inputRef:b,buttonRef:v},x]=c;R((()=>{i.current.value=n}),[n,i]),R((()=>{i.current.onChange=a}),[a,i]),R((()=>x({type:2,disabled:o})),[o]),K("mousedown",(e=>{var t,n,r;let a=e.target;0===d&&((null==(t=v.current)?void 0:t.contains(a))||(null==(n=b.current)?void 0:n.contains(a))||(null==(r=f.current)?void 0:r.contains(a))||x({type:1}))}));let g=null===m?null:p[m].dataRef.current.value,h=(0,r.useMemo)((()=>({open:0===d,disabled:o,activeIndex:m,activeOption:g})),[d,o,p,m]),y=(0,r.useCallback)((()=>{if(!b.current||void 0===n)return;let e=u.current.displayValue;"function"==typeof e?b.current.value=e(n):"string"==typeof n&&(b.current.value=n)}),[n,b,u]),w=(0,r.useCallback)((e=>{let t=p.find((t=>t.id===e));if(!t)return;let{dataRef:n}=t;i.current.onChange(n.current.value),y()}),[p,i,b]),E=(0,r.useCallback)((()=>{if(null!==m){let{dataRef:e}=p[m];i.current.onChange(e.current.value),y()}}),[m,p,i,b]),k=(0,r.useMemo)((()=>({selectOption:w,selectActiveOption:E})),[w,E]);return R((()=>{1===d&&y()}),[y,d]),R(y,[y]),r.createElement(ee.Provider,{value:k},r.createElement(X.Provider,{value:c},r.createElement(q,{value:A(d,{0:0,1:1})},j({props:null===t?l:{...l,ref:t},slot:h,defaultTag:re,name:"Combobox"}))))})),oe=B((function(e,t){var n,a;let{value:o,onChange:l,displayValue:i,...s}=e,[u,c]=Z("Combobox.Input"),d=te(),p=M(u.inputRef,t),m=u.inputPropsRef,f=`headlessui-combobox-input-${O()}`,b=S(),v=F(l);R((()=>{m.current.displayValue=i}),[i,m]);let x=(0,r.useCallback)((e=>{switch(e.key){case"Enter":e.preventDefault(),e.stopPropagation(),d.selectActiveOption(),c({type:1});break;case"ArrowDown":return e.preventDefault(),e.stopPropagation(),A(u.comboboxState,{0:()=>c({type:3,focus:2}),1:()=>{c({type:0}),b.nextFrame((()=>{u.comboboxPropsRef.current.value||c({type:3,focus:0})}))}});case"ArrowUp":return e.preventDefault(),e.stopPropagation(),A(u.comboboxState,{0:()=>c({type:3,focus:1}),1:()=>{c({type:0}),b.nextFrame((()=>{u.comboboxPropsRef.current.value||c({type:3,focus:3})}))}});case"Home":case"PageUp":return e.preventDefault(),e.stopPropagation(),c({type:3,focus:0});case"End":case"PageDown":return e.preventDefault(),e.stopPropagation(),c({type:3,focus:3});case"Escape":return e.preventDefault(),u.optionsRef.current&&!u.optionsPropsRef.current.static&&e.stopPropagation(),c({type:1});case"Tab":d.selectActiveOption(),c({type:1})}}),[b,c,u,d]),g=(0,r.useCallback)((e=>{var t;c({type:0}),null==(t=v.current)||t.call(v,e)}),[c,v]),h=L((()=>{if(u.labelRef.current)return[u.labelRef.current.id].join(" ")}),[u.labelRef.current]),y=(0,r.useMemo)((()=>({open:0===u.comboboxState,disabled:u.disabled})),[u]);return j({props:{...s,ref:p,id:f,role:"combobox",type:"text","aria-controls":null==(n=u.optionsRef.current)?void 0:n.id,"aria-expanded":u.disabled?void 0:0===u.comboboxState,"aria-activedescendant":null===u.activeOptionIndex||null==(a=u.options[u.activeOptionIndex])?void 0:a.id,"aria-labelledby":h,disabled:u.disabled,onKeyDown:x,onChange:g},slot:y,defaultTag:"input",name:"Combobox.Input"})})),le=B((function(e,t){var n;let[a,o]=Z("Combobox.Button"),l=te(),i=M(a.buttonRef,t),s=`headlessui-combobox-button-${O()}`,u=S(),c=(0,r.useCallback)((e=>{switch(e.key){case"ArrowDown":return e.preventDefault(),e.stopPropagation(),1===a.comboboxState&&(o({type:0}),u.nextFrame((()=>{a.comboboxPropsRef.current.value||o({type:3,focus:0})}))),u.nextFrame((()=>{var e;return null==(e=a.inputRef.current)?void 0:e.focus({preventScroll:!0})}));case"ArrowUp":return e.preventDefault(),e.stopPropagation(),1===a.comboboxState&&(o({type:0}),u.nextFrame((()=>{a.comboboxPropsRef.current.value||o({type:3,focus:3})}))),u.nextFrame((()=>{var e;return null==(e=a.inputRef.current)?void 0:e.focus({preventScroll:!0})}));case"Escape":return e.preventDefault(),a.optionsRef.current&&!a.optionsPropsRef.current.static&&e.stopPropagation(),o({type:1}),u.nextFrame((()=>{var e;return null==(e=a.inputRef.current)?void 0:e.focus({preventScroll:!0})}))}}),[u,o,a,l]),d=(0,r.useCallback)((e=>{if(G(e.currentTarget))return e.preventDefault();0===a.comboboxState?o({type:1}):(e.preventDefault(),o({type:0})),u.nextFrame((()=>{var e;return null==(e=a.inputRef.current)?void 0:e.focus({preventScroll:!0})}))}),[o,u,a]),p=L((()=>{if(a.labelRef.current)return[a.labelRef.current.id,s].join(" ")}),[a.labelRef.current,s]),m=(0,r.useMemo)((()=>({open:0===a.comboboxState,disabled:a.disabled})),[a]);return j({props:{...e,ref:i,id:s,type:V(e,a.buttonRef),tabIndex:-1,"aria-haspopup":!0,"aria-controls":null==(n=a.optionsRef.current)?void 0:n.id,"aria-expanded":a.disabled?void 0:0===a.comboboxState,"aria-labelledby":p,disabled:a.disabled,onClick:d,onKeyDown:c},slot:m,defaultTag:"button",name:"Combobox.Button"})})),ie=B((function(e,t){var n;let{hold:a=!1,...o}=e,[l]=Z("Combobox.Options"),{optionsPropsRef:i}=l,s=M(l.optionsRef,t),u=`headlessui-combobox-options-${O()}`,c=Q(),d=null!==c?0===c:0===l.comboboxState;R((()=>{var t;i.current.static=null!=(t=e.static)&&t}),[i,e.static]),R((()=>{i.current.hold=a}),[a,i]),Y({container:l.optionsRef.current,enabled:0===l.comboboxState,accept:e=>"option"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT,walk(e){e.setAttribute("role","none")}});let p=L((()=>{var e,t,n;return null!=(n=null==(e=l.labelRef.current)?void 0:e.id)?n:null==(t=l.buttonRef.current)?void 0:t.id}),[l.labelRef.current,l.buttonRef.current]),m=(0,r.useMemo)((()=>({open:0===l.comboboxState})),[l]);return j({props:{...o,"aria-activedescendant":null===l.activeOptionIndex||null==(n=l.options[l.activeOptionIndex])?void 0:n.id,"aria-labelledby":p,role:"listbox",id:u,ref:s},slot:m,defaultTag:"ul",features:3,visible:d,name:"Combobox.Options"})}));Object.assign(ae,{Input:oe,Button:le,Label:function(e){let[t]=Z("Combobox.Label"),n=`headlessui-combobox-label-${O()}`,a=(0,r.useCallback)((()=>{var e;return null==(e=t.inputRef.current)?void 0:e.focus({preventScroll:!0})}),[t.inputRef]),o=(0,r.useMemo)((()=>({open:0===t.comboboxState,disabled:t.disabled})),[t]);return j({props:{...e,ref:t.labelRef,id:n,onClick:a},slot:o,defaultTag:"label",name:"Combobox.Label"})},Options:ie,Option:function(e){let{disabled:t=!1,value:n,...a}=e,[o,l]=Z("Combobox.Option"),i=te(),s=`headlessui-combobox-option-${O()}`,u=null!==o.activeOptionIndex&&o.options[o.activeOptionIndex].id===s,c=o.comboboxPropsRef.current.value===n,d=(0,r.useRef)({disabled:t,value:n});R((()=>{d.current.disabled=t}),[d,t]),R((()=>{d.current.value=n}),[d,n]),R((()=>{var e,t;d.current.textValue=null==(t=null==(e=document.getElementById(s))?void 0:e.textContent)?void 0:t.toLowerCase()}),[d,s]);let p=(0,r.useCallback)((()=>i.selectOption(s)),[i,s]);R((()=>(l({type:4,id:s,dataRef:d}),()=>l({type:5,id:s}))),[d,s]),R((()=>{0===o.comboboxState&&(!c||l({type:3,focus:4,id:s}))}),[o.comboboxState,c,s]),R((()=>{if(0!==o.comboboxState||!u)return;let e=I();return e.requestAnimationFrame((()=>{var e,t;null==(t=null==(e=document.getElementById(s))?void 0:e.scrollIntoView)||t.call(e,{block:"nearest"})})),e.dispose}),[s,u,o.comboboxState,o.activeOptionIndex]);let m=(0,r.useCallback)((e=>{if(t)return e.preventDefault();p(),l({type:1}),I().nextFrame((()=>{var e;return null==(e=o.inputRef.current)?void 0:e.focus({preventScroll:!0})}))}),[l,o.inputRef,t,p]),f=(0,r.useCallback)((()=>{if(t)return l({type:3,focus:5});l({type:3,focus:4,id:s})}),[t,s,l]),b=(0,r.useCallback)((()=>{t||u||l({type:3,focus:4,id:s})}),[t,u,s,l]),v=(0,r.useCallback)((()=>{t||!u||o.optionsPropsRef.current.hold||l({type:3,focus:5})}),[t,u,l,o.comboboxState,o.comboboxPropsRef]),x=(0,r.useMemo)((()=>({active:u,selected:c,disabled:t})),[u,c,t]);return j({props:{...a,id:s,role:"option",tabIndex:!0===t?void 0:-1,"aria-disabled":!0===t||void 0,"aria-selected":!0===c||void 0,disabled:void 0,onClick:m,onFocus:f,onPointerMove:b,onMouseMove:b,onPointerLeave:v,onMouseLeave:v},slot:x,defaultTag:"li",name:"Combobox.Option"})}});var se=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map((e=>`${e}:not([tabindex='-1'])`)).join(",");function ue(e=document.body){return null==e?[]:Array.from(e.querySelectorAll(se))}function ce(e,t=0){return e!==document.body&&A(t,{0:()=>e.matches(se),1(){let t=e;for(;null!==t;){if(t.matches(se))return!0;t=t.parentElement}return!1}})}function de(e){null==e||e.focus({preventScroll:!0})}function pe(e,t){let n,r=Array.isArray(e)?e.slice().sort(((e,t)=>{let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING?-1:n&Node.DOCUMENT_POSITION_PRECEDING?1:0})):ue(e),a=document.activeElement,o=(()=>{if(5&t)return 1;if(10&t)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=(()=>{if(1&t)return 0;if(2&t)return Math.max(0,r.indexOf(a))-1;if(4&t)return Math.max(0,r.indexOf(a))+1;if(8&t)return r.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),i=32&t?{preventScroll:!0}:{},s=0,u=r.length;do{if(s>=u||s+u<=0)return 0;let e=l+s;if(16&t)e=(e+u)%u;else{if(e<0)return 3;if(e>=u)return 1}n=r[e],null==n||n.focus(i),s+=o}while(n!==document.activeElement);return n.hasAttribute("tabindex")||n.setAttribute("tabindex","0"),2}function me(){let e=(0,r.useRef)(!1);return(0,r.useEffect)((()=>(e.current=!0,()=>{e.current=!1})),[]),e}var fe=new Set,be=new Map;function ve(e){e.setAttribute("aria-hidden","true"),e.inert=!0}function xe(e){let t=be.get(e);!t||(null===t["aria-hidden"]?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",t["aria-hidden"]),e.inert=t.inert)}var ge=(0,r.createContext)(!1);function he(e){return r.createElement(ge.Provider,{value:e.force},e.children)}var ye=r.Fragment;function we(e){let t=e,n=function(){let e=(0,r.useContext)(ge),t=(0,r.useContext)(ke),[n,a]=(0,r.useState)((()=>{if(!e&&null!==t||"undefined"==typeof window)return null;let n=document.getElementById("headlessui-portal-root");if(n)return n;let r=document.createElement("div");return r.setAttribute("id","headlessui-portal-root"),document.body.appendChild(r)}));return(0,r.useEffect)((()=>{null!==n&&(document.body.contains(n)||document.body.appendChild(n))}),[n]),(0,r.useEffect)((()=>{e||null!==t&&a(t.current)}),[t,a,e]),n}(),[o]=(0,r.useState)((()=>"undefined"==typeof window?null:document.createElement("div"))),l=P();return R((()=>{if(n&&o)return n.appendChild(o),()=>{var e;!n||!o||(n.removeChild(o),n.childNodes.length<=0&&(null==(e=n.parentElement)||e.removeChild(n)))}}),[n,o]),l&&n&&o?(0,a.createPortal)(j({props:t,defaultTag:ye,name:"Portal"}),o):null}var Ee=r.Fragment,ke=(0,r.createContext)(null);we.Group=function(e){let{target:t,...n}=e;return r.createElement(ke.Provider,{value:t},j({props:n,defaultTag:Ee,name:"Popover.Group"}))};var Ce=(0,r.createContext)(null);function _e(){let e=(0,r.useContext)(Ce);if(null===e){let e=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,_e),e}return e}function Ie(){let[e,t]=(0,r.useState)([]);return[e.length>0?e.join(" "):void 0,(0,r.useMemo)((()=>function(e){let n=(0,r.useCallback)((e=>(t((t=>[...t,e])),()=>t((t=>{let n=t.slice(),r=n.indexOf(e);return-1!==r&&n.splice(r,1),n})))),[]),a=(0,r.useMemo)((()=>({register:n,slot:e.slot,name:e.name,props:e.props})),[n,e.slot,e.name,e.props]);return r.createElement(Ce.Provider,{value:a},e.children)}),[t])]}function Se(e){let t=_e(),n=`headlessui-description-${O()}`;return R((()=>t.register(n)),[n,t.register]),j({props:{...e,...{...t.props,id:n}},slot:t.slot||{},defaultTag:"p",name:t.name||"Description"})}var Re=(0,r.createContext)((()=>{}));function Ne({children:e,onUpdate:t,type:n,element:a}){let o=(0,r.useContext)(Re),l=(0,r.useCallback)(((...e)=>{null==t||t(...e),o(...e)}),[o,t]);return R((()=>(l(0,n,a),()=>l(1,n,a))),[l,n,a]),r.createElement(Re.Provider,{value:l},e)}Re.displayName="StackContext";var Pe={0:(e,t)=>e.titleId===t.id?e:{...e,titleId:t.id}},Te=(0,r.createContext)(null);function De(e){let t=(0,r.useContext)(Te);if(null===t){let t=new Error(`<${e} /> is missing a parent <${Me.displayName} /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,De),t}return t}function Oe(e,t){return A(t.type,Pe,e,t)}Te.displayName="DialogContext";var Fe=B((function(e,t){let{open:n,onClose:a,initialFocus:o,...l}=e,[i,s]=(0,r.useState)(0),u=Q();void 0===n&&null!==u&&(n=A(u,{0:!0,1:!1}));let c=(0,r.useRef)(new Set),d=(0,r.useRef)(null),p=M(d,t),m=e.hasOwnProperty("open")||null!==u,f=e.hasOwnProperty("onClose");if(!m&&!f)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!m)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!f)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if("boolean"!=typeof n)throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${n}`);if("function"!=typeof a)throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${a}`);let b=n?0:1,v=null!==u?0===u:0===b,[x,g]=(0,r.useReducer)(Oe,{titleId:null,descriptionId:null}),h=(0,r.useCallback)((()=>a(!1)),[a]),y=(0,r.useCallback)((e=>g({type:0,id:e})),[g]),w=P()&&0===b,E=i>1,k=null!==(0,r.useContext)(Te);(function(e,t=30,{initialFocus:n,containers:a}={}){let o=(0,r.useRef)("undefined"!=typeof window?document.activeElement:null),l=(0,r.useRef)(null),i=me(),s=Boolean(16&t),u=Boolean(2&t);(0,r.useEffect)((()=>{!s||(o.current=document.activeElement)}),[s]),(0,r.useEffect)((()=>{if(s)return()=>{de(o.current),o.current=null}}),[s]),(0,r.useEffect)((()=>{if(!u||!e.current)return;let t=document.activeElement;if(null==n?void 0:n.current){if((null==n?void 0:n.current)===t)return void(l.current=t)}else if(e.current.contains(t))return void(l.current=t);(null==n?void 0:n.current)?de(n.current):0===pe(e.current,1)&&console.warn("There are no focusable elements inside the <FocusTrap />"),l.current=document.activeElement}),[e,n,u]),K("keydown",(n=>{!(4&t)||!e.current||"Tab"===n.key&&(n.preventDefault(),2===pe(e.current,16|(n.shiftKey?2:4))&&(l.current=document.activeElement))})),K("focus",(n=>{if(!(8&t))return;let r=new Set(null==a?void 0:a.current);if(r.add(e),!r.size)return;let o=l.current;if(!o||!i.current)return;let s=n.target;s&&s instanceof HTMLElement?function(e,t){var n;for(let r of e)if(null==(n=r.current)?void 0:n.contains(t))return!0;return!1}(r,s)?(l.current=s,de(s)):(n.preventDefault(),n.stopPropagation(),de(o)):de(l.current)}),!0)})(d,w?A(E?"parent":"leaf",{parent:16,leaf:30}):1,{initialFocus:o,containers:c}),function(e,t=!0){R((()=>{if(!t||!e.current)return;let n=e.current;fe.add(n);for(let e of be.keys())e.contains(n)&&(xe(e),be.delete(e));return document.querySelectorAll("body > *").forEach((e=>{if(e instanceof HTMLElement){for(let t of fe)if(e.contains(t))return;1===fe.size&&(be.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),ve(e))}})),()=>{if(fe.delete(n),fe.size>0)document.querySelectorAll("body > *").forEach((e=>{if(e instanceof HTMLElement&&!be.has(e)){for(let t of fe)if(e.contains(t))return;be.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),ve(e)}}));else for(let e of be.keys())xe(e),be.delete(e)}}),[t])}(d,!!E&&w),K("mousedown",(e=>{var t;let n=e.target;0===b&&(E||(null==(t=d.current)?void 0:t.contains(n))||h())})),K("keydown",(e=>{"Escape"===e.key&&0===b&&(E||(e.preventDefault(),e.stopPropagation(),h()))})),(0,r.useEffect)((()=>{if(0!==b||k)return;let e=document.documentElement.style.overflow,t=document.documentElement.style.paddingRight,n=window.innerWidth-document.documentElement.clientWidth;return document.documentElement.style.overflow="hidden",document.documentElement.style.paddingRight=`${n}px`,()=>{document.documentElement.style.overflow=e,document.documentElement.style.paddingRight=t}}),[b,k]),(0,r.useEffect)((()=>{if(0!==b||!d.current)return;let e=new IntersectionObserver((e=>{for(let t of e)0===t.boundingClientRect.x&&0===t.boundingClientRect.y&&0===t.boundingClientRect.width&&0===t.boundingClientRect.height&&h()}));return e.observe(d.current),()=>e.disconnect()}),[b,d,h]);let[C,_]=Ie(),I=`headlessui-dialog-${O()}`,S=(0,r.useMemo)((()=>[{dialogState:b,close:h,setTitleId:y},x]),[b,x,h,y]),N=(0,r.useMemo)((()=>({open:0===b})),[b]),T={ref:p,id:I,role:"dialog","aria-modal":0===b||void 0,"aria-labelledby":x.titleId,"aria-describedby":C,onClick(e){e.stopPropagation()}},D=l;return r.createElement(Ne,{type:"Dialog",element:d,onUpdate:(0,r.useCallback)(((e,t,n)=>{"Dialog"===t&&A(e,{0(){c.current.add(n),s((e=>e+1))},1(){c.current.add(n),s((e=>e-1))}})}),[])},r.createElement(he,{force:!0},r.createElement(we,null,r.createElement(Te.Provider,{value:S},r.createElement(we.Group,{target:d},r.createElement(he,{force:!1},r.createElement(_,{slot:N,name:"Dialog.Description"},j({props:{...D,...T},slot:N,defaultTag:"div",features:3,visible:v,name:"Dialog"}))))))))})),Le=B((function(e,t){let[{dialogState:n,close:a}]=De("Dialog.Overlay");return j({props:{...e,ref:M(t),id:`headlessui-dialog-overlay-${O()}`,"aria-hidden":!0,onClick:(0,r.useCallback)((e=>{if(e.target===e.currentTarget){if(G(e.currentTarget))return e.preventDefault();e.preventDefault(),e.stopPropagation(),a()}}),[a])},slot:(0,r.useMemo)((()=>({open:0===n})),[n]),defaultTag:"div",name:"Dialog.Overlay"})})),Me=Object.assign(Fe,{Overlay:Le,Title:function(e){let[{dialogState:t,setTitleId:n}]=De("Dialog.Title"),a=`headlessui-dialog-title-${O()}`;(0,r.useEffect)((()=>(n(a),()=>n(null))),[a,n]);let o=(0,r.useMemo)((()=>({open:0===t})),[t]);return j({props:{...e,id:a},slot:o,defaultTag:"h2",name:"Dialog.Title"})},Description:Se}),Ae={0:e=>({...e,disclosureState:A(e.disclosureState,{0:1,1:0})}),1:e=>1===e.disclosureState?e:{...e,disclosureState:1},4:e=>!0===e.linkedPanel?e:{...e,linkedPanel:!0},5:e=>!1===e.linkedPanel?e:{...e,linkedPanel:!1},2:(e,t)=>e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId},3:(e,t)=>e.panelId===t.panelId?e:{...e,panelId:t.panelId}},je=(0,r.createContext)(null);function $e(e){let t=(0,r.useContext)(je);if(null===t){let t=new Error(`<${e} /> is missing a parent <${He.name} /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,$e),t}return t}je.displayName="DisclosureContext";var Be=(0,r.createContext)(null);function We(e){let t=(0,r.useContext)(Be);if(null===t){let t=new Error(`<${e} /> is missing a parent <${He.name} /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,We),t}return t}Be.displayName="DisclosureAPIContext";var Ue=(0,r.createContext)(null);function Ge(e,t){return A(t.type,Ae,e,t)}Ue.displayName="DisclosurePanelContext";var Ke=r.Fragment;function He(e){let{defaultOpen:t=!1,...n}=e,a=`headlessui-disclosure-button-${O()}`,o=`headlessui-disclosure-panel-${O()}`,l=(0,r.useReducer)(Ge,{disclosureState:t?0:1,linkedPanel:!1,buttonId:a,panelId:o}),[{disclosureState:i},s]=l;(0,r.useEffect)((()=>s({type:2,buttonId:a})),[a,s]),(0,r.useEffect)((()=>s({type:3,panelId:o})),[o,s]);let u=(0,r.useCallback)((e=>{s({type:1});let t=e?e instanceof HTMLElement?e:e.current instanceof HTMLElement?e.current:document.getElementById(a):document.getElementById(a);null==t||t.focus()}),[s,a]),c=(0,r.useMemo)((()=>({close:u})),[u]),d=(0,r.useMemo)((()=>({open:0===i,close:u})),[i,u]);return r.createElement(je.Provider,{value:l},r.createElement(Be.Provider,{value:c},r.createElement(q,{value:A(i,{0:0,1:1})},j({props:n,slot:d,defaultTag:Ke,name:"Disclosure"}))))}var Qe=B((function(e,t){let[n,a]=$e("Disclosure.Button"),o=(0,r.useRef)(null),l=M(o,t),i=(0,r.useContext)(Ue),s=null!==i&&i===n.panelId,u=(0,r.useCallback)((e=>{var t;if(s){if(1===n.disclosureState)return;switch(e.key){case" ":case"Enter":e.preventDefault(),e.stopPropagation(),a({type:0}),null==(t=document.getElementById(n.buttonId))||t.focus()}}else switch(e.key){case" ":case"Enter":e.preventDefault(),e.stopPropagation(),a({type:0})}}),[a,s,n.disclosureState,n.buttonId]),c=(0,r.useCallback)((e=>{" "===e.key&&e.preventDefault()}),[]),d=(0,r.useCallback)((t=>{var r;G(t.currentTarget)||e.disabled||(s?(a({type:0}),null==(r=document.getElementById(n.buttonId))||r.focus()):a({type:0}))}),[a,e.disabled,n.buttonId,s]),p=(0,r.useMemo)((()=>({open:0===n.disclosureState})),[n]),m=V(e,o);return j({props:{...e,...s?{ref:l,type:m,onKeyDown:u,onClick:d}:{ref:l,id:n.buttonId,type:m,"aria-expanded":e.disabled?void 0:0===n.disclosureState,"aria-controls":n.linkedPanel?n.panelId:void 0,onKeyDown:u,onKeyUp:c,onClick:d}},slot:p,defaultTag:"button",name:"Disclosure.Button"})})),qe=B((function(e,t){let[n,a]=$e("Disclosure.Panel"),{close:o}=We("Disclosure.Panel"),l=M(t,(()=>{n.linkedPanel||a({type:4})})),i=Q(),s=null!==i?0===i:0===n.disclosureState;(0,r.useEffect)((()=>()=>a({type:5})),[a]),(0,r.useEffect)((()=>{var t;1===n.disclosureState&&(null==(t=e.unmount)||t)&&a({type:5})}),[n.disclosureState,e.unmount,a]);let u=(0,r.useMemo)((()=>({open:0===n.disclosureState,close:o})),[n,o]),c={ref:l,id:n.panelId},d=e;return r.createElement(Ue.Provider,{value:n.panelId},j({props:{...d,...c},slot:u,defaultTag:"div",features:3,visible:s,name:"Disclosure.Panel"}))}));He.Button=Qe,He.Panel=qe;var ze={1:e=>e.disabled||1===e.listboxState?e:{...e,activeOptionIndex:null,listboxState:1},0:e=>e.disabled||0===e.listboxState?e:{...e,listboxState:0},2:(e,t)=>e.disabled===t.disabled?e:{...e,disabled:t.disabled},3:(e,t)=>e.orientation===t.orientation?e:{...e,orientation:t.orientation},4(e,t){if(e.disabled||1===e.listboxState)return e;let n=U(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});return""===e.searchQuery&&e.activeOptionIndex===n?e:{...e,searchQuery:"",activeOptionIndex:n}},5:(e,t)=>{if(e.disabled||1===e.listboxState)return e;let n=""!==e.searchQuery?0:1,r=e.searchQuery+t.value.toLowerCase(),a=(null!==e.activeOptionIndex?e.options.slice(e.activeOptionIndex+n).concat(e.options.slice(0,e.activeOptionIndex+n)):e.options).find((e=>{var t;return!e.dataRef.current.disabled&&(null==(t=e.dataRef.current.textValue)?void 0:t.startsWith(r))})),o=a?e.options.indexOf(a):-1;return-1===o||o===e.activeOptionIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeOptionIndex:o}},6:e=>e.disabled||1===e.listboxState||""===e.searchQuery?e:{...e,searchQuery:""},7:(e,t)=>{var n;let r=Array.from(null==(n=e.optionsRef.current)?void 0:n.querySelectorAll('[id^="headlessui-listbox-option-"]')).reduce(((e,t,n)=>Object.assign(e,{[t.id]:n})),{}),a=[...e.options,{id:t.id,dataRef:t.dataRef}].sort(((e,t)=>r[e.id]-r[t.id]));return{...e,options:a}},8:(e,t)=>{let n=e.options.slice(),r=null!==e.activeOptionIndex?n[e.activeOptionIndex]:null,a=n.findIndex((e=>e.id===t.id));return-1!==a&&n.splice(a,1),{...e,options:n,activeOptionIndex:a===e.activeOptionIndex||null===r?null:n.indexOf(r)}}},Ve=(0,r.createContext)(null);function Ye(e){let t=(0,r.useContext)(Ve);if(null===t){let t=new Error(`<${e} /> is missing a parent <${Ze.name} /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Ye),t}return t}function Je(e,t){return A(t.type,ze,e,t)}Ve.displayName="ListboxContext";var Xe=r.Fragment;function Ze(e){let{value:t,onChange:n,disabled:a=!1,horizontal:o=!1,...l}=e,i=o?"horizontal":"vertical",s=(0,r.useReducer)(Je,{listboxState:1,propsRef:{current:{value:t,onChange:n}},labelRef:(0,r.createRef)(),buttonRef:(0,r.createRef)(),optionsRef:(0,r.createRef)(),disabled:a,orientation:i,options:[],searchQuery:"",activeOptionIndex:null}),[{listboxState:u,propsRef:c,optionsRef:d,buttonRef:p},m]=s;R((()=>{c.current.value=t}),[t,c]),R((()=>{c.current.onChange=n}),[n,c]),R((()=>m({type:2,disabled:a})),[a]),R((()=>m({type:3,orientation:i})),[i]),K("mousedown",(e=>{var t,n,r;let a=e.target;0===u&&((null==(t=p.current)?void 0:t.contains(a))||(null==(n=d.current)?void 0:n.contains(a))||(m({type:1}),ce(a,1)||(e.preventDefault(),null==(r=p.current)||r.focus())))}));let f=(0,r.useMemo)((()=>({open:0===u,disabled:a})),[u,a]);return r.createElement(Ve.Provider,{value:s},r.createElement(q,{value:A(u,{0:0,1:1})},j({props:l,slot:f,defaultTag:Xe,name:"Listbox"})))}var et=B((function(e,t){var n;let[a,o]=Ye("Listbox.Button"),l=M(a.buttonRef,t),i=`headlessui-listbox-button-${O()}`,s=S(),u=(0,r.useCallback)((e=>{switch(e.key){case" ":case"Enter":case"ArrowDown":e.preventDefault(),o({type:0}),s.nextFrame((()=>{a.propsRef.current.value||o({type:4,focus:0})}));break;case"ArrowUp":e.preventDefault(),o({type:0}),s.nextFrame((()=>{a.propsRef.current.value||o({type:4,focus:3})}))}}),[o,a,s]),c=(0,r.useCallback)((e=>{" "===e.key&&e.preventDefault()}),[]),d=(0,r.useCallback)((e=>{if(G(e.currentTarget))return e.preventDefault();0===a.listboxState?(o({type:1}),s.nextFrame((()=>{var e;return null==(e=a.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(e.preventDefault(),o({type:0}))}),[o,s,a]),p=L((()=>{if(a.labelRef.current)return[a.labelRef.current.id,i].join(" ")}),[a.labelRef.current,i]),m=(0,r.useMemo)((()=>({open:0===a.listboxState,disabled:a.disabled})),[a]);return j({props:{...e,ref:l,id:i,type:V(e,a.buttonRef),"aria-haspopup":!0,"aria-controls":null==(n=a.optionsRef.current)?void 0:n.id,"aria-expanded":a.disabled?void 0:0===a.listboxState,"aria-labelledby":p,disabled:a.disabled,onKeyDown:u,onKeyUp:c,onClick:d},slot:m,defaultTag:"button",name:"Listbox.Button"})})),tt=B((function(e,t){var n;let[a,o]=Ye("Listbox.Options"),l=M(a.optionsRef,t),i=`headlessui-listbox-options-${O()}`,s=S(),u=S(),c=Q(),d=null!==c?0===c:0===a.listboxState;R((()=>{let e=a.optionsRef.current;!e||0===a.listboxState&&e!==document.activeElement&&e.focus({preventScroll:!0})}),[a.listboxState,a.optionsRef]);let p=(0,r.useCallback)((e=>{switch(u.dispose(),e.key){case" ":if(""!==a.searchQuery)return e.preventDefault(),e.stopPropagation(),o({type:5,value:e.key});case"Enter":if(e.preventDefault(),e.stopPropagation(),o({type:1}),null!==a.activeOptionIndex){let{dataRef:e}=a.options[a.activeOptionIndex];a.propsRef.current.onChange(e.current.value)}I().nextFrame((()=>{var e;return null==(e=a.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case A(a.orientation,{vertical:"ArrowDown",horizontal:"ArrowRight"}):return e.preventDefault(),e.stopPropagation(),o({type:4,focus:2});case A(a.orientation,{vertical:"ArrowUp",horizontal:"ArrowLeft"}):return e.preventDefault(),e.stopPropagation(),o({type:4,focus:1});case"Home":case"PageUp":return e.preventDefault(),e.stopPropagation(),o({type:4,focus:0});case"End":case"PageDown":return e.preventDefault(),e.stopPropagation(),o({type:4,focus:3});case"Escape":return e.preventDefault(),e.stopPropagation(),o({type:1}),s.nextFrame((()=>{var e;return null==(e=a.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));case"Tab":e.preventDefault(),e.stopPropagation();break;default:1===e.key.length&&(o({type:5,value:e.key}),u.setTimeout((()=>o({type:6})),350))}}),[s,o,u,a]),m=L((()=>{var e,t,n;return null!=(n=null==(e=a.labelRef.current)?void 0:e.id)?n:null==(t=a.buttonRef.current)?void 0:t.id}),[a.labelRef.current,a.buttonRef.current]),f=(0,r.useMemo)((()=>({open:0===a.listboxState})),[a]);return j({props:{...e,"aria-activedescendant":null===a.activeOptionIndex||null==(n=a.options[a.activeOptionIndex])?void 0:n.id,"aria-labelledby":m,"aria-orientation":a.orientation,id:i,onKeyDown:p,role:"listbox",tabIndex:0,ref:l},slot:f,defaultTag:"ul",features:3,visible:d,name:"Listbox.Options"})}));Ze.Button=et,Ze.Label=function(e){let[t]=Ye("Listbox.Label"),n=`headlessui-listbox-label-${O()}`,a=(0,r.useCallback)((()=>{var e;return null==(e=t.buttonRef.current)?void 0:e.focus({preventScroll:!0})}),[t.buttonRef]),o=(0,r.useMemo)((()=>({open:0===t.listboxState,disabled:t.disabled})),[t]);return j({props:{...e,ref:t.labelRef,id:n,onClick:a},slot:o,defaultTag:"label",name:"Listbox.Label"})},Ze.Options=tt,Ze.Option=function(e){let{disabled:t=!1,value:n,...a}=e,[o,l]=Ye("Listbox.Option"),i=`headlessui-listbox-option-${O()}`,s=null!==o.activeOptionIndex&&o.options[o.activeOptionIndex].id===i,u=o.propsRef.current.value===n,c=(0,r.useRef)({disabled:t,value:n});R((()=>{c.current.disabled=t}),[c,t]),R((()=>{c.current.value=n}),[c,n]),R((()=>{var e,t;c.current.textValue=null==(t=null==(e=document.getElementById(i))?void 0:e.textContent)?void 0:t.toLowerCase()}),[c,i]);let d=(0,r.useCallback)((()=>o.propsRef.current.onChange(n)),[o.propsRef,n]);R((()=>(l({type:7,id:i,dataRef:c}),()=>l({type:8,id:i}))),[c,i]),R((()=>{var e,t;0===o.listboxState&&(!u||(l({type:4,focus:4,id:i}),null==(t=null==(e=document.getElementById(i))?void 0:e.focus)||t.call(e)))}),[o.listboxState]),R((()=>{if(0!==o.listboxState||!s)return;let e=I();return e.requestAnimationFrame((()=>{var e,t;null==(t=null==(e=document.getElementById(i))?void 0:e.scrollIntoView)||t.call(e,{block:"nearest"})})),e.dispose}),[i,s,o.listboxState,o.activeOptionIndex]);let p=(0,r.useCallback)((e=>{if(t)return e.preventDefault();d(),l({type:1}),I().nextFrame((()=>{var e;return null==(e=o.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))}),[l,o.buttonRef,t,d]),m=(0,r.useCallback)((()=>{if(t)return l({type:4,focus:5});l({type:4,focus:4,id:i})}),[t,i,l]),f=(0,r.useCallback)((()=>{t||s||l({type:4,focus:4,id:i})}),[t,s,i,l]),b=(0,r.useCallback)((()=>{t||!s||l({type:4,focus:5})}),[t,s,l]),v=(0,r.useMemo)((()=>({active:s,selected:u,disabled:t})),[s,u,t]);return j({props:{...a,id:i,role:"option",tabIndex:!0===t?void 0:-1,"aria-disabled":!0===t||void 0,"aria-selected":!0===u||void 0,disabled:void 0,onClick:p,onFocus:m,onPointerMove:f,onMouseMove:f,onPointerLeave:b,onMouseLeave:b},slot:v,defaultTag:"li",name:"Listbox.Option"})};var nt={1:e=>1===e.menuState?e:{...e,activeItemIndex:null,menuState:1},0:e=>0===e.menuState?e:{...e,menuState:0},2:(e,t)=>{let n=U(t,{resolveItems:()=>e.items,resolveActiveIndex:()=>e.activeItemIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});return""===e.searchQuery&&e.activeItemIndex===n?e:{...e,searchQuery:"",activeItemIndex:n}},3:(e,t)=>{let n=""!==e.searchQuery?0:1,r=e.searchQuery+t.value.toLowerCase(),a=(null!==e.activeItemIndex?e.items.slice(e.activeItemIndex+n).concat(e.items.slice(0,e.activeItemIndex+n)):e.items).find((e=>{var t;return(null==(t=e.dataRef.current.textValue)?void 0:t.startsWith(r))&&!e.dataRef.current.disabled})),o=a?e.items.indexOf(a):-1;return-1===o||o===e.activeItemIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeItemIndex:o}},4:e=>""===e.searchQuery?e:{...e,searchQuery:"",searchActiveItemIndex:null},5:(e,t)=>{var n;let r=Array.from(null==(n=e.itemsRef.current)?void 0:n.querySelectorAll('[id^="headlessui-menu-item-"]')).reduce(((e,t,n)=>Object.assign(e,{[t.id]:n})),{}),a=[...e.items,{id:t.id,dataRef:t.dataRef}].sort(((e,t)=>r[e.id]-r[t.id]));return{...e,items:a}},6:(e,t)=>{let n=e.items.slice(),r=null!==e.activeItemIndex?n[e.activeItemIndex]:null,a=n.findIndex((e=>e.id===t.id));return-1!==a&&n.splice(a,1),{...e,items:n,activeItemIndex:a===e.activeItemIndex||null===r?null:n.indexOf(r)}}},rt=(0,r.createContext)(null);function at(e){let t=(0,r.useContext)(rt);if(null===t){let t=new Error(`<${e} /> is missing a parent <${it.name} /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,at),t}return t}function ot(e,t){return A(t.type,nt,e,t)}rt.displayName="MenuContext";var lt=r.Fragment;function it(e){let t=(0,r.useReducer)(ot,{menuState:1,buttonRef:(0,r.createRef)(),itemsRef:(0,r.createRef)(),items:[],searchQuery:"",activeItemIndex:null}),[{menuState:n,itemsRef:a,buttonRef:o},l]=t;K("mousedown",(e=>{var t,r,i;let s=e.target;0===n&&((null==(t=o.current)?void 0:t.contains(s))||(null==(r=a.current)?void 0:r.contains(s))||(l({type:1}),ce(s,1)||(e.preventDefault(),null==(i=o.current)||i.focus())))}));let i=(0,r.useMemo)((()=>({open:0===n})),[n]);return r.createElement(rt.Provider,{value:t},r.createElement(q,{value:A(n,{0:0,1:1})},j({props:e,slot:i,defaultTag:lt,name:"Menu"})))}var st=B((function(e,t){var n;let[a,o]=at("Menu.Button"),l=M(a.buttonRef,t),i=`headlessui-menu-button-${O()}`,s=S(),u=(0,r.useCallback)((e=>{switch(e.key){case" ":case"Enter":case"ArrowDown":e.preventDefault(),e.stopPropagation(),o({type:0}),s.nextFrame((()=>o({type:2,focus:0})));break;case"ArrowUp":e.preventDefault(),e.stopPropagation(),o({type:0}),s.nextFrame((()=>o({type:2,focus:3})))}}),[o,s]),c=(0,r.useCallback)((e=>{" "===e.key&&e.preventDefault()}),[]),d=(0,r.useCallback)((t=>{if(G(t.currentTarget))return t.preventDefault();e.disabled||(0===a.menuState?(o({type:1}),s.nextFrame((()=>{var e;return null==(e=a.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(t.preventDefault(),t.stopPropagation(),o({type:0})))}),[o,s,a,e.disabled]),p=(0,r.useMemo)((()=>({open:0===a.menuState})),[a]);return j({props:{...e,ref:l,id:i,type:V(e,a.buttonRef),"aria-haspopup":!0,"aria-controls":null==(n=a.itemsRef.current)?void 0:n.id,"aria-expanded":e.disabled?void 0:0===a.menuState,onKeyDown:u,onKeyUp:c,onClick:d},slot:p,defaultTag:"button",name:"Menu.Button"})})),ut=B((function(e,t){var n,a;let[o,l]=at("Menu.Items"),i=M(o.itemsRef,t),s=`headlessui-menu-items-${O()}`,u=S(),c=Q(),d=null!==c?0===c:0===o.menuState;(0,r.useEffect)((()=>{let e=o.itemsRef.current;!e||0===o.menuState&&e!==document.activeElement&&e.focus({preventScroll:!0})}),[o.menuState,o.itemsRef]),Y({container:o.itemsRef.current,enabled:0===o.menuState,accept:e=>"menuitem"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT,walk(e){e.setAttribute("role","none")}});let p=(0,r.useCallback)((e=>{var t;switch(u.dispose(),e.key){case" ":if(""!==o.searchQuery)return e.preventDefault(),e.stopPropagation(),l({type:3,value:e.key});case"Enter":if(e.preventDefault(),e.stopPropagation(),l({type:1}),null!==o.activeItemIndex){let{id:e}=o.items[o.activeItemIndex];null==(t=document.getElementById(e))||t.click()}I().nextFrame((()=>{var e;return null==(e=o.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case"ArrowDown":return e.preventDefault(),e.stopPropagation(),l({type:2,focus:2});case"ArrowUp":return e.preventDefault(),e.stopPropagation(),l({type:2,focus:1});case"Home":case"PageUp":return e.preventDefault(),e.stopPropagation(),l({type:2,focus:0});case"End":case"PageDown":return e.preventDefault(),e.stopPropagation(),l({type:2,focus:3});case"Escape":e.preventDefault(),e.stopPropagation(),l({type:1}),I().nextFrame((()=>{var e;return null==(e=o.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case"Tab":e.preventDefault(),e.stopPropagation();break;default:1===e.key.length&&(l({type:3,value:e.key}),u.setTimeout((()=>l({type:4})),350))}}),[l,u,o]),m=(0,r.useCallback)((e=>{" "===e.key&&e.preventDefault()}),[]),f=(0,r.useMemo)((()=>({open:0===o.menuState})),[o]);return j({props:{...e,"aria-activedescendant":null===o.activeItemIndex||null==(n=o.items[o.activeItemIndex])?void 0:n.id,"aria-labelledby":null==(a=o.buttonRef.current)?void 0:a.id,id:s,onKeyDown:p,onKeyUp:m,role:"menu",tabIndex:0,ref:i},slot:f,defaultTag:"div",features:3,visible:d,name:"Menu.Items"})})),ct=r.Fragment;it.Button=st,it.Items=ut,it.Item=function(e){let{disabled:t=!1,onClick:n,...a}=e,[o,l]=at("Menu.Item"),i=`headlessui-menu-item-${O()}`,s=null!==o.activeItemIndex&&o.items[o.activeItemIndex].id===i;R((()=>{if(0!==o.menuState||!s)return;let e=I();return e.requestAnimationFrame((()=>{var e,t;null==(t=null==(e=document.getElementById(i))?void 0:e.scrollIntoView)||t.call(e,{block:"nearest"})})),e.dispose}),[i,s,o.menuState,o.activeItemIndex]);let u=(0,r.useRef)({disabled:t});R((()=>{u.current.disabled=t}),[u,t]),R((()=>{var e,t;u.current.textValue=null==(t=null==(e=document.getElementById(i))?void 0:e.textContent)?void 0:t.toLowerCase()}),[u,i]),R((()=>(l({type:5,id:i,dataRef:u}),()=>l({type:6,id:i}))),[u,i]);let c=(0,r.useCallback)((e=>t?e.preventDefault():(l({type:1}),I().nextFrame((()=>{var e;return null==(e=o.buttonRef.current)?void 0:e.focus({preventScroll:!0})})),n?n(e):void 0)),[l,o.buttonRef,t,n]),d=(0,r.useCallback)((()=>{if(t)return l({type:2,focus:5});l({type:2,focus:4,id:i})}),[t,i,l]),p=(0,r.useCallback)((()=>{t||s||l({type:2,focus:4,id:i})}),[t,s,i,l]),m=(0,r.useCallback)((()=>{t||!s||l({type:2,focus:5})}),[t,s,l]),f=(0,r.useMemo)((()=>({active:s,disabled:t})),[s,t]);return j({props:{...a,id:i,role:"menuitem",tabIndex:!0===t?void 0:-1,"aria-disabled":!0===t||void 0,disabled:void 0,onClick:c,onFocus:d,onPointerMove:p,onMouseMove:p,onPointerLeave:m,onMouseLeave:m},slot:f,defaultTag:ct,name:"Menu.Item"})};var dt={0:e=>({...e,popoverState:A(e.popoverState,{0:1,1:0})}),1:e=>1===e.popoverState?e:{...e,popoverState:1},2:(e,t)=>e.button===t.button?e:{...e,button:t.button},3:(e,t)=>e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId},4:(e,t)=>e.panel===t.panel?e:{...e,panel:t.panel},5:(e,t)=>e.panelId===t.panelId?e:{...e,panelId:t.panelId}},pt=(0,r.createContext)(null);function mt(e){let t=(0,r.useContext)(pt);if(null===t){let t=new Error(`<${e} /> is missing a parent <${yt.name} /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,mt),t}return t}pt.displayName="PopoverContext";var ft=(0,r.createContext)(null);function bt(e){let t=(0,r.useContext)(ft);if(null===t){let t=new Error(`<${e} /> is missing a parent <${yt.name} /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,bt),t}return t}ft.displayName="PopoverAPIContext";var vt=(0,r.createContext)(null);function xt(){return(0,r.useContext)(vt)}vt.displayName="PopoverGroupContext";var gt=(0,r.createContext)(null);function ht(e,t){return A(t.type,dt,e,t)}function yt(e){let t=`headlessui-popover-button-${O()}`,n=`headlessui-popover-panel-${O()}`,a=(0,r.useReducer)(ht,{popoverState:1,button:null,buttonId:t,panel:null,panelId:n}),[{popoverState:o,button:l,panel:i},s]=a;(0,r.useEffect)((()=>s({type:3,buttonId:t})),[t,s]),(0,r.useEffect)((()=>s({type:5,panelId:n})),[n,s]);let u=(0,r.useMemo)((()=>({buttonId:t,panelId:n,close:()=>s({type:1})})),[t,n,s]),c=xt(),d=null==c?void 0:c.registerPopover,p=(0,r.useCallback)((()=>{var e;return null!=(e=null==c?void 0:c.isFocusWithinPopoverGroup())?e:(null==l?void 0:l.contains(document.activeElement))||(null==i?void 0:i.contains(document.activeElement))}),[c,l,i]);(0,r.useEffect)((()=>null==d?void 0:d(u)),[d,u]),K("focus",(()=>{0===o&&(p()||!l||!i||s({type:1}))}),!0),K("mousedown",(e=>{let t=e.target;0===o&&((null==l?void 0:l.contains(t))||(null==i?void 0:i.contains(t))||(s({type:1}),ce(t,1)||(e.preventDefault(),null==l||l.focus())))}));let m=(0,r.useCallback)((e=>{s({type:1});let t=e?e instanceof HTMLElement?e:e.current instanceof HTMLElement?e.current:l:l;null==t||t.focus()}),[s,l]),f=(0,r.useMemo)((()=>({close:m})),[m]),b=(0,r.useMemo)((()=>({open:0===o,close:m})),[o,m]);return r.createElement(pt.Provider,{value:a},r.createElement(ft.Provider,{value:f},r.createElement(q,{value:A(o,{0:0,1:1})},j({props:e,slot:b,defaultTag:"div",name:"Popover"}))))}gt.displayName="PopoverPanelContext";var wt=B((function(e,t){let[n,a]=mt("Popover.Button"),o=(0,r.useRef)(null),l=xt(),i=null==l?void 0:l.closeOthers,s=(0,r.useContext)(gt),u=null!==s&&s===n.panelId,c=M(o,t,u?null:e=>a({type:2,button:e})),d=M(o,t),p=(0,r.useRef)(null),m=(0,r.useRef)("undefined"==typeof window?null:document.activeElement);K("focus",(()=>{m.current=p.current,p.current=document.activeElement}),!0);let f=(0,r.useCallback)((e=>{var t,r;if(u){if(1===n.popoverState)return;switch(e.key){case" ":case"Enter":e.preventDefault(),e.stopPropagation(),a({type:1}),null==(t=n.button)||t.focus()}}else switch(e.key){case" ":case"Enter":e.preventDefault(),e.stopPropagation(),1===n.popoverState&&(null==i||i(n.buttonId)),a({type:0});break;case"Escape":if(0!==n.popoverState)return null==i?void 0:i(n.buttonId);if(!o.current||!o.current.contains(document.activeElement))return;e.preventDefault(),e.stopPropagation(),a({type:1});break;case"Tab":if(0!==n.popoverState||!n.panel||!n.button)return;if(e.shiftKey){if(!m.current||(null==(r=n.button)?void 0:r.contains(m.current))||n.panel.contains(m.current))return;let t=ue(),a=t.indexOf(m.current);if(t.indexOf(n.button)>a)return;e.preventDefault(),e.stopPropagation(),pe(n.panel,8)}else e.preventDefault(),e.stopPropagation(),pe(n.panel,1)}}),[a,n.popoverState,n.buttonId,n.button,n.panel,o,i,u]),b=(0,r.useCallback)((e=>{var t;if(!u&&(" "===e.key&&e.preventDefault(),0===n.popoverState&&n.panel&&n.button)&&"Tab"===e.key){if(!m.current||(null==(t=n.button)?void 0:t.contains(m.current))||n.panel.contains(m.current))return;let r=ue(),a=r.indexOf(m.current);if(r.indexOf(n.button)>a)return;e.preventDefault(),e.stopPropagation(),pe(n.panel,8)}}),[n.popoverState,n.panel,n.button,u]),v=(0,r.useCallback)((t=>{var r,o;G(t.currentTarget)||e.disabled||(u?(a({type:1}),null==(r=n.button)||r.focus()):(1===n.popoverState&&(null==i||i(n.buttonId)),null==(o=n.button)||o.focus(),a({type:0})))}),[a,n.button,n.popoverState,n.buttonId,e.disabled,i,u]),x=(0,r.useMemo)((()=>({open:0===n.popoverState})),[n]),g=V(e,o);return j({props:{...e,...u?{ref:d,type:g,onKeyDown:f,onClick:v}:{ref:c,id:n.buttonId,type:g,"aria-expanded":e.disabled?void 0:0===n.popoverState,"aria-controls":n.panel?n.panelId:void 0,onKeyDown:f,onKeyUp:b,onClick:v}},slot:x,defaultTag:"button",name:"Popover.Button"})})),Et=B((function(e,t){let[{popoverState:n},a]=mt("Popover.Overlay"),o=M(t),l=`headlessui-popover-overlay-${O()}`,i=Q(),s=null!==i?0===i:0===n;return j({props:{...e,ref:o,id:l,"aria-hidden":!0,onClick:(0,r.useCallback)((e=>{if(G(e.currentTarget))return e.preventDefault();a({type:1})}),[a])},slot:(0,r.useMemo)((()=>({open:0===n})),[n]),defaultTag:"div",features:3,visible:s,name:"Popover.Overlay"})})),kt=B((function(e,t){let{focus:n=!1,...a}=e,[o,l]=mt("Popover.Panel"),{close:i}=bt("Popover.Panel"),s=(0,r.useRef)(null),u=M(s,t,(e=>{l({type:4,panel:e})})),c=Q(),d=null!==c?0===c:0===o.popoverState,p=(0,r.useCallback)((e=>{var t;if("Escape"===e.key){if(0!==o.popoverState||!s.current||!s.current.contains(document.activeElement))return;e.preventDefault(),e.stopPropagation(),l({type:1}),null==(t=o.button)||t.focus()}}),[o,s,l]);(0,r.useEffect)((()=>()=>l({type:4,panel:null})),[l]),(0,r.useEffect)((()=>{var t;e.static||1===o.popoverState&&(null==(t=e.unmount)||t)&&l({type:4,panel:null})}),[o.popoverState,e.unmount,e.static,l]),(0,r.useEffect)((()=>{if(!n||0!==o.popoverState||!s.current)return;let e=document.activeElement;s.current.contains(e)||pe(s.current,1)}),[n,s,o.popoverState]),K("keydown",(e=>{var t;if(!(0===o.popoverState&&s.current&&"Tab"===e.key&&document.activeElement&&s.current&&s.current.contains(document.activeElement)))return;e.preventDefault();let n=pe(s.current,e.shiftKey?2:4);if(3===n)return null==(t=o.button)?void 0:t.focus();if(1===n){if(!o.button)return;let e=ue(),t=e.indexOf(o.button);0===pe(e.splice(t+1).filter((e=>{var t;return!(null==(t=s.current)?void 0:t.contains(e))})),1)&&pe(document.body,1)}})),K("focus",(()=>{var e;!n||0===o.popoverState&&(!s.current||(null==(e=s.current)?void 0:e.contains(document.activeElement))||l({type:1}))}),!0);let m=(0,r.useMemo)((()=>({open:0===o.popoverState,close:i})),[o,i]),f={ref:u,id:o.panelId,onKeyDown:p};return r.createElement(gt.Provider,{value:o.panelId},j({props:{...a,...f},slot:m,defaultTag:"div",features:3,visible:d,name:"Popover.Panel"}))}));yt.Button=wt,yt.Overlay=Et,yt.Panel=kt,yt.Group=function(e){let t=(0,r.useRef)(null),[n,a]=(0,r.useState)([]),o=(0,r.useCallback)((e=>{a((t=>{let n=t.indexOf(e);if(-1!==n){let e=t.slice();return e.splice(n,1),e}return t}))}),[a]),l=(0,r.useCallback)((e=>(a((t=>[...t,e])),()=>o(e))),[a,o]),i=(0,r.useCallback)((()=>{var e;let r=document.activeElement;return!!(null==(e=t.current)?void 0:e.contains(r))||n.some((e=>{var t,n;return(null==(t=document.getElementById(e.buttonId))?void 0:t.contains(r))||(null==(n=document.getElementById(e.panelId))?void 0:n.contains(r))}))}),[t,n]),s=(0,r.useCallback)((e=>{for(let t of n)t.buttonId!==e&&t.close()}),[n]),u=(0,r.useMemo)((()=>({registerPopover:l,unregisterPopover:o,isFocusWithinPopoverGroup:i,closeOthers:s})),[l,o,i,s]),c=(0,r.useMemo)((()=>({})),[]),d={ref:t},p=e;return r.createElement(vt.Provider,{value:u},j({props:{...p,...d},slot:c,defaultTag:"div",name:"Popover.Group"}))};var Ct=(0,r.createContext)(null);function _t(){let e=(0,r.useContext)(Ct);if(null===e){let e=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,_t),e}return e}function It(){let[e,t]=(0,r.useState)([]);return[e.length>0?e.join(" "):void 0,(0,r.useMemo)((()=>function(e){let n=(0,r.useCallback)((e=>(t((t=>[...t,e])),()=>t((t=>{let n=t.slice(),r=n.indexOf(e);return-1!==r&&n.splice(r,1),n})))),[]),a=(0,r.useMemo)((()=>({register:n,slot:e.slot,name:e.name,props:e.props})),[n,e.slot,e.name,e.props]);return r.createElement(Ct.Provider,{value:a},e.children)}),[t])]}function St(e){let{passive:t=!1,...n}=e,r=_t(),a=`headlessui-label-${O()}`;R((()=>r.register(a)),[a,r.register]);let o={...n,...{...r.props,id:a}};return t&&delete o.onClick,j({props:o,slot:r.slot||{},defaultTag:"label",name:r.name||"Label"})}var Rt={0:(e,t)=>({...e,options:[...e.options,{id:t.id,element:t.element,propsRef:t.propsRef}]}),1(e,t){let n=e.options.slice(),r=e.options.findIndex((e=>e.id===t.id));return-1===r?e:(n.splice(r,1),{...e,options:n})}},Nt=(0,r.createContext)(null);function Pt(e){let t=(0,r.useContext)(Nt);if(null===t){let t=new Error(`<${e} /> is missing a parent <${Dt.name} /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Pt),t}return t}function Tt(e,t){return A(t.type,Rt,e,t)}function Dt(e){let{value:t,onChange:n,disabled:a=!1,...o}=e,[{options:l},i]=(0,r.useReducer)(Tt,{options:[]}),[s,u]=It(),[c,d]=Ie(),p=`headlessui-radiogroup-${O()}`,m=(0,r.useRef)(null),f=(0,r.useMemo)((()=>l.find((e=>!e.propsRef.current.disabled))),[l]),b=(0,r.useMemo)((()=>l.some((e=>e.propsRef.current.value===t))),[l,t]),v=(0,r.useCallback)((e=>{var r;if(a||e===t)return!1;let o=null==(r=l.find((t=>t.propsRef.current.value===e)))?void 0:r.propsRef.current;return!(null==o?void 0:o.disabled)&&(n(e),!0)}),[n,t,a,l]);Y({container:m.current,accept:e=>"radio"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT,walk(e){e.setAttribute("role","none")}});let x=(0,r.useCallback)((e=>{if(!m.current)return;let t=l.filter((e=>!1===e.propsRef.current.disabled)).map((e=>e.element.current));switch(e.key){case"ArrowLeft":case"ArrowUp":if(e.preventDefault(),e.stopPropagation(),2===pe(t,18)){let e=l.find((e=>e.element.current===document.activeElement));e&&v(e.propsRef.current.value)}break;case"ArrowRight":case"ArrowDown":if(e.preventDefault(),e.stopPropagation(),2===pe(t,20)){let e=l.find((e=>e.element.current===document.activeElement));e&&v(e.propsRef.current.value)}break;case" ":{e.preventDefault(),e.stopPropagation();let t=l.find((e=>e.element.current===document.activeElement));t&&v(t.propsRef.current.value)}}}),[m,l,v]),g=(0,r.useCallback)((e=>(i({type:0,...e}),()=>i({type:1,id:e.id}))),[i]),h=(0,r.useMemo)((()=>({registerOption:g,firstOption:f,containsCheckedOption:b,change:v,disabled:a,value:t})),[g,f,b,v,a,t]),y={ref:m,id:p,role:"radiogroup","aria-labelledby":s,"aria-describedby":c,onKeyDown:x};return r.createElement(d,{name:"RadioGroup.Description"},r.createElement(u,{name:"RadioGroup.Label"},r.createElement(Nt.Provider,{value:h},j({props:{...o,...y},defaultTag:"div",name:"RadioGroup"}))))}Nt.displayName="RadioGroupContext",Dt.Option=function(e){let t=(0,r.useRef)(null),n=`headlessui-radiogroup-option-${O()}`,[a,o]=It(),[l,i]=Ie(),{addFlag:s,removeFlag:u,hasFlag:c}=function(e=0){let[t,n]=(0,r.useState)(e);return{addFlag:(0,r.useCallback)((e=>n((t=>t|e))),[n]),hasFlag:(0,r.useCallback)((e=>Boolean(t&e)),[t]),removeFlag:(0,r.useCallback)((e=>n((t=>t&~e))),[n]),toggleFlag:(0,r.useCallback)((e=>n((t=>t^e))),[n])}}(1),{value:d,disabled:p=!1,...m}=e,f=(0,r.useRef)({value:d,disabled:p});R((()=>{f.current.value=d}),[d,f]),R((()=>{f.current.disabled=p}),[p,f]);let{registerOption:b,disabled:v,change:x,firstOption:g,containsCheckedOption:h,value:y}=Pt("RadioGroup.Option");R((()=>b({id:n,element:t,propsRef:f})),[n,b,t,e]);let w=(0,r.useCallback)((()=>{var e;!x(d)||(s(2),null==(e=t.current)||e.focus())}),[s,x,d]),E=(0,r.useCallback)((()=>s(2)),[s]),k=(0,r.useCallback)((()=>u(2)),[u]),C=(null==g?void 0:g.id)===n,_=v||p,I=y===d,S={ref:t,id:n,role:"radio","aria-checked":I?"true":"false","aria-labelledby":a,"aria-describedby":l,"aria-disabled":!!_||void 0,tabIndex:_?-1:I||!h&&C?0:-1,onClick:_?void 0:w,onFocus:_?void 0:E,onBlur:_?void 0:k},N=(0,r.useMemo)((()=>({checked:I,disabled:_,active:c(2)})),[I,_,c]);return r.createElement(i,{name:"RadioGroup.Description"},r.createElement(o,{name:"RadioGroup.Label"},j({props:{...m,...S},slot:N,defaultTag:"div",name:"RadioGroup.Option"})))},Dt.Label=St,Dt.Description=Se;var Ot=(0,r.createContext)(null);Ot.displayName="GroupContext";var Ft=r.Fragment;function Lt(e){let{checked:t,onChange:n,...a}=e,o=`headlessui-switch-${O()}`,l=(0,r.useContext)(Ot),i=(0,r.useRef)(null),s=M(i,null===l?null:l.setSwitch),u=(0,r.useCallback)((()=>n(!t)),[n,t]),c=(0,r.useCallback)((e=>{if(G(e.currentTarget))return e.preventDefault();e.preventDefault(),u()}),[u]),d=(0,r.useCallback)((e=>{"Tab"!==e.key&&e.preventDefault()," "===e.key&&u()}),[u]),p=(0,r.useCallback)((e=>e.preventDefault()),[]),m=(0,r.useMemo)((()=>({checked:t})),[t]);return j({props:{...a,id:o,ref:s,role:"switch",type:V(e,i),tabIndex:0,"aria-checked":t,"aria-labelledby":null==l?void 0:l.labelledby,"aria-describedby":null==l?void 0:l.describedby,onClick:c,onKeyUp:d,onKeyPress:p},slot:m,defaultTag:"button",name:"Switch"})}Lt.Group=function(e){let[t,n]=(0,r.useState)(null),[a,o]=It(),[l,i]=Ie(),s=(0,r.useMemo)((()=>({switch:t,setSwitch:n,labelledby:a,describedby:l})),[t,n,a,l]);return r.createElement(i,{name:"Switch.Description"},r.createElement(o,{name:"Switch.Label",props:{onClick(){!t||(t.click(),t.focus({preventScroll:!0}))}}},r.createElement(Ot.Provider,{value:s},j({props:e,defaultTag:Ft,name:"Switch.Group"}))))},Lt.Label=St,Lt.Description=Se;var Mt={0:(e,t)=>e.selectedIndex===t.index?e:{...e,selectedIndex:t.index},1:(e,t)=>e.orientation===t.orientation?e:{...e,orientation:t.orientation},2:(e,t)=>e.activation===t.activation?e:{...e,activation:t.activation},3:(e,t)=>e.tabs.includes(t.tab)?e:{...e,tabs:[...e.tabs,t.tab]},4:(e,t)=>({...e,tabs:e.tabs.filter((e=>e!==t.tab))}),5:(e,t)=>e.panels.includes(t.panel)?e:{...e,panels:[...e.panels,t.panel]},6:(e,t)=>({...e,panels:e.panels.filter((e=>e!==t.panel))}),7:e=>({...e})},At=(0,r.createContext)(null);function jt(e){let t=(0,r.useContext)(At);if(null===t){let t=new Error(`<${e} /> is missing a parent <Tab.Group /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,jt),t}return t}function $t(e,t){return A(t.type,Mt,e,t)}At.displayName="TabsContext";var Bt=r.Fragment;function Wt(e){var t,n;let a=`headlessui-tabs-tab-${O()}`,[{selectedIndex:o,tabs:l,panels:i,orientation:s,activation:u},{dispatch:c,change:d}]=jt(Wt.name),p=(0,r.useRef)(null),m=M(p,(e=>{!e||c({type:7})}));R((()=>(c({type:3,tab:p}),()=>c({type:4,tab:p}))),[c,p]);let f=l.indexOf(p),b=f===o,v=(0,r.useCallback)((e=>{let t=l.map((e=>e.current)).filter(Boolean);if(" "===e.key||"Enter"===e.key)return e.preventDefault(),e.stopPropagation(),void d(f);switch(e.key){case"Home":case"PageUp":return e.preventDefault(),e.stopPropagation(),pe(t,1);case"End":case"PageDown":return e.preventDefault(),e.stopPropagation(),pe(t,8)}return A(s,{vertical:()=>"ArrowUp"===e.key?pe(t,18):"ArrowDown"===e.key?pe(t,20):void 0,horizontal:()=>"ArrowLeft"===e.key?pe(t,18):"ArrowRight"===e.key?pe(t,20):void 0})}),[l,s,f,d]),x=(0,r.useCallback)((()=>{var e;null==(e=p.current)||e.focus()}),[p]),g=(0,r.useCallback)((()=>{var e;null==(e=p.current)||e.focus(),d(f)}),[d,f,p]),h=(0,r.useMemo)((()=>({selected:b})),[b]),y={ref:m,onKeyDown:v,onFocus:"manual"===u?x:g,onClick:g,id:a,role:"tab",type:V(e,p),"aria-controls":null==(n=null==(t=i[f])?void 0:t.current)?void 0:n.id,"aria-selected":b,tabIndex:b?0:-1};return j({props:{...e,...y},slot:h,defaultTag:"button",name:"Tabs.Tab"})}function Ut(e,...t){e&&t.length>0&&e.classList.add(...t)}function Gt(e,...t){e&&t.length>0&&e.classList.remove(...t)}function Kt(e,t,n,r,a,o){let l=I(),i=void 0!==o?function(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}(o):()=>{};return Gt(e,...a),Ut(e,...t,...n),l.nextFrame((()=>{Gt(e,...n),Ut(e,...r),l.add(function(e,t){let n=I();if(!e)return n.dispose;let{transitionDuration:r,transitionDelay:a}=getComputedStyle(e),[o,l]=[r,a].map((e=>{let[t=0]=e.split(",").filter(Boolean).map((e=>e.includes("ms")?parseFloat(e):1e3*parseFloat(e))).sort(((e,t)=>t-e));return t}));return 0!==o?n.setTimeout((()=>{t("finished")}),o+l):t("finished"),n.add((()=>t("cancelled"))),n.dispose}(e,(n=>(Gt(e,...r,...t),Ut(e,...a),i(n)))))})),l.add((()=>Gt(e,...t,...n,...r,...a))),l.add((()=>i("cancelled"))),l.dispose}function Ht(e=""){return(0,r.useMemo)((()=>e.split(" ").filter((e=>e.trim().length>1))),[e])}Wt.Group=function(e){let{defaultIndex:t=0,vertical:n=!1,manual:a=!1,onChange:o,selectedIndex:l=null,...i}=e,s=n?"vertical":"horizontal",u=a?"manual":"auto",[c,d]=(0,r.useReducer)($t,{selectedIndex:null,tabs:[],panels:[],orientation:s,activation:u}),p=(0,r.useMemo)((()=>({selectedIndex:c.selectedIndex})),[c.selectedIndex]),m=(0,r.useRef)((()=>{}));(0,r.useEffect)((()=>{d({type:1,orientation:s})}),[s]),(0,r.useEffect)((()=>{d({type:2,activation:u})}),[u]),(0,r.useEffect)((()=>{"function"==typeof o&&(m.current=o)}),[o]),(0,r.useEffect)((()=>{if(c.tabs.length<=0||null===l&&null!==c.selectedIndex)return;let e=c.tabs.map((e=>e.current)).filter(Boolean),n=e.filter((e=>!e.hasAttribute("disabled"))),r=null!=l?l:t;if(r<0)d({type:0,index:e.indexOf(n[0])});else if(r>c.tabs.length)d({type:0,index:e.indexOf(n[n.length-1])});else{let t=e.slice(0,r),a=[...e.slice(r),...t].find((e=>n.includes(e)));if(!a)return;d({type:0,index:e.indexOf(a)})}}),[t,l,c.tabs,c.selectedIndex]);let f=(0,r.useRef)(c.selectedIndex);(0,r.useEffect)((()=>{f.current=c.selectedIndex}),[c.selectedIndex]);let b=(0,r.useMemo)((()=>[c,{dispatch:d,change(e){f.current!==e&&m.current(e),f.current=e,d({type:0,index:e})}}]),[c,d]);return r.createElement(At.Provider,{value:b},j({props:{...i},slot:p,defaultTag:Bt,name:"Tabs"}))},Wt.List=function(e){let[{selectedIndex:t,orientation:n}]=jt("Tab.List");return j({props:{...e,role:"tablist","aria-orientation":n},slot:{selectedIndex:t},defaultTag:"div",name:"Tabs.List"})},Wt.Panels=function(e){let[{selectedIndex:t}]=jt("Tab.Panels");return j({props:e,slot:(0,r.useMemo)((()=>({selectedIndex:t})),[t]),defaultTag:"div",name:"Tabs.Panels"})},Wt.Panel=function(e){var t,n;let[{selectedIndex:a,tabs:o,panels:l},{dispatch:i}]=jt("Tab.Panel"),s=`headlessui-tabs-panel-${O()}`,u=(0,r.useRef)(null),c=M(u,(e=>{!e||i({type:7})}));R((()=>(i({type:5,panel:u}),()=>i({type:6,panel:u}))),[i,u]);let d=l.indexOf(u),p=d===a,m=(0,r.useMemo)((()=>({selected:p})),[p]);return j({props:{...e,ref:c,id:s,role:"tabpanel","aria-labelledby":null==(n=null==(t=o[d])?void 0:t.current)?void 0:n.id,tabIndex:p?0:-1},slot:m,defaultTag:"div",features:3,visible:p,name:"Tabs.Panel"})};var Qt=(0,r.createContext)(null);Qt.displayName="TransitionContext";var qt=(0,r.createContext)(null);function zt(e){return"children"in e?zt(e.children):e.current.filter((({state:e})=>"visible"===e)).length>0}function Vt(e){let t=(0,r.useRef)(e),n=(0,r.useRef)([]),a=me();(0,r.useEffect)((()=>{t.current=e}),[e]);let o=(0,r.useCallback)(((e,r=1)=>{var o;let l=n.current.findIndex((({id:t})=>t===e));-1!==l&&(A(r,{0(){n.current.splice(l,1)},1(){n.current[l].state="hidden"}}),!zt(n)&&a.current&&(null==(o=t.current)||o.call(t)))}),[t,a,n]),l=(0,r.useCallback)((e=>{let t=n.current.find((({id:t})=>t===e));return t?"visible"!==t.state&&(t.state="visible"):n.current.push({id:e,state:"visible"}),()=>o(e,0)}),[n,o]);return(0,r.useMemo)((()=>({children:n,register:l,unregister:o})),[l,o,n])}function Yt(){}qt.displayName="NestingContext";var Jt=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function Xt(e){var t;let n={};for(let r of Jt)n[r]=null!=(t=e[r])?t:Yt;return n}function Zt(e){let{beforeEnter:t,afterEnter:n,beforeLeave:a,afterLeave:o,enter:l,enterFrom:i,enterTo:s,entered:u,leave:c,leaveFrom:d,leaveTo:p,...m}=e,f=(0,r.useRef)(null),[b,v]=(0,r.useState)("visible"),x=m.unmount?0:1,{show:g,appear:h,initial:y}=function(){let e=(0,r.useContext)(Qt);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),{register:w,unregister:E}=function(){let e=(0,r.useContext)(qt);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),k=O(),C=(0,r.useRef)(!1),_=Vt((()=>{C.current||(v("hidden"),E(k),M.current.afterLeave())}));R((()=>{if(k)return w(k)}),[w,k]),R((()=>{if(1===x&&k){if(g&&"visible"!==b)return void v("visible");A(b,{hidden:()=>E(k),visible:()=>w(k)})}}),[b,k,w,E,g,x]);let I=Ht(l),S=Ht(i),N=Ht(s),T=Ht(u),D=Ht(c),F=Ht(d),L=Ht(p),M=function(e){let t=(0,r.useRef)(Xt(e));return(0,r.useEffect)((()=>{t.current=Xt(e)}),[e]),t}({beforeEnter:t,afterEnter:n,beforeLeave:a,afterLeave:o}),$=P();(0,r.useEffect)((()=>{if($&&"visible"===b&&null===f.current)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")}),[f,b,$]);let B=y&&!h;R((()=>{let e=f.current;if(e&&!B)return C.current=!0,g&&M.current.beforeEnter(),g||M.current.beforeLeave(),g?Kt(e,I,S,N,T,(e=>{C.current=!1,"finished"===e&&M.current.afterEnter()})):Kt(e,D,F,L,T,(e=>{C.current=!1,"finished"===e&&(zt(_)||(v("hidden"),E(k),M.current.afterLeave()))}))}),[M,k,C,E,_,f,B,g,I,S,N,D,F,L]);let W={ref:f},U=m;return r.createElement(qt.Provider,{value:_},r.createElement(q,{value:A(b,{visible:0,hidden:1})},j({props:{...U,...W},defaultTag:"div",features:1,visible:"visible"===b,name:"Transition.Child"})))}function en(e){let{show:t,appear:n=!1,unmount:a,...o}=e,l=Q();if(void 0===t&&null!==l&&(t=A(l,{0:!0,1:!1})),![!0,!1].includes(t))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[i,s]=(0,r.useState)(t?"visible":"hidden"),u=Vt((()=>{s("hidden")})),c=function(){let e=(0,r.useRef)(!0);return(0,r.useEffect)((()=>{e.current=!1}),[]),e.current}(),d=(0,r.useMemo)((()=>({show:t,appear:n||!c,initial:c})),[t,n,c]);(0,r.useEffect)((()=>{t?s("visible"):zt(u)||s("hidden")}),[t,u]);let p={unmount:a};return r.createElement(qt.Provider,{value:u},r.createElement(Qt.Provider,{value:d},j({props:{...p,as:r.Fragment,children:r.createElement(Zt,{...p,...o})},defaultTag:r.Fragment,features:1,visible:"visible"===i,name:"Transition"})))}en.Child=function(e){let t=null!==(0,r.useContext)(Qt),n=null!==Q();return!t&&n?r.createElement(en,{...e}):r.createElement(Zt,{...e})},en.Root=en;var tn=window.wp.apiFetch,nn=t.n(tn);function rn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter(Boolean).join(" ")}var an=function(){const[e,t]=(0,r.useState)(!1),[a,o]=(0,r.useState)(onboarding_vars.available_gateways),l=g();return(0,n.createElement)("main",{className:"mt-4 mb-4 mx-auto w-auto max-w-7xl px-4 sm:mt-6 sm:px-6 md:mt-8 lg:mt-10 lg:px-8 xl:mt-16"},(0,n.createElement)("div",{className:"text-center"},(0,n.createElement)("p",{className:"mt-3 text-base text-gray-500 sm:mt-5 sm:text-lg sm:mx-auto md:mt-5 md:text-xl lg:mx-0"},(0,n.createElement)("span",{className:"block"},(0,n.createElement)("span",{className:"text-gray-700 inline font-bold"},(0,k.__)("Congratulations!!","checkout-plugins-stripe-woo")," "),(0,k.__)("You are connected to Stripe successfully.","checkout-plugins-stripe-woo")),(0,n.createElement)("span",{className:"block"},(0,k.__)("Let's enable gateways","checkout-plugins-stripe-woo"))),(0,n.createElement)("ul",{role:"list",className:"divide-y divide-gray-200 bg-white overflow-hidden sm:rounded-md mt-10 max-w-screen-md mx-auto"},a.map((e=>(0,n.createElement)("li",{key:e.id},(0,n.createElement)("span",{href:"#",className:"block hover:bg-gray-50"},(0,n.createElement)("div",{className:"flex items-center px-4 py-4 sm:px-6"},(0,n.createElement)("div",{className:"min-w-0 flex-1 flex items-center"},(0,n.createElement)("div",{className:"flex-shrink-0"},(0,n.createElement)("img",{className:"h-12 w-32 max-w-80",src:e.icon,alt:e.name})),(0,n.createElement)("div",{className:"min-w-0 flex-1 px-4 md:gap-4"},(0,n.createElement)("div",null,(0,n.createElement)("p",{className:"text-sm font-medium text-cart-500 flex truncate"},e.name," ",e.recommended?(0,n.createElement)("span",{className:"ml-2 px-2 py-1 text-green-800 text-xs font-medium bg-green-100 rounded-full"},(0,k.__)("Recommended","checkout-plugins-stripe-woo")):""),(0,n.createElement)("p",{className:"text-sm font-medium text-gray-400 flex"},(0,n.createElement)("span",{className:"text-left text-sm"},"all"===e.currencies?(0,k.__)("Works with all currencies","checkout-plugins-stripe-woo"):(0,k.__)("Works with ","checkout-plugins-stripe-woo")+e.currencies))))),(0,n.createElement)("div",null,(0,n.createElement)(Lt,{checked:e.enabled,value:e.enabled,name:e.id,onChange:()=>{e.enabled=!e.enabled,o([...a])},className:rn(e.enabled?"bg-cart-500 ":"bg-gray-200","relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-cart-500")},(0,n.createElement)("span",{className:"sr-only"},e.id),(0,n.createElement)("span",{"aria-hidden":"true",className:rn(e.enabled?"translate-x-5":"translate-x-0","pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow transform ring-0 transition ease-in-out duration-200")}))))))))),(0,n.createElement)("div",{className:"mt-5 sm:mt-8 sm:inline-block lg:inline-block sm:justify-center lg:justify-center"},(0,n.createElement)("div",{className:"rounded-md shadow"},e?(0,n.createElement)("button",{className:"disabled w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-wait"},(0,k.__)("Enabling…","checkout-plugins-stripe-woo"),(0,n.createElement)(C,null)):(0,n.createElement)("button",{onClick:function(e){e.preventDefault(),t(!0);const n=new window.FormData,r={};a.forEach((function(e){r[e.id]=document.getElementsByName(e.id)[0].value}));const o=JSON.stringify(r);n.append("formdata",o),n.append("action","cpsw_onboarding_enable_gateway"),n.append("security",onboarding_vars.cpsw_onboarding_enable_gateway),nn()({url:onboarding_vars.ajax_url,method:"POST",body:n}).then((e=>{e.success&&(!0===e.data.activated_gateways.cpsw_stripe?l(onboarding_vars.navigator_base+"&cpsw_call=express-checkout"):l(onboarding_vars.navigator_base+"&cpsw_call=webhooks"))}))},className:"w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-pointer"},(0,k.__)("Enable Gateways","checkout-plugins-stripe-woo"))))))},on=function(){const[e,t]=(0,r.useState)(!1),[a,o]=(0,r.useState)(onboarding_vars.get_webhook_secret),l=[{id:"test",name:(0,k.__)("Test","cart-plugin")},{id:"live",name:(0,k.__)("Live","cart-plugin")}],i=Object.keys(l).find((e=>l[e].id===onboarding_vars.get_payment_mode)),[s,u]=(0,r.useState)(l[i]),c=g();return(0,n.createElement)("main",{className:"mt-4 mb-4 mx-auto w-auto max-w-7xl px-4 sm:mt-6 sm:px-6 md:mt-8 lg:mt-10 lg:px-8 xl:mt-16"},(0,n.createElement)("div",{className:"text-center"},(0,n.createElement)("h1",{className:"text-4xl tracking-tight font-extrabold text-gray-900 sm:text-5xl md:text-6xl"},(0,n.createElement)("span",{className:"block text-cart-500 xl:inline"},(0,k.__)("This is important!!","checkout-plugins-stripe-woo"))),(0,n.createElement)("h3",{className:"text-2xl tracking-tight mt-5 font-bold text-gray-700"},(0,n.createElement)("span",{className:"block xl:inline"},(0,k.__)("Enable Webhooks","checkout-plugins-stripe-woo"))),(0,n.createElement)("p",{className:"mt-2 text-sm mb-5 text-gray-500 sm:mt-2 sm:text-xl sm:mx-auto md:mt-2 md:text-xl lg:mx-0"},(0,n.createElement)("span",{className:"block xl:inline font-bold select-none text-gray-700"},(0,k.__)("Webhook URL","checkout-plugins-stripe-woo"),": ")," ",(0,n.createElement)("span",{className:"block xl:inline font-bold select-text"},onboarding_vars.webhook_url)),(0,n.createElement)("div",{className:"block mx-auto mt-2 mb-5 w-full md:w-6/12 lg:w-6/12"},(0,n.createElement)("p",{className:"mt-2 text-sm text-gray-400 sm:mt-2 sm:text-sm sm:mx-auto md:mt-2 md:text-md lg:mx-0"},(0,n.createElement)("span",{className:"block"}," ",(0,k.__)("The webhook URL is called by","checkout-plugins-stripe-woo")," ",(0,n.createElement)("span",{className:"block text-gray-700 xl:inline font-bold"},(0,k.__)("Stripe","checkout-plugins-stripe-woo"),","),(0,k.__)(" when events occur in your account, like a source becomes chargeable.","checkout-plugins-stripe-woo")," ",(0,n.createElement)("a",{href:"https://checkoutplugins.com/docs/stripe-card-payments/#webhook",target:"_blank",rel:"noreferrer"},(0,n.createElement)("span",{className:"block xl:inline font-bold text-cart-500"},(0,k.__)("Webhook Guide","checkout-plugins-stripe-woo")))," ",(0,k.__)("or create webhook secret on","checkout-plugins-stripe-woo")," ",(0,n.createElement)("a",{href:"https://dashboard.stripe.com/webhooks/create",target:"_blank",rel:"noreferrer"},(0,n.createElement)("span",{className:"block text-cart-500 xl:inline font-bold"},(0,k.__)("Stripe Dashboard","checkout-plugins-stripe-woo"))),".")),(0,n.createElement)("p",{className:"text-left mt-3 text-sm text-gray-400 sm:mt-5 sm:text-sm sm:mx-auto md:mt-5 md:text-md lg:mx-0"},(0,n.createElement)("span",{className:"block text-gray-700 xl:inline font-bold"}," ",(0,k.__)("This is the list of the supported webhook events: ","checkout-plugins-stripe-woo")," ")),(0,n.createElement)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-2 gap-1 text-left"},(0,n.createElement)("div",null,(0,n.createElement)("ul",{className:"list-disc mt-3 pl-4 text-sm text-gray-400"},(0,n.createElement)("li",null,"charge.captured"),(0,n.createElement)("li",null,"charge.refunded"),(0,n.createElement)("li",null,"charge.dispute.created"),(0,n.createElement)("li",null,"charge.dispute.closed"),(0,n.createElement)("li",null,"payment_intent.succeeded"))),(0,n.createElement)("div",null,(0,n.createElement)("ul",{className:"list-disc md:mt-3 lg:mt-3 pl-4 text-sm text-gray-400"},(0,n.createElement)("li",null,"payment_intent.amount_capturable_updated"),(0,n.createElement)("li",null,"payment_intent.payment_failed"),(0,n.createElement)("li",null,"review.opened"),(0,n.createElement)("li",null,"review.closed"))))),(0,n.createElement)("div",{className:"block mx-auto mt-5 mb-5 w-full md:w-6/12 lg:w-6/12"},(0,n.createElement)("span",{className:"block text-gray-700 font-bold text-left"},(0,k.__)("Select Mode","checkout-plugins-stripe-woo")),(0,n.createElement)(Ze,{value:s,onChange:u},(0,n.createElement)("div",{className:"relative mt-1"},(0,n.createElement)(Ze.Button,{className:"relative w-full py-2 pl-3 pr-10 h-12 text-left bg-white rounded appearance-none border shadow cursor-default focus:outline-none focus-visible:ring-2 focus-visible:ring-opacity-75 focus-visible:ring-white focus-visible:ring-offset-orange-300 focus-visible:ring-offset-2 focus-visible:border-indigo-500 sm:text-sm"},(0,n.createElement)("span",{className:"block truncate"},s.name),(0,n.createElement)("span",{className:"absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none"},(0,n.createElement)("span",{className:"dashicons dashicons-arrow-down-alt2"}))),(0,n.createElement)(en,{as:r.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0"},(0,n.createElement)(Ze.Options,{className:"absolute w-full py-1 mt-1 z-40 text-left overflow-auto text-base bg-white rounded border shadow max-h-60 ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm"},l.map(((e,t)=>(0,n.createElement)(Ze.Option,{key:t,className:e=>{let{active:t}=e;return(t?" text-gray-500 bg-wpcolor":"text-gray-900")+"\n\t\t\t\t\t\t\t\tcursor-default select-none relative py-1 pl-4"},value:e},(t=>{let{active:a}=t;return(0,n.createElement)(r.Fragment,null,(0,n.createElement)("span",{className:(s?"font-medium":"font-normal")+" block"},e.name),s?(0,n.createElement)("span",{className:(a?"text-wpcolor":"text-wpcolor20")+"\n\t\t\t\t\t\t\t\t\t\tabsolute inset-y-0 left-0 flex items-center pl-3"}):null)})))))))),(0,n.createElement)("input",{type:"hidden",name:"cpsw_mode",id:"cpsw_mode",value:s.id})),(0,n.createElement)("div",{className:"w-full md:w-6/12 lg:w-6/12 block mx-auto mt-5 mb-5"},(0,n.createElement)("span",{className:"block text-gray-700 font-bold text-left"},s.name," ",(0,k.__)("Webhook Secret","checkout-plugins-stripe-woo")),(0,n.createElement)("p",{className:"mt-2 text-sm text-gray-400 sm:mt-2 sm:text-sm sm:mx-auto md:mt-2 md:text-md lg:mx-0"},(0,n.createElement)("input",{type:"text",value:a,onChange:function(e){o(e.target.value)},name:"webhook_secret",id:"cpsw_webhook_secret",placeholder:(0,k.__)("Enter key here","checkout-plugins-stripe-woo"),className:"w-full shadow appearance-none border rounded h-12 py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"}),(0,n.createElement)("span",{className:"block mt-3"}," ",(0,k.__)("The webhook secret is used to authenticate webhooks sent from Stripe. It ensures nobody else can send you events pretending to be Stripe","checkout-plugins-stripe-woo"),"."))),(0,n.createElement)("div",{className:"sm:inline-block lg:inline-block sm:justify-center lg:justify-center"},(0,n.createElement)("div",{className:"rounded-md shadow"},e?(0,n.createElement)("button",{className:"disabled w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-wait"},(0,k.__)("Saving…","checkout-plugins-stripe-woo"),(0,n.createElement)(C,null)):(0,n.createElement)("button",{onClick:function(){const e=new window.FormData;e.append("action","cpsw_onboarding_enable_webhooks");const n=document.getElementById("cpsw_webhook_secret").value,r=document.getElementById("cpsw_mode").value;if(""===n)return window.alert((0,k.__)("Webhook Secret field is Required.","checkout-plugins-stripe-woo")),!1;t(!0),e.append("webhook_secret",n),e.append("cpsw_mode",r),e.append("security",onboarding_vars.cpsw_onboarding_enable_webhooks),nn()({url:onboarding_vars.ajax_url,method:"POST",body:e}).then((e=>{e.success&&c(onboarding_vars.navigator_base+"&cpsw_call=thank-you")}))},className:"w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-pointer"},(0,k.__)("Save & Continue","checkout-plugins-stripe-woo"))),(0,n.createElement)("div",{className:"mt-3 sm:mt-0"},(0,n.createElement)("a",{href:onboarding_vars.base_url+"&cpsw_call=thank-you",className:"w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-slate-300 md:py-4 md:text-lg md:px-10"},(0,k.__)("Skip","checkout-plugins-stripe-woo"))))))},ln=function(){const[e,t]=(0,r.useState)(!1),a=g();return(0,n.createElement)("main",{className:"mt-10 mx-auto w-auto max-w-7xl px-4 sm:mt-12 sm:px-6 md:mt-16 lg:mt-20 lg:px-8 xl:mt-28"},(0,n.createElement)("div",{className:"text-center"},(0,n.createElement)("h1",{className:"text-4xl tracking-tight font-extrabold text-gray-900 sm:text-5xl md:text-6xl"},(0,n.createElement)("span",{className:"block xl"},(0,k.__)("Wooho!!","checkout-plugins-stripe-woo")),(0,n.createElement)("span",{className:"block text-cart-500 xl:inline"},(0,k.__)("You are almost done.","checkout-plugins-stripe-woo"))),(0,n.createElement)("p",{className:"mt-3 text-base text-gray-500 sm:mt-5 sm:text-lg sm:mx-auto md:mt-5 md:text-xl lg:mx-0"},(0,n.createElement)("span",{className:"block"}," ",(0,k.__)("Since you have enabled","checkout-plugins-stripe-woo")," ",(0,n.createElement)("span",{className:"block text-gray-700 xl:inline font-bold"},(0,k.__)("Stripe Card Processing","checkout-plugins-stripe-woo"),","),(0,k.__)(" We recommend you to enable","checkout-plugins-stripe-woo")," ",(0,n.createElement)("span",{className:"block text-gray-700 xl:inline font-bold"},(0,k.__)("Express Checkout","checkout-plugins-stripe-woo"))," ",(0,k.__)("feature","checkout-plugins-stripe-woo"),"."),(0,n.createElement)("span",null,(0,k.__)("Express Checkout generates more conversions!!","checkout-plugins-stripe-woo"))),(0,n.createElement)("div",{className:"block mx-auto mt-1 mb-1"},(0,n.createElement)("img",{className:"inline mx-4 py-5 h-24",src:onboarding_vars.assets_url+"images/apple-pay.svg",alt:"Express Checkout"}),(0,n.createElement)("img",{className:"inline mx-4 py-5 h-24",src:onboarding_vars.assets_url+"images/gpay.svg",alt:"Express Checkout"})),(0,n.createElement)("div",{className:"sm:inline-block lg:inline-block sm:justify-center lg:justify-center"},(0,n.createElement)("div",{className:"rounded-md shadow"},e?(0,n.createElement)("button",{className:"disabled w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-wait"},(0,k.__)("Enabling…","checkout-plugins-stripe-woo"),(0,n.createElement)(C,null)):(0,n.createElement)("button",{onClick:function(){t(!0);const e=new window.FormData;e.append("action","cpsw_onboarding_enable_express_checkout"),e.append("security",onboarding_vars.cpsw_onboarding_enable_express_checkout),nn()({url:onboarding_vars.ajax_url,method:"POST",body:e}).then((e=>{e.success&&a(onboarding_vars.navigator_base+"&cpsw_call=webhooks")}))},className:"w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-pointer"},(0,k.__)("Enable Express Checkout","checkout-plugins-stripe-woo"))),(0,n.createElement)("div",{className:"mt-3 sm:mt-0 sm:ml-3"},(0,n.createElement)("a",{href:onboarding_vars.base_url+"&cpsw_call=webhooks",className:"w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-slate-300 md:py-4 md:text-lg md:px-10"},(0,k.__)("Skip Express Checkout","checkout-plugins-stripe-woo"))))))},sn=function(){return(0,n.createElement)("main",{className:"mt-10 mx-auto w-auto max-w-7xl px-4 sm:mt-12 sm:px-6 md:mt-14 lg:mt-16 lg:px-8 xl:mt-18"},(0,n.createElement)("div",{className:"text-center"},(0,n.createElement)("h1",{className:"text-4xl tracking-tight font-extrabold text-gray-900 sm:text-5xl md:text-6xl"},(0,n.createElement)("span",{className:"block text-red-600 xl:inline"},(0,k.__)("Failed!!","checkout-plugins-stripe-woo"))),(0,n.createElement)("p",{className:"mt-3 text-base text-gray-500 sm:mt-5 sm:text-lg sm:mx-auto md:mt-5 md:text-xl lg:mx-0"},(0,n.createElement)("span",{className:"block"},(0,k.__)("Unfortunately Connection to Stripe failed.","checkout-plugins-stripe-woo"))),(0,n.createElement)("div",{className:"mt-5 sm:mt-8 sm:inline-block lg:inline-block sm:justify-center lg:justify-center"},(0,n.createElement)("div",{className:"rounded-md shadow"},(0,n.createElement)("a",{href:onboarding_vars.authorization_url,className:"w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10"},(0,k.__)("Try Again","checkout-plugins-stripe-woo"))),(0,n.createElement)("div",{className:"mt-3 sm:mt-0 sm:ml-3"},(0,n.createElement)("a",{href:onboarding_vars.manual_connect_url,className:"w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-slate-300 md:py-4 md:text-lg md:px-10"},(0,k.__)("Manage API keys manually","checkout-plugins-stripe-woo"))))))},un=function(){const[e,t]=(0,r.useState)(!1);return(0,n.createElement)("main",{className:"mt-10 mx-auto w-auto max-w-7xl px-4 sm:mt-12 sm:px-6 md:mt-14 lg:mt-16 lg:px-8 xl:mt-18"},(0,n.createElement)("div",{className:"text-center"},(0,n.createElement)("h1",{className:"text-4xl tracking-tight font-extrabold text-gray-900 sm:text-5xl md:text-6xl"},(0,n.createElement)("span",{className:"block text-cart-500 xl:inline"},(0,k.__)("Great!!","checkout-plugins-stripe-woo"))),(0,n.createElement)("p",{className:"mt-3 text-base text-gray-500 sm:mt-5 sm:text-lg sm:mx-auto md:mt-5 md:text-xl lg:mx-0"},(0,n.createElement)("span",{className:"block"},(0,k.__)("Your store is all set to accept payment.","checkout-plugins-stripe-woo")),(0,n.createElement)("span",null,(0,k.__)("We provide lots of customization options to match your needs, don't forget to explore them.","checkout-plugins-stripe-woo"))),(0,n.createElement)("div",{className:"mt-5 sm:mt-8 sm:inline-block lg:inline-block sm:justify-center lg:justify-center"},(0,n.createElement)("div",{className:"rounded-md shadow"},e?(0,n.createElement)("button",{className:"disabled w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-wait"},(0,k.__)("Let's Customize…","checkout-plugins-stripe-woo"),(0,n.createElement)(C,null)):(0,n.createElement)("button",{onClick:function(){t(!0),window.location.replace(onboarding_vars.gateways_url)},className:"w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-pointer"},(0,k.__)("Let's Customize","checkout-plugins-stripe-woo"))))))},cn=function(){""!==onboarding_vars.woocommerce_installed&&""!==onboarding_vars.woocommerce_activated&&window.location.replace(onboarding_vars.navigator_base);const[e,t]=(0,r.useState)(""),[a,o]=(0,r.useState)(!1),[l,i]=(0,r.useState)(!1);return(0,n.createElement)("main",{className:"mt-10 mx-auto max-w-7xl px-4 sm:mt-12 sm:px-6 md:mt-16 lg:mt-20 lg:px-8 xl:mt-28"},(0,n.createElement)("div",{className:"text-center"},(0,n.createElement)("h1",{className:"text-4xl tracking-tight font-extrabold text-gray-900 sm:text-5xl md:text-6xl"},(0,n.createElement)("span",{className:"block xl"},""===onboarding_vars.woocommerce_installed?(0,k.__)("Missing","checkout-plugins-stripe-woo"):(0,k.__)("Inactiave","checkout-plugins-stripe-woo")),(0,n.createElement)("span",{className:"block text-cart-500 xl:inline"},(0,k.__)("WooCoomerce","checkout-plugins-stripe-woo"))),(0,n.createElement)("p",{className:"mt-6 text-base justify-center text-gray-500 sm:mt-5 sm:text-lg sm:w-full sm:mx-auto md:mt-5 md:text-xl lg:mx-0"},(0,n.createElement)("span",{className:"block text-gray-700 xl:inline font-bold"},(0,k.__)("Checkout Plugins - Stripe for WooCoomerce","checkout-plugins-stripe-woo"))," ",(0,k.__)("requires","checkout-plugins-stripe-woo")," ",(0,n.createElement)("span",{className:"block text-gray-700 xl:inline font-bold"},(0,k.__)("WooCommerce","checkout-plugins-stripe-woo"))," ",(0,k.__)("to be active on your store.","checkout-plugins-stripe-woo")),(0,n.createElement)("div",{className:"mt-5 sm:mt-8 sm:flex justify-center"},(0,n.createElement)("div",{className:"rounded-md shadow"},"installing"===e?(0,n.createElement)("button",{className:"disabled w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-wait"},(0,k.__)("Installing…","checkout-plugins-stripe-woo"),(0,n.createElement)(C,null)):"activating"===e?(0,n.createElement)("button",{className:"disabled w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-wait"},(0,k.__)("Activating…","checkout-plugins-stripe-woo"),(0,n.createElement)(C,null)):(0,n.createElement)("button",{onClick:function(){if(""===onboarding_vars.woocommerce_installed)t("installing"),setTimeout((()=>{o(!0)}),1e4),wp.updates.queue.push({action:"install-plugin",data:{slug:"woocommerce"}}),wp.updates.queueChecker();else{t("activating");const e=new window.FormData;e.append("action","cpsw_onboarding_install_woocommerce"),e.append("security",onboarding_vars.cpsw_onboarding_install_woocommerce),nn()({url:onboarding_vars.ajax_url,method:"POST",body:e}).then((e=>{e.success?window.location.replace(onboarding_vars.onboarding_base):i(!0)}))}},className:"install-dependency w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-pointer"},""===onboarding_vars.woocommerce_installed?(0,k.__)("Install and continue","checkout-plugins-stripe-woo"):(0,k.__)("Activate and continue","checkout-plugins-stripe-woo"))))),a?(0,n.createElement)("div",{className:"bg-cart-50 p-4 fixed left-0 top-0 right-0 transition ease-in-out delay-150"},(0,n.createElement)("div",{className:"block"},(0,n.createElement)("div",{className:"text-center justify-center"},(0,n.createElement)("p",{className:"text-sm mx-auto w-full text-cart-500 text-center"},(0,k.__)("Installing WooCommerce will take time. Please be patient.","checkout-plugins-stripe-woo"))))):"",l?(0,n.createElement)("div",{className:"bg-cart-50 p-4 fixed left-0 top-0 right-0 transition ease-in-out delay-150"},(0,n.createElement)("div",{className:"block"},(0,n.createElement)("div",{className:"text-center justify-center"},(0,n.createElement)("p",{className:"text-sm mx-auto w-full text-cart-500 text-center"},(0,k.__)("WooCommerce installing failed. Please try again.","checkout-plugins-stripe-woo"))))):"")},dn=function(){return(0,n.createElement)("div",null,(0,n.createElement)("div",{className:"relative pt-6 px-4 sm:px-6 lg:px-8"},(0,n.createElement)("nav",{className:"relative flex items-center justify-center sm:h-10","aria-label":"Logo"},(0,n.createElement)("div",{className:"flex items-center justify-center flex-grow"},(0,n.createElement)("div",{className:"flex items-center w-auto"},(0,n.createElement)("img",{className:"h-16 w-full",src:onboarding_vars.assets_url+"images/cpsw-logo.svg",alt:"Checkout Plugins - Stripe for WooCommerce"}))))))};o().render((0,n.createElement)((function(t){let{basename:n,children:a,window:o}=t,d=(0,r.useRef)();null==d.current&&(d.current=function(t){void 0===t&&(t={});var n=t.window,r=void 0===n?document.defaultView:n,a=r.history;function o(){var e=r.location,t=e.pathname,n=e.search,o=e.hash,l=a.state||{};return[l.idx,{pathname:t,search:n,hash:o,state:l.usr||null,key:l.key||"default"}]}var d=null;r.addEventListener("popstate",(function(){if(d)x.call(d),d=null;else{var t=e.Pop,n=o(),r=n[0],a=n[1];if(x.length){if(null!=r){var l=f-r;l&&(d={action:t,location:a,retry:function(){k(-1*l)}},k(l))}}else E(t)}}));var p=e.Pop,m=o(),f=m[0],b=m[1],v=u(),x=u();function g(e){return"string"==typeof e?e:function(e){var t=e.pathname,n=void 0===t?"/":t,r=e.search,a=void 0===r?"":r,o=e.hash,l=void 0===o?"":o;return a&&"?"!==a&&(n+="?"===a.charAt(0)?a:"?"+a),l&&"#"!==l&&(n+="#"===l.charAt(0)?l:"#"+l),n}(e)}function h(e,t){return void 0===t&&(t=null),l({pathname:b.pathname,hash:"",search:""},"string"==typeof e?c(e):e,{state:t,key:Math.random().toString(36).substr(2,8)})}function y(e,t){return[{usr:e.state,key:e.key,idx:t},g(e)]}function w(e,t,n){return!x.length||(x.call({action:e,location:t,retry:n}),!1)}function E(e){p=e;var t=o();f=t[0],b=t[1],v.call({action:p,location:b})}function k(e){a.go(e)}null==f&&(f=0,a.replaceState(l({},a.state,{idx:f}),""));var C={get action(){return p},get location(){return b},createHref:g,push:function t(n,o){var l=e.Push,i=h(n,o);if(w(l,i,(function(){t(n,o)}))){var s=y(i,f+1),u=s[0],c=s[1];try{a.pushState(u,"",c)}catch(e){r.location.assign(c)}E(l)}},replace:function t(n,r){var o=e.Replace,l=h(n,r);if(w(o,l,(function(){t(n,r)}))){var i=y(l,f),s=i[0],u=i[1];a.replaceState(s,"",u),E(o)}},go:k,back:function(){k(-1)},forward:function(){k(1)},listen:function(e){return v.push(e)},block:function(e){var t=x.push(e);return 1===x.length&&r.addEventListener(i,s),function(){t(),x.length||r.removeEventListener(i,s)}}};return C}({window:o}));let p=d.current,[m,f]=(0,r.useState)({action:p.action,location:p.location});return(0,r.useLayoutEffect)((()=>p.listen(f)),[p]),(0,r.createElement)(b,{basename:n,children:a,location:m.location,navigationType:m.action,navigator:p})}),null,(0,n.createElement)((function(){const e=new URLSearchParams(x().search).get("cpsw_call");let t=(0,n.createElement)("p",null);switch(e){case"success":t=(0,n.createElement)(an,null);break;case"failed":t=(0,n.createElement)(sn,null);break;case"webhooks":t=(0,n.createElement)(on,null);break;case"express-checkout":t=(0,n.createElement)(ln,null);break;case"thank-you":t=(0,n.createElement)(un,null);break;case"setup-woocommerce":t=(0,n.createElement)(cn,null);break;default:t=(0,n.createElement)(_,null)}return(0,n.createElement)("div",{className:"relative bg-white overflow-hidden w-10/12 mx-auto my-0 rounded-xl mt-12"},(0,n.createElement)("div",{className:"max-w-7xl mx-auto overflow-x-hidden"},(0,n.createElement)("div",{className:"relative z-10 bg-white lg:w-full"},(0,n.createElement)(dn,null),t)))}),null)),document.getElementById("cpsw-onboarding-content"))}();
1
+ !function(){"use strict";var e={n:function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,{a:n}),n},d:function(t,n){for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},t=window.wp.element,n=window.React,r=e.n(n),a=window.ReactDOM,o=e.n(a);function i(){return i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i.apply(this,arguments)}var l,s=l||(l={});s.Pop="POP",s.Push="PUSH",s.Replace="REPLACE";function c(e){e.preventDefault(),e.returnValue=""}function u(){var e=[];return{get length(){return e.length},push:function(t){return e.push(t),function(){e=e.filter((function(e){return e!==t}))}},call:function(t){e.forEach((function(e){return e&&e(t)}))}}}function m(e){var t={};if(e){var n=e.indexOf("#");0<=n&&(t.hash=e.substr(n),e=e.substr(0,n)),0<=(n=e.indexOf("?"))&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function d(e,t){if(!e)throw new Error(t)}const p=(0,n.createContext)(null),f=(0,n.createContext)(null),b=(0,n.createContext)({outlet:null,matches:[]});function v(e){let{basename:t="/",children:r=null,location:a,navigationType:o=l.Pop,navigator:i,static:s=!1}=e;x()&&d(!1);let c=y(t),u=(0,n.useMemo)((()=>({basename:c,navigator:i,static:s})),[c,i,s]);"string"==typeof a&&(a=m(a));let{pathname:b="/",search:v="",hash:g="",state:h=null,key:w="default"}=a,E=(0,n.useMemo)((()=>{let e=function(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=e.charAt(t.length);return n&&"/"!==n?null:e.slice(t.length)||"/"}(b,c);return null==e?null:{pathname:e,search:v,hash:g,state:h,key:w}}),[c,b,v,g,h,w]);return null==E?null:(0,n.createElement)(p.Provider,{value:u},(0,n.createElement)(f.Provider,{children:r,value:{location:E,navigationType:o}}))}function x(){return null!=(0,n.useContext)(f)}function g(){return x()||d(!1),(0,n.useContext)(f).location}function h(){x()||d(!1);let{basename:e,navigator:t}=(0,n.useContext)(p),{matches:r}=(0,n.useContext)(b),{pathname:a}=g(),o=JSON.stringify(r.map((e=>e.pathnameBase))),i=(0,n.useRef)(!1);return(0,n.useEffect)((()=>{i.current=!0})),(0,n.useCallback)((function(n,r){if(void 0===r&&(r={}),!i.current)return;if("number"==typeof n)return void t.go(n);let l=function(e,t,n){let r,a="string"==typeof e?m(e):e,o=""===e||""===a.pathname?"/":a.pathname;if(null==o)r=n;else{let e=t.length-1;if(o.startsWith("..")){let t=o.split("/");for(;".."===t[0];)t.shift(),e-=1;a.pathname=t.join("/")}r=e>=0?t[e]:"/"}let i=function(e,t){void 0===t&&(t="/");let{pathname:n,search:r="",hash:a=""}="string"==typeof e?m(e):e,o=n?n.startsWith("/")?n:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(n,t):t;return{pathname:o,search:E(r),hash:k(a)}}(a,r);return o&&"/"!==o&&o.endsWith("/")&&!i.pathname.endsWith("/")&&(i.pathname+="/"),i}(n,JSON.parse(o),a);"/"!==e&&(l.pathname=w([e,l.pathname])),(r.replace?t.replace:t.push)(l,r.state)}),[e,t,o,a])}const w=e=>e.join("/").replace(/\/\/+/g,"/"),y=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),E=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",k=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";var _,N,S,C=window.wp.i18n,O=function(){return(0,t.createElement)("svg",{className:"animate-spin ml-2 mr-3 h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},(0,t.createElement)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,t.createElement)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"}))},R=function(){const[e,r]=(0,n.useState)(!1),a=h();return(0,t.createElement)("main",{className:"mt-10 mx-auto w-auto max-w-7xl px-4 sm:mt-12 sm:px-6 md:mt-16 lg:mt-20 lg:px-8 xl:mt-28"},(0,t.createElement)("div",{className:"text-center"},(0,t.createElement)("h1",{className:"text-4xl tracking-tight font-extrabold text-gray-900 sm:text-5xl md:text-6xl"},(0,t.createElement)("span",{className:"block xl"}," ",(0,C.__)("Let's Connect","checkout-plugins-stripe-woo")),(0,t.createElement)("span",{className:"block text-cart-500 xl:inline"},(0,C.__)("with Stripe","checkout-plugins-stripe-woo"))),(0,t.createElement)("p",{className:"mt-3 text-base text-gray-500 sm:mt-5 sm:text-lg sm:mx-auto md:mt-5 md:text-xl lg:mx-0"},(0,t.createElement)("span",{className:"block"},(0,t.createElement)("span",{className:"block text-gray-700 inline font-bold"},(0,C.__)("Checkout Plugins","checkout-plugins-stripe-woo"))," ",(0,C.__)("recommends to connect with","checkout-plugins-stripe-woo")," ",(0,t.createElement)("span",{className:"block text-gray-700 xl:inline font-bold"},(0,C.__)("Stripe connect.","checkout-plugins-stripe-woo"))),(0,t.createElement)("span",null,(0,C.__)("One click onboarding solution provided by","checkout-plugins-stripe-woo")," ",(0,t.createElement)("span",{className:"block text-gray-700 xl:inline font-bold"},(0,C.__)("Stripe.","checkout-plugins-stripe-woo")))),(0,t.createElement)("div",{className:"mt-5 sm:mt-8 sm:inline-block lg:inline-block sm:justify-center lg:justify-center"},(0,t.createElement)("div",{className:"rounded-md shadow"},e?(0,t.createElement)("button",{className:"disabled w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-wait"},(0,C.__)("Connecting…","checkout-plugins-stripe-woo"),(0,t.createElement)(O,null)):(0,t.createElement)("button",{onClick:function(){r(!0),""===onboarding_vars.woocommerce_installed||""===onboarding_vars.woocommerce_activated?a(onboarding_vars.navigator_base+"&cpsw_call=setup-woocommerce"):window.location.replace(onboarding_vars.authorization_url)},className:"w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-pointer"},(0,C.__)("Connect with Stripe","checkout-plugins-stripe-woo"))),(0,t.createElement)("div",{className:"mt-3 sm:mt-0 sm:ml-3"},(0,t.createElement)("a",{href:onboarding_vars.settings_url,className:"w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-slate-300 md:py-4 md:text-lg md:px-10"},(0,C.__)("Leave onboarding process","checkout-plugins-stripe-woo"))))))};function L(){return L=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},L.apply(this,arguments)}function j(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function P(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return T(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?T(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}function D(e,t){if(e in t){for(var n=t[e],r=arguments.length,a=new Array(r>2?r-2:0),o=2;o<r;o++)a[o-2]=arguments[o];return"function"==typeof n?n.apply(void 0,a):n}var i=new Error('Tried to handle "'+e+'" but there is no handler defined. Only defined handlers are: '+Object.keys(t).map((function(e){return'"'+e+'"'})).join(", ")+".");throw Error.captureStackTrace&&Error.captureStackTrace(i,D),i}function A(e){var t=e.props,n=e.slot,r=e.defaultTag,a=e.features,o=e.visible,i=void 0===o||o,l=e.name;if(i)return F(t,n,r,l);var s=null!=a?a:_.None;if(s&_.Static){var c=t.static,u=void 0!==c&&c,m=j(t,["static"]);if(u)return F(m,n,r,l)}if(s&_.RenderStrategy){var d,p=t.unmount,f=void 0===p||p,b=j(t,["unmount"]);return D(f?N.Unmount:N.Hidden,((d={})[N.Unmount]=function(){return null},d[N.Hidden]=function(){return F(L({},b,{hidden:!0,style:{display:"none"}}),n,r,l)},d))}return F(t,n,r,l)}function F(e,t,r,a){var o;void 0===t&&(t={});var i=M(e,["unmount","static"]),l=i.as,s=void 0===l?r:l,c=i.children,u=i.refName,m=void 0===u?"ref":u,d=j(i,["as","children","refName"]),p=void 0!==e.ref?((o={})[m]=e.ref,o):{},f="function"==typeof c?c(t):c;if(d.className&&"function"==typeof d.className&&(d.className=d.className(t)),s===n.Fragment&&Object.keys(d).length>0){if(!(0,n.isValidElement)(f)||Array.isArray(f)&&f.length>1)throw new Error(['Passing props on "Fragment"!',"","The current component <"+a+' /> is rendering a "Fragment".',"However we need to passthrough the following props:",Object.keys(d).map((function(e){return" - "+e})).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map((function(e){return" - "+e})).join("\n")].join("\n"));return(0,n.cloneElement)(f,Object.assign({},function(e,t,n){for(var r,a=Object.assign({},e),o=function(){var n,o=r.value;void 0!==e[o]&&void 0!==t[o]&&Object.assign(a,((n={})[o]=function(n){n.defaultPrevented||e[o](n),n.defaultPrevented||t[o](n)},n))},i=P(["onClick"]);!(r=i()).done;)o();return a}(function(e){var t=Object.assign({},e);for(var n in t)void 0===t[n]&&delete t[n];return t}(M(d,["ref"])),f.props),p))}return(0,n.createElement)(s,Object.assign({},M(d,["ref"]),s!==n.Fragment&&p),f)}function I(e){var t;return Object.assign((0,n.forwardRef)(e),{displayName:null!=(t=e.displayName)?t:e.name})}function M(e,t){void 0===t&&(t=[]);for(var n,r=Object.assign({},e),a=P(t);!(n=a()).done;){var o=n.value;o in r&&delete r[o]}return r}function H(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var a=(0,n.useRef)(t);return(0,n.useEffect)((function(){a.current=t}),[t]),(0,n.useCallback)((function(e){for(var t,n=P(a.current);!(t=n()).done;){var r=t.value;null!=r&&("function"==typeof r?r(e):r.current=e)}}),[a])}function U(e){for(var t,n,r=e.parentElement,a=null;r&&!(r instanceof HTMLFieldSetElement);)r instanceof HTMLLegendElement&&(a=r),r=r.parentElement;var o=null!=(t=""===(null==(n=r)?void 0:n.getAttribute("disabled")))&&t;return(!o||!function(e){if(!e)return!1;for(var t=e.previousElementSibling;null!==t;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}(a))&&o}!function(e){e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static"}(_||(_={})),function(e){e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden"}(N||(N={})),function(e){e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab"}(S||(S={}));var W="undefined"!=typeof window?n.useLayoutEffect:n.useEffect,V={serverHandoffComplete:!1};function G(){var e=(0,n.useState)(V.serverHandoffComplete),t=e[0],r=e[1];return(0,n.useEffect)((function(){!0!==t&&r(!0)}),[t]),(0,n.useEffect)((function(){!1===V.serverHandoffComplete&&(V.serverHandoffComplete=!0)}),[]),t}var B=0;function z(){return++B}function Q(){var e=G(),t=(0,n.useState)(e?z:null),r=t[0],a=t[1];return W((function(){null===r&&a(z())}),[r]),null!=r?""+r:void 0}var q=(0,n.createContext)(null);function Y(){var e=(0,n.useContext)(q);if(null===e){var t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Y),t}return e}function K(e){var t;if(e.type)return e.type;var n=null!=(t=e.as)?t:"button";return"string"==typeof n&&"button"===n.toLowerCase()?"button":void 0}function J(e,t){var r=(0,n.useState)((function(){return K(e)})),a=r[0],o=r[1];return W((function(){o(K(e))}),[e.type,e.as]),W((function(){a||t.current&&t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&o("button")}),[a,t]),a}var $=(0,n.createContext)(null);function X(){var e=(0,n.useContext)($);if(null===e){var t=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,X),t}return e}var Z=(0,n.createContext)(null);Z.displayName="GroupContext";var ee=n.Fragment;function te(e){var t=e.checked,r=e.onChange,a=j(e,["checked","onChange"]),o="headlessui-switch-"+Q(),i=(0,n.useContext)(Z),l=(0,n.useRef)(null),s=H(l,null===i?null:i.setSwitch),c=(0,n.useCallback)((function(){return r(!t)}),[r,t]),u=(0,n.useCallback)((function(e){if(U(e.currentTarget))return e.preventDefault();e.preventDefault(),c()}),[c]),m=(0,n.useCallback)((function(e){e.key!==S.Tab&&e.preventDefault(),e.key===S.Space&&c()}),[c]),d=(0,n.useCallback)((function(e){return e.preventDefault()}),[]),p=(0,n.useMemo)((function(){return{checked:t}}),[t]);return A({props:L({},a,{id:o,ref:s,role:"switch",type:J(e,l),tabIndex:0,"aria-checked":t,"aria-labelledby":null==i?void 0:i.labelledby,"aria-describedby":null==i?void 0:i.describedby,onClick:u,onKeyUp:m,onKeyPress:d}),slot:p,defaultTag:"button",name:"Switch"})}te.Group=function(e){var t=(0,n.useState)(null),a=t[0],o=t[1],i=function(){var e=(0,n.useState)([]),t=e[0],a=e[1];return[t.length>0?t.join(" "):void 0,(0,n.useMemo)((function(){return function(e){var t=(0,n.useCallback)((function(e){return a((function(t){return[].concat(t,[e])})),function(){return a((function(t){var n=t.slice(),r=n.indexOf(e);return-1!==r&&n.splice(r,1),n}))}}),[]),o=(0,n.useMemo)((function(){return{register:t,slot:e.slot,name:e.name,props:e.props}}),[t,e.slot,e.name,e.props]);return r().createElement($.Provider,{value:o},e.children)}}),[a])]}(),l=i[0],s=i[1],c=function(){var e=(0,n.useState)([]),t=e[0],a=e[1];return[t.length>0?t.join(" "):void 0,(0,n.useMemo)((function(){return function(e){var t=(0,n.useCallback)((function(e){return a((function(t){return[].concat(t,[e])})),function(){return a((function(t){var n=t.slice(),r=n.indexOf(e);return-1!==r&&n.splice(r,1),n}))}}),[]),o=(0,n.useMemo)((function(){return{register:t,slot:e.slot,name:e.name,props:e.props}}),[t,e.slot,e.name,e.props]);return r().createElement(q.Provider,{value:o},e.children)}}),[a])]}(),u=c[0],m=c[1],d=(0,n.useMemo)((function(){return{switch:a,setSwitch:o,labelledby:l,describedby:u}}),[a,o,l,u]);return r().createElement(m,{name:"Switch.Description"},r().createElement(s,{name:"Switch.Label",props:{onClick:function(){a&&(a.click(),a.focus({preventScroll:!0}))}}},r().createElement(Z.Provider,{value:d},A({props:e,defaultTag:ee,name:"Switch.Group"}))))},te.Label=function(e){var t=e.passive,n=void 0!==t&&t,r=j(e,["passive"]),a=X(),o="headlessui-label-"+Q();W((function(){return a.register(o)}),[o,a.register]);var i=L({},a.props,{id:o}),l=L({},r,i);return n&&delete l.onClick,A({props:l,slot:a.slot||{},defaultTag:"label",name:a.name||"Label"})},te.Description=function(e){var t=Y(),n="headlessui-description-"+Q();W((function(){return t.register(n)}),[n,t.register]);var r=e,a=L({},t.props,{id:n});return A({props:L({},r,a),slot:t.slot||{},defaultTag:"p",name:t.name||"Description"})};var ne=window.wp.apiFetch,re=e.n(ne);function ae(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter(Boolean).join(" ")}var oe,ie,le,se,ce=function(){const[e,r]=(0,n.useState)(!1),[a,o]=(0,n.useState)(onboarding_vars.available_gateways),i=h();return(0,t.createElement)("main",{className:"mt-4 mb-4 mx-auto w-auto max-w-7xl px-4 sm:mt-6 sm:px-6 md:mt-8 lg:mt-10 lg:px-8 xl:mt-16"},(0,t.createElement)("div",{className:"text-center"},(0,t.createElement)("p",{className:"mt-3 text-base text-gray-500 sm:mt-5 sm:text-lg sm:mx-auto md:mt-5 md:text-xl lg:mx-0"},(0,t.createElement)("span",{className:"block"},(0,t.createElement)("span",{className:"text-gray-700 inline font-bold"},(0,C.__)("Congratulations!!","checkout-plugins-stripe-woo")," "),(0,C.__)("You are connected to Stripe successfully.","checkout-plugins-stripe-woo")),(0,t.createElement)("span",{className:"block"},(0,C.__)("Let's enable gateways","checkout-plugins-stripe-woo"))),(0,t.createElement)("ul",{role:"list",className:"divide-y divide-gray-200 bg-white overflow-hidden sm:rounded-md mt-10 max-w-screen-md mx-auto"},a.map((e=>(0,t.createElement)("li",{key:e.id},(0,t.createElement)("span",{href:"#",className:"block hover:bg-gray-50"},(0,t.createElement)("div",{className:"flex items-center px-4 py-4 sm:px-6"},(0,t.createElement)("div",{className:"min-w-0 flex-1 flex items-center"},(0,t.createElement)("div",{className:"flex-shrink-0"},(0,t.createElement)("img",{className:"h-12 w-32 max-w-80",src:e.icon,alt:e.name})),(0,t.createElement)("div",{className:"min-w-0 flex-1 px-4 md:gap-4"},(0,t.createElement)("div",null,(0,t.createElement)("p",{className:"text-sm font-medium text-cart-500 flex truncate"},e.name," ",e.recommended?(0,t.createElement)("span",{className:"ml-2 px-2 py-1 text-green-800 text-xs font-medium bg-green-100 rounded-full"},(0,C.__)("Recommended","checkout-plugins-stripe-woo")):""),(0,t.createElement)("p",{className:"text-sm font-medium text-gray-400 flex"},(0,t.createElement)("span",{className:"text-left text-sm"},"all"===e.currencies?(0,C.__)("Works with all currencies","checkout-plugins-stripe-woo"):(0,C.__)("Works with ","checkout-plugins-stripe-woo")+e.currencies))))),(0,t.createElement)("div",null,(0,t.createElement)(te,{checked:e.enabled,value:e.enabled,name:e.id,onChange:()=>{e.enabled=!e.enabled,o([...a])},className:ae(e.enabled?"bg-cart-500 ":"bg-gray-200","relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-cart-500")},(0,t.createElement)("span",{className:"sr-only"},e.id),(0,t.createElement)("span",{"aria-hidden":"true",className:ae(e.enabled?"translate-x-5":"translate-x-0","pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow transform ring-0 transition ease-in-out duration-200")}))))))))),(0,t.createElement)("div",{className:"mt-5 sm:mt-8 sm:inline-block lg:inline-block sm:justify-center lg:justify-center"},(0,t.createElement)("div",{className:"rounded-md shadow"},e?(0,t.createElement)("button",{className:"disabled w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-wait"},(0,C.__)("Enabling…","checkout-plugins-stripe-woo"),(0,t.createElement)(O,null)):(0,t.createElement)("button",{onClick:function(e){e.preventDefault(),r(!0);const t=new window.FormData,n={};a.forEach((function(e){n[e.id]=document.getElementsByName(e.id)[0].value}));const o=JSON.stringify(n);t.append("formdata",o),t.append("action","cpsw_onboarding_enable_gateway"),t.append("security",onboarding_vars.cpsw_onboarding_enable_gateway),re()({url:onboarding_vars.ajax_url,method:"POST",body:t}).then((e=>{e.success&&(!0===e.data.activated_gateways.cpsw_stripe?i(onboarding_vars.navigator_base+"&cpsw_call=express-checkout"):i(onboarding_vars.navigator_base+"&cpsw_call=webhooks"))}))},className:"w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-pointer"},(0,C.__)("Enable Gateways","checkout-plugins-stripe-woo"))))))},ue=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map((function(e){return e+":not([tabindex='-1'])"})).join(",");!function(e){e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll"}(oe||(oe={})),function(e){e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow"}(ie||(ie={})),function(e){e[e.Previous=-1]="Previous",e[e.Next=1]="Next"}(le||(le={})),function(e){e[e.Strict=0]="Strict",e[e.Loose=1]="Loose"}(se||(se={}));var me,de,pe,fe,be,ve=(0,n.createContext)(null);function xe(){return(0,n.useContext)(ve)}function ge(e){var t=e.value,n=e.children;return r().createElement(ve.Provider,{value:t},n)}function he(){var e=[],t={requestAnimationFrame:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(){var e=requestAnimationFrame.apply(void 0,arguments);t.add((function(){return cancelAnimationFrame(e)}))})),nextFrame:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.requestAnimationFrame((function(){t.requestAnimationFrame.apply(t,n)}))},setTimeout:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(){var e=setTimeout.apply(void 0,arguments);t.add((function(){return clearTimeout(e)}))})),add:function(t){e.push(t)},dispose:function(){for(var t,n=P(e.splice(0));!(t=n()).done;){(0,t.value)()}}};return t}function we(){var e=(0,n.useState)(he)[0];return(0,n.useEffect)((function(){return function(){return e.dispose()}}),[e]),e}function ye(e,t){var r=(0,n.useState)(e),a=r[0],o=r[1],i=(0,n.useRef)(e);return W((function(){i.current=e}),[e]),W((function(){return o(i.current)}),[i,o].concat(t)),a}ve.displayName="OpenClosedContext",function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(me||(me={})),function(e){e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing"}(de||(de={})),function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(fe||(fe={})),function(e){e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.SetDisabled=2]="SetDisabled",e[e.SetOrientation=3]="SetOrientation",e[e.GoToOption=4]="GoToOption",e[e.Search=5]="Search",e[e.ClearSearch=6]="ClearSearch",e[e.RegisterOption=7]="RegisterOption",e[e.UnregisterOption=8]="UnregisterOption"}(be||(be={}));var Ee=((pe={})[be.CloseListbox]=function(e){return e.disabled||e.listboxState===fe.Closed?e:L({},e,{activeOptionIndex:null,listboxState:fe.Closed})},pe[be.OpenListbox]=function(e){return e.disabled||e.listboxState===fe.Open?e:L({},e,{listboxState:fe.Open})},pe[be.SetDisabled]=function(e,t){return e.disabled===t.disabled?e:L({},e,{disabled:t.disabled})},pe[be.SetOrientation]=function(e,t){return e.orientation===t.orientation?e:L({},e,{orientation:t.orientation})},pe[be.GoToOption]=function(e,t){if(e.disabled)return e;if(e.listboxState===fe.Closed)return e;var n=function(e,t){var n=t.resolveItems();if(n.length<=0)return null;var r=t.resolveActiveIndex(),a=null!=r?r:-1,o=function(){switch(e.focus){case de.First:return n.findIndex((function(e){return!t.resolveDisabled(e)}));case de.Previous:var r=n.slice().reverse().findIndex((function(e,n,r){return!(-1!==a&&r.length-n-1>=a||t.resolveDisabled(e))}));return-1===r?r:n.length-1-r;case de.Next:return n.findIndex((function(e,n){return!(n<=a||t.resolveDisabled(e))}));case de.Last:var o=n.slice().reverse().findIndex((function(e){return!t.resolveDisabled(e)}));return-1===o?o:n.length-1-o;case de.Specific:return n.findIndex((function(n){return t.resolveId(n)===e.id}));case de.Nothing:return null;default:!function(e){throw new Error("Unexpected object: "+e)}(e)}}();return-1===o?r:o}(t,{resolveItems:function(){return e.options},resolveActiveIndex:function(){return e.activeOptionIndex},resolveId:function(e){return e.id},resolveDisabled:function(e){return e.dataRef.current.disabled}});return""===e.searchQuery&&e.activeOptionIndex===n?e:L({},e,{searchQuery:"",activeOptionIndex:n})},pe[be.Search]=function(e,t){if(e.disabled)return e;if(e.listboxState===fe.Closed)return e;var n=e.searchQuery+t.value.toLowerCase(),r=e.options.findIndex((function(e){var t;return!e.dataRef.current.disabled&&(null==(t=e.dataRef.current.textValue)?void 0:t.startsWith(n))}));return-1===r||r===e.activeOptionIndex?L({},e,{searchQuery:n}):L({},e,{searchQuery:n,activeOptionIndex:r})},pe[be.ClearSearch]=function(e){return e.disabled||e.listboxState===fe.Closed||""===e.searchQuery?e:L({},e,{searchQuery:""})},pe[be.RegisterOption]=function(e,t){return L({},e,{options:[].concat(e.options,[{id:t.id,dataRef:t.dataRef}])})},pe[be.UnregisterOption]=function(e,t){var n=e.options.slice(),r=null!==e.activeOptionIndex?n[e.activeOptionIndex]:null,a=n.findIndex((function(e){return e.id===t.id}));return-1!==a&&n.splice(a,1),L({},e,{options:n,activeOptionIndex:a===e.activeOptionIndex||null===r?null:n.indexOf(r)})},pe),ke=(0,n.createContext)(null);function _e(e){var t=(0,n.useContext)(ke);if(null===t){var r=new Error("<"+e+" /> is missing a parent <"+Ce.name+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(r,_e),r}return t}function Ne(e,t){return D(t.type,Ee,e,t)}ke.displayName="ListboxContext";var Se=n.Fragment;function Ce(e){var t,a,o,i,l,s=e.value,c=e.onChange,u=e.disabled,m=void 0!==u&&u,d=e.horizontal,p=void 0!==d&&d,f=j(e,["value","onChange","disabled","horizontal"]),b=p?"horizontal":"vertical",v=(0,n.useReducer)(Ne,{listboxState:fe.Closed,propsRef:{current:{value:s,onChange:c}},labelRef:(0,n.createRef)(),buttonRef:(0,n.createRef)(),optionsRef:(0,n.createRef)(),disabled:m,orientation:b,options:[],searchQuery:"",activeOptionIndex:null}),x=v[0],g=x.listboxState,h=x.propsRef,w=x.optionsRef,y=x.buttonRef,E=v[1];W((function(){h.current.value=s}),[s,h]),W((function(){h.current.onChange=c}),[c,h]),W((function(){return E({type:be.SetDisabled,disabled:m})}),[m]),W((function(){return E({type:be.SetOrientation,orientation:b})}),[b]),a="mousedown",o=function(e){var t,n,r,a=e.target;g===fe.Open&&((null==(t=y.current)?void 0:t.contains(a))||(null==(n=w.current)?void 0:n.contains(a))||(E({type:be.CloseListbox}),function(e,t){var n;return void 0===t&&(t=se.Strict),e!==document.body&&D(t,((n={})[se.Strict]=function(){return e.matches(ue)},n[se.Loose]=function(){for(var t=e;null!==t;){if(t.matches(ue))return!0;t=t.parentElement}return!1},n))}(a,se.Loose)||(e.preventDefault(),null==(r=y.current)||r.focus())))},(l=(0,n.useRef)(o)).current=o,(0,n.useEffect)((function(){function e(e){l.current.call(window,e)}return window.addEventListener(a,e,i),function(){return window.removeEventListener(a,e,i)}}),[a,i]);var k=(0,n.useMemo)((function(){return{open:g===fe.Open,disabled:m}}),[g,m]);return r().createElement(ke.Provider,{value:v},r().createElement(ge,{value:D(g,(t={},t[fe.Open]=me.Open,t[fe.Closed]=me.Closed,t))},A({props:f,slot:k,defaultTag:Se,name:"Listbox"})))}var Oe,Re=I((function e(t,r){var a,o=_e([Ce.name,e.name].join(".")),i=o[0],l=o[1],s=H(i.buttonRef,r),c="headlessui-listbox-button-"+Q(),u=we(),m=(0,n.useCallback)((function(e){switch(e.key){case S.Space:case S.Enter:case S.ArrowDown:e.preventDefault(),l({type:be.OpenListbox}),u.nextFrame((function(){i.propsRef.current.value||l({type:be.GoToOption,focus:de.First})}));break;case S.ArrowUp:e.preventDefault(),l({type:be.OpenListbox}),u.nextFrame((function(){i.propsRef.current.value||l({type:be.GoToOption,focus:de.Last})}))}}),[l,i,u]),d=(0,n.useCallback)((function(e){e.key===S.Space&&e.preventDefault()}),[]),p=(0,n.useCallback)((function(e){if(U(e.currentTarget))return e.preventDefault();i.listboxState===fe.Open?(l({type:be.CloseListbox}),u.nextFrame((function(){var e;return null==(e=i.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(e.preventDefault(),l({type:be.OpenListbox}))}),[l,u,i]),f=ye((function(){if(i.labelRef.current)return[i.labelRef.current.id,c].join(" ")}),[i.labelRef.current,c]),b=(0,n.useMemo)((function(){return{open:i.listboxState===fe.Open,disabled:i.disabled}}),[i]);return A({props:L({},t,{ref:s,id:c,type:J(t,i.buttonRef),"aria-haspopup":!0,"aria-controls":null==(a=i.optionsRef.current)?void 0:a.id,"aria-expanded":i.disabled?void 0:i.listboxState===fe.Open,"aria-labelledby":f,disabled:i.disabled,onKeyDown:m,onKeyUp:d,onClick:p}),slot:b,defaultTag:"button",name:"Listbox.Button"})})),Le=_.RenderStrategy|_.Static,je=I((function e(t,r){var a,o=_e([Ce.name,e.name].join(".")),i=o[0],l=o[1],s=H(i.optionsRef,r),c="headlessui-listbox-options-"+Q(),u=we(),m=we(),d=xe(),p=null!==d?d===me.Open:i.listboxState===fe.Open;W((function(){var e=i.optionsRef.current;e&&i.listboxState===fe.Open&&e!==document.activeElement&&e.focus({preventScroll:!0})}),[i.listboxState,i.optionsRef]);var f=(0,n.useCallback)((function(e){switch(m.dispose(),e.key){case S.Space:if(""!==i.searchQuery)return e.preventDefault(),e.stopPropagation(),l({type:be.Search,value:e.key});case S.Enter:if(e.preventDefault(),e.stopPropagation(),l({type:be.CloseListbox}),null!==i.activeOptionIndex){var t=i.options[i.activeOptionIndex].dataRef;i.propsRef.current.onChange(t.current.value)}he().nextFrame((function(){var e;return null==(e=i.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case D(i.orientation,{vertical:S.ArrowDown,horizontal:S.ArrowRight}):return e.preventDefault(),e.stopPropagation(),l({type:be.GoToOption,focus:de.Next});case D(i.orientation,{vertical:S.ArrowUp,horizontal:S.ArrowLeft}):return e.preventDefault(),e.stopPropagation(),l({type:be.GoToOption,focus:de.Previous});case S.Home:case S.PageUp:return e.preventDefault(),e.stopPropagation(),l({type:be.GoToOption,focus:de.First});case S.End:case S.PageDown:return e.preventDefault(),e.stopPropagation(),l({type:be.GoToOption,focus:de.Last});case S.Escape:return e.preventDefault(),e.stopPropagation(),l({type:be.CloseListbox}),u.nextFrame((function(){var e;return null==(e=i.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));case S.Tab:e.preventDefault(),e.stopPropagation();break;default:1===e.key.length&&(l({type:be.Search,value:e.key}),m.setTimeout((function(){return l({type:be.ClearSearch})}),350))}}),[u,l,m,i]),b=ye((function(){var e,t,n;return null!=(e=null==(t=i.labelRef.current)?void 0:t.id)?e:null==(n=i.buttonRef.current)?void 0:n.id}),[i.labelRef.current,i.buttonRef.current]),v=(0,n.useMemo)((function(){return{open:i.listboxState===fe.Open}}),[i]);return A({props:L({},t,{"aria-activedescendant":null===i.activeOptionIndex||null==(a=i.options[i.activeOptionIndex])?void 0:a.id,"aria-labelledby":b,"aria-orientation":i.orientation,id:c,onKeyDown:f,role:"listbox",tabIndex:0,ref:s}),slot:v,defaultTag:"ul",features:Le,visible:p,name:"Listbox.Options"})}));function Te(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];e&&r.length>0&&(t=e.classList).add.apply(t,r)}function Pe(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];e&&r.length>0&&(t=e.classList).remove.apply(t,r)}function De(e,t,n,r,a,o){var i=he(),l=void 0!==o?function(e){var t={called:!1};return function(){if(!t.called)return t.called=!0,e.apply(void 0,arguments)}}(o):function(){};return Pe.apply(void 0,[e].concat(a)),Te.apply(void 0,[e].concat(t,n)),i.nextFrame((function(){Pe.apply(void 0,[e].concat(n)),Te.apply(void 0,[e].concat(r)),i.add(function(e,t){var n=he();if(!e)return n.dispose;var r=getComputedStyle(e),a=[r.transitionDuration,r.transitionDelay].map((function(e){var t=e.split(",").filter(Boolean).map((function(e){return e.includes("ms")?parseFloat(e):1e3*parseFloat(e)})).sort((function(e,t){return t-e}))[0];return void 0===t?0:t})),o=a[0],i=a[1];return 0!==o?n.setTimeout((function(){t(Oe.Finished)}),o+i):t(Oe.Finished),n.add((function(){return t(Oe.Cancelled)})),n.dispose}(e,(function(n){return Pe.apply(void 0,[e].concat(r,t)),Te.apply(void 0,[e].concat(a)),l(n)})))})),i.add((function(){return Pe.apply(void 0,[e].concat(t,n,r,a))})),i.add((function(){return l(Oe.Cancelled)})),i.dispose}function Ae(e){return void 0===e&&(e=""),(0,n.useMemo)((function(){return e.split(" ").filter((function(e){return e.trim().length>1}))}),[e])}Ce.Button=Re,Ce.Label=function e(t){var r=_e([Ce.name,e.name].join("."))[0],a="headlessui-listbox-label-"+Q(),o=(0,n.useCallback)((function(){var e;return null==(e=r.buttonRef.current)?void 0:e.focus({preventScroll:!0})}),[r.buttonRef]),i=(0,n.useMemo)((function(){return{open:r.listboxState===fe.Open,disabled:r.disabled}}),[r]);return A({props:L({},t,{ref:r.labelRef,id:a,onClick:o}),slot:i,defaultTag:"label",name:"Listbox.Label"})},Ce.Options=je,Ce.Option=function e(t){var r=t.disabled,a=void 0!==r&&r,o=t.value,i=j(t,["disabled","value"]),l=_e([Ce.name,e.name].join(".")),s=l[0],c=l[1],u="headlessui-listbox-option-"+Q(),m=null!==s.activeOptionIndex&&s.options[s.activeOptionIndex].id===u,d=s.propsRef.current.value===o,p=(0,n.useRef)({disabled:a,value:o});W((function(){p.current.disabled=a}),[p,a]),W((function(){p.current.value=o}),[p,o]),W((function(){var e,t;p.current.textValue=null==(e=document.getElementById(u))||null==(t=e.textContent)?void 0:t.toLowerCase()}),[p,u]);var f=(0,n.useCallback)((function(){return s.propsRef.current.onChange(o)}),[s.propsRef,o]);W((function(){return c({type:be.RegisterOption,id:u,dataRef:p}),function(){return c({type:be.UnregisterOption,id:u})}}),[p,u]),W((function(){var e;s.listboxState===fe.Open&&d&&(c({type:be.GoToOption,focus:de.Specific,id:u}),null==(e=document.getElementById(u))||null==e.focus||e.focus())}),[s.listboxState]),W((function(){if(s.listboxState===fe.Open&&m){var e=he();return e.nextFrame((function(){var e;return null==(e=document.getElementById(u))||null==e.scrollIntoView?void 0:e.scrollIntoView({block:"nearest"})})),e.dispose}}),[u,m,s.listboxState]);var b=(0,n.useCallback)((function(e){if(a)return e.preventDefault();f(),c({type:be.CloseListbox}),he().nextFrame((function(){var e;return null==(e=s.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))}),[c,s.buttonRef,a,f]),v=(0,n.useCallback)((function(){if(a)return c({type:be.GoToOption,focus:de.Nothing});c({type:be.GoToOption,focus:de.Specific,id:u})}),[a,u,c]),x=(0,n.useCallback)((function(){a||m||c({type:be.GoToOption,focus:de.Specific,id:u})}),[a,m,u,c]),g=(0,n.useCallback)((function(){a||m&&c({type:be.GoToOption,focus:de.Nothing})}),[a,m,c]),h=(0,n.useMemo)((function(){return{active:m,selected:d,disabled:a}}),[m,d,a]);return A({props:L({},i,{id:u,role:"option",tabIndex:!0===a?void 0:-1,"aria-disabled":!0===a||void 0,"aria-selected":!0===d||void 0,disabled:void 0,onClick:b,onFocus:v,onPointerMove:x,onMouseMove:x,onPointerLeave:g,onMouseLeave:g}),slot:h,defaultTag:"li",name:"Listbox.Option"})},function(e){e.Finished="finished",e.Cancelled="cancelled"}(Oe||(Oe={}));var Fe,Ie=(0,n.createContext)(null);Ie.displayName="TransitionContext",function(e){e.Visible="visible",e.Hidden="hidden"}(Fe||(Fe={}));var Me=(0,n.createContext)(null);function He(e){return"children"in e?He(e.children):e.current.filter((function(e){return e.state===Fe.Visible})).length>0}function Ue(e){var t=(0,n.useRef)(e),r=(0,n.useRef)([]),a=function(){var e=(0,n.useRef)(!1);return(0,n.useEffect)((function(){return e.current=!0,function(){e.current=!1}}),[]),e}();(0,n.useEffect)((function(){t.current=e}),[e]);var o=(0,n.useCallback)((function(e,n){var o;void 0===n&&(n=N.Hidden);var i=r.current.findIndex((function(t){return t.id===e}));-1!==i&&(D(n,((o={})[N.Unmount]=function(){r.current.splice(i,1)},o[N.Hidden]=function(){r.current[i].state=Fe.Hidden},o)),!He(r)&&a.current&&(null==t.current||t.current()))}),[t,a,r]),i=(0,n.useCallback)((function(e){var t=r.current.find((function(t){return t.id===e}));return t?t.state!==Fe.Visible&&(t.state=Fe.Visible):r.current.push({id:e,state:Fe.Visible}),function(){return o(e,N.Unmount)}}),[r,o]);return(0,n.useMemo)((function(){return{children:r,register:i,unregister:o}}),[i,o,r])}function We(){}Me.displayName="NestingContext";var Ve=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function Ge(e){for(var t,n={},r=P(Ve);!(t=r()).done;){var a,o=t.value;n[o]=null!=(a=e[o])?a:We}return n}var Be=_.RenderStrategy;function ze(e){var t,a=e.beforeEnter,o=e.afterEnter,i=e.beforeLeave,l=e.afterLeave,s=e.enter,c=e.enterFrom,u=e.enterTo,m=e.entered,d=e.leave,p=e.leaveFrom,f=e.leaveTo,b=j(e,["beforeEnter","afterEnter","beforeLeave","afterLeave","enter","enterFrom","enterTo","entered","leave","leaveFrom","leaveTo"]),v=(0,n.useRef)(null),x=(0,n.useState)(Fe.Visible),g=x[0],h=x[1],w=b.unmount?N.Unmount:N.Hidden,y=function(){var e=(0,n.useContext)(Ie);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),E=y.show,k=y.appear,_=y.initial,S=function(){var e=(0,n.useContext)(Me);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),C=S.register,O=S.unregister,R=Q(),T=(0,n.useRef)(!1),P=Ue((function(){T.current||(h(Fe.Hidden),O(R),z.current.afterLeave())}));W((function(){if(R)return C(R)}),[C,R]),W((function(){var e;w===N.Hidden&&R&&(E&&g!==Fe.Visible?h(Fe.Visible):D(g,((e={})[Fe.Hidden]=function(){return O(R)},e[Fe.Visible]=function(){return C(R)},e)))}),[g,R,C,O,E,w]);var F=Ae(s),I=Ae(c),M=Ae(u),H=Ae(m),U=Ae(d),V=Ae(p),B=Ae(f),z=function(e){var t=(0,n.useRef)(Ge(e));return(0,n.useEffect)((function(){t.current=Ge(e)}),[e]),t}({beforeEnter:a,afterEnter:o,beforeLeave:i,afterLeave:l}),q=G();(0,n.useEffect)((function(){if(q&&g===Fe.Visible&&null===v.current)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")}),[v,g,q]);var Y=_&&!k;W((function(){var e=v.current;if(e&&!Y)return T.current=!0,E&&z.current.beforeEnter(),E||z.current.beforeLeave(),E?De(e,F,I,M,H,(function(e){T.current=!1,e===Oe.Finished&&z.current.afterEnter()})):De(e,U,V,B,H,(function(e){T.current=!1,e===Oe.Finished&&(He(P)||(h(Fe.Hidden),O(R),z.current.afterLeave()))}))}),[z,R,T,O,P,v,Y,E,F,I,M,U,V,B]);var K={ref:v},J=b;return r().createElement(Me.Provider,{value:P},r().createElement(ge,{value:D(g,(t={},t[Fe.Visible]=me.Open,t[Fe.Hidden]=me.Closed,t))},A({props:L({},J,K),defaultTag:"div",features:Be,visible:g===Fe.Visible,name:"Transition.Child"})))}function Qe(e){var t,a=e.show,o=e.appear,i=void 0!==o&&o,l=e.unmount,s=j(e,["show","appear","unmount"]),c=xe();if(void 0===a&&null!==c&&(a=D(c,((t={})[me.Open]=!0,t[me.Closed]=!1,t))),![!0,!1].includes(a))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");var u=(0,n.useState)(a?Fe.Visible:Fe.Hidden),m=u[0],d=u[1],p=Ue((function(){d(Fe.Hidden)})),f=function(){var e=(0,n.useRef)(!0);return(0,n.useEffect)((function(){e.current=!1}),[]),e.current}(),b=(0,n.useMemo)((function(){return{show:a,appear:i||!f,initial:f}}),[a,i,f]);(0,n.useEffect)((function(){a?d(Fe.Visible):He(p)||d(Fe.Hidden)}),[a,p]);var v={unmount:l};return r().createElement(Me.Provider,{value:p},r().createElement(Ie.Provider,{value:b},A({props:L({},v,{as:n.Fragment,children:r().createElement(ze,Object.assign({},v,s))}),defaultTag:n.Fragment,features:Be,visible:m===Fe.Visible,name:"Transition"})))}Qe.Child=function(e){var t=null!==(0,n.useContext)(Ie),a=null!==xe();return!t&&a?r().createElement(Qe,Object.assign({},e)):r().createElement(ze,Object.assign({},e))},Qe.Root=Qe;var qe=function(){const[e,r]=(0,n.useState)(!1),[a,o]=(0,n.useState)(onboarding_vars.get_webhook_secret),i=[{id:"test",name:(0,C.__)("Test","cart-plugin")},{id:"live",name:(0,C.__)("Live","cart-plugin")}],l=Object.keys(i).find((e=>i[e].id===onboarding_vars.get_payment_mode)),[s,c]=(0,n.useState)(i[l]),u=h();return(0,t.createElement)("main",{className:"mt-4 mb-4 mx-auto w-auto max-w-7xl px-4 sm:mt-6 sm:px-6 md:mt-8 lg:mt-10 lg:px-8 xl:mt-16"},(0,t.createElement)("div",{className:"text-center"},(0,t.createElement)("h1",{className:"text-4xl tracking-tight font-extrabold text-gray-900 sm:text-5xl md:text-6xl"},(0,t.createElement)("span",{className:"block text-cart-500 xl:inline"},(0,C.__)("This is important!!","checkout-plugins-stripe-woo"))),(0,t.createElement)("h3",{className:"text-2xl tracking-tight mt-5 font-bold text-gray-700"},(0,t.createElement)("span",{className:"block xl:inline"},(0,C.__)("Enable Webhooks","checkout-plugins-stripe-woo"))),(0,t.createElement)("p",{className:"mt-2 text-sm mb-5 text-gray-500 sm:mt-2 sm:text-xl sm:mx-auto md:mt-2 md:text-xl lg:mx-0"},(0,t.createElement)("span",{className:"block xl:inline font-bold select-none text-gray-700"},(0,C.__)("Webhook URL","checkout-plugins-stripe-woo"),": ")," ",(0,t.createElement)("span",{className:"block xl:inline font-bold select-text"},onboarding_vars.webhook_url)),(0,t.createElement)("div",{className:"block mx-auto mt-2 mb-5 w-full md:w-6/12 lg:w-6/12"},(0,t.createElement)("p",{className:"mt-2 text-sm text-gray-400 sm:mt-2 sm:text-sm sm:mx-auto md:mt-2 md:text-md lg:mx-0"},(0,t.createElement)("span",{className:"block"}," ",(0,C.__)("The webhook URL is called by","checkout-plugins-stripe-woo")," ",(0,t.createElement)("span",{className:"block text-gray-700 xl:inline font-bold"},(0,C.__)("Stripe","checkout-plugins-stripe-woo"),","),(0,C.__)(" when events occur in your account, like a source becomes chargeable.","checkout-plugins-stripe-woo")," ",(0,t.createElement)("a",{href:"https://checkoutplugins.com/docs/stripe-card-payments/#webhook",target:"_blank",rel:"noreferrer"},(0,t.createElement)("span",{className:"block xl:inline font-bold text-cart-500"},(0,C.__)("Webhook Guide","checkout-plugins-stripe-woo")))," ",(0,C.__)("or create webhook secret on","checkout-plugins-stripe-woo")," ",(0,t.createElement)("a",{href:"https://dashboard.stripe.com/webhooks/create",target:"_blank",rel:"noreferrer"},(0,t.createElement)("span",{className:"block text-cart-500 xl:inline font-bold"},(0,C.__)("Stripe Dashboard","checkout-plugins-stripe-woo"))),".")),(0,t.createElement)("p",{className:"text-left mt-3 text-sm text-gray-400 sm:mt-5 sm:text-sm sm:mx-auto md:mt-5 md:text-md lg:mx-0"},(0,t.createElement)("span",{className:"block text-gray-700 xl:inline font-bold"}," ",(0,C.__)("This is the list of the supported webhook events: ","checkout-plugins-stripe-woo")," ")),(0,t.createElement)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-2 gap-1 text-left"},(0,t.createElement)("div",null,(0,t.createElement)("ul",{className:"list-disc mt-3 pl-4 text-sm text-gray-400"},(0,t.createElement)("li",null,"charge.captured"),(0,t.createElement)("li",null,"charge.refunded"),(0,t.createElement)("li",null,"charge.dispute.created"),(0,t.createElement)("li",null,"charge.dispute.closed"),(0,t.createElement)("li",null,"payment_intent.succeeded"))),(0,t.createElement)("div",null,(0,t.createElement)("ul",{className:"list-disc md:mt-3 lg:mt-3 pl-4 text-sm text-gray-400"},(0,t.createElement)("li",null,"payment_intent.amount_capturable_updated"),(0,t.createElement)("li",null,"payment_intent.payment_failed"),(0,t.createElement)("li",null,"review.opened"),(0,t.createElement)("li",null,"review.closed"))))),(0,t.createElement)("div",{className:"block mx-auto mt-5 mb-5 w-full md:w-6/12 lg:w-6/12"},(0,t.createElement)("span",{className:"block text-gray-700 font-bold text-left"},(0,C.__)("Select Mode","checkout-plugins-stripe-woo")),(0,t.createElement)(Ce,{value:s,onChange:c},(0,t.createElement)("div",{className:"relative mt-1"},(0,t.createElement)(Ce.Button,{className:"relative w-full py-2 pl-3 pr-10 h-12 text-left bg-white rounded appearance-none border shadow cursor-default focus:outline-none focus-visible:ring-2 focus-visible:ring-opacity-75 focus-visible:ring-white focus-visible:ring-offset-orange-300 focus-visible:ring-offset-2 focus-visible:border-indigo-500 sm:text-sm"},(0,t.createElement)("span",{className:"block truncate"},s.name),(0,t.createElement)("span",{className:"absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none"},(0,t.createElement)("span",{className:"dashicons dashicons-arrow-down-alt2"}))),(0,t.createElement)(Qe,{as:n.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0"},(0,t.createElement)(Ce.Options,{className:"absolute w-full py-1 mt-1 z-40 text-left overflow-auto text-base bg-white rounded border shadow max-h-60 ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm"},i.map(((e,r)=>(0,t.createElement)(Ce.Option,{key:r,className:e=>{let{active:t}=e;return(t?" text-gray-500 bg-wpcolor":"text-gray-900")+"\n\t\t\t\t\t\t\t\tcursor-default select-none relative py-1 pl-4"},value:e},(r=>{let{active:a}=r;return(0,t.createElement)(n.Fragment,null,(0,t.createElement)("span",{className:(s?"font-medium":"font-normal")+" block"},e.name),s?(0,t.createElement)("span",{className:(a?"text-wpcolor":"text-wpcolor20")+"\n\t\t\t\t\t\t\t\t\t\tabsolute inset-y-0 left-0 flex items-center pl-3"}):null)})))))))),(0,t.createElement)("input",{type:"hidden",name:"cpsw_mode",id:"cpsw_mode",value:s.id})),(0,t.createElement)("div",{className:"w-full md:w-6/12 lg:w-6/12 block mx-auto mt-5 mb-5"},(0,t.createElement)("span",{className:"block text-gray-700 font-bold text-left"},s.name," ",(0,C.__)("Webhook Secret","checkout-plugins-stripe-woo")),(0,t.createElement)("p",{className:"mt-2 text-sm text-gray-400 sm:mt-2 sm:text-sm sm:mx-auto md:mt-2 md:text-md lg:mx-0"},(0,t.createElement)("input",{type:"text",value:a,onChange:function(e){o(e.target.value)},name:"webhook_secret",id:"cpsw_webhook_secret",placeholder:(0,C.__)("Enter key here","checkout-plugins-stripe-woo"),className:"w-full shadow appearance-none border rounded h-12 py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"}),(0,t.createElement)("span",{className:"block mt-3"}," ",(0,C.__)("The webhook secret is used to authenticate webhooks sent from Stripe. It ensures nobody else can send you events pretending to be Stripe","checkout-plugins-stripe-woo"),"."))),(0,t.createElement)("div",{className:"sm:inline-block lg:inline-block sm:justify-center lg:justify-center"},(0,t.createElement)("div",{className:"rounded-md shadow"},e?(0,t.createElement)("button",{className:"disabled w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-wait"},(0,C.__)("Saving…","checkout-plugins-stripe-woo"),(0,t.createElement)(O,null)):(0,t.createElement)("button",{onClick:function(){const e=new window.FormData;e.append("action","cpsw_onboarding_enable_webhooks");const t=document.getElementById("cpsw_webhook_secret").value,n=document.getElementById("cpsw_mode").value;if(""===t)return window.alert((0,C.__)("Webhook Secret field is Required.","checkout-plugins-stripe-woo")),!1;r(!0),e.append("webhook_secret",t),e.append("cpsw_mode",n),e.append("security",onboarding_vars.cpsw_onboarding_enable_webhooks),re()({url:onboarding_vars.ajax_url,method:"POST",body:e}).then((e=>{e.success&&u(onboarding_vars.navigator_base+"&cpsw_call=thank-you")}))},className:"w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-pointer"},(0,C.__)("Save & Continue","checkout-plugins-stripe-woo"))),(0,t.createElement)("div",{className:"mt-3 sm:mt-0"},(0,t.createElement)("a",{href:onboarding_vars.base_url+"&cpsw_call=thank-you",className:"w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-slate-300 md:py-4 md:text-lg md:px-10"},(0,C.__)("Skip","checkout-plugins-stripe-woo"))))))},Ye=function(){const[e,r]=(0,n.useState)(!1),a=h();return(0,t.createElement)("main",{className:"mt-10 mx-auto w-auto max-w-7xl px-4 sm:mt-12 sm:px-6 md:mt-16 lg:mt-20 lg:px-8 xl:mt-28"},(0,t.createElement)("div",{className:"text-center"},(0,t.createElement)("h1",{className:"text-4xl tracking-tight font-extrabold text-gray-900 sm:text-5xl md:text-6xl"},(0,t.createElement)("span",{className:"block xl"},(0,C.__)("Wooho!!","checkout-plugins-stripe-woo")),(0,t.createElement)("span",{className:"block text-cart-500 xl:inline"},(0,C.__)("You are almost done.","checkout-plugins-stripe-woo"))),(0,t.createElement)("p",{className:"mt-3 text-base text-gray-500 sm:mt-5 sm:text-lg sm:mx-auto md:mt-5 md:text-xl lg:mx-0"},(0,t.createElement)("span",{className:"block"}," ",(0,C.__)("Since you have enabled","checkout-plugins-stripe-woo")," ",(0,t.createElement)("span",{className:"block text-gray-700 xl:inline font-bold"},(0,C.__)("Stripe Card Processing","checkout-plugins-stripe-woo"),","),(0,C.__)(" We recommend you to enable","checkout-plugins-stripe-woo")," ",(0,t.createElement)("span",{className:"block text-gray-700 xl:inline font-bold"},(0,C.__)("Express Checkout","checkout-plugins-stripe-woo"))," ",(0,C.__)("feature","checkout-plugins-stripe-woo"),"."),(0,t.createElement)("span",null,(0,C.__)("Express Checkout generates more conversions!!","checkout-plugins-stripe-woo"))),(0,t.createElement)("div",{className:"block mx-auto mt-1 mb-1"},(0,t.createElement)("img",{className:"inline mx-4 py-5 h-24",src:onboarding_vars.assets_url+"images/apple-pay.svg",alt:"Express Checkout"}),(0,t.createElement)("img",{className:"inline mx-4 py-5 h-24",src:onboarding_vars.assets_url+"images/gpay.svg",alt:"Express Checkout"})),(0,t.createElement)("div",{className:"sm:inline-block lg:inline-block sm:justify-center lg:justify-center"},(0,t.createElement)("div",{className:"rounded-md shadow"},e?(0,t.createElement)("button",{className:"disabled w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-wait"},(0,C.__)("Enabling…","checkout-plugins-stripe-woo"),(0,t.createElement)(O,null)):(0,t.createElement)("button",{onClick:function(){r(!0);const e=new window.FormData;e.append("action","cpsw_onboarding_enable_express_checkout"),e.append("security",onboarding_vars.cpsw_onboarding_enable_express_checkout),re()({url:onboarding_vars.ajax_url,method:"POST",body:e}).then((e=>{e.success&&a(onboarding_vars.navigator_base+"&cpsw_call=webhooks")}))},className:"w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-pointer"},(0,C.__)("Enable Express Checkout","checkout-plugins-stripe-woo"))),(0,t.createElement)("div",{className:"mt-3 sm:mt-0 sm:ml-3"},(0,t.createElement)("a",{href:onboarding_vars.base_url+"&cpsw_call=webhooks",className:"w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-slate-300 md:py-4 md:text-lg md:px-10"},(0,C.__)("Skip Express Checkout","checkout-plugins-stripe-woo"))))))},Ke=function(){return(0,t.createElement)("main",{className:"mt-10 mx-auto w-auto max-w-7xl px-4 sm:mt-12 sm:px-6 md:mt-14 lg:mt-16 lg:px-8 xl:mt-18"},(0,t.createElement)("div",{className:"text-center"},(0,t.createElement)("h1",{className:"text-4xl tracking-tight font-extrabold text-gray-900 sm:text-5xl md:text-6xl"},(0,t.createElement)("span",{className:"block text-red-600 xl:inline"},(0,C.__)("Failed!!","checkout-plugins-stripe-woo"))),(0,t.createElement)("p",{className:"mt-3 text-base text-gray-500 sm:mt-5 sm:text-lg sm:mx-auto md:mt-5 md:text-xl lg:mx-0"},(0,t.createElement)("span",{className:"block"},(0,C.__)("Unfortunately Connection to Stripe failed.","checkout-plugins-stripe-woo"))),(0,t.createElement)("div",{className:"mt-5 sm:mt-8 sm:inline-block lg:inline-block sm:justify-center lg:justify-center"},(0,t.createElement)("div",{className:"rounded-md shadow"},(0,t.createElement)("a",{href:onboarding_vars.authorization_url,className:"w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10"},(0,C.__)("Try Again","checkout-plugins-stripe-woo"))),(0,t.createElement)("div",{className:"mt-3 sm:mt-0 sm:ml-3"},(0,t.createElement)("a",{href:onboarding_vars.manual_connect_url,className:"w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-slate-300 md:py-4 md:text-lg md:px-10"},(0,C.__)("Manage API keys manually","checkout-plugins-stripe-woo"))))))},Je=function(){const[e,r]=(0,n.useState)(!1);return(0,t.createElement)("main",{className:"mt-10 mx-auto w-auto max-w-7xl px-4 sm:mt-12 sm:px-6 md:mt-14 lg:mt-16 lg:px-8 xl:mt-18"},(0,t.createElement)("div",{className:"text-center"},(0,t.createElement)("h1",{className:"text-4xl tracking-tight font-extrabold text-gray-900 sm:text-5xl md:text-6xl"},(0,t.createElement)("span",{className:"block text-cart-500 xl:inline"},(0,C.__)("Great!!","checkout-plugins-stripe-woo"))),(0,t.createElement)("p",{className:"mt-3 text-base text-gray-500 sm:mt-5 sm:text-lg sm:mx-auto md:mt-5 md:text-xl lg:mx-0"},(0,t.createElement)("span",{className:"block"},(0,C.__)("Your store is all set to accept payment.","checkout-plugins-stripe-woo")),(0,t.createElement)("span",null,(0,C.__)("We provide lots of customization options to match your needs, don't forget to explore them.","checkout-plugins-stripe-woo"))),(0,t.createElement)("div",{className:"mt-5 sm:mt-8 sm:inline-block lg:inline-block sm:justify-center lg:justify-center"},(0,t.createElement)("div",{className:"rounded-md shadow"},e?(0,t.createElement)("button",{className:"disabled w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-wait"},(0,C.__)("Let's Customize…","checkout-plugins-stripe-woo"),(0,t.createElement)(O,null)):(0,t.createElement)("button",{onClick:function(){r(!0),window.location.replace(onboarding_vars.gateways_url)},className:"w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-pointer"},(0,C.__)("Let's Customize","checkout-plugins-stripe-woo"))))))},$e=function(){""!==onboarding_vars.woocommerce_installed&&""!==onboarding_vars.woocommerce_activated&&window.location.replace(onboarding_vars.navigator_base);const[e,r]=(0,n.useState)(""),[a,o]=(0,n.useState)(!1),[i,l]=(0,n.useState)(!1);return(0,t.createElement)("main",{className:"mt-10 mx-auto max-w-7xl px-4 sm:mt-12 sm:px-6 md:mt-16 lg:mt-20 lg:px-8 xl:mt-28"},(0,t.createElement)("div",{className:"text-center"},(0,t.createElement)("h1",{className:"text-4xl tracking-tight font-extrabold text-gray-900 sm:text-5xl md:text-6xl"},(0,t.createElement)("span",{className:"block xl"},""===onboarding_vars.woocommerce_installed?(0,C.__)("Missing","checkout-plugins-stripe-woo"):(0,C.__)("Inactiave","checkout-plugins-stripe-woo")),(0,t.createElement)("span",{className:"block text-cart-500 xl:inline"},(0,C.__)("WooCoomerce","checkout-plugins-stripe-woo"))),(0,t.createElement)("p",{className:"mt-6 text-base justify-center text-gray-500 sm:mt-5 sm:text-lg sm:w-full sm:mx-auto md:mt-5 md:text-xl lg:mx-0"},(0,t.createElement)("span",{className:"block text-gray-700 xl:inline font-bold"},(0,C.__)("Checkout Plugins - Stripe for WooCoomerce","checkout-plugins-stripe-woo"))," ",(0,C.__)("requires","checkout-plugins-stripe-woo")," ",(0,t.createElement)("span",{className:"block text-gray-700 xl:inline font-bold"},(0,C.__)("WooCommerce","checkout-plugins-stripe-woo"))," ",(0,C.__)("to be active on your store.","checkout-plugins-stripe-woo")),(0,t.createElement)("div",{className:"mt-5 sm:mt-8 sm:flex justify-center"},(0,t.createElement)("div",{className:"rounded-md shadow"},"installing"===e?(0,t.createElement)("button",{className:"disabled w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-wait"},(0,C.__)("Installing…","checkout-plugins-stripe-woo"),(0,t.createElement)(O,null)):"activating"===e?(0,t.createElement)("button",{className:"disabled w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-wait"},(0,C.__)("Activating…","checkout-plugins-stripe-woo"),(0,t.createElement)(O,null)):(0,t.createElement)("button",{onClick:function(){if(""===onboarding_vars.woocommerce_installed)r("installing"),setTimeout((()=>{o(!0)}),1e4),wp.updates.queue.push({action:"install-plugin",data:{slug:"woocommerce"}}),wp.updates.queueChecker();else{r("activating");const e=new window.FormData;e.append("action","cpsw_onboarding_install_woocommerce"),e.append("security",onboarding_vars.cpsw_onboarding_install_woocommerce),re()({url:onboarding_vars.ajax_url,method:"POST",body:e}).then((e=>{e.success?window.location.replace(onboarding_vars.onboarding_base):l(!0)}))}},className:"install-dependency w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-cart-500 hover:bg-cart-700 md:py-4 md:text-lg md:px-10 cursor-pointer"},""===onboarding_vars.woocommerce_installed?(0,C.__)("Install and continue","checkout-plugins-stripe-woo"):(0,C.__)("Activate and continue","checkout-plugins-stripe-woo"))))),a?(0,t.createElement)("div",{className:"bg-cart-50 p-4 fixed left-0 top-0 right-0 transition ease-in-out delay-150"},(0,t.createElement)("div",{className:"block"},(0,t.createElement)("div",{className:"text-center justify-center"},(0,t.createElement)("p",{className:"text-sm mx-auto w-full text-cart-500 text-center"},(0,C.__)("Installing WooCommerce will take time. Please be patient.","checkout-plugins-stripe-woo"))))):"",i?(0,t.createElement)("div",{className:"bg-cart-50 p-4 fixed left-0 top-0 right-0 transition ease-in-out delay-150"},(0,t.createElement)("div",{className:"block"},(0,t.createElement)("div",{className:"text-center justify-center"},(0,t.createElement)("p",{className:"text-sm mx-auto w-full text-cart-500 text-center"},(0,C.__)("WooCommerce installing failed. Please try again.","checkout-plugins-stripe-woo"))))):"")},Xe=function(){return(0,t.createElement)("div",null,(0,t.createElement)("div",{className:"relative pt-6 px-4 sm:px-6 lg:px-8"},(0,t.createElement)("nav",{className:"relative flex items-center justify-center sm:h-10","aria-label":"Logo"},(0,t.createElement)("div",{className:"flex items-center justify-center flex-grow"},(0,t.createElement)("div",{className:"flex items-center w-auto"},(0,t.createElement)("img",{className:"h-16 w-full",src:onboarding_vars.assets_url+"images/cpsw-logo.svg",alt:"Checkout Plugins - Stripe for WooCommerce"}))))))};o().render((0,t.createElement)((function(e){let{basename:t,children:r,window:a}=e,o=(0,n.useRef)();null==o.current&&(o.current=function(e){function t(){var e=s.location,t=d.state||{};return[t.idx,{pathname:e.pathname,search:e.search,hash:e.hash,state:t.usr||null,key:t.key||"default"}]}function n(e){return"string"==typeof e?e:function(e){var t=e.pathname;t=void 0===t?"/":t;var n=e.search;return n=void 0===n?"":n,e=void 0===(e=e.hash)?"":e,n&&"?"!==n&&(t+="?"===n.charAt(0)?n:"?"+n),e&&"#"!==e&&(t+="#"===e.charAt(0)?e:"#"+e),t}(e)}function r(e,t){return void 0===t&&(t=null),i({pathname:v.pathname,hash:"",search:""},"string"==typeof e?m(e):e,{state:t,key:Math.random().toString(36).substr(2,8)})}function a(e){f=e,e=t(),b=e[0],v=e[1],x.call({action:f,location:v})}function o(e){d.go(e)}void 0===e&&(e={});var s=void 0===(e=e.window)?document.defaultView:e,d=s.history,p=null;s.addEventListener("popstate",(function(){if(p)g.call(p),p=null;else{var e=l.Pop,n=t(),r=n[0];if(n=n[1],g.length){if(null!=r){var i=b-r;i&&(p={action:e,location:n,retry:function(){o(-1*i)}},o(i))}}else a(e)}}));var f=l.Pop,b=(e=t())[0],v=e[1],x=u(),g=u();return null==b&&(b=0,d.replaceState(i({},d.state,{idx:b}),"")),{get action(){return f},get location(){return v},createHref:n,push:function e(t,o){var i=l.Push,c=r(t,o);if(!g.length||(g.call({action:i,location:c,retry:function(){e(t,o)}}),0)){var u=[{usr:c.state,key:c.key,idx:b+1},n(c)];c=u[0],u=u[1];try{d.pushState(c,"",u)}catch(e){s.location.assign(u)}a(i)}},replace:function e(t,o){var i=l.Replace,s=r(t,o);g.length&&(g.call({action:i,location:s,retry:function(){e(t,o)}}),1)||(s=[{usr:s.state,key:s.key,idx:b},n(s)],d.replaceState(s[0],"",s[1]),a(i))},go:o,back:function(){o(-1)},forward:function(){o(1)},listen:function(e){return x.push(e)},block:function(e){var t=g.push(e);return 1===g.length&&s.addEventListener("beforeunload",c),function(){t(),g.length||s.removeEventListener("beforeunload",c)}}}}({window:a}));let s=o.current,[d,p]=(0,n.useState)({action:s.action,location:s.location});return(0,n.useLayoutEffect)((()=>s.listen(p)),[s]),(0,n.createElement)(v,{basename:t,children:r,location:d.location,navigationType:d.action,navigator:s})}),null,(0,t.createElement)((function(){const e=new URLSearchParams(g().search).get("cpsw_call");let n=(0,t.createElement)("p",null);switch(e){case"success":n=(0,t.createElement)(ce,null);break;case"failed":n=(0,t.createElement)(Ke,null);break;case"webhooks":n=(0,t.createElement)(qe,null);break;case"express-checkout":n=(0,t.createElement)(Ye,null);break;case"thank-you":n=(0,t.createElement)(Je,null);break;case"setup-woocommerce":n=(0,t.createElement)($e,null);break;default:n=(0,t.createElement)(R,null)}return(0,t.createElement)("div",{className:"relative bg-white overflow-hidden w-10/12 mx-auto my-0 rounded-xl mt-12"},(0,t.createElement)("div",{className:"max-w-7xl mx-auto overflow-x-hidden"},(0,t.createElement)("div",{className:"relative z-10 bg-white lg:w-full"},(0,t.createElement)(Xe,null),n)))}),null)),document.getElementById("cpsw-onboarding-content"))}();