WooCommerce Stripe Payment Gateway - Version 5.9.0

Version Description

  • 2021-12-09 =
  • Add - Add Stripe API to generate connection tokens, manage terminal locations, create customers, get account summary, capture payment.
  • Tweak - Remove _wcstripe_feature_upe flag and all traces of old settings.
  • Fix - Fix error when invalid card is used on Pay Order page.
  • Fix - Fix outdated data when using Blocks Checkout.
  • Add - List of payment methods that are not included for the merchant.
  • Tweak - Update how the new checkout experience is enabled.
  • Fix - Error on UPE checkout depending on the account keys set.
  • Tweak - Hide separate credit card form setting when UPE is enabled.

See changelog for all versions.

Download this release

Release Info

Developer automattic
Plugin Icon 128x128 WooCommerce Stripe Payment Gateway
Version 5.9.0
Comparing to
See all releases

Code changes from version 5.8.1 to 5.9.0

assets/css/stripe-admin-styles.css DELETED
@@ -1 +0,0 @@
1
- .wc-stripe-upe-method-selection .wc-stripe-upe-method-selection__description,.wc-stripe-upe-method-selection .wc-stripe-upe-method-selection__name,.wc-stripe-upe-method-selection .wc-stripe-upe-method-selection__status{vertical-align:middle}
 
assets/css/stripe-admin-styles.scss DELETED
@@ -1,5 +0,0 @@
1
- .wc-stripe-upe-method-selection .wc-stripe-upe-method-selection__name,
2
- .wc-stripe-upe-method-selection .wc-stripe-upe-method-selection__description,
3
- .wc-stripe-upe-method-selection .wc-stripe-upe-method-selection__status {
4
- vertical-align: middle;
5
- }
 
 
 
 
 
