@foxy.io/elements 1.27.1 → 1.27.2-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 +5 -5
- package/dist/cdn/foxy-address-form.js +1 -1
- package/dist/cdn/foxy-admin-subscription-card.js +1 -1
- package/dist/cdn/foxy-api-browser.js +1 -1
- package/dist/cdn/foxy-applied-coupon-code-card.js +1 -1
- package/dist/cdn/foxy-applied-coupon-code-form.js +1 -1
- package/dist/cdn/foxy-applied-tax-card.js +1 -1
- package/dist/cdn/foxy-attribute-card.js +1 -1
- package/dist/cdn/foxy-attribute-form.js +1 -1
- package/dist/cdn/foxy-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 +1 -1
- 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 +1 -1
- package/dist/cdn/foxy-customer.js +1 -1
- package/dist/cdn/foxy-customers-table.js +1 -1
- package/dist/cdn/foxy-discount-builder.js +1 -1
- package/dist/cdn/foxy-discount-card.js +1 -1
- package/dist/cdn/foxy-discount-detail-card.js +1 -1
- package/dist/cdn/foxy-donation.js +1 -1
- package/dist/cdn/foxy-downloadable-card.js +1 -1
- package/dist/cdn/foxy-downloadable-form.js +5 -5
- 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-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 +2 -2
- package/dist/cdn/foxy-i18n.js +1 -1
- package/dist/cdn/foxy-integration-card.js +1 -1
- package/dist/cdn/foxy-integration-form.js +1 -1
- package/dist/cdn/foxy-item-card.js +1 -1
- package/dist/cdn/foxy-item-category-card.js +1 -1
- package/dist/cdn/foxy-item-category-form.js +1 -1
- package/dist/cdn/foxy-item-form.js +1 -1
- package/dist/cdn/foxy-item-option-card.js +1 -1
- package/dist/cdn/foxy-item-option-form.js +1 -1
- package/dist/cdn/foxy-items-form.js +1 -1
- package/dist/cdn/foxy-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 +2 -2
- package/dist/cdn/foxy-reports-table.js +6 -6
- package/dist/cdn/foxy-shipment-card.js +1 -1
- package/dist/cdn/foxy-shipping-method-card.js +1 -1
- package/dist/cdn/foxy-sign-in-form.js +1 -1
- package/dist/cdn/foxy-spinner.js +1 -1
- package/dist/cdn/foxy-store-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-subscription-card.js +1 -1
- package/dist/cdn/foxy-subscription-form.js +1 -1
- package/dist/cdn/foxy-subscription-settings-form.js +1 -1
- package/dist/cdn/foxy-subscriptions-table.js +1 -1
- package/dist/cdn/foxy-table.js +1 -1
- package/dist/cdn/foxy-tax-card.js +1 -1
- package/dist/cdn/foxy-tax-form.js +1 -1
- package/dist/cdn/foxy-template-config-form.js +1 -1
- package/dist/cdn/foxy-template-form.js +1 -1
- package/dist/cdn/foxy-template-set-card.js +1 -1
- package/dist/cdn/foxy-template-set-form.js +1 -1
- package/dist/cdn/foxy-transaction-card.js +1 -1
- package/dist/cdn/foxy-transaction.js +1 -1
- package/dist/cdn/foxy-transactions-table.js +7 -7
- package/dist/cdn/foxy-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-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-213b9416.js → shared-02bfc323.js} +1 -1
- package/dist/cdn/{shared-90ddf541.js → shared-042969fe.js} +1 -1
- package/dist/cdn/{shared-eeb2d7ab.js → shared-0c786cc9.js} +1 -1
- package/dist/cdn/shared-10600ab1.js +1 -0
- package/dist/cdn/{shared-85f44e3e.js → shared-198d654d.js} +1 -1
- package/dist/cdn/{shared-9f5c636a.js → shared-1d8edd03.js} +1 -1
- package/dist/cdn/{shared-5f65bdab.js → shared-24aed5cb.js} +1 -1
- package/dist/cdn/{shared-739a8fe4.js → shared-251a538b.js} +1 -1
- package/dist/cdn/{shared-f090c63a.js → shared-2574c562.js} +1 -1
- package/dist/cdn/{shared-741bfa42.js → shared-26139f48.js} +1 -1
- package/dist/cdn/{shared-8b4ba63a.js → shared-26e29b61.js} +1 -1
- package/dist/cdn/{shared-0f4947e8.js → shared-2aae2920.js} +1 -1
- package/dist/cdn/{shared-f635c052.js → shared-33cdaccb.js} +1 -1
- package/dist/cdn/shared-365c8437.js +1 -0
- package/dist/cdn/{shared-9bd371c7.js → shared-3ca4dfc1.js} +1 -1
- package/dist/cdn/{shared-98f85be1.js → shared-406306d3.js} +1 -1
- package/dist/cdn/{shared-0aa511d0.js → shared-49d678ad.js} +1 -1
- package/dist/cdn/{shared-b91650ba.js → shared-4a63427c.js} +1 -1
- package/dist/cdn/{shared-550608b8.js → shared-4af58773.js} +1 -1
- package/dist/cdn/{shared-28e988c6.js → shared-4d3cfde9.js} +1 -1
- package/dist/cdn/{shared-0e9ad70e.js → shared-5b42f19a.js} +1 -1
- package/dist/cdn/{shared-43928f5a.js → shared-6040bdb6.js} +1 -1
- package/dist/cdn/{shared-891b33ad.js → shared-673b5058.js} +1 -1
- package/dist/cdn/{shared-e5f6ca48.js → shared-6a4ddaef.js} +1 -1
- package/dist/cdn/{shared-a006b7a9.js → shared-6cf18449.js} +3 -3
- package/dist/cdn/{shared-3c58ddf1.js → shared-701157ac.js} +2 -2
- package/dist/cdn/shared-704b89be.js +1 -0
- package/dist/cdn/{shared-5e9395ec.js → shared-7063f5af.js} +1 -1
- package/dist/cdn/{shared-e075ca81.js → shared-75ebda34.js} +1 -1
- package/dist/cdn/{shared-fca5f5e3.js → shared-78a0deaa.js} +1 -1
- package/dist/cdn/{shared-21fec810.js → shared-7b4ed755.js} +1 -1
- package/dist/cdn/{shared-96077b62.js → shared-7c362722.js} +1 -1
- package/dist/cdn/{shared-d67d56c2.js → shared-7ee5a7cf.js} +1 -1
- package/dist/cdn/{shared-56b8e9ca.js → shared-81db435d.js} +1 -1
- package/dist/cdn/shared-8f0251e9.js +1 -0
- package/dist/cdn/{shared-617dbd76.js → shared-91e27e9b.js} +1 -1
- package/dist/cdn/{shared-71782a9e.js → shared-92f42e44.js} +1 -1
- package/dist/cdn/{shared-8452c492.js → shared-9452df44.js} +1 -1
- package/dist/cdn/{shared-1602c9a4.js → shared-95097c93.js} +1 -1
- package/dist/cdn/{shared-5c4a29b9.js → shared-995b5d29.js} +1 -1
- package/dist/cdn/{shared-b6c1aa47.js → shared-9aed814d.js} +1 -1
- package/dist/cdn/shared-9f6344ce.js +1 -0
- package/dist/cdn/{shared-6c97a6b0.js → shared-a12b2c4b.js} +1 -1
- package/dist/cdn/{shared-849413bb.js → shared-a1ae3899.js} +1 -1
- package/dist/cdn/{shared-b7cda8ba.js → shared-a2253b8a.js} +1 -1
- package/dist/cdn/{shared-a827bcc6.js → shared-a4809573.js} +1 -1
- package/dist/cdn/{shared-2808f43a.js → shared-a5c48bf4.js} +1 -1
- package/dist/cdn/{shared-c9f4fe97.js → shared-aefcc55d.js} +1 -1
- package/dist/cdn/{shared-8acb820f.js → shared-b248e139.js} +1 -1
- package/dist/cdn/shared-b6ee51b2.js +29 -0
- package/dist/cdn/{shared-d2a79509.js → shared-b851d2ba.js} +1 -1
- package/dist/cdn/{shared-7a5adb55.js → shared-b8e1ded5.js} +1 -1
- package/dist/cdn/{shared-0ac853c6.js → shared-b9eeff84.js} +1 -1
- package/dist/cdn/{shared-68aebcc4.js → shared-bb35ee61.js} +1 -1
- package/dist/cdn/{shared-75f3a59e.js → shared-bf697129.js} +1 -1
- package/dist/cdn/{shared-8e75c372.js → shared-c2128988.js} +1 -1
- package/dist/cdn/{shared-221d3788.js → shared-c43b90e7.js} +1 -1
- package/dist/cdn/{shared-9c3b800b.js → shared-c78c5441.js} +1 -1
- package/dist/cdn/{shared-8d7e2e2c.js → shared-cb7cbfc1.js} +1 -1
- package/dist/cdn/shared-cbeb8587.js +1 -0
- package/dist/cdn/{shared-eef50424.js → shared-d0e13938.js} +1 -1
- package/dist/cdn/{shared-41e9ef02.js → shared-d274a659.js} +2 -2
- package/dist/cdn/{shared-15a947f3.js → shared-d3d8cad4.js} +1 -1
- package/dist/cdn/{shared-51c3bc09.js → shared-d58490e1.js} +1 -1
- package/dist/cdn/{shared-a30fcaf6.js → shared-d61d0a7b.js} +1 -1
- package/dist/cdn/{shared-ecb7a183.js → shared-d7a68ddc.js} +1 -1
- package/dist/cdn/{shared-879fcb1f.js → shared-d96b4840.js} +1 -1
- package/dist/cdn/{shared-c73f6e8a.js → shared-dbe4e1a3.js} +1 -1
- package/dist/cdn/{shared-a6e383ac.js → shared-e1cd88e3.js} +1 -1
- package/dist/cdn/{shared-d7bb413b.js → shared-e20a7505.js} +1 -1
- package/dist/cdn/{shared-82423f8b.js → shared-ebe1fd1d.js} +1 -1
- package/dist/cdn/{shared-12e531b8.js → shared-ecec6a10.js} +1 -1
- package/dist/cdn/{shared-7535b32d.js → shared-f1cef702.js} +1 -1
- package/dist/cdn/{shared-3521ade9.js → shared-f28b1959.js} +1 -1
- package/dist/cdn/{shared-ec0fb97f.js → shared-f44ad831.js} +1 -1
- package/dist/cdn/{shared-85707e42.js → shared-fb4213b0.js} +1 -1
- package/dist/cdn/{shared-2e2d45c4.js → shared-fbfa45bb.js} +1 -1
- package/dist/cdn/{shared-ec636065.js → shared-fc9d9f3e.js} +1 -1
- package/dist/cdn/{shared-4a1ca2d3.js → shared-fd3679c3.js} +1 -1
- package/dist/cdn/{shared-9e014b51.js → shared-fdb43c3b.js} +1 -1
- package/dist/cdn/{shared-bd99107c.js → shared-fee535ca.js} +1 -1
- package/dist/elements/internal/InternalAsyncResourceLinkListControl/InternalAsyncResourceLinkListControl.js +1 -1
- package/dist/elements/internal/InternalAsyncResourceLinkListControl/InternalAsyncResourceLinkListControl.js.map +1 -1
- package/dist/elements/public/CollectionPages/CollectionPages.js +16 -8
- package/dist/elements/public/CollectionPages/CollectionPages.js.map +1 -1
- package/dist/elements/public/NucleonElement/NucleonElement.js +14 -8
- package/dist/elements/public/NucleonElement/NucleonElement.js.map +1 -1
- package/dist/elements/public/TaxForm/TaxForm.js +8 -8
- package/dist/elements/public/TaxForm/TaxForm.js.map +1 -1
- package/dist/mixins/translatable.d.ts +3 -3
- package/dist/mixins/translatable.js +7 -16
- package/dist/mixins/translatable.js.map +1 -1
- package/package.json +2 -2
- package/dist/cdn/shared-157c52e5.js +0 -1
- package/dist/cdn/shared-272e7269.js +0 -1
- package/dist/cdn/shared-37391934.js +0 -1
- package/dist/cdn/shared-39fc8fed.js +0 -1
- package/dist/cdn/shared-66d2a0d7.js +0 -1
- package/dist/cdn/shared-8bd53409.js +0 -1
- package/dist/cdn/shared-e989e47e.js +0 -29
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-704b89be.js";import{a as e}from"./shared-b6ee51b2.js";import{I as t}from"./shared-2574c562.js";import{h as r}from"./shared-dc73b9a5.js";import"./foxy-spinner.js";import"./shared-a2253b8a.js";import"./shared-c43b90e7.js";import"./shared-92f42e44.js";import"./shared-d7a68ddc.js";import"./shared-701157ac.js";import"./shared-343d1fd7.js";import"./shared-a5c48bf4.js";import"./shared-cbeb8587.js";import"./shared-8f0251e9.js";import"./shared-cd96ff03.js";import"./shared-ecec6a10.js";import"./shared-042969fe.js";import"./shared-365c8437.js";import"./shared-fbfa45bb.js";import"./shared-4e709717.js";let i,s,a,o,d=e=>e;const C=e(t,"client-card");class l extends C{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=d` <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=d`<foxy-i18n infer="" key="no_project_name"></foxy-i18n>`)),(null==t?void 0:t.project_description.trim())||r(a||(a=d`<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=d`<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-3ca4dfc1.js";import"./shared-0c786cc9.js";import{I as t}from"./shared-c78c5441.js";import{R as e,a as r}from"./shared-b6ee51b2.js";import{B as o}from"./shared-701157ac.js";import{h as s}from"./shared-dc73b9a5.js";import"./shared-a1ae3899.js";import"./shared-406306d3.js";import"./shared-c43b90e7.js";import"./shared-7ee5a7cf.js";import"./shared-e20a7505.js";import"./shared-5b42f19a.js";import"./shared-d58490e1.js";import"./shared-61ade33e.js";import"./shared-6040bdb6.js";import"./shared-6a4ddaef.js";import"./shared-51c4a6dd.js";import"./shared-d7a68ddc.js";import"./shared-343d1fd7.js";import"./shared-a5c48bf4.js";import"./shared-fee535ca.js";import"./shared-9803aa7c.js";import"./shared-cbeb8587.js";import"./shared-8f0251e9.js";import"./shared-cd96ff03.js";import"./shared-ecec6a10.js";import"./shared-042969fe.js";import"./shared-365c8437.js";import"./shared-fbfa45bb.js";import"./shared-d3d8cad4.js";import"./shared-198d654d.js";import"./shared-cb7cbfc1.js";import"./shared-4e709717.js";import"./foxy-copy-to-clipboard.js";import"./shared-92f42e44.js";import"./shared-a2253b8a.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let n,a=t=>t;const i=e(r(t,"client-form"));class c extends i{constructor(){super(...arguments),this.templates={}}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 s(n||(n=a` <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} `),super.renderBody())}}customElements.define("foxy-client-form",c);export{c as ClientForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./foxy-spinner.js";import{_ as e}from"./shared-
|
|
1
|
+
import"./foxy-spinner.js";import{_ as e}from"./shared-701157ac.js";import{h as t}from"./shared-dc73b9a5.js";import{a as s}from"./shared-b6ee51b2.js";import{C as r}from"./shared-fee535ca.js";import{F as i}from"./shared-343d1fd7.js";import{N as a}from"./shared-cbeb8587.js";import{r as n}from"./shared-a0c6a159.js";import{s as o}from"./shared-99940888.js";import"./shared-a2253b8a.js";import"./shared-c43b90e7.js";import"./shared-92f42e44.js";import"./shared-d7a68ddc.js";import"./shared-a5c48bf4.js";import"./shared-9803aa7c.js";import"./shared-8f0251e9.js";import"./shared-cd96ff03.js";import"./shared-ecec6a10.js";import"./shared-042969fe.js";import"./shared-365c8437.js";import"./shared-fbfa45bb.js";let l,d=e=>e;const h=r(s(a));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}))),t(l||(l=d`${0}`),n(e,(e=>e.key),((s,r)=>{var i,a,n,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!==(n=null===(a=e[r-1])||void 0===a?void 0:a.data)&&void 0!==n?n:null,related:this.related,hidden:this.hidden,parent:this.href,spread:o,props:this.props,group:this.group,lang:this.lang,data:s.data,href:s.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:t})})))}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 i)||e.target===this)return;const{method:t,url:s}=e.request;return"GET"===t?"foxy://collection-page/stall"===s?this.__stallRequest(e):"foxy://collection-page/fail"===s?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-d3d8cad4.js";import"./foxy-collection-page.js";import"./shared-d7a68ddc.js";import{o as e,aE as t,_ as s,R as r}from"./shared-701157ac.js";import{h as a,L as i}from"./shared-dc73b9a5.js";import{C as n}from"./shared-fee535ca.js";import{F as o}from"./shared-343d1fd7.js";import{N as d,s as l}from"./shared-cbeb8587.js";import{r as c}from"./shared-a0c6a159.js";import{I as h}from"./shared-a5c48bf4.js";import{i as p}from"./shared-fbfa45bb.js";import{s as u}from"./shared-99940888.js";import"./shared-406306d3.js";import"./shared-c43b90e7.js";import"./shared-b6ee51b2.js";import"./shared-6040bdb6.js";import"./shared-61ade33e.js";import"./foxy-spinner.js";import"./shared-a2253b8a.js";import"./shared-92f42e44.js";import"./shared-9803aa7c.js";import"./shared-8f0251e9.js";import"./shared-cd96ff03.js";import"./shared-ecec6a10.js";import"./shared-042969fe.js";import"./shared-365c8437.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=n(h(i));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:""}),a(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:a})})),this.manual?this.in({idle:"paused"})?a(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):"":a(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 o)||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-92f42e44.js";import"./shared-a2253b8a.js";import"./shared-d7a68ddc.js";import{_ as t}from"./shared-701157ac.js";import{c as e,h as o,L as r}from"./shared-dc73b9a5.js";import{C as i}from"./shared-fee535ca.js";import{I as s}from"./shared-a5c48bf4.js";import{a}from"./shared-b6ee51b2.js";import"./shared-c43b90e7.js";import"./shared-343d1fd7.js";import"./shared-9803aa7c.js";let n,d,c=t=>t;const h=i(a(s(r),"copy-to-clipboard"));class l extends h{constructor(){super(...arguments),this.text=null,this.__state="idle"}static get properties(){return t(t({},super.properties),{},{text:{type:String},__state:{attribute:!1}})}static get styles(){return e(n||(n=c`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}button::before{position:absolute;inset:0;content:' ';display:block;background:currentColor;opacity:.08;transition:opacity .15s ease;border-radius:var(--lumo-border-radius-s)}button:focus{outline:0;box-shadow:0 0 0 2px currentColor}button:disabled{opacity:.5;cursor:default}@media (hover:hover){button:not(:disabled):hover{cursor:pointer}button:not(:disabled):hover::before{opacity:.16}}iron-icon{--iron-icon-height:1em;--iron-icon-width:1em}`))}render(){let t="",e="";return"busy"===this.__state?(t="copying",e="icons:hourglass-empty"):"fail"===this.__state?(t="failed_to_copy",e="icons:error-outline"):"done"===this.__state?(t="done",e="icons:done"):(t="click_to_copy",e="icons:content-copy"),o(d||(d=c` <button title="${0}" ?disabled="${0}" @click="${0}"> <iron-icon icon="${0}"></iron-icon> </button> `),this.t(t),this.disabled,(()=>{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))))}),e)}}customElements.define("foxy-copy-to-clipboard",l);export{l as CopyToClipboard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-
|
|
1
|
+
import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-d7a68ddc.js";import{h as t}from"./shared-dc73b9a5.js";import{C as e}from"./shared-fee535ca.js";import{N as s}from"./shared-cbeb8587.js";import{T as i,a}from"./shared-b6ee51b2.js";import{c as r}from"./shared-4e709717.js";import"./shared-a2253b8a.js";import"./shared-c43b90e7.js";import"./shared-92f42e44.js";import"./shared-701157ac.js";import"./shared-a5c48bf4.js";import"./shared-343d1fd7.js";import"./shared-9803aa7c.js";import"./shared-8f0251e9.js";import"./shared-cd96ff03.js";import"./shared-ecec6a10.js";import"./shared-042969fe.js";import"./shared-365c8437.js";import"./shared-fbfa45bb.js";let n,o,d,l,c,p,h,m=t=>t;const u=i(e(a(s,"coupon-card")));class f extends u{constructor(){super(...arguments),this.templates={}}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-704b89be.js";import"./shared-d7a68ddc.js";import{a as s}from"./shared-b6ee51b2.js";import{I as e}from"./shared-2574c562.js";import{h as t}from"./shared-dc73b9a5.js";import"./foxy-spinner.js";import"./shared-a2253b8a.js";import"./shared-c43b90e7.js";import"./shared-92f42e44.js";import"./shared-701157ac.js";import"./shared-a5c48bf4.js";import"./shared-343d1fd7.js";import"./shared-cbeb8587.js";import"./shared-8f0251e9.js";import"./shared-cd96ff03.js";import"./shared-ecec6a10.js";import"./shared-042969fe.js";import"./shared-365c8437.js";import"./shared-fbfa45bb.js";import"./shared-4e709717.js";let r,o=s=>s;const a=s(e,"coupon-code-card");class i extends a{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",i);export{i as CouponCodeCard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-a4809573.js";import"./shared-95097c93.js";import"./shared-0c786cc9.js";import{I as r}from"./shared-c78c5441.js";import"./foxy-transaction-card.js";import{_ as e,B as s}from"./shared-701157ac.js";import{a as t}from"./shared-b6ee51b2.js";import{i as o}from"./shared-9803aa7c.js";import{h as a}from"./shared-dc73b9a5.js";import"./shared-d96b4840.js";import"./shared-7b4ed755.js";import"./shared-406306d3.js";import"./shared-c43b90e7.js";import"./shared-a2253b8a.js";import"./shared-d274a659.js";import"./shared-6040bdb6.js";import"./shared-d3d8cad4.js";import"./shared-61ade33e.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-92f42e44.js";import"./shared-d7a68ddc.js";import"./shared-343d1fd7.js";import"./shared-a5c48bf4.js";import"./shared-fee535ca.js";import"./shared-cbeb8587.js";import"./shared-8f0251e9.js";import"./shared-cd96ff03.js";import"./shared-ecec6a10.js";import"./shared-042969fe.js";import"./shared-365c8437.js";import"./shared-fbfa45bb.js";import"./shared-a0c6a159.js";import"./shared-99940888.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-198d654d.js";import"./shared-cb7cbfc1.js";import"./shared-4e709717.js";import"./foxy-pagination.js";import"./shared-6a4ddaef.js";import"./shared-51c4a6dd.js";import"./shared-dbe4e1a3.js";import"./shared-5b42f19a.js";import"./shared-d58490e1.js";import"./shared-7ee5a7cf.js";import"./shared-e20a7505.js";import"./shared-fdb43c3b.js";import"./foxy-copy-to-clipboard.js";import"./shared-bab2ea2c.js";import"./shared-4a63427c.js";import"./shared-26e29b61.js";import"./shared-704b89be.js";import"./shared-2574c562.js";let i,d=r=>r;const n=t(r,"coupon-code-form");class c extends n{constructor(){super(...arguments),this.getTransactionPageHref=null,this.templates={}}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 readonlySelector(){return new s(`number-of-uses-to-date ${super.readonlySelector}`.trim())}get hiddenSelector(){const r=[super.hiddenSelector.toString()];return this.href||r.unshift("transactions","number-of-uses-to-date"),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(i||(i=d` <foxy-internal-text-control infer="code"></foxy-internal-text-control> <foxy-internal-integer-control infer="number-of-uses-to-date"></foxy-internal-integer-control> <foxy-internal-async-list-control first="${0}" infer="transactions" limit="5" item="foxy-transaction-card" .getPageHref="${0}" hide-delete-button> </foxy-internal-async-list-control> ${0} `),o(s),this.getTransactionPageHref,super.renderBody())}}customElements.define("foxy-coupon-code-form",c);export{c as CouponCodeForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-7c362722.js";import{I as e}from"./shared-c78c5441.js";import{a as s}from"./shared-b6ee51b2.js";import{B as r}from"./shared-701157ac.js";import{h as o}from"./shared-dc73b9a5.js";import"./shared-a2253b8a.js";import"./shared-c43b90e7.js";import"./shared-6a4ddaef.js";import"./shared-51c4a6dd.js";import"./shared-d7a68ddc.js";import"./shared-343d1fd7.js";import"./shared-a5c48bf4.js";import"./shared-fee535ca.js";import"./shared-9803aa7c.js";import"./shared-cbeb8587.js";import"./shared-8f0251e9.js";import"./shared-cd96ff03.js";import"./shared-ecec6a10.js";import"./shared-042969fe.js";import"./shared-365c8437.js";import"./shared-fbfa45bb.js";import"./shared-4e709717.js";import"./shared-a0c6a159.js";import"./shared-22ba9566.js";import"./shared-99940888.js";import"./shared-d3d8cad4.js";import"./shared-406306d3.js";import"./shared-6040bdb6.js";import"./shared-61ade33e.js";import"./shared-198d654d.js";import"./shared-cb7cbfc1.js";import"./foxy-copy-to-clipboard.js";import"./shared-92f42e44.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.templates={},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-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-
|
|
1
|
+
import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-d7a68ddc.js";import{h as r}from"./shared-dc73b9a5.js";import{a as e}from"./shared-b6ee51b2.js";import{T as s}from"./shared-9452df44.js";import"./shared-a2253b8a.js";import"./shared-c43b90e7.js";import"./shared-92f42e44.js";import"./shared-701157ac.js";import"./shared-a5c48bf4.js";import"./shared-343d1fd7.js";import"./shared-fee535ca.js";import"./shared-9803aa7c.js";import"./shared-2574c562.js";import"./shared-cbeb8587.js";import"./shared-8f0251e9.js";import"./shared-cd96ff03.js";import"./shared-ecec6a10.js";import"./shared-042969fe.js";import"./shared-365c8437.js";import"./shared-fbfa45bb.js";import"./shared-4e709717.js";let t,a,c=r=>r;const i=e(s,"coupon-detail-card");class o extends i{constructor(){super(...arguments),this.__currencyDisplay="",this.__currency=""}renderBody(){return super.renderBody({title:e=>r(t||(t=c`${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=c` <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",o);export{o as CouponDetailCard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-157c52e5.js";import"./shared-ec0fb97f.js";import"./shared-96077b62.js";import{I as e}from"./shared-e5f6ca48.js";import"./foxy-query-builder.js";import{_ as t,B as o}from"./shared-3c58ddf1.js";import{O as s,T as r}from"./shared-8874ec69.js";import{c as i}from"./shared-4e709717.js";import{h as n}from"./shared-dc73b9a5.js";import"./shared-1602c9a4.js";import"./shared-28e988c6.js";import"./shared-eeb2d7ab.js";import"./shared-213b9416.js";import{I as a}from"./shared-9c3b800b.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"./shared-ecb7a183.js";import{R as l,a as c}from"./shared-e989e47e.js";import{i as d}from"./shared-9803aa7c.js";import"./shared-75f3a59e.js";import"./shared-98f85be1.js";import"./shared-221d3788.js";import"./shared-43928f5a.js";import"./shared-61ade33e.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-b7cda8ba.js";import"./shared-71782a9e.js";import"./shared-2808f43a.js";import"./shared-343d1fd7.js";import"./shared-bd99107c.js";import"./shared-272e7269.js";import"./shared-37391934.js";import"./shared-cd96ff03.js";import"./shared-12e531b8.js";import"./shared-90ddf541.js";import"./shared-39fc8fed.js";import"./shared-2e2d45c4.js";import"./shared-a0c6a159.js";import"./shared-99940888.js";import"./foxy-pagination.js";import"./shared-15a947f3.js";import"./shared-bab2ea2c.js";import"./foxy-form-dialog.js";import"./shared-85f44e3e.js";import"./shared-8d7e2e2c.js";import"./shared-d7bb413b.js";import"./shared-22ba9566.js";import"./shared-51c4a6dd.js";import"./shared-8438d4ca.js";import"./shared-79d0699c.js";import"./shared-c73f6e8a.js";import"./shared-0e9ad70e.js";import"./shared-51c3bc09.js";import"./shared-d67d56c2.js";import"./shared-9e014b51.js";import"./shared-891b33ad.js";import"./shared-82423f8b.js";import"./shared-21fec810.js";import"./shared-85707e42.js";import"./shared-879fcb1f.js";import"./shared-41e9ef02.js";import"./shared-a6e383ac.js";import"./shared-0f4947e8.js";import"./shared-43e2c3f6.js";import"./shared-739a8fe4.js";import"./shared-8452c492.js";import"./shared-f090c63a.js";import"./shared-8bd53409.js";import"./shared-a827bcc6.js";import"./foxy-swipe-actions.js";import"./foxy-transaction-card.js";import"./shared-b91650ba.js";import"./shared-8b4ba63a.js";import"./shared-c9f4fe97.js";let u,p,_,m,f=e=>e;customElements.define("foxy-internal-query-builder-control",class extends e{constructor(){super(...arguments),this.operators=Object.values(s),this.disableOr=!1}static get properties(){return t(t({},super.properties),{},{operators:{type:Array},disableOr:{type:Boolean,attribute:"disable-or"}})}renderControl(){const{label:e,helperText:t,_errorMessage:o}=this,s=o&&!this.disabled&&!this.readonly;return n(u||(u=f` <section class="${0}"> ${0} <foxy-query-builder infer="query-builder" .operators="${0}" .value="${0}" ?disable-or="${0}" @change="${0}"> </foxy-query-builder> ${0} ${0} </section> `),i({"grid gap-xs leading-xs transition-colors":!0,"text-secondary hover-text-body":!this.disabled&&!this.readonly,"text-disabled":this.disabled,"text-body":this.readonly}),e?n(p||(p=f`<p class="text-s font-medium">${0}</p>`),e):"",this.operators,this._value,this.disableOr,(e=>{var t;const o=e.currentTarget;this._value=null!==(t=o.value)&&void 0!==t?t:""}),t?n(_||(_=f`<p class="text-xs">${0}</p>`),t):"",s?n(m||(m=f`<p class="text-xs text-error">${0}</p>`),o):"")}});let h,y,b,x,g,v=e=>e;customElements.define("foxy-internal-coupon-form-rules-control",class extends e{renderControl(){var e,t;const o=this.nucleon,s=null!==(e=null==o?void 0:o.form.coupon_discount_details)&&void 0!==e?e:"",r=null!==(t=null==o?void 0:o.form.coupon_discount_type)&&void 0!==t?t:"quantity_amount",a=this.helperText,l=this.__renderRulesDescription(),c=this._errorMessage;return n(h||(h=v` <section> <p class="leading-xs flex items-center justify-between space-x-m text-s mb-xs"> <span class="${0}"> ${0} </span> <span class="min-w-0">${0}</span> </p> <foxy-discount-builder infer="discount-builder" .parsedValue="${0}" @change="${0}"> </foxy-discount-builder> ${0} ${0} </section> `),i({"transition-colors font-medium flex-1":!0,"text-secondary":!this.disabled,"text-disabled":this.disabled}),this.label,this.__renderPreset(),{details:s,type:r,name:"Rules"},(e=>{const t=e.currentTarget.parsedValue,o=this.nucleon;null==o||o.edit({coupon_discount_details:t.details,coupon_discount_type:t.type})}),a||l?n(y||(y=v` <p class="${0}"> ${0} </p> `),i({"text-xs mt-xs leading-xs transition-colors":!0,"text-secondary":!this.disabled&&!this.readonly,"text-disabled":this.disabled,"text-body":this.readonly}),l||a):"",!c||this.disabled||this.readonly?"":n(b||(b=v`<p class="mt-xs text-xs leading-xs text-error">${0}</p>`),this._errorMessage))}__renderRulesDescription(){var e,t;const o=this.nucleon,s=null!==(e=null==o?void 0:o.form.coupon_discount_type)&&void 0!==e?e:"quantity_amount",r=null!==(t=null==o?void 0:o.form.coupon_discount_details)&&void 0!==t?t:"";return r?this.t("discount_summary",{params:{details:r,type:s,ns:this.ns}}):null}__renderPreset(){const e=this.nucleon,o=null==e?void 0:e.form.coupon_discount_details,s=null==e?void 0:e.form.coupon_discount_type,r=[{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"}],a=r.find((e=>e.details===o&&e.type===s));return n(x||(x=v` <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> `),i({"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}),a?this.t("discount_summary",{params:t(t({},a),{},{ns:this.ns})}):this.t("custom_discount"),this.disabled||this.readonly,(e=>{var t,o;const s=e.currentTarget,i=r[s.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!==(o=null==i?void 0:i.type)&&void 0!==o?o:"quantity_amount"})}),r.map((e=>n(g||(g=v` <option value="${0}" ?selected="${0}"> ${0} </option> `),e.details,e===a,this.t("discount_summary",{params:t(t({},e),{},{ns:this.ns})})))),!a&&!!o&&!!s,this.t("custom_discount"))}});let j,$,w=e=>e;const k=l(c(a,"coupon-form"));class V extends k{constructor(){var e;super(...arguments),e=this,this.getTransactionPageHref=null,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,o)=>!!e&&o.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,o)=>!!e&&o.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,o)=>!!e&&o.indexOf(e)===t)).join(",")})},this.__itemOptionRestrictionsOperators=[s.In],this.__itemOptionRestrictionsGetValue=()=>{var e;const t=new URLSearchParams,o=null!==(e=this.form.item_option_restrictions)&&void 0!==e?e:{};for(const e in o)t.set(`${e}:in`,o[e].join(","));return t.toString()},this.__itemOptionRestrictionsSetValue=e=>{const t=Object.fromEntries(Array.from(new URLSearchParams(e).entries()).map((([e,t])=>[e.replace(":in",""),t.split(",").filter((e=>!!e.trim()))])));this.edit({item_option_restrictions:t})},this.__optionsGetValue=()=>{const e=[];return this.form.multiple_codes_allowed&&e.push("multiple_codes_allowed"),this.form.combinable&&e.push("combinable"),this.form.exclude_category_discounts&&e.push("exclude_category_discounts"),this.form.exclude_line_item_discounts&&e.push("exclude_line_item_discounts"),this.form.is_taxable&&e.push("is_taxable"),this.form.shared_codes_allowed&&e.push("shared_codes_allowed"),this.form.customer_auto_apply&&e.push("customer_auto_apply"),e},this.__optionsSetValue=e=>{this.edit({multiple_codes_allowed:e.includes("multiple_codes_allowed"),combinable:e.includes("combinable"),exclude_category_discounts:e.includes("exclude_category_discounts"),exclude_line_item_discounts:e.includes("exclude_line_item_discounts"),is_taxable:e.includes("is_taxable"),shared_codes_allowed:e.includes("shared_codes_allowed"),customer_auto_apply:e.includes("customer_auto_apply")})},this.__optionsOptions=[{value:"multiple_codes_allowed",label:"option_multiple_codes_allowed"},{value:"combinable",label:"option_combinable"},{value:"exclude_category_discounts",label:"option_exclude_category_discounts"},{value:"exclude_line_item_discounts",label:"option_exclude_line_item_discounts"},{value:"is_taxable",label:"option_is_taxable"},{value:"shared_codes_allowed",label:"option_shared_codes_allowed"},{value:"customer_auto_apply",label:"option_customer_auto_apply"}],this.__storeLoaderId="storeLoader",this.__codesFilters=[{label:"code",path:"code",type:r.String},{label:"used_codes",path:"number_of_uses_to_date",type:r.Number},{label:"date_created",path:"date_created",type:r.Date},{label:"date_modified",path:"date_modified",type:r.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 t(t({},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","category-restrictions","attributes"),this.form.customer_auto_apply||e.push("customer-attribute-restrictions","customer-subscription-restrictions"),new o(e.join(" ").trim())}renderHeaderActions(e){return n(j||(j=w` <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,o,s,r,i,a,l;let c;try{const o=new URL(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:coupon_codes"].href)&&void 0!==t?t:"");o.searchParams.set("order","date_created desc"),c=o.toString()}catch(e){c=void 0}return n($||($=w` ${0} <foxy-internal-text-control infer="name"></foxy-internal-text-control> <foxy-internal-coupon-form-rules-control infer="rules"> </foxy-internal-coupon-form-rules-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-query-builder-control infer="item-option-restrictions" disable-or .operators="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-query-builder-control> <foxy-internal-editable-list-control infer="product-code-restrictions" .getValue="${0}" .setValue="${0}" .units="${0}"> </foxy-internal-editable-list-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> <div class="grid gap-l sm-grid-cols-3"> <foxy-internal-integer-control infer="number-of-uses-allowed" min="0" show-controls> </foxy-internal-integer-control> <foxy-internal-integer-control infer="number-of-uses-allowed-per-customer" min="0" show-controls> </foxy-internal-integer-control> <foxy-internal-integer-control infer="number-of-uses-allowed-per-code" min="0" show-controls> </foxy-internal-integer-control> </div> <div class="grid gap-l sm-grid-cols-2"> <foxy-internal-date-control infer="start-date"></foxy-internal-date-control> <foxy-internal-date-control infer="end-date"></foxy-internal-date-control> </div> <foxy-internal-number-control min="0" max="1" infer="inclusive-tax-rate"> </foxy-internal-number-control> <foxy-internal-checkbox-group-control infer="options" theme="vertical" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-editable-list-control infer="customer-subscription-restrictions" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-query-builder-control infer="customer-attribute-restrictions"> </foxy-internal-query-builder-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(),c,{".getTransactionPageHref":this.getTransactionPageHref},this.__couponCodesActions,this.__codesFilters,this.__itemOptionRestrictionsOperators,this.__itemOptionRestrictionsGetValue,this.__itemOptionRestrictionsSetValue,this.__productCodeRestrictionsGetValue,this.__productCodeRestrictionsSetValue,[{label:this.t("product-code-restrictions.unit_allow"),value:"allow"},{label:this.t("product-code-restrictions.unit_block"),value:"block"}],d(null===(o=this.data)||void 0===o?void 0:o._links.self.href),d(null===(r=null===(s=this.__storeLoader)||void 0===s?void 0:s.data)||void 0===r?void 0:r._links["fx:item_categories"].href),d(null===(i=this.data)||void 0===i?void 0:i._links["fx:coupon_item_categories"].href),this.__optionsGetValue,this.__optionsSetValue,this.__optionsOptions,this.__customerSubscriptionRestrictionsGetValue,this.__customerSubscriptionRestrictionsSetValue,d(null===(a=this.data)||void 0===a?void 0:a._links["fx:attributes"].href),super.renderBody(),d(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",V);export{V as CouponForm};
|
|
1
|
+
import"./shared-9f6344ce.js";import"./shared-f44ad831.js";import"./shared-7c362722.js";import{I as e}from"./shared-6a4ddaef.js";import"./foxy-query-builder.js";import{_ as t,B as o}from"./shared-701157ac.js";import{O as s,T as r}from"./shared-8874ec69.js";import{c as i}from"./shared-4e709717.js";import{h as n}from"./shared-dc73b9a5.js";import"./shared-95097c93.js";import"./shared-4d3cfde9.js";import"./shared-0c786cc9.js";import"./shared-02bfc323.js";import{I as a}from"./shared-c78c5441.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"./shared-d7a68ddc.js";import{R as l,a as c}from"./shared-b6ee51b2.js";import{i as d}from"./shared-9803aa7c.js";import"./shared-bf697129.js";import"./shared-406306d3.js";import"./shared-c43b90e7.js";import"./shared-6040bdb6.js";import"./shared-61ade33e.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-a2253b8a.js";import"./shared-92f42e44.js";import"./shared-a5c48bf4.js";import"./shared-343d1fd7.js";import"./shared-fee535ca.js";import"./shared-cbeb8587.js";import"./shared-8f0251e9.js";import"./shared-cd96ff03.js";import"./shared-ecec6a10.js";import"./shared-042969fe.js";import"./shared-365c8437.js";import"./shared-fbfa45bb.js";import"./shared-a0c6a159.js";import"./shared-99940888.js";import"./foxy-pagination.js";import"./shared-d3d8cad4.js";import"./shared-bab2ea2c.js";import"./foxy-form-dialog.js";import"./shared-198d654d.js";import"./shared-cb7cbfc1.js";import"./shared-e20a7505.js";import"./shared-22ba9566.js";import"./shared-51c4a6dd.js";import"./shared-8438d4ca.js";import"./shared-79d0699c.js";import"./shared-dbe4e1a3.js";import"./shared-5b42f19a.js";import"./shared-d58490e1.js";import"./shared-7ee5a7cf.js";import"./shared-fdb43c3b.js";import"./shared-673b5058.js";import"./shared-ebe1fd1d.js";import"./shared-7b4ed755.js";import"./shared-fb4213b0.js";import"./shared-d96b4840.js";import"./shared-d274a659.js";import"./shared-e1cd88e3.js";import"./shared-2aae2920.js";import"./shared-43e2c3f6.js";import"./shared-251a538b.js";import"./shared-9452df44.js";import"./shared-2574c562.js";import"./shared-704b89be.js";import"./shared-a4809573.js";import"./foxy-swipe-actions.js";import"./foxy-transaction-card.js";import"./shared-4a63427c.js";import"./shared-26e29b61.js";import"./shared-aefcc55d.js";let u,p,_,m,f=e=>e;customElements.define("foxy-internal-query-builder-control",class extends e{constructor(){super(...arguments),this.operators=Object.values(s),this.disableOr=!1}static get properties(){return t(t({},super.properties),{},{operators:{type:Array},disableOr:{type:Boolean,attribute:"disable-or"}})}renderControl(){const{label:e,helperText:t,_errorMessage:o}=this,s=o&&!this.disabled&&!this.readonly;return n(u||(u=f` <section class="${0}"> ${0} <foxy-query-builder infer="query-builder" .operators="${0}" .value="${0}" ?disable-or="${0}" @change="${0}"> </foxy-query-builder> ${0} ${0} </section> `),i({"grid gap-xs leading-xs transition-colors":!0,"text-secondary hover-text-body":!this.disabled&&!this.readonly,"text-disabled":this.disabled,"text-body":this.readonly}),e?n(p||(p=f`<p class="text-s font-medium">${0}</p>`),e):"",this.operators,this._value,this.disableOr,(e=>{var t;const o=e.currentTarget;this._value=null!==(t=o.value)&&void 0!==t?t:""}),t?n(_||(_=f`<p class="text-xs">${0}</p>`),t):"",s?n(m||(m=f`<p class="text-xs text-error">${0}</p>`),o):"")}});let h,y,b,x,g,v=e=>e;customElements.define("foxy-internal-coupon-form-rules-control",class extends e{renderControl(){var e,t;const o=this.nucleon,s=null!==(e=null==o?void 0:o.form.coupon_discount_details)&&void 0!==e?e:"",r=null!==(t=null==o?void 0:o.form.coupon_discount_type)&&void 0!==t?t:"quantity_amount",a=this.helperText,l=this.__renderRulesDescription(),c=this._errorMessage;return n(h||(h=v` <section> <p class="leading-xs flex items-center justify-between space-x-m text-s mb-xs"> <span class="${0}"> ${0} </span> <span class="min-w-0">${0}</span> </p> <foxy-discount-builder infer="discount-builder" .parsedValue="${0}" @change="${0}"> </foxy-discount-builder> ${0} ${0} </section> `),i({"transition-colors font-medium flex-1":!0,"text-secondary":!this.disabled,"text-disabled":this.disabled}),this.label,this.__renderPreset(),{details:s,type:r,name:"Rules"},(e=>{const t=e.currentTarget.parsedValue,o=this.nucleon;null==o||o.edit({coupon_discount_details:t.details,coupon_discount_type:t.type})}),a||l?n(y||(y=v` <p class="${0}"> ${0} </p> `),i({"text-xs mt-xs leading-xs transition-colors":!0,"text-secondary":!this.disabled&&!this.readonly,"text-disabled":this.disabled,"text-body":this.readonly}),l||a):"",!c||this.disabled||this.readonly?"":n(b||(b=v`<p class="mt-xs text-xs leading-xs text-error">${0}</p>`),this._errorMessage))}__renderRulesDescription(){var e,t;const o=this.nucleon,s=null!==(e=null==o?void 0:o.form.coupon_discount_type)&&void 0!==e?e:"quantity_amount",r=null!==(t=null==o?void 0:o.form.coupon_discount_details)&&void 0!==t?t:"";return r?this.t("discount_summary",{params:{details:r,type:s,ns:this.ns}}):null}__renderPreset(){const e=this.nucleon,o=null==e?void 0:e.form.coupon_discount_details,s=null==e?void 0:e.form.coupon_discount_type,r=[{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"}],a=r.find((e=>e.details===o&&e.type===s));return n(x||(x=v` <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> `),i({"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}),a?this.t("discount_summary",{params:t(t({},a),{},{ns:this.ns})}):this.t("custom_discount"),this.disabled||this.readonly,(e=>{var t,o;const s=e.currentTarget,i=r[s.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!==(o=null==i?void 0:i.type)&&void 0!==o?o:"quantity_amount"})}),r.map((e=>n(g||(g=v` <option value="${0}" ?selected="${0}"> ${0} </option> `),e.details,e===a,this.t("discount_summary",{params:t(t({},e),{},{ns:this.ns})})))),!a&&!!o&&!!s,this.t("custom_discount"))}});let j,$,w=e=>e;const k=l(c(a,"coupon-form"));class V extends k{constructor(){var e;super(...arguments),e=this,this.getTransactionPageHref=null,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,o)=>!!e&&o.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,o)=>!!e&&o.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,o)=>!!e&&o.indexOf(e)===t)).join(",")})},this.__itemOptionRestrictionsOperators=[s.In],this.__itemOptionRestrictionsGetValue=()=>{var e;const t=new URLSearchParams,o=null!==(e=this.form.item_option_restrictions)&&void 0!==e?e:{};for(const e in o)t.set(`${e}:in`,o[e].join(","));return t.toString()},this.__itemOptionRestrictionsSetValue=e=>{const t=Object.fromEntries(Array.from(new URLSearchParams(e).entries()).map((([e,t])=>[e.replace(":in",""),t.split(",").filter((e=>!!e.trim()))])));this.edit({item_option_restrictions:t})},this.__optionsGetValue=()=>{const e=[];return this.form.multiple_codes_allowed&&e.push("multiple_codes_allowed"),this.form.combinable&&e.push("combinable"),this.form.exclude_category_discounts&&e.push("exclude_category_discounts"),this.form.exclude_line_item_discounts&&e.push("exclude_line_item_discounts"),this.form.is_taxable&&e.push("is_taxable"),this.form.shared_codes_allowed&&e.push("shared_codes_allowed"),this.form.customer_auto_apply&&e.push("customer_auto_apply"),e},this.__optionsSetValue=e=>{this.edit({multiple_codes_allowed:e.includes("multiple_codes_allowed"),combinable:e.includes("combinable"),exclude_category_discounts:e.includes("exclude_category_discounts"),exclude_line_item_discounts:e.includes("exclude_line_item_discounts"),is_taxable:e.includes("is_taxable"),shared_codes_allowed:e.includes("shared_codes_allowed"),customer_auto_apply:e.includes("customer_auto_apply")})},this.__optionsOptions=[{value:"multiple_codes_allowed",label:"option_multiple_codes_allowed"},{value:"combinable",label:"option_combinable"},{value:"exclude_category_discounts",label:"option_exclude_category_discounts"},{value:"exclude_line_item_discounts",label:"option_exclude_line_item_discounts"},{value:"is_taxable",label:"option_is_taxable"},{value:"shared_codes_allowed",label:"option_shared_codes_allowed"},{value:"customer_auto_apply",label:"option_customer_auto_apply"}],this.__storeLoaderId="storeLoader",this.__codesFilters=[{label:"code",path:"code",type:r.String},{label:"used_codes",path:"number_of_uses_to_date",type:r.Number},{label:"date_created",path:"date_created",type:r.Date},{label:"date_modified",path:"date_modified",type:r.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 t(t({},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","category-restrictions","attributes"),this.form.customer_auto_apply||e.push("customer-attribute-restrictions","customer-subscription-restrictions"),new o(e.join(" ").trim())}renderHeaderActions(e){return n(j||(j=w` <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,o,s,r,i,a,l;let c;try{const o=new URL(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:coupon_codes"].href)&&void 0!==t?t:"");o.searchParams.set("order","date_created desc"),c=o.toString()}catch(e){c=void 0}return n($||($=w` ${0} <foxy-internal-text-control infer="name"></foxy-internal-text-control> <foxy-internal-coupon-form-rules-control infer="rules"> </foxy-internal-coupon-form-rules-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-query-builder-control infer="item-option-restrictions" disable-or .operators="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-query-builder-control> <foxy-internal-editable-list-control infer="product-code-restrictions" .getValue="${0}" .setValue="${0}" .units="${0}"> </foxy-internal-editable-list-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> <div class="grid gap-l sm-grid-cols-3"> <foxy-internal-integer-control infer="number-of-uses-allowed" min="0" show-controls> </foxy-internal-integer-control> <foxy-internal-integer-control infer="number-of-uses-allowed-per-customer" min="0" show-controls> </foxy-internal-integer-control> <foxy-internal-integer-control infer="number-of-uses-allowed-per-code" min="0" show-controls> </foxy-internal-integer-control> </div> <div class="grid gap-l sm-grid-cols-2"> <foxy-internal-date-control infer="start-date"></foxy-internal-date-control> <foxy-internal-date-control infer="end-date"></foxy-internal-date-control> </div> <foxy-internal-number-control min="0" max="1" infer="inclusive-tax-rate"> </foxy-internal-number-control> <foxy-internal-checkbox-group-control infer="options" theme="vertical" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-editable-list-control infer="customer-subscription-restrictions" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-query-builder-control infer="customer-attribute-restrictions"> </foxy-internal-query-builder-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(),c,{".getTransactionPageHref":this.getTransactionPageHref},this.__couponCodesActions,this.__codesFilters,this.__itemOptionRestrictionsOperators,this.__itemOptionRestrictionsGetValue,this.__itemOptionRestrictionsSetValue,this.__productCodeRestrictionsGetValue,this.__productCodeRestrictionsSetValue,[{label:this.t("product-code-restrictions.unit_allow"),value:"allow"},{label:this.t("product-code-restrictions.unit_block"),value:"block"}],d(null===(o=this.data)||void 0===o?void 0:o._links.self.href),d(null===(r=null===(s=this.__storeLoader)||void 0===s?void 0:s.data)||void 0===r?void 0:r._links["fx:item_categories"].href),d(null===(i=this.data)||void 0===i?void 0:i._links["fx:coupon_item_categories"].href),this.__optionsGetValue,this.__optionsSetValue,this.__optionsOptions,this.__customerSubscriptionRestrictionsGetValue,this.__customerSubscriptionRestrictionsSetValue,d(null===(a=this.data)||void 0===a?void 0:a._links["fx:attributes"].href),super.renderBody(),d(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",V);export{V as CouponForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import{h as r}from"./shared-dc73b9a5.js";import{a as s}from"./shared-
|
|
1
|
+
import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import{h as r}from"./shared-dc73b9a5.js";import{a as s}from"./shared-b6ee51b2.js";import{T as e}from"./shared-9452df44.js";import"./shared-a2253b8a.js";import"./shared-c43b90e7.js";import"./shared-92f42e44.js";import"./shared-d7a68ddc.js";import"./shared-701157ac.js";import"./shared-343d1fd7.js";import"./shared-a5c48bf4.js";import"./shared-fee535ca.js";import"./shared-9803aa7c.js";import"./shared-2574c562.js";import"./shared-cbeb8587.js";import"./shared-8f0251e9.js";import"./shared-cd96ff03.js";import"./shared-ecec6a10.js";import"./shared-042969fe.js";import"./shared-365c8437.js";import"./shared-fbfa45bb.js";import"./shared-4e709717.js";let a,d,t=r=>r;class o extends(s(e,"custom-field-card")){renderBody(){return super.renderBody({title:s=>r(a||(a=t`${0}`),s.name),subtitle:s=>r(d||(d=t`${0}`),s.value)})}}customElements.define("foxy-custom-field-card",o);export{o as CustomFieldCard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-f44ad831.js";import"./shared-251a538b.js";import{I as e}from"./shared-c78c5441.js";import{a as r}from"./shared-b6ee51b2.js";import{h as s}from"./shared-dc73b9a5.js";import"./shared-bf697129.js";import"./shared-406306d3.js";import"./shared-c43b90e7.js";import"./shared-6040bdb6.js";import"./shared-61ade33e.js";import"./shared-e20a7505.js";import"./shared-a2253b8a.js";import"./shared-6a4ddaef.js";import"./shared-51c4a6dd.js";import"./shared-d7a68ddc.js";import"./shared-701157ac.js";import"./shared-343d1fd7.js";import"./shared-a5c48bf4.js";import"./shared-fee535ca.js";import"./shared-9803aa7c.js";import"./shared-cbeb8587.js";import"./shared-8f0251e9.js";import"./shared-cd96ff03.js";import"./shared-ecec6a10.js";import"./shared-042969fe.js";import"./shared-365c8437.js";import"./shared-fbfa45bb.js";import"./shared-a0c6a159.js";import"./shared-d3d8cad4.js";import"./shared-198d654d.js";import"./shared-cb7cbfc1.js";import"./shared-4e709717.js";import"./foxy-copy-to-clipboard.js";import"./shared-92f42e44.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let i,t=e=>e;const o=r(e,"custom-field-form");class a extends o{constructor(){super(...arguments),this.templates={},this.__visibilityGetValue=()=>this.form.is_hidden?["hidden"]:[],this.__visibilitySetValue=e=>{this.edit({is_hidden:e.includes("hidden")})},this.__visibilityOptions=[{label:"option_hidden",value:"hidden"}]}static get v8n(){return[({value:e})=>e&&e.length>0||"value:v8n_required",({value:e})=>!e||e.length<=700||"value:v8n_too_long",({name:e})=>e&&e.length>0||"name:v8n_required",({name:e})=>!e||e.length<=100||"name:v8n_too_long"]}renderBody(){return s(i||(i=t` <foxy-internal-source-control infer="name"></foxy-internal-source-control> <foxy-internal-source-control infer="value"></foxy-internal-source-control> <foxy-internal-checkbox-group-control infer="visibility" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> ${0} `),this.__visibilityGetValue,this.__visibilitySetValue,this.__visibilityOptions,super.renderBody())}}customElements.define("foxy-custom-field-form",a);export{a as CustomFieldForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as s}from"./shared-
|
|
1
|
+
import{C as s}from"./shared-49d678ad.js";export{C as CustomerApi}from"./shared-49d678ad.js";import"./shared-701157ac.js";import"./shared-dc73b9a5.js";import"./shared-c2128988.js";import"./shared-7063f5af.js";import"./shared-fee535ca.js";import"./shared-9803aa7c.js";import"./shared-343d1fd7.js";import"./shared-a5c48bf4.js";customElements.define("foxy-customer-api",s);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-
|
|
1
|
+
import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-d7a68ddc.js";import{h as e}from"./shared-dc73b9a5.js";import{C as t}from"./shared-fee535ca.js";import{N as s}from"./shared-cbeb8587.js";import{T as a,a as i}from"./shared-b6ee51b2.js";import{c as r}from"./shared-4e709717.js";import"./shared-a2253b8a.js";import"./shared-c43b90e7.js";import"./shared-92f42e44.js";import"./shared-701157ac.js";import"./shared-a5c48bf4.js";import"./shared-343d1fd7.js";import"./shared-9803aa7c.js";import"./shared-8f0251e9.js";import"./shared-cd96ff03.js";import"./shared-ecec6a10.js";import"./shared-042969fe.js";import"./shared-365c8437.js";import"./shared-fbfa45bb.js";let d,o,n,l,m,c,p,h=e=>e;const v=a(t(i(s,"customer-card")));class f extends v{constructor(){super(...arguments),this.templates={}}render(){var t,s;const a=this.hiddenSelector;return e(d||(d=h` <div aria-busy="${0}" aria-live="polite" class="relative leading-m font-lumo text-m"> <div class="${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({"leading-xs transition-opacity":!0,"opacity-0":!this.data}),a.matches("name",!0)?"":this.__renderName(),a.matches("email",!0)?"":this.__renderEmail(),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===(t=customElements.get("foxy-spinner"))||void 0===t?void 0:t.defaultNS)&&void 0!==s?s:"")}__renderName(){var t,s,a,i,r;const d=this.data,m=`${null!==(t=null==d?void 0:d.first_name)&&void 0!==t?t:""} ${null!==(s=null==d?void 0:d.last_name)&&void 0!==s?s:""}`.trim()||"–",c=d?e(o||(o=h`${0}`),m):e(n||(n=h`​`));let p;try{p=null!==(r=new URL(null!==(i=null===(a=this.data)||void 0===a?void 0:a._links.self.href)&&void 0!==i?i:"").pathname.split("/").pop())&&void 0!==r?r:""}catch(e){p=""}return e(l||(l=h` <div data-testid="name"> ${0} <div class="flex items-center gap-m"> <div class="font-medium text-body truncate mr-auto">${0}</div> <div class="text-tertiary text-s">ID ${0}</div> </div> ${0} </div> `),this.renderTemplateOrSlot("name:before"),c,p,this.renderTemplateOrSlot("name:after"))}__renderEmail(){var t;const s=this.data,a=`${null!==(t=null==s?void 0:s.email)&&void 0!==t?t:""}`.trim()||"–",i=s?e(m||(m=h`${0}`),a):e(c||(c=h`​`));return e(p||(p=h` <div data-testid="email"> ${0} <div class="text-secondary truncate text-s">${0}</div> ${0} </div> `),this.renderTemplateOrSlot("email:before"),i,this.renderTemplateOrSlot("email:after"))}}customElements.define("foxy-customer-card",f);export{f as CustomerCard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-c9f4fe97.js";import"./shared-ec636065.js";import"./shared-eeb2d7ab.js";import{I as e}from"./shared-9c3b800b.js";import{a as t}from"./shared-e5f6ca48.js";import"./shared-ecb7a183.js";import{i as s}from"./shared-9803aa7c.js";import{h as r}from"./shared-dc73b9a5.js";import{c as o,_ as a,B as i}from"./shared-3c58ddf1.js";import{S as n,a as d}from"./shared-e989e47e.js";import{v as l}from"./shared-b738ee96.js";import{c as h}from"./shared-4e709717.js";import"./shared-98f85be1.js";import"./shared-221d3788.js";import"./shared-43928f5a.js";import"./shared-61ade33e.js";import"./shared-d7bb413b.js";import"./shared-b7cda8ba.js";import"./shared-3521ade9.js";import"./shared-0e9ad70e.js";import"./shared-d67d56c2.js";import"./shared-51c3bc09.js";import"./shared-15a947f3.js";import"./shared-85f44e3e.js";import"./shared-8d7e2e2c.js";import"./shared-37391934.js";import"./shared-343d1fd7.js";import"./shared-bd99107c.js";import"./shared-2808f43a.js";import"./foxy-copy-to-clipboard.js";import"./shared-71782a9e.js";import"./foxy-spinner.js";import"./shared-272e7269.js";import"./shared-cd96ff03.js";import"./shared-12e531b8.js";import"./shared-90ddf541.js";import"./shared-39fc8fed.js";import"./shared-2e2d45c4.js";import"./shared-bab2ea2c.js";import"./shared-51c4a6dd.js";!function(){function e(e,t,s){if(null!=s){const r=e.includes("?")?"&":"?";return e+r+t+"="+encodeURIComponent(s)}return e}class t extends Error{constructor(e){super(`[hcaptcha-web-component]: ${e}`),Object.setPrototypeOf(this,t.prototype)}}class s extends HTMLElement{connectedCallback(){(function(t){if(window._hCaptchaOnLoadPromise)return window._hCaptchaOnLoadPromise;if(window.hcaptcha)return console.warn("[vanilla-hcaptcha] hCaptcha JS API detected to be externally loaded. Unless you know what are you doing, this task should be delegated to this web component."),window._hCaptchaOnLoadPromise=Promise.resolve(),window._hCaptchaOnLoadPromise;{let s,r;window._hCaptchaOnLoadPromise=new Promise(((e,t)=>{s=e,r=t})),window._hCaptchaOnLoad=s;const o=function(t){let s=t.jsapi;return s=e(s,"render","explicit"),s=e(s,"onload","_hCaptchaOnLoad"),s=e(s,"recaptchacompat",!1===t.reCaptchaCompat?"off":null),s=e(s,"host",t.host),s=e(s,"hl",t.hl),s=e(s,"sentry",JSON.stringify(t.sentry)),s=e(s,"endpoint",t.endpoint),s=e(s,"assethost",t.assethost),s=e(s,"imghost",t.imghost),s=e(s,"reportapi",t.reportapi),s}(t),a=document.createElement("script");return a.src=o,a.async=!0,a.defer=!0,a.onerror=e=>{const t=`Failed to load hCaptcha JS API: "${o}"`;console.error(t,e),r(t)},document.head.appendChild(a),window._hCaptchaOnLoadPromise}})({host:this.getAttribute("host"),hl:this.getAttribute("hl"),sentry:"false"!==this.getAttribute("sentry"),reCaptchaCompat:"false"===this.getAttribute("reCaptchaCompat"),jsapi:this.getAttribute("jsapi")||"https://js.hcaptcha.com/1/api.js",endpoint:this.getAttribute("endpoint"),reportapi:this.getAttribute("reportapi"),assethost:this.getAttribute("assethost"),imghost:this.getAttribute("imghost")}).then(this.onApiLoaded.bind(this)).catch(this.onError.bind(this))}onApiLoaded(){this.$emit("loaded");const e="false"!==this.getAttribute("auto-render"),t={sitekey:this.getAttribute("sitekey")||this.getAttribute("site-key"),theme:this.getAttribute("theme"),size:this.getAttribute("size"),hl:this.getAttribute("hl"),tplinks:"off"===this.getAttribute("tplinks")?"off":"on",tabindex:parseInt(this.getAttribute("tabindex")),custom:"true"===this.getAttribute("custom")},s=this.getAttribute("challenge-container");s&&(t["challenge-container"]=s);const r=this.getAttribute("rqdata");e&&!t.sitekey||e&&(this.render(t),this.setData(r))}assertApiLoaded(e){if(!hcaptcha)throw new t(`hCaptcha JS API was not loaded yet. Please wait for \`loaded\` event to safely call "${e}".`)}assertRendered(){if(!this.hcaptchaId)throw new t('hCaptcha was not yet rendered. Please call "render()" first.')}onError(e){console.error(e),this.$emit("error",{error:e})}$emit(e,t){let s;"function"==typeof Event?s=new Event(e):(s=document.createEvent("Event"),s.initEvent(e,!1,!1)),t&&Object.assign(s,t),this.dispatchEvent(s)}render(e){this.assertApiLoaded("render"),this.hcaptchaId?console.warn("hCaptcha was already rendered. You may want to call 'reset()' first."):this.hcaptchaId=hcaptcha.render(this,Object.assign(Object.assign({},e),{callback:()=>{const e=hcaptcha.getResponse(this.hcaptchaId),t=hcaptcha.getRespKey(this.hcaptchaId);this.$emit("verified",{token:e,eKey:t,key:e})},"expired-callback":()=>{this.$emit("expired")},"chalexpired-callback":()=>{this.$emit("challenge-expired")},"error-callback":this.onError.bind(this),"open-callback":()=>{this.$emit("opened")},"close-callback":()=>{this.$emit("closed")}}))}setData(e){this.assertRendered(),hcaptcha.setData(this.hcaptchaId,{rqdata:e})}execute(){this.assertApiLoaded("execute"),this.assertRendered(),hcaptcha.execute(this.hcaptchaId)}executeAsync(){return this.assertApiLoaded("execute"),this.assertRendered(),hcaptcha.execute(this.hcaptchaId,{async:!0})}reset(){this.assertApiLoaded("reset"),this.assertRendered(),hcaptcha.reset(this.hcaptchaId)}}customElements.define("h-captcha",s)}();let c,p=e=>e;customElements.define("foxy-internal-customer-form-legal-notice-control",class extends t{renderControl(){var e,t;const o=this.nucleon;return r(c||(c=p` <p class="leading-s text-xs text-secondary"> <foxy-i18n infer="" key="text"></foxy-i18n> <a class="font-medium text-body rounded hover-underline focus-outline-none focus-ring-2 focus-ring-primary-50" target="_blank" href="${0}" rel="noopener noreferrer"> <foxy-i18n infer="" key="link"></foxy-i18n> </a> </p> `),s(null===(t=null===(e=null==o?void 0:o.settings)||void 0===e?void 0:e.tos_checkbox_settings)||void 0===t?void 0:t.url))}});var m=o((function(e){!function(){const t=[{id:0,value:"Too weak",minDiversity:0,minLength:0},{id:1,value:"Weak",minDiversity:2,minLength:6},{id:2,value:"Medium",minDiversity:4,minLength:8},{id:3,value:"Strong",minDiversity:4,minLength:10}],s=(e,s=t,r="!\"#$%&'()*+,-./:;<=>?@[\\\\\\]^_`{|}~")=>{let o=e||"";s[0].minDiversity=0,s[0].minLength=0;const a=[{regex:"[a-z]",message:"lowercase"},{regex:"[A-Z]",message:"uppercase"},{regex:"[0-9]",message:"number"}];r&&a.push({regex:`[${r}]`,message:"symbol"});let i={};i.contains=a.filter((e=>new RegExp(`${e.regex}`).test(o))).map((e=>e.message)),i.length=o.length;let n=s.filter((e=>i.contains.length>=e.minDiversity)).filter((e=>i.length>=e.minLength)).sort(((e,t)=>t.id-e.id)).map((e=>({id:e.id,value:e.value})));return Object.assign(i,n[0]),i};e.exports={passwordStrength:s,defaultOptions:t}}()}));let u,f,g=e=>e;const _=n(d(e,"customer-form")),y=m.passwordStrength;class x extends _{constructor(){super(...arguments),this.passwordless=!1,this.templates={},this.settings=null,this.__isAnonymousGetValue=()=>{var e;return!1===(null===(e=this.form)||void 0===e?void 0:e.is_anonymous)?"false":"true"},this.__isAnonymousSetValue=e=>{const t="true"===e;this.edit({is_anonymous:t}),t&&this.form.password&&this.edit({password:""}),t&&this.form.password_old&&this.edit({password_old:""}),t&&this.form.forgot_password&&this.edit({forgot_password:""})},this.__isAnonymousOptions=[{value:"true",label:"option_true"},{value:"false",label:"option_false"}],this.__refreshInterval=null}static get scopedElements(){return{"foxy-internal-customer-form-legal-notice-control":customElements.get("foxy-internal-customer-form-legal-notice-control"),"foxy-internal-radio-group-control":customElements.get("foxy-internal-radio-group-control"),"foxy-internal-timestamps-control":customElements.get("foxy-internal-timestamps-control"),"foxy-internal-password-control":customElements.get("foxy-internal-password-control"),"foxy-internal-create-control":customElements.get("foxy-internal-create-control"),"foxy-internal-delete-control":customElements.get("foxy-internal-delete-control"),"foxy-internal-text-control":customElements.get("foxy-internal-text-control"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-i18n":customElements.get("foxy-i18n"),"h-captcha":customElements.get("h-captcha"),"vaadin-button":customElements.get("vaadin-button")}}static get properties(){return a(a({},super.properties),{},{passwordless:{type:Boolean},settings:{type:Object}})}static get v8n(){return[({password:e,_links:t,is_anonymous:s=!0},r)=>!!r.passwordless||(!!(t||s||e)||"password:v8n_required"),({password_old:e,password:t,_links:s},r)=>{var o;return!s||(void 0===(null===(o=r.settings)||void 0===o?void 0:o.sign_up)||(!(t&&!e)||"password-old:v8n_required"))},({first_name:e})=>!e||e.length<=50||"first-name:v8n_too_long",({last_name:e})=>!e||e.length<=50||"last-name:v8n_too_long",({password:e})=>!e||y(e).id>=2||"password:v8n_too_weak",({password:e})=>!e||e.length<=50||"password:v8n_too_long",({tax_id:e})=>!e||e.length<=50||"tax-id:v8n_too_long",({email:e})=>e&&e.length>0||"email:v8n_required",({email:e})=>!e||e.length<=100||"email:v8n_too_long",({email:e})=>!e||l(e)||"email:v8n_invalid_email"]}get hiddenSelector(){const e=new Set(super.hiddenSelector.toString().split(" "));return this.settings?(e.add("forgot-password"),e.add("is-anonymous"),this.form.password||e.add("password-old"),"none"===this.settings.tos_checkbox_settings.usage&&e.add("legal-notice")):(!1!==this.form.is_anonymous&&(e.add("forgot-password"),e.add("password")),e.add("password-old"),e.add("legal-notice")),this.href&&(e.add("is-anonymous"),e.add("legal-notice")),new i(Array.from(e).join(" ").trim())}disconnectedCallback(){super.disconnectedCallback();const e=this.__refreshInterval;e&&clearInterval(e)}connectedCallback(){super.connectedCallback();const e=setInterval((()=>this.requestUpdate()),6e4);this.__refreshInterval=e}renderBody(){var e,t,s,o;const a=this.hiddenSelector.matches("first-name",!0),i=this.hiddenSelector.matches("last-name",!0);return r(u||(u=g` <div class="${0}"> <foxy-internal-text-control infer="first-name"></foxy-internal-text-control> <foxy-internal-text-control infer="last-name"></foxy-internal-text-control> </div> <foxy-internal-text-control helper-text="${0}" infer="email"> </foxy-internal-text-control> <foxy-internal-radio-group-control infer="is-anonymous" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-radio-group-control> <foxy-internal-password-control placeholder="${0}" helper-text="${0}" infer="password" show-generator> </foxy-internal-password-control> <foxy-internal-password-control infer="password-old"></foxy-internal-password-control> <foxy-internal-password-control helper-text="${0}" infer="forgot-password" show-generator> </foxy-internal-password-control> <foxy-internal-text-control infer="tax-id"></foxy-internal-text-control> <foxy-internal-customer-form-legal-notice-control infer="legal-notice"> </foxy-internal-customer-form-legal-notice-control> ${0} ${0} `),h({"grid-cols-2":!a&&!i,hidden:a&&i,"gap-m":!0,grid:!a||!i}),this.__emailHelperText,this.__isAnonymousGetValue,this.__isAnonymousSetValue,this.__isAnonymousOptions,this.__passwordPlaceholder,this.__passwordHelperText,this.__forgotPasswordHelperText,!this.data&&(null===(t=null===(e=this.settings)||void 0===e?void 0:e.sign_up)||void 0===t?void 0:t.enabled)&&"hcaptcha"===(null===(o=null===(s=this.settings)||void 0===s?void 0:s.sign_up)||void 0===o?void 0:o.verification.type)?r(f||(f=g` <h-captcha site-key="${0}" class="hidden" size="invisible" hl="${0}" @verified="${0}"> </h-captcha> `),this.settings.sign_up.verification.site_key,this.lang,(({token:e})=>{this.edit({verification:{type:"hcaptcha",token:e}}),super.submit()})):"",super.renderBody())}submit(){var e,t,s,r,o;"hcaptcha"!==(null===(s=null===(t=null===(e=this.settings)||void 0===e?void 0:e.sign_up)||void 0===t?void 0:t.verification)||void 0===s?void 0:s.type)||this.data?super.submit():(null===(r=this.__hcaptcha)||void 0===r||r.reset(),null===(o=this.__hcaptcha)||void 0===o||o.execute())}async _sendPatch(e){const t=await super._sendPatch(e);if(e.password){const e={key:"password_change_success",options:{email:t.email}};this.status=e}return t}async _sendGet(){return this.status=null,await super._sendGet()}async _fetch(...e){try{return await super._fetch(...e)}catch(e){let t;try{t=(await e.json())._embedded["fx:errors"][0].message}catch(t){throw e}throw"Conflict"===t||t.startsWith("This email address is already in use")?["error:email_already_used"]:t.startsWith("Customer registration is disabled")?["error:registration_disabled"]:t.startsWith("Client verification failed")?["error:verification_failed"]:t.startsWith("Provided password is incorrect")?["error:old_password_incorrect"]:e}}get __forgotPasswordHelperText(){var e,t;const s=null===(e=this.data)||void 0===e?void 0:e.forgot_password_timestamp,r="forgot-password.helper_text";if((null===(t=this.data)||void 0===t?void 0:t.forgot_password)&&s){const e=new Date(new Date(s).getTime()+18e5),t=Math.floor((e.getTime()-Date.now())/1e3/60);return t<=0?this.t(`${r}_expired_on`,{expiresOn:e}):this.t(`${r}_expires_in`,{expiresInMin:`${t}minutes`})}return this.t(r)}get __passwordPlaceholder(){return this.data?this.t("password.placeholder_new"):this.t("password.placeholder")}get __passwordHelperText(){return this.data?this.t("password.helper_text_new"):this.t("password.helper_text")}get __emailHelperText(){var e;return(null===(e=this.data)||void 0===e?void 0:e.last_login_date)?this.t("email.helper_text_last_login_date",{date:this.data.last_login_date}):this.t("email.helper_text")}get __hcaptcha(){return this.renderRoot.querySelector("h-captcha")}}customElements.define("foxy-customer-form",x);export{x as CustomerForm};
|
|
1
|
+
import"./shared-aefcc55d.js";import"./shared-fc9d9f3e.js";import"./shared-0c786cc9.js";import{I as t}from"./shared-c78c5441.js";import{a as e}from"./shared-6a4ddaef.js";import"./shared-d7a68ddc.js";import{i as s}from"./shared-9803aa7c.js";import{h as r}from"./shared-dc73b9a5.js";import{c as o,_ as a,B as i}from"./shared-701157ac.js";import{S as n,a as d}from"./shared-b6ee51b2.js";import{v as l}from"./shared-b738ee96.js";import{c as h}from"./shared-4e709717.js";import"./shared-406306d3.js";import"./shared-c43b90e7.js";import"./shared-6040bdb6.js";import"./shared-61ade33e.js";import"./shared-e20a7505.js";import"./shared-a2253b8a.js";import"./shared-f28b1959.js";import"./shared-5b42f19a.js";import"./shared-7ee5a7cf.js";import"./shared-d58490e1.js";import"./shared-d3d8cad4.js";import"./shared-198d654d.js";import"./shared-cb7cbfc1.js";import"./shared-8f0251e9.js";import"./shared-343d1fd7.js";import"./shared-fee535ca.js";import"./shared-a5c48bf4.js";import"./foxy-copy-to-clipboard.js";import"./shared-92f42e44.js";import"./foxy-spinner.js";import"./shared-cbeb8587.js";import"./shared-cd96ff03.js";import"./shared-ecec6a10.js";import"./shared-042969fe.js";import"./shared-365c8437.js";import"./shared-fbfa45bb.js";import"./shared-bab2ea2c.js";import"./shared-51c4a6dd.js";!function(){function t(t,e,s){if(null!=s){const r=t.includes("?")?"&":"?";return t+r+e+"="+encodeURIComponent(s)}return t}class e extends Error{constructor(t){super(`[hcaptcha-web-component]: ${t}`),Object.setPrototypeOf(this,e.prototype)}}class s extends HTMLElement{connectedCallback(){(function(e){if(window._hCaptchaOnLoadPromise)return window._hCaptchaOnLoadPromise;if(window.hcaptcha)return console.warn("[vanilla-hcaptcha] hCaptcha JS API detected to be externally loaded. Unless you know what are you doing, this task should be delegated to this web component."),window._hCaptchaOnLoadPromise=Promise.resolve(),window._hCaptchaOnLoadPromise;{let s,r;window._hCaptchaOnLoadPromise=new Promise(((t,e)=>{s=t,r=e})),window._hCaptchaOnLoad=s;const o=function(e){let s=e.jsapi;return s=t(s,"render","explicit"),s=t(s,"onload","_hCaptchaOnLoad"),s=t(s,"recaptchacompat",!1===e.reCaptchaCompat?"off":null),s=t(s,"host",e.host),s=t(s,"hl",e.hl),s=t(s,"sentry",JSON.stringify(e.sentry)),s=t(s,"endpoint",e.endpoint),s=t(s,"assethost",e.assethost),s=t(s,"imghost",e.imghost),s=t(s,"reportapi",e.reportapi),s}(e),a=document.createElement("script");return a.src=o,a.async=!0,a.defer=!0,a.onerror=t=>{const e=`Failed to load hCaptcha JS API: "${o}"`;console.error(e,t),r(e)},document.head.appendChild(a),window._hCaptchaOnLoadPromise}})({host:this.getAttribute("host"),hl:this.getAttribute("hl"),sentry:"false"!==this.getAttribute("sentry"),reCaptchaCompat:"false"===this.getAttribute("reCaptchaCompat"),jsapi:this.getAttribute("jsapi")||"https://js.hcaptcha.com/1/api.js",endpoint:this.getAttribute("endpoint"),reportapi:this.getAttribute("reportapi"),assethost:this.getAttribute("assethost"),imghost:this.getAttribute("imghost")}).then(this.onApiLoaded.bind(this)).catch(this.onError.bind(this))}onApiLoaded(){this.$emit("loaded");const t="false"!==this.getAttribute("auto-render"),e={sitekey:this.getAttribute("sitekey")||this.getAttribute("site-key"),theme:this.getAttribute("theme"),size:this.getAttribute("size"),hl:this.getAttribute("hl"),tplinks:"off"===this.getAttribute("tplinks")?"off":"on",tabindex:parseInt(this.getAttribute("tabindex")),custom:"true"===this.getAttribute("custom")},s=this.getAttribute("challenge-container");s&&(e["challenge-container"]=s);const r=this.getAttribute("rqdata");t&&!e.sitekey||t&&(this.render(e),this.setData(r))}assertApiLoaded(t){if(!hcaptcha)throw new e(`hCaptcha JS API was not loaded yet. Please wait for \`loaded\` event to safely call "${t}".`)}assertRendered(){if(!this.hcaptchaId)throw new e('hCaptcha was not yet rendered. Please call "render()" first.')}onError(t){console.error(t),this.$emit("error",{error:t})}$emit(t,e){let s;"function"==typeof Event?s=new Event(t):(s=document.createEvent("Event"),s.initEvent(t,!1,!1)),e&&Object.assign(s,e),this.dispatchEvent(s)}render(t){this.assertApiLoaded("render"),this.hcaptchaId?console.warn("hCaptcha was already rendered. You may want to call 'reset()' first."):this.hcaptchaId=hcaptcha.render(this,Object.assign(Object.assign({},t),{callback:()=>{const t=hcaptcha.getResponse(this.hcaptchaId),e=hcaptcha.getRespKey(this.hcaptchaId);this.$emit("verified",{token:t,eKey:e,key:t})},"expired-callback":()=>{this.$emit("expired")},"chalexpired-callback":()=>{this.$emit("challenge-expired")},"error-callback":this.onError.bind(this),"open-callback":()=>{this.$emit("opened")},"close-callback":()=>{this.$emit("closed")}}))}setData(t){this.assertRendered(),hcaptcha.setData(this.hcaptchaId,{rqdata:t})}execute(){this.assertApiLoaded("execute"),this.assertRendered(),hcaptcha.execute(this.hcaptchaId)}executeAsync(){return this.assertApiLoaded("execute"),this.assertRendered(),hcaptcha.execute(this.hcaptchaId,{async:!0})}reset(){this.assertApiLoaded("reset"),this.assertRendered(),hcaptcha.reset(this.hcaptchaId)}}customElements.define("h-captcha",s)}();let c,p=t=>t;customElements.define("foxy-internal-customer-form-legal-notice-control",class extends e{renderControl(){var t,e;const o=this.nucleon;return r(c||(c=p` <p class="leading-s text-xs text-secondary"> <foxy-i18n infer="" key="text"></foxy-i18n> <a class="font-medium text-body rounded hover-underline focus-outline-none focus-ring-2 focus-ring-primary-50" target="_blank" href="${0}" rel="noopener noreferrer"> <foxy-i18n infer="" key="link"></foxy-i18n> </a> </p> `),s(null===(e=null===(t=null==o?void 0:o.settings)||void 0===t?void 0:t.tos_checkbox_settings)||void 0===e?void 0:e.url))}});var m=o((function(t){!function(){const e=[{id:0,value:"Too weak",minDiversity:0,minLength:0},{id:1,value:"Weak",minDiversity:2,minLength:6},{id:2,value:"Medium",minDiversity:4,minLength:8},{id:3,value:"Strong",minDiversity:4,minLength:10}],s=(t,s=e,r="!\"#$%&'()*+,-./:;<=>?@[\\\\\\]^_`{|}~")=>{let o=t||"";s[0].minDiversity=0,s[0].minLength=0;const a=[{regex:"[a-z]",message:"lowercase"},{regex:"[A-Z]",message:"uppercase"},{regex:"[0-9]",message:"number"}];r&&a.push({regex:`[${r}]`,message:"symbol"});let i={};i.contains=a.filter((t=>new RegExp(`${t.regex}`).test(o))).map((t=>t.message)),i.length=o.length;let n=s.filter((t=>i.contains.length>=t.minDiversity)).filter((t=>i.length>=t.minLength)).sort(((t,e)=>e.id-t.id)).map((t=>({id:t.id,value:t.value})));return Object.assign(i,n[0]),i};t.exports={passwordStrength:s,defaultOptions:e}}()}));let u,f,g=t=>t;const _=n(d(t,"customer-form")),y=m.passwordStrength;class x extends _{constructor(){super(...arguments),this.passwordless=!1,this.templates={},this.settings=null,this.__isAnonymousGetValue=()=>{var t;return!1===(null===(t=this.form)||void 0===t?void 0:t.is_anonymous)?"false":"true"},this.__isAnonymousSetValue=t=>{const e="true"===t;this.edit({is_anonymous:e}),e&&this.form.password&&this.edit({password:""}),e&&this.form.password_old&&this.edit({password_old:""}),e&&this.form.forgot_password&&this.edit({forgot_password:""})},this.__isAnonymousOptions=[{value:"true",label:"option_true"},{value:"false",label:"option_false"}],this.__refreshInterval=null}static get scopedElements(){return{"foxy-internal-customer-form-legal-notice-control":customElements.get("foxy-internal-customer-form-legal-notice-control"),"foxy-internal-radio-group-control":customElements.get("foxy-internal-radio-group-control"),"foxy-internal-timestamps-control":customElements.get("foxy-internal-timestamps-control"),"foxy-internal-password-control":customElements.get("foxy-internal-password-control"),"foxy-internal-create-control":customElements.get("foxy-internal-create-control"),"foxy-internal-delete-control":customElements.get("foxy-internal-delete-control"),"foxy-internal-text-control":customElements.get("foxy-internal-text-control"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-i18n":customElements.get("foxy-i18n"),"h-captcha":customElements.get("h-captcha"),"vaadin-button":customElements.get("vaadin-button")}}static get properties(){return a(a({},super.properties),{},{passwordless:{type:Boolean},settings:{type:Object}})}static get v8n(){return[({password:t,_links:e,is_anonymous:s=!0},r)=>!!r.passwordless||(!!(e||s||t)||"password:v8n_required"),({password_old:t,password:e,_links:s},r)=>{var o;return!s||(void 0===(null===(o=r.settings)||void 0===o?void 0:o.sign_up)||(!(e&&!t)||"password-old:v8n_required"))},({first_name:t})=>!t||t.length<=50||"first-name:v8n_too_long",({last_name:t})=>!t||t.length<=50||"last-name:v8n_too_long",({password:t})=>!t||y(t).id>=2||"password:v8n_too_weak",({password:t})=>!t||t.length<=50||"password:v8n_too_long",({tax_id:t})=>!t||t.length<=50||"tax-id:v8n_too_long",({email:t})=>t&&t.length>0||"email:v8n_required",({email:t})=>!t||t.length<=100||"email:v8n_too_long",({email:t})=>!t||l(t)||"email:v8n_invalid_email"]}get hiddenSelector(){const t=new Set(super.hiddenSelector.toString().split(" "));return this.settings?(t.add("forgot-password"),t.add("is-anonymous"),this.form.password||t.add("password-old"),"none"===this.settings.tos_checkbox_settings.usage&&t.add("legal-notice")):(!1!==this.form.is_anonymous&&(t.add("forgot-password"),t.add("password")),t.add("password-old"),t.add("legal-notice")),this.href&&(t.add("is-anonymous"),t.add("legal-notice")),new i(Array.from(t).join(" ").trim())}disconnectedCallback(){super.disconnectedCallback();const t=this.__refreshInterval;t&&clearInterval(t)}connectedCallback(){super.connectedCallback();const t=setInterval((()=>this.requestUpdate()),6e4);this.__refreshInterval=t}renderBody(){var t,e,s,o;const a=this.hiddenSelector.matches("first-name",!0),i=this.hiddenSelector.matches("last-name",!0);return r(u||(u=g` <div class="${0}"> <foxy-internal-text-control infer="first-name"></foxy-internal-text-control> <foxy-internal-text-control infer="last-name"></foxy-internal-text-control> </div> <foxy-internal-text-control helper-text="${0}" infer="email"> </foxy-internal-text-control> <foxy-internal-radio-group-control infer="is-anonymous" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-radio-group-control> <foxy-internal-password-control placeholder="${0}" helper-text="${0}" infer="password" show-generator> </foxy-internal-password-control> <foxy-internal-password-control infer="password-old"></foxy-internal-password-control> <foxy-internal-password-control helper-text="${0}" infer="forgot-password" show-generator> </foxy-internal-password-control> <foxy-internal-text-control infer="tax-id"></foxy-internal-text-control> <foxy-internal-customer-form-legal-notice-control infer="legal-notice"> </foxy-internal-customer-form-legal-notice-control> ${0} ${0} `),h({"grid-cols-2":!a&&!i,hidden:a&&i,"gap-m":!0,grid:!a||!i}),this.__emailHelperText,this.__isAnonymousGetValue,this.__isAnonymousSetValue,this.__isAnonymousOptions,this.__passwordPlaceholder,this.__passwordHelperText,this.__forgotPasswordHelperText,!this.data&&(null===(e=null===(t=this.settings)||void 0===t?void 0:t.sign_up)||void 0===e?void 0:e.enabled)&&"hcaptcha"===(null===(o=null===(s=this.settings)||void 0===s?void 0:s.sign_up)||void 0===o?void 0:o.verification.type)?r(f||(f=g` <h-captcha site-key="${0}" class="hidden" size="invisible" hl="${0}" @verified="${0}"> </h-captcha> `),this.settings.sign_up.verification.site_key,this.lang,(({token:t})=>{this.edit({verification:{type:"hcaptcha",token:t}}),super.submit()})):"",super.renderBody())}submit(){var t,e,s,r,o;"hcaptcha"!==(null===(s=null===(e=null===(t=this.settings)||void 0===t?void 0:t.sign_up)||void 0===e?void 0:e.verification)||void 0===s?void 0:s.type)||this.data?super.submit():(null===(r=this.__hcaptcha)||void 0===r||r.reset(),null===(o=this.__hcaptcha)||void 0===o||o.execute())}async _sendPatch(t){const e=await super._sendPatch(t);if(t.password){const t={key:"password_change_success",options:{email:e.email}};this.status=t}return e}async _sendGet(){return this.status=null,await super._sendGet()}async _fetch(...t){try{return await super._fetch(...t)}catch(t){let e;try{e=(await t.json())._embedded["fx:errors"][0].message}catch(e){throw t}throw"Conflict"===e||e.startsWith("This email address is already in use")?["error:email_already_used"]:e.startsWith("Customer registration is disabled")?["error:registration_disabled"]:e.startsWith("Client verification failed")?["error:verification_failed"]:e.startsWith("Provided password is incorrect")?["error:old_password_incorrect"]:t}}get __forgotPasswordHelperText(){var t,e;const s=null===(t=this.data)||void 0===t?void 0:t.forgot_password_timestamp,r="forgot-password.helper_text";if((null===(e=this.data)||void 0===e?void 0:e.forgot_password)&&s){const t=new Date(new Date(s).getTime()+18e5),e=Math.floor((t.getTime()-Date.now())/1e3/60);return e<=0?this.t(`${r}_expired_on`,{expiresOn:t}):this.t(`${r}_expires_in`,{expiresInMin:`${e}minutes`})}return this.t(r)}get __passwordPlaceholder(){return this.data?this.t("password.placeholder_new"):this.t("password.placeholder")}get __passwordHelperText(){return this.data?this.t("password.helper_text_new"):this.t("password.helper_text")}get __emailHelperText(){var t;return(null===(t=this.data)||void 0===t?void 0:t.last_login_date)?this.t("email.helper_text_last_login_date",{date:this.data.last_login_date}):this.t("email.helper_text")}get __hcaptcha(){return this.renderRoot.querySelector("h-captcha")}}customElements.define("foxy-customer-form",x);export{x as CustomerForm};
|