MockProcessor-498b60c5.js
1 year ago
MockProcessor-498b60c5.js.map
1 year ago
add-query-args-0e2a8393.js
1 year ago
add-query-args-0e2a8393.js.map
1 year ago
address-b892540d.js
1 year ago
address-b892540d.js.map
1 year ago
animation-registry-12eed2e3.js
1 year ago
animation-registry-12eed2e3.js.map
1 year ago
app-globals-707edcd4.js
1 year ago
app-globals-707edcd4.js.map
1 year ago
consumer-e06b16d3.js
1 year ago
consumer-e06b16d3.js.map
1 year ago
countries-c2f41f03.js
1 year ago
countries-c2f41f03.js.map
1 year ago
currency-a0c9bff4.js
1 year ago
currency-a0c9bff4.js.map
1 year ago
error-ca32663d.js
1 year ago
error-ca32663d.js.map
1 year ago
fetch-2032d11d.js
1 year ago
fetch-2032d11d.js.map
1 year ago
form-data-76641f16.js
1 year ago
form-data-76641f16.js.map
1 year ago
functions-2a4a4ba3.js
1 year ago
functions-2a4a4ba3.js.map
1 year ago
getters-929aa1df.js
1 year ago
getters-929aa1df.js.map
1 year ago
getters-a7eec27c.js
1 year ago
getters-a7eec27c.js.map
1 year ago
getters-b1d93841.js
1 year ago
getters-b1d93841.js.map
1 year ago
getters-e4172581.js
1 year ago
getters-e4172581.js.map
1 year ago
getters-ff7a502e.js
1 year ago
getters-ff7a502e.js.map
1 year ago
google-a86aa761.js
1 year ago
google-a86aa761.js.map
1 year ago
google-dd89f242.js
1 year ago
google-dd89f242.js.map
1 year ago
index-0202319f.js
1 year ago
index-0202319f.js.map
1 year ago
index-06061d4e.js
1 year ago
index-06061d4e.js.map
1 year ago
index-745b6bec.js
1 year ago
index-745b6bec.js.map
1 year ago
index-871d88b8.js
1 year ago
index-871d88b8.js.map
1 year ago
index-96490395.js
1 year ago
index-96490395.js.map
1 year ago
index-c5a96d53.js
2 years ago
index-c5a96d53.js.map
2 years ago
index.js
1 year ago
index.js.map
1 year ago
inline-c012a0f9.js
1 year ago
inline-c012a0f9.js.map
1 year ago
lazy-deb42890.js
1 year ago
lazy-deb42890.js.map
1 year ago
library-e110eea6.js
1 year ago
library-e110eea6.js.map
1 year ago
loader.js
1 year ago
loader.js.map
1 year ago
media-d21119a3.js
1 year ago
media-d21119a3.js.map
1 year ago
mutations-01792dfb.js
1 year ago
mutations-01792dfb.js.map
1 year ago
mutations-30225b1b.js
1 year ago
mutations-30225b1b.js.map
1 year ago
mutations-d5e8faea.js
1 year ago
mutations-d5e8faea.js.map
1 year ago
mutations-ed6d0770.js
1 year ago
mutations-ed6d0770.js.map
1 year ago
page-align-0cdacf32.js
1 year ago
page-align-0cdacf32.js.map
1 year ago
price-d5770168.js
1 year ago
price-d5770168.js.map
1 year ago
pure-963214cb.js
1 year ago
pure-963214cb.js.map
1 year ago
quantity-1f39f750.js
1 year ago
quantity-1f39f750.js.map
1 year ago
remove-query-args-938c53ea.js
1 year ago
remove-query-args-938c53ea.js.map
1 year ago
sc-address_3.entry.js
1 year ago
sc-address_3.entry.js.map
1 year ago
sc-alert_13.entry.js
1 year ago
sc-alert_13.entry.js.map
1 year ago
sc-avatar.entry.js
1 year ago
sc-avatar.entry.js.map
1 year ago
sc-badge-notice.entry.js
1 year ago
sc-badge-notice.entry.js.map
1 year ago
sc-breadcrumb.entry.js
1 year ago
sc-breadcrumb.entry.js.map
1 year ago
sc-breadcrumbs.entry.js
1 year ago
sc-breadcrumbs.entry.js.map
1 year ago
sc-button-group.entry.js
1 year ago
sc-button-group.entry.js.map
1 year ago
sc-cancel-dialog_2.entry.js
1 year ago
sc-cancel-dialog_2.entry.js.map
1 year ago
sc-cancel-discount_4.entry.js
1 year ago
sc-cancel-discount_4.entry.js.map
1 year ago
sc-card.entry.js
1 year ago
sc-card.entry.js.map
1 year ago
sc-cart-button.entry.js
1 year ago
sc-cart-button.entry.js.map
1 year ago
sc-cart-form-submit.entry.js
1 year ago
sc-cart-form-submit.entry.js.map
1 year ago
sc-cart-form.entry.js
1 year ago
sc-cart-form.entry.js.map
1 year ago
sc-cart-header.entry.js
1 year ago
sc-cart-header.entry.js.map
1 year ago
sc-cart-icon.entry.js
1 year ago
sc-cart-icon.entry.js.map
1 year ago
sc-cart-loader.entry.js
1 year ago
sc-cart-loader.entry.js.map
1 year ago
sc-cart-session-provider_3.entry.js
1 year ago
sc-cart-session-provider_3.entry.js.map
1 year ago
sc-cart-submit.entry.js
1 year ago
sc-cart-submit.entry.js.map
1 year ago
sc-cart.entry.js
1 year ago
sc-cart.entry.js.map
1 year ago
sc-cc-logo_2.entry.js
1 year ago
sc-cc-logo_2.entry.js.map
1 year ago
sc-charges-list.entry.js
1 year ago
sc-charges-list.entry.js.map
1 year ago
sc-checkout-form-errors.entry.js
1 year ago
sc-checkout-form-errors.entry.js.map
1 year ago
sc-checkout-mollie-payment_2.entry.js
1 year ago
sc-checkout-mollie-payment_2.entry.js.map
1 year ago
sc-checkout-product-price-variant-selector.entry.js
1 year ago
sc-checkout-product-price-variant-selector.entry.js.map
1 year ago
sc-checkout-stock-alert_9.entry.js
1 year ago
sc-checkout-stock-alert_9.entry.js.map
1 year ago
sc-checkout.entry.js
1 year ago
sc-checkout.entry.js.map
1 year ago
sc-choice-container.entry.js
1 year ago
sc-choice-container.entry.js.map
1 year ago
sc-choice.entry.js
1 year ago
sc-choice.entry.js.map
1 year ago
sc-choices.entry.js
1 year ago
sc-choices.entry.js.map
1 year ago
sc-column_2.entry.js
1 year ago
sc-column_2.entry.js.map
1 year ago
sc-compact-address_16.entry.js
1 year ago
sc-compact-address_16.entry.js.map
1 year ago
sc-conditional-form.entry.js
1 year ago
sc-conditional-form.entry.js.map
1 year ago
sc-consumer.entry.js
1 year ago
sc-consumer.entry.js.map
1 year ago
sc-coupon-form.entry.js
1 year ago
sc-coupon-form.entry.js.map
1 year ago
sc-custom-order-price-input.entry.js
1 year ago
sc-custom-order-price-input.entry.js.map
1 year ago
sc-customer-details.entry.js
1 year ago
sc-customer-details.entry.js.map
1 year ago
sc-customer-edit.entry.js
1 year ago
sc-customer-edit.entry.js.map
1 year ago
sc-customer-email.entry.js
1 year ago
sc-customer-email.entry.js.map
1 year ago
sc-customer-firstname.entry.js
1 year ago
sc-customer-firstname.entry.js.map
1 year ago
sc-customer-lastname.entry.js
1 year ago
sc-customer-lastname.entry.js.map
1 year ago
sc-customer-name.entry.js
1 year ago
sc-customer-name.entry.js.map
1 year ago
sc-customer-phone.entry.js
1 year ago
sc-customer-phone.entry.js.map
1 year ago
sc-dashboard-customer-details.entry.js
1 year ago
sc-dashboard-customer-details.entry.js.map
1 year ago
sc-dashboard-downloads-list.entry.js
1 year ago
sc-dashboard-downloads-list.entry.js.map
1 year ago
sc-divider.entry.js
1 year ago
sc-divider.entry.js.map
1 year ago
sc-donation-choices.entry.js
1 year ago
sc-donation-choices.entry.js.map
1 year ago
sc-downloads-list.entry.js
1 year ago
sc-downloads-list.entry.js.map
1 year ago
sc-dropdown_3.entry.js
1 year ago
sc-dropdown_3.entry.js.map
1 year ago
sc-empty.entry.js
1 year ago
sc-empty.entry.js.map
1 year ago
sc-express-payment.entry.js
1 year ago
sc-express-payment.entry.js.map
1 year ago
sc-feature-demo-banner.entry.js
1 year ago
sc-feature-demo-banner.entry.js.map
1 year ago
sc-form-control_2.entry.js
1 year ago
sc-form-control_2.entry.js.map
1 year ago
sc-form-row.entry.js
1 year ago
sc-form-row.entry.js.map
1 year ago
sc-form.entry.js
1 year ago
sc-form.entry.js.map
1 year ago
sc-format-bytes.entry.js
1 year ago
sc-format-bytes.entry.js.map
1 year ago
sc-format-interval.entry.js
1 year ago
sc-format-interval.entry.js.map
1 year ago
sc-fulfillment-shipping-status-badge.entry.js
1 year ago
sc-fulfillment-shipping-status-badge.entry.js.map
1 year ago
sc-fulfillments.entry.js
1 year ago
sc-fulfillments.entry.js.map
1 year ago
sc-heading_2.entry.js
1 year ago
sc-heading_2.entry.js.map
1 year ago
sc-image-slider.entry.js
1 year ago
sc-image-slider.entry.js.map
1 year ago
sc-invoice-status-badge.entry.js
1 year ago
sc-invoice-status-badge.entry.js.map
1 year ago
sc-invoices-list.entry.js
1 year ago
sc-invoices-list.entry.js.map
1 year ago
sc-license.entry.js
1 year ago
sc-license.entry.js.map
1 year ago
sc-licenses-list.entry.js
1 year ago
sc-licenses-list.entry.js.map
1 year ago
sc-line-item-bump.entry.js
1 year ago
sc-line-item-bump.entry.js.map
1 year ago
sc-line-item-total.entry.js
1 year ago
sc-line-item-total.entry.js.map
1 year ago
sc-line-item.entry.js
1 year ago
sc-line-item.entry.js.map
1 year ago
sc-line-items-provider.entry.js
1 year ago
sc-line-items-provider.entry.js.map
1 year ago
sc-line-items.entry.js
1 year ago
sc-line-items.entry.js.map
1 year ago
sc-login-form.entry.js
1 year ago
sc-login-form.entry.js.map
1 year ago
sc-manual-payment-method_3.entry.js
1 year ago
sc-manual-payment-method_3.entry.js.map
1 year ago
sc-menu-divider.entry.js
1 year ago
sc-menu-divider.entry.js.map
1 year ago
sc-menu-label_2.entry.js
1 year ago
sc-menu-label_2.entry.js.map
1 year ago
sc-mollie-add-method.entry.js
1 year ago
sc-mollie-add-method.entry.js.map
1 year ago
sc-order-confirmation-customer.entry.js
1 year ago
sc-order-confirmation-customer.entry.js.map
1 year ago
sc-order-confirmation-details.entry.js
1 year ago
sc-order-confirmation-details.entry.js.map
1 year ago
sc-order-confirmation-line-items_2.entry.js
1 year ago
sc-order-confirmation-line-items_2.entry.js.map
1 year ago
sc-order-confirmation.entry.js
1 year ago
sc-order-confirmation.entry.js.map
1 year ago
sc-order-coupon-form.entry.js
1 year ago
sc-order-coupon-form.entry.js.map
1 year ago
sc-order-detail.entry.js
1 year ago
sc-order-detail.entry.js.map
1 year ago
sc-order-fulfillment-badge.entry.js
1 year ago
sc-order-fulfillment-badge.entry.js.map
1 year ago
sc-order-manual-instructions.entry.js
1 year ago
sc-order-manual-instructions.entry.js.map
1 year ago
sc-order-password.entry.js
1 year ago
sc-order-password.entry.js.map
1 year ago
sc-order-return-badge.entry.js
1 year ago
sc-order-return-badge.entry.js.map
1 year ago
sc-order-shipment-badge.entry.js
1 year ago
sc-order-shipment-badge.entry.js.map
1 year ago
sc-order-status-badge.entry.js
1 year ago
sc-order-status-badge.entry.js.map
1 year ago
sc-order-submit.entry.js
1 year ago
sc-order-submit.entry.js.map
1 year ago
sc-order-summary.entry.js
1 year ago
sc-order-summary.entry.js.map
1 year ago
sc-order.entry.js
1 year ago
sc-order.entry.js.map
1 year ago
sc-orders-list.entry.js
1 year ago
sc-orders-list.entry.js.map
1 year ago
sc-pagination.entry.js
1 year ago
sc-pagination.entry.js.map
1 year ago
sc-password-nag.entry.js
1 year ago
sc-password-nag.entry.js.map
1 year ago
sc-password.entry.js
1 year ago
sc-password.entry.js.map
1 year ago
sc-payment-method-choice_2.entry.js
1 year ago
sc-payment-method-choice_2.entry.js.map
1 year ago
sc-payment-method-details.entry.js
1 year ago
sc-payment-method-details.entry.js.map
1 year ago
sc-payment-methods-list.entry.js
1 year ago
sc-payment-methods-list.entry.js.map
1 year ago
sc-payment.entry.js
1 year ago
sc-payment.entry.js.map
1 year ago
sc-paypal-add-method.entry.js
1 year ago
sc-paypal-add-method.entry.js.map
1 year ago
sc-paypal-buttons_2.entry.js
1 year ago
sc-paypal-buttons_2.entry.js.map
1 year ago
sc-paystack-add-method.entry.js
1 year ago
sc-paystack-add-method.entry.js.map
1 year ago
sc-phone-input.entry.js
1 year ago
sc-phone-input.entry.js.map
1 year ago
sc-pill-option.entry.js
1 year ago
sc-pill-option.entry.js.map
1 year ago
sc-premium-tag.entry.js
1 year ago
sc-premium-tag.entry.js.map
1 year ago
sc-price-choice-container.entry.js
1 year ago
sc-price-choice-container.entry.js.map
1 year ago
sc-price-choice.entry.js
1 year ago
sc-price-choice.entry.js.map
1 year ago
sc-price-choices.entry.js
1 year ago
sc-price-choices.entry.js.map
1 year ago
sc-price-input.entry.js
1 year ago
sc-price-input.entry.js.map
1 year ago
sc-price-range.entry.js
1 year ago
sc-price-range.entry.js.map
1 year ago
sc-price.entry.js
1 year ago
sc-price.entry.js.map
1 year ago
sc-product-buy-button.entry.js
1 year ago
sc-product-buy-button.entry.js.map
1 year ago
sc-product-donation-amount-choice.entry.js
1 year ago
sc-product-donation-amount-choice.entry.js.map
1 year ago
sc-product-donation-choices.entry.js
1 year ago
sc-product-donation-choices.entry.js.map
1 year ago
sc-product-donation-custom-amount.entry.js
1 year ago
sc-product-donation-custom-amount.entry.js.map
1 year ago
sc-product-item-image_3.entry.js
1 year ago
sc-product-item-image_3.entry.js.map
1 year ago
sc-product-item-list.entry.js
1 year ago
sc-product-item-list.entry.js.map
1 year ago
sc-product-item.entry.js
1 year ago
sc-product-item.entry.js.map
1 year ago
sc-product-line-item_2.entry.js
1 year ago
sc-product-line-item_2.entry.js.map
1 year ago
sc-product-pills-variant-option.entry.js
1 year ago
sc-product-pills-variant-option.entry.js.map
1 year ago
sc-product-price-choices.entry.js
1 year ago
sc-product-price-choices.entry.js.map
1 year ago
sc-product-price-modal.entry.js
1 year ago
sc-product-price-modal.entry.js.map
1 year ago
sc-product-price.entry.js
1 year ago
sc-product-price.entry.js.map
1 year ago
sc-product-quantity.entry.js
1 year ago
sc-product-quantity.entry.js.map
1 year ago
sc-product-selected-price.entry.js
1 year ago
sc-product-selected-price.entry.js.map
1 year ago
sc-product-text.entry.js
1 year ago
sc-product-text.entry.js.map
1 year ago
sc-provider.entry.js
1 year ago
sc-provider.entry.js.map
1 year ago
sc-provisional-banner.entry.js
1 year ago
sc-provisional-banner.entry.js.map
1 year ago
sc-purchase-downloads-list.entry.js
1 year ago
sc-purchase-downloads-list.entry.js.map
1 year ago
sc-recurring-price-choice-container.entry.js
1 year ago
sc-recurring-price-choice-container.entry.js.map
1 year ago
sc-rich-text.entry.js
1 year ago
sc-rich-text.entry.js.map
1 year ago
sc-spacing.entry.js
1 year ago
sc-spacing.entry.js.map
1 year ago
sc-stacked-list_2.entry.js
1 year ago
sc-stacked-list_2.entry.js.map
1 year ago
sc-stripe-add-method.entry.js
1 year ago
sc-stripe-add-method.entry.js.map
1 year ago
sc-stripe-element.entry.js
1 year ago
sc-stripe-element.entry.js.map
1 year ago
sc-stripe-payment-element.entry.js
1 year ago
sc-stripe-payment-element.entry.js.map
1 year ago
sc-stripe-payment-request.entry.js
1 year ago
sc-stripe-payment-request.entry.js.map
1 year ago
sc-subscription-ad-hoc-confirm.entry.js
1 year ago
sc-subscription-ad-hoc-confirm.entry.js.map
1 year ago
sc-subscription-details_2.entry.js
1 year ago
sc-subscription-details_2.entry.js.map
1 year ago
sc-subscription-payment-method.entry.js
1 year ago
sc-subscription-payment-method.entry.js.map
1 year ago
sc-subscription-payment.entry.js
1 year ago
sc-subscription-payment.entry.js.map
1 year ago
sc-subscription-switch.entry.js
1 year ago
sc-subscription-switch.entry.js.map
1 year ago
sc-subscription-variation-confirm.entry.js
1 year ago
sc-subscription-variation-confirm.entry.js.map
1 year ago
sc-subscription.entry.js
1 year ago
sc-subscription.entry.js.map
1 year ago
sc-subscriptions-list.entry.js
1 year ago
sc-subscriptions-list.entry.js.map
1 year ago
sc-summary.entry.js
1 year ago
sc-summary.entry.js.map
1 year ago
sc-switch.entry.js
1 year ago
sc-switch.entry.js.map
1 year ago
sc-tab-group.entry.js
1 year ago
sc-tab-group.entry.js.map
1 year ago
sc-tab-panel.entry.js
1 year ago
sc-tab-panel.entry.js.map
1 year ago
sc-tab.entry.js
1 year ago
sc-tab.entry.js.map
1 year ago
sc-table-head.entry.js
1 year ago
sc-table-head.entry.js.map
1 year ago
sc-table_3.entry.js
1 year ago
sc-table_3.entry.js.map
1 year ago
sc-tag.entry.js
1 year ago
sc-tag.entry.js.map
1 year ago
sc-toggle.entry.js
1 year ago
sc-toggle.entry.js.map
1 year ago
sc-toggles.entry.js
1 year ago
sc-toggles.entry.js.map
1 year ago
sc-total.entry.js
1 year ago
sc-total.entry.js.map
1 year ago
sc-upcoming-invoice.entry.js
1 year ago
sc-upcoming-invoice.entry.js.map
1 year ago
sc-upgrade-required.entry.js
1 year ago
sc-upgrade-required.entry.js.map
1 year ago
sc-upsell-countdown-timer.entry.js
1 year ago
sc-upsell-countdown-timer.entry.js.map
1 year ago
sc-upsell-no-thanks-button.entry.js
1 year ago
sc-upsell-no-thanks-button.entry.js.map
1 year ago
sc-upsell-submit-button.entry.js
1 year ago
sc-upsell-submit-button.entry.js.map
1 year ago
sc-upsell-totals.entry.js
1 year ago
sc-upsell-totals.entry.js.map
1 year ago
sc-upsell.entry.js
1 year ago
sc-upsell.entry.js.map
1 year ago
sc-visually-hidden.entry.js
1 year ago
sc-visually-hidden.entry.js.map
1 year ago
sc-wordpress-password-edit.entry.js
1 year ago
sc-wordpress-password-edit.entry.js.map
1 year ago
sc-wordpress-user-edit.entry.js
1 year ago
sc-wordpress-user-edit.entry.js.map
1 year ago
sc-wordpress-user.entry.js
1 year ago
sc-wordpress-user.entry.js.map
1 year ago
store-7020541e.js
1 year ago
store-7020541e.js.map
1 year ago
store-a8bae355.js
1 year ago
store-a8bae355.js.map
1 year ago
store-dcefd119.js
1 year ago
store-dcefd119.js.map
1 year ago
surecart.js
1 year ago
surecart.js.map
1 year ago
tax-d4911dbc.js
1 year ago
tax-d4911dbc.js.map
1 year ago
universe-5a73abb7.js
1 year ago
universe-5a73abb7.js.map
1 year ago
util-50af2a83.js
1 year ago
util-50af2a83.js.map
1 year ago
utils-e9ee502a.js
1 year ago
utils-e9ee502a.js.map
1 year ago
watchers-38693c1f.js
1 year ago
watchers-38693c1f.js.map
1 year ago
watchers-46ca00a4.js
1 year ago
watchers-46ca00a4.js.map
1 year ago
watchers-67501779.js
1 year ago
watchers-67501779.js.map
1 year ago
watchers-94c3ca47.js
1 year ago
watchers-94c3ca47.js.map
1 year ago
watchers-bbcb6e4d.js
1 year ago
watchers-bbcb6e4d.js.map
1 year ago
sc-address_3.entry.js
347 lines
| 1 | import { r as registerInstance, c as createEvent, h, a as getElement, F as Fragment } from './index-745b6bec.js'; |
| 2 | import { c as countryChoices, a as hasPostal, b as hasCity, h as hasState } from './address-b892540d.js'; |
| 3 | import { r as reportChildrenValidity, F as FormSubmitController } from './form-data-76641f16.js'; |
| 4 | import { i as isRtl } from './page-align-0cdacf32.js'; |
| 5 | import { s as speak } from './index-c5a96d53.js'; |
| 6 | import { z as zones } from './tax-d4911dbc.js'; |
| 7 | |
| 8 | const scAddressCss = ":host{display:block}.sc-address{display:block;position:relative}.sc-address [hidden]{display:none}.sc-address--loading{min-height:230px}.sc-address sc-skeleton{display:block;margin-bottom:1em}.sc-address__control{display:block}.sc-address__control>*{margin-bottom:var(--sc-address-column-spacing, -1px)}.sc-address__columns{display:flex;flex-direction:row;align-items:center;flex-wrap:wrap;justify-content:space-between}.sc-address__columns>*{flex:1;width:50%;margin-right:var(--sc-address-column-spacing, -1px)}.sc-address__columns>*:last-child{margin-right:0}"; |
| 9 | const ScAddressStyle0 = scAddressCss; |
| 10 | |
| 11 | const ScAddress = class { |
| 12 | constructor(hostRef) { |
| 13 | registerInstance(this, hostRef); |
| 14 | this.scChangeAddress = createEvent(this, "scChangeAddress", 7); |
| 15 | this.scInputAddress = createEvent(this, "scInputAddress", 7); |
| 16 | this.address = { |
| 17 | country: null, |
| 18 | city: null, |
| 19 | line_1: null, |
| 20 | line_2: null, |
| 21 | postal_code: null, |
| 22 | state: null, |
| 23 | }; |
| 24 | this.names = { |
| 25 | name: 'shipping_name', |
| 26 | country: 'shipping_country', |
| 27 | city: 'shipping_city', |
| 28 | line_1: 'shipping_line_1', |
| 29 | line_2: 'shipping_line_2', |
| 30 | postal_code: 'shipping_postal_code', |
| 31 | state: 'shipping_state', |
| 32 | }; |
| 33 | this.placeholders = {}; |
| 34 | this.loading = false; |
| 35 | this.disabled = undefined; |
| 36 | this.label = undefined; |
| 37 | this.showName = undefined; |
| 38 | this.showLine2 = undefined; |
| 39 | this.required = false; |
| 40 | this.requireName = false; |
| 41 | this.showCity = true; |
| 42 | this.showPostal = true; |
| 43 | this.regions = undefined; |
| 44 | this.countryChoices = countryChoices; |
| 45 | } |
| 46 | /** When the state changes, we want to update city and postal fields. */ |
| 47 | handleAddressChange() { |
| 48 | var _a; |
| 49 | if (!((_a = this.address) === null || _a === void 0 ? void 0 : _a.country)) |
| 50 | return; |
| 51 | this.setRegions(); |
| 52 | this.showPostal = hasPostal(this.address.country); |
| 53 | this.showCity = hasCity(this.address.country); |
| 54 | this.scChangeAddress.emit(this.address); |
| 55 | this.scInputAddress.emit(this.address); |
| 56 | } |
| 57 | handleNameChange() { |
| 58 | if (this.requireName) { |
| 59 | this.showName = true; |
| 60 | } |
| 61 | } |
| 62 | decodeHtmlEntities(html) { |
| 63 | var _a; |
| 64 | return ((_a = new DOMParser().parseFromString(html, 'text/html')) === null || _a === void 0 ? void 0 : _a.body.textContent) || html; |
| 65 | } |
| 66 | updateAddress(address) { |
| 67 | this.address = { ...this.address, ...address }; |
| 68 | } |
| 69 | handleAddressInput(address) { |
| 70 | this.scInputAddress.emit({ ...this.address, ...address }); |
| 71 | } |
| 72 | clearAddress() { |
| 73 | var _a; |
| 74 | this.address = { |
| 75 | name: (_a = this.address) === null || _a === void 0 ? void 0 : _a.name, |
| 76 | country: null, |
| 77 | city: null, |
| 78 | line_1: null, |
| 79 | line_2: null, |
| 80 | postal_code: null, |
| 81 | state: null, |
| 82 | }; |
| 83 | } |
| 84 | /** Set the regions based on the country. */ |
| 85 | setRegions() { |
| 86 | var _a; |
| 87 | if (hasState((_a = this.address) === null || _a === void 0 ? void 0 : _a.country)) { |
| 88 | import('./countries-c2f41f03.js').then(module => { |
| 89 | const countryRegions = module === null || module === void 0 ? void 0 : module[this.address.country]; |
| 90 | this.regions = (countryRegions || []).map(region => ({ |
| 91 | ...region, |
| 92 | label: this.decodeHtmlEntities(region.label), |
| 93 | })); |
| 94 | }); |
| 95 | } |
| 96 | else { |
| 97 | this.regions = []; |
| 98 | } |
| 99 | } |
| 100 | componentWillLoad() { |
| 101 | var _a; |
| 102 | this.handleAddressChange(); |
| 103 | const country = ((_a = this.countryChoices.find(country => { var _a; return country.value === ((_a = this.address) === null || _a === void 0 ? void 0 : _a.country); })) === null || _a === void 0 ? void 0 : _a.value) || null; |
| 104 | this.updateAddress({ country }); |
| 105 | this.handleNameChange(); |
| 106 | } |
| 107 | async reportValidity() { |
| 108 | return reportChildrenValidity(this.el); |
| 109 | } |
| 110 | render() { |
| 111 | var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w; |
| 112 | return (h("div", { key: 'c4cc88711c39da2b53478ac131ccbd07d10ed435', class: "sc-address", part: "base" }, h("sc-form-control", { key: 'f26c49e9871e71b46ec8a3ae735a0031e1d87abe', label: this.label, exportparts: "label, help-text, form-control", class: "sc-address__control", required: this.required }, this.showName && (h("sc-input", { key: '1a0e9a5d856408b7fde4d29ce76369c0dd69c6cb', exportparts: "base:input__base, input, form-control, label, help-text", value: (_a = this === null || this === void 0 ? void 0 : this.address) === null || _a === void 0 ? void 0 : _a.name, onScChange: (e) => this.updateAddress({ name: e.target.value || null }), onScInput: (e) => this.handleAddressInput({ name: e.target.value || null }), autocomplete: "street-address", placeholder: this.placeholders.name || wp.i18n.__('Name or Company Name', 'surecart'), name: (_b = this.names) === null || _b === void 0 ? void 0 : _b.name, "squared-bottom": true, disabled: this.disabled, required: this.requireName, "aria-label": this.placeholders.name || wp.i18n.__('Name or Company Name', 'surecart') })), h("sc-select", { key: '4b6ac2cbf2e6fd2b6685cb51d588b6e4ec3acb29', exportparts: "base:select__base, input, form-control, label, help-text, trigger, panel, caret, search__base, search__input, search__form-control, menu__base, spinner__base, empty", part: "name__input", value: (_c = this.address) === null || _c === void 0 ? void 0 : _c.country, onScChange: (e) => { |
| 113 | this.clearAddress(); |
| 114 | this.updateAddress({ country: e.target.value }); |
| 115 | }, choices: this.countryChoices, autocomplete: 'country-name', placeholder: this.placeholders.country || wp.i18n.__('Country', 'surecart'), name: (_d = this.names) === null || _d === void 0 ? void 0 : _d.country, search: true, unselect: false, "squared-bottom": true, squared: this.showName, disabled: this.disabled, required: this.required, "aria-label": this.placeholders.country || wp.i18n.__('Country', 'surecart') }), h("sc-input", { key: '03b155e8ec72c8b98567295c63f1590cf4153870', exportparts: "base:input__base, input, form-control, label, help-text", value: (_e = this === null || this === void 0 ? void 0 : this.address) === null || _e === void 0 ? void 0 : _e.line_1, onScChange: (e) => this.updateAddress({ line_1: e.target.value || null }), onScInput: (e) => this.handleAddressInput({ line_1: e.target.value || null }), autocomplete: "street-address", placeholder: this.placeholders.line_1 || wp.i18n.__('Address', 'surecart'), name: (_f = this.names) === null || _f === void 0 ? void 0 : _f.line_1, squared: true, disabled: this.disabled, required: this.required, "aria-label": this.placeholders.line_1 || wp.i18n.__('Address', 'surecart') }), (this.showLine2 || !!((_h = (_g = this === null || this === void 0 ? void 0 : this.address) === null || _g === void 0 ? void 0 : _g.line_2) === null || _h === void 0 ? void 0 : _h.length)) && (h("sc-input", { key: '7444074558b36b1b3893cee38590ffb91c94b53b', exportparts: "base:input__base, input, form-control, label, help-text", value: (_j = this === null || this === void 0 ? void 0 : this.address) === null || _j === void 0 ? void 0 : _j.line_2, onScChange: (e) => this.updateAddress({ line_2: e.target.value || null }), onScInput: (e) => this.handleAddressInput({ line_2: e.target.value || null }), autocomplete: "street-address", placeholder: this.placeholders.line_2 || wp.i18n.__('Address Line 2', 'surecart'), name: (_k = this.names) === null || _k === void 0 ? void 0 : _k.line_2, squared: true, disabled: this.disabled, "aria-label": this.placeholders.line_2 || wp.i18n.__('Address Line 2', 'surecart') })), h("div", { key: '9e2255025ea7ed75b421d2b4b5f5230ed17c9eba', class: "sc-address__columns", part: "columns" }, this.showCity && (h("sc-input", { key: '1d47f55fa93010ad3ab893cb398482faf83de5cb', exportparts: "base:input__base, input, form-control, label, help-text", placeholder: this.placeholders.city || wp.i18n.__('City', 'surecart'), name: (_l = this.names) === null || _l === void 0 ? void 0 : _l.city, value: (_m = this === null || this === void 0 ? void 0 : this.address) === null || _m === void 0 ? void 0 : _m.city, onScChange: (e) => this.updateAddress({ city: e.target.value || null }), onScInput: (e) => this.handleAddressInput({ city: e.target.value || null }), required: this.required, squared: !!((_o = this === null || this === void 0 ? void 0 : this.regions) === null || _o === void 0 ? void 0 : _o.length), "squared-top": true, disabled: this.disabled, "squared-right": this.showPostal, "aria-label": this.placeholders.city || wp.i18n.__('City', 'surecart') })), this.showPostal && (h("sc-input", { key: '35614cee2c4aa9b872b595e441144dbeb172f3e2', exportparts: "base:input__base, input, form-control, label, help-text", placeholder: this.placeholders.postal_code || wp.i18n.__('Postal Code/Zip', 'surecart'), name: (_p = this.names) === null || _p === void 0 ? void 0 : _p.postal_code, onScChange: (e) => this.updateAddress({ postal_code: e.target.value || null }), onScInput: (e) => this.handleAddressInput({ postal_code: e.target.value || null }), autocomplete: 'postal-code', required: this.required, value: (_q = this === null || this === void 0 ? void 0 : this.address) === null || _q === void 0 ? void 0 : _q.postal_code, squared: !!((_r = this === null || this === void 0 ? void 0 : this.regions) === null || _r === void 0 ? void 0 : _r.length), "squared-top": true, disabled: this.disabled, maxlength: ((_s = this.address) === null || _s === void 0 ? void 0 : _s.country) === 'US' ? 5 : null, "squared-left": this.showCity, "aria-label": this.placeholders.postal_code || wp.i18n.__('Postal Code/Zip', 'surecart') }))), !!((_t = this === null || this === void 0 ? void 0 : this.regions) === null || _t === void 0 ? void 0 : _t.length) && !!((_u = this === null || this === void 0 ? void 0 : this.address) === null || _u === void 0 ? void 0 : _u.country) && (h("sc-select", { key: '0cec51536bd3f1dc513779b642aeb12a8649f402', exportparts: "base:select__base, input, form-control, label, help-text, trigger, panel, caret, search__base, search__input, search__form-control, menu__base, spinner__base, empty", placeholder: this.placeholders.state || wp.i18n.__('State/Province/Region', 'surecart'), name: (_v = this.names) === null || _v === void 0 ? void 0 : _v.state, autocomplete: 'address-level1', value: (_w = this === null || this === void 0 ? void 0 : this.address) === null || _w === void 0 ? void 0 : _w.state, onScChange: (e) => { var _a; return this.updateAddress({ state: e.target.value || ((_a = e.detail) === null || _a === void 0 ? void 0 : _a.value) || null }); }, choices: this.regions, required: this.required, disabled: this.disabled, search: true, "squared-top": true, "aria-label": this.placeholders.state || wp.i18n.__('State/Province/Region', 'surecart') }))), this.loading && h("sc-block-ui", { key: '23976b1484d604a1b3f60f11708fe2b466060b9d', exportparts: "base:block-ui, content:block-ui__content" }))); |
| 116 | } |
| 117 | get el() { return getElement(this); } |
| 118 | static get watchers() { return { |
| 119 | "address": ["handleAddressChange"], |
| 120 | "requireName": ["handleNameChange"] |
| 121 | }; } |
| 122 | }; |
| 123 | ScAddress.style = ScAddressStyle0; |
| 124 | |
| 125 | const scCheckboxCss = ":host{display:block}.checkbox{display:flex;font-family:var(--sc-input-font-family);font-size:var(--sc-input-font-size-medium);font-weight:var(--sc-input-font-weight);color:var(--sc-input-color);vertical-align:middle;cursor:pointer}.checkbox__control{flex:0 0 auto;position:relative;display:inline-flex;align-items:center;justify-content:center;width:var(--sc-checkbox-size);height:var(--sc-checkbox-size);border:solid var(--sc-input-border-width) var(--sc-input-border-color);border-radius:2px;background-color:var(--sc-input-background-color);color:var(--sc-color-white);transition:var(--sc-input-transition, var(--sc-transition-medium)) border-color, var(--sc-input-transition, var(--sc-transition-medium)) opacity, var(--sc-input-transition, var(--sc-transition-medium)) background-color, var(--sc-input-transition, var(--sc-transition-medium)) color, var(--sc-input-transition, var(--sc-transition-medium)) box-shadow}.checkbox__control input[type=checkbox]{position:absolute;opacity:0;padding:0;margin:0;pointer-events:none}.checkbox__control .checkbox__icon{display:inline-flex;width:var(--sc-checkbox-size);height:var(--sc-checkbox-size)}.checkbox__control .checkbox__icon svg{width:100%;height:100%}.checkbox:not(.checkbox--checked):not(.checkbox--disabled) .checkbox__control:hover{border-color:var(--sc-input-border-color-hover);background-color:var(--sc-input-background-color-hover)}.checkbox.checkbox--focused:not(.checkbox--checked):not(.checkbox--disabled) .checkbox__control{border-color:var(--sc-input-border-color-focus);background-color:var(--sc-input-background-color-focus);box-shadow:0 0 0 var(--sc-focus-ring-width) var(--sc-focus-ring-color-primary)}.checkbox--checked .checkbox__control,.checkbox--indeterminate .checkbox__control{border-color:var(--sc-color-primary-500);background-color:var(--sc-color-primary-500)}.checkbox.checkbox--checked:not(.checkbox--disabled) .checkbox__control:hover,.checkbox.checkbox--indeterminate:not(.checkbox--disabled) .checkbox__control:hover{opacity:0.8}.checkbox.checkbox--checked:not(.checkbox--disabled).checkbox--focused .checkbox__control,.checkbox.checkbox--indeterminate:not(.checkbox--disabled).checkbox--focused .checkbox__control{border-color:var(--sc-color-white);background-color:var(--sc-color-primary-500);box-shadow:0 0 0 var(--sc-focus-ring-width) var(--sc-focus-ring-color-primary)}.checkbox--disabled{opacity:0.5;cursor:not-allowed}.checkbox__label{line-height:var(--sc-checkbox-size);margin-top:var(--sc-input-border-width);margin-left:0.5em;flex:1}.checkbox--is-required .checkbox__label:after{content:\" *\";color:var(--sc-color-danger-500)}::slotted(*){display:inline-block}.checkbox--is-rtl .checkbox__label{margin-left:0;margin-right:0.5em}"; |
| 126 | const ScCheckboxStyle0 = scCheckboxCss; |
| 127 | |
| 128 | let id = 0; |
| 129 | const ScCheckbox = class { |
| 130 | constructor(hostRef) { |
| 131 | registerInstance(this, hostRef); |
| 132 | this.scBlur = createEvent(this, "scBlur", 7); |
| 133 | this.scChange = createEvent(this, "scChange", 7); |
| 134 | this.scFocus = createEvent(this, "scFocus", 7); |
| 135 | this.inputId = `checkbox-${++id}`; |
| 136 | this.labelId = `checkbox-label-${id}`; |
| 137 | this.hasFocus = false; |
| 138 | this.name = undefined; |
| 139 | this.value = undefined; |
| 140 | this.disabled = false; |
| 141 | this.edit = false; |
| 142 | this.required = false; |
| 143 | this.checked = false; |
| 144 | this.indeterminate = false; |
| 145 | this.invalid = false; |
| 146 | } |
| 147 | firstUpdated() { |
| 148 | this.input.indeterminate = this.indeterminate; |
| 149 | } |
| 150 | /** Simulates a click on the checkbox. */ |
| 151 | async triggerClick() { |
| 152 | return this.input.click(); |
| 153 | } |
| 154 | /** Sets focus on the checkbox. */ |
| 155 | async triggerFocus(options) { |
| 156 | return this.input.focus(options); |
| 157 | } |
| 158 | /** Removes focus from the checkbox. */ |
| 159 | async triggerBlur() { |
| 160 | return this.input.blur(); |
| 161 | } |
| 162 | /** Checks for validity and shows the browser's validation message if the control is invalid. */ |
| 163 | async reportValidity() { |
| 164 | this.invalid = !this.input.checkValidity(); |
| 165 | return this.input.reportValidity(); |
| 166 | } |
| 167 | /** Sets a custom validation message. If `message` is not empty, the field will be considered invalid. */ |
| 168 | setCustomValidity(message) { |
| 169 | this.input.setCustomValidity(message); |
| 170 | this.invalid = !this.input.checkValidity(); |
| 171 | } |
| 172 | handleClick() { |
| 173 | this.checked = !this.checked; |
| 174 | this.indeterminate = false; |
| 175 | } |
| 176 | handleBlur() { |
| 177 | this.hasFocus = false; |
| 178 | this.scBlur.emit(); |
| 179 | } |
| 180 | handleFocus() { |
| 181 | this.hasFocus = true; |
| 182 | this.scFocus.emit(); |
| 183 | } |
| 184 | handleLabelMouseDown() { |
| 185 | // Prevent clicks on the label from briefly blurring the input |
| 186 | // event.preventDefault(); |
| 187 | this.input.focus(); |
| 188 | } |
| 189 | handleStateChange() { |
| 190 | this.input.checked = this.checked; |
| 191 | this.input.indeterminate = this.indeterminate; |
| 192 | this.scChange.emit(); |
| 193 | } |
| 194 | componentDidLoad() { |
| 195 | this.formController = new FormSubmitController(this.el, { |
| 196 | value: (control) => (control.checked ? control.value : undefined), |
| 197 | }).addFormData(); |
| 198 | } |
| 199 | disconnectedCallback() { |
| 200 | var _a; |
| 201 | (_a = this.formController) === null || _a === void 0 ? void 0 : _a.removeFormData(); |
| 202 | } |
| 203 | render() { |
| 204 | const Tag = this.edit ? 'div' : 'label'; |
| 205 | return (h(Tag, { key: '6a16539beb550f366475bd3ab140438b8a8384d0', part: "base", class: { |
| 206 | 'checkbox': true, |
| 207 | 'checkbox--is-required': this.required, |
| 208 | 'checkbox--checked': this.checked, |
| 209 | 'checkbox--disabled': this.disabled, |
| 210 | 'checkbox--focused': this.hasFocus, |
| 211 | 'checkbox--indeterminate': this.indeterminate, |
| 212 | 'checkbox--is-rtl': isRtl() |
| 213 | }, htmlFor: this.inputId, onMouseDown: () => this.handleLabelMouseDown() }, h("span", { key: 'ceb6c46a5195eda73b437a808e719b89e1f2a23d', part: "control", class: "checkbox__control" }, this.checked ? (h("span", { part: "checked-icon", class: "checkbox__icon" }, h("svg", { viewBox: "0 0 16 16" }, h("g", { stroke: "none", "stroke-width": "1", fill: "none", "fill-rule": "evenodd", "stroke-linecap": "round" }, h("g", { stroke: "currentColor", "stroke-width": "2" }, h("g", { transform: "translate(3.428571, 3.428571)" }, h("path", { d: "M0,5.71428571 L3.42857143,9.14285714" }), h("path", { d: "M9.14285714,0 L3.42857143,9.14285714" }))))))) : (''), !this.checked && this.indeterminate ? (h("span", { part: "indeterminate-icon", class: "checkbox__icon" }, h("svg", { viewBox: "0 0 16 16" }, h("g", { stroke: "none", "stroke-width": "1", fill: "none", "fill-rule": "evenodd", "stroke-linecap": "round" }, h("g", { stroke: "currentColor", "stroke-width": "2" }, h("g", { transform: "translate(2.285714, 6.857143)" }, h("path", { d: "M10.2857143,1.14285714 L1.14285714,1.14285714" }))))))) : (''), h("input", { key: '0c478b8b894d3348ebe6fa8c734e9dc150af7ecf', id: this.inputId, ref: el => (this.input = el), type: "checkbox", name: this.name, value: this.value, checked: this.checked, disabled: this.disabled, required: this.required, role: "checkbox", "aria-checked": this.checked ? 'true' : 'false', "aria-labelledby": this.labelId, onClick: () => this.handleClick(), onBlur: () => this.handleBlur(), onFocus: () => this.handleFocus() })), h("span", { key: '8022bc817ef90e208573f9ca401430f17adab5b0', part: "label", id: this.labelId, class: "checkbox__label" }, h("slot", { key: '31f13bf319f5555afeab25215ad500214b28265d' })))); |
| 214 | } |
| 215 | get el() { return getElement(this); } |
| 216 | static get watchers() { return { |
| 217 | "checked": ["handleStateChange"], |
| 218 | "indeterminate": ["handleStateChange"] |
| 219 | }; } |
| 220 | }; |
| 221 | ScCheckbox.style = ScCheckboxStyle0; |
| 222 | |
| 223 | const scTaxIdInputCss = ":host{display:block;z-index:3;position:relative}"; |
| 224 | const ScTaxIdInputStyle0 = scTaxIdInputCss; |
| 225 | |
| 226 | const ScTaxIdInput = class { |
| 227 | constructor(hostRef) { |
| 228 | registerInstance(this, hostRef); |
| 229 | this.scChange = createEvent(this, "scChange", 7); |
| 230 | this.scInput = createEvent(this, "scInput", 7); |
| 231 | this.scInputType = createEvent(this, "scInputType", 7); |
| 232 | this.scSetState = createEvent(this, "scSetState", 7); |
| 233 | this.country = undefined; |
| 234 | this.show = false; |
| 235 | this.type = 'other'; |
| 236 | this.number = null; |
| 237 | this.status = 'unknown'; |
| 238 | this.loading = undefined; |
| 239 | this.help = undefined; |
| 240 | this.otherLabel = wp.i18n.__('Tax ID', 'surecart'); |
| 241 | this.caGstLabel = wp.i18n.__('GST Number', 'surecart'); |
| 242 | this.auAbnLabel = wp.i18n.__('ABN Number', 'surecart'); |
| 243 | this.gbVatLabel = wp.i18n.__('UK VAT', 'surecart'); |
| 244 | this.euVatLabel = wp.i18n.__('EU VAT', 'surecart'); |
| 245 | this.taxIdTypes = []; |
| 246 | this.required = false; |
| 247 | } |
| 248 | async reportValidity() { |
| 249 | return this.input.reportValidity(); |
| 250 | } |
| 251 | onLabelChange() { |
| 252 | zones.ca_gst.label = this.caGstLabel || zones.ca_gst.label; |
| 253 | zones.au_abn.label = this.auAbnLabel || zones.au_abn.label; |
| 254 | zones.gb_vat.label = this.gbVatLabel || zones.gb_vat.label; |
| 255 | zones.eu_vat.label = this.euVatLabel || zones.eu_vat.label; |
| 256 | zones.other.label = this.otherLabel || zones.other.label; |
| 257 | } |
| 258 | componentWillLoad() { |
| 259 | this.onLabelChange(); |
| 260 | } |
| 261 | renderStatus() { |
| 262 | if (this.status === 'valid') { |
| 263 | return h("sc-icon", { name: "check", slot: "prefix", style: { color: 'var(--sc-color-success-500)' } }); |
| 264 | } |
| 265 | if (this.status === 'invalid') { |
| 266 | return h("sc-icon", { name: "x", slot: "prefix", style: { color: 'var(--sc-color-danger-500)' } }); |
| 267 | } |
| 268 | } |
| 269 | filteredZones() { |
| 270 | if (!!this.taxIdTypes.length) { |
| 271 | return Object.keys(zones) |
| 272 | .filter(name => this.taxIdTypes.includes(name)) |
| 273 | .reduce((obj, key) => { |
| 274 | obj[key] = zones[key]; |
| 275 | return obj; |
| 276 | }, {}); |
| 277 | } |
| 278 | return zones; |
| 279 | } |
| 280 | onTaxIdTypesChange() { |
| 281 | // If there is no other type, set the first one as default type. |
| 282 | if (!!this.taxIdTypes.length) { |
| 283 | this.type = !this.taxIdTypes.includes('other') ? this.taxIdTypes[0] : 'other'; |
| 284 | } |
| 285 | } |
| 286 | getZoneLabel() { |
| 287 | var _a, _b; |
| 288 | const filteredZones = this.filteredZones() || {}; |
| 289 | // Get the label of the current type or the other type. |
| 290 | // If there is no other type, get the first one. |
| 291 | return ((_a = filteredZones === null || filteredZones === void 0 ? void 0 : filteredZones[(this === null || this === void 0 ? void 0 : this.type) || 'other']) === null || _a === void 0 ? void 0 : _a.label) || ((_b = filteredZones === null || filteredZones === void 0 ? void 0 : filteredZones[Object.keys(filteredZones)[0]]) === null || _b === void 0 ? void 0 : _b.label); |
| 292 | } |
| 293 | render() { |
| 294 | var _a, _b, _c, _d, _e; |
| 295 | return (h(Fragment, { key: '263bb29a9c0f49ee3759c324c720290454fb8f8c' }, h("sc-input", { key: '573b2c665f5e138b313d8b26ca76f489f1fb4f5c', name: "tax_identifier.number_type", required: this.required, value: this.type, style: { display: 'none' } }), h("sc-input", { key: 'bfa2ec0af71d78cb716b39ccf4bad642026df1c9', ref: el => (this.input = el), label: this.getZoneLabel(), "aria-label": wp.i18n.__('Tax ID', 'surecart'), placeholder: wp.i18n.__('Enter Tax ID', 'surecart'), name: "tax_identifier.number", value: this.number, onScInput: (e) => { |
| 296 | e.stopImmediatePropagation(); |
| 297 | this.scInput.emit({ |
| 298 | number: e.target.value, |
| 299 | number_type: this.type || 'other', |
| 300 | }); |
| 301 | }, onScChange: (e) => { |
| 302 | e.stopImmediatePropagation(); |
| 303 | this.scChange.emit({ |
| 304 | number: e.target.value, |
| 305 | number_type: this.type || 'other', |
| 306 | }); |
| 307 | }, help: this.help, required: this.required }, this.loading && this.type === 'eu_vat' ? h("sc-spinner", { slot: "prefix", style: { '--spinner-size': '10px' } }) : this.renderStatus(), ((_a = Object.keys(this.filteredZones() || {})) === null || _a === void 0 ? void 0 : _a.length) === 1 ? (h("span", { slot: "suffix" }, (_c = (_b = Object.values(this.filteredZones() || {})) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c['label_small'])) : (h("sc-dropdown", { slot: "suffix", position: "bottom-right", role: "select", "aria-multiselectable": "false", "aria-label": wp.i18n.__('Select number type', 'surecart') }, h("sc-button", { type: "text", slot: "trigger", caret: true, loading: false, style: { color: 'var(--sc-input-label-color)' }, tabindex: "0" }, (_e = (_d = this.filteredZones()) === null || _d === void 0 ? void 0 : _d[(this === null || this === void 0 ? void 0 : this.type) || 'other']) === null || _e === void 0 ? void 0 : _e.label_small), h("sc-menu", null, Object.keys(this.filteredZones() || {}).map(name => (h("sc-menu-item", { role: "option", onClick: () => { |
| 308 | this.scInput.emit({ |
| 309 | number: this.number, |
| 310 | number_type: name, |
| 311 | }); |
| 312 | this.scChange.emit({ |
| 313 | number: this.number, |
| 314 | number_type: name, |
| 315 | }); |
| 316 | this.type = name; |
| 317 | }, onKeyDown: e => { |
| 318 | var _a; |
| 319 | if (e.key === 'Enter') { |
| 320 | this.scInput.emit({ |
| 321 | number: this.number, |
| 322 | number_type: name, |
| 323 | }); |
| 324 | this.scChange.emit({ |
| 325 | number: this.number, |
| 326 | number_type: name, |
| 327 | }); |
| 328 | this.type = name; |
| 329 | (_a = this.input) === null || _a === void 0 ? void 0 : _a.triggerFocus(); |
| 330 | speak(wp.i18n.sprintf(wp.i18n.__('%s selected', 'surecart'), zones[name].label_small, 'assertive')); |
| 331 | } |
| 332 | }, checked: this.type === name, "aria-selected": this.type === name ? 'true' : 'false', "aria-label": zones[name].label_small }, zones[name].label_small))))))))); |
| 333 | } |
| 334 | static get watchers() { return { |
| 335 | "otherLabel": ["onLabelChange"], |
| 336 | "caGstLabel": ["onLabelChange"], |
| 337 | "auAbnLabel": ["onLabelChange"], |
| 338 | "gbVatLabel": ["onLabelChange"], |
| 339 | "euVatLabel": ["onLabelChange"], |
| 340 | "taxIdTypes": ["onTaxIdTypesChange"] |
| 341 | }; } |
| 342 | }; |
| 343 | ScTaxIdInput.style = ScTaxIdInputStyle0; |
| 344 | |
| 345 | export { ScAddress as sc_address, ScCheckbox as sc_checkbox, ScTaxIdInput as sc_tax_id_input }; |
| 346 | |
| 347 | //# sourceMappingURL=sc-address_3.entry.js.map |