@foxy.io/elements 1.45.0 → 1.46.0-beta.1
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/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-admin-subscription-form.js +1 -1
- package/dist/cdn/foxy-admin-transaction-card.js +1 -0
- 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-billing-address-card.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 +2 -2
- package/dist/cdn/foxy-client-card.js +1 -1
- package/dist/cdn/foxy-client-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-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-api.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-form.js +1 -1
- package/dist/cdn/foxy-customer-portal-settings.js +1 -1
- package/dist/cdn/foxy-customer-portal.js +11 -11
- 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-downloadable-card.js +1 -1
- package/dist/cdn/foxy-downloadable-form.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-experimental-add-to-cart-builder.js +1 -1
- package/dist/cdn/foxy-filter-attribute-card.js +1 -1
- package/dist/cdn/foxy-filter-attribute-form.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-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 +1 -1
- 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-native-integration-card.js +1 -1
- package/dist/cdn/foxy-native-integration-form.js +1 -1
- package/dist/cdn/foxy-nucleon-element.js +1 -1
- package/dist/cdn/foxy-pagination.js +1 -1
- package/dist/cdn/foxy-passkey-card.js +1 -1
- package/dist/cdn/foxy-passkey-form.js +1 -1
- package/dist/cdn/foxy-payment-card-embed.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-payments-api.js +1 -1
- package/dist/cdn/foxy-query-builder.js +1 -1
- package/dist/cdn/foxy-report-form.js +1 -1
- package/dist/cdn/foxy-reports-table.js +1 -1
- package/dist/cdn/foxy-shipment-card.js +1 -1
- package/dist/cdn/foxy-shipping-container-card.js +1 -1
- package/dist/cdn/foxy-shipping-drop-type-card.js +1 -1
- package/dist/cdn/foxy-shipping-method-card.js +1 -1
- package/dist/cdn/foxy-shipping-service-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-card.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-store-transaction-folder-card.js +1 -0
- package/dist/cdn/foxy-store-transaction-folder-form.js +1 -0
- 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-swipe-actions.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 +1 -1
- package/dist/cdn/foxy-update-payment-method-form.js +1 -1
- package/dist/cdn/foxy-user-card.js +1 -1
- package/dist/cdn/foxy-user-form.js +1 -1
- package/dist/cdn/foxy-user-invitation-card.js +1 -1
- package/dist/cdn/foxy-user-invitation-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-6c25eb72.js → shared-0557539b.js} +1 -1
- package/dist/cdn/{shared-1e14a3fe.js → shared-0b8768db.js} +1 -1
- package/dist/cdn/{shared-cc0d9412.js → shared-0db4e843.js} +3 -3
- package/dist/cdn/{shared-e1e4d8f5.js → shared-0e19bda5.js} +1 -1
- package/dist/cdn/{shared-85ed835a.js → shared-0e25ac65.js} +1 -1
- package/dist/cdn/{shared-4e1bff30.js → shared-0e5484c2.js} +1 -1
- package/dist/cdn/{shared-7dc40542.js → shared-11de7969.js} +1 -1
- package/dist/cdn/{shared-fd5ff448.js → shared-14cc889b.js} +1 -1
- package/dist/cdn/{shared-f9d1baff.js → shared-15a75e70.js} +1 -1
- package/dist/cdn/{shared-946a7af6.js → shared-16776ac6.js} +1 -1
- package/dist/cdn/{shared-c6b1b119.js → shared-18dc7a8a.js} +1 -1
- package/dist/cdn/{shared-c929504f.js → shared-1c985317.js} +1 -1
- package/dist/cdn/{shared-f1e48b0e.js → shared-2111aa44.js} +1 -1
- package/dist/cdn/shared-257dd725.js +1 -0
- package/dist/cdn/{shared-a268320e.js → shared-27c16d99.js} +1 -1
- package/dist/cdn/{shared-4cc42648.js → shared-28ceb7f7.js} +1 -1
- package/dist/cdn/{shared-a1297ca4.js → shared-2df3c589.js} +1 -1
- package/dist/cdn/{shared-85668fe8.js → shared-2f8d04dc.js} +1 -1
- package/dist/cdn/{shared-e54135f0.js → shared-32b2d003.js} +1 -1
- package/dist/cdn/{shared-005168e0.js → shared-34a87829.js} +1 -1
- package/dist/cdn/{shared-5963a49e.js → shared-360196ad.js} +1 -1
- package/dist/cdn/shared-3d353eb8.js +1 -0
- package/dist/cdn/{shared-3c94ab84.js → shared-4158f91e.js} +1 -1
- package/dist/cdn/{shared-809d503c.js → shared-4194ffe7.js} +1 -1
- package/dist/cdn/{shared-c782b9fa.js → shared-41c9c53f.js} +1 -1
- package/dist/cdn/{shared-8340f3ab.js → shared-4498a367.js} +1 -1
- package/dist/cdn/shared-47f3f5f5.js +29 -0
- package/dist/cdn/{shared-788173f2.js → shared-4eb52fc7.js} +1 -1
- package/dist/cdn/{shared-f8519b17.js → shared-57e94234.js} +1 -1
- package/dist/cdn/{shared-a704aaa4.js → shared-58add5b4.js} +1 -1
- package/dist/cdn/{shared-e502a7be.js → shared-59128d82.js} +1 -1
- package/dist/cdn/{shared-433eea12.js → shared-5a469962.js} +1 -1
- package/dist/cdn/shared-5c8931a0.js +1 -0
- package/dist/cdn/{shared-d3414cf0.js → shared-64231b81.js} +1 -1
- package/dist/cdn/{shared-64e243c4.js → shared-66278c21.js} +1 -1
- package/dist/cdn/shared-6740e365.js +1 -0
- package/dist/cdn/{shared-65b2760f.js → shared-69c98b7b.js} +1 -1
- package/dist/cdn/{shared-b5a0d106.js → shared-6bf89411.js} +1 -1
- package/dist/cdn/{shared-50f8f2bd.js → shared-6f071960.js} +1 -1
- package/dist/cdn/{shared-138959d7.js → shared-6f90d987.js} +1 -1
- package/dist/cdn/{shared-e4792d4a.js → shared-730acf1d.js} +1 -1
- package/dist/cdn/{shared-1ae16c80.js → shared-742640c2.js} +1 -1
- package/dist/cdn/shared-791b4510.js +1 -0
- package/dist/cdn/{shared-3b4148ad.js → shared-7f7d6ceb.js} +1 -1
- package/dist/cdn/{shared-be30b940.js → shared-803be1e4.js} +1 -1
- package/dist/cdn/{shared-2d1b1ab2.js → shared-845f968f.js} +1 -1
- package/dist/cdn/shared-8498f274.js +1 -0
- package/dist/cdn/{shared-bea6e6a7.js → shared-84e97597.js} +1 -1
- package/dist/cdn/{shared-597193f7.js → shared-8df4ab18.js} +1 -1
- package/dist/cdn/{shared-7fec42f2.js → shared-8f9014ff.js} +1 -1
- package/dist/cdn/{shared-0ea750af.js → shared-930e68b7.js} +1 -1
- package/dist/cdn/{shared-d6a0954b.js → shared-9496e995.js} +1 -1
- package/dist/cdn/{shared-0fb0732a.js → shared-97fac71c.js} +1 -1
- package/dist/cdn/shared-9b138652.js +1 -0
- package/dist/cdn/{shared-c5c123c5.js → shared-9e0b104a.js} +1 -1
- package/dist/cdn/{shared-21a945fd.js → shared-a08e5a5f.js} +5 -5
- package/dist/cdn/shared-a449033a.js +1 -0
- package/dist/cdn/{shared-3615b419.js → shared-a6ddec3d.js} +1 -1
- package/dist/cdn/{shared-e7a2b31d.js → shared-b01c3b62.js} +1 -1
- package/dist/cdn/{shared-5b0c206b.js → shared-b2cbe727.js} +1 -1
- package/dist/cdn/{shared-529a82a3.js → shared-b3fe8c63.js} +1 -1
- package/dist/cdn/{shared-51376cac.js → shared-bdc981e3.js} +1 -1
- package/dist/cdn/{shared-1091aa45.js → shared-be2ce0e6.js} +1 -1
- package/dist/cdn/{shared-937e58bf.js → shared-bf8d95b9.js} +1 -1
- package/dist/cdn/{shared-85feff39.js → shared-c5a44ef2.js} +1 -1
- package/dist/cdn/shared-c7796413.js +1 -0
- package/dist/cdn/{shared-12973e93.js → shared-c84333db.js} +1 -1
- package/dist/cdn/{shared-5380e27d.js → shared-d46230dc.js} +1 -1
- package/dist/cdn/{shared-9e8344bf.js → shared-d4b77609.js} +1 -1
- package/dist/cdn/{shared-7d15992f.js → shared-d9378323.js} +1 -1
- package/dist/cdn/{shared-37869bac.js → shared-da4f9115.js} +1 -1
- package/dist/cdn/shared-e2d5673b.js +1 -0
- package/dist/cdn/{shared-636d6e33.js → shared-e41960a0.js} +1 -1
- package/dist/cdn/{shared-278b8790.js → shared-e55c8dc4.js} +1 -1
- package/dist/cdn/{shared-5bcf861e.js → shared-eb49be2e.js} +1 -1
- package/dist/cdn/{shared-95d34ae8.js → shared-f2a7eb85.js} +5 -5
- package/dist/cdn/{shared-df7d368c.js → shared-fb859ece.js} +1 -1
- package/dist/cdn/shared-fc155659.js +1 -0
- package/dist/cdn/translations/admin-subscription-form/en.json +6 -6
- package/dist/cdn/translations/admin-transaction-card/en.json +35 -0
- package/dist/cdn/translations/coupon-code-form/en.json +6 -6
- package/dist/cdn/translations/store-transaction-folder-card/en.json +8 -0
- package/dist/cdn/translations/store-transaction-folder-form/en.json +61 -0
- package/dist/cdn/translations/transaction/en.json +4 -0
- package/dist/elements/internal/InternalCard/InternalCard.js +1 -1
- package/dist/elements/internal/InternalCard/InternalCard.js.map +1 -1
- package/dist/elements/internal/InternalDateControl/getMonthNames.js +2 -2
- package/dist/elements/internal/InternalDateControl/getMonthNames.js.map +1 -1
- package/dist/elements/internal/InternalForm/InternalForm.d.ts +2 -4
- package/dist/elements/internal/InternalForm/InternalForm.js +17 -9
- package/dist/elements/internal/InternalForm/InternalForm.js.map +1 -1
- package/dist/elements/internal/InternalForm/types.d.ts +9 -0
- package/dist/elements/internal/InternalForm/types.js.map +1 -1
- package/dist/elements/internal/InternalTextControl/InternalTextControl.d.ts +2 -1
- package/dist/elements/internal/InternalTextControl/InternalTextControl.js +39 -0
- package/dist/elements/internal/InternalTextControl/InternalTextControl.js.map +1 -1
- package/dist/elements/public/AdminSubscriptionForm/AdminSubscriptionForm.js +1 -2
- package/dist/elements/public/AdminSubscriptionForm/AdminSubscriptionForm.js.map +1 -1
- package/dist/elements/public/AdminSubscriptionForm/index.d.ts +1 -1
- package/dist/elements/public/AdminSubscriptionForm/index.js +1 -1
- package/dist/elements/public/AdminSubscriptionForm/index.js.map +1 -1
- package/dist/elements/public/AdminTransactionCard/AdminTransactionCard.d.ts +21 -0
- package/dist/elements/public/AdminTransactionCard/AdminTransactionCard.js +166 -0
- package/dist/elements/public/AdminTransactionCard/AdminTransactionCard.js.map +1 -0
- package/dist/elements/public/AdminTransactionCard/index.d.ts +6 -0
- package/dist/elements/public/AdminTransactionCard/index.js +8 -0
- package/dist/elements/public/AdminTransactionCard/index.js.map +1 -0
- package/dist/elements/public/AdminTransactionCard/types.d.ts +5 -0
- package/dist/elements/public/AdminTransactionCard/types.js +2 -0
- package/dist/elements/public/AdminTransactionCard/types.js.map +1 -0
- package/dist/elements/public/CartForm/internal/InternalCartFormTotalsControl/InternalCartFormTotalsControl.js +6 -6
- package/dist/elements/public/CartForm/internal/InternalCartFormTotalsControl/InternalCartFormTotalsControl.js.map +1 -1
- package/dist/elements/public/CartForm/types.d.ts +1 -1
- package/dist/elements/public/CartForm/types.js.map +1 -1
- package/dist/elements/public/CouponCodeForm/CouponCodeForm.d.ts +1 -0
- package/dist/elements/public/CouponCodeForm/CouponCodeForm.js +13 -1
- package/dist/elements/public/CouponCodeForm/CouponCodeForm.js.map +1 -1
- package/dist/elements/public/CouponCodeForm/index.d.ts +1 -1
- package/dist/elements/public/CouponCodeForm/index.js +1 -1
- package/dist/elements/public/CouponCodeForm/index.js.map +1 -1
- package/dist/elements/public/FilterAttributeCard/FilterAttributeCard.js +7 -3
- package/dist/elements/public/FilterAttributeCard/FilterAttributeCard.js.map +1 -1
- package/dist/elements/public/FormDialog/FormDialog.js +1 -0
- package/dist/elements/public/FormDialog/FormDialog.js.map +1 -1
- package/dist/elements/public/NucleonElement/NucleonElement.d.ts +2 -2
- package/dist/elements/public/NucleonElement/NucleonElement.js +19 -13
- package/dist/elements/public/NucleonElement/NucleonElement.js.map +1 -1
- package/dist/elements/public/PaymentsApi/api/types.d.ts +6 -0
- package/dist/elements/public/PaymentsApi/api/types.js.map +1 -1
- package/dist/elements/public/PaymentsApiPaymentMethodForm/PaymentsApiPaymentMethodForm.js +31 -42
- package/dist/elements/public/PaymentsApiPaymentMethodForm/PaymentsApiPaymentMethodForm.js.map +1 -1
- package/dist/elements/public/StoreForm/StoreForm.js +0 -2
- package/dist/elements/public/StoreForm/StoreForm.js.map +1 -1
- package/dist/elements/public/StoreTransactionFolderCard/StoreTransactionFolderCard.d.ts +27 -0
- package/dist/elements/public/StoreTransactionFolderCard/StoreTransactionFolderCard.js +134 -0
- package/dist/elements/public/StoreTransactionFolderCard/StoreTransactionFolderCard.js.map +1 -0
- package/dist/elements/public/StoreTransactionFolderCard/index.d.ts +5 -0
- package/dist/elements/public/StoreTransactionFolderCard/index.js +7 -0
- package/dist/elements/public/StoreTransactionFolderCard/index.js.map +1 -0
- package/dist/elements/public/StoreTransactionFolderCard/types.d.ts +3 -0
- package/dist/elements/public/StoreTransactionFolderCard/types.js +2 -0
- package/dist/elements/public/StoreTransactionFolderCard/types.js.map +1 -0
- package/dist/elements/public/StoreTransactionFolderForm/StoreTransactionFolderForm.d.ts +18 -0
- package/dist/elements/public/StoreTransactionFolderForm/StoreTransactionFolderForm.js +76 -0
- package/dist/elements/public/StoreTransactionFolderForm/StoreTransactionFolderForm.js.map +1 -0
- package/dist/elements/public/StoreTransactionFolderForm/index.d.ts +7 -0
- package/dist/elements/public/StoreTransactionFolderForm/index.js +9 -0
- package/dist/elements/public/StoreTransactionFolderForm/index.js.map +1 -0
- package/dist/elements/public/StoreTransactionFolderForm/internal/InternalStoreTransactionFolderFormColorControl/InternalStoreTransactionFolderFormColorControl.d.ts +8 -0
- package/dist/elements/public/StoreTransactionFolderForm/internal/InternalStoreTransactionFolderFormColorControl/InternalStoreTransactionFolderFormColorControl.js +68 -0
- package/dist/elements/public/StoreTransactionFolderForm/internal/InternalStoreTransactionFolderFormColorControl/InternalStoreTransactionFolderFormColorControl.js.map +1 -0
- package/dist/elements/public/StoreTransactionFolderForm/internal/InternalStoreTransactionFolderFormColorControl/index.d.ts +3 -0
- package/dist/elements/public/StoreTransactionFolderForm/internal/InternalStoreTransactionFolderFormColorControl/index.js +5 -0
- package/dist/elements/public/StoreTransactionFolderForm/internal/InternalStoreTransactionFolderFormColorControl/index.js.map +1 -0
- package/dist/elements/public/StoreTransactionFolderForm/types.d.ts +3 -0
- package/dist/elements/public/StoreTransactionFolderForm/types.js +2 -0
- package/dist/elements/public/StoreTransactionFolderForm/types.js.map +1 -0
- package/dist/elements/public/SwipeActions/SwipeActions.d.ts +0 -1
- package/dist/elements/public/SwipeActions/SwipeActions.js +6 -7
- package/dist/elements/public/SwipeActions/SwipeActions.js.map +1 -1
- package/dist/elements/public/TaxCard/TaxCard.js +2 -2
- package/dist/elements/public/TaxCard/TaxCard.js.map +1 -1
- package/dist/elements/public/TaxForm/TaxForm.js +0 -2
- package/dist/elements/public/TaxForm/TaxForm.js.map +1 -1
- package/dist/elements/public/TemplateConfigForm/internal/InternalTemplateConfigFormFilterValuesControl/InternalTemplateConfigFormFilterValuesControl.js +1 -3
- package/dist/elements/public/TemplateConfigForm/internal/InternalTemplateConfigFormFilterValuesControl/InternalTemplateConfigFormFilterValuesControl.js.map +1 -1
- package/dist/elements/public/Transaction/Transaction.d.ts +2 -3
- package/dist/elements/public/Transaction/Transaction.js +30 -6
- package/dist/elements/public/Transaction/Transaction.js.map +1 -1
- package/dist/elements/public/Transaction/internal/InternalTransactionActionsControl/InternalTransactionActionsControl.d.ts +5 -1
- package/dist/elements/public/Transaction/internal/InternalTransactionActionsControl/InternalTransactionActionsControl.js +87 -18
- package/dist/elements/public/Transaction/internal/InternalTransactionActionsControl/InternalTransactionActionsControl.js.map +1 -1
- package/dist/elements/public/Transaction/internal/InternalTransactionActionsControl/index.d.ts +1 -0
- package/dist/elements/public/Transaction/internal/InternalTransactionActionsControl/index.js +1 -0
- package/dist/elements/public/Transaction/internal/InternalTransactionActionsControl/index.js.map +1 -1
- package/dist/elements/public/Transaction/internal/InternalTransactionSummaryControl/InternalTransactionSummaryControl.js +6 -6
- package/dist/elements/public/Transaction/internal/InternalTransactionSummaryControl/InternalTransactionSummaryControl.js.map +1 -1
- package/dist/elements/public/Transaction/types.d.ts +1 -3
- package/dist/elements/public/Transaction/types.js.map +1 -1
- package/dist/elements/public/WebhookCard/types.d.ts +1 -3
- package/dist/elements/public/WebhookCard/types.js.map +1 -1
- package/dist/elements/public/index.d.ts +3 -0
- package/dist/elements/public/index.defined.d.ts +3 -0
- package/dist/elements/public/index.defined.js +3 -0
- package/dist/elements/public/index.defined.js.map +1 -1
- package/dist/elements/public/index.js +3 -0
- package/dist/elements/public/index.js.map +1 -1
- package/dist/mixins/themeable.js +106 -4
- package/dist/mixins/themeable.js.map +1 -1
- package/package.json +2 -2
- package/dist/cdn/shared-10da9bf0.js +0 -1
- package/dist/cdn/shared-1da47f50.js +0 -1
- package/dist/cdn/shared-4b24accb.js +0 -1
- package/dist/cdn/shared-5905fca4.js +0 -1
- package/dist/cdn/shared-69074dae.js +0 -1
- package/dist/cdn/shared-77829fbb.js +0 -1
- package/dist/cdn/shared-7a87cd33.js +0 -29
- package/dist/cdn/shared-a6e889a8.js +0 -1
- package/dist/cdn/shared-c66ca1f5.js +0 -1
- package/dist/cdn/shared-cb4ac1d2.js +0 -1
- package/dist/cdn/shared-f8e1143e.js +0 -1
- package/dist/cdn/shared-fc784ca0.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-6f90d987.js";import"./shared-4eb52fc7.js";import"./shared-28ceb7f7.js";import"./shared-64231b81.js";import"./shared-59128d82.js";import"./shared-5c8931a0.js";import{I as e}from"./shared-fc155659.js";import"./foxy-applied-coupon-code-card.js";import"./foxy-applied-coupon-code-form.js";import"./foxy-custom-field-card.js";import"./foxy-custom-field-form.js";import"./foxy-template-set-card.js";import"./foxy-nucleon-element.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-customer-card.js";import"./foxy-item-card.js";import"./foxy-item-form.js";import"./shared-3d353eb8.js";import{a as t,I as r}from"./shared-0b8768db.js";import{_ as o,B as i}from"./shared-8f9014ff.js";import{c as s}from"./shared-4e709717.js";import{h as n,c as a}from"./shared-ba5c42c7.js";import"./shared-360196ad.js";import{R as l,a as d}from"./shared-47f3f5f5.js";import{i as c}from"./shared-53e42a77.js";import"./foxy-update-payment-method-form.js";import{U as u}from"./shared-cd96ff03.js";import{s as m}from"./shared-53e476fd.js";import"./shared-e2d5673b.js";import{g as p}from"./shared-bab2ea2c.js";import{T as _}from"./shared-730acf1d.js";import{T as h}from"./shared-8874ec69.js";import"./foxy-copy-to-clipboard.js";import"./shared-34a87829.js";import"./shared-5a469962.js";import"./shared-66278c21.js";import"./shared-6bf89411.js";import"./shared-d4b77609.js";import"./shared-eb49be2e.js";import"./shared-bf8d95b9.js";import"./shared-b2cbe727.js";import"./shared-41c9c53f.js";import"./shared-930e68b7.js";import"./foxy-form-dialog.js";import"./shared-1c985317.js";import"./shared-58add5b4.js";import"./shared-69c98b7b.js";import"./shared-9b138652.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-9e0b104a.js";import"./shared-fb859ece.js";import"./shared-4194ffe7.js";import"./shared-27c16d99.js";import"./shared-32b2d003.js";import"./shared-0e25ac65.js";import"./shared-b3fe8c63.js";import"./shared-e55c8dc4.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-5fd5805c.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-742640c2.js";import"./shared-be2ce0e6.js";import"./shared-5212ef4f.js";import"./shared-d0aed1c1.js";import"./shared-6740e365.js";import"./shared-d46230dc.js";import"./shared-57e94234.js";import"./shared-15a75e70.js";import"./shared-8498f274.js";import"./shared-c84333db.js";import"./shared-0e5484c2.js";import"./shared-d9378323.js";import"./shared-c5a44ef2.js";import"./shared-84e97597.js";import"./shared-f2a7eb85.js";import"./shared-b01c3b62.js";import"./shared-2061be9a.js";import"./shared-f0fa0a88.js";import"./foxy-discount-detail-card.js";import"./foxy-coupon-detail-card.js";import"./foxy-item-category-card.js";import"./foxy-discount-builder.js";import"./shared-63c32024.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./foxy-payment-card-embed.js";import"./shared-18dc7a8a.js";import"./shared-7f7d6ceb.js";import"./shared-11de7969.js";let f,y,v=e=>e;customElements.define("foxy-internal-cart-form-create-session-action",class extends t{constructor(){super(...arguments),this.__loader=null}static get properties(){return o(o({},super.properties),{},{__loader:{attribute:!1}})}renderControl(){var e,t;const r=null===(e=this.__loader)||void 0===e?void 0:e.state,o=null===(t=this.__loader)||void 0===t?void 0:t.result;return o?n(f||(f=v` <a target="_blank" class="rounded font-medium transition-colors text-body focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n infer="" key="state_idle"></foxy-i18n> </a> `),o):n(y||(y=v` <div class="${0}"> <foxy-i18n infer="" key="${0}"> </foxy-i18n> </div> `),s({"transition-colors font-medium rounded":!0,"text-tertiary":"fail"!==r,"text-error":"fail"===r}),"fail"===r?"state_fail":"state_busy")}updated(e){var t;super.updated(e);const r=this.nucleon,o=null==r?void 0:r.data,i=null!==(t=null==o?void 0:o._links["fx:create_session"].href)&&void 0!==t?t:null;this.__reloadSessionHref(i)}async __reloadSessionHref(e){var t;if((null===(t=this.__loader)||void 0===t?void 0:t.href)===e)return;const r=this.nucleon;if(r)if(e){const t={result:null,state:"busy",href:e},o=new r.constructor.API(this);this.__loader=t;try{const r=await o.fetch(e,{method:"POST"});if(!r.ok)throw new Error;t.result=(await r.json()).cart_link,t.state="idle"}catch(e){t.state="fail"}finally{this.requestUpdate()}}else this.__loader=null}});let g;const x=a(g||(g=(e=>e)`
|
|
2
2
|
#dialog{
|
|
3
3
|
width:100dvw;
|
|
4
4
|
max-height:calc(100dvh - var(--lumo-space-m));
|
|
@@ -54,4 +54,4 @@ import"./shared-138959d7.js";import"./shared-788173f2.js";import"./shared-4cc426
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
`));let b,$,j,k,w,P,U=e=>e;class S extends(l(r)){constructor(){super(...arguments),this.countries=null,this.customer=null,this.regions=null,this.type=null}static get properties(){return o(o({},super.properties),{},{countries:{},customer:{type:Object},regions:{},type:{}})}static get styles(){return[...super.styles,x]}get disabledSelector(){var e;const t=[super.disabledSelector.toString()];return(null===(e=this.__regionsLoader)||void 0===e?void 0:e.data)||t.unshift("address:state"),new i(t.join(" ").toString())}renderControl(){var e,t;const r=this.__regionOptions,o=null!==(e=this.type)&&void 0!==e?e:"billing",i=this.__mergedAddress;return n(b||(b=U` <div class="flex flex-col gap-m sm-flex-row items-start leading-xs"> <div class="flex-1"> <p class="text-m text-body">${0}</p> <p class="text-xs text-secondary">${0}</p> <p class="text-xs text-error" ?hidden="${0}"> ${0} </p> </div> <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> ${0} </button> </div> <dialog id="dialog" class="p-m bg-base shadow-xxl space-y-m"> <h2 class="text-xl font-medium"> <foxy-i18n infer="" key="label"></foxy-i18n> </h2> <foxy-internal-summary-control infer="name"> ${0} ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="address"> ${0} ${0} ${0} <foxy-internal-select-control placeholder="${0}" property="${0}_country" layout="summary-item" infer="country" .options="${0}"> </foxy-internal-select-control> ${0} ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="extra"> ${0} ${0} </foxy-internal-summary-control> <p class="text-xs text-secondary"> <foxy-i18n infer="" key="form_helper_text"></foxy-i18n> </p> <div class="flex justify-between gap-m"> <vaadin-button theme="error" ?disabled="${0}" ?hidden="${0}" @click="${0}"> <foxy-i18n infer="" key="reset"></foxy-i18n> </vaadin-button> <vaadin-button theme="primary" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="done"></foxy-i18n> </vaadin-button> </div> </dialog> <foxy-nucleon class="hidden" infer="" href="${0}" id="countriesLoader" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="regionsLoader" @update="${0}"> </foxy-nucleon> `),this.label,this.helperText,this.disabled||this.readonly,this._errorMessage,this.t("edit"),s({"text-left sm-text-right transition-colors transition-opacity":!0,"text-body cursor-pointer hover-opacity-80":!this.disabled&&!this.readonly,"text-secondary":this.readonly,"text-disabled":this.disabled,"font-medium":!this.readonly}),this.disabled||this.readonly,(()=>{var e;return null===(e=this.__dialog)||void 0===e?void 0:e.showModal()}),this.__isAddressEmpty?n($||($=U`<foxy-i18n infer="" key="not_set"></foxy-i18n>`)):n(j||(j=U` <div> ${0} ${0} </div> <div>${0}</div> <div>${0}</div> <div> ${0} ${0} ${0} ${0} ${0} ${0} </div> `),this.__renderAddressPart(i.first_name),this.__renderAddressPart(i.last_name),this.__renderAddressPart(i.company),this.__renderAddressPart(i.phone),this.__renderAddressPart(i.address1),this.__renderAddressPart(i.address2),this.__renderAddressPart(i.city),this.__renderAddressPart(i.state),this.__renderAddressPart(i.postal_code),this.__renderAddressPart(i.country)),this.__renderTextField(i.first_name),this.__renderTextField(i.last_name),this.__renderTextField(i.address1),this.__renderTextField(i.address2),this.__renderTextField(i.city),c(this.__getPlaceholder(i.country)),o,this.__countryOptions,r.length>0?n(k||(k=U` <foxy-internal-select-control placeholder="${0}" property="${0}_state" layout="summary-item" infer="state" .options="${0}"> </foxy-internal-select-control> `),c(this.__getPlaceholder(i.state)),o,r):this.__renderTextField(i.state),this.__renderTextField(i.postal_code),this.__renderTextField(i.company),this.__renderTextField(i.phone),this.disabled,this.readonly,(()=>{var e;null===(e=this.nucleon)||void 0===e||e.edit({[`${o}_first_name`]:null,[`${o}_last_name`]:null,[`${o}_company`]:null,[`${o}_address1`]:null,[`${o}_address2`]:null,[`${o}_city`]:null,[`${o}_state`]:null,[`${o}_postal_code`]:null,[`${o}_country`]:null,[`${o}_phone`]:null})}),this.disabled,(()=>{var e;return null===(e=this.__dialog)||void 0===e?void 0:e.close()}),c(null!==(t=this.countries)&&void 0!==t?t:void 0),(()=>this.requestUpdate()),c(this.__regionsUrl),(()=>this.requestUpdate()))}__renderAddressPart(e){const t=this.__getDisplayText(e);return n(w||(w=U` <span class="${0}"> ${0} </span> `),s({"text-success bg-success-10":e.modified&&!this.disabled,"bg-contrast-5":e.modified&&this.disabled,"inline-block":!!t,"rounded-s":!0,hidden:!t}),t)}__renderTextField(e){var t;return n(P||(P=U` <foxy-internal-text-control placeholder="${0}" property="${0}_${0}" layout="summary-item" infer="${0}" @clear="${0}"> </foxy-internal-text-control> `),c(this.__getPlaceholder(e)),null!==(t=this.type)&&void 0!==t?t:"billing",e.field,e.field.replace(/_/g,"-").replace("1","-one").replace("2","-two"),(()=>{var t,r;return null===(t=this.nucleon)||void 0===t?void 0:t.edit({[`${null!==(r=this.type)&&void 0!==r?r:"billing"}_${e.field}`]:null})}))}__getDisplayText(e){return e.value||(e.modified?"--":"")}__getPlaceholder(e){return e.modified?this.t("empty_modified_placeholder"):e.originalValue||void 0}get __countriesLoader(){return this.renderRoot.querySelector("#countriesLoader")}get __countryOptions(){var e,t,r;return Object.values(null!==(r=null===(t=null===(e=this.__countriesLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t.values)&&void 0!==r?r:{}).map((e=>({rawLabel:e.default,value:e.cc2})))}get __isAddressEmpty(){return Object.values(this.__mergedAddress).every((e=>""===this.__getDisplayText(e)))}get __regionOptions(){var e,t,r;return Object.values(null!==(r=null===(t=null===(e=this.__regionsLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t.values)&&void 0!==r?r:{}).map((e=>({rawLabel:e.default,value:e.code})))}get __regionsLoader(){return this.renderRoot.querySelector("#regionsLoader")}get __mergedAddress(){var e,t,r;const o=null===(e=this.nucleon)||void 0===e?void 0:e.form,i="shipping"===this.type?"shipping":"billing",s=null!==(r=null===(t=this.customer)||void 0===t?void 0:t._embedded[`fx:default_${i}_address`])&&void 0!==r?r:{},n=["first_name","last_name","company","address1","address2","city","state","postal_code","country","phone"].reduce(((e,t)=>{var r;const n=null==o?void 0:o[`${i}_${t}`],a=null==s?void 0:s["state"===t?"region":t];return e[t]={originalValue:String(null!=a?a:""),modified:null!==n,value:String(null!==(r=null!=n?n:a)&&void 0!==r?r:""),field:t},e}),{});return n}get __regionsUrl(){var e;try{const t=new URL(null!==(e=this.regions)&&void 0!==e?e:""),r=this.__mergedAddress.country.value;return r&&t.searchParams.set("country_code",r),t.toString()}catch(e){}}get __dialog(){return this.renderRoot.querySelector("#dialog")}}customElements.define("foxy-internal-cart-form-address-summary-item",S);let L,C=e=>e;customElements.define("foxy-internal-cart-form-payment-method-form",class extends e{constructor(){super(...arguments),this.defaultPaymentMethod=null,this.paymentCardEmbedUrl=null,this.selectionProps={}}static get properties(){return o(o({},super.properties),{},{defaultPaymentMethod:{attribute:"default-payment-method"},paymentCardEmbedUrl:{attribute:"payment-card-embed-url"},selectionProps:{attribute:!1}})}renderBody(){var e,t;return n(L||(L=C` <foxy-update-payment-method-form embed-url="${0}" infer="default-payment-method" href="${0}" @update="${0}"> </foxy-update-payment-method-form> <div class="flex items-center gap-m"> <div class="border-t border-contrast-10 flex-1"></div> <foxy-i18n class="text-tertiary" infer="" key="or"></foxy-i18n> <div class="border-t border-contrast-10 flex-1"></div> </div> <h2 class="text-xl font-medium"> <foxy-i18n infer="" key="select_previous"></foxy-i18n> </h2> <foxy-internal-async-list-control infer="selection" limit="5" form="foxy-null" hide-delete-button hide-create-button @itemclick="${0}" ...="${0}"> </foxy-internal-async-list-control> `),c(null!==(e=this.paymentCardEmbedUrl)&&void 0!==e?e:void 0),c(null!==(t=this.defaultPaymentMethod)&&void 0!==t?t:void 0),(e=>{var t;(null===(t=e.detail)||void 0===t?void 0:t.result)===u.UpdateResult.ResourceUpdated&&(this.edit({selection:""}),this.submit())}),(e=>{e.preventDefault(),this.edit({selection:e.detail}),this.submit()}),m(this.selectionProps))}});let A,E,O=e=>e;customElements.define("foxy-internal-cart-form-payment-method-card",class extends _{renderBody(){return super.renderBody({title:e=>{var t,r,o,i,s;const a=null===(r=null===(t=e._embedded)||void 0===t?void 0:t["fx:payments"])||void 0===r?void 0:r[0],l=null!==(o=null==a?void 0:a.cc_type)&&void 0!==o?o:"",d=null===(i=null==a?void 0:a.cc_exp_year)||void 0===i?void 0:i.substring(2),c=null==a?void 0:a.cc_exp_month,u=null===(s=null==a?void 0:a.cc_number_masked)||void 0===s?void 0:s.replace(/x/gi,"");return n(A||(A=O`<foxy-i18n infer="" key="title" .options="${0}"></foxy-i18n>`),{last4Digits:u,context:l&&d&&c&&u?"valid":"invalid",month:c,type:l,year:d})},subtitle:e=>{var t,r,o;const i=null===(r=null===(t=e._embedded)||void 0===t?void 0:t["fx:payments"])||void 0===r?void 0:r[0],s={id:p(e._links.self.href),date:null!==(o=null==i?void 0:i.date_created)&&void 0!==o?o:e.transaction_date};return n(E||(E=O`<foxy-i18n infer="" key="subtitle" .options="${0}"></foxy-i18n>`),s)}})}});let T,R,I,M,q,F=e=>e;customElements.define("foxy-internal-cart-form-totals-control",class extends t{constructor(){super(...arguments),this.__storeLoaderId="storeLoader"}renderControl(){var e,t,r,o,i;const s=null===(e=this.nucleon)||void 0===e?void 0:e.data;return s?n(R||(R=F` <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <p class="grid gap-x-s text-right text-s leading-m border-dashed border rounded border-contrast-20 whitespace-nowrap overflow-auto" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 2px);grid-template-columns:1fr min-content"> <span><foxy-i18n key="subtotal" infer=""></foxy-i18n>:</span> <span>${0}</span> <span><foxy-i18n infer="" key="total_shipping"></foxy-i18n>:</span> <span>${0} </span> <span><foxy-i18n infer="" key="total_tax"></foxy-i18n>:</span> <span>${0}</span> ${0} ${0} <span class="col-span-2 border-t border-dashed border-contrast-20 my-s"></span> <span class="col-span-2 flex gap-s justify-between items-center"> <span></span> <span class="text-xl font-medium leading-xs"> <foxy-i18n infer="" key="total"></foxy-i18n>: ${0} </span> </span> </p> `),c(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()),this.__renderPrice(s.total_item_price),this.__renderPrice(s.total_shipping,!0),this.__renderPrice(s.total_tax,!0),null===(r=null===(t=null==s?void 0:s._embedded)||void 0===t?void 0:t["fx:applied_gift_card_codes"])||void 0===r?void 0:r.map((e=>{var t;return n(I||(I=F` <span>${0}:</span> <span>${0}</span> `),e._embedded["fx:gift_card"].name,this.__renderPrice(null!==(t=e.balance_adjustment)&&void 0!==t?t:0,!0))})),null===(i=null===(o=null==s?void 0:s._embedded)||void 0===o?void 0:o["fx:discounts"])||void 0===i?void 0:i.map((e=>n(M||(M=F` <span data-testclass="discount">${0}:</span> <span>${0}</span> `),e.name,this.__renderPrice(e.amount,!0)))),this.__renderPrice(s.total_order)):n(T||(T=F``))}get __storeHref(){var e,t,r;return null===(r=null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:store"])||void 0===r?void 0:r.href}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}__renderPrice(e,t=!1){var r,o,i;const s=(null===(r=this.__store)||void 0===r?void 0:r.use_international_currency_symbol)?"code":"symbol",a=null===(i=null===(o=this.nucleon)||void 0===o?void 0:o.data)||void 0===i?void 0:i.currency_code;return n(q||(q=F` <foxy-i18n class="${0}" infer="" key="price" .options="${0}"> </foxy-i18n> `),t&&0!==e?e>0?"text-success":"text-error":"",{currencyDisplay:s,signDisplay:t?"exceptZero":"auto",amount:`${e} ${a}`})}});let V,D,H=e=>e;const z=l(d(e,"cart-form"));class B extends z{constructor(){super(...arguments),this.paymentCardEmbedUrl=null,this.getCustomerPageUrl=null,this.itemCategories=null,this.templateSets=null,this.localeCodes=null,this.languages=null,this.customers=null,this.countries=null,this.regions=null,this.coupons=null,this.__languagesLoaderId="languagesLoader",this.__customerLoaderId="customerLoader",this.__paymentMethodUriGetDisplayValueOptions=e=>{var t,r,o,i;const s=null!==(o=null===(r=null===(t=null==e?void 0:e._embedded)||void 0===t?void 0:t["fx:payments"])||void 0===r?void 0:r[0])&&void 0!==o?o:null,n=null==s?void 0:s.cc_exp_month,a=null==s?void 0:s.cc_exp_year,l=null===(i=null==s?void 0:s.cc_number_masked)||void 0===i?void 0:i.replace(/x/g,""),d=null==s?void 0:s.cc_type;return{cc_exp_month:null!=n?n:"",cc_exp_year:null!=a?a:"",cc_last4:null!=l?l:"",cc_type:null!=d?d:"",context:l&&n&&a&&d?"":"empty"}},this.__paymentMethodUriSetValue=e=>{try{const t=new URL(e);t.search="",t.pathname+="/payments",this.edit({payment_method_uri:t.toString()})}catch(e){this.edit({payment_method_uri:""})}},this.__paymentMethodUriFilters=[{label:"filter_type",type:f.String,path:"payments:type",list:[{label:"filter_type_value_purchase_order",value:"purchase_order"},{label:"filter_type_value_amazon_mws",value:"amazon_mws"},{label:"filter_type_value_paypal_ec",value:"paypal_ec"},{label:"filter_type_value_paypal",value:"paypal"},{label:"filter_type_value_hosted",value:"hosted"},{label:"filter_type_value_ogone",value:"ogone"}]},{label:"filter_cc_type",type:f.String,path:"payments:cc_type",list:[{label:"filter_cc_type_value_mastercard",value:"mastercard"},{label:"filter_cc_type_value_discover",value:"discover"},{label:"filter_cc_type_value_unionpay",value:"unionpay"},{label:"filter_cc_type_value_maestro",value:"maestro"},{label:"filter_cc_type_value_diners",value:"diners"},{label:"filter_cc_type_value_visa",value:"visa"},{label:"filter_cc_type_value_amex",value:"amex"},{label:"filter_cc_type_value_jcb",value:"jcb"}]},{label:"filter_cc_number_masked",type:f.String,path:"payments:cc_number_masked"}],this.__customerUriSetValue=e=>{this.edit({customer_uri:e,customer_email:""})},this.__customerUriOptions=[{label:"filter_email",path:"email",type:f.String},{label:"filter_is_anonymous",path:"is_anonymous",type:f.String,list:[{value:"false",label:"filter_is_anonymous_value_false"},{value:"true",label:"filter_is_anonymous_value_true"}]}]}static get properties(){return o(o({},super.properties),{},{paymentCardEmbedUrl:{attribute:"payment-card-embed-url"},getCustomerPageUrl:{attribute:!1},itemCategories:{attribute:"item-categories"},templateSets:{attribute:"template-sets"},localeCodes:{attribute:"locale-codes"},languages:{},customers:{},countries:{},regions:{},coupons:{}})}static get v8n(){return[({billing_first_name:e})=>!e||e.length<=50||"billing-first-name:v8n_too_long",({billing_last_name:e})=>!e||e.length<=50||"billing-last-name:v8n_too_long",({billing_state:e})=>!e||e.length<=50||"billing-state:v8n_too_long",({billing_city:e})=>!e||e.length<=50||"billing-city:v8n_too_long",({billing_phone:e})=>!e||e.length<=50||"billing-phone:v8n_too_long",({billing_company:e})=>!e||e.length<=50||"billing-company:v8n_too_long",({billing_address2:e})=>!e||e.length<=100||"billing-address-two:v8n_too_long",({billing_address1:e})=>!e||e.length<=100||"billing-address-one:v8n_too_long",({billing_postal_code:e})=>!e||e.length<=50||"billing-postal-code:v8n_too_long",({shipping_first_name:e})=>!e||e.length<=50||"shipping-first-name:v8n_too_long",({shipping_last_name:e})=>!e||e.length<=50||"shipping-last-name:v8n_too_long",({shipping_state:e})=>!e||e.length<=50||"shipping-state:v8n_too_long",({shipping_city:e})=>!e||e.length<=50||"shipping-city:v8n_too_long",({shipping_phone:e})=>!e||e.length<=50||"shipping-phone:v8n_too_long",({shipping_company:e})=>!e||e.length<=50||"shipping-company:v8n_too_long",({shipping_address2:e})=>!e||e.length<=100||"shipping-address-two:v8n_too_long",({shipping_address1:e})=>!e||e.length<=100||"shipping-address-one:v8n_too_long",({shipping_postal_code:e})=>!e||e.length<=50||"shipping-postal-code:v8n_too_long"]}get hiddenSelector(){const e=[super.hiddenSelector.toString()];return this.form.customer_uri?e.unshift("general:customer-email"):e.unshift("billing:payment-method-uri"),this.data?this.form.use_customer_shipping_address||e.unshift("shipping:shipping-address"):e.unshift("applied-coupon-codes","custom-fields","attributes","shipping","billing","totals","items"),new i(e.join(" ").trim())}renderHeaderActions(){return n(V||(V=H` <foxy-internal-cart-form-create-session-action infer="view-as-customer"> </foxy-internal-cart-form-create-session-action> `))}renderBody(){var e,t,r,o,i,s,a,l,d,u,m;const p=null===(e=this.data)||void 0===e?void 0:e._links,_=this.__customer;return n(D||(D=H` ${0} <foxy-internal-summary-control infer="general"> <foxy-internal-resource-picker-control layout="summary-item" first="${0}" infer="template-set-uri" item="foxy-template-set-card"> </foxy-internal-resource-picker-control> <foxy-internal-select-control layout="summary-item" infer="language" .options="${0}"> </foxy-internal-select-control> <foxy-internal-text-control layout="summary-item" infer="customer-email"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-async-list-control infer="items" class="min-w-0" first="${0}" alert wide item="foxy-item-card" form="foxy-item-form" .related="${0}" .itemProps="${0}" .formProps="${0}"> </foxy-internal-async-list-control> <foxy-internal-cart-form-totals-control class="min-w-0" infer="totals"> </foxy-internal-cart-form-totals-control> <foxy-internal-async-list-control infer="applied-coupon-codes" class="min-w-0" first="${0}" item="foxy-applied-coupon-code-card" form="foxy-applied-coupon-code-form" alert .related="${0}"> </foxy-internal-async-list-control> <foxy-internal-resource-picker-control first="${0}" infer="customer-uri" item="foxy-customer-card" show-copy-id-button .getItemUrl="${0}" .setValue="${0}" .filters="${0}"> </foxy-internal-resource-picker-control> <foxy-internal-summary-control infer="billing"> <foxy-internal-resource-picker-control placeholder="${0}" layout="summary-item" first="${0}" infer="payment-method-uri" item="foxy-internal-cart-form-payment-method-card" form="foxy-internal-cart-form-payment-method-form" .getDisplayValueOptions="${0}" .formProps="${0}" .setValue="${0}" .filters="${0}"> </foxy-internal-resource-picker-control> <foxy-internal-cart-form-address-summary-item countries="${0}" regions="${0}" infer="billing-address" type="billing" .customer="${0}"> </foxy-internal-cart-form-address-summary-item> </foxy-internal-summary-control> <foxy-internal-summary-control infer="shipping"> <foxy-internal-switch-control infer="use-customer-shipping-address" invert> </foxy-internal-switch-control> <foxy-internal-cart-form-address-summary-item countries="${0}" regions="${0}" infer="shipping-address" type="shipping" .customer="${0}"> </foxy-internal-cart-form-address-summary-item> </foxy-internal-summary-control> <foxy-internal-async-list-control infer="custom-fields" class="min-w-0" first="${0}" limit="5" item="foxy-custom-field-card" form="foxy-custom-field-form" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="attributes" class="min-w-0" first="${0}" limit="5" item="foxy-attribute-card" form="foxy-attribute-form" alert> </foxy-internal-async-list-control> ${0} <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> `),this.renderHeader(),c(null!==(t=this.templateSets)&&void 0!==t?t:void 0),this.__languageOptions,c(this.__itemsHref),this.href?[this.href]:[],{"locale-codes":this.localeCodes},{"item-categories":this.itemCategories,"locale-codes":this.localeCodes,store:null===(r=this.data)||void 0===r?void 0:r._links["fx:store"].href},c(null==p?void 0:p["fx:applied_coupon_codes"].href),this.href?[this.href]:[],c(null!==(o=this.customers)&&void 0!==o?o:void 0),this.getCustomerPageUrl,this.__customerUriSetValue,this.__customerUriOptions,this.__paymentMethodUriPlaceholder,c(this.__transactionsWithPaymentsUrl),this.__paymentMethodUriGetDisplayValueOptions,{"default-payment-method":null!==(i=null==_?void 0:_._links["fx:default_payment_method"].href)&&void 0!==i?i:"","payment-card-embed-url":null!==(s=this.__pickerPaymentCardEmbedUrl)&&void 0!==s?s:""},this.__paymentMethodUriSetValue,this.__paymentMethodUriFilters,c(null!==(a=this.countries)&&void 0!==a?a:void 0),c(null!==(l=this.regions)&&void 0!==l?l:void 0),_,c(null!==(d=this.countries)&&void 0!==d?d:void 0),c(null!==(u=this.regions)&&void 0!==u?u:void 0),_,c(null==p?void 0:p["fx:custom_fields"].href),c(null==p?void 0:p["fx:attributes"].href),super.renderBody(),c(null!==(m=this.languages)&&void 0!==m?m:void 0),this.__languagesLoaderId,(()=>this.requestUpdate()),c(this.__customerHref),this.__customerLoaderId,(()=>this.requestUpdate()))}get __paymentMethodUriPlaceholder(){var e,t,r,o,i,s;const n=null===(e=this.__customer)||void 0===e?void 0:e._embedded["fx:default_payment_method"],a=null!==(t=null==n?void 0:n.cc_exp_month)&&void 0!==t?t:null,l=null!==(r=null==n?void 0:n.cc_exp_year)&&void 0!==r?r:null,d=null!==(i=null===(o=null==n?void 0:n.cc_number_masked)||void 0===o?void 0:o.replace(/x/g,""))&&void 0!==i?i:null,c=null!==(s=null==n?void 0:n.cc_type)&&void 0!==s?s:null;return this.t("billing.payment-method-uri.value",{cc_exp_month:null!=a?a:"",cc_exp_year:null!=l?l:"",cc_last4:null!=d?d:"",cc_type:null!=c?c:"",context:d&&a&&l&&c?"":"empty"})}get __transactionsWithPaymentsUrl(){var e,t;try{const r=new URL(null!==(t=null===(e=this.__customer)||void 0===e?void 0:e._links["fx:transactions"].href)&&void 0!==t?t:"");return r.searchParams.set("zoom","payments"),r.toString()}catch(e){}}get __pickerPaymentCardEmbedUrl(){var e,t;try{const r=new URL(null!==(e=this.paymentCardEmbedUrl)&&void 0!==e?e:""),o=p(null!==(t=this.form.template_set_uri)&&void 0!==t?t:"");if(null!==o)return r.searchParams.set("template_set_id",String(o)),r.toString()}catch(e){}}get __customerHref(){var e;try{const t=new URL(null!==(e=this.form.customer_uri)&&void 0!==e?e:"");return t.searchParams.set("zoom","default_payment_method,default_billing_address,default_shipping_address"),t.toString()}catch(e){}}get __itemsHref(){var e,t;try{const r=new URL(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:items"].href)&&void 0!==t?t:"");return r.searchParams.set("zoom","item_options"),r.toString()}catch(e){}}get __languageOptions(){var e,t;const r=this.renderRoot.querySelector(`#${this.__languagesLoaderId}`);return Object.entries(null!==(t=null===(e=null==r?void 0:r.data)||void 0===e?void 0:e.values)&&void 0!==t?t:{}).map((([e,t])=>({rawLabel:t,value:e})))}get __customer(){var e;return null===(e=this.renderRoot.querySelector(`#${this.__customerLoaderId}`))||void 0===e?void 0:e.data}}customElements.define("foxy-cart-form",B);export{B as CartForm};
|
|
57
|
+
`));let b,$,j,k,w,P,U=e=>e;class S extends(l(r)){constructor(){super(...arguments),this.countries=null,this.customer=null,this.regions=null,this.type=null}static get properties(){return o(o({},super.properties),{},{countries:{},customer:{type:Object},regions:{},type:{}})}static get styles(){return[...super.styles,x]}get disabledSelector(){var e;const t=[super.disabledSelector.toString()];return(null===(e=this.__regionsLoader)||void 0===e?void 0:e.data)||t.unshift("address:state"),new i(t.join(" ").toString())}renderControl(){var e,t;const r=this.__regionOptions,o=null!==(e=this.type)&&void 0!==e?e:"billing",i=this.__mergedAddress;return n(b||(b=U` <div class="flex flex-col gap-m sm-flex-row items-start leading-xs"> <div class="flex-1"> <p class="text-m text-body">${0}</p> <p class="text-xs text-secondary">${0}</p> <p class="text-xs text-error" ?hidden="${0}"> ${0} </p> </div> <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> ${0} </button> </div> <dialog id="dialog" class="p-m bg-base shadow-xxl space-y-m"> <h2 class="text-xl font-medium"> <foxy-i18n infer="" key="label"></foxy-i18n> </h2> <foxy-internal-summary-control infer="name"> ${0} ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="address"> ${0} ${0} ${0} <foxy-internal-select-control placeholder="${0}" property="${0}_country" layout="summary-item" infer="country" .options="${0}"> </foxy-internal-select-control> ${0} ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="extra"> ${0} ${0} </foxy-internal-summary-control> <p class="text-xs text-secondary"> <foxy-i18n infer="" key="form_helper_text"></foxy-i18n> </p> <div class="flex justify-between gap-m"> <vaadin-button theme="error" ?disabled="${0}" ?hidden="${0}" @click="${0}"> <foxy-i18n infer="" key="reset"></foxy-i18n> </vaadin-button> <vaadin-button theme="primary" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="done"></foxy-i18n> </vaadin-button> </div> </dialog> <foxy-nucleon class="hidden" infer="" href="${0}" id="countriesLoader" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="regionsLoader" @update="${0}"> </foxy-nucleon> `),this.label,this.helperText,this.disabled||this.readonly,this._errorMessage,this.t("edit"),s({"text-left sm-text-right transition-colors transition-opacity":!0,"text-body cursor-pointer hover-opacity-80":!this.disabled&&!this.readonly,"text-secondary":this.readonly,"text-disabled":this.disabled,"font-medium":!this.readonly}),this.disabled||this.readonly,(()=>{var e;return null===(e=this.__dialog)||void 0===e?void 0:e.showModal()}),this.__isAddressEmpty?n($||($=U`<foxy-i18n infer="" key="not_set"></foxy-i18n>`)):n(j||(j=U` <div> ${0} ${0} </div> <div>${0}</div> <div>${0}</div> <div> ${0} ${0} ${0} ${0} ${0} ${0} </div> `),this.__renderAddressPart(i.first_name),this.__renderAddressPart(i.last_name),this.__renderAddressPart(i.company),this.__renderAddressPart(i.phone),this.__renderAddressPart(i.address1),this.__renderAddressPart(i.address2),this.__renderAddressPart(i.city),this.__renderAddressPart(i.state),this.__renderAddressPart(i.postal_code),this.__renderAddressPart(i.country)),this.__renderTextField(i.first_name),this.__renderTextField(i.last_name),this.__renderTextField(i.address1),this.__renderTextField(i.address2),this.__renderTextField(i.city),c(this.__getPlaceholder(i.country)),o,this.__countryOptions,r.length>0?n(k||(k=U` <foxy-internal-select-control placeholder="${0}" property="${0}_state" layout="summary-item" infer="state" .options="${0}"> </foxy-internal-select-control> `),c(this.__getPlaceholder(i.state)),o,r):this.__renderTextField(i.state),this.__renderTextField(i.postal_code),this.__renderTextField(i.company),this.__renderTextField(i.phone),this.disabled,this.readonly,(()=>{var e;null===(e=this.nucleon)||void 0===e||e.edit({[`${o}_first_name`]:null,[`${o}_last_name`]:null,[`${o}_company`]:null,[`${o}_address1`]:null,[`${o}_address2`]:null,[`${o}_city`]:null,[`${o}_state`]:null,[`${o}_postal_code`]:null,[`${o}_country`]:null,[`${o}_phone`]:null})}),this.disabled,(()=>{var e;return null===(e=this.__dialog)||void 0===e?void 0:e.close()}),c(null!==(t=this.countries)&&void 0!==t?t:void 0),(()=>this.requestUpdate()),c(this.__regionsUrl),(()=>this.requestUpdate()))}__renderAddressPart(e){const t=this.__getDisplayText(e);return n(w||(w=U` <span class="${0}"> ${0} </span> `),s({"text-success bg-success-10":e.modified&&!this.disabled,"bg-contrast-5":e.modified&&this.disabled,"inline-block":!!t,"rounded-s":!0,hidden:!t}),t)}__renderTextField(e){var t;return n(P||(P=U` <foxy-internal-text-control placeholder="${0}" property="${0}_${0}" layout="summary-item" infer="${0}" @clear="${0}"> </foxy-internal-text-control> `),c(this.__getPlaceholder(e)),null!==(t=this.type)&&void 0!==t?t:"billing",e.field,e.field.replace(/_/g,"-").replace("1","-one").replace("2","-two"),(()=>{var t,r;return null===(t=this.nucleon)||void 0===t?void 0:t.edit({[`${null!==(r=this.type)&&void 0!==r?r:"billing"}_${e.field}`]:null})}))}__getDisplayText(e){return e.value||(e.modified?"--":"")}__getPlaceholder(e){return e.modified?this.t("empty_modified_placeholder"):e.originalValue||void 0}get __countriesLoader(){return this.renderRoot.querySelector("#countriesLoader")}get __countryOptions(){var e,t,r;return Object.values(null!==(r=null===(t=null===(e=this.__countriesLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t.values)&&void 0!==r?r:{}).map((e=>({rawLabel:e.default,value:e.cc2})))}get __isAddressEmpty(){return Object.values(this.__mergedAddress).every((e=>""===this.__getDisplayText(e)))}get __regionOptions(){var e,t,r;return Object.values(null!==(r=null===(t=null===(e=this.__regionsLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t.values)&&void 0!==r?r:{}).map((e=>({rawLabel:e.default,value:e.code})))}get __regionsLoader(){return this.renderRoot.querySelector("#regionsLoader")}get __mergedAddress(){var e,t,r;const o=null===(e=this.nucleon)||void 0===e?void 0:e.form,i="shipping"===this.type?"shipping":"billing",s=null!==(r=null===(t=this.customer)||void 0===t?void 0:t._embedded[`fx:default_${i}_address`])&&void 0!==r?r:{},n=["first_name","last_name","company","address1","address2","city","state","postal_code","country","phone"].reduce(((e,t)=>{var r;const n=null==o?void 0:o[`${i}_${t}`],a=null==s?void 0:s["state"===t?"region":t];return e[t]={originalValue:String(null!=a?a:""),modified:null!==n,value:String(null!==(r=null!=n?n:a)&&void 0!==r?r:""),field:t},e}),{});return n}get __regionsUrl(){var e;try{const t=new URL(null!==(e=this.regions)&&void 0!==e?e:""),r=this.__mergedAddress.country.value;return r&&t.searchParams.set("country_code",r),t.toString()}catch(e){}}get __dialog(){return this.renderRoot.querySelector("#dialog")}}customElements.define("foxy-internal-cart-form-address-summary-item",S);let L,C=e=>e;customElements.define("foxy-internal-cart-form-payment-method-form",class extends e{constructor(){super(...arguments),this.defaultPaymentMethod=null,this.paymentCardEmbedUrl=null,this.selectionProps={}}static get properties(){return o(o({},super.properties),{},{defaultPaymentMethod:{attribute:"default-payment-method"},paymentCardEmbedUrl:{attribute:"payment-card-embed-url"},selectionProps:{attribute:!1}})}renderBody(){var e,t;return n(L||(L=C` <foxy-update-payment-method-form embed-url="${0}" infer="default-payment-method" href="${0}" @update="${0}"> </foxy-update-payment-method-form> <div class="flex items-center gap-m"> <div class="border-t border-contrast-10 flex-1"></div> <foxy-i18n class="text-tertiary" infer="" key="or"></foxy-i18n> <div class="border-t border-contrast-10 flex-1"></div> </div> <h2 class="text-xl font-medium"> <foxy-i18n infer="" key="select_previous"></foxy-i18n> </h2> <foxy-internal-async-list-control infer="selection" limit="5" form="foxy-null" hide-delete-button hide-create-button @itemclick="${0}" ...="${0}"> </foxy-internal-async-list-control> `),c(null!==(e=this.paymentCardEmbedUrl)&&void 0!==e?e:void 0),c(null!==(t=this.defaultPaymentMethod)&&void 0!==t?t:void 0),(e=>{var t;(null===(t=e.detail)||void 0===t?void 0:t.result)===u.UpdateResult.ResourceUpdated&&(this.edit({selection:""}),this.submit())}),(e=>{e.preventDefault(),this.edit({selection:e.detail}),this.submit()}),m(this.selectionProps))}});let A,E,O=e=>e;customElements.define("foxy-internal-cart-form-payment-method-card",class extends _{renderBody(){return super.renderBody({title:e=>{var t,r,o,i,s;const a=null===(r=null===(t=e._embedded)||void 0===t?void 0:t["fx:payments"])||void 0===r?void 0:r[0],l=null!==(o=null==a?void 0:a.cc_type)&&void 0!==o?o:"",d=null===(i=null==a?void 0:a.cc_exp_year)||void 0===i?void 0:i.substring(2),c=null==a?void 0:a.cc_exp_month,u=null===(s=null==a?void 0:a.cc_number_masked)||void 0===s?void 0:s.replace(/x/gi,"");return n(A||(A=O`<foxy-i18n infer="" key="title" .options="${0}"></foxy-i18n>`),{last4Digits:u,context:l&&d&&c&&u?"valid":"invalid",month:c,type:l,year:d})},subtitle:e=>{var t,r,o;const i=null===(r=null===(t=e._embedded)||void 0===t?void 0:t["fx:payments"])||void 0===r?void 0:r[0],s={id:p(e._links.self.href),date:null!==(o=null==i?void 0:i.date_created)&&void 0!==o?o:e.transaction_date};return n(E||(E=O`<foxy-i18n infer="" key="subtitle" .options="${0}"></foxy-i18n>`),s)}})}});let T,R,I,M,q,F=e=>e;customElements.define("foxy-internal-cart-form-totals-control",class extends t{constructor(){super(...arguments),this.__storeLoaderId="storeLoader"}renderControl(){var e,t,r,o,i;const s=null===(e=this.nucleon)||void 0===e?void 0:e.data;return s?n(R||(R=F` <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <p class="grid gap-x-s text-right text-s leading-m border-dashed border rounded border-contrast-20 whitespace-nowrap overflow-auto" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 2px);grid-template-columns:1fr min-content"> <span><foxy-i18n key="subtotal" infer=""></foxy-i18n>:</span> <span>${0}</span> <span><foxy-i18n infer="" key="total_shipping"></foxy-i18n>:</span> <span>${0} </span> <span><foxy-i18n infer="" key="total_tax"></foxy-i18n>:</span> <span>${0}</span> ${0} ${0} <span class="col-span-2 border-t border-dashed border-contrast-20 my-s"></span> <span class="col-span-2 flex gap-s justify-between items-center"> <span></span> <span class="text-xl font-medium leading-xs"> <foxy-i18n infer="" key="total"></foxy-i18n>: ${0} </span> </span> </p> `),c(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()),this.__renderPrice(s.total_item_price),this.__renderPrice(s.total_shipping,!0),this.__renderPrice(s.total_tax,!0),null===(r=null===(t=null==s?void 0:s._embedded)||void 0===t?void 0:t["fx:gift_card_code_logs"])||void 0===r?void 0:r.map((e=>{var t;const r=e._embedded["fx:gift_card"].name;return n(I||(I=F` <span>${0}:</span> <span>${0}</span> `),r,this.__renderPrice(null!==(t=e.balance_adjustment)&&void 0!==t?t:0,!0))})),null===(i=null===(o=null==s?void 0:s._embedded)||void 0===o?void 0:o["fx:discounts"])||void 0===i?void 0:i.map((e=>n(M||(M=F` <span data-testclass="discount">${0}:</span> <span>${0}</span> `),e.name,this.__renderPrice(e.amount,!0)))),this.__renderPrice(s.total_order)):n(T||(T=F``))}get __storeHref(){var e,t,r;return null===(r=null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:store"])||void 0===r?void 0:r.href}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}__renderPrice(e,t=!1){var r,o,i;const s=(null===(r=this.__store)||void 0===r?void 0:r.use_international_currency_symbol)?"code":"symbol",a=null===(i=null===(o=this.nucleon)||void 0===o?void 0:o.data)||void 0===i?void 0:i.currency_code;return n(q||(q=F` <foxy-i18n class="${0}" infer="" key="price" .options="${0}"> </foxy-i18n> `),t&&0!==e?e>0?"text-success":"text-error":"",{currencyDisplay:s,signDisplay:t?"exceptZero":"auto",amount:`${e} ${a}`})}});let V,D,H=e=>e;const z=l(d(e,"cart-form"));class B extends z{constructor(){super(...arguments),this.paymentCardEmbedUrl=null,this.getCustomerPageUrl=null,this.itemCategories=null,this.templateSets=null,this.localeCodes=null,this.languages=null,this.customers=null,this.countries=null,this.regions=null,this.coupons=null,this.__languagesLoaderId="languagesLoader",this.__customerLoaderId="customerLoader",this.__paymentMethodUriGetDisplayValueOptions=e=>{var t,r,o,i;const s=null!==(o=null===(r=null===(t=null==e?void 0:e._embedded)||void 0===t?void 0:t["fx:payments"])||void 0===r?void 0:r[0])&&void 0!==o?o:null,n=null==s?void 0:s.cc_exp_month,a=null==s?void 0:s.cc_exp_year,l=null===(i=null==s?void 0:s.cc_number_masked)||void 0===i?void 0:i.replace(/x/g,""),d=null==s?void 0:s.cc_type;return{cc_exp_month:null!=n?n:"",cc_exp_year:null!=a?a:"",cc_last4:null!=l?l:"",cc_type:null!=d?d:"",context:l&&n&&a&&d?"":"empty"}},this.__paymentMethodUriSetValue=e=>{try{const t=new URL(e);t.search="",t.pathname+="/payments",this.edit({payment_method_uri:t.toString()})}catch(e){this.edit({payment_method_uri:""})}},this.__paymentMethodUriFilters=[{label:"filter_type",type:h.String,path:"payments:type",list:[{label:"filter_type_value_purchase_order",value:"purchase_order"},{label:"filter_type_value_amazon_mws",value:"amazon_mws"},{label:"filter_type_value_paypal_ec",value:"paypal_ec"},{label:"filter_type_value_paypal",value:"paypal"},{label:"filter_type_value_hosted",value:"hosted"},{label:"filter_type_value_ogone",value:"ogone"}]},{label:"filter_cc_type",type:h.String,path:"payments:cc_type",list:[{label:"filter_cc_type_value_mastercard",value:"mastercard"},{label:"filter_cc_type_value_discover",value:"discover"},{label:"filter_cc_type_value_unionpay",value:"unionpay"},{label:"filter_cc_type_value_maestro",value:"maestro"},{label:"filter_cc_type_value_diners",value:"diners"},{label:"filter_cc_type_value_visa",value:"visa"},{label:"filter_cc_type_value_amex",value:"amex"},{label:"filter_cc_type_value_jcb",value:"jcb"}]},{label:"filter_cc_number_masked",type:h.String,path:"payments:cc_number_masked"}],this.__customerUriSetValue=e=>{this.edit({customer_uri:e,customer_email:""})},this.__customerUriOptions=[{label:"filter_email",path:"email",type:h.String},{label:"filter_is_anonymous",path:"is_anonymous",type:h.String,list:[{value:"false",label:"filter_is_anonymous_value_false"},{value:"true",label:"filter_is_anonymous_value_true"}]}]}static get properties(){return o(o({},super.properties),{},{paymentCardEmbedUrl:{attribute:"payment-card-embed-url"},getCustomerPageUrl:{attribute:!1},itemCategories:{attribute:"item-categories"},templateSets:{attribute:"template-sets"},localeCodes:{attribute:"locale-codes"},languages:{},customers:{},countries:{},regions:{},coupons:{}})}static get v8n(){return[({billing_first_name:e})=>!e||e.length<=50||"billing-first-name:v8n_too_long",({billing_last_name:e})=>!e||e.length<=50||"billing-last-name:v8n_too_long",({billing_state:e})=>!e||e.length<=50||"billing-state:v8n_too_long",({billing_city:e})=>!e||e.length<=50||"billing-city:v8n_too_long",({billing_phone:e})=>!e||e.length<=50||"billing-phone:v8n_too_long",({billing_company:e})=>!e||e.length<=50||"billing-company:v8n_too_long",({billing_address2:e})=>!e||e.length<=100||"billing-address-two:v8n_too_long",({billing_address1:e})=>!e||e.length<=100||"billing-address-one:v8n_too_long",({billing_postal_code:e})=>!e||e.length<=50||"billing-postal-code:v8n_too_long",({shipping_first_name:e})=>!e||e.length<=50||"shipping-first-name:v8n_too_long",({shipping_last_name:e})=>!e||e.length<=50||"shipping-last-name:v8n_too_long",({shipping_state:e})=>!e||e.length<=50||"shipping-state:v8n_too_long",({shipping_city:e})=>!e||e.length<=50||"shipping-city:v8n_too_long",({shipping_phone:e})=>!e||e.length<=50||"shipping-phone:v8n_too_long",({shipping_company:e})=>!e||e.length<=50||"shipping-company:v8n_too_long",({shipping_address2:e})=>!e||e.length<=100||"shipping-address-two:v8n_too_long",({shipping_address1:e})=>!e||e.length<=100||"shipping-address-one:v8n_too_long",({shipping_postal_code:e})=>!e||e.length<=50||"shipping-postal-code:v8n_too_long"]}get hiddenSelector(){const e=[super.hiddenSelector.toString()];return this.form.customer_uri?e.unshift("general:customer-email"):e.unshift("billing:payment-method-uri"),this.data?this.form.use_customer_shipping_address||e.unshift("shipping:shipping-address"):e.unshift("applied-coupon-codes","custom-fields","attributes","shipping","billing","totals","items"),new i(e.join(" ").trim())}renderHeaderActions(){return n(V||(V=H` <foxy-internal-cart-form-create-session-action infer="view-as-customer"> </foxy-internal-cart-form-create-session-action> `))}renderBody(){var e,t,r,o,i,s,a,l,d,u,m;const p=null===(e=this.data)||void 0===e?void 0:e._links,_=this.__customer;return n(D||(D=H` ${0} <foxy-internal-summary-control infer="general"> <foxy-internal-resource-picker-control layout="summary-item" first="${0}" infer="template-set-uri" item="foxy-template-set-card"> </foxy-internal-resource-picker-control> <foxy-internal-select-control layout="summary-item" infer="language" .options="${0}"> </foxy-internal-select-control> <foxy-internal-text-control layout="summary-item" infer="customer-email"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-async-list-control infer="items" class="min-w-0" first="${0}" alert wide item="foxy-item-card" form="foxy-item-form" .related="${0}" .itemProps="${0}" .formProps="${0}"> </foxy-internal-async-list-control> <foxy-internal-cart-form-totals-control class="min-w-0" infer="totals"> </foxy-internal-cart-form-totals-control> <foxy-internal-async-list-control infer="applied-coupon-codes" class="min-w-0" first="${0}" item="foxy-applied-coupon-code-card" form="foxy-applied-coupon-code-form" alert .related="${0}"> </foxy-internal-async-list-control> <foxy-internal-resource-picker-control first="${0}" infer="customer-uri" item="foxy-customer-card" show-copy-id-button .getItemUrl="${0}" .setValue="${0}" .filters="${0}"> </foxy-internal-resource-picker-control> <foxy-internal-summary-control infer="billing"> <foxy-internal-resource-picker-control placeholder="${0}" layout="summary-item" first="${0}" infer="payment-method-uri" item="foxy-internal-cart-form-payment-method-card" form="foxy-internal-cart-form-payment-method-form" .getDisplayValueOptions="${0}" .formProps="${0}" .setValue="${0}" .filters="${0}"> </foxy-internal-resource-picker-control> <foxy-internal-cart-form-address-summary-item countries="${0}" regions="${0}" infer="billing-address" type="billing" .customer="${0}"> </foxy-internal-cart-form-address-summary-item> </foxy-internal-summary-control> <foxy-internal-summary-control infer="shipping"> <foxy-internal-switch-control infer="use-customer-shipping-address" invert> </foxy-internal-switch-control> <foxy-internal-cart-form-address-summary-item countries="${0}" regions="${0}" infer="shipping-address" type="shipping" .customer="${0}"> </foxy-internal-cart-form-address-summary-item> </foxy-internal-summary-control> <foxy-internal-async-list-control infer="custom-fields" class="min-w-0" first="${0}" limit="5" item="foxy-custom-field-card" form="foxy-custom-field-form" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="attributes" class="min-w-0" first="${0}" limit="5" item="foxy-attribute-card" form="foxy-attribute-form" alert> </foxy-internal-async-list-control> ${0} <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> `),this.renderHeader(),c(null!==(t=this.templateSets)&&void 0!==t?t:void 0),this.__languageOptions,c(this.__itemsHref),this.href?[this.href]:[],{"locale-codes":this.localeCodes},{"item-categories":this.itemCategories,"locale-codes":this.localeCodes,store:null===(r=this.data)||void 0===r?void 0:r._links["fx:store"].href},c(null==p?void 0:p["fx:applied_coupon_codes"].href),this.href?[this.href]:[],c(null!==(o=this.customers)&&void 0!==o?o:void 0),this.getCustomerPageUrl,this.__customerUriSetValue,this.__customerUriOptions,this.__paymentMethodUriPlaceholder,c(this.__transactionsWithPaymentsUrl),this.__paymentMethodUriGetDisplayValueOptions,{"default-payment-method":null!==(i=null==_?void 0:_._links["fx:default_payment_method"].href)&&void 0!==i?i:"","payment-card-embed-url":null!==(s=this.__pickerPaymentCardEmbedUrl)&&void 0!==s?s:""},this.__paymentMethodUriSetValue,this.__paymentMethodUriFilters,c(null!==(a=this.countries)&&void 0!==a?a:void 0),c(null!==(l=this.regions)&&void 0!==l?l:void 0),_,c(null!==(d=this.countries)&&void 0!==d?d:void 0),c(null!==(u=this.regions)&&void 0!==u?u:void 0),_,c(null==p?void 0:p["fx:custom_fields"].href),c(null==p?void 0:p["fx:attributes"].href),super.renderBody(),c(null!==(m=this.languages)&&void 0!==m?m:void 0),this.__languagesLoaderId,(()=>this.requestUpdate()),c(this.__customerHref),this.__customerLoaderId,(()=>this.requestUpdate()))}get __paymentMethodUriPlaceholder(){var e,t,r,o,i,s;const n=null===(e=this.__customer)||void 0===e?void 0:e._embedded["fx:default_payment_method"],a=null!==(t=null==n?void 0:n.cc_exp_month)&&void 0!==t?t:null,l=null!==(r=null==n?void 0:n.cc_exp_year)&&void 0!==r?r:null,d=null!==(i=null===(o=null==n?void 0:n.cc_number_masked)||void 0===o?void 0:o.replace(/x/g,""))&&void 0!==i?i:null,c=null!==(s=null==n?void 0:n.cc_type)&&void 0!==s?s:null;return this.t("billing.payment-method-uri.value",{cc_exp_month:null!=a?a:"",cc_exp_year:null!=l?l:"",cc_last4:null!=d?d:"",cc_type:null!=c?c:"",context:d&&a&&l&&c?"":"empty"})}get __transactionsWithPaymentsUrl(){var e,t;try{const r=new URL(null!==(t=null===(e=this.__customer)||void 0===e?void 0:e._links["fx:transactions"].href)&&void 0!==t?t:"");return r.searchParams.set("zoom","payments"),r.toString()}catch(e){}}get __pickerPaymentCardEmbedUrl(){var e,t;try{const r=new URL(null!==(e=this.paymentCardEmbedUrl)&&void 0!==e?e:""),o=p(null!==(t=this.form.template_set_uri)&&void 0!==t?t:"");if(null!==o)return r.searchParams.set("template_set_id",String(o)),r.toString()}catch(e){}}get __customerHref(){var e;try{const t=new URL(null!==(e=this.form.customer_uri)&&void 0!==e?e:"");return t.searchParams.set("zoom","default_payment_method,default_billing_address,default_shipping_address"),t.toString()}catch(e){}}get __itemsHref(){var e,t;try{const r=new URL(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:items"].href)&&void 0!==t?t:"");return r.searchParams.set("zoom","item_options"),r.toString()}catch(e){}}get __languageOptions(){var e,t;const r=this.renderRoot.querySelector(`#${this.__languagesLoaderId}`);return Object.entries(null!==(t=null===(e=null==r?void 0:r.data)||void 0===e?void 0:e.values)&&void 0!==t?t:{}).map((([e,t])=>({rawLabel:t,value:e})))}get __customer(){var e;return null===(e=this.renderRoot.querySelector(`#${this.__customerLoaderId}`))||void 0===e?void 0:e.data}}customElements.define("foxy-cart-form",B);export{B as CartForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-e2d5673b.js";import{a as e}from"./shared-47f3f5f5.js";import{I as t}from"./shared-6740e365.js";import{h as r}from"./shared-ba5c42c7.js";import"./foxy-spinner.js";import"./shared-d4b77609.js";import"./shared-eb49be2e.js";import"./shared-5a469962.js";import"./shared-b2cbe727.js";import"./shared-3d353eb8.js";import"./shared-8f9014ff.js";import"./shared-930e68b7.js";import"./shared-9b138652.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-4e709717.js";let i,s,a,o,C=e=>e;const d=e(t,"client-card");class l extends d{static get defaultImageSrc(){return"data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0_2168_15479)'%3E%3Crect width='40' height='40' fill='%23E8E8E8'/%3E%3Cpath d='M6.93609 0H0V6.93609L6.93609 0Z' fill='white'/%3E%3Cpath d='M0 8.35031V16.2326L16.2326 0H8.35031L0 8.35031Z' fill='white'/%3E%3Cpath d='M23.4667 20C23.4667 21.9146 21.9146 23.4667 20 23.4667C18.0854 23.4667 16.5333 21.9146 16.5333 20C16.5333 18.0854 18.0854 16.5333 20 16.5333C21.9146 16.5333 23.4667 18.0854 23.4667 20Z' fill='white'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M17.6468 0L0 17.6468V25.529L5.75703 19.772C5.9523 19.5767 6.26888 19.5767 6.46414 19.772C6.6594 19.9673 6.6594 20.2839 6.46414 20.4791L0 26.9433V34.8255L7.67907 27.1464C7.87433 26.9512 8.19091 26.9512 8.38617 27.1464C8.58144 27.3417 8.58144 27.6583 8.38617 27.8536L0 36.2397V40H4.12198L12.4755 31.6464C12.6708 31.4512 12.9874 31.4512 13.1826 31.6464C13.3779 31.8417 13.3779 32.1583 13.1826 32.3536L5.5362 40H13.4185L19.8826 33.5359C20.0779 33.3406 20.3944 33.3406 20.5897 33.5359C20.785 33.7311 20.785 34.0477 20.5897 34.243L14.8327 40H22.7149L40 22.7149V14.8327L34.3536 20.4791C34.1583 20.6744 33.8417 20.6744 33.6464 20.4791C33.4512 20.2839 33.4512 19.9673 33.6464 19.772L40 13.4185V5.5362L32.3536 13.1826C32.1583 13.3779 31.8417 13.3779 31.6464 13.1826C31.4512 12.9874 31.4512 12.6708 31.6464 12.4755L40 4.12198V0H36.2397L27.8536 8.38617C27.6583 8.58144 27.3417 8.58144 27.1464 8.38617C26.9512 8.19091 26.9512 7.87433 27.1464 7.67907L34.8255 0H26.9433L20.5897 6.35355C20.3944 6.54882 20.0779 6.54882 19.8826 6.35355C19.6873 6.15829 19.6873 5.84171 19.8826 5.64645L25.529 0H17.6468ZM12.6461 28.5796L11.4204 27.3539C10.7435 26.677 10.7435 25.5795 11.4204 24.9026L11.7742 24.5489C12.0955 24.2275 12.1662 23.7396 11.992 23.3199C11.8178 22.9003 11.421 22.6 10.9668 22.6H10.4667C9.50938 22.6 8.73334 21.824 8.73334 20.8667V19.1333C8.73334 18.176 9.50938 17.4 10.4667 17.4H10.9668C11.421 17.4 11.8178 17.0997 11.992 16.6801C12.1662 16.2604 12.0955 15.7725 11.7742 15.4511L11.4204 15.0974C10.7435 14.4205 10.7435 13.323 11.4204 12.6461L12.6461 11.4204C13.323 10.7435 14.4205 10.7435 15.0974 11.4204L15.4511 11.7742C15.7725 12.0955 16.2604 12.1662 16.6801 11.992C17.0997 11.8178 17.4 11.421 17.4 10.9668V10.4667C17.4 9.50938 18.176 8.73334 19.1333 8.73334H20.8667C21.824 8.73334 22.6 9.50938 22.6 10.4667V10.9668C22.6 11.421 22.9003 11.8178 23.3199 11.992C23.7396 12.1662 24.2275 12.0955 24.5489 11.7742L24.9026 11.4204C25.5795 10.7435 26.677 10.7435 27.3539 11.4204L28.5796 12.6461C29.2565 13.323 29.2565 14.4205 28.5796 15.0974L28.2259 15.4511C27.9045 15.7725 27.8338 16.2604 28.0081 16.6801C28.1822 17.0997 28.579 17.4 29.0333 17.4H29.5333C30.4906 17.4 31.2667 18.176 31.2667 19.1333V20.8667C31.2667 21.824 30.4906 22.6 29.5333 22.6H29.0332C28.579 22.6 28.1822 22.9003 28.0081 23.3199C27.8338 23.7396 27.9045 24.2275 28.2259 24.5489L28.5796 24.9026C29.2565 25.5795 29.2565 26.677 28.5796 27.3539L27.3539 28.5796C26.677 29.2565 25.5795 29.2565 24.9026 28.5796L24.5489 28.2259C24.2275 27.9045 23.7396 27.8338 23.3199 28.0081C22.9003 28.1822 22.6 28.579 22.6 29.0333V29.5333C22.6 30.4906 21.824 31.2667 20.8667 31.2667H19.1333C18.176 31.2667 17.4 30.4906 17.4 29.5333V29.0333C17.4 28.579 17.0997 28.1822 16.6801 28.0081C16.2604 27.8338 15.7725 27.9045 15.4511 28.2259L15.0974 28.5796C14.4205 29.2565 13.323 29.2565 12.6461 28.5796Z' fill='white'/%3E%3Cpath d='M40 24.1291L24.1291 40H32.0114L40 32.0114V24.1291Z' fill='white'/%3E%3Cpath d='M40 33.4256L33.4256 40H40V33.4256Z' fill='white'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0_2168_15479'%3E%3Crect width='40' height='40' fill='white'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E%0A"}renderBody(){const e=l.defaultImageSrc,t=this.data;return r(i||(i=C` <figure class="flex" 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="${0}" @error="${0}"> <figcaption class="min-w-0 flex-1 leading-s -my-xs"> <p class="text-m truncate text-body font-medium"> ${0} </p> <p class="text-s truncate text-secondary"> ${0} </p> <p class="text-s truncate text-tertiary"> ${0} • ${0} </p> </figcaption> </figure> `),(null==t?void 0:t.company_logo)||e,this.t("image_alt"),(t=>t.currentTarget.src=e),(null==t?void 0:t.project_name.trim())||r(s||(s=C`<foxy-i18n infer="" key="no_project_name"></foxy-i18n>`)),(null==t?void 0:t.project_description.trim())||r(a||(a=C`<foxy-i18n infer="" key="no_project_description"></foxy-i18n>`)),t?new URL(t.redirect_uri).host:"",(null==t?void 0:t.company_name)||r(o||(o=C`<foxy-i18n infer="" key="no_company_name"></foxy-i18n>`)))}}customElements.define("foxy-client-card",l);export{l as ClientCard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-a449033a.js";import"./shared-5c8931a0.js";import{I as t}from"./shared-fc155659.js";import{R as r,a as e}from"./shared-47f3f5f5.js";import{B as o}from"./shared-8f9014ff.js";import{h as n}from"./shared-ba5c42c7.js";import"./shared-0557539b.js";import"./shared-6bf89411.js";import"./shared-5a469962.js";import"./shared-b3fe8c63.js";import"./shared-e55c8dc4.js";import"./shared-27c16d99.js";import"./shared-0e25ac65.js";import"./shared-360196ad.js";import"./shared-66278c21.js";import"./shared-0b8768db.js";import"./shared-5212ef4f.js";import"./shared-3d353eb8.js";import"./shared-930e68b7.js";import"./shared-41c9c53f.js";import"./shared-53e42a77.js";import"./shared-9b138652.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-4e709717.js";import"./shared-d0aed1c1.js";import"./shared-1c985317.js";import"./shared-58add5b4.js";import"./foxy-copy-to-clipboard.js";import"./shared-34a87829.js";import"./shared-d4b77609.js";import"./shared-eb49be2e.js";import"./shared-bf8d95b9.js";import"./shared-b2cbe727.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let s,a=t=>t;const i=r(e(t,"client-form"));class c extends i{get headerSubtitleOptions(){var t,r;try{return{context:"with_domain",domain:new URL(null!==(r=null===(t=this.data)||void 0===t?void 0:t.redirect_uri)&&void 0!==r?r:"").hostname}}catch(t){return super.headerSubtitleOptions}}get readonlySelector(){const t=["client-secret"];return(this.data||this.in({busy:"fetching"}))&&t.push("client-id"),new o(`${t.join(" ")} ${super.readonlySelector.toString()}`)}get hiddenSelector(){const t=[];return this.data||this.in({busy:"fetching"})||t.push("client-secret"),new o(`${t.join(" ")} ${super.hiddenSelector.toString()}`)}renderBody(){return n(s||(s=a` ${0} <div class="grid grid-cols-2 gap-m"> <foxy-internal-text-control class="col-span-2" infer="client-id"> </foxy-internal-text-control> <foxy-internal-text-control class="col-span-2" infer="client-secret"> </foxy-internal-text-control> <foxy-internal-text-control class="col-span-2" infer="redirect-uri"> </foxy-internal-text-control> <foxy-internal-text-control class="col-span-2" infer="project-name"> </foxy-internal-text-control> <foxy-internal-text-area-control class="col-span-2" infer="project-description"> </foxy-internal-text-area-control> <foxy-internal-text-control infer="company-name"></foxy-internal-text-control> <foxy-internal-text-control infer="company-url"></foxy-internal-text-control> <foxy-internal-text-control class="col-span-2" infer="company-logo"> </foxy-internal-text-control> <foxy-internal-text-control class="col-span-2" infer="contact-name"> </foxy-internal-text-control> <foxy-internal-text-control infer="contact-email"></foxy-internal-text-control> <foxy-internal-text-control infer="contact-phone"></foxy-internal-text-control> </div> ${0} `),this.renderHeader(),super.renderBody())}}customElements.define("foxy-client-form",c);export{c as ClientForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./foxy-spinner.js";import{_ as e,F as t}from"./shared-
|
|
1
|
+
import"./foxy-spinner.js";import{_ as e,F as t}from"./shared-8f9014ff.js";import{h as s}from"./shared-ba5c42c7.js";import{a as r}from"./shared-47f3f5f5.js";import{C as i}from"./shared-41c9c53f.js";import{N as n}from"./shared-9b138652.js";import{r as a}from"./shared-5fd5805c.js";import{s as o}from"./shared-53e476fd.js";import"./shared-d4b77609.js";import"./shared-eb49be2e.js";import"./shared-5a469962.js";import"./shared-b2cbe727.js";import"./shared-3d353eb8.js";import"./shared-930e68b7.js";import"./shared-53e42a77.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";let l,d=e=>e;const h=i(r(n));class p extends h{constructor(){super(),this.props={},this.__pageFetchEventHandler=e=>this.__handlePageFetchEvent(e),this.item="foxy-null"}static get properties(){return e(e({},super.properties),{},{props:{type:Object},item:{type:String}})}get item(){return this.__item}set item(e){const t=null!=e?e:"foxy-null";this.__renderItem="string"==typeof t?new Function("ctx",`return ctx.html\`\n <${t}\n disabledcontrols=\${ctx.disabledControls.toString()}\n readonlycontrols=\${ctx.readonlyControls.toString()}\n hiddencontrols=\${ctx.hiddenControls.toString()}\n data-testclass="items"\n related=\${JSON.stringify(ctx.related)}\n parent=\${ctx.parent}\n group=\${ctx.group}\n href=\${ctx.href}\n lang=\${ctx.lang}\n ns="\${ctx.ns} \${customElements.get('${t}')?.defaultNS ?? ''}"\n ?disabled=\${ctx.disabled}\n ?readonly=\${ctx.readonly}\n ?hidden=\${ctx.hidden}\n .simplifyNsLoading=\${ctx.simplifyNsLoading}\n .templates=\${ctx.templates}\n ...=\${ctx.spread(ctx.props)}\n >\n </${t}>\``):t,this.__item=e,this.requestUpdate()}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.addEventListener("fetch",this.__pageFetchEventHandler)}render(){let e=[];return e=this.in("busy")?[{key:"stalled",href:"foxy://collection-page/stall",data:null}]:this.in("fail")?[{key:"failed",href:"foxy://collection-page/fail",data:null}]:this.in({idle:"template"})||0===this.__items.length?[{key:"empty",href:"",data:null}]:this.__items.map((e=>({key:e._links.self.href,href:e._links.self.href,data:e}))),s(l||(l=d`${0}`),a(e,(e=>e.key),((t,r)=>{var i,n,a,l,d;return null===(i=this.__renderItem)||void 0===i?void 0:i.call(this,{simplifyNsLoading:this.simplifyNsLoading,disabledControls:this.disabledControls,readonlyControls:this.readonlyControls,hiddenControls:this.hiddenControls,templates:this.templates,disabled:this.disabled,readonly:this.readonly,previous:null!==(a=null===(n=e[r-1])||void 0===n?void 0:n.data)&&void 0!==a?a:null,related:this.related,hidden:this.hidden,parent:this.href,spread:o,props:this.props,group:this.group,lang:this.lang,data:t.data,href:t.href,next:null!==(d=null===(l=e[r+1])||void 0===l?void 0:l.data)&&void 0!==d?d:null,ns:this.ns,html:s})})))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("fetch",this.__pageFetchEventHandler)}get __items(){var e,t;return Array.from(Object.values(null!==(t=null===(e=this.form)||void 0===e?void 0:e._embedded)&&void 0!==t?t:{})).reduce(((e,t)=>[...e,...t]),[])}__handlePageFetchEvent(e){if(!(e instanceof t)||e.target===this)return;const{method:s,url:r}=e.request;return"GET"===s?"foxy://collection-page/stall"===r?this.__stallRequest(e):"foxy://collection-page/fail"===r?this.__failRequest(e):void 0:void 0}__stallRequest(e){e.stopImmediatePropagation(),e.respondWith(new Promise((()=>{})))}__failRequest(e){e.stopImmediatePropagation(),e.respondWith(Promise.resolve(new Response(null,{status:500})))}}customElements.define("foxy-collection-page",p);export{p as CollectionPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-360196ad.js";import"./foxy-collection-page.js";import"./shared-3d353eb8.js";import{o as e,aF as t,_ as s,R as r,F as a}from"./shared-8f9014ff.js";import{h as i,L as n}from"./shared-ba5c42c7.js";import{C as o}from"./shared-41c9c53f.js";import{N as d,s as l}from"./shared-9b138652.js";import{r as c}from"./shared-5fd5805c.js";import{I as h}from"./shared-930e68b7.js";import{i as p}from"./shared-0e19bda5.js";import{s as u}from"./shared-53e476fd.js";import"./shared-6bf89411.js";import"./shared-5a469962.js";import"./shared-47f3f5f5.js";import"./shared-66278c21.js";import"./foxy-spinner.js";import"./shared-d4b77609.js";import"./shared-eb49be2e.js";import"./shared-b2cbe727.js";import"./shared-53e42a77.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";const _=e({manual:(e,t)=>t.data}),g=e({error:(e,t)=>t.data}),m=e({first:(e,t)=>t.data,pages:[],error:null}),f=e({first:(e,t)=>{var s,r;return null!==(r=null===(s=t.data[0])||void 0===s?void 0:s._links.self.href)&&void 0!==r?r:""},pages:(e,t)=>t.data,error:null}),v=e({pages:(e,t)=>0===t.data.returned_items?e.pages:[...e.pages,t.data]}),y=e=>e.manual,b=t({id:"pages",initial:"idle",context:{first:"",pages:[],error:null,manual:!1},states:{busy:{invoke:{src:"sendGet",onError:{target:"fail",actions:g},onDone:[{target:"idle.empty",cond:(e,t)=>0==t.data.total_items},{target:"idle.end",cond:(e,t)=>t.data.returned_items<t.data.limit,actions:v},{target:"idle.paused.manual",cond:y,actions:v},{target:"idle.paused.auto",actions:v}]},on:{SET_MANUAL:{actions:_}}},fail:{on:{SET_MANUAL:{actions:_}}},idle:{initial:"empty",states:{paused:{states:{auto:{invoke:{src:"observeChildren"}},manual:{}},on:{RESUME:"#pages.busy",SET_MANUAL:[{cond:y,actions:_,target:".manual"},{actions:_,target:".auto"}]}},empty:{on:{SET_MANUAL:{actions:_}}},end:{on:{SET_MANUAL:{actions:_}}}}}},on:{SET_FIRST:[{cond:(e,t)=>0===t.data.trim().length,target:"idle.empty",actions:m},{target:"busy",actions:m}],SET_PAGES:[{cond:(e,t)=>0===t.data.length,target:"idle.empty",actions:f},{target:"idle.paused",actions:f}]}});let x,E,k,S=e=>e;const j=o(h(n));class R extends j{constructor(){var e;super(),e=this,this.props={},this.lang="",this.ns="",this.__group="",this.__fetchEventHandler=e=>this.__handleFetchEvent(e),this.__service=p(b.withConfig({services:{observeChildren:()=>e=>{const t=new IntersectionObserver((t=>{t.some((e=>e.isIntersecting))&&e("RESUME")}));return t.observe(this.renderRoot.children[this.renderRoot.children.length-1]),()=>t.disconnect()},sendGet:async function(t){var s;const r=t.pages[t.pages.length-1],a=null!==(s=null==r?void 0:r._links.next.href)&&void 0!==s?s:t.first,i=await new d.API(e).fetch(a);if(!i.ok)throw i;const n=await i.json();return e.__stopTrackingRumour(),d.Rumour(e.group).share({source:n._links.self.href,data:n}),e.__trackRumour(),n}}})),this.page="foxy-collection-page foxy-null"}static get properties(){return s(s({},super.properties),{},{manual:{type:Boolean,reflect:!0},first:{type:String,noAccessor:!0},pages:{type:Array,noAccessor:!0},group:{type:String},props:{type:Object},lang:{type:String},page:{type:String},ns:{type:String}})}get page(){return this.__page}set page(e){if("string"==typeof e){const t=e.split(" ").pop(),s=t?`item="${t}"`:"";this.__renderPage=new Function("ctx",`return ctx.html\`\n <${e}\n disabledcontrols=\${ctx.disabledControls.toString()}\n readonlycontrols=\${ctx.readonlyControls.toString()}\n hiddencontrols=\${ctx.hiddenControls.toString()}\n group=\${ctx.group}\n href=\${ctx.href}\n lang=\${ctx.lang}\n ns="\${ctx.ns} \${customElements.get('${e}')?.defaultNS ?? ''}"\n ${s}\n ?disabled=\${ctx.disabled}\n ?readonly=\${ctx.readonly}\n ?hidden=\${ctx.hidden}\n .templates=\${ctx.templates}\n ...=\${ctx.spread(ctx.props)}\n >\n </${e}>\``)}else this.__renderPage=e;this.__page=e,this.requestUpdate()}get first(){var e,t;return null!==(t=null===(e=this.__service.state)||void 0===e?void 0:e.context.first)&&void 0!==t?t:""}set first(e){this.__service.send({type:"SET_FIRST",data:e})}get pages(){var e,t;return null!==(t=null===(e=this.__service.state)||void 0===e?void 0:e.context.pages)&&void 0!==t?t:[]}set pages(e){this.__service.send({type:"SET_PAGES",data:e})}get group(){return this.__group}set group(e){var t;this.__group=e,null===(t=this.__stopTrackingRumour)||void 0===t||t.call(this),this.__trackRumour()}get manual(){var e;return!!(null===(e=this.__service.state)||void 0===e?void 0:e.context.manual)}set manual(e){this.__service.send({type:"SET_MANUAL",data:e})}in(e){var t;return!!(null===(t=this.__service.state)||void 0===t?void 0:t.matches(e))}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.addEventListener("fetch",this.__fetchEventHandler),this.__createService(),this.__trackRumour()}render(){var e,t,s;const r=this.pages.map((e=>({key:e._links.self.href,href:e._links.self.href})));return(null===(e=this.__service.state)||void 0===e?void 0:e.matches("busy"))?r.push({key:"stalled",href:"foxy://collection-pages/stall"}):(null===(t=this.__service.state)||void 0===t?void 0:t.matches("fail"))?r.push({key:"failed",href:"foxy://collection-pages/fail"}):(null===(s=this.__service.state)||void 0===s?void 0:s.matches({idle:"empty"}))&&r.push({key:"empty",href:""}),i(x||(x=S` ${0} ${0} `),c(r,(e=>e.key),((e,t)=>{var s;return this.__renderPage({disabledControls:this.disabledControls,readonlyControls:this.readonlyControls,hiddenControls:this.hiddenControls,templates:this.templates,disabled:this.disabled,readonly:this.readonly,hidden:this.hidden,spread:u,props:this.props,group:this.group,data:null!==(s=this.pages[t])&&void 0!==s?s:null,href:e.href,lang:this.lang,ns:this.ns,html:i})})),this.manual?this.in({idle:"paused"})?i(E||(E=S` <vaadin-button theme="small contrast" @click="${0}"> <foxy-i18n lang="${0}" key="load_more" ns="${0}"></foxy-i18n> </vaadin-button> `),(()=>this.__service.send("RESUME")),this.lang,this.ns):"":i(k||(k=S` <span></span> `)))}updated(e){super.updated(e),this.dispatchEvent(new d.UpdateEvent)}disconnectedCallback(){var e;super.disconnectedCallback(),this.removeEventListener("fetch",this.__fetchEventHandler),this.__service.stop(),null===(e=this.__stopTrackingRumour)||void 0===e||e.call(this)}__trackRumour(){this.__stopTrackingRumour=d.Rumour(this.group).track((e=>{try{0===this.pages.length?e({_links:{self:{href:this.first}}}):this.pages.map((t=>e(t)))}catch(e){if(!(e instanceof r.UpdateError))throw e;this.__service.send({type:"SET_FIRST",data:this.first})}}))}__createService(){this.__service.onTransition((({changed:e})=>e&&this.requestUpdate())).onChange((()=>this.requestUpdate())).start()}__handleFetchEvent(e){if(!(e instanceof a)||e.target===this)return;const{method:t,url:s}=e.request;return"GET"===t?"foxy://collection-pages/stall"===s?this.__stallRequest(e):"foxy://collection-pages/fail"===s?this.__failRequest(e):void this.__respondIfPossible(e):void 0}__respondIfPossible(e){const t=l(e.request.url,this.pages);t.ok&&(e.respondWith(Promise.resolve(t)),console.debug(`%c@foxy.io/elements::${this.localName}\n%c200%c GET ${e.request.url}`,"color: gray","background: gray; padding: 0 .2em; border-radius: .2em; color: white;",""))}__stallRequest(e){e.stopImmediatePropagation(),e.respondWith(new Promise((()=>{})))}__failRequest(e){var t;const s=null===(t=this.__service.state)||void 0===t?void 0:t.context.error,r=null!=s?s:new Response("Unknown error, details unavailable.",{status:500});e.stopImmediatePropagation(),e.respondWith(Promise.resolve(r))}}customElements.define("foxy-collection-pages",R);export{R as CollectionPages};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-34a87829.js";import"./shared-b2cbe727.js";import"./shared-d4b77609.js";import"./shared-3d353eb8.js";import{_ as t}from"./shared-8f9014ff.js";import{c as o,h as e,L as i}from"./shared-ba5c42c7.js";import{a as s}from"./shared-47f3f5f5.js";import{C as r}from"./shared-41c9c53f.js";import{I as n}from"./shared-930e68b7.js";import{i as a}from"./shared-53e42a77.js";import"./shared-5a469962.js";import"./shared-66278c21.js";import"./shared-6bf89411.js";import"./shared-bf8d95b9.js";import"./shared-eb49be2e.js";let c,d,l,h,p,u=t=>t;const b=r(s(n(i),"copy-to-clipboard"));class m extends b{constructor(){super(...arguments),this.layout=null,this.theme=null,this.icon=null,this.text=null,this.__state="idle"}static get properties(){return t(t({},super.properties),{},{layout:{},theme:{},text:{type:String},icon:{type:String},__state:{attribute:!1}})}static get styles(){return o(c||(c=u`.icon-button{position:relative;appearance:none;background:0 0;border:none;border-radius:var(--lumo-border-radius-s);color:inherit;font-size:inherit;padding:0;width:1.5em;height:1.5em;display:flex;justify-content:center;align-items:center}.icon-button::before{position:absolute;inset:0;content:' ';display:block;background:currentColor;opacity:.08;transition:opacity .15s ease;border-radius:var(--lumo-border-radius-s)}.icon-button:focus{outline:0;box-shadow:0 0 0 2px currentColor}.icon-button:disabled{opacity:.5;cursor:default}@media (hover:hover){.icon-button:not(:disabled):hover{cursor:pointer}.icon-button:not(:disabled):hover::before{opacity:.16}}iron-icon{--iron-icon-height:1em;--iron-icon-width:1em}`))}render(){var t,o,i;const s=null!==(t=this.layout)&&void 0!==t?t:"icon";let r="",n="";return"busy"===this.__state?(r="copying",n="icons:hourglass-empty"):"fail"===this.__state?(r="failed_to_copy",n="icons:error-outline"):"done"===this.__state?(r="done",n="icons:done"):(r="click_to_copy",n=null!==(o=this.icon)&&void 0!==o?o:"icons:content-copy"),e(d||(d=u` ${0} `),"icon"===s?e(l||(l=u` <button id="trigger" class="icon-button" ?disabled="${0}" @click="${0}"> <iron-icon icon="${0}"></iron-icon> </button> <vcf-tooltip position="bottom" style="--lumo-base-color:black" theme="light" for="trigger"> <span class="text-s" style="color:#fff"> <foxy-i18n infer="" key="${0}"></foxy-i18n> </span> </vcf-tooltip> `),this.disabled,this.__copy,n,r):e(h||(h=u` <vaadin-button theme="${0}" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="${0}"></foxy-i18n> ${0} </vaadin-button> `),a(null!==(i=this.theme)&&void 0!==i?i:void 0),this.disabled,this.__copy,r,"complete"===s?e(p||(p=u` <iron-icon style="--lumo-icon-size-m:1em;transform:translateY(-.1em)" icon="${0}"> </iron-icon> `),n):""))}__copy(){var t;"idle"===this.__state&&(this.__state="busy",navigator.clipboard.writeText(null!==(t=this.text)&&void 0!==t?t:"").then((()=>this.__state="done")).catch((()=>this.__state="fail")).then((()=>setTimeout((()=>this.__state="idle"),2e3))))}}customElements.define("foxy-copy-to-clipboard",m);export{m as CopyToClipboard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-5212ef4f.js";import"./foxy-spinner.js";import"./shared-
|
|
1
|
+
import"./shared-5212ef4f.js";import"./foxy-spinner.js";import"./shared-3d353eb8.js";import{h as t}from"./shared-ba5c42c7.js";import{C as e}from"./shared-41c9c53f.js";import{N as s}from"./shared-9b138652.js";import{T as i,a}from"./shared-47f3f5f5.js";import{c as r}from"./shared-4e709717.js";import"./shared-d4b77609.js";import"./shared-eb49be2e.js";import"./shared-5a469962.js";import"./shared-b2cbe727.js";import"./shared-8f9014ff.js";import"./shared-930e68b7.js";import"./shared-53e42a77.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";let n,o,d,l,c,p,h,m=t=>t;const u=i(e(a(s,"coupon-card")));class f extends u{render(){var e,s;const i=this.hiddenSelector;return t(n||(n=m` <div aria-busy="${0}" aria-live="polite" class="relative leading-m font-lumo text-m"> <div class="${0}"> ${0} ${0} ${0} </div> <div class="${0}"> <foxy-spinner data-testid="spinner" state="${0}" class="m-auto" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),this.in("busy"),r({"transition-opacity":!0,"opacity-0":!this.data}),i.matches("title",!0)?"":this.__renderTitle(),i.matches("description",!0)?"":this.__renderDescription(),i.matches("status",!0)?"":this.__renderStatus(),r({"pointer-events-none absolute inset-0 flex transition-opacity":!0,"opacity-0":!!this.data}),this.in("fail")?"error":this.in({idle:"template"})?"empty":"busy",this.lang,this.ns,null!==(s=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==s?s:"")}__renderTitle(){var e,s,i,a,r,n;const l=null!==(s=null===(e=this.data)||void 0===e?void 0:e.number_of_uses_to_date)&&void 0!==s?s:0,c=null!==(a=null===(i=this.data)||void 0===i?void 0:i.number_of_uses_allowed)&&void 0!==a?a:0;return t(o||(o=m` <div data-testid="title"> ${0} <div class="flex items-center justify-between"> <div class="font-medium truncate">${0}</div> <foxy-i18n options="${0}" class="text-tertiary text-s flex-shrink-0" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> </div> ${0} </div> `),this.renderTemplateOrSlot("title:before"),null!==(n=null===(r=this.data)||void 0===r?void 0:r.name)&&void 0!==n?n:t(d||(d=m`​`)),JSON.stringify({count:l,total:c}),this.lang,0===c?"uses_count":"uses_to_total_count",this.ns,this.renderTemplateOrSlot("title:after"))}__renderDescription(){let e=null;if(this.data){const s=this.data.coupon_discount_details,i=this.data.coupon_discount_type,a=this.ns;e=t(l||(l=m` <foxy-i18n options="${0}" lang="${0}" key="discount_summary" ns="${0}"> </foxy-i18n> `),JSON.stringify({params:{details:s,type:i,ns:a}}),this.lang,this.ns)}return t(c||(c=m` <div data-testid="description"> ${0} <div class="truncate text-s text-secondary">${0}</div> ${0} </div> `),this.renderTemplateOrSlot("description:before"),null!=e?e:t(p||(p=m`​`)),this.renderTemplateOrSlot("description:after"))}__renderStatus(){var e;const{start_date:s,end_date:i}=null!==(e=this.data)&&void 0!==e?e:{},a=s&&i?"complete":s?"from":i?"until":"any";return t(h||(h=m` <div data-testid="status"> ${0} <foxy-i18n options="${0}" class="block truncate text-s text-tertiary" lang="${0}" key="date_range_${0}" ns="${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("status:before"),JSON.stringify({start:s,end:i}),this.lang,a,this.ns,this.renderTemplateOrSlot("status:after"))}}customElements.define("foxy-coupon-card",f);export{f as CouponCard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-e2d5673b.js";import"./shared-3d353eb8.js";import{a as s}from"./shared-47f3f5f5.js";import{I as e}from"./shared-6740e365.js";import{h as t}from"./shared-ba5c42c7.js";import"./foxy-spinner.js";import"./shared-d4b77609.js";import"./shared-eb49be2e.js";import"./shared-5a469962.js";import"./shared-b2cbe727.js";import"./shared-8f9014ff.js";import"./shared-930e68b7.js";import"./shared-9b138652.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-4e709717.js";let r,o=s=>s;const i=s(e,"coupon-code-card");class a extends i{renderBody(){var s;return t(r||(r=o` <section class="h-s flex flex-col justify-center leading-xs"> <p class="flex items-center justify-between min-w-0"> <foxy-i18n infer="" class="block truncate text-m font-medium" key="line_1" .options="${0}"> </foxy-i18n> <foxy-i18n infer="" class="text-s text-tertiary" key="uses_count" .options="${0}"> </foxy-i18n> </p> <p class="text-s text-secondary min-w-0"> <foxy-i18n infer="" class="block truncate" key="line_2" .options="${0}"> </foxy-i18n> </p> </section> `),this.data,{count:null===(s=this.data)||void 0===s?void 0:s.number_of_uses_to_date},this.data)}}customElements.define("foxy-coupon-code-card",a);export{a as CouponCodeCard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-4eb52fc7.js";import"./shared-28ceb7f7.js";import"./shared-5c8931a0.js";import{I as r}from"./shared-fc155659.js";import"./foxy-admin-transaction-card.js";import{_ as e,B as s}from"./shared-8f9014ff.js";import{a as t}from"./shared-47f3f5f5.js";import{i as o}from"./shared-53e42a77.js";import{h as a}from"./shared-ba5c42c7.js";import"./shared-6bf89411.js";import"./shared-5a469962.js";import"./shared-eb49be2e.js";import"./shared-66278c21.js";import"./shared-9e0b104a.js";import"./shared-360196ad.js";import"./shared-fb859ece.js";import"./shared-4194ffe7.js";import"./shared-27c16d99.js";import"./shared-32b2d003.js";import"./shared-0e25ac65.js";import"./shared-b3fe8c63.js";import"./shared-e55c8dc4.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-d4b77609.js";import"./shared-b2cbe727.js";import"./shared-3d353eb8.js";import"./shared-930e68b7.js";import"./shared-41c9c53f.js";import"./shared-9b138652.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-5fd5805c.js";import"./shared-53e476fd.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-1c985317.js";import"./shared-58add5b4.js";import"./shared-4e709717.js";import"./foxy-pagination.js";import"./shared-742640c2.js";import"./shared-be2ce0e6.js";import"./shared-0b8768db.js";import"./shared-5212ef4f.js";import"./shared-59128d82.js";import"./shared-d0aed1c1.js";import"./foxy-copy-to-clipboard.js";import"./shared-34a87829.js";import"./shared-bf8d95b9.js";import"./shared-bab2ea2c.js";import"./shared-e2d5673b.js";import"./shared-6740e365.js";import"./foxy-nucleon-element.js";let i,d,n=r=>r;const m=t(r,"coupon-code-form");class c extends m{constructor(){super(...arguments),this.getTransactionPageHref=null,this.__transactionsItemRenderer=r=>{let e;if(r.data){const s=new URL(r.data._links["fx:transaction"].href);s.searchParams.set("zoom","folder,items"),e=s.toString()}else e=r.href;return a(i||(i=n`<foxy-admin-transaction-card infer="" href="${0}"></foxy-admin-transaction-card>`),e)}}static get properties(){return e(e({},super.properties),{},{getTransactionPageHref:{attribute:!1}})}static get v8n(){return[({code:r})=>!!r||"code:v8n_required",({code:r})=>!r||r.length<=50||"code:v8n_too_long",({code:r})=>!(null==r?void 0:r.includes(" "))||"code:v8n_has_spaces"]}get hiddenSelector(){const r=[super.hiddenSelector.toString()];return this.href||r.unshift("transactions"),new s(r.join(" ").trim())}renderBody(){var r,e;let s;try{const t=new URL(null!==(e=null===(r=this.data)||void 0===r?void 0:r._links["fx:coupon_code_transactions"].href)&&void 0!==e?e:"");t.searchParams.set("zoom","items"),s=t.toString()}catch(r){s=void 0}return a(d||(d=n` ${0} <foxy-internal-summary-control infer="general"> <foxy-internal-text-control layout="summary-item" infer="code"></foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-async-list-control first="${0}" infer="transactions" limit="5" .item="${0}" .getPageHref="${0}" hide-delete-button> </foxy-internal-async-list-control> ${0} `),this.renderHeader(),o(s),this.__transactionsItemRenderer,this.getTransactionPageHref,super.renderBody())}}customElements.define("foxy-coupon-code-form",c);export{c as CouponCodeForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-8df4ab18.js";import{I as e}from"./shared-fc155659.js";import{a as s}from"./shared-47f3f5f5.js";import{B as r}from"./shared-8f9014ff.js";import{h as o}from"./shared-ba5c42c7.js";import"./shared-34a87829.js";import"./shared-5a469962.js";import"./shared-66278c21.js";import"./shared-6bf89411.js";import"./shared-d4b77609.js";import"./shared-eb49be2e.js";import"./shared-bf8d95b9.js";import"./shared-0b8768db.js";import"./shared-5212ef4f.js";import"./shared-3d353eb8.js";import"./shared-930e68b7.js";import"./shared-41c9c53f.js";import"./shared-53e42a77.js";import"./shared-9b138652.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-4e709717.js";import"./shared-5fd5805c.js";import"./shared-d0aed1c1.js";import"./shared-53e476fd.js";import"./shared-360196ad.js";import"./shared-1c985317.js";import"./shared-58add5b4.js";import"./foxy-copy-to-clipboard.js";import"./shared-b2cbe727.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let t,d=e=>e;const a=s(e,"coupon-codes-form");class i extends a{constructor(){super(...arguments),this.__couponCodesGetValue=()=>{var e,s;return null!==(s=null===(e=this.form.coupon_codes)||void 0===e?void 0:e.map((e=>({value:e}))))&&void 0!==s?s:[]},this.__couponCodesSetValue=e=>{this.edit({coupon_codes:e.map((({value:e})=>e.split(" ").map((e=>e.trim())))).flat().filter(((e,s,r)=>r.indexOf(e)===s))})}}static get v8n(){return[({coupon_codes:e})=>e&&e.length>0||"coupon-codes:v8n_required"]}get readonlySelector(){const e=[super.readonlySelector.toString()];return this.href&&e.push("coupon-codes"),new r(e.join(" ").trim())}get hiddenSelector(){const e=["delete timestamps",super.hiddenSelector.toString()];return new r(e.join(" ").trim())}renderBody(){return o(t||(t=d` <foxy-internal-editable-list-control infer="coupon-codes" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> ${0} `),this.__couponCodesGetValue,this.__couponCodesSetValue,super.renderBody())}async _sendPost(e){const s=JSON.stringify(e),r=await this._fetch(this.parent,{body:s,method:"POST"});return this.status={key:"success"},r}}customElements.define("foxy-coupon-codes-form",i);export{i as CouponCodesForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-5212ef4f.js";import"./foxy-spinner.js";import"./shared-
|
|
1
|
+
import"./shared-5212ef4f.js";import"./foxy-spinner.js";import"./shared-3d353eb8.js";import{h as r}from"./shared-ba5c42c7.js";import{a as e}from"./shared-47f3f5f5.js";import{T as s}from"./shared-730acf1d.js";import"./shared-d4b77609.js";import"./shared-eb49be2e.js";import"./shared-5a469962.js";import"./shared-b2cbe727.js";import"./shared-8f9014ff.js";import"./shared-930e68b7.js";import"./shared-41c9c53f.js";import"./shared-53e42a77.js";import"./shared-6740e365.js";import"./shared-9b138652.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-4e709717.js";let t,a,i=r=>r;const o=e(s,"coupon-detail-card");class c extends o{constructor(){super(...arguments),this.__currencyDisplay="",this.__currency=""}renderBody(){return super.renderBody({title:e=>r(t||(t=i`${0} • ${0}`),e.name,e.code),subtitle:e=>{let s;try{s=Math.abs(e.amount_per).toLocaleString(this.lang||"en",{maximumFractionDigits:2,minimumFractionDigits:2,currencyDisplay:this.__currencyDisplay,currency:this.__currency,style:"currency"})}catch(r){s="--"}return r(a||(a=i` <span class="${0}">${0}</span> `),e.amount_per>0?"text-success":"text-error",s)}})}async _sendGet(){const r=await super._sendGet(),[e,s]=await Promise.all([super._fetch(r._links["fx:transaction"].href),super._fetch(r._links["fx:store"].href)]);return this.__currency=e.currency_code,this.__currencyDisplay=s.use_international_currency_symbol?"code":"symbol",r}}customElements.define("foxy-coupon-detail-card",c);export{c as CouponDetailCard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-a1297ca4.js";import"./shared-0fb0732a.js";import"./shared-597193f7.js";import{I as e}from"./shared-1e14a3fe.js";import{p as t,s as r}from"./shared-946a7af6.js";import{_ as o,B as s}from"./shared-7fec42f2.js";import{O as i,T as n}from"./shared-8874ec69.js";import{h as a,c as l,s as d}from"./shared-ba5c42c7.js";import"./shared-10da9bf0.js";import{R as c,a as u}from"./shared-7a87cd33.js";import{c as m}from"./shared-4e709717.js";import{r as p}from"./shared-5fd5805c.js";import"./shared-4cc42648.js";import"./shared-d3414cf0.js";import"./shared-1ae16c80.js";import"./shared-fc784ca0.js";import"./shared-bea6e6a7.js";import{I as f}from"./shared-77829fbb.js";import"./foxy-generate-codes-form.js";import"./foxy-item-category-card.js";import"./foxy-coupon-codes-form.js";import"./foxy-coupon-code-card.js";import"./foxy-coupon-code-form.js";import"./foxy-nucleon-element.js";import"./foxy-attribute-form.js";import"./foxy-attribute-card.js";import"./foxy-copy-to-clipboard.js";import"./foxy-discount-builder.js";import{i as h}from"./shared-53e42a77.js";import"./shared-c5c123c5.js";import"./shared-b5a0d106.js";import"./shared-433eea12.js";import"./shared-64e243c4.js";import"./shared-5963a49e.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-9e8344bf.js";import"./shared-5bcf861e.js";import"./shared-5b0c206b.js";import"./shared-0ea750af.js";import"./shared-c782b9fa.js";import"./shared-69074dae.js";import"./shared-65b2760f.js";import"./shared-cd96ff03.js";import"./shared-37869bac.js";import"./shared-d6a0954b.js";import"./shared-1da47f50.js";import"./shared-e1e4d8f5.js";import"./shared-53e476fd.js";import"./foxy-pagination.js";import"./shared-e502a7be.js";import"./shared-df7d368c.js";import"./shared-809d503c.js";import"./shared-a268320e.js";import"./shared-e54135f0.js";import"./shared-85ed835a.js";import"./shared-529a82a3.js";import"./shared-278b8790.js";import"./shared-5212ef4f.js";import"./shared-1091aa45.js";import"./foxy-form-dialog.js";import"./shared-c929504f.js";import"./shared-a704aaa4.js";import"./shared-005168e0.js";import"./shared-937e58bf.js";import"./shared-d0aed1c1.js";import"./shared-63c32024.js";import"./shared-2061be9a.js";import"./shared-f0fa0a88.js";import"./shared-95d34ae8.js";import"./shared-e7a2b31d.js";import"./shared-bab2ea2c.js";import"./shared-7d15992f.js";import"./shared-f8519b17.js";import"./shared-e4792d4a.js";import"./shared-4b24accb.js";import"./shared-a6e889a8.js";import"./shared-788173f2.js";import"./foxy-swipe-actions.js";import"./foxy-transaction-card.js";import"./shared-f9d1baff.js";let y,_,x,b,v=e=>e;customElements.define("foxy-internal-query-builder-control",class extends e{constructor(){super(...arguments),this.disableZoom=!1,this.disableOr=!1,this.operators=Object.values(i)}static get properties(){return o(o({},super.properties),{},{disableZoom:{type:Boolean,attribute:"disable-zoom"},disableOr:{type:Boolean,attribute:"disable-or"},operators:{type:Array}})}renderControl(){const{label:e,helperText:t,_errorMessage:r}=this,o=r&&!this.disabled&&!this.readonly;return a(y||(y=v` <section class="grid gap-s leading-xs"> <div ?hidden="${0}"> ${0} ${0} </div> <div class="bg-contrast-5 rounded" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> <foxy-query-builder infer="query-builder" style="--lumo-border-radius:var(--lumo-border-radius-s);--lumo-border-radius-l:var(--lumo-border-radius-s)" .operators="${0}" .value="${0}" ?disable-zoom="${0}" ?disable-or="${0}" @change="${0}"> </foxy-query-builder> </div> ${0} </section> `),!e&&!t,e?a(_||(_=v`<p class="text-l font-medium">${0}</p>`),e):"",t?a(x||(x=v`<p class="text-s text-secondary">${0}</p>`),t):"",this.operators,this._value,this.disableZoom,this.disableOr,(e=>{var t;const r=e.currentTarget;this._value=null!==(t=r.value)&&void 0!==t?t:""}),o?a(b||(b=v`<p class="text-s text-error">${0}</p>`),r):"")}});let g,j,$,w,C,k,A,V,R,S,q=e=>e;class O extends(c(e)){static get styles(){return[super.styles,l(g||(g=q`.gap-1px{gap:1px}.grid-vertical{grid-template:auto/var(--lumo-size-m) 1fr}:host([sm]) .sm-grid-horizontal{grid-template:auto/var(--lumo-size-m) 1fr var(--lumo-size-m) 1fr}`))]}renderControl(){const e=a(j||(j=q` <div class="flex items-center h-s"> <div class="w-m text-center leading-none uppercase font-medium text-xs text-contrast-20"> <foxy-i18n infer="" key="or"></foxy-i18n> </div> <div class="flex-1 border-t border-contrast-10"></div> <div class="w-m ml-s flex-shrink-0"></div> </div> `));return a($||($=q` <div class="mb-s" ?hidden="${0}"> <p class="font-medium text-body text-l" ?hidden="${0}">${0}</p> <p class="text-s text-secondary" ?hidden="${0}">${0}</p> </div> <div class="rounded bg-contrast-5" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} </div> <p class="text-s text-error mt-s" ?hidden="${0}"> ${0} </p> `),!this.label&&!this.helperText,!this.label,this.label,!this.helperText,this.helperText,p([...Object.entries(this._value||{}),null],((e,t)=>String(t)),((t,r)=>null===t?[r>0?e:"",this.__renderRule({onChange:({key:e,items:t})=>{var r;this._value=o(o({},this._value),{},{[e]:[...null!==(r=this._value[e])&&void 0!==r?r:[],...t]})}})]:[r>0?e:"",this.__renderRule({rule:{key:t[0],items:t[1]},onChange:e=>{var r,o;const s={},i=Object.keys(this._value);for(let n=0;n<i.length;n++){const a=i[n];if(a===t[0])if(e.key===a)s[a]=e.items;else{const t=null!==(r=this._value[e.key])&&void 0!==r?r:[];n>i.indexOf(e.key)?s[e.key]=[...t,...e.items]:(s[e.key]=[...e.items,...t],i.splice(i.indexOf(e.key),1))}else s[a]=null!==(o=this._value[a])&&void 0!==o?o:[]}this._value=s},onDelete:()=>{const e=o({},this._value);delete e[t[0]],this._value=e}})])),!this._errorMessage||this.disabled||this.readonly,this._errorMessage)}get _value(){var e;return null!==(e=super._value)&&void 0!==e?e:{}}set _value(e){super._value=e}__renderRule({rule:e,onDelete:t,onChange:r}){var o,s;const i=null!==(o=null==e?void 0:e.items)&&void 0!==o?o:[];return a(w||(w=q` <div class="flex items-center space-x-s" aria-label="${0}"> <div class="flex-1 bg-base rounded-s overflow-hidden border border-contrast-10"> <div class="bg-contrast-10"> <div class="grid gap-1px grid-vertical sm-grid-horizontal"> <div class="bg-base"> <div aria-hidden="true" class="${0}"> ${0} </div> </div> <div class="bg-base"> ${0} </div> <div class="bg-base"> <div class="${0}"> <div aria-hidden="true"> ${0} </div> </div> </div> <div class="bg-base"> <div class="bg-contrast-10 grid grid-cols-1 gap-1px"> ${0} </div> </div> </div> </div> </div> <div class="flex -mr-s self-start flex-col sm-flex-row flex-shrink-0 items-center border-t border-b border-transparent divide-y divide-transparent" ?hidden="${0}"> <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> ${0} </button> </div> </div> `),this.t("rule"),m({"text-tertiary":!this.readonly&&!this.disabled,"text-disabled":this.readonly||this.disabled,"w-m h-m":!0}),d(C||(C=q`<svg class="w-full h-full" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M18 8C12.48 8 8 12.48 8 18C8 23.52 12.48 28 18 28C23.52 28 28 23.52 28 18C28 12.48 23.52 8 18 8ZM18 26C13.59 26 10 22.41 10 18C10 13.59 13.59 10 18 10C22.41 10 26 13.59 26 18C26 22.41 22.41 26 18 26Z" class="fill-current"/><path fill-rule="evenodd" clip-rule="evenodd" d="M19.49 17.38C19.92 16.16 19.66 14.74 18.68 13.76C17.57 12.65 15.89 12.46 14.58 13.17L16.93 15.52L15.52 16.93L13.17 14.58C12.46 15.9 12.65 17.57 13.76 18.68C14.74 19.66 16.16 19.92 17.38 19.49L20.79 22.9C20.99 23.1 21.3 23.1 21.5 22.9L22.9 21.5C23.1 21.3 23.1 20.99 22.9 20.79L19.49 17.38Z" class="fill-current"/></svg>`)),this.__renderInput({value:null!==(s=null==e?void 0:e.key)&&void 0!==s?s:"",label:this.t("option_name"),onChange:e=>{void 0===e?null==t||t():r({key:e,items:i})}}),m({"flex items-center justify-center w-m h-m transition-colors":!0,"focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50":!0,"cursor-default text-tertiary":!(this.disabled||this.readonly),"text-disabled cursor-default":this.disabled||this.readonly}),d(k||(k=q`<svg class="w-full h-full" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.5 9.8C11.0088 9.8 9.8 11.0088 9.8 12.5V23.5C9.8 24.9912 11.0088 26.2 12.5 26.2H14C14.6627 26.2 15.2 25.6627 15.2 25C15.2 24.3373 14.6627 23.8 14 23.8H13.5C12.782 23.8 12.2 23.218 12.2 22.5V13.5C12.2 12.782 12.782 12.2 13.5 12.2H14C14.6627 12.2 15.2 11.6627 15.2 11C15.2 10.3373 14.6627 9.8 14 9.8H12.5Z" class="fill-current"/><path d="M22 9.8C21.3373 9.8 20.8 10.3373 20.8 11C20.8 11.6627 21.3373 12.2 22 12.2H22.5C23.218 12.2 23.8 12.782 23.8 13.5V22.5C23.8 23.218 23.218 23.8 22.5 23.8H22C21.3373 23.8 20.8 24.3373 20.8 25C20.8 25.6627 21.3373 26.2 22 26.2H23.5C24.9912 26.2 26.2 24.9912 26.2 23.5V12.5C26.2 11.0088 24.9912 9.8 23.5 9.8H22Z" class="fill-current"/></svg>`)),p(this.readonly?i:[...i,null],((e,t)=>t),((t,o)=>a(A||(A=q` <div class="bg-base"> ${0} </div> `),this.__renderInput({value:null!=t?t:"",label:t?String(o+1):this.t("add_value"),onChange:s=>{const n=[...i];s?null===t?n.push(s):n[o]=s:n.splice(o,1),e&&r({key:e.key,items:n})}})))),this.readonly||0===Object.keys(this._value).length,this.t("delete"),m({"box-content flex items-center justify-center":!0,"w-m h-m rounded-full transition-colors":!0,"text-secondary hover-bg-contrast-5 hover-text-error":!this.disabled,"cursor-default text-disabled":this.disabled,"focus-outline-none focus-ring-2 ring-primary-50":!0,"opacity-0 pointer-events-none":!e}),this.disabled||this.readonly||!e,(()=>null==t?void 0:t()),d(V||(V=q`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="text-l" style="width: 1.25em; height: 1.25em"><path stroke-linecap="round" stroke-linejoin="round" d="M15 12H9m12 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" /></svg>`)))}__renderInput(e){return a(R||(R=q` <label class="relative flex items-center cursor-text group text-tertiary"> <div class="relative flex-1 min-w-0 overflow-hidden"> <input placeholder="${0}" class="${0}" .value="${0}" ?disabled="${0}" @keydown="${0}" @change="${0}" @input="${0}"> </div> <span class="${0}"> ${0} </span> ${0} </label> `),e.label,m({"bg-base relative flex h-m px-s font-medium w-full":!0,"text-body":!this.disabled&&!this.readonly,"text-disabled":this.disabled,"text-secondary":this.readonly,"flex max-w-full whitespace-nowrap":!0,"focus-outline-none":!0}),e.value,this.disabled||this.readonly,(t=>{const r=t.currentTarget;"Backspace"!==t.key||r.value||e.onChange()}),(t=>{t.currentTarget.value||e.onChange()}),(t=>{const r=t.currentTarget;e.onChange(r.value)}),m({"font-tnum text-xs font-medium border border-current mr-s px-xs rounded-s":!0,"inline-block":!!e.value,"sr-only":!e.value,"text-body":!this.disabled&&!this.readonly,"text-disabled":this.disabled,"text-secondary":this.readonly}),this.t(e.label),this.disabled||this.readonly?"":a(S||(S=q` <div class="absolute inset-0 transition-colors bg-transparent group-hover-bg-contrast-5 pointer-events-none"></div> `)))}}customElements.define("foxy-internal-array-map-control",O);let T,H,L,I,M,B=e=>e;customElements.define("foxy-internal-coupon-form-rules-control",class extends e{renderControl(){var e,t;const r=this.nucleon,o=null!==(e=null==r?void 0:r.form.coupon_discount_details)&&void 0!==e?e:"",s=null!==(t=null==r?void 0:r.form.coupon_discount_type)&&void 0!==t?t:"quantity_amount",i=this.helperText,n=this.__renderRulesDescription(),l=this._errorMessage;return a(T||(T=B` <section> <div class="mb-s" ?hidden="${0}"> <p class="flex items-center justify-between space-x-m"> <span class="font-medium flex-1 text-l">${0}</span> <span class="min-w-0">${0}</span> </p> <p class="text-s text-secondary">${0}</p> </div> <foxy-discount-builder infer="discount-builder" .parsedValue="${0}" @change="${0}"> </foxy-discount-builder> ${0} ${0} </section> `),!this.label&&!i&&!n,this.label,this.__renderPreset(),i,{details:o,type:s,name:"Rules"},(e=>{const t=e.currentTarget.parsedValue,r=this.nucleon;null==r||r.edit({coupon_discount_details:t.details,coupon_discount_type:t.type})}),n?a(H||(H=B`<p class="text-s text-secondary mt-s">${0}</p>`),n):"",!l||this.disabled||this.readonly?"":a(L||(L=B`<p class="mt-s text-s leading-xs text-error">${0}</p>`),this._errorMessage))}__renderRulesDescription(){var e,t;const r=this.nucleon,o=null!==(e=null==r?void 0:r.form.coupon_discount_type)&&void 0!==e?e:"quantity_amount",s=null!==(t=null==r?void 0:r.form.coupon_discount_details)&&void 0!==t?t:"";return s?this.t("discount_summary",{params:{details:s,type:o,ns:this.ns}}):null}__renderPreset(){const e=this.nucleon,t=null==e?void 0:e.form.coupon_discount_details,r=null==e?void 0:e.form.coupon_discount_type,s=[{type:"quantity_amount",details:"allunits|2-2"},{type:"quantity_percentage",details:"allunits|5-10|10-20"},{type:"quantity_amount",details:"incremental|3-5"},{type:"quantity_percentage",details:"incremental|11-10|51-15|101-20"},{type:"quantity_percentage",details:"repeat|2-100"},{type:"quantity_percentage",details:"repeat|4-50"},{type:"quantity_amount",details:"single|5-10"},{type:"price_percentage",details:"single|99.99-10"}],i=s.find((e=>e.details===t&&e.type===r));return a(I||(I=B` <label data-testid="rules:preset" class="${0}"> <foxy-i18n class="sr-only" infer="" key="preset"></foxy-i18n> <span class="relative font-medium flex items-center"> <span class="truncate"> ${0} </span> <iron-icon class="icon-inline text-xl ml-xs -mr-xs" icon="icons:expand-more"></iron-icon> <select data-testclass="interactive editable" data-testid="rules:preset:select" class="opacity-0 absolute inset-0 focus-outline-none" ?disabled="${0}" @change="${0}"> ${0} <option value="custom" ?selected="${0}"> ${0} </option> </select> </span> </label> `),m({"whitespace-nowrap block ring-primary-50 rounded px-xs -mx-xs transition-colors":!0,"text-body hover-text-primary focus-within-ring-2":!this.disabled&&!this.readonly,"text-secondary":this.readonly,"text-disabled":this.disabled}),i?this.t("discount_summary",{params:o(o({},i),{},{ns:this.ns})}):this.t("custom_discount"),this.disabled||this.readonly,(e=>{var t,r;const o=e.currentTarget,i=s[o.selectedIndex],n=this.nucleon;null==n||n.edit({coupon_discount_details:null!==(t=null==i?void 0:i.details)&&void 0!==t?t:"",coupon_discount_type:null!==(r=null==i?void 0:i.type)&&void 0!==r?r:"quantity_amount"})}),s.map((e=>a(M||(M=B` <option value="${0}" ?selected="${0}"> ${0} </option> `),e.details,e===i,this.t("discount_summary",{params:o(o({},e),{},{ns:this.ns})})))),!i&&!!t&&!!r,this.t("custom_discount"))}});let Z,z,P=e=>e;const D=c(u(f,"coupon-form"));class G extends D{constructor(){var e;super(...arguments),e=this,this.getTransactionPageHref=null,this.__customerAttributeRestrictionsOperators=[i.Not,i.In],this.__customerAttributeRestrictionsGetValue=()=>{var e;const o=t(null!==(e=this.form.customer_attribute_restrictions)&&void 0!==e?e:"").filter((e=>Array.isArray(e)||"string"==typeof e.name)).map((e=>{if(Array.isArray(e))return e.filter((({name:e})=>"string"==typeof e)).map((({name:e,operator:t,value:r})=>({path:e,operator:t,value:r})));return{operator:e.operator,value:e.value,path:e.name}}));return r(o,!0)},this.__customerAttributeRestrictionsSetValue=e=>{const o=t(e).map((e=>{if(Array.isArray(e))return e.map((({path:e,operator:t,value:r})=>({name:e,path:"attributes",operator:t,value:r})));return{operator:e.operator,value:e.value,path:"attributes",name:e.path}}));this.edit({customer_attribute_restrictions:r(o,!0)})},this.__customerSubscriptionRestrictionsGetValue=()=>{var e;const t=null===(e=this.form.customer_subscription_restrictions)||void 0===e?void 0:e.split(",").map((e=>e.trim())).filter(((e,t,r)=>!!e&&r.indexOf(e)===t)).map((e=>({value:e})));return null!=t?t:[]},this.__customerSubscriptionRestrictionsSetValue=e=>{this.edit({customer_subscription_restrictions:e.map((({value:e})=>e.trim())).filter(((e,t,r)=>!!e&&r.indexOf(e)===t)).join()}),this.edit({customer_auto_apply:!!this.form.customer_subscription_restrictions||!!this.form.customer_attribute_restrictions})},this.__productCodeRestrictionsGetValue=()=>{var e;return null===(e=this.form.product_code_restrictions)||void 0===e?void 0:e.split(",").filter((e=>!!e.trim())).map((e=>({value:e,label:e.startsWith("-")?this.t("product-code-restrictions.label_block",{value:e.substring(1)}):this.t("product-code-restrictions.label_allow",{value:e})})))},this.__productCodeRestrictionsSetValue=e=>{this.edit({product_code_restrictions:e.map((({value:e,unit:t})=>"block"===t?`-${e}`:e)).filter(((e,t,r)=>!!e&&r.indexOf(e)===t)).join(",")})},this.__storeLoaderId="storeLoader",this.__codesFilters=[{label:"option_code",path:"code",type:n.String},{label:"option_number_of_uses_to_date",path:"number_of_uses_to_date",type:n.Number},{label:"option_date_created",path:"date_created",type:n.Date},{label:"option_date_modified",path:"date_modified",type:n.Date}],this.__couponCodesActions=[{theme:"contrast",state:"idle",text:"copy_button_text",onClick:async function(t){e.__couponCodesActions[0].state="busy",e.__couponCodesActions=[...e.__couponCodesActions];try{await navigator.clipboard.writeText(t.code),e.__couponCodesActions[0].state="end"}catch(t){e.__couponCodesActions[0].state="error"}finally{e.__couponCodesActions=[...e.__couponCodesActions],setTimeout((()=>{e.__couponCodesActions[0].state="idle",e.__couponCodesActions=[...e.__couponCodesActions]}),1e3)}}}]}static get properties(){return o(o({},super.properties),{},{getTransactionPageHref:{attribute:!1},__couponCodesActions:{type:Array}})}static get v8n(){return[({name:e})=>!!e||"name:v8n_required",({name:e})=>!e||e.length<=50||"name:v8n_too_long",({inclusive_tax_rate:e})=>!e||e>=0||"inclusive-tax-rate:v8n_too_small",({inclusive_tax_rate:e})=>!e||e<=1||"inclusive-tax-rate:v8n_too_big",({number_of_uses_allowed:e})=>!e||e>=0||"number-of-uses-allowed:v8n_too_small",({coupon_discount_details:e})=>!!e||"rules:v8n_required",({coupon_discount_details:e})=>!e||e.length<=200||"rules:v8n_too_long",({item_option_restrictions:e})=>!e||JSON.stringify(e).length<=6e3||"item-option-restrictions:v8n_too_long",({product_code_restrictions:e})=>!e||e.length<=5e3||"product-code-restrictions:v8n_too_long",({customer_attribute_restrictions:e})=>!e||e.length<=2e3||"customer-attribute-restrictions:v8n_too_long",({number_of_uses_allowed_per_code:e})=>!e||e>=0||"number-of-uses-allowed-per-code:v8n_too_small",({customer_subscription_restrictions:e})=>!e||e.length<=200||"customer-subscription-restrictions:v8n_too_long",({number_of_uses_allowed_per_customer:e})=>!e||e>=0||"number-of-uses-allowed-per-customer:v8n_too_small"]}get hiddenSelector(){const e=[super.hiddenSelector.toString()];return this.data?e.push("coupon-codes-stub","category-restrictions-stub","attributes-stub"):e.push("coupon-codes","category-restrictions","attributes"),new s(e.join(" ").trim())}get headerSubtitleOptions(){return o(o({},super.headerSubtitleOptions),{},{id:this.headerCopyIdValue})}renderHeaderActions(e){return a(Z||(Z=P` <foxy-internal-bulk-add-action-control parent="${0}" infer="generate" form="foxy-generate-codes-form" .related="${0}"> </foxy-internal-bulk-add-action-control> <foxy-internal-bulk-add-action-control parent="${0}" infer="import" form="foxy-coupon-codes-form" .related="${0}"> </foxy-internal-bulk-add-action-control> ${0} `),e._links["fx:generate_codes"].href,[e._links["fx:coupon_codes"].href],e._links["fx:coupon_codes"].href,[e._links["fx:coupon_codes"].href],super.renderHeaderActions(e))}renderBody(){var e,t,r,o,s,i,n,l;let d;try{const r=new URL(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:coupon_codes"].href)&&void 0!==t?t:"");r.searchParams.set("order","date_created desc"),d=r.toString()}catch(e){d=void 0}return a(z||(z=P` ${0} <foxy-internal-summary-control infer="general"> <foxy-internal-text-control layout="summary-item" infer="name"></foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-coupon-form-rules-control infer="rules"> </foxy-internal-coupon-form-rules-control> <foxy-internal-summary-control infer="coupon-codes-stub"> <p class="text-disabled"><foxy-i18n infer="" key="text"></foxy-i18n></p> </foxy-internal-summary-control> <foxy-internal-async-list-control first="${0}" limit="5" infer="coupon-codes" item="foxy-coupon-code-card" form="foxy-coupon-code-form" alert .formProps="${0}" .actions="${0}" .filters="${0}"> </foxy-internal-async-list-control> <foxy-internal-editable-list-control infer="product-code-restrictions" .getValue="${0}" .setValue="${0}" .units="${0}"> </foxy-internal-editable-list-control> <foxy-internal-array-map-control infer="item-option-restrictions"> </foxy-internal-array-map-control> <foxy-internal-query-builder-control infer="customer-attribute-restrictions" disable-zoom disable-or .operators="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-query-builder-control> <foxy-internal-editable-list-control infer="customer-subscription-restrictions" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-summary-control infer="auto-apply"> <foxy-internal-switch-control infer="customer-auto-apply"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="category-restrictions-stub"> <p class="text-disabled"><foxy-i18n infer="" key="text"></foxy-i18n></p> </foxy-internal-summary-control> <foxy-internal-async-resource-link-list-control foreign-key-for-uri="item_category_uri" foreign-key-for-id="item_category_id" own-key-for-uri="coupon_uri" own-uri="${0}" embed-key="fx:coupon_item_categories" options-href="${0}" links-href="${0}" infer="category-restrictions" limit="5" item="foxy-item-category-card"> </foxy-internal-async-resource-link-list-control> <foxy-internal-summary-control infer="uses"> <foxy-internal-number-control layout="summary-item" infer="number-of-uses-allowed" step="1" min="0"> </foxy-internal-number-control> <foxy-internal-number-control layout="summary-item" infer="number-of-uses-allowed-per-customer" step="1" min="0"> </foxy-internal-number-control> <foxy-internal-number-control layout="summary-item" infer="number-of-uses-allowed-per-code" step="1" min="0"> </foxy-internal-number-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="timeframe"> <foxy-internal-date-control layout="summary-item" infer="start-date"> </foxy-internal-date-control> <foxy-internal-date-control layout="summary-item" infer="end-date"> </foxy-internal-date-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="taxes"> <foxy-internal-number-control layout="summary-item" infer="inclusive-tax-rate" min="0" max="1"> </foxy-internal-number-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="options"> <foxy-internal-switch-control infer="multiple-codes-allowed"></foxy-internal-switch-control> <foxy-internal-switch-control infer="combinable"></foxy-internal-switch-control> <foxy-internal-switch-control infer="exclude-category-discounts"> </foxy-internal-switch-control> <foxy-internal-switch-control infer="exclude-line-item-discounts"> </foxy-internal-switch-control> <foxy-internal-switch-control infer="is-taxable"></foxy-internal-switch-control> <foxy-internal-switch-control infer="shared-codes-allowed"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="attributes-stub"> <p class="text-disabled"><foxy-i18n infer="" key="text"></foxy-i18n></p> </foxy-internal-summary-control> <foxy-internal-async-list-control first="${0}" limit="5" infer="attributes" item="foxy-attribute-card" form="foxy-attribute-form" alert> </foxy-internal-async-list-control> ${0} <foxy-nucleon infer="" class="hidden" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),d,{".getTransactionPageHref":this.getTransactionPageHref},this.__couponCodesActions,this.__codesFilters,this.__productCodeRestrictionsGetValue,this.__productCodeRestrictionsSetValue,[{label:this.t("product-code-restrictions.unit_allow"),value:"allow"},{label:this.t("product-code-restrictions.unit_block"),value:"block"}],this.__customerAttributeRestrictionsOperators,this.__customerAttributeRestrictionsGetValue,this.__customerAttributeRestrictionsSetValue,this.__customerSubscriptionRestrictionsGetValue,this.__customerSubscriptionRestrictionsSetValue,h(null===(r=this.data)||void 0===r?void 0:r._links.self.href),h(null===(s=null===(o=this.__storeLoader)||void 0===o?void 0:o.data)||void 0===s?void 0:s._links["fx:item_categories"].href),h(null===(i=this.data)||void 0===i?void 0:i._links["fx:coupon_item_categories"].href),h(null===(n=this.data)||void 0===n?void 0:n._links["fx:attributes"].href),super.renderBody(),h(null===(l=this.data)||void 0===l?void 0:l._links["fx:store"].href),this.__storeLoaderId,(()=>this.requestUpdate()))}get __storeLoader(){return this.renderRoot.querySelector(`#${this.__storeLoaderId}`)}}customElements.define("foxy-coupon-form",G);export{G as CouponForm};
|
|
1
|
+
import"./shared-2df3c589.js";import"./shared-97fac71c.js";import"./shared-8df4ab18.js";import{I as e}from"./shared-0b8768db.js";import{p as t,s as r}from"./shared-16776ac6.js";import{_ as o,B as s}from"./shared-8f9014ff.js";import{O as i,T as n}from"./shared-8874ec69.js";import{h as a,c as l,s as d}from"./shared-ba5c42c7.js";import"./shared-3d353eb8.js";import{R as c,a as u}from"./shared-47f3f5f5.js";import{c as m}from"./shared-4e709717.js";import{r as p}from"./shared-5fd5805c.js";import"./shared-28ceb7f7.js";import"./shared-64231b81.js";import"./shared-742640c2.js";import"./shared-5c8931a0.js";import"./shared-84e97597.js";import{I as f}from"./shared-fc155659.js";import"./foxy-generate-codes-form.js";import"./foxy-item-category-card.js";import"./foxy-coupon-codes-form.js";import"./foxy-coupon-code-card.js";import"./foxy-coupon-code-form.js";import"./foxy-nucleon-element.js";import"./foxy-attribute-form.js";import"./foxy-attribute-card.js";import"./foxy-copy-to-clipboard.js";import"./foxy-discount-builder.js";import{i as h}from"./shared-53e42a77.js";import"./shared-9e0b104a.js";import"./shared-6bf89411.js";import"./shared-5a469962.js";import"./shared-66278c21.js";import"./shared-360196ad.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-d4b77609.js";import"./shared-eb49be2e.js";import"./shared-b2cbe727.js";import"./shared-930e68b7.js";import"./shared-41c9c53f.js";import"./shared-9b138652.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-53e476fd.js";import"./foxy-pagination.js";import"./shared-59128d82.js";import"./shared-fb859ece.js";import"./shared-4194ffe7.js";import"./shared-27c16d99.js";import"./shared-32b2d003.js";import"./shared-0e25ac65.js";import"./shared-b3fe8c63.js";import"./shared-e55c8dc4.js";import"./shared-5212ef4f.js";import"./shared-be2ce0e6.js";import"./foxy-form-dialog.js";import"./shared-1c985317.js";import"./shared-58add5b4.js";import"./shared-34a87829.js";import"./shared-bf8d95b9.js";import"./shared-d0aed1c1.js";import"./shared-63c32024.js";import"./shared-2061be9a.js";import"./shared-f0fa0a88.js";import"./shared-f2a7eb85.js";import"./shared-b01c3b62.js";import"./shared-bab2ea2c.js";import"./shared-d9378323.js";import"./shared-57e94234.js";import"./shared-730acf1d.js";import"./shared-6740e365.js";import"./shared-e2d5673b.js";import"./shared-4eb52fc7.js";import"./foxy-swipe-actions.js";import"./foxy-admin-transaction-card.js";import"./shared-15a75e70.js";let y,_,b,x,v=e=>e;customElements.define("foxy-internal-query-builder-control",class extends e{constructor(){super(...arguments),this.disableZoom=!1,this.disableOr=!1,this.operators=Object.values(i)}static get properties(){return o(o({},super.properties),{},{disableZoom:{type:Boolean,attribute:"disable-zoom"},disableOr:{type:Boolean,attribute:"disable-or"},operators:{type:Array}})}renderControl(){const{label:e,helperText:t,_errorMessage:r}=this,o=r&&!this.disabled&&!this.readonly;return a(y||(y=v` <section class="grid gap-s leading-xs"> <div ?hidden="${0}"> ${0} ${0} </div> <div class="bg-contrast-5 rounded" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> <foxy-query-builder infer="query-builder" style="--lumo-border-radius:var(--lumo-border-radius-s);--lumo-border-radius-l:var(--lumo-border-radius-s)" .operators="${0}" .value="${0}" ?disable-zoom="${0}" ?disable-or="${0}" @change="${0}"> </foxy-query-builder> </div> ${0} </section> `),!e&&!t,e?a(_||(_=v`<p class="text-l font-medium">${0}</p>`),e):"",t?a(b||(b=v`<p class="text-s text-secondary">${0}</p>`),t):"",this.operators,this._value,this.disableZoom,this.disableOr,(e=>{var t;const r=e.currentTarget;this._value=null!==(t=r.value)&&void 0!==t?t:""}),o?a(x||(x=v`<p class="text-s text-error">${0}</p>`),r):"")}});let g,j,$,w,C,k,A,V,R,S,q=e=>e;class O extends(c(e)){static get styles(){return[super.styles,l(g||(g=q`.gap-1px{gap:1px}.grid-vertical{grid-template:auto/var(--lumo-size-m) 1fr}:host([sm]) .sm-grid-horizontal{grid-template:auto/var(--lumo-size-m) 1fr var(--lumo-size-m) 1fr}`))]}renderControl(){const e=a(j||(j=q` <div class="flex items-center h-s"> <div class="w-m text-center leading-none uppercase font-medium text-xs text-contrast-20"> <foxy-i18n infer="" key="or"></foxy-i18n> </div> <div class="flex-1 border-t border-contrast-10"></div> <div class="w-m ml-s flex-shrink-0"></div> </div> `));return a($||($=q` <div class="mb-s" ?hidden="${0}"> <p class="font-medium text-body text-l" ?hidden="${0}">${0}</p> <p class="text-s text-secondary" ?hidden="${0}">${0}</p> </div> <div class="rounded bg-contrast-5" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} </div> <p class="text-s text-error mt-s" ?hidden="${0}"> ${0} </p> `),!this.label&&!this.helperText,!this.label,this.label,!this.helperText,this.helperText,p([...Object.entries(this._value||{}),null],((e,t)=>String(t)),((t,r)=>null===t?[r>0?e:"",this.__renderRule({onChange:({key:e,items:t})=>{var r;this._value=o(o({},this._value),{},{[e]:[...null!==(r=this._value[e])&&void 0!==r?r:[],...t]})}})]:[r>0?e:"",this.__renderRule({rule:{key:t[0],items:t[1]},onChange:e=>{var r,o;const s={},i=Object.keys(this._value);for(let n=0;n<i.length;n++){const a=i[n];if(a===t[0])if(e.key===a)s[a]=e.items;else{const t=null!==(r=this._value[e.key])&&void 0!==r?r:[];n>i.indexOf(e.key)?s[e.key]=[...t,...e.items]:(s[e.key]=[...e.items,...t],i.splice(i.indexOf(e.key),1))}else s[a]=null!==(o=this._value[a])&&void 0!==o?o:[]}this._value=s},onDelete:()=>{const e=o({},this._value);delete e[t[0]],this._value=e}})])),!this._errorMessage||this.disabled||this.readonly,this._errorMessage)}get _value(){var e;return null!==(e=super._value)&&void 0!==e?e:{}}set _value(e){super._value=e}__renderRule({rule:e,onDelete:t,onChange:r}){var o,s;const i=null!==(o=null==e?void 0:e.items)&&void 0!==o?o:[];return a(w||(w=q` <div class="flex items-center space-x-s" aria-label="${0}"> <div class="flex-1 bg-base rounded-s overflow-hidden border border-contrast-10"> <div class="bg-contrast-10"> <div class="grid gap-1px grid-vertical sm-grid-horizontal"> <div class="bg-base"> <div aria-hidden="true" class="${0}"> ${0} </div> </div> <div class="bg-base"> ${0} </div> <div class="bg-base"> <div class="${0}"> <div aria-hidden="true"> ${0} </div> </div> </div> <div class="bg-base"> <div class="bg-contrast-10 grid grid-cols-1 gap-1px"> ${0} </div> </div> </div> </div> </div> <div class="flex -mr-s self-start flex-col sm-flex-row flex-shrink-0 items-center border-t border-b border-transparent divide-y divide-transparent" ?hidden="${0}"> <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> ${0} </button> </div> </div> `),this.t("rule"),m({"text-tertiary":!this.readonly&&!this.disabled,"text-disabled":this.readonly||this.disabled,"w-m h-m":!0}),d(C||(C=q`<svg class="w-full h-full" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M18 8C12.48 8 8 12.48 8 18C8 23.52 12.48 28 18 28C23.52 28 28 23.52 28 18C28 12.48 23.52 8 18 8ZM18 26C13.59 26 10 22.41 10 18C10 13.59 13.59 10 18 10C22.41 10 26 13.59 26 18C26 22.41 22.41 26 18 26Z" class="fill-current"/><path fill-rule="evenodd" clip-rule="evenodd" d="M19.49 17.38C19.92 16.16 19.66 14.74 18.68 13.76C17.57 12.65 15.89 12.46 14.58 13.17L16.93 15.52L15.52 16.93L13.17 14.58C12.46 15.9 12.65 17.57 13.76 18.68C14.74 19.66 16.16 19.92 17.38 19.49L20.79 22.9C20.99 23.1 21.3 23.1 21.5 22.9L22.9 21.5C23.1 21.3 23.1 20.99 22.9 20.79L19.49 17.38Z" class="fill-current"/></svg>`)),this.__renderInput({value:null!==(s=null==e?void 0:e.key)&&void 0!==s?s:"",label:this.t("option_name"),onChange:e=>{void 0===e?null==t||t():r({key:e,items:i})}}),m({"flex items-center justify-center w-m h-m transition-colors":!0,"focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50":!0,"cursor-default text-tertiary":!(this.disabled||this.readonly),"text-disabled cursor-default":this.disabled||this.readonly}),d(k||(k=q`<svg class="w-full h-full" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.5 9.8C11.0088 9.8 9.8 11.0088 9.8 12.5V23.5C9.8 24.9912 11.0088 26.2 12.5 26.2H14C14.6627 26.2 15.2 25.6627 15.2 25C15.2 24.3373 14.6627 23.8 14 23.8H13.5C12.782 23.8 12.2 23.218 12.2 22.5V13.5C12.2 12.782 12.782 12.2 13.5 12.2H14C14.6627 12.2 15.2 11.6627 15.2 11C15.2 10.3373 14.6627 9.8 14 9.8H12.5Z" class="fill-current"/><path d="M22 9.8C21.3373 9.8 20.8 10.3373 20.8 11C20.8 11.6627 21.3373 12.2 22 12.2H22.5C23.218 12.2 23.8 12.782 23.8 13.5V22.5C23.8 23.218 23.218 23.8 22.5 23.8H22C21.3373 23.8 20.8 24.3373 20.8 25C20.8 25.6627 21.3373 26.2 22 26.2H23.5C24.9912 26.2 26.2 24.9912 26.2 23.5V12.5C26.2 11.0088 24.9912 9.8 23.5 9.8H22Z" class="fill-current"/></svg>`)),p(this.readonly?i:[...i,null],((e,t)=>t),((t,o)=>a(A||(A=q` <div class="bg-base"> ${0} </div> `),this.__renderInput({value:null!=t?t:"",label:t?String(o+1):this.t("add_value"),onChange:s=>{const n=[...i];s?null===t?n.push(s):n[o]=s:n.splice(o,1),e&&r({key:e.key,items:n})}})))),this.readonly||0===Object.keys(this._value).length,this.t("delete"),m({"box-content flex items-center justify-center":!0,"w-m h-m rounded-full transition-colors":!0,"text-secondary hover-bg-contrast-5 hover-text-error":!this.disabled,"cursor-default text-disabled":this.disabled,"focus-outline-none focus-ring-2 ring-primary-50":!0,"opacity-0 pointer-events-none":!e}),this.disabled||this.readonly||!e,(()=>null==t?void 0:t()),d(V||(V=q`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="text-l" style="width: 1.25em; height: 1.25em"><path stroke-linecap="round" stroke-linejoin="round" d="M15 12H9m12 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" /></svg>`)))}__renderInput(e){return a(R||(R=q` <label class="relative flex items-center cursor-text group text-tertiary"> <div class="relative flex-1 min-w-0 overflow-hidden"> <input placeholder="${0}" class="${0}" .value="${0}" ?disabled="${0}" @keydown="${0}" @change="${0}" @input="${0}"> </div> <span class="${0}"> ${0} </span> ${0} </label> `),e.label,m({"bg-base relative flex h-m px-s font-medium w-full":!0,"text-body":!this.disabled&&!this.readonly,"text-disabled":this.disabled,"text-secondary":this.readonly,"flex max-w-full whitespace-nowrap":!0,"focus-outline-none":!0}),e.value,this.disabled||this.readonly,(t=>{const r=t.currentTarget;"Backspace"!==t.key||r.value||e.onChange()}),(t=>{t.currentTarget.value||e.onChange()}),(t=>{const r=t.currentTarget;e.onChange(r.value)}),m({"font-tnum text-xs font-medium border border-current mr-s px-xs rounded-s":!0,"inline-block":!!e.value,"sr-only":!e.value,"text-body":!this.disabled&&!this.readonly,"text-disabled":this.disabled,"text-secondary":this.readonly}),this.t(e.label),this.disabled||this.readonly?"":a(S||(S=q` <div class="absolute inset-0 transition-colors bg-transparent group-hover-bg-contrast-5 pointer-events-none"></div> `)))}}customElements.define("foxy-internal-array-map-control",O);let T,H,L,I,M,B=e=>e;customElements.define("foxy-internal-coupon-form-rules-control",class extends e{renderControl(){var e,t;const r=this.nucleon,o=null!==(e=null==r?void 0:r.form.coupon_discount_details)&&void 0!==e?e:"",s=null!==(t=null==r?void 0:r.form.coupon_discount_type)&&void 0!==t?t:"quantity_amount",i=this.helperText,n=this.__renderRulesDescription(),l=this._errorMessage;return a(T||(T=B` <section> <div class="mb-s" ?hidden="${0}"> <p class="flex items-center justify-between space-x-m"> <span class="font-medium flex-1 text-l">${0}</span> <span class="min-w-0">${0}</span> </p> <p class="text-s text-secondary">${0}</p> </div> <foxy-discount-builder infer="discount-builder" .parsedValue="${0}" @change="${0}"> </foxy-discount-builder> ${0} ${0} </section> `),!this.label&&!i&&!n,this.label,this.__renderPreset(),i,{details:o,type:s,name:"Rules"},(e=>{const t=e.currentTarget.parsedValue,r=this.nucleon;null==r||r.edit({coupon_discount_details:t.details,coupon_discount_type:t.type})}),n?a(H||(H=B`<p class="text-s text-secondary mt-s">${0}</p>`),n):"",!l||this.disabled||this.readonly?"":a(L||(L=B`<p class="mt-s text-s leading-xs text-error">${0}</p>`),this._errorMessage))}__renderRulesDescription(){var e,t;const r=this.nucleon,o=null!==(e=null==r?void 0:r.form.coupon_discount_type)&&void 0!==e?e:"quantity_amount",s=null!==(t=null==r?void 0:r.form.coupon_discount_details)&&void 0!==t?t:"";return s?this.t("discount_summary",{params:{details:s,type:o,ns:this.ns}}):null}__renderPreset(){const e=this.nucleon,t=null==e?void 0:e.form.coupon_discount_details,r=null==e?void 0:e.form.coupon_discount_type,s=[{type:"quantity_amount",details:"allunits|2-2"},{type:"quantity_percentage",details:"allunits|5-10|10-20"},{type:"quantity_amount",details:"incremental|3-5"},{type:"quantity_percentage",details:"incremental|11-10|51-15|101-20"},{type:"quantity_percentage",details:"repeat|2-100"},{type:"quantity_percentage",details:"repeat|4-50"},{type:"quantity_amount",details:"single|5-10"},{type:"price_percentage",details:"single|99.99-10"}],i=s.find((e=>e.details===t&&e.type===r));return a(I||(I=B` <label data-testid="rules:preset" class="${0}"> <foxy-i18n class="sr-only" infer="" key="preset"></foxy-i18n> <span class="relative font-medium flex items-center"> <span class="truncate"> ${0} </span> <iron-icon class="icon-inline text-xl ml-xs -mr-xs" icon="icons:expand-more"></iron-icon> <select data-testclass="interactive editable" data-testid="rules:preset:select" class="opacity-0 absolute inset-0 focus-outline-none" ?disabled="${0}" @change="${0}"> ${0} <option value="custom" ?selected="${0}"> ${0} </option> </select> </span> </label> `),m({"whitespace-nowrap block ring-primary-50 rounded px-xs -mx-xs transition-colors":!0,"text-body hover-text-primary focus-within-ring-2":!this.disabled&&!this.readonly,"text-secondary":this.readonly,"text-disabled":this.disabled}),i?this.t("discount_summary",{params:o(o({},i),{},{ns:this.ns})}):this.t("custom_discount"),this.disabled||this.readonly,(e=>{var t,r;const o=e.currentTarget,i=s[o.selectedIndex],n=this.nucleon;null==n||n.edit({coupon_discount_details:null!==(t=null==i?void 0:i.details)&&void 0!==t?t:"",coupon_discount_type:null!==(r=null==i?void 0:i.type)&&void 0!==r?r:"quantity_amount"})}),s.map((e=>a(M||(M=B` <option value="${0}" ?selected="${0}"> ${0} </option> `),e.details,e===i,this.t("discount_summary",{params:o(o({},e),{},{ns:this.ns})})))),!i&&!!t&&!!r,this.t("custom_discount"))}});let Z,z,P=e=>e;const D=c(u(f,"coupon-form"));class G extends D{constructor(){var e;super(...arguments),e=this,this.getTransactionPageHref=null,this.__customerAttributeRestrictionsOperators=[i.Not,i.In],this.__customerAttributeRestrictionsGetValue=()=>{var e;const o=t(null!==(e=this.form.customer_attribute_restrictions)&&void 0!==e?e:"").filter((e=>Array.isArray(e)||"string"==typeof e.name)).map((e=>{if(Array.isArray(e))return e.filter((({name:e})=>"string"==typeof e)).map((({name:e,operator:t,value:r})=>({path:e,operator:t,value:r})));return{operator:e.operator,value:e.value,path:e.name}}));return r(o,!0)},this.__customerAttributeRestrictionsSetValue=e=>{const o=t(e).map((e=>{if(Array.isArray(e))return e.map((({path:e,operator:t,value:r})=>({name:e,path:"attributes",operator:t,value:r})));return{operator:e.operator,value:e.value,path:"attributes",name:e.path}}));this.edit({customer_attribute_restrictions:r(o,!0)})},this.__customerSubscriptionRestrictionsGetValue=()=>{var e;const t=null===(e=this.form.customer_subscription_restrictions)||void 0===e?void 0:e.split(",").map((e=>e.trim())).filter(((e,t,r)=>!!e&&r.indexOf(e)===t)).map((e=>({value:e})));return null!=t?t:[]},this.__customerSubscriptionRestrictionsSetValue=e=>{this.edit({customer_subscription_restrictions:e.map((({value:e})=>e.trim())).filter(((e,t,r)=>!!e&&r.indexOf(e)===t)).join()}),this.edit({customer_auto_apply:!!this.form.customer_subscription_restrictions||!!this.form.customer_attribute_restrictions})},this.__productCodeRestrictionsGetValue=()=>{var e;return null===(e=this.form.product_code_restrictions)||void 0===e?void 0:e.split(",").filter((e=>!!e.trim())).map((e=>({value:e,label:e.startsWith("-")?this.t("product-code-restrictions.label_block",{value:e.substring(1)}):this.t("product-code-restrictions.label_allow",{value:e})})))},this.__productCodeRestrictionsSetValue=e=>{this.edit({product_code_restrictions:e.map((({value:e,unit:t})=>"block"===t?`-${e}`:e)).filter(((e,t,r)=>!!e&&r.indexOf(e)===t)).join(",")})},this.__storeLoaderId="storeLoader",this.__codesFilters=[{label:"option_code",path:"code",type:n.String},{label:"option_number_of_uses_to_date",path:"number_of_uses_to_date",type:n.Number},{label:"option_date_created",path:"date_created",type:n.Date},{label:"option_date_modified",path:"date_modified",type:n.Date}],this.__couponCodesActions=[{theme:"contrast",state:"idle",text:"copy_button_text",onClick:async function(t){e.__couponCodesActions[0].state="busy",e.__couponCodesActions=[...e.__couponCodesActions];try{await navigator.clipboard.writeText(t.code),e.__couponCodesActions[0].state="end"}catch(t){e.__couponCodesActions[0].state="error"}finally{e.__couponCodesActions=[...e.__couponCodesActions],setTimeout((()=>{e.__couponCodesActions[0].state="idle",e.__couponCodesActions=[...e.__couponCodesActions]}),1e3)}}}]}static get properties(){return o(o({},super.properties),{},{getTransactionPageHref:{attribute:!1},__couponCodesActions:{type:Array}})}static get v8n(){return[({name:e})=>!!e||"name:v8n_required",({name:e})=>!e||e.length<=50||"name:v8n_too_long",({inclusive_tax_rate:e})=>!e||e>=0||"inclusive-tax-rate:v8n_too_small",({inclusive_tax_rate:e})=>!e||e<=1||"inclusive-tax-rate:v8n_too_big",({number_of_uses_allowed:e})=>!e||e>=0||"number-of-uses-allowed:v8n_too_small",({coupon_discount_details:e})=>!!e||"rules:v8n_required",({coupon_discount_details:e})=>!e||e.length<=200||"rules:v8n_too_long",({item_option_restrictions:e})=>!e||JSON.stringify(e).length<=6e3||"item-option-restrictions:v8n_too_long",({product_code_restrictions:e})=>!e||e.length<=5e3||"product-code-restrictions:v8n_too_long",({customer_attribute_restrictions:e})=>!e||e.length<=2e3||"customer-attribute-restrictions:v8n_too_long",({number_of_uses_allowed_per_code:e})=>!e||e>=0||"number-of-uses-allowed-per-code:v8n_too_small",({customer_subscription_restrictions:e})=>!e||e.length<=200||"customer-subscription-restrictions:v8n_too_long",({number_of_uses_allowed_per_customer:e})=>!e||e>=0||"number-of-uses-allowed-per-customer:v8n_too_small"]}get hiddenSelector(){const e=[super.hiddenSelector.toString()];return this.data?e.push("coupon-codes-stub","category-restrictions-stub","attributes-stub"):e.push("coupon-codes","category-restrictions","attributes"),new s(e.join(" ").trim())}get headerSubtitleOptions(){return o(o({},super.headerSubtitleOptions),{},{id:this.headerCopyIdValue})}renderHeaderActions(e){return a(Z||(Z=P` <foxy-internal-bulk-add-action-control parent="${0}" infer="generate" form="foxy-generate-codes-form" .related="${0}"> </foxy-internal-bulk-add-action-control> <foxy-internal-bulk-add-action-control parent="${0}" infer="import" form="foxy-coupon-codes-form" .related="${0}"> </foxy-internal-bulk-add-action-control> ${0} `),e._links["fx:generate_codes"].href,[e._links["fx:coupon_codes"].href],e._links["fx:coupon_codes"].href,[e._links["fx:coupon_codes"].href],super.renderHeaderActions(e))}renderBody(){var e,t,r,o,s,i,n,l;let d;try{const r=new URL(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:coupon_codes"].href)&&void 0!==t?t:"");r.searchParams.set("order","date_created desc"),d=r.toString()}catch(e){d=void 0}return a(z||(z=P` ${0} <foxy-internal-summary-control infer="general"> <foxy-internal-text-control layout="summary-item" infer="name"></foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-coupon-form-rules-control infer="rules"> </foxy-internal-coupon-form-rules-control> <foxy-internal-summary-control infer="coupon-codes-stub"> <p class="text-disabled"><foxy-i18n infer="" key="text"></foxy-i18n></p> </foxy-internal-summary-control> <foxy-internal-async-list-control first="${0}" limit="5" infer="coupon-codes" item="foxy-coupon-code-card" form="foxy-coupon-code-form" alert .formProps="${0}" .actions="${0}" .filters="${0}"> </foxy-internal-async-list-control> <foxy-internal-editable-list-control infer="product-code-restrictions" .getValue="${0}" .setValue="${0}" .units="${0}"> </foxy-internal-editable-list-control> <foxy-internal-array-map-control infer="item-option-restrictions"> </foxy-internal-array-map-control> <foxy-internal-query-builder-control infer="customer-attribute-restrictions" disable-zoom disable-or .operators="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-query-builder-control> <foxy-internal-editable-list-control infer="customer-subscription-restrictions" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-summary-control infer="auto-apply"> <foxy-internal-switch-control infer="customer-auto-apply"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="category-restrictions-stub"> <p class="text-disabled"><foxy-i18n infer="" key="text"></foxy-i18n></p> </foxy-internal-summary-control> <foxy-internal-async-resource-link-list-control foreign-key-for-uri="item_category_uri" foreign-key-for-id="item_category_id" own-key-for-uri="coupon_uri" own-uri="${0}" embed-key="fx:coupon_item_categories" options-href="${0}" links-href="${0}" infer="category-restrictions" limit="5" item="foxy-item-category-card"> </foxy-internal-async-resource-link-list-control> <foxy-internal-summary-control infer="uses"> <foxy-internal-number-control layout="summary-item" infer="number-of-uses-allowed" step="1" min="0"> </foxy-internal-number-control> <foxy-internal-number-control layout="summary-item" infer="number-of-uses-allowed-per-customer" step="1" min="0"> </foxy-internal-number-control> <foxy-internal-number-control layout="summary-item" infer="number-of-uses-allowed-per-code" step="1" min="0"> </foxy-internal-number-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="timeframe"> <foxy-internal-date-control layout="summary-item" infer="start-date"> </foxy-internal-date-control> <foxy-internal-date-control layout="summary-item" infer="end-date"> </foxy-internal-date-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="taxes"> <foxy-internal-number-control layout="summary-item" infer="inclusive-tax-rate" min="0" max="1"> </foxy-internal-number-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="options"> <foxy-internal-switch-control infer="multiple-codes-allowed"></foxy-internal-switch-control> <foxy-internal-switch-control infer="combinable"></foxy-internal-switch-control> <foxy-internal-switch-control infer="exclude-category-discounts"> </foxy-internal-switch-control> <foxy-internal-switch-control infer="exclude-line-item-discounts"> </foxy-internal-switch-control> <foxy-internal-switch-control infer="is-taxable"></foxy-internal-switch-control> <foxy-internal-switch-control infer="shared-codes-allowed"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="attributes-stub"> <p class="text-disabled"><foxy-i18n infer="" key="text"></foxy-i18n></p> </foxy-internal-summary-control> <foxy-internal-async-list-control first="${0}" limit="5" infer="attributes" item="foxy-attribute-card" form="foxy-attribute-form" alert> </foxy-internal-async-list-control> ${0} <foxy-nucleon infer="" class="hidden" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),d,{".getTransactionPageHref":this.getTransactionPageHref},this.__couponCodesActions,this.__codesFilters,this.__productCodeRestrictionsGetValue,this.__productCodeRestrictionsSetValue,[{label:this.t("product-code-restrictions.unit_allow"),value:"allow"},{label:this.t("product-code-restrictions.unit_block"),value:"block"}],this.__customerAttributeRestrictionsOperators,this.__customerAttributeRestrictionsGetValue,this.__customerAttributeRestrictionsSetValue,this.__customerSubscriptionRestrictionsGetValue,this.__customerSubscriptionRestrictionsSetValue,h(null===(r=this.data)||void 0===r?void 0:r._links.self.href),h(null===(s=null===(o=this.__storeLoader)||void 0===o?void 0:o.data)||void 0===s?void 0:s._links["fx:item_categories"].href),h(null===(i=this.data)||void 0===i?void 0:i._links["fx:coupon_item_categories"].href),h(null===(n=this.data)||void 0===n?void 0:n._links["fx:attributes"].href),super.renderBody(),h(null===(l=this.data)||void 0===l?void 0:l._links["fx:store"].href),this.__storeLoaderId,(()=>this.requestUpdate()))}get __storeLoader(){return this.renderRoot.querySelector(`#${this.__storeLoaderId}`)}}customElements.define("foxy-coupon-form",G);export{G as CouponForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-5212ef4f.js";import"./shared-
|
|
1
|
+
import"./shared-5212ef4f.js";import"./shared-e2d5673b.js";import{h as r}from"./shared-ba5c42c7.js";import{a as s}from"./shared-47f3f5f5.js";import{T as e}from"./shared-730acf1d.js";import"./foxy-spinner.js";import"./shared-d4b77609.js";import"./shared-eb49be2e.js";import"./shared-5a469962.js";import"./shared-b2cbe727.js";import"./shared-3d353eb8.js";import"./shared-8f9014ff.js";import"./shared-930e68b7.js";import"./shared-6740e365.js";import"./shared-9b138652.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-4e709717.js";import"./shared-41c9c53f.js";import"./shared-53e42a77.js";let d,a,t=r=>r;class o extends(s(e,"custom-field-card")){renderBody(){return super.renderBody({title:s=>r(d||(d=t`${0}`),s.name),subtitle:s=>r(a||(a=t`${0}`),s.value)})}}customElements.define("foxy-custom-field-card",o);export{o as CustomFieldCard};
|