assets/css/stripe-styles.css CHANGED
@@ -1 +1 @@
1
- .wc-stripe-elements-field,.wc-stripe-iban-element-field{border:1px solid #ddd;margin:5px 0;padding:5px;background-color:#fff;outline:0}#payment .methods li.woocommerce-SavedPaymentMethods-token label{display:inline}#payment .methods li.woocommerce-SavedPaymentMethods-new label{display:inline}#add_payment_method #payment ul.payment_methods li img.stripe-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-icon{max-width:40px;padding-left:3px;margin:0}#add_payment_method #payment ul.payment_methods li img.stripe-bancontact-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-bancontact-icon{max-height:65px;max-width:45px}#add_payment_method #payment ul.payment_methods li img.stripe-ideal-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-ideal-icon{max-height:35px}#add_payment_method #payment ul.payment_methods li img.stripe-p24-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-p24-icon{max-width:65px}#add_payment_method #payment ul.payment_methods li img.stripe-alipay-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-alipay-icon{max-width:50px}#add_payment_method #payment ul.payment_methods li img.stripe-sofort-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-sofort-icon{max-width:55px}#add_payment_method #payment ul.payment_methods li img.stripe-sepa-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-sepa-icon{max-width:50px}#add_payment_method #payment ul.payment_methods li img.stripe-multibanco-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-multibanco-icon{max-height:30px}#add_payment_method #payment ul.payment_methods li img.stripe-eps-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-eps-icon{max-height:30px}#add_payment_method #payment ul.payment_methods li img.stripe-giropay-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-giropay-icon{max-width:50px}#add_payment_method #payment ul.payment_methods li .stripe-credit-card-brand,.woocommerce-checkout #payment ul.payment_methods li .stripe-credit-card-brand{position:absolute;top:50%;margin-top:-10px;right:10px;background:no-repeat url(../images/credit-card.svg);display:block;width:30px;height:24px}#add_payment_method #payment ul.payment_methods li .stripe-visa-brand,.woocommerce-checkout #payment ul.payment_methods li .stripe-visa-brand{position:absolute;top:50%;margin-top:-10px;right:10px;background:no-repeat url(../images/visa.svg);display:block;width:30px;height:24px}#add_payment_method #payment ul.payment_methods li .stripe-amex-brand,.woocommerce-checkout #payment ul.payment_methods li .stripe-amex-brand{position:absolute;top:50%;margin-top:-10px;right:10px;background:no-repeat url(../images/amex.svg);display:block;width:30px;height:24px}#add_payment_method #payment ul.payment_methods li .stripe-diners-brand,.woocommerce-checkout #payment ul.payment_methods li .stripe-diners-brand{position:absolute;top:50%;margin-top:-10px;right:10px;background:no-repeat url(../images/diners.svg);display:block;width:30px;height:24px}#add_payment_method #payment ul.payment_methods li .stripe-discover-brand,.woocommerce-checkout #payment ul.payment_methods li .stripe-discover-brand{position:absolute;top:50%;margin-top:-10px;right:10px;background:no-repeat url(../images/discover.svg);display:block;width:30px;height:24px}#add_payment_method #payment ul.payment_methods li .stripe-jcb-brand,.woocommerce-checkout #payment ul.payment_methods li .stripe-jcb-brand{position:absolute;top:50%;margin-top:-10px;right:10px;background:no-repeat url(../images/jcb.svg);display:block;width:30px;height:24px}#add_payment_method #payment ul.payment_methods li .stripe-maestro-brand,.woocommerce-checkout #payment ul.payment_methods li .stripe-maestro-brand{position:absolute;top:50%;margin-top:-10px;right:10px;background:no-repeat url(../images/maestro.svg);display:block;width:30px;height:24px}#add_payment_method #payment ul.payment_methods li .stripe-mastercard-brand,.woocommerce-checkout #payment ul.payment_methods li .stripe-mastercard-brand{position:absolute;top:50%;margin-top:-10px;right:10px;background:no-repeat url(../images/mastercard.svg);display:block;width:30px;height:24px}#add_payment_method #payment ul.payment_methods .stripe-card-group,.woocommerce-checkout #payment ul.payment_methods .stripe-card-group{position:relative}.woocommerce-SavedPaymentMethods-token .stripe-source-errors .woocommerce-error{margin-top:1em;margin-bottom:2em}#wc-stripe-custom-button{display:block;width:100%}.gpay-button{background-origin:content-box;background-position:center center;background-repeat:no-repeat;background-size:contain;border:0;border-radius:4px;cursor:pointer;height:40px;min-height:40px;padding:11px 24px;width:100%}.gpay-button.light{width:calc(100% - 3px);background-color:#fff;margin:2px 0 3px 0}.gpay-button.light:active{background-color:#fff}.gpay-button.light:hover{background-color:#f8f8f8}.gpay-button.light:focus{box-shadow:#e8e8e8 0 1px 1px 0,#e8e8e8 0 1px 3px;outline:0}.gpay-button.light-outline{width:calc(100% - 3px);background-color:#fff;box-shadow:rgba(60,64,67,.3) 0 1px 1px 0,rgba(60,64,67,.15) 0 1px 3px 1px;margin:2px 0 3px 0}.gpay-button.light-outline:active{background-color:#fff}.gpay-button.light-outline:hover{background-color:#f8f8f8}.gpay-button.light-outline:focus{box-shadow:#e8e8e8 0 1px 1px 0,#e8e8e8 0 1px 3px;outline:0}.gpay-button.dark{background-color:#000;padding:12px 24px 10px}.gpay-button.dark:active{background-color:#5f6368}.gpay-button.dark:hover{background-color:#3c4043}.gpay-button.dark:focus{box-shadow:#5f6368 0 1px 1px 0,#5f6368 0 1px 3px;outline:0}.gpay-button.short.light,.gpay-button.short.light-outline{background-image:url(https://www.gstatic.com/instantbuy/svg/light_gpay.svg)}.gpay-button.short.dark{background-image:url(https://www.gstatic.com/instantbuy/svg/dark_gpay.svg)}
1
+ .wc-stripe-elements-field,.wc-stripe-iban-element-field{border:1px solid #ddd;margin:5px 0;padding:5px;background-color:#fff;outline:0}#payment .methods li.woocommerce-SavedPaymentMethods-token label{display:inline}#payment .methods li.woocommerce-SavedPaymentMethods-new label{display:inline}#add_payment_method #payment ul.payment_methods li img.stripe-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-icon{max-width:40px;padding-left:3px;margin:0}#add_payment_method #payment ul.payment_methods li img.stripe-bancontact-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-bancontact-icon{max-height:65px;max-width:45px}#add_payment_method #payment ul.payment_methods li img.stripe-ideal-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-ideal-icon{max-height:35px}#add_payment_method #payment ul.payment_methods li img.stripe-p24-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-p24-icon{max-width:65px}#add_payment_method #payment ul.payment_methods li img.stripe-alipay-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-alipay-icon{max-width:50px}#add_payment_method #payment ul.payment_methods li img.stripe-sofort-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-sofort-icon{max-width:55px}#add_payment_method #payment ul.payment_methods li img.stripe-sepa-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-sepa-icon{max-width:50px}#add_payment_method #payment ul.payment_methods li img.stripe-multibanco-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-multibanco-icon{max-height:30px}#add_payment_method #payment ul.payment_methods li img.stripe-eps-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-eps-icon{max-height:30px}#add_payment_method #payment ul.payment_methods li img.stripe-giropay-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-giropay-icon{max-width:50px}#add_payment_method #payment ul.payment_methods li .stripe-credit-card-brand,.woocommerce-checkout #payment ul.payment_methods li .stripe-credit-card-brand{position:absolute;top:50%;margin-top:-10px;right:10px;background:no-repeat url(../images/credit-card.svg);display:block;width:30px;height:24px}#add_payment_method #payment ul.payment_methods li .stripe-visa-brand,.woocommerce-checkout #payment ul.payment_methods li .stripe-visa-brand{position:absolute;top:50%;margin-top:-10px;right:10px;background:no-repeat url(../images/visa.svg);display:block;width:30px;height:24px}#add_payment_method #payment ul.payment_methods li .stripe-amex-brand,.woocommerce-checkout #payment ul.payment_methods li .stripe-amex-brand{position:absolute;top:50%;margin-top:-10px;right:10px;background:no-repeat url(../images/amex.svg);display:block;width:30px;height:24px}#add_payment_method #payment ul.payment_methods li .stripe-diners-brand,.woocommerce-checkout #payment ul.payment_methods li .stripe-diners-brand{position:absolute;top:50%;margin-top:-10px;right:10px;background:no-repeat url(../images/diners.svg);display:block;width:30px;height:24px}#add_payment_method #payment ul.payment_methods li .stripe-discover-brand,.woocommerce-checkout #payment ul.payment_methods li .stripe-discover-brand{position:absolute;top:50%;margin-top:-10px;right:10px;background:no-repeat url(../images/discover.svg);display:block;width:30px;height:24px}#add_payment_method #payment ul.payment_methods li .stripe-jcb-brand,.woocommerce-checkout #payment ul.payment_methods li .stripe-jcb-brand{position:absolute;top:50%;margin-top:-10px;right:10px;background:no-repeat url(../images/jcb.svg);display:block;width:30px;height:24px}#add_payment_method #payment ul.payment_methods li .stripe-maestro-brand,.woocommerce-checkout #payment ul.payment_methods li .stripe-maestro-brand{position:absolute;top:50%;margin-top:-10px;right:10px;background:no-repeat url(../images/maestro.svg);display:block;width:30px;height:24px}#add_payment_method #payment ul.payment_methods li .stripe-mastercard-brand,.woocommerce-checkout #payment ul.payment_methods li .stripe-mastercard-brand{position:absolute;top:50%;margin-top:-10px;right:10px;background:no-repeat url(../images/mastercard.svg);display:block;width:30px;height:24px}#add_payment_method #payment ul.payment_methods .stripe-card-group,.woocommerce-checkout #payment ul.payment_methods .stripe-card-group{position:relative}.woocommerce-SavedPaymentMethods-token .stripe-source-errors .woocommerce-error{margin-top:1em;margin-bottom:2em}#wc-stripe-custom-button{display:block;width:100%}.woocommerce-checkout #payment #stripe_boleto_tax_id{width:100%}.gpay-button{background-origin:content-box;background-position:center center;background-repeat:no-repeat;background-size:contain;border:0;border-radius:4px;cursor:pointer;height:40px;min-height:40px;padding:11px 24px;width:100%}.gpay-button.light{width:calc(100% - 3px);background-color:#fff;margin:2px 0 3px 0}.gpay-button.light:active{background-color:#fff}.gpay-button.light:hover{background-color:#f8f8f8}.gpay-button.light:focus{box-shadow:#e8e8e8 0 1px 1px 0,#e8e8e8 0 1px 3px;outline:0}.gpay-button.light-outline{width:calc(100% - 3px);background-color:#fff;box-shadow:rgba(60,64,67,.3) 0 1px 1px 0,rgba(60,64,67,.15) 0 1px 3px 1px;margin:2px 0 3px 0}.gpay-button.light-outline:active{background-color:#fff}.gpay-button.light-outline:hover{background-color:#f8f8f8}.gpay-button.light-outline:focus{box-shadow:#e8e8e8 0 1px 1px 0,#e8e8e8 0 1px 3px;outline:0}.gpay-button.dark{background-color:#000;padding:12px 24px 10px}.gpay-button.dark:active{background-color:#5f6368}.gpay-button.dark:hover{background-color:#3c4043}.gpay-button.dark:focus{box-shadow:#5f6368 0 1px 1px 0,#5f6368 0 1px 3px;outline:0}.gpay-button.short.light,.gpay-button.short.light-outline{background-image:url(https://www.gstatic.com/instantbuy/svg/light_gpay.svg)}.gpay-button.short.dark{background-image:url(https://www.gstatic.com/instantbuy/svg/dark_gpay.svg)}
assets/css/stripe-styles.scss CHANGED
@@ -180,6 +180,10 @@
180
  width: 100%;
181
  }
182
 
 
 
 
 
183
  .gpay-button {
184
  background-origin: content-box;
185
  background-position: center center;
180
  width: 100%;
181
  }
182
 
183
+ .woocommerce-checkout #payment #stripe_boleto_tax_id {
184
+ width: 100%;
185
+ }
186
+
187
  .gpay-button {
188
  background-origin: content-box;
189
  background-position: center center;
assets/images/boleto.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg width="48" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M0 0h1v20H0V0Zm2 0h3v20H2V0Zm5 0H6v20h1V0Zm9 0h1v20h-1V0Zm4 0h-1v20h1V0ZM8 0h1v20H8V0Zm19 0h-1v20h1V0Zm7 0h-1v20h1V0Zm3 0h1v20h-1V0Zm3 0h-1v20h1V0Zm1 0h3v20h-3V0Zm6 0h1v20h-1V0Zm-1 0h-1v20h1V0ZM29 0h3v20h-3V0Zm-5 0h-3v20h3V0ZM14 0h1v20h-1V0Zm-1 0h-3v20h3V0Z" fill="#000"/></svg>
assets/images/oxxo.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg width="48" height="24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 2.926C0 1.343 1.271.059 2.84.059h41.673c1.568 0 2.84 1.284 2.84 2.867v18.133c0 1.582-1.272 2.865-2.84 2.865H2.84C1.271 23.924 0 22.641 0 21.06V2.926Z" fill="#fff"/><path d="M.033 2.636C.033 1.181 1.203 0 2.645 0H44.75c1.442 0 2.611 1.18 2.611 2.636v.084H.033v-.084ZM47.36 21.298v.066c0 1.455-1.169 2.636-2.611 2.636H2.645C1.203 24 .033 22.82.033 21.364v-.066H47.36Z" fill="#FBB110"/><path d="M32.787 11.972c0 3.685 2.96 6.672 6.612 6.672 3.65 0 6.612-2.987 6.612-6.672 0-3.686-2.961-6.673-6.612-6.673-3.652 0-6.612 2.987-6.612 6.673Zm-31.523 0c0 3.685 2.961 6.672 6.613 6.672 3.651 0 6.612-2.987 6.612-6.672 0-3.686-2.96-6.673-6.612-6.673s-6.613 2.987-6.613 6.673Zm46.096 8.063h-32.6c.588-.416 1.135-.986 1.732-1.754l3.32-4.276 1.451 1.85 1.614-2.167-1.411-1.813 3.38-4.354c1.073-1.38-.98-3.004-2.053-1.623l-2.987 3.849-3.037-3.9c-1.074-1.377-3.123.25-2.048 1.629l3.432 4.4-3.714 4.782c-1.32 1.7-2.636 3.257-5.25 3.377H.033V3.983H32.46c-.557.411-1.083.962-1.654 1.698l-3.32 4.275-1.451-1.848-1.613 2.166 1.411 1.812-3.381 4.353c-1.072 1.381.98 3.005 2.052 1.623l2.989-3.847 3.037 3.899c1.074 1.378 3.123-.25 2.048-1.628l-3.432-4.402 3.714-4.78c1.212-1.563 2.422-3.005 4.64-3.32h9.86v16.051Zm-11.92-8.063c0-2.207 1.773-3.995 3.959-3.995s3.957 1.788 3.957 3.995c0 2.206-1.771 3.994-3.957 3.994s-3.958-1.788-3.958-3.994Zm-31.52 0c0-2.207 1.771-3.995 3.957-3.995 2.185 0 3.958 1.788 3.958 3.995 0 2.206-1.773 3.994-3.958 3.994-2.186 0-3.958-1.788-3.958-3.994Z" fill="#E70020"/></svg>
assets/js/jquery.mask.js ADDED
@@ -0,0 +1,604 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * jquery.mask.js
3
+ * @version: v1.14.16
4
+ * @author: Igor Escobar
5
+ *
6
+ * Created by Igor Escobar on 2012-03-10. Please report any bug at github.com/igorescobar/jQuery-Mask-Plugin
7
+ *
8
+ * Copyright (c) 2012 Igor Escobar http://igorescobar.com
9
+ *
10
+ * The MIT License (http://www.opensource.org/licenses/mit-license.php)
11
+ *
12
+ * Permission is hereby granted, free of charge, to any person
13
+ * obtaining a copy of this software and associated documentation
14
+ * files (the "Software"), to deal in the Software without
15
+ * restriction, including without limitation the rights to use,
16
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell
17
+ * copies of the Software, and to permit persons to whom the
18
+ * Software is furnished to do so, subject to the following
19
+ * conditions:
20
+ *
21
+ * The above copyright notice and this permission notice shall be
22
+ * included in all copies or substantial portions of the Software.
23
+ *
24
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
26
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
28
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
29
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
30
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
31
+ * OTHER DEALINGS IN THE SOFTWARE.
32
+ */
33
+
34
+ /* jshint laxbreak: true */
35
+ /* jshint maxcomplexity:17 */
36
+ /* global define */
37
+
38
+ // UMD (Universal Module Definition) patterns for JavaScript modules that work everywhere.
39
+ // https://github.com/umdjs/umd/blob/master/templates/jqueryPlugin.js
40
+ (function (factory, jQuery, Zepto) {
41
+
42
+ if (typeof define === 'function' && define.amd) {
43
+ define(['jquery'], factory);
44
+ } else if (typeof exports === 'object' && typeof Meteor === 'undefined') {
45
+ module.exports = factory(require('jquery'));
46
+ } else {
47
+ factory(jQuery || Zepto);
48
+ }
49
+
50
+ }(function ($) {
51
+ 'use strict';
52
+
53
+ var Mask = function (el, mask, options) {
54
+
55
+ var p = {
56
+ invalid: [],
57
+ getCaret: function () {
58
+ try {
59
+ var sel,
60
+ pos = 0,
61
+ ctrl = el.get(0),
62
+ dSel = document.selection,
63
+ cSelStart = ctrl.selectionStart;
64
+
65
+ // IE Support
66
+ if (dSel && navigator.appVersion.indexOf('MSIE 10') === -1) {
67
+ sel = dSel.createRange();
68
+ sel.moveStart('character', -p.val().length);
69
+ pos = sel.text.length;
70
+ }
71
+ // Firefox support
72
+ else if (cSelStart || cSelStart === '0') {
73
+ pos = cSelStart;
74
+ }
75
+
76
+ return pos;
77
+ } catch (e) {}
78
+ },
79
+ setCaret: function(pos) {
80
+ try {
81
+ if (el.is(':focus')) {
82
+ var range, ctrl = el.get(0);
83
+
84
+ // Firefox, WebKit, etc..
85
+ if (ctrl.setSelectionRange) {
86
+ ctrl.setSelectionRange(pos, pos);
87
+ } else { // IE
88
+ range = ctrl.createTextRange();
89
+ range.collapse(true);
90
+ range.moveEnd('character', pos);
91
+ range.moveStart('character', pos);
92
+ range.select();
93
+ }
94
+ }
95
+ } catch (e) {}
96
+ },
97
+ events: function() {
98
+ el
99
+ .on('keydown.mask', function(e) {
100
+ el.data('mask-keycode', e.keyCode || e.which);
101
+ el.data('mask-previus-value', el.val());
102
+ el.data('mask-previus-caret-pos', p.getCaret());
103
+ p.maskDigitPosMapOld = p.maskDigitPosMap;
104
+ })
105
+ .on($.jMaskGlobals.useInput ? 'input.mask' : 'keyup.mask', p.behaviour)
106
+ .on('paste.mask drop.mask', function() {
107
+ setTimeout(function() {
108
+ el.keydown().keyup();
109
+ }, 100);
110
+ })
111
+ .on('change.mask', function(){
112
+ el.data('changed', true);
113
+ })
114
+ .on('blur.mask', function(){
115
+ if (oldValue !== p.val() && !el.data('changed')) {
116
+ el.trigger('change');
117
+ }
118
+ el.data('changed', false);
119
+ })
120
+ // it's very important that this callback remains in this position
121
+ // otherwhise oldValue it's going to work buggy
122
+ .on('blur.mask', function() {
123
+ oldValue = p.val();
124
+ })
125
+ // select all text on focus
126
+ .on('focus.mask', function (e) {
127
+ if (options.selectOnFocus === true) {
128
+ $(e.target).select();
129
+ }
130
+ })
131
+ // clear the value if it not complete the mask
132
+ .on('focusout.mask', function() {
133
+ if (options.clearIfNotMatch && !regexMask.test(p.val())) {
134
+ p.val('');
135
+ }
136
+ });
137
+ },
138
+ getRegexMask: function() {
139
+ var maskChunks = [], translation, pattern, optional, recursive, oRecursive, r;
140
+
141
+ for (var i = 0; i < mask.length; i++) {
142
+ translation = jMask.translation[mask.charAt(i)];
143
+
144
+ if (translation) {
145
+
146
+ pattern = translation.pattern.toString().replace(/.{1}$|^.{1}/g, '');
147
+ optional = translation.optional;
148
+ recursive = translation.recursive;
149
+
150
+ if (recursive) {
151
+ maskChunks.push(mask.charAt(i));
152
+ oRecursive = {digit: mask.charAt(i), pattern: pattern};
153
+ } else {
154
+ maskChunks.push(!optional && !recursive ? pattern : (pattern + '?'));
155
+ }
156
+
157
+ } else {
158
+ maskChunks.push(mask.charAt(i).replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'));
159
+ }
160
+ }
161
+
162
+ r = maskChunks.join('');
163
+
164
+ if (oRecursive) {
165
+ r = r.replace(new RegExp('(' + oRecursive.digit + '(.*' + oRecursive.digit + ')?)'), '($1)?')
166
+ .replace(new RegExp(oRecursive.digit, 'g'), oRecursive.pattern);
167
+ }
168
+
169
+ return new RegExp(r);
170
+ },
171
+ destroyEvents: function() {
172
+ el.off(['input', 'keydown', 'keyup', 'paste', 'drop', 'blur', 'focusout', ''].join('.mask '));
173
+ },
174
+ val: function(v) {
175
+ var isInput = el.is('input'),
176
+ method = isInput ? 'val' : 'text',
177
+ r;
178
+
179
+ if (arguments.length > 0) {
180
+ if (el[method]() !== v) {
181
+ el[method](v);
182
+ }
183
+ r = el;
184
+ } else {
185
+ r = el[method]();
186
+ }
187
+
188
+ return r;
189
+ },
190
+ calculateCaretPosition: function(oldVal) {
191
+ var newVal = p.getMasked(),
192
+ caretPosNew = p.getCaret();
193
+ if (oldVal !== newVal) {
194
+ var caretPosOld = el.data('mask-previus-caret-pos') || 0,
195
+ newValL = newVal.length,
196
+ oldValL = oldVal.length,
197
+ maskDigitsBeforeCaret = 0,
198
+ maskDigitsAfterCaret = 0,
199
+ maskDigitsBeforeCaretAll = 0,
200
+ maskDigitsBeforeCaretAllOld = 0,
201
+ i = 0;
202
+
203
+ for (i = caretPosNew; i < newValL; i++) {
204
+ if (!p.maskDigitPosMap[i]) {
205
+ break;
206
+ }
207
+ maskDigitsAfterCaret++;
208
+ }
209
+
210
+ for (i = caretPosNew - 1; i >= 0; i--) {
211
+ if (!p.maskDigitPosMap[i]) {
212
+ break;
213
+ }
214
+ maskDigitsBeforeCaret++;
215
+ }
216
+
217
+ for (i = caretPosNew - 1; i >= 0; i--) {
218
+ if (p.maskDigitPosMap[i]) {
219
+ maskDigitsBeforeCaretAll++;
220
+ }
221
+ }
222
+
223
+ for (i = caretPosOld - 1; i >= 0; i--) {
224
+ if (p.maskDigitPosMapOld[i]) {
225
+ maskDigitsBeforeCaretAllOld++;
226
+ }
227
+ }
228
+
229
+ // if the cursor is at the end keep it there
230
+ if (caretPosNew > oldValL) {
231
+ caretPosNew = newValL * 10;
232
+ } else if (caretPosOld >= caretPosNew && caretPosOld !== oldValL) {
233
+ if (!p.maskDigitPosMapOld[caretPosNew]) {
234
+ var caretPos = caretPosNew;
235
+ caretPosNew -= maskDigitsBeforeCaretAllOld - maskDigitsBeforeCaretAll;
236
+ caretPosNew -= maskDigitsBeforeCaret;
237
+ if (p.maskDigitPosMap[caretPosNew]) {
238
+ caretPosNew = caretPos;
239
+ }
240
+ }
241
+ }
242
+ else if (caretPosNew > caretPosOld) {
243
+ caretPosNew += maskDigitsBeforeCaretAll - maskDigitsBeforeCaretAllOld;
244
+ caretPosNew += maskDigitsAfterCaret;
245
+ }
246
+ }
247
+ return caretPosNew;
248
+ },
249
+ behaviour: function(e) {
250
+ e = e || window.event;
251
+ p.invalid = [];
252
+
253
+ var keyCode = el.data('mask-keycode');
254
+
255
+ if ($.inArray(keyCode, jMask.byPassKeys) === -1) {
256
+ var newVal = p.getMasked(),
257
+ caretPos = p.getCaret(),
258
+ oldVal = el.data('mask-previus-value') || '';
259
+
260
+ // this is a compensation to devices/browsers that don't compensate
261
+ // caret positioning the right way
262
+ setTimeout(function() {
263
+ p.setCaret(p.calculateCaretPosition(oldVal));
264
+ }, $.jMaskGlobals.keyStrokeCompensation);
265
+
266
+ p.val(newVal);
267
+ p.setCaret(caretPos);
268
+ return p.callbacks(e);
269
+ }
270
+ },
271
+ getMasked: function(skipMaskChars, val) {
272
+ var buf = [],
273
+ value = val === undefined ? p.val() : val + '',
274
+ m = 0, maskLen = mask.length,
275
+ v = 0, valLen = value.length,
276
+ offset = 1, addMethod = 'push',
277
+ resetPos = -1,
278
+ maskDigitCount = 0,
279
+ maskDigitPosArr = [],
280
+ lastMaskChar,
281
+ check;
282
+
283
+ if (options.reverse) {
284
+ addMethod = 'unshift';
285
+ offset = -1;
286
+ lastMaskChar = 0;
287
+ m = maskLen - 1;
288
+ v = valLen - 1;
289
+ check = function () {
290
+ return m > -1 && v > -1;
291
+ };
292
+ } else {
293
+ lastMaskChar = maskLen - 1;
294
+ check = function () {
295
+ return m < maskLen && v < valLen;
296
+ };
297
+ }
298
+
299
+ var lastUntranslatedMaskChar;
300
+ while (check()) {
301
+ var maskDigit = mask.charAt(m),
302
+ valDigit = value.charAt(v),
303
+ translation = jMask.translation[maskDigit];
304
+
305
+ if (translation) {
306
+ if (valDigit.match(translation.pattern)) {
307
+ buf[addMethod](valDigit);
308
+ if (translation.recursive) {
309
+ if (resetPos === -1) {
310
+ resetPos = m;
311
+ } else if (m === lastMaskChar && m !== resetPos) {
312
+ m = resetPos - offset;
313
+ }
314
+
315
+ if (lastMaskChar === resetPos) {
316
+ m -= offset;
317
+ }
318
+ }
319
+ m += offset;
320
+ } else if (valDigit === lastUntranslatedMaskChar) {
321
+ // matched the last untranslated (raw) mask character that we encountered
322
+ // likely an insert offset the mask character from the last entry; fall
323
+ // through and only increment v
324
+ maskDigitCount--;
325
+ lastUntranslatedMaskChar = undefined;
326
+ } else if (translation.optional) {
327
+ m += offset;
328
+ v -= offset;
329
+ } else if (translation.fallback) {
330
+ buf[addMethod](translation.fallback);
331
+ m += offset;
332
+ v -= offset;
333
+ } else {
334
+ p.invalid.push({p: v, v: valDigit, e: translation.pattern});
335
+ }
336
+ v += offset;
337
+ } else {
338
+ if (!skipMaskChars) {
339
+ buf[addMethod](maskDigit);
340
+ }
341
+
342
+ if (valDigit === maskDigit) {
343
+ maskDigitPosArr.push(v);
344
+ v += offset;
345
+ } else {
346
+ lastUntranslatedMaskChar = maskDigit;
347
+ maskDigitPosArr.push(v + maskDigitCount);
348
+ maskDigitCount++;
349
+ }
350
+
351
+ m += offset;
352
+ }
353
+ }
354
+
355
+ var lastMaskCharDigit = mask.charAt(lastMaskChar);
356
+ if (maskLen === valLen + 1 && !jMask.translation[lastMaskCharDigit]) {
357
+ buf.push(lastMaskCharDigit);
358
+ }
359
+
360
+ var newVal = buf.join('');
361
+ p.mapMaskdigitPositions(newVal, maskDigitPosArr, valLen);
362
+ return newVal;
363
+ },
364
+ mapMaskdigitPositions: function(newVal, maskDigitPosArr, valLen) {
365
+ var maskDiff = options.reverse ? newVal.length - valLen : 0;
366
+ p.maskDigitPosMap = {};
367
+ for (var i = 0; i < maskDigitPosArr.length; i++) {
368
+ p.maskDigitPosMap[maskDigitPosArr[i] + maskDiff] = 1;
369
+ }
370
+ },
371
+ callbacks: function (e) {
372
+ var val = p.val(),
373
+ changed = val !== oldValue,
374
+ defaultArgs = [val, e, el, options],
375
+ callback = function(name, criteria, args) {
376
+ if (typeof options[name] === 'function' && criteria) {
377
+ options[name].apply(this, args);
378
+ }
379
+ };
380
+
381
+ callback('onChange', changed === true, defaultArgs);
382
+ callback('onKeyPress', changed === true, defaultArgs);
383
+ callback('onComplete', val.length === mask.length, defaultArgs);
384
+ callback('onInvalid', p.invalid.length > 0, [val, e, el, p.invalid, options]);
385
+ }
386
+ };
387
+
388
+ el = $(el);
389
+ var jMask = this, oldValue = p.val(), regexMask;
390
+
391
+ mask = typeof mask === 'function' ? mask(p.val(), undefined, el, options) : mask;
392
+
393
+ // public methods
394
+ jMask.mask = mask;
395
+ jMask.options = options;
396
+ jMask.remove = function() {
397
+ var caret = p.getCaret();
398
+ if (jMask.options.placeholder) {
399
+ el.removeAttr('placeholder');
400
+ }
401
+ if (el.data('mask-maxlength')) {
402
+ el.removeAttr('maxlength');
403
+ }
404
+ p.destroyEvents();
405
+ p.val(jMask.getCleanVal());
406
+ p.setCaret(caret);
407
+ return el;
408
+ };
409
+
410
+ // get value without mask
411
+ jMask.getCleanVal = function() {
412
+ return p.getMasked(true);
413
+ };
414
+
415
+ // get masked value without the value being in the input or element
416
+ jMask.getMaskedVal = function(val) {
417
+ return p.getMasked(false, val);
418
+ };
419
+
420
+ jMask.init = function(onlyMask) {
421
+ onlyMask = onlyMask || false;
422
+ options = options || {};
423
+
424
+ jMask.clearIfNotMatch = $.jMaskGlobals.clearIfNotMatch;
425
+ jMask.byPassKeys = $.jMaskGlobals.byPassKeys;
426
+ jMask.translation = $.extend({}, $.jMaskGlobals.translation, options.translation);
427
+
428
+ jMask = $.extend(true, {}, jMask, options);
429
+
430
+ regexMask = p.getRegexMask();
431
+
432
+ if (onlyMask) {
433
+ p.events();
434
+ p.val(p.getMasked());
435
+ } else {
436
+ if (options.placeholder) {
437
+ el.attr('placeholder' , options.placeholder);
438
+ }
439
+
440
+ // this is necessary, otherwise if the user submit the form
441
+ // and then press the "back" button, the autocomplete will erase
442
+ // the data. Works fine on IE9+, FF, Opera, Safari.
443
+ if (el.data('mask')) {
444
+ el.attr('autocomplete', 'off');
445
+ }
446
+
447
+ // detect if is necessary let the user type freely.
448
+ // for is a lot faster than forEach.
449
+ for (var i = 0, maxlength = true; i < mask.length; i++) {
450
+ var translation = jMask.translation[mask.charAt(i)];
451
+ if (translation && translation.recursive) {
452
+ maxlength = false;
453
+ break;
454
+ }
455
+ }
456
+
457
+ if (maxlength) {
458
+ el.attr('maxlength', mask.length).data('mask-maxlength', true);
459
+ }
460
+
461
+ p.destroyEvents();
462
+ p.events();
463
+
464
+ var caret = p.getCaret();
465
+ p.val(p.getMasked());
466
+ p.setCaret(caret);
467
+ }
468
+ };
469
+
470
+ jMask.init(!el.is('input'));
471
+ };
472
+
473
+ $.maskWatchers = {};
474
+ var HTMLAttributes = function () {
475
+ var input = $(this),
476
+ options = {},
477
+ prefix = 'data-mask-',
478
+ mask = input.attr('data-mask');
479
+
480
+ if (input.attr(prefix + 'reverse')) {
481
+ options.reverse = true;
482
+ }
483
+
484
+ if (input.attr(prefix + 'clearifnotmatch')) {
485
+ options.clearIfNotMatch = true;
486
+ }
487
+
488
+ if (input.attr(prefix + 'selectonfocus') === 'true') {
489
+ options.selectOnFocus = true;
490
+ }
491
+
492
+ if (notSameMaskObject(input, mask, options)) {
493
+ return input.data('mask', new Mask(this, mask, options));
494
+ }
495
+ },
496
+ notSameMaskObject = function(field, mask, options) {
497
+ options = options || {};
498
+ var maskObject = $(field).data('mask'),
499
+ stringify = JSON.stringify,
500
+ value = $(field).val() || $(field).text();
501
+ try {
502
+ if (typeof mask === 'function') {
503
+ mask = mask(value);
504
+ }
505
+ return typeof maskObject !== 'object' || stringify(maskObject.options) !== stringify(options) || maskObject.mask !== mask;
506
+ } catch (e) {}
507
+ },
508
+ eventSupported = function(eventName) {
509
+ var el = document.createElement('div'), isSupported;
510
+
511
+ eventName = 'on' + eventName;
512
+ isSupported = (eventName in el);
513
+
514
+ if ( !isSupported ) {
515
+ el.setAttribute(eventName, 'return;');
516
+ isSupported = typeof el[eventName] === 'function';
517
+ }
518
+ el = null;
519
+
520
+ return isSupported;
521
+ };
522
+
523
+ $.fn.mask = function(mask, options) {
524
+ options = options || {};
525
+ var selector = this.selector,
526
+ globals = $.jMaskGlobals,
527
+ interval = globals.watchInterval,
528
+ watchInputs = options.watchInputs || globals.watchInputs,
529
+ maskFunction = function() {
530
+ if (notSameMaskObject(this, mask, options)) {
531
+ return $(this).data('mask', new Mask(this, mask, options));
532
+ }
533
+ };
534
+
535
+ $(this).each(maskFunction);
536
+
537
+ if (selector && selector !== '' && watchInputs) {
538
+ clearInterval($.maskWatchers[selector]);
539
+ $.maskWatchers[selector] = setInterval(function(){
540
+ $(document).find(selector).each(maskFunction);
541
+ }, interval);
542
+ }
543
+ return this;
544
+ };
545
+
546
+ $.fn.masked = function(val) {
547
+ return this.data('mask').getMaskedVal(val);
548
+ };
549
+
550
+ $.fn.unmask = function() {
551
+ clearInterval($.maskWatchers[this.selector]);
552
+ delete $.maskWatchers[this.selector];
553
+ return this.each(function() {
554
+ var dataMask = $(this).data('mask');
555
+ if (dataMask) {
556
+ dataMask.remove().removeData('mask');
557
+ }
558
+ });
559
+ };
560
+
561
+ $.fn.cleanVal = function() {
562
+ return this.data('mask').getCleanVal();
563
+ };
564
+
565
+ $.applyDataMask = function(selector) {
566
+ selector = selector || $.jMaskGlobals.maskElements;
567
+ var $selector = (selector instanceof $) ? selector : $(selector);
568
+ $selector.filter($.jMaskGlobals.dataMaskAttr).each(HTMLAttributes);
569
+ };
570
+
571
+ var globals = {
572
+ maskElements: 'input,td,span,div',
573
+ dataMaskAttr: '*[data-mask]',
574
+ dataMask: true,
575
+ watchInterval: 300,
576
+ watchInputs: true,
577
+ keyStrokeCompensation: 10,
578
+ // old versions of chrome dont work great with input event
579
+ useInput: !/Chrome\/[2-4][0-9]|SamsungBrowser/.test(window.navigator.userAgent) && eventSupported('input'),
580
+ watchDataMask: false,
581
+ byPassKeys: [9, 16, 17, 18, 36, 37, 38, 39, 40, 91],
582
+ translation: {
583
+ '0': {pattern: /\d/},
584
+ '9': {pattern: /\d/, optional: true},
585
+ '#': {pattern: /\d/, recursive: true},
586
+ 'A': {pattern: /[a-zA-Z0-9]/},
587
+ 'S': {pattern: /[a-zA-Z]/}
588
+ }
589
+ };
590
+
591
+ $.jMaskGlobals = $.jMaskGlobals || {};
592
+ globals = $.jMaskGlobals = $.extend(true, {}, globals, $.jMaskGlobals);
593
+
594
+ // looking for inputs with data-mask attribute
595
+ if (globals.dataMask) {
596
+ $.applyDataMask();
597
+ }
598
+
599
+ setInterval(function() {
600
+ if ($.jMaskGlobals.watchDataMask) {
601
+ $.applyDataMask();
602
+ }
603
+ }, globals.watchInterval);
604
+ }, window.jQuery, window.Zepto));
assets/js/jquery.mask.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(t,a,e){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports&&"undefined"==typeof Meteor?module.exports=t(require("jquery")):t(a||e)}(function(o){"use strict";function i(u,M,y){var b={invalid:[],getCaret:function(){try{var t,a=0,e=u.get(0),n=document.selection,s=e.selectionStart;return n&&-1===navigator.appVersion.indexOf("MSIE 10")?((t=n.createRange()).moveStart("character",-b.val().length),a=t.text.length):!s&&"0"!==s||(a=s),a}catch(t){}},setCaret:function(t){try{var a,e;u.is(":focus")&&((e=u.get(0)).setSelectionRange?e.setSelectionRange(t,t):((a=e.createTextRange()).collapse(!0),a.moveEnd("character",t),a.moveStart("character",t),a.select()))}catch(t){}},events:function(){u.on("keydown.mask",function(t){u.data("mask-keycode",t.keyCode||t.which),u.data("mask-previus-value",u.val()),u.data("mask-previus-caret-pos",b.getCaret()),b.maskDigitPosMapOld=b.maskDigitPosMap}).on(o.jMaskGlobals.useInput?"input.mask":"keyup.mask",b.behaviour).on("paste.mask drop.mask",function(){setTimeout(function(){u.keydown().keyup()},100)}).on("change.mask",function(){u.data("changed",!0)}).on("blur.mask",function(){r===b.val()||u.data("changed")||u.trigger("change"),u.data("changed",!1)}).on("blur.mask",function(){r=b.val()}).on("focus.mask",function(t){!0===y.selectOnFocus&&o(t.target).select()}).on("focusout.mask",function(){y.clearIfNotMatch&&!s.test(b.val())&&b.val("")})},getRegexMask:function(){for(var t,a,e,n,s,r=[],o=0;o<M.length;o++)(e=w.translation[M.charAt(o)])?(t=e.pattern.toString().replace(/.{1}$|^.{1}/g,""),a=e.optional,(e=e.recursive)?(r.push(M.charAt(o)),n={digit:M.charAt(o),pattern:t}):r.push(a||e?t+"?":t)):r.push(M.charAt(o).replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"));return s=r.join(""),n&&(s=s.replace(new RegExp("("+n.digit+"(.*"+n.digit+")?)"),"($1)?").replace(new RegExp(n.digit,"g"),n.pattern)),new RegExp(s)},destroyEvents:function(){u.off(["input","keydown","keyup","paste","drop","blur","focusout",""].join(".mask "))},val:function(t){var a=u.is("input")?"val":"text",a=0<arguments.length?(u[a]()!==t&&u[a](t),u):u[a]();return a},calculateCaretPosition:function(t){var a=b.getMasked(),e=b.getCaret();if(t!==a){for(var n=u.data("mask-previus-caret-pos")||0,s=a.length,t=t.length,r=0,o=0,i=0,l=0,c=0,c=e;c<s&&b.maskDigitPosMap[c];c++)o++;for(c=e-1;0<=c&&b.maskDigitPosMap[c];c--)r++;for(c=e-1;0<=c;c--)b.maskDigitPosMap[c]&&i++;for(c=n-1;0<=c;c--)b.maskDigitPosMapOld[c]&&l++;t<e?e=10*s:e<=n&&n!==t?b.maskDigitPosMapOld[e]||(t=e,e-=l-i,b.maskDigitPosMap[e-=r]&&(e=t)):n<e&&(e+=i-l,e+=o)}return e},behaviour:function(t){t=t||window.event,b.invalid=[];var a=u.data("mask-keycode");if(-1===o.inArray(a,w.byPassKeys)){var e=b.getMasked(),a=b.getCaret(),n=u.data("mask-previus-value")||"";return setTimeout(function(){b.setCaret(b.calculateCaretPosition(n))},o.jMaskGlobals.keyStrokeCompensation),b.val(e),b.setCaret(a),b.callbacks(t)}},getMasked:function(t,a){for(var e,n,s=[],r=void 0===a?b.val():a+"",o=0,i=M.length,l=0,c=r.length,u=1,k="push",p=-1,d=0,f=[],h=y.reverse?(k="unshift",u=-1,e=0,o=i-1,l=c-1,function(){return-1<o&&-1<l}):(e=i-1,function(){return o<i&&l<c});h();){var v=M.charAt(o),g=r.charAt(l),m=w.translation[v];m?(g.match(m.pattern)?(s[k](g),m.recursive&&(-1===p?p=o:o===e&&o!==p&&(o=p-u),e===p&&(o-=u)),o+=u):g===n?(d--,n=void 0):m.optional?(o+=u,l-=u):m.fallback?(s[k](m.fallback),o+=u,l-=u):b.invalid.push({p:l,v:g,e:m.pattern}),l+=u):(t||s[k](v),g===v?(f.push(l),l+=u):(n=v,f.push(l+d),d++),o+=u)}a=M.charAt(e);i!==c+1||w.translation[a]||s.push(a);a=s.join("");return b.mapMaskdigitPositions(a,f,c),a},mapMaskdigitPositions:function(t,a,e){var n=y.reverse?t.length-e:0;b.maskDigitPosMap={};for(var s=0;s<a.length;s++)b.maskDigitPosMap[a[s]+n]=1},callbacks:function(t){function a(t,a,e){"function"==typeof y[t]&&a&&y[t].apply(this,e)}var e=b.val(),n=e!==r,s=[e,t,u,y];a("onChange",!0==n,s),a("onKeyPress",!0==n,s),a("onComplete",e.length===M.length,s),a("onInvalid",0<b.invalid.length,[e,t,u,b.invalid,y])}};u=o(u);var s,w=this,r=b.val();M="function"==typeof M?M(b.val(),void 0,u,y):M,w.mask=M,w.options=y,w.remove=function(){var t=b.getCaret();return w.options.placeholder&&u.removeAttr("placeholder"),u.data("mask-maxlength")&&u.removeAttr("maxlength"),b.destroyEvents(),b.val(w.getCleanVal()),b.setCaret(t),u},w.getCleanVal=function(){return b.getMasked(!0)},w.getMaskedVal=function(t){return b.getMasked(!1,t)},w.init=function(t){if(t=t||!1,y=y||{},w.clearIfNotMatch=o.jMaskGlobals.clearIfNotMatch,w.byPassKeys=o.jMaskGlobals.byPassKeys,w.translation=o.extend({},o.jMaskGlobals.translation,y.translation),w=o.extend(!0,{},w,y),s=b.getRegexMask(),t)b.events(),b.val(b.getMasked());else{y.placeholder&&u.attr("placeholder",y.placeholder),u.data("mask")&&u.attr("autocomplete","off");for(var a=0,e=!0;a<M.length;a++){var n=w.translation[M.charAt(a)];if(n&&n.recursive){e=!1;break}}e&&u.attr("maxlength",M.length).data("mask-maxlength",!0),b.destroyEvents(),b.events();t=b.getCaret();b.val(b.getMasked()),b.setCaret(t)}},w.init(!u.is("input"))}o.maskWatchers={};function a(){var t=o(this),a={},e="data-mask-",n=t.attr("data-mask");if(t.attr(e+"reverse")&&(a.reverse=!0),t.attr(e+"clearifnotmatch")&&(a.clearIfNotMatch=!0),"true"===t.attr(e+"selectonfocus")&&(a.selectOnFocus=!0),l(t,n,a))return t.data("mask",new i(this,n,a))}var l=function(t,a,e){e=e||{};var n=o(t).data("mask"),s=JSON.stringify,t=o(t).val()||o(t).text();try{return"function"==typeof a&&(a=a(t)),"object"!=typeof n||s(n.options)!==s(e)||n.mask!==a}catch(t){}};o.fn.mask=function(t,a){function e(){if(l(this,t,a))return o(this).data("mask",new i(this,t,a))}var n=this.selector,s=o.jMaskGlobals,r=s.watchInterval,s=(a=a||{}).watchInputs||s.watchInputs;return o(this).each(e),n&&""!==n&&s&&(clearInterval(o.maskWatchers[n]),o.maskWatchers[n]=setInterval(function(){o(document).find(n).each(e)},r)),this},o.fn.masked=function(t){return this.data("mask").getMaskedVal(t)},o.fn.unmask=function(){return clearInterval(o.maskWatchers[this.selector]),delete o.maskWatchers[this.selector],this.each(function(){var t=o(this).data("mask");t&&t.remove().removeData("mask")})},o.fn.cleanVal=function(){return this.data("mask").getCleanVal()},o.applyDataMask=function(t){((t=t||o.jMaskGlobals.maskElements)instanceof o?t:o(t)).filter(o.jMaskGlobals.dataMaskAttr).each(a)};var t,e,n,s={maskElements:"input,td,span,div",dataMaskAttr:"*[data-mask]",dataMask:!0,watchInterval:300,watchInputs:!0,keyStrokeCompensation:10,useInput:!/Chrome\/[2-4][0-9]|SamsungBrowser/.test(window.navigator.userAgent)&&(t="input",n=document.createElement("div"),(e=(t="on"+t)in n)||(n.setAttribute(t,"return;"),e="function"==typeof n[t]),n=null,e),watchDataMask:!1,byPassKeys:[9,16,17,18,36,37,38,39,40,91],translation:{0:{pattern:/\d/},9:{pattern:/\d/,optional:!0},"#":{pattern:/\d/,recursive:!0},A:{pattern:/[a-zA-Z0-9]/},S:{pattern:/[a-zA-Z]/}}};o.jMaskGlobals=o.jMaskGlobals||{},(s=o.jMaskGlobals=o.extend(!0,{},s,o.jMaskGlobals)).dataMask&&o.applyDataMask(),setInterval(function(){o.jMaskGlobals.watchDataMask&&o.applyDataMask()},s.watchInterval)},window.jQuery,window.Zepto);
assets/js/stripe-admin.js DELETED
@@ -1,156 +0,0 @@
1
- +/* global wc_stripe_settings_params */
2
-
3
- jQuery( function( $ ) {
4
- 'use strict';
5
-
6
- /**
7
- * Object to handle Stripe admin functions.
8
- */
9
- var wc_stripe_admin = {
10
-
11
- isTestMode: function() {
12
- return $( '#woocommerce_stripe_testmode' ).is( ':checked' );
13
- },
14
-
15
- getSecretKey: function() {
16
- if ( wc_stripe_admin.isTestMode() ) {
17
- return $( '#woocommerce_stripe_test_secret_key' ).val();
18
- } else {
19
- return $( '#woocommerce_stripe_secret_key' ).val();
20
- }
21
- },
22
-
23
- /**
24
- * Initialize.
25
- */
26
- init: function() {
27
- $( document.body ).on( 'change', '#woocommerce_stripe_testmode', function() {
28
- var test_secret_key = $( '#woocommerce_stripe_test_secret_key' ).parents( 'tr' ).eq( 0 ),
29
- test_publishable_key = $( '#woocommerce_stripe_test_publishable_key' ).parents( 'tr' ).eq( 0 ),
30
- test_webhook_secret = $( '#woocommerce_stripe_test_webhook_secret' ).parents( 'tr' ).eq( 0 ),
31
- live_secret_key = $( '#woocommerce_stripe_secret_key' ).parents( 'tr' ).eq( 0 ),
32
- live_publishable_key = $( '#woocommerce_stripe_publishable_key' ).parents( 'tr' ).eq( 0 ),
33
- live_webhook_secret = $( '#woocommerce_stripe_webhook_secret' ).parents( 'tr' ).eq( 0 );
34
-
35
- if ( $( this ).is( ':checked' ) ) {
36
- test_secret_key.show();
37
- test_publishable_key.show();
38
- test_webhook_secret.show();
39
- live_secret_key.hide();
40
- live_publishable_key.hide();
41
- live_webhook_secret.hide();
42
- } else {
43
- test_secret_key.hide();
44
- test_publishable_key.hide();
45
- test_webhook_secret.hide();
46
- live_secret_key.show();
47
- live_publishable_key.show();
48
- live_webhook_secret.show();
49
- }
50
- } );
51
-
52
- $( '#woocommerce_stripe_testmode' ).trigger( 'change' );
53
-
54
- // Toggle Payment Request buttons settings.
55
- $( '#woocommerce_stripe_payment_request' ).on( 'change', function() {
56
- if ( $( this ).is( ':checked' ) ) {
57
- $( '#woocommerce_stripe_payment_request_button_theme, #woocommerce_stripe_payment_request_button_type, #woocommerce_stripe_payment_request_button_locations, #woocommerce_stripe_payment_request_button_size, #woocommerce_stripe_payment_request_button_height' ).closest( 'tr' ).show();
58
- } else {
59
- $( '#woocommerce_stripe_payment_request_button_theme, #woocommerce_stripe_payment_request_button_type, #woocommerce_stripe_payment_request_button_locations, #woocommerce_stripe_payment_request_button_size, #woocommerce_stripe_payment_request_button_height' ).closest( 'tr' ).hide();
60
- }
61
- } ).trigger( 'change' );
62
-
63
- // Toggle Custom Payment Request configs.
64
- $( '#woocommerce_stripe_payment_request_button_type' ).on( 'change', function() {
65
- if ( 'custom' === $( this ).val() ) {
66
- $( '#woocommerce_stripe_payment_request_button_label' ).closest( 'tr' ).show();
67
- } else {
68
- $( '#woocommerce_stripe_payment_request_button_label' ).closest( 'tr' ).hide();
69
- }
70
- } ).trigger( 'change' )
71
-
72
- // Toggle Branded Payment Request configs.
73
- $( '#woocommerce_stripe_payment_request_button_type' ).on( 'change', function() {
74
- if ( 'branded' === $( this ).val() ) {
75
- $( '#woocommerce_stripe_payment_request_button_branded_type' ).closest( 'tr' ).show();
76
- } else {
77
- $( '#woocommerce_stripe_payment_request_button_branded_type' ).closest( 'tr' ).hide();
78
- }
79
- } ).trigger( 'change' )
80
-
81
- // Make the 3DS notice dismissable.
82
- $( '.wc-stripe-3ds-missing' ).each( function() {
83
- var $setting = $( this );
84
-
85
- $setting.find( '.notice-dismiss' ).on( 'click.wc-stripe-dismiss-notice', function() {
86
- $.ajax( {
87
- type: 'head',
88
- url: window.location.href + '&stripe_dismiss_3ds=' + $setting.data( 'nonce' ),
89
- } );
90
- } );
91
- } );
92
-
93
- // Add secret visibility toggles.
94
- $( '#woocommerce_stripe_test_secret_key, #woocommerce_stripe_secret_key, #woocommerce_stripe_test_webhook_secret, #woocommerce_stripe_webhook_secret' ).after(
95
- '<button class="wc-stripe-toggle-secret" style="height: 30px; margin-left: 2px; cursor: pointer"><span class="dashicons dashicons-visibility"></span></button>'
96
- );
97
- $( '.wc-stripe-toggle-secret' ).on( 'click', function( event ) {
98
- event.preventDefault();
99
-
100
- var $dashicon = $( this ).closest( 'button' ).find( '.dashicons' );
101
- var $input = $( this ).closest( 'tr' ).find( '.input-text' );
102
- var inputType = $input.attr( 'type' );
103
-
104
- if ( 'text' == inputType ) {
105
- $input.attr( 'type', 'password' );
106
- $dashicon.removeClass( 'dashicons-hidden' );
107
- $dashicon.addClass( 'dashicons-visibility' );
108
- } else {
109
- $input.attr( 'type', 'text' );
110
- $dashicon.removeClass( 'dashicons-visibility' );
111
- $dashicon.addClass( 'dashicons-hidden' );
112
- }
113
- } );
114
-
115
- $( 'form' ).find( 'input, select' ).on( 'change input', function disableConnect() {
116
-
117
- $( '#wc_stripe_connect_button' ).addClass( 'disabled' );
118
-
119
- $( '#wc_stripe_connect_button' ).on( 'click', function() { return false; } );
120
-
121
- $( '#woocommerce_stripe_api_credentials' )
122
- .next( 'p' )
123
- .append( ' (Please save changes before selecting this button.)' );
124
-
125
- $( 'form' ).find( 'input, select' ).off( 'change input', disableConnect );
126
- } );
127
-
128
- // Toggle UPE methods on/off.
129
- $( '.wc_gateways' ).on( 'click', '.wc-payment-upe-method-toggle-enabled, .wc-payment-upe-method-toggle-disabled', function() {
130
- var $toggle = $( this ).find( '.woocommerce-input-toggle' );
131
- $toggle.toggleClass( 'woocommerce-input-toggle--enabled woocommerce-input-toggle--disabled' );
132
- $toggle.parent().toggleClass( 'wc-payment-upe-method-toggle-enabled wc-payment-upe-method-toggle-disabled' );
133
- $( '#wc_stripe_upe_change_notice' ).removeClass( 'hidden' );
134
- return false;
135
- });
136
-
137
- $( '#mainform' ).submit( function() {
138
- var $form = $( this );
139
- $( '.wc_gateways .wc-payment-upe-method-toggle-enabled').each( function() {
140
- $form.append( '<input type="hidden" name="woocommerce_stripe_upe_checkout_experience_accepted_payments[]" value="' + $( this ).closest( 'tr' ).data( 'upe_method_id' ) + '" />' );
141
- });
142
- });
143
-
144
- // Webhook verification checks for timestamp within 5 minutes so warn if
145
- // server time is off from browser time by > 4 minutes.
146
- var timeDifference = Date.now() / 1000 - wc_stripe_settings_params.time;
147
- var isTimeOutOfSync = Math.abs( timeDifference ) > 4 * 60;
148
- if ( isTimeOutOfSync ) {
149
- var $td = $( '#woocommerce_stripe_test_webhook_secret, #woocommerce_stripe_webhook_secret' ).closest( 'td' );
150
- $td.append( '<p>' + wc_stripe_settings_params.i18n_out_of_sync + '</p>' );
151
- }
152
- }
153
- };
154
-
155
- wc_stripe_admin.init();
156
- } );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/stripe-admin.min.js DELETED
@@ -1 +0,0 @@
1
- jQuery(function(n){"use strict";var e={isTestMode:function(){return n("#woocommerce_stripe_testmode").is(":checked")},getSecretKey:function(){return(e.isTestMode()?n("#woocommerce_stripe_test_secret_key"):n("#woocommerce_stripe_secret_key")).val()},init:function(){n(document.body).on("change","#woocommerce_stripe_testmode",function(){var e=n("#woocommerce_stripe_test_secret_key").parents("tr").eq(0),t=n("#woocommerce_stripe_test_publishable_key").parents("tr").eq(0),o=n("#woocommerce_stripe_test_webhook_secret").parents("tr").eq(0),s=n("#woocommerce_stripe_secret_key").parents("tr").eq(0),c=n("#woocommerce_stripe_publishable_key").parents("tr").eq(0),r=n("#woocommerce_stripe_webhook_secret").parents("tr").eq(0);n(this).is(":checked")?(e.show(),t.show(),o.show(),s.hide(),c.hide(),r.hide()):(e.hide(),t.hide(),o.hide(),s.show(),c.show(),r.show())}),n("#woocommerce_stripe_testmode").trigger("change"),n("#woocommerce_stripe_payment_request").on("change",function(){n(this).is(":checked")?n("#woocommerce_stripe_payment_request_button_theme, #woocommerce_stripe_payment_request_button_type, #woocommerce_stripe_payment_request_button_locations, #woocommerce_stripe_payment_request_button_size, #woocommerce_stripe_payment_request_button_height").closest("tr").show():n("#woocommerce_stripe_payment_request_button_theme, #woocommerce_stripe_payment_request_button_type, #woocommerce_stripe_payment_request_button_locations, #woocommerce_stripe_payment_request_button_size, #woocommerce_stripe_payment_request_button_height").closest("tr").hide()}).trigger("change"),n("#woocommerce_stripe_payment_request_button_type").on("change",function(){"custom"===n(this).val()?n("#woocommerce_stripe_payment_request_button_label").closest("tr").show():n("#woocommerce_stripe_payment_request_button_label").closest("tr").hide()}).trigger("change"),n("#woocommerce_stripe_payment_request_button_type").on("change",function(){"branded"===n(this).val()?n("#woocommerce_stripe_payment_request_button_branded_type").closest("tr").show():n("#woocommerce_stripe_payment_request_button_branded_type").closest("tr").hide()}).trigger("change"),n(".wc-stripe-3ds-missing").each(function(){var e=n(this);e.find(".notice-dismiss").on("click.wc-stripe-dismiss-notice",function(){n.ajax({type:"head",url:window.location.href+"&stripe_dismiss_3ds="+e.data("nonce")})})}),n("#woocommerce_stripe_test_secret_key, #woocommerce_stripe_secret_key, #woocommerce_stripe_test_webhook_secret, #woocommerce_stripe_webhook_secret").after('<button class="wc-stripe-toggle-secret" style="height: 30px; margin-left: 2px; cursor: pointer"><span class="dashicons dashicons-visibility"></span></button>'),n(".wc-stripe-toggle-secret").on("click",function(e){e.preventDefault();var t=n(this).closest("button").find(".dashicons"),e=n(this).closest("tr").find(".input-text");"text"==e.attr("type")?(e.attr("type","password"),t.removeClass("dashicons-hidden"),t.addClass("dashicons-visibility")):(e.attr("type","text"),t.removeClass("dashicons-visibility"),t.addClass("dashicons-hidden"))}),n("form").find("input, select").on("change input",function e(){n("#wc_stripe_connect_button").addClass("disabled"),n("#wc_stripe_connect_button").on("click",function(){return!1}),n("#woocommerce_stripe_api_credentials").next("p").append(" (Please save changes before selecting this button.)"),n("form").find("input, select").off("change input",e)}),n(".wc_gateways").on("click",".wc-payment-upe-method-toggle-enabled, .wc-payment-upe-method-toggle-disabled",function(){var e=n(this).find(".woocommerce-input-toggle");return e.toggleClass("woocommerce-input-toggle--enabled woocommerce-input-toggle--disabled"),e.parent().toggleClass("wc-payment-upe-method-toggle-enabled wc-payment-upe-method-toggle-disabled"),n("#wc_stripe_upe_change_notice").removeClass("hidden"),!1}),n("#mainform").submit(function(){var e=n(this);n(".wc_gateways .wc-payment-upe-method-toggle-enabled").each(function(){e.append('<input type="hidden" name="woocommerce_stripe_upe_checkout_experience_accepted_payments[]" value="'+n(this).closest("tr").data("upe_method_id")+'" />')})});var e=Date.now()/1e3-wc_stripe_settings_params.time;240<Math.abs(e)&&n("#woocommerce_stripe_test_webhook_secret, #woocommerce_stripe_webhook_secret").closest("td").append("<p>"+wc_stripe_settings_params.i18n_out_of_sync+"</p>")}};e.init()});
 
assets/js/stripe.js CHANGED
@@ -211,7 +211,7 @@ jQuery( function( $ ) {
211
 
212
  $( 'form.woocommerce-checkout' )
213
  .on(
214
- 'checkout_place_order_stripe checkout_place_order_stripe_bancontact checkout_place_order_stripe_sofort checkout_place_order_stripe_giropay checkout_place_order_stripe_ideal checkout_place_order_stripe_alipay checkout_place_order_stripe_sepa',
215
  this.onSubmit
216
  );
217
 
@@ -264,6 +264,20 @@ jQuery( function( $ ) {
264
  // Listen for hash changes in order to handle payment intents
265
  window.addEventListener( 'hashchange', wc_stripe_form.onHashChange );
266
  wc_stripe_form.maybeConfirmIntent();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
267
  },
268
 
269
  /**
@@ -272,7 +286,7 @@ jQuery( function( $ ) {
272
  * @return {boolean}
273
  */
274
  isStripeChosen: function() {
275
- return $( '#payment_method_stripe, #payment_method_stripe_bancontact, #payment_method_stripe_sofort, #payment_method_stripe_giropay, #payment_method_stripe_ideal, #payment_method_stripe_alipay, #payment_method_stripe_sepa, #payment_method_stripe_eps, #payment_method_stripe_multibanco' ).is( ':checked' ) || ( $( '#payment_method_stripe' ).is( ':checked' ) && 'new' === $( 'input[name="wc-stripe-payment-token"]:checked' ).val() ) || ( $( '#payment_method_stripe_sepa' ).is( ':checked' ) && 'new' === $( 'input[name="wc-stripe-payment-token"]:checked' ).val() );
276
  },
277
 
278
  /**
@@ -282,18 +296,18 @@ jQuery( function( $ ) {
282
  */
283
  isStripeSaveCardChosen: function() {
284
  return (
285
- $( '#payment_method_stripe' ).is( ':checked' )
286
- && $( 'input[name="wc-stripe-payment-token"]' ).is( ':checked' )
287
- && 'new' !== $( 'input[name="wc-stripe-payment-token"]:checked' ).val()
288
  ) || (
289
- $( '#payment_method_stripe_sepa' ).is( ':checked' )
290
- && $( 'input[name="wc-stripe_sepa-payment-token"]' ).is( ':checked' )
291
- && 'new' !== $( 'input[name="wc-stripe_sepa-payment-token"]:checked' ).val()
292
  );
293
  },
294
 
295
  /**
296
- * Check if Stripe credit card is being used used.
297
  *
298
  * @return {boolean}
299
  */
@@ -302,7 +316,7 @@ jQuery( function( $ ) {
302
  },
303
 
304
  /**
305
- * Check if Stripe Bancontact is being used used.
306
  *
307
  * @return {boolean}
308
  */
@@ -311,7 +325,7 @@ jQuery( function( $ ) {
311
  },
312
 
313
  /**
314
- * Check if Stripe Giropay is being used used.
315
  *
316
  * @return {boolean}
317
  */
@@ -320,7 +334,7 @@ jQuery( function( $ ) {
320
  },
321
 
322
  /**
323
- * Check if Stripe iDeal is being used used.
324
  *
325
  * @return {boolean}
326
  */
@@ -329,7 +343,7 @@ jQuery( function( $ ) {
329
  },
330
 
331
  /**
332
- * Check if Stripe SOFORT is being used used.
333
  *
334
  * @return {boolean}
335
  */
@@ -338,7 +352,7 @@ jQuery( function( $ ) {
338
  },
339
 
340
  /**
341
- * Check if Stripe Alipay is being used used.
342
  *
343
  * @return {boolean}
344
  */
@@ -347,7 +361,7 @@ jQuery( function( $ ) {
347
  },
348
 
349
  /**
350
- * Check if Stripe SEPA Direct Debit is being used used.
351
  *
352
  * @return {boolean}
353
  */
@@ -356,7 +370,7 @@ jQuery( function( $ ) {
356
  },
357
 
358
  /**
359
- * Check if Stripe P24 is being used used.
360
  *
361
  * @return {boolean}
362
  */
@@ -365,7 +379,7 @@ jQuery( function( $ ) {
365
  },
366
 
367
  /**
368
- * Check if Stripe EPS is being used used.
369
  *
370
  * @return {boolean}
371
  */
@@ -374,7 +388,7 @@ jQuery( function( $ ) {
374
  },
375
 
376
  /**
377
- * Check if Stripe Multibanco is being used used.
378
  *
379
  * @return {boolean}
380
  */
@@ -382,6 +396,24 @@ jQuery( function( $ ) {
382
  return $( '#payment_method_stripe_multibanco' ).is( ':checked' );
383
  },
384
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
385
  /**
386
  * Checks if a source ID is present as a hidden input.
387
  * Only used when SEPA Direct Debit is chosen.
@@ -624,11 +656,123 @@ jQuery( function( $ ) {
624
  }
625
 
626
  wc_stripe_form.block();
627
- wc_stripe_form.createSource();
 
 
 
 
 
 
 
 
 
 
 
 
 
628
 
629
  return false;
630
  },
631
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
632
  /**
633
  * If a new credit card is entered, reset sources.
634
  */
@@ -702,9 +846,7 @@ jQuery( function( $ ) {
702
  */
703
  if ( wc_stripe_form.isSepaChosen() ) {
704
  if ( 'invalid_owner_name' === result.error.code && wc_stripe_params.hasOwnProperty( result.error.code ) ) {
705
- var error = $( '<div><ul class="woocommerce-error"><li /></ul></div>' );
706
- error.find( 'li' ).text( wc_stripe_params[ result.error.code ] ); // Prevent XSS
707
- wc_stripe_form.submitError( error.html() );
708
  return;
709
  }
710
  }
@@ -726,11 +868,7 @@ jQuery( function( $ ) {
726
  message = wc_stripe_params.invalid_request_error;
727
  }
728
 
729
- if ( 'card_error' === result.error.type && wc_stripe_params.hasOwnProperty( result.error.code ) ) {
730
- message = wc_stripe_params[ result.error.code ];
731
- }
732
-
733
- if ( 'validation_error' === result.error.type && wc_stripe_params.hasOwnProperty( result.error.code ) ) {
734
  message = wc_stripe_params[ result.error.code ];
735
  }
736
 
@@ -754,7 +892,13 @@ jQuery( function( $ ) {
754
  *
755
  * @param {Object} error_message An error message jQuery object.
756
  */
757
- submitError: function( error_message ) {
 
 
 
 
 
 
758
  $( '.woocommerce-NoticeGroup-checkout, .woocommerce-error, .woocommerce-message' ).remove();
759
  wc_stripe_form.form.prepend( '<div class="woocommerce-NoticeGroup woocommerce-NoticeGroup-checkout">' + error_message + '</div>' );
760
  wc_stripe_form.form.removeClass( 'processing' ).unblock();
211
 
212
  $( 'form.woocommerce-checkout' )
213
  .on(
214
+ 'checkout_place_order_stripe checkout_place_order_stripe_bancontact checkout_place_order_stripe_sofort checkout_place_order_stripe_giropay checkout_place_order_stripe_ideal checkout_place_order_stripe_alipay checkout_place_order_stripe_sepa checkout_place_order_stripe_boleto checkout_place_order_stripe_oxxo',
215
  this.onSubmit
216
  );
217
 
264
  // Listen for hash changes in order to handle payment intents
265
  window.addEventListener( 'hashchange', wc_stripe_form.onHashChange );
266
  wc_stripe_form.maybeConfirmIntent();
267
+
268
+ //Mask CPF/CNPJ field when using Boleto
269
+ $( document ).on( 'change', '.wc_payment_methods', function () {
270
+ var TaxIdMaskBehavior = function ( val ) {
271
+ return val.replace( /\D/g, '' ).length >= 12 ? '00.000.000/0000-00' : '000.000.000-009999';
272
+ },
273
+ spOptions = {
274
+ onKeyPress: function ( val, e, field, options ) {
275
+ field.mask( TaxIdMaskBehavior.apply( {}, arguments ), options );
276
+ }
277
+ };
278
+
279
+ $( '#stripe_boleto_tax_id' ).mask( TaxIdMaskBehavior, spOptions );
280
+ });
281
  },
282
 
283
  /**
286
  * @return {boolean}
287
  */
288
  isStripeChosen: function() {
289
+ return $( '#payment_method_stripe, #payment_method_stripe_bancontact, #payment_method_stripe_sofort, #payment_method_stripe_giropay, #payment_method_stripe_ideal, #payment_method_stripe_alipay, #payment_method_stripe_sepa, #payment_method_stripe_eps, #payment_method_stripe_multibanco, #payment_method_stripe_boleto, #payment_method_stripe_oxxo' ).is( ':checked' ) || ( $( '#payment_method_stripe' ).is( ':checked' ) && 'new' === $( 'input[name="wc-stripe-payment-token"]:checked' ).val() ) || ( $( '#payment_method_stripe_sepa' ).is( ':checked' ) && 'new' === $( 'input[name="wc-stripe-payment-token"]:checked' ).val() );
290
  },
291
 
292
  /**
296
  */
297
  isStripeSaveCardChosen: function() {
298
  return (
299
+ $( '#payment_method_stripe' ).is( ':checked' ) &&
300
+ $( 'input[name="wc-stripe-payment-token"]' ).is( ':checked' ) &&
301
+ 'new' !== $( 'input[name="wc-stripe-payment-token"]:checked' ).val()
302
  ) || (
303
+ $( '#payment_method_stripe_sepa' ).is( ':checked' ) &&
304
+ $( 'input[name="wc-stripe_sepa-payment-token"]' ).is( ':checked' ) &&
305
+ 'new' !== $( 'input[name="wc-stripe_sepa-payment-token"]:checked' ).val()
306
  );
307
  },
308
 
309
  /**
310
+ * Check if Stripe credit card is being used.
311
  *
312
  * @return {boolean}
313
  */
316
  },
317
 
318
  /**
319
+ * Check if Stripe Bancontact is being used.
320
  *
321
  * @return {boolean}
322
  */
325
  },
326
 
327
  /**
328
+ * Check if Stripe Giropay is being used.
329
  *
330
  * @return {boolean}
331
  */
334
  },
335
 
336
  /**
337
+ * Check if Stripe iDeal is being used.
338
  *
339
  * @return {boolean}
340
  */
343
  },
344
 
345
  /**
346
+ * Check if Stripe SOFORT is being used.
347
  *
348
  * @return {boolean}
349
  */
352
  },
353
 
354
  /**
355
+ * Check if Stripe Alipay is being used.
356
  *
357
  * @return {boolean}
358
  */
361
  },
362
 
363
  /**
364
+ * Check if Stripe SEPA Direct Debit is being used.
365
  *
366
  * @return {boolean}
367
  */
370
  },
371
 
372
  /**
373
+ * Check if Stripe P24 is being used.
374
  *
375
  * @return {boolean}
376
  */
379
  },
380
 
381
  /**
382
+ * Check if Stripe EPS is being used.
383
  *
384
  * @return {boolean}
385
  */
388
  },
389
 
390
  /**
391
+ * Check if Stripe Multibanco is being used.
392
  *
393
  * @return {boolean}
394
  */
396
  return $( '#payment_method_stripe_multibanco' ).is( ':checked' );
397
  },
398
 
399
+ /**
400
+ * Check if Stripe Boleto is being used.
401
+ *
402
+ * @return {boolean}
403
+ */
404
+ isBoletoChosen: function() {
405
+ return $( '#payment_method_stripe_boleto' ).is( ':checked' );
406
+ },
407
+
408
+ /**
409
+ * Check if Stripe OXXO is being used.
410
+ *
411
+ * @return {boolean}
412
+ */
413
+ isOxxoChosen: function() {
414
+ return $( '#payment_method_stripe_oxxo' ).is( ':checked' );
415
+ },
416
+
417
  /**
418
  * Checks if a source ID is present as a hidden input.
419
  * Only used when SEPA Direct Debit is chosen.
656
  }
657
 
658
  wc_stripe_form.block();
659
+
660
+ if( wc_stripe_form.isBoletoChosen() ) {
661
+ if( ! $( '#stripe_boleto_tax_id' ).val() ) {
662
+ wc_stripe_form.submitError( wc_stripe_params.cpf_cnpj_required_msg );
663
+ wc_stripe_form.unblock();
664
+ return false;
665
+ }
666
+
667
+ wc_stripe_form.handleBoleto();
668
+ } else if ( wc_stripe_form.isOxxoChosen() ) {
669
+ wc_stripe_form.handleOxxo();
670
+ } else {
671
+ wc_stripe_form.createSource();
672
+ }
673
 
674
  return false;
675
  },
676
 
677
+ /**
678
+ * Will show a modal for printing the Boleto.
679
+ * After the customer closes the modal proceeds with checkout normally
680
+ */
681
+ handleBoleto: function () {
682
+ wc_stripe_form.executeCheckout( 'boleto', function ( checkout_response ) {
683
+ stripe.confirmBoletoPayment(
684
+ checkout_response.client_secret,
685
+ checkout_response.confirm_payment_data
686
+ )
687
+ .then(function ( response ) {
688
+ wc_stripe_form.handleConfirmResponse( checkout_response, response );
689
+ });
690
+ } );
691
+ },
692
+
693
+ /**
694
+ * Executes the checkout and then execute the callback instead of redirect to success page
695
+ * @param callback
696
+ */
697
+ executeCheckout: function ( payment_method, callback ) {
698
+ const formFields = wc_stripe_form.form.serializeArray().reduce( ( obj, field ) => {
699
+ obj[ field.name ] = field.value;
700
+ return obj;
701
+ }, {} );
702
+
703
+ if( wc_stripe_form.form.attr('id') === 'order_review' ) {
704
+ formFields._ajax_nonce = wc_stripe_params.updatePaymentIntentNonce;
705
+ formFields.order_id = wc_stripe_params.orderId;
706
+
707
+ $.ajax( {
708
+ url: wc_stripe_form.getAjaxURL( payment_method + '_update_payment_intent' ),
709
+ type: 'POST',
710
+ data: formFields,
711
+ success: function ( response ) {
712
+
713
+ if( 'success' !== response.result ) {
714
+ wc_stripe_form.submitError( response.messages );
715
+ wc_stripe_form.unblock();
716
+ return;
717
+ }
718
+
719
+ callback( response );
720
+ }
721
+ } );
722
+
723
+ } else {
724
+ $.ajax( {
725
+ url: wc_stripe_params.checkout_url,
726
+ type: 'POST',
727
+ data: formFields,
728
+ success: function ( checkout_response ) {
729
+
730
+ if( 'success' !== checkout_response.result ) {
731
+ wc_stripe_form.submitError( checkout_response.messages, true );
732
+ wc_stripe_form.unblock();
733
+ return;
734
+ }
735
+
736
+ callback( checkout_response );
737
+ }
738
+ } );
739
+ }
740
+ },
741
+
742
+ /**
743
+ * Handles response of the Confirm<payment_method>Payment like confirmBoletoPayment and confirmOxxoPayment
744
+ * @param checkout_response
745
+ * @param response
746
+ */
747
+ handleConfirmResponse: function ( checkout_response, response ) {
748
+ if ( response.error ) {
749
+ $( document.body ).trigger( 'stripeError', response );
750
+ return;
751
+ }
752
+
753
+ if ( -1 === checkout_response.redirect.indexOf( 'https://' ) || -1 === checkout_response.redirect.indexOf( 'http://' ) ) {
754
+ window.location = checkout_response.redirect;
755
+ } else {
756
+ window.location = decodeURI( checkout_response.redirect );
757
+ }
758
+ },
759
+
760
+ /**
761
+ * Will show a modal for printing the OXXO Voucher.
762
+ * After the customer closes the modal proceeds with checkout normally
763
+ */
764
+ handleOxxo: function () {
765
+ wc_stripe_form.executeCheckout( 'oxxo', function ( checkout_response ) {
766
+ stripe.confirmOxxoPayment(
767
+ checkout_response.client_secret,
768
+ checkout_response.confirm_payment_data
769
+ )
770
+ .then(function (response) {
771
+ wc_stripe_form.handleConfirmResponse( checkout_response, response );
772
+ } );
773
+ } );
774
+ },
775
+
776
  /**
777
  * If a new credit card is entered, reset sources.
778
  */
846
  */
847
  if ( wc_stripe_form.isSepaChosen() ) {
848
  if ( 'invalid_owner_name' === result.error.code && wc_stripe_params.hasOwnProperty( result.error.code ) ) {
849
+ wc_stripe_form.submitError( wc_stripe_params[ result.error.code ] );
 
 
850
  return;
851
  }
852
  }
868
  message = wc_stripe_params.invalid_request_error;
869
  }
870
 
871
+ if ( wc_stripe_params.hasOwnProperty(result.error.code) ) {
 
 
 
 
872
  message = wc_stripe_params[ result.error.code ];
873
  }
874
 
892
  *
893
  * @param {Object} error_message An error message jQuery object.
894
  */
895
+ submitError: function( error_message, is_html = false ) {
896
+ if( ! is_html ) {
897
+ var error = $( '<div><ul class="woocommerce-error"><li /></ul></div>' );
898
+ error.find( 'li' ).text( error_message ); // Prevent XSS
899
+ error_message = error.html();
900
+ }
901
+
902
  $( '.woocommerce-NoticeGroup-checkout, .woocommerce-error, .woocommerce-message' ).remove();
903
  wc_stripe_form.form.prepend( '<div class="woocommerce-NoticeGroup woocommerce-NoticeGroup-checkout">' + error_message + '</div>' );
904
  wc_stripe_form.form.removeClass( 'processing' ).unblock();
assets/js/stripe.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(function(s){"use strict";try{var n=Stripe(wc_stripe_params.key,{locale:wc_stripe_params.stripe_locale||"auto"})}catch(e){return void console.log(e)}var t,o,i,e=Object.keys(wc_stripe_params.elements_options).length?wc_stripe_params.elements_options:{},r=Object.keys(wc_stripe_params.sepa_elements_options).length?wc_stripe_params.sepa_elements_options:{},a=n.elements(e),c=a.create("iban",r),m={getAjaxURL:function(e){return wc_stripe_params.ajaxurl.toString().replace("%%endpoint%%","wc_stripe_"+e)},unmountElements:function(){"yes"===wc_stripe_params.inline_cc_form?t.unmount("#stripe-card-element"):(t.unmount("#stripe-card-element"),o.unmount("#stripe-exp-element"),i.unmount("#stripe-cvc-element"))},mountElements:function(){s("#stripe-card-element").length&&("yes"!==wc_stripe_params.inline_cc_form?(t.mount("#stripe-card-element"),o.mount("#stripe-exp-element"),i.mount("#stripe-cvc-element")):t.mount("#stripe-card-element"))},createElements:function(){var e={base:{iconColor:"#666EE8",color:"#31325F",fontSize:"15px","::placeholder":{color:"#CFD7E0"}}},r={focus:"focused",empty:"empty",invalid:"invalid"},e=wc_stripe_params.elements_styling||e,r=wc_stripe_params.elements_classes||r;"yes"===wc_stripe_params.inline_cc_form?(t=a.create("card",{style:e,hidePostalCode:!0})).addEventListener("change",function(e){m.onCCFormChange(),e.error&&s(document.body).trigger("stripeError",e)}):(t=a.create("cardNumber",{style:e,classes:r}),o=a.create("cardExpiry",{style:e,classes:r}),i=a.create("cardCvc",{style:e,classes:r}),t.addEventListener("change",function(e){m.onCCFormChange(),m.updateCardBrand(e.brand),e.error&&s(document.body).trigger("stripeError",e)}),o.addEventListener("change",function(e){m.onCCFormChange(),e.error&&s(document.body).trigger("stripeError",e)}),i.addEventListener("change",function(e){m.onCCFormChange(),e.error&&s(document.body).trigger("stripeError",e)})),"yes"===wc_stripe_params.is_checkout?s(document.body).on("updated_checkout",function(){s("#stripe-card-element").children().length||(t&&m.unmountElements(),m.mountElements(),s("#stripe-iban-element").length&&c.mount("#stripe-iban-element"))}):(s("form#add_payment_method").length||s("form#order_review").length)&&(m.mountElements(),s("#stripe-iban-element").length&&c.mount("#stripe-iban-element"))},updateCardBrand:function(e){var r={visa:"stripe-visa-brand",mastercard:"stripe-mastercard-brand",amex:"stripe-amex-brand",discover:"stripe-discover-brand",diners:"stripe-diners-brand",jcb:"stripe-jcb-brand",unknown:"stripe-credit-card-brand"},t=s(".stripe-card-brand"),e=e in r?r[e]:"stripe-credit-card-brand";s.each(r,function(e,r){t.removeClass(r)}),t.addClass(e)},init:function(){"yes"!==wc_stripe_params.is_change_payment_page&&"yes"!==wc_stripe_params.is_pay_for_order_page||s(document.body).trigger("wc-credit-card-form-init"),s("form.woocommerce-checkout").length&&(this.form=s("form.woocommerce-checkout")),s("form.woocommerce-checkout").on("checkout_place_order_stripe checkout_place_order_stripe_bancontact checkout_place_order_stripe_sofort checkout_place_order_stripe_giropay checkout_place_order_stripe_ideal checkout_place_order_stripe_alipay checkout_place_order_stripe_sepa",this.onSubmit),s("form#order_review").length&&(this.form=s("form#order_review")),s("form#order_review, form#add_payment_method").on("submit",this.onSubmit),s("form#add_payment_method").length&&(this.form=s("form#add_payment_method")),s("form.woocommerce-checkout").on("change",this.reset),s(document).on("stripeError",this.onError).on("checkout_error",this.reset),c.on("change",this.onSepaError),(s("#early_renewal_modal_submit[data-payment-method]").length?s("#early_renewal_modal_submit[data-payment-method=stripe]"):s("#early_renewal_modal_submit")).on("click",this.onEarlyRenewalSubmit),m.createElements(),window.addEventListener("hashchange",m.onHashChange),m.maybeConfirmIntent()},isStripeChosen:function(){return s("#payment_method_stripe, #payment_method_stripe_bancontact, #payment_method_stripe_sofort, #payment_method_stripe_giropay, #payment_method_stripe_ideal, #payment_method_stripe_alipay, #payment_method_stripe_sepa, #payment_method_stripe_eps, #payment_method_stripe_multibanco").is(":checked")||s("#payment_method_stripe").is(":checked")&&"new"===s('input[name="wc-stripe-payment-token"]:checked').val()||s("#payment_method_stripe_sepa").is(":checked")&&"new"===s('input[name="wc-stripe-payment-token"]:checked').val()},isStripeSaveCardChosen:function(){return s("#payment_method_stripe").is(":checked")&&s('input[name="wc-stripe-payment-token"]').is(":checked")&&"new"!==s('input[name="wc-stripe-payment-token"]:checked').val()||s("#payment_method_stripe_sepa").is(":checked")&&s('input[name="wc-stripe_sepa-payment-token"]').is(":checked")&&"new"!==s('input[name="wc-stripe_sepa-payment-token"]:checked').val()},isStripeCardChosen:function(){return s("#payment_method_stripe").is(":checked")},isBancontactChosen:function(){return s("#payment_method_stripe_bancontact").is(":checked")},isGiropayChosen:function(){return s("#payment_method_stripe_giropay").is(":checked")},isIdealChosen:function(){return s("#payment_method_stripe_ideal").is(":checked")},isSofortChosen:function(){return s("#payment_method_stripe_sofort").is(":checked")},isAlipayChosen:function(){return s("#payment_method_stripe_alipay").is(":checked")},isSepaChosen:function(){return s("#payment_method_stripe_sepa").is(":checked")},isP24Chosen:function(){return s("#payment_method_stripe_p24").is(":checked")},isEpsChosen:function(){return s("#payment_method_stripe_eps").is(":checked")},isMultibancoChosen:function(){return s("#payment_method_stripe_multibanco").is(":checked")},hasSource:function(){return 0<s("input.stripe-source").length},isMobile:function(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},block:function(){m.isMobile()||m.form.block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},unblock:function(){m.form&&m.form.unblock()},getSelectedPaymentElement:function(){return s('.payment_methods input[name="payment_method"]:checked')},getOwnerDetails:function(){var e=s("#billing_first_name").length?s("#billing_first_name").val():wc_stripe_params.billing_first_name,r=s("#billing_last_name").length?s("#billing_last_name").val():wc_stripe_params.billing_last_name,t={name:"",address:{},email:"",phone:""};return t.name=e,t.name=e&&r?e+" "+r:s("#stripe-payment-data").data("full-name"),t.email=s("#billing_email").val(),t.phone=s("#billing_phone").val(),(void 0===t.phone||t.phone.length<=0)&&delete t.phone,(void 0===t.email||t.email.length<=0)&&(s("#stripe-payment-data").data("email").length?t.email=s("#stripe-payment-data").data("email"):delete t.email),(void 0===t.name||t.name.length<=0)&&delete t.name,t.address.line1=s("#billing_address_1").val()||wc_stripe_params.billing_address_1,t.address.line2=s("#billing_address_2").val()||wc_stripe_params.billing_address_2,t.address.state=s("#billing_state").val()||wc_stripe_params.billing_state,t.address.city=s("#billing_city").val()||wc_stripe_params.billing_city,t.address.postal_code=s("#billing_postcode").val()||wc_stripe_params.billing_postcode,t.address.country=s("#billing_country").val()||wc_stripe_params.billing_country,{owner:t}},createSource:function(){var e=m.getOwnerDetails();return m.isSepaChosen()?(e.currency=s("#stripe-sepa_debit-payment-data").data("currency"),e.mandate={notification_method:wc_stripe_params.sepa_mandate_notification},e.type="sepa_debit",n.createSource(c,e).then(m.sourceResponse)):n.createSource(t,e).then(m.sourceResponse)},sourceResponse:function(e){e.error?s(document.body).trigger("stripeError",e):(m.reset(),m.form.append(s('<input type="hidden" />').addClass("stripe-source").attr("name","stripe_source").val(e.source.id)),s("form#add_payment_method").length||s("#wc-stripe-change-payment-method").length?m.sourceSetup(e):m.form.trigger("submit"))},sourceSetup:function(r){var e={error:{type:"api_connection_error"}};s.post({url:m.getAjaxURL("create_setup_intent"),dataType:"json",data:{stripe_source_id:r.source.id,nonce:wc_stripe_params.add_card_nonce},error:function(){s(document.body).trigger("stripeError",e)}}).done(function(e){return"success"===e.status?(s("form#add_payment_method").length&&s(m.form).off("submit",m.form.onSubmit),void m.form.trigger("submit")):void("requires_action"===e.status?n.confirmCardSetup(e.client_secret,{payment_method:r.source.id}).then(function(e){e.error?s(document.body).trigger("stripeError",e):(s("form#add_payment_method").length&&s(m.form).off("submit",m.form.onSubmit),m.form.trigger("submit"))}).catch(function(e){console.log(e),s(document.body).trigger("stripeError",{error:e})}):s(document.body).trigger("stripeError",e))})},onSubmit:function(){return!m.isStripeChosen()||(!(!m.isStripeSaveCardChosen()&&!m.hasSource())||(!!(m.isBancontactChosen()||m.isGiropayChosen()||m.isIdealChosen()||m.isAlipayChosen()||m.isSofortChosen()||m.isP24Chosen()||m.isEpsChosen()||m.isMultibancoChosen())||(m.block(),m.createSource(),!1)))},onCCFormChange:function(){m.reset()},reset:function(){s(".wc-stripe-error, .stripe-source").remove()},onSepaError:function(e){var r=m.getSelectedPaymentElement().parents("li").eq(0).find(".stripe-source-errors");e.error?(console.log(e.error.message),s(r).html('<ul class="woocommerce_error woocommerce-error wc-stripe-error"><li /></ul>'),s(r).find("li").text(e.error.message)):s(r).html("")},onError:function(e,r){var t,o=r.error.message,n=m.getSelectedPaymentElement().closest("li"),i=n.find(".woocommerce-SavedPaymentMethods-tokenInput"),a=s("body").hasClass("woocommerce-stripe-prb-clicked");if(t=a?(s("body").removeClass("woocommerce-stripe-prb-clicked"),s("div.woocommerce-notices-wrapper").first()):i.length?(t=i.filter(":checked")).closest(".woocommerce-SavedPaymentMethods-new").length?s("#wc-stripe-cc-form .stripe-source-errors"):t.closest("li").find(".stripe-source-errors"):n.find(".stripe-source-errors"),m.isSepaChosen()&&"invalid_owner_name"===r.error.code&&wc_stripe_params.hasOwnProperty(r.error.code)){n=s('<div><ul class="woocommerce-error"><li /></ul></div>');return n.find("li").text(wc_stripe_params[r.error.code]),void m.submitError(n.html())}"email_invalid"===r.error.code?o=wc_stripe_params.email_invalid:"invalid_request_error"!==r.error.type&&"api_connection_error"!==r.error.type&&"api_error"!==r.error.type&&"authentication_error"!==r.error.type&&"rate_limit_error"!==r.error.type||(o=wc_stripe_params.invalid_request_error),"card_error"===r.error.type&&wc_stripe_params.hasOwnProperty(r.error.code)&&(o=wc_stripe_params[r.error.code]),"validation_error"===r.error.type&&wc_stripe_params.hasOwnProperty(r.error.code)&&(o=wc_stripe_params[r.error.code]),m.reset(),s(".woocommerce-NoticeGroup-checkout").remove(),console.log(r.error.message),s(t).html('<ul class="woocommerce_error woocommerce-error wc-stripe-error"><li /></ul>'),s(t).find("li").text(o),s(".wc-stripe-error").length&&s("html, body").animate({scrollTop:s(".wc-stripe-error").offset().top-200},200),m.unblock(),s.unblockUI()},submitError:function(e){s(".woocommerce-NoticeGroup-checkout, .woocommerce-error, .woocommerce-message").remove(),m.form.prepend('<div class="woocommerce-NoticeGroup woocommerce-NoticeGroup-checkout">'+e+"</div>"),m.form.removeClass("processing").unblock(),m.form.find(".input-text, select, input:checkbox").trigger("blur");e="";s("#add_payment_method").length&&(e=s("#add_payment_method")),s("#order_review").length&&(e=s("#order_review")),(e=s("form.checkout").length?s("form.checkout"):e).length&&s("html, body").animate({scrollTop:e.offset().top-100},500),s(document.body).trigger("checkout_error"),m.unblock()},onHashChange:function(){var e,r,t=window.location.hash.match(/^#?confirm-(pi|si)-([^:]+):(.+)$/);!t||t.length<4||(e=t[1],r=t[2],t=decodeURIComponent(t[3]),window.location.hash="",m.openIntentModal(r,t,!1,"si"===e))},maybeConfirmIntent:function(){var e,r;s("#stripe-intent-id").length&&s("#stripe-intent-return").length&&(e=s("#stripe-intent-id").val(),r=s("#stripe-intent-return").val(),m.openIntentModal(e,r,!0,!1))},openIntentModal:function(e,r,t,o){n[o?"handleCardSetup":"handleCardPayment"](e).then(function(e){if(e.error)throw e.error;e=e[o?"setupIntent":"paymentIntent"];"requires_capture"!==e.status&&"succeeded"!==e.status||(window.location=r)}).catch(function(e){t?window.location=r:(s(document.body).trigger("stripeError",{error:e}),m.form&&m.form.removeClass("processing"),s.get(r+"&is_ajax"))})},onEarlyRenewalSubmit:function(e){return e.preventDefault(),s.ajax({url:s("#early_renewal_modal_submit").attr("href"),method:"get",success:function(e){e=JSON.parse(e);e.stripe_sca_required?m.openIntentModal(e.intent_secret,e.redirect_url,!0,!1):window.location=e.redirect_url}}),!1}};m.init()});
1
+ jQuery(function(i){"use strict";try{var n=Stripe(wc_stripe_params.key,{locale:wc_stripe_params.stripe_locale||"auto"})}catch(e){return void console.log(e)}var t,o,s,e=Object.keys(wc_stripe_params.elements_options).length?wc_stripe_params.elements_options:{},r=Object.keys(wc_stripe_params.sepa_elements_options).length?wc_stripe_params.sepa_elements_options:{},a=n.elements(e),c=a.create("iban",r),m={getAjaxURL:function(e){return wc_stripe_params.ajaxurl.toString().replace("%%endpoint%%","wc_stripe_"+e)},unmountElements:function(){"yes"===wc_stripe_params.inline_cc_form?t.unmount("#stripe-card-element"):(t.unmount("#stripe-card-element"),o.unmount("#stripe-exp-element"),s.unmount("#stripe-cvc-element"))},mountElements:function(){i("#stripe-card-element").length&&("yes"!==wc_stripe_params.inline_cc_form?(t.mount("#stripe-card-element"),o.mount("#stripe-exp-element"),s.mount("#stripe-cvc-element")):t.mount("#stripe-card-element"))},createElements:function(){var e={base:{iconColor:"#666EE8",color:"#31325F",fontSize:"15px","::placeholder":{color:"#CFD7E0"}}},r={focus:"focused",empty:"empty",invalid:"invalid"},e=wc_stripe_params.elements_styling||e,r=wc_stripe_params.elements_classes||r;"yes"===wc_stripe_params.inline_cc_form?(t=a.create("card",{style:e,hidePostalCode:!0})).addEventListener("change",function(e){m.onCCFormChange(),e.error&&i(document.body).trigger("stripeError",e)}):(t=a.create("cardNumber",{style:e,classes:r}),o=a.create("cardExpiry",{style:e,classes:r}),s=a.create("cardCvc",{style:e,classes:r}),t.addEventListener("change",function(e){m.onCCFormChange(),m.updateCardBrand(e.brand),e.error&&i(document.body).trigger("stripeError",e)}),o.addEventListener("change",function(e){m.onCCFormChange(),e.error&&i(document.body).trigger("stripeError",e)}),s.addEventListener("change",function(e){m.onCCFormChange(),e.error&&i(document.body).trigger("stripeError",e)})),"yes"===wc_stripe_params.is_checkout?i(document.body).on("updated_checkout",function(){i("#stripe-card-element").children().length||(t&&m.unmountElements(),m.mountElements(),i("#stripe-iban-element").length&&c.mount("#stripe-iban-element"))}):(i("form#add_payment_method").length||i("form#order_review").length)&&(m.mountElements(),i("#stripe-iban-element").length&&c.mount("#stripe-iban-element"))},updateCardBrand:function(e){var r={visa:"stripe-visa-brand",mastercard:"stripe-mastercard-brand",amex:"stripe-amex-brand",discover:"stripe-discover-brand",diners:"stripe-diners-brand",jcb:"stripe-jcb-brand",unknown:"stripe-credit-card-brand"},t=i(".stripe-card-brand"),e=e in r?r[e]:"stripe-credit-card-brand";i.each(r,function(e,r){t.removeClass(r)}),t.addClass(e)},init:function(){"yes"!==wc_stripe_params.is_change_payment_page&&"yes"!==wc_stripe_params.is_pay_for_order_page||i(document.body).trigger("wc-credit-card-form-init"),i("form.woocommerce-checkout").length&&(this.form=i("form.woocommerce-checkout")),i("form.woocommerce-checkout").on("checkout_place_order_stripe checkout_place_order_stripe_bancontact checkout_place_order_stripe_sofort checkout_place_order_stripe_giropay checkout_place_order_stripe_ideal checkout_place_order_stripe_alipay checkout_place_order_stripe_sepa checkout_place_order_stripe_boleto checkout_place_order_stripe_oxxo",this.onSubmit),i("form#order_review").length&&(this.form=i("form#order_review")),i("form#order_review, form#add_payment_method").on("submit",this.onSubmit),i("form#add_payment_method").length&&(this.form=i("form#add_payment_method")),i("form.woocommerce-checkout").on("change",this.reset),i(document).on("stripeError",this.onError).on("checkout_error",this.reset),c.on("change",this.onSepaError),(i("#early_renewal_modal_submit[data-payment-method]").length?i("#early_renewal_modal_submit[data-payment-method=stripe]"):i("#early_renewal_modal_submit")).on("click",this.onEarlyRenewalSubmit),m.createElements(),window.addEventListener("hashchange",m.onHashChange),m.maybeConfirmIntent(),i(document).on("change",".wc_payment_methods",function(){function n(e){return 12<=e.replace(/\D/g,"").length?"00.000.000/0000-00":"000.000.000-009999"}var e={onKeyPress:function(e,r,t,o){t.mask(n.apply({},arguments),o)}};i("#stripe_boleto_tax_id").mask(n,e)})},isStripeChosen:function(){return i("#payment_method_stripe, #payment_method_stripe_bancontact, #payment_method_stripe_sofort, #payment_method_stripe_giropay, #payment_method_stripe_ideal, #payment_method_stripe_alipay, #payment_method_stripe_sepa, #payment_method_stripe_eps, #payment_method_stripe_multibanco, #payment_method_stripe_boleto, #payment_method_stripe_oxxo").is(":checked")||i("#payment_method_stripe").is(":checked")&&"new"===i('input[name="wc-stripe-payment-token"]:checked').val()||i("#payment_method_stripe_sepa").is(":checked")&&"new"===i('input[name="wc-stripe-payment-token"]:checked').val()},isStripeSaveCardChosen:function(){return i("#payment_method_stripe").is(":checked")&&i('input[name="wc-stripe-payment-token"]').is(":checked")&&"new"!==i('input[name="wc-stripe-payment-token"]:checked').val()||i("#payment_method_stripe_sepa").is(":checked")&&i('input[name="wc-stripe_sepa-payment-token"]').is(":checked")&&"new"!==i('input[name="wc-stripe_sepa-payment-token"]:checked').val()},isStripeCardChosen:function(){return i("#payment_method_stripe").is(":checked")},isBancontactChosen:function(){return i("#payment_method_stripe_bancontact").is(":checked")},isGiropayChosen:function(){return i("#payment_method_stripe_giropay").is(":checked")},isIdealChosen:function(){return i("#payment_method_stripe_ideal").is(":checked")},isSofortChosen:function(){return i("#payment_method_stripe_sofort").is(":checked")},isAlipayChosen:function(){return i("#payment_method_stripe_alipay").is(":checked")},isSepaChosen:function(){return i("#payment_method_stripe_sepa").is(":checked")},isP24Chosen:function(){return i("#payment_method_stripe_p24").is(":checked")},isEpsChosen:function(){return i("#payment_method_stripe_eps").is(":checked")},isMultibancoChosen:function(){return i("#payment_method_stripe_multibanco").is(":checked")},isBoletoChosen:function(){return i("#payment_method_stripe_boleto").is(":checked")},isOxxoChosen:function(){return i("#payment_method_stripe_oxxo").is(":checked")},hasSource:function(){return 0<i("input.stripe-source").length},isMobile:function(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},block:function(){m.isMobile()||m.form.block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},unblock:function(){m.form&&m.form.unblock()},getSelectedPaymentElement:function(){return i('.payment_methods input[name="payment_method"]:checked')},getOwnerDetails:function(){var e=i("#billing_first_name").length?i("#billing_first_name").val():wc_stripe_params.billing_first_name,r=i("#billing_last_name").length?i("#billing_last_name").val():wc_stripe_params.billing_last_name,t={name:"",address:{},email:"",phone:""};return t.name=e,t.name=e&&r?e+" "+r:i("#stripe-payment-data").data("full-name"),t.email=i("#billing_email").val(),t.phone=i("#billing_phone").val(),(void 0===t.phone||t.phone.length<=0)&&delete t.phone,(void 0===t.email||t.email.length<=0)&&(i("#stripe-payment-data").data("email").length?t.email=i("#stripe-payment-data").data("email"):delete t.email),(void 0===t.name||t.name.length<=0)&&delete t.name,t.address.line1=i("#billing_address_1").val()||wc_stripe_params.billing_address_1,t.address.line2=i("#billing_address_2").val()||wc_stripe_params.billing_address_2,t.address.state=i("#billing_state").val()||wc_stripe_params.billing_state,t.address.city=i("#billing_city").val()||wc_stripe_params.billing_city,t.address.postal_code=i("#billing_postcode").val()||wc_stripe_params.billing_postcode,t.address.country=i("#billing_country").val()||wc_stripe_params.billing_country,{owner:t}},createSource:function(){var e=m.getOwnerDetails();return m.isSepaChosen()?(e.currency=i("#stripe-sepa_debit-payment-data").data("currency"),e.mandate={notification_method:wc_stripe_params.sepa_mandate_notification},e.type="sepa_debit",n.createSource(c,e).then(m.sourceResponse)):n.createSource(t,e).then(m.sourceResponse)},sourceResponse:function(e){e.error?i(document.body).trigger("stripeError",e):(m.reset(),m.form.append(i('<input type="hidden" />').addClass("stripe-source").attr("name","stripe_source").val(e.source.id)),i("form#add_payment_method").length||i("#wc-stripe-change-payment-method").length?m.sourceSetup(e):m.form.trigger("submit"))},sourceSetup:function(r){var e={error:{type:"api_connection_error"}};i.post({url:m.getAjaxURL("create_setup_intent"),dataType:"json",data:{stripe_source_id:r.source.id,nonce:wc_stripe_params.add_card_nonce},error:function(){i(document.body).trigger("stripeError",e)}}).done(function(e){return"success"===e.status?(i("form#add_payment_method").length&&i(m.form).off("submit",m.form.onSubmit),void m.form.trigger("submit")):void("requires_action"===e.status?n.confirmCardSetup(e.client_secret,{payment_method:r.source.id}).then(function(e){e.error?i(document.body).trigger("stripeError",e):(i("form#add_payment_method").length&&i(m.form).off("submit",m.form.onSubmit),m.form.trigger("submit"))}).catch(function(e){console.log(e),i(document.body).trigger("stripeError",{error:e})}):i(document.body).trigger("stripeError",e))})},onSubmit:function(){if(!m.isStripeChosen())return!0;if(m.isStripeSaveCardChosen()||m.hasSource())return!0;if(m.isBancontactChosen()||m.isGiropayChosen()||m.isIdealChosen()||m.isAlipayChosen()||m.isSofortChosen()||m.isP24Chosen()||m.isEpsChosen()||m.isMultibancoChosen())return!0;if(m.block(),m.isBoletoChosen()){if(!i("#stripe_boleto_tax_id").val())return m.submitError(wc_stripe_params.cpf_cnpj_required_msg),m.unblock(),!1;m.handleBoleto()}else m.isOxxoChosen()?m.handleOxxo():m.createSource();return!1},handleBoleto:function(){m.executeCheckout("boleto",function(r){n.confirmBoletoPayment(r.client_secret,r.confirm_payment_data).then(function(e){m.handleConfirmResponse(r,e)})})},executeCheckout:function(e,r){const t=m.form.serializeArray().reduce((e,r)=>(e[r.name]=r.value,e),{});"order_review"===m.form.attr("id")?(t._ajax_nonce=wc_stripe_params.updatePaymentIntentNonce,t.order_id=wc_stripe_params.orderId,i.ajax({url:m.getAjaxURL(e+"_update_payment_intent"),type:"POST",data:t,success:function(e){if("success"!==e.result)return m.submitError(e.messages),void m.unblock();r(e)}})):i.ajax({url:wc_stripe_params.checkout_url,type:"POST",data:t,success:function(e){if("success"!==e.result)return m.submitError(e.messages,!0),void m.unblock();r(e)}})},handleConfirmResponse:function(e,r){r.error?i(document.body).trigger("stripeError",r):-1===e.redirect.indexOf("https://")||-1===e.redirect.indexOf("http://")?window.location=e.redirect:window.location=decodeURI(e.redirect)},handleOxxo:function(){m.executeCheckout("oxxo",function(r){n.confirmOxxoPayment(r.client_secret,r.confirm_payment_data).then(function(e){m.handleConfirmResponse(r,e)})})},onCCFormChange:function(){m.reset()},reset:function(){i(".wc-stripe-error, .stripe-source").remove()},onSepaError:function(e){var r=m.getSelectedPaymentElement().parents("li").eq(0).find(".stripe-source-errors");e.error?(console.log(e.error.message),i(r).html('<ul class="woocommerce_error woocommerce-error wc-stripe-error"><li /></ul>'),i(r).find("li").text(e.error.message)):i(r).html("")},onError:function(e,r){var t=r.error.message,o=m.getSelectedPaymentElement().closest("li"),n=o.find(".woocommerce-SavedPaymentMethods-tokenInput");o=i("body").hasClass("woocommerce-stripe-prb-clicked")?(i("body").removeClass("woocommerce-stripe-prb-clicked"),i("div.woocommerce-notices-wrapper").first()):n.length?(n=n.filter(":checked")).closest(".woocommerce-SavedPaymentMethods-new").length?i("#wc-stripe-cc-form .stripe-source-errors"):n.closest("li").find(".stripe-source-errors"):o.find(".stripe-source-errors"),m.isSepaChosen()&&"invalid_owner_name"===r.error.code&&wc_stripe_params.hasOwnProperty(r.error.code)?m.submitError(wc_stripe_params[r.error.code]):("email_invalid"===r.error.code?t=wc_stripe_params.email_invalid:"invalid_request_error"!==r.error.type&&"api_connection_error"!==r.error.type&&"api_error"!==r.error.type&&"authentication_error"!==r.error.type&&"rate_limit_error"!==r.error.type||(t=wc_stripe_params.invalid_request_error),wc_stripe_params.hasOwnProperty(r.error.code)&&(t=wc_stripe_params[r.error.code]),m.reset(),i(".woocommerce-NoticeGroup-checkout").remove(),console.log(r.error.message),i(o).html('<ul class="woocommerce_error woocommerce-error wc-stripe-error"><li /></ul>'),i(o).find("li").text(t),i(".wc-stripe-error").length&&i("html, body").animate({scrollTop:i(".wc-stripe-error").offset().top-200},200),m.unblock(),i.unblockUI())},submitError:function(e,r=!1){r||((r=i('<div><ul class="woocommerce-error"><li /></ul></div>')).find("li").text(e),e=r.html()),i(".woocommerce-NoticeGroup-checkout, .woocommerce-error, .woocommerce-message").remove(),m.form.prepend('<div class="woocommerce-NoticeGroup woocommerce-NoticeGroup-checkout">'+e+"</div>"),m.form.removeClass("processing").unblock(),m.form.find(".input-text, select, input:checkbox").trigger("blur");e="";i("#add_payment_method").length&&(e=i("#add_payment_method")),i("#order_review").length&&(e=i("#order_review")),(e=i("form.checkout").length?i("form.checkout"):e).length&&i("html, body").animate({scrollTop:e.offset().top-100},500),i(document.body).trigger("checkout_error"),m.unblock()},onHashChange:function(){var e,r,t=window.location.hash.match(/^#?confirm-(pi|si)-([^:]+):(.+)$/);!t||t.length<4||(e=t[1],r=t[2],t=decodeURIComponent(t[3]),window.location.hash="",m.openIntentModal(r,t,!1,"si"===e))},maybeConfirmIntent:function(){var e,r;i("#stripe-intent-id").length&&i("#stripe-intent-return").length&&(e=i("#stripe-intent-id").val(),r=i("#stripe-intent-return").val(),m.openIntentModal(e,r,!0,!1))},openIntentModal:function(e,r,t,o){n[o?"handleCardSetup":"handleCardPayment"](e).then(function(e){if(e.error)throw e.error;e=e[o?"setupIntent":"paymentIntent"];"requires_capture"!==e.status&&"succeeded"!==e.status||(window.location=r)}).catch(function(e){t?window.location=r:(i(document.body).trigger("stripeError",{error:e}),m.form&&m.form.removeClass("processing"),i.get(r+"&is_ajax"))})},onEarlyRenewalSubmit:function(e){return e.preventDefault(),i.ajax({url:i("#early_renewal_modal_submit").attr("href"),method:"get",success:function(e){e=JSON.parse(e);e.stripe_sca_required?m.openIntentModal(e.intent_secret,e.redirect_url,!0,!1):window.location=e.redirect_url}}),!1}};m.init()});
build/index.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('jquery', 'react', 'wc-blocks-registry', 'wc-settings', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '1b98f878a188df526b127251b432b4b2');
1
+ <?php return array('dependencies' => array('jquery', 'react', 'wc-blocks-registry', 'wc-settings', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '050923d77fd9ba7faa48ce702e542622');
build/index.js CHANGED
@@ -1 +1 @@
1
- !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=305)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.React},function(e,t){e.exports=window.wp.i18n},,,,,function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,n.apply(this,arguments)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return i})),n.d(t,"d",(function(){return c})),n.d(t,"b",(function(){return a}));var r=n(148);const o=()=>{const e=Object(r.getSetting)("stripe_data",null);if(!e)throw new Error("Stripe initialization data is not available");return e},i=(e,t)=>{var n,r;const i={total:t.order_data.total,currency:t.order_data.currency,country:t.order_data.country_code,requestPayerName:!0,requestPayerEmail:!0,requestPayerPhone:null===(n=o())||void 0===n||null===(r=n.checkout)||void 0===r?void 0:r.needs_payer_phone,requestShipping:!!t.shipping_required,displayItems:t.order_data.displayItems};return"PR"===i.country&&(i.country="US"),e.paymentRequest(i)},c=(e,t)=>{const n={total:t.order_data.total,currency:t.order_data.currency,displayItems:t.order_data.displayItems};e.update(n)},a=()=>{var e;const t=null===(e=o())||void 0===e?void 0:e.key;if(!t)throw new Error("There is no api key available for stripe. Make sure it is available on the wc.stripe_data.stripe.key property.");return t}},function(e,t,n){(function(t){var n=function(e){return e&&e.Math==Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof t&&t)||function(){return this}()||Function("return this")()}).call(this,n(108))},function(e,t,n){var r=n(9),o=n(81),i=n(17),c=n(76),a=n(77),s=n(110),u=o("wks"),l=r.Symbol,p=s?l:l&&l.withoutSetter||c;e.exports=function(e){return i(u,e)&&(a||"string"==typeof u[e])||(a&&i(l,e)?u[e]=l[e]:u[e]=p("Symbol."+e)),u[e]}},function(e,t,n){"use strict";var r=n(9),o=n(80).f,i=n(84),c=n(24),a=n(43),s=n(18),u=n(17),l=function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t};e.exports=function(e,t){var n,p,f,d,v,m,y,h,g=e.target,b=e.global,_=e.stat,w=e.proto,E=b?r:_?r[g]:(r[g]||{}).prototype,O=b?c:c[g]||(c[g]={}),j=O.prototype;for(f in t)n=!i(b?f:g+(_?".":"#")+f,e.forced)&&E&&u(E,f),v=O[f],n&&(m=e.noTargetGet?(h=o(E,f))&&h.value:E[f]),d=n&&m?m:t[f],n&&typeof v==typeof d||(y=e.bind&&n?a(d,r):e.wrap&&n?l(d):w&&"function"==typeof d?a(Function.call,d):d,(e.sham||d&&d.sham||v&&v.sham)&&s(y,"sham",!0),O[f]=y,w&&(u(c,p=g+"Prototype")||s(c,p,{}),c[p][f]=d,e.real&&j&&!j[f]&&s(j,f,d)))}},,,function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){e.exports=n(118)},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){var r=n(23),o=n(34),i=n(36);e.exports=r?function(e,t,n){return o.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return o}));const r={INVALID_EMAIL:"email_invalid",INVALID_REQUEST:"invalid_request_error",API_CONNECTION:"api_connection_error",API_ERROR:"api_error",AUTHENTICATION_ERROR:"authentication_error",RATE_LIMIT_ERROR:"rate_limit_error",CARD_ERROR:"card_error",VALIDATION_ERROR:"validation_error"},o={INVALID_NUMBER:"invalid_number",INVALID_EXPIRY_MONTH:"invalid_expiry_month",INVALID_EXPIRY_YEAR:"invalid_expiry_year",INVALID_CVC:"invalid_cvc",INCORRECT_NUMBER:"incorrect_number",INCOMPLETE_NUMBER:"incomplete_number",INCOMPLETE_CVC:"incomplete_cvc",INCOMPLETE_EXPIRY:"incomplete_expiry",EXPIRED_CARD:"expired_card",INCORRECT_CVC:"incorrect_cvc",INCORRECT_ZIP:"incorrect_zip",INVALID_EXPIRY_YEAR_PAST:"invalid_expiry_year_past",CARD_DECLINED:"card_declined",MISSING:"missing",PROCESSING_ERROR:"processing_error"}},,function(e,t,n){var r=n(16);e.exports=function(e){if(!r(e))throw TypeError(String(e)+" is not an object");return e}},,function(e,t,n){var r=n(14);e.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(e,t){e.exports={}},,function(e,t,n){var r=n(24);e.exports=function(e){return r[e+"Prototype"]}},,function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},function(e,t,n){!function(e,t){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function o(){}function i(){}t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t,i.resetWarningCache=o;var c=function(e,t){return function(e){e.exports=function(){function e(e,t,n,r,o,i){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==i){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}()}(t={exports:{}}),t.exports}(),a=function(e){return null!==e&&"object"===n(e)},s=function e(t,n){if(!a(t)||!a(n))return t===n;var r=Array.isArray(t);if(r!==Array.isArray(n))return!1;var o="[object Object]"===Object.prototype.toString.call(t);if(o!==("[object Object]"===Object.prototype.toString.call(n)))return!1;if(!o&&!r)return!1;var i=Object.keys(t),c=Object.keys(n);if(i.length!==c.length)return!1;for(var s={},u=0;u<i.length;u+=1)s[i[u]]=!0;for(var l=0;l<c.length;l+=1)s[c[l]]=!0;var p=Object.keys(s);if(p.length!==i.length)return!1;var f=t,d=n;return p.every((function(t){return e(f[t],d[t])}))},u=function(e){var n=t.useRef(e);return t.useEffect((function(){n.current=e}),[e]),n.current},l=function(e){if(null===e||a(t=e)&&"function"==typeof t.elements&&"function"==typeof t.createToken&&"function"==typeof t.createPaymentMethod&&"function"==typeof t.confirmCardPayment)return e;var t;throw new Error("Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.")},p=t.createContext(null);p.displayName="ElementsContext";var f=function(e){var n,o,i=e.stripe,c=e.options,f=e.children,d=t.useRef(!1),v=t.useRef(!0),m=t.useMemo((function(){return function(e){if(function(e){return a(e)&&"function"==typeof e.then}(e))return{tag:"async",stripePromise:Promise.resolve(e).then(l)};var t=l(e);return null===t?{tag:"empty"}:{tag:"sync",stripe:t}}(i)}),[i]),y=(n=t.useState((function(){return{stripe:null,elements:null}})),o=2,function(e){if(Array.isArray(e))return e}(n)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],_n=!0,r=!1,o=void 0;try{for(var i,c=e[Symbol.iterator]();!(_n=(i=c.next()).done)&&(n.push(i.value),!t||n.length!==t);_n=!0);}catch(e){r=!0,o=e}finally{try{_n||null==c.return||c.return()}finally{if(r)throw o}}return n}}(n,o)||function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(n,o)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),h=y[0],g=y[1],b=u(i),_=u(c);return null!==b&&(b!==i&&console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it."),s(c,_)||console.warn("Unsupported prop change on Elements: You cannot change the `options` prop after setting the `stripe` prop.")),d.current||("sync"===m.tag&&(d.current=!0,g({stripe:m.stripe,elements:m.stripe.elements(c)})),"async"===m.tag&&(d.current=!0,m.stripePromise.then((function(e){e&&v.current&&g({stripe:e,elements:e.elements(c)})})))),t.useEffect((function(){return function(){v.current=!1}}),[]),t.useEffect((function(){var e=h.stripe;e&&e._registerWrapper&&e.registerAppInfo&&(e._registerWrapper({name:"react-stripe-js",version:"1.4.1"}),e.registerAppInfo({name:"react-stripe-js",version:"1.4.1",url:"https://stripe.com/docs/stripe-js/react"}))}),[h.stripe]),t.createElement(p.Provider,{value:h},f)};f.propTypes={stripe:c.any,options:c.object};var d=function(e){return function(e,t){if(!e)throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(t," in an <Elements> provider."));return e}(t.useContext(p),e)},v=function(e){return(0,e.children)(d("mounts <ElementsConsumer>"))};v.propTypes={children:c.func.isRequired};var m=function(e){var n=t.useRef(e);return t.useEffect((function(){n.current=e}),[e]),function(){n.current&&n.current.apply(n,arguments)}},y=function(e){return a(e)?(e.paymentRequest,function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["paymentRequest"])):{}},h=function(){},g=function(e,n){var r,o="".concat((r=e).charAt(0).toUpperCase()+r.slice(1),"Element"),i=n?function(e){d("mounts <".concat(o,">"));var n=e.id,r=e.className;return t.createElement("div",{id:n,className:r})}:function(n){var r=n.id,i=n.className,c=n.options,a=void 0===c?{}:c,u=n.onBlur,l=void 0===u?h:u,p=n.onFocus,f=void 0===p?h:p,v=n.onReady,g=void 0===v?h:v,b=n.onChange,_=void 0===b?h:b,w=n.onEscape,E=void 0===w?h:w,O=n.onClick,j=void 0===O?h:O,x=d("mounts <".concat(o,">")).elements,C=t.useRef(null),S=t.useRef(null),R=m(g),T=m(l),I=m(f),A=m(j),P=m(_),k=m(E);t.useLayoutEffect((function(){if(null==C.current&&x&&null!=S.current){var t=x.create(e,a);C.current=t,t.mount(S.current),t.on("ready",(function(){return R(t)})),t.on("change",P),t.on("blur",T),t.on("focus",I),t.on("escape",k),t.on("click",A)}}));var N=t.useRef(a);return t.useEffect((function(){N.current&&N.current.paymentRequest!==a.paymentRequest&&console.warn("Unsupported prop change: options.paymentRequest is not a customizable property.");var e=y(a);0===Object.keys(e).length||s(e,y(N.current))||C.current&&(C.current.update(e),N.current=a)}),[a]),t.useLayoutEffect((function(){return function(){C.current&&C.current.destroy()}}),[]),t.createElement("div",{id:r,className:i,ref:S})};return i.propTypes={id:c.string,className:c.string,onChange:c.func,onBlur:c.func,onFocus:c.func,onReady:c.func,onClick:c.func,options:c.object},i.displayName=o,i.__elementType=e,i},b="undefined"==typeof window,_=g("auBankAccount",b),w=g("card",b),E=g("cardNumber",b),O=g("cardExpiry",b),j=g("cardCvc",b),x=g("fpxBank",b),C=g("iban",b),S=g("idealBank",b),R=g("p24Bank",b),T=g("epsBank",b),I=g("payment",b),A=g("paymentRequestButton",b),P=g("afterpayClearpayMessage",b);e.AfterpayClearpayMessageElement=P,e.AuBankAccountElement=_,e.CardCvcElement=j,e.CardElement=w,e.CardExpiryElement=O,e.CardNumberElement=E,e.Elements=f,e.ElementsConsumer=v,e.EpsBankElement=T,e.FpxBankElement=x,e.IbanElement=C,e.IdealBankElement=S,e.P24BankElement=R,e.PaymentElement=I,e.PaymentRequestButtonElement=A,e.useElements=function(){return d("calls useElements()").elements},e.useStripe=function(){return d("calls useStripe()").stripe},Object.defineProperty(e,"__esModule",{value:!0})}(t,n(1))},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){var r=n(24),o=n(9),i=function(e){return"function"==typeof e?e:void 0};e.exports=function(e,t){return arguments.length<2?i(r[e])||i(o[e]):r[e]&&r[e][t]||o[e]&&o[e][t]}},,function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(23),o=n(75),i=n(21),c=n(54),a=Object.defineProperty;t.f=r?a:function(e,t,n){if(i(e),t=c(t,!0),i(n),o)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},function(e,t){e.exports={}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t){e.exports=!0},function(e,t,n){var r=n(53),o=n(33);e.exports=function(e){return r(o(e))}},,function(e,t,n){var r=n(51),o=Math.min;e.exports=function(e){return e>0?o(r(e),9007199254740991):0}},,function(e,t,n){"use strict";n.d(t,"c",(function(){return m})),n.d(t,"b",(function(){return d})),n.d(t,"a",(function(){return v}));var r=n(15),o=n.n(r),i=n(52),c=n.n(i),a=n(155),s=n.n(a),u=n(100),l=n.n(u),p=n(2),f=n(19);const d=()=>{if(!wc_stripe_upe_params)throw new Error("Stripe initialization data is not available");return wc_stripe_upe_params},v=(e,t="")=>{switch(e){case f.b.INVALID_EMAIL:return Object(p.__)("Invalid email address, please correct and try again.","woocommerce-gateway-stripe");case(e=>{var t;return o()(t=[f.b.INVALID_REQUEST,f.b.API_CONNECTION,f.b.API_ERROR,f.b.AUTHENTICATION_ERROR,f.b.RATE_LIMIT_ERROR]).call(t,e)})(e):return Object(p.__)("Unable to process this payment, please try again or use alternative method.","woocommerce-gateway-stripe");case f.b.CARD_ERROR:return(e=>({[f.a.INVALID_NUMBER]:Object(p.__)("The card number is not a valid credit card number.","woocommerce-gateway-stripe"),[f.a.INVALID_EXPIRY_MONTH]:Object(p.__)("The card expiration month is invalid.","woocommerce-gateway-stripe"),[f.a.INVALID_EXPIRY_YEAR]:Object(p.__)("The card expiration year is invalid.","woocommerce-gateway-stripe"),[f.a.INVALID_CVC]:Object(p.__)("The card security code is invalid.","woocommerce-gateway-stripe"),[f.a.INCORRECT_NUMBER]:Object(p.__)("The card number is incorrect.","woocommerce-gateway-stripe"),[f.a.INCOMPLETE_NUMBER]:Object(p.__)("The card number is incomplete.","woocommerce-gateway-stripe"),[f.a.INCOMPLETE_CVC]:Object(p.__)("The card security code is incomplete.","woocommerce-gateway-stripe"),[f.a.INCOMPLETE_EXPIRY]:Object(p.__)("The card expiration date is incomplete.","woocommerce-gateway-stripe"),[f.a.EXPIRED_CARD]:Object(p.__)("The card has expired.","woocommerce-gateway-stripe"),[f.a.INCORRECT_CVC]:Object(p.__)("The card security code is incorrect.","woocommerce-gateway-stripe"),[f.a.INCORRECT_ZIP]:Object(p.__)("The card zip code failed validation.","woocommerce-gateway-stripe"),[f.a.INVALID_EXPIRY_YEAR_PAST]:Object(p.__)("The card expiration year is in the past","woocommerce-gateway-stripe"),[f.a.CARD_DECLINED]:Object(p.__)("The card was declined.","woocommerce-gateway-stripe"),[f.a.MISSING]:Object(p.__)("There is no card on a customer that is being charged.","woocommerce-gateway-stripe"),[f.a.PROCESSING_ERROR]:Object(p.__)("An error occurred while processing the card.","woocommerce-gateway-stripe")}[e]||null))(t);case f.b.VALIDATION_ERROR:return""}return null},m=(e="always")=>{var t,n;const r=null===(t=d())||void 0===t?void 0:t.paymentMethodsConfig,o=c()(n=s()(r)).call(n,e=>r[e].isReusable);return l()(o).call(o,(t,n)=>(t[n]=e,t),{})}},function(e,t,n){var r=n(28);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){var r=n(30),o=n(9);e.exports="process"==r(o.process)},function(e,t,n){var r=n(33);e.exports=function(e){return Object(r(e))}},function(e,t,n){var r,o,i=n(9),c=n(57),a=i.process,s=a&&a.versions,u=s&&s.v8;u?o=(r=u.split("."))[0]+r[1]:c&&(!(r=c.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=c.match(/Chrome\/(\d+)/))&&(o=r[1]),e.exports=o&&+o},,function(e,t){e.exports=window.jQuery},function(e,t,n){var r=n(18);e.exports=function(e,t,n,o){o&&o.enumerable?e[t]=n:r(e,t,n)}},,function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){e.exports=n(173)},function(e,t,n){var r=n(14),o=n(30),i="".split;e.exports=r((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==o(e)?i.call(e,""):Object(e)}:Object},function(e,t,n){var r=n(16);e.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},function(e,t,n){var r=n(9),o=n(109),i=r["__core-js_shared__"]||o("__core-js_shared__",{});e.exports=i},function(e,t,n){var r=n(21),o=n(130),i=n(40),c=n(43),a=n(103),s=n(131),u=function(e,t){this.stopped=e,this.result=t};e.exports=function(e,t,n){var l,p,f,d,v,m,y,h=n&&n.that,g=!(!n||!n.AS_ENTRIES),b=!(!n||!n.IS_ITERATOR),_=!(!n||!n.INTERRUPTED),w=c(t,h,1+g+_),E=function(e){return l&&s(l),new u(!0,e)},O=function(e){return g?(r(e),_?w(e[0],e[1],E):w(e[0],e[1])):_?w(e,E):w(e)};if(b)l=e;else{if("function"!=typeof(p=a(e)))throw TypeError("Target is not iterable");if(o(p)){for(f=0,d=i(e.length);d>f;f++)if((v=O(e[f]))&&v instanceof u)return v;return new u(!1)}l=p.call(e)}for(m=l.next;!(y=m.call(l)).done;){try{v=O(y.value)}catch(e){throw s(l),e}if("object"==typeof v&&v&&v instanceof u)return v}return new u(!1)}},function(e,t,n){var r=n(31);e.exports=r("navigator","userAgent")||""},function(e,t,n){var r=n(67),o=n(34).f,i=n(18),c=n(17),a=n(142),s=n(10)("toStringTag");e.exports=function(e,t,n,u){if(e){var l=n?e:e.prototype;c(l,s)||o(l,s,{configurable:!0,value:t}),u&&!r&&i(l,"toString",a)}}},function(e,t,n){var r,o,i,c=n(144),a=n(9),s=n(16),u=n(18),l=n(17),p=n(55),f=n(66),d=n(63),v=a.WeakMap;if(c){var m=p.state||(p.state=new v),y=m.get,h=m.has,g=m.set;r=function(e,t){return t.facade=e,g.call(m,e,t),t},o=function(e){return y.call(m,e)||{}},i=function(e){return h.call(m,e)}}else{var b=f("state");d[b]=!0,r=function(e,t){return t.facade=e,u(e,b,t),t},o=function(e){return l(e,b)?e[b]:{}},i=function(e){return l(e,b)}}e.exports={set:r,get:o,has:i,enforce:function(e){return i(e)?o(e):r(e,{})},getterFor:function(e){return function(t){var n;if(!s(t)||(n=o(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}}},,,function(e,t,n){var r=n(9),o=n(16),i=r.document,c=o(i)&&o(i.createElement);e.exports=function(e){return c?i.createElement(e):{}}},function(e,t){e.exports={}},function(e,t,n){var r=n(67),o=n(30),i=n(10)("toStringTag"),c="Arguments"==o(function(){return arguments}());e.exports=r?o:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),i))?n:c?o(t):"Object"==(r=o(t))&&"function"==typeof t.callee?"Arguments":r}},,function(e,t,n){var r=n(81),o=n(76),i=r("keys");e.exports=function(e){return i[e]||(i[e]=o(e))}},function(e,t,n){var r={};r[n(10)("toStringTag")]="z",e.exports="[object z]"===String(r)},function(e,t,n){"use strict";var r=n(28),o=function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r})),this.resolve=r(t),this.reject=r(n)};e.exports.f=function(e){return new o(e)}},,function(e,t,n){e.exports=n(158)},,function(e,t,n){var r=n(17),o=n(45),i=n(66),c=n(138),a=i("IE_PROTO"),s=Object.prototype;e.exports=c?Object.getPrototypeOf:function(e){return e=o(e),r(e,a)?e[a]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?s:null}},function(e,t,n){var r=n(38),o=n(40),i=n(97),c=function(e){return function(t,n,c){var a,s=r(t),u=o(s.length),l=i(c,u);if(e&&n!=n){for(;u>l;)if((a=s[l++])!=a)return!0}else for(;u>l;l++)if((e||l in s)&&s[l]===n)return e||l||0;return!e&&-1}};e.exports={includes:c(!0),indexOf:c(!1)}},,function(e,t,n){var r=n(23),o=n(14),i=n(62);e.exports=!r&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++n+r).toString(36)}},function(e,t,n){var r=n(44),o=n(46),i=n(14);e.exports=!!Object.getOwnPropertySymbols&&!i((function(){return!Symbol.sham&&(r?38===o:o>37&&o<41)}))},function(e,t,n){e.exports=n(169)},,function(e,t,n){var r=n(23),o=n(90),i=n(36),c=n(38),a=n(54),s=n(17),u=n(75),l=Object.getOwnPropertyDescriptor;t.f=r?l:function(e,t){if(e=c(e),t=a(t,!0),u)try{return l(e,t)}catch(e){}if(s(e,t))return i(!o.f.call(e,t),e[t])}},function(e,t,n){var r=n(37),o=n(55);(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.9.1",mode:r?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})},function(e,t){e.exports=function(){}},,function(e,t,n){var r=n(14),o=/#|\.prototype\./,i=function(e,t){var n=a[c(e)];return n==u||n!=s&&("function"==typeof t?r(t):!!t)},c=i.normalize=function(e){return String(e).replace(o,".").toLowerCase()},a=i.data={},s=i.NATIVE="N",u=i.POLYFILL="P";e.exports=i},function(e,t,n){var r,o=n(21),i=n(129),c=n(91),a=n(63),s=n(98),u=n(62),l=n(66)("IE_PROTO"),p=function(){},f=function(e){return"<script>"+e+"<\/script>"},d=function(){try{r=document.domain&&new ActiveXObject("htmlfile")}catch(e){}var e,t;d=r?function(e){e.write(f("")),e.close();var t=e.parentWindow.Object;return e=null,t}(r):((t=u("iframe")).style.display="none",s.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(f("document.F=Object")),e.close(),e.F);for(var n=c.length;n--;)delete d.prototype[c[n]];return d()};a[l]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(p.prototype=o(e),n=new p,p.prototype=null,n[l]=e):n=d(),void 0===t?n:i(n,t)}},function(e,t,n){var r=n(140),o=n(91);e.exports=Object.keys||function(e){return r(e,o)}},function(e,t){e.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},function(e,t,n){var r=n(43),o=n(53),i=n(45),c=n(40),a=n(146),s=[].push,u=function(e){var t=1==e,n=2==e,u=3==e,l=4==e,p=6==e,f=7==e,d=5==e||p;return function(v,m,y,h){for(var g,b,_=i(v),w=o(_),E=r(m,y,3),O=c(w.length),j=0,x=h||a,C=t?x(v,O):n||f?x(v,0):void 0;O>j;j++)if((d||j in w)&&(b=E(g=w[j],j,_),e))if(t)C[j]=b;else if(b)switch(e){case 3:return!0;case 5:return g;case 6:return j;case 2:s.call(C,g)}else switch(e){case 4:return!1;case 7:s.call(C,g)}return p?-1:u||l?l:C}};e.exports={forEach:u(0),map:u(1),filter:u(2),some:u(3),every:u(4),find:u(5),findIndex:u(6),filterOut:u(7)}},function(e,t,n){var r=n(14),o=n(10),i=n(46),c=o("species");e.exports=function(e){return i>=51||!r((function(){var t=[];return(t.constructor={})[c]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},function(e,t,n){"use strict";var r={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,i=o&&!r.call({1:2},1);t.f=i?function(e){var t=o(this,e);return!!t&&t.enumerable}:r},function(e,t){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(e,t,n){"use strict";var r=n(11),o=n(133),i=n(72),c=n(96),a=n(58),s=n(18),u=n(49),l=n(10),p=n(37),f=n(35),d=n(93),v=d.IteratorPrototype,m=d.BUGGY_SAFARI_ITERATORS,y=l("iterator"),h=function(){return this};e.exports=function(e,t,n,l,d,g,b){o(n,t,l);var _,w,E,O=function(e){if(e===d&&R)return R;if(!m&&e in C)return C[e];switch(e){case"keys":case"values":case"entries":return function(){return new n(this,e)}}return function(){return new n(this)}},j=t+" Iterator",x=!1,C=e.prototype,S=C[y]||C["@@iterator"]||d&&C[d],R=!m&&S||O(d),T="Array"==t&&C.entries||S;if(T&&(_=i(T.call(new e)),v!==Object.prototype&&_.next&&(p||i(_)===v||(c?c(_,v):"function"!=typeof _[y]&&s(_,y,h)),a(_,j,!0,!0),p&&(f[j]=h))),"values"==d&&S&&"values"!==S.name&&(x=!0,R=function(){return S.call(this)}),p&&!b||C[y]===R||s(C,y,R),f[t]=R,d)if(w={values:O("values"),keys:g?R:O("keys"),entries:O("entries")},b)for(E in w)(m||x||!(E in C))&&u(C,E,w[E]);else r({target:t,proto:!0,forced:m||x},w);return w}},function(e,t,n){"use strict";var r,o,i,c=n(14),a=n(72),s=n(18),u=n(17),l=n(10),p=n(37),f=l("iterator"),d=!1;[].keys&&("next"in(i=[].keys())?(o=a(a(i)))!==Object.prototype&&(r=o):d=!0);var v=null==r||c((function(){var e={};return r[f].call(e)!==e}));v&&(r={}),p&&!v||u(r,f)||s(r,f,(function(){return this})),e.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:d}},,,function(e,t,n){var r=n(21),o=n(139);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),t=n instanceof Array}catch(e){}return function(n,i){return r(n),o(i),t?e.call(n,i):n.__proto__=i,n}}():void 0)},function(e,t,n){var r=n(51),o=Math.max,i=Math.min;e.exports=function(e,t){var n=r(e);return n<0?o(n+t,0):i(n,t)}},function(e,t,n){var r=n(31);e.exports=r("document","documentElement")},function(e,t,n){var r=n(55),o=Function.toString;"function"!=typeof r.inspectSource&&(r.inspectSource=function(e){return o.call(e)}),e.exports=r.inspectSource},function(e,t,n){e.exports=n(177)},,,function(e,t,n){var r=n(64),o=n(35),i=n(10)("iterator");e.exports=function(e){if(null!=e)return e[i]||e["@@iterator"]||o[r(e)]}},function(e,t,n){var r=n(30);e.exports=Array.isArray||function(e){return"Array"==r(e)}},function(e,t,n){var r=n(124);e.exports=function(e){if(r(e))throw TypeError("The method doesn't accept regular expressions");return e}},function(e,t,n){var r=n(10)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[r]=!1,"/./"[e](t)}catch(e){}}return!1}},,function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var r=n(9),o=n(18);e.exports=function(e,t){try{o(r,e,t)}catch(n){r[e]=t}return t}},function(e,t,n){var r=n(77);e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(e,t,n){var r=n(9);e.exports=r.Promise},function(e,t){e.exports=function(e,t,n){if(!(e instanceof t))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return e}},function(e,t,n){var r=n(21),o=n(28),i=n(10)("species");e.exports=function(e,t){var n,c=r(e).constructor;return void 0===c||null==(n=r(c)[i])?t:o(n)}},function(e,t,n){var r,o,i,c=n(9),a=n(14),s=n(43),u=n(98),l=n(62),p=n(115),f=n(44),d=c.location,v=c.setImmediate,m=c.clearImmediate,y=c.process,h=c.MessageChannel,g=c.Dispatch,b=0,_={},w=function(e){if(_.hasOwnProperty(e)){var t=_[e];delete _[e],t()}},E=function(e){return function(){w(e)}},O=function(e){w(e.data)},j=function(e){c.postMessage(e+"",d.protocol+"//"+d.host)};v&&m||(v=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return _[++b]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},r(b),b},m=function(e){delete _[e]},f?r=function(e){y.nextTick(E(e))}:g&&g.now?r=function(e){g.now(E(e))}:h&&!p?(i=(o=new h).port2,o.port1.onmessage=O,r=s(i.postMessage,i,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts&&d&&"file:"!==d.protocol&&!a(j)?(r=j,c.addEventListener("message",O,!1)):r="onreadystatechange"in l("script")?function(e){u.appendChild(l("script")).onreadystatechange=function(){u.removeChild(this),w(e)}}:function(e){setTimeout(E(e),0)}),e.exports={set:v,clear:m}},function(e,t,n){var r=n(57);e.exports=/(iphone|ipod|ipad).*applewebkit/i.test(r)},function(e,t,n){var r=n(21),o=n(16),i=n(68);e.exports=function(e,t){if(r(e),o(t)&&t.constructor===e)return t;var n=i.f(e);return(0,n.resolve)(t),n.promise}},function(e,t,n){"use strict";var r=n(132).charAt,o=n(59),i=n(92),c=o.set,a=o.getterFor("String Iterator");i(String,"String",(function(e){c(this,{type:"String Iterator",string:String(e),index:0})}),(function(){var e,t=a(this),n=t.string,o=t.index;return o>=n.length?{value:void 0,done:!0}:(e=r(n,o),t.index+=e.length,{value:e,done:!1})}))},function(e,t,n){var r=n(119);e.exports=r},function(e,t,n){var r=n(120),o=n(122),i=Array.prototype,c=String.prototype;e.exports=function(e){var t=e.includes;return e===i||e instanceof Array&&t===i.includes?r:"string"==typeof e||e===c||e instanceof String&&t===c.includes?o:t}},function(e,t,n){n(121);var r=n(26);e.exports=r("Array").includes},function(e,t,n){"use strict";var r=n(11),o=n(73).includes,i=n(82);r({target:"Array",proto:!0},{includes:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}}),i("includes")},function(e,t,n){n(123);var r=n(26);e.exports=r("String").includes},function(e,t,n){"use strict";var r=n(11),o=n(105),i=n(33);r({target:"String",proto:!0,forced:!n(106)("includes")},{includes:function(e){return!!~String(i(this)).indexOf(o(e),arguments.length>1?arguments[1]:void 0)}})},function(e,t,n){var r=n(16),o=n(30),i=n(10)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[i])?!!t:"RegExp"==o(e))}},function(e,t,n){"use strict";var r=n(14);e.exports=function(e,t){var n=[][e];return!!n&&r((function(){n.call(null,t||function(){throw 1},1)}))}},,,function(e,t,n){e.exports=n(223)},function(e,t,n){var r=n(23),o=n(34),i=n(21),c=n(86);e.exports=r?Object.defineProperties:function(e,t){i(e);for(var n,r=c(t),a=r.length,s=0;a>s;)o.f(e,n=r[s++],t[n]);return e}},function(e,t,n){var r=n(10),o=n(35),i=r("iterator"),c=Array.prototype;e.exports=function(e){return void 0!==e&&(o.Array===e||c[i]===e)}},function(e,t,n){var r=n(21);e.exports=function(e){var t=e.return;if(void 0!==t)return r(t.call(e)).value}},function(e,t,n){var r=n(51),o=n(33),i=function(e){return function(t,n){var i,c,a=String(o(t)),s=r(n),u=a.length;return s<0||s>=u?e?"":void 0:(i=a.charCodeAt(s))<55296||i>56319||s+1===u||(c=a.charCodeAt(s+1))<56320||c>57343?e?a.charAt(s):i:e?a.slice(s,s+2):c-56320+(i-55296<<10)+65536}};e.exports={codeAt:i(!1),charAt:i(!0)}},function(e,t,n){"use strict";var r=n(93).IteratorPrototype,o=n(85),i=n(36),c=n(58),a=n(35),s=function(){return this};e.exports=function(e,t,n){var u=t+" Iterator";return e.prototype=o(r,{next:i(1,n)}),c(e,u,!1,!0),a[u]=s,e}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r="stripe"},,,function(e,t,n){var r=n(14);e.exports=!r((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},function(e,t,n){var r=n(16);e.exports=function(e){if(!r(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e}},function(e,t,n){var r=n(17),o=n(38),i=n(73).indexOf,c=n(63);e.exports=function(e,t){var n,a=o(e),s=0,u=[];for(n in a)!r(c,n)&&r(a,n)&&u.push(n);for(;t.length>s;)r(a,n=t[s++])&&(~i(u,n)||u.push(n));return u}},function(e,t,n){var r=n(49);e.exports=function(e,t,n){for(var o in t)n&&n.unsafe&&e[o]?e[o]=t[o]:r(e,o,t[o],n);return e}},function(e,t,n){"use strict";var r=n(67),o=n(64);e.exports=r?{}.toString:function(){return"[object "+o(this)+"]"}},function(e,t,n){var r=n(10)("iterator"),o=!1;try{var i=0,c={next:function(){return{done:!!i++}},return:function(){o=!0}};c[r]=function(){return this},Array.from(c,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!o)return!1;var n=!1;try{var i={};i[r]=function(){return{next:function(){return{done:n=!0}}}},e(i)}catch(e){}return n}},function(e,t,n){var r=n(9),o=n(99),i=r.WeakMap;e.exports="function"==typeof i&&/native code/.test(o(i))},function(e,t,n){n(153);var r=n(168),o=n(9),i=n(64),c=n(18),a=n(35),s=n(10)("toStringTag");for(var u in r){var l=o[u],p=l&&l.prototype;p&&i(p)!==s&&c(p,s,u),a[u]=a.Array}},function(e,t,n){var r=n(16),o=n(104),i=n(10)("species");e.exports=function(e,t){var n;return o(e)&&("function"!=typeof(n=e.constructor)||n!==Array&&!o(n.prototype)?r(n)&&null===(n=n[i])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===t?0:t)}},function(e,t){e.exports="\t\n\v\f\r                 \u2028\u2029\ufeff"},function(e,t){e.exports=window.wc.wcSettings},,function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(70),o=n.n(r),i=n(156),c=n(8);const a=()=>new o.a(e=>{try{var t,n;const r=null!==(t=null===(n=Object(c.c)())||void 0===n?void 0:n.stripe_locale)&&void 0!==t?t:"auto";e(Object(i.a)(Object(c.b)(),{locale:r}))}catch(t){e({error:t})}})},function(e,t){},function(e,t,n){"use strict";var r=n(31),o=n(34),i=n(10),c=n(23),a=i("species");e.exports=function(e){var t=r(e),n=o.f;c&&t&&!t[a]&&n(t,a,{configurable:!0,get:function(){return this}})}},function(e,t,n){"use strict";var r=n(38),o=n(82),i=n(35),c=n(59),a=n(92),s=c.set,u=c.getterFor("Array Iterator");e.exports=a(Array,"Array",(function(e,t){s(this,{type:"Array Iterator",target:r(e),index:0,kind:t})}),(function(){var e=u(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:t[r],done:!1}:{value:[r,t[r]],done:!1}}),"values"),i.Arguments=i.Array,o("keys"),o("values"),o("entries")},,function(e,t,n){e.exports=n(197)},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r="https://js.stripe.com/v3",o=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,i="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",c=null,a=function(e,t,n){if(null===e)return null;var r=e.apply(void 0,t);return function(e,t){e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",version:"1.15.1",startTime:t})}(r,n),r},s=Promise.resolve().then((function(){return e=null,null!==c?c:c=new Promise((function(t,n){if("undefined"!=typeof window)if(window.Stripe&&e&&console.warn(i),window.Stripe)t(window.Stripe);else try{var c=function(){for(var e=document.querySelectorAll('script[src^="'.concat(r,'"]')),t=0;t<e.length;t++){var n=e[t];if(o.test(n.src))return n}return null}();c&&e?console.warn(i):c||(c=function(e){var t=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",n=document.createElement("script");n.src="".concat(r).concat(t);var o=document.head||document.body;if(!o)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return o.appendChild(n),n}(e)),c.addEventListener("load",(function(){window.Stripe?t(window.Stripe):n(new Error("Stripe.js not available"))})),c.addEventListener("error",(function(){n(new Error("Failed to load Stripe.js"))}))}catch(e){return void n(e)}else t(null)}));var e})),u=!1;s.catch((function(e){u||console.warn(e)}));var l=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];u=!0;var r=Date.now();return s.then((function(e){return a(e,t,r)}))}},,function(e,t,n){var r=n(159);e.exports=r},function(e,t,n){n(160),n(151),n(161),n(165),n(166),n(167),n(117),n(145);var r=n(24);e.exports=r.Promise},function(e,t,n){"use strict";var r=n(11),o=n(72),i=n(96),c=n(85),a=n(18),s=n(36),u=n(56),l=function(e,t){var n=this;if(!(n instanceof l))return new l(e,t);i&&(n=i(new Error(void 0),o(n))),void 0!==t&&a(n,"message",String(t));var r=[];return u(e,r.push,{that:r}),a(n,"errors",r),n};l.prototype=c(Error.prototype,{constructor:s(5,l),message:s(5,""),name:s(5,"AggregateError")}),r({global:!0},{AggregateError:l})},function(e,t,n){"use strict";var r,o,i,c,a=n(11),s=n(37),u=n(9),l=n(31),p=n(111),f=n(49),d=n(141),v=n(58),m=n(152),y=n(16),h=n(28),g=n(112),b=n(99),_=n(56),w=n(143),E=n(113),O=n(114).set,j=n(162),x=n(116),C=n(164),S=n(68),R=n(87),T=n(59),I=n(84),A=n(10),P=n(44),k=n(46),N=A("species"),L="Promise",M=T.get,D=T.set,V=T.getterFor(L),B=p,q=u.TypeError,F=u.document,U=u.process,Y=l("fetch"),H=S.f,W=H,G=!!(F&&F.createEvent&&u.dispatchEvent),$="function"==typeof PromiseRejectionEvent,z=I(L,(function(){if(b(B)===String(B)){if(66===k)return!0;if(!P&&!$)return!0}if(s&&!B.prototype.finally)return!0;if(k>=51&&/native code/.test(B))return!1;var e=B.resolve(1),t=function(e){e((function(){}),(function(){}))};return(e.constructor={})[N]=t,!(e.then((function(){}))instanceof t)})),X=z||!w((function(e){B.all(e).catch((function(){}))})),Z=function(e){var t;return!(!y(e)||"function"!=typeof(t=e.then))&&t},Q=function(e,t){if(!e.notified){e.notified=!0;var n=e.reactions;j((function(){for(var r=e.value,o=1==e.state,i=0;n.length>i;){var c,a,s,u=n[i++],l=o?u.ok:u.fail,p=u.resolve,f=u.reject,d=u.domain;try{l?(o||(2===e.rejection&&te(e),e.rejection=1),!0===l?c=r:(d&&d.enter(),c=l(r),d&&(d.exit(),s=!0)),c===u.promise?f(q("Promise-chain cycle")):(a=Z(c))?a.call(c,p,f):p(c)):f(r)}catch(e){d&&!s&&d.exit(),f(e)}}e.reactions=[],e.notified=!1,t&&!e.rejection&&J(e)}))}},K=function(e,t,n){var r,o;G?((r=F.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),u.dispatchEvent(r)):r={promise:t,reason:n},!$&&(o=u["on"+e])?o(r):"unhandledrejection"===e&&C("Unhandled promise rejection",n)},J=function(e){O.call(u,(function(){var t,n=e.facade,r=e.value;if(ee(e)&&(t=R((function(){P?U.emit("unhandledRejection",r,n):K("unhandledrejection",n,r)})),e.rejection=P||ee(e)?2:1,t.error))throw t.value}))},ee=function(e){return 1!==e.rejection&&!e.parent},te=function(e){O.call(u,(function(){var t=e.facade;P?U.emit("rejectionHandled",t):K("rejectionhandled",t,e.value)}))},ne=function(e,t,n){return function(r){e(t,r,n)}},re=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,Q(e,!0))},oe=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw q("Promise can't be resolved itself");var r=Z(t);r?j((function(){var n={done:!1};try{r.call(t,ne(oe,n,e),ne(re,n,e))}catch(t){re(n,t,e)}})):(e.value=t,e.state=1,Q(e,!1))}catch(t){re({done:!1},t,e)}}};z&&(B=function(e){g(this,B,L),h(e),r.call(this);var t=M(this);try{e(ne(oe,t),ne(re,t))}catch(e){re(t,e)}},(r=function(e){D(this,{type:L,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=d(B.prototype,{then:function(e,t){var n=V(this),r=H(E(this,B));return r.ok="function"!=typeof e||e,r.fail="function"==typeof t&&t,r.domain=P?U.domain:void 0,n.parent=!0,n.reactions.push(r),0!=n.state&&Q(n,!1),r.promise},catch:function(e){return this.then(void 0,e)}}),o=function(){var e=new r,t=M(e);this.promise=e,this.resolve=ne(oe,t),this.reject=ne(re,t)},S.f=H=function(e){return e===B||e===i?new o(e):W(e)},s||"function"!=typeof p||(c=p.prototype.then,f(p.prototype,"then",(function(e,t){var n=this;return new B((function(e,t){c.call(n,e,t)})).then(e,t)}),{unsafe:!0}),"function"==typeof Y&&a({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return x(B,Y.apply(u,arguments))}}))),a({global:!0,wrap:!0,forced:z},{Promise:B}),v(B,L,!1,!0),m(L),i=l(L),a({target:L,stat:!0,forced:z},{reject:function(e){var t=H(this);return t.reject.call(void 0,e),t.promise}}),a({target:L,stat:!0,forced:s||z},{resolve:function(e){return x(s&&this===i?B:this,e)}}),a({target:L,stat:!0,forced:X},{all:function(e){var t=this,n=H(t),r=n.resolve,o=n.reject,i=R((function(){var n=h(t.resolve),i=[],c=0,a=1;_(e,(function(e){var s=c++,u=!1;i.push(void 0),a++,n.call(t,e).then((function(e){u||(u=!0,i[s]=e,--a||r(i))}),o)})),--a||r(i)}));return i.error&&o(i.value),n.promise},race:function(e){var t=this,n=H(t),r=n.reject,o=R((function(){var o=h(t.resolve);_(e,(function(e){o.call(t,e).then(n.resolve,r)}))}));return o.error&&r(o.value),n.promise}})},function(e,t,n){var r,o,i,c,a,s,u,l,p=n(9),f=n(80).f,d=n(114).set,v=n(115),m=n(163),y=n(44),h=p.MutationObserver||p.WebKitMutationObserver,g=p.document,b=p.process,_=p.Promise,w=f(p,"queueMicrotask"),E=w&&w.value;E||(r=function(){var e,t;for(y&&(e=b.domain)&&e.exit();o;){t=o.fn,o=o.next;try{t()}catch(e){throw o?c():i=void 0,e}}i=void 0,e&&e.enter()},v||y||m||!h||!g?_&&_.resolve?(u=_.resolve(void 0),l=u.then,c=function(){l.call(u,r)}):c=y?function(){b.nextTick(r)}:function(){d.call(p,r)}:(a=!0,s=g.createTextNode(""),new h(r).observe(s,{characterData:!0}),c=function(){s.data=a=!a})),e.exports=E||function(e){var t={fn:e,next:void 0};i&&(i.next=t),o||(o=t,c()),i=t}},function(e,t,n){var r=n(57);e.exports=/web0s(?!.*chrome)/i.test(r)},function(e,t,n){var r=n(9);e.exports=function(e,t){var n=r.console;n&&n.error&&(1===arguments.length?n.error(e):n.error(e,t))}},function(e,t,n){"use strict";var r=n(11),o=n(28),i=n(68),c=n(87),a=n(56);r({target:"Promise",stat:!0},{allSettled:function(e){var t=this,n=i.f(t),r=n.resolve,s=n.reject,u=c((function(){var n=o(t.resolve),i=[],c=0,s=1;a(e,(function(e){var o=c++,a=!1;i.push(void 0),s++,n.call(t,e).then((function(e){a||(a=!0,i[o]={status:"fulfilled",value:e},--s||r(i))}),(function(e){a||(a=!0,i[o]={status:"rejected",reason:e},--s||r(i))}))})),--s||r(i)}));return u.error&&s(u.value),n.promise}})},function(e,t,n){"use strict";var r=n(11),o=n(28),i=n(31),c=n(68),a=n(87),s=n(56);r({target:"Promise",stat:!0},{any:function(e){var t=this,n=c.f(t),r=n.resolve,u=n.reject,l=a((function(){var n=o(t.resolve),c=[],a=0,l=1,p=!1;s(e,(function(e){var o=a++,s=!1;c.push(void 0),l++,n.call(t,e).then((function(e){s||p||(p=!0,r(e))}),(function(e){s||p||(s=!0,c[o]=e,--l||u(new(i("AggregateError"))(c,"No one promise resolved")))}))})),--l||u(new(i("AggregateError"))(c,"No one promise resolved"))}));return l.error&&u(l.value),n.promise}})},function(e,t,n){"use strict";var r=n(11),o=n(37),i=n(111),c=n(14),a=n(31),s=n(113),u=n(116),l=n(49);r({target:"Promise",proto:!0,real:!0,forced:!!i&&c((function(){i.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=s(this,a("Promise")),n="function"==typeof e;return this.then(n?function(n){return u(t,e()).then((function(){return n}))}:e,n?function(n){return u(t,e()).then((function(){throw n}))}:e)}}),o||"function"!=typeof i||i.prototype.finally||l(i.prototype,"finally",a("Promise").prototype.finally)},function(e,t){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},function(e,t,n){var r=n(170);e.exports=r},function(e,t,n){var r=n(171),o=Array.prototype;e.exports=function(e){var t=e.map;return e===o||e instanceof Array&&t===o.map?r:t}},function(e,t,n){n(172);var r=n(26);e.exports=r("Array").map},function(e,t,n){"use strict";var r=n(11),o=n(88).map;r({target:"Array",proto:!0,forced:!n(89)("map")},{map:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}})},function(e,t,n){var r=n(174);e.exports=r},function(e,t,n){var r=n(175),o=Array.prototype;e.exports=function(e){var t=e.filter;return e===o||e instanceof Array&&t===o.filter?r:t}},function(e,t,n){n(176);var r=n(26);e.exports=r("Array").filter},function(e,t,n){"use strict";var r=n(11),o=n(88).filter;r({target:"Array",proto:!0,forced:!n(89)("filter")},{filter:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}})},function(e,t,n){var r=n(178);e.exports=r},function(e,t,n){var r=n(179),o=Array.prototype;e.exports=function(e){var t=e.reduce;return e===o||e instanceof Array&&t===o.reduce?r:t}},function(e,t,n){n(180);var r=n(26);e.exports=r("Array").reduce},function(e,t,n){"use strict";var r=n(11),o=n(181).left,i=n(125),c=n(46),a=n(44);r({target:"Array",proto:!0,forced:!i("reduce")||!a&&c>79&&c<83},{reduce:function(e){return o(this,e,arguments.length,arguments.length>1?arguments[1]:void 0)}})},function(e,t,n){var r=n(28),o=n(45),i=n(53),c=n(40),a=function(e){return function(t,n,a,s){r(n);var u=o(t),l=i(u),p=c(u.length),f=e?p-1:0,d=e?-1:1;if(a<2)for(;;){if(f in l){s=l[f],f+=d;break}if(f+=d,e?f<0:p<=f)throw TypeError("Reduce of empty array with no initial value")}for(;e?f>=0:p>f;f+=d)f in l&&(s=n(s,l[f],f,u));return s}};e.exports={left:a(!1),right:a(!0)}},function(e,t,n){"use strict";var r=n(54),o=n(34),i=n(36);e.exports=function(e,t,n){var c=r(t);c in e?o.f(e,c,i(0,n)):e[c]=n}},,,,,,,,,function(e,t){e.exports=window.wc.wcBlocksRegistry},function(e,t,n){var r=n(33),o="["+n(147)+"]",i=RegExp("^"+o+o+"*"),c=RegExp(o+o+"*$"),a=function(e){return function(t){var n=String(r(t));return 1&e&&(n=n.replace(i,"")),2&e&&(n=n.replace(c,"")),n}};e.exports={start:a(1),end:a(2),trim:a(3)}},function(e,t,n){e.exports=n(215)},,,,function(e,t,n){var r=n(198);e.exports=r},function(e,t,n){n(199);var r=n(24);e.exports=r.Object.keys},function(e,t,n){var r=n(11),o=n(45),i=n(86);r({target:"Object",stat:!0,forced:n(14)((function(){i(1)}))},{keys:function(e){return i(o(e))}})},,,,,,function(e,t,n){e.exports=n(219)},,,,,,function(e,t,n){"use strict";var r=n(0),o=n(205),i=n.n(o),c=n(148),a=n(29),s=n(15),u=n.n(s),l=n(8);const p=({onButtonClicked:e})=>{var t,n;const{theme:o="dark",locale:i="en",height:c="44"}=null===(t=Object(l.c)())||void 0===t?void 0:t.button,a=["short","long"],{branded_type:s}=null===(n=Object(l.c)())||void 0===n?void 0:n.button,p=u()(a).call(a,s)?s:"long",f=((e,t,n)=>{const o="long"===e?`https://www.gstatic.com/instantbuy/svg/${t}/${n}.svg`:`https://www.gstatic.com/instantbuy/svg/${t}_gpay.svg`,[i,c]=Object(r.useState)(o);return Object(r.useEffect)(()=>{const e=document.createElement("img");e.addEventListener("error",()=>{c(`https://www.gstatic.com/instantbuy/svg/${t}/en.svg`)}),e.src=i},[i,t]),i})(p,"dark"===o?"dark":"light",i);return Object(r.createElement)("button",{type:"button",id:"wc-stripe-branded-button","aria-label":"Google Pay",className:`gpay-button ${o} ${p}`,style:{backgroundImage:`url(${f})`,height:c+"px"},onClick:e})};var f=n(2);const d=({onButtonClicked:e})=>{var t;const{theme:n="dark",height:o="44",customLabel:i=Object(f.__)("Buy now","woocommerce-gateway-stripe")}=null===(t=Object(l.c)())||void 0===t?void 0:t.button;return Object(r.createElement)("button",{type:"button",id:"wc-stripe-custom-button",className:`button ${n} is-active`,style:{height:o+"px"},onClick:e},i)};var v=n(48),m=n.n(v),y=n(128),h=n.n(y);const g=e=>({country:e.country,state:e.region,postcode:e.postalCode,city:e.city,address:void 0===e.addressLine[0]?"":e.addressLine[0],address_2:void 0===e.addressLine[1]?"":e.addressLine[1]}),b=(e,t="wc_stripe_")=>{var n,r,o;return null===(n=Object(l.c)())||void 0===n||null===(r=n.ajax_url)||void 0===r||null===(o=r.toString())||void 0===o?void 0:o.replace("%%endpoint%%",t+e)},_=()=>{var e,t;const n={security:null===(e=Object(l.c)())||void 0===e||null===(t=e.nonce)||void 0===t?void 0:t.payment};return m.a.ajax({type:"POST",data:n,url:b("get_cart_details")})},w=e=>{const{shippingOption:t}=e;(e=>{var t,n,r;const o={security:null===(t=Object(l.c)())||void 0===t||null===(n=t.nonce)||void 0===n?void 0:n.update_shipping,shipping_method:[e.id],is_product_page:null===(r=Object(l.c)())||void 0===r?void 0:r.is_product_page};return m.a.ajax({type:"POST",data:o,url:b("update_shipping_method")})})(t).then(t=>{"success"===t.result&&e.updateWith({status:"success",total:t.total,displayItems:t.displayItems}),"fail"===t.result&&e.updateWith({status:"fail"})})},E=(e,t,n,o)=>{Object(r.useEffect)(()=>{const r=null==t?void 0:t.on("source",((e,t,n)=>r=>{var o,i,c,a,s,u;"yes"===(null===(o=Object(l.c)())||void 0===o||null===(i=o.stripe)||void 0===i?void 0:i.allow_prepaid_card)||"prepaid"!==(null==r||null===(c=r.source)||void 0===c||null===(a=c.card)||void 0===a?void 0:a.funding)?((e,t)=>{const n=((e,t)=>{var n,r,o,i,c,a,s,u,p,f,d,v,m,y,g,b,_,w,E,O;const{source:j}=e,x=null==j||null===(n=j.owner)||void 0===n?void 0:n.email,C=null==j||null===(r=j.owner)||void 0===r?void 0:r.phone,S=null==j||null===(o=j.owner)||void 0===o?void 0:o.address,R=null==j||null===(i=j.owner)||void 0===i?void 0:i.name,T=null==e?void 0:e.shippingAddress,I={_wpnonce:null===(c=Object(l.c)())||void 0===c||null===(a=c.nonce)||void 0===a?void 0:a.checkout,billing_first_name:null!==(s=null==R||null===(u=R.split(" "))||void 0===u||null===(p=h()(u).call(u,0,1))||void 0===p?void 0:p.join(" "))&&void 0!==s?s:"",billing_last_name:null!==(f=null==R||null===(d=R.split(" "))||void 0===d||null===(v=h()(d).call(d,1))||void 0===v?void 0:v.join(" "))&&void 0!==f?f:"",billing_company:"",billing_email:null!=x?x:null==e?void 0:e.payerEmail,billing_phone:null!=C?C:null==e||null===(m=e.payerPhone)||void 0===m?void 0:m.replace("/[() -]/g",""),billing_country:null!==(y=null==S?void 0:S.country)&&void 0!==y?y:"",billing_address_1:null!==(g=null==S?void 0:S.line1)&&void 0!==g?g:"",billing_address_2:null!==(b=null==S?void 0:S.line2)&&void 0!==b?b:"",billing_city:null!==(_=null==S?void 0:S.city)&&void 0!==_?_:"",billing_state:null!==(w=null==S?void 0:S.state)&&void 0!==w?w:"",billing_postcode:null!==(E=null==S?void 0:S.postal_code)&&void 0!==E?E:"",shipping_first_name:"",shipping_last_name:"",shipping_company:"",shipping_country:"",shipping_address_1:"",shipping_address_2:"",shipping_city:"",shipping_state:"",shipping_postcode:"",shipping_method:[null==e||null===(O=e.shippingOption)||void 0===O?void 0:O.id],order_comments:"",payment_method:"stripe",ship_to_different_address:1,terms:1,stripe_source:j.id,payment_request_type:t};var A,P,k,N,L,M,D,V,B,q;return T&&(I.shipping_first_name=null==T||null===(A=T.recipient)||void 0===A||null===(P=A.split(" "))||void 0===P||null===(k=h()(P).call(P,0,1))||void 0===k?void 0:k.join(" "),I.shipping_last_name=null==T||null===(N=T.recipient)||void 0===N||null===(L=N.split(" "))||void 0===L||null===(M=h()(L).call(L,1))||void 0===M?void 0:M.join(" "),I.shipping_company=null==T?void 0:T.organization,I.shipping_country=null==T?void 0:T.country,I.shipping_address_1=null!==(D=null==T||null===(V=T.addressLine)||void 0===V?void 0:V[0])&&void 0!==D?D:"",I.shipping_address_2=null!==(B=null==T||null===(q=T.addressLine)||void 0===q?void 0:q[1])&&void 0!==B?B:"",I.shipping_city=null==T?void 0:T.city,I.shipping_state=null==T?void 0:T.region,I.shipping_postcode=null==T?void 0:T.postalCode),I})(e,t);return m.a.ajax({type:"POST",data:n,dataType:"json",url:b("create_order")})})(r,t).then(((e,t,n)=>r=>{if("success"===r.result){t.complete("success");const o=(e=>{const t=e.match(/^#?confirm-(pi|si)-([^:]+):(.+)$/);if(t&&!(t.length<4))return{type:t[1],clientSecret:t[2],redirectUrl:decodeURIComponent(t[3])}})(r.redirect);if(!o||o.length<4)return void(window.location=r.redirect);const{type:i,clientSecret:c,redirectUrl:a}=o;((e,t,n)=>"si"===t?e.handleCardSetup(n):e.handleCardPayment(n))(e,i,c).then(((e,t)=>n=>{if(n.error)throw n.error;const r=((e,t)=>"si"===t?e.setupIntent:e.paymentIntent)(n,t);((e=>"requires_capture"===e.status)(r)||(e=>"succeeded"===e.status)(r))&&(window.location=e)})(a,i)).catch(e=>{n(e.message),m.a.get(a+"&is_ajax")})}else{var o,i;t.complete("fail");const e=document.createElement("div");e.innerHTML=r.messages;const c=null!==(o=null==e||null===(i=e.firstChild)||void 0===i?void 0:i.textContent)&&void 0!==o?o:"";n(c)}})(e,r,n)):n(null===(s=Object(l.c)())||void 0===s||null===(u=s.i18n)||void 0===u?void 0:u.no_prepaid_card)})(e,n,o));return()=>{null==r||r.removeEventListener("source")}},[e,t,n,o])},O=({billing:e,shippingData:t,onClick:n,onClose:o,setExpressPaymentError:i})=>{var c,s,u,f,v,y,h;const O=Object(a.useStripe)(),{needsShipping:j}=t,[x,C,S]=((e,t,n)=>{const[o,i]=Object(r.useState)(null),[c,a]=Object(r.useState)(null),[s,u]=Object(r.useState)(!1);return Object(r.useEffect)(()=>{e&&(async()=>{const t=await _(),n=Object(l.a)(e,t),r=await n.canMakePayment();r?(i(n),a(()=>r.applePay?"apple_pay":r.googlePay?"google_pay":"payment_request_api")):i(null)})()},[e,t]),Object(r.useEffect)(()=>{o&&(async()=>{u(!0);const e=await _();Object(l.d)(o,e),u(!1)})()},[o,n.cartTotal,n.cartTotalItems,n.currency.code]),[o,c,s]})(O,j,e);((e,t)=>{Object(r.useEffect)(()=>{const n=null==e?void 0:e.on("shippingaddresschange",(e=>t=>{const{shippingAddress:n}=t;((e,t)=>{var n,r,o;const i={security:null===(n=Object(l.c)())||void 0===n||null===(r=n.nonce)||void 0===r?void 0:r.shipping,payment_request_type:t,is_product_page:null===(o=Object(l.c)())||void 0===o?void 0:o.is_product_page,...g(e)};return m.a.ajax({type:"POST",data:i,url:b("get_shipping_options")})})(n,e).then(e=>{t.updateWith({status:e.result,shippingOptions:e.shipping_options,total:e.total,displayItems:e.displayItems})})})(t));return()=>{null==n||n.removeEventListener("shippingaddresschange")}},[e,t])})(x,C),((e,t)=>{Object(r.useEffect)(()=>{const t=null==e?void 0:e.on("shippingoptionchange",w);return()=>{null==t||t.removeEventListener("shippingoptionchange")}},[e,t])})(x,C),E(O,x,C,i);const R=((e,t,n)=>Object(r.useCallback)((r,o)=>{var i;if(null!==(i=Object(l.c)())&&void 0!==i&&i.login_confirmation)return r.preventDefault(),void(e=>{var t,n,r;if(null===(t=Object(l.c)())||void 0===t||!t.login_confirmation)return;let o=null===(n=Object(l.c)())||void 0===n||null===(r=n.login_confirmation)||void 0===r?void 0:r.message;var i,c;"payment_request_api"!==e&&(o=o.replace(/\*\*.*?\*\*/,"apple_pay"===e?"Apple Pay":"Google Pay")),o=o.replace(/\*\*/g,""),confirm(o)&&(window.location.href=null===(i=Object(l.c)())||void 0===i||null===(c=i.login_confirmation)||void 0===c?void 0:c.redirect_url)})(e);t(""),n(),o&&o.show()},[e,t,n]))(C,i,n);((e,t)=>{Object(r.useEffect)(()=>{const n=null==e?void 0:e.on("cancel",t);return()=>{null==n||n.removeEventListener("cancel")}},[e,t])})(x,o);const{type:T="default",theme:I="dark",height:A="48"}=null===(c=Object(l.c)())||void 0===c?void 0:c.button,P={paymentRequestButton:{type:T,theme:I,height:A+"px"}},k=null===(s=Object(l.c)())||void 0===s||null===(u=s.button)||void 0===u?void 0:u.is_branded,N=null===(f=Object(l.c)())||void 0===f||null===(v=f.button)||void 0===v?void 0:v.branded_type,L=null===(y=Object(l.c)())||void 0===y||null===(h=y.button)||void 0===h?void 0:h.is_custom;return x?L?Object(r.createElement)("div",{className:S?"wc-block-components-loading-mask":""},Object(r.createElement)(d,{className:S?"wc-block-components-loading-mask__children":"",onButtonClicked:e=>{R(e,x)}})):k&&(()=>{const e=window.navigator.userAgent.toLowerCase(),t=/chrome/.test(e)&&!/edge|edg|opr|brave\//.test(e)&&"Google Inc."===window.navigator.vendor,n=t&&window.navigator.brave;return t&&!n})()?Object(r.createElement)("div",{className:S?"wc-block-components-loading-mask":""},Object(r.createElement)(p,{className:S?"wc-block-components-loading-mask__children":"",onButtonClicked:e=>{R(e,x)}})):(k&&(P.paymentRequestButton.type="long"===N?"buy":"default"),Object(r.createElement)("div",{className:S?"wc-block-components-loading-mask":""},Object(r.createElement)(a.PaymentRequestButtonElement,{className:S?"wc-block-components-loading-mask__children":"",onClick:R,options:{style:P,paymentRequest:x}}))):null};var j,x,C=n(150);const S=Object(C.a)(),R={name:"payment_request",content:Object(r.createElement)(e=>{const{stripe:t}=e;return Object(r.createElement)(a.Elements,{stripe:t},Object(r.createElement)(O,e))},{stripe:S}),edit:Object(r.createElement)(()=>Object(r.createElement)("img",{src:"data:image/svg+xml,%3Csvg width='264' height='48' viewBox='0 0 264 48' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='264' height='48' rx='3' fill='black'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M125.114 16.6407C125.682 15.93 126.067 14.9756 125.966 14C125.135 14.0415 124.121 14.549 123.533 15.2602C123.006 15.8693 122.539 16.8641 122.661 17.7983C123.594 17.8797 124.526 17.3317 125.114 16.6407Z' fill='white'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M125.955 17.982C124.601 17.9011 123.448 18.7518 122.801 18.7518C122.154 18.7518 121.163 18.0224 120.092 18.0421C118.696 18.0629 117.402 18.8524 116.694 20.1079C115.238 22.6196 116.31 26.3453 117.726 28.3909C118.414 29.4028 119.242 30.5174 120.334 30.4769C121.366 30.4365 121.77 29.8087 123.024 29.8087C124.277 29.8087 124.641 30.4769 125.733 30.4567C126.865 30.4365 127.573 29.4443 128.261 28.4313C129.049 27.2779 129.373 26.1639 129.393 26.1027C129.373 26.0825 127.209 25.2515 127.189 22.7606C127.169 20.6751 128.888 19.6834 128.969 19.6217C127.998 18.1847 126.481 18.0224 125.955 17.982Z' fill='white'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M136.131 23.1804H138.834C140.886 23.1804 142.053 22.0752 142.053 20.1592C142.053 18.2432 140.886 17.1478 138.845 17.1478H136.131V23.1804ZM139.466 15.1582C142.411 15.1582 144.461 17.1903 144.461 20.1483C144.461 23.1172 142.369 25.1596 139.392 25.1596H136.131V30.3498H133.775V15.1582H139.466Z' fill='white'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152.198 26.224V25.3712L149.579 25.5397C148.106 25.6341 147.339 26.182 147.339 27.14C147.339 28.0664 148.138 28.6667 149.39 28.6667C150.988 28.6667 152.198 27.6449 152.198 26.224ZM145.046 27.2032C145.046 25.2551 146.529 24.1395 149.263 23.971L152.198 23.7922V22.9498C152.198 21.7181 151.388 21.0442 149.947 21.0442C148.758 21.0442 147.896 21.6548 147.717 22.5916H145.592C145.656 20.6232 147.507 19.1914 150.01 19.1914C152.703 19.1914 154.459 20.602 154.459 22.7917V30.351H152.282V28.5298H152.229C151.609 29.719 150.241 30.4666 148.758 30.4666C146.571 30.4666 145.046 29.1612 145.046 27.2032Z' fill='white'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M156.461 34.4145V32.5934C156.608 32.6141 156.965 32.6354 157.155 32.6354C158.196 32.6354 158.785 32.1932 159.142 31.0564L159.353 30.3824L155.366 19.3281H157.827L160.604 28.298H160.657L163.434 19.3281H165.832L161.698 30.9402C160.752 33.6038 159.668 34.4778 157.376 34.4778C157.197 34.4778 156.618 34.4565 156.461 34.4145Z' fill='white'/%3E%3C/svg%3E%0A",alt:""}),null),canMakePayment:e=>{var t,n,r;return!(null===(t=null===(n=Object(l.c)())||void 0===n?void 0:n.isAdmin)||void 0===t||!t)||!(null===(r=Object(l.c)())||void 0===r||!r.shouldShowPaymentRequestButton)&&Object(C.a)().then(t=>{var n,r,o,a,s;const u={order_data:{total:{label:"Total",amount:i()(null!==(n=null==e||null===(r=e.cartTotals)||void 0===r?void 0:r.total_price)&&void 0!==n?n:0,10),pending:!0},currency:null==e||null===(o=e.cartTotals)||void 0===o||null===(a=o.currency_code)||void 0===a?void 0:a.toLowerCase(),country_code:null===(s=Object(c.getSetting)("baseLocation",{}))||void 0===s?void 0:s.country,displayItems:[]},shipping_required:!1};return Object(l.a)(t,u).canMakePayment()})},paymentMethodId:"stripe",supports:{features:null!==(j=null===(x=Object(l.c)())||void 0===x?void 0:x.supports)&&void 0!==j?j:[]}};t.a=R},,,,function(e,t,n){var r=n(216);e.exports=r},function(e,t,n){n(217);var r=n(24);e.exports=r.Object.entries},function(e,t,n){var r=n(11),o=n(218).entries;r({target:"Object",stat:!0},{entries:function(e){return o(e)}})},function(e,t,n){var r=n(23),o=n(86),i=n(38),c=n(90).f,a=function(e){return function(t){for(var n,a=i(t),s=o(a),u=s.length,l=0,p=[];u>l;)n=s[l++],r&&!c.call(a,n)||p.push(e?[n,a[n]]:a[n]);return p}};e.exports={entries:a(!0),values:a(!1)}},function(e,t,n){var r=n(220);e.exports=r},function(e,t,n){n(221);var r=n(24);e.exports=r.parseInt},function(e,t,n){var r=n(11),o=n(222);r({global:!0,forced:parseInt!=o},{parseInt:o})},function(e,t,n){var r=n(9),o=n(192).trim,i=n(147),c=r.parseInt,a=/^[+-]?0[Xx]/,s=8!==c(i+"08")||22!==c(i+"0x16");e.exports=s?function(e,t){var n=o(String(e));return c(n,t>>>0||(a.test(n)?16:10))}:c},function(e,t,n){var r=n(224);e.exports=r},function(e,t,n){var r=n(225),o=Array.prototype;e.exports=function(e){var t=e.slice;return e===o||e instanceof Array&&t===o.slice?r:t}},function(e,t,n){n(226);var r=n(26);e.exports=r("Array").slice},function(e,t,n){"use strict";var r=n(11),o=n(16),i=n(104),c=n(97),a=n(40),s=n(38),u=n(182),l=n(10),p=n(89)("slice"),f=l("species"),d=[].slice,v=Math.max;r({target:"Array",proto:!0,forced:!p},{slice:function(e,t){var n,r,l,p=s(this),m=a(p.length),y=c(e,m),h=c(void 0===t?m:t,m);if(i(p)&&("function"!=typeof(n=p.constructor)||n!==Array&&!i(n.prototype)?o(n)&&null===(n=n[f])&&(n=void 0):n=void 0,n===Array||void 0===n))return d.call(p,y,h);for(r=new(void 0===n?Array:n)(v(h-y,0)),l=0;y<h;y++,l++)y in p&&u(r,l,p[y]);return r.length=l,r}})},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.r(t);var r=n(191),o=n(7),i=n.n(o),c=n(0),a=n(70),s=n.n(a),u=n(2),l=n(29);const p=(e,t,n,r)=>{Object(c.useEffect)(()=>{const o=t(async({processingResponse:t})=>{const o=t.paymentDetails||{},i=await(({stripe:e,paymentDetails:t,errorContext:n,errorType:r,successType:o})=>{const i={type:o};if(!t.setup_intent_secret&&!t.payment_intent_secret)return!0;const c=!!t.setup_intent_secret,a=t.verification_endpoint,s=c?t.setup_intent_secret:t.payment_intent_secret;return e[c?"confirmCardSetup":"confirmCardPayment"](s).then((function(e){if(e.error)throw e.error;const t=e[c?"setupIntent":"paymentIntent"];return"requires_capture"!==t.status&&"succeeded"!==t.status||(i.redirectUrl=a),i})).catch((function(e){return i.type=r,i.message=e.message,i.retry=!0,i.messageContext=n,window.fetch(a+"&is_ajax"),i}))})({stripe:e,paymentDetails:o,errorContext:r.noticeContexts.PAYMENTS,errorType:r.responseTypes.ERROR,successType:r.responseTypes.SUCCESS});return i.type===r.responseTypes.ERROR&&i.retry&&n(""),i});return()=>o()},[t,r.noticeContexts.PAYMENTS,r.responseTypes.ERROR,r.responseTypes.SUCCESS,n,e])},f=()=>{},d=({eventRegistration:e,emitResponse:t})=>{const n=Object(l.useStripe)(),{onCheckoutAfterProcessingWithSuccess:r}=e;return p(n,r,f,t),null};var v=n(78),m=n.n(v),y=n(193),h=n.n(y),g=n(42),b=n(19),_=n(135),w=n(8);const E={style:{base:{iconColor:"#666EE8",color:"#31325F",fontSize:((e,t,n)=>{let r={};if("object"==typeof document&&"function"==typeof document.querySelector&&"function"==typeof window.getComputedStyle){const e=document.querySelector(".wc-block-checkout");e&&(r=window.getComputedStyle(e))}return r.fontSize||"16px"})(),lineHeight:1.375,"::placeholder":{color:"#fff"}}},classes:{focus:"focused",empty:"empty",invalid:"has-error"}},O=e=>{const[t,n]=Object(c.useState)(!1),[r,o]=Object(c.useState)({...E,...e}),[i,a]=Object(c.useState)("");return Object(c.useEffect)(()=>{const e=t?"#CFD7E0":"#fff";o(n=>{const r=void 0!==n.showIcon?{showIcon:t}:{};return{...n,style:{...n.style,base:{...n.style.base,"::placeholder":{color:e}}},...r}})},[t]),{options:r,onActive:Object(c.useCallback)(e=>{n(!e||(e=>!e))},[n]),error:i,setError:a}},j=({inputErrorComponent:e,onChange:t})=>{const[n,r]=Object(c.useState)(!0),{options:o,onActive:i,error:a,setError:s}=O({hidePostalCode:!0});return Object(c.createElement)(c.Fragment,null,Object(c.createElement)("div",{className:"wc-block-gateway-container wc-inline-card-element"},Object(c.createElement)(l.CardElement,{id:"wc-stripe-inline-card-element",className:"wc-block-gateway-input",options:o,onBlur:()=>i(n),onFocus:()=>i(n),onChange:e=>{e.error?s(e.error.message):s(""),r(e.empty),t(e)}}),Object(c.createElement)("label",{htmlFor:"wc-stripe-inline-card-element"},Object(u.__)("Credit Card Information","woocommerce-gateway-stripe"))),Object(c.createElement)(e,{errorMessage:a}))},x=({onChange:e,inputErrorComponent:t})=>{const[n,r]=Object(c.useState)({cardNumber:!0,cardExpiry:!0,cardCvc:!0}),{options:o,onActive:i,error:a,setError:s}=O({showIcon:!1}),{options:p,onActive:f,error:d,setError:v}=O(),{options:m,onActive:y,error:h,setError:g}=O(),b=(t,o)=>i=>{i.error?t(i.error.message):t(""),r({...n,[o]:i.empty}),e(i)};return Object(c.createElement)("div",{className:"wc-block-card-elements"},Object(c.createElement)("div",{className:"wc-block-gateway-container wc-card-number-element"},Object(c.createElement)(l.CardNumberElement,{onChange:b(s,"cardNumber"),options:o,className:"wc-block-gateway-input",id:"wc-stripe-card-number-element",onFocus:()=>i(n.cardNumber),onBlur:()=>i(n.cardNumber)}),Object(c.createElement)("label",{htmlFor:"wc-stripe-card-number-element"},Object(u.__)("Card Number","woocommerce-gateway-stripe")),Object(c.createElement)(t,{errorMessage:a})),Object(c.createElement)("div",{className:"wc-block-gateway-container wc-card-expiry-element"},Object(c.createElement)(l.CardExpiryElement,{onChange:b(v,"cardExpiry"),options:p,className:"wc-block-gateway-input",onFocus:()=>f(n.cardExpiry),onBlur:()=>f(n.cardExpiry),id:"wc-stripe-card-expiry-element"}),Object(c.createElement)("label",{htmlFor:"wc-stripe-card-expiry-element"},Object(u.__)("Expiry Date","woocommerce-gateway-stripe")),Object(c.createElement)(t,{errorMessage:d})),Object(c.createElement)("div",{className:"wc-block-gateway-container wc-card-cvc-element"},Object(c.createElement)(l.CardCvcElement,{onChange:b(g,"cardCvc"),options:m,className:"wc-block-gateway-input",onFocus:()=>y(n.cardCvc),onBlur:()=>y(n.cardCvc),id:"wc-stripe-card-code-element"}),Object(c.createElement)("label",{htmlFor:"wc-stripe-card-code-element"},Object(u.__)("CVV/CVC","woocommerce-gateway-stripe")),Object(c.createElement)(t,{errorMessage:h})))},C=()=>{var e,t,n;return m()(e=h()(null!==(t=null===(n=Object(w.c)())||void 0===n?void 0:n.icons)&&void 0!==t?t:{})).call(e,([e,{src:t,alt:n}])=>({id:e,src:t,alt:n}))},S=({billing:e,eventRegistration:t,emitResponse:n,components:r})=>{var o;const{ValidationInputError:i,PaymentMethodIcons:a}=r,[s,u]=Object(c.useState)(""),f=Object(l.useStripe)(),d=((e,t,n,r,o,i)=>{const[a,s]=Object(c.useState)(""),u=Object(c.useCallback)(e=>{var t;const n=e.error.type,r=e.error.code||"",o=null!==(t=Object(g.a)(n,r))&&void 0!==t?t:e.error.message;return s(o),o},[]),{onCheckoutAfterProcessingWithSuccess:f,onPaymentProcessing:d,onCheckoutAfterProcessingWithError:v}=e;return p(i,f,r,o),((e,t,n,r,o,i,a,s)=>{const u=Object(l.useElements)();Object(c.useEffect)(()=>{const c=s(async()=>{try{var c,s;const p=r.billingData;if(t)return{type:o.responseTypes.ERROR,message:t};if(""!==i)return{type:o.responseTypes.SUCCESS,meta:{paymentMethodData:{paymentMethod:_.a,paymentRequestType:"cc",stripe_source:i},billingData:p}};const f={address:{line1:p.address_1,line2:p.address_2,city:p.city,state:p.state,postal_code:p.postcode,country:p.country}};p.phone&&(f.phone=p.phone),p.email&&(f.email=p.email),(p.first_name||p.last_name)&&(f.name=`${p.first_name} ${p.last_name}`);const d=await(async e=>{var t;const r="yes"===(null===(t=Object(w.c)())||void 0===t?void 0:t.inline_cc_form)?l.CardElement:l.CardNumberElement;return await n.createSource(null==u?void 0:u.getElement(r),{type:"card",owner:e})})(f);if(d.error)return{type:o.responseTypes.ERROR,message:e(d)};if(!d.source||!d.source.id)throw new Error(Object(g.a)(b.b.API_ERROR));return a(d.source.id),{type:o.responseTypes.SUCCESS,meta:{paymentMethodData:{stripe_source:d.source.id,billing_email:f.email,billing_first_name:null!==(c=null==p?void 0:p.first_name)&&void 0!==c?c:"",billing_last_name:null!==(s=null==p?void 0:p.last_name)&&void 0!==s?s:"",paymentMethod:_.a,paymentRequestType:"cc"},billingData:p}}}catch(e){return{type:o.responseTypes.ERROR,message:e}}});return()=>{c()}},[s,r.billingData,n,i,a,e,t,o.noticeContexts.PAYMENTS,o.responseTypes.ERROR,o.responseTypes.SUCCESS,u])})(u,a,i,t,o,n,r,d),Object(c.useEffect)(()=>{const e=v(({processingResponse:e})=>{var t;return null==e||null===(t=e.paymentDetails)||void 0===t||!t.errorMessage||{type:o.responseTypes.ERROR,message:e.paymentDetails.errorMessage,messageContext:o.noticeContexts.PAYMENTS}});return()=>{e()}},[v,o.noticeContexts.PAYMENTS,o.responseTypes.ERROR]),u})(t,e,s,u,n,f),v=e=>{e.error&&d(e),u("")},m=C(),y="yes"===(null===(o=Object(w.c)())||void 0===o?void 0:o.inline_cc_form)?Object(c.createElement)(j,{onChange:v,inputErrorComponent:i}):Object(c.createElement)(x,{onChange:v,inputErrorComponent:i});return Object(c.createElement)(c.Fragment,null,y,a&&m.length&&Object(c.createElement)(a,{icons:m,align:"left"}))},R=e=>{const{stripe:t}=e;return Object(c.createElement)(l.Elements,{stripe:t},Object(c.createElement)(S,e))};var T,I,A,P,k,N,L=n(150);const M=Object(L.a)(),D=({RenderedComponent:e,...t})=>{const[n,r]=Object(c.useState)("");return Object(c.useEffect)(()=>{s.a.resolve(M).then(({error:e})=>{e&&r(e.message)})},[r]),Object(c.useEffect)(()=>{if(n)throw new Error(n)},[n]),Object(c.createElement)(e,i()({stripe:M},t))},V=C();var B={name:_.a,label:Object(c.createElement)(e=>{var t,n;const{PaymentMethodLabel:r}=e.components,o=null!==(t=null===(n=Object(w.c)())||void 0===n?void 0:n.title)&&void 0!==t?t:Object(u.__)("Credit / Debit Card","woocommerce-gateway-stripe");return Object(c.createElement)(r,{text:o})},null),content:Object(c.createElement)(D,{RenderedComponent:R}),edit:Object(c.createElement)(D,{RenderedComponent:R}),savedTokenComponent:Object(c.createElement)(D,{RenderedComponent:({stripe:e,...t})=>Object(c.createElement)(l.Elements,{stripe:e},Object(c.createElement)(d,t))}),icons:V,canMakePayment:()=>M,ariaLabel:Object(u.__)("Stripe Credit Card payment method","woocommerce-gateway-stripe"),supports:{showSavedCards:null!==(T=null===(I=Object(w.c)())||void 0===I?void 0:I.showSavedCards)&&void 0!==T&&T,showSaveOption:null!==(A=null===(P=Object(w.c)())||void 0===P?void 0:P.showSaveOption)&&void 0!==A&&A,features:null!==(k=null===(N=Object(w.c)())||void 0===N?void 0:N.supports)&&void 0!==k?k:[]}},q=n(211);Object(r.registerPaymentMethod)(B),Object(r.registerExpressPaymentMethod)(q.a)}]);
1
+ !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=278)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.React},,,,,function(e,t,n){"use strict";n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return i})),n.d(t,"d",(function(){return c})),n.d(t,"b",(function(){return a}));var r=n(117);const o=()=>{const e=Object(r.getSetting)("stripe_data",null);if(!e)throw new Error("Stripe initialization data is not available");return e},i=(e,t)=>{var n,r;const i={total:t.order_data.total,currency:t.order_data.currency,country:t.order_data.country_code,requestPayerName:!0,requestPayerEmail:!0,requestPayerPhone:null===(n=o())||void 0===n||null===(r=n.checkout)||void 0===r?void 0:r.needs_payer_phone,requestShipping:!!t.shipping_required,displayItems:t.order_data.displayItems};return"PR"===i.country&&(i.country="US"),e.paymentRequest(i)},c=(e,t)=>{const n={total:t.order_data.total,currency:t.order_data.currency,displayItems:t.order_data.displayItems};e.update(n)},a=()=>{var e;const t=null===(e=o())||void 0===e?void 0:e.key;if(!t)throw new Error("There is no api key available for stripe. Make sure it is available on the wc.stripe_data.stripe.key property.");return t}},function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,n.apply(this,arguments)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){(function(t){var n=function(e){return e&&e.Math==Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof t&&t)||function(){return this}()||Function("return this")()}).call(this,n(106))},function(e,t,n){var r=n(9),o=n(75),i=n(18),c=n(76),a=n(72),s=n(108),u=o("wks"),l=r.Symbol,p=s?l:l&&l.withoutSetter||c;e.exports=function(e){return i(u,e)&&(a||"string"==typeof u[e])||(a&&i(l,e)?u[e]=l[e]:u[e]=p("Symbol."+e)),u[e]}},,function(e,t,n){"use strict";var r=n(9),o=n(74).f,i=n(81),c=n(27),a=n(41),s=n(20),u=n(18),l=function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t};e.exports=function(e,t){var n,p,f,d,v,m,y,h,g=e.target,b=e.global,_=e.stat,w=e.proto,E=b?r:_?r[g]:(r[g]||{}).prototype,O=b?c:c[g]||(c[g]={}),j=O.prototype;for(f in t)n=!i(b?f:g+(_?".":"#")+f,e.forced)&&E&&u(E,f),v=O[f],n&&(m=e.noTargetGet?(h=o(E,f))&&h.value:E[f]),d=n&&m?m:t[f],n&&typeof v==typeof d||(y=e.bind&&n?a(d,r):e.wrap&&n?l(d):w&&"function"==typeof d?a(Function.call,d):d,(e.sham||d&&d.sham||v&&v.sham)&&s(y,"sham",!0),O[f]=y,w&&(u(c,p=g+"Prototype")||s(c,p,{}),c[p][f]=d,e.real&&j&&!j[f]&&s(j,f,d)))}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},,function(e,t,n){e.exports=n(109)},function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return o}));const r={INVALID_EMAIL:"email_invalid",INVALID_REQUEST:"invalid_request_error",API_CONNECTION:"api_connection_error",API_ERROR:"api_error",AUTHENTICATION_ERROR:"authentication_error",RATE_LIMIT_ERROR:"rate_limit_error",CARD_ERROR:"card_error",VALIDATION_ERROR:"validation_error"},o={INVALID_NUMBER:"invalid_number",INVALID_EXPIRY_MONTH:"invalid_expiry_month",INVALID_EXPIRY_YEAR:"invalid_expiry_year",INVALID_CVC:"invalid_cvc",INCORRECT_NUMBER:"incorrect_number",INCOMPLETE_NUMBER:"incomplete_number",INCOMPLETE_CVC:"incomplete_cvc",INCOMPLETE_EXPIRY:"incomplete_expiry",EXPIRED_CARD:"expired_card",INCORRECT_CVC:"incorrect_cvc",INCORRECT_ZIP:"incorrect_zip",INVALID_EXPIRY_YEAR_PAST:"invalid_expiry_year_past",CARD_DECLINED:"card_declined",MISSING:"missing",PROCESSING_ERROR:"processing_error"}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},,function(e,t,n){var r=n(24),o=n(39),i=n(33);e.exports=r?function(e,t,n){return o.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var r=n(17);e.exports=function(e){if(!r(e))throw TypeError(String(e)+" is not an object");return e}},,function(e,t,n){!function(e,t){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function o(){}function i(){}t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t,i.resetWarningCache=o;var c=function(e,t){return function(e){e.exports=function(){function e(e,t,n,r,o,i){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==i){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}()}(t={exports:{}}),t.exports}(),a=function(e){return null!==e&&"object"===n(e)},s=function e(t,n){if(!a(t)||!a(n))return t===n;var r=Array.isArray(t);if(r!==Array.isArray(n))return!1;var o="[object Object]"===Object.prototype.toString.call(t);if(o!==("[object Object]"===Object.prototype.toString.call(n)))return!1;if(!o&&!r)return!1;var i=Object.keys(t),c=Object.keys(n);if(i.length!==c.length)return!1;for(var s={},u=0;u<i.length;u+=1)s[i[u]]=!0;for(var l=0;l<c.length;l+=1)s[c[l]]=!0;var p=Object.keys(s);if(p.length!==i.length)return!1;var f=t,d=n;return p.every((function(t){return e(f[t],d[t])}))},u=function(e){var n=t.useRef(e);return t.useEffect((function(){n.current=e}),[e]),n.current},l=function(e){if(null===e||a(t=e)&&"function"==typeof t.elements&&"function"==typeof t.createToken&&"function"==typeof t.createPaymentMethod&&"function"==typeof t.confirmCardPayment)return e;var t;throw new Error("Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.")},p=t.createContext(null);p.displayName="ElementsContext";var f=function(e){var n,o,i=e.stripe,c=e.options,f=e.children,d=t.useRef(!1),v=t.useRef(!0),m=t.useMemo((function(){return function(e){if(function(e){return a(e)&&"function"==typeof e.then}(e))return{tag:"async",stripePromise:Promise.resolve(e).then(l)};var t=l(e);return null===t?{tag:"empty"}:{tag:"sync",stripe:t}}(i)}),[i]),y=(n=t.useState((function(){return{stripe:null,elements:null}})),o=2,function(e){if(Array.isArray(e))return e}(n)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],_n=!0,r=!1,o=void 0;try{for(var i,c=e[Symbol.iterator]();!(_n=(i=c.next()).done)&&(n.push(i.value),!t||n.length!==t);_n=!0);}catch(e){r=!0,o=e}finally{try{_n||null==c.return||c.return()}finally{if(r)throw o}}return n}}(n,o)||function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(n,o)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),h=y[0],g=y[1],b=u(i),_=u(c);return null!==b&&(b!==i&&console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it."),s(c,_)||console.warn("Unsupported prop change on Elements: You cannot change the `options` prop after setting the `stripe` prop.")),d.current||("sync"===m.tag&&(d.current=!0,g({stripe:m.stripe,elements:m.stripe.elements(c)})),"async"===m.tag&&(d.current=!0,m.stripePromise.then((function(e){e&&v.current&&g({stripe:e,elements:e.elements(c)})})))),t.useEffect((function(){return function(){v.current=!1}}),[]),t.useEffect((function(){var e=h.stripe;e&&e._registerWrapper&&e.registerAppInfo&&(e._registerWrapper({name:"react-stripe-js",version:"1.4.1"}),e.registerAppInfo({name:"react-stripe-js",version:"1.4.1",url:"https://stripe.com/docs/stripe-js/react"}))}),[h.stripe]),t.createElement(p.Provider,{value:h},f)};f.propTypes={stripe:c.any,options:c.object};var d=function(e){return function(e,t){if(!e)throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(t," in an <Elements> provider."));return e}(t.useContext(p),e)},v=function(e){return(0,e.children)(d("mounts <ElementsConsumer>"))};v.propTypes={children:c.func.isRequired};var m=function(e){var n=t.useRef(e);return t.useEffect((function(){n.current=e}),[e]),function(){n.current&&n.current.apply(n,arguments)}},y=function(e){return a(e)?(e.paymentRequest,function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["paymentRequest"])):{}},h=function(){},g=function(e,n){var r,o="".concat((r=e).charAt(0).toUpperCase()+r.slice(1),"Element"),i=n?function(e){d("mounts <".concat(o,">"));var n=e.id,r=e.className;return t.createElement("div",{id:n,className:r})}:function(n){var r=n.id,i=n.className,c=n.options,a=void 0===c?{}:c,u=n.onBlur,l=void 0===u?h:u,p=n.onFocus,f=void 0===p?h:p,v=n.onReady,g=void 0===v?h:v,b=n.onChange,_=void 0===b?h:b,w=n.onEscape,E=void 0===w?h:w,O=n.onClick,j=void 0===O?h:O,x=d("mounts <".concat(o,">")).elements,C=t.useRef(null),S=t.useRef(null),R=m(g),T=m(l),I=m(f),A=m(j),P=m(_),k=m(E);t.useLayoutEffect((function(){if(null==C.current&&x&&null!=S.current){var t=x.create(e,a);C.current=t,t.mount(S.current),t.on("ready",(function(){return R(t)})),t.on("change",P),t.on("blur",T),t.on("focus",I),t.on("escape",k),t.on("click",A)}}));var N=t.useRef(a);return t.useEffect((function(){N.current&&N.current.paymentRequest!==a.paymentRequest&&console.warn("Unsupported prop change: options.paymentRequest is not a customizable property.");var e=y(a);0===Object.keys(e).length||s(e,y(N.current))||C.current&&(C.current.update(e),N.current=a)}),[a]),t.useLayoutEffect((function(){return function(){C.current&&C.current.destroy()}}),[]),t.createElement("div",{id:r,className:i,ref:S})};return i.propTypes={id:c.string,className:c.string,onChange:c.func,onBlur:c.func,onFocus:c.func,onReady:c.func,onClick:c.func,options:c.object},i.displayName=o,i.__elementType=e,i},b="undefined"==typeof window,_=g("auBankAccount",b),w=g("card",b),E=g("cardNumber",b),O=g("cardExpiry",b),j=g("cardCvc",b),x=g("fpxBank",b),C=g("iban",b),S=g("idealBank",b),R=g("p24Bank",b),T=g("epsBank",b),I=g("payment",b),A=g("paymentRequestButton",b),P=g("afterpayClearpayMessage",b);e.AfterpayClearpayMessageElement=P,e.AuBankAccountElement=_,e.CardCvcElement=j,e.CardElement=w,e.CardExpiryElement=O,e.CardNumberElement=E,e.Elements=f,e.ElementsConsumer=v,e.EpsBankElement=T,e.FpxBankElement=x,e.IbanElement=C,e.IdealBankElement=S,e.P24BankElement=R,e.PaymentElement=I,e.PaymentRequestButtonElement=A,e.useElements=function(){return d("calls useElements()").elements},e.useStripe=function(){return d("calls useStripe()").stripe},Object.defineProperty(e,"__esModule",{value:!0})}(t,n(2))},function(e,t,n){var r=n(13);e.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},,,function(e,t){e.exports={}},function(e,t,n){var r=n(27);e.exports=function(e){return r[e+"Prototype"]}},function(e,t,n){"use strict";n.d(t,"c",(function(){return m})),n.d(t,"b",(function(){return d})),n.d(t,"a",(function(){return v}));var r=n(15),o=n.n(r),i=n(56),c=n.n(i),a=n(133),s=n.n(a),u=n(104),l=n.n(u),p=n(1),f=n(16);const d=()=>{if(!wc_stripe_upe_params)throw new Error("Stripe initialization data is not available");return wc_stripe_upe_params},v=(e,t="")=>{switch(e){case f.b.INVALID_EMAIL:return Object(p.__)("Invalid email address, please correct and try again.","woocommerce-gateway-stripe");case(e=>{var t;return o()(t=[f.b.INVALID_REQUEST,f.b.API_CONNECTION,f.b.API_ERROR,f.b.AUTHENTICATION_ERROR,f.b.RATE_LIMIT_ERROR]).call(t,e)})(e):return Object(p.__)("Unable to process this payment, please try again or use alternative method.","woocommerce-gateway-stripe");case f.b.CARD_ERROR:return(e=>({[f.a.INVALID_NUMBER]:Object(p.__)("The card number is not a valid credit card number.","woocommerce-gateway-stripe"),[f.a.INVALID_EXPIRY_MONTH]:Object(p.__)("The card expiration month is invalid.","woocommerce-gateway-stripe"),[f.a.INVALID_EXPIRY_YEAR]:Object(p.__)("The card expiration year is invalid.","woocommerce-gateway-stripe"),[f.a.INVALID_CVC]:Object(p.__)("The card security code is invalid.","woocommerce-gateway-stripe"),[f.a.INCORRECT_NUMBER]:Object(p.__)("The card number is incorrect.","woocommerce-gateway-stripe"),[f.a.INCOMPLETE_NUMBER]:Object(p.__)("The card number is incomplete.","woocommerce-gateway-stripe"),[f.a.INCOMPLETE_CVC]:Object(p.__)("The card security code is incomplete.","woocommerce-gateway-stripe"),[f.a.INCOMPLETE_EXPIRY]:Object(p.__)("The card expiration date is incomplete.","woocommerce-gateway-stripe"),[f.a.EXPIRED_CARD]:Object(p.__)("The card has expired.","woocommerce-gateway-stripe"),[f.a.INCORRECT_CVC]:Object(p.__)("The card security code is incorrect.","woocommerce-gateway-stripe"),[f.a.INCORRECT_ZIP]:Object(p.__)("The card zip code failed validation.","woocommerce-gateway-stripe"),[f.a.INVALID_EXPIRY_YEAR_PAST]:Object(p.__)("The card expiration year is in the past","woocommerce-gateway-stripe"),[f.a.CARD_DECLINED]:Object(p.__)("The card was declined.","woocommerce-gateway-stripe"),[f.a.MISSING]:Object(p.__)("There is no card on a customer that is being charged.","woocommerce-gateway-stripe"),[f.a.PROCESSING_ERROR]:Object(p.__)("An error occurred while processing the card.","woocommerce-gateway-stripe")}[e]||null))(t);case f.b.VALIDATION_ERROR:return""}return null},m=(e="always")=>{var t,n;const r=null===(t=d())||void 0===t?void 0:t.paymentMethodsConfig,o=c()(n=s()(r)).call(n,e=>r[e].isReusable);return l()(o).call(o,(t,n)=>(t[n]=e,t),{})}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var r=n(27),o=n(9),i=function(e){return"function"==typeof e?e:void 0};e.exports=function(e,t){return arguments.length<2?i(r[e])||i(o[e]):r[e]&&r[e][t]||o[e]&&o[e][t]}},function(e,t){e.exports=!0},function(e,t){e.exports={}},function(e,t){e.exports=window.jQuery},function(e,t,n){var r=n(53),o=n(31);e.exports=function(e){return r(o(e))}},function(e,t,n){var r=n(24),o=n(69),i=n(21),c=n(48),a=Object.defineProperty;t.f=r?a:function(e,t,n){if(i(e),t=c(t,!0),i(n),o)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){var r=n(49),o=Math.min;e.exports=function(e){return e>0?o(r(e),9007199254740991):0}},function(e,t,n){var r=n(32);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},,function(e,t,n){var r=n(31);e.exports=function(e){return Object(r(e))}},function(e,t,n){var r=n(30),o=n(9);e.exports="process"==r(o.process)},,function(e,t,n){var r,o,i=n(9),c=n(59),a=i.process,s=a&&a.versions,u=s&&s.v8;u?o=(r=u.split("."))[0]+r[1]:c&&(!(r=c.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=c.match(/Chrome\/(\d+)/))&&(o=r[1]),e.exports=o&&+o},,function(e,t,n){var r=n(17);e.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){var r=n(20);e.exports=function(e,t,n,o){o&&o.enumerable?e[t]=n:r(e,t,n)}},,,function(e,t,n){var r=n(13),o=n(30),i="".split;e.exports=r((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==o(e)?i.call(e,""):Object(e)}:Object},function(e,t,n){var r=n(9),o=n(107),i=r["__core-js_shared__"]||o("__core-js_shared__",{});e.exports=i},,function(e,t,n){e.exports=n(174)},,function(e,t,n){var r=n(9),o=n(17),i=r.document,c=o(i)&&o(i.createElement);e.exports=function(e){return c?i.createElement(e):{}}},function(e,t,n){var r=n(34);e.exports=r("navigator","userAgent")||""},function(e,t,n){var r=n(67),o=n(39).f,i=n(20),c=n(18),a=n(139),s=n(10)("toStringTag");e.exports=function(e,t,n,u){if(e){var l=n?e:e.prototype;c(l,s)||o(l,s,{configurable:!0,value:t}),u&&!r&&i(l,"toString",a)}}},,function(e,t,n){e.exports=n(156)},function(e,t,n){var r=n(75),o=n(76),i=r("keys");e.exports=function(e){return i[e]||(i[e]=o(e))}},function(e,t,n){var r=n(38),o=n(40),i=n(89),c=function(e){return function(t,n,c){var a,s=r(t),u=o(s.length),l=i(c,u);if(e&&n!=n){for(;u>l;)if((a=s[l++])!=a)return!0}else for(;u>l;l++)if((e||l in s)&&s[l]===n)return e||l||0;return!e&&-1}};e.exports={includes:c(!0),indexOf:c(!1)}},function(e,t){e.exports={}},function(e,t,n){var r=n(67),o=n(30),i=n(10)("toStringTag"),c="Arguments"==o(function(){return arguments}());e.exports=r?o:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),i))?n:c?o(t):"Object"==(r=o(t))&&"function"==typeof t.callee?"Arguments":r}},function(e,t,n){var r={};r[n(10)("toStringTag")]="z",e.exports="[object z]"===String(r)},function(e,t,n){var r,o,i,c=n(142),a=n(9),s=n(17),u=n(20),l=n(18),p=n(54),f=n(63),d=n(65),v=a.WeakMap;if(c){var m=p.state||(p.state=new v),y=m.get,h=m.has,g=m.set;r=function(e,t){return t.facade=e,g.call(m,e,t),t},o=function(e){return y.call(m,e)||{}},i=function(e){return h.call(m,e)}}else{var b=f("state");d[b]=!0,r=function(e,t){return t.facade=e,u(e,b,t),t},o=function(e){return l(e,b)?e[b]:{}},i=function(e){return l(e,b)}}e.exports={set:r,get:o,has:i,enforce:function(e){return i(e)?o(e):r(e,{})},getterFor:function(e){return function(t){var n;if(!s(t)||(n=o(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}}},function(e,t,n){var r=n(24),o=n(13),i=n(58);e.exports=!r&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},function(e,t,n){var r=n(18),o=n(43),i=n(63),c=n(136),a=i("IE_PROTO"),s=Object.prototype;e.exports=c?Object.getPrototypeOf:function(e){return e=o(e),r(e,a)?e[a]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?s:null}},function(e,t,n){var r=n(21),o=n(122),i=n(40),c=n(41),a=n(97),s=n(123),u=function(e,t){this.stopped=e,this.result=t};e.exports=function(e,t,n){var l,p,f,d,v,m,y,h=n&&n.that,g=!(!n||!n.AS_ENTRIES),b=!(!n||!n.IS_ITERATOR),_=!(!n||!n.INTERRUPTED),w=c(t,h,1+g+_),E=function(e){return l&&s(l),new u(!0,e)},O=function(e){return g?(r(e),_?w(e[0],e[1],E):w(e[0],e[1])):_?w(e,E):w(e)};if(b)l=e;else{if("function"!=typeof(p=a(e)))throw TypeError("Target is not iterable");if(o(p)){for(f=0,d=i(e.length);d>f;f++)if((v=O(e[f]))&&v instanceof u)return v;return new u(!1)}l=p.call(e)}for(m=l.next;!(y=m.call(l)).done;){try{v=O(y.value)}catch(e){throw s(l),e}if("object"==typeof v&&v&&v instanceof u)return v}return new u(!1)}},function(e,t,n){var r=n(44),o=n(46),i=n(13);e.exports=!!Object.getOwnPropertySymbols&&!i((function(){return!Symbol.sham&&(r?38===o:o>37&&o<41)}))},function(e,t,n){"use strict";var r=n(32),o=function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r})),this.resolve=r(t),this.reject=r(n)};e.exports.f=function(e){return new o(e)}},function(e,t,n){var r=n(24),o=n(87),i=n(33),c=n(38),a=n(48),s=n(18),u=n(69),l=Object.getOwnPropertyDescriptor;t.f=r?l:function(e,t){if(e=c(e),t=a(t,!0),u)try{return l(e,t)}catch(e){}if(s(e,t))return i(!o.f.call(e,t),e[t])}},function(e,t,n){var r=n(35),o=n(54);(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.9.1",mode:r?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++n+r).toString(36)}},function(e,t){e.exports=function(){}},function(e,t,n){e.exports=n(170)},,,function(e,t,n){var r=n(13),o=/#|\.prototype\./,i=function(e,t){var n=a[c(e)];return n==u||n!=s&&("function"==typeof t?r(t):!!t)},c=i.normalize=function(e){return String(e).replace(o,".").toLowerCase()},a=i.data={},s=i.NATIVE="N",u=i.POLYFILL="P";e.exports=i},function(e,t,n){var r=n(138),o=n(90);e.exports=Object.keys||function(e){return r(e,o)}},function(e,t,n){var r=n(13),o=n(10),i=n(46),c=o("species");e.exports=function(e){return i>=51||!r((function(){var t=[];return(t.constructor={})[c]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},,,,function(e,t,n){"use strict";var r={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,i=o&&!r.call({1:2},1);t.f=i?function(e){var t=o(this,e);return!!t&&t.enumerable}:r},function(e,t,n){var r,o=n(21),i=n(121),c=n(90),a=n(65),s=n(96),u=n(58),l=n(63)("IE_PROTO"),p=function(){},f=function(e){return"<script>"+e+"<\/script>"},d=function(){try{r=document.domain&&new ActiveXObject("htmlfile")}catch(e){}var e,t;d=r?function(e){e.write(f("")),e.close();var t=e.parentWindow.Object;return e=null,t}(r):((t=u("iframe")).style.display="none",s.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(f("document.F=Object")),e.close(),e.F);for(var n=c.length;n--;)delete d.prototype[c[n]];return d()};a[l]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(p.prototype=o(e),n=new p,p.prototype=null,n[l]=e):n=d(),void 0===t?n:i(n,t)}},function(e,t,n){var r=n(49),o=Math.max,i=Math.min;e.exports=function(e,t){var n=r(e);return n<0?o(n+t,0):i(n,t)}},function(e,t){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(e,t){e.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},function(e,t,n){"use strict";var r,o,i,c=n(13),a=n(70),s=n(20),u=n(18),l=n(10),p=n(35),f=l("iterator"),d=!1;[].keys&&("next"in(i=[].keys())?(o=a(a(i)))!==Object.prototype&&(r=o):d=!0);var v=null==r||c((function(){var e={};return r[f].call(e)!==e}));v&&(r={}),p&&!v||u(r,f)||s(r,f,(function(){return this})),e.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:d}},,function(e,t,n){e.exports=n(201)},function(e,t,n){var r=n(21),o=n(137);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),t=n instanceof Array}catch(e){}return function(n,i){return r(n),o(i),t?e.call(n,i):n.__proto__=i,n}}():void 0)},function(e,t,n){var r=n(34);e.exports=r("document","documentElement")},function(e,t,n){var r=n(66),o=n(36),i=n(10)("iterator");e.exports=function(e){if(null!=e)return e[i]||e["@@iterator"]||o[r(e)]}},function(e,t,n){var r=n(54),o=Function.toString;"function"!=typeof r.inspectSource&&(r.inspectSource=function(e){return o.call(e)}),e.exports=r.inspectSource},function(e,t,n){"use strict";var r=n(12),o=n(131),i=n(70),c=n(95),a=n(60),s=n(20),u=n(50),l=n(10),p=n(35),f=n(36),d=n(92),v=d.IteratorPrototype,m=d.BUGGY_SAFARI_ITERATORS,y=l("iterator"),h=function(){return this};e.exports=function(e,t,n,l,d,g,b){o(n,t,l);var _,w,E,O=function(e){if(e===d&&R)return R;if(!m&&e in C)return C[e];switch(e){case"keys":case"values":case"entries":return function(){return new n(this,e)}}return function(){return new n(this)}},j=t+" Iterator",x=!1,C=e.prototype,S=C[y]||C["@@iterator"]||d&&C[d],R=!m&&S||O(d),T="Array"==t&&C.entries||S;if(T&&(_=i(T.call(new e)),v!==Object.prototype&&_.next&&(p||i(_)===v||(c?c(_,v):"function"!=typeof _[y]&&s(_,y,h)),a(_,j,!0,!0),p&&(f[j]=h))),"values"==d&&S&&"values"!==S.name&&(x=!0,R=function(){return S.call(this)}),p&&!b||C[y]===R||s(C,y,R),f[t]=R,d)if(w={values:O("values"),keys:g?R:O("keys"),entries:O("entries")},b)for(E in w)(m||x||!(E in C))&&u(C,E,w[E]);else r({target:t,proto:!0,forced:m||x},w);return w}},function(e,t,n){var r=n(41),o=n(53),i=n(43),c=n(40),a=n(143),s=[].push,u=function(e){var t=1==e,n=2==e,u=3==e,l=4==e,p=6==e,f=7==e,d=5==e||p;return function(v,m,y,h){for(var g,b,_=i(v),w=o(_),E=r(m,y,3),O=c(w.length),j=0,x=h||a,C=t?x(v,O):n||f?x(v,0):void 0;O>j;j++)if((d||j in w)&&(b=E(g=w[j],j,_),e))if(t)C[j]=b;else if(b)switch(e){case 3:return!0;case 5:return g;case 6:return j;case 2:s.call(C,g)}else switch(e){case 4:return!1;case 7:s.call(C,g)}return p?-1:u||l?l:C}};e.exports={forEach:u(0),map:u(1),filter:u(2),some:u(3),every:u(4),find:u(5),findIndex:u(6),filterOut:u(7)}},function(e,t,n){var r=n(30);e.exports=Array.isArray||function(e){return"Array"==r(e)}},function(e,t,n){var r=n(115);e.exports=function(e){if(r(e))throw TypeError("The method doesn't accept regular expressions");return e}},function(e,t,n){var r=n(10)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[r]=!1,"/./"[e](t)}catch(e){}}return!1}},function(e,t,n){e.exports=n(181)},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r="stripe"},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var r=n(9),o=n(20);e.exports=function(e,t){try{o(r,e,t)}catch(n){r[e]=t}return t}},function(e,t,n){var r=n(72);e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(e,t,n){var r=n(110);e.exports=r},function(e,t,n){var r=n(111),o=n(113),i=Array.prototype,c=String.prototype;e.exports=function(e){var t=e.includes;return e===i||e instanceof Array&&t===i.includes?r:"string"==typeof e||e===c||e instanceof String&&t===c.includes?o:t}},function(e,t,n){n(112);var r=n(28);e.exports=r("Array").includes},function(e,t,n){"use strict";var r=n(12),o=n(64).includes,i=n(77);r({target:"Array",proto:!0},{includes:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}}),i("includes")},function(e,t,n){n(114);var r=n(28);e.exports=r("String").includes},function(e,t,n){"use strict";var r=n(12),o=n(102),i=n(31);r({target:"String",proto:!0,forced:!n(103)("includes")},{includes:function(e){return!!~String(i(this)).indexOf(o(e),arguments.length>1?arguments[1]:void 0)}})},function(e,t,n){var r=n(17),o=n(30),i=n(10)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[i])?!!t:"RegExp"==o(e))}},function(e,t){e.exports="\t\n\v\f\r                 \u2028\u2029\ufeff"},function(e,t){e.exports=window.wc.wcSettings},,,function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(62),o=n.n(r),i=n(134),c=n(7);const a=()=>new o.a(e=>{try{var t,n;const r=null!==(t=null===(n=Object(c.c)())||void 0===n?void 0:n.stripe_locale)&&void 0!==t?t:"auto";e(Object(i.a)(Object(c.b)(),{locale:r}))}catch(t){e({error:t})}})},function(e,t,n){var r=n(24),o=n(39),i=n(21),c=n(82);e.exports=r?Object.defineProperties:function(e,t){i(e);for(var n,r=c(t),a=r.length,s=0;a>s;)o.f(e,n=r[s++],t[n]);return e}},function(e,t,n){var r=n(10),o=n(36),i=r("iterator"),c=Array.prototype;e.exports=function(e){return void 0!==e&&(o.Array===e||c[i]===e)}},function(e,t,n){var r=n(21);e.exports=function(e){var t=e.return;if(void 0!==t)return r(t.call(e)).value}},function(e,t,n){var r=n(9);e.exports=r.Promise},function(e,t,n){var r=n(21),o=n(32),i=n(10)("species");e.exports=function(e,t){var n,c=r(e).constructor;return void 0===c||null==(n=r(c)[i])?t:o(n)}},function(e,t,n){var r,o,i,c=n(9),a=n(13),s=n(41),u=n(96),l=n(58),p=n(127),f=n(44),d=c.location,v=c.setImmediate,m=c.clearImmediate,y=c.process,h=c.MessageChannel,g=c.Dispatch,b=0,_={},w=function(e){if(_.hasOwnProperty(e)){var t=_[e];delete _[e],t()}},E=function(e){return function(){w(e)}},O=function(e){w(e.data)},j=function(e){c.postMessage(e+"",d.protocol+"//"+d.host)};v&&m||(v=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return _[++b]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},r(b),b},m=function(e){delete _[e]},f?r=function(e){y.nextTick(E(e))}:g&&g.now?r=function(e){g.now(E(e))}:h&&!p?(i=(o=new h).port2,o.port1.onmessage=O,r=s(i.postMessage,i,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts&&d&&"file:"!==d.protocol&&!a(j)?(r=j,c.addEventListener("message",O,!1)):r="onreadystatechange"in l("script")?function(e){u.appendChild(l("script")).onreadystatechange=function(){u.removeChild(this),w(e)}}:function(e){setTimeout(E(e),0)}),e.exports={set:v,clear:m}},function(e,t,n){var r=n(59);e.exports=/(iphone|ipod|ipad).*applewebkit/i.test(r)},function(e,t,n){var r=n(21),o=n(17),i=n(73);e.exports=function(e,t){if(r(e),o(t)&&t.constructor===e)return t;var n=i.f(e);return(0,n.resolve)(t),n.promise}},function(e,t,n){"use strict";var r=n(130).charAt,o=n(68),i=n(99),c=o.set,a=o.getterFor("String Iterator");i(String,"String",(function(e){c(this,{type:"String Iterator",string:String(e),index:0})}),(function(){var e,t=a(this),n=t.string,o=t.index;return o>=n.length?{value:void 0,done:!0}:(e=r(n,o),t.index+=e.length,{value:e,done:!1})}))},function(e,t,n){var r=n(49),o=n(31),i=function(e){return function(t,n){var i,c,a=String(o(t)),s=r(n),u=a.length;return s<0||s>=u?e?"":void 0:(i=a.charCodeAt(s))<55296||i>56319||s+1===u||(c=a.charCodeAt(s+1))<56320||c>57343?e?a.charAt(s):i:e?a.slice(s,s+2):c-56320+(i-55296<<10)+65536}};e.exports={codeAt:i(!1),charAt:i(!0)}},function(e,t,n){"use strict";var r=n(92).IteratorPrototype,o=n(88),i=n(33),c=n(60),a=n(36),s=function(){return this};e.exports=function(e,t,n){var u=t+" Iterator";return e.prototype=o(r,{next:i(1,n)}),c(e,u,!1,!0),a[u]=s,e}},function(e,t,n){"use strict";var r=n(13);e.exports=function(e,t){var n=[][e];return!!n&&r((function(){n.call(null,t||function(){throw 1},1)}))}},function(e,t,n){e.exports=n(178)},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r="https://js.stripe.com/v3",o=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,i="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",c=null,a=function(e,t,n){if(null===e)return null;var r=e.apply(void 0,t);return function(e,t){e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",version:"1.15.1",startTime:t})}(r,n),r},s=Promise.resolve().then((function(){return e=null,null!==c?c:c=new Promise((function(t,n){if("undefined"!=typeof window)if(window.Stripe&&e&&console.warn(i),window.Stripe)t(window.Stripe);else try{var c=function(){for(var e=document.querySelectorAll('script[src^="'.concat(r,'"]')),t=0;t<e.length;t++){var n=e[t];if(o.test(n.src))return n}return null}();c&&e?console.warn(i):c||(c=function(e){var t=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",n=document.createElement("script");n.src="".concat(r).concat(t);var o=document.head||document.body;if(!o)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return o.appendChild(n),n}(e)),c.addEventListener("load",(function(){window.Stripe?t(window.Stripe):n(new Error("Stripe.js not available"))})),c.addEventListener("error",(function(){n(new Error("Failed to load Stripe.js"))}))}catch(e){return void n(e)}else t(null)}));var e})),u=!1;s.catch((function(e){u||console.warn(e)}));var l=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];u=!0;var r=Date.now();return s.then((function(e){return a(e,t,r)}))}},,function(e,t,n){var r=n(13);e.exports=!r((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},function(e,t,n){var r=n(17);e.exports=function(e){if(!r(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e}},function(e,t,n){var r=n(18),o=n(38),i=n(64).indexOf,c=n(65);e.exports=function(e,t){var n,a=o(e),s=0,u=[];for(n in a)!r(c,n)&&r(a,n)&&u.push(n);for(;t.length>s;)r(a,n=t[s++])&&(~i(u,n)||u.push(n));return u}},function(e,t,n){"use strict";var r=n(67),o=n(66);e.exports=r?{}.toString:function(){return"[object "+o(this)+"]"}},function(e,t){e.exports=function(e,t,n){if(!(e instanceof t))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return e}},function(e,t,n){var r=n(10)("iterator"),o=!1;try{var i=0,c={next:function(){return{done:!!i++}},return:function(){o=!0}};c[r]=function(){return this},Array.from(c,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!o)return!1;var n=!1;try{var i={};i[r]=function(){return{next:function(){return{done:n=!0}}}},e(i)}catch(e){}return n}},function(e,t,n){var r=n(9),o=n(98),i=r.WeakMap;e.exports="function"==typeof i&&/native code/.test(o(i))},function(e,t,n){var r=n(17),o=n(101),i=n(10)("species");e.exports=function(e,t){var n;return o(e)&&("function"!=typeof(n=e.constructor)||n!==Array&&!o(n.prototype)?r(n)&&null===(n=n[i])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===t?0:t)}},function(e,t,n){"use strict";var r=n(48),o=n(39),i=n(33);e.exports=function(e,t,n){var c=r(t);c in e?o.f(e,c,i(0,n)):e[c]=n}},,,,function(e,t){e.exports=window.wc.wcBlocksRegistry},,,function(e,t,n){var r=n(50);e.exports=function(e,t,n){for(var o in t)n&&n.unsafe&&e[o]?e[o]=t[o]:r(e,o,t[o],n);return e}},function(e,t,n){"use strict";var r=n(38),o=n(77),i=n(36),c=n(68),a=n(99),s=c.set,u=c.getterFor("Array Iterator");e.exports=a(Array,"Array",(function(e,t){s(this,{type:"Array Iterator",target:r(e),index:0,kind:t})}),(function(){var e=u(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:t[r],done:!1}:{value:[r,t[r]],done:!1}}),"values"),i.Arguments=i.Array,o("keys"),o("values"),o("entries")},function(e,t,n){var r=n(31),o="["+n(116)+"]",i=RegExp("^"+o+o+"*"),c=RegExp(o+o+"*$"),a=function(e){return function(t){var n=String(r(t));return 1&e&&(n=n.replace(i,"")),2&e&&(n=n.replace(c,"")),n}};e.exports={start:a(1),end:a(2),trim:a(3)}},,,function(e,t,n){var r=n(157);e.exports=r},function(e,t,n){n(158),n(159),n(160),n(165),n(166),n(167),n(129),n(168);var r=n(27);e.exports=r.Promise},function(e,t,n){"use strict";var r=n(12),o=n(70),i=n(95),c=n(88),a=n(20),s=n(33),u=n(71),l=function(e,t){var n=this;if(!(n instanceof l))return new l(e,t);i&&(n=i(new Error(void 0),o(n))),void 0!==t&&a(n,"message",String(t));var r=[];return u(e,r.push,{that:r}),a(n,"errors",r),n};l.prototype=c(Error.prototype,{constructor:s(5,l),message:s(5,""),name:s(5,"AggregateError")}),r({global:!0},{AggregateError:l})},function(e,t){},function(e,t,n){"use strict";var r,o,i,c,a=n(12),s=n(35),u=n(9),l=n(34),p=n(124),f=n(50),d=n(151),v=n(60),m=n(161),y=n(17),h=n(32),g=n(140),b=n(98),_=n(71),w=n(141),E=n(125),O=n(126).set,j=n(162),x=n(128),C=n(164),S=n(73),R=n(91),T=n(68),I=n(81),A=n(10),P=n(44),k=n(46),N=A("species"),L="Promise",M=T.get,D=T.set,V=T.getterFor(L),B=p,q=u.TypeError,F=u.document,U=u.process,Y=l("fetch"),H=S.f,W=H,G=!!(F&&F.createEvent&&u.dispatchEvent),$="function"==typeof PromiseRejectionEvent,z=I(L,(function(){if(b(B)===String(B)){if(66===k)return!0;if(!P&&!$)return!0}if(s&&!B.prototype.finally)return!0;if(k>=51&&/native code/.test(B))return!1;var e=B.resolve(1),t=function(e){e((function(){}),(function(){}))};return(e.constructor={})[N]=t,!(e.then((function(){}))instanceof t)})),X=z||!w((function(e){B.all(e).catch((function(){}))})),Z=function(e){var t;return!(!y(e)||"function"!=typeof(t=e.then))&&t},Q=function(e,t){if(!e.notified){e.notified=!0;var n=e.reactions;j((function(){for(var r=e.value,o=1==e.state,i=0;n.length>i;){var c,a,s,u=n[i++],l=o?u.ok:u.fail,p=u.resolve,f=u.reject,d=u.domain;try{l?(o||(2===e.rejection&&te(e),e.rejection=1),!0===l?c=r:(d&&d.enter(),c=l(r),d&&(d.exit(),s=!0)),c===u.promise?f(q("Promise-chain cycle")):(a=Z(c))?a.call(c,p,f):p(c)):f(r)}catch(e){d&&!s&&d.exit(),f(e)}}e.reactions=[],e.notified=!1,t&&!e.rejection&&J(e)}))}},K=function(e,t,n){var r,o;G?((r=F.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),u.dispatchEvent(r)):r={promise:t,reason:n},!$&&(o=u["on"+e])?o(r):"unhandledrejection"===e&&C("Unhandled promise rejection",n)},J=function(e){O.call(u,(function(){var t,n=e.facade,r=e.value;if(ee(e)&&(t=R((function(){P?U.emit("unhandledRejection",r,n):K("unhandledrejection",n,r)})),e.rejection=P||ee(e)?2:1,t.error))throw t.value}))},ee=function(e){return 1!==e.rejection&&!e.parent},te=function(e){O.call(u,(function(){var t=e.facade;P?U.emit("rejectionHandled",t):K("rejectionhandled",t,e.value)}))},ne=function(e,t,n){return function(r){e(t,r,n)}},re=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,Q(e,!0))},oe=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw q("Promise can't be resolved itself");var r=Z(t);r?j((function(){var n={done:!1};try{r.call(t,ne(oe,n,e),ne(re,n,e))}catch(t){re(n,t,e)}})):(e.value=t,e.state=1,Q(e,!1))}catch(t){re({done:!1},t,e)}}};z&&(B=function(e){g(this,B,L),h(e),r.call(this);var t=M(this);try{e(ne(oe,t),ne(re,t))}catch(e){re(t,e)}},(r=function(e){D(this,{type:L,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=d(B.prototype,{then:function(e,t){var n=V(this),r=H(E(this,B));return r.ok="function"!=typeof e||e,r.fail="function"==typeof t&&t,r.domain=P?U.domain:void 0,n.parent=!0,n.reactions.push(r),0!=n.state&&Q(n,!1),r.promise},catch:function(e){return this.then(void 0,e)}}),o=function(){var e=new r,t=M(e);this.promise=e,this.resolve=ne(oe,t),this.reject=ne(re,t)},S.f=H=function(e){return e===B||e===i?new o(e):W(e)},s||"function"!=typeof p||(c=p.prototype.then,f(p.prototype,"then",(function(e,t){var n=this;return new B((function(e,t){c.call(n,e,t)})).then(e,t)}),{unsafe:!0}),"function"==typeof Y&&a({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return x(B,Y.apply(u,arguments))}}))),a({global:!0,wrap:!0,forced:z},{Promise:B}),v(B,L,!1,!0),m(L),i=l(L),a({target:L,stat:!0,forced:z},{reject:function(e){var t=H(this);return t.reject.call(void 0,e),t.promise}}),a({target:L,stat:!0,forced:s||z},{resolve:function(e){return x(s&&this===i?B:this,e)}}),a({target:L,stat:!0,forced:X},{all:function(e){var t=this,n=H(t),r=n.resolve,o=n.reject,i=R((function(){var n=h(t.resolve),i=[],c=0,a=1;_(e,(function(e){var s=c++,u=!1;i.push(void 0),a++,n.call(t,e).then((function(e){u||(u=!0,i[s]=e,--a||r(i))}),o)})),--a||r(i)}));return i.error&&o(i.value),n.promise},race:function(e){var t=this,n=H(t),r=n.reject,o=R((function(){var o=h(t.resolve);_(e,(function(e){o.call(t,e).then(n.resolve,r)}))}));return o.error&&r(o.value),n.promise}})},function(e,t,n){"use strict";var r=n(34),o=n(39),i=n(10),c=n(24),a=i("species");e.exports=function(e){var t=r(e),n=o.f;c&&t&&!t[a]&&n(t,a,{configurable:!0,get:function(){return this}})}},function(e,t,n){var r,o,i,c,a,s,u,l,p=n(9),f=n(74).f,d=n(126).set,v=n(127),m=n(163),y=n(44),h=p.MutationObserver||p.WebKitMutationObserver,g=p.document,b=p.process,_=p.Promise,w=f(p,"queueMicrotask"),E=w&&w.value;E||(r=function(){var e,t;for(y&&(e=b.domain)&&e.exit();o;){t=o.fn,o=o.next;try{t()}catch(e){throw o?c():i=void 0,e}}i=void 0,e&&e.enter()},v||y||m||!h||!g?_&&_.resolve?(u=_.resolve(void 0),l=u.then,c=function(){l.call(u,r)}):c=y?function(){b.nextTick(r)}:function(){d.call(p,r)}:(a=!0,s=g.createTextNode(""),new h(r).observe(s,{characterData:!0}),c=function(){s.data=a=!a})),e.exports=E||function(e){var t={fn:e,next:void 0};i&&(i.next=t),o||(o=t,c()),i=t}},function(e,t,n){var r=n(59);e.exports=/web0s(?!.*chrome)/i.test(r)},function(e,t,n){var r=n(9);e.exports=function(e,t){var n=r.console;n&&n.error&&(1===arguments.length?n.error(e):n.error(e,t))}},function(e,t,n){"use strict";var r=n(12),o=n(32),i=n(73),c=n(91),a=n(71);r({target:"Promise",stat:!0},{allSettled:function(e){var t=this,n=i.f(t),r=n.resolve,s=n.reject,u=c((function(){var n=o(t.resolve),i=[],c=0,s=1;a(e,(function(e){var o=c++,a=!1;i.push(void 0),s++,n.call(t,e).then((function(e){a||(a=!0,i[o]={status:"fulfilled",value:e},--s||r(i))}),(function(e){a||(a=!0,i[o]={status:"rejected",reason:e},--s||r(i))}))})),--s||r(i)}));return u.error&&s(u.value),n.promise}})},function(e,t,n){"use strict";var r=n(12),o=n(32),i=n(34),c=n(73),a=n(91),s=n(71);r({target:"Promise",stat:!0},{any:function(e){var t=this,n=c.f(t),r=n.resolve,u=n.reject,l=a((function(){var n=o(t.resolve),c=[],a=0,l=1,p=!1;s(e,(function(e){var o=a++,s=!1;c.push(void 0),l++,n.call(t,e).then((function(e){s||p||(p=!0,r(e))}),(function(e){s||p||(s=!0,c[o]=e,--l||u(new(i("AggregateError"))(c,"No one promise resolved")))}))})),--l||u(new(i("AggregateError"))(c,"No one promise resolved"))}));return l.error&&u(l.value),n.promise}})},function(e,t,n){"use strict";var r=n(12),o=n(35),i=n(124),c=n(13),a=n(34),s=n(125),u=n(128),l=n(50);r({target:"Promise",proto:!0,real:!0,forced:!!i&&c((function(){i.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=s(this,a("Promise")),n="function"==typeof e;return this.then(n?function(n){return u(t,e()).then((function(){return n}))}:e,n?function(n){return u(t,e()).then((function(){throw n}))}:e)}}),o||"function"!=typeof i||i.prototype.finally||l(i.prototype,"finally",a("Promise").prototype.finally)},function(e,t,n){n(152);var r=n(169),o=n(9),i=n(66),c=n(20),a=n(36),s=n(10)("toStringTag");for(var u in r){var l=o[u],p=l&&l.prototype;p&&i(p)!==s&&c(p,s,u),a[u]=a.Array}},function(e,t){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},function(e,t,n){var r=n(171);e.exports=r},function(e,t,n){var r=n(172),o=Array.prototype;e.exports=function(e){var t=e.map;return e===o||e instanceof Array&&t===o.map?r:t}},function(e,t,n){n(173);var r=n(28);e.exports=r("Array").map},function(e,t,n){"use strict";var r=n(12),o=n(100).map;r({target:"Array",proto:!0,forced:!n(83)("map")},{map:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}})},function(e,t,n){var r=n(175);e.exports=r},function(e,t,n){var r=n(176),o=Array.prototype;e.exports=function(e){var t=e.filter;return e===o||e instanceof Array&&t===o.filter?r:t}},function(e,t,n){n(177);var r=n(28);e.exports=r("Array").filter},function(e,t,n){"use strict";var r=n(12),o=n(100).filter;r({target:"Array",proto:!0,forced:!n(83)("filter")},{filter:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}})},function(e,t,n){var r=n(179);e.exports=r},function(e,t,n){n(180);var r=n(27);e.exports=r.Object.keys},function(e,t,n){var r=n(12),o=n(43),i=n(82);r({target:"Object",stat:!0,forced:n(13)((function(){i(1)}))},{keys:function(e){return i(o(e))}})},function(e,t,n){var r=n(182);e.exports=r},function(e,t,n){var r=n(183),o=Array.prototype;e.exports=function(e){var t=e.reduce;return e===o||e instanceof Array&&t===o.reduce?r:t}},function(e,t,n){n(184);var r=n(28);e.exports=r("Array").reduce},function(e,t,n){"use strict";var r=n(12),o=n(185).left,i=n(132),c=n(46),a=n(44);r({target:"Array",proto:!0,forced:!i("reduce")||!a&&c>79&&c<83},{reduce:function(e){return o(this,e,arguments.length,arguments.length>1?arguments[1]:void 0)}})},function(e,t,n){var r=n(32),o=n(43),i=n(53),c=n(40),a=function(e){return function(t,n,a,s){r(n);var u=o(t),l=i(u),p=c(u.length),f=e?p-1:0,d=e?-1:1;if(a<2)for(;;){if(f in l){s=l[f],f+=d;break}if(f+=d,e?f<0:p<=f)throw TypeError("Reduce of empty array with no initial value")}for(;e?f>=0:p>f;f+=d)f in l&&(s=n(s,l[f],f,u));return s}};e.exports={left:a(!1),right:a(!0)}},,,,function(e,t,n){e.exports=n(197)},,,,,function(e,t,n){"use strict";var r=n(0),o=n(189),i=n.n(o),c=n(117),a=n(23),s=n(15),u=n.n(s),l=n(7);const p=({onButtonClicked:e})=>{var t,n;const{theme:o="dark",locale:i="en",height:c="44"}=null===(t=Object(l.c)())||void 0===t?void 0:t.button,a=["short","long"],{branded_type:s}=null===(n=Object(l.c)())||void 0===n?void 0:n.button,p=u()(a).call(a,s)?s:"long",f=((e,t,n)=>{const o="long"===e?`https://www.gstatic.com/instantbuy/svg/${t}/${n}.svg`:`https://www.gstatic.com/instantbuy/svg/${t}_gpay.svg`,[i,c]=Object(r.useState)(o);return Object(r.useEffect)(()=>{const e=document.createElement("img");e.addEventListener("error",()=>{c(`https://www.gstatic.com/instantbuy/svg/${t}/en.svg`)}),e.src=i},[i,t]),i})(p,"dark"===o?"dark":"light",i);return Object(r.createElement)("button",{type:"button",id:"wc-stripe-branded-button","aria-label":"Google Pay",className:`gpay-button ${o} ${p}`,style:{backgroundImage:`url(${f})`,height:c+"px"},onClick:e})};var f=n(1);const d=({onButtonClicked:e})=>{var t;const{theme:n="dark",height:o="44",customLabel:i=Object(f.__)("Buy now","woocommerce-gateway-stripe")}=null===(t=Object(l.c)())||void 0===t?void 0:t.button;return Object(r.createElement)("button",{type:"button",id:"wc-stripe-custom-button",className:`button ${n} is-active`,style:{height:o+"px"},onClick:e},i)};var v=n(37),m=n.n(v),y=n(94),h=n.n(y);const g=e=>({country:e.country,state:e.region,postcode:e.postalCode,city:e.city,address:void 0===e.addressLine[0]?"":e.addressLine[0],address_2:void 0===e.addressLine[1]?"":e.addressLine[1]}),b=(e,t="wc_stripe_")=>{var n,r,o;return null===(n=Object(l.c)())||void 0===n||null===(r=n.ajax_url)||void 0===r||null===(o=r.toString())||void 0===o?void 0:o.replace("%%endpoint%%",t+e)},_=()=>{var e,t;const n={security:null===(e=Object(l.c)())||void 0===e||null===(t=e.nonce)||void 0===t?void 0:t.payment};return m.a.ajax({type:"POST",data:n,url:b("get_cart_details")})},w=e=>{const{shippingOption:t}=e;(e=>{var t,n,r;const o={security:null===(t=Object(l.c)())||void 0===t||null===(n=t.nonce)||void 0===n?void 0:n.update_shipping,shipping_method:[e.id],is_product_page:null===(r=Object(l.c)())||void 0===r?void 0:r.is_product_page};return m.a.ajax({type:"POST",data:o,url:b("update_shipping_method")})})(t).then(t=>{"success"===t.result&&e.updateWith({status:"success",total:t.total,displayItems:t.displayItems}),"fail"===t.result&&e.updateWith({status:"fail"})})},E=(e,t,n,o)=>{Object(r.useEffect)(()=>{const r=null==t?void 0:t.on("source",((e,t,n)=>r=>{var o,i,c,a,s,u;"yes"===(null===(o=Object(l.c)())||void 0===o||null===(i=o.stripe)||void 0===i?void 0:i.allow_prepaid_card)||"prepaid"!==(null==r||null===(c=r.source)||void 0===c||null===(a=c.card)||void 0===a?void 0:a.funding)?((e,t)=>{const n=((e,t)=>{var n,r,o,i,c,a,s,u,p,f,d,v,m,y,g,b,_,w,E,O;const{source:j}=e,x=null==j||null===(n=j.owner)||void 0===n?void 0:n.email,C=null==j||null===(r=j.owner)||void 0===r?void 0:r.phone,S=null==j||null===(o=j.owner)||void 0===o?void 0:o.address,R=null==j||null===(i=j.owner)||void 0===i?void 0:i.name,T=null==e?void 0:e.shippingAddress,I={_wpnonce:null===(c=Object(l.c)())||void 0===c||null===(a=c.nonce)||void 0===a?void 0:a.checkout,billing_first_name:null!==(s=null==R||null===(u=R.split(" "))||void 0===u||null===(p=h()(u).call(u,0,1))||void 0===p?void 0:p.join(" "))&&void 0!==s?s:"",billing_last_name:null!==(f=null==R||null===(d=R.split(" "))||void 0===d||null===(v=h()(d).call(d,1))||void 0===v?void 0:v.join(" "))&&void 0!==f?f:"",billing_company:"",billing_email:null!=x?x:null==e?void 0:e.payerEmail,billing_phone:null!=C?C:null==e||null===(m=e.payerPhone)||void 0===m?void 0:m.replace("/[() -]/g",""),billing_country:null!==(y=null==S?void 0:S.country)&&void 0!==y?y:"",billing_address_1:null!==(g=null==S?void 0:S.line1)&&void 0!==g?g:"",billing_address_2:null!==(b=null==S?void 0:S.line2)&&void 0!==b?b:"",billing_city:null!==(_=null==S?void 0:S.city)&&void 0!==_?_:"",billing_state:null!==(w=null==S?void 0:S.state)&&void 0!==w?w:"",billing_postcode:null!==(E=null==S?void 0:S.postal_code)&&void 0!==E?E:"",shipping_first_name:"",shipping_last_name:"",shipping_company:"",shipping_country:"",shipping_address_1:"",shipping_address_2:"",shipping_city:"",shipping_state:"",shipping_postcode:"",shipping_method:[null==e||null===(O=e.shippingOption)||void 0===O?void 0:O.id],order_comments:"",payment_method:"stripe",ship_to_different_address:1,terms:1,stripe_source:j.id,payment_request_type:t};var A,P,k,N,L,M,D,V,B,q;return T&&(I.shipping_first_name=null==T||null===(A=T.recipient)||void 0===A||null===(P=A.split(" "))||void 0===P||null===(k=h()(P).call(P,0,1))||void 0===k?void 0:k.join(" "),I.shipping_last_name=null==T||null===(N=T.recipient)||void 0===N||null===(L=N.split(" "))||void 0===L||null===(M=h()(L).call(L,1))||void 0===M?void 0:M.join(" "),I.shipping_company=null==T?void 0:T.organization,I.shipping_country=null==T?void 0:T.country,I.shipping_address_1=null!==(D=null==T||null===(V=T.addressLine)||void 0===V?void 0:V[0])&&void 0!==D?D:"",I.shipping_address_2=null!==(B=null==T||null===(q=T.addressLine)||void 0===q?void 0:q[1])&&void 0!==B?B:"",I.shipping_city=null==T?void 0:T.city,I.shipping_state=null==T?void 0:T.region,I.shipping_postcode=null==T?void 0:T.postalCode),I})(e,t);return m.a.ajax({type:"POST",data:n,dataType:"json",url:b("create_order")})})(r,t).then(((e,t,n)=>r=>{if("success"===r.result){t.complete("success");const o=(e=>{const t=e.match(/^#?confirm-(pi|si)-([^:]+):(.+)$/);if(t&&!(t.length<4))return{type:t[1],clientSecret:t[2],redirectUrl:decodeURIComponent(t[3])}})(r.redirect);if(!o||o.length<4)return void(window.location=r.redirect);const{type:i,clientSecret:c,redirectUrl:a}=o;((e,t,n)=>"si"===t?e.handleCardSetup(n):e.handleCardPayment(n))(e,i,c).then(((e,t)=>n=>{if(n.error)throw n.error;const r=((e,t)=>"si"===t?e.setupIntent:e.paymentIntent)(n,t);((e=>"requires_capture"===e.status)(r)||(e=>"succeeded"===e.status)(r))&&(window.location=e)})(a,i)).catch(e=>{n(e.message),m.a.get(a+"&is_ajax")})}else{var o,i;t.complete("fail");const e=document.createElement("div");e.innerHTML=r.messages;const c=null!==(o=null==e||null===(i=e.firstChild)||void 0===i?void 0:i.textContent)&&void 0!==o?o:"";n(c)}})(e,r,n)):n(null===(s=Object(l.c)())||void 0===s||null===(u=s.i18n)||void 0===u?void 0:u.no_prepaid_card)})(e,n,o));return()=>{null==r||r.removeEventListener("source")}},[e,t,n,o])},O=({billing:e,shippingData:t,onClick:n,onClose:o,setExpressPaymentError:i})=>{var c,s,u,f,v,y,h;const O=Object(a.useStripe)(),{needsShipping:j}=t,[x,C,S]=((e,t,n)=>{const[o,i]=Object(r.useState)(null),[c,a]=Object(r.useState)(null),[s,u]=Object(r.useState)(!1);return Object(r.useEffect)(()=>{e&&(async()=>{const t=await _(),n=Object(l.a)(e,t),r=await n.canMakePayment();r?(i(n),a(()=>r.applePay?"apple_pay":r.googlePay?"google_pay":"payment_request_api")):i(null)})()},[e,t]),Object(r.useEffect)(()=>{o&&(async()=>{u(!0);const e=await _();Object(l.d)(o,e),u(!1)})()},[o,n.cartTotal,n.cartTotalItems,n.currency.code]),[o,c,s]})(O,j,e);((e,t)=>{Object(r.useEffect)(()=>{const n=null==e?void 0:e.on("shippingaddresschange",(e=>t=>{const{shippingAddress:n}=t;((e,t)=>{var n,r,o;const i={security:null===(n=Object(l.c)())||void 0===n||null===(r=n.nonce)||void 0===r?void 0:r.shipping,payment_request_type:t,is_product_page:null===(o=Object(l.c)())||void 0===o?void 0:o.is_product_page,...g(e)};return m.a.ajax({type:"POST",data:i,url:b("get_shipping_options")})})(n,e).then(e=>{t.updateWith({status:e.result,shippingOptions:e.shipping_options,total:e.total,displayItems:e.displayItems})})})(t));return()=>{null==n||n.removeEventListener("shippingaddresschange")}},[e,t])})(x,C),((e,t)=>{Object(r.useEffect)(()=>{const t=null==e?void 0:e.on("shippingoptionchange",w);return()=>{null==t||t.removeEventListener("shippingoptionchange")}},[e,t])})(x,C),E(O,x,C,i);const R=((e,t,n)=>Object(r.useCallback)((r,o)=>{var i;if(null!==(i=Object(l.c)())&&void 0!==i&&i.login_confirmation)return r.preventDefault(),void(e=>{var t,n,r;if(null===(t=Object(l.c)())||void 0===t||!t.login_confirmation)return;let o=null===(n=Object(l.c)())||void 0===n||null===(r=n.login_confirmation)||void 0===r?void 0:r.message;var i,c;"payment_request_api"!==e&&(o=o.replace(/\*\*.*?\*\*/,"apple_pay"===e?"Apple Pay":"Google Pay")),o=o.replace(/\*\*/g,""),confirm(o)&&(window.location.href=null===(i=Object(l.c)())||void 0===i||null===(c=i.login_confirmation)||void 0===c?void 0:c.redirect_url)})(e);t(""),n(),o&&o.show()},[e,t,n]))(C,i,n);((e,t)=>{Object(r.useEffect)(()=>{const n=null==e?void 0:e.on("cancel",t);return()=>{null==n||n.removeEventListener("cancel")}},[e,t])})(x,o);const{type:T="default",theme:I="dark",height:A="48"}=null===(c=Object(l.c)())||void 0===c?void 0:c.button,P={paymentRequestButton:{type:T,theme:I,height:A+"px"}},k=null===(s=Object(l.c)())||void 0===s||null===(u=s.button)||void 0===u?void 0:u.is_branded,N=null===(f=Object(l.c)())||void 0===f||null===(v=f.button)||void 0===v?void 0:v.branded_type,L=null===(y=Object(l.c)())||void 0===y||null===(h=y.button)||void 0===h?void 0:h.is_custom;return x?L?Object(r.createElement)("div",{className:S?"wc-block-components-loading-mask":""},Object(r.createElement)(d,{className:S?"wc-block-components-loading-mask__children":"",onButtonClicked:e=>{R(e,x)}})):k&&(()=>{const e=window.navigator.userAgent.toLowerCase(),t=/chrome/.test(e)&&!/edge|edg|opr|brave\//.test(e)&&"Google Inc."===window.navigator.vendor,n=t&&window.navigator.brave;return t&&!n})()?Object(r.createElement)("div",{className:S?"wc-block-components-loading-mask":""},Object(r.createElement)(p,{className:S?"wc-block-components-loading-mask__children":"",onButtonClicked:e=>{R(e,x)}})):(k&&(P.paymentRequestButton.type="long"===N?"buy":"default"),Object(r.createElement)("div",{className:S?"wc-block-components-loading-mask":""},Object(r.createElement)(a.PaymentRequestButtonElement,{className:S?"wc-block-components-loading-mask__children":"",onClick:R,options:{style:P,paymentRequest:x}}))):null};var j,x,C=n(120);const S=Object(C.a)(),R={name:"payment_request",content:Object(r.createElement)(e=>{const{stripe:t}=e;return Object(r.createElement)(a.Elements,{stripe:t},Object(r.createElement)(O,e))},{stripe:S}),edit:Object(r.createElement)(()=>Object(r.createElement)("img",{src:"data:image/svg+xml,%3Csvg width='264' height='48' viewBox='0 0 264 48' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='264' height='48' rx='3' fill='black'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M125.114 16.6407C125.682 15.93 126.067 14.9756 125.966 14C125.135 14.0415 124.121 14.549 123.533 15.2602C123.006 15.8693 122.539 16.8641 122.661 17.7983C123.594 17.8797 124.526 17.3317 125.114 16.6407Z' fill='white'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M125.955 17.982C124.601 17.9011 123.448 18.7518 122.801 18.7518C122.154 18.7518 121.163 18.0224 120.092 18.0421C118.696 18.0629 117.402 18.8524 116.694 20.1079C115.238 22.6196 116.31 26.3453 117.726 28.3909C118.414 29.4028 119.242 30.5174 120.334 30.4769C121.366 30.4365 121.77 29.8087 123.024 29.8087C124.277 29.8087 124.641 30.4769 125.733 30.4567C126.865 30.4365 127.573 29.4443 128.261 28.4313C129.049 27.2779 129.373 26.1639 129.393 26.1027C129.373 26.0825 127.209 25.2515 127.189 22.7606C127.169 20.6751 128.888 19.6834 128.969 19.6217C127.998 18.1847 126.481 18.0224 125.955 17.982Z' fill='white'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M136.131 23.1804H138.834C140.886 23.1804 142.053 22.0752 142.053 20.1592C142.053 18.2432 140.886 17.1478 138.845 17.1478H136.131V23.1804ZM139.466 15.1582C142.411 15.1582 144.461 17.1903 144.461 20.1483C144.461 23.1172 142.369 25.1596 139.392 25.1596H136.131V30.3498H133.775V15.1582H139.466Z' fill='white'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152.198 26.224V25.3712L149.579 25.5397C148.106 25.6341 147.339 26.182 147.339 27.14C147.339 28.0664 148.138 28.6667 149.39 28.6667C150.988 28.6667 152.198 27.6449 152.198 26.224ZM145.046 27.2032C145.046 25.2551 146.529 24.1395 149.263 23.971L152.198 23.7922V22.9498C152.198 21.7181 151.388 21.0442 149.947 21.0442C148.758 21.0442 147.896 21.6548 147.717 22.5916H145.592C145.656 20.6232 147.507 19.1914 150.01 19.1914C152.703 19.1914 154.459 20.602 154.459 22.7917V30.351H152.282V28.5298H152.229C151.609 29.719 150.241 30.4666 148.758 30.4666C146.571 30.4666 145.046 29.1612 145.046 27.2032Z' fill='white'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M156.461 34.4145V32.5934C156.608 32.6141 156.965 32.6354 157.155 32.6354C158.196 32.6354 158.785 32.1932 159.142 31.0564L159.353 30.3824L155.366 19.3281H157.827L160.604 28.298H160.657L163.434 19.3281H165.832L161.698 30.9402C160.752 33.6038 159.668 34.4778 157.376 34.4778C157.197 34.4778 156.618 34.4565 156.461 34.4145Z' fill='white'/%3E%3C/svg%3E%0A",alt:""}),null),canMakePayment:e=>{var t,n,r;return!(null===(t=null===(n=Object(l.c)())||void 0===n?void 0:n.isAdmin)||void 0===t||!t)||!(null===(r=Object(l.c)())||void 0===r||!r.shouldShowPaymentRequestButton)&&Object(C.a)().then(t=>{var n,r,o,a,s;const u={order_data:{total:{label:"Total",amount:i()(null!==(n=null==e||null===(r=e.cartTotals)||void 0===r?void 0:r.total_price)&&void 0!==n?n:0,10),pending:!0},currency:null==e||null===(o=e.cartTotals)||void 0===o||null===(a=o.currency_code)||void 0===a?void 0:a.toLowerCase(),country_code:null===(s=Object(c.getSetting)("baseLocation",{}))||void 0===s?void 0:s.country,displayItems:[]},shipping_required:!1};return Object(l.a)(t,u).canMakePayment()})},paym