@foxy.io/elements 1.18.0-beta.20 → 1.18.0-beta.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -1
- package/dist/cdn/foxy-access-recovery-form.js +1 -1
- package/dist/cdn/foxy-address-card.js +1 -1
- package/dist/cdn/foxy-address-form.js +1 -1
- package/dist/cdn/foxy-admin-subscription-card.js +1 -1
- package/dist/cdn/foxy-api-browser.js +1 -1
- package/dist/cdn/foxy-applied-coupon-code-card.js +1 -1
- package/dist/cdn/foxy-applied-coupon-code-form.js +1 -1
- package/dist/cdn/foxy-applied-tax-card.js +1 -1
- package/dist/cdn/foxy-attribute-card.js +1 -1
- package/dist/cdn/foxy-attribute-form.js +1 -1
- package/dist/cdn/foxy-cancellation-form.js +1 -1
- package/dist/cdn/foxy-cart-card.js +1 -1
- package/dist/cdn/foxy-cart-form.js +1 -1
- package/dist/cdn/foxy-collection-page.js +1 -1
- package/dist/cdn/foxy-collection-pages.js +1 -1
- package/dist/cdn/foxy-copy-to-clipboard.js +1 -1
- package/dist/cdn/foxy-coupon-card.js +1 -1
- package/dist/cdn/foxy-coupon-code-form.js +1 -1
- package/dist/cdn/foxy-coupon-codes-form.js +1 -1
- package/dist/cdn/foxy-coupon-detail-card.js +1 -1
- package/dist/cdn/foxy-coupon-form.js +1 -1
- package/dist/cdn/foxy-custom-field-card.js +1 -1
- package/dist/cdn/foxy-custom-field-form.js +1 -1
- package/dist/cdn/foxy-customer-card.js +1 -1
- package/dist/cdn/foxy-customer-form.js +1 -1
- package/dist/cdn/foxy-customer-portal-settings.js +1 -1
- package/dist/cdn/foxy-customer-portal.js +1 -1
- package/dist/cdn/foxy-customer.js +1 -1
- package/dist/cdn/foxy-customers-table.js +1 -1
- package/dist/cdn/foxy-discount-builder.js +1 -1
- package/dist/cdn/foxy-discount-card.js +1 -1
- package/dist/cdn/foxy-discount-detail-card.js +1 -1
- package/dist/cdn/foxy-donation.js +1 -1
- package/dist/cdn/foxy-email-template-card.js +1 -1
- package/dist/cdn/foxy-email-template-form.js +1 -1
- package/dist/cdn/foxy-error-entry-card.js +1 -1
- package/dist/cdn/foxy-form-dialog.js +1 -1
- package/dist/cdn/foxy-generate-codes-form.js +1 -1
- package/dist/cdn/foxy-gift-card-card.js +1 -1
- package/dist/cdn/foxy-gift-card-code-form.js +1 -1
- package/dist/cdn/foxy-gift-card-code-log-card.js +1 -1
- package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
- package/dist/cdn/foxy-gift-card-form.js +1 -1
- package/dist/cdn/foxy-i18n-editor.js +2 -2
- package/dist/cdn/foxy-i18n.js +1 -1
- package/dist/cdn/foxy-integration-card.js +1 -1
- package/dist/cdn/foxy-integration-form.js +1 -1
- package/dist/cdn/foxy-item-card.js +1 -1
- package/dist/cdn/foxy-item-category-card.js +1 -1
- package/dist/cdn/foxy-item-category-form.js +1 -1
- package/dist/cdn/foxy-item-form.js +1 -1
- package/dist/cdn/foxy-item-option-card.js +1 -1
- package/dist/cdn/foxy-item-option-form.js +1 -1
- package/dist/cdn/foxy-items-form.js +1 -1
- package/dist/cdn/foxy-pagination.js +1 -1
- package/dist/cdn/foxy-payment-card.js +1 -1
- package/dist/cdn/foxy-payment-method-card.js +1 -1
- package/dist/cdn/foxy-payments-api-fraud-protection-card.js +1 -1
- package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-method-card.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-preset-card.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
- package/dist/cdn/foxy-query-builder.js +1 -1
- package/dist/cdn/foxy-report-form.js +2 -2
- package/dist/cdn/foxy-reports-table.js +5 -5
- package/dist/cdn/foxy-shipment-card.js +1 -1
- package/dist/cdn/foxy-shipping-method-card.js +1 -1
- package/dist/cdn/foxy-sign-in-form.js +1 -1
- package/dist/cdn/foxy-spinner.js +1 -1
- package/dist/cdn/foxy-store-form.js +1 -1
- package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
- package/dist/cdn/foxy-subscription-card.js +1 -1
- package/dist/cdn/foxy-subscription-form.js +1 -1
- package/dist/cdn/foxy-subscription-settings-form.js +1 -1
- package/dist/cdn/foxy-subscriptions-table.js +1 -1
- package/dist/cdn/foxy-table.js +1 -1
- package/dist/cdn/foxy-tax-card.js +1 -1
- package/dist/cdn/foxy-tax-form.js +1 -1
- package/dist/cdn/foxy-template-config-form.js +1 -1
- package/dist/cdn/foxy-template-form.js +1 -1
- package/dist/cdn/foxy-template-set-card.js +1 -1
- package/dist/cdn/foxy-template-set-form.js +1 -1
- package/dist/cdn/foxy-transaction-card.js +1 -1
- package/dist/cdn/foxy-transaction.js +1 -1
- package/dist/cdn/foxy-transactions-table.js +7 -7
- package/dist/cdn/foxy-user-form.js +1 -1
- package/dist/cdn/foxy-users-table.js +1 -1
- package/dist/cdn/foxy-webhook-card.js +1 -1
- package/dist/cdn/foxy-webhook-form.js +1 -1
- package/dist/cdn/foxy-webhook-log-card.js +1 -1
- package/dist/cdn/foxy-webhook-status-card.js +1 -1
- package/dist/cdn/{shared-39b184de.js → shared-08156595.js} +1 -1
- package/dist/cdn/shared-0821cfdc.js +1 -0
- package/dist/cdn/{shared-23bf6ee6.js → shared-08e27fe9.js} +3 -3
- package/dist/cdn/{shared-68e0cf30.js → shared-0ce006b9.js} +1 -1
- package/dist/cdn/shared-1000b848.js +1 -0
- package/dist/cdn/{shared-d384d6a3.js → shared-101d1234.js} +2 -2
- package/dist/cdn/{shared-7d658c02.js → shared-1c94a156.js} +1 -1
- package/dist/cdn/{shared-3ca1e8e4.js → shared-2092d86f.js} +1 -1
- package/dist/cdn/shared-21679ebd.js +1 -0
- package/dist/cdn/{shared-dbd4a5e8.js → shared-2add595d.js} +1 -1
- package/dist/cdn/{shared-1e94e6dd.js → shared-2cc638ad.js} +1 -1
- package/dist/cdn/{shared-0d4f9b06.js → shared-39c10b22.js} +1 -1
- package/dist/cdn/{shared-e99fa3d6.js → shared-404aa9cc.js} +1 -1
- package/dist/cdn/{shared-17c1eab2.js → shared-4849ef5b.js} +1 -1
- package/dist/cdn/shared-486d7bb5.js +1 -0
- package/dist/cdn/{shared-0f649dc6.js → shared-4f9d2417.js} +5 -5
- package/dist/cdn/{shared-413415b0.js → shared-5378bd8c.js} +1 -1
- package/dist/cdn/{shared-a90a5235.js → shared-5a4829e3.js} +1 -1
- package/dist/cdn/{shared-90c7dbdb.js → shared-5b177708.js} +1 -1
- package/dist/cdn/{shared-5b3ae513.js → shared-5ea18e60.js} +1 -1
- package/dist/cdn/{shared-ae588315.js → shared-62a54a6c.js} +1 -1
- package/dist/cdn/{shared-2f6e33b6.js → shared-62c088b7.js} +1 -1
- package/dist/cdn/{shared-5c6eb602.js → shared-639c666f.js} +1 -1
- package/dist/cdn/{shared-21689ac0.js → shared-6581241a.js} +1 -1
- package/dist/cdn/{shared-df462496.js → shared-6cb1015f.js} +1 -1
- package/dist/cdn/{shared-179ff8af.js → shared-71d8d167.js} +1 -1
- package/dist/cdn/{shared-cdc183c5.js → shared-71f2ef1f.js} +1 -1
- package/dist/cdn/{shared-9d7bbdd8.js → shared-744cf66b.js} +1 -1
- package/dist/cdn/{shared-a343ec6b.js → shared-7d4fb1a2.js} +1 -1
- package/dist/cdn/{shared-5ada1ccb.js → shared-80fc2b6a.js} +1 -1
- package/dist/cdn/{shared-034c6aeb.js → shared-83596b46.js} +1 -1
- package/dist/cdn/shared-868065de.js +1 -0
- package/dist/cdn/{shared-2b2002ac.js → shared-88c4cfec.js} +1 -1
- package/dist/cdn/{shared-cf784db1.js → shared-8dd0af4d.js} +1 -1
- package/dist/cdn/{shared-776f948d.js → shared-988ec916.js} +1 -1
- package/dist/cdn/{shared-c379590f.js → shared-9bdacf65.js} +1 -1
- package/dist/cdn/{shared-a41f2200.js → shared-9f436277.js} +1 -1
- package/dist/cdn/shared-a0c8faf2.js +1 -0
- package/dist/cdn/{shared-bae9da44.js → shared-a37abe4c.js} +2 -2
- package/dist/cdn/{shared-ea6c8bae.js → shared-a41234b4.js} +1 -1
- package/dist/cdn/{shared-6cc53630.js → shared-af226a9a.js} +1 -1
- package/dist/cdn/{shared-13982611.js → shared-b40cf0dd.js} +1 -1
- package/dist/cdn/{shared-9d511d7e.js → shared-bb0e33c3.js} +1 -1
- package/dist/cdn/{shared-b48e5aaf.js → shared-bc814810.js} +1 -1
- package/dist/cdn/{shared-88c7755d.js → shared-bd252323.js} +1 -1
- package/dist/cdn/{shared-869df7ed.js → shared-be66c2e7.js} +1 -1
- package/dist/cdn/{shared-e06b70cc.js → shared-c774d080.js} +1 -1
- package/dist/cdn/{shared-e94165e9.js → shared-c95c17e6.js} +1 -1
- package/dist/cdn/shared-cba08e1c.js +1 -0
- package/dist/cdn/{shared-7fb8ecc5.js → shared-d518bd55.js} +1 -1
- package/dist/cdn/{shared-004f1a77.js → shared-d61b3e4f.js} +1 -1
- package/dist/cdn/{shared-d4a652b7.js → shared-d8dc97f0.js} +1 -1
- package/dist/cdn/{shared-bf47ead0.js → shared-de036570.js} +1 -1
- package/dist/cdn/{shared-1db07286.js → shared-ed0dee03.js} +1 -1
- package/dist/cdn/shared-f7e4cd67.js +1 -0
- package/dist/cdn/{shared-8eb4c8d7.js → shared-f80f402a.js} +1 -1
- package/dist/cdn/translations/cart-card/en.json +3 -3
- package/dist/cdn/translations/gift-card-code-form/en.json +6 -3
- package/dist/cdn/translations/gift-card-code-log-card/en.json +6 -3
- package/dist/cdn/translations/integration-form/en.json +13 -15
- package/dist/cdn/translations/payments-api-fraud-protection-card/en.json +0 -2
- package/dist/cdn/translations/payments-api-payment-method-card/en.json +0 -2
- package/dist/cdn/translations/payments-api-payment-preset-form/en.json +2 -2
- package/dist/cdn/translations/template-set-form/en.json +10 -0
- package/dist/elements/internal/InternalAsyncListControl/InternalAsyncListControl.js +10 -5
- package/dist/elements/internal/InternalAsyncListControl/InternalAsyncListControl.js.map +1 -1
- package/dist/elements/internal/InternalControl/InternalControl.js +2 -2
- package/dist/elements/internal/InternalControl/InternalControl.js.map +1 -1
- package/dist/elements/internal/InternalDetails/InternalDetails.js +3 -3
- package/dist/elements/internal/InternalDetails/InternalDetails.js.map +1 -1
- package/dist/elements/internal/InternalRadioGroupControl/InternalRadioGroupControl.js +1 -1
- package/dist/elements/internal/InternalRadioGroupControl/InternalRadioGroupControl.js.map +1 -1
- package/dist/elements/internal/InternalSelectControl/InternalSelectControl.d.ts +1 -1
- package/dist/elements/internal/InternalSelectControl/InternalSelectControl.js +3 -2
- package/dist/elements/internal/InternalSelectControl/InternalSelectControl.js.map +1 -1
- package/dist/elements/private/Group/Group.js +1 -1
- package/dist/elements/private/Group/Group.js.map +1 -1
- package/dist/elements/private/Warning/Warning.js +1 -3
- package/dist/elements/private/Warning/Warning.js.map +1 -1
- package/dist/elements/public/AdminSubscriptionCard/AdminSubscriptionCard.d.ts +12 -0
- package/dist/elements/public/AdminSubscriptionCard/AdminSubscriptionCard.js +12 -0
- package/dist/elements/public/AdminSubscriptionCard/AdminSubscriptionCard.js.map +1 -1
- package/dist/elements/public/AdminSubscriptionCard/index.d.ts +1 -0
- package/dist/elements/public/AdminSubscriptionCard/index.js +1 -0
- package/dist/elements/public/AdminSubscriptionCard/index.js.map +1 -1
- package/dist/elements/public/AppliedCouponCodeCard/AppliedCouponCodeCard.d.ts +2 -2
- package/dist/elements/public/AppliedCouponCodeCard/AppliedCouponCodeCard.js +7 -8
- package/dist/elements/public/AppliedCouponCodeCard/AppliedCouponCodeCard.js.map +1 -1
- package/dist/elements/public/AppliedCouponCodeForm/AppliedCouponCodeForm.d.ts +23 -4
- package/dist/elements/public/AppliedCouponCodeForm/AppliedCouponCodeForm.js +19 -0
- package/dist/elements/public/AppliedCouponCodeForm/AppliedCouponCodeForm.js.map +1 -1
- package/dist/elements/public/AppliedCouponCodeForm/types.d.ts +12 -0
- package/dist/elements/public/AppliedCouponCodeForm/types.js.map +1 -1
- package/dist/elements/public/AppliedTaxCard/AppliedTaxCard.d.ts +1 -1
- package/dist/elements/public/AppliedTaxCard/AppliedTaxCard.js +2 -2
- package/dist/elements/public/AppliedTaxCard/AppliedTaxCard.js.map +1 -1
- package/dist/elements/public/AttributeCard/AttributeCard.js +28 -14
- package/dist/elements/public/AttributeCard/AttributeCard.js.map +1 -1
- package/dist/elements/public/CartCard/CartCard.d.ts +7 -2
- package/dist/elements/public/CartCard/CartCard.js +16 -9
- package/dist/elements/public/CartCard/CartCard.js.map +1 -1
- package/dist/elements/public/CartForm/CartForm.d.ts +106 -1
- package/dist/elements/public/CartForm/CartForm.js +167 -37
- package/dist/elements/public/CartForm/CartForm.js.map +1 -1
- package/dist/elements/public/CartForm/index.d.ts +2 -0
- package/dist/elements/public/CartForm/index.js +2 -0
- package/dist/elements/public/CartForm/index.js.map +1 -1
- package/dist/elements/public/CartForm/types.d.ts +64 -0
- package/dist/elements/public/CartForm/types.js.map +1 -1
- package/dist/elements/public/CouponDetailCard/CouponDetailCard.d.ts +1 -1
- package/dist/elements/public/CouponDetailCard/CouponDetailCard.js +2 -2
- package/dist/elements/public/CouponDetailCard/CouponDetailCard.js.map +1 -1
- package/dist/elements/public/CouponForm/CouponForm.js +13 -9
- package/dist/elements/public/CouponForm/CouponForm.js.map +1 -1
- package/dist/elements/public/CustomFieldCard/CustomFieldCard.d.ts +1 -1
- package/dist/elements/public/CustomFieldCard/CustomFieldCard.js +2 -2
- package/dist/elements/public/CustomFieldCard/CustomFieldCard.js.map +1 -1
- package/dist/elements/public/CustomFieldCard/TwoLineCard.d.ts +6 -12
- package/dist/elements/public/CustomFieldCard/TwoLineCard.js +5 -35
- package/dist/elements/public/CustomFieldCard/TwoLineCard.js.map +1 -1
- package/dist/elements/public/DiscountBuilder/DiscountBuilder.js +4 -4
- package/dist/elements/public/DiscountBuilder/DiscountBuilder.js.map +1 -1
- package/dist/elements/public/DiscountCard/DiscountCard.d.ts +1 -1
- package/dist/elements/public/DiscountCard/DiscountCard.js +2 -2
- package/dist/elements/public/DiscountCard/DiscountCard.js.map +1 -1
- package/dist/elements/public/DiscountDetailCard/DiscountDetailCard.d.ts +1 -1
- package/dist/elements/public/DiscountDetailCard/DiscountDetailCard.js +2 -2
- package/dist/elements/public/DiscountDetailCard/DiscountDetailCard.js.map +1 -1
- package/dist/elements/public/EmailTemplateCard/EmailTemplateCard.d.ts +1 -1
- package/dist/elements/public/EmailTemplateCard/EmailTemplateCard.js +2 -2
- package/dist/elements/public/EmailTemplateCard/EmailTemplateCard.js.map +1 -1
- package/dist/elements/public/EmailTemplateForm/EmailTemplateForm.js +10 -2
- package/dist/elements/public/EmailTemplateForm/EmailTemplateForm.js.map +1 -1
- package/dist/elements/public/GiftCardCodeLogCard/GiftCardCodeLogCard.d.ts +13 -2
- package/dist/elements/public/GiftCardCodeLogCard/GiftCardCodeLogCard.js +66 -76
- package/dist/elements/public/GiftCardCodeLogCard/GiftCardCodeLogCard.js.map +1 -1
- package/dist/elements/public/GiftCardCodeLogCard/index.d.ts +1 -2
- package/dist/elements/public/GiftCardCodeLogCard/index.js +1 -2
- package/dist/elements/public/GiftCardCodeLogCard/index.js.map +1 -1
- package/dist/elements/public/GiftCardForm/GiftCardForm.js +3 -3
- package/dist/elements/public/GiftCardForm/GiftCardForm.js.map +1 -1
- package/dist/elements/public/I18n/format/price.js +1 -0
- package/dist/elements/public/I18n/format/price.js.map +1 -1
- package/dist/elements/public/I18nEditor/I18nEditor.d.ts +9 -0
- package/dist/elements/public/I18nEditor/I18nEditor.js +13 -4
- package/dist/elements/public/I18nEditor/I18nEditor.js.map +1 -1
- package/dist/elements/public/IntegrationForm/IntegrationForm.d.ts +35 -0
- package/dist/elements/public/IntegrationForm/IntegrationForm.js +156 -164
- package/dist/elements/public/IntegrationForm/IntegrationForm.js.map +1 -1
- package/dist/elements/public/IntegrationForm/index.d.ts +1 -0
- package/dist/elements/public/IntegrationForm/index.js +1 -0
- package/dist/elements/public/IntegrationForm/index.js.map +1 -1
- package/dist/elements/public/ItemCard/ItemCard.js +14 -15
- package/dist/elements/public/ItemCard/ItemCard.js.map +1 -1
- package/dist/elements/public/ItemCategoryCard/ItemCategoryCard.d.ts +1 -1
- package/dist/elements/public/ItemCategoryCard/ItemCategoryCard.js +2 -2
- package/dist/elements/public/ItemCategoryCard/ItemCategoryCard.js.map +1 -1
- package/dist/elements/public/ItemOptionCard/ItemOptionCard.d.ts +1 -1
- package/dist/elements/public/ItemOptionCard/ItemOptionCard.js +2 -2
- package/dist/elements/public/ItemOptionCard/ItemOptionCard.js.map +1 -1
- package/dist/elements/public/PaymentsApiFraudProtectionCard/PaymentsApiFraudProtectionCard.d.ts +23 -2
- package/dist/elements/public/PaymentsApiFraudProtectionCard/PaymentsApiFraudProtectionCard.js +35 -19
- package/dist/elements/public/PaymentsApiFraudProtectionCard/PaymentsApiFraudProtectionCard.js.map +1 -1
- package/dist/elements/public/PaymentsApiFraudProtectionCard/index.d.ts +2 -1
- package/dist/elements/public/PaymentsApiFraudProtectionCard/index.js +2 -1
- package/dist/elements/public/PaymentsApiFraudProtectionCard/index.js.map +1 -1
- package/dist/elements/public/PaymentsApiFraudProtectionForm/PaymentsApiFraudProtectionForm.d.ts +41 -3
- package/dist/elements/public/PaymentsApiFraudProtectionForm/PaymentsApiFraudProtectionForm.js +142 -84
- package/dist/elements/public/PaymentsApiFraudProtectionForm/PaymentsApiFraudProtectionForm.js.map +1 -1
- package/dist/elements/public/PaymentsApiFraudProtectionForm/index.d.ts +2 -3
- package/dist/elements/public/PaymentsApiFraudProtectionForm/index.js +2 -3
- package/dist/elements/public/PaymentsApiFraudProtectionForm/index.js.map +1 -1
- package/dist/elements/public/PaymentsApiFraudProtectionForm/types.d.ts +15 -0
- package/dist/elements/public/PaymentsApiFraudProtectionForm/types.js.map +1 -1
- package/dist/elements/public/PaymentsApiPaymentMethodCard/PaymentsApiPaymentMethodCard.d.ts +23 -3
- package/dist/elements/public/PaymentsApiPaymentMethodCard/PaymentsApiPaymentMethodCard.js +34 -20
- package/dist/elements/public/PaymentsApiPaymentMethodCard/PaymentsApiPaymentMethodCard.js.map +1 -1
- package/dist/elements/public/PaymentsApiPaymentMethodCard/index.d.ts +2 -1
- package/dist/elements/public/PaymentsApiPaymentMethodCard/index.js +2 -1
- package/dist/elements/public/PaymentsApiPaymentMethodCard/index.js.map +1 -1
- package/dist/elements/public/PaymentsApiPaymentMethodForm/PaymentsApiPaymentMethodForm.d.ts +70 -3
- package/dist/elements/public/PaymentsApiPaymentMethodForm/PaymentsApiPaymentMethodForm.js +314 -263
- package/dist/elements/public/PaymentsApiPaymentMethodForm/PaymentsApiPaymentMethodForm.js.map +1 -1
- package/dist/elements/public/PaymentsApiPaymentMethodForm/index.d.ts +2 -0
- package/dist/elements/public/PaymentsApiPaymentMethodForm/index.js +2 -0
- package/dist/elements/public/PaymentsApiPaymentMethodForm/index.js.map +1 -1
- package/dist/elements/public/PaymentsApiPaymentMethodForm/types.d.ts +29 -0
- package/dist/elements/public/PaymentsApiPaymentMethodForm/types.js.map +1 -1
- package/dist/elements/public/PaymentsApiPaymentPresetCard/PaymentsApiPaymentPresetCard.d.ts +1 -1
- package/dist/elements/public/PaymentsApiPaymentPresetCard/PaymentsApiPaymentPresetCard.js +2 -2
- package/dist/elements/public/PaymentsApiPaymentPresetCard/PaymentsApiPaymentPresetCard.js.map +1 -1
- package/dist/elements/public/PaymentsApiPaymentPresetForm/PaymentsApiPaymentPresetForm.d.ts +40 -1
- package/dist/elements/public/PaymentsApiPaymentPresetForm/PaymentsApiPaymentPresetForm.js +93 -74
- package/dist/elements/public/PaymentsApiPaymentPresetForm/PaymentsApiPaymentPresetForm.js.map +1 -1
- package/dist/elements/public/PaymentsApiPaymentPresetForm/types.d.ts +14 -0
- package/dist/elements/public/PaymentsApiPaymentPresetForm/types.js.map +1 -1
- package/dist/elements/public/ReportForm/ReportForm.js +4 -1
- package/dist/elements/public/ReportForm/ReportForm.js.map +1 -1
- package/dist/elements/public/StoreForm/StoreForm.d.ts +153 -1
- package/dist/elements/public/StoreForm/StoreForm.js +191 -27
- package/dist/elements/public/StoreForm/StoreForm.js.map +1 -1
- package/dist/elements/public/StoreForm/index.d.ts +1 -0
- package/dist/elements/public/StoreForm/index.js +1 -0
- package/dist/elements/public/StoreForm/index.js.map +1 -1
- package/dist/elements/public/StoreForm/types.d.ts +94 -0
- package/dist/elements/public/StoreForm/types.js.map +1 -1
- package/dist/elements/public/StoreShippingMethodForm/StoreShippingMethodForm.d.ts +1 -1
- package/dist/elements/public/StoreShippingMethodForm/StoreShippingMethodForm.js +1 -1
- package/dist/elements/public/StoreShippingMethodForm/StoreShippingMethodForm.js.map +1 -1
- package/dist/elements/public/SubscriptionSettingsForm/SubscriptionSettingsForm.d.ts +50 -1
- package/dist/elements/public/SubscriptionSettingsForm/SubscriptionSettingsForm.js +49 -0
- package/dist/elements/public/SubscriptionSettingsForm/SubscriptionSettingsForm.js.map +1 -1
- package/dist/elements/public/SubscriptionSettingsForm/internal/InternalSubscriptionSettingsFormReattemptBypass/globalStyles.js +1 -1
- package/dist/elements/public/SubscriptionSettingsForm/internal/InternalSubscriptionSettingsFormReattemptBypass/globalStyles.js.map +1 -1
- package/dist/elements/public/SubscriptionSettingsForm/internal/InternalSubscriptionSettingsFormReattemptBypass/index.d.ts +1 -0
- package/dist/elements/public/SubscriptionSettingsForm/internal/InternalSubscriptionSettingsFormReattemptBypass/index.js +1 -0
- package/dist/elements/public/SubscriptionSettingsForm/internal/InternalSubscriptionSettingsFormReattemptBypass/index.js.map +1 -1
- package/dist/elements/public/SubscriptionSettingsForm/types.d.ts +33 -1
- package/dist/elements/public/SubscriptionSettingsForm/types.js.map +1 -1
- package/dist/elements/public/TemplateConfigForm/TemplateConfigForm.js +4 -1
- package/dist/elements/public/TemplateConfigForm/TemplateConfigForm.js.map +1 -1
- package/dist/elements/public/TemplateForm/TemplateForm.js +10 -2
- package/dist/elements/public/TemplateForm/TemplateForm.js.map +1 -1
- package/dist/elements/public/TemplateSetCard/TemplateSetCard.d.ts +1 -1
- package/dist/elements/public/TemplateSetCard/TemplateSetCard.js +2 -2
- package/dist/elements/public/TemplateSetCard/TemplateSetCard.js.map +1 -1
- package/dist/elements/public/TemplateSetForm/TemplateSetForm.d.ts +49 -8
- package/dist/elements/public/TemplateSetForm/TemplateSetForm.js +100 -64
- package/dist/elements/public/TemplateSetForm/TemplateSetForm.js.map +1 -1
- package/dist/elements/public/TemplateSetForm/index.d.ts +1 -0
- package/dist/elements/public/TemplateSetForm/index.js +1 -0
- package/dist/elements/public/TemplateSetForm/index.js.map +1 -1
- package/dist/elements/public/TemplateSetForm/types.d.ts +22 -0
- package/dist/elements/public/TemplateSetForm/types.js.map +1 -1
- package/dist/mixins/themeable.js +19 -12
- package/dist/mixins/themeable.js.map +1 -1
- package/package.json +2 -1
- package/dist/cdn/shared-11ffd643.js +0 -1
- package/dist/cdn/shared-1351c1e3.js +0 -1
- package/dist/cdn/shared-2f9b7791.js +0 -1
- package/dist/cdn/shared-79d6a262.js +0 -1
- package/dist/cdn/shared-888d690a.js +0 -1
- package/dist/cdn/shared-b7636a23.js +0 -1
- package/dist/cdn/shared-fafafc09.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-bc814810.js";import"./shared-bb0e33c3.js";import{I as e}from"./shared-6581241a.js";import"./shared-80fc2b6a.js";import"./shared-0479553e.js";import"./foxy-copy-to-clipboard.js";import"./shared-0821cfdc.js";import{_ as t}from"./shared-a8ced8bf.js";import{a as r}from"./shared-2cc638ad.js";import{c as s}from"./shared-4e709717.js";import{h as a}from"./shared-7f33a83a.js";import"./shared-be66c2e7.js";import"./shared-0ce006b9.js";import"./shared-ed0dee03.js";import"./shared-08156595.js";import"./shared-5ea18e60.js";import"./shared-39c10b22.js";import"./shared-9bdacf65.js";import"./shared-43bcce74.js";import"./shared-76b3d76a.js";import"./shared-d3bf9ac0.js";import"./shared-4f037e43.js";import"./shared-181f51bd.js";import"./shared-a85afa33.js";import"./shared-d6276c83.js";import"./shared-2f7dcefa.js";import"./shared-8dd0af4d.js";import"./shared-62a54a6c.js";import"./foxy-spinner.js";import"./shared-62c088b7.js";import"./shared-2092d86f.js";let o,n,i,d,l,c,h,p,_,m,b,f,u,y,x=e=>e;const j=r(e,"integration-form");class $ extends j{constructor(){super(...arguments),this.__postResponse=null}static get properties(){return t(t({},super.properties),{},{__postResponse:{attribute:!1}})}static get v8n(){return[({project_name:e})=>!!e||"project-name:v8n_required"]}renderBody(){return this.data?this.__renderSnapshotBody():this.__renderTemplateBody()}async _fetch(...e){var t;const r=this.constructor,s=await new r.API(this).fetch(...e),a="string"==typeof e[0]?null===(t=e[1])||void 0===t?void 0:t.method:e[0].method,o="string"==typeof e[0]?e[0]:e[0].url;if(!s.ok)throw s;const n=await s.json();return"POST"===(null==a?void 0:a.toUpperCase())&&o===this.parent&&(this.__postResponse=n),n}__renderSnapshotBody(){const e=this.hiddenSelector,t=this.__postResponse;return a(o||(o=x` ${0} ${0} ${0} <foxy-internal-delete-control infer="delete"></foxy-internal-delete-control> `),e.matches("header",!0)?"":this.__renderHeader(),e.matches("message",!0)||!t?"":this.__renderMessage(),e.matches("table")?"":this.__renderTable())}__renderTemplateBody(){return a(n||(n=x` <foxy-internal-text-control infer="project-name"></foxy-internal-text-control> <foxy-internal-text-area-control infer="project-description"> </foxy-internal-text-area-control> <foxy-internal-create-control infer="create"></foxy-internal-create-control> `))}__renderMessage(){return a(i||(i=x` ${0} <div class="bg-success-10 text-success p-m pb-s space-y-xs leading-s rounded-t-l rounded-b-l"> <foxy-i18n infer="message" class="block" key="text"></foxy-i18n> <vaadin-button data-testid="message-action" theme="tertiary contrast" class="p-0" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="message" key="action"></foxy-i18n> </vaadin-button> </div> ${0} `),this.renderTemplateOrSlot("message:before"),this.disabledSelector.matches("message",!0),(()=>this.__postResponse=null),this.renderTemplateOrSlot("message:after"))}__renderHeader(){const e=this.data,t=a(d||(d=x`<foxy-i18n infer="header" key="no_description"></foxy-i18n>`));return a(l||(l=x` ${0} <div class="space-y-xs"> <div class="font-bold truncate text-xl">${0}​</div> <div class="text-secondary">${0}</div> </div> ${0} `),this.renderTemplateOrSlot("header:before"),e.project_name,e.project_description||t,this.renderTemplateOrSlot("header:after"))}__renderTable(){var e;const t=this.data,r=new Date(1e3*(null!==(e=t.expires)&&void 0!==e?e:0)),s=this.__postResponse;return a(c||(c=x` ${0} <table class="font-lumo text-m leading-m w-full"> <tbody class="divide-y divide-contrast-10"> ${0} ${0} ${0} ${0} ${0} ${0} ${0} </tbody> </table> ${0} `),this.renderTemplateOrSlot("table:before"),this.__renderTableRow({label:this.__renderTableI18n("added_by"),value:this.__renderMailToLink(t.added_by_email,t.added_by_name)}),this.__renderTableRow({label:this.__renderTableI18n("contact"),value:this.__renderMailToLink(t.contact_email,t.contact_name)}),this.__renderTableRow({label:this.__renderTableI18n("company"),value:this.__renderLink(t.company_url,t.company_name)}),this.__renderTableRow({label:this.__renderTableI18n("expires"),value:this.__renderTableI18n("expires_date",{date:r})}),this.__renderTableRow({label:"Client ID",value:this.__renderCopiableText(t.client_id)}),s?a(h||(h=x` ${0} ${0} ${0} `),this.__renderTableRow({highlight:!0,label:"Client secret",value:this.__renderCopiableText(s.client_secret)}),this.__renderTableRow({highlight:!0,label:"Refresh token",value:this.__renderCopiableText(s.refresh_token)}),this.__renderTableRow({highlight:!0,label:"Access token",value:this.__renderCopiableText(s.access_token)})):"",this.__renderTableRow({label:"Scope",value:a(p||(p=x`<code>${0}</code>`),t.scope)}),this.renderTemplateOrSlot("table:after"))}__renderCopiableText(e){return a(_||(_=x` <div class="flex items-center gap-s"> <code class="truncate flex-1">${0}</code> <foxy-copy-to-clipboard infer="copy-to-clipboard" class="inline-block" text="${0}"> </foxy-copy-to-clipboard> </div> `),e,e)}__renderMailToLink(e,t){return e?this.__renderLink(`mailto:${e}`,t):a(m||(m=x`${0}`),t)}__renderLink(e,t){return e?a(f||(f=x` <a target="_blank" class="font-semibold text-primary rounded hover-underline focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> ${0} </a> `),e,t):a(b||(b=x`${0}`),t)}__renderTableRow(e){const{label:t,value:r,highlight:o=!1}=e;return a(u||(u=x` <tr class="${0}"> <td class="max-w-0 truncate py-s text-secondary w-1-3 pr-m">${0}</td> <td class="max-w-0 truncate py-s text-body w-2-3">${0}</td> </tr> `),s({"font-semibold text-success":o}),t,r)}__renderTableI18n(e,t){return a(y||(y=x`<foxy-i18n infer="table" key="${0}" .options="${0}"></foxy-i18n>`),e,t)}}customElements.define("foxy-integration-form",$);export{$ as IntegrationForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{I as e}from"./shared-b7636a23.js";import"./foxy-nucleon-element.js";import"./shared-888d690a.js";import{_ as t}from"./shared-a8ced8bf.js";import{a as i}from"./shared-1e94e6dd.js";import{C as r}from"./shared-43bcce74.js";import{i as o}from"./shared-d3bf9ac0.js";import{h as a}from"./shared-7f33a83a.js";import"./foxy-spinner.js";import"./shared-2f6e33b6.js";import"./shared-68e0cf30.js";import"./shared-3ca1e8e4.js";import"./shared-4f037e43.js";import"./shared-76b3d76a.js";import"./shared-181f51bd.js";import"./shared-a85afa33.js";import"./shared-d6276c83.js";import"./shared-2f7dcefa.js";import"./shared-4e709717.js";let d,s,l,n,c,u,h=e=>e;const _=r(i(e,"item-card"));class f extends _{constructor(){super(...arguments),this.localeCodes=null,this.__transactionTemplateLoaderId="transactionTemplateLoader",this.__defaultTemplateSetLoaderId="defaultTemplateSetLoader",this.__localeCodesHelperLoaderId="localeCodesLoader",this.__transactionLoaderId="transactionLoader",this.__templateSetLoaderId="templateSetLoader",this.__storeLoaderId="storeLoader",this.__cartLoaderId="cartLoader"}static get properties(){return t(t({},super.properties),{},{localeCodes:{type:String,attribute:"locale-codes"}})}renderBody(){var e,t,i,r,_,v,p,m,y;const x=null!==(t=null===(e=this.data)||void 0===e?void 0:e.quantity)&&void 0!==t?t:0,L=null===(r=null===(i=this.data)||void 0===i?void 0:i._embedded)||void 0===r?void 0:r["fx:item_options"],$=null!==(v=null===(_=this.data)||void 0===_?void 0:_.price)&&void 0!==v?v:0,g=this.__currencyDisplay,C=this.__currencyCode,H=x*$;return a(d||(d=h` <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <div class="flex items-start space-x-m leading-m"> <div class="w-l h-l relative flex-shrink-0"> <img class="relative w-full h-full object-cover rounded-s" src="${0}" alt="" @error="${0}"> <div class="border border-contrast-10 absolute inset-0 rounded-s"></div> </div> <div class="flex-1 min-w-0"> <div class="flex-1 h-l flex items-center"> <div class="flex-1 leading-s"> <div class="font-semibold text-m truncate">${0}</div> <div class="text-secondary text-m truncate"> ${0} × <foxy-i18n options="${0}" key="price" infer=""> </foxy-i18n> = <foxy-i18n options="${0}" key="price" infer=""> </foxy-i18n> </div> </div> ${0} </div> ${0} </div> </div> `),o(this.__transactionTemplateHref),this.__transactionTemplateLoaderId,(()=>this.requestUpdate()),o(this.__defaultTemplateSetHref),this.__defaultTemplateSetLoaderId,(()=>this.requestUpdate()),o(this.__localeCodesHelperHref),this.__localeCodesHelperLoaderId,(()=>this.requestUpdate()),o(this.__transactionHref),this.__transactionLoaderId,(()=>this.requestUpdate()),o(this.__templateSetHref),this.__templateSetLoaderId,(()=>this.requestUpdate()),o(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()),o(this.__cartHref),this.__cartLoaderId,(()=>this.requestUpdate()),o(null===(p=this.data)||void 0===p?void 0:p.image),(e=>{e.currentTarget.src=f.__placeholder}),null===(m=this.data)||void 0===m?void 0:m.name,x,JSON.stringify({amount:`${$} ${C}`,currencyDisplay:g}),JSON.stringify({amount:`${H} ${C}`,currencyDisplay:g}),(null===(y=this.data)||void 0===y?void 0:y.subscription_frequency)&&!this.hiddenSelector.matches("autorenew-icon",!0)?a(s||(s=h` <div class="w-xs h-xs flex items-center justify-center rounded-full bg-contrast-5"> <iron-icon icon="icons:autorenew" class="icon-inline text-s"></iron-icon> </div> `)):"",L&&L.length>0?a(l||(l=h` <div class="mt-s"> ${0} </div> `),L.map((e=>a(n||(n=h` <div data-testclass="option" class="flex items-center text-m space-x-xs leading-m"> <div class="flex-1 text-tertiary truncate"> ${0}: ${0} </div> ${0} ${0} </div> `),e.name,e.value,e.price_mod?a(c||(c=h` <div class="${0} rounded px-xs truncate"> <foxy-i18n options="${0}" key="price" infer=""> </foxy-i18n> </div> `),e.price_mod>0?"text-success":"text-error",JSON.stringify({amount:`${e.price_mod} ${C}`,currencyDisplay:g})):"",e.weight_mod?a(u||(u=h` <div class="${0} rounded px-xs truncate"> ${0} <foxy-i18n key="wgt" infer=""></foxy-i18n> </div> `),e.price_mod>0?"text-success":"text-error",e.weight_mod):"")))):"")}get isBodyReady(){const e=!!this.__currencyDisplay&&!!this.__currencyCode;return super.isBodyReady&&e}get __transactionTemplateHref(){var e,t,i;try{const r=null===(e=this.data)||void 0===e?void 0:e._links,o=new URL(null!==(i=null===(t=null==r?void 0:r["fx:subscription"])||void 0===t?void 0:t.href)&&void 0!==i?i:"");return o.searchParams.set("zoom","transaction_template"),o.toString()}catch(e){}}get __defaultTemplateSetHref(){var e,t,i,r;if(""===(null===(t=null!==(e=this.__cart)&&void 0!==e?e:this.__transactionTemplate)||void 0===t?void 0:t.template_set_uri))try{const e=new URL(null!==(r=null===(i=this.__store)||void 0===i?void 0:i._links["fx:template_sets"].href)&&void 0!==r?r:"");return e.searchParams.set("code","DEFAULT"),e.toString()}catch(e){}}get __localeCodesHelperHref(){var e;if(this.__defaultTemplateSetHref||this.__templateSetHref)return null!==(e=this.localeCodes)&&void 0!==e?e:void 0}get __transactionHref(){var e,t;return null===(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:transaction"])||void 0===t?void 0:t.href}get __templateSetHref(){var e;const t=null!==(e=this.__cart)&&void 0!==e?e:this.__transactionTemplate;if(!(null==t?void 0:t.currency_code))return(null==t?void 0:t.template_set_uri)||void 0}get __storeHref(){var e,t;return null===(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:store"])||void 0===t?void 0:t.href}get __cartHref(){var e,t;const i=null===(e=this.data)||void 0===e?void 0:e._links;return null===(t=null==i?void 0:i["fx:cart"])||void 0===t?void 0:t.href}get __transactionTemplate(){var e,t;const i=`#${this.__transactionTemplateLoaderId}`,r=this.renderRoot.querySelector(i);return null!==(t=null===(e=null==r?void 0:r.data)||void 0===e?void 0:e._embedded["fx:transaction_template"])&&void 0!==t?t:null}get __defaultTemplateSet(){var e,t;const i=`#${this.__defaultTemplateSetLoaderId}`,r=this.renderRoot.querySelector(i);return null!==(t=null===(e=null==r?void 0:r.data)||void 0===e?void 0:e._embedded["fx:template_sets"][0])&&void 0!==t?t:null}get __localeCodesHelper(){var e,t;const i=`#${this.__localeCodesHelperLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(i))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __transaction(){var e,t;const i=`#${this.__transactionLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(i))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __templateSet(){var e,t;const i=`#${this.__templateSetLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(i))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __store(){var e,t;const i=`#${this.__storeLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(i))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __cart(){var e,t;const i=`#${this.__cartLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(i))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __currencyDisplay(){var e;const t=null===(e=this.__store)||void 0===e?void 0:e.use_international_currency_symbol;return!0===t?"code":!1===t||this.data&&!this.data._links["fx:store"]?"symbol":void 0}get __currencyCode(){var e,t,i,r;const o=this.__transaction;if(o)return o.currency_code;{const o=null!==(e=this.__cart)&&void 0!==e?e:this.__transactionTemplate;if(o&&"currency_code"in o)return o.currency_code;{const e=this.__localeCodesHelper,o=null===(i=null!==(t=this.__templateSet)&&void 0!==t?t:this.__defaultTemplateSet)||void 0===i?void 0:i.locale_code,a=o?null==e?void 0:e.values[o]:void 0;if(a)return null===(r=/Currency: ([A-Z]{3})/g.exec(a))||void 0===r?void 0:r[1]}}}}f.__placeholder='data:image/svg+xml,%3Csvg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"%3E%3Crect width="40" height="40" fill="%23E8E8E8"/%3E%3Cpath d="M31.5143 0H24.5476L0 24.5476V31.5143L11.7046 19.8097L11.9841 17.0782C12.0983 15.9624 13.0131 15.1154 14.1038 15.1154H15.7373V12.1923C15.7373 10.9815 16.6915 10 17.8687 10H21.5143L31.5143 0Z" fill="white"/%3E%3Cpath d="M11.5434 21.3852L0 32.9285V39.8953L11.5822 28.3131C11.172 27.8663 10.9438 27.2444 11.012 26.5782L11.5434 21.3852Z" fill="white"/%3E%3Cpath d="M12.4305 28.879L1.30951 40H8.27631L19.2763 29H13.1316C12.8853 29 12.6495 28.9573 12.4305 28.879Z" fill="white"/%3E%3Cpath d="M28.3113 19.965L28.0159 17.0782C27.9116 16.0591 27.1395 15.2642 26.1754 15.1341L40 1.3095V8.27627L28.3113 19.965Z" fill="white"/%3E%3Cpath d="M20.6905 29L9.69049 40H16.6572L27.9755 28.6817C27.6541 28.8832 27.2756 29 26.8684 29H20.6905Z" fill="white"/%3E%3Cpath d="M28.6572 28C28.9128 27.5952 29.0415 27.1003 28.988 26.5782L28.4426 21.2479L40 9.69053V16.6572L28.6572 28Z" fill="white"/%3E%3Cpath d="M25.0381 40H18.0715L40 18.0715V25.0381L25.0381 40Z" fill="white"/%3E%3Cpath d="M26.4524 40H33.4191L40 33.4191V26.4524L26.4524 40Z" fill="white"/%3E%3Cpath d="M40 40H34.8333L40 34.8333V40Z" fill="white"/%3E%3Cpath d="M16.1666 0H23.1334L0 23.1334V16.1666L16.1666 0Z" fill="white"/%3E%3Cpath d="M14.7524 0H7.78571L0 7.78573V14.7524L14.7524 0Z" fill="white"/%3E%3Cpath d="M0 0H6.37152L0 6.37151V0Z" fill="white"/%3E%3Cpath d="M21.467 11.4615H17.8687C17.4763 11.4615 17.1582 11.7887 17.1582 12.1923V15.1154H22.8418V12.1923C22.8418 11.7887 22.5237 11.4615 22.1313 11.4615H21.467Z" fill="white"/%3E%3Cpath d="M24.7798 15.1154H24.2627V12.1923C24.2627 11.227 23.6562 10.4075 22.8138 10.1148L32.9286 0H39.89L24.7798 15.1154Z" fill="white"/%3E%3C/svg%3E',customElements.define("foxy-item-card",f);export{f as ItemCard};
|
|
1
|
+
import"./shared-21679ebd.js";import"./foxy-nucleon-element.js";import"./shared-0821cfdc.js";import{_ as e}from"./shared-a8ced8bf.js";import{a as t}from"./shared-2cc638ad.js";import{C as i}from"./shared-43bcce74.js";import{I as r}from"./shared-486d7bb5.js";import{i as o}from"./shared-d3bf9ac0.js";import{h as a}from"./shared-7f33a83a.js";import"./foxy-spinner.js";import"./shared-62c088b7.js";import"./shared-0ce006b9.js";import"./shared-2092d86f.js";import"./shared-4f037e43.js";import"./shared-76b3d76a.js";import"./shared-181f51bd.js";import"./shared-a85afa33.js";import"./shared-d6276c83.js";import"./shared-2f7dcefa.js";import"./shared-4e709717.js";let d,s,l,n,c,u,h=e=>e;const _=i(t(r,"item-card"));class f extends _{constructor(){super(...arguments),this.localeCodes=null,this.__transactionTemplateLoaderId="transactionTemplateLoader",this.__defaultTemplateSetLoaderId="defaultTemplateSetLoader",this.__localeCodesHelperLoaderId="localeCodesLoader",this.__transactionLoaderId="transactionLoader",this.__templateSetLoaderId="templateSetLoader",this.__storeLoaderId="storeLoader",this.__cartLoaderId="cartLoader"}static get properties(){return e(e({},super.properties),{},{localeCodes:{type:String,attribute:"locale-codes"}})}renderBody(){var e,t,i,r,_,v,p,m,y;const x=null!==(t=null===(e=this.data)||void 0===e?void 0:e.quantity)&&void 0!==t?t:0,L=null===(r=null===(i=this.data)||void 0===i?void 0:i._embedded)||void 0===r?void 0:r["fx:item_options"],$=null!==(v=null===(_=this.data)||void 0===_?void 0:_.price)&&void 0!==v?v:0,g=this.__currencyDisplay,C=this.__currencyCode,H=x*$;return a(d||(d=h` <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <div class="flex items-start leading-xs" style="gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> <img class="relative h-s w-s object-cover rounded-full bg-contrast-20 flex-shrink-0 shadow-xs" src="${0}" alt="" @error="${0}"> <div class="flex-1 min-w-0"> <div class="flex-1 h-s flex items-center"> <div class="flex-1"> <div class="font-semibold text-m truncate">${0}</div> <div class="text-tertiary text-s truncate"> ${0} × <foxy-i18n options="${0}" key="price" infer=""> </foxy-i18n> = <foxy-i18n options="${0}" key="price" infer=""> </foxy-i18n> </div> </div> ${0} </div> ${0} </div> </div> `),o(this.__transactionTemplateHref),this.__transactionTemplateLoaderId,(()=>this.requestUpdate()),o(this.__defaultTemplateSetHref),this.__defaultTemplateSetLoaderId,(()=>this.requestUpdate()),o(this.__localeCodesHelperHref),this.__localeCodesHelperLoaderId,(()=>this.requestUpdate()),o(this.__transactionHref),this.__transactionLoaderId,(()=>this.requestUpdate()),o(this.__templateSetHref),this.__templateSetLoaderId,(()=>this.requestUpdate()),o(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()),o(this.__cartHref),this.__cartLoaderId,(()=>this.requestUpdate()),o(null===(p=this.data)||void 0===p?void 0:p.image),(e=>{e.currentTarget.src=f.__placeholder}),null===(m=this.data)||void 0===m?void 0:m.name,x,JSON.stringify({amount:`${$} ${C}`,currencyDisplay:g}),JSON.stringify({amount:`${H} ${C}`,currencyDisplay:g}),(null===(y=this.data)||void 0===y?void 0:y.subscription_frequency)&&!this.hiddenSelector.matches("autorenew-icon",!0)?a(s||(s=h` <div class="w-xs h-xs flex items-center justify-center rounded-full bg-contrast-5"> <iron-icon icon="icons:autorenew" class="icon-inline text-s"></iron-icon> </div> `)):"",L&&L.length>0?a(l||(l=h` <div class="mt-s"> ${0} </div> `),L.map((e=>a(n||(n=h` <div data-testclass="option" class="flex items-center text-s space-x-xs leading-m"> <div class="flex-1 text-tertiary truncate"> ${0}: ${0} </div> ${0} ${0} </div> `),e.name,e.value,e.price_mod?a(c||(c=h` <div class="${0} rounded px-xs truncate"> <foxy-i18n options="${0}" key="price" infer=""> </foxy-i18n> </div> `),e.price_mod>0?"text-success":"text-error",JSON.stringify({amount:`${e.price_mod} ${C}`,currencyDisplay:g})):"",e.weight_mod?a(u||(u=h` <div class="${0} rounded px-xs truncate"> ${0} <foxy-i18n key="wgt" infer=""></foxy-i18n> </div> `),e.price_mod>0?"text-success":"text-error",e.weight_mod):"")))):"")}get isBodyReady(){const e=!!this.__currencyDisplay&&!!this.__currencyCode;return super.isBodyReady&&e}get __transactionTemplateHref(){var e,t,i;try{const r=null===(e=this.data)||void 0===e?void 0:e._links,o=new URL(null!==(i=null===(t=null==r?void 0:r["fx:subscription"])||void 0===t?void 0:t.href)&&void 0!==i?i:"");return o.searchParams.set("zoom","transaction_template"),o.toString()}catch(e){}}get __defaultTemplateSetHref(){var e,t,i,r;if(""===(null===(t=null!==(e=this.__cart)&&void 0!==e?e:this.__transactionTemplate)||void 0===t?void 0:t.template_set_uri))try{const e=new URL(null!==(r=null===(i=this.__store)||void 0===i?void 0:i._links["fx:template_sets"].href)&&void 0!==r?r:"");return e.searchParams.set("code","DEFAULT"),e.toString()}catch(e){}}get __localeCodesHelperHref(){var e;if(this.__defaultTemplateSetHref||this.__templateSetHref)return null!==(e=this.localeCodes)&&void 0!==e?e:void 0}get __transactionHref(){var e,t;return null===(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:transaction"])||void 0===t?void 0:t.href}get __templateSetHref(){var e;const t=null!==(e=this.__cart)&&void 0!==e?e:this.__transactionTemplate;if(!(null==t?void 0:t.currency_code))return(null==t?void 0:t.template_set_uri)||void 0}get __storeHref(){var e,t;return null===(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:store"])||void 0===t?void 0:t.href}get __cartHref(){var e,t;const i=null===(e=this.data)||void 0===e?void 0:e._links;return null===(t=null==i?void 0:i["fx:cart"])||void 0===t?void 0:t.href}get __transactionTemplate(){var e,t;const i=`#${this.__transactionTemplateLoaderId}`,r=this.renderRoot.querySelector(i);return null!==(t=null===(e=null==r?void 0:r.data)||void 0===e?void 0:e._embedded["fx:transaction_template"])&&void 0!==t?t:null}get __defaultTemplateSet(){var e,t;const i=`#${this.__defaultTemplateSetLoaderId}`,r=this.renderRoot.querySelector(i);return null!==(t=null===(e=null==r?void 0:r.data)||void 0===e?void 0:e._embedded["fx:template_sets"][0])&&void 0!==t?t:null}get __localeCodesHelper(){var e,t;const i=`#${this.__localeCodesHelperLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(i))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __transaction(){var e,t;const i=`#${this.__transactionLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(i))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __templateSet(){var e,t;const i=`#${this.__templateSetLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(i))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __store(){var e,t;const i=`#${this.__storeLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(i))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __cart(){var e,t;const i=`#${this.__cartLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(i))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __currencyDisplay(){var e;const t=null===(e=this.__store)||void 0===e?void 0:e.use_international_currency_symbol;return!0===t?"code":!1===t||this.data&&!this.data._links["fx:store"]?"symbol":void 0}get __currencyCode(){var e,t,i,r;const o=this.__transaction;if(o)return o.currency_code;{const o=null!==(e=this.__cart)&&void 0!==e?e:this.__transactionTemplate;if(o&&"currency_code"in o)return o.currency_code;{const e=this.__localeCodesHelper,o=null===(i=null!==(t=this.__templateSet)&&void 0!==t?t:this.__defaultTemplateSet)||void 0===i?void 0:i.locale_code,a=o?null==e?void 0:e.values[o]:void 0;if(a)return null===(r=/Currency: ([A-Z]{3})/g.exec(a))||void 0===r?void 0:r[1]}}}}f.__placeholder='data:image/svg+xml,%3Csvg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"%3E%3Crect width="40" height="40" fill="%23E8E8E8"/%3E%3Cpath d="M31.5143 0H24.5476L0 24.5476V31.5143L11.7046 19.8097L11.9841 17.0782C12.0983 15.9624 13.0131 15.1154 14.1038 15.1154H15.7373V12.1923C15.7373 10.9815 16.6915 10 17.8687 10H21.5143L31.5143 0Z" fill="white"/%3E%3Cpath d="M11.5434 21.3852L0 32.9285V39.8953L11.5822 28.3131C11.172 27.8663 10.9438 27.2444 11.012 26.5782L11.5434 21.3852Z" fill="white"/%3E%3Cpath d="M12.4305 28.879L1.30951 40H8.27631L19.2763 29H13.1316C12.8853 29 12.6495 28.9573 12.4305 28.879Z" fill="white"/%3E%3Cpath d="M28.3113 19.965L28.0159 17.0782C27.9116 16.0591 27.1395 15.2642 26.1754 15.1341L40 1.3095V8.27627L28.3113 19.965Z" fill="white"/%3E%3Cpath d="M20.6905 29L9.69049 40H16.6572L27.9755 28.6817C27.6541 28.8832 27.2756 29 26.8684 29H20.6905Z" fill="white"/%3E%3Cpath d="M28.6572 28C28.9128 27.5952 29.0415 27.1003 28.988 26.5782L28.4426 21.2479L40 9.69053V16.6572L28.6572 28Z" fill="white"/%3E%3Cpath d="M25.0381 40H18.0715L40 18.0715V25.0381L25.0381 40Z" fill="white"/%3E%3Cpath d="M26.4524 40H33.4191L40 33.4191V26.4524L26.4524 40Z" fill="white"/%3E%3Cpath d="M40 40H34.8333L40 34.8333V40Z" fill="white"/%3E%3Cpath d="M16.1666 0H23.1334L0 23.1334V16.1666L16.1666 0Z" fill="white"/%3E%3Cpath d="M14.7524 0H7.78571L0 7.78573V14.7524L14.7524 0Z" fill="white"/%3E%3Cpath d="M0 0H6.37152L0 6.37151V0Z" fill="white"/%3E%3Cpath d="M21.467 11.4615H17.8687C17.4763 11.4615 17.1582 11.7887 17.1582 12.1923V15.1154H22.8418V12.1923C22.8418 11.7887 22.5237 11.4615 22.1313 11.4615H21.467Z" fill="white"/%3E%3Cpath d="M24.7798 15.1154H24.2627V12.1923C24.2627 11.227 23.6562 10.4075 22.8138 10.1148L32.9286 0H39.89L24.7798 15.1154Z" fill="white"/%3E%3C/svg%3E',customElements.define("foxy-item-card",f);export{f as ItemCard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-0479553e.js";import"./foxy-spinner.js";import{a as
|
|
1
|
+
import"./shared-0479553e.js";import"./foxy-spinner.js";import{a as r}from"./shared-2cc638ad.js";import{T as s}from"./shared-868065de.js";import{h as e}from"./shared-7f33a83a.js";import"./shared-62c088b7.js";import"./shared-0ce006b9.js";import"./shared-2092d86f.js";import"./shared-0821cfdc.js";import"./shared-a8ced8bf.js";import"./shared-76b3d76a.js";import"./shared-4f037e43.js";import"./shared-43bcce74.js";import"./shared-d3bf9ac0.js";import"./shared-486d7bb5.js";import"./shared-181f51bd.js";import"./shared-a85afa33.js";import"./shared-d6276c83.js";import"./shared-2f7dcefa.js";import"./shared-4e709717.js";let a,d,t=r=>r;const o=r(s,"item-category-card");class m extends o{renderBody(){return super.renderBody({title:r=>e(a||(a=t`${0}`),r.name),subtitle:r=>e(d||(d=t`${0}`),r.code)})}}customElements.define("foxy-item-category-card",m);export{m as ItemCategoryCard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-e94165e9.js";import"./shared-776f948d.js";import"./shared-7fb8ecc5.js";import"./shared-fafafc09.js";import"./shared-5ada1ccb.js";import{I as e}from"./shared-21689ac0.js";import"./foxy-discount-builder.js";import{I as t}from"./shared-c379590f.js";import"./foxy-collection-page.js";import"./foxy-pagination.js";import"./shared-2b2002ac.js";import"./foxy-nucleon-element.js";import{TaxCard as n}from"./foxy-tax-card.js";import{_ as r}from"./shared-a8ced8bf.js";import{i}from"./shared-d3bf9ac0.js";import{h as o}from"./shared-7f33a83a.js";import{a}from"./shared-1e94e6dd.js";import"./shared-df462496.js";import"./shared-869df7ed.js";import"./shared-68e0cf30.js";import"./shared-5b3ae513.js";import"./shared-23bf6ee6.js";import"./shared-2f6e33b6.js";import"./shared-39b184de.js";import"./shared-0d4f9b06.js";import"./shared-a85afa33.js";import"./shared-76b3d76a.js";import"./shared-88c7755d.js";import"./shared-a343ec6b.js";import"./shared-888d690a.js";import"./shared-4f037e43.js";import"./shared-b48e5aaf.js";import"./shared-cf784db1.js";import"./shared-ae588315.js";import"./shared-43bcce74.js";import"./shared-4e709717.js";import"./foxy-spinner.js";import"./shared-3ca1e8e4.js";import"./shared-181f51bd.js";import"./shared-d6276c83.js";import"./shared-2f7dcefa.js";import"./shared-d519a301.js";import"./shared-e6f3e9f0.js";import"./shared-0479553e.js";import"./shared-11c2efc8.js";import"./shared-b7636a23.js";let l,s=e=>e;customElements.define("foxy-internal-item-category-form-taxes-control-item",class extends n{constructor(){super(...arguments),this.taxItemCategories=null,this.itemCategory=null,this.__resourceElementIsBusy=!1,this.__queryElementData=null}static get properties(){return r(r({},super.properties),{},{taxItemCategories:{type:String,attribute:"tax-item-categories"},itemCategory:{type:String,attribute:"item-category"}})}render(){var e,t,n,r,a;const d=null===(n=null===(t=null===(e=this.__queryElementData)||void 0===e?void 0:e._embedded)||void 0===t?void 0:t["fx:tax_item_categories"])||void 0===n?void 0:n[0];let m;try{const e=new URL(null!==(r=this.taxItemCategories)&&void 0!==r?r:""),t=new URL(this.href).pathname.split("/").pop();if(!t)throw new Error;e.searchParams.set("tax_id",t),e.searchParams.set("limit","1"),m=e.toString()}catch(e){m=void 0}return o(l||(l=s` <foxy-nucleon href="${0}" id="query" @update="${0}"> <foxy-nucleon parent="${0}" href="${0}" id="resource" @update="${0}"> </foxy-nucleon> </foxy-nucleon> <vaadin-checkbox class="px-m py-s block overflow-hidden" ?disabled="${0}" ?checked="${0}" @change="${0}"> ${0} </vaadin-checkbox> `),i(m),(e=>{const t=e.currentTarget;this.__queryElementData=t.data,this.requestUpdate()}),i(null!==(a=this.taxItemCategories)&&void 0!==a?a:void 0),i(null==d?void 0:d._links.self.href),(e=>{const t=e.currentTarget;this.__resourceElementIsBusy=!t.in("idle"),this.requestUpdate()}),!this.__queryElementData||this.__resourceElementIsBusy||this.disabled,!!d,(e=>{const t=e.currentTarget,n=this.renderRoot.querySelector("#resource");t.checked?(n.edit({tax_uri:this.data._links.self.href,item_category_uri:this.itemCategory}),n.submit()):n.delete()}),super.render())}});let d,m=e=>e;customElements.define("foxy-internal-item-category-form-taxes-control",class extends t{constructor(){super(...arguments),this.taxes=null}static get properties(){return r(r({},super.properties),{},{taxes:{type:String}})}renderControl(){var e,t,n,r;const i=this.nucleon;let a;try{const t=new URL(null!==(e=this.taxes)&&void 0!==e?e:"");t.searchParams.set("limit","5"),a=t.toString()}catch(e){a=null!==(t=this.taxes)&&void 0!==t?t:""}return o(d||(d=m` <foxy-i18n class="block text-s font-medium text-secondary leading-none mb-s" infer="" key="title"> </foxy-i18n> <foxy-pagination first="${0}" infer="pagination"> <foxy-collection-page class="block mb-s divide-y divide-contrast-10 border border-contrast-10 rounded-t-l rounded-b-l" infer="" item="foxy-internal-item-category-form-taxes-control-item" .props="${0}"> </foxy-collection-page> </foxy-pagination> <foxy-i18n class="block text-xs text-secondary leading-xs mt-xs" infer="" key="helper_text"> </foxy-i18n> `),a,{"tax-item-categories":null!==(r=null===(n=null==i?void 0:i.form._links)||void 0===n?void 0:n["fx:tax_item_categories"].href)&&void 0!==r?r:"","item-category":null==i?void 0:i.href})}});let p,c,_,f,u,h,y,g,x,v,b,j,$,w=e=>e;class q extends(a(e,"item-category-form")){constructor(){super(...arguments),this.emailTemplates=null,this.taxes=null}static get properties(){return r(r({},super.properties),{},{emailTemplates:{type:String,attribute:"email-templates"},taxes:{type:String}})}static get v8n(){return[({code:e})=>!!e||"code:v8n_required",({code:e})=>e&&e.length<=50||"code:v8n_too_long",({name:e})=>!!e||"name:v8n_required",({name:e})=>e&&e.length<=50||"name:v8n_too_long",({item_delivery_type:e})=>!!e||"item-delivery-type:v8n_required",({item_delivery_type:e,max_downloads_per_customer:t})=>"downloaded"!==e||"number"==typeof t||"max-downloads-per-customer:v8n_required",({max_downloads_per_customer:e})=>"number"!=typeof e||e>=0||"max-downloads-per-customer:v8n_negative",({item_delivery_type:e,max_downloads_time_period:t})=>"downloaded"!==e||"number"==typeof t||"max-downloads-time-period:v8n_required",({max_downloads_time_period:e})=>"number"!=typeof e||e>=0||"max-downloads-time-period:v8n_negative",({customs_value:e})=>"number"!=typeof e||e>=0||"customs-value:v8n_negative",({item_delivery_type:e,default_weight:t})=>"shipped"!==e||"number"==typeof t||"default-weight:v8n_required",({default_weight:e})=>"number"!=typeof e||e>=0||"default-weight:v8n_negative",({item_delivery_type:e,default_weight_unit:t})=>"shipped"!==e||"string"==typeof t||"default-weight-unit:v8n_required",({item_delivery_type:e,default_length_unit:t})=>"shipped"!==e||"string"==typeof t||"default-length-unit:v8n_required",({item_delivery_type:e,shipping_flat_rate:t})=>"flat_rate"!==e||"number"==typeof t||"shipping-flat-rate:v8n_required",({shipping_flat_rate:e})=>"number"!=typeof e||e>=0||"shipping-flat-rate:v8n_negative",({item_delivery_type:e,shipping_flat_rate_type:t})=>"flat_rate"!==e||"string"==typeof t||"shipping-flat-rate-type:v8n_required",({handling_fee_type:e})=>!!e||"handling-fee-type:v8n_required",({handling_fee_type:e,handling_fee_minimum:t})=>"flat_percent_with_minimum"!==e||"number"==typeof t||"handling-fee-minimum:v8n_required",({handling_fee_minimum:e})=>"number"!=typeof e||e>=0||"handling-fee-minimum:v8n_negative",({handling_fee_type:e,handling_fee_percentage:t})=>"flat_percent_with_minimum"!==e&&"flat_percent"!==e||"number"==typeof t||"handling-fee-percentage:v8n_required",({handling_fee_percentage:e})=>"number"!=typeof e||e>=0||"handling-fee-percentage:v8n_negative",({send_admin_email:e,admin_email:t})=>!e||!!t||"admin-email:v8n_required"]}renderBody(){var e,t,n,r;const a=this.form.item_delivery_type,l=null!==(e=this.form.handling_fee_type)&&void 0!==e?e:"none",s=!this.hiddenSelector.matches("dividers",!0),d=o(p||(p=w`<div class="border-t border-contrast-10 col-span-2"></div>`));return o(c||(c=w` <div class="grid grid-cols-2 gap-m"> <foxy-internal-text-control infer="name" class="col-span-2"></foxy-internal-text-control> <foxy-internal-text-control infer="code" class="col-span-2"></foxy-internal-text-control> ${0} <foxy-internal-select-control infer="handling-fee-type" class="col-span-2" .options="${0}"> </foxy-internal-select-control> ${0} ${0} <foxy-internal-select-control infer="item-delivery-type" class="col-span-2" .options="${0}"> </foxy-internal-select-control> ${0} ${0} ${0} <foxy-internal-text-control infer="discount-name" class="col-span-2"> </foxy-internal-text-control> ${0} ${0} <foxy-internal-async-combo-box-control item-label-path="description" item-value-path="_links.self.href" first="${0}" infer="admin-email-template-uri" class="${0}" @change="${0}"> </foxy-internal-async-combo-box-control> ${0} <foxy-internal-async-combo-box-control item-label-path="description" item-value-path="_links.self.href" first="${0}" infer="customer-email-template-uri" class="col-span-2" @change="${0}"> </foxy-internal-async-combo-box-control> <foxy-internal-async-combo-box-control item-label-path="description" item-value-path="_links.self.href" first="${0}" infer="gift-recipient-email-template-uri" class="col-span-2"> </foxy-internal-async-combo-box-control> ${0} ${0} </div> ${0} `),s?d:"",q.__handlingFeeTypeOptions,"none"===l?"":o(_||(_=w` ${0} ${0} ${0} `),this.__renderHandlingFee(),l.includes("percent")?this.__renderHandlingFeePercentage():"","flat_percent_with_minimum"===l?this.__renderHandlingFeeMinimum():""),s?d:"",q.__itemDeliveryTypeOptions,"downloaded"===a?this.__renderDownloadDeliveryControls():"flat_rate"===a?this.__renderFlatRateControls():"shipped"===a?this.__renderShippingControls():"","shipped"===a||"flat_rate"===a?this.__renderCustomsValue():"",s?d:"",this.form.discount_name?this.__renderDiscountBuilder():"",s?d:"",i(null!==(t=this.emailTemplates)&&void 0!==t?t:void 0),this.form.send_admin_email?"":"col-span-2",(e=>{this.edit({send_admin_email:!!e.detail,admin_email:e.detail?this.form.admin_email:""})}),this.form.send_admin_email?this.__renderAdminEmail():"",i(null!==(n=this.emailTemplates)&&void 0!==n?n:void 0),(e=>this.edit({send_customer_email:!!e.detail})),i(null!==(r=this.emailTemplates)&&void 0!==r?r:void 0),s?d:"",this.data?this.__renderTaxes():"",super.renderBody())}__renderHandlingFee(){return o(f||(f=w` <foxy-internal-number-control infer="handling-fee" class="${0}"> </foxy-internal-number-control> `),"flat_percent"===this.form.handling_fee_type?"":"col-span-2")}__renderHandlingFeePercentage(){return o(u||(u=w` <foxy-internal-number-control infer="handling-fee-percentage"> </foxy-internal-number-control> `))}__renderHandlingFeeMinimum(){return o(h||(h=w` <foxy-internal-number-control infer="handling-fee-minimum"> </foxy-internal-number-control> `))}__renderDownloadDeliveryControls(){return o(y||(y=w` <foxy-internal-integer-control infer="max-downloads-per-customer"> </foxy-internal-integer-control> <foxy-internal-integer-control infer="max-downloads-time-period"> </foxy-internal-integer-control> `))}__renderFlatRateControls(){return o(g||(g=w` <foxy-internal-number-control infer="shipping-flat-rate"> </foxy-internal-number-control> <foxy-internal-select-control infer="shipping-flat-rate-type" .options="${0}"> </foxy-internal-select-control> `),q.__shippingFlatRateTypeOptions)}__renderShippingControls(){return o(x||(x=w` <foxy-internal-integer-control infer="default-weight" class="col-span-2"> </foxy-internal-integer-control> <foxy-internal-select-control infer="default-weight-unit" .options="${0}"> </foxy-internal-select-control> <foxy-internal-select-control infer="default-length-unit" .options="${0}"> </foxy-internal-select-control> `),q.__defaultWeightUnitOptions,q.__defaultLengthUnitOptions)}__renderCustomsValue(){return o(v||(v=w` <foxy-internal-number-control infer="customs-value" class="col-span-2"> </foxy-internal-number-control> `))}__renderDiscountBuilder(){var e,t;const n={name:null!==(e=this.form.discount_name)&&void 0!==e?e:"",type:this.form.discount_type||"quantity_amount",details:null!==(t=this.form.discount_details)&&void 0!==t?t:""};return o(b||(b=w` <foxy-discount-builder infer="discount-builder" class="col-span-2" .parsedValue="${0}" @change="${0}"> </foxy-discount-builder> `),n,(e=>{const t=e.currentTarget;this.edit({discount_name:t.parsedValue.name,discount_type:t.parsedValue.type,discount_details:t.parsedValue.details})}))}__renderAdminEmail(){return o(j||(j=w`<foxy-internal-text-control infer="admin-email"> </foxy-internal-text-control>`))}__renderTaxes(){var e;return o($||($=w` <foxy-internal-item-category-form-taxes-control taxes="${0}" class="col-span-2" infer="taxes"> </foxy-internal-item-category-form-taxes-control> `),i(null!==(e=this.taxes)&&void 0!==e?e:void 0))}}q.__shippingFlatRateTypeOptions=[{label:"option_per_order",value:"per_order"},{label:"option_per_shipment",value:"per_shipment"}],q.__defaultWeightUnitOptions=[{label:"option_lbs",value:"LBS"},{label:"option_kgs",value:"KGS"}],q.__defaultLengthUnitOptions=[{label:"option_in",value:"IN"},{label:"option_cm",value:"CM"}],q.__itemDeliveryTypeOptions=[{label:"option_notshipped",value:"notshipped"},{label:"option_downloaded",value:"downloaded"},{label:"option_flat_rate",value:"flat_rate"},{label:"option_shipped",value:"shipped"},{label:"option_pickup",value:"pickup"}],q.__handlingFeeTypeOptions=[{label:"option_none",value:"none"},{label:"option_flat_per_order",value:"flat_per_order"},{label:"option_flat_per_item",value:"flat_per_item"},{label:"option_flat_percent",value:"flat_percent"},{label:"option_flat_percent_with_minimum",value:"flat_percent_with_minimum"}],customElements.define("foxy-item-category-form",q);export{q as ItemCategoryForm};
|
|
1
|
+
import"./shared-c95c17e6.js";import"./shared-988ec916.js";import"./shared-d518bd55.js";import"./shared-cba08e1c.js";import"./shared-80fc2b6a.js";import{I as e}from"./shared-6581241a.js";import"./foxy-discount-builder.js";import{I as t}from"./shared-9bdacf65.js";import"./foxy-collection-page.js";import"./foxy-pagination.js";import"./shared-88c4cfec.js";import"./foxy-nucleon-element.js";import{TaxCard as n}from"./foxy-tax-card.js";import{_ as r}from"./shared-a8ced8bf.js";import{i}from"./shared-d3bf9ac0.js";import{h as o}from"./shared-7f33a83a.js";import{a}from"./shared-2cc638ad.js";import"./shared-6cb1015f.js";import"./shared-be66c2e7.js";import"./shared-0ce006b9.js";import"./shared-5ea18e60.js";import"./shared-08e27fe9.js";import"./shared-62c088b7.js";import"./shared-08156595.js";import"./shared-39c10b22.js";import"./shared-a85afa33.js";import"./shared-76b3d76a.js";import"./shared-bd252323.js";import"./shared-7d4fb1a2.js";import"./shared-0821cfdc.js";import"./shared-4f037e43.js";import"./shared-bc814810.js";import"./shared-8dd0af4d.js";import"./shared-62a54a6c.js";import"./shared-43bcce74.js";import"./shared-4e709717.js";import"./foxy-spinner.js";import"./shared-2092d86f.js";import"./shared-181f51bd.js";import"./shared-d6276c83.js";import"./shared-2f7dcefa.js";import"./shared-d519a301.js";import"./shared-e6f3e9f0.js";import"./shared-0479553e.js";import"./shared-11c2efc8.js";import"./shared-21679ebd.js";import"./shared-486d7bb5.js";let l,s=e=>e;customElements.define("foxy-internal-item-category-form-taxes-control-item",class extends n{constructor(){super(...arguments),this.taxItemCategories=null,this.itemCategory=null,this.__resourceElementIsBusy=!1,this.__queryElementData=null}static get properties(){return r(r({},super.properties),{},{taxItemCategories:{type:String,attribute:"tax-item-categories"},itemCategory:{type:String,attribute:"item-category"}})}render(){var e,t,n,r,a;const d=null===(n=null===(t=null===(e=this.__queryElementData)||void 0===e?void 0:e._embedded)||void 0===t?void 0:t["fx:tax_item_categories"])||void 0===n?void 0:n[0];let m;try{const e=new URL(null!==(r=this.taxItemCategories)&&void 0!==r?r:""),t=new URL(this.href).pathname.split("/").pop();if(!t)throw new Error;e.searchParams.set("tax_id",t),e.searchParams.set("limit","1"),m=e.toString()}catch(e){m=void 0}return o(l||(l=s` <foxy-nucleon href="${0}" id="query" @update="${0}"> <foxy-nucleon parent="${0}" href="${0}" id="resource" @update="${0}"> </foxy-nucleon> </foxy-nucleon> <vaadin-checkbox class="px-m py-s block overflow-hidden" ?disabled="${0}" ?checked="${0}" @change="${0}"> ${0} </vaadin-checkbox> `),i(m),(e=>{const t=e.currentTarget;this.__queryElementData=t.data,this.requestUpdate()}),i(null!==(a=this.taxItemCategories)&&void 0!==a?a:void 0),i(null==d?void 0:d._links.self.href),(e=>{const t=e.currentTarget;this.__resourceElementIsBusy=!t.in("idle"),this.requestUpdate()}),!this.__queryElementData||this.__resourceElementIsBusy||this.disabled,!!d,(e=>{const t=e.currentTarget,n=this.renderRoot.querySelector("#resource");t.checked?(n.edit({tax_uri:this.data._links.self.href,item_category_uri:this.itemCategory}),n.submit()):n.delete()}),super.render())}});let d,m=e=>e;customElements.define("foxy-internal-item-category-form-taxes-control",class extends t{constructor(){super(...arguments),this.taxes=null}static get properties(){return r(r({},super.properties),{},{taxes:{type:String}})}renderControl(){var e,t,n,r;const i=this.nucleon;let a;try{const t=new URL(null!==(e=this.taxes)&&void 0!==e?e:"");t.searchParams.set("limit","5"),a=t.toString()}catch(e){a=null!==(t=this.taxes)&&void 0!==t?t:""}return o(d||(d=m` <foxy-i18n class="block text-s font-medium text-secondary leading-none mb-s" infer="" key="title"> </foxy-i18n> <foxy-pagination first="${0}" infer="pagination"> <foxy-collection-page class="block mb-s divide-y divide-contrast-10 border border-contrast-10 rounded-t-l rounded-b-l" infer="" item="foxy-internal-item-category-form-taxes-control-item" .props="${0}"> </foxy-collection-page> </foxy-pagination> <foxy-i18n class="block text-xs text-secondary leading-xs mt-xs" infer="" key="helper_text"> </foxy-i18n> `),a,{"tax-item-categories":null!==(r=null===(n=null==i?void 0:i.form._links)||void 0===n?void 0:n["fx:tax_item_categories"].href)&&void 0!==r?r:"","item-category":null==i?void 0:i.href})}});let p,c,_,f,u,h,y,g,x,v,b,j,$,w=e=>e;class q extends(a(e,"item-category-form")){constructor(){super(...arguments),this.emailTemplates=null,this.taxes=null}static get properties(){return r(r({},super.properties),{},{emailTemplates:{type:String,attribute:"email-templates"},taxes:{type:String}})}static get v8n(){return[({code:e})=>!!e||"code:v8n_required",({code:e})=>e&&e.length<=50||"code:v8n_too_long",({name:e})=>!!e||"name:v8n_required",({name:e})=>e&&e.length<=50||"name:v8n_too_long",({item_delivery_type:e})=>!!e||"item-delivery-type:v8n_required",({item_delivery_type:e,max_downloads_per_customer:t})=>"downloaded"!==e||"number"==typeof t||"max-downloads-per-customer:v8n_required",({max_downloads_per_customer:e})=>"number"!=typeof e||e>=0||"max-downloads-per-customer:v8n_negative",({item_delivery_type:e,max_downloads_time_period:t})=>"downloaded"!==e||"number"==typeof t||"max-downloads-time-period:v8n_required",({max_downloads_time_period:e})=>"number"!=typeof e||e>=0||"max-downloads-time-period:v8n_negative",({customs_value:e})=>"number"!=typeof e||e>=0||"customs-value:v8n_negative",({item_delivery_type:e,default_weight:t})=>"shipped"!==e||"number"==typeof t||"default-weight:v8n_required",({default_weight:e})=>"number"!=typeof e||e>=0||"default-weight:v8n_negative",({item_delivery_type:e,default_weight_unit:t})=>"shipped"!==e||"string"==typeof t||"default-weight-unit:v8n_required",({item_delivery_type:e,default_length_unit:t})=>"shipped"!==e||"string"==typeof t||"default-length-unit:v8n_required",({item_delivery_type:e,shipping_flat_rate:t})=>"flat_rate"!==e||"number"==typeof t||"shipping-flat-rate:v8n_required",({shipping_flat_rate:e})=>"number"!=typeof e||e>=0||"shipping-flat-rate:v8n_negative",({item_delivery_type:e,shipping_flat_rate_type:t})=>"flat_rate"!==e||"string"==typeof t||"shipping-flat-rate-type:v8n_required",({handling_fee_type:e})=>!!e||"handling-fee-type:v8n_required",({handling_fee_type:e,handling_fee_minimum:t})=>"flat_percent_with_minimum"!==e||"number"==typeof t||"handling-fee-minimum:v8n_required",({handling_fee_minimum:e})=>"number"!=typeof e||e>=0||"handling-fee-minimum:v8n_negative",({handling_fee_type:e,handling_fee_percentage:t})=>"flat_percent_with_minimum"!==e&&"flat_percent"!==e||"number"==typeof t||"handling-fee-percentage:v8n_required",({handling_fee_percentage:e})=>"number"!=typeof e||e>=0||"handling-fee-percentage:v8n_negative",({send_admin_email:e,admin_email:t})=>!e||!!t||"admin-email:v8n_required"]}renderBody(){var e,t,n,r;const a=this.form.item_delivery_type,l=null!==(e=this.form.handling_fee_type)&&void 0!==e?e:"none",s=!this.hiddenSelector.matches("dividers",!0),d=o(p||(p=w`<div class="border-t border-contrast-10 col-span-2"></div>`));return o(c||(c=w` <div class="grid grid-cols-2 gap-m"> <foxy-internal-text-control infer="name" class="col-span-2"></foxy-internal-text-control> <foxy-internal-text-control infer="code" class="col-span-2"></foxy-internal-text-control> ${0} <foxy-internal-select-control infer="handling-fee-type" class="col-span-2" .options="${0}"> </foxy-internal-select-control> ${0} ${0} <foxy-internal-select-control infer="item-delivery-type" class="col-span-2" .options="${0}"> </foxy-internal-select-control> ${0} ${0} ${0} <foxy-internal-text-control infer="discount-name" class="col-span-2"> </foxy-internal-text-control> ${0} ${0} <foxy-internal-async-combo-box-control item-label-path="description" item-value-path="_links.self.href" first="${0}" infer="admin-email-template-uri" class="${0}" @change="${0}"> </foxy-internal-async-combo-box-control> ${0} <foxy-internal-async-combo-box-control item-label-path="description" item-value-path="_links.self.href" first="${0}" infer="customer-email-template-uri" class="col-span-2" @change="${0}"> </foxy-internal-async-combo-box-control> <foxy-internal-async-combo-box-control item-label-path="description" item-value-path="_links.self.href" first="${0}" infer="gift-recipient-email-template-uri" class="col-span-2"> </foxy-internal-async-combo-box-control> ${0} ${0} </div> ${0} `),s?d:"",q.__handlingFeeTypeOptions,"none"===l?"":o(_||(_=w` ${0} ${0} ${0} `),this.__renderHandlingFee(),l.includes("percent")?this.__renderHandlingFeePercentage():"","flat_percent_with_minimum"===l?this.__renderHandlingFeeMinimum():""),s?d:"",q.__itemDeliveryTypeOptions,"downloaded"===a?this.__renderDownloadDeliveryControls():"flat_rate"===a?this.__renderFlatRateControls():"shipped"===a?this.__renderShippingControls():"","shipped"===a||"flat_rate"===a?this.__renderCustomsValue():"",s?d:"",this.form.discount_name?this.__renderDiscountBuilder():"",s?d:"",i(null!==(t=this.emailTemplates)&&void 0!==t?t:void 0),this.form.send_admin_email?"":"col-span-2",(e=>{this.edit({send_admin_email:!!e.detail,admin_email:e.detail?this.form.admin_email:""})}),this.form.send_admin_email?this.__renderAdminEmail():"",i(null!==(n=this.emailTemplates)&&void 0!==n?n:void 0),(e=>this.edit({send_customer_email:!!e.detail})),i(null!==(r=this.emailTemplates)&&void 0!==r?r:void 0),s?d:"",this.data?this.__renderTaxes():"",super.renderBody())}__renderHandlingFee(){return o(f||(f=w` <foxy-internal-number-control infer="handling-fee" class="${0}"> </foxy-internal-number-control> `),"flat_percent"===this.form.handling_fee_type?"":"col-span-2")}__renderHandlingFeePercentage(){return o(u||(u=w` <foxy-internal-number-control infer="handling-fee-percentage"> </foxy-internal-number-control> `))}__renderHandlingFeeMinimum(){return o(h||(h=w` <foxy-internal-number-control infer="handling-fee-minimum"> </foxy-internal-number-control> `))}__renderDownloadDeliveryControls(){return o(y||(y=w` <foxy-internal-integer-control infer="max-downloads-per-customer"> </foxy-internal-integer-control> <foxy-internal-integer-control infer="max-downloads-time-period"> </foxy-internal-integer-control> `))}__renderFlatRateControls(){return o(g||(g=w` <foxy-internal-number-control infer="shipping-flat-rate"> </foxy-internal-number-control> <foxy-internal-select-control infer="shipping-flat-rate-type" .options="${0}"> </foxy-internal-select-control> `),q.__shippingFlatRateTypeOptions)}__renderShippingControls(){return o(x||(x=w` <foxy-internal-integer-control infer="default-weight" class="col-span-2"> </foxy-internal-integer-control> <foxy-internal-select-control infer="default-weight-unit" .options="${0}"> </foxy-internal-select-control> <foxy-internal-select-control infer="default-length-unit" .options="${0}"> </foxy-internal-select-control> `),q.__defaultWeightUnitOptions,q.__defaultLengthUnitOptions)}__renderCustomsValue(){return o(v||(v=w` <foxy-internal-number-control infer="customs-value" class="col-span-2"> </foxy-internal-number-control> `))}__renderDiscountBuilder(){var e,t;const n={name:null!==(e=this.form.discount_name)&&void 0!==e?e:"",type:this.form.discount_type||"quantity_amount",details:null!==(t=this.form.discount_details)&&void 0!==t?t:""};return o(b||(b=w` <foxy-discount-builder infer="discount-builder" class="col-span-2" .parsedValue="${0}" @change="${0}"> </foxy-discount-builder> `),n,(e=>{const t=e.currentTarget;this.edit({discount_name:t.parsedValue.name,discount_type:t.parsedValue.type,discount_details:t.parsedValue.details})}))}__renderAdminEmail(){return o(j||(j=w`<foxy-internal-text-control infer="admin-email"> </foxy-internal-text-control>`))}__renderTaxes(){var e;return o($||($=w` <foxy-internal-item-category-form-taxes-control taxes="${0}" class="col-span-2" infer="taxes"> </foxy-internal-item-category-form-taxes-control> `),i(null!==(e=this.taxes)&&void 0!==e?e:void 0))}}q.__shippingFlatRateTypeOptions=[{label:"option_per_order",value:"per_order"},{label:"option_per_shipment",value:"per_shipment"}],q.__defaultWeightUnitOptions=[{label:"option_lbs",value:"LBS"},{label:"option_kgs",value:"KGS"}],q.__defaultLengthUnitOptions=[{label:"option_in",value:"IN"},{label:"option_cm",value:"CM"}],q.__itemDeliveryTypeOptions=[{label:"option_notshipped",value:"notshipped"},{label:"option_downloaded",value:"downloaded"},{label:"option_flat_rate",value:"flat_rate"},{label:"option_shipped",value:"shipped"},{label:"option_pickup",value:"pickup"}],q.__handlingFeeTypeOptions=[{label:"option_none",value:"none"},{label:"option_flat_per_order",value:"flat_per_order"},{label:"option_flat_per_item",value:"flat_per_item"},{label:"option_flat_percent",value:"flat_percent"},{label:"option_flat_percent_with_minimum",value:"flat_percent_with_minimum"}],customElements.define("foxy-item-category-form",q);export{q as ItemCategoryForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-776f948d.js";import"./shared-1351c1e3.js";import"./shared-7fb8ecc5.js";import"./shared-5ada1ccb.js";import{I as t}from"./shared-21689ac0.js";import"./foxy-discount-detail-card.js";import"./foxy-coupon-detail-card.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-coupon-card.js";import"./shared-e94165e9.js";import{I as e}from"./shared-0d4f9b06.js";import"./foxy-discount-builder.js";import{i as r}from"./shared-d3bf9ac0.js";import{h as o}from"./shared-7f33a83a.js";import"./shared-6cc53630.js";import"./shared-ea6c8bae.js";import{_ as i}from"./shared-a8ced8bf.js";import{s as n}from"./shared-bc7f58ef.js";import{p as s}from"./shared-2f9b7791.js";import"./foxy-subscription-card.js";import"./foxy-subscription-form.js";import"./foxy-form-dialog.js";import{a}from"./shared-1e94e6dd.js";import"./shared-88c7755d.js";import"./shared-5b3ae513.js";import"./shared-68e0cf30.js";import"./shared-869df7ed.js";import"./shared-39b184de.js";import"./shared-a343ec6b.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-2f6e33b6.js";import"./shared-3ca1e8e4.js";import"./shared-888d690a.js";import"./shared-76b3d76a.js";import"./shared-4f037e43.js";import"./shared-43bcce74.js";import"./shared-181f51bd.js";import"./shared-a85afa33.js";import"./shared-d6276c83.js";import"./shared-2f7dcefa.js";import"./shared-d519a301.js";import"./shared-11c2efc8.js";import"./foxy-pagination.js";import"./shared-b48e5aaf.js";import"./shared-4e709717.js";import"./shared-c379590f.js";import"./shared-0479553e.js";import"./shared-cf784db1.js";import"./shared-ae588315.js";import"./shared-79d6a262.js";import"./foxy-nucleon-element.js";import"./shared-1db07286.js";import"./shared-a90a5235.js";import"./shared-7d658c02.js";import"./shared-17c1eab2.js";import"./shared-df462496.js";import"./shared-23bf6ee6.js";import"./shared-d384d6a3.js";import"./shared-e99fa3d6.js";import"./shared-d4a652b7.js";import"./shared-413415b0.js";import"./shared-e6f3e9f0.js";import"./shared-004f1a77.js";import"./shared-11ffd643.js";import"./foxy-swipe-actions.js";import"./foxy-cancellation-form.js";import"./foxy-transaction-card.js";import"./foxy-item-card.js";import"./shared-b7636a23.js";import"./shared-ea67b3f3.js";import"./shared-75e78c70.js";let l,c=t=>t;customElements.define("foxy-internal-item-form-line-item-discount-control",class extends e{constructor(){super(...arguments),this.infer="line-item-discount"}renderControl(){var t,e,i,n,s;return o(l||(l=c` <foxy-internal-details summary="title" infer=""> <div class="space-y-m p-m"> <foxy-internal-async-combo-box-control item-value-path="_links.self.href" item-label-path="name" first="${0}" infer="coupon" @change="${0}"> </foxy-internal-async-combo-box-control> <foxy-internal-text-control infer="discount-name"></foxy-internal-text-control> <foxy-discount-builder infer="discount-builder" .parsedValue="${0}" @change="${0}"> </foxy-discount-builder> </div> </foxy-internal-details> `),r(null!==(e=null===(t=this.nucleon)||void 0===t?void 0:t.coupons)&&void 0!==e?e:void 0),(t=>{var e;t.preventDefault();const r=t.detail;null===(e=this.nucleon)||void 0===e||e.edit({discount_name:r.name,discount_type:r.coupon_discount_type,discount_details:r.coupon_discount_details})}),{type:null===(i=this.nucleon)||void 0===i?void 0:i.form.discount_type,name:null===(n=this.nucleon)||void 0===n?void 0:n.form.discount_name,details:null===(s=this.nucleon)||void 0===s?void 0:s.form.discount_details},(t=>{var e;const r=t.currentTarget.parsedValue;null===(e=this.nucleon)||void 0===e||e.edit({discount_name:r.name,discount_type:r.type,discount_details:r.details})}))}});let d,f=t=>t;customElements.define("foxy-internal-date-control",class extends e{constructor(){super(...arguments),this.format=null}static get properties(){return i(i({},super.properties),{},{format:{type:String}})}renderControl(){var t;let e;return e="unix"===this.format?n(new Date(1e3*(null!==(t=this._value)&&void 0!==t?t:0))):this._value,o(d||(d=f` <vaadin-date-picker error-message="${0}" placeholder="${0}" helper-text="${0}" label="${0}" class="w-full" ?disabled="${0}" ?readonly="${0}" .checkValidity="${0}" .value="${0}" @keydown="${0}" @change="${0}"> </vaadin-date-picker> `),r(this._errorMessage),this.placeholder,this.helperText,this.label,this.disabled,this.readonly,this._checkValidity,e,(t=>{var e;return"Enter"===t.key&&(null===(e=this.nucleon)||void 0===e?void 0:e.submit())}),(t=>{var e,r;const o=t.currentTarget;"unix"===this.format?this._value=Math.floor((null!==(r=null===(e=s(o.value))||void 0===e?void 0:e.getTime())&&void 0!==r?r:0)/1e3):this._value=o.value}))}});let m,p,u,y=t=>t;customElements.define("foxy-internal-item-form-subscription-control",class extends e{constructor(){super(...arguments),this.infer="subscription"}renderControl(){var t,e,r,i,n;let s;try{const o=null!==(i=null===(r=(null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links)["fx:subscription"])||void 0===r?void 0:r.href)&&void 0!==i?i:"",n=new URL(o);n.searchParams.set("zoom","last_transaction,transaction_template:items"),s=n.toString()}catch(t){s=null}return o(m||(m=y` <foxy-internal-details summary="title" infer=""> ${0} </foxy-internal-details> `),s?o(p||(p=y` <foxy-form-dialog header="update" infer="form" href="${0}" form="foxy-subscription-form" .related="${0}"> </foxy-form-dialog> <button ?disabled="${0}" @click="${0}"> <foxy-subscription-card class="p-m" infer="card" href="${0}"> </foxy-subscription-card> </button> `),s,(null===(n=this.nucleon)||void 0===n?void 0:n.href)?[this.nucleon.href]:[],this.disabled,(t=>{const e=t.currentTarget;e.previousElementSibling.show(e)}),s):o(u||(u=y` <div class="space-y-m p-m"> <foxy-internal-frequency-control infer="frequency" property="subscription_frequency"> </foxy-internal-frequency-control> <foxy-internal-date-control infer="start" property="subscription_start_date"> </foxy-internal-date-control> <foxy-internal-date-control infer="end" property="subscription_end_date"> </foxy-internal-date-control> <foxy-internal-date-control infer="next" property="subscription_next_transaction_date"> </foxy-internal-date-control> </div> `)))}});let h,x=t=>t;customElements.define("foxy-internal-item-form-inventory-control",class extends e{constructor(){super(...arguments),this.infer="inventory"}renderControl(){var t,e;return o(h||(h=x` <foxy-internal-details summary="title" infer=""> <div class="grid grid-cols-2 gap-m p-m"> <foxy-internal-async-combo-box-control item-value-path="_links.self.href" item-label-path="name" property="item_category_uri" first="${0}" class="col-span-2" infer="category"> </foxy-internal-async-combo-box-control> <foxy-internal-text-control infer="code"></foxy-internal-text-control> <foxy-internal-text-control infer="parent-code"></foxy-internal-text-control> </div> </foxy-internal-details> `),r(null!==(e=null===(t=this.nucleon)||void 0===t?void 0:t.itemCategories)&&void 0!==e?e:void 0))}});let v,_=t=>t;customElements.define("foxy-internal-item-form-shipping-control",class extends e{constructor(){super(...arguments),this.infer="shipping"}renderControl(){var t,e;return o(v||(v=_` <foxy-internal-details summary="title" infer=""> <div class="grid grid-cols-2 gap-m p-m"> <foxy-internal-async-combo-box-control item-value-path="address_name" item-label-path="address_name" first="${0}" class="col-span-2" infer="shipto"> </foxy-internal-async-combo-box-control> <foxy-internal-integer-control infer="width"></foxy-internal-integer-control> <foxy-internal-integer-control infer="height"></foxy-internal-integer-control> <foxy-internal-integer-control infer="length"></foxy-internal-integer-control> <foxy-internal-integer-control infer="weight"></foxy-internal-integer-control> </div> </foxy-internal-details> `),r(null!==(e=null===(t=this.nucleon)||void 0===t?void 0:t.customerAddresses)&&void 0!==e?e:void 0))}});let b,j=t=>t;customElements.define("foxy-internal-item-form-cart-control",class extends e{constructor(){super(...arguments),this.infer="cart"}renderControl(){return o(b||(b=j` <foxy-internal-details summary="title" infer=""> <div class="grid grid-cols-2 gap-m p-m"> <foxy-internal-date-control class="col-span-2" infer="expires" format="unix"> </foxy-internal-date-control> <foxy-internal-text-control class="col-span-2" infer="url"></foxy-internal-text-control> <foxy-internal-text-control class="col-span-2" infer="image"></foxy-internal-text-control> <foxy-internal-integer-control infer="quantity-min"></foxy-internal-integer-control> <foxy-internal-integer-control infer="quantity-max"></foxy-internal-integer-control> </div> </foxy-internal-details> `))}});let g,$,k,w=t=>t;class C extends(a(t,"item-form")){constructor(){super(...arguments),this.customerAddresses=null,this.itemCategories=null,this.localeCodes=null,this.coupons=null,this.__itemsLink=""}static get properties(){return i(i({},super.properties),{},{customerAddresses:{type:String,attribute:"customer-addresses"},itemCategories:{type:String,attribute:"item-categories"},localeCodes:{attribute:"locale-codes"},coupons:{type:String}})}static get v8n(){return[({name:t})=>!!t||"name:v8n_required",({name:t})=>!!t&&t.length<=255||"name:v8n_too_long",({price:t})=>"number"==typeof t&&!isNaN(t)||"price:v8n_required",({price:t})=>"number"==typeof t&&t>=0||"price:v8n_negative",({quantity:t})=>"number"==typeof t&&t>=1||"quantity:v8n_less_than_one"]}renderBody(){return o($||($=w` <foxy-internal-text-control infer="name"></foxy-internal-text-control> <div class="grid grid-cols-2 gap-m"> <foxy-internal-number-control infer="price"></foxy-internal-number-control> <foxy-internal-integer-control infer="quantity"></foxy-internal-integer-control> </div> <foxy-internal-item-form-subscription-control></foxy-internal-item-form-subscription-control> <foxy-internal-item-form-line-item-discount-control></foxy-internal-item-form-line-item-discount-control> <foxy-internal-item-form-cart-control></foxy-internal-item-form-cart-control> <foxy-internal-item-form-shipping-control></foxy-internal-item-form-shipping-control> <foxy-internal-item-form-inventory-control></foxy-internal-item-form-inventory-control> ${0} ${0} `),this.data?o(k||(k=w` <foxy-internal-async-details-control infer="discount-details" first="${0}" limit="5" item="foxy-discount-detail-card"> </foxy-internal-async-details-control> <foxy-internal-async-details-control infer="coupon-details" first="${0}" limit="5" item="foxy-coupon-detail-card"> </foxy-internal-async-details-control> <foxy-internal-async-details-control infer="attributes" first="${0}" limit="5" item="foxy-attribute-card" form="foxy-attribute-form"> </foxy-internal-async-details-control> <foxy-internal-async-details-control infer="item-options" first="${0}" limit="5" form="foxy-item-option-form" .item="${0}" .related="${0}"> </foxy-internal-async-details-control> `),this.data._links["fx:discount_details"].href,this.data._links["fx:coupon_details"].href,this.data._links["fx:attributes"].href,this.data._links["fx:item_options"].href,(t=>{var e;return o(g||(g=w` <foxy-item-option-card locale-codes="${0}" parent="${0}" class="p-m" infer="" href="${0}" .related="${0}"> </foxy-item-option-card> `),r(null!==(e=this.localeCodes)&&void 0!==e?e:void 0),t.parent,t.href,t.related)}),this.__itemOptionRelatedUrls):"",super.renderBody())}async _sendGet(){const t=await super._sendGet();if("fx:subscription"in t._links){const e=t._links["fx:subscription"].href,r=(await super._fetch(e))._links["fx:transaction_template"].href,o=await super._fetch(r);return this.__itemsLink=o._links["fx:items"].href,t}if("fx:transaction"in t._links){const e=await super._fetch(t._links["fx:transaction"].href);return this.__itemsLink=e._links["fx:items"].href,t}if("fx:cart"in t._links){const e=await super._fetch(t._links["fx:cart"].href);return this.__itemsLink=e._links["fx:items"].href,t}return t}get __itemOptionRelatedUrls(){var t,e;const r=null!==(e=null===(t=this.data)||void 0===t?void 0:t._links)&&void 0!==e?e:{},o=[];return r["fx:subscription"]&&o.push(r["fx:subscription"].href),r["fx:transaction"]&&o.push(r["fx:transaction"].href),r["fx:shipment"]&&o.push(r["fx:shipment"].href),r["fx:cart"]&&o.push(r["fx:cart"].href),this.__itemsLink&&o.push(this.__itemsLink),o}}customElements.define("foxy-item-form",C);export{C as ItemForm};
|
|
1
|
+
import"./shared-988ec916.js";import"./shared-a0c8faf2.js";import"./shared-d518bd55.js";import"./shared-80fc2b6a.js";import{I as t}from"./shared-6581241a.js";import"./foxy-discount-detail-card.js";import"./foxy-coupon-detail-card.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-coupon-card.js";import"./shared-c95c17e6.js";import{I as e}from"./shared-39c10b22.js";import"./foxy-discount-builder.js";import{i as r}from"./shared-d3bf9ac0.js";import{h as o}from"./shared-7f33a83a.js";import"./shared-af226a9a.js";import"./shared-a41234b4.js";import{_ as i}from"./shared-a8ced8bf.js";import{s as n}from"./shared-bc7f58ef.js";import{p as s}from"./shared-f7e4cd67.js";import"./foxy-subscription-card.js";import"./foxy-subscription-form.js";import"./foxy-form-dialog.js";import{a}from"./shared-2cc638ad.js";import"./shared-bd252323.js";import"./shared-5ea18e60.js";import"./shared-0ce006b9.js";import"./shared-be66c2e7.js";import"./shared-08156595.js";import"./shared-7d4fb1a2.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-62c088b7.js";import"./shared-2092d86f.js";import"./shared-0821cfdc.js";import"./shared-76b3d76a.js";import"./shared-4f037e43.js";import"./shared-43bcce74.js";import"./shared-181f51bd.js";import"./shared-a85afa33.js";import"./shared-d6276c83.js";import"./shared-2f7dcefa.js";import"./shared-d519a301.js";import"./shared-11c2efc8.js";import"./foxy-pagination.js";import"./shared-bc814810.js";import"./shared-4e709717.js";import"./shared-9bdacf65.js";import"./shared-0479553e.js";import"./shared-8dd0af4d.js";import"./shared-62a54a6c.js";import"./shared-868065de.js";import"./shared-486d7bb5.js";import"./foxy-nucleon-element.js";import"./shared-ed0dee03.js";import"./shared-5a4829e3.js";import"./shared-1c94a156.js";import"./shared-4849ef5b.js";import"./shared-6cb1015f.js";import"./shared-08e27fe9.js";import"./shared-101d1234.js";import"./shared-404aa9cc.js";import"./shared-d8dc97f0.js";import"./shared-5378bd8c.js";import"./shared-e6f3e9f0.js";import"./shared-d61b3e4f.js";import"./shared-1000b848.js";import"./foxy-swipe-actions.js";import"./foxy-cancellation-form.js";import"./foxy-transaction-card.js";import"./foxy-item-card.js";import"./shared-21679ebd.js";import"./shared-ea67b3f3.js";import"./shared-75e78c70.js";let l,c=t=>t;customElements.define("foxy-internal-item-form-line-item-discount-control",class extends e{constructor(){super(...arguments),this.infer="line-item-discount"}renderControl(){var t,e,i,n,s;return o(l||(l=c` <foxy-internal-details summary="title" infer=""> <div class="space-y-m p-m"> <foxy-internal-async-combo-box-control item-value-path="_links.self.href" item-label-path="name" first="${0}" infer="coupon" @change="${0}"> </foxy-internal-async-combo-box-control> <foxy-internal-text-control infer="discount-name"></foxy-internal-text-control> <foxy-discount-builder infer="discount-builder" .parsedValue="${0}" @change="${0}"> </foxy-discount-builder> </div> </foxy-internal-details> `),r(null!==(e=null===(t=this.nucleon)||void 0===t?void 0:t.coupons)&&void 0!==e?e:void 0),(t=>{var e;t.preventDefault();const r=t.detail;null===(e=this.nucleon)||void 0===e||e.edit({discount_name:r.name,discount_type:r.coupon_discount_type,discount_details:r.coupon_discount_details})}),{type:null===(i=this.nucleon)||void 0===i?void 0:i.form.discount_type,name:null===(n=this.nucleon)||void 0===n?void 0:n.form.discount_name,details:null===(s=this.nucleon)||void 0===s?void 0:s.form.discount_details},(t=>{var e;const r=t.currentTarget.parsedValue;null===(e=this.nucleon)||void 0===e||e.edit({discount_name:r.name,discount_type:r.type,discount_details:r.details})}))}});let d,f=t=>t;customElements.define("foxy-internal-date-control",class extends e{constructor(){super(...arguments),this.format=null}static get properties(){return i(i({},super.properties),{},{format:{type:String}})}renderControl(){var t;let e;return e="unix"===this.format?n(new Date(1e3*(null!==(t=this._value)&&void 0!==t?t:0))):this._value,o(d||(d=f` <vaadin-date-picker error-message="${0}" placeholder="${0}" helper-text="${0}" label="${0}" class="w-full" ?disabled="${0}" ?readonly="${0}" .checkValidity="${0}" .value="${0}" @keydown="${0}" @change="${0}"> </vaadin-date-picker> `),r(this._errorMessage),this.placeholder,this.helperText,this.label,this.disabled,this.readonly,this._checkValidity,e,(t=>{var e;return"Enter"===t.key&&(null===(e=this.nucleon)||void 0===e?void 0:e.submit())}),(t=>{var e,r;const o=t.currentTarget;"unix"===this.format?this._value=Math.floor((null!==(r=null===(e=s(o.value))||void 0===e?void 0:e.getTime())&&void 0!==r?r:0)/1e3):this._value=o.value}))}});let m,p,u,y=t=>t;customElements.define("foxy-internal-item-form-subscription-control",class extends e{constructor(){super(...arguments),this.infer="subscription"}renderControl(){var t,e,r,i,n;let s;try{const o=null!==(i=null===(r=(null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links)["fx:subscription"])||void 0===r?void 0:r.href)&&void 0!==i?i:"",n=new URL(o);n.searchParams.set("zoom","last_transaction,transaction_template:items"),s=n.toString()}catch(t){s=null}return o(m||(m=y` <foxy-internal-details summary="title" infer=""> ${0} </foxy-internal-details> `),s?o(p||(p=y` <foxy-form-dialog header="update" infer="form" href="${0}" form="foxy-subscription-form" .related="${0}"> </foxy-form-dialog> <button ?disabled="${0}" @click="${0}"> <foxy-subscription-card class="p-m" infer="card" href="${0}"> </foxy-subscription-card> </button> `),s,(null===(n=this.nucleon)||void 0===n?void 0:n.href)?[this.nucleon.href]:[],this.disabled,(t=>{const e=t.currentTarget;e.previousElementSibling.show(e)}),s):o(u||(u=y` <div class="space-y-m p-m"> <foxy-internal-frequency-control infer="frequency" property="subscription_frequency"> </foxy-internal-frequency-control> <foxy-internal-date-control infer="start" property="subscription_start_date"> </foxy-internal-date-control> <foxy-internal-date-control infer="end" property="subscription_end_date"> </foxy-internal-date-control> <foxy-internal-date-control infer="next" property="subscription_next_transaction_date"> </foxy-internal-date-control> </div> `)))}});let h,x=t=>t;customElements.define("foxy-internal-item-form-inventory-control",class extends e{constructor(){super(...arguments),this.infer="inventory"}renderControl(){var t,e;return o(h||(h=x` <foxy-internal-details summary="title" infer=""> <div class="grid grid-cols-2 gap-m p-m"> <foxy-internal-async-combo-box-control item-value-path="_links.self.href" item-label-path="name" property="item_category_uri" first="${0}" class="col-span-2" infer="category"> </foxy-internal-async-combo-box-control> <foxy-internal-text-control infer="code"></foxy-internal-text-control> <foxy-internal-text-control infer="parent-code"></foxy-internal-text-control> </div> </foxy-internal-details> `),r(null!==(e=null===(t=this.nucleon)||void 0===t?void 0:t.itemCategories)&&void 0!==e?e:void 0))}});let v,b=t=>t;customElements.define("foxy-internal-item-form-shipping-control",class extends e{constructor(){super(...arguments),this.infer="shipping"}renderControl(){var t,e;return o(v||(v=b` <foxy-internal-details summary="title" infer=""> <div class="grid grid-cols-2 gap-m p-m"> <foxy-internal-async-combo-box-control item-value-path="address_name" item-label-path="address_name" first="${0}" class="col-span-2" infer="shipto"> </foxy-internal-async-combo-box-control> <foxy-internal-integer-control infer="width"></foxy-internal-integer-control> <foxy-internal-integer-control infer="height"></foxy-internal-integer-control> <foxy-internal-integer-control infer="length"></foxy-internal-integer-control> <foxy-internal-integer-control infer="weight"></foxy-internal-integer-control> </div> </foxy-internal-details> `),r(null!==(e=null===(t=this.nucleon)||void 0===t?void 0:t.customerAddresses)&&void 0!==e?e:void 0))}});let _,j=t=>t;customElements.define("foxy-internal-item-form-cart-control",class extends e{constructor(){super(...arguments),this.infer="cart"}renderControl(){return o(_||(_=j` <foxy-internal-details summary="title" infer=""> <div class="grid grid-cols-2 gap-m p-m"> <foxy-internal-date-control class="col-span-2" infer="expires" format="unix"> </foxy-internal-date-control> <foxy-internal-text-control class="col-span-2" infer="url"></foxy-internal-text-control> <foxy-internal-text-control class="col-span-2" infer="image"></foxy-internal-text-control> <foxy-internal-integer-control infer="quantity-min"></foxy-internal-integer-control> <foxy-internal-integer-control infer="quantity-max"></foxy-internal-integer-control> </div> </foxy-internal-details> `))}});let g,$,k,w=t=>t;class C extends(a(t,"item-form")){constructor(){super(...arguments),this.customerAddresses=null,this.itemCategories=null,this.localeCodes=null,this.coupons=null,this.__itemsLink=""}static get properties(){return i(i({},super.properties),{},{customerAddresses:{type:String,attribute:"customer-addresses"},itemCategories:{type:String,attribute:"item-categories"},localeCodes:{attribute:"locale-codes"},coupons:{type:String}})}static get v8n(){return[({name:t})=>!!t||"name:v8n_required",({name:t})=>!!t&&t.length<=255||"name:v8n_too_long",({price:t})=>"number"==typeof t&&!isNaN(t)||"price:v8n_required",({price:t})=>"number"==typeof t&&t>=0||"price:v8n_negative",({quantity:t})=>"number"==typeof t&&t>=1||"quantity:v8n_less_than_one"]}renderBody(){return o($||($=w` <foxy-internal-text-control infer="name"></foxy-internal-text-control> <div class="grid grid-cols-2 gap-m"> <foxy-internal-number-control infer="price"></foxy-internal-number-control> <foxy-internal-integer-control infer="quantity"></foxy-internal-integer-control> </div> <foxy-internal-item-form-subscription-control></foxy-internal-item-form-subscription-control> <foxy-internal-item-form-line-item-discount-control></foxy-internal-item-form-line-item-discount-control> <foxy-internal-item-form-cart-control></foxy-internal-item-form-cart-control> <foxy-internal-item-form-shipping-control></foxy-internal-item-form-shipping-control> <foxy-internal-item-form-inventory-control></foxy-internal-item-form-inventory-control> ${0} ${0} `),this.data?o(k||(k=w` <foxy-internal-async-details-control infer="discount-details" first="${0}" limit="5" item="foxy-discount-detail-card"> </foxy-internal-async-details-control> <foxy-internal-async-details-control infer="coupon-details" first="${0}" limit="5" item="foxy-coupon-detail-card"> </foxy-internal-async-details-control> <foxy-internal-async-details-control infer="attributes" first="${0}" limit="5" item="foxy-attribute-card" form="foxy-attribute-form"> </foxy-internal-async-details-control> <foxy-internal-async-details-control infer="item-options" first="${0}" limit="5" form="foxy-item-option-form" .item="${0}" .related="${0}"> </foxy-internal-async-details-control> `),this.data._links["fx:discount_details"].href,this.data._links["fx:coupon_details"].href,this.data._links["fx:attributes"].href,this.data._links["fx:item_options"].href,(t=>{var e;return o(g||(g=w` <foxy-item-option-card locale-codes="${0}" parent="${0}" class="p-m" infer="" href="${0}" .related="${0}"> </foxy-item-option-card> `),r(null!==(e=this.localeCodes)&&void 0!==e?e:void 0),t.parent,t.href,t.related)}),this.__itemOptionRelatedUrls):"",super.renderBody())}async _sendGet(){const t=await super._sendGet();if("fx:subscription"in t._links){const e=t._links["fx:subscription"].href,r=(await super._fetch(e))._links["fx:transaction_template"].href,o=await super._fetch(r);return this.__itemsLink=o._links["fx:items"].href,t}if("fx:transaction"in t._links){const e=await super._fetch(t._links["fx:transaction"].href);return this.__itemsLink=e._links["fx:items"].href,t}if("fx:cart"in t._links){const e=await super._fetch(t._links["fx:cart"].href);return this.__itemsLink=e._links["fx:items"].href,t}return t}get __itemOptionRelatedUrls(){var t,e;const r=null!==(e=null===(t=this.data)||void 0===t?void 0:t._links)&&void 0!==e?e:{},o=[];return r["fx:subscription"]&&o.push(r["fx:subscription"].href),r["fx:transaction"]&&o.push(r["fx:transaction"].href),r["fx:shipment"]&&o.push(r["fx:shipment"].href),r["fx:cart"]&&o.push(r["fx:cart"].href),this.__itemsLink&&o.push(this.__itemsLink),o}}customElements.define("foxy-item-form",C);export{C as ItemForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-2092d86f.js";import"./shared-62c088b7.js";import"./shared-0479553e.js";import"./foxy-nucleon-element.js";import"./foxy-spinner.js";import{_ as e}from"./shared-a8ced8bf.js";import{a as t}from"./shared-2cc638ad.js";import{T as r}from"./shared-868065de.js";import{i as o}from"./shared-d3bf9ac0.js";import{h as a}from"./shared-7f33a83a.js";import"./shared-0ce006b9.js";import"./shared-181f51bd.js";import"./shared-76b3d76a.js";import"./shared-a85afa33.js";import"./shared-d6276c83.js";import"./shared-4f037e43.js";import"./shared-2f7dcefa.js";import"./shared-0821cfdc.js";import"./shared-43bcce74.js";import"./shared-486d7bb5.js";import"./shared-4e709717.js";let d,i,l,s,n=e=>e;const c=t(r,"item-option-card");class u extends c{constructor(){super(...arguments),this.localeCodes=null,this.__transactionTemplateLoaderId="transactionTemplateLoader",this.__defaultTemplateSetLoaderId="defaultTemplateSetLoader",this.__localeCodesHelperLoaderId="localeCodesLoader",this.__transactionLoaderId="transactionLoader",this.__templateSetLoaderId="templateSetLoader",this.__storeLoaderId="storeLoader",this.__cartLoaderId="cartLoader"}static get properties(){return e(e({},super.properties),{},{localeCodes:{type:String,attribute:"locale-codes"}})}renderBody(){var e,t,r,c,u,_;const h=(null===(e=this.__store)||void 0===e?void 0:e.use_international_currency_symbol)?"code":"symbol",p=this.__transaction;let f=null;if(p)f=p.currency_code;else{const e=null!==(t=this.__cart)&&void 0!==t?t:this.__transactionTemplate;if(e&&"currency_code"in e)f=e.currency_code;else{const e=this.__localeCodesHelper,t=null===(c=null!==(r=this.__templateSet)&&void 0!==r?r:this.__defaultTemplateSet)||void 0===c?void 0:c.locale_code,o=t?null==e?void 0:e.values[t]:void 0;o&&(f=null!==(_=null===(u=/Currency: ([A-Z]{3})/g.exec(o))||void 0===u?void 0:u[1])&&void 0!==_?_:null)}}return a(d||(d=n` <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> ${0} `),o(this.__transactionTemplateHref),this.__transactionTemplateLoaderId,(()=>this.requestUpdate()),o(this.__defaultTemplateSetHref),this.__defaultTemplateSetLoaderId,(()=>this.requestUpdate()),o(this.__localeCodesHelperHref),this.__localeCodesHelperLoaderId,(()=>this.requestUpdate()),o(this.__transactionHref),this.__transactionLoaderId,(()=>this.requestUpdate()),o(this.__templateSetHref),this.__templateSetLoaderId,(()=>this.requestUpdate()),o(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()),o(this.__cartHref),this.__cartLoaderId,(()=>this.requestUpdate()),super.renderBody({title:e=>{if(!f||!h)return a(i||(i=n`​`));let t;try{t=Math.abs(e.price_mod).toLocaleString(this.lang||"en",{maximumFractionDigits:2,minimumFractionDigits:2,currencyDisplay:h,currency:f,style:"currency"})}catch(e){t="--"}return a(l||(l=n`${0} • ${0} • ${0}`),e.name,t,e.weight_mod)},subtitle:e=>a(s||(s=n`${0}`),e.value)}))}get __transactionTemplateHref(){var e,t,r;try{const o=null===(e=this.data)||void 0===e?void 0:e._links,a=new URL(null!==(r=null===(t=null==o?void 0:o["fx:subscription"])||void 0===t?void 0:t.href)&&void 0!==r?r:"");return a.searchParams.set("zoom","transaction_template"),a.toString()}catch(e){}}get __defaultTemplateSetHref(){var e,t,r,o;if(""===(null===(t=null!==(e=this.__cart)&&void 0!==e?e:this.__transactionTemplate)||void 0===t?void 0:t.template_set_uri))try{const e=new URL(null!==(o=null===(r=this.__store)||void 0===r?void 0:r._links["fx:template_sets"].href)&&void 0!==o?o:"");return e.searchParams.set("code","DEFAULT"),e.toString()}catch(e){}}get __localeCodesHelperHref(){var e;if(this.__defaultTemplateSetHref||this.__templateSetHref)return null!==(e=this.localeCodes)&&void 0!==e?e:void 0}get __transactionHref(){var e,t;return null===(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:transaction"])||void 0===t?void 0:t.href}get __templateSetHref(){var e;const t=null!==(e=this.__cart)&&void 0!==e?e:this.__transactionTemplate;if(!(null==t?void 0:t.currency_code))return(null==t?void 0:t.template_set_uri)||void 0}get __storeHref(){var e,t;return null===(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:store"])||void 0===t?void 0:t.href}get __cartHref(){var e,t;const r=null===(e=this.data)||void 0===e?void 0:e._links;return null===(t=null==r?void 0:r["fx:cart"])||void 0===t?void 0:t.href}get __transactionTemplate(){var e,t;const r=`#${this.__transactionTemplateLoaderId}`,o=this.renderRoot.querySelector(r);return null!==(t=null===(e=null==o?void 0:o.data)||void 0===e?void 0:e._embedded["fx:transaction_template"])&&void 0!==t?t:null}get __defaultTemplateSet(){var e,t;const r=`#${this.__defaultTemplateSetLoaderId}`,o=this.renderRoot.querySelector(r);return null!==(t=null===(e=null==o?void 0:o.data)||void 0===e?void 0:e._embedded["fx:template_sets"][0])&&void 0!==t?t:null}get __localeCodesHelper(){var e,t;const r=`#${this.__localeCodesHelperLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(r))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __transaction(){var e,t;const r=`#${this.__transactionLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(r))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __templateSet(){var e,t;const r=`#${this.__templateSetLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(r))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __store(){var e,t;const r=`#${this.__storeLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(r))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __cart(){var e,t;const r=`#${this.__cartLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(r))||void 0===e?void 0:e.data)&&void 0!==t?t:null}}customElements.define("foxy-item-option-card",u);export{u as ItemOptionCard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-d518bd55.js";import"./shared-80fc2b6a.js";import{I as r}from"./shared-6581241a.js";import{a as e}from"./shared-2cc638ad.js";import{h as o}from"./shared-7f33a83a.js";import"./shared-bd252323.js";import"./shared-5ea18e60.js";import"./shared-0ce006b9.js";import"./shared-be66c2e7.js";import"./shared-08156595.js";import"./shared-39c10b22.js";import"./shared-9bdacf65.js";import"./shared-0479553e.js";import"./shared-0821cfdc.js";import"./shared-a8ced8bf.js";import"./shared-76b3d76a.js";import"./shared-4f037e43.js";import"./shared-43bcce74.js";import"./shared-d3bf9ac0.js";import"./shared-181f51bd.js";import"./shared-a85afa33.js";import"./shared-d6276c83.js";import"./shared-2f7dcefa.js";import"./shared-bc814810.js";import"./shared-8dd0af4d.js";import"./shared-62a54a6c.js";import"./shared-4e709717.js";import"./foxy-spinner.js";import"./shared-62c088b7.js";import"./shared-2092d86f.js";let t,a=r=>r;class s extends(e(r,"item-option-form")){static get v8n(){return[({name:r})=>!!r||"name:v8n_required",({name:r})=>!!r&&r.length<=100||"name:v8n_too_long",({value:r})=>!!r||"value:v8n_required",({value:r})=>!!r&&r.length<=1024||"value:v8n_too_long"]}renderBody(){return o(t||(t=a` <foxy-internal-text-control infer="name"></foxy-internal-text-control> <foxy-internal-text-control infer="value"></foxy-internal-text-control> <foxy-internal-number-control infer="price-mod"></foxy-internal-number-control> <foxy-internal-number-control infer="weight-mod"></foxy-internal-number-control> ${0} `),super.renderBody())}}customElements.define("foxy-item-option-form",s);export{s as ItemOptionForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as t}from"./shared-a8ced8bf.js";import"./shared-b48e5aaf.js";import{L as e,c as i,h as s}from"./shared-7f33a83a.js";import{p as r}from"./shared-888d690a.js";import"./shared-2f6e33b6.js";import"./shared-869df7ed.js";import"./shared-a90a5235.js";import{w as a,S as n,x as o}from"./shared-1e94e6dd.js";import"./shared-7d658c02.js";import"./shared-ae588315.js";import{I as l,D as c}from"./shared-d384d6a3.js";import{E as h}from"./shared-bf47ead0.js";import"./shared-88c7755d.js";import"./shared-39b184de.js";import"./shared-a343ec6b.js";import"./shared-17c1eab2.js";import"./shared-df462496.js";import"./shared-5b3ae513.js";import"./shared-3ca1e8e4.js";import{s as d}from"./shared-11c2efc8.js";import"./shared-68e0cf30.js";import"./shared-76b3d76a.js";import"./shared-4f037e43.js";import"./shared-1db07286.js";import"./shared-2f7dcefa.js";import"./shared-a85afa33.js";import"./shared-43bcce74.js";import"./shared-d3bf9ac0.js";import"./shared-4e709717.js";import"./shared-e99fa3d6.js";import"./shared-23bf6ee6.js";class u extends CustomEvent{constructor(t){super("change",{detail:t})}}class m extends CustomEvent{constructor(t){super("submit",{detail:t,cancelable:!0})}}let _,p,g=t=>t;var f;!function(t){t[t.Excluded=0]="Excluded",t[t.BeforeEnter=1]="BeforeEnter",t[t.Default=2]="Default",t[t.Previous=3]="Previous",t[t.BeforeExit=4]="BeforeExit"}(f||(f={}));class y extends e{constructor(){super(...arguments),this.quantity=0,this.image=""}static get properties(){return t(t({},super.properties),{},{quantity:{attribute:!1},image:{attribute:!1}})}static get styles(){return[a.styles,i(_||(_=g`.ease-out-back{transition-timing-function:cubic-bezier(.34,1.56,.64,1)}.blur-1{filter:blur(1px)}.blur-2{filter:blur(2px)}.grayscale{filter:grayscale()}.rotate-12{--tw-rotate:12deg}.-rotate-12{--tw-rotate:-12deg}.-rotate-24{--tw-rotate:-24deg}.translate-y-half{--tw-translate-y:50%}`))]}set empty(t){this.updateComplete.then((()=>{if(t){const[,...t]=this.__stack;t.forEach((t=>t.remove()))}else this.quantity>1&&this.__stack.length<2&&this.__insertImage(f.Previous,this.__stack[0])}))}set data({quantity:t,image:e}){this.quantity=t,this.image=e}render(){return s(p||(p=g`<div id="image" class="w-full h-full relative"></div>`))}firstUpdated(){const t=this.__insertImage(f.Default);this.quantity>1&&this.__insertImage(f.Previous,t)}updated(t){if(t.has("quantity")){const e=t.get("quantity");void 0!==e&&(this.quantity>e?this.__add():this.__remove())}t.has("image")&&this.__stack.forEach((t=>t.src=this.image))}get __container(){return this.shadowRoot.getElementById("image")}get __stack(){var t,e;return[...null!==(e=null===(t=this.__container)||void 0===t?void 0:t.querySelectorAll(":not(.opacity-0)"))&&void 0!==e?e:[]].reverse()}__add(){const[t,e]=this.__stack;this.quantity>1?(t&&this.__setImageState(t,f.Previous),e&&(this.__setImageState(e,f.BeforeExit),e.ontransitionend=()=>e.remove()),this.__setImageState(this.__insertImage(f.BeforeEnter),f.Default)):t&&this.__setImageState(t,f.Default)}__remove(){const[t,e]=this.__stack;let i;if(this.quantity>0?(e&&this.__setImageState(e,f.Default),i=t):(t&&this.__setImageState(t,f.Excluded),i=e),i&&(this.__setImageState(i,f.BeforeEnter),i.ontransitionend=()=>i.remove()),this.quantity>1){const t=this.__insertImage(f.BeforeExit,this.__container.firstElementChild);this.__setImageState(t,f.Previous)}}__insertImage(t,e=null){const i=new Image;return i.src=this.image,i.setAttribute("part","picture"),i.addEventListener("error",(()=>i.src=y.placeholder)),this.__setImageState(i,t),this.__container.insertBefore(i,e),i}__setImageState(t,e){t.offsetHeight,t.className=["absolute inset-0 w-full h-full object-cover rounded transform transition duration-700 ease-out-back",["grayscale","shadow-m translate-y-half scale-110 rotate-12 opacity-0","shadow-m","blur-1 -rotate-12 opacity-25","blur-2 -rotate-24 opacity-0"][e]].join(" ")}}y.placeholder='data:image/svg+xml,%3Csvg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"%3E%3Crect width="40" height="40" fill="%23E8E8E8"/%3E%3Cpath d="M31.5143 0H24.5476L0 24.5476V31.5143L11.7046 19.8097L11.9841 17.0782C12.0983 15.9624 13.0131 15.1154 14.1038 15.1154H15.7373V12.1923C15.7373 10.9815 16.6915 10 17.8687 10H21.5143L31.5143 0Z" fill="white"/%3E%3Cpath d="M11.5434 21.3852L0 32.9285V39.8953L11.5822 28.3131C11.172 27.8663 10.9438 27.2444 11.012 26.5782L11.5434 21.3852Z" fill="white"/%3E%3Cpath d="M12.4305 28.879L1.30951 40H8.27631L19.2763 29H13.1316C12.8853 29 12.6495 28.9573 12.4305 28.879Z" fill="white"/%3E%3Cpath d="M28.3113 19.965L28.0159 17.0782C27.9116 16.0591 27.1395 15.2642 26.1754 15.1341L40 1.3095V8.27627L28.3113 19.965Z" fill="white"/%3E%3Cpath d="M20.6905 29L9.69049 40H16.6572L27.9755 28.6817C27.6541 28.8832 27.2756 29 26.8684 29H20.6905Z" fill="white"/%3E%3Cpath d="M28.6572 28C28.9128 27.5952 29.0415 27.1003 28.988 26.5782L28.4426 21.2479L40 9.69053V16.6572L28.6572 28Z" fill="white"/%3E%3Cpath d="M25.0381 40H18.0715L40 18.0715V25.0381L25.0381 40Z" fill="white"/%3E%3Cpath d="M26.4524 40H33.4191L40 33.4191V26.4524L26.4524 40Z" fill="white"/%3E%3Cpath d="M40 40H34.8333L40 34.8333V40Z" fill="white"/%3E%3Cpath d="M16.1666 0H23.1334L0 23.1334V16.1666L16.1666 0Z" fill="white"/%3E%3Cpath d="M14.7524 0H7.78571L0 7.78573V14.7524L14.7524 0Z" fill="white"/%3E%3Cpath d="M0 0H6.37152L0 6.37151V0Z" fill="white"/%3E%3Cpath d="M21.467 11.4615H17.8687C17.4763 11.4615 17.1582 11.7887 17.1582 12.1923V15.1154H22.8418V12.1923C22.8418 11.7887 22.5237 11.4615 22.1313 11.4615H21.467Z" fill="white"/%3E%3Cpath d="M24.7798 15.1154H24.2627V12.1923C24.2627 11.227 23.6562 10.4075 22.8138 10.1148L32.9286 0H39.89L24.7798 15.1154Z" fill="white"/%3E%3C/svg%3E';let v,b,w,x,q,E,I,$,C=t=>t;class S extends(n(e)){constructor(){super(...arguments),this.empty=!1,this.data=[]}static get properties(){return t(t({},super.properties),{},{empty:{attribute:!1},data:{attribute:!1}})}static get styles(){return[a.styles,i(v||(v=C`.w-preview{width:5.5rem}.h-preview{height:5.5rem}.ease-out-back{transition-timing-function:cubic-bezier(.34,1.56,.64,1)}.grayscale{filter:grayscale()}.grid-2>:nth-child(1),.grid-3>:nth-child(1),.grid-4-plus>:nth-child(1),.grid-4>:nth-child(1){--tw-scale-x:calc(2.5 / 5.5);--tw-scale-y:var(--tw-scale-x)}.grid-1>:nth-child(2){opacity:0;--tw-translate-x:100%;--tw-translate-y:var(--tw-translate-x)}.grid-2>:nth-child(2),.grid-3>:nth-child(2),.grid-4-plus>:nth-child(2),.grid-4>:nth-child(2){--tw-scale-x:calc(2.5 / 5.5);--tw-scale-y:var(--tw-scale-x)}.grid-3>:nth-child(2),.grid-4-plus>:nth-child(2),.grid-4>:nth-child(2){transform-origin:top right}.grid-1>:nth-child(3),.grid-2>:nth-child(3),.grid-3>:nth-child(3),.grid-4-plus>:nth-child(3),.grid-4>:nth-child(3){--tw-scale-x:calc(2.5 / 5.5);--tw-scale-y:var(--tw-scale-x)}.grid-1>:nth-child(3),.grid-2>:nth-child(3){opacity:0;--tw-translate-y:100%}.grid-3>:nth-child(3){transform-origin:bottom right}.grid-4-plus>:nth-child(3),.grid-4>:nth-child(3){transform-origin:bottom left}.grid-1>:nth-child(4),.grid-2>:nth-child(4),.grid-3>:nth-child(4),.grid-4-plus>:nth-child(4),.grid-4>:nth-child(4){--tw-scale-x:calc(2.5 / 5.5);--tw-scale-y:var(--tw-scale-x)}.grid-1>:nth-child(4),.grid-2>:nth-child(4),.grid-3>:nth-child(4){opacity:0;transform-origin:bottom left;--tw-translate-x:100%}.grid-1>:nth-child(4)>:first-child,.grid-2>:nth-child(4)>:first-child,.grid-3>:nth-child(4)>:first-child,.grid-4>:nth-child(4)>:first-child{transform:perspective(250px) rotateX(-90deg)}.grid-4-plus>:nth-child(4)>:first-child,.grid-4>:nth-child(4)>:last-child{transition-delay:.15s;transition-timing-function:ease-out}.grid-4-plus>:nth-child(4)>:last-child,.grid-4>:nth-child(4)>:first-child{transition-timing-function:ease-in}.grid-4-plus>:nth-child(4)>:last-child{transform:perspective(250px) rotateX(90deg)}.grid-1>:nth-child(5),.grid-3>:nth-child(5),.grid-4-plus>:nth-child(5),.grid-4>:nth-child(5){opacity:0}.grid-1>:nth-child(5){--tw-translate-x:100%}.grid-2>:nth-child(5),.grid-3>:nth-child(5),.grid-4-plus>:nth-child(5),.grid-4>:nth-child(5){--tw-scale-x:calc(2.5 / 5.5);--tw-scale-y:var(--tw-scale-x)}.grid-3>:nth-child(5),.grid-4-plus>:nth-child(5),.grid-4>:nth-child(5){--tw-translate-y:-100%}.grid-1>:nth-child(6),.grid-4-plus>:nth-child(6),.grid-4>:nth-child(6){opacity:0}.grid-1>:nth-child(6){--tw-translate-y:100%}.grid-2>:nth-child(6),.grid-3>:nth-child(6),.grid-4-plus>:nth-child(6),.grid-4>:nth-child(6){--tw-scale-x:calc(2.5 / 5.5);--tw-scale-y:var(--tw-scale-x)}.grid-4-plus>:nth-child(6),.grid-4>:nth-child(6){--tw-translate-x:-100%}`))]}render(){const t=this.data.length,e="rounded bg-contrast-10",i="transition-all duration-700 ease-out-back transform absolute inset-0",r=this.empty?"grayscale":"",a=t>4?"grid-4-plus":`grid-${Math.max(1,t)}`,n=d({exportparts:"picture",class:"w-full h-full",".empty":this.empty}),[o,l,c,h]=this.data;return s(b||(b=C` <div class="${0} w-preview h-preview relative font-lumo"> <div class="${0} ${0} origin-top-left"> ${0} </div> <div class="${0} ${0} origin-bottom-right"> ${0} </div> <div class="${0} ${0} origin-top-right"> ${0} </div> <div class="${0} ${0} origin-bottom-right"> <div class="${0} flex text-body transition duration-150 absolute inset-0"> ${0} </div> <div class="transition duration-150 absolute inset-0"> ${0} </div> </div> <div class="${0} ${0} origin-top-right"></div> <div class="${0} ${0} origin-bottom-left"></div> </div> `),a,i,r,o?s(w||(w=C`<x-pic ...="${0}" .data="${0}"></x-pic>`),n,o):"",i,r,l?s(x||(x=C`<x-pic ...="${0}" .data="${0}"></x-pic>`),n,l):"",i,r,c?s(q||(q=C`<x-pic ...="${0}" .data="${0}"></x-pic>`),n,c):"",i,r,e,t>102?s(E||(E=C`<iron-icon icon="icons:more-horiz" class="m-auto w-xl h-xl"></iron-icon>`)):s(I||(I=C`<div class="m-auto text-xxxl">+${0}</div>`),t-3),h?s($||($=C`<x-pic ...="${0}" .data="${0}"></x-pic>`),n,h):"",i,e,i,e)}}let D,k,j=t=>t;class L extends S{static get scopedElements(){return{"x-pic":y}}}class A extends S{static get scopedElements(){return{"x-pic":L}}}class N extends(n(e)){constructor(){super(...arguments),this.quantity=0,this.items=[]}static get scopedElements(){return{"x-picture":y,"x-bundle-grid":A}}static get properties(){return{quantity:{attribute:!1},image:{attribute:!1},items:{attribute:!1}}}static get styles(){return a.styles}render(){const{quantity:t,image:e=""}=this,i=0===t,r=d({class:"w-full h-full",exportparts:"picture"});if(0===this.items.length)return s(D||(D=j`<x-picture ...="${0}" .data="${0}"></x-picture>`),r,{quantity:t,image:e});{const e=new Array(Math.max(1,t)).fill(this.items);return s(k||(k=j`<x-bundle-grid ...="${0}" .empty="${0}" .data="${0}"></x-bundle-grid>`),r,i,e)}}}class P extends o{static get properties(){return t(t({},super.properties),{},{open:{type:Object},signatures:{type:Object,converter:t=>{const e=JSON.parse(t);for(const t of Object.keys(e))64!=e[t].length&&console.error("There is something wrong with the signature. It should have 64 characters.");return e}}})}signedName(t){return this.signatures&&this.signatures[t]?`${t}||${this.signatures[t]}${this.isOpen(t)?"||open":""}`:t}isOpen(t){return!(!this.open||!this.open[t])}}let F,T,O,V,M,H,B,Z=t=>t;class R extends P{constructor(){super("items-form"),this.rel="product_item",this.readonly=!1,this.quantity=0,this.total=this.__computeTotalPrice(),this.currency="",this.isItem=!0,this.isChildItem=!1,this.pid=R.__newId(),this.__modified=!1,this.__childPrices=[],this.__images=[],this.__childrenCount=0,this.__itemDescription="",this.__handleQuantity={handleEvent:t=>{const e=Number(t.target.value);this.quantity=e,this.__modified=!0,this.__images=[this.getImageDescription()].concat(this.__images.slice(1,this.__images.length))}},this.__childItemsObserver=new MutationObserver(this.__observeItems.bind(this)),this.__childItemsObserver.observe(this,{childList:!0,attributes:!1,subtree:!0}),this.updateComplete.then((()=>{this.__setCode(),this.__acknowledgeChildItems(),this.__changedChildItem(),this.__isValid()||console.error("Invalid item",this.value)}))}static get styles(){return[super.styles,i(F||(F=Z`:host{--quantity-width:6.5rem;--preview-size:5.5rem;--threshold:20rem}.min-w-description::before{content:'';width:var(--threshold);display:block;overflow:hidden}.ml-description{--min-width:calc(var(--threshold) + var(--preview-size) + var(--lumo-space-l));--free-space:calc(100% - var(--min-width));--max-margin-left:calc(var(--preview-size) + var(--lumo-space-l));--final-margin-left:clamp(0rem, var(--free-space) * 999999999, var(--max-margin-left));margin-left:var(--final-margin-left)}.mr-quantity{--min-width:var(--threshold);--free-space:calc(100% - var(--min-width));--max-margin-right:calc(var(--quantity-width) + var(--lumo-space-l));--final-margin-right:clamp(0rem, var(--free-space) * 999999999, var(--max-margin-right));margin-right:var(--final-margin-right)}:host([data-bundled]:not(:last-of-type)) .separator::after{content:' ';display:block;position:absolute;width:100vw;border-bottom:solid thin var(--lumo-shade-10pct);left:0;bottom:0}.w-quantity{width:var(--quantity-width)}.w-preview{width:var(--preview-size)}.h-preview{height:var(--preview-size)}`))]}static get scopedElements(){return{"vaadin-integer-field":customElements.get("vaadin-integer-field"),"x-error-screen":h,"x-preview":N,"x-i18n":l}}static get properties(){return t(t({},super.properties),{},{__modified:{},readonly:{type:Boolean,reflect:!0},currency:{type:String},category:{type:String},code:{type:String,reflect:!0},expires:{type:String},height:{type:Number},image:{type:String},length:{type:Number},name:{type:String},parent_code:{type:String},price:{type:Number},quantity:{type:Number,reflect:!0},quantity_max:{type:Number},quantity_min:{type:String},shipto:{type:String},total:{type:Number,reflect:!0,attribute:"total"},url:{type:String},value:{type:Object},weight:{type:Number},width:{type:Number},__childPrices:{},__childrenCount:{},__images:{},alt:{type:String},isChildItem:{type:Boolean,reflect:!0,attribute:"data-bundled"},isItem:{type:Boolean,reflect:!0,attribute:"data-item"},open:{type:Object},pid:{type:Number,reflect:!0},items:{type:Array}})}get items(){const t=[];return this.__onEachChildItem([e=>t.push(e.value)]),t}set items(t){this.__createItems(t)}get value(){const t={};for(let e=0;e<this.attributes.length;e++)t[this.attributes[e].name]=this.attributes[e].value;return t.items=this.items,t}set value(t){this.__itemDescription="";for(const e in t){let i="";if("description"!=e){if("object"==typeof t[e])i=JSON.stringify(t[e]);else{const s=e;(t[s]&&"undefined"!==t[s]||0===t[s])&&(i=t[e].toString())}this.setAttribute(e,t[e]?i:"")}else this.__itemDescription=t[e]}}updated(t){t.forEach(((t,e)=>{"__itemDescription"!=e&&"isChildItem"!=e||this.__updateDescriptionEl()})),this.__setTotalPrice(),this.dispatchEvent(new Event("change"))}render(){var t;if(!this.__isValid())return s(T||(T=Z`<x-error-screen type="setup_needed" class="relative"></x-error-screen>`));const e=`font-lumo text-body text-s leading-m transition duration-100 ${this.quantity?"":"removed opacity-50"}`;if(this.isChildItem)return s(O||(O=Z` <article part="item" class="py-s w-full relative separator item-summary flex justify-between ${0}"> <div class="description flex-1"> <h1 class="text-header font-medium">${0}</h1> <section class="description text-secondary"> <slot></slot> </section> </div> ${0} </article> `),e,this.name,this.quantity<2?"":s(V||(V=Z` <section class="quantity font-medium text-tertiary whitespace-nowrap"> ${0} </section> `),this._t("item.items",{quantity:this.quantity})));{const i=(null!==(t=this.price)&&void 0!==t?t:0)+this.__childPrices.reduce(((t,e)=>t+e),0),r=this.__translateAmount(i*this.quantity),a=this.__translateAmount(i);return s(M||(M=Z` <article part="item" class="p-l relative item ${0} ${0}"> <x-preview class="preview float-left w-preview h-preview mr-l mb-l" exportparts="picture" .image="${0}" .quantity="${0}" .items="${0}"> </x-preview> <section class="description min-w-description ml-description"> <h1 class="text-header font-medium text-l leading-none mr-quantity mb-s"> ${0} </h1> <div class="item-description text-secondary mr-quantity mb-s"> <slot></slot> </div> <div class="child-items mb-s"> <slot name="items"></slot> </div> ${0} </section> <section class="quantity w-quantity absolute top-0 right-0 m-l"> <vaadin-integer-field class="w-full p-0" name="quantity" @change="${0}" value="${0}" min="0" has-controls ?readonly="${0}"> </vaadin-integer-field> ${0} </section> </article> `),e,this.__modified?"modified":"",this.image,this.quantity,[...this.querySelectorAll("[data-bundled]")].map((t=>{var e;return{quantity:t.quantity,image:null!==(e=t.image)&&void 0!==e?e:""}})),this.name,a?s(H||(H=Z`<div class="font-medium price text-l">${0}</div>`),a):"",this.__handleQuantity,this.quantity,this.readonly,this.quantity>1?s(B||(B=Z` <x-i18n .ns="${0}" .lang="${0}" .opts="${0}" class="price-total text-secondary text-xs text-center block mt-xs" key="price.total"> </x-i18n> `),this.ns,this.lang,{amount:r}):"")}}getImageDescription(){return{src:this.image,alt:this.alt,quantity:this.quantity}}signedName(t){const e=super.signedName(t);return`${this.pid.toString()}:${e}`}static __newId(){const t=R.__existingIds.reduce(((t,e)=>e>t?e:t),0)+1;return R.__existingIds.push(t),t}__updateDescriptionEl(){if(this.__itemDescription){let t=this.shadowRoot.querySelector("data-item-description");t||(t=document.createElement("p"),t.dataset.itemDescription="true",this.__addSlottedEl(t)),t.innerText=this.__itemDescription}else{const t=this.shadowRoot.querySelector("data-item-description");t&&t.remove()}}__addSlottedEl(t){const e=this.shadowRoot.querySelector("article");e&&e.appendChild(t)}__setCode(){this.code||(this.code=`RAND${Math.random()}`)}__createItems(t){t.forEach((t=>{const e=document.createElement(this.tagName);e.value=t,e.currency=this.currency,e.__computeTotalPrice(),this.__acknowledgeItem(e),this.appendChild(e)}))}__setTotalPrice(){this.total=this.__computeTotalPrice()}__computeTotalPrice(){if(!this.__childPrices)return this.price?this.price*this.quantity:0;let t=0;return this.__childPrices.forEach((e=>{t+=e})),t+=this.price,t*=this.quantity,t}__isValid(){const t=[];return this.name&&this.name.length||t.push("The name attribute of an item is required."),this.price||0===this.price||t.push("The price attribute of an item is required."),this.price&&this.price<0&&t.push("Item added with negative price."),this.quantity_min&&this.quantity&&this.quantity<this.quantity_min&&t.push("Quantity amount is less than minimum quantity."),this.quantity_max&&this.quantity&&this.quantity>this.quantity_max&&t.push("Quantity amount is more than maximum quantity."),console.error(...t),!t.length}__translateAmount(t){return this.currency?t.toLocaleString(this.lang,{minimumFractionDigits:2,currency:this.currency,style:"currency"}):""}__observeItems(t){t.forEach((t=>{"childList"==t.type&&t.addedNodes.forEach((t=>{t.nodeType===Node.DOCUMENT_NODE&&this.__acknowledgeItem(t)}))})),this.__setTotalPrice()}__acknowledgeChildItems(){var t;null===(t=this.shadowRoot)||void 0===t||t.querySelectorAll("[data-item]").forEach((t=>this.__acknowledgeItem(t))),this.querySelectorAll("[data-item]").forEach((t=>this.__acknowledgeItem(t)))}__acknowledgeItem(t){t.addEventListener("change",this.__changedChildItem.bind(this)),t.currency=this.currency,t.isItem=!1,t.isChildItem=!0,this.code&&(t.parent_code=this.code)}__changedChildItem(){const t=[],e=[];let i=0;this.__onEachChildItem([e=>{void 0!==e.total&&t.push(e.total)},t=>{e.push(t.getImageDescription())},()=>i+=1]),this.image&&0===e.length&&e.push(this.getImageDescription()),this.__childPrices=t,this.__images=e,this.__childrenCount=i,this.__setTotalPrice()}__onEachChildItem(t){const e=this.querySelectorAll("[data-bundled]");for(const i of e)for(const e of t)e(i)}}R.__existingIds=[];let z,Q,W,J,U,X,G=t=>t;class K extends P{constructor(){super("items-form"),this.readonly=!1,this.target="_top",this.cart="checkout",this.sub_modify="replace",this.sub_restart="auto",this.frequencies=[],this.handleSubmit={handleEvent:()=>{null!==this.__data&&this.dispatchEvent(new m(this.__data))&&this.shadowRoot.querySelector("form").submit()}},this.__hasValidItems=!1,this.__total=0,this.__handleFrequency={handleEvent:t=>{const e=t.detail.replace(/([wydm])\w*/,"$1").replace(/ /g,"").replace(/^0/,"");K.__validFrequency(e)?this.sub_frequency=e:this.sub_frequency="",this.__updateData()}},this.__data=new FormData,this.__childItemsObserver=new MutationObserver(this.__observeChildren.bind(this)),this.__childItemsObserver.observe(this,{childList:!0,attributes:!1,subtree:!0}),this.updateComplete.then((()=>{this.__acknowledgeItemElements(),this.__computeTotalPrice(),this.__updateData()}))}static get scopedElements(){return{"x-error-screen":h,"vaadin-button":customElements.get("vaadin-button"),"x-dropdown":c,"x-item":R}}static get properties(){return t(t({},super.properties),{},{currency:{type:String},readonly:{type:Boolean},cart:{type:String,converter:t=>t&&!["checkout","add"].includes(t)?null:t},target:{type:String},store:{type:String,attribute:"store"},sub_frequency:{type:String},sub_startdate:{type:String,converter:t=>K.__validDate(t)?t:(console.error("Invalid start date",t),"")},sub_enddate:{type:String,converter:t=>K.__validDateFuture(t)?t:(console.error("Invalid end date",t),"")},sub_token:{type:String},sub_modify:{type:String,converter:t=>""===t||"append"===t?"":"replace"},sub_restart:{type:String,converter:t=>"true"===t?t:"auto"},frequencies:{converter:t=>{if(!t)return[];const e=JSON.parse(t);if(!Array.isArray(e))return console.error("Invalid frequency","Frequency options must be an array."),[];for(const t of e)if(!K.__validFrequency(t))return console.error("Invalid frequency","Invalid frequency option.\n Please, check https://wiki.foxycart.com/v/2.0/products#subscription_product_options for possible values.\n Each frequency must be a in the format:\n - 1d (a number followed by d, for day)\n - 1w (a number followed by w, for week)\n - 1m (a number followed by m, for month)\n - 1y (a number followed by y, for year)\n or .5m (no other decimals are allowed, and this is only for months)\n ",t),[];return e.filter(K.__validFrequency)}},items:{type:Array},__hasValidItems:{attribute:!1},__total:{attribute:!1},__data:{attribute:!1}})}get items(){const t=[];return this.__itemElements.forEach((e=>{const i=new Proxy(e,{set:function(t,e,i){const s=Object.keys(t.value);return!("string"!=typeof e||!s.includes(e))&&(t[e]=i,!0)},get:function(t,e){return t.value[e]}});t.push(i)})),t}set items(t){this.__removeItems(),this.__createItemsFromItemArray(t)}get total(){return this.__total}render(){var t;return this.store&&this.currency?s(Q||(Q=G` <div> <form class="overflow-hidden" method="POST" target="${0}" action="https://${0}/cart" data-testid="form" class="hidden" hidden> ${0} </form> <section class="items"> <slot></slot> </section> ${0} </div> `),this.target,this.store,this.__data?s(W||(W=G` ${0}`),[...this.__data.entries()].map((([t,e])=>s(J||(J=G`<input type="hidden" name="${0}" value="${0}">`),t,e)))):"",this.readonly?"":s(U||(U=G` <section class="actions flex flex-wrap justify-end m-m"> ${0} <vaadin-button class="m-s w-full sm-w-auto" theme="primary" data-testid="submit" ?disabled="${0}" @click="${0}"> <span class="total"> ${0} </span> </vaadin-button> </section> `),this.frequencies&&this.frequencies.length?s(X||(X=G` <x-dropdown type="text" name="frequency" class="subscription m-s w-full sm-w-auto" lang="${0}" .value="${0}" .items="${0}" .getText="${0}" @change="${0}"> </x-dropdown> `),this.lang,null!==(t=this.sub_frequency)&&void 0!==t?t:"0",this.frequencies.concat(["0"]),this.__translateFrequency.bind(this),this.__handleFrequency):"",!this.__hasValidItems,this.handleSubmit,this.__submitBtnText(this.__translateAmount(this.total)))):s(z||(z=G`<x-error-screen type="setup_needed" class="relative"></x-error-screen>`))}addItems(t){for(const e of t){const t=this.createItem(e);this.appendChild(t),this.__acknowledgeItemElement(t)}}removeItems(t){this.__removeItems((e=>t.includes(e.pid)))}updated(){this.dispatchEvent(new u(this.__data))}createItem(t){const e=this.constructor.getScopedTagName("x-item"),i=document.createElement(e);return i.value=t,i.currency=this.currency,i.readonly=this.readonly,i}__submitBtnText(t){if(this.sub_frequency&&"0"!=this.sub_frequency){const e=r(this.sub_frequency);return 1===e.count?this._t("checkout.subscribe_single_unit",{value:t,period:this._t(e.units).toLowerCase()}):this._t("checkout.subscribe_muiltiple_units",{value:t,period:this.__translateFrequency(this.sub_frequency).toLowerCase()})}return this._t("checkout.buy",{value:t})}get __itemElements(){return this.querySelectorAll("[data-item]")}__createItemsFromItemArray(t){this.addItems(t)}__removeItems(t=(()=>!0)){this.__itemElements.forEach((e=>{t(e)&&e.remove()}))}__addSignature(t,e,i){return`${t}||${e}${i?"||open":""}`}__formDataFill(t){let e=0;return this.__itemElements.forEach((i=>{e+=this.__formDataAddItem(t,i)})),this.__formDataAddCartWideSubscriptionFields(t),e}__formDataCustomInputs(t){this.querySelectorAll("[name]").forEach((e=>{const i=e;"INPUT"==i.tagName&&["checkbox","radio"].includes(i.type)&&!i.checked||"OPTION"!=i.tagName&&i.value&&["number","string"].includes(typeof i.value)&&t.set(i.name,i.value)}))}__isAttributeReserved(t){return["alt","currency","description","isChildren","isItem","items","open","pid","signatures","slot","total"].includes(t)}__formDataAddItem(t,e,i=null){let s=0;if(this.__validItem(e)){if(!e.value.pid)throw new Error("Attempt to convert a item without a propper ID");i&&i.getAttribute("code")&&e.setAttribute("parent_code",i.getAttribute("code"));for(let s=0;s<e.attributes.length;s++){const r=e.attributes[s];if(!this.__isAttributeReserved(r.name)&&!r.name.startsWith("data-")){let s=e[r.name];e.code&&["string","number"].includes(typeof s)&&(i&&"quantity"==r.name&&(s=Number(r.value)*i.quantity),t.set(e.signedName(r.name),s.toString()))}}s+=1,this.__formDataAddSubscriptionFields(t,e)}const r=e.querySelectorAll("[data-bundled]");if(r&&e.quantity>0)for(const i of r)s+=this.__formDataAddItem(t,i,e);return s}__formDataAddSubscriptionFields(t,e){if(this.sub_frequency)for(const i of["sub_frequency","sub_startdate","sub_enddate"])this[i]&&t.set(e.signedName(i),this[i])}__formDataAddCartWideSubscriptionFields(t){this.sub_frequency&&(this.sub_token&&t.set(this.signedName("sub_token"),this.sub_token),t.set(this.signedName("sub_modify"),this.sub_modify),t.set(this.signedName("sub_restart"),this.sub_restart))}__formDataAddCartFields(t){this.cart?t.set("cart",this.cart):t.delete("cart")}static __validDate(t){return null!=t&&(t.match(/^(\d{1,2}|\d{8})$/)?!(t.match(/^\d{2}$/)&&Number(t)>31):!(t.match(/^\.5m/)||!K.__validFrequency(t)))}static __validDateFuture(t){let e=!1;if(K.__validDate(t))if(t.match(/^\d{8}/)){e=(new Date).toISOString().replace(/(-|T.*)/g,"")<=t}else e=!0;return e}static __validFrequency(t){return!!t&&!!t.match(/^(\.5m|\d+[dwmy])$/)}__observeChildren(t){t.forEach((t=>{"childList"==t.type&&t.addedNodes.forEach((t=>{t.addEventListener("change",this.__itemChange.bind(this))}))})),this.__acknowledgeItemElements(),this.__computeTotalPrice(),this.__updateData()}__itemChange(){this.__computeTotalPrice(),this.__updateData()}__computeTotalPrice(){let t=0;this.__itemElements.forEach((e=>{const i=e;i.total&&(t+=Number(i.total))})),this.__total=Number(t.toFixed(2))}__acknowledgeItemElements(){this.__itemElements.forEach((t=>{const e=t;this.__acknowledgeItemElement(e)}))}__acknowledgeItemElement(t){t.addEventListener("change",this.__itemChange.bind(this)),t.currency=this.currency}__validItem(t){const e=t.getAttribute("pid"),i=Number(t.getAttribute("quantity")),s=Number(t.getAttribute("price"));return!!(e&&i>0&&s>=0)}__translateFrequency(t){if(t.startsWith("0"))return this._t("frequency_once");if(".5m"===t)return this._t("frequency_0_5m");const{count:e,units:i}=r(t);return this._t("frequency",{units:this._t(i,{count:e}),count:e})}__translateAmount(t){return t.toLocaleString(this.lang,{minimumFractionDigits:2,currency:this.currency,style:"currency"})}__updateData(){this.__data=null;if(!this.shadowRoot.querySelector("form"))return;const t=new FormData,e=this.__formDataFill(t);this.__hasValidItems=!!e,this.__formDataAddCartFields(t),this.__formDataCustomInputs(t),this.__data=t}}customElements.define("foxy-items-form",K),customElements.define("foxy-item",R);export{R as Item,K as ItemsForm};
|
|
1
|
+
import{_ as t}from"./shared-a8ced8bf.js";import"./shared-bc814810.js";import{L as e,c as i,h as s}from"./shared-7f33a83a.js";import{p as r}from"./shared-0821cfdc.js";import"./shared-62c088b7.js";import"./shared-be66c2e7.js";import"./shared-5a4829e3.js";import{w as a,S as n,x as o}from"./shared-2cc638ad.js";import"./shared-1c94a156.js";import"./shared-62a54a6c.js";import{I as c,D as l}from"./shared-101d1234.js";import{E as h}from"./shared-de036570.js";import"./shared-bd252323.js";import"./shared-08156595.js";import"./shared-7d4fb1a2.js";import"./shared-4849ef5b.js";import"./shared-6cb1015f.js";import"./shared-5ea18e60.js";import"./shared-2092d86f.js";import{s as d}from"./shared-11c2efc8.js";import"./shared-0ce006b9.js";import"./shared-76b3d76a.js";import"./shared-4f037e43.js";import"./shared-ed0dee03.js";import"./shared-2f7dcefa.js";import"./shared-a85afa33.js";import"./shared-43bcce74.js";import"./shared-d3bf9ac0.js";import"./shared-4e709717.js";import"./shared-404aa9cc.js";import"./shared-08e27fe9.js";class u extends CustomEvent{constructor(t){super("change",{detail:t})}}class m extends CustomEvent{constructor(t){super("submit",{detail:t,cancelable:!0})}}let _,p,g=t=>t;var y;!function(t){t[t.Excluded=0]="Excluded",t[t.BeforeEnter=1]="BeforeEnter",t[t.Default=2]="Default",t[t.Previous=3]="Previous",t[t.BeforeExit=4]="BeforeExit"}(y||(y={}));class f extends e{constructor(){super(...arguments),this.quantity=0,this.image=""}static get properties(){return t(t({},super.properties),{},{quantity:{attribute:!1},image:{attribute:!1}})}static get styles(){return[a.styles,i(_||(_=g`.ease-out-back{transition-timing-function:cubic-bezier(.34,1.56,.64,1)}.blur-1{filter:blur(1px)}.blur-2{filter:blur(2px)}.grayscale{filter:grayscale()}.rotate-12{--tw-rotate:12deg}.-rotate-12{--tw-rotate:-12deg}.-rotate-24{--tw-rotate:-24deg}.translate-y-half{--tw-translate-y:50%}`))]}set empty(t){this.updateComplete.then((()=>{if(t){const[,...t]=this.__stack;t.forEach((t=>t.remove()))}else this.quantity>1&&this.__stack.length<2&&this.__insertImage(y.Previous,this.__stack[0])}))}set data({quantity:t,image:e}){this.quantity=t,this.image=e}render(){return s(p||(p=g`<div id="image" class="w-full h-full relative"></div>`))}firstUpdated(){const t=this.__insertImage(y.Default);this.quantity>1&&this.__insertImage(y.Previous,t)}updated(t){if(t.has("quantity")){const e=t.get("quantity");void 0!==e&&(this.quantity>e?this.__add():this.__remove())}t.has("image")&&this.__stack.forEach((t=>t.src=this.image))}get __container(){return this.shadowRoot.getElementById("image")}get __stack(){var t,e;return[...null!==(e=null===(t=this.__container)||void 0===t?void 0:t.querySelectorAll(":not(.opacity-0)"))&&void 0!==e?e:[]].reverse()}__add(){const[t,e]=this.__stack;this.quantity>1?(t&&this.__setImageState(t,y.Previous),e&&(this.__setImageState(e,y.BeforeExit),e.ontransitionend=()=>e.remove()),this.__setImageState(this.__insertImage(y.BeforeEnter),y.Default)):t&&this.__setImageState(t,y.Default)}__remove(){const[t,e]=this.__stack;let i;if(this.quantity>0?(e&&this.__setImageState(e,y.Default),i=t):(t&&this.__setImageState(t,y.Excluded),i=e),i&&(this.__setImageState(i,y.BeforeEnter),i.ontransitionend=()=>i.remove()),this.quantity>1){const t=this.__insertImage(y.BeforeExit,this.__container.firstElementChild);this.__setImageState(t,y.Previous)}}__insertImage(t,e=null){const i=new Image;return i.src=this.image,i.setAttribute("part","picture"),i.addEventListener("error",(()=>i.src=f.placeholder)),this.__setImageState(i,t),this.__container.insertBefore(i,e),i}__setImageState(t,e){t.offsetHeight,t.className=["absolute inset-0 w-full h-full object-cover rounded transform transition duration-700 ease-out-back",["grayscale","shadow-m translate-y-half scale-110 rotate-12 opacity-0","shadow-m","blur-1 -rotate-12 opacity-25","blur-2 -rotate-24 opacity-0"][e]].join(" ")}}f.placeholder='data:image/svg+xml,%3Csvg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"%3E%3Crect width="40" height="40" fill="%23E8E8E8"/%3E%3Cpath d="M31.5143 0H24.5476L0 24.5476V31.5143L11.7046 19.8097L11.9841 17.0782C12.0983 15.9624 13.0131 15.1154 14.1038 15.1154H15.7373V12.1923C15.7373 10.9815 16.6915 10 17.8687 10H21.5143L31.5143 0Z" fill="white"/%3E%3Cpath d="M11.5434 21.3852L0 32.9285V39.8953L11.5822 28.3131C11.172 27.8663 10.9438 27.2444 11.012 26.5782L11.5434 21.3852Z" fill="white"/%3E%3Cpath d="M12.4305 28.879L1.30951 40H8.27631L19.2763 29H13.1316C12.8853 29 12.6495 28.9573 12.4305 28.879Z" fill="white"/%3E%3Cpath d="M28.3113 19.965L28.0159 17.0782C27.9116 16.0591 27.1395 15.2642 26.1754 15.1341L40 1.3095V8.27627L28.3113 19.965Z" fill="white"/%3E%3Cpath d="M20.6905 29L9.69049 40H16.6572L27.9755 28.6817C27.6541 28.8832 27.2756 29 26.8684 29H20.6905Z" fill="white"/%3E%3Cpath d="M28.6572 28C28.9128 27.5952 29.0415 27.1003 28.988 26.5782L28.4426 21.2479L40 9.69053V16.6572L28.6572 28Z" fill="white"/%3E%3Cpath d="M25.0381 40H18.0715L40 18.0715V25.0381L25.0381 40Z" fill="white"/%3E%3Cpath d="M26.4524 40H33.4191L40 33.4191V26.4524L26.4524 40Z" fill="white"/%3E%3Cpath d="M40 40H34.8333L40 34.8333V40Z" fill="white"/%3E%3Cpath d="M16.1666 0H23.1334L0 23.1334V16.1666L16.1666 0Z" fill="white"/%3E%3Cpath d="M14.7524 0H7.78571L0 7.78573V14.7524L14.7524 0Z" fill="white"/%3E%3Cpath d="M0 0H6.37152L0 6.37151V0Z" fill="white"/%3E%3Cpath d="M21.467 11.4615H17.8687C17.4763 11.4615 17.1582 11.7887 17.1582 12.1923V15.1154H22.8418V12.1923C22.8418 11.7887 22.5237 11.4615 22.1313 11.4615H21.467Z" fill="white"/%3E%3Cpath d="M24.7798 15.1154H24.2627V12.1923C24.2627 11.227 23.6562 10.4075 22.8138 10.1148L32.9286 0H39.89L24.7798 15.1154Z" fill="white"/%3E%3C/svg%3E';let v,b,w,x,q,E,I,$,C=t=>t;class S extends(n(e)){constructor(){super(...arguments),this.empty=!1,this.data=[]}static get properties(){return t(t({},super.properties),{},{empty:{attribute:!1},data:{attribute:!1}})}static get styles(){return[a.styles,i(v||(v=C`.w-preview{width:5.5rem}.h-preview{height:5.5rem}.ease-out-back{transition-timing-function:cubic-bezier(.34,1.56,.64,1)}.grayscale{filter:grayscale()}.grid-2>:nth-child(1),.grid-3>:nth-child(1),.grid-4-plus>:nth-child(1),.grid-4>:nth-child(1){--tw-scale-x:calc(2.5 / 5.5);--tw-scale-y:var(--tw-scale-x)}.grid-1>:nth-child(2){opacity:0;--tw-translate-x:100%;--tw-translate-y:var(--tw-translate-x)}.grid-2>:nth-child(2),.grid-3>:nth-child(2),.grid-4-plus>:nth-child(2),.grid-4>:nth-child(2){--tw-scale-x:calc(2.5 / 5.5);--tw-scale-y:var(--tw-scale-x)}.grid-3>:nth-child(2),.grid-4-plus>:nth-child(2),.grid-4>:nth-child(2){transform-origin:top right}.grid-1>:nth-child(3),.grid-2>:nth-child(3),.grid-3>:nth-child(3),.grid-4-plus>:nth-child(3),.grid-4>:nth-child(3){--tw-scale-x:calc(2.5 / 5.5);--tw-scale-y:var(--tw-scale-x)}.grid-1>:nth-child(3),.grid-2>:nth-child(3){opacity:0;--tw-translate-y:100%}.grid-3>:nth-child(3){transform-origin:bottom right}.grid-4-plus>:nth-child(3),.grid-4>:nth-child(3){transform-origin:bottom left}.grid-1>:nth-child(4),.grid-2>:nth-child(4),.grid-3>:nth-child(4),.grid-4-plus>:nth-child(4),.grid-4>:nth-child(4){--tw-scale-x:calc(2.5 / 5.5);--tw-scale-y:var(--tw-scale-x)}.grid-1>:nth-child(4),.grid-2>:nth-child(4),.grid-3>:nth-child(4){opacity:0;transform-origin:bottom left;--tw-translate-x:100%}.grid-1>:nth-child(4)>:first-child,.grid-2>:nth-child(4)>:first-child,.grid-3>:nth-child(4)>:first-child,.grid-4>:nth-child(4)>:first-child{transform:perspective(250px) rotateX(-90deg)}.grid-4-plus>:nth-child(4)>:first-child,.grid-4>:nth-child(4)>:last-child{transition-delay:.15s;transition-timing-function:ease-out}.grid-4-plus>:nth-child(4)>:last-child,.grid-4>:nth-child(4)>:first-child{transition-timing-function:ease-in}.grid-4-plus>:nth-child(4)>:last-child{transform:perspective(250px) rotateX(90deg)}.grid-1>:nth-child(5),.grid-3>:nth-child(5),.grid-4-plus>:nth-child(5),.grid-4>:nth-child(5){opacity:0}.grid-1>:nth-child(5){--tw-translate-x:100%}.grid-2>:nth-child(5),.grid-3>:nth-child(5),.grid-4-plus>:nth-child(5),.grid-4>:nth-child(5){--tw-scale-x:calc(2.5 / 5.5);--tw-scale-y:var(--tw-scale-x)}.grid-3>:nth-child(5),.grid-4-plus>:nth-child(5),.grid-4>:nth-child(5){--tw-translate-y:-100%}.grid-1>:nth-child(6),.grid-4-plus>:nth-child(6),.grid-4>:nth-child(6){opacity:0}.grid-1>:nth-child(6){--tw-translate-y:100%}.grid-2>:nth-child(6),.grid-3>:nth-child(6),.grid-4-plus>:nth-child(6),.grid-4>:nth-child(6){--tw-scale-x:calc(2.5 / 5.5);--tw-scale-y:var(--tw-scale-x)}.grid-4-plus>:nth-child(6),.grid-4>:nth-child(6){--tw-translate-x:-100%}`))]}render(){const t=this.data.length,e="rounded bg-contrast-10",i="transition-all duration-700 ease-out-back transform absolute inset-0",r=this.empty?"grayscale":"",a=t>4?"grid-4-plus":`grid-${Math.max(1,t)}`,n=d({exportparts:"picture",class:"w-full h-full",".empty":this.empty}),[o,c,l,h]=this.data;return s(b||(b=C` <div class="${0} w-preview h-preview relative font-lumo"> <div class="${0} ${0} origin-top-left"> ${0} </div> <div class="${0} ${0} origin-bottom-right"> ${0} </div> <div class="${0} ${0} origin-top-right"> ${0} </div> <div class="${0} ${0} origin-bottom-right"> <div class="${0} flex text-body transition duration-150 absolute inset-0"> ${0} </div> <div class="transition duration-150 absolute inset-0"> ${0} </div> </div> <div class="${0} ${0} origin-top-right"></div> <div class="${0} ${0} origin-bottom-left"></div> </div> `),a,i,r,o?s(w||(w=C`<x-pic ...="${0}" .data="${0}"></x-pic>`),n,o):"",i,r,c?s(x||(x=C`<x-pic ...="${0}" .data="${0}"></x-pic>`),n,c):"",i,r,l?s(q||(q=C`<x-pic ...="${0}" .data="${0}"></x-pic>`),n,l):"",i,r,e,t>102?s(E||(E=C`<iron-icon icon="icons:more-horiz" class="m-auto w-xl h-xl"></iron-icon>`)):s(I||(I=C`<div class="m-auto text-xxxl">+${0}</div>`),t-3),h?s($||($=C`<x-pic ...="${0}" .data="${0}"></x-pic>`),n,h):"",i,e,i,e)}}let D,k,j=t=>t;class L extends S{static get scopedElements(){return{"x-pic":f}}}class A extends S{static get scopedElements(){return{"x-pic":L}}}class N extends(n(e)){constructor(){super(...arguments),this.quantity=0,this.items=[]}static get scopedElements(){return{"x-picture":f,"x-bundle-grid":A}}static get properties(){return{quantity:{attribute:!1},image:{attribute:!1},items:{attribute:!1}}}static get styles(){return a.styles}render(){const{quantity:t,image:e=""}=this,i=0===t,r=d({class:"w-full h-full",exportparts:"picture"});if(0===this.items.length)return s(D||(D=j`<x-picture ...="${0}" .data="${0}"></x-picture>`),r,{quantity:t,image:e});{const e=new Array(Math.max(1,t)).fill(this.items);return s(k||(k=j`<x-bundle-grid ...="${0}" .empty="${0}" .data="${0}"></x-bundle-grid>`),r,i,e)}}}class P extends o{static get properties(){return t(t({},super.properties),{},{open:{type:Object},signatures:{type:Object,converter:t=>{const e=JSON.parse(t);for(const t of Object.keys(e))64!=e[t].length&&console.error("There is something wrong with the signature. It should have 64 characters.");return e}}})}signedName(t){return this.signatures&&this.signatures[t]?`${t}||${this.signatures[t]}${this.isOpen(t)?"||open":""}`:t}isOpen(t){return!(!this.open||!this.open[t])}}let F,T,O,V,M,H,B,Z=t=>t;class R extends P{constructor(){super("items-form"),this.rel="product_item",this.readonly=!1,this.quantity=0,this.total=this.__computeTotalPrice(),this.currency="",this.isItem=!0,this.isChildItem=!1,this.pid=R.__newId(),this.__modified=!1,this.__childPrices=[],this.__images=[],this.__childrenCount=0,this.__itemDescription="",this.__handleQuantity={handleEvent:t=>{const e=Number(t.target.value);this.quantity=e,this.__modified=!0,this.__images=[this.getImageDescription()].concat(this.__images.slice(1,this.__images.length))}},this.__childItemsObserver=new MutationObserver(this.__observeItems.bind(this)),this.__childItemsObserver.observe(this,{childList:!0,attributes:!1,subtree:!0}),this.updateComplete.then((()=>{this.__setCode(),this.__acknowledgeChildItems(),this.__changedChildItem(),this.__isValid()||console.error("Invalid item",this.value)}))}static get styles(){return[super.styles,i(F||(F=Z`:host{--quantity-width:6.5rem;--preview-size:5.5rem;--threshold:20rem}.min-w-description::before{content:'';width:var(--threshold);display:block;overflow:hidden}.ml-description{--min-width:calc(var(--threshold) + var(--preview-size) + var(--lumo-space-l));--free-space:calc(100% - var(--min-width));--max-margin-left:calc(var(--preview-size) + var(--lumo-space-l));--final-margin-left:clamp(0rem, var(--free-space) * 999999999, var(--max-margin-left));margin-left:var(--final-margin-left)}.mr-quantity{--min-width:var(--threshold);--free-space:calc(100% - var(--min-width));--max-margin-right:calc(var(--quantity-width) + var(--lumo-space-l));--final-margin-right:clamp(0rem, var(--free-space) * 999999999, var(--max-margin-right));margin-right:var(--final-margin-right)}:host([data-bundled]:not(:last-of-type)) .separator::after{content:' ';display:block;position:absolute;width:100vw;border-bottom:solid thin var(--lumo-shade-10pct);left:0;bottom:0}.w-quantity{width:var(--quantity-width)}.w-preview{width:var(--preview-size)}.h-preview{height:var(--preview-size)}`))]}static get scopedElements(){return{"vaadin-integer-field":customElements.get("vaadin-integer-field"),"x-error-screen":h,"x-preview":N,"x-i18n":c}}static get properties(){return t(t({},super.properties),{},{__modified:{},readonly:{type:Boolean,reflect:!0},currency:{type:String},category:{type:String},code:{type:String,reflect:!0},expires:{type:String},height:{type:Number},image:{type:String},length:{type:Number},name:{type:String},parent_code:{type:String},price:{type:Number},quantity:{type:Number,reflect:!0},quantity_max:{type:Number},quantity_min:{type:String},shipto:{type:String},total:{type:Number,reflect:!0,attribute:"total"},url:{type:String},value:{type:Object},weight:{type:Number},width:{type:Number},__childPrices:{},__childrenCount:{},__images:{},alt:{type:String},isChildItem:{type:Boolean,reflect:!0,attribute:"data-bundled"},isItem:{type:Boolean,reflect:!0,attribute:"data-item"},open:{type:Object},pid:{type:Number,reflect:!0},items:{type:Array}})}get items(){const t=[];return this.__onEachChildItem([e=>t.push(e.value)]),t}set items(t){this.__createItems(t)}get value(){const t={};for(let e=0;e<this.attributes.length;e++)t[this.attributes[e].name]=this.attributes[e].value;return t.items=this.items,t}set value(t){this.__itemDescription="";for(const e in t){let i="";if("description"!=e){if("object"==typeof t[e])i=JSON.stringify(t[e]);else{const s=e;(t[s]&&"undefined"!==t[s]||0===t[s])&&(i=t[e].toString())}this.setAttribute(e,t[e]?i:"")}else this.__itemDescription=t[e]}}updated(t){t.forEach(((t,e)=>{"__itemDescription"!=e&&"isChildItem"!=e||this.__updateDescriptionEl()})),this.__setTotalPrice(),this.dispatchEvent(new Event("change"))}render(){var t;if(!this.__isValid())return s(T||(T=Z`<x-error-screen type="setup_needed" class="relative"></x-error-screen>`));const e=`font-lumo text-body text-s leading-m transition duration-100 ${this.quantity?"":"removed opacity-50"}`;if(this.isChildItem)return s(O||(O=Z` <article part="item" class="py-s w-full relative separator item-summary flex justify-between ${0}"> <div class="description flex-1"> <h1 class="text-header font-medium">${0}</h1> <section class="description text-secondary"> <slot></slot> </section> </div> ${0} </article> `),e,this.name,this.quantity<2?"":s(V||(V=Z` <section class="quantity font-medium text-tertiary whitespace-nowrap"> ${0} </section> `),this._t("item.items",{quantity:this.quantity})));{const i=(null!==(t=this.price)&&void 0!==t?t:0)+this.__childPrices.reduce(((t,e)=>t+e),0),r=this.__translateAmount(i*this.quantity),a=this.__translateAmount(i);return s(M||(M=Z` <article part="item" class="p-l relative item ${0} ${0}"> <x-preview class="preview float-left w-preview h-preview mr-l mb-l" exportparts="picture" .image="${0}" .quantity="${0}" .items="${0}"> </x-preview> <section class="description min-w-description ml-description"> <h1 class="text-header font-medium text-l leading-none mr-quantity mb-s"> ${0} </h1> <div class="item-description text-secondary mr-quantity mb-s"> <slot></slot> </div> <div class="child-items mb-s"> <slot name="items"></slot> </div> ${0} </section> <section class="quantity w-quantity absolute top-0 right-0 m-l"> <vaadin-integer-field class="w-full p-0" name="quantity" @change="${0}" value="${0}" min="0" has-controls ?readonly="${0}"> </vaadin-integer-field> ${0} </section> </article> `),e,this.__modified?"modified":"",this.image,this.quantity,[...this.querySelectorAll("[data-bundled]")].map((t=>{var e;return{quantity:t.quantity,image:null!==(e=t.image)&&void 0!==e?e:""}})),this.name,a?s(H||(H=Z`<div class="font-medium price text-l">${0}</div>`),a):"",this.__handleQuantity,this.quantity,this.readonly,this.quantity>1?s(B||(B=Z` <x-i18n .ns="${0}" .lang="${0}" .opts="${0}" class="price-total text-secondary text-xs text-center block mt-xs" key="price.total"> </x-i18n> `),this.ns,this.lang,{amount:r}):"")}}getImageDescription(){return{src:this.image,alt:this.alt,quantity:this.quantity}}signedName(t){const e=super.signedName(t);return`${this.pid.toString()}:${e}`}static __newId(){const t=R.__existingIds.reduce(((t,e)=>e>t?e:t),0)+1;return R.__existingIds.push(t),t}__updateDescriptionEl(){if(this.__itemDescription){let t=this.shadowRoot.querySelector("data-item-description");t||(t=document.createElement("p"),t.dataset.itemDescription="true",this.__addSlottedEl(t)),t.innerText=this.__itemDescription}else{const t=this.shadowRoot.querySelector("data-item-description");t&&t.remove()}}__addSlottedEl(t){const e=this.shadowRoot.querySelector("article");e&&e.appendChild(t)}__setCode(){this.code||(this.code=`RAND${Math.random()}`)}__createItems(t){t.forEach((t=>{const e=document.createElement(this.tagName);e.value=t,e.currency=this.currency,e.__computeTotalPrice(),this.__acknowledgeItem(e),this.appendChild(e)}))}__setTotalPrice(){this.total=this.__computeTotalPrice()}__computeTotalPrice(){if(!this.__childPrices)return this.price?this.price*this.quantity:0;let t=0;return this.__childPrices.forEach((e=>{t+=e})),t+=this.price,t*=this.quantity,t}__isValid(){const t=[];return this.name&&this.name.length||t.push("The name attribute of an item is required."),this.price||0===this.price||t.push("The price attribute of an item is required."),this.price&&this.price<0&&t.push("Item added with negative price."),this.quantity_min&&this.quantity&&this.quantity<this.quantity_min&&t.push("Quantity amount is less than minimum quantity."),this.quantity_max&&this.quantity&&this.quantity>this.quantity_max&&t.push("Quantity amount is more than maximum quantity."),console.error(...t),!t.length}__translateAmount(t){return this.currency?t.toLocaleString(this.lang,{minimumFractionDigits:2,currency:this.currency,style:"currency"}):""}__observeItems(t){t.forEach((t=>{"childList"==t.type&&t.addedNodes.forEach((t=>{t.nodeType===Node.DOCUMENT_NODE&&this.__acknowledgeItem(t)}))})),this.__setTotalPrice()}__acknowledgeChildItems(){var t;null===(t=this.shadowRoot)||void 0===t||t.querySelectorAll("[data-item]").forEach((t=>this.__acknowledgeItem(t))),this.querySelectorAll("[data-item]").forEach((t=>this.__acknowledgeItem(t)))}__acknowledgeItem(t){t.addEventListener("change",this.__changedChildItem.bind(this)),t.currency=this.currency,t.isItem=!1,t.isChildItem=!0,this.code&&(t.parent_code=this.code)}__changedChildItem(){const t=[],e=[];let i=0;this.__onEachChildItem([e=>{void 0!==e.total&&t.push(e.total)},t=>{e.push(t.getImageDescription())},()=>i+=1]),this.image&&0===e.length&&e.push(this.getImageDescription()),this.__childPrices=t,this.__images=e,this.__childrenCount=i,this.__setTotalPrice()}__onEachChildItem(t){const e=this.querySelectorAll("[data-bundled]");for(const i of e)for(const e of t)e(i)}}R.__existingIds=[];let z,Q,W,J,U,X,G=t=>t;class K extends P{constructor(){super("items-form"),this.readonly=!1,this.target="_top",this.cart="checkout",this.sub_modify="replace",this.sub_restart="auto",this.frequencies=[],this.handleSubmit={handleEvent:()=>{null!==this.__data&&this.dispatchEvent(new m(this.__data))&&this.shadowRoot.querySelector("form").submit()}},this.__hasValidItems=!1,this.__total=0,this.__handleFrequency={handleEvent:t=>{const e=t.detail.replace(/([wydm])\w*/,"$1").replace(/ /g,"").replace(/^0/,"");K.__validFrequency(e)?this.sub_frequency=e:this.sub_frequency="",this.__updateData()}},this.__data=new FormData,this.__childItemsObserver=new MutationObserver(this.__observeChildren.bind(this)),this.__childItemsObserver.observe(this,{childList:!0,attributes:!1,subtree:!0}),this.updateComplete.then((()=>{this.__acknowledgeItemElements(),this.__computeTotalPrice(),this.__updateData()}))}static get scopedElements(){return{"x-error-screen":h,"vaadin-button":customElements.get("vaadin-button"),"x-dropdown":l,"x-item":R}}static get properties(){return t(t({},super.properties),{},{currency:{type:String},readonly:{type:Boolean},cart:{type:String,converter:t=>t&&!["checkout","add"].includes(t)?null:t},target:{type:String},store:{type:String,attribute:"store"},sub_frequency:{type:String},sub_startdate:{type:String,converter:t=>K.__validDate(t)?t:(console.error("Invalid start date",t),"")},sub_enddate:{type:String,converter:t=>K.__validDateFuture(t)?t:(console.error("Invalid end date",t),"")},sub_token:{type:String},sub_modify:{type:String,converter:t=>""===t||"append"===t?"":"replace"},sub_restart:{type:String,converter:t=>"true"===t?t:"auto"},frequencies:{converter:t=>{if(!t)return[];const e=JSON.parse(t);if(!Array.isArray(e))return console.error("Invalid frequency","Frequency options must be an array."),[];for(const t of e)if(!K.__validFrequency(t))return console.error("Invalid frequency","Invalid frequency option.\n Please, check https://wiki.foxycart.com/v/2.0/products#subscription_product_options for possible values.\n Each frequency must be a in the format:\n - 1d (a number followed by d, for day)\n - 1w (a number followed by w, for week)\n - 1m (a number followed by m, for month)\n - 1y (a number followed by y, for year)\n or .5m (no other decimals are allowed, and this is only for months)\n ",t),[];return e.filter(K.__validFrequency)}},items:{type:Array},__hasValidItems:{attribute:!1},__total:{attribute:!1},__data:{attribute:!1}})}get items(){const t=[];return this.__itemElements.forEach((e=>{const i=new Proxy(e,{set:function(t,e,i){const s=Object.keys(t.value);return!("string"!=typeof e||!s.includes(e))&&(t[e]=i,!0)},get:function(t,e){return t.value[e]}});t.push(i)})),t}set items(t){this.__removeItems(),this.__createItemsFromItemArray(t)}get total(){return this.__total}render(){var t;return this.store&&this.currency?s(Q||(Q=G` <div> <form class="overflow-hidden" method="POST" target="${0}" action="https://${0}/cart" data-testid="form" class="hidden" hidden> ${0} </form> <section class="items"> <slot></slot> </section> ${0} </div> `),this.target,this.store,this.__data?s(W||(W=G` ${0}`),[...this.__data.entries()].map((([t,e])=>s(J||(J=G`<input type="hidden" name="${0}" value="${0}">`),t,e)))):"",this.readonly?"":s(U||(U=G` <section class="actions flex flex-wrap justify-end m-m"> ${0} <vaadin-button class="m-s w-full sm-w-auto" theme="primary" data-testid="submit" ?disabled="${0}" @click="${0}"> <span class="total"> ${0} </span> </vaadin-button> </section> `),this.frequencies&&this.frequencies.length?s(X||(X=G` <x-dropdown type="text" name="frequency" class="subscription m-s w-full sm-w-auto" lang="${0}" .value="${0}" .items="${0}" .getText="${0}" @change="${0}"> </x-dropdown> `),this.lang,null!==(t=this.sub_frequency)&&void 0!==t?t:"0",this.frequencies.concat(["0"]),this.__translateFrequency.bind(this),this.__handleFrequency):"",!this.__hasValidItems,this.handleSubmit,this.__submitBtnText(this.__translateAmount(this.total)))):s(z||(z=G`<x-error-screen type="setup_needed" class="relative"></x-error-screen>`))}addItems(t){for(const e of t){const t=this.createItem(e);this.appendChild(t),this.__acknowledgeItemElement(t)}}removeItems(t){this.__removeItems((e=>t.includes(e.pid)))}updated(){this.dispatchEvent(new u(this.__data))}createItem(t){const e=this.constructor.getScopedTagName("x-item"),i=document.createElement(e);return i.value=t,i.currency=this.currency,i.readonly=this.readonly,i}__submitBtnText(t){if(this.sub_frequency&&"0"!=this.sub_frequency){const e=r(this.sub_frequency);return 1===e.count?this._t("checkout.subscribe_single_unit",{value:t,period:this._t(e.units).toLowerCase()}):this._t("checkout.subscribe_muiltiple_units",{value:t,period:this.__translateFrequency(this.sub_frequency).toLowerCase()})}return this._t("checkout.buy",{value:t})}get __itemElements(){return this.querySelectorAll("[data-item]")}__createItemsFromItemArray(t){this.addItems(t)}__removeItems(t=(()=>!0)){this.__itemElements.forEach((e=>{t(e)&&e.remove()}))}__addSignature(t,e,i){return`${t}||${e}${i?"||open":""}`}__formDataFill(t){let e=0;return this.__itemElements.forEach((i=>{e+=this.__formDataAddItem(t,i)})),this.__formDataAddCartWideSubscriptionFields(t),e}__formDataCustomInputs(t){this.querySelectorAll("[name]").forEach((e=>{const i=e;"INPUT"==i.tagName&&["checkbox","radio"].includes(i.type)&&!i.checked||"OPTION"!=i.tagName&&i.value&&["number","string"].includes(typeof i.value)&&t.set(i.name,i.value)}))}__isAttributeReserved(t){return["alt","currency","description","isChildren","isItem","items","open","pid","signatures","slot","total"].includes(t)}__formDataAddItem(t,e,i=null){let s=0;if(this.__validItem(e)){if(!e.value.pid)throw new Error("Attempt to convert a item without a propper ID");i&&i.getAttribute("code")&&e.setAttribute("parent_code",i.getAttribute("code"));for(let s=0;s<e.attributes.length;s++){const r=e.attributes[s];if(!this.__isAttributeReserved(r.name)&&!r.name.startsWith("data-")){let s=e[r.name];e.code&&["string","number"].includes(typeof s)&&(i&&"quantity"==r.name&&(s=Number(r.value)*i.quantity),t.set(e.signedName(r.name),s.toString()))}}s+=1,this.__formDataAddSubscriptionFields(t,e)}const r=e.querySelectorAll("[data-bundled]");if(r&&e.quantity>0)for(const i of r)s+=this.__formDataAddItem(t,i,e);return s}__formDataAddSubscriptionFields(t,e){if(this.sub_frequency)for(const i of["sub_frequency","sub_startdate","sub_enddate"])this[i]&&t.set(e.signedName(i),this[i])}__formDataAddCartWideSubscriptionFields(t){this.sub_frequency&&(this.sub_token&&t.set(this.signedName("sub_token"),this.sub_token),t.set(this.signedName("sub_modify"),this.sub_modify),t.set(this.signedName("sub_restart"),this.sub_restart))}__formDataAddCartFields(t){this.cart?t.set("cart",this.cart):t.delete("cart")}static __validDate(t){return null!=t&&(t.match(/^(\d{1,2}|\d{8})$/)?!(t.match(/^\d{2}$/)&&Number(t)>31):!(t.match(/^\.5m/)||!K.__validFrequency(t)))}static __validDateFuture(t){let e=!1;if(K.__validDate(t))if(t.match(/^\d{8}/)){e=(new Date).toISOString().replace(/(-|T.*)/g,"")<=t}else e=!0;return e}static __validFrequency(t){return!!t&&!!t.match(/^(\.5m|\d+[dwmy])$/)}__observeChildren(t){t.forEach((t=>{"childList"==t.type&&t.addedNodes.forEach((t=>{t.addEventListener("change",this.__itemChange.bind(this))}))})),this.__acknowledgeItemElements(),this.__computeTotalPrice(),this.__updateData()}__itemChange(){this.__computeTotalPrice(),this.__updateData()}__computeTotalPrice(){let t=0;this.__itemElements.forEach((e=>{const i=e;i.total&&(t+=Number(i.total))})),this.__total=Number(t.toFixed(2))}__acknowledgeItemElements(){this.__itemElements.forEach((t=>{const e=t;this.__acknowledgeItemElement(e)}))}__acknowledgeItemElement(t){t.addEventListener("change",this.__itemChange.bind(this)),t.currency=this.currency}__validItem(t){const e=t.getAttribute("pid"),i=Number(t.getAttribute("quantity")),s=Number(t.getAttribute("price"));return!!(e&&i>0&&s>=0)}__translateFrequency(t){if(t.startsWith("0"))return this._t("frequency_once");if(".5m"===t)return this._t("frequency_0_5m");const{count:e,units:i}=r(t);return this._t("frequency",{units:this._t(i,{count:e}),count:e})}__translateAmount(t){return t.toLocaleString(this.lang,{minimumFractionDigits:2,currency:this.currency,style:"currency"})}__updateData(){this.__data=null;if(!this.shadowRoot.querySelector("form"))return;const t=new FormData,e=this.__formDataFill(t);this.__hasValidItems=!!e,this.__formDataAddCartFields(t),this.__formDataCustomInputs(t),this.__data=t}}customElements.define("foxy-items-form",K),customElements.define("foxy-item",R);export{R as Item,K as ItemsForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-2092d86f.js";import"./shared-62c088b7.js";import"./shared-bc814810.js";import"./shared-0821cfdc.js";import{_ as e}from"./shared-a8ced8bf.js";import{h as t,L as s}from"./shared-7f33a83a.js";import{C as i}from"./shared-43bcce74.js";import{N as n}from"./shared-181f51bd.js";import{R as a,T as r,a as o}from"./shared-2cc638ad.js";import{c}from"./shared-4e709717.js";import{Q as l}from"./shared-76b3d76a.js";import{I as d}from"./shared-4f037e43.js";import"./shared-0ce006b9.js";import"./shared-be66c2e7.js";import"./shared-d3bf9ac0.js";import"./shared-a85afa33.js";import"./shared-d6276c83.js";import"./shared-2f7dcefa.js";let m,_=e=>e;const h=a(i(r(o(d(s),"pagination"))));class f extends h{constructor(){super(...arguments),this.__pageElement=null,this.__rerender=()=>this.requestUpdate(),this.__first=""}static get properties(){return e(e({},super.properties),{},{first:{type:String},__pageElement:{attribute:!1}})}get first(){return this.__first}set first(e){this.__first=e,this.__pageElement&&(this.__pageElement.href=e)}connectedCallback(){super.connectedCallback(),this.__connectPageElement()}render(){var e;const s=null===(e=this.__pageElement)||void 0===e?void 0:e.data,{disabled:i,lang:n,ns:a}=this,r=Number(l(s,"returned_items")),o=Number.isNaN(r)?0:r,d=Number(l(s,"total_items")),h=Number.isNaN(d)?0:d,f=Number(l(s,"offset")),p=Number.isNaN(f)?0:f,g=!i&&p>0,u=!i&&p+o<h,b="sr-only sm-not-sr-only";return t(m||(m=_` <slot @slotchange="${0}"></slot> <div class="grid gap-s items-center -mx-xs" style="grid-template-columns:1fr auto 1fr"> <div class="flex items-center space-x-s"> <vaadin-button data-testid="first" theme="contrast tertiary-inline" ?disabled="${0}" @click="${0}"> <iron-icon class="icon-inline text-s" icon="icons:first-page"></iron-icon> <foxy-i18n class="${0}" lang="${0}" key="first" ns="${0}"></foxy-i18n> </vaadin-button> <vaadin-button data-testid="prev" theme="contrast tertiary-inline" ?disabled="${0}" @click="${0}"> <iron-icon class="icon-inline text-s" icon="icons:chevron-left"></iron-icon> <foxy-i18n class="${0}" lang="${0}" key="previous" ns="${0}"></foxy-i18n> </vaadin-button> </div> <foxy-i18n options="${0}" class="${0}" lang="${0}" key="pagination" ns="${0}"> </foxy-i18n> <div class="flex items-center justify-end space-x-s"> <vaadin-button data-testid="next" theme="contrast tertiary-inline" ?disabled="${0}" @click="${0}"> <foxy-i18n class="${0}" lang="${0}" key="next" ns="${0}"></foxy-i18n> <iron-icon class="icon-inline text-s" icon="icons:chevron-right"></iron-icon> </vaadin-button> <vaadin-button data-testid="last" theme="contrast tertiary-inline" ?disabled="${0}" @click="${0}"> <foxy-i18n class="${0}" lang="${0}" key="last" ns="${0}"></foxy-i18n> <iron-icon class="icon-inline text-s" icon="icons:last-page"></iron-icon> </vaadin-button> </div> </div> `),this.__connectPageElement,!g,(()=>this.__goTo("first")),b,n,a,!g,(()=>this.__goTo("prev")),b,n,a,JSON.stringify({total:h,from:p?p+1:0,to:p+o}),c({"flex-1 text-xs text-tertiary text-center leading-xs truncate":!0,"opacity-0":!s}),n,a,!u,(()=>this.__goTo("next")),b,n,a,!u,(()=>this.__goTo("last")),b,n,a)}disconnectedCallback(){super.disconnectedCallback(),this.__disconnectPageElement()}__goTo(e){var t;this.__pageElement.href=String(l(null===(t=this.__pageElement)||void 0===t?void 0:t.data,`_links.${e}.href`))}__disconnectPageElement(){var e;null===(e=this.__pageElement)||void 0===e||e.removeEventListener("update",this.__rerender),this.__pageElement=null}__connectPageElement(){var e;this.__disconnectPageElement();const t=this.renderRoot.querySelector("slot"),s=(null!==(e=null==t?void 0:t.assignedElements())&&void 0!==e?e:[]).find((e=>e instanceof n));s&&(this.__pageElement=s,this.__pageElement.addEventListener("update",this.__rerender),this.__pageElement.href=this.first)}}customElements.define("foxy-pagination",f);export{f as Pagination};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-0479553e.js";import"./shared-
|
|
1
|
+
import"./shared-0479553e.js";import"./shared-0821cfdc.js";import"./foxy-spinner.js";import{l as e,u as t}from"./shared-99065f2a.js";import{h as s}from"./shared-7f33a83a.js";import{C as r}from"./shared-43bcce74.js";import{N as i}from"./shared-181f51bd.js";import{T as a,a as n}from"./shared-2cc638ad.js";import{c as o}from"./shared-4e709717.js";import"./shared-a8ced8bf.js";import"./shared-76b3d76a.js";import"./shared-4f037e43.js";import"./shared-62c088b7.js";import"./shared-0ce006b9.js";import"./shared-2092d86f.js";import"./shared-d3bf9ac0.js";import"./shared-a85afa33.js";import"./shared-d6276c83.js";import"./shared-2f7dcefa.js";let d,l,c,p,u,f,h,m=e=>e;const v=a(r(n(i,"payment-card")));class _ extends v{constructor(){super(...arguments),this.templates={},this.__currencyDisplay="",this.__currency=""}render(){var e,t;const r=this.hiddenSelector,i=r.matches("card-info",!0),a=r.matches("fraud-risk",!0);return s(d||(d=m` <div aria-busy="${0}" aria-live="polite" class="relative text-body text-m font-lumo leading-m focus-outline-none"> <div class="${0}"> ${0} ${0} ${0} ${0} </div> <div class="${0}"> <foxy-spinner data-testid="spinner" class="m-auto" state="${0}" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),!this.data&&this.in("busy"),o({"relative transition duration-250 ease-in-out":!0,"opacity-0 pointer-events-none":!this.data}),r.matches("title",!0)?"":this.__renderTitle(),r.matches("subtitle",!0)?"":this.__renderSubtitle(),i&&a?"":s(l||(l=m` <div class="my-s flex space-x-s overflow-auto"> ${0} ${0} </div> `),i?"":this.__renderCardInfo(),a?"":this.__renderFraudRisk()),r.matches("processor-response",!0)?"":this.__renderProcessorResponse(),o({"transition duration-250 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":!!this.data}),this.in("fail")?"error":this.in({idle:"template"})?"empty":"busy",this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"")}async _sendGet(){const e=await super._sendGet(),[t,s]=await Promise.all([super._fetch(e._links["fx:transaction"].href),super._fetch(e._links["fx:store"].href)]);return this.__currency=t.currency_code,this.__currencyDisplay=s.use_international_currency_symbol?"code":"symbol",e}__renderTitle(){const e=this.data?`gateways.${this.data.gateway_type}`:"",t=`${this.ns} gateways`;return s(c||(c=m` <div class="text-m flex text-secondary" data-testid="title"> ${0} <foxy-i18n lang="${0}" key="${0}" ns="${0}"></foxy-i18n>​ ${0} </div> `),this.renderTemplateOrSlot("title:before"),this.lang,e,t,this.renderTemplateOrSlot("title:after"))}__renderSubtitle(){var e,t,r,i;const a=`${null!==(t=null===(e=this.data)||void 0===e?void 0:e.amount)&&void 0!==t?t:""} ${this.__currency}`,n=JSON.stringify({amount:a,currencyDisplay:this.__currencyDisplay}),o=null!==(i=null===(r=this.data)||void 0===r?void 0:r.date_created)&&void 0!==i?i:"",d=JSON.stringify({value:o}),l=this.lang,c=this.ns;return s(p||(p=m` <div class="flex font-semibold text-m" data-testid="subtitle"> ${0} <foxy-i18n options="${0}" lang="${0}" key="price" ns="${0}"></foxy-i18n> <span> • </span> <foxy-i18n options="${0}" lang="${0}" key="date" ns="${0}"></foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("subtitle:before"),n,l,c,d,l,c,this.renderTemplateOrSlot("subtitle:after"))}__renderCardInfo(){var r,i,a,n;const o=this.data,d=(null!==(r=null==o?void 0:o.cc_type)&&void 0!==r?r:"unknown").toLowerCase(),l=null===(i=null==o?void 0:o.cc_exp_year)||void 0===i?void 0:i.substring(2),c=null==o?void 0:o.cc_exp_month,p=null===(a=null==o?void 0:o.cc_number_masked)||void 0===a?void 0:a.replace(/x/gi,"");if(c&&l&&p)return s(u||(u=m` <div class="flex" data-testid="card-info"> ${0} <div class="truncate flex items-center h-s rounded overflow-hidden bg-contrast-5"> <div class="h-s">${0}</div> <div class="text-m font-semibold px-s">•••• ${0} ${0}/${0}</div> </div> ${0} </div> `),this.renderTemplateOrSlot("card-info:before"),null!==(n=e[d])&&void 0!==n?n:t,p,c,l,this.renderTemplateOrSlot("card-info:after"))}__renderFraudRisk(){var e,t;const r=null!==(t=null===(e=this.data)||void 0===e?void 0:e.fraud_protection_score)&&void 0!==t?t:0,i=r>0?"text-error":"text-success",a=r>0?"bg-error-10":"bg-success-10";return s(f||(f=m` <div class="flex" data-testid="fraud-risk"> ${0} <foxy-i18n options="${0}" class="truncate flex font-semibold h-s items-center px-s rounded text-m ${0} ${0}" lang="${0}" key="fraud_risk" ns="${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("fraud-risk:before"),JSON.stringify({score:r}),i,a,this.lang,this.ns,this.renderTemplateOrSlot("fraud-risk:after"))}__renderProcessorResponse(){var e;return s(h||(h=m` <div class="text-m text-tertiary" data-testid="processor-response"> ${0} ${0}​ ${0} </div> `),this.renderTemplateOrSlot("processor-response:before"),null===(e=this.data)||void 0===e?void 0:e.processor_response,this.renderTemplateOrSlot("processor-response:after"))}}customElements.define("foxy-payment-card",_);export{_ as PaymentCard};
|