MockProcessor-498b60c5.js
1 year ago
MockProcessor-498b60c5.js.map
1 year ago
add-query-args-0e2a8393.js
1 year ago
add-query-args-0e2a8393.js.map
1 year ago
address-b892540d.js
1 year ago
address-b892540d.js.map
1 year ago
animation-registry-12eed2e3.js
1 year ago
animation-registry-12eed2e3.js.map
1 year ago
app-globals-707edcd4.js
1 year ago
app-globals-707edcd4.js.map
1 year ago
consumer-e06b16d3.js
1 year ago
consumer-e06b16d3.js.map
1 year ago
countries-c2f41f03.js
1 year ago
countries-c2f41f03.js.map
1 year ago
currency-a0c9bff4.js
1 year ago
currency-a0c9bff4.js.map
1 year ago
error-12ea55b3.js
1 year ago
error-12ea55b3.js.map
1 year ago
fetch-e3c5d1b9.js
1 year ago
fetch-e3c5d1b9.js.map
1 year ago
form-data-76641f16.js
1 year ago
form-data-76641f16.js.map
1 year ago
functions-2a4a4ba3.js
1 year ago
functions-2a4a4ba3.js.map
1 year ago
getters-09dda855.js
1 year ago
getters-09dda855.js.map
1 year ago
getters-1a55b8a4.js
1 year ago
getters-1a55b8a4.js.map
1 year ago
getters-26526b7c.js
1 year ago
getters-26526b7c.js.map
1 year ago
getters-a7eec27c.js
1 year ago
getters-a7eec27c.js.map
1 year ago
getters-b1d93841.js
1 year ago
getters-b1d93841.js.map
1 year ago
google-a86aa761.js
1 year ago
google-a86aa761.js.map
1 year ago
google-dd89f242.js
1 year ago
google-dd89f242.js.map
1 year ago
index-06061d4e.js
1 year ago
index-06061d4e.js.map
1 year ago
index-675be13e.js
1 year ago
index-675be13e.js.map
1 year ago
index-745b6bec.js
1 year ago
index-745b6bec.js.map
1 year ago
index-822e5799.js
1 year ago
index-822e5799.js.map
1 year ago
index-871d88b8.js
1 year ago
index-871d88b8.js.map
1 year ago
index-c5a96d53.js
2 years ago
index-c5a96d53.js.map
2 years ago
index.js
1 year ago
index.js.map
2 years ago
inline-c012a0f9.js
1 year ago
inline-c012a0f9.js.map
1 year ago
lazy-deb42890.js
1 year ago
lazy-deb42890.js.map
1 year ago
library-e110eea6.js
1 year ago
library-e110eea6.js.map
1 year ago
loader.js
1 year ago
loader.js.map
1 year ago
media-d21119a3.js
1 year ago
media-d21119a3.js.map
1 year ago
mutations-066b82f0.js
1 year ago
mutations-066b82f0.js.map
1 year ago
mutations-7ba12644.js
1 year ago
mutations-7ba12644.js.map
1 year ago
mutations-e77bd122.js
1 year ago
mutations-e77bd122.js.map
1 year ago
mutations-ed6d0770.js
1 year ago
mutations-ed6d0770.js.map
1 year ago
mutations-f11a19f9.js
1 year ago
mutations-f11a19f9.js.map
1 year ago
page-align-0cdacf32.js
1 year ago
page-align-0cdacf32.js.map
1 year ago
price-d5770168.js
1 year ago
price-d5770168.js.map
1 year ago
pure-963214cb.js
1 year ago
pure-963214cb.js.map
1 year ago
quantity-1f39f750.js
1 year ago
quantity-1f39f750.js.map
1 year ago
remove-query-args-938c53ea.js
1 year ago
remove-query-args-938c53ea.js.map
1 year ago
sc-address_3.entry.js
1 year ago
sc-address_3.entry.js.map
1 year ago
sc-alert_13.entry.js
1 year ago
sc-alert_13.entry.js.map
1 year ago
sc-avatar.entry.js
1 year ago
sc-avatar.entry.js.map
1 year ago
sc-badge-notice.entry.js
1 year ago
sc-badge-notice.entry.js.map
1 year ago
sc-breadcrumb.entry.js
1 year ago
sc-breadcrumb.entry.js.map
1 year ago
sc-breadcrumbs.entry.js
1 year ago
sc-breadcrumbs.entry.js.map
1 year ago
sc-button-group.entry.js
1 year ago
sc-button-group.entry.js.map
1 year ago
sc-cancel-dialog_2.entry.js
1 year ago
sc-cancel-dialog_2.entry.js.map
1 year ago
sc-cancel-discount_4.entry.js
1 year ago
sc-cancel-discount_4.entry.js.map
1 year ago
sc-card.entry.js
1 year ago
sc-card.entry.js.map
1 year ago
sc-cart-button.entry.js
1 year ago
sc-cart-button.entry.js.map
1 year ago
sc-cart-form-submit.entry.js
1 year ago
sc-cart-form-submit.entry.js.map
1 year ago
sc-cart-form.entry.js
1 year ago
sc-cart-form.entry.js.map
1 year ago
sc-cart-header.entry.js
1 year ago
sc-cart-header.entry.js.map
1 year ago
sc-cart-icon.entry.js
1 year ago
sc-cart-icon.entry.js.map
1 year ago
sc-cart-loader.entry.js
1 year ago
sc-cart-loader.entry.js.map
1 year ago
sc-cart-session-provider_3.entry.js
1 year ago
sc-cart-session-provider_3.entry.js.map
1 year ago
sc-cart-submit.entry.js
1 year ago
sc-cart-submit.entry.js.map
1 year ago
sc-cart.entry.js
1 year ago
sc-cart.entry.js.map
1 year ago
sc-cc-logo_2.entry.js
1 year ago
sc-cc-logo_2.entry.js.map
1 year ago
sc-charges-list.entry.js
1 year ago
sc-charges-list.entry.js.map
1 year ago
sc-checkout-form-errors.entry.js
1 year ago
sc-checkout-form-errors.entry.js.map
1 year ago
sc-checkout-mollie-payment_2.entry.js
1 year ago
sc-checkout-mollie-payment_2.entry.js.map
1 year ago
sc-checkout-product-price-variant-selector.entry.js
1 year ago
sc-checkout-product-price-variant-selector.entry.js.map
1 year ago
sc-checkout-stock-alert_8.entry.js
1 year ago
sc-checkout-stock-alert_8.entry.js.map
1 year ago
sc-checkout.entry.js
1 year ago
sc-checkout.entry.js.map
1 year ago
sc-choice-container.entry.js
1 year ago
sc-choice-container.entry.js.map
1 year ago
sc-choice.entry.js
1 year ago
sc-choice.entry.js.map
1 year ago
sc-choices.entry.js
1 year ago
sc-choices.entry.js.map
1 year ago
sc-column_2.entry.js
1 year ago
sc-column_2.entry.js.map
1 year ago
sc-compact-address_11.entry.js
1 year ago
sc-compact-address_11.entry.js.map
1 year ago
sc-conditional-form.entry.js
1 year ago
sc-conditional-form.entry.js.map
1 year ago
sc-consumer.entry.js
1 year ago
sc-consumer.entry.js.map
1 year ago
sc-coupon-form.entry.js
1 year ago
sc-coupon-form.entry.js.map
1 year ago
sc-custom-order-price-input.entry.js
1 year ago
sc-custom-order-price-input.entry.js.map
1 year ago
sc-customer-details.entry.js
1 year ago
sc-customer-details.entry.js.map
1 year ago
sc-customer-edit.entry.js
1 year ago
sc-customer-edit.entry.js.map
1 year ago
sc-customer-email.entry.js
1 year ago
sc-customer-email.entry.js.map
1 year ago
sc-customer-firstname.entry.js
1 year ago
sc-customer-firstname.entry.js.map
1 year ago
sc-customer-lastname.entry.js
1 year ago
sc-customer-lastname.entry.js.map
1 year ago
sc-customer-name.entry.js
1 year ago
sc-customer-name.entry.js.map
1 year ago
sc-customer-phone.entry.js
1 year ago
sc-customer-phone.entry.js.map
1 year ago
sc-dashboard-customer-details.entry.js
1 year ago
sc-dashboard-customer-details.entry.js.map
1 year ago
sc-dashboard-downloads-list.entry.js
1 year ago
sc-dashboard-downloads-list.entry.js.map
1 year ago
sc-divider.entry.js
1 year ago
sc-divider.entry.js.map
1 year ago
sc-donation-choices.entry.js
1 year ago
sc-donation-choices.entry.js.map
1 year ago
sc-downloads-list.entry.js
1 year ago
sc-downloads-list.entry.js.map
1 year ago
sc-dropdown_3.entry.js
1 year ago
sc-dropdown_3.entry.js.map
1 year ago
sc-empty.entry.js
1 year ago
sc-empty.entry.js.map
1 year ago
sc-express-payment.entry.js
1 year ago
sc-express-payment.entry.js.map
1 year ago
sc-feature-demo-banner.entry.js
1 year ago
sc-feature-demo-banner.entry.js.map
1 year ago
sc-form-control_2.entry.js
1 year ago
sc-form-control_2.entry.js.map
1 year ago
sc-form-row.entry.js
1 year ago
sc-form-row.entry.js.map
1 year ago
sc-form.entry.js
1 year ago
sc-form.entry.js.map
1 year ago
sc-format-bytes.entry.js
1 year ago
sc-format-bytes.entry.js.map
1 year ago
sc-format-interval.entry.js
1 year ago
sc-format-interval.entry.js.map
1 year ago
sc-fulfillment-shipping-status-badge.entry.js
1 year ago
sc-fulfillment-shipping-status-badge.entry.js.map
1 year ago
sc-fulfillments.entry.js
1 year ago
sc-fulfillments.entry.js.map
1 year ago
sc-heading_2.entry.js
1 year ago
sc-heading_2.entry.js.map
1 year ago
sc-image-slider.entry.js
1 year ago
sc-image-slider.entry.js.map
1 year ago
sc-invoices-list.entry.js
1 year ago
sc-invoices-list.entry.js.map
1 year ago
sc-license.entry.js
1 year ago
sc-license.entry.js.map
1 year ago
sc-licenses-list.entry.js
1 year ago
sc-licenses-list.entry.js.map
1 year ago
sc-line-item-bump.entry.js
1 year ago
sc-line-item-bump.entry.js.map
1 year ago
sc-line-item-total.entry.js
1 year ago
sc-line-item-total.entry.js.map
1 year ago
sc-line-item.entry.js
1 year ago
sc-line-item.entry.js.map
1 year ago
sc-line-items-provider.entry.js
1 year ago
sc-line-items-provider.entry.js.map
1 year ago
sc-line-items.entry.js
1 year ago
sc-line-items.entry.js.map
1 year ago
sc-login-form.entry.js
1 year ago
sc-login-form.entry.js.map
1 year ago
sc-manual-payment-method_3.entry.js
1 year ago
sc-manual-payment-method_3.entry.js.map
1 year ago
sc-menu-divider.entry.js
1 year ago
sc-menu-divider.entry.js.map
1 year ago
sc-menu-label_2.entry.js
1 year ago
sc-menu-label_2.entry.js.map
1 year ago
sc-mollie-add-method.entry.js
1 year ago
sc-mollie-add-method.entry.js.map
1 year ago
sc-order-confirmation-customer.entry.js
1 year ago
sc-order-confirmation-customer.entry.js.map
1 year ago
sc-order-confirmation-details.entry.js
1 year ago
sc-order-confirmation-details.entry.js.map
1 year ago
sc-order-confirmation-line-items_2.entry.js
1 year ago
sc-order-confirmation-line-items_2.entry.js.map
1 year ago
sc-order-confirmation.entry.js
1 year ago
sc-order-confirmation.entry.js.map
1 year ago
sc-order-coupon-form.entry.js
1 year ago
sc-order-coupon-form.entry.js.map
1 year ago
sc-order-detail.entry.js
1 year ago
sc-order-detail.entry.js.map
1 year ago
sc-order-fulfillment-badge.entry.js
1 year ago
sc-order-fulfillment-badge.entry.js.map
1 year ago
sc-order-manual-instructions.entry.js
1 year ago
sc-order-manual-instructions.entry.js.map
1 year ago
sc-order-password.entry.js
1 year ago
sc-order-password.entry.js.map
1 year ago
sc-order-return-badge.entry.js
1 year ago
sc-order-return-badge.entry.js.map
1 year ago
sc-order-shipment-badge.entry.js
1 year ago
sc-order-shipment-badge.entry.js.map
1 year ago
sc-order-status-badge.entry.js
1 year ago
sc-order-status-badge.entry.js.map
1 year ago
sc-order-submit.entry.js
1 year ago
sc-order-submit.entry.js.map
1 year ago
sc-order-summary.entry.js
1 year ago
sc-order-summary.entry.js.map
1 year ago
sc-order.entry.js
1 year ago
sc-order.entry.js.map
1 year ago
sc-orders-list.entry.js
1 year ago
sc-orders-list.entry.js.map
1 year ago
sc-pagination.entry.js
1 year ago
sc-pagination.entry.js.map
1 year ago
sc-password-nag.entry.js
1 year ago
sc-password-nag.entry.js.map
1 year ago
sc-password.entry.js
1 year ago
sc-password.entry.js.map
1 year ago
sc-payment-method-choice_2.entry.js
1 year ago
sc-payment-method-choice_2.entry.js.map
1 year ago
sc-payment-method-details.entry.js
1 year ago
sc-payment-method-details.entry.js.map
1 year ago
sc-payment-methods-list.entry.js
1 year ago
sc-payment-methods-list.entry.js.map
1 year ago
sc-payment.entry.js
1 year ago
sc-payment.entry.js.map
1 year ago
sc-paypal-add-method.entry.js
1 year ago
sc-paypal-add-method.entry.js.map
1 year ago
sc-paypal-buttons_2.entry.js
1 year ago
sc-paypal-buttons_2.entry.js.map
1 year ago
sc-paystack-add-method.entry.js
1 year ago
sc-paystack-add-method.entry.js.map
1 year ago
sc-phone-input.entry.js
1 year ago
sc-phone-input.entry.js.map
1 year ago
sc-pill-option.entry.js
1 year ago
sc-pill-option.entry.js.map
1 year ago
sc-premium-tag.entry.js
1 year ago
sc-premium-tag.entry.js.map
1 year ago
sc-price-choice-container.entry.js
1 year ago
sc-price-choice-container.entry.js.map
1 year ago
sc-price-choice.entry.js
1 year ago
sc-price-choice.entry.js.map
1 year ago
sc-price-choices.entry.js
1 year ago
sc-price-choices.entry.js.map
1 year ago
sc-price-input.entry.js
1 year ago
sc-price-input.entry.js.map
1 year ago
sc-price-range.entry.js
1 year ago
sc-price-range.entry.js.map
1 year ago
sc-price.entry.js
1 year ago
sc-price.entry.js.map
1 year ago
sc-product-buy-button.entry.js
1 year ago
sc-product-buy-button.entry.js.map
1 year ago
sc-product-donation-amount-choice.entry.js
1 year ago
sc-product-donation-amount-choice.entry.js.map
1 year ago
sc-product-donation-choices.entry.js
1 year ago
sc-product-donation-choices.entry.js.map
1 year ago
sc-product-donation-custom-amount.entry.js
1 year ago
sc-product-donation-custom-amount.entry.js.map
1 year ago
sc-product-item-image_3.entry.js
1 year ago
sc-product-item-image_3.entry.js.map
1 year ago
sc-product-item-list.entry.js
1 year ago
sc-product-item-list.entry.js.map
1 year ago
sc-product-item.entry.js
1 year ago
sc-product-item.entry.js.map
1 year ago
sc-product-line-item_2.entry.js
1 year ago
sc-product-line-item_2.entry.js.map
1 year ago
sc-product-pills-variant-option.entry.js
1 year ago
sc-product-pills-variant-option.entry.js.map
1 year ago
sc-product-price-choices.entry.js
1 year ago
sc-product-price-choices.entry.js.map
1 year ago
sc-product-price-modal.entry.js
1 year ago
sc-product-price-modal.entry.js.map
1 year ago
sc-product-price.entry.js
1 year ago
sc-product-price.entry.js.map
1 year ago
sc-product-quantity.entry.js
1 year ago
sc-product-quantity.entry.js.map
1 year ago
sc-product-selected-price.entry.js
1 year ago
sc-product-selected-price.entry.js.map
1 year ago
sc-product-text.entry.js
1 year ago
sc-product-text.entry.js.map
1 year ago
sc-provider.entry.js
1 year ago
sc-provider.entry.js.map
1 year ago
sc-provisional-banner.entry.js
1 year ago
sc-provisional-banner.entry.js.map
1 year ago
sc-purchase-downloads-list.entry.js
1 year ago
sc-purchase-downloads-list.entry.js.map
1 year ago
sc-recurring-price-choice-container.entry.js
1 year ago
sc-recurring-price-choice-container.entry.js.map
1 year ago
sc-rich-text.entry.js
1 year ago
sc-rich-text.entry.js.map
1 year ago
sc-spacing.entry.js
1 year ago
sc-spacing.entry.js.map
1 year ago
sc-stacked-list_2.entry.js
1 year ago
sc-stacked-list_2.entry.js.map
1 year ago
sc-stripe-add-method.entry.js
1 year ago
sc-stripe-add-method.entry.js.map
1 year ago
sc-stripe-element.entry.js
1 year ago
sc-stripe-element.entry.js.map
1 year ago
sc-stripe-payment-element.entry.js
1 year ago
sc-stripe-payment-element.entry.js.map
1 year ago
sc-stripe-payment-request.entry.js
1 year ago
sc-stripe-payment-request.entry.js.map
1 year ago
sc-subscription-ad-hoc-confirm.entry.js
1 year ago
sc-subscription-ad-hoc-confirm.entry.js.map
1 year ago
sc-subscription-details_2.entry.js
1 year ago
sc-subscription-details_2.entry.js.map
1 year ago
sc-subscription-payment-method.entry.js
1 year ago
sc-subscription-payment-method.entry.js.map
1 year ago
sc-subscription-payment.entry.js
1 year ago
sc-subscription-payment.entry.js.map
1 year ago
sc-subscription-switch.entry.js
1 year ago
sc-subscription-switch.entry.js.map
1 year ago
sc-subscription-variation-confirm.entry.js
1 year ago
sc-subscription-variation-confirm.entry.js.map
1 year ago
sc-subscription.entry.js
1 year ago
sc-subscription.entry.js.map
1 year ago
sc-subscriptions-list.entry.js
1 year ago
sc-subscriptions-list.entry.js.map
1 year ago
sc-summary.entry.js
1 year ago
sc-summary.entry.js.map
1 year ago
sc-switch.entry.js
1 year ago
sc-switch.entry.js.map
1 year ago
sc-tab-group.entry.js
1 year ago
sc-tab-group.entry.js.map
1 year ago
sc-tab-panel.entry.js
1 year ago
sc-tab-panel.entry.js.map
1 year ago
sc-tab.entry.js
1 year ago
sc-tab.entry.js.map
1 year ago
sc-table-head.entry.js
1 year ago
sc-table-head.entry.js.map
1 year ago
sc-table_3.entry.js
1 year ago
sc-table_3.entry.js.map
1 year ago
sc-tag.entry.js
1 year ago
sc-tag.entry.js.map
1 year ago
sc-toggle.entry.js
1 year ago
sc-toggle.entry.js.map
1 year ago
sc-toggles.entry.js
1 year ago
sc-toggles.entry.js.map
1 year ago
sc-total.entry.js
1 year ago
sc-total.entry.js.map
1 year ago
sc-upcoming-invoice.entry.js
1 year ago
sc-upcoming-invoice.entry.js.map
1 year ago
sc-upgrade-required.entry.js
1 year ago
sc-upgrade-required.entry.js.map
1 year ago
sc-upsell-countdown-timer.entry.js
1 year ago
sc-upsell-countdown-timer.entry.js.map
1 year ago
sc-upsell-no-thanks-button.entry.js
1 year ago
sc-upsell-no-thanks-button.entry.js.map
1 year ago
sc-upsell-submit-button.entry.js
1 year ago
sc-upsell-submit-button.entry.js.map
1 year ago
sc-upsell-totals.entry.js
1 year ago
sc-upsell-totals.entry.js.map
1 year ago
sc-upsell.entry.js
1 year ago
sc-upsell.entry.js.map
1 year ago
sc-visually-hidden.entry.js
1 year ago
sc-visually-hidden.entry.js.map
1 year ago
sc-wordpress-password-edit.entry.js
1 year ago
sc-wordpress-password-edit.entry.js.map
1 year ago
sc-wordpress-user-edit.entry.js
1 year ago
sc-wordpress-user-edit.entry.js.map
1 year ago
sc-wordpress-user.entry.js
1 year ago
sc-wordpress-user.entry.js.map
1 year ago
store-093f0f6a.js
1 year ago
store-093f0f6a.js.map
1 year ago
store-a8bae355.js
1 year ago
store-a8bae355.js.map
1 year ago
store-dcefd119.js
1 year ago
store-dcefd119.js.map
1 year ago
surecart.js
1 year ago
surecart.js.map
1 year ago
tax-d4911dbc.js
1 year ago
tax-d4911dbc.js.map
1 year ago
universe-5a73abb7.js
1 year ago
universe-5a73abb7.js.map
1 year ago
util-50af2a83.js
1 year ago
util-50af2a83.js.map
1 year ago
utils-e9ee502a.js
1 year ago
utils-e9ee502a.js.map
1 year ago
watchers-38693c1f.js
1 year ago
watchers-38693c1f.js.map
1 year ago
watchers-4d2edfb0.js
1 year ago
watchers-4d2edfb0.js.map
1 year ago
watchers-4e5b728a.js
1 year ago
watchers-4e5b728a.js.map
1 year ago
watchers-67501779.js
1 year ago
watchers-67501779.js.map
1 year ago
watchers-a697b0c8.js
1 year ago
watchers-a697b0c8.js.map
1 year ago
sc-alert_13.entry.js
803 lines
| 1 | import { r as registerInstance, c as createEvent, h, H as Host, a as getElement, F as Fragment } from './index-745b6bec.js'; |
| 2 | import { i as isRtl } from './page-align-0cdacf32.js'; |
| 3 | import { s as setDefaultAnimation, g as getAnimation, a as animateTo, b as stopAnimations } from './animation-registry-12eed2e3.js'; |
| 4 | import { m as maybeConvertAmount } from './currency-a0c9bff4.js'; |
| 5 | import { g as getIconLibrary } from './library-e110eea6.js'; |
| 6 | import { a as apiFetch } from './fetch-e3c5d1b9.js'; |
| 7 | import { a as addQueryArgs } from './add-query-args-0e2a8393.js'; |
| 8 | import './remove-query-args-938c53ea.js'; |
| 9 | |
| 10 | const scAlertCss = ":host{display:block}[hidden]{display:none !important}::slotted(*:not(:first-child)){margin-top:0.5rem;margin-bottom:0}::slotted(ul){line-height:1.4em;list-style-type:disc;margin:0;padding:0;padding-left:20px}.alert{font-family:var(--sc-input-font-family);font-weight:var(--sc-font-weight-normal);font-size:var(--sc-button-font-size-medium);line-height:var(--sc-line-height-dense);border-radius:var(--sc-alert-border-radius, var(--sc-border-radius-medium));padding:var(--sc-spacing-large);display:flex;align-items:flex-start;border:var(--sc-alert-border, var(--sc-input-border));border-top:solid var(--sc-alert-border-width, 3px);color:var(--sc-alert-color, var(--sc-input-label-color));background:var(--sc-alert-background-color, var(--sc-color-white));box-shadow:var(--sc-shadow-small)}.alert__text{flex:1}.alert.alert--primary{border-top-color:var(--sc-alert-primary-border-color, var(--sc-color-primary-500))}.alert.alert--primary a{color:var(--sc-color-primary-900)}.alert.alert--primary .alert__title{color:var(--sc-alert-title-color, var(--sc-color-gray-800))}.alert.alert--primary .alert__icon{color:var(--sc-alert-primary-icon-color, var(--sc-color-primary-500))}.alert.alert--info{border-top-color:var(--sc-alert-info-border-color, var(--sc-color-info-500))}.alert.alert--info a{color:var(--sc-color-info-900)}.alert.alert--info .alert__title{color:var(--sc-alert-title-color, var(--sc-color-gray-800))}.alert.alert--info .alert__icon{color:var(--sc-alert-info-icon-color, var(--sc-color-info-500))}.alert.alert--danger{border-top-color:var(--sc-alert-danger-border-color, var(--sc-color-danger-500))}.alert.alert--danger a{color:var(--sc-color-danger-900)}.alert.alert--danger .alert__title{color:var(--sc-alert-title-color, var(--sc-color-gray-800))}.alert.alert--danger .alert__icon{color:var(--sc-alert-danger-icon-color, var(--sc-color-danger-500))}.alert.alert--warning{border-top-color:var(--sc-alert-warning-border-color, var(--sc-color-warning-500))}.alert.alert--warning a{color:var(--sc-color-warning-900)}.alert.alert--warning .alert__title{color:var(--sc-alert-title-color, var(--sc-color-gray-800))}.alert.alert--warning .alert__icon{color:var(--sc-alert-warning-icon-color, var(--sc-color-warning-500))}.alert.alert--success{border-top-color:var(--sc-alert-success-border-color, var(--sc-color-success-500))}.alert.alert--success a{color:var(--sc-color-success-900)}.alert.alert--success .alert__title{color:var(--sc-alert-title-color, var(--sc-color-gray-800))}.alert.alert--success .alert__icon{color:var(--sc-alert-success-icon-color, var(--sc-color-success-500))}.alert__icon{flex:1;flex:0 0 auto;display:flex;align-items:center;font-size:var(--sc-font-size-large);padding-inline-end:var(--sc-spacing-medium)}.alert__title{font-weight:var(--sc-font-weight-semibold)}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.alert__close{transition:background-color var(--sc-transition-fast) ease;display:inline-flex;border-radius:var(--sc-border-radius-small);padding:var(--sc-spacing-x-small);margin-left:auto;cursor:pointer}.alert__close svg{width:1em;height:1em}.alert--is-rtl{text-align:right}.alert--is-rtl.alert-close{margin-right:auto;margin-left:unset}.alert--is-rtl ::slotted(ul){margin:0;padding:0;padding-right:20px}"; |
| 11 | const ScAlertStyle0 = scAlertCss; |
| 12 | |
| 13 | const ScAlert = class { |
| 14 | constructor(hostRef) { |
| 15 | registerInstance(this, hostRef); |
| 16 | this.scHide = createEvent(this, "scHide", 7); |
| 17 | this.scShow = createEvent(this, "scShow", 7); |
| 18 | this.open = false; |
| 19 | this.title = undefined; |
| 20 | this.closable = false; |
| 21 | this.type = 'primary'; |
| 22 | this.duration = Infinity; |
| 23 | this.scrollOnOpen = undefined; |
| 24 | this.scrollMargin = '0px'; |
| 25 | this.noIcon = undefined; |
| 26 | this.autoHideTimeout = undefined; |
| 27 | } |
| 28 | /** Shows the alert. */ |
| 29 | async show() { |
| 30 | if (this.open) { |
| 31 | return; |
| 32 | } |
| 33 | this.open = true; |
| 34 | } |
| 35 | /** Hides the alert */ |
| 36 | async hide() { |
| 37 | if (!this.open) { |
| 38 | return; |
| 39 | } |
| 40 | this.open = false; |
| 41 | } |
| 42 | restartAutoHide() { |
| 43 | clearTimeout(this.autoHideTimeout); |
| 44 | if (this.open && this.duration < Infinity) { |
| 45 | this.autoHideTimeout = setTimeout(() => this.hide(), this.duration); |
| 46 | } |
| 47 | } |
| 48 | handleMouseMove() { |
| 49 | this.restartAutoHide(); |
| 50 | } |
| 51 | handleCloseClick() { |
| 52 | this.hide(); |
| 53 | } |
| 54 | /** Emit event when showing or hiding changes */ |
| 55 | handleOpenChange() { |
| 56 | this.open ? this.scShow.emit() : this.scHide.emit(); |
| 57 | if (this.open && this.scrollOnOpen) { |
| 58 | this.el.scrollIntoView({ behavior: 'smooth' }); |
| 59 | } |
| 60 | } |
| 61 | componentDidLoad() { |
| 62 | this.handleOpenChange(); |
| 63 | } |
| 64 | iconName() { |
| 65 | switch (this.type) { |
| 66 | case 'danger': |
| 67 | return 'alert-circle'; |
| 68 | case 'success': |
| 69 | return 'check-circle'; |
| 70 | case 'warning': |
| 71 | return 'alert-triangle'; |
| 72 | default: |
| 73 | return 'info'; |
| 74 | } |
| 75 | } |
| 76 | icon() { |
| 77 | return h("sc-icon", { name: this.iconName() }); |
| 78 | } |
| 79 | render() { |
| 80 | return (h(Host, { key: '09f038b869c46bb2a469d707488252f854190590', style: { 'scroll-margin-top': this.scrollMargin } }, h("div", { key: '88a711dfdc7b39aa0e4238dc47251c453f0ba02b', class: { |
| 81 | 'alert': true, |
| 82 | 'alert--primary': this.type === 'primary', |
| 83 | 'alert--success': this.type === 'success', |
| 84 | 'alert--info': this.type === 'info', |
| 85 | 'alert--warning': this.type === 'warning', |
| 86 | 'alert--danger': this.type === 'danger', |
| 87 | 'alert--is-rtl': isRtl() |
| 88 | }, part: "base", role: "alert", "aria-live": "assertive", "aria-atomic": "true", "aria-hidden": this.open ? 'false' : 'true', hidden: this.open ? false : true, onMouseMove: () => this.handleMouseMove() }, h("div", { key: 'c21265104fee4edcd348738b77b46bb70a485f5d', class: "alert__icon", part: "icon" }, h("slot", { key: '3d62bb971e893c65526c7adce67a09508b2ed377', name: "icon" }, this.icon())), h("div", { key: 'a5cbb772ac33e726ee88fd7e329b3f524975a8d3', class: "alert__text", part: "text" }, h("div", { key: 'c737729ab271b6dc6f615378d05b9992f46e3529', class: "alert__title", part: "title" }, h("slot", { key: 'd941d1ddb86031f5d5162ce0c5528899911bb418', name: "title" }, this.title)), h("div", { key: 'af69867824717107976a3435fe1c53c27a07b7d8', class: "alert__message", part: "message" }, h("slot", { key: 'a26ad3def26671c72aff76c0cdec1d6cf8c82080' }))), this.closable && (h("span", { key: '5dd48cb13843ad29e028771b18f00a28883b38ca', part: "close", class: "alert__close", onClick: () => this.handleCloseClick() }, h("span", { key: '7a11566917da7243f87ebe41fb5ae43c6b2614d8', class: "sr-only" }, "Dismiss"), h("svg", { key: '958f27bd6907865e4725fe3645f5e63c479cd3ab', class: "h-5 w-5", "x-description": "Heroicon name: solid/x", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true" }, h("path", { key: '8098bc65a08397682f66032aa85e6460277e924f', "fill-rule": "evenodd", d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z", "clip-rule": "evenodd" }))))))); |
| 89 | } |
| 90 | get el() { return getElement(this); } |
| 91 | static get watchers() { return { |
| 92 | "open": ["handleOpenChange"] |
| 93 | }; } |
| 94 | }; |
| 95 | ScAlert.style = ScAlertStyle0; |
| 96 | |
| 97 | const scBlockUiCss = ":host{display:block;position:var(--sc-block-ui-position, absolute);top:-5px;left:-5px;right:-5px;bottom:-5px;overflow:hidden;display:flex;align-items:center;justify-content:center}:host>*{z-index:1}:host:after{content:\"\";position:var(--sc-block-ui-position, absolute);top:0;left:0;right:0;bottom:0;cursor:wait;background:var(--sc-block-ui-background-color, var(--sc-color-white));opacity:var(--sc-block-ui-opacity, 0.15)}:host.transparent:after{background:transparent}.overlay__content{font-size:var(--sc-font-size-large);font-weight:var(--sc-font-weight-semibold);display:grid;gap:0.5em;text-align:center}"; |
| 98 | const ScBlockUiStyle0 = scBlockUiCss; |
| 99 | |
| 100 | const ScBlockUi = class { |
| 101 | constructor(hostRef) { |
| 102 | registerInstance(this, hostRef); |
| 103 | this.zIndex = 1; |
| 104 | this.transparent = undefined; |
| 105 | this.spinner = undefined; |
| 106 | } |
| 107 | render() { |
| 108 | return (h("div", { key: '9681c9104c4d01ee05c0151c9574f0a33b88b0e7', part: "base", class: { overlay: true, transparent: this.transparent }, style: { 'z-index': this.zIndex.toString() } }, h("div", { key: '7232fa02fb8767911454188287a19cbfc0d82af5', class: "overlay__content", part: "content" }, h("slot", { key: '2aab74d4d58c9a7b4401576ec4ebf5ab6bdd3740', name: "spinner" }, !this.transparent && this.spinner && h("sc-spinner", { key: 'a47feab5434e70c0e93ed35d390d8ac99826a5a7' })), h("slot", { key: 'd0d84b1d1fb5295c0fbab68a202e338b40dfac3d' })))); |
| 109 | } |
| 110 | }; |
| 111 | ScBlockUi.style = ScBlockUiStyle0; |
| 112 | |
| 113 | const scButtonCss = ":host{display:inline-block;width:auto;cursor:pointer;--primary-color:var(--sc-color-primary-text);--primary-background:var(--sc-color-primary-500)}:host([full]){display:block}::slotted(*){pointer-events:none}.button{box-sizing:border-box;z-index:10;display:inline-flex;align-items:stretch;justify-content:center;width:100%;border-style:solid;border-width:var(--sc-input-border-width);font-family:var(--sc-input-font-family);font-weight:var(--sc-font-weight-semibold);text-decoration:none;user-select:none;white-space:nowrap;vertical-align:middle;padding:0;transition: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)) border, var(--sc-input-transition, var(--sc-transition-medium)) box-shadow, var(--sc-input-transition, var(--sc-transition-medium)) opacity;cursor:inherit}.button::-moz-focus-inner{border:0}.button:focus{outline:none}.button:focus-visible{box-shadow:0 0 0 var(--sc-focus-ring-width) var(--sc-focus-ring-color-primary)}.button.button--disabled{cursor:not-allowed}.button.button--disabled *{pointer-events:none}.button.button--disabled .button__label,.button.button--disabled .button__suffix,.button.button--disabled .button__prefix{opacity:0.5}.button ::slotted(.sc--icon){pointer-events:none}.button__prefix,.button__suffix{flex:0 0 auto;display:flex;align-items:center}.button__label{display:flex;align-items:center}.button__label ::slotted(sc-icon){vertical-align:-2px}.button:not(.button--text):not(.button--link){box-shadow:var(--sc-shadow-small)}.button.button--standard.button--default{background-color:var(--sc-button-default-background-color, var(--sc-color-white));border-color:var(--sc-button-default-border-color, var(--sc-color-gray-300));color:var(--sc-button-default-color, var(--sc-color-gray-600))}.button.button--standard.button--default:hover:not(.button--disabled){background-color:var(--sc-button-default-hover-background-color, var(--sc-color-white));border-color:var(--sc-button-default-focus-border-color, var(--primary-background));color:var(--primary-background)}.button.button--standard.button--default:focus:not(.button--disabled){background-color:var(--sc-button-default-focus-background-color, var(--sc-color-white));border-color:var(--sc-button-default-focus-border-color, var(--sc-color-white));color:var(--primary-background);box-shadow:0 0 0 var(--sc-focus-ring-width) var(--sc-focus-ring-color-primary)}.button.button--standard.button--default:active:not(.button--disabled){background-color:var(--sc-button-default-active-background-color, var(--sc-color-white));border-color:var(--sc-button-default-active-border-color, var(--sc-color-white));color:var(--primary-background)}.button.button--standard.button--primary{background-color:var(--primary-background);border-color:var(--primary-background);color:var(--primary-color)}.button.button--standard.button--primary:hover:not(.button--disabled){opacity:0.8}.button.button--standard.button--primary:focus:not(.button--disabled){opacity:0.8;color:var(--primary-color);border-color:var(--sc-color-white);box-shadow:0 0 0 var(--sc-focus-ring-width) var(--sc-focus-ring-color-primary)}.button.button--standard.button--primary:active:not(.button--disabled){background-color:var(--primary-background);border-color:var(--sc-color-white);color:var(--primary-color)}.button.button--standard.button--success{background-color:var(--sc-color-success-500);border-color:var(--sc-color-success-500);color:var(--sc-color-success-text)}.button.button--standard.button--success:hover:not(.button--disabled){background-color:var(--sc-color-success-400);border-color:var(--sc-color-success-400);color:var(--sc-color-success-text)}.button.button--standard.button--success:focus:not(.button--disabled){background-color:var(--sc-color-success-400);border-color:var(--sc-color-success-400);color:var(--sc-color-success-text);box-shadow:0 0 0 var(--sc-focus-ring-width) var(--sc-focus-ring-color-success)}.button.button--standard.button--success:active:not(.button--disabled){background-color:var(--sc-color-success-500);border-color:var(--sc-color-success-500);color:var(--sc-color-success-text)}.button.button--standard.button--info{background-color:var(--sc-color-info-500);border-color:var(--sc-color-info-500);color:var(--sc-color-info-text)}.button.button--standard.button--info:hover:not(.button--disabled){background-color:var(--sc-color-info-400);border-color:var(--sc-color-info-400);color:var(--sc-color-info-text)}.button.button--standard.button--info:focus:not(.button--disabled){background-color:var(--sc-color-info-400);border-color:var(--sc-color-info-400);color:var(--sc-color-info-text);box-shadow:0 0 0 var(--sc-focus-ring-width) var(--sc-focus-ring-color-info)}.button.button--standard.button--info:active:not(.button--disabled){background-color:var(--sc-color-info-500);border-color:var(--sc-color-info-500);color:var(--sc-color-info-text)}.button.button--standard.button--warning{background-color:var(--sc-color-warning-500);border-color:var(--sc-color-warning-500);color:var(--sc-color-warning-text)}.button.button--standard.button--warning:hover:not(.button--disabled){background-color:var(--sc-color-warning-400);border-color:var(--sc-color-warning-400);color:var(--sc-color-warning-text)}.button.button--standard.button--warning:focus:not(.button--disabled){background-color:var(--sc-color-warning-400);border-color:var(--sc-color-warning-400);color:var(--sc-color-warning-text);box-shadow:0 0 0 var(--sc-focus-ring-width) var(--sc-focus-ring-color-warning)}.button.button--standard.button--warning:active:not(.button--disabled){background-color:var(--sc-color-warning-500);border-color:var(--sc-color-warning-500);color:var(--sc-color-warning-text)}.button.button--standard.button--danger{background-color:var(--sc-color-danger-500);border-color:var(--sc-color-danger-500);color:var(--sc-color-danger-text)}.button.button--standard.button--danger:hover:not(.button--disabled){background-color:var(--sc-color-danger-400);border-color:var(--sc-color-danger-400);color:var(--sc-color-danger-text)}.button.button--standard.button--danger:focus:not(.button--disabled){background-color:var(--sc-color-danger-400);border-color:var(--sc-color-danger-400);color:var(--sc-color-danger-text);box-shadow:0 0 0 var(--sc-focus-ring-width) var(--sc-focus-ring-color-danger)}.button.button--standard.button--danger:active:not(.button--disabled){background-color:var(--sc-color-danger-500);border-color:var(--sc-color-danger-500);color:var(--sc-color-danger-text)}.button--outline{background:none;border:solid 1px}.button--outline.button--default{border-color:var(--sc-color-gray-300);color:var(--sc-color-gray-700)}.button--outline.button--default:hover:not(.button--disabled){border-color:var(--primary-background);background-color:var(--primary-background);color:var(--sc-color-white)}.button--outline.button--default:focus:not(.button--disabled){border-color:var(--primary-background);box-shadow:0 0 0 var(--sc-focus-ring-width) var(--primary-background)/var(--sc-focus-ring-alpha)}.button--outline.button--default:active:not(.button--disabled){opacity:0.8;color:var(--sc-color-white)}.button--outline.button--primary{border-color:var(--primary-background);color:var(--primary-background)}.button--outline.button--primary:hover:not(.button--disabled){background-color:var(--primary-background);opacity:0.8;color:var(--sc-color-white)}.button--outline.button--primary:focus:not(.button--disabled){border-color:var(--primary-background);box-shadow:0 0 0 var(--sc-focus-ring-width) var(--primary-background)/var(--sc-focus-ring-alpha)}.button--outline.button--primary:active:not(.button--disabled){border-color:var(--primary-background);background-color:var(--primary-background);opacity:0.9;color:var(--sc-color-white)}.button--outline.button--success{border-color:var(--sc-color-success-500);color:var(--sc-color-success-500)}.button--outline.button--success:hover:not(.button--disabled){background-color:var(--sc-color-success-500);color:var(--sc-color-white)}.button--outline.button--success:focus:not(.button--disabled){border-color:var(--sc-color-success-500);box-shadow:0 0 0 var(--sc-focus-ring-width) var(--sc-color-success-500)/var(--sc-focus-ring-alpha)}.button--outline.button--success:active:not(.button--disabled){border-color:var(--sc-color-success-700);background-color:var(--sc-color-success-700);color:var(--sc-color-white)}.button--outline.button--info{border-color:var(--sc-color-gray-500);color:var(--sc-color-gray-500)}.button--outline.button--info:hover:not(.button--disabled){background-color:var(--sc-color-gray-500);color:var(--sc-color-white)}.button--outline.button--info:focus:not(.button--disabled){border-color:var(--sc-color-gray-500);box-shadow:0 0 0 var(--sc-focus-ring-width) var(--sc-color-gray-500)/var(--sc-focus-ring-alpha)}.button--outline.button--info:active:not(.button--disabled){border-color:var(--sc-color-gray-700);background-color:var(--sc-color-gray-700);color:var(--sc-color-white)}.button--outline.button--warning{border-color:var(--sc-color-warning-500);color:var(--sc-color-warning-500)}.button--outline.button--warning:hover:not(.button--disabled){background-color:var(--sc-color-warning-500);color:var(--sc-color-white)}.button--outline.button--warning:focus:not(.button--disabled){border-color:var(--sc-color-warning-500);box-shadow:0 0 0 var(--sc-focus-ring-width) var(--sc-color-warning-500)/var(--sc-focus-ring-alpha)}.button--outline.button--warning:active:not(.button--disabled){border-color:var(--sc-color-warning-700);background-color:var(--sc-color-warning-700);color:var(--sc-color-white)}.button--outline.button--danger{border-color:var(--sc-color-danger-500);color:var(--sc-color-danger-500)}.button--outline.button--danger:hover:not(.button--disabled){background-color:var(--sc-color-danger-500);color:var(--sc-color-white)}.button--outline.button--danger:focus:not(.button--disabled){border-color:var(--sc-color-danger-500);box-shadow:0 0 0 var(--sc-focus-ring-width) var(--sc-color-danger-500)/var(--sc-focus-ring-alpha)}.button--outline.button--danger:active:not(.button--disabled){border-color:var(--sc-color-danger-700);background-color:var(--sc-color-danger-700);color:var(--sc-color-white)}.button--text{background-color:transparent;border-color:transparent;color:inherit}.button--text:hover:not(.button--disabled){background-color:transparent;border-color:transparent;color:var(--sc-color-gray-600)}.button--text:focus:not(.button--disabled){background-color:transparent;border-color:transparent;box-shadow:0}.button--text:active:not(.button--disabled){background-color:transparent;border-color:transparent;box-shadow:0}.button--text.button--caret.button--has-label{padding-right:var(--sc-spacing-xx-small)}.button--text.button--caret.button--has-label .button__label{padding:0 var(--sc-spacing-xx-small) !important}.button--link{background-color:transparent;border-color:transparent;box-shadow:none;color:var(--sc-button-link-color, var(--primary-background));transition:opacity var(--sc-input-transition, var(--sc-transition-medium)) ease;text-decoration:var(--sc-button-link-text-decoration, none)}.button--link.button--has-label.button--small .button__label,.button--link.button--has-label.button--medium .button__label,.button--link.button--has-label.button--large .button__label{padding:0}.button--link:hover:not(.button--disabled){background-color:transparent;border-color:transparent;opacity:0.75}.button--link:focus:not(.button--disabled){background-color:transparent;border-color:transparent}.button--link:active:not(.button--disabled){background-color:transparent;border-color:transparent}.button--link.button--has-prefix:not(.button--text).button--small,.button--link.button--has-prefix:not(.button--text).button--medium,.button--link.button--has-prefix:not(.button--text).button--large{padding-left:0}.button--link.button--has-prefix:not(.button--text).button--small .button__label,.button--link.button--has-prefix:not(.button--text).button--medium .button__label,.button--link.button--has-prefix:not(.button--text).button--large .button__label{padding-left:var(--sc-spacing-xx-small)}.button--link.button--has-suffix:not(.button--text).button--small,.button--link.button--has-suffix:not(.button--text).button--medium,.button--link.button--has-suffix:not(.button--text).button--large{padding-right:0}.button--link.button--has-suffix:not(.button--text).button--small .button__label,.button--link.button--has-suffix:not(.button--text).button--medium .button__label,.button--link.button--has-suffix:not(.button--text).button--large .button__label{padding-right:var(--sc-spacing-xx-small)}.button--small{font-size:var(--sc-button-font-size-small);height:var(--sc-input-height-small);line-height:calc(var(--sc-input-height-small) - var(--sc-input-border-width) * 2);border-radius:var(--button-border-radius, var(--sc-input-border-radius-small))}.button--medium{font-size:var(--sc-button-font-size-medium);height:var(--sc-input-height-medium);line-height:calc(var(--sc-input-height-medium) - var(--sc-input-border-width) * 2);border-radius:var(--button-border-radius, var(--sc-input-border-radius-medium))}.button--large{font-size:var(--sc-button-font-size-large);height:var(--sc-input-height-large);line-height:calc(var(--sc-input-height-large) - var(--sc-input-border-width) * 2);border-radius:var(--button-border-radius, var(--sc-input-border-radius-large))}.button--full{display:block}.button--pill.button--small{border-radius:var(--sc-input-height-small)}.button--pill.button--medium{border-radius:var(--sc-input-height-medium)}.button--pill.button--large{border-radius:var(--sc-input-height-large)}.button--circle{padding-left:0;padding-right:0}.button--circle.button--small{width:var(--sc-input-height-small);border-radius:50%}.button--circle.button--medium{width:var(--sc-input-height-medium);border-radius:50%}.button--circle.button--large{width:var(--sc-input-height-large);border-radius:50%}.button--circle .button__prefix,.button--circle .button__suffix,.button--circle .button__caret{display:none}.button--caret .button__suffix{display:none}.button--caret .button__caret{display:flex;align-items:center}.button--caret .button__caret svg{width:1em;height:1em}.button--busy{position:relative;cursor:wait}.button--busy .button__prefix,.button--busy .button__label,.button--busy .button__suffix,.button--busy .button__caret{visibility:hidden}.button--busy *{pointer-events:none}.button--loading{position:relative;cursor:wait}.button--loading .button__prefix,.button--loading .button__label,.button--loading .button__suffix,.button--loading .button__caret{visibility:hidden}sc-spinner::part(base){--indicator-color:currentColor;--spinner-size:12px;position:absolute;top:calc(50% - var(--spinner-size) + var(--spinner-size) / 4);left:calc(50% - var(--spinner-size) + var(--spinner-size) / 4)}.button ::slotted(sc-badge){position:absolute;top:0;right:0;transform:translateY(-50%) translateX(50%);pointer-events:none}.button--has-label.button--small .button__label{padding:0 var(--sc-spacing-small)}.button--has-label.button--medium .button__label{padding:0 var(--sc-spacing-medium)}.button--has-label.button--large .button__label{padding:0 var(--sc-spacing-large)}.button--has-prefix:not(.button--text).button--small{padding-left:var(--sc-spacing-x-small)}.button--has-prefix:not(.button--text).button--small .button__label{padding-left:var(--sc-spacing-x-small)}.button--has-prefix:not(.button--text).button--medium{padding-left:var(--sc-spacing-small)}.button--has-prefix:not(.button--text).button--medium .button__label{padding-left:var(--sc-spacing-small)}.button--has-prefix:not(.button--text).button--large{padding-left:var(--sc-spacing-small)}.button--has-prefix:not(.button--text).button--large .button__label{padding-left:var(--sc-spacing-small)}.button--has-suffix.button--small,.button--caret.button--small{padding-right:var(--sc-spacing-x-small)}.button--has-suffix.button--small .button__label,.button--caret.button--small .button__label{padding-right:var(--sc-spacing-x-small)}.button--has-suffix.button--medium,.button--caret.button--medium{padding-right:var(--sc-spacing-small)}.button--has-suffix.button--medium .button__label,.button--caret.button--medium .button__label{padding-right:var(--sc-spacing-small)}.button--has-suffix.button--large,.button--caret.button--large{padding-right:var(--sc-spacing-small)}.button--has-suffix.button--large .button__label,.button--caret.button--large .button__label{padding-right:var(--sc-spacing-small)}:host(.sc-button-group__button--first) .button{border-top-right-radius:0;border-bottom-right-radius:0}:host(.sc-button-group__button--inner) .button{border-radius:0}:host(.sc-button-group__button--last) .button{border-top-left-radius:0;border-bottom-left-radius:0}:host(.sc-button-group__button:not(.sc-button-group__button--first)){margin-left:calc(-1 * var(--sc-input-border-width))}:host(.sc-button-group__button:not(.sc-button-group__button--focus,.sc-button-group__button--first,[type=default]):not(:hover,:active,:focus)) .button:after{content:\"\";position:absolute;top:0;left:0;bottom:0;border-left:solid 1px rgba(255, 255, 255, 0.2666666667);mix-blend-mode:lighten}:host(.sc-button-group__button--hover){z-index:1}:host(.sc-button-group__button--focus){z-index:2}@keyframes busy-animation{0%{background-position:200px 0}}.button--is-rtl.button--has-prefix.button--small,.button--is-rtl.button--has-prefix.button--medium,.button--is-rtl.button--has-prefix.button--large{padding-left:0}.button--is-rtl.button--has-prefix.button--small .button__label,.button--is-rtl.button--has-prefix.button--medium .button__label,.button--is-rtl.button--has-prefix.button--large .button__label{padding-left:0;padding-right:var(--sc-spacing-xx-small)}.button--is-rtl.button--has-suffix.button--small,.button--is-rtl.button--has-suffix.button--medium,.button--is-rtl.button--has-suffix.button--large{padding-right:0}.button--is-rtl.button--has-suffix.button--small .button__label,.button--is-rtl.button--has-suffix.button--medium .button__label,.button--is-rtl.button--has-suffix.button--large .button__label{padding-right:0;padding-left:var(--sc-spacing-xx-small)}"; |
| 114 | const ScButtonStyle0 = scButtonCss; |
| 115 | |
| 116 | const ScButton = class { |
| 117 | constructor(hostRef) { |
| 118 | registerInstance(this, hostRef); |
| 119 | this.scBlur = createEvent(this, "scBlur", 7); |
| 120 | this.scFocus = createEvent(this, "scFocus", 7); |
| 121 | this.hasFocus = false; |
| 122 | this.hasLabel = false; |
| 123 | this.hasPrefix = false; |
| 124 | this.hasSuffix = false; |
| 125 | this.type = 'default'; |
| 126 | this.size = 'medium'; |
| 127 | this.caret = false; |
| 128 | this.full = false; |
| 129 | this.disabled = false; |
| 130 | this.loading = false; |
| 131 | this.outline = false; |
| 132 | this.busy = false; |
| 133 | this.pill = false; |
| 134 | this.circle = false; |
| 135 | this.submit = false; |
| 136 | this.name = undefined; |
| 137 | this.value = undefined; |
| 138 | this.href = undefined; |
| 139 | this.target = undefined; |
| 140 | this.download = undefined; |
| 141 | this.autofocus = undefined; |
| 142 | } |
| 143 | componentWillLoad() { |
| 144 | this.handleSlotChange(); |
| 145 | } |
| 146 | /** Simulates a click on the button. */ |
| 147 | click() { |
| 148 | this.button.click(); |
| 149 | } |
| 150 | /** Sets focus on the button. */ |
| 151 | focus(options) { |
| 152 | this.button.focus(options); |
| 153 | } |
| 154 | /** Removes focus from the button. */ |
| 155 | blur() { |
| 156 | this.button.blur(); |
| 157 | } |
| 158 | handleSlotChange() { |
| 159 | this.hasLabel = !!this.button.children; |
| 160 | this.hasPrefix = !!this.button.querySelector('[slot="prefix"]'); |
| 161 | this.hasSuffix = !!this.button.querySelector('[slot="suffix"]'); |
| 162 | } |
| 163 | handleBlur() { |
| 164 | this.hasFocus = false; |
| 165 | this.scBlur.emit(); |
| 166 | } |
| 167 | handleFocus() { |
| 168 | this.hasFocus = true; |
| 169 | this.scFocus.emit(); |
| 170 | } |
| 171 | handleClick(event) { |
| 172 | if (this.disabled || this.loading || this.busy) { |
| 173 | event.preventDefault(); |
| 174 | event.stopPropagation(); |
| 175 | } |
| 176 | if (this.submit) { |
| 177 | this.submitForm(); |
| 178 | } |
| 179 | } |
| 180 | submitForm() { |
| 181 | var _a, _b; |
| 182 | const form = ((_b = (_a = this.button.closest('sc-form')) === null || _a === void 0 ? void 0 : _a.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('form')) || this.button.closest('form'); |
| 183 | // Calling form.submit() seems to bypass the submit event and constraint validation. Instead, we can inject a |
| 184 | // native submit button into the form, click it, then remove it to simulate a standard form submission. |
| 185 | const button = document.createElement('button'); |
| 186 | if (form) { |
| 187 | button.type = 'submit'; |
| 188 | button.style.position = 'absolute'; |
| 189 | button.style.width = '0'; |
| 190 | button.style.height = '0'; |
| 191 | button.style.clip = 'rect(0 0 0 0)'; |
| 192 | button.style.clipPath = 'inset(50%)'; |
| 193 | button.style.overflow = 'hidden'; |
| 194 | button.style.whiteSpace = 'nowrap'; |
| 195 | form.append(button); |
| 196 | button.click(); |
| 197 | button.remove(); |
| 198 | } |
| 199 | } |
| 200 | render() { |
| 201 | const Tag = this.href ? 'a' : 'button'; |
| 202 | const interior = (h(Fragment, { key: 'f24e2a28bcd34f5dc690696251990215748f3b90' }, h("span", { key: '3e40c4bd145c10b04baeb7367a34197214a34040', part: "prefix", class: "button__prefix" }, h("slot", { key: 'e43d867289b8089f9506dc01bbceaf0c0c6578e7', onSlotchange: () => this.handleSlotChange(), name: "prefix" })), h("span", { key: '2fd1716e139d428c0357b30c1257fb142a4c5539', part: "label", class: "button__label" }, h("slot", { key: 'fe59ee1a2300225bd4d4b46b104c6604814a1cfb', onSlotchange: () => this.handleSlotChange() })), h("span", { key: '52914e300a151d2453e9edcee91f2984426b5460', part: "suffix", class: "button__suffix" }, h("slot", { key: 'a3d7be32fdcd5ca13ae78ed5d1a43be01cda91a2', onSlotchange: () => this.handleSlotChange(), name: "suffix" })), this.caret ? (h("span", { part: "caret", class: "button__caret" }, h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("polyline", { points: "6 9 12 15 18 9" })))) : (''), this.loading || this.busy ? h("sc-spinner", { exportparts: "base:spinner" }) : '')); |
| 203 | return (h(Tag, { key: 'd3ac910cccb0996e75392170ca3f3d5f97aec797', part: "base", class: { |
| 204 | 'button': true, |
| 205 | [`button--${this.type}`]: !!this.type, |
| 206 | [`button--${this.size}`]: true, |
| 207 | 'button--caret': this.caret, |
| 208 | 'button--circle': this.circle, |
| 209 | 'button--disabled': this.disabled, |
| 210 | 'button--focused': this.hasFocus, |
| 211 | 'button--loading': this.loading, |
| 212 | 'button--busy': this.busy, |
| 213 | 'button--pill': this.pill, |
| 214 | 'button--standard': !this.outline, |
| 215 | 'button--outline': this.outline, |
| 216 | 'button--has-label': this.hasLabel, |
| 217 | 'button--has-prefix': this.hasPrefix, |
| 218 | 'button--has-suffix': this.hasSuffix, |
| 219 | 'button--is-rtl': isRtl(), |
| 220 | }, href: this.href, target: this.target, download: this.download, autoFocus: this.autofocus, rel: this.target ? 'noreferrer noopener' : undefined, role: "button", "aria-disabled": this.disabled ? 'true' : 'false', "aria-busy": this.busy || this.loading ? 'true' : 'false', tabindex: this.disabled ? '-1' : '0', disabled: this.disabled || this.busy, type: this.submit ? 'submit' : 'button', name: this.name, value: this.value, onBlur: () => this.handleBlur(), onFocus: () => this.handleFocus(), onClick: e => this.handleClick(e) }, interior)); |
| 221 | } |
| 222 | get button() { return getElement(this); } |
| 223 | }; |
| 224 | ScButton.style = ScButtonStyle0; |
| 225 | |
| 226 | const scDashboardModuleCss = ":host{display:block;position:relative}.dashboard-module{display:grid;gap:var(--sc-dashboard-module-spacing, 1em)}.heading{font-family:var(--sc-font-sans);display:flex;flex-wrap:wrap;gap:1em;align-items:center;justify-content:space-between}.heading__text{display:grid;flex:1;gap:calc(var(--sc-dashboard-module-spacing, 1em) / 2)}@media screen and (min-width: 720px){.heading{gap:2em}}.heading__title{font-size:var(--sc-dashbaord-module-heading-size, var(--sc-font-size-x-large));font-weight:var(--sc-dashbaord-module-heading-weight, var(--sc-font-weight-bold));line-height:var(--sc-dashbaord-module-heading-line-height, var(--sc-line-height-dense));white-space:nowrap}.heading__description{font-size:var(--sc-font-size-normal);line-height:var(--sc-line-height-dense);opacity:0.85}"; |
| 227 | const ScDashboardModuleStyle0 = scDashboardModuleCss; |
| 228 | |
| 229 | const ScDashboardModule = class { |
| 230 | constructor(hostRef) { |
| 231 | registerInstance(this, hostRef); |
| 232 | this.heading = undefined; |
| 233 | this.error = undefined; |
| 234 | this.loading = undefined; |
| 235 | } |
| 236 | render() { |
| 237 | return (h("div", { key: '3de0cde0fe04ee3424defbce8cfa68025c79e3e0', class: "dashboard-module", part: "base" }, !!this.error && (h("sc-alert", { key: 'bc897abbb84b511f7e23b07f9a869319f18f62b2', exportparts: "base:error__base, icon:error__icon, text:error__text, title:error__title, message:error__message", open: !!this.error, type: "danger" }, h("span", { key: '1b0bc02a679ae34033f457714f7ce2588729d0c6', slot: "title" }, wp.i18n.__('Error', 'surecart')), this.error)), h("div", { key: 'af6d73e44be70a61fea4e1381c1f4b5254956135', class: "heading", part: "heading" }, h("div", { key: '9e29217cbb7333ba5df3d3525dd685c0768874be', class: "heading__text", part: "heading-text" }, h("div", { key: '7c76e45b97ec123f2bf8ded60867630e6fe6c2a5', class: "heading__title", part: "heading-title" }, h("slot", { key: 'f0679df2c2654bade5c39dd72237c02a4d244801', name: "heading", "aria-label": this.heading }, this.heading)), h("div", { key: '336a6d29e685ccee3f4a4fbab04f4360c1f14077', class: "heading__description", part: "heading-description" }, h("slot", { key: 'bae0d71b143c65fda0e81b16926260ead5496939', name: "description" }))), h("slot", { key: '9aefc55963fc5b0daadb91dc4960b7327b375589', name: "end" })), h("slot", { key: '898f1e47a2afc0eff3762f50a1ce407a7a392dc7' }))); |
| 238 | } |
| 239 | }; |
| 240 | ScDashboardModule.style = ScDashboardModuleStyle0; |
| 241 | |
| 242 | const locks = new Set(); |
| 243 | // |
| 244 | // Prevents body scrolling. Keeps track of which elements requested a lock so multiple levels of locking are possible |
| 245 | // without premature unlocking. |
| 246 | // |
| 247 | function lockBodyScrolling(lockingEl) { |
| 248 | locks.add(lockingEl); |
| 249 | document.body.classList.add('sc-scroll-lock'); |
| 250 | } |
| 251 | // |
| 252 | // Unlocks body scrolling. Scrolling will only be unlocked once all elements that requested a lock call this method. |
| 253 | // |
| 254 | function unlockBodyScrolling(lockingEl) { |
| 255 | locks.delete(lockingEl); |
| 256 | if (locks.size === 0) { |
| 257 | document.body.classList.remove('sc-scroll-lock'); |
| 258 | } |
| 259 | } |
| 260 | |
| 261 | const scDialogCss = ":host{--width:31rem;--header-spacing:var(--sc-spacing-large);--body-spacing:var(--sc-spacing-large);--footer-spacing:var(--sc-spacing-large);display:contents}[hidden]{display:none !important}.dialog{display:flex;align-items:center;justify-content:center;position:fixed;top:0;right:0;bottom:0;left:0;z-index:var(--sc-z-index-dialog);box-sizing:border-box;text-align:left}.dialog__panel{display:flex;flex-direction:column;z-index:2;width:var(--width);max-width:100vw;max-height:100vh;background-color:var(--sc-panel-background-color);border-radius:var(--sc-border-radius-medium);box-shadow:var(--sc-shadow-x-large);position:relative}.dialog__panel:focus{outline:none}@media screen and (max-width: 420px){.dialog__panel{max-height:80vh}}.dialog--open .dialog__panel{display:flex;opacity:1;transform:none}.dialog__header{flex:0 0 auto;display:flex;border-bottom:1px solid var(--sc-color-gray-300)}.dialog__title{flex:1 1 auto;font:inherit;font-size:var(--sc-font-size-large);line-height:var(--sc-line-height-dense);padding:var(--header-spacing);margin:0}.dialog__close{flex:0 0 auto;display:flex;align-items:center;font-size:var(--sc-font-size-x-large);padding:0 calc(var(--header-spacing) / 2);z-index:2}.dialog__body{flex:1 1 auto;padding:var(--body-spacing);overflow:var(--dialog-body-overflow, auto);-webkit-overflow-scrolling:touch}.dialog__footer{flex:0 0 auto;text-align:right;padding:var(--footer-spacing)}.dialog__footer ::slotted(sl-button:not(:first-of-type)){margin-left:var(--sc-spacing-x-small)}.dialog:not(.dialog--has-footer) .dialog__footer{display:none}.dialog__overlay{position:fixed;top:0;right:0;bottom:0;left:0;background-color:var(--sc-overlay-background-color)}"; |
| 262 | const ScDialogStyle0 = scDialogCss; |
| 263 | |
| 264 | const ScDialog = class { |
| 265 | constructor(hostRef) { |
| 266 | registerInstance(this, hostRef); |
| 267 | this.scRequestClose = createEvent(this, "scRequestClose", 7); |
| 268 | this.scShow = createEvent(this, "scShow", 7); |
| 269 | this.scAfterShow = createEvent(this, "scAfterShow", 7); |
| 270 | this.scHide = createEvent(this, "scHide", 7); |
| 271 | this.scAfterHide = createEvent(this, "scAfterHide", 7); |
| 272 | this.scInitialFocus = createEvent(this, "scInitialFocus", 7); |
| 273 | this.open = false; |
| 274 | this.label = ''; |
| 275 | this.noHeader = false; |
| 276 | this.hasFooter = false; |
| 277 | } |
| 278 | /** Shows the dialog. */ |
| 279 | async show() { |
| 280 | if (this.open) { |
| 281 | return undefined; |
| 282 | } |
| 283 | this.open = true; |
| 284 | } |
| 285 | /** Hides the dialog */ |
| 286 | async hide() { |
| 287 | if (!this.open) { |
| 288 | return undefined; |
| 289 | } |
| 290 | this.open = false; |
| 291 | } |
| 292 | requestClose(source) { |
| 293 | const slRequestClose = this.scRequestClose.emit(source); |
| 294 | if (slRequestClose.defaultPrevented) { |
| 295 | const animation = getAnimation(this.el, 'dialog.denyClose'); |
| 296 | animateTo(this.panel, animation.keyframes, animation.options); |
| 297 | return; |
| 298 | } |
| 299 | this.hide(); |
| 300 | } |
| 301 | handleKeyDown(event) { |
| 302 | if (event.key === 'Escape') { |
| 303 | event.stopPropagation(); |
| 304 | this.requestClose('keyboard'); |
| 305 | } |
| 306 | } |
| 307 | async handleOpenChange() { |
| 308 | if (this.open) { |
| 309 | // Show |
| 310 | this.scShow.emit(); |
| 311 | lockBodyScrolling(this.el); |
| 312 | // When the dialog is shown, Safari will attempt to set focus on whatever element has autofocus. This can cause |
| 313 | // the dialogs's animation to jitter (if it starts offscreen), so we'll temporarily remove the attribute, call |
| 314 | // `focus({ preventScroll: true })` ourselves, and add the attribute back afterwards. |
| 315 | // |
| 316 | // Related: https://github.com/shoelace-style/shoelace/issues/693 |
| 317 | // |
| 318 | const autoFocusTarget = this.el.querySelector('[autofocus]'); |
| 319 | if (autoFocusTarget) { |
| 320 | autoFocusTarget.removeAttribute('autofocus'); |
| 321 | } |
| 322 | await Promise.all([stopAnimations(this.dialog), stopAnimations(this.overlay)]); |
| 323 | this.dialog.hidden = false; |
| 324 | // Set initial focus |
| 325 | requestAnimationFrame(() => { |
| 326 | const slInitialFocus = this.scInitialFocus.emit(); |
| 327 | if (!slInitialFocus.defaultPrevented) { |
| 328 | // Set focus to the autofocus target and restore the attribute |
| 329 | if (autoFocusTarget) { |
| 330 | autoFocusTarget.focus({ preventScroll: true }); |
| 331 | } |
| 332 | else { |
| 333 | this.panel.focus({ preventScroll: true }); |
| 334 | } |
| 335 | } |
| 336 | // Restore the autofocus attribute |
| 337 | if (autoFocusTarget) { |
| 338 | autoFocusTarget.setAttribute('autofocus', ''); |
| 339 | } |
| 340 | }); |
| 341 | const panelAnimation = getAnimation(this.el, 'dialog.show'); |
| 342 | const overlayAnimation = getAnimation(this.el, 'dialog.overlay.show'); |
| 343 | await Promise.all([animateTo(this.panel, panelAnimation.keyframes, panelAnimation.options), animateTo(this.overlay, overlayAnimation.keyframes, overlayAnimation.options)]); |
| 344 | this.scAfterShow.emit(); |
| 345 | } |
| 346 | else { |
| 347 | // Hide |
| 348 | this.scHide.emit(); |
| 349 | await Promise.all([stopAnimations(this.dialog), stopAnimations(this.overlay)]); |
| 350 | const panelAnimation = getAnimation(this.el, 'dialog.hide'); |
| 351 | const overlayAnimation = getAnimation(this.el, 'dialog.overlay.hide'); |
| 352 | await Promise.all([animateTo(this.panel, panelAnimation.keyframes, panelAnimation.options), animateTo(this.overlay, overlayAnimation.keyframes, overlayAnimation.options)]); |
| 353 | this.dialog.hidden = true; |
| 354 | unlockBodyScrolling(this.el); |
| 355 | // Restore focus to the original trigger |
| 356 | const trigger = this.originalTrigger; |
| 357 | if (typeof (trigger === null || trigger === void 0 ? void 0 : trigger.focus) === 'function') { |
| 358 | setTimeout(() => trigger.focus()); |
| 359 | } |
| 360 | this.scAfterHide.emit(); |
| 361 | } |
| 362 | } |
| 363 | componentDidLoad() { |
| 364 | this.hasFooter = !!this.el.querySelector('[slot="footer"]'); |
| 365 | this.dialog.hidden = !this.open; |
| 366 | if (this.open) { |
| 367 | lockBodyScrolling(this.el); |
| 368 | } |
| 369 | } |
| 370 | disconnectedCallback() { |
| 371 | unlockBodyScrolling(this.el); |
| 372 | } |
| 373 | render() { |
| 374 | return (h("div", { key: 'bf1c3df909db24b2f0b03f29142eec5aa4e39420', part: "base", ref: el => (this.dialog = el), class: { |
| 375 | 'dialog': true, |
| 376 | 'dialog--open': this.open, |
| 377 | 'dialog--has-footer': this.hasFooter, |
| 378 | }, onKeyDown: e => this.handleKeyDown(e) }, h("div", { key: 'ae54847913977bf52a5e252afd10fe5ad8695d41', part: "overlay", class: "dialog__overlay", onClick: e => { |
| 379 | e.preventDefault(); |
| 380 | e.stopImmediatePropagation(); |
| 381 | this.requestClose('overlay'); |
| 382 | }, ref: el => (this.overlay = el), tabindex: "-1" }), h("div", { key: '10454310bc9761ad49069ca723e81e2ef7320018', part: "panel", class: "dialog__panel", role: "dialog", "aria-modal": "true", "aria-hidden": this.open ? 'false' : 'true', "aria-label": this.noHeader || this.label, "aria-labelledby": !this.noHeader || 'title', ref: el => (this.panel = el), tabindex: "0" }, !this.noHeader && (h("header", { key: 'b0d7e31944394b067c44c2a400b08fb391d072d0', part: "header", class: "dialog__header" }, h("h2", { key: 'b4e9f1d7f6d720d6b9553ec62adc415a84d50ce0', part: "title", class: "dialog__title", id: "title" }, h("slot", { key: '5d747d98d228a81c53833e77714dfa5ce342b126', name: "label" }, " ", this.label.length > 0 ? this.label : String.fromCharCode(65279), " ")), h("sc-button", { key: '49040b90d1b12a682cbdce414b1b569a461611dc', class: "dialog__close", type: "text", circle: true, part: "close-button", exportparts: "base:close-button__base", onClick: e => { |
| 383 | e.preventDefault(); |
| 384 | e.stopImmediatePropagation(); |
| 385 | this.requestClose('close-button'); |
| 386 | } }, h("sc-icon", { key: '17961c645c9f85a29ad1c666d5213325c09eebd6', name: "x", label: wp.i18n.__('Close', 'surecart') })))), h("div", { key: 'd95e32e3802cc9e9aeac56684226c6dc6d6381bc', part: "body", class: "dialog__body" }, h("slot", { key: '6effdd4289157ea1b1664e7eab5af571088d8f38' })), h("footer", { key: 'ffadaae7b1cb69f46ec5276a8e9682123674546f', part: "footer", class: "dialog__footer" }, h("slot", { key: '3eb44e52095e42a41f03a603577750998ed3e7c8', name: "footer" }))))); |
| 387 | } |
| 388 | get el() { return getElement(this); } |
| 389 | static get watchers() { return { |
| 390 | "open": ["handleOpenChange"] |
| 391 | }; } |
| 392 | }; |
| 393 | setDefaultAnimation('dialog.show', { |
| 394 | keyframes: [ |
| 395 | { opacity: 0, transform: 'scale(0.8)' }, |
| 396 | { opacity: 1, transform: 'scale(1)' }, |
| 397 | ], |
| 398 | options: { duration: 150, easing: 'ease' }, |
| 399 | }); |
| 400 | setDefaultAnimation('dialog.hide', { |
| 401 | keyframes: [ |
| 402 | { opacity: 1, transform: 'scale(1)' }, |
| 403 | { opacity: 0, transform: 'scale(0.8)' }, |
| 404 | ], |
| 405 | options: { duration: 150, easing: 'ease' }, |
| 406 | }); |
| 407 | setDefaultAnimation('dialog.denyClose', { |
| 408 | keyframes: [{ transform: 'scale(1)' }, { transform: 'scale(1.02)' }, { transform: 'scale(1)' }], |
| 409 | options: { duration: 150 }, |
| 410 | }); |
| 411 | setDefaultAnimation('dialog.overlay.show', { |
| 412 | keyframes: [{ opacity: 0 }, { opacity: 1 }], |
| 413 | options: { duration: 150 }, |
| 414 | }); |
| 415 | setDefaultAnimation('dialog.overlay.hide', { |
| 416 | keyframes: [{ opacity: 1 }, { opacity: 0 }], |
| 417 | options: { duration: 150 }, |
| 418 | }); |
| 419 | ScDialog.style = ScDialogStyle0; |
| 420 | |
| 421 | const scFlexCss = ":host{display:block;--spacing:var(--sc-spacing-small)}.flex{display:flex;gap:var(--sc-flex-column-gap, var(--spacing));justify-content:var(--sc-flex-space-between, space-between)}.justify-flex-start{justify-content:flex-start}.justify-flex-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-space-between{justify-content:space-between}.justify-space-around{justify-content:space-around}.justify-space-evenly{justify-content:space-evenly}.wrap-wrap{flex-wrap:wrap}.wrap-no-wrap{flex-wrap:no-wrap}.align-flex-start{align-items:flex-start}.align-flex-end{align-items:flex-end}.align-center{align-items:center}.align-baseline{align-items:baseline}.align-stretch{align-items:stretch}.direction-row{flex-direction:row}.direction-row-reverse{flex-direction:row-reverse}.direction-column{flex-direction:column}.direction-column-reverse{flex-direction:column-reverse}@media (max-width: 480px){.stack-mobile{flex-direction:column}}@media (max-width: 768px){.stack-tablet{flex-direction:column}}@media (max-width: 1180px){.stack-desktop{flex-direction:column}}"; |
| 422 | const ScFlexStyle0 = scFlexCss; |
| 423 | |
| 424 | const ScFlex = class { |
| 425 | constructor(hostRef) { |
| 426 | registerInstance(this, hostRef); |
| 427 | this.alignItems = undefined; |
| 428 | this.justifyContent = undefined; |
| 429 | this.flexDirection = undefined; |
| 430 | this.columnGap = undefined; |
| 431 | this.flexWrap = undefined; |
| 432 | this.stack = undefined; |
| 433 | } |
| 434 | render() { |
| 435 | return (h("div", { key: 'fe79ec5e2b745f72291050f684e1e8755f824b41', part: "base", class: { |
| 436 | flex: true, |
| 437 | ...(this.justifyContent ? { [`justify-${this.justifyContent}`]: true } : {}), |
| 438 | ...(this.alignItems ? { [`align-${this.alignItems}`]: true } : {}), |
| 439 | ...(this.flexDirection ? { [`direction-${this.flexDirection}`]: true } : {}), |
| 440 | ...(this.columnGap ? { [`column-gap-${this.columnGap}`]: true } : {}), |
| 441 | ...(this.flexWrap ? { [`wrap-${this.flexWrap}`]: true } : {}), |
| 442 | ...(this.stack ? { [`stack-${this.stack}`]: true } : {}), |
| 443 | } }, h("slot", { key: '9772fa51d4c6e255454cc9feae4850805e21d30c' }))); |
| 444 | } |
| 445 | }; |
| 446 | ScFlex.style = ScFlexStyle0; |
| 447 | |
| 448 | const ScFormatDate = class { |
| 449 | constructor(hostRef) { |
| 450 | registerInstance(this, hostRef); |
| 451 | this.locale = undefined; |
| 452 | this.date = new Date(); |
| 453 | this.weekday = undefined; |
| 454 | this.era = undefined; |
| 455 | this.year = undefined; |
| 456 | this.month = undefined; |
| 457 | this.day = undefined; |
| 458 | this.hour = undefined; |
| 459 | this.minute = undefined; |
| 460 | this.second = undefined; |
| 461 | this.timeZoneName = undefined; |
| 462 | this.timeZone = undefined; |
| 463 | this.hourFormat = 'auto'; |
| 464 | this.type = 'date'; |
| 465 | } |
| 466 | render() { |
| 467 | const dateString = this.type === 'timestamp' ? parseInt(this.date.toString()) * 1000 : this.date; |
| 468 | const date = new Date(dateString); |
| 469 | const hour12 = this.hourFormat === 'auto' ? undefined : this.hourFormat === '12'; |
| 470 | // Check for an invalid date |
| 471 | if (isNaN(date.getMilliseconds())) { |
| 472 | return; |
| 473 | } |
| 474 | return new Intl.DateTimeFormat(this.locale, { |
| 475 | weekday: this.weekday, |
| 476 | era: this.era, |
| 477 | year: this.year, |
| 478 | month: this.month, |
| 479 | day: this.day, |
| 480 | hour: this.hour, |
| 481 | minute: this.minute, |
| 482 | second: this.second, |
| 483 | timeZoneName: this.timeZoneName, |
| 484 | timeZone: this.timeZone, |
| 485 | hour12: hour12, |
| 486 | }).format(date); |
| 487 | } |
| 488 | }; |
| 489 | |
| 490 | const UNIT_TYPES = { |
| 491 | kg: 'kilogram', |
| 492 | lb: 'pound', |
| 493 | g: 'gram', |
| 494 | oz: 'ounce', |
| 495 | }; |
| 496 | const ScFormatNumber = class { |
| 497 | constructor(hostRef) { |
| 498 | registerInstance(this, hostRef); |
| 499 | this.value = 0; |
| 500 | this.locale = undefined; |
| 501 | this.type = 'decimal'; |
| 502 | this.noGrouping = false; |
| 503 | this.currency = 'USD'; |
| 504 | this.currencyDisplay = 'symbol'; |
| 505 | this.minimumIntegerDigits = undefined; |
| 506 | this.minimumFractionDigits = null; |
| 507 | this.maximumFractionDigits = undefined; |
| 508 | this.minimumSignificantDigits = undefined; |
| 509 | this.maximumSignificantDigits = undefined; |
| 510 | this.noConvert = undefined; |
| 511 | this.unit = 'lb'; |
| 512 | } |
| 513 | render() { |
| 514 | if (isNaN(this.value)) { |
| 515 | return ''; |
| 516 | } |
| 517 | const lang = navigator.language || (navigator === null || navigator === void 0 ? void 0 : navigator.browserLanguage) || (navigator.languages || ['en'])[0]; |
| 518 | // maybe convert zero decimal currencies. |
| 519 | const value = this.noConvert || this.type !== 'currency' ? this.value : maybeConvertAmount(this.value, this.currency.toUpperCase()); |
| 520 | // decide how many decimal places to use. |
| 521 | const minimumFractionDigits = value % 1 == 0 ? 0 : 2; |
| 522 | return new Intl.NumberFormat(this.locale || lang, { |
| 523 | style: this.type, |
| 524 | currency: this.currency.toUpperCase(), |
| 525 | currencyDisplay: this.currencyDisplay, |
| 526 | useGrouping: !this.noGrouping, |
| 527 | minimumIntegerDigits: this.minimumIntegerDigits, |
| 528 | minimumFractionDigits: this.minimumFractionDigits !== null ? this.minimumFractionDigits : minimumFractionDigits, |
| 529 | maximumFractionDigits: this.maximumFractionDigits, |
| 530 | minimumSignificantDigits: this.minimumSignificantDigits, |
| 531 | maximumSignificantDigits: this.maximumSignificantDigits, |
| 532 | unit: UNIT_TYPES[this.unit], |
| 533 | }).format(value); |
| 534 | } |
| 535 | }; |
| 536 | |
| 537 | const iconFiles = new Map(); |
| 538 | const requestIcon = (url) => { |
| 539 | if (iconFiles.has(url)) { |
| 540 | return iconFiles.get(url); |
| 541 | } |
| 542 | else { |
| 543 | const request = fetch(url).then(async (response) => { |
| 544 | if (response.ok) { |
| 545 | const div = document.createElement('div'); |
| 546 | div.innerHTML = await response.text(); |
| 547 | const svg = div.firstElementChild; |
| 548 | return { |
| 549 | ok: response.ok, |
| 550 | status: response.status, |
| 551 | svg: svg && svg.tagName.toLowerCase() === 'svg' ? svg.outerHTML : '', |
| 552 | }; |
| 553 | } |
| 554 | else { |
| 555 | return { |
| 556 | ok: response.ok, |
| 557 | status: response.status, |
| 558 | svg: null, |
| 559 | }; |
| 560 | } |
| 561 | }); |
| 562 | iconFiles.set(url, request); |
| 563 | return request; |
| 564 | } |
| 565 | }; |
| 566 | |
| 567 | const scIconCss = ":host{--width:1em;--height:1em;display:inline-block;width:var(--width);height:var(--height);contain:strict;box-sizing:content-box !important}.icon,svg{display:block;height:100%;width:100%;stroke-width:var(--sc-icon-stroke-width, 2px)}"; |
| 568 | const ScIconStyle0 = scIconCss; |
| 569 | |
| 570 | /** |
| 571 | * The icon's label used for accessibility. |
| 572 | */ |
| 573 | const LABEL_MAPPINGS = { |
| 574 | 'chevron-down': wp.i18n.__('Open', 'surecart'), |
| 575 | 'chevron-up': wp.i18n.__('Close', 'surecart'), |
| 576 | 'chevron-right': wp.i18n.__('Next', 'surecart'), |
| 577 | 'chevron-left': wp.i18n.__('Previous', 'surecart'), |
| 578 | 'arrow-right': wp.i18n.__('Next', 'surecart'), |
| 579 | 'arrow-left': wp.i18n.__('Previous', 'surecart'), |
| 580 | 'arrow-down': wp.i18n.__('Down', 'surecart'), |
| 581 | 'arrow-up': wp.i18n.__('Up', 'surecart'), |
| 582 | 'alert-circle': wp.i18n.__('Alert', 'surecart'), |
| 583 | }; |
| 584 | const parser = new DOMParser(); |
| 585 | const ScIcon = class { |
| 586 | constructor(hostRef) { |
| 587 | registerInstance(this, hostRef); |
| 588 | this.scLoad = createEvent(this, "scLoad", 7); |
| 589 | this.svg = ''; |
| 590 | this.name = undefined; |
| 591 | this.src = undefined; |
| 592 | this.label = undefined; |
| 593 | this.library = 'default'; |
| 594 | } |
| 595 | /** @internal Fetches the icon and redraws it. Used to handle library registrations. */ |
| 596 | redraw() { |
| 597 | this.setIcon(); |
| 598 | } |
| 599 | componentWillLoad() { |
| 600 | this.setIcon(); |
| 601 | } |
| 602 | getLabel() { |
| 603 | let label = ''; |
| 604 | if (this.label) { |
| 605 | label = (LABEL_MAPPINGS === null || LABEL_MAPPINGS === void 0 ? void 0 : LABEL_MAPPINGS[this.label]) || this.label; |
| 606 | } |
| 607 | else if (this.name) { |
| 608 | label = ((LABEL_MAPPINGS === null || LABEL_MAPPINGS === void 0 ? void 0 : LABEL_MAPPINGS[this.name]) || this.name).replace(/-/g, ' '); |
| 609 | } |
| 610 | else if (this.src) { |
| 611 | label = this.src.replace(/.*\//, '').replace(/-/g, ' ').replace(/\.svg/i, ''); |
| 612 | } |
| 613 | return label; |
| 614 | } |
| 615 | async setIcon() { |
| 616 | const library = getIconLibrary(this.library); |
| 617 | const url = this.getUrl(); |
| 618 | if (url) { |
| 619 | try { |
| 620 | const file = await requestIcon(url); |
| 621 | if (url !== this.getUrl()) { |
| 622 | // If the url has changed while fetching the icon, ignore this request |
| 623 | return; |
| 624 | } |
| 625 | else if (file.ok) { |
| 626 | const doc = parser.parseFromString(file.svg, 'text/html'); |
| 627 | const svgEl = doc.body.querySelector('svg'); |
| 628 | if (svgEl) { |
| 629 | if (library && library.mutator) { |
| 630 | library.mutator(svgEl); |
| 631 | } |
| 632 | this.svg = svgEl.outerHTML; |
| 633 | this.scLoad.emit(); |
| 634 | } |
| 635 | else { |
| 636 | this.svg = ''; |
| 637 | console.error({ status: file === null || file === void 0 ? void 0 : file.status }); |
| 638 | } |
| 639 | } |
| 640 | else { |
| 641 | this.svg = ''; |
| 642 | console.error({ status: file === null || file === void 0 ? void 0 : file.status }); |
| 643 | } |
| 644 | } |
| 645 | catch { |
| 646 | console.error({ status: -1 }); |
| 647 | } |
| 648 | } |
| 649 | else if (this.svg) { |
| 650 | // If we can't resolve a URL and an icon was previously set, remove it |
| 651 | this.svg = ''; |
| 652 | } |
| 653 | } |
| 654 | getUrl() { |
| 655 | const library = getIconLibrary(this.library); |
| 656 | if (this.name && library) { |
| 657 | return library.resolver(this.name); |
| 658 | } |
| 659 | else { |
| 660 | return this.src; |
| 661 | } |
| 662 | } |
| 663 | render() { |
| 664 | return h("div", { key: 'deedb35b3e492ab36508a8a896e3089f2e11626b', part: "base", class: "icon", role: "img", "aria-label": this.getLabel(), innerHTML: this.svg }); |
| 665 | } |
| 666 | static get assetsDirs() { return ["icon-assets"]; } |
| 667 | static get watchers() { return { |
| 668 | "name": ["setIcon"], |
| 669 | "src": ["setIcon"], |
| 670 | "library": ["setIcon"] |
| 671 | }; } |
| 672 | }; |
| 673 | ScIcon.style = ScIconStyle0; |
| 674 | |
| 675 | const scSkeletonCss = ":host{position:relative;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit}:host{--border-radius:var(--sc-border-radius-pill);--color:var(--sc-skeleton-color, var(--sc-color-gray-300));--sheen-color:var(--sc-skeleton-sheen-color, var(--sc-color-gray-400));display:block;position:relative}.skeleton{display:flex;width:100%;height:100%;min-height:1rem}.skeleton__indicator{flex:1 1 auto;background:var(--color);border-radius:var(--border-radius)}.skeleton--sheen .skeleton__indicator{background:linear-gradient(270deg, var(--sheen-color), var(--color), var(--color), var(--sheen-color));background-size:400% 100%;background-size:400% 100%;animation:sheen 3s ease-in-out infinite}.skeleton--pulse .skeleton__indicator{animation:pulse 2s ease-in-out 0.5s infinite}@keyframes sheen{0%{background-position:200% 0}to{background-position:-200% 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}"; |
| 676 | const ScSkeletonStyle0 = scSkeletonCss; |
| 677 | |
| 678 | const ScSkeleton = class { |
| 679 | constructor(hostRef) { |
| 680 | registerInstance(this, hostRef); |
| 681 | this.effect = 'sheen'; |
| 682 | } |
| 683 | render() { |
| 684 | return (h("div", { key: 'c6a1b8aec59860a3a72fce1b2e77cc4da682932b', part: "base", class: { |
| 685 | 'skeleton': true, |
| 686 | 'skeleton--pulse': this.effect === 'pulse', |
| 687 | 'skeleton--sheen': this.effect === 'sheen', |
| 688 | }, "aria-busy": "true", "aria-live": "polite" }, h("div", { key: 'e40de9d99b53f149ce5c341ef2b3244be168584b', part: "indicator", class: "skeleton__indicator" }))); |
| 689 | } |
| 690 | }; |
| 691 | ScSkeleton.style = ScSkeletonStyle0; |
| 692 | |
| 693 | const scSpinnerCss = ":host{--track-color:#0d131e20;--indicator-color:var(--sc-color-primary-500);--stroke-width:2px;--spinner-size:1em;display:inline-block}.spinner{display:inline-block;width:var(--spinner-size);height:var(--spinner-size);border-radius:50%;border:solid var(--stroke-width) var(--track-color);border-top-color:var(--indicator-color);border-right-color:var(--indicator-color);animation:1s linear infinite spin}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}"; |
| 694 | const ScSpinnerStyle0 = scSpinnerCss; |
| 695 | |
| 696 | const ScSpinner = class { |
| 697 | constructor(hostRef) { |
| 698 | registerInstance(this, hostRef); |
| 699 | } |
| 700 | render() { |
| 701 | return h("span", { key: '91d0bfe44be09c74ae7b57a74c80940a80004949', part: "base", class: "spinner", "aria-busy": "true", "aria-live": "polite" }); |
| 702 | } |
| 703 | }; |
| 704 | ScSpinner.style = ScSpinnerStyle0; |
| 705 | |
| 706 | const ScSubscriptionReactivate = class { |
| 707 | constructor(hostRef) { |
| 708 | registerInstance(this, hostRef); |
| 709 | this.scRequestClose = createEvent(this, "scRequestClose", 7); |
| 710 | this.scRefresh = createEvent(this, "scRefresh", 7); |
| 711 | this.open = undefined; |
| 712 | this.subscription = undefined; |
| 713 | this.busy = undefined; |
| 714 | this.error = undefined; |
| 715 | this.upcomingPeriod = undefined; |
| 716 | this.loading = false; |
| 717 | } |
| 718 | openChanged() { |
| 719 | if (this.open) { |
| 720 | this.fetchUpcoming(); |
| 721 | } |
| 722 | } |
| 723 | async fetchUpcoming() { |
| 724 | var _a; |
| 725 | this.loading = true; |
| 726 | try { |
| 727 | this.upcomingPeriod = await apiFetch({ |
| 728 | method: 'PATCH', |
| 729 | path: addQueryArgs(`surecart/v1/subscriptions/${(_a = this.subscription) === null || _a === void 0 ? void 0 : _a.id}/upcoming_period`, { |
| 730 | skip_product_group_validation: true, |
| 731 | expand: ['period.checkout'], |
| 732 | }), |
| 733 | data: { |
| 734 | purge_pending_update: false, |
| 735 | }, |
| 736 | }); |
| 737 | } |
| 738 | catch (e) { |
| 739 | this.error = (e === null || e === void 0 ? void 0 : e.message) || wp.i18n.__('Something went wrong', 'surecart'); |
| 740 | } |
| 741 | finally { |
| 742 | this.loading = false; |
| 743 | } |
| 744 | } |
| 745 | async reactivateSubscription() { |
| 746 | var _a; |
| 747 | try { |
| 748 | this.error = ''; |
| 749 | this.busy = true; |
| 750 | await apiFetch({ |
| 751 | path: `surecart/v1/subscriptions/${(_a = this.subscription) === null || _a === void 0 ? void 0 : _a.id}/restore`, |
| 752 | method: 'PATCH', |
| 753 | }); |
| 754 | this.scRefresh.emit(); |
| 755 | this.scRequestClose.emit('close-button'); |
| 756 | } |
| 757 | catch (e) { |
| 758 | this.error = (e === null || e === void 0 ? void 0 : e.message) || wp.i18n.__('Something went wrong', 'surecart'); |
| 759 | } |
| 760 | finally { |
| 761 | this.busy = false; |
| 762 | } |
| 763 | } |
| 764 | renderLoading() { |
| 765 | return (h("sc-flex", { flexDirection: "column", style: { gap: '1em' } }, h("sc-skeleton", { style: { width: '20%', display: 'inline-block' } }), h("sc-skeleton", { style: { width: '60%', display: 'inline-block' } }), h("sc-skeleton", { style: { width: '40%', display: 'inline-block' } }))); |
| 766 | } |
| 767 | render() { |
| 768 | var _a, _b, _c, _d; |
| 769 | return (h("sc-dialog", { key: '78928fb1f9c14597eadcdbaa32e183d18d40fbdb', noHeader: true, open: this.open, style: { '--width': '600px', '--body-spacing': 'var(--sc-spacing-xxx-large)' } }, h("sc-dashboard-module", { key: '06568dfb4a28e5670555be81b1e7fdfb03153196', loading: this.loading, heading: wp.i18n.__('Resubscribe', 'surecart'), class: "subscription-reactivate", error: this.error, style: { '--sc-dashboard-module-spacing': '1em' } }, this.loading ? (this.renderLoading()) : (h(Fragment, null, h("div", { slot: "description" }, h("sc-alert", { open: true, type: "warning", title: wp.i18n.__('Confirm Charge', 'surecart') }, wp.i18n.__('You will be charged', 'surecart'), ' ', h("sc-format-number", { type: "currency", value: (_b = (_a = this.upcomingPeriod) === null || _a === void 0 ? void 0 : _a.checkout) === null || _b === void 0 ? void 0 : _b.amount_due, currency: (_c = this.subscription) === null || _c === void 0 ? void 0 : _c.currency }), ' ', wp.i18n.__('immediately for your subscription.', 'surecart')), h("sc-text", { style: { |
| 770 | '--font-size': 'var(--sc-font-size-medium)', |
| 771 | '--color': 'var(--sc-input-label-color)', |
| 772 | '--line-height': 'var(--sc-line-height-dense)', |
| 773 | 'margin-top': 'var(--sc-spacing-medium)', |
| 774 | } }, wp.i18n.__('Your subscription will be reactivated and will renew automatically on', 'surecart'), ' ', h("strong", null, h("sc-format-date", { type: "timestamp", date: (_d = this.upcomingPeriod) === null || _d === void 0 ? void 0 : _d.end_at, month: "long", day: "numeric", year: "numeric" })))), h("sc-flex", { justifyContent: "flex-start" }, h("sc-button", { type: "primary", loading: this.busy, disabled: this.busy, onClick: () => this.reactivateSubscription() }, wp.i18n.__('Yes, Reactivate', 'surecart')), h("sc-button", { disabled: this.busy, style: { color: 'var(--sc-color-gray-500)' }, type: "text", onClick: () => this.scRequestClose.emit() }, wp.i18n.__('No, Keep Inactive', 'surecart'))))), this.busy && h("sc-block-ui", { key: 'f2441bfdcf892b9a54b23fa2c17c6edec8d52de8' })))); |
| 775 | } |
| 776 | static get watchers() { return { |
| 777 | "open": ["openChanged"] |
| 778 | }; } |
| 779 | }; |
| 780 | |
| 781 | const scTextCss = ":host{display:block;--font-size:var(--font-size, var(--sc-font-size-medium));--font-weight:var(--font-size, var(--sc-font-weight-normal));--line-height:var(--font-size, var(--sc-line-height-medium));--text-align:left;--color:var(--color, inherit)}.text{margin:0;font-size:var(--font-size);font-weight:var(--font-weight);line-height:var(--line-height);text-align:var(--text-align);color:var(--sc-stacked-list-row-text-color, var(--color))}.text.is-truncated{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text--is-rtl .text{text-align:right}"; |
| 782 | const ScTextStyle0 = scTextCss; |
| 783 | |
| 784 | const ScText = class { |
| 785 | constructor(hostRef) { |
| 786 | registerInstance(this, hostRef); |
| 787 | this.tag = 'p'; |
| 788 | this.truncate = false; |
| 789 | } |
| 790 | render() { |
| 791 | const CustomTag = this.tag; |
| 792 | return (h(CustomTag, { key: 'fed3d8e0241b6f16b58b91b8c49bcc632777bcf3', class: { |
| 793 | 'text': true, |
| 794 | 'is-truncated': this.truncate, |
| 795 | 'text--is-rtl': isRtl() |
| 796 | } }, h("slot", { key: '767109b735776fbc449dc0025a9c24c4e0fba385' }))); |
| 797 | } |
| 798 | }; |
| 799 | ScText.style = ScTextStyle0; |
| 800 | |
| 801 | export { ScAlert as sc_alert, ScBlockUi as sc_block_ui, ScButton as sc_button, ScDashboardModule as sc_dashboard_module, ScDialog as sc_dialog, ScFlex as sc_flex, ScFormatDate as sc_format_date, ScFormatNumber as sc_format_number, ScIcon as sc_icon, ScSkeleton as sc_skeleton, ScSpinner as sc_spinner, ScSubscriptionReactivate as sc_subscription_reactivate, ScText as sc_text }; |
| 802 | |
| 803 | //# sourceMappingURL=sc-alert_13.entry.js.map |