MockProcessor-ad11752f.js
2 months ago
MockProcessor-ad11752f.js.map
2 months ago
add-query-args-49dcb630.js
1 year ago
add-query-args-49dcb630.js.map
1 year ago
address-7404695f.js
4 months ago
address-7404695f.js.map
4 months ago
animation-registry-b597d2f4.js
3 months ago
animation-registry-b597d2f4.js.map
3 months ago
app-globals-464bf4c9.js
2 months ago
app-globals-464bf4c9.js.map
2 months ago
consumer-b58230e6.js
2 months ago
consumer-b58230e6.js.map
2 months ago
currency-71fce0f0.js
1 year ago
currency-71fce0f0.js.map
1 year ago
error-03c29608.js
1 month ago
error-03c29608.js.map
1 month ago
fetch-5e8dc1d5.js
1 month ago
fetch-5e8dc1d5.js.map
1 month ago
floating-ui.dom.esm-7fad5c49.js
6 months ago
floating-ui.dom.esm-7fad5c49.js.map
6 months ago
form-data-0da9940f.js
1 year ago
form-data-0da9940f.js.map
1 year ago
functions-033a6a55.js
3 months ago
functions-033a6a55.js.map
3 months ago
geo-permission-8128c254.js
1 month ago
geo-permission-8128c254.js.map
1 month ago
getters-6818073e.js
1 month ago
getters-6818073e.js.map
1 month ago
getters-68a0d178.js
2 months ago
getters-68a0d178.js.map
2 months ago
getters-a7cb114b.js
1 month ago
getters-a7cb114b.js.map
1 month ago
getters-bc65a40b.js
2 months ago
getters-bc65a40b.js.map
2 months ago
getters-d68c08ed.js
2 months ago
getters-d68c08ed.js.map
2 months ago
google-59d23803.js
1 year ago
google-59d23803.js.map
1 year ago
google-c1098cb3.js
1 month ago
google-c1098cb3.js.map
1 month ago
google-maps-0f9b7648.js
3 months ago
google-maps-0f9b7648.js.map
3 months ago
index-7ced8198.js
2 months ago
index-7ced8198.js.map
2 months ago
index-92023a2d.js
1 month ago
index-92023a2d.js.map
1 month ago
index-a4a4f390.js
1 month ago
index-a4a4f390.js.map
1 month ago
index-adacfa36.js
1 year ago
index-adacfa36.js.map
1 year ago
index-be4abba1.js
2 months ago
index-be4abba1.js.map
2 months ago
index-c3de642f.js
2 months ago
index-c3de642f.js.map
2 months ago
index-f3933112.js
1 month ago
index-f3933112.js.map
1 month ago
index-fb76df07.js
2 years ago
index-fb76df07.js.map
2 years ago
index.cjs.js
1 month ago
index.cjs.js.map
1 month ago
inline-aa15f113.js
1 year ago
inline-aa15f113.js.map
1 year ago
lazy-2b509fa7.js
1 year ago
lazy-2b509fa7.js.map
1 year ago
library-08bc52a5.js
2 months ago
library-08bc52a5.js.map
2 months ago
loader.cjs.js
1 month ago
loader.cjs.js.map
1 year ago
media-43b85f3d.js
1 year ago
media-43b85f3d.js.map
1 year ago
mutations-06bf0ea4.js
1 month ago
mutations-06bf0ea4.js.map
1 month ago
mutations-927be23d.js
1 month ago
mutations-927be23d.js.map
1 month ago
mutations-c14cbdc4.js
1 month ago
mutations-c14cbdc4.js.map
1 month ago
mutations-d5d6ddf1.js
2 months ago
mutations-d5d6ddf1.js.map
2 months ago
page-align-5a2ab493.js
1 year ago
page-align-5a2ab493.js.map
1 year ago
price-da3cab3d.js
4 months ago
price-da3cab3d.js.map
4 months ago
pure-bd6f0a6e.js
1 year ago
pure-bd6f0a6e.js.map
1 year ago
quantity-aa458329.js
3 months ago
quantity-aa458329.js.map
3 months ago
razorpay-88fe8897.js
3 months ago
razorpay-88fe8897.js.map
3 months ago
remove-query-args-b57e8cd3.js
1 year ago
remove-query-args-b57e8cd3.js.map
1 year ago
sc-address_5.cjs.entry.js
1 month ago
sc-address_5.cjs.entry.js.map
3 months ago
sc-alert.cjs.entry.js
1 month ago
sc-alert.cjs.entry.js.map
1 year ago
sc-avatar_2.cjs.entry.js
1 month ago
sc-avatar_2.cjs.entry.js.map
1 month ago
sc-badge-notice.cjs.entry.js
1 month ago
sc-badge-notice.cjs.entry.js.map
1 year ago
sc-block-ui.cjs.entry.js
1 month ago
sc-block-ui.cjs.entry.js.map
5 months ago
sc-breadcrumb.cjs.entry.js
1 month ago
sc-breadcrumb.cjs.entry.js.map
1 year ago
sc-breadcrumbs.cjs.entry.js
1 month ago
sc-breadcrumbs.cjs.entry.js.map
1 year ago
sc-button-group.cjs.entry.js
1 month ago
sc-button-group.cjs.entry.js.map
1 year ago
sc-button_6.cjs.entry.js
1 month ago
sc-button_6.cjs.entry.js.map
1 month ago
sc-cancel-dialog_3.cjs.entry.js
1 month ago
sc-cancel-dialog_3.cjs.entry.js.map
1 month ago
sc-cancel-discount_4.cjs.entry.js
1 month ago
sc-cancel-discount_4.cjs.entry.js.map
2 months ago
sc-card_2.cjs.entry.js
1 month ago
sc-card_2.cjs.entry.js.map
4 months ago
sc-cart-button.cjs.entry.js
1 month ago
sc-cart-button.cjs.entry.js.map
1 year ago
sc-cart-form-submit.cjs.entry.js
2 months ago
sc-cart-form-submit.cjs.entry.js.map
1 year ago
sc-cart-form.cjs.entry.js
1 month ago
sc-cart-form.cjs.entry.js.map
1 month ago
sc-cart-header.cjs.entry.js
1 month ago
sc-cart-header.cjs.entry.js.map
1 year ago
sc-cart-icon.cjs.entry.js
1 month ago
sc-cart-icon.cjs.entry.js.map
1 year ago
sc-cart-loader.cjs.entry.js
1 month ago
sc-cart-loader.cjs.entry.js.map
1 year ago
sc-cart-session-provider_3.cjs.entry.js
1 month ago
sc-cart-session-provider_3.cjs.entry.js.map
2 months ago
sc-cart-submit.cjs.entry.js
2 months ago
sc-cart-submit.cjs.entry.js.map
1 year ago
sc-cart.cjs.entry.js
1 month ago
sc-cart.cjs.entry.js.map
2 months ago
sc-cc-logo_2.cjs.entry.js
1 month ago
sc-cc-logo_2.cjs.entry.js.map
1 month ago
sc-charges-list.cjs.entry.js
1 month ago
sc-charges-list.cjs.entry.js.map
2 months ago
sc-checkout-autofill-provider_11.cjs.entry.js
1 month ago
sc-checkout-autofill-provider_11.cjs.entry.js.map
1 month ago
sc-checkout-form-errors.cjs.entry.js
2 months ago
sc-checkout-form-errors.cjs.entry.js.map
1 year ago
sc-checkout-mollie-payment_3.cjs.entry.js
1 month ago
sc-checkout-mollie-payment_3.cjs.entry.js.map
2 months ago
sc-checkout-product-bundle-component-variants.cjs.entry.js
1 month ago
sc-checkout-product-bundle-component-variants.cjs.entry.js.map
1 month ago
sc-checkout-product-price-variant-selector.cjs.entry.js
4 weeks ago
sc-checkout-product-price-variant-selector.cjs.entry.js.map
4 weeks ago
sc-checkout.cjs.entry.js
1 month ago
sc-checkout.cjs.entry.js.map
1 month ago
sc-choice-container.cjs.entry.js
1 month ago
sc-choice-container.cjs.entry.js.map
1 year ago
sc-choice.cjs.entry.js
1 month ago
sc-choice.cjs.entry.js.map
1 year ago
sc-choices.cjs.entry.js
1 month ago
sc-choices.cjs.entry.js.map
1 year ago
sc-column_2.cjs.entry.js
1 month ago
sc-column_2.cjs.entry.js.map
1 month ago
sc-compact-address_18.cjs.entry.js
1 month ago
sc-compact-address_18.cjs.entry.js.map
1 month ago
sc-conditional-form.cjs.entry.js
1 month ago
sc-conditional-form.cjs.entry.js.map
2 months ago
sc-consumer.cjs.entry.js
2 months ago
sc-consumer.cjs.entry.js.map
1 year ago
sc-coupon-form.cjs.entry.js
1 month ago
sc-coupon-form.cjs.entry.js.map
5 months ago
sc-custom-order-price-input.cjs.entry.js
1 month ago
sc-custom-order-price-input.cjs.entry.js.map
2 months ago
sc-customer-details.cjs.entry.js
1 month ago
sc-customer-details.cjs.entry.js.map
7 months ago
sc-customer-edit.cjs.entry.js
1 month ago
sc-customer-edit.cjs.entry.js.map
2 months ago
sc-customer-email.cjs.entry.js
1 month ago
sc-customer-email.cjs.entry.js.map
1 month ago
sc-customer-firstname.cjs.entry.js
1 month ago
sc-customer-firstname.cjs.entry.js.map
2 months ago
sc-customer-lastname.cjs.entry.js
1 month ago
sc-customer-lastname.cjs.entry.js.map
2 months ago
sc-customer-name.cjs.entry.js
1 month ago
sc-customer-name.cjs.entry.js.map
2 months ago
sc-dashboard-customer-details.cjs.entry.js
1 month ago
sc-dashboard-customer-details.cjs.entry.js.map
2 months ago
sc-dashboard-downloads-list.cjs.entry.js
1 month ago
sc-dashboard-downloads-list.cjs.entry.js.map
2 months ago
sc-dialog.cjs.entry.js
1 month ago
sc-dialog.cjs.entry.js.map
5 months ago
sc-divider.cjs.entry.js
1 month ago
sc-divider.cjs.entry.js.map
1 year ago
sc-donation-choices.cjs.entry.js
2 months ago
sc-donation-choices.cjs.entry.js.map
1 year ago
sc-downloads-list.cjs.entry.js
1 month ago
sc-downloads-list.cjs.entry.js.map
1 month ago
sc-dropdown_3.cjs.entry.js
1 month ago
sc-dropdown_3.cjs.entry.js.map
6 months ago
sc-empty_3.cjs.entry.js
1 month ago
sc-empty_3.cjs.entry.js.map
4 months ago
sc-express-payment.cjs.entry.js
1 month ago
sc-express-payment.cjs.entry.js.map
3 months ago
sc-feature-demo-banner.cjs.entry.js
1 month ago
sc-feature-demo-banner.cjs.entry.js.map
1 year ago
sc-flex.cjs.entry.js
1 month ago
sc-flex.cjs.entry.js.map
1 year ago
sc-form-control_2.cjs.entry.js
1 month ago
sc-form-control_2.cjs.entry.js.map
2 months ago
sc-form-row.cjs.entry.js
1 month ago
sc-form-row.cjs.entry.js.map
1 year ago
sc-form.cjs.entry.js
1 month ago
sc-form.cjs.entry.js.map
1 year ago
sc-format-bytes.cjs.entry.js
2 months ago
sc-format-bytes.cjs.entry.js.map
1 year ago
sc-format-interval.cjs.entry.js
2 months ago
sc-format-interval.cjs.entry.js.map
1 year ago
sc-format-number.cjs.entry.js
2 months ago
sc-format-number.cjs.entry.js.map
1 year ago
sc-fulfillment-shipping-status-badge.cjs.entry.js
2 months ago
sc-fulfillment-shipping-status-badge.cjs.entry.js.map
4 months ago
sc-fulfillments.cjs.entry.js
1 month ago
sc-fulfillments.cjs.entry.js.map
2 months ago
sc-heading_2.cjs.entry.js
1 month ago
sc-heading_2.cjs.entry.js.map
1 year ago
sc-image-slider.cjs.entry.js
1 month ago
sc-image-slider.cjs.entry.js.map
1 month ago
sc-invoice-status-badge.cjs.entry.js
1 month ago
sc-invoice-status-badge.cjs.entry.js.map
4 months ago
sc-invoices-list.cjs.entry.js
1 month ago
sc-invoices-list.cjs.entry.js.map
2 months ago
sc-license.cjs.entry.js
1 month ago
sc-license.cjs.entry.js.map
2 months ago
sc-licenses-list.cjs.entry.js
1 month ago
sc-licenses-list.cjs.entry.js.map
1 month ago
sc-line-item-bump.cjs.entry.js
1 month ago
sc-line-item-bump.cjs.entry.js.map
1 year ago
sc-line-item-total.cjs.entry.js
1 month ago
sc-line-item-total.cjs.entry.js.map
6 months ago
sc-line-item.cjs.entry.js
1 month ago
sc-line-item.cjs.entry.js.map
1 year ago
sc-line-items-provider.cjs.entry.js
1 month ago
sc-line-items-provider.cjs.entry.js.map
1 year ago
sc-line-items.cjs.entry.js
1 month ago
sc-line-items.cjs.entry.js.map
1 month ago
sc-login-form.cjs.entry.js
1 month ago
sc-login-form.cjs.entry.js.map
2 months ago
sc-manual-payment-method_3.cjs.entry.js
1 month ago
sc-manual-payment-method_3.cjs.entry.js.map
3 months ago
sc-menu-divider.cjs.entry.js
1 month ago
sc-menu-divider.cjs.entry.js.map
1 year ago
sc-menu-label_2.cjs.entry.js
1 month ago
sc-menu-label_2.cjs.entry.js.map
1 month ago
sc-mollie-add-method.cjs.entry.js
1 month ago
sc-mollie-add-method.cjs.entry.js.map
2 months ago
sc-order-confirmation-customer.cjs.entry.js
2 months ago
sc-order-confirmation-customer.cjs.entry.js.map
1 year ago
sc-order-confirmation-details.cjs.entry.js
2 months ago
sc-order-confirmation-details.cjs.entry.js.map
11 months ago
sc-order-confirmation-line-items_2.cjs.entry.js
1 month ago
sc-order-confirmation-line-items_2.cjs.entry.js.map
1 month ago
sc-order-confirmation.cjs.entry.js
1 month ago
sc-order-confirmation.cjs.entry.js.map
2 months ago
sc-order-coupon-form.cjs.entry.js
1 month ago
sc-order-coupon-form.cjs.entry.js.map
2 months ago
sc-order-detail.cjs.entry.js
2 months ago
sc-order-detail.cjs.entry.js.map
1 year ago
sc-order-fulfillment-badge.cjs.entry.js
1 month ago
sc-order-fulfillment-badge.cjs.entry.js.map
4 months ago
sc-order-manual-instructions.cjs.entry.js
2 months ago
sc-order-manual-instructions.cjs.entry.js.map
1 year ago
sc-order-password.cjs.entry.js
2 months ago
sc-order-password.cjs.entry.js.map
1 year ago
sc-order-return-badge.cjs.entry.js
1 month ago
sc-order-return-badge.cjs.entry.js.map
4 months ago
sc-order-shipment-badge.cjs.entry.js
2 months ago
sc-order-shipment-badge.cjs.entry.js.map
4 months ago
sc-order-status-badge.cjs.entry.js
1 month ago
sc-order-status-badge.cjs.entry.js.map
4 months ago
sc-order-submit.cjs.entry.js
1 month ago
sc-order-submit.cjs.entry.js.map
2 months ago
sc-order-summary.cjs.entry.js
1 month ago
sc-order-summary.cjs.entry.js.map
1 month ago
sc-order.cjs.entry.js
1 month ago
sc-order.cjs.entry.js.map
1 month ago
sc-orders-list.cjs.entry.js
1 month ago
sc-orders-list.cjs.entry.js.map
1 month ago
sc-pagination.cjs.entry.js
2 months ago
sc-pagination.cjs.entry.js.map
1 year ago
sc-password-nag.cjs.entry.js
1 month ago
sc-password-nag.cjs.entry.js.map
2 months ago
sc-password.cjs.entry.js
1 month ago
sc-password.cjs.entry.js.map
1 month ago
sc-payment-method-choice_2.cjs.entry.js
1 month ago
sc-payment-method-choice_2.cjs.entry.js.map
1 year ago
sc-payment-method-details.cjs.entry.js
1 month ago
sc-payment-method-details.cjs.entry.js.map
1 year ago
sc-payment-methods-list.cjs.entry.js
1 month ago
sc-payment-methods-list.cjs.entry.js.map
2 months ago
sc-payment.cjs.entry.js
1 month ago
sc-payment.cjs.entry.js.map
3 months ago
sc-paypal-add-method.cjs.entry.js
1 month ago
sc-paypal-add-method.cjs.entry.js.map
2 months ago
sc-paypal-buttons_2.cjs.entry.js
1 month ago
sc-paypal-buttons_2.cjs.entry.js.map
2 months ago
sc-paystack-add-method.cjs.entry.js
1 month ago
sc-paystack-add-method.cjs.entry.js.map
2 months ago
sc-pill-option.cjs.entry.js
1 month ago
sc-pill-option.cjs.entry.js.map
1 year ago
sc-popover.cjs.entry.js
1 month ago
sc-popover.cjs.entry.js.map
6 months ago
sc-premium-tag.cjs.entry.js
1 month ago
sc-premium-tag.cjs.entry.js.map
1 year ago
sc-price-choice-container.cjs.entry.js
1 month ago
sc-price-choice-container.cjs.entry.js.map
1 month ago
sc-price-choice.cjs.entry.js
1 month ago
sc-price-choice.cjs.entry.js.map
2 months ago
sc-price-choices.cjs.entry.js
1 month ago
sc-price-choices.cjs.entry.js.map
1 year ago
sc-price-input.cjs.entry.js
1 month ago
sc-price-input.cjs.entry.js.map
1 year ago
sc-price-range_4.cjs.entry.js
1 month ago
sc-price-range_4.cjs.entry.js.map
1 year ago
sc-price.cjs.entry.js
2 months ago
sc-price.cjs.entry.js.map
11 months ago
sc-product-buy-button.cjs.entry.js
1 month ago
sc-product-buy-button.cjs.entry.js.map
2 months ago
sc-product-donation-amount-choice.cjs.entry.js
1 month ago
sc-product-donation-amount-choice.cjs.entry.js.map
2 months ago
sc-product-donation-choices.cjs.entry.js
1 month ago
sc-product-donation-choices.cjs.entry.js.map
2 months ago
sc-product-donation-custom-amount.cjs.entry.js
1 month ago
sc-product-donation-custom-amount.cjs.entry.js.map
2 months ago
sc-product-item-list.cjs.entry.js
1 month ago
sc-product-item-list.cjs.entry.js.map
2 months ago
sc-product-item.cjs.entry.js
1 month ago
sc-product-item.cjs.entry.js.map
1 year ago
sc-product-pills-variant-option.cjs.entry.js
1 month ago
sc-product-pills-variant-option.cjs.entry.js.map
1 year ago
sc-product-price-choices.cjs.entry.js
1 month ago
sc-product-price-choices.cjs.entry.js.map
1 year ago
sc-product-price-modal.cjs.entry.js
1 month ago
sc-product-price-modal.cjs.entry.js.map
2 months ago
sc-product-price.cjs.entry.js
1 month ago
sc-product-price.cjs.entry.js.map
2 months ago
sc-product-quantity.cjs.entry.js
1 month ago
sc-product-quantity.cjs.entry.js.map
1 year ago
sc-product-selected-price.cjs.entry.js
1 month ago
sc-product-selected-price.cjs.entry.js.map
2 months ago
sc-product-text.cjs.entry.js
1 month ago
sc-product-text.cjs.entry.js.map
1 year ago
sc-provider.cjs.entry.js
2 months ago
sc-provider.cjs.entry.js.map
1 year ago
sc-provisional-banner.cjs.entry.js
1 month ago
sc-provisional-banner.cjs.entry.js.map
11 months ago
sc-purchase-downloads-list.cjs.entry.js
1 month ago
sc-purchase-downloads-list.cjs.entry.js.map
1 month ago
sc-razorpay-add-method.cjs.entry.js
1 month ago
sc-razorpay-add-method.cjs.entry.js.map
2 months ago
sc-recurring-price-choice-container.cjs.entry.js
2 months ago
sc-recurring-price-choice-container.cjs.entry.js.map
1 year ago
sc-review-stars.cjs.entry.js
2 months ago
sc-review-stars.cjs.entry.js.map
5 months ago
sc-rich-text.cjs.entry.js
1 month ago
sc-rich-text.cjs.entry.js.map
1 month ago
sc-skeleton.cjs.entry.js
1 month ago
sc-skeleton.cjs.entry.js.map
1 year ago
sc-spacing.cjs.entry.js
1 month ago
sc-spacing.cjs.entry.js.map
1 year ago
sc-stripe-add-method.cjs.entry.js
1 month ago
sc-stripe-add-method.cjs.entry.js.map
2 months ago
sc-stripe-element.cjs.entry.js
1 month ago
sc-stripe-element.cjs.entry.js.map
2 months ago
sc-stripe-payment-element.cjs.entry.js
1 month ago
sc-stripe-payment-element.cjs.entry.js.map
2 months ago
sc-stripe-payment-request.cjs.entry.js
1 month ago
sc-stripe-payment-request.cjs.entry.js.map
2 months ago
sc-subscription-ad-hoc-confirm.cjs.entry.js
1 month ago
sc-subscription-ad-hoc-confirm.cjs.entry.js.map
6 months ago
sc-subscription-details_2.cjs.entry.js
1 month ago
sc-subscription-details_2.cjs.entry.js.map
1 month ago
sc-subscription-payment-method.cjs.entry.js
1 month ago
sc-subscription-payment-method.cjs.entry.js.map
2 months ago
sc-subscription-payment.cjs.entry.js
1 month ago
sc-subscription-payment.cjs.entry.js.map
2 months ago
sc-subscription-switch.cjs.entry.js
1 month ago
sc-subscription-switch.cjs.entry.js.map
2 months ago
sc-subscription-variation-confirm.cjs.entry.js
1 month ago
sc-subscription-variation-confirm.cjs.entry.js.map
1 year ago
sc-subscription.cjs.entry.js
1 month ago
sc-subscription.cjs.entry.js.map
1 month ago
sc-subscriptions-list.cjs.entry.js
1 month ago
sc-subscriptions-list.cjs.entry.js.map
2 months ago
sc-summary.cjs.entry.js
1 month ago
sc-summary.cjs.entry.js.map
1 year ago
sc-swap.cjs.entry.js
1 month ago
sc-swap.cjs.entry.js.map
2 months ago
sc-switch.cjs.entry.js
1 month ago
sc-switch.cjs.entry.js.map
7 months ago
sc-tab-group.cjs.entry.js
1 month ago
sc-tab-group.cjs.entry.js.map
1 year ago
sc-tab-panel.cjs.entry.js
1 month ago
sc-tab-panel.cjs.entry.js.map
1 year ago
sc-tab.cjs.entry.js
1 month ago
sc-tab.cjs.entry.js.map
1 year ago
sc-table-head.cjs.entry.js
1 month ago
sc-table-head.cjs.entry.js.map
1 year ago
sc-table_3.cjs.entry.js
1 month ago
sc-table_3.cjs.entry.js.map
10 months ago
sc-tag.cjs.entry.js
1 month ago
sc-tag.cjs.entry.js.map
4 months ago
sc-test-mode-info.cjs.entry.js
1 month ago
sc-test-mode-info.cjs.entry.js.map
6 months ago
sc-text.cjs.entry.js
1 month ago
sc-text.cjs.entry.js.map
1 year ago
sc-toggle.cjs.entry.js
1 month ago
sc-toggle.cjs.entry.js.map
1 year ago
sc-toggles.cjs.entry.js
1 month ago
sc-toggles.cjs.entry.js.map
1 year ago
sc-total.cjs.entry.js
1 month ago
sc-total.cjs.entry.js.map
1 year ago
sc-upcoming-invoice.cjs.entry.js
1 month ago
sc-upcoming-invoice.cjs.entry.js.map
2 months ago
sc-upgrade-required.cjs.entry.js
2 months ago
sc-upgrade-required.cjs.entry.js.map
1 year ago
sc-upsell-countdown-timer.cjs.entry.js
1 month ago
sc-upsell-countdown-timer.cjs.entry.js.map
1 year ago
sc-upsell-no-thanks-button.cjs.entry.js
1 month ago
sc-upsell-no-thanks-button.cjs.entry.js.map
2 months ago
sc-upsell-submit-button.cjs.entry.js
1 month ago
sc-upsell-submit-button.cjs.entry.js.map
2 months ago
sc-upsell-totals.cjs.entry.js
1 month ago
sc-upsell-totals.cjs.entry.js.map
2 months ago
sc-upsell.cjs.entry.js
1 month ago
sc-upsell.cjs.entry.js.map
2 months ago
sc-verification-code.cjs.entry.js
1 month ago
sc-verification-code.cjs.entry.js.map
2 months ago
sc-visually-hidden.cjs.entry.js
1 month ago
sc-visually-hidden.cjs.entry.js.map
1 year ago
sc-wordpress-password-edit.cjs.entry.js
1 month ago
sc-wordpress-password-edit.cjs.entry.js.map
2 months ago
sc-wordpress-user-edit.cjs.entry.js
1 month ago
sc-wordpress-user-edit.cjs.entry.js.map
2 months ago
sc-wordpress-user.cjs.entry.js
1 month ago
sc-wordpress-user.cjs.entry.js.map
1 year ago
store-01e8edc2.js
2 months ago
store-01e8edc2.js.map
2 months ago
store-401bdb4d.js
2 months ago
store-401bdb4d.js.map
2 months ago
store-9c215436.js
1 month ago
store-9c215436.js.map
1 month ago
surecart.cjs.js
1 month ago
surecart.cjs.js.map
1 year ago
tax-a4582e73.js
1 year ago
tax-a4582e73.js.map
1 year ago
universe-1db52218.js
2 months ago
universe-1db52218.js.map
2 months ago
util-a15c420c.js
2 months ago
util-a15c420c.js.map
2 months ago
utils-a9d13080.js
3 months ago
utils-a9d13080.js.map
3 months ago
verification-19455819.js
1 month ago
verification-19455819.js.map
1 month ago
watchers-517825ae.js
2 months ago
watchers-517825ae.js.map
2 months ago
watchers-78d592d3.js
1 month ago
watchers-78d592d3.js.map
1 month ago
watchers-a1a973e3.js
1 month ago
watchers-a1a973e3.js.map
1 month ago
watchers-d2dd8b04.js
1 month ago
watchers-d2dd8b04.js.map
1 month ago
watchers-dcd346b7.js
1 month ago
watchers-dcd346b7.js.map
1 month ago
sc-compact-address_18.cjs.entry.js
1074 lines
| 1 | 'use strict'; |
| 2 | |
| 3 | Object.defineProperty(exports, '__esModule', { value: true }); |
| 4 | |
| 5 | const index = require('./index-be4abba1.js'); |
| 6 | const address = require('./address-7404695f.js'); |
| 7 | const formData = require('./form-data-0da9940f.js'); |
| 8 | const googleMaps = require('./google-maps-0f9b7648.js'); |
| 9 | const mutations = require('./mutations-927be23d.js'); |
| 10 | const getters = require('./getters-d68c08ed.js'); |
| 11 | const store = require('./store-01e8edc2.js'); |
| 12 | const consumer = require('./consumer-b58230e6.js'); |
| 13 | const mutations$1 = require('./mutations-06bf0ea4.js'); |
| 14 | const index$2 = require('./index-92023a2d.js'); |
| 15 | const index$1 = require('./index-a4a4f390.js'); |
| 16 | const index$3 = require('./index-fb76df07.js'); |
| 17 | const price = require('./price-da3cab3d.js'); |
| 18 | const getters$1 = require('./getters-a7cb114b.js'); |
| 19 | const mutations$2 = require('./mutations-d5d6ddf1.js'); |
| 20 | const pageAlign = require('./page-align-5a2ab493.js'); |
| 21 | require('./add-query-args-49dcb630.js'); |
| 22 | require('./index-c3de642f.js'); |
| 23 | require('./utils-a9d13080.js'); |
| 24 | require('./remove-query-args-b57e8cd3.js'); |
| 25 | require('./google-59d23803.js'); |
| 26 | require('./currency-71fce0f0.js'); |
| 27 | require('./fetch-5e8dc1d5.js'); |
| 28 | require('./index-7ced8198.js'); |
| 29 | require('./store-9c215436.js'); |
| 30 | |
| 31 | const scCompactAddressCss = ":host{display:block}.sc-address{display:block;position:relative}.sc-address [hidden]{display:none}.sc-address--loading{min-height:70px}.sc-address--loading sc-skeleton{display:block;margin-bottom:1em}.sc-address__control{display:block}.sc-address__control>*{margin-bottom:-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-left:-1px}.sc-address__columns>*:first-child{margin-left:0}"; |
| 32 | const ScCompactAddressStyle0 = scCompactAddressCss; |
| 33 | |
| 34 | const ScCompactAddress = class { |
| 35 | constructor(hostRef) { |
| 36 | index.registerInstance(this, hostRef); |
| 37 | this.scChangeAddress = index.createEvent(this, "scChangeAddress", 7); |
| 38 | this.scInputAddress = index.createEvent(this, "scInputAddress", 7); |
| 39 | this.address = { |
| 40 | country: null, |
| 41 | city: null, |
| 42 | line_1: null, |
| 43 | line_2: null, |
| 44 | postal_code: null, |
| 45 | state: null, |
| 46 | }; |
| 47 | this.names = { |
| 48 | country: 'shipping_country', |
| 49 | city: 'shipping_city', |
| 50 | line_1: 'shipping_line_1', |
| 51 | line_2: 'shipping_line_2', |
| 52 | postal_code: 'shipping_postal_code', |
| 53 | state: 'shipping_state', |
| 54 | }; |
| 55 | this.placeholders = { |
| 56 | country: '', |
| 57 | postal_code: '', |
| 58 | state: '', |
| 59 | }; |
| 60 | this.label = wp.i18n.__('Country or region', 'surecart'); |
| 61 | this.required = undefined; |
| 62 | this.loading = undefined; |
| 63 | this.countryChoices = undefined; |
| 64 | this.regions = undefined; |
| 65 | this.showState = undefined; |
| 66 | this.showPostal = undefined; |
| 67 | this.postalCodeRegex = undefined; |
| 68 | } |
| 69 | /** When the state changes, we want to update city and postal fields. */ |
| 70 | handleAddressChange() { |
| 71 | var _a; |
| 72 | if (!((_a = this.address) === null || _a === void 0 ? void 0 : _a.country)) |
| 73 | return; |
| 74 | this.setRegions(); |
| 75 | this.showState = ['US', 'CA'].includes(this.address.country); |
| 76 | this.showPostal = ['US'].includes(this.address.country); |
| 77 | this.scChangeAddress.emit(this.address); |
| 78 | this.scInputAddress.emit(this.address); |
| 79 | } |
| 80 | updateAddress(address) { |
| 81 | this.address = { ...this.address, ...address }; |
| 82 | } |
| 83 | handleAddressInput(address) { |
| 84 | this.scInputAddress.emit({ ...this.address, ...address }); |
| 85 | } |
| 86 | clearAddress() { |
| 87 | var _a; |
| 88 | this.address = { |
| 89 | name: (_a = this.address) === null || _a === void 0 ? void 0 : _a.name, |
| 90 | country: null, |
| 91 | line_1: null, |
| 92 | line_2: null, |
| 93 | city: null, |
| 94 | postal_code: null, |
| 95 | state: null, |
| 96 | }; |
| 97 | } |
| 98 | /** Set the regions based on the country. */ |
| 99 | async setRegions() { |
| 100 | var _a, _b; |
| 101 | const countryDetails = await address.getCountryDetails((_a = this.address) === null || _a === void 0 ? void 0 : _a.country); |
| 102 | this.regions = |
| 103 | ((_b = countryDetails === null || countryDetails === void 0 ? void 0 : countryDetails.states) === null || _b === void 0 ? void 0 : _b.map(state => ({ |
| 104 | value: state === null || state === void 0 ? void 0 : state.code, |
| 105 | label: state === null || state === void 0 ? void 0 : state.name, |
| 106 | }))) || []; |
| 107 | this.placeholders = countryDetails === null || countryDetails === void 0 ? void 0 : countryDetails.address_labels; |
| 108 | this.postalCodeRegex = (countryDetails === null || countryDetails === void 0 ? void 0 : countryDetails.postal_code_regex) || undefined; |
| 109 | } |
| 110 | componentWillLoad() { |
| 111 | var _a, _b; |
| 112 | this.initCountryChoices(); |
| 113 | this.handleAddressChange(); |
| 114 | const country = (_b = (_a = this.countryChoices) === null || _a === void 0 ? void 0 : _a.find(country => country.value === this.address.country)) === null || _b === void 0 ? void 0 : _b.value; |
| 115 | if (country) { |
| 116 | this.updateAddress({ country }); |
| 117 | } |
| 118 | this.fetchUserCountry(); |
| 119 | } |
| 120 | async fetchUserCountry() { |
| 121 | var _a; |
| 122 | if ((_a = this.address) === null || _a === void 0 ? void 0 : _a.country) { |
| 123 | return; |
| 124 | } |
| 125 | const countryCode = await googleMaps.getCurrentUserCountryCode(); |
| 126 | if (countryCode) { |
| 127 | this.updateAddress({ country: countryCode }); |
| 128 | } |
| 129 | } |
| 130 | async initCountryChoices() { |
| 131 | this.countryChoices = await address.countryChoices(); |
| 132 | } |
| 133 | async reportValidity() { |
| 134 | return formData.reportChildrenValidity(this.el); |
| 135 | } |
| 136 | render() { |
| 137 | var _a, _b, _c, _d, _e, _f, _g; |
| 138 | return (index.h("div", { key: '788e0d1d63e678b291b9cce256fa812da18c7b45', class: "sc-address", part: "base" }, index.h("sc-form-control", { key: '579fe0c306a2dc3a1d55227a14dc1507d02cfbc8', exportparts: "label, help-text, form-control", label: this.label, class: "sc-address__control", part: "control", required: this.required }, index.h("sc-select", { key: '0e1cc5b5ca11fff1ddd11ce2b8854b2797734997', 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", value: (_a = this.address) === null || _a === void 0 ? void 0 : _a.country, onScChange: (e) => { |
| 139 | this.clearAddress(); |
| 140 | this.updateAddress({ country: e.target.value || null }); |
| 141 | }, choices: this.countryChoices, autocomplete: 'country-name', placeholder: ((_b = this.placeholders) === null || _b === void 0 ? void 0 : _b.country) || wp.i18n.__('Select Your Country', 'surecart'), name: this.names.country, search: true, unselect: false, "squared-bottom": this.showState || this.showPostal, required: this.required }), index.h("div", { key: '292dba3c347f24769d02f738b3df35f3c02e5c86', class: "sc-address__columns" }, this.showState && (index.h("sc-select", { key: '27d303b88ba2b25225950ec1c1bd7568b3dfe512', 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: (_c = this.placeholders) === null || _c === void 0 ? void 0 : _c.state, name: this.names.state, autocomplete: 'address-level1', value: (_d = this === null || this === void 0 ? void 0 : this.address) === null || _d === void 0 ? void 0 : _d.state, onScChange: (e) => this.updateAddress({ state: e.target.value || null }), choices: this.regions, required: this.required, search: true, "squared-top": true, unselect: false, "squared-right": this.showPostal })), this.showPostal && (index.h("sc-input", { key: 'ce3e81bb66101040a786e6ad422fe110f9a4f61c', exportparts: "base:input__base, input, form-control, label, help-text", placeholder: ((_e = this.placeholders) === null || _e === void 0 ? void 0 : _e.postal_code) || wp.i18n.__('Postal Code/Zip', 'surecart'), name: this.names.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: (_f = this === null || this === void 0 ? void 0 : this.address) === null || _f === void 0 ? void 0 : _f.postal_code, "squared-top": true, maxlength: ((_g = this.address) === null || _g === void 0 ? void 0 : _g.country) === 'US' ? 5 : undefined, pattern: this.postalCodeRegex, customValidity: this.postalCodeRegex ? wp.i18n.__('Please enter a valid postal code', 'surecart') : undefined, "squared-left": this.showState })))), this.loading && index.h("sc-block-ui", { key: '677f634586c9c45ea2e58629e13ef8cccfd45ffe', exportparts: "base:block-ui, content:block-ui__content" }))); |
| 142 | } |
| 143 | get el() { return index.getElement(this); } |
| 144 | static get watchers() { return { |
| 145 | "address": ["handleAddressChange"] |
| 146 | }; } |
| 147 | }; |
| 148 | ScCompactAddress.style = ScCompactAddressStyle0; |
| 149 | |
| 150 | const scCustomerPhoneCss = ":host{display:block}"; |
| 151 | const ScCustomerPhoneStyle0 = scCustomerPhoneCss; |
| 152 | |
| 153 | const ScCustomerPhone = class { |
| 154 | constructor(hostRef) { |
| 155 | index.registerInstance(this, hostRef); |
| 156 | this.scChange = index.createEvent(this, "scChange", 7); |
| 157 | this.scClear = index.createEvent(this, "scClear", 7); |
| 158 | this.scInput = index.createEvent(this, "scInput", 7); |
| 159 | this.scFocus = index.createEvent(this, "scFocus", 7); |
| 160 | this.scBlur = index.createEvent(this, "scBlur", 7); |
| 161 | this.size = 'medium'; |
| 162 | this.value = ''; |
| 163 | this.pill = false; |
| 164 | this.label = undefined; |
| 165 | this.showLabel = true; |
| 166 | this.help = ''; |
| 167 | this.placeholder = undefined; |
| 168 | this.disabled = false; |
| 169 | this.readonly = false; |
| 170 | this.required = false; |
| 171 | this.invalid = false; |
| 172 | this.autofocus = undefined; |
| 173 | this.hasFocus = undefined; |
| 174 | this.error = undefined; |
| 175 | } |
| 176 | async handleChange() { |
| 177 | this.value = this.input.value; |
| 178 | this.scChange.emit(); |
| 179 | } |
| 180 | async reportValidity() { |
| 181 | var _a, _b; |
| 182 | return (_b = (_a = this.input) === null || _a === void 0 ? void 0 : _a.reportValidity) === null || _b === void 0 ? void 0 : _b.call(_a); |
| 183 | } |
| 184 | componentWillLoad() { |
| 185 | this.handleCheckoutChange(); |
| 186 | this.removeChangeListener = mutations.onChange('checkout', () => this.handleCheckoutChange()); |
| 187 | } |
| 188 | disconnectedCallback() { |
| 189 | this.removeChangeListener(); |
| 190 | } |
| 191 | handleCheckoutChange() { |
| 192 | var _a, _b, _c, _d, _e, _f; |
| 193 | // we only want to do this if we don't have a value. |
| 194 | if (this === null || this === void 0 ? void 0 : this.value) |
| 195 | return; |
| 196 | // if the checkout has a phone, use that. |
| 197 | if ((_a = mutations.state.checkout) === null || _a === void 0 ? void 0 : _a.phone) { |
| 198 | this.value = (_b = mutations.state.checkout) === null || _b === void 0 ? void 0 : _b.phone; |
| 199 | return; |
| 200 | } |
| 201 | // if the customer has a phone, use that. |
| 202 | if ((_d = (_c = mutations.state.checkout) === null || _c === void 0 ? void 0 : _c.customer) === null || _d === void 0 ? void 0 : _d.phone) { |
| 203 | this.value = (_f = (_e = mutations.state.checkout) === null || _e === void 0 ? void 0 : _e.customer) === null || _f === void 0 ? void 0 : _f.phone; |
| 204 | return; |
| 205 | } |
| 206 | } |
| 207 | render() { |
| 208 | return (index.h("sc-phone-input", { key: '89ec8776e62c3ad08e763115f06b5bbe6a87d246', name: "phone", ref: el => (this.input = el), value: this.value, label: this.label, help: this.help, autocomplete: "phone", placeholder: this.placeholder, readonly: this.readonly, required: this.required, invalid: this.invalid, autofocus: this.autofocus, hasFocus: this.hasFocus, onScChange: () => this.handleChange(), onScInput: () => this.scInput.emit(), onScFocus: () => this.scFocus.emit(), onScBlur: () => this.scBlur.emit() })); |
| 209 | } |
| 210 | }; |
| 211 | ScCustomerPhone.style = ScCustomerPhoneStyle0; |
| 212 | |
| 213 | const scInvoiceDetailsCss = ":host{display:block}::slotted(*){margin:4px 0 !important}::slotted(sc-divider){margin:16px 0 !important}"; |
| 214 | const ScInvoiceDetailsStyle0 = scInvoiceDetailsCss; |
| 215 | |
| 216 | const ScInvoiceDetails = class { |
| 217 | constructor(hostRef) { |
| 218 | index.registerInstance(this, hostRef); |
| 219 | } |
| 220 | render() { |
| 221 | var _a; |
| 222 | return (index.h(index.Host, { key: 'b1774fcf95a7780ac4479d44d0814431b07724ef', style: { ...(!((_a = mutations.state === null || mutations.state === void 0 ? void 0 : mutations.state.checkout) === null || _a === void 0 ? void 0 : _a.invoice) ? { display: 'none' } : {}) } }, index.h("div", { key: '081242c9b4e67bef899ede149b49cf2fd119f608', class: "invoice-details" }, index.h("slot", { key: '8c2fb522cc464a1a8ebca35686e769e21017bdcb' })))); |
| 223 | } |
| 224 | }; |
| 225 | ScInvoiceDetails.style = ScInvoiceDetailsStyle0; |
| 226 | |
| 227 | const scInvoiceMemoCss = ":host{display:block}.invoice-memo{font-size:var(--sc-font-size-small);line-height:var(--sc-line-height-dense);color:var(--sc-input-label-color);display:grid;gap:5px}.invoice-memo__content{text-align:left;color:var(--sc-input-help-text-color)}"; |
| 228 | const ScInvoiceMemoStyle0 = scInvoiceMemoCss; |
| 229 | |
| 230 | const ScLineItemInvoiceMemo = class { |
| 231 | constructor(hostRef) { |
| 232 | index.registerInstance(this, hostRef); |
| 233 | this.text = undefined; |
| 234 | } |
| 235 | render() { |
| 236 | var _a; |
| 237 | const checkout = mutations.state === null || mutations.state === void 0 ? void 0 : mutations.state.checkout; |
| 238 | const memo = ((_a = checkout === null || checkout === void 0 ? void 0 : checkout.invoice) === null || _a === void 0 ? void 0 : _a.memo) || null; |
| 239 | // Stop if checkout has no invoice number. |
| 240 | if (!memo) { |
| 241 | return null; |
| 242 | } |
| 243 | // loading state |
| 244 | if (getters.formBusy() && !(checkout === null || checkout === void 0 ? void 0 : checkout.invoice)) { |
| 245 | return (index.h("div", null, index.h("sc-skeleton", { style: { width: '100px' } }), index.h("sc-skeleton", { style: { width: '200px' } }))); |
| 246 | } |
| 247 | return (index.h("div", { class: "invoice-memo" }, index.h("div", { class: "invoice-memo__title" }, this.text || wp.i18n.__('Memo', 'surecart')), index.h("div", { class: "invoice-memo__content" }, memo))); |
| 248 | } |
| 249 | }; |
| 250 | ScLineItemInvoiceMemo.style = ScInvoiceMemoStyle0; |
| 251 | |
| 252 | const scLineItemInvoiceDueDateCss = ":host{display:block}sc-line-item{text-align:left;line-height:var(--sc-line-height-dense);color:var(--sc-input-label-color)}"; |
| 253 | const ScLineItemInvoiceDueDateStyle0 = scLineItemInvoiceDueDateCss; |
| 254 | |
| 255 | const ScLineItemInvoiceDueDate = class { |
| 256 | constructor(hostRef) { |
| 257 | index.registerInstance(this, hostRef); |
| 258 | } |
| 259 | render() { |
| 260 | var _a; |
| 261 | const checkout = mutations.state === null || mutations.state === void 0 ? void 0 : mutations.state.checkout; |
| 262 | const dueDate = ((_a = checkout === null || checkout === void 0 ? void 0 : checkout.invoice) === null || _a === void 0 ? void 0 : _a.due_date_date) || null; |
| 263 | // Stop if checkout has no invoice due date. |
| 264 | if (!dueDate) { |
| 265 | return null; |
| 266 | } |
| 267 | // loading state |
| 268 | if (getters.formBusy() && !(checkout === null || checkout === void 0 ? void 0 : checkout.invoice)) { |
| 269 | return (index.h("sc-line-item", null, index.h("sc-skeleton", { slot: "title", style: { width: '120px', display: 'inline-block' } }), index.h("sc-skeleton", { slot: "price", style: { 'width': '50px', 'display': 'inline-block', '--border-radius': '6px' } }))); |
| 270 | } |
| 271 | return (index.h("sc-line-item", null, index.h("span", { slot: "description" }, index.h("slot", { name: "title" }, wp.i18n.__('Due Date', 'surecart'))), index.h("span", { slot: "price-description" }, dueDate))); |
| 272 | } |
| 273 | }; |
| 274 | ScLineItemInvoiceDueDate.style = ScLineItemInvoiceDueDateStyle0; |
| 275 | |
| 276 | const scLineItemInvoiceNumberCss = ":host{display:block}sc-line-item{text-align:left;line-height:var(--sc-line-height-dense);color:var(--sc-input-label-color)}"; |
| 277 | const ScLineItemInvoiceNumberStyle0 = scLineItemInvoiceNumberCss; |
| 278 | |
| 279 | const ScLineItemInvoiceNumber = class { |
| 280 | constructor(hostRef) { |
| 281 | index.registerInstance(this, hostRef); |
| 282 | } |
| 283 | render() { |
| 284 | var _a; |
| 285 | const checkout = mutations.state === null || mutations.state === void 0 ? void 0 : mutations.state.checkout; |
| 286 | const invoiceNumber = ((_a = checkout === null || checkout === void 0 ? void 0 : checkout.invoice) === null || _a === void 0 ? void 0 : _a.order_number) || null; |
| 287 | // Stop if checkout has no invoice number. |
| 288 | if (!invoiceNumber) { |
| 289 | return null; |
| 290 | } |
| 291 | // loading state |
| 292 | if (getters.formBusy() && !(checkout === null || checkout === void 0 ? void 0 : checkout.invoice)) { |
| 293 | return (index.h("sc-line-item", null, index.h("sc-skeleton", { slot: "title", style: { width: '120px', display: 'inline-block' } }), index.h("sc-skeleton", { slot: "price", style: { 'width': '50px', 'display': 'inline-block', '--border-radius': '6px' } }))); |
| 294 | } |
| 295 | return (index.h("sc-line-item", null, index.h("span", { slot: "description" }, index.h("slot", { name: "title" }, wp.i18n.__('Invoice Number', 'surecart'))), index.h("span", { slot: "price-description" }, "#", invoiceNumber))); |
| 296 | } |
| 297 | }; |
| 298 | ScLineItemInvoiceNumber.style = ScLineItemInvoiceNumberStyle0; |
| 299 | |
| 300 | const scLineItemInvoiceReceiptDownloadCss = ":host{display:block}sc-line-item{text-align:left;line-height:var(--sc-line-height-dense);color:var(--sc-input-label-color)}.sc-invoice-download-link{display:inline-flex;gap:var(--sc-spacing-x-small);text-decoration:none;color:inherit}"; |
| 301 | const ScLineItemInvoiceReceiptDownloadStyle0 = scLineItemInvoiceReceiptDownloadCss; |
| 302 | |
| 303 | const ScLineItemInvoiceReceiptDownload = class { |
| 304 | constructor(hostRef) { |
| 305 | index.registerInstance(this, hostRef); |
| 306 | this.checkout = undefined; |
| 307 | } |
| 308 | render() { |
| 309 | var _a; |
| 310 | const checkout = mutations.state === null || mutations.state === void 0 ? void 0 : mutations.state.checkout; |
| 311 | const receiptDownloadLink = ((_a = checkout === null || checkout === void 0 ? void 0 : checkout.invoice) === null || _a === void 0 ? void 0 : _a.id) ? checkout === null || checkout === void 0 ? void 0 : checkout.pdf_url : null; |
| 312 | // Stop if checkout has no receipt download link. |
| 313 | if (!receiptDownloadLink) { |
| 314 | return null; |
| 315 | } |
| 316 | // loading state |
| 317 | if (getters.formBusy() && !(checkout === null || checkout === void 0 ? void 0 : checkout.invoice)) { |
| 318 | return (index.h("sc-line-item", null, index.h("sc-skeleton", { slot: "title", style: { width: '120px', display: 'inline-block' } }), index.h("sc-skeleton", { slot: "price", style: { 'width': '50px', 'display': 'inline-block', '--border-radius': '6px' } }))); |
| 319 | } |
| 320 | return (index.h("sc-line-item", null, index.h("span", { slot: "description" }, index.h("slot", { name: "title" }, wp.i18n.__('Receipt / Invoice', 'surecart'))), index.h("span", { slot: "price-description" }, index.h("a", { class: "sc-invoice-download-link", href: receiptDownloadLink, target: "_blank", rel: "noopener noreferrer" }, index.h("sc-icon", { name: "download" }), wp.i18n.__('Download', 'surecart'))))); |
| 321 | } |
| 322 | }; |
| 323 | ScLineItemInvoiceReceiptDownload.style = ScLineItemInvoiceReceiptDownloadStyle0; |
| 324 | |
| 325 | const scLineItemShippingCss = ":host{display:block}"; |
| 326 | const ScLineItemShippingStyle0 = scLineItemShippingCss; |
| 327 | |
| 328 | const ScLineItemShipping = class { |
| 329 | constructor(hostRef) { |
| 330 | index.registerInstance(this, hostRef); |
| 331 | this.label = undefined; |
| 332 | } |
| 333 | renderShippingFees(checkout) { |
| 334 | var _a, _b, _c, _d; |
| 335 | if (!((_b = (_a = checkout === null || checkout === void 0 ? void 0 : checkout.shipping_fees) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.length)) { |
| 336 | return null; |
| 337 | } |
| 338 | return (index.h(index.Fragment, null, (_d = (_c = checkout === null || checkout === void 0 ? void 0 : checkout.shipping_fees) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.map(fee => (index.h("sc-line-item", { key: fee.id }, index.h("span", { slot: "description" }, fee.description), index.h("span", { slot: "price" }, fee.display_amount)))))); |
| 339 | } |
| 340 | render() { |
| 341 | const { checkout } = mutations.state; |
| 342 | // don't show if no shipping amount if no choice selected |
| 343 | if (!(checkout === null || checkout === void 0 ? void 0 : checkout.selected_shipping_choice)) { |
| 344 | return index.h(index.Host, { style: { display: 'none' } }); |
| 345 | } |
| 346 | if (store.state.formState.value === 'loading') { |
| 347 | return (index.h("sc-line-item", null, index.h("sc-skeleton", { slot: "title", style: { width: '120px', display: 'inline-block' } }), index.h("sc-skeleton", { slot: "price", style: { 'width': '70px', 'display': 'inline-block', '--border-radius': '6px' } }))); |
| 348 | } |
| 349 | return (index.h(index.Fragment, null, index.h("sc-line-item", null, index.h("span", { slot: "description" }, this.label || wp.i18n.__('Shipping', 'surecart')), index.h("span", { slot: "price" }, checkout === null || checkout === void 0 ? void 0 : checkout.shipping_display_amount)), this.renderShippingFees(checkout))); |
| 350 | } |
| 351 | }; |
| 352 | ScLineItemShipping.style = ScLineItemShippingStyle0; |
| 353 | |
| 354 | const scLineItemTaxCss = ":host{display:block}"; |
| 355 | const ScLineItemTaxStyle0 = scLineItemTaxCss; |
| 356 | |
| 357 | const ScLineItemTax = class { |
| 358 | constructor(hostRef) { |
| 359 | index.registerInstance(this, hostRef); |
| 360 | this.order = undefined; |
| 361 | this.loading = undefined; |
| 362 | } |
| 363 | renderLabel() { |
| 364 | var _a, _b, _c; |
| 365 | let label = wp.i18n.sprintf(wp.i18n.__('Estimated %s', 'surecart'), ((_a = this === null || this === void 0 ? void 0 : this.order) === null || _a === void 0 ? void 0 : _a.tax_label) || ''); |
| 366 | if (((_b = this === null || this === void 0 ? void 0 : this.order) === null || _b === void 0 ? void 0 : _b.tax_status) === 'calculated') { |
| 367 | label = ((_c = this.order) === null || _c === void 0 ? void 0 : _c.tax_label) || ''; |
| 368 | } |
| 369 | return index.h(index.Fragment, null, `${wp.i18n.__('Tax', 'surecart')} ${label}`); |
| 370 | } |
| 371 | render() { |
| 372 | var _a, _b, _c, _d, _e; |
| 373 | // hide if tax is 0 |
| 374 | if (!((_a = this === null || this === void 0 ? void 0 : this.order) === null || _a === void 0 ? void 0 : _a.tax_amount)) { |
| 375 | return null; |
| 376 | } |
| 377 | return (index.h("sc-line-item", null, index.h("span", { slot: "description" }, this.renderLabel()), ((_b = this.order) === null || _b === void 0 ? void 0 : _b.tax_exclusive_amount) && index.h("span", { slot: "price" }, (_c = this.order) === null || _c === void 0 ? void 0 : _c.tax_exclusive_display_amount), ((_d = this.order) === null || _d === void 0 ? void 0 : _d.tax_inclusive_amount) && (index.h("span", { slot: "price-description" }, '(', (_e = this.order) === null || _e === void 0 ? void 0 : |
| 378 | _e.tax_inclusive_display_amount, " ", wp.i18n.__('included', 'surecart'), ')')))); |
| 379 | } |
| 380 | }; |
| 381 | consumer.openWormhole(ScLineItemTax, ['order', 'loading'], false); |
| 382 | ScLineItemTax.style = ScLineItemTaxStyle0; |
| 383 | |
| 384 | const scLineItemTrialCss = ":host{display:block}"; |
| 385 | const ScLineItemTrialStyle0 = scLineItemTrialCss; |
| 386 | |
| 387 | const ScLineItemTrial = class { |
| 388 | constructor(hostRef) { |
| 389 | index.registerInstance(this, hostRef); |
| 390 | this.label = undefined; |
| 391 | } |
| 392 | render() { |
| 393 | var _a, _b; |
| 394 | if (!((_a = mutations.state === null || mutations.state === void 0 ? void 0 : mutations.state.checkout) === null || _a === void 0 ? void 0 : _a.trial_amount)) { |
| 395 | return index.h(index.Host, { style: { display: 'none' } }); |
| 396 | } |
| 397 | return (index.h("sc-line-item", null, index.h("span", { slot: "description" }, this.label || wp.i18n.__('Trial', 'surecart')), index.h("span", { slot: "price-description" }, (_b = mutations.state === null || mutations.state === void 0 ? void 0 : mutations.state.checkout) === null || _b === void 0 ? void 0 : _b.trial_display_amount))); |
| 398 | } |
| 399 | }; |
| 400 | ScLineItemTrial.style = ScLineItemTrialStyle0; |
| 401 | |
| 402 | const scOrderBillingAddressCss = ":host{display:block}.order-billing-address__toggle{margin-bottom:var(--sc-form-row-spacing, var(--sc-spacing-medium))}"; |
| 403 | const ScOrderBillingAddressStyle0 = scOrderBillingAddressCss; |
| 404 | |
| 405 | const ScOrderBillingAddress = class { |
| 406 | constructor(hostRef) { |
| 407 | index.registerInstance(this, hostRef); |
| 408 | this.label = undefined; |
| 409 | this.showName = undefined; |
| 410 | this.namePlaceholder = wp.i18n.__('Name or Company Name', 'surecart'); |
| 411 | this.defaultCountry = undefined; |
| 412 | this.toggleLabel = wp.i18n.__('Billing address is same as shipping', 'surecart'); |
| 413 | this.address = { |
| 414 | country: null, |
| 415 | city: null, |
| 416 | line_1: null, |
| 417 | line_2: null, |
| 418 | postal_code: null, |
| 419 | state: null, |
| 420 | }; |
| 421 | } |
| 422 | async reportValidity() { |
| 423 | var _a, _b; |
| 424 | if (!this.input) |
| 425 | return true; |
| 426 | return (_b = (_a = this.input) === null || _a === void 0 ? void 0 : _a.reportValidity) === null || _b === void 0 ? void 0 : _b.call(_a); |
| 427 | } |
| 428 | prefillAddress() { |
| 429 | var _a; |
| 430 | // Autofill is handled by sc-checkout-autofill-provider which patches checkoutState.checkout with any logged-in customer profile data. |
| 431 | if (index$1.isAddressEmpty(this.address)) { |
| 432 | this.address = { ...this.address, ...(_a = mutations.state.checkout) === null || _a === void 0 ? void 0 : _a.billing_address }; |
| 433 | } |
| 434 | } |
| 435 | componentWillLoad() { |
| 436 | var _a; |
| 437 | if (this.defaultCountry && !((_a = this.address) === null || _a === void 0 ? void 0 : _a.country)) { |
| 438 | this.address.country = this.defaultCountry; |
| 439 | } |
| 440 | this.prefillAddress(); |
| 441 | mutations.onChange('checkout', () => this.prefillAddress()); |
| 442 | } |
| 443 | async updateAddressState(address) { |
| 444 | var _a, _b; |
| 445 | if (JSON.stringify(address) === JSON.stringify(this.address)) |
| 446 | return; // no change, don't update. |
| 447 | this.address = address; |
| 448 | try { |
| 449 | mutations$1.lockCheckout('billing-address'); |
| 450 | mutations.state.checkout = (await index$2.createOrUpdateCheckout({ |
| 451 | id: (_a = mutations.state === null || mutations.state === void 0 ? void 0 : mutations.state.checkout) === null || _a === void 0 ? void 0 : _a.id, |
| 452 | data: { |
| 453 | billing_matches_shipping: (_b = mutations.state.checkout) === null || _b === void 0 ? void 0 : _b.billing_matches_shipping, |
| 454 | billing_address: this.address, |
| 455 | }, |
| 456 | })); |
| 457 | } |
| 458 | catch (e) { |
| 459 | console.error(e); |
| 460 | } |
| 461 | finally { |
| 462 | mutations$1.unLockCheckout('billing-address'); |
| 463 | } |
| 464 | } |
| 465 | async onToggleBillingMatchesShipping(e) { |
| 466 | mutations.state.checkout = { |
| 467 | ...mutations.state.checkout, |
| 468 | billing_matches_shipping: e.target.checked, |
| 469 | }; |
| 470 | } |
| 471 | shippingAddressFieldExists() { |
| 472 | return !!document.querySelector('sc-order-shipping-address'); |
| 473 | } |
| 474 | render() { |
| 475 | var _a, _b; |
| 476 | return (index.h(index.Fragment, { key: 'fba7f7f30478cf9db8a296cc46e39b77a84efa43' }, this.shippingAddressFieldExists() && (index.h("sc-checkbox", { key: '41b0408fd0a4d6817f6de847e23552547e515472', class: "order-billing-address__toggle", onScChange: e => this.onToggleBillingMatchesShipping(e), checked: (_a = mutations.state.checkout) === null || _a === void 0 ? void 0 : _a.billing_matches_shipping }, this.toggleLabel)), (!this.shippingAddressFieldExists() || !((_b = mutations.state.checkout) === null || _b === void 0 ? void 0 : _b.billing_matches_shipping)) && (index.h("sc-address", { key: '154cd2dd179e6099840a101141a607ef8b76a41d', exportparts: "label, help-text, form-control, input__base, select__base, columns, search__base, menu__base", ref: el => { |
| 477 | this.input = el; |
| 478 | }, label: this.label || wp.i18n.__('Billing Address', 'surecart'), names: { |
| 479 | name: 'billing_name', |
| 480 | country: 'billing_country', |
| 481 | city: 'billing_city', |
| 482 | line_1: 'billing_line_1', |
| 483 | line_2: 'billing_line_2', |
| 484 | postal_code: 'billing_postal_code', |
| 485 | state: 'billing_state', |
| 486 | }, required: true, loading: getters.formLoading(), address: this.address, "show-name": this.showName, onScChangeAddress: e => this.updateAddressState(e.detail) })))); |
| 487 | } |
| 488 | }; |
| 489 | ScOrderBillingAddress.style = ScOrderBillingAddressStyle0; |
| 490 | |
| 491 | const scOrderBumpCss = ":host {\n display: block;\n}\n\n:host([data-design=modern]) sc-choice::part(base) {\n padding: 0;\n overflow: hidden;\n border-radius: var(--sc-order-bump-border-radius, 12px);\n border-color: var(--sc-order-bump-border-color, #e0e0e0) !important;\n box-shadow: none !important;\n outline: none !important;\n cursor: default;\n}\n\n:host([data-design=modern]) sc-choice::part(content) {\n cursor: default;\n}\n\n:host([data-design=modern]) .bump {\n display: flex;\n align-items: center;\n gap: var(--sc-order-bump-gap, 1em);\n padding: var(--sc-order-bump-padding, 0.75em 1em 0.75em 0.75em);\n}\n:host([data-design=modern]) .bump__text {\n display: grid;\n gap: 5px;\n flex: 1;\n min-width: 0;\n}\n:host([data-design=modern]) .bump__title {\n font-size: var(--sc-order-bump-title-size, 15px);\n font-weight: 600;\n line-height: 1.3;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n line-clamp: 2;\n overflow: hidden;\n text-overflow: ellipsis;\n word-break: break-word;\n}\n:host([data-design=modern]) .bump__cta {\n font-size: var(--sc-order-bump-cta-size, 12px);\n font-weight: 600;\n line-height: 1.3;\n display: var(--sc-order-bump-cta-display, -webkit-box);\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n overflow: hidden;\n text-overflow: ellipsis;\n word-break: break-word;\n}\n:host([data-design=modern]) .bump__tag {\n display: var(--sc-order-bump-tag-display, inline-block);\n background: var(--sc-color-primary-500);\n color: var(--sc-color-white);\n border-radius: 999px;\n padding: var(--sc-spacing-x-small);\n font-size: var(--sc-font-size-x-small);\n}\n:host([data-design=modern]) .bump__description {\n display: var(--sc-order-bump-description-display, block);\n font-size: var(--sc-order-bump-description-size, 13px);\n color: var(--sc-order-bump-description-color, #6b7280);\n opacity: 0.8;\n line-height: 1.3;\n font-weight: normal;\n}\n:host([data-design=modern]) .bump__description p {\n margin: 0;\n}\n:host([data-design=modern]) .bump__image {\n width: var(--sc-order-bump-image-size, 72px);\n height: var(--sc-order-bump-image-size, 72px);\n flex: 0 0 var(--sc-order-bump-image-size, 72px);\n object-fit: cover;\n border-radius: var(--sc-order-bump-image-radius, 8px);\n border: 1px solid var(--sc-color-gray-200);\n display: var(--sc-order-bump-image-display, block);\n}\n:host([data-design=modern]) .bump__price--has-discount {\n display: flex;\n align-items: baseline;\n gap: 4px;\n}\n:host([data-design=modern]) .bump__price--has-discount .bump__original-price {\n text-decoration: line-through;\n color: var(--sc-color-gray-500);\n font-size: var(--sc-order-bump-price-size, 14px);\n font-weight: normal;\n}\n:host([data-design=modern]) .bump__price .bump__new-price {\n font-size: var(--sc-order-bump-price-size, 14px);\n font-weight: 500;\n color: var(--sc-color-gray-700);\n}\n:host([data-design=modern]) .bump__price .bump__interval {\n color: var(--sc-color-gray-500);\n}\n:host([data-design=modern]) .bump__button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n border-radius: var(--sc-order-bump-button-radius, 74.6%);\n border: 1px solid var(--sc-order-bump-button-border-color, #d1d5db);\n background-color: transparent;\n color: var(--sc-color-gray-500);\n flex-shrink: 0;\n line-height: 1;\n font-size: var(--sc-order-bump-button-size, 18px);\n padding: 0.5em;\n cursor: pointer;\n transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;\n}\n:host([data-design=modern]) .bump__button sc-icon {\n font-size: 1em;\n}\n:host([data-design=modern]) .bump__button--checked {\n background-color: var(--sc-color-primary-500);\n border-color: var(--sc-color-primary-500);\n color: var(--sc-color-white, #fff);\n}\n:host([data-design=modern]) .bump__button--loading {\n border-color: var(--sc-color-primary-500);\n}\n:host([data-design=modern]) .bump__button--loading sc-spinner {\n --spinner-size: 1em;\n --indicator-color: var(--sc-color-gray-500);\n}\n:host([data-design=modern]) .bump__amount {\n display: var(--sc-order-bump-amount-display, flex);\n align-items: center;\n gap: 4px;\n flex-wrap: wrap;\n}\n\n:host([data-design=classic]) .bump {\n display: grid;\n gap: 1em;\n}\n:host([data-design=classic]) .bump__text {\n display: grid;\n gap: 0.25em;\n}\n:host([data-design=classic]) .bump__tag {\n background: var(--sc-color-primary-500);\n color: var(--sc-color-white);\n border-radius: var(--sc-input-border-radius-medium);\n padding: var(--sc-spacing-x-small);\n font-size: var(--sc-font-size-x-small);\n}\n:host([data-design=classic]) .bump__product {\n display: flex;\n align-items: center;\n gap: var(--sc-choice-padding, 1.3em 1.1em);\n line-height: var(--sc-line-height-dense);\n}\n:host([data-design=classic]) .bump__product--wrapper {\n container-type: inline-size;\n}\n@container (max-width: 325px) {\n :host([data-design=classic]) .bump__product {\n flex-direction: column;\n align-items: start;\n }\n}\n:host([data-design=classic]) .bump__title {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n line-clamp: 2;\n overflow: hidden;\n text-overflow: ellipsis;\n word-break: break-word;\n}\n:host([data-design=classic]) .bump__product-title {\n font-weight: var(--sc-font-weight-semibold);\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n line-clamp: 2;\n overflow: hidden;\n text-overflow: ellipsis;\n word-break: break-word;\n}\n:host([data-design=classic]) .bump__product-description {\n color: var(--sc-input-label-color);\n}\n:host([data-design=classic]) .bump__image {\n width: var(--sc-product-line-item-image-size, 4em);\n height: var(--sc-product-line-item-image-size, 4em);\n flex: 0 0 var(--sc-product-line-item-image-size, 4em);\n object-fit: cover;\n border-radius: 4px;\n border: 1px solid var(--sc-color-gray-200);\n display: block;\n box-shadow: var(--sc-input-box-shadow);\n}\n:host([data-design=classic]) .bump__price--has-discount {\n display: flex;\n align-items: baseline;\n gap: var(--sc-spacing-x-small);\n}\n:host([data-design=classic]) .bump__price--has-discount .bump__original-price {\n text-decoration: line-through;\n color: var(--sc-color-gray-500);\n font-size: var(--sc-font-size-small);\n}\n:host([data-design=classic]) .bump__price .bump__new-price {\n font-size: var(--sc-font-size-large);\n color: var(--sc-color-gray-700);\n}\n:host([data-design=classic]) .bump__price .bump__interval {\n color: var(--sc-color-gray-500);\n}\n:host([data-design=classic]) .bump__amount {\n display: flex;\n align-items: center;\n gap: var(--sc-spacing-x-small);\n flex-wrap: wrap;\n margin-top: var(--sc-spacing-xx-small);\n}"; |
| 492 | const ScOrderBumpStyle0 = scOrderBumpCss; |
| 493 | |
| 494 | const ScOrderBump = class { |
| 495 | constructor(hostRef) { |
| 496 | index.registerInstance(this, hostRef); |
| 497 | /** Cached design mode */ |
| 498 | this.isModern = true; |
| 499 | this.bump = undefined; |
| 500 | this.showControl = undefined; |
| 501 | this.loading = false; |
| 502 | } |
| 503 | /** The bump line item */ |
| 504 | lineItem() { |
| 505 | var _a, _b, _c; |
| 506 | return (_c = (_b = (_a = mutations.state === null || mutations.state === void 0 ? void 0 : mutations.state.checkout) === null || _a === void 0 ? void 0 : _a.line_items) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.find(item => { var _a; return (item === null || item === void 0 ? void 0 : item.bump) === ((_a = this.bump) === null || _a === void 0 ? void 0 : _a.id); }); |
| 507 | } |
| 508 | /** Update the line item. */ |
| 509 | async updateLineItem() { |
| 510 | var _a, _b, _c; |
| 511 | if (this.loading) |
| 512 | return; |
| 513 | const price = ((_a = this.bump.price) === null || _a === void 0 ? void 0 : _a.id) || ((_b = this.bump) === null || _b === void 0 ? void 0 : _b.price); |
| 514 | const lineItem = this.lineItem(); |
| 515 | this.loading = true; |
| 516 | try { |
| 517 | if (lineItem) { |
| 518 | await mutations$1.removeCheckoutLineItem(lineItem.id); |
| 519 | index$3.speak(wp.i18n.__('Order bump Removed.', 'surecart')); |
| 520 | } |
| 521 | else { |
| 522 | await mutations$1.addCheckoutLineItem({ |
| 523 | bump: (_c = this.bump) === null || _c === void 0 ? void 0 : _c.id, |
| 524 | price, |
| 525 | quantity: 1, |
| 526 | }); |
| 527 | index$3.speak(wp.i18n.__('Order bump applied.', 'surecart')); |
| 528 | } |
| 529 | } |
| 530 | catch (e) { |
| 531 | console.error('[sc-order-bump] updateLineItem failed:', e); |
| 532 | index$3.speak(wp.i18n.__('Something went wrong. Please try again.', 'surecart')); |
| 533 | } |
| 534 | finally { |
| 535 | this.loading = false; |
| 536 | } |
| 537 | } |
| 538 | componentWillLoad() { |
| 539 | var _a; |
| 540 | this.isModern = !!((_a = window.scData) === null || _a === void 0 ? void 0 : _a.modern_order_bump); |
| 541 | this.el.setAttribute('data-design', this.isModern ? 'modern' : 'classic'); |
| 542 | } |
| 543 | componentDidLoad() { |
| 544 | var _a; |
| 545 | mutations$1.trackOrderBump((_a = this.bump) === null || _a === void 0 ? void 0 : _a.id); |
| 546 | } |
| 547 | renderInterval() { |
| 548 | var _a; |
| 549 | const interval = price.intervalString((_a = this.bump) === null || _a === void 0 ? void 0 : _a.price, { labels: { interval: '/', period: wp.i18n.__('for', 'surecart') } }); |
| 550 | if (!interval.trim().length) |
| 551 | return null; |
| 552 | return index.h("span", { class: "bump__interval" }, interval); |
| 553 | } |
| 554 | renderDiscount() { |
| 555 | var _a, _b, _c, _d, _e; |
| 556 | if (!!((_a = this.bump) === null || _a === void 0 ? void 0 : _a.amount_off)) { |
| 557 | return (index.h("div", { class: "bump__tag", part: "tag", "aria-label": |
| 558 | /** translators: %1$s: amount off, %2$s: currency */ |
| 559 | wp.i18n.sprintf(wp.i18n.__('You save %1$s%2$s.', 'surecart'), (_b = this.bump) === null || _b === void 0 ? void 0 : _b.amount_off, ((_c = this.bump) === null || _c === void 0 ? void 0 : _c.price).currency) }, index.h("span", { "aria-hidden": "true" }, wp.i18n._x('Save', 'Save money', 'surecart'), " ", (_d = this.bump) === null || _d === void 0 ? void 0 : |
| 560 | _d.amount_off_display_amount))); |
| 561 | } |
| 562 | if (!!((_e = this.bump) === null || _e === void 0 ? void 0 : _e.percent_off)) { |
| 563 | const percent = `${this.bump.percent_off}%`; |
| 564 | return (index.h("div", { class: "bump__tag", part: "tag", "aria-label": |
| 565 | /** translators: %s is the discount percentage (e.g. "10%"). */ |
| 566 | wp.i18n.sprintf(wp.i18n.__('You save %s.', 'surecart'), percent) }, index.h("span", { "aria-hidden": "true" }, wp.i18n.sprintf( |
| 567 | /** translators: %s is the discount percentage (e.g. "10%"). */ |
| 568 | wp.i18n._x('Save %s', 'Save money', 'surecart'), percent)))); |
| 569 | } |
| 570 | } |
| 571 | /** Modern price (no slot) */ |
| 572 | renderModernPrice() { |
| 573 | var _a, _b, _c, _d, _e, _f, _g, _h, _j; |
| 574 | return (index.h("div", { class: { 'bump__price': true, 'bump__price--has-discount': !!((_a = this.bump) === null || _a === void 0 ? void 0 : _a.percent_off) || !!((_b = this.bump) === null || _b === void 0 ? void 0 : _b.amount_off) }, part: "price" }, !!(((_c = this.bump) === null || _c === void 0 ? void 0 : _c.percent_off) || ((_d = this.bump) === null || _d === void 0 ? void 0 : _d.amount_off)) && (index.h("span", { "aria-label": |
| 575 | /** translators: %s: old price */ |
| 576 | wp.i18n.sprintf(wp.i18n.__('Originally priced at %s.', 'surecart'), (_e = this.bump) === null || _e === void 0 ? void 0 : _e.subtotal_display_amount), class: "bump__original-price" }, (_f = this.bump) === null || _f === void 0 ? void 0 : _f.subtotal_display_amount)), index.h("span", null, index.h("span", { "aria-hidden": "true" }, ((_g = this.bump) === null || _g === void 0 ? void 0 : _g.total_amount) === 0 && wp.i18n.__('Free', 'surecart'), ((_h = this.bump) === null || _h === void 0 ? void 0 : _h.total_amount) > 0 && index.h("span", { class: "bump__new-price" }, (_j = this.bump) === null || _j === void 0 ? void 0 : _j.total_display_amount), this.renderInterval())))); |
| 577 | } |
| 578 | /** Classic price (with slot="description") */ |
| 579 | renderClassicPrice() { |
| 580 | var _a, _b, _c, _d, _e, _f, _g, _h, _j; |
| 581 | return (index.h("div", { slot: "description", class: { 'bump__price': true, 'bump__price--has-discount': !!((_a = this.bump) === null || _a === void 0 ? void 0 : _a.percent_off) || !!((_b = this.bump) === null || _b === void 0 ? void 0 : _b.amount_off) }, part: "price" }, !!(((_c = this.bump) === null || _c === void 0 ? void 0 : _c.percent_off) || ((_d = this.bump) === null || _d === void 0 ? void 0 : _d.amount_off)) && (index.h("span", { "aria-label": |
| 582 | /** translators: %s: old price */ |
| 583 | wp.i18n.sprintf(wp.i18n.__('Originally priced at %s.', 'surecart'), (_e = this.bump) === null || _e === void 0 ? void 0 : _e.subtotal_display_amount), class: "bump__original-price" }, (_f = this.bump) === null || _f === void 0 ? void 0 : _f.subtotal_display_amount)), index.h("span", null, index.h("span", { "aria-hidden": "true" }, ((_g = this.bump) === null || _g === void 0 ? void 0 : _g.total_amount) === 0 && wp.i18n.__('Free', 'surecart'), ((_h = this.bump) === null || _h === void 0 ? void 0 : _h.total_amount) > 0 && index.h("span", { class: "bump__new-price" }, (_j = this.bump) === null || _j === void 0 ? void 0 : _j.total_display_amount), this.renderInterval())))); |
| 584 | } |
| 585 | /** Modern design: rounded button, inline image, no checkbox */ |
| 586 | renderModern() { |
| 587 | var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p; |
| 588 | const product = (_b = (_a = this.bump) === null || _a === void 0 ? void 0 : _a.price) === null || _b === void 0 ? void 0 : _b.product; |
| 589 | const lineItem = this.lineItem(); |
| 590 | return (index.h("sc-choice", { value: (_c = this.bump) === null || _c === void 0 ? void 0 : _c.id, type: "checkbox", showControl: false, checked: !!lineItem, exportparts: "base:choice__base, content:choice__content" }, index.h("div", { part: "base-content", class: "bump", onClick: e => e.stopPropagation(), onKeyDown: e => { |
| 591 | if (e.key === 'Enter' || e.key === ' ') |
| 592 | e.stopPropagation(); |
| 593 | } }, !!((_d = product === null || product === void 0 ? void 0 : product.line_item_image) === null || _d === void 0 ? void 0 : _d.src) && index.h("img", { ...product === null || product === void 0 ? void 0 : product.line_item_image, class: "bump__image", part: "image" }), index.h("div", { class: "bump__text", part: "text" }, index.h("div", { class: "bump__title", part: "title", "aria-label": wp.i18n.sprintf( |
| 594 | /* translators: %s: order bump name */ |
| 595 | wp.i18n.__('Product: %s.', 'surecart'), ((_e = this.bump) === null || _e === void 0 ? void 0 : _e.name) || (product === null || product === void 0 ? void 0 : product.name)) }, index.h("span", { "aria-hidden": "true" }, ((_f = this.bump) === null || _f === void 0 ? void 0 : _f.name) || (product === null || product === void 0 ? void 0 : product.name))), !!((_h = (_g = this.bump) === null || _g === void 0 ? void 0 : _g.metadata) === null || _h === void 0 ? void 0 : _h.cta) && (index.h("div", { class: "bump__cta", part: "cta" }, index.h("span", null, (_k = (_j = this.bump) === null || _j === void 0 ? void 0 : _j.metadata) === null || _k === void 0 ? void 0 : _k.cta))), index.h("div", { class: "bump__amount", part: "amount" }, this.renderModernPrice(), this.renderDiscount()), !!((_m = (_l = this.bump) === null || _l === void 0 ? void 0 : _l.metadata) === null || _m === void 0 ? void 0 : _m.description) && (index.h("div", { class: "bump__description", part: "description", "aria-label": wp.i18n.sprintf( |
| 596 | /* translators: %s: Product description */ |
| 597 | wp.i18n.__('Product description: %s.', 'surecart'), (_o = this.bump) === null || _o === void 0 ? void 0 : _o.rendered_description) }, index.h("span", { "aria-hidden": "true", innerHTML: (_p = this.bump) === null || _p === void 0 ? void 0 : _p.rendered_description })))), index.h("button", { type: "button", class: { |
| 598 | 'bump__button': true, |
| 599 | 'bump__button--checked': !!lineItem, |
| 600 | 'bump__button--loading': this.loading, |
| 601 | }, part: "button", onClick: () => this.updateLineItem(), "aria-label": lineItem ? wp.i18n.__('Remove from order', 'surecart') : wp.i18n.__('Add to order', 'surecart'), "aria-pressed": !!lineItem, "aria-busy": this.loading }, this.loading ? index.h("sc-spinner", null) : index.h("sc-icon", { name: lineItem ? 'check' : 'plus' }))))); |
| 602 | } |
| 603 | /** Classic design: checkbox control, footer with divider + image + description */ |
| 604 | renderClassic() { |
| 605 | var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t; |
| 606 | const product = (_b = (_a = this.bump) === null || _a === void 0 ? void 0 : _a.price) === null || _b === void 0 ? void 0 : _b.product; |
| 607 | return (index.h("sc-choice", { value: (_c = this.bump) === null || _c === void 0 ? void 0 : _c.id, type: "checkbox", showControl: this.showControl, checked: !!this.lineItem(), disabled: this.loading, onClick: e => { |
| 608 | e.preventDefault(); |
| 609 | e.stopImmediatePropagation(); |
| 610 | this.updateLineItem(); |
| 611 | }, onKeyDown: e => { |
| 612 | if (e.key === 'Enter' || e.key === ' ') { |
| 613 | e.preventDefault(); |
| 614 | e.stopImmediatePropagation(); |
| 615 | this.updateLineItem(); |
| 616 | } |
| 617 | }, exportparts: "base, control, checked-icon, title" }, index.h("div", { part: "base-content", class: "bump" }, index.h("div", { class: "bump__text" }, index.h("div", { class: "bump__title", "aria-label": wp.i18n.sprintf( |
| 618 | /* translators: %s: order bump name */ |
| 619 | wp.i18n.__('Product: %s.', 'surecart'), ((_e = (_d = this.bump) === null || _d === void 0 ? void 0 : _d.metadata) === null || _e === void 0 ? void 0 : _e.cta) || ((_f = this.bump) === null || _f === void 0 ? void 0 : _f.name) || (product === null || product === void 0 ? void 0 : product.name)) }, index.h("span", { "aria-hidden": "true" }, ((_h = (_g = this.bump) === null || _g === void 0 ? void 0 : _g.metadata) === null || _h === void 0 ? void 0 : _h.cta) || ((_j = this.bump) === null || _j === void 0 ? void 0 : _j.name) || (product === null || product === void 0 ? void 0 : product.name))), index.h("div", { class: "bump__amount" }, this.renderClassicPrice(), this.renderDiscount()))), ((_l = (_k = this.bump) === null || _k === void 0 ? void 0 : _k.metadata) === null || _l === void 0 ? void 0 : _l.description) && (index.h("div", { slot: "footer", class: "bump__product--wrapper" }, index.h("sc-divider", { style: { '--spacing': 'var(--sc-spacing-medium)' } }), index.h("div", { class: "bump__product" }, !!((_m = product === null || product === void 0 ? void 0 : product.line_item_image) === null || _m === void 0 ? void 0 : _m.src) && index.h("img", { ...product === null || product === void 0 ? void 0 : product.line_item_image, class: "bump__image" }), index.h("div", { class: "bump__product-text" }, !!((_p = (_o = this.bump) === null || _o === void 0 ? void 0 : _o.metadata) === null || _p === void 0 ? void 0 : _p.cta) && (index.h("div", { class: "bump__product-title", "aria-hidden": "true" }, this.bump.name || (product === null || product === void 0 ? void 0 : product.name))), !!((_r = (_q = this.bump) === null || _q === void 0 ? void 0 : _q.metadata) === null || _r === void 0 ? void 0 : _r.description) && (index.h("div", { class: "bump__product-description", "aria-label": wp.i18n.sprintf( |
| 620 | /* translators: %s: Product description */ |
| 621 | wp.i18n.__('Product description: %s.', 'surecart'), (_s = this.bump) === null || _s === void 0 ? void 0 : _s.rendered_description) }, index.h("span", { "aria-hidden": "true", innerHTML: (_t = this.bump) === null || _t === void 0 ? void 0 : _t.rendered_description }))))))))); |
| 622 | } |
| 623 | render() { |
| 624 | return this.isModern ? this.renderModern() : this.renderClassic(); |
| 625 | } |
| 626 | get el() { return index.getElement(this); } |
| 627 | }; |
| 628 | ScOrderBump.style = ScOrderBumpStyle0; |
| 629 | |
| 630 | const scOrderBumpsCss = ":host{display:block}.bumps__list{display:grid;gap:10px}"; |
| 631 | const ScOrderBumpsStyle0 = scOrderBumpsCss; |
| 632 | |
| 633 | const ScOrderBumps = class { |
| 634 | constructor(hostRef) { |
| 635 | index.registerInstance(this, hostRef); |
| 636 | this.label = undefined; |
| 637 | this.help = undefined; |
| 638 | this.showControl = undefined; |
| 639 | this.hideAddedItems = undefined; |
| 640 | } |
| 641 | /** Check if a bump is already added as a line item. */ |
| 642 | isBumpAdded(bumpId) { |
| 643 | var _a, _b; |
| 644 | return (((_b = (_a = mutations.state === null || mutations.state === void 0 ? void 0 : mutations.state.checkout) === null || _a === void 0 ? void 0 : _a.line_items) === null || _b === void 0 ? void 0 : _b.data) || []).some(item => (item === null || item === void 0 ? void 0 : item.bump) === bumpId); |
| 645 | } |
| 646 | render() { |
| 647 | var _a, _b; |
| 648 | const bumps = (((_b = (_a = mutations.state === null || mutations.state === void 0 ? void 0 : mutations.state.checkout) === null || _a === void 0 ? void 0 : _a.recommended_bumps) === null || _b === void 0 ? void 0 : _b.data) || []).filter(bump => { |
| 649 | var _a, _b, _c, _d; |
| 650 | // exclude variants for now. |
| 651 | if (((_d = (_c = (_b = (_a = bump === null || bump === void 0 ? void 0 : bump.price) === null || _a === void 0 ? void 0 : _a.product) === null || _b === void 0 ? void 0 : _b.variants) === null || _c === void 0 ? void 0 : _c.pagination) === null || _d === void 0 ? void 0 : _d.count) !== 0) { |
| 652 | return false; |
| 653 | } |
| 654 | // optionally exclude bumps already added to the checkout. |
| 655 | if (this.hideAddedItems && this.isBumpAdded(bump === null || bump === void 0 ? void 0 : bump.id)) { |
| 656 | return false; |
| 657 | } |
| 658 | return true; |
| 659 | }); |
| 660 | if (!(bumps === null || bumps === void 0 ? void 0 : bumps.length)) { |
| 661 | return null; |
| 662 | } |
| 663 | return (index.h("sc-form-control", { label: this.label || wp.i18n.__('Recommended', 'surecart'), help: this.help }, index.h("div", { class: "bumps__list", "aria-label": wp.i18n.__('Order bump summary', 'surecart') }, bumps.map(bump => (index.h("sc-order-bump", { key: bump === null || bump === void 0 ? void 0 : bump.id, bump: bump, showControl: this.showControl, exportparts: "choice__base, choice__content, base-content, image, text, title, cta, amount, price, tag, description, button, base, control, checked-icon" })))))); |
| 664 | } |
| 665 | }; |
| 666 | ScOrderBumps.style = ScOrderBumpsStyle0; |
| 667 | |
| 668 | const scOrderShippingAddressCss = ":host{display:block}.sc-order-shipping__loading{display:flex;flex-direction:column;gap:0.5em}"; |
| 669 | const ScOrderShippingAddressStyle0 = scOrderShippingAddressCss; |
| 670 | |
| 671 | const ScOrderShippingAddress = class { |
| 672 | constructor(hostRef) { |
| 673 | index.registerInstance(this, hostRef); |
| 674 | /** Names for the address */ |
| 675 | this.names = { |
| 676 | name: 'shipping_name', |
| 677 | country: 'shipping_country', |
| 678 | city: 'shipping_city', |
| 679 | line_1: 'shipping_line_1', |
| 680 | line_2: 'shipping_line_2', |
| 681 | postal_code: 'shipping_postal_code', |
| 682 | state: 'shipping_state', |
| 683 | }; |
| 684 | this.label = undefined; |
| 685 | this.required = false; |
| 686 | this.full = undefined; |
| 687 | this.showName = undefined; |
| 688 | this.defaultCountry = undefined; |
| 689 | this.showLine2 = undefined; |
| 690 | this.requireName = false; |
| 691 | this.address = { |
| 692 | country: null, |
| 693 | city: null, |
| 694 | line_1: null, |
| 695 | line_2: null, |
| 696 | postal_code: null, |
| 697 | state: null, |
| 698 | }; |
| 699 | } |
| 700 | async updateAddressState(address) { |
| 701 | var _a; |
| 702 | if (JSON.stringify(address) === JSON.stringify(this.address)) |
| 703 | return; // no change, don't update. |
| 704 | this.address = address; |
| 705 | try { |
| 706 | mutations$1.lockCheckout('shipping-address'); |
| 707 | mutations.state.checkout = (await index$2.createOrUpdateCheckout({ |
| 708 | id: (_a = mutations.state.checkout) === null || _a === void 0 ? void 0 : _a.id, |
| 709 | data: { |
| 710 | shipping_address: this.address, |
| 711 | }, |
| 712 | })); |
| 713 | } |
| 714 | catch (e) { |
| 715 | console.error(e); |
| 716 | } |
| 717 | finally { |
| 718 | mutations$1.unLockCheckout('shipping-address'); |
| 719 | } |
| 720 | } |
| 721 | async reportValidity() { |
| 722 | var _a, _b; |
| 723 | if (!this.input) |
| 724 | return true; |
| 725 | return (_b = (_a = this.input) === null || _a === void 0 ? void 0 : _a.reportValidity) === null || _b === void 0 ? void 0 : _b.call(_a); |
| 726 | } |
| 727 | prefillAddress() { |
| 728 | var _a; |
| 729 | // Autofill is handled by sc-checkout-autofill-provider which patches checkoutState.checkout with any logged-in customer profile data. |
| 730 | if (index$1.isAddressEmpty(this.address)) { |
| 731 | this.address = { ...this.address, ...(_a = mutations.state.checkout) === null || _a === void 0 ? void 0 : _a.shipping_address }; |
| 732 | } |
| 733 | } |
| 734 | componentWillLoad() { |
| 735 | var _a; |
| 736 | if (this.defaultCountry && !((_a = this.address) === null || _a === void 0 ? void 0 : _a.country)) { |
| 737 | this.address.country = this.defaultCountry; |
| 738 | } |
| 739 | this.prefillAddress(); |
| 740 | mutations.onChange('checkout', () => this.prefillAddress()); |
| 741 | } |
| 742 | render() { |
| 743 | // use full if checkout requires it, it's set, or we're showing/requiring name field. |
| 744 | if (getters$1.fullShippingAddressRequired() || this.full || this.requireName || this.showName) { |
| 745 | return (index.h("sc-address", { exportparts: "label, help-text, form-control, input__base, select__base, columns, search__base, menu__base", ref: el => (this.input = el), label: this.label || wp.i18n.__('Shipping Address', 'surecart'), names: this.names, required: this.required || getters$1.shippingAddressRequired(), loading: getters.formLoading(), address: this.address, "show-name": this.showName, "require-name": this.requireName, "show-line-2": this.showLine2, onScChangeAddress: e => this.updateAddressState(e.detail) })); |
| 746 | } |
| 747 | return (index.h("sc-compact-address", { ref: el => (this.input = el), required: this.required || getters$1.shippingAddressRequired(), loading: getters.formLoading(), address: this.address, names: this.names, label: this.label, onScChangeAddress: e => this.updateAddressState(e.detail) })); |
| 748 | } |
| 749 | }; |
| 750 | ScOrderShippingAddress.style = ScOrderShippingAddressStyle0; |
| 751 | |
| 752 | const scOrderTaxIdInputCss = ":host{display:block}"; |
| 753 | const ScOrderTaxIdInputStyle0 = scOrderTaxIdInputCss; |
| 754 | |
| 755 | const ScOrderTaxIdInput = class { |
| 756 | constructor(hostRef) { |
| 757 | index.registerInstance(this, hostRef); |
| 758 | this.show = false; |
| 759 | this.otherLabel = undefined; |
| 760 | this.caGstLabel = undefined; |
| 761 | this.auAbnLabel = undefined; |
| 762 | this.gbVatLabel = undefined; |
| 763 | this.euVatLabel = undefined; |
| 764 | this.helpText = undefined; |
| 765 | this.taxIdTypes = undefined; |
| 766 | this.required = false; |
| 767 | this.taxIdTypesData = []; |
| 768 | } |
| 769 | handleTaxIdTypesChange() { |
| 770 | this.taxIdTypesData = typeof this.taxIdTypes === 'string' ? JSON.parse(this.taxIdTypes) : this.taxIdTypes; |
| 771 | } |
| 772 | async reportValidity() { |
| 773 | return this.input.reportValidity(); |
| 774 | } |
| 775 | getStatus() { |
| 776 | var _a, _b, _c, _d, _e; |
| 777 | if (((_b = (_a = mutations.state.checkout) === null || _a === void 0 ? void 0 : _a.tax_identifier) === null || _b === void 0 ? void 0 : _b.number_type) !== 'eu_vat') { |
| 778 | return 'unknown'; |
| 779 | } |
| 780 | if (((_c = mutations.state.taxProtocol) === null || _c === void 0 ? void 0 : _c.eu_vat_unverified_behavior) === 'apply_reverse_charge') { |
| 781 | return 'unknown'; |
| 782 | } |
| 783 | return ((_e = (_d = mutations.state.checkout) === null || _d === void 0 ? void 0 : _d.tax_identifier) === null || _e === void 0 ? void 0 : _e.eu_vat_verified) ? 'valid' : 'invalid'; |
| 784 | } |
| 785 | async updateOrder(tax_identifier) { |
| 786 | try { |
| 787 | mutations.updateFormState('FETCH'); |
| 788 | mutations.state.checkout = (await index$2.createOrUpdateCheckout({ |
| 789 | id: mutations.state.checkout.id, |
| 790 | data: { tax_identifier }, |
| 791 | })); |
| 792 | mutations.updateFormState('RESOLVE'); |
| 793 | } |
| 794 | catch (e) { |
| 795 | console.error(e); |
| 796 | mutations$2.createErrorNotice(e); |
| 797 | mutations.updateFormState('REJECT'); |
| 798 | } |
| 799 | } |
| 800 | componentWillLoad() { |
| 801 | this.handleTaxIdTypesChange(); |
| 802 | } |
| 803 | isRequired() { |
| 804 | var _a, _b, _c, _d; |
| 805 | // If the block has explicitly set required, use that value. |
| 806 | if (this.required) { |
| 807 | return true; |
| 808 | } |
| 809 | // Only apply EU VAT requirement if eu_vat is one of the allowed tax types. |
| 810 | // If taxIdTypesData is empty, all types are allowed. |
| 811 | const isEuVatAllowed = !((_a = this.taxIdTypesData) === null || _a === void 0 ? void 0 : _a.length) || this.taxIdTypesData.includes('eu_vat'); |
| 812 | // Fall back to EU VAT protocol requirement only if EU VAT is an allowed type. |
| 813 | return isEuVatAllowed && ((_b = mutations.state.taxProtocol) === null || _b === void 0 ? void 0 : _b.eu_vat_required) && ((_d = (_c = mutations.state.checkout) === null || _c === void 0 ? void 0 : _c.tax_identifier) === null || _d === void 0 ? void 0 : _d.number_type) === 'eu_vat'; |
| 814 | } |
| 815 | render() { |
| 816 | var _a, _b, _c, _d, _e, _f, _g; |
| 817 | return (index.h("sc-tax-id-input", { key: 'a1025cc63d419d9d2ea88b5926249a7ba105156a', ref: el => (this.input = el), show: this.show, number: (_b = (_a = mutations.state.checkout) === null || _a === void 0 ? void 0 : _a.tax_identifier) === null || _b === void 0 ? void 0 : _b.number, type: ((_d = (_c = mutations.state.checkout) === null || _c === void 0 ? void 0 : _c.tax_identifier) === null || _d === void 0 ? void 0 : _d.number_type) || ((_e = this.taxIdTypesData) === null || _e === void 0 ? void 0 : _e[0]) || 'eu_vat', country: (_g = (_f = mutations.state.checkout) === null || _f === void 0 ? void 0 : _f.shipping_address) === null || _g === void 0 ? void 0 : _g.country, status: this.getStatus(), loading: getters.formBusy(), onScChange: e => { |
| 818 | e.stopImmediatePropagation(); |
| 819 | this.updateOrder(e.detail); |
| 820 | }, otherLabel: this.otherLabel, caGstLabel: this.caGstLabel, auAbnLabel: this.auAbnLabel, gbVatLabel: this.gbVatLabel, euVatLabel: this.euVatLabel, help: this.helpText, taxIdTypes: this.taxIdTypesData, required: this.isRequired() })); |
| 821 | } |
| 822 | static get watchers() { return { |
| 823 | "taxIdTypes": ["handleTaxIdTypesChange"] |
| 824 | }; } |
| 825 | }; |
| 826 | ScOrderTaxIdInput.style = ScOrderTaxIdInputStyle0; |
| 827 | |
| 828 | const scRadioCss = ":host{display:inline-block}::slotted([slot=description]){display:block;color:var(--sc-radio-description-color, var(--sc-input-help-text-color, var(--sc-color-gray-500)));line-height:var(--sc-line-height-dense);margin:0.5em 0 0;font-size:var(--sc-font-size-small)}.radio{display:inline-flex;align-items:flex-start;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;gap:var(--sc-spacing-xx-small)}.radio:not(.radio--editing){cursor:pointer}.radio__icon{display:inline-flex;width:var(--sc-radio-size);height:var(--sc-radio-size)}.radio__icon svg{width:100%;height:100%}.radio__control{flex:0 0 auto;position:relative;display:inline-flex;align-items:center;justify-content:center;width:var(--sc-radio-size);height:var(--sc-radio-size);border:solid var(--sc-input-border-width) var(--sc-input-border-color);border-radius:50%;background-color:var(--sc-input-background-color);color:transparent;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}.radio__control input[type=radio]{position:absolute;opacity:0;padding:0;margin:0;pointer-events:none}.radio:not(.radio--checked):not(.radio--disabled) .radio__control:hover{border-color:var(--sc-input-border-color-hover);background-color:var(--sc-input-background-color-hover)}.radio.radio--focused:not(.radio--checked):not(.radio--disabled) .radio__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)}.radio--checked .radio__control{color:var(--var-sc-checked-radio-background-color, var(--sc-input-background-color));border-color:var(--sc-color-primary-500);background-color:var(--sc-color-primary-500)}.radio.radio--checked:not(.radio--disabled) .radio__control:hover{opacity:0.8}.radio.radio--checked:not(.radio--disabled).radio--focused .radio__control{border-color:var(--var-sc-checked-radio-border-color, var(--sc-input-background-color));background-color:var(--sc-color-primary-500);box-shadow:0 0 0 var(--sc-focus-ring-width) var(--sc-focus-ring-color-primary)}.radio--disabled{opacity:0.5;cursor:not-allowed}.radio:not(.radio--checked) svg circle{opacity:0}.radio__label{line-height:var(--sc-radio-size);margin-left:0.5em;user-select:none}"; |
| 829 | const ScRadioStyle0 = scRadioCss; |
| 830 | |
| 831 | let id = 0; |
| 832 | const ScRadio = class { |
| 833 | constructor(hostRef) { |
| 834 | index.registerInstance(this, hostRef); |
| 835 | this.scBlur = index.createEvent(this, "scBlur", 7); |
| 836 | this.scChange = index.createEvent(this, "scChange", 7); |
| 837 | this.scFocus = index.createEvent(this, "scFocus", 7); |
| 838 | this.inputId = `radio-${++id}`; |
| 839 | this.labelId = `radio-label-${id}`; |
| 840 | this.hasFocus = false; |
| 841 | this.name = undefined; |
| 842 | this.value = undefined; |
| 843 | this.disabled = false; |
| 844 | this.checked = false; |
| 845 | this.required = false; |
| 846 | this.invalid = false; |
| 847 | this.edit = undefined; |
| 848 | } |
| 849 | /** Simulates a click on the radio. */ |
| 850 | async ceClick() { |
| 851 | this.input.click(); |
| 852 | } |
| 853 | /** Checks for validity and shows the browser's validation message if the control is invalid. */ |
| 854 | async reportValidity() { |
| 855 | this.invalid = !this.input.checkValidity(); |
| 856 | return this.input.reportValidity(); |
| 857 | } |
| 858 | handleCheckedChange() { |
| 859 | if (!this.input) |
| 860 | return; |
| 861 | if (this.checked) { |
| 862 | this.getSiblingRadios().map(radio => (radio.checked = false)); |
| 863 | } |
| 864 | this.input.checked = this.checked; |
| 865 | this.scChange.emit(); |
| 866 | } |
| 867 | handleClick() { |
| 868 | this.checked = true; |
| 869 | } |
| 870 | handleBlur() { |
| 871 | this.hasFocus = false; |
| 872 | this.scBlur.emit(); |
| 873 | } |
| 874 | handleFocus() { |
| 875 | this.hasFocus = true; |
| 876 | this.scFocus.emit(); |
| 877 | } |
| 878 | /** Sets a custom validation message. If `message` is not empty, the field will be considered invalid. */ |
| 879 | setCustomValidity(message) { |
| 880 | this.input.setCustomValidity(message); |
| 881 | this.invalid = !this.input.checkValidity(); |
| 882 | } |
| 883 | getAllRadios() { |
| 884 | const radioGroup = this.el.closest('sc-radio-group'); |
| 885 | // Radios must be part of a radio group |
| 886 | if (!radioGroup) { |
| 887 | return []; |
| 888 | } |
| 889 | return [...radioGroup.querySelectorAll('sc-radio')]; |
| 890 | } |
| 891 | getSiblingRadios() { |
| 892 | return this.getAllRadios().filter(radio => radio !== this.el); |
| 893 | } |
| 894 | handleKeyDown(event) { |
| 895 | if (this.edit) |
| 896 | return true; |
| 897 | if (['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'].includes(event.key)) { |
| 898 | const radios = this.getAllRadios().filter(radio => !radio.disabled); |
| 899 | const incr = ['ArrowUp', 'ArrowLeft'].includes(event.key) ? -1 : 1; |
| 900 | let index = radios.indexOf(this.el) + incr; |
| 901 | if (index < 0) |
| 902 | index = radios.length - 1; |
| 903 | if (index > radios.length - 1) |
| 904 | index = 0; |
| 905 | this.getAllRadios().map(radio => (radio.checked = false)); |
| 906 | radios[index].focus(); |
| 907 | radios[index].checked = true; |
| 908 | event.preventDefault(); |
| 909 | } |
| 910 | } |
| 911 | // Prevent clicks on the label from briefly blurring the input |
| 912 | handleMouseDown(event) { |
| 913 | if (this.edit) |
| 914 | return true; |
| 915 | event.preventDefault(); |
| 916 | this.input.focus(); |
| 917 | } |
| 918 | componentDidLoad() { |
| 919 | this.formController = new formData.FormSubmitController(this.el, { |
| 920 | value: (control) => (control.checked ? control.value : undefined), |
| 921 | }).addFormData(); |
| 922 | } |
| 923 | disconnectedCallback() { |
| 924 | var _a; |
| 925 | (_a = this.formController) === null || _a === void 0 ? void 0 : _a.removeFormData(); |
| 926 | } |
| 927 | render() { |
| 928 | const Tag = this.edit ? 'div' : 'label'; |
| 929 | return (index.h(Tag, { key: '19d5762b6350887c46422f2f0b1af8c9df70deab', part: "base", class: { |
| 930 | 'radio': true, |
| 931 | 'radio--checked': this.checked, |
| 932 | 'radio--disabled': this.disabled, |
| 933 | 'radio--focused': this.hasFocus, |
| 934 | 'radio--editing': this.edit, |
| 935 | }, htmlFor: this.inputId, onKeyDown: e => this.handleKeyDown(e), onMouseDown: e => this.handleMouseDown(e) }, index.h("span", { key: '8f085a092c452cff7bbfad644c6701ff7a3e6d6f', part: "control", class: "radio__control" }, index.h("span", { key: '437c748392090b6b5952eca8fc8b35aa31710cce', part: "checked-icon", class: "radio__icon" }, index.h("svg", { key: '5bd54bdec3563d55abb2375c3ab9d5123e812761', viewBox: "0 0 16 16" }, index.h("g", { key: '3dd7070bb8f45f07e11c80c511df432523a959a7', stroke: "none", "stroke-width": "1", fill: "none", "fill-rule": "evenodd" }, index.h("g", { key: '9b86f8022a20d9e0e7a4c10211c69d50053df9a2', fill: "currentColor" }, index.h("circle", { key: '8dbbcc8b1266b94dd4fd0b9925c7ce9c59c7cc75', cx: "8", cy: "8", r: "3.42857143" }))))), index.h("input", { key: 'ebd16e07d9674bf0c59d2bc990e9dec11a4f18b4', id: this.inputId, ref: el => (this.input = el), type: "radio", name: this.name, value: this.value, checked: this.checked, disabled: this.disabled, required: this.required, "aria-checked": this.checked ? 'true' : 'false', "aria-disabled": this.disabled ? 'true' : 'false', "aria-labelledby": this.labelId, onClick: () => this.handleClick(), onBlur: () => this.handleBlur(), onFocus: () => this.handleFocus() })), index.h("span", { key: 'bd64e86da262e70d1e13ff36c9ab902b5ab0a7a6', part: "label", id: this.labelId, class: "radio__label" }, index.h("slot", { key: '482c49a3702df3f524846736d3f12da5866bbed5' }), index.h("slot", { key: '4d16b4c7c545680398a739c28bce1d2ebfd3acfc', name: "description" })))); |
| 936 | } |
| 937 | get el() { return index.getElement(this); } |
| 938 | static get watchers() { return { |
| 939 | "checked": ["handleCheckedChange"] |
| 940 | }; } |
| 941 | }; |
| 942 | ScRadio.style = ScRadioStyle0; |
| 943 | |
| 944 | const scRadioGroupCss = ":host{display:block}.radio-group{border:none;padding:0;margin:0;min-width:0}.radio-group .radio-group__label{display:inline-block;padding:0;color:var(--sc-input-label-color);font-weight:var(--sc-input-label-font-weight);text-transform:var(--sc-input-label-text-transform, none);letter-spacing:var(--sc-input-label-letter-spacing, 0);margin-bottom:var(--sc-input-label-margin)}.radio-group__hidden-input{position:absolute;opacity:0;padding:0px;margin:0px;pointer-events:none}.radio-group--is-required .radio-group__label:after{content:\" *\";color:var(--sc-color-danger-500)}::slotted(sc-radio:not(:last-of-type)){display:block;margin-bottom:var(--sc-spacing-x-small)}.radio-group--is-rtl.radio-group,.radio-group--is-rtl.radio-group .radio-group__label{text-align:right}"; |
| 945 | const ScRadioGroupStyle0 = scRadioGroupCss; |
| 946 | |
| 947 | const ScRadioGroup = class { |
| 948 | constructor(hostRef) { |
| 949 | index.registerInstance(this, hostRef); |
| 950 | this.scChange = index.createEvent(this, "scChange", 7); |
| 951 | this.label = ''; |
| 952 | this.invalid = undefined; |
| 953 | this.value = ''; |
| 954 | this.required = undefined; |
| 955 | } |
| 956 | /** Checks for validity and shows the browser's validation message if the control is invalid. */ |
| 957 | async reportValidity() { |
| 958 | this.invalid = !this.input.checkValidity(); |
| 959 | return this.input.reportValidity(); |
| 960 | } |
| 961 | handleRadioClick(event) { |
| 962 | if (event.target.tagName !== 'SC-RADIO') |
| 963 | return; |
| 964 | event.stopImmediatePropagation(); |
| 965 | const target = event.target; |
| 966 | if (target.disabled) { |
| 967 | return; |
| 968 | } |
| 969 | if (target.checked) { |
| 970 | this.value = target.value; |
| 971 | this.scChange.emit(target.value); |
| 972 | } |
| 973 | } |
| 974 | componentDidLoad() { |
| 975 | const choices = [...this.el.querySelectorAll('sc-radio')]; |
| 976 | choices.forEach(choice => { |
| 977 | if (choice.checked) { |
| 978 | this.value = choice.value; |
| 979 | } |
| 980 | }); |
| 981 | } |
| 982 | render() { |
| 983 | return (index.h("fieldset", { key: '0d9a4ba13a02ca240257a1ea54439573d4bbd5cc', part: "base", class: { |
| 984 | 'radio-group': true, |
| 985 | 'radio-group--invalid': this.invalid, |
| 986 | 'radio-group--is-required': this.required, |
| 987 | 'radio-group--is-rtl': pageAlign.isRtl(), |
| 988 | }, "aria-invalid": this.invalid, role: "radiogroup" }, index.h("legend", { key: '3c21b9c1d8ef448d07edf1e108f6085459dace07', part: "label", class: "radio-group__label" }, index.h("slot", { key: '2c72f2c65b564a707c9dbb25c054f30c816b3ae3', name: "label" }, this.label)), index.h("input", { key: 'db34f962b73dc1f4c976b841204963fa3068b05c', type: "text", class: "radio-group__hidden-input", ref: el => (this.input = el), required: this.required, value: this.value, tabindex: "-1" }), index.h("div", { key: 'f6c015bd02e42caf4c1e1a2441f1974ac0b7bf28', part: "items", class: "radio-group__items" }, index.h("slot", { key: '11abc8a0e5f0cf8979820facdf61749dda257d97' })))); |
| 989 | } |
| 990 | get el() { return index.getElement(this); } |
| 991 | }; |
| 992 | ScRadioGroup.style = ScRadioGroupStyle0; |
| 993 | |
| 994 | const scShippingChoicesCss = ":host{display:block}.shipping-choice{width:100%;padding:var(--sc-spacing-medium);margin:0;box-sizing:border-box;border-bottom:var(--sc-input-border, 1px solid var(--sc-color-gray-300));background-color:var(--sc-shipping-choice-background-color, var(--sc-input-background-color))}.shipping-choice__empty{background:var(--sc-alert-background-color, var(--sc-color-gray-100));opacity:0.75;padding:var(--sc-spacing-large);border-radius:var(--sc-input-border-radius-medium);line-height:var(--sc-line-height-dense);font-size:var(--sc-font-size-small);border:solid 1px var(--sc-input-border-color, var(--sc-input-border))}.shipping-choice:last-child{border-bottom-width:0}.shipping-choice__text{display:flex;flex-direction:column;gap:var(--sc-spacing-xx-small)}.shipping-choice__price{color:var(--sc-input-label-color);font-weight:var(--sc-price-choice-price-font-weight, var(--sc-font-weight-normal));white-space:nowrap;display:var(--sc-shipping-choice-price-display, inherit)}.shipping-choice__name{display:inline-block;color:var(--sc-price-choice-name-color, var(--sc-input-label-color));font-size:var(--sc-price-choice-name-size, var(--sc-input-label-font-size-medium));font-weight:var(--sc-price-choice-name-font-weight, var(--sc-font-weight-bold));text-transform:var(--sc-price-choice-text-transform, var(--sc-input-label-text-transform, none));line-height:var(--sc-shipping-name-line-height, 1)}.shipping-choice__description{color:var(--sc-input-label-color);font-weight:var(--sc-price-choice-price-font-weight, var(--sc-font-weight-normal));line-height:var(--sc-shipping-description-line-height, 1.2)}sc-radio-group::part(items){border:var(--sc-input-border, 1px solid var(--sc-color-gray-300));border-radius:var(--sc-shipping-choice-border-radius, var(--sc-input-border-radius-medium));box-shadow:var(--sc-shipping-box-shadow, var(--sc-input-box-shadow));overflow:hidden;position:relative}sc-radio::part(base){width:100%}sc-radio::part(label){width:100%;display:flex;justify-content:space-between;gap:var(--sc-spacing-small)}sc-radio-group::slotted(sc-radio:not(:last-of-type)){margin-bottom:0}"; |
| 995 | const ScShippingChoicesStyle0 = scShippingChoicesCss; |
| 996 | |
| 997 | const ScShippingChoices = class { |
| 998 | constructor(hostRef) { |
| 999 | index.registerInstance(this, hostRef); |
| 1000 | this.label = undefined; |
| 1001 | this.showDescription = true; |
| 1002 | this.shippingChoices = undefined; |
| 1003 | } |
| 1004 | /** Maybe update the order. */ |
| 1005 | async updateCheckout(selectedShippingChoiceId) { |
| 1006 | if (!selectedShippingChoiceId) |
| 1007 | return; |
| 1008 | try { |
| 1009 | mutations$1.lockCheckout('selected_shipping_choice'); |
| 1010 | mutations.state.checkout = (await index$2.createOrUpdateCheckout({ |
| 1011 | id: mutations.state.checkout.id, |
| 1012 | data: { |
| 1013 | selected_shipping_choice_id: selectedShippingChoiceId, |
| 1014 | }, |
| 1015 | })); |
| 1016 | index$3.speak(wp.i18n.__('Shipping choice updated.', 'surecart'), 'assertive'); |
| 1017 | const { total_amount, currency } = mutations.state.checkout; |
| 1018 | /** translators: %1$s: formatted amount */ |
| 1019 | index$3.speak(wp.i18n.sprintf(wp.i18n.__('Your order total has changed to: %1$s.', 'surecart'), price.getFormattedPrice({ amount: total_amount, currency })), 'assertive'); |
| 1020 | } |
| 1021 | catch (e) { |
| 1022 | console.error(e); |
| 1023 | mutations$2.createErrorNotice(e); |
| 1024 | } |
| 1025 | finally { |
| 1026 | mutations$1.unLockCheckout('selected_shipping_choice'); |
| 1027 | } |
| 1028 | } |
| 1029 | render() { |
| 1030 | var _a, _b, _c, _d, _e; |
| 1031 | const choices = this.shippingChoices || ((_b = (_a = mutations.state === null || mutations.state === void 0 ? void 0 : mutations.state.checkout) === null || _a === void 0 ? void 0 : _a.shipping_choices) === null || _b === void 0 ? void 0 : _b.data); |
| 1032 | // When not using prop override, apply checkout state guards. |
| 1033 | if (!this.shippingChoices) { |
| 1034 | // shipping choice is not required. |
| 1035 | if (!((_c = mutations.state === null || mutations.state === void 0 ? void 0 : mutations.state.checkout) === null || _c === void 0 ? void 0 : _c.selected_shipping_choice_required)) { |
| 1036 | return index.h(index.Host, { style: { display: 'none' } }); |
| 1037 | } |
| 1038 | // no shipping choices but no country either |
| 1039 | if (!(choices === null || choices === void 0 ? void 0 : choices.length) && !((_e = (_d = mutations.state === null || mutations.state === void 0 ? void 0 : mutations.state.checkout) === null || _d === void 0 ? void 0 : _d.shipping_address) === null || _e === void 0 ? void 0 : _e.country)) { |
| 1040 | return (index.h("sc-form-control", { label: this.label || wp.i18n.__('Shipping', 'surecart') }, index.h("div", { class: "shipping-choice__empty" }, wp.i18n.__('To check available shipping choices, please provide your shipping country in the address section.', 'surecart')))); |
| 1041 | } |
| 1042 | // no shipping choices yet. |
| 1043 | if (!(choices === null || choices === void 0 ? void 0 : choices.length)) { |
| 1044 | return (index.h("sc-form-control", { part: "empty", label: this.label || wp.i18n.__('Shipping', 'surecart') }, index.h("div", { class: "shipping-choice__empty" }, wp.i18n.__('Sorry, we are not able to ship to your address.', 'surecart')))); |
| 1045 | } |
| 1046 | } |
| 1047 | return (index.h(index.Host, null, index.h("sc-radio-group", { part: "base", label: this.label || wp.i18n.__('Shipping', 'surecart'), class: "shipping-choices", onScChange: e => this.updateCheckout(e.detail) }, (choices || []).map(({ id, display_amount, shipping_method }) => { |
| 1048 | var _a; |
| 1049 | return (index.h("sc-radio", { key: id, checked: ((_a = mutations.state === null || mutations.state === void 0 ? void 0 : mutations.state.checkout) === null || _a === void 0 ? void 0 : _a.selected_shipping_choice) === id, exportparts: "base:radio__base,label:radio__label,control:radio__control,checked-icon:radio__checked-icon", class: "shipping-choice", value: id }, index.h("div", { class: "shipping-choice__text" }, index.h("div", { class: "shipping-choice__name" }, (shipping_method === null || shipping_method === void 0 ? void 0 : shipping_method.name) || wp.i18n.__('Standard Shipping', 'surecart')), this.showDescription && !!(shipping_method === null || shipping_method === void 0 ? void 0 : shipping_method.description) && (index.h("div", { class: "shipping-choice__description" }, shipping_method === null || shipping_method === void 0 ? void 0 : shipping_method.description))), index.h("div", { class: "shipping-choice__price" }, !!display_amount ? display_amount : wp.i18n.__('Free', 'surecart')))); |
| 1050 | })), getters$1.checkoutIsLocked('selected_shipping_choice') && index.h("sc-block-ui", null))); |
| 1051 | } |
| 1052 | }; |
| 1053 | ScShippingChoices.style = ScShippingChoicesStyle0; |
| 1054 | |
| 1055 | exports.sc_compact_address = ScCompactAddress; |
| 1056 | exports.sc_customer_phone = ScCustomerPhone; |
| 1057 | exports.sc_invoice_details = ScInvoiceDetails; |
| 1058 | exports.sc_invoice_memo = ScLineItemInvoiceMemo; |
| 1059 | exports.sc_line_item_invoice_due_date = ScLineItemInvoiceDueDate; |
| 1060 | exports.sc_line_item_invoice_number = ScLineItemInvoiceNumber; |
| 1061 | exports.sc_line_item_invoice_receipt_download = ScLineItemInvoiceReceiptDownload; |
| 1062 | exports.sc_line_item_shipping = ScLineItemShipping; |
| 1063 | exports.sc_line_item_tax = ScLineItemTax; |
| 1064 | exports.sc_line_item_trial = ScLineItemTrial; |
| 1065 | exports.sc_order_billing_address = ScOrderBillingAddress; |
| 1066 | exports.sc_order_bump = ScOrderBump; |
| 1067 | exports.sc_order_bumps = ScOrderBumps; |
| 1068 | exports.sc_order_shipping_address = ScOrderShippingAddress; |
| 1069 | exports.sc_order_tax_id_input = ScOrderTaxIdInput; |
| 1070 | exports.sc_radio = ScRadio; |
| 1071 | exports.sc_radio_group = ScRadioGroup; |
| 1072 | exports.sc_shipping_choices = ScShippingChoices; |
| 1073 | |
| 1074 | //# sourceMappingURL=sc-compact-address_18.cjs.entry.js.map |