PluginProbe ʕ •ᴥ•ʔ
SureCart – Ecommerce Made Easy For Selling Physical Products, Digital Downloads, Subscriptions, Donations, & Payments / 3.0.0-beta2
SureCart – Ecommerce Made Easy For Selling Physical Products, Digital Downloads, Subscriptions, Donations, & Payments v3.0.0-beta2
4.7.0 4.6.6 4.6.5 4.6.4 4.6.3 4.6.2 4.6.1 4.6.0 4.5.1 4.5.0 4.4.2 4.4.1 4.4.0 4.3.3 4.3.2 4.3.1 4.3.0 4.2.3 4.2.2 4.2.1 1.0.3 1.0.4 1.0.5 1.0.6 1.1.0 1.1.1 1.1.10 1.1.11 1.1.12 1.1.13 1.1.14 1.1.15 1.1.16 1.1.17 1.1.18 1.1.19 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 1.1.9 1.10.0 1.10.1 1.10.2 1.10.3 1.10.4 1.11.0 1.11.1 1.11.2 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.4.0 1.4.1 1.4.2 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.7.0 1.7.1 1.7.2 1.8.0 1.8.1 1.8.2 1.8.3 1.8.4 1.8.5 1.9.0 1.9.1 1.9.2 1.9.3 1.9.4 1.9.5 2.0.0 2.0.1 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.10.0 2.10.1 2.11.0 2.11.1 2.11.2 2.11.3 2.11.4 2.12.0 2.13.0 2.14.0 2.14.1 2.15.0 2.15.1 2.16.0 2.16.1 2.16.2 2.16.3 2.17.0 2.17.1 2.17.2 2.18.0 2.19.0 2.19.2 2.19.3 2.19.4 2.2.0 2.2.1 2.20.0 2.20.1 2.20.2 2.20.3 2.20.4 2.20.5 2.20.6 2.21.0 2.22.0 2.22.1 2.23.0 2.24.0 2.25.0 2.25.1 2.25.2 2.26.0 2.27.0 2.27.1 2.28.0 2.29.0 2.29.1 2.29.2 2.29.3 2.29.4 2.3.0 2.3.1 2.30.0 2.31.0 2.31.1 2.31.2 2.31.3 2.4.0 2.4.1 2.4.2 2.4.3 2.4.4 2.40.0 2.40.1 2.5.0 2.5.1 2.5.2 2.6.0 2.6.1 2.6.2 2.7.0 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.8.0 2.8.1 2.8.2 2.8.3 2.8.4 2.9.0 3.0.0 3.0.0-RC1 3.0.0-RC2 3.0.0-beta1 3.0.0-beta2 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.10.0 3.10.1 3.11.0 3.12.0 3.13.0 3.13.1 3.13.2 3.13.3 3.13.4 3.14.0 3.15.0 3.15.1 3.15.2 3.15.3 3.15.4 3.15.5 3.16.0 3.16.1 3.16.2 3.16.3 3.16.4 3.16.5 3.16.6 3.16.7 3.16.8 3.17.0 3.17.1 3.17.2 3.17.3 3.17.4 3.17.5 3.17.6 3.18.0 3.19.0 3.19.1 3.19.2 3.2.0 3.2.1 3.2.2 3.20.0 3.20.1 3.3.0 3.3.1 3.4.0 3.4.1 3.4.2 3.4.3 3.5.0 3.5.1 3.5.2 3.5.3 3.6.0 3.6.1 3.6.2 3.7.0 3.7.1 3.7.2 3.7.3 3.8.0 3.8.1 3.8.2 3.8.3 3.8.4 3.8.5 3.9.0 4.0.0 4.0.1 4.0.2 4.0.3 trunk 4.1.0 0.2.19.1 4.1.1 1.0.0 4.2.0 1.0.1 1.0.2
surecart / dist / components / cjs / sc-price-choice.cjs.entry.js
surecart / dist / components / cjs Last commit date
MockProcessor-48b83649.js 1 year ago MockProcessor-48b83649.js.map 1 year ago add-query-args-49dcb630.js 1 year ago add-query-args-49dcb630.js.map 1 year ago address-4c70d641.js 1 year ago address-4c70d641.js.map 1 year ago animation-registry-f7f1a08b.js 1 year ago animation-registry-f7f1a08b.js.map 1 year ago app-globals-9f96f14c.js 1 year ago app-globals-9f96f14c.js.map 1 year ago consumer-9f4ee0e3.js 1 year ago consumer-9f4ee0e3.js.map 1 year ago countries-367b507a.js 1 year ago countries-367b507a.js.map 1 year ago currency-71fce0f0.js 1 year ago currency-71fce0f0.js.map 1 year ago error-b46e23c3.js 1 year ago error-b46e23c3.js.map 1 year ago fetch-6192c074.js 1 year ago fetch-6192c074.js.map 1 year ago form-data-0da9940f.js 1 year ago form-data-0da9940f.js.map 1 year ago functions-b63256c8.js 1 year ago functions-b63256c8.js.map 1 year ago getters-305b8266.js 1 year ago getters-305b8266.js.map 1 year ago getters-36e9dc10.js 1 year ago getters-36e9dc10.js.map 1 year ago getters-3f9f8286.js 1 year ago getters-3f9f8286.js.map 1 year ago getters-810d572b.js 1 year ago getters-810d572b.js.map 1 year ago getters-f6bbfe30.js 1 year ago getters-f6bbfe30.js.map 1 year ago google-03835677.js 1 year ago google-03835677.js.map 1 year ago google-59d23803.js 1 year ago google-59d23803.js.map 1 year ago index-252211ea.js 1 year ago index-252211ea.js.map 1 year ago index-6c7d178b.js 1 year ago index-6c7d178b.js.map 1 year ago index-8acc3c89.js 1 year ago index-8acc3c89.js.map 1 year ago index-adacfa36.js 1 year ago index-adacfa36.js.map 1 year ago index-bcdafe6e.js 1 year ago index-bcdafe6e.js.map 1 year ago index-fb76df07.js 2 years ago index-fb76df07.js.map 2 years ago index.cjs.js 1 year ago index.cjs.js.map 2 years 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-b4e9d7e3.js 1 year ago library-b4e9d7e3.js.map 1 year ago loader.cjs.js 1 year ago loader.cjs.js.map 1 year ago media-43b85f3d.js 1 year ago media-43b85f3d.js.map 1 year ago mutations-11c8f9a8.js 1 year ago mutations-11c8f9a8.js.map 1 year ago mutations-14b05e96.js 1 year ago mutations-14b05e96.js.map 1 year ago mutations-35e01219.js 1 year ago mutations-35e01219.js.map 1 year ago mutations-76f337c0.js 1 year ago mutations-76f337c0.js.map 1 year ago mutations-a920eef8.js 1 year ago mutations-a920eef8.js.map 1 year ago page-align-5a2ab493.js 1 year ago page-align-5a2ab493.js.map 1 year ago price-653ec1cb.js 1 year ago price-653ec1cb.js.map 1 year ago pure-bd6f0a6e.js 1 year ago pure-bd6f0a6e.js.map 1 year ago quantity-bff7f892.js 1 year ago quantity-bff7f892.js.map 1 year ago remove-query-args-b57e8cd3.js 1 year ago remove-query-args-b57e8cd3.js.map 1 year ago sc-address_3.cjs.entry.js 1 year ago sc-address_3.cjs.entry.js.map 1 year ago sc-alert_13.cjs.entry.js 1 year ago sc-alert_13.cjs.entry.js.map 1 year ago sc-avatar.cjs.entry.js 1 year ago sc-avatar.cjs.entry.js.map 1 year ago sc-badge-notice.cjs.entry.js 1 year ago sc-badge-notice.cjs.entry.js.map 1 year ago sc-breadcrumb.cjs.entry.js 1 year ago sc-breadcrumb.cjs.entry.js.map 1 year ago sc-breadcrumbs.cjs.entry.js 1 year ago sc-breadcrumbs.cjs.entry.js.map 1 year ago sc-button-group.cjs.entry.js 1 year ago sc-button-group.cjs.entry.js.map 1 year ago sc-cancel-dialog_2.cjs.entry.js 1 year ago sc-cancel-dialog_2.cjs.entry.js.map 1 year ago sc-cancel-discount_4.cjs.entry.js 1 year ago sc-cancel-discount_4.cjs.entry.js.map 1 year ago sc-card.cjs.entry.js 1 year ago sc-card.cjs.entry.js.map 1 year ago sc-cart-button.cjs.entry.js 1 year ago sc-cart-button.cjs.entry.js.map 1 year ago sc-cart-form-submit.cjs.entry.js 1 year ago sc-cart-form-submit.cjs.entry.js.map 1 year ago sc-cart-form.cjs.entry.js 1 year ago sc-cart-form.cjs.entry.js.map 1 year ago sc-cart-header.cjs.entry.js 1 year ago sc-cart-header.cjs.entry.js.map 1 year ago sc-cart-icon.cjs.entry.js 1 year ago sc-cart-icon.cjs.entry.js.map 1 year ago sc-cart-loader.cjs.entry.js 1 year ago sc-cart-loader.cjs.entry.js.map 1 year ago sc-cart-session-provider_3.cjs.entry.js 1 year ago sc-cart-session-provider_3.cjs.entry.js.map 1 year ago sc-cart-submit.cjs.entry.js 1 year ago sc-cart-submit.cjs.entry.js.map 1 year ago sc-cart.cjs.entry.js 1 year ago sc-cart.cjs.entry.js.map 1 year ago sc-cc-logo_2.cjs.entry.js 1 year ago sc-cc-logo_2.cjs.entry.js.map 1 year ago sc-charges-list.cjs.entry.js 1 year ago sc-charges-list.cjs.entry.js.map 1 year ago sc-checkout-form-errors.cjs.entry.js 1 year ago sc-checkout-form-errors.cjs.entry.js.map 1 year ago sc-checkout-mollie-payment_2.cjs.entry.js 1 year ago sc-checkout-mollie-payment_2.cjs.entry.js.map 1 year ago sc-checkout-product-price-variant-selector.cjs.entry.js 1 year ago sc-checkout-product-price-variant-selector.cjs.entry.js.map 1 year ago sc-checkout-stock-alert_8.cjs.entry.js 1 year ago sc-checkout-stock-alert_8.cjs.entry.js.map 1 year ago sc-checkout.cjs.entry.js 1 year ago sc-checkout.cjs.entry.js.map 1 year ago sc-choice-container.cjs.entry.js 1 year ago sc-choice-container.cjs.entry.js.map 1 year ago sc-choice.cjs.entry.js 1 year ago sc-choice.cjs.entry.js.map 1 year ago sc-choices.cjs.entry.js 1 year ago sc-choices.cjs.entry.js.map 1 year ago sc-column_2.cjs.entry.js 1 year ago sc-column_2.cjs.entry.js.map 1 year ago sc-compact-address_11.cjs.entry.js 1 year ago sc-compact-address_11.cjs.entry.js.map 1 year ago sc-conditional-form.cjs.entry.js 1 year ago sc-conditional-form.cjs.entry.js.map 1 year ago sc-consumer.cjs.entry.js 1 year ago sc-consumer.cjs.entry.js.map 1 year ago sc-coupon-form.cjs.entry.js 1 year ago sc-coupon-form.cjs.entry.js.map 1 year ago sc-custom-order-price-input.cjs.entry.js 1 year ago sc-custom-order-price-input.cjs.entry.js.map 1 year ago sc-customer-details.cjs.entry.js 1 year ago sc-customer-details.cjs.entry.js.map 1 year ago sc-customer-edit.cjs.entry.js 1 year ago sc-customer-edit.cjs.entry.js.map 1 year ago sc-customer-email.cjs.entry.js 1 year ago sc-customer-email.cjs.entry.js.map 1 year ago sc-customer-firstname.cjs.entry.js 1 year ago sc-customer-firstname.cjs.entry.js.map 1 year ago sc-customer-lastname.cjs.entry.js 1 year ago sc-customer-lastname.cjs.entry.js.map 1 year ago sc-customer-name.cjs.entry.js 1 year ago sc-customer-name.cjs.entry.js.map 1 year ago sc-customer-phone.cjs.entry.js 1 year ago sc-customer-phone.cjs.entry.js.map 1 year ago sc-dashboard-customer-details.cjs.entry.js 1 year ago sc-dashboard-customer-details.cjs.entry.js.map 1 year ago sc-dashboard-downloads-list.cjs.entry.js 1 year ago sc-dashboard-downloads-list.cjs.entry.js.map 1 year ago sc-divider.cjs.entry.js 1 year ago sc-divider.cjs.entry.js.map 1 year ago sc-donation-choices.cjs.entry.js 1 year ago sc-donation-choices.cjs.entry.js.map 1 year ago sc-downloads-list.cjs.entry.js 1 year ago sc-downloads-list.cjs.entry.js.map 1 year ago sc-dropdown_3.cjs.entry.js 1 year ago sc-dropdown_3.cjs.entry.js.map 1 year ago sc-empty.cjs.entry.js 1 year ago sc-empty.cjs.entry.js.map 1 year ago sc-express-payment.cjs.entry.js 1 year ago sc-express-payment.cjs.entry.js.map 1 year ago sc-feature-demo-banner.cjs.entry.js 1 year ago sc-feature-demo-banner.cjs.entry.js.map 1 year ago sc-form-control_2.cjs.entry.js 1 year ago sc-form-control_2.cjs.entry.js.map 1 year ago sc-form-row.cjs.entry.js 1 year ago sc-form-row.cjs.entry.js.map 1 year ago sc-form.cjs.entry.js 1 year ago sc-form.cjs.entry.js.map 1 year ago sc-format-bytes.cjs.entry.js 1 year ago sc-format-bytes.cjs.entry.js.map 1 year ago sc-format-interval.cjs.entry.js 1 year ago sc-format-interval.cjs.entry.js.map 1 year ago sc-fulfillment-shipping-status-badge.cjs.entry.js 1 year ago sc-fulfillment-shipping-status-badge.cjs.entry.js.map 1 year ago sc-fulfillments.cjs.entry.js 1 year ago sc-fulfillments.cjs.entry.js.map 1 year ago sc-heading_2.cjs.entry.js 1 year ago sc-heading_2.cjs.entry.js.map 1 year ago sc-image-slider.cjs.entry.js 1 year ago sc-image-slider.cjs.entry.js.map 1 year ago sc-invoices-list.cjs.entry.js 1 year ago sc-invoices-list.cjs.entry.js.map 1 year ago sc-license.cjs.entry.js 1 year ago sc-license.cjs.entry.js.map 1 year ago sc-licenses-list.cjs.entry.js 1 year ago sc-licenses-list.cjs.entry.js.map 1 year ago sc-line-item-bump.cjs.entry.js 1 year ago sc-line-item-bump.cjs.entry.js.map 1 year ago sc-line-item-total.cjs.entry.js 1 year ago sc-line-item-total.cjs.entry.js.map 1 year ago sc-line-item.cjs.entry.js 1 year ago sc-line-item.cjs.entry.js.map 1 year ago sc-line-items-provider.cjs.entry.js 1 year ago sc-line-items-provider.cjs.entry.js.map 1 year ago sc-line-items.cjs.entry.js 1 year ago sc-line-items.cjs.entry.js.map 1 year ago sc-login-form.cjs.entry.js 1 year ago sc-login-form.cjs.entry.js.map 1 year ago sc-manual-payment-method_3.cjs.entry.js 1 year ago sc-manual-payment-method_3.cjs.entry.js.map 1 year ago sc-menu-divider.cjs.entry.js 1 year ago sc-menu-divider.cjs.entry.js.map 1 year ago sc-menu-label_2.cjs.entry.js 1 year ago sc-menu-label_2.cjs.entry.js.map 1 year ago sc-mollie-add-method.cjs.entry.js 1 year ago sc-mollie-add-method.cjs.entry.js.map 1 year ago sc-order-confirmation-customer.cjs.entry.js 1 year ago sc-order-confirmation-customer.cjs.entry.js.map 1 year ago sc-order-confirmation-details.cjs.entry.js 1 year ago sc-order-confirmation-details.cjs.entry.js.map 1 year ago sc-order-confirmation-line-items_2.cjs.entry.js 1 year ago sc-order-confirmation-line-items_2.cjs.entry.js.map 1 year ago sc-order-confirmation.cjs.entry.js 1 year ago sc-order-confirmation.cjs.entry.js.map 1 year ago sc-order-coupon-form.cjs.entry.js 1 year ago sc-order-coupon-form.cjs.entry.js.map 1 year ago sc-order-detail.cjs.entry.js 1 year ago sc-order-detail.cjs.entry.js.map 1 year ago sc-order-fulfillment-badge.cjs.entry.js 1 year ago sc-order-fulfillment-badge.cjs.entry.js.map 1 year ago sc-order-manual-instructions.cjs.entry.js 1 year ago sc-order-manual-instructions.cjs.entry.js.map 1 year ago sc-order-password.cjs.entry.js 1 year ago sc-order-password.cjs.entry.js.map 1 year ago sc-order-return-badge.cjs.entry.js 1 year ago sc-order-return-badge.cjs.entry.js.map 1 year ago sc-order-shipment-badge.cjs.entry.js 1 year ago sc-order-shipment-badge.cjs.entry.js.map 1 year ago sc-order-status-badge.cjs.entry.js 1 year ago sc-order-status-badge.cjs.entry.js.map 1 year ago sc-order-submit.cjs.entry.js 1 year ago sc-order-submit.cjs.entry.js.map 1 year ago sc-order-summary.cjs.entry.js 1 year ago sc-order-summary.cjs.entry.js.map 1 year ago sc-order.cjs.entry.js 1 year ago sc-order.cjs.entry.js.map 1 year ago sc-orders-list.cjs.entry.js 1 year ago sc-orders-list.cjs.entry.js.map 1 year ago sc-pagination.cjs.entry.js 1 year ago sc-pagination.cjs.entry.js.map 1 year ago sc-password-nag.cjs.entry.js 1 year ago sc-password-nag.cjs.entry.js.map 1 year ago sc-password.cjs.entry.js 1 year ago sc-password.cjs.entry.js.map 1 year ago sc-payment-method-choice_2.cjs.entry.js 1 year ago sc-payment-method-choice_2.cjs.entry.js.map 1 year ago sc-payment-method-details.cjs.entry.js 1 year ago sc-payment-method-details.cjs.entry.js.map 1 year ago sc-payment-methods-list.cjs.entry.js 1 year ago sc-payment-methods-list.cjs.entry.js.map 1 year ago sc-payment.cjs.entry.js 1 year ago sc-payment.cjs.entry.js.map 1 year ago sc-paypal-add-method.cjs.entry.js 1 year ago sc-paypal-add-method.cjs.entry.js.map 1 year ago sc-paypal-buttons_2.cjs.entry.js 1 year ago sc-paypal-buttons_2.cjs.entry.js.map 1 year ago sc-paystack-add-method.cjs.entry.js 1 year ago sc-paystack-add-method.cjs.entry.js.map 1 year ago sc-phone-input.cjs.entry.js 1 year ago sc-phone-input.cjs.entry.js.map 1 year ago sc-pill-option.cjs.entry.js 1 year ago sc-pill-option.cjs.entry.js.map 1 year ago sc-premium-tag.cjs.entry.js 1 year ago sc-premium-tag.cjs.entry.js.map 1 year ago sc-price-choice-container.cjs.entry.js 1 year ago sc-price-choice-container.cjs.entry.js.map 1 year ago sc-price-choice.cjs.entry.js 1 year ago sc-price-choice.cjs.entry.js.map 1 year ago sc-price-choices.cjs.entry.js 1 year ago sc-price-choices.cjs.entry.js.map 1 year ago sc-price-input.cjs.entry.js 1 year ago sc-price-input.cjs.entry.js.map 1 year ago sc-price-range.cjs.entry.js 1 year ago sc-price-range.cjs.entry.js.map 1 year ago sc-price.cjs.entry.js 1 year ago sc-price.cjs.entry.js.map 1 year ago sc-product-buy-button.cjs.entry.js 1 year ago sc-product-buy-button.cjs.entry.js.map 1 year ago sc-product-donation-amount-choice.cjs.entry.js 1 year ago sc-product-donation-amount-choice.cjs.entry.js.map 1 year ago sc-product-donation-choices.cjs.entry.js 1 year ago sc-product-donation-choices.cjs.entry.js.map 1 year ago sc-product-donation-custom-amount.cjs.entry.js 1 year ago sc-product-donation-custom-amount.cjs.entry.js.map 1 year ago sc-product-item-image_3.cjs.entry.js 1 year ago sc-product-item-image_3.cjs.entry.js.map 1 year ago sc-product-item-list.cjs.entry.js 1 year ago sc-product-item-list.cjs.entry.js.map 1 year ago sc-product-item.cjs.entry.js 1 year ago sc-product-item.cjs.entry.js.map 1 year ago sc-product-line-item_2.cjs.entry.js 1 year ago sc-product-line-item_2.cjs.entry.js.map 1 year ago sc-product-pills-variant-option.cjs.entry.js 1 year ago sc-product-pills-variant-option.cjs.entry.js.map 1 year ago sc-product-price-choices.cjs.entry.js 1 year ago sc-product-price-choices.cjs.entry.js.map 1 year ago sc-product-price-modal.cjs.entry.js 1 year ago sc-product-price-modal.cjs.entry.js.map 1 year ago sc-product-price.cjs.entry.js 1 year ago sc-product-price.cjs.entry.js.map 1 year ago sc-product-quantity.cjs.entry.js 1 year ago sc-product-quantity.cjs.entry.js.map 1 year ago sc-product-selected-price.cjs.entry.js 1 year ago sc-product-selected-price.cjs.entry.js.map 1 year ago sc-product-text.cjs.entry.js 1 year ago sc-product-text.cjs.entry.js.map 1 year ago sc-provider.cjs.entry.js 1 year ago sc-provider.cjs.entry.js.map 1 year ago sc-provisional-banner.cjs.entry.js 1 year ago sc-provisional-banner.cjs.entry.js.map 1 year ago sc-purchase-downloads-list.cjs.entry.js 1 year ago sc-purchase-downloads-list.cjs.entry.js.map 1 year ago sc-recurring-price-choice-container.cjs.entry.js 1 year ago sc-recurring-price-choice-container.cjs.entry.js.map 1 year ago sc-rich-text.cjs.entry.js 1 year ago sc-rich-text.cjs.entry.js.map 1 year ago sc-spacing.cjs.entry.js 1 year ago sc-spacing.cjs.entry.js.map 1 year ago sc-stacked-list_2.cjs.entry.js 1 year ago sc-stacked-list_2.cjs.entry.js.map 1 year ago sc-stripe-add-method.cjs.entry.js 1 year ago sc-stripe-add-method.cjs.entry.js.map 1 year ago sc-stripe-element.cjs.entry.js 1 year ago sc-stripe-element.cjs.entry.js.map 1 year ago sc-stripe-payment-element.cjs.entry.js 1 year ago sc-stripe-payment-element.cjs.entry.js.map 1 year ago sc-stripe-payment-request.cjs.entry.js 1 year ago sc-stripe-payment-request.cjs.entry.js.map 1 year ago sc-subscription-ad-hoc-confirm.cjs.entry.js 1 year ago sc-subscription-ad-hoc-confirm.cjs.entry.js.map 1 year ago sc-subscription-details_2.cjs.entry.js 1 year ago sc-subscription-details_2.cjs.entry.js.map 1 year ago sc-subscription-payment-method.cjs.entry.js 1 year ago sc-subscription-payment-method.cjs.entry.js.map 1 year ago sc-subscription-payment.cjs.entry.js 1 year ago sc-subscription-payment.cjs.entry.js.map 1 year ago sc-subscription-switch.cjs.entry.js 1 year ago sc-subscription-switch.cjs.entry.js.map 1 year ago sc-subscription-variation-confirm.cjs.entry.js 1 year ago sc-subscription-variation-confirm.cjs.entry.js.map 1 year ago sc-subscription.cjs.entry.js 1 year ago sc-subscription.cjs.entry.js.map 1 year ago sc-subscriptions-list.cjs.entry.js 1 year ago sc-subscriptions-list.cjs.entry.js.map 1 year ago sc-summary.cjs.entry.js 1 year ago sc-summary.cjs.entry.js.map 1 year ago sc-switch.cjs.entry.js 1 year ago sc-switch.cjs.entry.js.map 1 year ago sc-tab-group.cjs.entry.js 1 year ago sc-tab-group.cjs.entry.js.map 1 year ago sc-tab-panel.cjs.entry.js 1 year ago sc-tab-panel.cjs.entry.js.map 1 year ago sc-tab.cjs.entry.js 1 year ago sc-tab.cjs.entry.js.map 1 year ago sc-table-head.cjs.entry.js 1 year ago sc-table-head.cjs.entry.js.map 1 year ago sc-table_3.cjs.entry.js 1 year ago sc-table_3.cjs.entry.js.map 1 year ago sc-tag.cjs.entry.js 1 year ago sc-tag.cjs.entry.js.map 1 year ago sc-toggle.cjs.entry.js 1 year ago sc-toggle.cjs.entry.js.map 1 year ago sc-toggles.cjs.entry.js 1 year ago sc-toggles.cjs.entry.js.map 1 year ago sc-total.cjs.entry.js 1 year ago sc-total.cjs.entry.js.map 1 year ago sc-upcoming-invoice.cjs.entry.js 1 year ago sc-upcoming-invoice.cjs.entry.js.map 1 year ago sc-upgrade-required.cjs.entry.js 1 year ago sc-upgrade-required.cjs.entry.js.map 1 year ago sc-upsell-countdown-timer.cjs.entry.js 1 year ago sc-upsell-countdown-timer.cjs.entry.js.map 1 year ago sc-upsell-no-thanks-button.cjs.entry.js 1 year ago sc-upsell-no-thanks-button.cjs.entry.js.map 1 year ago sc-upsell-submit-button.cjs.entry.js 1 year ago sc-upsell-submit-button.cjs.entry.js.map 1 year ago sc-upsell-totals.cjs.entry.js 1 year ago sc-upsell-totals.cjs.entry.js.map 1 year ago sc-upsell.cjs.entry.js 1 year ago sc-upsell.cjs.entry.js.map 1 year ago sc-visually-hidden.cjs.entry.js 1 year ago sc-visually-hidden.cjs.entry.js.map 1 year ago sc-wordpress-password-edit.cjs.entry.js 1 year ago sc-wordpress-password-edit.cjs.entry.js.map 1 year ago sc-wordpress-user-edit.cjs.entry.js 1 year ago sc-wordpress-user-edit.cjs.entry.js.map 1 year ago sc-wordpress-user.cjs.entry.js 1 year ago sc-wordpress-user.cjs.entry.js.map 1 year ago store-34d62f12.js 1 year ago store-34d62f12.js.map 1 year ago store-7e035943.js 1 year ago store-7e035943.js.map 1 year ago store-d24717c6.js 1 year ago store-d24717c6.js.map 1 year ago surecart.cjs.js 1 year ago surecart.cjs.js.map 1 year ago tax-736ff458.js 1 year ago tax-736ff458.js.map 1 year ago universe-0cf1168a.js 1 year ago universe-0cf1168a.js.map 1 year ago util-b877b2bd.js 1 year ago util-b877b2bd.js.map 1 year ago utils-ee1bb9d3.js 1 year ago utils-ee1bb9d3.js.map 1 year ago watchers-2ad3abd1.js 1 year ago watchers-2ad3abd1.js.map 1 year ago watchers-758e6979.js 1 year ago watchers-758e6979.js.map 1 year ago watchers-cb566474.js 1 year ago watchers-cb566474.js.map 1 year ago watchers-dc559477.js 1 year ago watchers-dc559477.js.map 1 year ago watchers-fb1bab08.js 1 year ago watchers-fb1bab08.js.map 1 year ago
sc-price-choice.cjs.entry.js
830 lines
1 'use strict';
2
3 Object.defineProperty(exports, '__esModule', { value: true });
4
5 const index = require('./index-8acc3c89.js');
6 const consumer = require('./consumer-9f4ee0e3.js');
7 const index$1 = require('./index-252211ea.js');
8 const price$1 = require('./price-653ec1cb.js');
9 const fetch = require('./fetch-6192c074.js');
10 const addQueryArgs = require('./add-query-args-49dcb630.js');
11 require('./currency-71fce0f0.js');
12 require('./remove-query-args-b57e8cd3.js');
13
14 function _defineProperties(target, props) {
15 for (var i = 0; i < props.length; i++) {
16 var descriptor = props[i];
17 descriptor.enumerable = descriptor.enumerable || false;
18 descriptor.configurable = true;
19 if ("value" in descriptor) descriptor.writable = true;
20 Object.defineProperty(target, descriptor.key, descriptor);
21 }
22 }
23
24 function _createClass(Constructor, protoProps, staticProps) {
25 if (protoProps) _defineProperties(Constructor.prototype, protoProps);
26 if (staticProps) _defineProperties(Constructor, staticProps);
27 return Constructor;
28 }
29
30 function _extends() {
31 _extends = Object.assign || function (target) {
32 for (var i = 1; i < arguments.length; i++) {
33 var source = arguments[i];
34
35 for (var key in source) {
36 if (Object.prototype.hasOwnProperty.call(source, key)) {
37 target[key] = source[key];
38 }
39 }
40 }
41
42 return target;
43 };
44
45 return _extends.apply(this, arguments);
46 }
47
48 function _inheritsLoose(subClass, superClass) {
49 subClass.prototype = Object.create(superClass.prototype);
50 subClass.prototype.constructor = subClass;
51 subClass.__proto__ = superClass;
52 }
53
54 /**
55 * Helpers to enable Immutable compatibility *without* bringing in
56 * the 'immutable' package as a dependency.
57 */
58
59 /**
60 * Check if an object is immutable by checking if it has a key specific
61 * to the immutable library.
62 *
63 * @param {any} object
64 * @return {bool}
65 */
66 function isImmutable(object) {
67 return !!(object && typeof object.hasOwnProperty === 'function' && (object.hasOwnProperty('__ownerID') || // Immutable.Map
68 object._map && object._map.hasOwnProperty('__ownerID'))); // Immutable.Record
69 }
70 /**
71 * Denormalize an immutable entity.
72 *
73 * @param {Schema} schema
74 * @param {Immutable.Map|Immutable.Record} input
75 * @param {function} unvisit
76 * @param {function} getDenormalizedEntity
77 * @return {Immutable.Map|Immutable.Record}
78 */
79
80 function denormalizeImmutable(schema, input, unvisit) {
81 return Object.keys(schema).reduce(function (object, key) {
82 // Immutable maps cast keys to strings on write so we need to ensure
83 // we're accessing them using string keys.
84 var stringKey = "" + key;
85
86 if (object.has(stringKey)) {
87 return object.set(stringKey, unvisit(object.get(stringKey), schema[stringKey]));
88 } else {
89 return object;
90 }
91 }, input);
92 }
93
94 var getDefaultGetId = function getDefaultGetId(idAttribute) {
95 return function (input) {
96 return isImmutable(input) ? input.get(idAttribute) : input[idAttribute];
97 };
98 };
99
100 var EntitySchema = /*#__PURE__*/function () {
101 function EntitySchema(key, definition, options) {
102 if (definition === void 0) {
103 definition = {};
104 }
105
106 if (options === void 0) {
107 options = {};
108 }
109
110 if (!key || typeof key !== 'string') {
111 throw new Error("Expected a string key for Entity, but found " + key + ".");
112 }
113
114 var _options = options,
115 _options$idAttribute = _options.idAttribute,
116 idAttribute = _options$idAttribute === void 0 ? 'id' : _options$idAttribute,
117 _options$mergeStrateg = _options.mergeStrategy,
118 mergeStrategy = _options$mergeStrateg === void 0 ? function (entityA, entityB) {
119 return _extends({}, entityA, entityB);
120 } : _options$mergeStrateg,
121 _options$processStrat = _options.processStrategy,
122 processStrategy = _options$processStrat === void 0 ? function (input) {
123 return _extends({}, input);
124 } : _options$processStrat,
125 _options$fallbackStra = _options.fallbackStrategy,
126 fallbackStrategy = _options$fallbackStra === void 0 ? function (key, schema) {
127 return undefined;
128 } : _options$fallbackStra;
129 this._key = key;
130 this._getId = typeof idAttribute === 'function' ? idAttribute : getDefaultGetId(idAttribute);
131 this._idAttribute = idAttribute;
132 this._mergeStrategy = mergeStrategy;
133 this._processStrategy = processStrategy;
134 this._fallbackStrategy = fallbackStrategy;
135 this.define(definition);
136 }
137
138 var _proto = EntitySchema.prototype;
139
140 _proto.define = function define(definition) {
141 this.schema = Object.keys(definition).reduce(function (entitySchema, key) {
142 var _extends2;
143
144 var schema = definition[key];
145 return _extends({}, entitySchema, (_extends2 = {}, _extends2[key] = schema, _extends2));
146 }, this.schema || {});
147 };
148
149 _proto.getId = function getId(input, parent, key) {
150 return this._getId(input, parent, key);
151 };
152
153 _proto.merge = function merge(entityA, entityB) {
154 return this._mergeStrategy(entityA, entityB);
155 };
156
157 _proto.fallback = function fallback(id, schema) {
158 return this._fallbackStrategy(id, schema);
159 };
160
161 _proto.normalize = function normalize(input, parent, key, visit, addEntity, visitedEntities) {
162 var _this = this;
163
164 var id = this.getId(input, parent, key);
165 var entityType = this.key;
166
167 if (!(entityType in visitedEntities)) {
168 visitedEntities[entityType] = {};
169 }
170
171 if (!(id in visitedEntities[entityType])) {
172 visitedEntities[entityType][id] = [];
173 }
174
175 if (visitedEntities[entityType][id].some(function (entity) {
176 return entity === input;
177 })) {
178 return id;
179 }
180
181 visitedEntities[entityType][id].push(input);
182
183 var processedEntity = this._processStrategy(input, parent, key);
184
185 Object.keys(this.schema).forEach(function (key) {
186 if (processedEntity.hasOwnProperty(key) && typeof processedEntity[key] === 'object') {
187 var schema = _this.schema[key];
188 var resolvedSchema = typeof schema === 'function' ? schema(input) : schema;
189 processedEntity[key] = visit(processedEntity[key], processedEntity, key, resolvedSchema, addEntity, visitedEntities);
190 }
191 });
192 addEntity(this, processedEntity, input, parent, key);
193 return id;
194 };
195
196 _proto.denormalize = function denormalize(entity, unvisit) {
197 var _this2 = this;
198
199 if (isImmutable(entity)) {
200 return denormalizeImmutable(this.schema, entity, unvisit);
201 }
202
203 Object.keys(this.schema).forEach(function (key) {
204 if (entity.hasOwnProperty(key)) {
205 var schema = _this2.schema[key];
206 entity[key] = unvisit(entity[key], schema);
207 }
208 });
209 return entity;
210 };
211
212 _createClass(EntitySchema, [{
213 key: "key",
214 get: function get() {
215 return this._key;
216 }
217 }, {
218 key: "idAttribute",
219 get: function get() {
220 return this._idAttribute;
221 }
222 }]);
223
224 return EntitySchema;
225 }();
226
227 var PolymorphicSchema = /*#__PURE__*/function () {
228 function PolymorphicSchema(definition, schemaAttribute) {
229 if (schemaAttribute) {
230 this._schemaAttribute = typeof schemaAttribute === 'string' ? function (input) {
231 return input[schemaAttribute];
232 } : schemaAttribute;
233 }
234
235 this.define(definition);
236 }
237
238 var _proto = PolymorphicSchema.prototype;
239
240 _proto.define = function define(definition) {
241 this.schema = definition;
242 };
243
244 _proto.getSchemaAttribute = function getSchemaAttribute(input, parent, key) {
245 return !this.isSingleSchema && this._schemaAttribute(input, parent, key);
246 };
247
248 _proto.inferSchema = function inferSchema(input, parent, key) {
249 if (this.isSingleSchema) {
250 return this.schema;
251 }
252
253 var attr = this.getSchemaAttribute(input, parent, key);
254 return this.schema[attr];
255 };
256
257 _proto.normalizeValue = function normalizeValue(value, parent, key, visit, addEntity, visitedEntities) {
258 var schema = this.inferSchema(value, parent, key);
259
260 if (!schema) {
261 return value;
262 }
263
264 var normalizedValue = visit(value, parent, key, schema, addEntity, visitedEntities);
265 return this.isSingleSchema || normalizedValue === undefined || normalizedValue === null ? normalizedValue : {
266 id: normalizedValue,
267 schema: this.getSchemaAttribute(value, parent, key)
268 };
269 };
270
271 _proto.denormalizeValue = function denormalizeValue(value, unvisit) {
272 var schemaKey = isImmutable(value) ? value.get('schema') : value.schema;
273
274 if (!this.isSingleSchema && !schemaKey) {
275 return value;
276 }
277
278 var id = this.isSingleSchema ? undefined : isImmutable(value) ? value.get('id') : value.id;
279 var schema = this.isSingleSchema ? this.schema : this.schema[schemaKey];
280 return unvisit(id || value, schema);
281 };
282
283 _createClass(PolymorphicSchema, [{
284 key: "isSingleSchema",
285 get: function get() {
286 return !this._schemaAttribute;
287 }
288 }]);
289
290 return PolymorphicSchema;
291 }();
292
293 var UnionSchema = /*#__PURE__*/function (_PolymorphicSchema) {
294 _inheritsLoose(UnionSchema, _PolymorphicSchema);
295
296 function UnionSchema(definition, schemaAttribute) {
297 if (!schemaAttribute) {
298 throw new Error('Expected option "schemaAttribute" not found on UnionSchema.');
299 }
300
301 return _PolymorphicSchema.call(this, definition, schemaAttribute) || this;
302 }
303
304 var _proto = UnionSchema.prototype;
305
306 _proto.normalize = function normalize(input, parent, key, visit, addEntity, visitedEntities) {
307 return this.normalizeValue(input, parent, key, visit, addEntity, visitedEntities);
308 };
309
310 _proto.denormalize = function denormalize(input, unvisit) {
311 return this.denormalizeValue(input, unvisit);
312 };
313
314 return UnionSchema;
315 }(PolymorphicSchema);
316
317 var ValuesSchema = /*#__PURE__*/function (_PolymorphicSchema) {
318 _inheritsLoose(ValuesSchema, _PolymorphicSchema);
319
320 function ValuesSchema() {
321 return _PolymorphicSchema.apply(this, arguments) || this;
322 }
323
324 var _proto = ValuesSchema.prototype;
325
326 _proto.normalize = function normalize(input, parent, key, visit, addEntity, visitedEntities) {
327 var _this = this;
328
329 return Object.keys(input).reduce(function (output, key, index) {
330 var _extends2;
331
332 var value = input[key];
333 return value !== undefined && value !== null ? _extends({}, output, (_extends2 = {}, _extends2[key] = _this.normalizeValue(value, input, key, visit, addEntity, visitedEntities), _extends2)) : output;
334 }, {});
335 };
336
337 _proto.denormalize = function denormalize(input, unvisit) {
338 var _this2 = this;
339
340 return Object.keys(input).reduce(function (output, key) {
341 var _extends3;
342
343 var entityOrId = input[key];
344 return _extends({}, output, (_extends3 = {}, _extends3[key] = _this2.denormalizeValue(entityOrId, unvisit), _extends3));
345 }, {});
346 };
347
348 return ValuesSchema;
349 }(PolymorphicSchema);
350
351 var validateSchema = function validateSchema(definition) {
352 var isArray = Array.isArray(definition);
353
354 if (isArray && definition.length > 1) {
355 throw new Error("Expected schema definition to be a single schema, but found " + definition.length + ".");
356 }
357
358 return definition[0];
359 };
360
361 var getValues = function getValues(input) {
362 return Array.isArray(input) ? input : Object.keys(input).map(function (key) {
363 return input[key];
364 });
365 };
366
367 var normalize = function normalize(schema, input, parent, key, visit, addEntity, visitedEntities) {
368 schema = validateSchema(schema);
369 var values = getValues(input); // Special case: Arrays pass *their* parent on to their children, since there
370 // is not any special information that can be gathered from themselves directly
371
372 return values.map(function (value, index) {
373 return visit(value, parent, key, schema, addEntity, visitedEntities);
374 });
375 };
376
377 var ArraySchema = /*#__PURE__*/function (_PolymorphicSchema) {
378 _inheritsLoose(ArraySchema, _PolymorphicSchema);
379
380 function ArraySchema() {
381 return _PolymorphicSchema.apply(this, arguments) || this;
382 }
383
384 var _proto = ArraySchema.prototype;
385
386 _proto.normalize = function normalize(input, parent, key, visit, addEntity, visitedEntities) {
387 var _this = this;
388
389 var values = getValues(input);
390 return values.map(function (value, index) {
391 return _this.normalizeValue(value, parent, key, visit, addEntity, visitedEntities);
392 }).filter(function (value) {
393 return value !== undefined && value !== null;
394 });
395 };
396
397 _proto.denormalize = function denormalize(input, unvisit) {
398 var _this2 = this;
399
400 return input && input.map ? input.map(function (value) {
401 return _this2.denormalizeValue(value, unvisit);
402 }) : input;
403 };
404
405 return ArraySchema;
406 }(PolymorphicSchema);
407
408 var _normalize = function normalize(schema, input, parent, key, visit, addEntity, visitedEntities) {
409 var object = _extends({}, input);
410
411 Object.keys(schema).forEach(function (key) {
412 var localSchema = schema[key];
413 var resolvedLocalSchema = typeof localSchema === 'function' ? localSchema(input) : localSchema;
414 var value = visit(input[key], input, key, resolvedLocalSchema, addEntity, visitedEntities);
415
416 if (value === undefined || value === null) {
417 delete object[key];
418 } else {
419 object[key] = value;
420 }
421 });
422 return object;
423 };
424
425 var _denormalize = function denormalize(schema, input, unvisit) {
426 if (isImmutable(input)) {
427 return denormalizeImmutable(schema, input, unvisit);
428 }
429
430 var object = _extends({}, input);
431
432 Object.keys(schema).forEach(function (key) {
433 if (object[key] != null) {
434 object[key] = unvisit(object[key], schema[key]);
435 }
436 });
437 return object;
438 };
439
440 var ObjectSchema = /*#__PURE__*/function () {
441 function ObjectSchema(definition) {
442 this.define(definition);
443 }
444
445 var _proto = ObjectSchema.prototype;
446
447 _proto.define = function define(definition) {
448 this.schema = Object.keys(definition).reduce(function (entitySchema, key) {
449 var _extends2;
450
451 var schema = definition[key];
452 return _extends({}, entitySchema, (_extends2 = {}, _extends2[key] = schema, _extends2));
453 }, this.schema || {});
454 };
455
456 _proto.normalize = function normalize() {
457 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
458 args[_key] = arguments[_key];
459 }
460
461 return _normalize.apply(void 0, [this.schema].concat(args));
462 };
463
464 _proto.denormalize = function denormalize() {
465 for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
466 args[_key2] = arguments[_key2];
467 }
468
469 return _denormalize.apply(void 0, [this.schema].concat(args));
470 };
471
472 return ObjectSchema;
473 }();
474
475 var visit = function visit(value, parent, key, schema, addEntity, visitedEntities) {
476 if (typeof value !== 'object' || !value) {
477 return value;
478 }
479
480 if (typeof schema === 'object' && (!schema.normalize || typeof schema.normalize !== 'function')) {
481 var method = Array.isArray(schema) ? normalize : _normalize;
482 return method(schema, value, parent, key, visit, addEntity, visitedEntities);
483 }
484
485 return schema.normalize(value, parent, key, visit, addEntity, visitedEntities);
486 };
487
488 var addEntities = function addEntities(entities) {
489 return function (schema, processedEntity, value, parent, key) {
490 var schemaKey = schema.key;
491 var id = schema.getId(value, parent, key);
492
493 if (!(schemaKey in entities)) {
494 entities[schemaKey] = {};
495 }
496
497 var existingEntity = entities[schemaKey][id];
498
499 if (existingEntity) {
500 entities[schemaKey][id] = schema.merge(existingEntity, processedEntity);
501 } else {
502 entities[schemaKey][id] = processedEntity;
503 }
504 };
505 };
506
507 var schema = {
508 Array: ArraySchema,
509 Entity: EntitySchema,
510 Object: ObjectSchema,
511 Union: UnionSchema,
512 Values: ValuesSchema
513 };
514 var normalize$1 = function normalize(input, schema) {
515 if (!input || typeof input !== 'object') {
516 throw new Error("Unexpected input given to normalize. Expected type to be \"object\", found \"" + (input === null ? 'null' : typeof input) + "\".");
517 }
518
519 var entities = {};
520 var addEntity = addEntities(entities);
521 var visitedEntities = {};
522 var result = visit(input, input, null, schema, addEntity, visitedEntities);
523 return {
524 entities: entities,
525 result: result
526 };
527 };
528
529 const entities = {
530 integration: new schema.Entity('integration'),
531 account: new schema.Entity('account'),
532 price: new schema.Entity('price'),
533 product: new schema.Entity('product'),
534 product_group: new schema.Entity('product_group'),
535 purchase: new schema.Entity('purchase'),
536 payment_method: new schema.Entity('payment_method'),
537 card: new schema.Entity('card'),
538 invoice: new schema.Entity('invoice'),
539 current_period: new schema.Entity('current_period'),
540 refund: new schema.Entity('refund'),
541 charge: new schema.Entity('charge'),
542 coupon: new schema.Entity('coupon'),
543 promotion: new schema.Entity('promotion'),
544 order: new schema.Entity('order'),
545 customer: new schema.Entity('customer'),
546 subscription: new schema.Entity('subscription'),
547 product_group: new schema.Entity('product_group'),
548 };
549
550 const {
551 price,
552 product,
553 purchase,
554 payment_method,
555 card,
556 invoice,
557 refund,
558 charge,
559 coupon,
560 promotion,
561 order,
562 integration,
563 customer,
564 product_group,
565 subscription,
566 } = entities;
567
568 product.define({
569 prices: {
570 data: [price],
571 },
572 product_group,
573 });
574
575 price.define({
576 product,
577 });
578
579 invoice.define({
580 purchases: {
581 data: [purchase],
582 },
583 charge,
584 customer,
585 subscription,
586 });
587
588 order.define({
589 purchases: {
590 data: [purchase],
591 },
592 charge,
593 customer,
594 subscription,
595 });
596
597 charge.define({
598 order,
599 invoice,
600 });
601
602 subscription.define({
603 current_period: invoice,
604 purchase,
605 price,
606 payment_method,
607 order,
608 customer,
609 });
610
611 refund.define({
612 charge,
613 customer,
614 });
615
616 purchase.define({
617 order,
618 product,
619 subscription,
620 });
621
622 payment_method.define({
623 card,
624 });
625
626 coupon.define({
627 promotions: {
628 data: [promotion],
629 },
630 });
631
632 product_group.define({});
633 integration.define({});
634
635 const normalizeEntities = (data) => {
636 if (entities?.[data?.[0]?.object]) {
637 return normalize$1(data, [entities[data?.[0]?.object]]);
638 }
639 return {};
640 };
641
642 const getPricesAndProducts = async ({ ids, archived = false }) => {
643 const prices = (await fetch.apiFetch({
644 path: addQueryArgs.addQueryArgs('surecart/v1/prices/', {
645 ids,
646 archived,
647 expand: ['product'],
648 }),
649 }));
650 return normalizePrices(prices);
651 };
652 const normalizePrices = (prices) => {
653 const { entities } = normalizeEntities(prices);
654 return {
655 prices: entities === null || entities === void 0 ? void 0 : entities.price,
656 products: entities === null || entities === void 0 ? void 0 : entities.product,
657 };
658 };
659
660 const scPriceChoiceCss = ":host {\n display: block;\n min-width: 0;\n width: 100%;\n}\n\nsc-choice-container {\n container-type: inline-size;\n}\n\n.price-choice {\n display: flex;\n align-items: center;\n justify-content: space-between;\n line-height: var(--sc-line-height-dense);\n gap: var(--sc-spacing-small);\n}\n.price-choice__name {\n color: var(--sc-price-choice-name-color, var(--sc-input-label-color));\n font-size: var(--sc-price-choice-name-size, var(--sc-input-label-font-size-medium));\n font-weight: var(--sc-price-choice-name-font-weight, var(--sc-font-weight-bold));\n text-transform: var(--sc-price-choice-text-transform, var(--sc-input-label-text-transform, none));\n display: -webkit-box;\n display: -moz-box;\n -webkit-box-orient: vertical;\n -moz-box-orient: vertical;\n -webkit-line-clamp: 3;\n -moz-box-lines: 3;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.price-choice__description {\n color: var(--sc-input-help-text-color);\n}\n.price-choice > *:not(:first-child):last-child {\n text-align: right;\n}\n.price-choice__details {\n flex: 1 0 50%;\n display: grid;\n gap: var(--sc-spacing-xxx-small);\n}\n.price-choice__trial, .price-choice__setup-fee, .price-choice__price {\n font-size: var(--sc-font-size-small);\n color: var(--sc-input-help-text-color);\n}\n.price-choice__price {\n color: var(--sc-input-label-color);\n font-weight: var(--sc-price-choice-price-font-weight, var(--sc-font-weight-normal));\n}\n\n@container (max-width: 325px) {\n .price-choice {\n flex-direction: column;\n align-items: flex-start;\n gap: var(--sc-spacing-xx-small);\n }\n .price-choice > *:not(:first-child):last-child {\n text-align: initial;\n }\n}";
661 const ScPriceChoiceStyle0 = scPriceChoiceCss;
662
663 const ScPriceChoice = class {
664 constructor(hostRef) {
665 index.registerInstance(this, hostRef);
666 this.scUpdateLineItem = index.createEvent(this, "scUpdateLineItem", 7);
667 this.scRemoveLineItem = index.createEvent(this, "scRemoveLineItem", 7);
668 this.scAddEntities = index.createEvent(this, "scAddEntities", 7);
669 this.priceId = undefined;
670 this.price = undefined;
671 this.product = undefined;
672 this.loading = false;
673 this.label = undefined;
674 this.showLabel = true;
675 this.showPrice = true;
676 this.showControl = true;
677 this.description = undefined;
678 this.prices = {};
679 this.products = {};
680 this.order = undefined;
681 this.quantity = 1;
682 this.type = undefined;
683 this.checked = false;
684 this.error = undefined;
685 this.isAdHoc = undefined;
686 this.blank = false;
687 this.errorMessage = undefined;
688 this.adHocErrorMessage = undefined;
689 }
690 /** Refetch if price changes */
691 handlePriceIdChage() {
692 var _a;
693 if (this.price && ((_a = this.price) === null || _a === void 0 ? void 0 : _a.id) === this.priceId)
694 return;
695 this.fetchPriceWithProduct();
696 }
697 /** Keep price up to date. */
698 handlePricesChange() {
699 var _a, _b, _c;
700 if (!Object.keys(this.prices || {}).length || !Object.keys(this.products || {}).length)
701 return;
702 this.price = (_a = this === null || this === void 0 ? void 0 : this.prices) === null || _a === void 0 ? void 0 : _a[this.priceId];
703 this.product = (_b = this === null || this === void 0 ? void 0 : this.products) === null || _b === void 0 ? void 0 : _b[(_c = this === null || this === void 0 ? void 0 : this.price) === null || _c === void 0 ? void 0 : _c.product];
704 }
705 handlePriseChange() {
706 var _a;
707 this.isAdHoc = (_a = this === null || this === void 0 ? void 0 : this.price) === null || _a === void 0 ? void 0 : _a.ad_hoc;
708 }
709 handleErrorsChange() {
710 var _a;
711 const error = (((_a = this === null || this === void 0 ? void 0 : this.error) === null || _a === void 0 ? void 0 : _a.additional_errors) || []).find(error => { var _a; return ((_a = error === null || error === void 0 ? void 0 : error.data) === null || _a === void 0 ? void 0 : _a.attribute) === 'line_items.ad_hoc_amount'; });
712 this.adHocErrorMessage = (error === null || error === void 0 ? void 0 : error.message) ? error === null || error === void 0 ? void 0 : error.message : '';
713 }
714 handleCheckedChange() {
715 var _a;
716 if (((_a = this.price) === null || _a === void 0 ? void 0 : _a.ad_hoc) && this.choice.checked) {
717 setTimeout(() => {
718 this.adHocInput.triggerFocus();
719 }, 50);
720 return;
721 }
722 }
723 /** Fetch on load */
724 componentWillLoad() {
725 if (!this.price) {
726 this.fetchPriceWithProduct();
727 }
728 }
729 /** Fetch prices and products */
730 async fetchPriceWithProduct() {
731 if (!this.priceId)
732 return;
733 try {
734 this.loading = true;
735 const { products, prices } = await getPricesAndProducts({
736 archived: false,
737 ids: [this.priceId],
738 });
739 // add to central store.
740 this.scAddEntities.emit({ prices, products });
741 }
742 catch (err) {
743 }
744 finally {
745 this.loading = false;
746 }
747 }
748 /** Is this price in the checkout session. */
749 isInOrder() {
750 return index$1.isPriceInOrder(this.price, this.order);
751 }
752 /** Is this checked */
753 isChecked() {
754 return this.isInOrder();
755 }
756 onChangeAdHoc(e) {
757 this.scUpdateLineItem.emit({ price_id: this.priceId, quantity: this.quantity, ad_hoc_amount: e.target.value });
758 }
759 getLineItem() {
760 var _a, _b;
761 return (((_b = (_a = this.order) === null || _a === void 0 ? void 0 : _a.line_items) === null || _b === void 0 ? void 0 : _b.data) || []).find(lineItem => lineItem.price.id === this.priceId);
762 }
763 /** Show we show the ad hoc price box */
764 showAdHoc() {
765 var _a, _b;
766 if (!((_a = this.price) === null || _a === void 0 ? void 0 : _a.ad_hoc)) {
767 return false;
768 }
769 if (this.isInOrder()) {
770 return true;
771 }
772 return (_b = this === null || this === void 0 ? void 0 : this.choice) === null || _b === void 0 ? void 0 : _b.checked;
773 }
774 renderEmpty() {
775 var _a;
776 if ((_a = window === null || window === void 0 ? void 0 : window.wp) === null || _a === void 0 ? void 0 : _a.blocks) {
777 return (index.h("sc-alert", { type: "danger", open: true, style: { margin: '0px' } }, wp.i18n.__('This product has been archived.', 'surecart')));
778 }
779 return index.h(index.Host, { style: { display: 'none' } });
780 }
781 renderPrice() {
782 return (index.h(index.Fragment, null, index.h("sc-format-number", { type: "currency", value: this.price.amount, currency: this.price.currency }), price$1.intervalString(this.price, {
783 showOnce: true,
784 abbreviate: true,
785 labels: {
786 interval: '/',
787 period:
788 /** translators: used as in time period: "for 3 months" */
789 wp.i18n.__('for', 'surecart'),
790 },
791 })));
792 }
793 render() {
794 var _a, _b, _c, _d, _e, _f, _g, _h;
795 if (this.loading) {
796 return (index.h("sc-choice-container", { showControl: this.showControl, name: "loading", disabled: true }, index.h("div", { class: "price-choice" }, index.h("sc-skeleton", { style: { width: '60px', display: 'inline-block' } }), index.h("sc-skeleton", { style: { width: '80px', display: 'inline-block' } }))));
797 }
798 // we need an active price.
799 if (!((_a = this === null || this === void 0 ? void 0 : this.price) === null || _a === void 0 ? void 0 : _a.id) || ((_b = this.price) === null || _b === void 0 ? void 0 : _b.archived))
800 return this.renderEmpty();
801 // product needs to be active
802 if ((_c = this.product) === null || _c === void 0 ? void 0 : _c.archived) {
803 return this.renderEmpty();
804 }
805 return (index.h("sc-choice-container", { ref: el => (this.choice = el), value: this.priceId, type: this.type, showControl: this.showControl, checked: this.isChecked() }, index.h("div", { class: "price-choice" }, this.showLabel && (index.h("div", { class: "price-choice__title" }, index.h("div", { class: "price-choice__name" }, this.label || ((_d = this === null || this === void 0 ? void 0 : this.price) === null || _d === void 0 ? void 0 : _d.name) || ((_e = this === null || this === void 0 ? void 0 : this.product) === null || _e === void 0 ? void 0 : _e.name)), !!this.description && index.h("div", { class: "price-choice__description" }, this.description))), this.showPrice && (index.h("div", { class: "price-choice__details" }, index.h("div", { class: "price-choice__price" }, ((_f = this.price) === null || _f === void 0 ? void 0 : _f.ad_hoc) ? (wp.i18n.__('Custom Amount', 'surecart')) : (index.h(index.Fragment, null, index.h("sc-format-number", { type: "currency", value: this.price.amount, currency: this.price.currency }), price$1.intervalString(this.price, {
806 showOnce: true,
807 abbreviate: true,
808 labels: {
809 interval: '/',
810 period:
811 /** translators: used as in time period: "for 3 months" */
812 wp.i18n.__('for', 'surecart'),
813 },
814 })))), !!this.price.trial_duration_days && (index.h("div", { class: "price-choice__trial" }, wp.i18n.sprintf(wp.i18n._n('Starting in %s day', 'Starting in %s days', this.price.trial_duration_days, 'surecart'), this.price.trial_duration_days))), !!this.price.setup_fee_enabled && ((_g = this.price) === null || _g === void 0 ? void 0 : _g.setup_fee_amount) && (index.h("div", { class: "price-choice__setup-fee" }, index.h("sc-format-number", { type: "currency", value: Math.abs(this.price.setup_fee_amount), currency: this.price.currency }), ' ', this.price.setup_fee_name || (((_h = this.price) === null || _h === void 0 ? void 0 : _h.setup_fee_amount) < 0 ? wp.i18n.__('Discount', 'surecart') : wp.i18n.__('Setup Fee', 'surecart')))))))));
815 }
816 static get watchers() { return {
817 "priceId": ["handlePriceIdChage"],
818 "prices": ["handlePricesChange"],
819 "products": ["handlePricesChange"],
820 "price": ["handlePriseChange"],
821 "error": ["handleErrorsChange"],
822 "checked": ["handleCheckedChange"]
823 }; }
824 };
825 consumer.openWormhole(ScPriceChoice, ['prices', 'products', 'order', 'error'], false);
826 ScPriceChoice.style = ScPriceChoiceStyle0;
827
828 exports.sc_price_choice = ScPriceChoice;
829
830 //# sourceMappingURL=sc-price-choice.cjs.entry.js.map