@foxy.io/elements 1.29.0-beta.2 → 1.29.0-beta.3
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-address-form.js +1 -1
- package/dist/cdn/foxy-admin-subscription-form.js +1 -1
- package/dist/cdn/foxy-applied-coupon-code-form.js +1 -1
- package/dist/cdn/foxy-cart-form.js +2 -2
- package/dist/cdn/foxy-client-form.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-form.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.js +1 -1
- package/dist/cdn/foxy-customer.js +1 -1
- package/dist/cdn/foxy-downloadable-form.js +1 -1
- package/dist/cdn/foxy-email-template-form.js +1 -1
- package/dist/cdn/foxy-filter-attribute-form.js +1 -1
- package/dist/cdn/foxy-generate-codes-form.js +1 -1
- package/dist/cdn/foxy-gift-card-code-form.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-integration-form.js +1 -1
- package/dist/cdn/foxy-item-category-form.js +1 -1
- package/dist/cdn/foxy-item-form.js +2 -2
- package/dist/cdn/foxy-item-option-form.js +1 -1
- package/dist/cdn/foxy-native-integration-form.js +1 -1
- package/dist/cdn/foxy-passkey-form.js +1 -1
- package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-preset-form.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-form.js +1 -1
- package/dist/cdn/foxy-subscription-settings-form.js +1 -1
- package/dist/cdn/foxy-template-set-form.js +1 -1
- package/dist/cdn/foxy-transaction.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-form.js +1 -1
- package/dist/cdn/shared-18cb3cfc.js +1 -0
- package/dist/cdn/{shared-6e355777.js → shared-588c6b15.js} +1 -1
- package/dist/cdn/shared-666bdabd.js +1 -0
- package/dist/cdn/shared-b9138e9f.js +1 -0
- package/dist/cdn/shared-d393bcd8.js +1 -0
- package/dist/cdn/{shared-70a5fad6.js → shared-f8723f3f.js} +1 -1
- package/dist/cdn/translations/subscription-settings-form/en.json +85 -61
- package/dist/elements/internal/InternalEditableListControl/InternalEditableListControl.d.ts +1 -0
- package/dist/elements/internal/InternalEditableListControl/InternalEditableListControl.js +39 -18
- package/dist/elements/internal/InternalEditableListControl/InternalEditableListControl.js.map +1 -1
- package/dist/elements/internal/InternalEditableListControl/index.d.ts +1 -0
- package/dist/elements/internal/InternalEditableListControl/index.js +1 -0
- package/dist/elements/internal/InternalEditableListControl/index.js.map +1 -1
- package/dist/elements/internal/InternalFrequencyControl/InternalFrequencyControl.js +2 -2
- package/dist/elements/internal/InternalFrequencyControl/InternalFrequencyControl.js.map +1 -1
- package/dist/elements/internal/InternalNumberControl/InternalNumberControl.js +13 -5
- package/dist/elements/internal/InternalNumberControl/InternalNumberControl.js.map +1 -1
- package/dist/elements/internal/InternalSelectControl/InternalSelectControl.js +2 -2
- package/dist/elements/internal/InternalSelectControl/InternalSelectControl.js.map +1 -1
- package/dist/elements/internal/InternalSummaryControl/InternalSummaryControl.js +2 -2
- package/dist/elements/internal/InternalSummaryControl/InternalSummaryControl.js.map +1 -1
- package/dist/elements/internal/InternalSwitchControl/InternalSwitchControl.d.ts +1 -0
- package/dist/elements/internal/InternalSwitchControl/InternalSwitchControl.js +31 -9
- package/dist/elements/internal/InternalSwitchControl/InternalSwitchControl.js.map +1 -1
- package/dist/elements/internal/InternalSwitchControl/index.d.ts +1 -0
- package/dist/elements/internal/InternalSwitchControl/index.js +1 -0
- package/dist/elements/internal/InternalSwitchControl/index.js.map +1 -1
- package/dist/elements/internal/InternalTextControl/InternalTextControl.js +2 -2
- package/dist/elements/internal/InternalTextControl/InternalTextControl.js.map +1 -1
- package/dist/elements/public/CartForm/internal/InternalCartFormAddressSummaryItem/InternalCartFormAddressSummaryItem.js +3 -3
- package/dist/elements/public/CartForm/internal/InternalCartFormAddressSummaryItem/InternalCartFormAddressSummaryItem.js.map +1 -1
- package/dist/elements/public/SubscriptionSettingsForm/SubscriptionSettingsForm.d.ts +4 -13
- package/dist/elements/public/SubscriptionSettingsForm/SubscriptionSettingsForm.js +105 -115
- package/dist/elements/public/SubscriptionSettingsForm/SubscriptionSettingsForm.js.map +1 -1
- package/dist/elements/public/SubscriptionSettingsForm/index.d.ts +4 -4
- package/dist/elements/public/SubscriptionSettingsForm/index.js +4 -4
- package/dist/elements/public/SubscriptionSettingsForm/index.js.map +1 -1
- package/dist/elements/public/SubscriptionSettingsForm/types.d.ts +3 -1
- package/dist/elements/public/SubscriptionSettingsForm/types.js.map +1 -1
- package/package.json +1 -1
- package/dist/cdn/shared-292ba15e.js +0 -1
- package/dist/cdn/shared-aefac46b.js +0 -1
- package/dist/cdn/shared-d4810405.js +0 -1
- package/dist/elements/public/SubscriptionSettingsForm/internal/InternalSubscriptionSettingsFormReattemptBypass/InternalSubscriptionSettingsFormReattemptBypass.d.ts +0 -12
- package/dist/elements/public/SubscriptionSettingsForm/internal/InternalSubscriptionSettingsFormReattemptBypass/InternalSubscriptionSettingsFormReattemptBypass.js +0 -128
- package/dist/elements/public/SubscriptionSettingsForm/internal/InternalSubscriptionSettingsFormReattemptBypass/InternalSubscriptionSettingsFormReattemptBypass.js.map +0 -1
- package/dist/elements/public/SubscriptionSettingsForm/internal/InternalSubscriptionSettingsFormReattemptBypass/globalStyles.d.ts +0 -2
- package/dist/elements/public/SubscriptionSettingsForm/internal/InternalSubscriptionSettingsFormReattemptBypass/globalStyles.js +0 -26
- package/dist/elements/public/SubscriptionSettingsForm/internal/InternalSubscriptionSettingsFormReattemptBypass/globalStyles.js.map +0 -1
- package/dist/elements/public/SubscriptionSettingsForm/internal/InternalSubscriptionSettingsFormReattemptBypass/index.d.ts +0 -7
- package/dist/elements/public/SubscriptionSettingsForm/internal/InternalSubscriptionSettingsFormReattemptBypass/index.js +0 -13
- package/dist/elements/public/SubscriptionSettingsForm/internal/InternalSubscriptionSettingsFormReattemptBypass/index.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-7fd9a30f.js";import"./shared-fa9e5c7f.js";import"./shared-3fa791ca.js";import"./shared-292ba15e.js";import"./shared-d4810405.js";import"./shared-6e355777.js";import{I as e}from"./shared-8c1df97c.js";import"./foxy-discount-builder.js";import"./foxy-nucleon-element.js";import"./foxy-tax-card.js";import{_ as t,B as i}from"./shared-0f6e4584.js";import{a as r}from"./shared-075796e2.js";import{i as n}from"./shared-9803aa7c.js";import{h as a}from"./shared-dc73b9a5.js";import"./shared-e6e84ff5.js";import"./shared-6a4e81ad.js";import"./shared-30221a16.js";import"./shared-8f7a31e0.js";import"./shared-61ade33e.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-fb56178f.js";import"./shared-5c05ac06.js";import"./shared-f1d2b5bb.js";import"./shared-343d1fd7.js";import"./shared-f7a1193f.js";import"./shared-0b01f721.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-a0c6a159.js";import"./shared-99940888.js";import"./foxy-pagination.js";import"./shared-2d723710.js";import"./shared-4e709717.js";import"./shared-7b8ad9c1.js";import"./shared-51c4a6dd.js";import"./shared-bab2ea2c.js";import"./shared-797ba64a.js";import"./shared-10325cda.js";import"./shared-021c7a22.js";import"./shared-2099544a.js";import"./shared-2fc671cd.js";import"./shared-e5d37737.js";import"./shared-651c44fa.js";import"./shared-acdcae7e.js";import"./shared-3e03c988.js";import"./shared-fe77f6f6.js";import"./shared-b6814728.js";import"./shared-634b670e.js";import"./shared-df00a537.js";import"./shared-339bbd50.js";import"./shared-abea5e34.js";import"./shared-7026fb08.js";import"./foxy-copy-to-clipboard.js";import"./shared-12ac8cc6.js";import"./shared-ff63a551.js";import"./shared-8438d4ca.js";import"./shared-77051754.js";import"./shared-a6273e4a.js";let o,l,s,d,m,p,_,f,c,u,h,y=e=>e;class g extends(r(e,"item-category-form")){constructor(){super(...arguments),this.emailTemplates=null,this.taxes=null,this.__giftRecipientEmailTemplateLoaderId="gift-recipient-email-template-loader",this.__customerEmailTemplateLoaderId="customer-email-template-loader",this.__adminEmailTemplateLoaderId="admin-email-template-loader"}static get properties(){return t(t({},super.properties),{},{emailTemplates:{attribute:"email-templates"},taxes:{}})}static get v8n(){return[({code:e})=>!!e||"code:v8n_required",({code:e})=>e&&e.length<=50||"code:v8n_too_long",({name:e})=>!!e||"name:v8n_required",({name:e})=>e&&e.length<=50||"name:v8n_too_long",({item_delivery_type:e})=>!!e||"item-delivery-type:v8n_required",({item_delivery_type:e,max_downloads_per_customer:t})=>"downloaded"!==e||"number"==typeof t||"max-downloads-per-customer:v8n_required",({max_downloads_per_customer:e})=>"number"!=typeof e||e>=0||"max-downloads-per-customer:v8n_negative",({item_delivery_type:e,max_downloads_time_period:t})=>"downloaded"!==e||"number"==typeof t||"max-downloads-time-period:v8n_required",({max_downloads_time_period:e})=>"number"!=typeof e||e>=0||"max-downloads-time-period:v8n_negative",({customs_value:e})=>"number"!=typeof e||e>=0||"customs-value:v8n_negative",({item_delivery_type:e,default_weight:t})=>"shipped"!==e||"number"==typeof t||"default-weight:v8n_required",({default_weight:e})=>"number"!=typeof e||e>=0||"default-weight:v8n_negative",({item_delivery_type:e,default_weight_unit:t})=>"shipped"!==e||"string"==typeof t||"default-weight-unit:v8n_required",({item_delivery_type:e,default_length_unit:t})=>"shipped"!==e||"string"==typeof t||"default-length-unit:v8n_required",({item_delivery_type:e,shipping_flat_rate:t})=>"flat_rate"!==e||"number"==typeof t||"shipping-flat-rate:v8n_required",({shipping_flat_rate:e})=>"number"!=typeof e||e>=0||"shipping-flat-rate:v8n_negative",({item_delivery_type:e,shipping_flat_rate_type:t})=>"flat_rate"!==e||"string"==typeof t||"shipping-flat-rate-type:v8n_required",({handling_fee_type:e})=>!!e||"handling-fee-type:v8n_required",({handling_fee_type:e,handling_fee_minimum:t})=>"flat_percent_with_minimum"!==e||"number"==typeof t||"handling-fee-minimum:v8n_required",({handling_fee_minimum:e})=>"number"!=typeof e||e>=0||"handling-fee-minimum:v8n_negative",({handling_fee_type:e,handling_fee_percentage:t})=>"flat_percent_with_minimum"!==e&&"flat_percent"!==e||"number"==typeof t||"handling-fee-percentage:v8n_required",({handling_fee_percentage:e})=>"number"!=typeof e||e>=0||"handling-fee-percentage:v8n_negative",({send_admin_email:e,admin_email:t})=>!e||!!t||"admin-email:v8n_required"]}get hiddenSelector(){const e=[super.hiddenSelector.toString()];return this.data||e.unshift("taxes"),new i(e.join(" ").trim())}renderBody(){var e,t,i,r,s,d,m,p,_,f;const c=this.form.item_delivery_type,u=null!==(e=this.form.handling_fee_type)&&void 0!==e?e:"none";return a(o||(o=y` ${0} <div class="grid grid-cols-2 gap-m"> <foxy-internal-text-control infer="name" class="col-span-2"></foxy-internal-text-control> <foxy-internal-text-control infer="code" class="col-span-2"></foxy-internal-text-control> <foxy-internal-select-control infer="handling-fee-type" class="col-span-2" .options="${0}"> </foxy-internal-select-control> ${0} <foxy-internal-select-control infer="item-delivery-type" class="col-span-2" .options="${0}"> </foxy-internal-select-control> ${0} <foxy-internal-text-control infer="discount-name" class="col-span-2"> </foxy-internal-text-control> ${0} <foxy-internal-async-combo-box-control item-label-path="description" item-value-path="_links.self.href" first="${0}" infer="admin-email-template-uri" class="${0}" .selectedItem="${0}" @change="${0}"> </foxy-internal-async-combo-box-control> ${0} <foxy-internal-async-combo-box-control item-label-path="description" item-value-path="_links.self.href" first="${0}" infer="customer-email-template-uri" class="col-span-2" .selectedItem="${0}" @change="${0}"> </foxy-internal-async-combo-box-control> <foxy-internal-async-combo-box-control item-label-path="description" item-value-path="_links.self.href" first="${0}" infer="gift-recipient-email-template-uri" class="col-span-2" .selectedItem="${0}"> </foxy-internal-async-combo-box-control> <foxy-internal-async-resource-link-list-control foreign-key-for-uri="tax_uri" foreign-key-for-id="tax_id" own-key-for-uri="item_category_uri" own-uri="${0}" embed-key="fx:tax_item_categories" options-href="${0}" links-href="${0}" infer="taxes" class="col-span-2" limit="5" item="foxy-tax-card"> </foxy-internal-async-resource-link-list-control> </div> ${0} <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),g.__handlingFeeTypeOptions,"none"===u?"":a(l||(l=y` ${0} ${0} ${0} `),this.__renderHandlingFee(),u.includes("percent")?this.__renderHandlingFeePercentage():"","flat_percent_with_minimum"===u?this.__renderHandlingFeeMinimum():""),g.__itemDeliveryTypeOptions,"downloaded"===c?this.__renderDownloadDeliveryControls():"flat_rate"===c?[this.__renderFlatRateControls(),this.__renderCustomsValue()]:"shipped"===c?[this.__renderShippingControls(),this.__renderCustomsValue()]:"",this.form.discount_name?this.__renderDiscountBuilder():"",n(null!==(t=this.emailTemplates)&&void 0!==t?t:void 0),this.form.send_admin_email?"":"col-span-2",null===(i=this.__adminEmailTemplateLoader)||void 0===i?void 0:i.data,(e=>{this.edit({send_admin_email:!!e.detail,admin_email:e.detail?this.form.admin_email:""})}),this.form.send_admin_email?this.__renderAdminEmail():"",n(null!==(r=this.emailTemplates)&&void 0!==r?r:void 0),null===(s=this.__customerEmailTemplateLoader)||void 0===s?void 0:s.data,(e=>this.edit({send_customer_email:!!e.detail})),n(null!==(d=this.emailTemplates)&&void 0!==d?d:void 0),null===(m=this.__giftRecipientEmailTemplateLoader)||void 0===m?void 0:m.data,n(null===(p=this.data)||void 0===p?void 0:p._links.self.href),n(null!==(_=this.taxes)&&void 0!==_?_:void 0),n(null===(f=this.data)||void 0===f?void 0:f._links["fx:tax_item_categories"].href),super.renderBody(),n(this.form.customer_email_template_uri||void 0),this.__customerEmailTemplateLoaderId,(()=>this.requestUpdate()),n(this.form.gift_recipient_email_template_uri||void 0),this.__giftRecipientEmailTemplateLoaderId,(()=>this.requestUpdate()),n(this.form.admin_email_template_uri||void 0),this.__adminEmailTemplateLoaderId,(()=>this.requestUpdate()))}get __giftRecipientEmailTemplateLoader(){const e=this.__giftRecipientEmailTemplateLoaderId;return this.renderRoot.querySelector(`#${e}`)}get __customerEmailTemplateLoader(){const e=this.__customerEmailTemplateLoaderId;return this.renderRoot.querySelector(`#${e}`)}get __adminEmailTemplateLoader(){const e=this.__adminEmailTemplateLoaderId;return this.renderRoot.querySelector(`#${e}`)}__renderHandlingFee(){return a(s||(s=y` <foxy-internal-number-control infer="handling-fee" class="${0}"> </foxy-internal-number-control> `),"flat_percent"===this.form.handling_fee_type?"":"col-span-2")}__renderHandlingFeePercentage(){return a(d||(d=y` <foxy-internal-number-control infer="handling-fee-percentage"> </foxy-internal-number-control> `))}__renderHandlingFeeMinimum(){return a(m||(m=y` <foxy-internal-number-control infer="handling-fee-minimum"> </foxy-internal-number-control> `))}__renderDownloadDeliveryControls(){return a(p||(p=y` <foxy-internal-integer-control infer="max-downloads-per-customer"> </foxy-internal-integer-control> <foxy-internal-integer-control infer="max-downloads-time-period"> </foxy-internal-integer-control> `))}__renderFlatRateControls(){return a(_||(_=y` <foxy-internal-number-control infer="shipping-flat-rate"> </foxy-internal-number-control> <foxy-internal-select-control infer="shipping-flat-rate-type" .options="${0}"> </foxy-internal-select-control> `),g.__shippingFlatRateTypeOptions)}__renderShippingControls(){return a(f||(f=y` <foxy-internal-integer-control infer="default-weight" class="col-span-2"> </foxy-internal-integer-control> <foxy-internal-select-control infer="default-weight-unit" .options="${0}"> </foxy-internal-select-control> <foxy-internal-select-control infer="default-length-unit" .options="${0}"> </foxy-internal-select-control> `),g.__defaultWeightUnitOptions,g.__defaultLengthUnitOptions)}__renderCustomsValue(){return a(c||(c=y` <foxy-internal-number-control infer="customs-value" class="col-span-2"> </foxy-internal-number-control> `))}__renderDiscountBuilder(){var e,t;const i={name:null!==(e=this.form.discount_name)&&void 0!==e?e:"",type:this.form.discount_type||"quantity_amount",details:null!==(t=this.form.discount_details)&&void 0!==t?t:""};return a(u||(u=y` <foxy-discount-builder infer="discount-builder" class="col-span-2" .parsedValue="${0}" @change="${0}"> </foxy-discount-builder> `),i,(e=>{const t=e.currentTarget;this.edit({discount_name:t.parsedValue.name,discount_type:t.parsedValue.type,discount_details:t.parsedValue.details})}))}__renderAdminEmail(){return a(h||(h=y`<foxy-internal-text-control infer="admin-email"> </foxy-internal-text-control>`))}}g.__shippingFlatRateTypeOptions=[{label:"option_per_order",value:"per_order"},{label:"option_per_shipment",value:"per_shipment"}],g.__defaultWeightUnitOptions=[{label:"option_lbs",value:"LBS"},{label:"option_kgs",value:"KGS"}],g.__defaultLengthUnitOptions=[{label:"option_in",value:"IN"},{label:"option_cm",value:"CM"}],g.__itemDeliveryTypeOptions=[{label:"option_notshipped",value:"notshipped"},{label:"option_downloaded",value:"downloaded"},{label:"option_flat_rate",value:"flat_rate"},{label:"option_shipped",value:"shipped"},{label:"option_pickup",value:"pickup"}],g.__handlingFeeTypeOptions=[{label:"option_none",value:"none"},{label:"option_flat_per_order",value:"flat_per_order"},{label:"option_flat_per_item",value:"flat_per_item"},{label:"option_flat_percent",value:"flat_percent"},{label:"option_flat_percent_with_minimum",value:"flat_percent_with_minimum"}],customElements.define("foxy-item-category-form",g);export{g as ItemCategoryForm};
|
|
1
|
+
import"./shared-7fd9a30f.js";import"./shared-fa9e5c7f.js";import"./shared-3fa791ca.js";import"./shared-b9138e9f.js";import"./shared-18cb3cfc.js";import"./shared-588c6b15.js";import{I as e}from"./shared-8c1df97c.js";import"./foxy-discount-builder.js";import"./foxy-nucleon-element.js";import"./foxy-tax-card.js";import{_ as t,B as i}from"./shared-0f6e4584.js";import{a as r}from"./shared-075796e2.js";import{i as n}from"./shared-9803aa7c.js";import{h as a}from"./shared-dc73b9a5.js";import"./shared-e6e84ff5.js";import"./shared-6a4e81ad.js";import"./shared-30221a16.js";import"./shared-8f7a31e0.js";import"./shared-61ade33e.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-fb56178f.js";import"./shared-5c05ac06.js";import"./shared-f1d2b5bb.js";import"./shared-343d1fd7.js";import"./shared-f7a1193f.js";import"./shared-0b01f721.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-a0c6a159.js";import"./shared-99940888.js";import"./foxy-pagination.js";import"./shared-2d723710.js";import"./shared-4e709717.js";import"./shared-7b8ad9c1.js";import"./shared-51c4a6dd.js";import"./shared-bab2ea2c.js";import"./shared-797ba64a.js";import"./shared-10325cda.js";import"./shared-021c7a22.js";import"./shared-2099544a.js";import"./shared-2fc671cd.js";import"./shared-e5d37737.js";import"./shared-651c44fa.js";import"./shared-acdcae7e.js";import"./shared-3e03c988.js";import"./shared-fe77f6f6.js";import"./shared-b6814728.js";import"./shared-634b670e.js";import"./shared-df00a537.js";import"./shared-339bbd50.js";import"./shared-abea5e34.js";import"./shared-7026fb08.js";import"./foxy-copy-to-clipboard.js";import"./shared-12ac8cc6.js";import"./shared-ff63a551.js";import"./shared-8438d4ca.js";import"./shared-77051754.js";import"./shared-a6273e4a.js";let o,l,s,d,m,p,_,f,c,u,h,y=e=>e;class g extends(r(e,"item-category-form")){constructor(){super(...arguments),this.emailTemplates=null,this.taxes=null,this.__giftRecipientEmailTemplateLoaderId="gift-recipient-email-template-loader",this.__customerEmailTemplateLoaderId="customer-email-template-loader",this.__adminEmailTemplateLoaderId="admin-email-template-loader"}static get properties(){return t(t({},super.properties),{},{emailTemplates:{attribute:"email-templates"},taxes:{}})}static get v8n(){return[({code:e})=>!!e||"code:v8n_required",({code:e})=>e&&e.length<=50||"code:v8n_too_long",({name:e})=>!!e||"name:v8n_required",({name:e})=>e&&e.length<=50||"name:v8n_too_long",({item_delivery_type:e})=>!!e||"item-delivery-type:v8n_required",({item_delivery_type:e,max_downloads_per_customer:t})=>"downloaded"!==e||"number"==typeof t||"max-downloads-per-customer:v8n_required",({max_downloads_per_customer:e})=>"number"!=typeof e||e>=0||"max-downloads-per-customer:v8n_negative",({item_delivery_type:e,max_downloads_time_period:t})=>"downloaded"!==e||"number"==typeof t||"max-downloads-time-period:v8n_required",({max_downloads_time_period:e})=>"number"!=typeof e||e>=0||"max-downloads-time-period:v8n_negative",({customs_value:e})=>"number"!=typeof e||e>=0||"customs-value:v8n_negative",({item_delivery_type:e,default_weight:t})=>"shipped"!==e||"number"==typeof t||"default-weight:v8n_required",({default_weight:e})=>"number"!=typeof e||e>=0||"default-weight:v8n_negative",({item_delivery_type:e,default_weight_unit:t})=>"shipped"!==e||"string"==typeof t||"default-weight-unit:v8n_required",({item_delivery_type:e,default_length_unit:t})=>"shipped"!==e||"string"==typeof t||"default-length-unit:v8n_required",({item_delivery_type:e,shipping_flat_rate:t})=>"flat_rate"!==e||"number"==typeof t||"shipping-flat-rate:v8n_required",({shipping_flat_rate:e})=>"number"!=typeof e||e>=0||"shipping-flat-rate:v8n_negative",({item_delivery_type:e,shipping_flat_rate_type:t})=>"flat_rate"!==e||"string"==typeof t||"shipping-flat-rate-type:v8n_required",({handling_fee_type:e})=>!!e||"handling-fee-type:v8n_required",({handling_fee_type:e,handling_fee_minimum:t})=>"flat_percent_with_minimum"!==e||"number"==typeof t||"handling-fee-minimum:v8n_required",({handling_fee_minimum:e})=>"number"!=typeof e||e>=0||"handling-fee-minimum:v8n_negative",({handling_fee_type:e,handling_fee_percentage:t})=>"flat_percent_with_minimum"!==e&&"flat_percent"!==e||"number"==typeof t||"handling-fee-percentage:v8n_required",({handling_fee_percentage:e})=>"number"!=typeof e||e>=0||"handling-fee-percentage:v8n_negative",({send_admin_email:e,admin_email:t})=>!e||!!t||"admin-email:v8n_required"]}get hiddenSelector(){const e=[super.hiddenSelector.toString()];return this.data||e.unshift("taxes"),new i(e.join(" ").trim())}renderBody(){var e,t,i,r,s,d,m,p,_,f;const c=this.form.item_delivery_type,u=null!==(e=this.form.handling_fee_type)&&void 0!==e?e:"none";return a(o||(o=y` ${0} <div class="grid grid-cols-2 gap-m"> <foxy-internal-text-control infer="name" class="col-span-2"></foxy-internal-text-control> <foxy-internal-text-control infer="code" class="col-span-2"></foxy-internal-text-control> <foxy-internal-select-control infer="handling-fee-type" class="col-span-2" .options="${0}"> </foxy-internal-select-control> ${0} <foxy-internal-select-control infer="item-delivery-type" class="col-span-2" .options="${0}"> </foxy-internal-select-control> ${0} <foxy-internal-text-control infer="discount-name" class="col-span-2"> </foxy-internal-text-control> ${0} <foxy-internal-async-combo-box-control item-label-path="description" item-value-path="_links.self.href" first="${0}" infer="admin-email-template-uri" class="${0}" .selectedItem="${0}" @change="${0}"> </foxy-internal-async-combo-box-control> ${0} <foxy-internal-async-combo-box-control item-label-path="description" item-value-path="_links.self.href" first="${0}" infer="customer-email-template-uri" class="col-span-2" .selectedItem="${0}" @change="${0}"> </foxy-internal-async-combo-box-control> <foxy-internal-async-combo-box-control item-label-path="description" item-value-path="_links.self.href" first="${0}" infer="gift-recipient-email-template-uri" class="col-span-2" .selectedItem="${0}"> </foxy-internal-async-combo-box-control> <foxy-internal-async-resource-link-list-control foreign-key-for-uri="tax_uri" foreign-key-for-id="tax_id" own-key-for-uri="item_category_uri" own-uri="${0}" embed-key="fx:tax_item_categories" options-href="${0}" links-href="${0}" infer="taxes" class="col-span-2" limit="5" item="foxy-tax-card"> </foxy-internal-async-resource-link-list-control> </div> ${0} <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),g.__handlingFeeTypeOptions,"none"===u?"":a(l||(l=y` ${0} ${0} ${0} `),this.__renderHandlingFee(),u.includes("percent")?this.__renderHandlingFeePercentage():"","flat_percent_with_minimum"===u?this.__renderHandlingFeeMinimum():""),g.__itemDeliveryTypeOptions,"downloaded"===c?this.__renderDownloadDeliveryControls():"flat_rate"===c?[this.__renderFlatRateControls(),this.__renderCustomsValue()]:"shipped"===c?[this.__renderShippingControls(),this.__renderCustomsValue()]:"",this.form.discount_name?this.__renderDiscountBuilder():"",n(null!==(t=this.emailTemplates)&&void 0!==t?t:void 0),this.form.send_admin_email?"":"col-span-2",null===(i=this.__adminEmailTemplateLoader)||void 0===i?void 0:i.data,(e=>{this.edit({send_admin_email:!!e.detail,admin_email:e.detail?this.form.admin_email:""})}),this.form.send_admin_email?this.__renderAdminEmail():"",n(null!==(r=this.emailTemplates)&&void 0!==r?r:void 0),null===(s=this.__customerEmailTemplateLoader)||void 0===s?void 0:s.data,(e=>this.edit({send_customer_email:!!e.detail})),n(null!==(d=this.emailTemplates)&&void 0!==d?d:void 0),null===(m=this.__giftRecipientEmailTemplateLoader)||void 0===m?void 0:m.data,n(null===(p=this.data)||void 0===p?void 0:p._links.self.href),n(null!==(_=this.taxes)&&void 0!==_?_:void 0),n(null===(f=this.data)||void 0===f?void 0:f._links["fx:tax_item_categories"].href),super.renderBody(),n(this.form.customer_email_template_uri||void 0),this.__customerEmailTemplateLoaderId,(()=>this.requestUpdate()),n(this.form.gift_recipient_email_template_uri||void 0),this.__giftRecipientEmailTemplateLoaderId,(()=>this.requestUpdate()),n(this.form.admin_email_template_uri||void 0),this.__adminEmailTemplateLoaderId,(()=>this.requestUpdate()))}get __giftRecipientEmailTemplateLoader(){const e=this.__giftRecipientEmailTemplateLoaderId;return this.renderRoot.querySelector(`#${e}`)}get __customerEmailTemplateLoader(){const e=this.__customerEmailTemplateLoaderId;return this.renderRoot.querySelector(`#${e}`)}get __adminEmailTemplateLoader(){const e=this.__adminEmailTemplateLoaderId;return this.renderRoot.querySelector(`#${e}`)}__renderHandlingFee(){return a(s||(s=y` <foxy-internal-number-control infer="handling-fee" class="${0}"> </foxy-internal-number-control> `),"flat_percent"===this.form.handling_fee_type?"":"col-span-2")}__renderHandlingFeePercentage(){return a(d||(d=y` <foxy-internal-number-control infer="handling-fee-percentage"> </foxy-internal-number-control> `))}__renderHandlingFeeMinimum(){return a(m||(m=y` <foxy-internal-number-control infer="handling-fee-minimum"> </foxy-internal-number-control> `))}__renderDownloadDeliveryControls(){return a(p||(p=y` <foxy-internal-integer-control infer="max-downloads-per-customer"> </foxy-internal-integer-control> <foxy-internal-integer-control infer="max-downloads-time-period"> </foxy-internal-integer-control> `))}__renderFlatRateControls(){return a(_||(_=y` <foxy-internal-number-control infer="shipping-flat-rate"> </foxy-internal-number-control> <foxy-internal-select-control infer="shipping-flat-rate-type" .options="${0}"> </foxy-internal-select-control> `),g.__shippingFlatRateTypeOptions)}__renderShippingControls(){return a(f||(f=y` <foxy-internal-integer-control infer="default-weight" class="col-span-2"> </foxy-internal-integer-control> <foxy-internal-select-control infer="default-weight-unit" .options="${0}"> </foxy-internal-select-control> <foxy-internal-select-control infer="default-length-unit" .options="${0}"> </foxy-internal-select-control> `),g.__defaultWeightUnitOptions,g.__defaultLengthUnitOptions)}__renderCustomsValue(){return a(c||(c=y` <foxy-internal-number-control infer="customs-value" class="col-span-2"> </foxy-internal-number-control> `))}__renderDiscountBuilder(){var e,t;const i={name:null!==(e=this.form.discount_name)&&void 0!==e?e:"",type:this.form.discount_type||"quantity_amount",details:null!==(t=this.form.discount_details)&&void 0!==t?t:""};return a(u||(u=y` <foxy-discount-builder infer="discount-builder" class="col-span-2" .parsedValue="${0}" @change="${0}"> </foxy-discount-builder> `),i,(e=>{const t=e.currentTarget;this.edit({discount_name:t.parsedValue.name,discount_type:t.parsedValue.type,discount_details:t.parsedValue.details})}))}__renderAdminEmail(){return a(h||(h=y`<foxy-internal-text-control infer="admin-email"> </foxy-internal-text-control>`))}}g.__shippingFlatRateTypeOptions=[{label:"option_per_order",value:"per_order"},{label:"option_per_shipment",value:"per_shipment"}],g.__defaultWeightUnitOptions=[{label:"option_lbs",value:"LBS"},{label:"option_kgs",value:"KGS"}],g.__defaultLengthUnitOptions=[{label:"option_in",value:"IN"},{label:"option_cm",value:"CM"}],g.__itemDeliveryTypeOptions=[{label:"option_notshipped",value:"notshipped"},{label:"option_downloaded",value:"downloaded"},{label:"option_flat_rate",value:"flat_rate"},{label:"option_shipped",value:"shipped"},{label:"option_pickup",value:"pickup"}],g.__handlingFeeTypeOptions=[{label:"option_none",value:"none"},{label:"option_flat_per_order",value:"flat_per_order"},{label:"option_flat_per_item",value:"flat_per_item"},{label:"option_flat_percent",value:"flat_percent"},{label:"option_flat_percent_with_minimum",value:"flat_percent_with_minimum"}],customElements.define("foxy-item-category-form",g);export{g as ItemCategoryForm};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./shared-6a4e81ad.js";import"./shared-e5d37737.js";import{h as t,P as e}from"./shared-30221a16.js";import{E as r,T as o}from"./shared-8f7a31e0.js";import{C as i}from"./shared-61ade33e.js";import"./shared-7ce91c80.js";import"./shared-b98b8d02.js";import"./shared-
|
|
1
|
+
import"./shared-6a4e81ad.js";import"./shared-e5d37737.js";import{h as t,P as e}from"./shared-30221a16.js";import{E as r,T as o}from"./shared-8f7a31e0.js";import{C as i}from"./shared-61ade33e.js";import"./shared-7ce91c80.js";import"./shared-b98b8d02.js";import"./shared-f8723f3f.js";import"./shared-72f41a65.js";import"./shared-3fa791ca.js";import"./shared-b9138e9f.js";import"./shared-588c6b15.js";import"./shared-cbb0e610.js";import{I as s}from"./shared-8c1df97c.js";import"./foxy-discount-detail-card.js";import"./foxy-coupon-detail-card.js";import"./foxy-item-category-card.js";import"./foxy-discount-builder.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import{_ as a}from"./shared-0f6e4584.js";import{a as n}from"./shared-075796e2.js";import{i as l}from"./shared-9803aa7c.js";import{h as d}from"./shared-dc73b9a5.js";import"./shared-7b8ad9c1.js";import"./shared-51c4a6dd.js";import"./shared-f1d2b5bb.js";import"./shared-343d1fd7.js";import"./shared-f7a1193f.js";import"./shared-0b01f721.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./foxy-nucleon-element.js";import"./foxy-form-dialog.js";import"./shared-abea5e34.js";import"./shared-2d723710.js";import"./shared-7026fb08.js";import"./shared-4e709717.js";import"./shared-99940888.js";import"./shared-10325cda.js";import"./shared-021c7a22.js";import"./shared-fb56178f.js";import"./shared-2099544a.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-5c05ac06.js";import"./shared-a0c6a159.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-df00a537.js";import"./shared-acdcae7e.js";import"./shared-3e03c988.js";import"./shared-fe77f6f6.js";import"./shared-339bbd50.js";import"./shared-e2a61f69.js";import"./shared-797ba64a.js";import"./shared-2fc671cd.js";import"./shared-651c44fa.js";import"./shared-b6814728.js";import"./shared-634b670e.js";import"./shared-77c4acdd.js";import"./shared-ffd3690b.js";import"./shared-303b428e.js";import"./shared-79d0699c.js";import"./shared-43e2c3f6.js";import"./foxy-copy-to-clipboard.js";import"./shared-12ac8cc6.js";import"./shared-ff63a551.js";import"./shared-bab2ea2c.js";import"./shared-77051754.js";import"./shared-a6273e4a.js";import"./shared-8438d4ca.js";import"./shared-cc79152c.js";import"./shared-a036e345.js";const m=t`<dom-module id="lumo-details" theme-for="vaadin-details">
|
|
2
2
|
<template>
|
|
3
3
|
<style>
|
|
4
4
|
:host {
|
|
@@ -176,4 +176,4 @@ class c extends(i(r(o(e)))){static get template(){return t`
|
|
|
176
176
|
<div part="content" aria-hidden\$="[[_getAriaHidden(opened)]]">
|
|
177
177
|
<slot></slot>
|
|
178
178
|
</div>
|
|
179
|
-
`}static get is(){return"vaadin-details"}static get version(){return"1.2.1"}static get properties(){return{opened:{type:Boolean,value:!1,reflectToAttribute:!0,notify:!0,observer:"_openedChanged"}}}get _collapsible(){return this.shadowRoot.querySelector('[part="content"]')}get focusElement(){return this.shadowRoot.querySelector('[part="summary"]')}_focus(){this.focusElement&&!this._isShiftTabbing&&(this._keyboardActive&&this.focusElement.focus(),this._setFocused(!0))}ready(){super.ready(),this._collapsible.addEventListener("keydown",(t=>{t.shiftKey&&9===t.keyCode&&t.stopPropagation()}))}_getAriaExpanded(t){return t?"true":"false"}_getAriaHidden(t){return t?"false":"true"}_openedChanged(t){this._collapsible.style.maxHeight=t?"":"0px"}_onToggleClick(t){this.opened=!this.opened}_onToggleKeyDown(t){[13,32].indexOf(t.keyCode)>-1&&(t.preventDefault(),this.opened=!this.opened)}}customElements.define(c.is,c);let p,f,h,u=t=>t;class y extends(n(
|
|
179
|
+
`}static get is(){return"vaadin-details"}static get version(){return"1.2.1"}static get properties(){return{opened:{type:Boolean,value:!1,reflectToAttribute:!0,notify:!0,observer:"_openedChanged"}}}get _collapsible(){return this.shadowRoot.querySelector('[part="content"]')}get focusElement(){return this.shadowRoot.querySelector('[part="summary"]')}_focus(){this.focusElement&&!this._isShiftTabbing&&(this._keyboardActive&&this.focusElement.focus(),this._setFocused(!0))}ready(){super.ready(),this._collapsible.addEventListener("keydown",(t=>{t.shiftKey&&9===t.keyCode&&t.stopPropagation()}))}_getAriaExpanded(t){return t?"true":"false"}_getAriaHidden(t){return t?"false":"true"}_openedChanged(t){this._collapsible.style.maxHeight=t?"":"0px"}_onToggleClick(t){this.opened=!this.opened}_onToggleKeyDown(t){[13,32].indexOf(t.keyCode)>-1&&(t.preventDefault(),this.opened=!this.opened)}}customElements.define(c.is,c);let p,f,h,u=t=>t;class y extends(n(s,"item-form")){constructor(){super(...arguments),this.customerAddresses=null,this.itemCategories=null,this.localeCodes=null,this.coupons=null,this.__itemsLink=""}static get properties(){return a(a({},super.properties),{},{customerAddresses:{type:String,attribute:"customer-addresses"},itemCategories:{type:String,attribute:"item-categories"},localeCodes:{attribute:"locale-codes"},coupons:{type:String}})}static get v8n(){return[({name:t})=>!!t||"name:v8n_required",({name:t})=>!!t&&t.length<=255||"name:v8n_too_long",({price:t})=>"number"==typeof t&&!isNaN(t)||"price:v8n_required",({price:t})=>"number"==typeof t&&t>=0||"price:v8n_negative",({quantity:t})=>"number"==typeof t&&t>=1||"quantity:v8n_less_than_one"]}get headerSubtitleOptions(){var t;return{context:(null===(t=this.data)||void 0===t?void 0:t.is_future_line_item)?"future_line_item":"regular"}}renderBody(){var t,e;return d(p||(p=u` ${0} <foxy-internal-text-control infer="name"></foxy-internal-text-control> <div class="grid grid-cols-2 gap-s"> <foxy-internal-number-control infer="price"></foxy-internal-number-control> <foxy-internal-integer-control infer="quantity"></foxy-internal-integer-control> </div> <foxy-internal-resource-picker-control first="${0}" infer="item-category-uri" item="foxy-item-category-card"> </foxy-internal-resource-picker-control> <foxy-internal-text-control infer="code"></foxy-internal-text-control> <foxy-internal-text-control infer="parent-code"></foxy-internal-text-control> <div class="grid grid-cols-2 gap-s"> <foxy-internal-integer-control infer="quantity-min"></foxy-internal-integer-control> <foxy-internal-integer-control infer="quantity-max"></foxy-internal-integer-control> </div> <div> <vaadin-details theme="reverse"> <foxy-i18n infer="" slot="summary" key="dimensions"></foxy-i18n> <div class="grid grid-cols-2 gap-s pt-m"> <foxy-internal-number-control infer="weight"></foxy-internal-number-control> <foxy-internal-number-control infer="width"></foxy-internal-number-control> <foxy-internal-number-control infer="height"></foxy-internal-number-control> <foxy-internal-number-control infer="length"></foxy-internal-number-control> </div> </vaadin-details> <vaadin-details theme="reverse"> <foxy-i18n infer="" slot="summary" key="subscriptions"></foxy-i18n> <div class="space-y-m pt-m"> <foxy-internal-frequency-control infer="subscription-frequency"> </foxy-internal-frequency-control> <foxy-internal-date-control infer="subscription-start-date"> </foxy-internal-date-control> <foxy-internal-date-control infer="subscription-end-date"></foxy-internal-date-control> </div> </vaadin-details> </div> <foxy-internal-text-area-control infer="url"></foxy-internal-text-area-control> <foxy-internal-text-area-control infer="image"></foxy-internal-text-area-control> <vaadin-details theme="reverse"> <foxy-i18n infer="" slot="summary" key="discount"></foxy-i18n> <div class="space-y-m pt-m"> <foxy-internal-text-control infer="discount-name"></foxy-internal-text-control> <foxy-discount-builder infer="discount-builder" .parsedValue="${0}" @change="${0}"> </foxy-discount-builder> </div> </vaadin-details> <foxy-internal-text-control infer="shipto"></foxy-internal-text-control> <foxy-internal-date-control infer="expires" format="unix"></foxy-internal-date-control> ${0} ${0} ${0} `),this.renderHeader(),l(null!==(t=null==this?void 0:this.itemCategories)&&void 0!==t?t:void 0),{details:this.form.discount_details,type:this.form.discount_type,name:this.form.discount_name},(t=>{const e=t.currentTarget.parsedValue;this.edit({discount_details:e.details,discount_type:e.type,discount_name:e.name})}),this.data?d(f||(f=u` <foxy-internal-async-list-control label="${0}" infer="item-options" first="${0}" limit="5" form="foxy-item-option-form" item="foxy-item-option-card" alert .related="${0}" .props="${0}"> </foxy-internal-async-list-control> `),this.t("item-options.title"),this.data._links["fx:item_options"].href,this.__itemOptionRelatedUrls,{"locale-codes":null!==(e=this.localeCodes)&&void 0!==e?e:""}):"",this.data?d(h||(h=u` <foxy-internal-async-list-control label="${0}" infer="discount-details" first="${0}" limit="5" item="foxy-discount-detail-card"> </foxy-internal-async-list-control> <foxy-internal-async-list-control label="${0}" infer="coupon-details" first="${0}" limit="5" item="foxy-coupon-detail-card"> </foxy-internal-async-list-control> <foxy-internal-async-list-control label="${0}" infer="attributes" first="${0}" limit="5" item="foxy-attribute-card" form="foxy-attribute-form" alert> </foxy-internal-async-list-control> `),this.t("discount-details.title"),this.data._links["fx:discount_details"].href,this.t("coupon-details.title"),this.data._links["fx:coupon_details"].href,this.t("attributes.title"),this.data._links["fx:attributes"].href):"",super.renderBody())}async _sendGet(){const t=await super._sendGet();if(t._links["fx:subscription"]){const e=t._links["fx:subscription"].href,r=(await super._fetch(e))._links["fx:transaction_template"].href,o=await super._fetch(r);return this.__itemsLink=o._links["fx:items"].href,t}if(t._links["fx:transaction"]){const e=await super._fetch(t._links["fx:transaction"].href);return this.__itemsLink=e._links["fx:items"].href,t}if(t._links["fx:cart"]){const e=await super._fetch(t._links["fx:cart"].href);return this.__itemsLink=e._links["fx:items"].href,t}return t}get __itemOptionRelatedUrls(){var t,e;const r=null!==(e=null===(t=this.data)||void 0===t?void 0:t._links)&&void 0!==e?e:{},o=[];return r["fx:subscription"]&&o.push(r["fx:subscription"].href),r["fx:transaction"]&&o.push(r["fx:transaction"].href),r["fx:shipment"]&&o.push(r["fx:shipment"].href),r["fx:cart"]&&o.push(r["fx:cart"].href),this.__itemsLink&&o.push(this.__itemsLink),o}}customElements.define("foxy-item-form",y);export{y as ItemForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-b9138e9f.js";import"./shared-588c6b15.js";import{I as r}from"./shared-8c1df97c.js";import{a as e}from"./shared-075796e2.js";import{h as s}from"./shared-dc73b9a5.js";import"./shared-df00a537.js";import"./shared-e5d37737.js";import"./shared-30221a16.js";import"./shared-6a4e81ad.js";import"./shared-acdcae7e.js";import"./shared-3e03c988.js";import"./shared-fe77f6f6.js";import"./shared-61ade33e.js";import"./shared-8f7a31e0.js";import"./shared-7b8ad9c1.js";import"./shared-51c4a6dd.js";import"./shared-f1d2b5bb.js";import"./shared-0f6e4584.js";import"./shared-343d1fd7.js";import"./shared-f7a1193f.js";import"./shared-0b01f721.js";import"./shared-9803aa7c.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-4e709717.js";import"./shared-2d723710.js";import"./shared-abea5e34.js";import"./shared-7026fb08.js";import"./foxy-copy-to-clipboard.js";import"./shared-12ac8cc6.js";import"./shared-fb56178f.js";import"./shared-ff63a551.js";import"./shared-5c05ac06.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let a,o=r=>r;class t extends(e(r,"item-option-form")){static get v8n(){return[({name:r})=>!!r||"name:v8n_required",({name:r})=>!!r&&r.length<=100||"name:v8n_too_long",({value:r})=>!!r||"value:v8n_required",({value:r})=>!!r&&r.length<=1024||"value:v8n_too_long"]}renderBody(){return s(a||(a=o` ${0} <div class="grid grid-cols-2 gap-m"> <foxy-internal-text-control infer="name" class="col-span-2"></foxy-internal-text-control> <foxy-internal-text-control infer="value" class="col-span-2"></foxy-internal-text-control> <foxy-internal-number-control infer="price-mod"></foxy-internal-number-control> <foxy-internal-number-control infer="weight-mod"></foxy-internal-number-control> </div> ${0} `),this.renderHeader(),super.renderBody())}}customElements.define("foxy-item-option-form",t);export{t as ItemOptionForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-10b5e78f.js";import"./shared-aefac46b.js";import"./shared-cc79152c.js";import"./shared-a159ccff.js";import"./shared-72f41a65.js";import"./shared-6e355777.js";import{I as e}from"./shared-8c1df97c.js";import{m as t,B as r,_ as o}from"./shared-0f6e4584.js";import{a as i}from"./shared-075796e2.js";import{h as a}from"./shared-dc73b9a5.js";import"./shared-e6e84ff5.js";import"./shared-6a4e81ad.js";import"./shared-30221a16.js";import"./shared-8f7a31e0.js";import"./shared-61ade33e.js";import"./shared-fe77f6f6.js";import"./shared-fb56178f.js";import"./shared-7b8ad9c1.js";import"./shared-51c4a6dd.js";import"./shared-f1d2b5bb.js";import"./shared-343d1fd7.js";import"./shared-f7a1193f.js";import"./shared-0b01f721.js";import"./shared-9803aa7c.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-4e709717.js";import"./shared-a0c6a159.js";import"./shared-22ba9566.js";import"./shared-99940888.js";import"./shared-f5366dda.js";import"./shared-e5d37737.js";import"./shared-3e03c988.js";import"./shared-acdcae7e.js";import"./shared-77c4acdd.js";import"./shared-2d723710.js";import"./shared-abea5e34.js";import"./shared-7026fb08.js";import"./foxy-copy-to-clipboard.js";import"./shared-12ac8cc6.js";import"./shared-ff63a551.js";import"./shared-5c05ac06.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";const n={service:"legacy_xml",version:1,events:["transaction/created"],title:"",url:""},l={encryption_key:"",service:"json",version:1,events:[],title:"",url:""},s={part_number_product_option:"",product_order_priority:"",calling_system_number:"",external_company_id:"",audit_settings:"never",company_role:"B",service_url:"",host_system:"",from_city:""},_={category_to_product_tax_code_mappings:{},enable_colorado_delivery_fee:!1,address_validation_countries:[],use_address_validation:!1,create_invoice:!1,company_code:"",service_url:"",use_ava_tax:!1,key:"",id:""},c={inventory_field_name:"",inventory_field_id:"",collection_name:"",sku_field_name:"",collection_id:"",sku_field_id:"",site_name:"",service:"webflow",version:1,site_id:"",events:["transaction/created"],auth:""},d={service:"zapier",events:[],url:""},f={category_to_product_tax_code_mappings:{},create_invoice:!1,api_token:""};let u,p,v,g,h,y,x,m,b,w,C,V,$,j=e=>e;const k=i(e,"native-integration-form");class F extends k{constructor(){super(...arguments),this.__createConfigGetterFor=t((e=>()=>{var t;return null===(t=this.__config)||void 0===t?void 0:t[e]})),this.__createConfigSetterFor=t((e=>t=>this.__config={[e]:t})),this.__providerGetValue=()=>{var e;return null!==(e=this.form.provider)&&void 0!==e?e:"avalara"},this.__providerSetValue=e=>{this.edit({provider:e,config:"{}"}),this.__config={}},this.__templateProviderOptions=[{value:"avalara",label:"option_avalara"},{value:"onesource",label:"option_onesource"},{value:"taxjar",label:"option_taxjar"}],this.__avalaraConfigOptions=[{value:"use_ava_tax",label:"option_use_ava_tax"},{value:"enable_colorado_delivery_fee",label:"option_enable_colorado_delivery_fee"},{value:"create_invoice",label:"option_create_invoice"},{value:"use_address_validation",label:"option_use_address_validation"}],this.__taxjarConfigOptions=[{value:"create_invoice",label:"option_create_invoice"}],this.__configOptionsGetValue=()=>{const e=this.__config,t=[];return(null==e?void 0:e.enable_colorado_delivery_fee)&&t.push("enable_colorado_delivery_fee"),(null==e?void 0:e.use_address_validation)&&t.push("use_address_validation"),(null==e?void 0:e.create_invoice)&&t.push("create_invoice"),(null==e?void 0:e.use_ava_tax)&&t.push("use_ava_tax"),t},this.__configOptionsSetValue=e=>{this.__config={enable_colorado_delivery_fee:e.includes("enable_colorado_delivery_fee"),use_address_validation:e.includes("use_address_validation"),create_invoice:e.includes("create_invoice"),use_ava_tax:e.includes("use_ava_tax")}},this.__avalaraAddressValidationCountriesOptions=[{value:"US",label:"option_US"},{value:"CA",label:"option_CA"}],this.__codeMappingsGetValue=()=>{var e,t;const r=null!==(t=null===(e=this.__config)||void 0===e?void 0:e.category_to_product_tax_code_mappings)&&void 0!==t?t:{};return Object.entries(r).map((([e,t])=>({value:`${e}:${t}`})))},this.__codeMappingsSetValue=e=>{const t={};for(const{value:r}of e){const[e,o]=r.split(":");e&&o&&(t[e]=o)}this.__config={category_to_product_tax_code_mappings:t}},this.__onesourceCompanyRoleOptions=[{value:"B",label:"option_buyer"},{value:"M",label:"option_middleman"},{value:"S",label:"option_seller"}],this.__onesourceProductOrderPriorityGetValue=()=>{var e,t;return(null!==(t=null===(e=this.__config)||void 0===e?void 0:e.product_order_priority.split(","))&&void 0!==t?t:[]).filter((e=>!!e)).map((e=>({value:e})))},this.__onesourceProductOrderPrioritySetValue=e=>{this.__config={product_order_priority:e.map((e=>e.value)).join(",")}},this.__onesourceAuditSettingsOptions=[{value:"capture_only",label:"option_capture_only"},{value:"auth_and_capture",label:"option_auth_and_capture"},{value:"never",label:"option_never"}],this.__webhookServiceOptions=[{value:"json",label:"option_json"},{value:"legacy_xml",label:"option_legacy_xml"}],this.__webhookJsonEventsOptions=[{value:"transaction/created",label:"option_transaction_created"},{value:"subscription/cancelled",label:"option_subscription_cancelled"}]}static get v8n(){const e=t(JSON.parse),r=t((e=>{try{return Boolean(new URL(e))}catch(e){return!1}}));return[({provider:t="avalara",config:o="{}"})=>{const i=e(o).service_url,a=i?r(i)?null:"v8n_invalid":"v8n_required";return"avalara"!==t||!a||`avalara-service-url:${a}`},({provider:t="avalara",config:r="{}"})=>"avalara"!==t||!!e(r).id||"avalara-id:v8n_required",({provider:t="avalara",config:r="{}"})=>"avalara"!==t||!!e(r).key||"avalara-key:v8n_required",({provider:t="avalara",config:r="{}"})=>"avalara"!==t||!!e(r).company_code||"avalara-company-code:v8n_required",({provider:t="avalara",config:r="{}"})=>{if("avalara"!==t)return!0;const o=e(r).category_to_product_tax_code_mappings;return o&&Object.entries(o).length>0||"avalara-category-to-product-tax-code-mappings:v8n_required"},({provider:t="avalara",config:r="{}"})=>"taxjar"!==t||!!e(r).api_token||"taxjar-api-token:v8n_required",({provider:t="avalara",config:o="{}"})=>{const i=e(o).service_url,a=i?r(i)?null:"v8n_invalid":"v8n_required";return"onesource"!==t||!a||`onesource-service-url:${a}`},({provider:t="avalara",config:r="{}"})=>"onesource"!==t||!!e(r).external_company_id||"onesource-external-company-id:v8n_required",({provider:t="avalara",config:r="{}"})=>"onesource"!==t||!!e(r).calling_system_number||"onesource-calling-system-number:v8n_required",({provider:t="avalara",config:r="{}"})=>"onesource"!==t||!!e(r).from_city||"onesource-from-city:v8n_required",({provider:t="avalara",config:r="{}"})=>"onesource"!==t||!!e(r).host_system||"onesource-host-system:v8n_required",({provider:t="avalara",config:r="{}"})=>{const{service:o,title:i}=e(r);return"webhook"!==t||"json"!==o||!!i||"webhook-json-title:v8n_required"},({provider:t="avalara",config:r="{}"})=>{const{service:o,encryption_key:i}=e(r);return"webhook"!==t||"json"!==o||!!i||"webhook-json-encryption-key:v8n_required"},({provider:t="avalara",config:o="{}"})=>{const{service:i,url:a}=e(o),n=a?r(a)?null:"v8n_invalid":"v8n_required";return"webhook"!==t||"json"!==i||!n||`webhook-json-url:${n}`},({provider:t="avalara",config:r="{}"})=>{const{service:o,title:i}=e(r);return"webhook"!==t||"legacy_xml"!==o||!!i||"webhook-legacy-xml-title:v8n_required"},({provider:t="avalara",config:o="{}"})=>{const{service:i,url:a}=e(o),n=a?r(a)?null:"v8n_invalid":"v8n_required";return"webhook"!==t||"legacy_xml"!==i||!n||`webhook-legacy-xml-url:${n}`},({provider:t="avalara",config:r="{}"})=>"webflow"!==t||!!e(r).site_id||"webflow-site-id:v8n_required",({provider:t="avalara",config:r="{}"})=>"webflow"!==t||!!e(r).site_name||"webflow-site-name:v8n_required",({provider:t="avalara",config:r="{}"})=>"webflow"!==t||!!e(r).collection_id||"webflow-collection-id:v8n_required",({provider:t="avalara",config:r="{}"})=>"webflow"!==t||!!e(r).collection_name||"webflow-collection-name:v8n_required",({provider:t="avalara",config:r="{}"})=>"webflow"!==t||!!e(r).sku_field_id||"webflow-sku-field-id:v8n_required",({provider:t="avalara",config:r="{}"})=>"webflow"!==t||!!e(r).sku_field_name||"webflow-sku-field-name:v8n_required",({provider:t="avalara",config:r="{}"})=>"webflow"!==t||!!e(r).inventory_field_id||"webflow-inventory-field-id:v8n_required",({provider:t="avalara",config:r="{}"})=>"webflow"!==t||!!e(r).inventory_field_name||"webflow-inventory-field-name:v8n_required",({provider:t="avalara",config:r="{}"})=>"webflow"!==t||!!e(r).auth||"webflow-auth:v8n_required"]}get readonlySelector(){const e=[super.readonlySelector.toString()];return this.href&&e.push("apple-pay-merchant-id","custom-tax-url","zapier-events","zapier-url","provider"),new r(e.join(" ").trim())}get headerTitleOptions(){return{context:this.data?`existing_${this.data.provider}`:"new",id:this.headerCopyIdValue}}renderBody(){var e;const t=null!==(e=this.form.provider)&&void 0!==e?e:"avalara";return a(u||(u=j` ${0} ${0} ${0} ${0} `),this.renderHeader(),this.href?"":a(p||(p=j` <foxy-internal-radio-group-control infer="provider" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-radio-group-control> `),this.__providerGetValue,this.__providerSetValue,this.__templateProviderOptions),"avalara"===t?this.__renderAvalaraConfig():"taxjar"===t?this.__renderTaxJarConfig():"onesource"===t?this.__renderOneSourceConfig():"webflow"===t?this.__renderWebflowConfig():"zapier"===t?this.__renderZapierConfig():"webhook"===t?this.__renderWebhookConfig():"apple_pay"===t?this.__renderApplePayConfig():"custom_tax"===t?this.__renderCustomTaxConfig():"",super.renderBody())}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 t.includes("has already been configured")?["error:already_configured"]:e}}get __config(){try{return JSON.parse(this.form.config)}catch(e){return null}}set __config(e){var t;const r=this.__config,i=null!==(t=this.form.provider)&&void 0!==t?t:"avalara",a="avalara"===i?_:"taxjar"===i?f:"onesource"===i?s:"webflow"===i?c:"zapier"===i?d:"webhook"===i?"legacy_xml"===(null==r?void 0:r.service)?n:l:void 0,u=JSON.stringify(o(o(o({},a),r),e));this.edit({provider:i,config:u})}__renderAvalaraConfig(){var e;return a(v||(v=j` <foxy-internal-text-control infer="avalara-service-url" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="avalara-id" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-password-control infer="avalara-key" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> <foxy-internal-text-control infer="avalara-company-code" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-editable-list-control infer="avalara-category-to-product-tax-code-mappings" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-checkbox-group-control infer="avalara-options" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> ${0} `),this.__createConfigGetterFor("service_url"),this.__createConfigSetterFor("service_url"),this.__createConfigGetterFor("id"),this.__createConfigSetterFor("id"),this.__createConfigGetterFor("key"),this.__createConfigSetterFor("key"),this.__createConfigGetterFor("company_code"),this.__createConfigSetterFor("company_code"),this.__codeMappingsGetValue,this.__codeMappingsSetValue,this.__configOptionsGetValue,this.__configOptionsSetValue,this.__avalaraConfigOptions,(null===(e=this.__config)||void 0===e?void 0:e.use_address_validation)?a(g||(g=j` <foxy-internal-checkbox-group-control infer="avalara-address-validation-countries" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> `),this.__createConfigGetterFor("address_validation_countries"),this.__createConfigSetterFor("address_validation_countries"),this.__avalaraAddressValidationCountriesOptions):"")}__renderTaxJarConfig(){return a(h||(h=j` <foxy-internal-password-control infer="taxjar-api-token" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> <foxy-internal-editable-list-control infer="taxjar-category-to-product-tax-code-mappings" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-checkbox-group-control infer="taxjar-options" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> `),this.__createConfigGetterFor("api_token"),this.__createConfigSetterFor("api_token"),this.__codeMappingsGetValue,this.__codeMappingsSetValue,this.__configOptionsGetValue,this.__configOptionsSetValue,this.__taxjarConfigOptions)}__renderOneSourceConfig(){return a(y||(y=j` <foxy-internal-text-control infer="onesource-service-url" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="onesource-external-company-id" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="onesource-calling-system-number" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="onesource-from-city" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="onesource-host-system" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-radio-group-control infer="onesource-company-role" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-radio-group-control> <foxy-internal-text-control infer="onesource-part-number-product-option" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-editable-list-control infer="onesource-product-order-priority" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-radio-group-control infer="onesource-audit-settings" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-radio-group-control> `),this.__createConfigGetterFor("service_url"),this.__createConfigSetterFor("service_url"),this.__createConfigGetterFor("external_company_id"),this.__createConfigSetterFor("external_company_id"),this.__createConfigGetterFor("calling_system_number"),this.__createConfigSetterFor("calling_system_number"),this.__createConfigGetterFor("from_city"),this.__createConfigSetterFor("from_city"),this.__createConfigGetterFor("host_system"),this.__createConfigSetterFor("host_system"),this.__createConfigGetterFor("company_role"),this.__createConfigSetterFor("company_role"),this.__onesourceCompanyRoleOptions,this.__createConfigGetterFor("part_number_product_option"),this.__createConfigSetterFor("part_number_product_option"),this.__onesourceProductOrderPriorityGetValue,this.__onesourceProductOrderPrioritySetValue,this.__createConfigGetterFor("audit_settings"),this.__createConfigSetterFor("audit_settings"),this.__onesourceAuditSettingsOptions)}__renderWebhookConfig(){var e,t;return a(x||(x=j` <p style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" class="rounded bg-error-10 text-error font-medium"> <foxy-i18n infer="webhook-warning" key="warning_text"></foxy-i18n> <br> <br> <a target="_blank" class="text-body rounded hover-underline hover-cursor-pointer focus-outline-none focus-ring-2 focus-ring-error-50" lang="en" rel="noopener" href="https://www.foxy.io/blog/new-feature-json-webhook/"> <foxy-i18n infer="webhook-warning" key="link_text"></foxy-i18n> </a> </p> ${0} `),"json"===(null===(e=this.__config)||void 0===e?void 0:e.service)?this.__renderWebhookJsonConfig():"legacy_xml"===(null===(t=this.__config)||void 0===t?void 0:t.service)?this.__renderWebhookLegacyXmlConfig():"")}__renderWebhookJsonConfig(){return a(m||(m=j` <foxy-internal-text-control infer="webhook-json-title" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-area-control infer="webhook-json-url" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-area-control> <foxy-internal-radio-group-control infer="webhook-service" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-radio-group-control> <foxy-internal-checkbox-group-control infer="webhook-json-events" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-password-control infer="webhook-json-encryption-key" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> `),this.__createConfigGetterFor("title"),this.__createConfigSetterFor("title"),this.__createConfigGetterFor("url"),this.__createConfigSetterFor("url"),this.__createConfigGetterFor("service"),this.__createConfigSetterFor("service"),this.__webhookServiceOptions,this.__createConfigGetterFor("events"),this.__createConfigSetterFor("events"),this.__webhookJsonEventsOptions,this.__createConfigGetterFor("encryption_key"),this.__createConfigSetterFor("encryption_key"))}__renderWebhookLegacyXmlConfig(){return a(b||(b=j` <foxy-internal-text-control infer="webhook-legacy-xml-title" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-area-control infer="webhook-legacy-xml-url" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-area-control> <foxy-internal-radio-group-control infer="webhook-service" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-radio-group-control> `),this.__createConfigGetterFor("title"),this.__createConfigSetterFor("title"),this.__createConfigGetterFor("url"),this.__createConfigSetterFor("url"),this.__createConfigGetterFor("service"),this.__createConfigSetterFor("service"),this.__webhookServiceOptions)}__renderWebflowConfig(){return a(w||(w=j` <div class="grid grid-cols-2 gap-m"> <foxy-internal-text-control infer="webflow-site-id" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="webflow-site-name" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="webflow-collection-id" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="webflow-collection-name" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="webflow-sku-field-id" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="webflow-sku-field-name" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="webflow-inventory-field-id" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="webflow-inventory-field-name" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> </div> <foxy-internal-password-control infer="webflow-auth" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> `),this.__createConfigGetterFor("site_id"),this.__createConfigSetterFor("site_id"),this.__createConfigGetterFor("site_name"),this.__createConfigSetterFor("site_name"),this.__createConfigGetterFor("collection_id"),this.__createConfigSetterFor("collection_id"),this.__createConfigGetterFor("collection_name"),this.__createConfigSetterFor("collection_name"),this.__createConfigGetterFor("sku_field_id"),this.__createConfigSetterFor("sku_field_id"),this.__createConfigGetterFor("sku_field_name"),this.__createConfigSetterFor("sku_field_name"),this.__createConfigGetterFor("inventory_field_id"),this.__createConfigSetterFor("inventory_field_id"),this.__createConfigGetterFor("inventory_field_name"),this.__createConfigSetterFor("inventory_field_name"),this.__createConfigGetterFor("auth"),this.__createConfigSetterFor("auth"))}__renderZapierConfig(){return a(C||(C=j` <foxy-internal-editable-list-control infer="zapier-events" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-text-area-control infer="zapier-url" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-area-control> <p class="text-xs text-secondary leading-xs"> <foxy-i18n infer="zapier-warning" key="warning_text"></foxy-i18n> </p> `),this.__createConfigGetterFor("events"),this.__createConfigSetterFor("events"),this.__createConfigGetterFor("url"),this.__createConfigSetterFor("url"))}__renderApplePayConfig(){return a(V||(V=j` <foxy-internal-text-control infer="apple-pay-merchant-id" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <p class="text-xs text-secondary leading-xs"> <foxy-i18n infer="apple-pay-warning" key="warning_text"></foxy-i18n> </p> `),this.__createConfigGetterFor("merchantID"),this.__createConfigSetterFor("merchantID"))}__renderCustomTaxConfig(){return a($||($=j` <foxy-internal-text-control infer="custom-tax-url" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <p class="text-xs text-secondary leading-xs"> <foxy-i18n infer="custom-tax-warning" key="warning_text"></foxy-i18n> </p> `),this.__createConfigGetterFor("url"),this.__createConfigSetterFor("url"))}}customElements.define("foxy-native-integration-form",F);export{F as NativeIntegrationForm};
|
|
1
|
+
import"./shared-10b5e78f.js";import"./shared-d393bcd8.js";import"./shared-cc79152c.js";import"./shared-a159ccff.js";import"./shared-72f41a65.js";import"./shared-588c6b15.js";import{I as e}from"./shared-8c1df97c.js";import{m as t,B as r,_ as o}from"./shared-0f6e4584.js";import{a as i}from"./shared-075796e2.js";import{h as a}from"./shared-dc73b9a5.js";import"./shared-e6e84ff5.js";import"./shared-6a4e81ad.js";import"./shared-30221a16.js";import"./shared-8f7a31e0.js";import"./shared-61ade33e.js";import"./shared-fe77f6f6.js";import"./shared-fb56178f.js";import"./shared-7b8ad9c1.js";import"./shared-51c4a6dd.js";import"./shared-f1d2b5bb.js";import"./shared-343d1fd7.js";import"./shared-f7a1193f.js";import"./shared-0b01f721.js";import"./shared-9803aa7c.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-12ac8cc6.js";import"./shared-ff63a551.js";import"./shared-4e709717.js";import"./shared-a0c6a159.js";import"./shared-22ba9566.js";import"./shared-99940888.js";import"./shared-f5366dda.js";import"./shared-e5d37737.js";import"./shared-3e03c988.js";import"./shared-acdcae7e.js";import"./shared-77c4acdd.js";import"./shared-2d723710.js";import"./shared-abea5e34.js";import"./shared-7026fb08.js";import"./foxy-copy-to-clipboard.js";import"./shared-5c05ac06.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";const n={service:"legacy_xml",version:1,events:["transaction/created"],title:"",url:""},l={encryption_key:"",service:"json",version:1,events:[],title:"",url:""},s={part_number_product_option:"",product_order_priority:"",calling_system_number:"",external_company_id:"",audit_settings:"never",company_role:"B",service_url:"",host_system:"",from_city:""},_={category_to_product_tax_code_mappings:{},enable_colorado_delivery_fee:!1,address_validation_countries:[],use_address_validation:!1,create_invoice:!1,company_code:"",service_url:"",use_ava_tax:!1,key:"",id:""},c={inventory_field_name:"",inventory_field_id:"",collection_name:"",sku_field_name:"",collection_id:"",sku_field_id:"",site_name:"",service:"webflow",version:1,site_id:"",events:["transaction/created"],auth:""},d={service:"zapier",events:[],url:""},f={category_to_product_tax_code_mappings:{},create_invoice:!1,api_token:""};let u,p,v,g,h,y,x,m,b,w,C,V,$,j=e=>e;const k=i(e,"native-integration-form");class F extends k{constructor(){super(...arguments),this.__createConfigGetterFor=t((e=>()=>{var t;return null===(t=this.__config)||void 0===t?void 0:t[e]})),this.__createConfigSetterFor=t((e=>t=>this.__config={[e]:t})),this.__providerGetValue=()=>{var e;return null!==(e=this.form.provider)&&void 0!==e?e:"avalara"},this.__providerSetValue=e=>{this.edit({provider:e,config:"{}"}),this.__config={}},this.__templateProviderOptions=[{value:"avalara",label:"option_avalara"},{value:"onesource",label:"option_onesource"},{value:"taxjar",label:"option_taxjar"}],this.__avalaraConfigOptions=[{value:"use_ava_tax",label:"option_use_ava_tax"},{value:"enable_colorado_delivery_fee",label:"option_enable_colorado_delivery_fee"},{value:"create_invoice",label:"option_create_invoice"},{value:"use_address_validation",label:"option_use_address_validation"}],this.__taxjarConfigOptions=[{value:"create_invoice",label:"option_create_invoice"}],this.__configOptionsGetValue=()=>{const e=this.__config,t=[];return(null==e?void 0:e.enable_colorado_delivery_fee)&&t.push("enable_colorado_delivery_fee"),(null==e?void 0:e.use_address_validation)&&t.push("use_address_validation"),(null==e?void 0:e.create_invoice)&&t.push("create_invoice"),(null==e?void 0:e.use_ava_tax)&&t.push("use_ava_tax"),t},this.__configOptionsSetValue=e=>{this.__config={enable_colorado_delivery_fee:e.includes("enable_colorado_delivery_fee"),use_address_validation:e.includes("use_address_validation"),create_invoice:e.includes("create_invoice"),use_ava_tax:e.includes("use_ava_tax")}},this.__avalaraAddressValidationCountriesOptions=[{value:"US",label:"option_US"},{value:"CA",label:"option_CA"}],this.__codeMappingsGetValue=()=>{var e,t;const r=null!==(t=null===(e=this.__config)||void 0===e?void 0:e.category_to_product_tax_code_mappings)&&void 0!==t?t:{};return Object.entries(r).map((([e,t])=>({value:`${e}:${t}`})))},this.__codeMappingsSetValue=e=>{const t={};for(const{value:r}of e){const[e,o]=r.split(":");e&&o&&(t[e]=o)}this.__config={category_to_product_tax_code_mappings:t}},this.__onesourceCompanyRoleOptions=[{value:"B",label:"option_buyer"},{value:"M",label:"option_middleman"},{value:"S",label:"option_seller"}],this.__onesourceProductOrderPriorityGetValue=()=>{var e,t;return(null!==(t=null===(e=this.__config)||void 0===e?void 0:e.product_order_priority.split(","))&&void 0!==t?t:[]).filter((e=>!!e)).map((e=>({value:e})))},this.__onesourceProductOrderPrioritySetValue=e=>{this.__config={product_order_priority:e.map((e=>e.value)).join(",")}},this.__onesourceAuditSettingsOptions=[{value:"capture_only",label:"option_capture_only"},{value:"auth_and_capture",label:"option_auth_and_capture"},{value:"never",label:"option_never"}],this.__webhookServiceOptions=[{value:"json",label:"option_json"},{value:"legacy_xml",label:"option_legacy_xml"}],this.__webhookJsonEventsOptions=[{value:"transaction/created",label:"option_transaction_created"},{value:"subscription/cancelled",label:"option_subscription_cancelled"}]}static get v8n(){const e=t(JSON.parse),r=t((e=>{try{return Boolean(new URL(e))}catch(e){return!1}}));return[({provider:t="avalara",config:o="{}"})=>{const i=e(o).service_url,a=i?r(i)?null:"v8n_invalid":"v8n_required";return"avalara"!==t||!a||`avalara-service-url:${a}`},({provider:t="avalara",config:r="{}"})=>"avalara"!==t||!!e(r).id||"avalara-id:v8n_required",({provider:t="avalara",config:r="{}"})=>"avalara"!==t||!!e(r).key||"avalara-key:v8n_required",({provider:t="avalara",config:r="{}"})=>"avalara"!==t||!!e(r).company_code||"avalara-company-code:v8n_required",({provider:t="avalara",config:r="{}"})=>{if("avalara"!==t)return!0;const o=e(r).category_to_product_tax_code_mappings;return o&&Object.entries(o).length>0||"avalara-category-to-product-tax-code-mappings:v8n_required"},({provider:t="avalara",config:r="{}"})=>"taxjar"!==t||!!e(r).api_token||"taxjar-api-token:v8n_required",({provider:t="avalara",config:o="{}"})=>{const i=e(o).service_url,a=i?r(i)?null:"v8n_invalid":"v8n_required";return"onesource"!==t||!a||`onesource-service-url:${a}`},({provider:t="avalara",config:r="{}"})=>"onesource"!==t||!!e(r).external_company_id||"onesource-external-company-id:v8n_required",({provider:t="avalara",config:r="{}"})=>"onesource"!==t||!!e(r).calling_system_number||"onesource-calling-system-number:v8n_required",({provider:t="avalara",config:r="{}"})=>"onesource"!==t||!!e(r).from_city||"onesource-from-city:v8n_required",({provider:t="avalara",config:r="{}"})=>"onesource"!==t||!!e(r).host_system||"onesource-host-system:v8n_required",({provider:t="avalara",config:r="{}"})=>{const{service:o,title:i}=e(r);return"webhook"!==t||"json"!==o||!!i||"webhook-json-title:v8n_required"},({provider:t="avalara",config:r="{}"})=>{const{service:o,encryption_key:i}=e(r);return"webhook"!==t||"json"!==o||!!i||"webhook-json-encryption-key:v8n_required"},({provider:t="avalara",config:o="{}"})=>{const{service:i,url:a}=e(o),n=a?r(a)?null:"v8n_invalid":"v8n_required";return"webhook"!==t||"json"!==i||!n||`webhook-json-url:${n}`},({provider:t="avalara",config:r="{}"})=>{const{service:o,title:i}=e(r);return"webhook"!==t||"legacy_xml"!==o||!!i||"webhook-legacy-xml-title:v8n_required"},({provider:t="avalara",config:o="{}"})=>{const{service:i,url:a}=e(o),n=a?r(a)?null:"v8n_invalid":"v8n_required";return"webhook"!==t||"legacy_xml"!==i||!n||`webhook-legacy-xml-url:${n}`},({provider:t="avalara",config:r="{}"})=>"webflow"!==t||!!e(r).site_id||"webflow-site-id:v8n_required",({provider:t="avalara",config:r="{}"})=>"webflow"!==t||!!e(r).site_name||"webflow-site-name:v8n_required",({provider:t="avalara",config:r="{}"})=>"webflow"!==t||!!e(r).collection_id||"webflow-collection-id:v8n_required",({provider:t="avalara",config:r="{}"})=>"webflow"!==t||!!e(r).collection_name||"webflow-collection-name:v8n_required",({provider:t="avalara",config:r="{}"})=>"webflow"!==t||!!e(r).sku_field_id||"webflow-sku-field-id:v8n_required",({provider:t="avalara",config:r="{}"})=>"webflow"!==t||!!e(r).sku_field_name||"webflow-sku-field-name:v8n_required",({provider:t="avalara",config:r="{}"})=>"webflow"!==t||!!e(r).inventory_field_id||"webflow-inventory-field-id:v8n_required",({provider:t="avalara",config:r="{}"})=>"webflow"!==t||!!e(r).inventory_field_name||"webflow-inventory-field-name:v8n_required",({provider:t="avalara",config:r="{}"})=>"webflow"!==t||!!e(r).auth||"webflow-auth:v8n_required"]}get readonlySelector(){const e=[super.readonlySelector.toString()];return this.href&&e.push("apple-pay-merchant-id","custom-tax-url","zapier-events","zapier-url","provider"),new r(e.join(" ").trim())}get headerTitleOptions(){return{context:this.data?`existing_${this.data.provider}`:"new",id:this.headerCopyIdValue}}renderBody(){var e;const t=null!==(e=this.form.provider)&&void 0!==e?e:"avalara";return a(u||(u=j` ${0} ${0} ${0} ${0} `),this.renderHeader(),this.href?"":a(p||(p=j` <foxy-internal-radio-group-control infer="provider" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-radio-group-control> `),this.__providerGetValue,this.__providerSetValue,this.__templateProviderOptions),"avalara"===t?this.__renderAvalaraConfig():"taxjar"===t?this.__renderTaxJarConfig():"onesource"===t?this.__renderOneSourceConfig():"webflow"===t?this.__renderWebflowConfig():"zapier"===t?this.__renderZapierConfig():"webhook"===t?this.__renderWebhookConfig():"apple_pay"===t?this.__renderApplePayConfig():"custom_tax"===t?this.__renderCustomTaxConfig():"",super.renderBody())}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 t.includes("has already been configured")?["error:already_configured"]:e}}get __config(){try{return JSON.parse(this.form.config)}catch(e){return null}}set __config(e){var t;const r=this.__config,i=null!==(t=this.form.provider)&&void 0!==t?t:"avalara",a="avalara"===i?_:"taxjar"===i?f:"onesource"===i?s:"webflow"===i?c:"zapier"===i?d:"webhook"===i?"legacy_xml"===(null==r?void 0:r.service)?n:l:void 0,u=JSON.stringify(o(o(o({},a),r),e));this.edit({provider:i,config:u})}__renderAvalaraConfig(){var e;return a(v||(v=j` <foxy-internal-text-control infer="avalara-service-url" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="avalara-id" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-password-control infer="avalara-key" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> <foxy-internal-text-control infer="avalara-company-code" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-editable-list-control infer="avalara-category-to-product-tax-code-mappings" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-checkbox-group-control infer="avalara-options" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> ${0} `),this.__createConfigGetterFor("service_url"),this.__createConfigSetterFor("service_url"),this.__createConfigGetterFor("id"),this.__createConfigSetterFor("id"),this.__createConfigGetterFor("key"),this.__createConfigSetterFor("key"),this.__createConfigGetterFor("company_code"),this.__createConfigSetterFor("company_code"),this.__codeMappingsGetValue,this.__codeMappingsSetValue,this.__configOptionsGetValue,this.__configOptionsSetValue,this.__avalaraConfigOptions,(null===(e=this.__config)||void 0===e?void 0:e.use_address_validation)?a(g||(g=j` <foxy-internal-checkbox-group-control infer="avalara-address-validation-countries" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> `),this.__createConfigGetterFor("address_validation_countries"),this.__createConfigSetterFor("address_validation_countries"),this.__avalaraAddressValidationCountriesOptions):"")}__renderTaxJarConfig(){return a(h||(h=j` <foxy-internal-password-control infer="taxjar-api-token" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> <foxy-internal-editable-list-control infer="taxjar-category-to-product-tax-code-mappings" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-checkbox-group-control infer="taxjar-options" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> `),this.__createConfigGetterFor("api_token"),this.__createConfigSetterFor("api_token"),this.__codeMappingsGetValue,this.__codeMappingsSetValue,this.__configOptionsGetValue,this.__configOptionsSetValue,this.__taxjarConfigOptions)}__renderOneSourceConfig(){return a(y||(y=j` <foxy-internal-text-control infer="onesource-service-url" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="onesource-external-company-id" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="onesource-calling-system-number" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="onesource-from-city" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="onesource-host-system" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-radio-group-control infer="onesource-company-role" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-radio-group-control> <foxy-internal-text-control infer="onesource-part-number-product-option" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-editable-list-control infer="onesource-product-order-priority" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-radio-group-control infer="onesource-audit-settings" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-radio-group-control> `),this.__createConfigGetterFor("service_url"),this.__createConfigSetterFor("service_url"),this.__createConfigGetterFor("external_company_id"),this.__createConfigSetterFor("external_company_id"),this.__createConfigGetterFor("calling_system_number"),this.__createConfigSetterFor("calling_system_number"),this.__createConfigGetterFor("from_city"),this.__createConfigSetterFor("from_city"),this.__createConfigGetterFor("host_system"),this.__createConfigSetterFor("host_system"),this.__createConfigGetterFor("company_role"),this.__createConfigSetterFor("company_role"),this.__onesourceCompanyRoleOptions,this.__createConfigGetterFor("part_number_product_option"),this.__createConfigSetterFor("part_number_product_option"),this.__onesourceProductOrderPriorityGetValue,this.__onesourceProductOrderPrioritySetValue,this.__createConfigGetterFor("audit_settings"),this.__createConfigSetterFor("audit_settings"),this.__onesourceAuditSettingsOptions)}__renderWebhookConfig(){var e,t;return a(x||(x=j` <p style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" class="rounded bg-error-10 text-error font-medium"> <foxy-i18n infer="webhook-warning" key="warning_text"></foxy-i18n> <br> <br> <a target="_blank" class="text-body rounded hover-underline hover-cursor-pointer focus-outline-none focus-ring-2 focus-ring-error-50" lang="en" rel="noopener" href="https://www.foxy.io/blog/new-feature-json-webhook/"> <foxy-i18n infer="webhook-warning" key="link_text"></foxy-i18n> </a> </p> ${0} `),"json"===(null===(e=this.__config)||void 0===e?void 0:e.service)?this.__renderWebhookJsonConfig():"legacy_xml"===(null===(t=this.__config)||void 0===t?void 0:t.service)?this.__renderWebhookLegacyXmlConfig():"")}__renderWebhookJsonConfig(){return a(m||(m=j` <foxy-internal-text-control infer="webhook-json-title" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-area-control infer="webhook-json-url" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-area-control> <foxy-internal-radio-group-control infer="webhook-service" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-radio-group-control> <foxy-internal-checkbox-group-control infer="webhook-json-events" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-password-control infer="webhook-json-encryption-key" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> `),this.__createConfigGetterFor("title"),this.__createConfigSetterFor("title"),this.__createConfigGetterFor("url"),this.__createConfigSetterFor("url"),this.__createConfigGetterFor("service"),this.__createConfigSetterFor("service"),this.__webhookServiceOptions,this.__createConfigGetterFor("events"),this.__createConfigSetterFor("events"),this.__webhookJsonEventsOptions,this.__createConfigGetterFor("encryption_key"),this.__createConfigSetterFor("encryption_key"))}__renderWebhookLegacyXmlConfig(){return a(b||(b=j` <foxy-internal-text-control infer="webhook-legacy-xml-title" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-area-control infer="webhook-legacy-xml-url" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-area-control> <foxy-internal-radio-group-control infer="webhook-service" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-radio-group-control> `),this.__createConfigGetterFor("title"),this.__createConfigSetterFor("title"),this.__createConfigGetterFor("url"),this.__createConfigSetterFor("url"),this.__createConfigGetterFor("service"),this.__createConfigSetterFor("service"),this.__webhookServiceOptions)}__renderWebflowConfig(){return a(w||(w=j` <div class="grid grid-cols-2 gap-m"> <foxy-internal-text-control infer="webflow-site-id" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="webflow-site-name" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="webflow-collection-id" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="webflow-collection-name" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="webflow-sku-field-id" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="webflow-sku-field-name" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="webflow-inventory-field-id" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="webflow-inventory-field-name" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> </div> <foxy-internal-password-control infer="webflow-auth" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> `),this.__createConfigGetterFor("site_id"),this.__createConfigSetterFor("site_id"),this.__createConfigGetterFor("site_name"),this.__createConfigSetterFor("site_name"),this.__createConfigGetterFor("collection_id"),this.__createConfigSetterFor("collection_id"),this.__createConfigGetterFor("collection_name"),this.__createConfigSetterFor("collection_name"),this.__createConfigGetterFor("sku_field_id"),this.__createConfigSetterFor("sku_field_id"),this.__createConfigGetterFor("sku_field_name"),this.__createConfigSetterFor("sku_field_name"),this.__createConfigGetterFor("inventory_field_id"),this.__createConfigSetterFor("inventory_field_id"),this.__createConfigGetterFor("inventory_field_name"),this.__createConfigSetterFor("inventory_field_name"),this.__createConfigGetterFor("auth"),this.__createConfigSetterFor("auth"))}__renderZapierConfig(){return a(C||(C=j` <foxy-internal-editable-list-control infer="zapier-events" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-text-area-control infer="zapier-url" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-area-control> <p class="text-xs text-secondary leading-xs"> <foxy-i18n infer="zapier-warning" key="warning_text"></foxy-i18n> </p> `),this.__createConfigGetterFor("events"),this.__createConfigSetterFor("events"),this.__createConfigGetterFor("url"),this.__createConfigSetterFor("url"))}__renderApplePayConfig(){return a(V||(V=j` <foxy-internal-text-control infer="apple-pay-merchant-id" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <p class="text-xs text-secondary leading-xs"> <foxy-i18n infer="apple-pay-warning" key="warning_text"></foxy-i18n> </p> `),this.__createConfigGetterFor("merchantID"),this.__createConfigSetterFor("merchantID"))}__renderCustomTaxConfig(){return a($||($=j` <foxy-internal-text-control infer="custom-tax-url" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <p class="text-xs text-secondary leading-xs"> <foxy-i18n infer="custom-tax-warning" key="warning_text"></foxy-i18n> </p> `),this.__createConfigGetterFor("url"),this.__createConfigSetterFor("url"))}}customElements.define("foxy-native-integration-form",F);export{F as NativeIntegrationForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-72f41a65.js";import"./shared-
|
|
1
|
+
import"./shared-72f41a65.js";import"./shared-588c6b15.js";import{I as r}from"./shared-8c1df97c.js";import"./foxy-spinner.js";import{R as e,a as s}from"./shared-075796e2.js";import{B as a}from"./shared-0f6e4584.js";import{h as t}from"./shared-dc73b9a5.js";import"./shared-77c4acdd.js";import"./shared-6a4e81ad.js";import"./shared-30221a16.js";import"./shared-3e03c988.js";import"./shared-fe77f6f6.js";import"./shared-e5d37737.js";import"./shared-acdcae7e.js";import"./shared-61ade33e.js";import"./shared-8f7a31e0.js";import"./shared-7b8ad9c1.js";import"./shared-51c4a6dd.js";import"./shared-f1d2b5bb.js";import"./shared-343d1fd7.js";import"./shared-f7a1193f.js";import"./shared-0b01f721.js";import"./shared-9803aa7c.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-4e709717.js";import"./shared-2d723710.js";import"./shared-abea5e34.js";import"./shared-7026fb08.js";import"./foxy-copy-to-clipboard.js";import"./shared-12ac8cc6.js";import"./shared-fb56178f.js";import"./shared-ff63a551.js";import"./shared-5c05ac06.js";import"./shared-bab2ea2c.js";let o,d,i=r=>r;const p=e(s(r,"passkey-form"));class m extends p{get readonlySelector(){return new a(`credential-id last-login-date last-login-ua ${super.readonlySelector.toString()}`)}renderBody(){return this.data?t(d||(d=i` ${0} <foxy-internal-text-control infer="credential-id"></foxy-internal-text-control> <foxy-internal-text-area-control infer="last-login-ua"></foxy-internal-text-area-control> ${0} `),this.renderHeader(),super.renderBody()):t(o||(o=i` <div class="p-xl flex items-center justify-center"> <foxy-spinner infer="spinner" state="empty" layout="vertical"></foxy-spinner> </div> `))}}customElements.define("foxy-passkey-form",m);export{m as PasskeyForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-2d723710.js";import"./shared-10b5e78f.js";import"./shared-3fa791ca.js";import"./shared-
|
|
1
|
+
import"./shared-2d723710.js";import"./shared-10b5e78f.js";import"./shared-3fa791ca.js";import"./shared-18cb3cfc.js";import"./shared-588c6b15.js";import{I as e}from"./shared-8c1df97c.js";import"./foxy-nucleon-element.js";import"./shared-f1d2b5bb.js";import{_ as r,B as t,aM as o,l as a}from"./shared-0f6e4584.js";import{a as i}from"./shared-075796e2.js";import{i as s}from"./shared-9803aa7c.js";import{h as d}from"./shared-dc73b9a5.js";import{s as n}from"./shared-6474675f.js";import{h as l}from"./shared-9db46672.js";import"./shared-6a4e81ad.js";import"./shared-30221a16.js";import"./shared-8f7a31e0.js";import"./shared-61ade33e.js";import"./shared-e6e84ff5.js";import"./shared-fe77f6f6.js";import"./shared-fb56178f.js";import"./shared-7b8ad9c1.js";import"./shared-51c4a6dd.js";import"./shared-0b01f721.js";import"./shared-f7a1193f.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-ee36b83f.js";import"./shared-df00a537.js";import"./shared-e5d37737.js";import"./shared-acdcae7e.js";import"./shared-3e03c988.js";import"./shared-339bbd50.js";import"./shared-797ba64a.js";import"./shared-10325cda.js";import"./shared-021c7a22.js";import"./shared-2099544a.js";import"./shared-2fc671cd.js";import"./shared-651c44fa.js";import"./shared-b6814728.js";import"./shared-634b670e.js";import"./shared-4e709717.js";import"./shared-abea5e34.js";import"./shared-7026fb08.js";import"./foxy-copy-to-clipboard.js";import"./shared-12ac8cc6.js";import"./shared-ff63a551.js";import"./shared-5c05ac06.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let c,h,p,f,u,m,v,j,_,b,g,y,x=e=>e;const $=i(e,"payments-api-fraud-protection-form");class L extends ${constructor(){super(...arguments),this.getImageSrc=null,this.__availableFraudProtectionsLoaderId="availableFraudProtections"}static get defaultImageSrc(){return"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 44 44'%3E%3Cpath fill='%23fff' d='M0 20.73v-9.9L10.83 0h9.9L0 20.73ZM0 0h9.41L0 9.41V0Zm0 22.14L22.14 0h9.9l-9.43 9.44-.61-.27-10.5 4.66v7-.29L0 32.04v-9.9Zm11.54-.23L0 33.46v9.9l14.14-14.14a15 15 0 0 1-2.6-7.3Zm3.2 8.12L.77 44h9.9l9.7-9.7a13.75 13.75 0 0 1-5.63-4.27Zm6.67 4.64L12.08 44h9.9L44 21.98v-9.9L32.16 23.92C31.01 29.15 27.05 33.6 22 34.83l-.59-.16Zm11.02-12.43L44 10.67V.77L31.42 13.35l1.08.48v7a13 13 0 0 1-.07 1.4Zm-1.99-9.32L43.35 0h-9.9l-9.87 9.87 6.86 3.05ZM23.4 44 44 23.4v9.9L33.3 44h-9.9Zm11.31 0L44 34.71V44h-9.29Z'/%3E%3Cpath fill='%23fff' d='M30.17 21.99H22V11.72l-8.17 3.63V22H22v10.42c4.34-1.34 7.55-5.63 8.17-10.43Z'/%3E%3C/svg%3E"}static get properties(){return r(r({},super.properties),{},{getImageSrc:{attribute:!1}})}static get v8n(){return[({description:e})=>!e||e.length<=100||"description:v8n_too_long",({type:e})=>!!e||"type:v8n_required",({score_threshold_reject:e})=>"number"!=typeof e||(e<=100&&e>=0||"score-threshold-reject:v8n_out_of_range"),e=>{var r,t,o,a;const i=null!==(o=null===(t=null===(r=e.helper)||void 0===r?void 0:r.json)||void 0===t?void 0:t.blocks)&&void 0!==o?o:[];let s;try{s=JSON.parse(null!==(a=e.json)&&void 0!==a?a:"{}")}catch(e){s={}}for(const e of i)for(const r of e.fields)if("optional"in r&&!r.optional){const t=[e.parent_id,e.id,r.id].filter((e=>!!e));if(!l(s,t)&&"checkbox"!==r.type)return"json:v8n_invalid"}return!0}]}get hiddenSelector(){return new t(`header:copy-json ${super.hiddenSelector}`.trimEnd())}get headerTitleOptions(){var e;return r(r({},this.data),{},{context:null!==(e=this.form.type)&&void 0!==e?e:"new"})}get headerSubtitleOptions(){return{id:this.headerCopyIdValue}}renderHeader(...e){var r;return d(c||(c=x` <div> ${0} ${0} </div> `),super.renderHeader(...e),(null===(r=this.data)||void 0===r?void 0:r.type)||!this.form.type?d(h||(h=x``)):d(p||(p=x` <vaadin-button data-testid="select-another-button" theme="tertiary-inline" @click="${0}"> <foxy-i18n infer="" key="select_another_button_label"></foxy-i18n> </vaadin-button> `),(()=>this.undo())))}renderBody(){return this.form.type?this.__renderFraudProtectionConfig():this.__renderFraudProtectionSelector()}get __availableFraudProtectionsLoader(){return this.renderRoot.querySelector(`#${this.__availableFraudProtectionsLoaderId}`)}get __availableFraudProtectionsHref(){try{const e=o(/\/payment_presets\/(.+)\//,{presetId:1}),r=new URL(this.href||this.parent).pathname,t=e.exec(r).groups.presetId;return new URL(`/payment_presets/${t}/available_fraud_protections`,this.href||this.parent).toString()}catch(e){}}get __availableFraudProtections(){var e,r;return null===(r=null===(e=this.__availableFraudProtectionsLoader)||void 0===e?void 0:e.data)||void 0===r?void 0:r.values}__renderFraudProtectionSelector(){var e;return d(f||(f=x` ${0} <div class="grid grid-cols-2 gap-m" data-testid="select-protection-list"> ${0} </div> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),Object.entries(null!==(e=this.__availableFraudProtections)&&void 0!==e?e:{}).map((([e,r])=>this.__renderFraudProtectionButton({type:e,helper:r}))),s(this.__availableFraudProtectionsHref),this.__availableFraudProtectionsLoaderId,(()=>this.requestUpdate()))}__renderFraudProtectionButton({type:e,helper:r}){var t,o;const a=L.defaultImageSrc,i=null!==(o=null===(t=this.getImageSrc)||void 0===t?void 0:t.call(this,e))&&void 0!==o?o:a,s=e=>e.currentTarget.src=a;return d(u||(u=x` <button class="relative w-full block text-left p-s rounded bg-contrast-5 overflow-hidden transition-colors hover-bg-contrast-10 focus-outline-none focus-ring-2 focus-ring-primary-50" @click="${0}"> <img class="absolute top-0 left-0 w-1-2 h-full object-cover bg-center filter saturate-200 blur-3xl" style="transform:translate3d(0,0,0)" src="${0}" alt="" @error="${0}"> <figure class="relative flex flex-col gap-m"> <img class="h-m w-m object-cover rounded-full bg-contrast-20 flex-shrink-0 shadow-xs" src="${0}" alt="" @error="${0}"> <figcaption class="min-w-0 flex-1 truncate leading-s"> <div class="font-medium">${0}​</div> <div class="text-xs text-secondary">${0}</div> </figcaption> </figure> </button> `),(()=>this.edit({type:e,helper:r})),i,s,i,s,r.name,e)}__renderFraudProtectionConfig(){var e,r,t;return d(m||(m=x` ${0} <foxy-internal-text-control infer="description"></foxy-internal-text-control> ${0} ${0} ${0} `),this.renderHeader(),(null===(e=this.form.helper)||void 0===e?void 0:e.uses_rejection_threshold)?d(v||(v=x` <foxy-internal-integer-control infer="score-threshold-reject"> </foxy-internal-integer-control> `)):"",null===(t=null===(r=this.form.helper)||void 0===r?void 0:r.json)||void 0===t?void 0:t.blocks.map((e=>this.__renderBlock(e))),super.renderBody())}__renderBlock(e){return d(j||(j=x`${0}`),e.fields.map((r=>{var t,o,i,s,l,c;const h=()=>{var t,o;let i;try{i=JSON.parse(null!==(t=this.form.json)&&void 0!==t?t:"")}catch(e){i={}}const s=[e.parent_id,e.id,r.id].filter((e=>!!e));return null!==(o=a(i,s))&&void 0!==o?o:i.default_value},p=t=>{var o;let a;try{a=JSON.parse(null!==(o=this.form.json)&&void 0!==o?o:"")}catch(e){a={}}const i=[e.parent_id,e.id,r.id].filter((e=>!!e));this.edit({json:JSON.stringify(n(a,i,t))})},f=r.options,u=["json",...[e.parent_id,e.id,r.id].filter((e=>!!e))].join("-").replace(/_/g,"-");return d(_||(_=x` ${0} `),"checkbox"===r.type?d(b||(b=x` <foxy-internal-checkbox-group-control helper-text="${0}" label="" infer="${0}" .options="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-checkbox-group-control> `),null!==(t=r.description)&&void 0!==t?t:"",u,[{label:r.name,value:"checked"}],(()=>h()?["checked"]:[]),(e=>p(e.includes("checked")))):"select"===r.type?d(g||(g=x` <foxy-internal-select-control helper-text="${0}" placeholder="${0}" label="${0}" infer="${0}" .options="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-select-control> `),null!==(o=r.description)&&void 0!==o?o:"",null!==(l=null===(s=null===(i=r.options)||void 0===i?void 0:i.find((e=>e.value===r.default_value)))||void 0===s?void 0:s.name)&&void 0!==l?l:this.t("default_additional_field_placeholder"),r.name,u,f.map((({name:e,value:r})=>({label:e,value:r}))),h,p):d(y||(y=x` <foxy-internal-text-control helper-text="${0}" placeholder="${0}" label="${0}" infer="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> `),null!==(c=r.description)&&void 0!==c?c:"",r.default_value||this.t("default_additional_field_placeholder"),r.name,u,h,p))})))}}customElements.define("foxy-payments-api-fraud-protection-form",L);export{L as PaymentsApiFraudProtectionForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-2d723710.js";import"./shared-81d3a9ae.js";import"./shared-fa9e5c7f.js";import"./shared-10b5e78f.js";import"./shared-cc79152c.js";import"./shared-d4810405.js";import"./shared-6e355777.js";import{I as e}from"./shared-8c1df97c.js";import"./foxy-nucleon-element.js";import"./foxy-spinner.js";import"./shared-f1d2b5bb.js";import{_ as t,B as r,aM as a,l as i}from"./shared-0f6e4584.js";import{g as o}from"./shared-bab2ea2c.js";import{a as s}from"./shared-075796e2.js";import{i as l}from"./shared-9803aa7c.js";import{c as n}from"./shared-4e709717.js";import{h as d}from"./shared-dc73b9a5.js";import{h as c}from"./shared-9db46672.js";import{s as h}from"./shared-6474675f.js";import"./shared-6a4e81ad.js";import"./shared-30221a16.js";import"./shared-8f7a31e0.js";import"./shared-61ade33e.js";import"./shared-e5d37737.js";import"./shared-644ee296.js";import"./shared-fb56178f.js";import"./shared-634b670e.js";import"./shared-651c44fa.js";import"./shared-2099544a.js";import"./shared-797ba64a.js";import"./shared-10325cda.js";import"./shared-021c7a22.js";import"./shared-2fc671cd.js";import"./shared-acdcae7e.js";import"./shared-3e03c988.js";import"./shared-fe77f6f6.js";import"./shared-b6814728.js";import"./shared-7b8ad9c1.js";import"./shared-51c4a6dd.js";import"./shared-0b01f721.js";import"./shared-f7a1193f.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-ee36b83f.js";import"./shared-e6e84ff5.js";import"./shared-abea5e34.js";import"./shared-7026fb08.js";import"./foxy-copy-to-clipboard.js";import"./shared-12ac8cc6.js";import"./shared-ff63a551.js";import"./shared-5c05ac06.js";let p,f,u,m,_,v,y,b,g,$,x,j,S,k,V,M,w,L,P,H,I,Z,B=e=>e;const C=s(e,"payments-api-payment-method-form");class D extends C{constructor(){super(...arguments),this.getImageSrc=null,this.__availablePaymentMethodsLoaderId="availablePaymentMethodsLoader",this.__threeDSecureResponseGetValue=()=>{var e;return(null===(e=this.form.config_3d_secure)||void 0===e?void 0:e.endsWith("require_valid_response"))?["valid_only"]:[]},this.__threeDSecureResponseSetValue=e=>{const t=e.includes("valid_only")?"_require_valid_response":"",r=this.form.config_3d_secure,a=(null==r?void 0:r.startsWith("all_cards"))?"all_cards":"maestro_only";this.edit({config_3d_secure:`${a}${t}`})},this.__threeDSecureResponseOptions=[{value:"valid_only",label:"option_valid_only"}],this.__threeDSecureToggleGetValue=()=>{const e=this.form.config_3d_secure;return(null==e?void 0:e.startsWith("all_cards"))?"all_cards":(null==e?void 0:e.startsWith("maestro_only"))?"maestro_only":"off"},this.__threeDSecureToggleSetValue=e=>{var t;let r="";"all_cards"!==e&&"maestro_only"!==e||(r=(null===(t=this.form.config_3d_secure)||void 0===t?void 0:t.endsWith("require_valid_response"))?`${e}_require_valid_response`:e),this.edit({config_3d_secure:r})},this.__threeDSecureToggleOptions=[{value:"off",label:"option_off"},{value:"all_cards",label:"option_all_cards"},{value:"maestro_only",label:"option_maestro_only"}],this.__tab=0}static get defaultImageSrc(){return"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 44 44'%3E%3Cpath fill='%23fff' d='m29.3 14 14-14H32.1l-14 14h11.2Zm2.7 9.9 12-12V.7L30.62 14.1A2 2 0 0 1 32 16v7.9ZM13.31 44h11.18L44 24.5V13.3l-12 12V28a2 2 0 0 1-2 2h-2.69l-14 14Zm-1.41 0H.7l14-14h11.2l-14 14Zm14 0h11.2l6.9-6.9V25.9L25.9 44Zm12.6 0H44v-5.5L38.5 44Z'/%3E%3Cpath fill='%23fff' d='M30 28H14v-6h16v6Zm0-10v-2H14v2h16ZM0 43.3l13.4-13.4A2 2 0 0 1 12 28v-7.9L0 32.12V43.3Z'/%3E%3Cpath fill='%23fff' d='M16.7 14H14c-1.11 0-1.99.89-1.99 2v2.7L0 30.7V19.52L19.52 0H30.7l-14 14Zm1.4-14H6.92L0 6.92V18.1L18.1 0ZM5.5 0H0v5.5L5.5 0Z'/%3E%3C/svg%3E"}static get properties(){return t(t({},super.properties),{},{__tab:{attribute:!1},getImageSrc:{attribute:!1}})}static get v8n(){return[({description:e})=>!e||e.length<=100||"description:v8n_too_long",({type:e})=>!!e||"type:v8n_required",e=>{var t,r,a,i;const o=null!==(a=null===(r=null===(t=e.helper)||void 0===t?void 0:t.additional_fields)||void 0===r?void 0:r.blocks)&&void 0!==a?a:[];let s;try{s=JSON.parse(null!==(i=e.additional_fields)&&void 0!==i?i:"{}")}catch(e){s={}}for(const e of o)for(const t of e.fields)if("optional"in t&&!t.optional&&!c(s,t.id)&&"checkbox"!==t.type)return"additional-fields:v8n_invalid";return!0}]}get hiddenSelector(){return new r(`header:copy-json ${super.hiddenSelector}`.trimEnd())}renderHeader(...e){var t;return d(p||(p=B` <div> ${0} ${0} </div> `),super.renderHeader(...e),(null===(t=this.data)||void 0===t?void 0:t.type)||!this.form.type?d(f||(f=B``)):d(u||(u=B` <vaadin-button data-testid="select-another-button" theme="tertiary-inline" @click="${0}"> <foxy-i18n infer="" key="select_another_button_label"></foxy-i18n> </vaadin-button> `),(()=>this.undo())))}get headerTitleOptions(){var e;return{context:this.form.type?"selected":"new",name:null===(e=this.form.helper)||void 0===e?void 0:e.name}}get headerSubtitleOptions(){if(this.href){const e=o(this.href),t=this.headerCopyIdValue;return e.startsWith("R")?{context:"regular",id:t}:{context:"hosted",id:t}}return{}}get headerCopyIdValue(){if(this.href){const e=o(this.href);return e.startsWith("R")?e.slice(1):e.slice(1).split("C")[0]}return""}renderBody(){const e=d(m||(m=B` <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),l(this.__availablePaymentMethodsHref),this.__availablePaymentMethodsLoaderId,(()=>this.requestUpdate()));return d(_||(_=B`${0}${0}${0}`),this.renderHeader(),this.form.type?this.__renderPaymentMethodConfig():this.__renderPaymentMethodSelector(),e)}get __groupedAvailablePaymentMethods(){var e;return Object.entries(null!==(e=this.__availablePaymentMethods)&&void 0!==e?e:{}).sort(((e,t)=>e[0].localeCompare(t[0],"en"))).reduce(((e,[t,r])=>{if(r.is_deprecated)return e;const a=t.charAt(0).toUpperCase(),i=!/\w/.test(a)?"#":a,o=e.find((e=>e.name===i));return o?o.items.push({type:t,helper:r}):e.push({name:i,items:[{type:t,helper:r}]}),e}),[])}get __availablePaymentMethodsLoader(){return this.renderRoot.querySelector(`#${this.__availablePaymentMethodsLoaderId}`)}get __availablePaymentMethodsHref(){try{const e=a(/\/payment_presets\/(.+)\//,{presetId:1}),t=new URL(this.href||this.parent).pathname,r=e.exec(t).groups.presetId;return new URL(`/payment_presets/${r}/available_payment_methods`,this.href||this.parent).toString()}catch(e){}}get __availablePaymentMethods(){var e,t;return null===(t=null===(e=this.__availablePaymentMethodsLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t.values}get __liveBlocks(){var e,t,r;return null!==(r=null===(t=null===(e=this.form.helper)||void 0===e?void 0:e.additional_fields)||void 0===t?void 0:t.blocks.filter((e=>e.is_live)))&&void 0!==r?r:[]}get __testBlocks(){var e,t,r;return null!==(r=null===(t=null===(e=this.form.helper)||void 0===e?void 0:e.additional_fields)||void 0===t?void 0:t.blocks.filter((e=>!e.is_live)))&&void 0!==r?r:[]}__renderPaymentMethodSelector(){const e=this.__availablePaymentMethodsLoader;return(null==e?void 0:e.data)?d(y||(y=B` <div> <section data-testid="select-method-list" class="-mt-m"> ${0} </section> </div> `),this.__groupedAvailablePaymentMethods.map((({name:e,items:t})=>d(b||(b=B` <p class="font-medium text-tertiary py-m">${0}</p> <ul class="grid grid-cols-2 gap-m"> ${0} </ul> `),e,t.map((e=>d(g||(g=B`<li>${0}</li>`),this.__renderPaymentMethodButton(e)))))))):d(v||(v=B` <foxy-spinner infer="list-spinner" state="${0}"> </foxy-spinner> `),(null==e?void 0:e.in("fail"))?"error":"busy")}__renderPaymentMethodConfig(){var e;return d($||($=B` <div class="rounded-t-l rounded-b-l border border-contrast-10"> <vaadin-tabs selected="${0}" theme="centered" @selected-changed="${0}"> <vaadin-tab><foxy-i18n infer="" key="tab_live"></foxy-i18n></vaadin-tab> <vaadin-tab><foxy-i18n infer="" key="tab_test"></foxy-i18n></vaadin-tab> </vaadin-tabs> <div class="overflow-hidden"> <div data-testid="tab-content" class="grid grid-cols-2 gap-m transition-transform transform duration-300" style="${0}"> ${0} </div> </div> </div> <foxy-internal-text-control infer="description"></foxy-internal-text-control> ${0} ${0} `),this.__tab,(e=>{var t;const r=e.currentTarget;this.__tab=null!==(t=r.selected)&&void 0!==t?t:0}),n({"width: calc(200% + var(--lumo-space-m));":!0,"--tw-translate-x: 0;":0===this.__tab,"--tw-translate-x: calc(-50% - (var(--lumo-space-m) / 2));":0!==this.__tab}),["live","test"].map(((e,t)=>{var r,a,i;const o=0===t?"":`${e}-`,s=0===t?this.__liveBlocks:this.__testBlocks;return d(x||(x=B` <div class="${0}"> ${0} ${0} ${0} ${0} </div> `),n({"grid grid-cols-1 gap-m p-m transition-opacity duration-300":!0,"opacity-100":this.__tab===t,"opacity-0":this.__tab!==t}),(null===(r=this.form.helper)||void 0===r?void 0:r.id_description)?d(j||(j=B` <foxy-internal-text-control placeholder="${0}" helper-text="" label="${0}" infer="${0}account-id"> </foxy-internal-text-control> `),this.t("default_additional_field_placeholder"),this.form.helper.id_description,o):"",(null===(a=this.form.helper)||void 0===a?void 0:a.third_party_key_description)?d(S||(S=B` <foxy-internal-text-control placeholder="${0}" helper-text="" label="${0}" infer="${0}third-party-key"> </foxy-internal-text-control> `),this.t("default_additional_field_placeholder"),this.form.helper.third_party_key_description,o):"",(null===(i=this.form.helper)||void 0===i?void 0:i.key_description)?d(k||(k=B` <foxy-internal-text-control placeholder="${0}" helper-text="" label="${0}" infer="${0}account-key"> </foxy-internal-text-control> `),this.t("default_additional_field_placeholder"),this.form.helper.key_description,o):"",s.map((e=>this.__renderBlock(e))))})),(null===(e=this.form.helper)||void 0===e?void 0:e.supports_3d_secure)?d(V||(V=B` <foxy-internal-radio-group-control infer="three-d-secure-toggle" class="-mb-s" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-radio-group-control> ${0} `),this.__threeDSecureToggleGetValue,this.__threeDSecureToggleSetValue,this.__threeDSecureToggleOptions,this.form.config_3d_secure?d(M||(M=B` <foxy-internal-checkbox-group-control infer="three-d-secure-response" class="-mb-s" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> `),this.__threeDSecureResponseGetValue,this.__threeDSecureResponseSetValue,this.__threeDSecureResponseOptions):""):"",super.renderBody())}__renderPaymentMethodButton({type:e,helper:t}){var r,a;const i=D.defaultImageSrc,o=null!==(a=null===(r=this.getImageSrc)||void 0===r?void 0:r.call(this,e))&&void 0!==a?a:i,s=e=>e.currentTarget.src=i;return d(w||(w=B` <button class="${0}" ?disabled="${0}" title="${0}" @click="${0}"> <img class="absolute top-0 left-0 w-1-2 h-full object-cover bg-center filter saturate-200 blur-3xl" style="transform:translate3d(0,0,0)" src="${0}" alt="" ?hidden="${0}" @error="${0}"> <figure class="relative flex flex-col gap-m"> <img class="${0}" src="${0}" alt="" @error="${0}"> <figcaption class="${0}"> <div class="font-medium">${0}​</div> <div class="text-xs ${0}">${0}</div> </figcaption> </figure> </button> `),n({"relative w-full block text-left p-s rounded bg-contrast-5 overflow-hidden":!0,"focus-outline-none focus-ring-2 focus-ring-primary-50":!0,"transition-colors hover-bg-contrast-10":!t.conflict,"cursor-default":!!t.conflict}),!!t.conflict,t.conflict?this.t("conflict_message",t.conflict):"",(()=>this.edit({type:e,helper:t})),o,!!t.conflict,s,n({"h-m w-m object-cover rounded-full bg-contrast-20 flex-shrink-0 shadow-xs":!0,"filter grayscale":!!t.conflict}),o,s,n({"min-w-0 flex-1 truncate leading-s":!0,"text-disabled":!!t.conflict}),t.name,t.conflict?"":"text-secondary",e)}__renderBlock(e){return d(L||(L=B`${0}`),e.fields.map((e=>{var t,r,a;const o=["additional-fields",e.id].join("-").replace(/_/g,"-"),s=()=>{var t,r;try{const a=JSON.parse(null!==(t=this.form.additional_fields)&&void 0!==t?t:"{}");return null!==(r=i(a,e.id))&&void 0!==r?r:a.default_value}catch(t){return e.default_value}},l=t=>{var r;try{const a=JSON.parse(null!==(r=this.form.additional_fields)&&void 0!==r?r:"{}");this.edit({additional_fields:JSON.stringify(h(a,e.id,t))})}catch(e){return""}},n=e.options;return d(P||(P=B` ${0} `),"checkbox"===e.type?d(H||(H=B` <foxy-internal-checkbox-group-control helper-text="${0}" label="" class="-mb-s" infer="${0}" .options="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-checkbox-group-control> `),null!==(t=e.description)&&void 0!==t?t:"",o,[{label:e.name,value:"checked"}],(()=>s()?["checked"]:[]),(e=>{l(e.includes("checked"))})):"select"===e.type?d(I||(I=B` <foxy-internal-select-control helper-text="${0}" label="${0}" infer="${0}" .options="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-select-control> `),null!==(r=e.description)&&void 0!==r?r:"",e.name,o,n.map((({name:e,value:t})=>({label:e,value:t}))),s,l):d(Z||(Z=B` <foxy-internal-text-control helper-text="${0}" placeholder="${0}" label="${0}" infer="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> `),null!==(a=e.description)&&void 0!==a?a:"",e.default_value||this.t("default_additional_field_placeholder"),e.name,o,s,l))})))}}customElements.define("foxy-payments-api-payment-method-form",D);export{D as PaymentsApiPaymentMethodForm};
|
|
1
|
+
import"./shared-2d723710.js";import"./shared-81d3a9ae.js";import"./shared-fa9e5c7f.js";import"./shared-10b5e78f.js";import"./shared-cc79152c.js";import"./shared-18cb3cfc.js";import"./shared-588c6b15.js";import{I as e}from"./shared-8c1df97c.js";import"./foxy-nucleon-element.js";import"./foxy-spinner.js";import"./shared-f1d2b5bb.js";import{_ as t,B as r,aM as a,l as i}from"./shared-0f6e4584.js";import{g as o}from"./shared-bab2ea2c.js";import{a as s}from"./shared-075796e2.js";import{i as l}from"./shared-9803aa7c.js";import{c as n}from"./shared-4e709717.js";import{h as d}from"./shared-dc73b9a5.js";import{h as c}from"./shared-9db46672.js";import{s as h}from"./shared-6474675f.js";import"./shared-6a4e81ad.js";import"./shared-30221a16.js";import"./shared-8f7a31e0.js";import"./shared-61ade33e.js";import"./shared-e5d37737.js";import"./shared-644ee296.js";import"./shared-fb56178f.js";import"./shared-634b670e.js";import"./shared-651c44fa.js";import"./shared-2099544a.js";import"./shared-797ba64a.js";import"./shared-10325cda.js";import"./shared-021c7a22.js";import"./shared-2fc671cd.js";import"./shared-acdcae7e.js";import"./shared-3e03c988.js";import"./shared-fe77f6f6.js";import"./shared-b6814728.js";import"./shared-7b8ad9c1.js";import"./shared-51c4a6dd.js";import"./shared-0b01f721.js";import"./shared-f7a1193f.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-ee36b83f.js";import"./shared-e6e84ff5.js";import"./shared-abea5e34.js";import"./shared-7026fb08.js";import"./foxy-copy-to-clipboard.js";import"./shared-12ac8cc6.js";import"./shared-ff63a551.js";import"./shared-5c05ac06.js";let p,f,u,m,_,v,y,b,g,$,x,j,S,k,V,M,w,L,P,H,I,Z,B=e=>e;const C=s(e,"payments-api-payment-method-form");class D extends C{constructor(){super(...arguments),this.getImageSrc=null,this.__availablePaymentMethodsLoaderId="availablePaymentMethodsLoader",this.__threeDSecureResponseGetValue=()=>{var e;return(null===(e=this.form.config_3d_secure)||void 0===e?void 0:e.endsWith("require_valid_response"))?["valid_only"]:[]},this.__threeDSecureResponseSetValue=e=>{const t=e.includes("valid_only")?"_require_valid_response":"",r=this.form.config_3d_secure,a=(null==r?void 0:r.startsWith("all_cards"))?"all_cards":"maestro_only";this.edit({config_3d_secure:`${a}${t}`})},this.__threeDSecureResponseOptions=[{value:"valid_only",label:"option_valid_only"}],this.__threeDSecureToggleGetValue=()=>{const e=this.form.config_3d_secure;return(null==e?void 0:e.startsWith("all_cards"))?"all_cards":(null==e?void 0:e.startsWith("maestro_only"))?"maestro_only":"off"},this.__threeDSecureToggleSetValue=e=>{var t;let r="";"all_cards"!==e&&"maestro_only"!==e||(r=(null===(t=this.form.config_3d_secure)||void 0===t?void 0:t.endsWith("require_valid_response"))?`${e}_require_valid_response`:e),this.edit({config_3d_secure:r})},this.__threeDSecureToggleOptions=[{value:"off",label:"option_off"},{value:"all_cards",label:"option_all_cards"},{value:"maestro_only",label:"option_maestro_only"}],this.__tab=0}static get defaultImageSrc(){return"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 44 44'%3E%3Cpath fill='%23fff' d='m29.3 14 14-14H32.1l-14 14h11.2Zm2.7 9.9 12-12V.7L30.62 14.1A2 2 0 0 1 32 16v7.9ZM13.31 44h11.18L44 24.5V13.3l-12 12V28a2 2 0 0 1-2 2h-2.69l-14 14Zm-1.41 0H.7l14-14h11.2l-14 14Zm14 0h11.2l6.9-6.9V25.9L25.9 44Zm12.6 0H44v-5.5L38.5 44Z'/%3E%3Cpath fill='%23fff' d='M30 28H14v-6h16v6Zm0-10v-2H14v2h16ZM0 43.3l13.4-13.4A2 2 0 0 1 12 28v-7.9L0 32.12V43.3Z'/%3E%3Cpath fill='%23fff' d='M16.7 14H14c-1.11 0-1.99.89-1.99 2v2.7L0 30.7V19.52L19.52 0H30.7l-14 14Zm1.4-14H6.92L0 6.92V18.1L18.1 0ZM5.5 0H0v5.5L5.5 0Z'/%3E%3C/svg%3E"}static get properties(){return t(t({},super.properties),{},{__tab:{attribute:!1},getImageSrc:{attribute:!1}})}static get v8n(){return[({description:e})=>!e||e.length<=100||"description:v8n_too_long",({type:e})=>!!e||"type:v8n_required",e=>{var t,r,a,i;const o=null!==(a=null===(r=null===(t=e.helper)||void 0===t?void 0:t.additional_fields)||void 0===r?void 0:r.blocks)&&void 0!==a?a:[];let s;try{s=JSON.parse(null!==(i=e.additional_fields)&&void 0!==i?i:"{}")}catch(e){s={}}for(const e of o)for(const t of e.fields)if("optional"in t&&!t.optional&&!c(s,t.id)&&"checkbox"!==t.type)return"additional-fields:v8n_invalid";return!0}]}get hiddenSelector(){return new r(`header:copy-json ${super.hiddenSelector}`.trimEnd())}renderHeader(...e){var t;return d(p||(p=B` <div> ${0} ${0} </div> `),super.renderHeader(...e),(null===(t=this.data)||void 0===t?void 0:t.type)||!this.form.type?d(f||(f=B``)):d(u||(u=B` <vaadin-button data-testid="select-another-button" theme="tertiary-inline" @click="${0}"> <foxy-i18n infer="" key="select_another_button_label"></foxy-i18n> </vaadin-button> `),(()=>this.undo())))}get headerTitleOptions(){var e;return{context:this.form.type?"selected":"new",name:null===(e=this.form.helper)||void 0===e?void 0:e.name}}get headerSubtitleOptions(){if(this.href){const e=o(this.href),t=this.headerCopyIdValue;return e.startsWith("R")?{context:"regular",id:t}:{context:"hosted",id:t}}return{}}get headerCopyIdValue(){if(this.href){const e=o(this.href);return e.startsWith("R")?e.slice(1):e.slice(1).split("C")[0]}return""}renderBody(){const e=d(m||(m=B` <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),l(this.__availablePaymentMethodsHref),this.__availablePaymentMethodsLoaderId,(()=>this.requestUpdate()));return d(_||(_=B`${0}${0}${0}`),this.renderHeader(),this.form.type?this.__renderPaymentMethodConfig():this.__renderPaymentMethodSelector(),e)}get __groupedAvailablePaymentMethods(){var e;return Object.entries(null!==(e=this.__availablePaymentMethods)&&void 0!==e?e:{}).sort(((e,t)=>e[0].localeCompare(t[0],"en"))).reduce(((e,[t,r])=>{if(r.is_deprecated)return e;const a=t.charAt(0).toUpperCase(),i=!/\w/.test(a)?"#":a,o=e.find((e=>e.name===i));return o?o.items.push({type:t,helper:r}):e.push({name:i,items:[{type:t,helper:r}]}),e}),[])}get __availablePaymentMethodsLoader(){return this.renderRoot.querySelector(`#${this.__availablePaymentMethodsLoaderId}`)}get __availablePaymentMethodsHref(){try{const e=a(/\/payment_presets\/(.+)\//,{presetId:1}),t=new URL(this.href||this.parent).pathname,r=e.exec(t).groups.presetId;return new URL(`/payment_presets/${r}/available_payment_methods`,this.href||this.parent).toString()}catch(e){}}get __availablePaymentMethods(){var e,t;return null===(t=null===(e=this.__availablePaymentMethodsLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t.values}get __liveBlocks(){var e,t,r;return null!==(r=null===(t=null===(e=this.form.helper)||void 0===e?void 0:e.additional_fields)||void 0===t?void 0:t.blocks.filter((e=>e.is_live)))&&void 0!==r?r:[]}get __testBlocks(){var e,t,r;return null!==(r=null===(t=null===(e=this.form.helper)||void 0===e?void 0:e.additional_fields)||void 0===t?void 0:t.blocks.filter((e=>!e.is_live)))&&void 0!==r?r:[]}__renderPaymentMethodSelector(){const e=this.__availablePaymentMethodsLoader;return(null==e?void 0:e.data)?d(y||(y=B` <div> <section data-testid="select-method-list" class="-mt-m"> ${0} </section> </div> `),this.__groupedAvailablePaymentMethods.map((({name:e,items:t})=>d(b||(b=B` <p class="font-medium text-tertiary py-m">${0}</p> <ul class="grid grid-cols-2 gap-m"> ${0} </ul> `),e,t.map((e=>d(g||(g=B`<li>${0}</li>`),this.__renderPaymentMethodButton(e)))))))):d(v||(v=B` <foxy-spinner infer="list-spinner" state="${0}"> </foxy-spinner> `),(null==e?void 0:e.in("fail"))?"error":"busy")}__renderPaymentMethodConfig(){var e;return d($||($=B` <div class="rounded-t-l rounded-b-l border border-contrast-10"> <vaadin-tabs selected="${0}" theme="centered" @selected-changed="${0}"> <vaadin-tab><foxy-i18n infer="" key="tab_live"></foxy-i18n></vaadin-tab> <vaadin-tab><foxy-i18n infer="" key="tab_test"></foxy-i18n></vaadin-tab> </vaadin-tabs> <div class="overflow-hidden"> <div data-testid="tab-content" class="grid grid-cols-2 gap-m transition-transform transform duration-300" style="${0}"> ${0} </div> </div> </div> <foxy-internal-text-control infer="description"></foxy-internal-text-control> ${0} ${0} `),this.__tab,(e=>{var t;const r=e.currentTarget;this.__tab=null!==(t=r.selected)&&void 0!==t?t:0}),n({"width: calc(200% + var(--lumo-space-m));":!0,"--tw-translate-x: 0;":0===this.__tab,"--tw-translate-x: calc(-50% - (var(--lumo-space-m) / 2));":0!==this.__tab}),["live","test"].map(((e,t)=>{var r,a,i;const o=0===t?"":`${e}-`,s=0===t?this.__liveBlocks:this.__testBlocks;return d(x||(x=B` <div class="${0}"> ${0} ${0} ${0} ${0} </div> `),n({"grid grid-cols-1 gap-m p-m transition-opacity duration-300":!0,"opacity-100":this.__tab===t,"opacity-0":this.__tab!==t}),(null===(r=this.form.helper)||void 0===r?void 0:r.id_description)?d(j||(j=B` <foxy-internal-text-control placeholder="${0}" helper-text="" label="${0}" infer="${0}account-id"> </foxy-internal-text-control> `),this.t("default_additional_field_placeholder"),this.form.helper.id_description,o):"",(null===(a=this.form.helper)||void 0===a?void 0:a.third_party_key_description)?d(S||(S=B` <foxy-internal-text-control placeholder="${0}" helper-text="" label="${0}" infer="${0}third-party-key"> </foxy-internal-text-control> `),this.t("default_additional_field_placeholder"),this.form.helper.third_party_key_description,o):"",(null===(i=this.form.helper)||void 0===i?void 0:i.key_description)?d(k||(k=B` <foxy-internal-text-control placeholder="${0}" helper-text="" label="${0}" infer="${0}account-key"> </foxy-internal-text-control> `),this.t("default_additional_field_placeholder"),this.form.helper.key_description,o):"",s.map((e=>this.__renderBlock(e))))})),(null===(e=this.form.helper)||void 0===e?void 0:e.supports_3d_secure)?d(V||(V=B` <foxy-internal-radio-group-control infer="three-d-secure-toggle" class="-mb-s" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-radio-group-control> ${0} `),this.__threeDSecureToggleGetValue,this.__threeDSecureToggleSetValue,this.__threeDSecureToggleOptions,this.form.config_3d_secure?d(M||(M=B` <foxy-internal-checkbox-group-control infer="three-d-secure-response" class="-mb-s" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> `),this.__threeDSecureResponseGetValue,this.__threeDSecureResponseSetValue,this.__threeDSecureResponseOptions):""):"",super.renderBody())}__renderPaymentMethodButton({type:e,helper:t}){var r,a;const i=D.defaultImageSrc,o=null!==(a=null===(r=this.getImageSrc)||void 0===r?void 0:r.call(this,e))&&void 0!==a?a:i,s=e=>e.currentTarget.src=i;return d(w||(w=B` <button class="${0}" ?disabled="${0}" title="${0}" @click="${0}"> <img class="absolute top-0 left-0 w-1-2 h-full object-cover bg-center filter saturate-200 blur-3xl" style="transform:translate3d(0,0,0)" src="${0}" alt="" ?hidden="${0}" @error="${0}"> <figure class="relative flex flex-col gap-m"> <img class="${0}" src="${0}" alt="" @error="${0}"> <figcaption class="${0}"> <div class="font-medium">${0}​</div> <div class="text-xs ${0}">${0}</div> </figcaption> </figure> </button> `),n({"relative w-full block text-left p-s rounded bg-contrast-5 overflow-hidden":!0,"focus-outline-none focus-ring-2 focus-ring-primary-50":!0,"transition-colors hover-bg-contrast-10":!t.conflict,"cursor-default":!!t.conflict}),!!t.conflict,t.conflict?this.t("conflict_message",t.conflict):"",(()=>this.edit({type:e,helper:t})),o,!!t.conflict,s,n({"h-m w-m object-cover rounded-full bg-contrast-20 flex-shrink-0 shadow-xs":!0,"filter grayscale":!!t.conflict}),o,s,n({"min-w-0 flex-1 truncate leading-s":!0,"text-disabled":!!t.conflict}),t.name,t.conflict?"":"text-secondary",e)}__renderBlock(e){return d(L||(L=B`${0}`),e.fields.map((e=>{var t,r,a;const o=["additional-fields",e.id].join("-").replace(/_/g,"-"),s=()=>{var t,r;try{const a=JSON.parse(null!==(t=this.form.additional_fields)&&void 0!==t?t:"{}");return null!==(r=i(a,e.id))&&void 0!==r?r:a.default_value}catch(t){return e.default_value}},l=t=>{var r;try{const a=JSON.parse(null!==(r=this.form.additional_fields)&&void 0!==r?r:"{}");this.edit({additional_fields:JSON.stringify(h(a,e.id,t))})}catch(e){return""}},n=e.options;return d(P||(P=B` ${0} `),"checkbox"===e.type?d(H||(H=B` <foxy-internal-checkbox-group-control helper-text="${0}" label="" class="-mb-s" infer="${0}" .options="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-checkbox-group-control> `),null!==(t=e.description)&&void 0!==t?t:"",o,[{label:e.name,value:"checked"}],(()=>s()?["checked"]:[]),(e=>{l(e.includes("checked"))})):"select"===e.type?d(I||(I=B` <foxy-internal-select-control helper-text="${0}" label="${0}" infer="${0}" .options="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-select-control> `),null!==(r=e.description)&&void 0!==r?r:"",e.name,o,n.map((({name:e,value:t})=>({label:e,value:t}))),s,l):d(Z||(Z=B` <foxy-internal-text-control helper-text="${0}" placeholder="${0}" label="${0}" infer="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> `),null!==(a=e.description)&&void 0!==a?a:"",e.default_value||this.t("default_additional_field_placeholder"),e.name,o,s,l))})))}}customElements.define("foxy-payments-api-payment-method-form",D);export{D as PaymentsApiPaymentMethodForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-10b5e78f.js";import"./shared-b98b8d02.js";import"./shared-
|
|
1
|
+
import"./shared-10b5e78f.js";import"./shared-b98b8d02.js";import"./shared-588c6b15.js";import{I as e}from"./shared-8c1df97c.js";import"./foxy-payments-api-fraud-protection-card.js";import"./foxy-payments-api-fraud-protection-form.js";import"./foxy-payments-api-payment-method-card.js";import"./foxy-payments-api-payment-method-form.js";import{_ as r,B as t}from"./shared-0f6e4584.js";import{a}from"./shared-075796e2.js";import{h as s}from"./shared-dc73b9a5.js";import"./shared-e6e84ff5.js";import"./shared-6a4e81ad.js";import"./shared-30221a16.js";import"./shared-8f7a31e0.js";import"./shared-61ade33e.js";import"./shared-fe77f6f6.js";import"./shared-fb56178f.js";import"./shared-7b8ad9c1.js";import"./shared-51c4a6dd.js";import"./shared-f1d2b5bb.js";import"./shared-343d1fd7.js";import"./shared-f7a1193f.js";import"./shared-0b01f721.js";import"./shared-9803aa7c.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-10325cda.js";import"./shared-021c7a22.js";import"./shared-2099544a.js";import"./shared-2d723710.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-5c05ac06.js";import"./shared-a0c6a159.js";import"./shared-99940888.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-abea5e34.js";import"./shared-7026fb08.js";import"./shared-4e709717.js";import"./foxy-pagination.js";import"./shared-3e03c988.js";import"./shared-e5d37737.js";import"./shared-acdcae7e.js";import"./foxy-copy-to-clipboard.js";import"./shared-12ac8cc6.js";import"./shared-ff63a551.js";import"./shared-bab2ea2c.js";import"./shared-77051754.js";import"./shared-a6273e4a.js";import"./shared-3fa791ca.js";import"./shared-df00a537.js";import"./shared-339bbd50.js";import"./shared-18cb3cfc.js";import"./shared-797ba64a.js";import"./shared-2fc671cd.js";import"./shared-651c44fa.js";import"./shared-b6814728.js";import"./shared-634b670e.js";import"./foxy-nucleon-element.js";import"./shared-9db46672.js";import"./shared-81d3a9ae.js";import"./shared-644ee296.js";import"./shared-fa9e5c7f.js";import"./shared-cc79152c.js";let o,i,d,p,n,m,h=e=>e;const c=a(e,"payments-api-payment-preset-form");class f extends c{constructor(){super(...arguments),this.getFraudProtectionImageSrc=null,this.getPaymentMethodImageSrc=null,this.__getIsPOEnabledValue=()=>this.form.is_purchase_order_enabled?["true"]:[],this.__setIsPOEnabledValue=e=>{this.edit({is_purchase_order_enabled:e.includes("true")})},this.__getIsLiveValue=()=>this.form.is_live?["live"]:["test"],this.__setIsLiveValue=e=>{this.edit({is_live:e.includes("live")})}}static get properties(){return r(r({},super.properties),{},{getFraudProtectionImageSrc:{attribute:!1},getPaymentMethodImageSrc:{attribute:!1}})}static get v8n(){return[({description:e})=>!!e||"description:v8n_required",({description:e})=>e&&e.length<=100||"description:v8n_too_long"]}get hiddenSelector(){return new t(`header:copy-json ${super.hiddenSelector}`.trimEnd())}renderBody(){const e=this.constructor;return s(o||(o=h` ${0} <foxy-internal-text-control infer="description"></foxy-internal-text-control> <div class="-mb-s"> <foxy-internal-checkbox-group-control infer="is-live" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-checkbox-group-control infer="is-purchase-order-enabled" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> </div> ${0} ${0} `),this.renderHeader(),this.__getIsLiveValue,this.__setIsLiveValue,e.__isLiveOptions,this.__getIsPOEnabledValue,this.__setIsPOEnabledValue,e.__isPOEnabledOptions,this.data?s(i||(i=h` <foxy-internal-async-list-control infer="payment-methods" first="${0}" limit="5" alert .item="${0}" .form="${0}"> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="fraud-protections" first="${0}" limit="5" alert .item="${0}" .form="${0}"> </foxy-internal-async-list-control> `),this.data._links["fx:payment_methods"].href,(e=>s(d||(d=h` <foxy-payments-api-payment-method-card parent="${0}" infer="payments-api-payment-method-card" href="${0}" .getImageSrc="${0}"> </foxy-payments-api-payment-method-card> `),e.parent,e.href,this.getPaymentMethodImageSrc)),(e=>s(p||(p=h` <foxy-payments-api-payment-method-form parent="${0}" infer="payments-api-payment-method-form" href="${0}" id="form" .getImageSrc="${0}" @fetch="${0}" @update="${0}"> </foxy-payments-api-payment-method-form> `),e.dialog.parent,e.dialog.href,this.getPaymentMethodImageSrc,e.handleFetch,e.handleUpdate)),this.data._links["fx:fraud_protections"].href,(e=>s(n||(n=h` <foxy-payments-api-fraud-protection-card parent="${0}" infer="payments-api-fraud-protection-card" href="${0}" .getImageSrc="${0}"> </foxy-payments-api-fraud-protection-card> `),e.parent,e.href,this.getFraudProtectionImageSrc)),(e=>s(m||(m=h` <foxy-payments-api-fraud-protection-form parent="${0}" infer="payments-api-fraud-protection-form" href="${0}" id="form" .getImageSrc="${0}" @fetch="${0}" @update="${0}"> </foxy-payments-api-fraud-protection-form> `),e.dialog.parent,e.dialog.href,this.getFraudProtectionImageSrc,e.handleFetch,e.handleUpdate))):"",super.renderBody())}}f.__isPOEnabledOptions=[{label:"option_true",value:"true"}],f.__isLiveOptions=[{label:"option_live",value:"live"}],customElements.define("foxy-payments-api-payment-preset-form",f);export{f as PaymentsApiPaymentPresetForm};
|