@foxy.io/elements 1.40.0-beta.3 → 1.40.0-beta.4

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.
Files changed (17) hide show
  1. package/dist/cdn/foxy-native-integration-form.js +1 -1
  2. package/dist/cdn/foxy-template-config-form.js +1 -1
  3. package/dist/elements/public/NativeIntegrationForm/NativeIntegrationForm.js +4 -7
  4. package/dist/elements/public/NativeIntegrationForm/NativeIntegrationForm.js.map +1 -1
  5. package/dist/elements/public/TemplateConfigForm/TemplateConfigForm.d.ts +2 -2
  6. package/dist/elements/public/TemplateConfigForm/TemplateConfigForm.js +6 -9
  7. package/dist/elements/public/TemplateConfigForm/TemplateConfigForm.js.map +1 -1
  8. package/dist/elements/public/TemplateConfigForm/internal/InternalTemplateConfigFormFilterValuesControl/InternalTemplateConfigFormFilterValuesControl.d.ts +0 -1
  9. package/dist/elements/public/TemplateConfigForm/internal/InternalTemplateConfigFormFilterValuesControl/InternalTemplateConfigFormFilterValuesControl.js +24 -70
  10. package/dist/elements/public/TemplateConfigForm/internal/InternalTemplateConfigFormFilterValuesControl/InternalTemplateConfigFormFilterValuesControl.js.map +1 -1
  11. package/dist/elements/public/TemplateConfigForm/internal/InternalTemplateConfigFormFilterValuesControl/InternalTemplateConfigFormFilterValuesControlItem.d.ts +8 -12
  12. package/dist/elements/public/TemplateConfigForm/internal/InternalTemplateConfigFormFilterValuesControl/InternalTemplateConfigFormFilterValuesControlItem.js +51 -89
  13. package/dist/elements/public/TemplateConfigForm/internal/InternalTemplateConfigFormFilterValuesControl/InternalTemplateConfigFormFilterValuesControlItem.js.map +1 -1
  14. package/dist/elements/public/TemplateConfigForm/internal/InternalTemplateConfigFormFilterValuesControl/index.d.ts +1 -0
  15. package/dist/elements/public/TemplateConfigForm/internal/InternalTemplateConfigFormFilterValuesControl/index.js +1 -0
  16. package/dist/elements/public/TemplateConfigForm/internal/InternalTemplateConfigFormFilterValuesControl/index.js.map +1 -1
  17. package/package.json +1 -1
@@ -1 +1 @@
1
- import"./shared-eef73355.js";import"./shared-4a4f6eb9.js";import"./shared-511fcf8e.js";import"./shared-5cd33249.js";import"./shared-00e02b35.js";import"./shared-4a32f76a.js";import{a as e,I as o}from"./shared-5b4e2567.js";import"./foxy-nucleon-element.js";import"./shared-653368ea.js";import"./foxy-item-category-card.js";import{_ as r,m as t,B as n}from"./shared-cb58dfcd.js";import{g as a}from"./shared-bab2ea2c.js";import{i}from"./shared-53e42a77.js";import{h as l,s}from"./shared-ba5c42c7.js";import{c}from"./shared-4e709717.js";import{a as p}from"./shared-11351c00.js";import"./shared-d807cb20.js";import"./shared-21e68b72.js";import"./shared-315d7620.js";import"./shared-f9ac8763.js";import"./shared-37348820.js";import"./shared-360d6a20.js";import"./shared-5fd5805c.js";import"./shared-d0aed1c1.js";import"./shared-53e476fd.js";import"./shared-8b25a098.js";import"./shared-8b0f00fa.js";import"./shared-edeeb089.js";import"./shared-f989c70e.js";import"./shared-be442f26.js";import"./shared-8ef0ca65.js";import"./shared-4d32d19e.js";import"./shared-343d1fd7.js";import"./shared-2aa23b5f.js";import"./shared-243456aa.js";import"./shared-3556f4b7.js";import"./shared-7dc9c80b.js";import"./shared-c25538f1.js";import"./shared-c1e86ea4.js";import"./shared-651c44fa.js";import"./shared-1c355fac.js";import"./shared-cf12f33b.js";import"./shared-0aedd809.js";import"./shared-7594e563.js";import"./shared-5212ef4f.js";import"./shared-5afb584d.js";import"./shared-f83207fb.js";import"./shared-5592ec6e.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-5ef40e86.js";import"./shared-e5546d55.js";import"./shared-048d5cae.js";import"./foxy-copy-to-clipboard.js";import"./shared-c18f681b.js";import"./foxy-spinner.js";import"./shared-0098edce.js";import"./shared-6957b8e6.js";import"./foxy-collection-page.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./foxy-pagination.js";import"./shared-0df46275.js";import"./shared-f1a70f51.js";let u,f,d,m=e=>e;customElements.define("foxy-internal-native-integration-form-code-map-control",class extends e{constructor(){super(...arguments),this.itemCategoryBase=null,this.itemCategories=null,this.__newMappingGetValue=()=>{},this.__newMappingSetValue=e=>{const o=a(e);if("string"==typeof o||"number"==typeof o)if(this._value&&o in this._value){const e=this.renderRoot.querySelector(`#category-${o}`);null==e||e.animate([{background:""},{background:"var(--lumo-primary-color-50pct)"},{background:""}],{duration:2e3,easing:"ease"})}else this._value=r(r({},this._value),{},{[o]:""})}}static get properties(){return r(r({},super.properties),{},{itemCategoryBase:{attribute:"item-category-base"},itemCategories:{attribute:"item-categories"}})}renderControl(){var e,o;return l(u||(u=m` <foxy-internal-summary-control infer="existing-mappings" unsafe-helper-text> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control helper-text="" label="" infer="new-mapping" class="mt-s"> <foxy-internal-resource-picker-control layout="summary-item" first="${0}" infer="" item="foxy-item-category-card" .getValue="${0}" .setValue="${0}"> </foxy-internal-resource-picker-control> </foxy-internal-summary-control> `),Object.entries(null!==(e=this._value)&&void 0!==e?e:{}).map((([e,o])=>{var t,n,a,p,u;let y;try{y=new URL(e,null!==(t=this.itemCategoryBase)&&void 0!==t?t:void 0).toString()}catch(e){y=void 0}const _=this.renderRoot.querySelector(`#category${e}Loader`),v=(null==_?void 0:_.in("fail"))?this.t("existing-mappings.status_fail"):(null==_?void 0:_.in("busy"))?this.t("existing-mappings.status_busy"):null;return l(f||(f=m` <div class="flex items-center gap-xs" id="category-${0}"> <foxy-nucleon parent="${0}" class="hidden" infer="" href="${0}" id="category${0}Loader" @update="${0}"> </foxy-nucleon> <foxy-internal-text-control helper-text="" layout="summary-item" label="${0}" infer="" class="flex-1" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <button aria-label="${0}" class="${0}" style="width:1em;height:1em" ?disabled="${0}" ?hidden="${0}" @click="${0}"> ${0} </button> </div> `),e,i(null!==(n=this.itemCategories)&&void 0!==n?n:void 0),i(y),e,(()=>this.requestUpdate()),null!==(u=null!==(p=null===(a=null==_?void 0:_.data)||void 0===a?void 0:a.name)&&void 0!==p?p:v)&&void 0!==u?u:e,(()=>o),(o=>this._value=r(r({},this._value),{},{[e]:o})),this.t("delete"),c({"flex-shrink-0 rounded-full transition-colors":!0,"focus-outline-none focus-ring-2 focus-ring-primary-50":!0,"cursor-pointer text-tertiary hover-text-body":!this.disabled,"cursor-default text-disabled":this.disabled}),this.disabled,this.readonly||!!o,(()=>{const o=r({},this._value);delete o[e],this._value=o}),s(d||(d=m`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1em; height: 1em; transform: translate(0.1em, 0.1em) scale(1.3);"><path fill-rule="evenodd" d="M5 3.25V4H2.75a.75.75 0 0 0 0 1.5h.3l.815 8.15A1.5 1.5 0 0 0 5.357 15h5.285a1.5 1.5 0 0 0 1.493-1.35l.815-8.15h.3a.75.75 0 0 0 0-1.5H11v-.75A2.25 2.25 0 0 0 8.75 1h-1.5A2.25 2.25 0 0 0 5 3.25Zm2.25-.75a.75.75 0 0 0-.75.75V4h3v-.75a.75.75 0 0 0-.75-.75h-1.5ZM6.05 6a.75.75 0 0 1 .787.713l.275 5.5a.75.75 0 0 1-1.498.075l-.275-5.5A.75.75 0 0 1 6.05 6Zm3.9 0a.75.75 0 0 1 .712.787l-.275 5.5a.75.75 0 0 1-1.498-.075l.275-5.5a.75.75 0 0 1 .786-.711Z" clip-rule="evenodd" /> </svg>`)))})),i(null!==(o=this.itemCategories)&&void 0!==o?o:void 0),this.__newMappingGetValue,this.__newMappingSetValue)}get _value(){return super._value}set _value(e){super._value=e}});const y=JSON.stringify({service:"legacy_xml",version:1,events:["transaction/created"],title:"",url:""}),_=JSON.stringify({encryption_key:"",service:"json",version:1,events:[],title:"",url:""}),v=JSON.stringify({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:""}),h=JSON.stringify({url:""}),x=JSON.stringify({merchantID:""}),g=JSON.stringify({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:""}),j=JSON.stringify({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:""}),b=JSON.stringify({service:"zapier",events:[],url:""}),w=JSON.stringify({category_to_product_tax_code_mappings:{},create_invoice:!1,api_token:""});let $,k,C,S,O,q,V,J,B,A,N,L,P,z,G,M=e=>e;const W=p(o,"native-integration-form");class R extends W{constructor(){super(...arguments),this.itemCategoryBase=null,this.store=null,this.__createConfigGetterFor=t((e=>()=>{var o;return null===(o=this.__config)||void 0===o?void 0:o[e]})),this.__createConfigSetterFor=t((e=>o=>this.__config={[e]:o})),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"},{value:"custom_tax",label:"option_custom_tax"}],this.__avalaraAddressValidationCountriesOptions=[{value:"US"},{value:"CA"}],this.__onesourceCompanyRoleOptions=[{value:"B",label:"option_buyer"},{value:"M",label:"option_middleman"},{value:"S",label:"option_seller"}],this.__onesourceProductOrderPriorityGetValue=()=>{var e,o;return(null!==(o=null===(e=this.__config)||void 0===e?void 0:e.product_order_priority.split(","))&&void 0!==o?o:[]).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 properties(){return r(r({},super.properties),{},{itemCategoryBase:{attribute:"item-category-base"},store:{}})}static get v8n(){const e=t(JSON.parse),o=t((e=>{try{return Boolean(new URL(e))}catch(e){return!1}}));return[({provider:r="avalara",config:t="{}"})=>{const n=e(t).service_url,a=n?o(n)?null:"v8n_invalid":"v8n_required";return"avalara"!==r||!a||`avalara-service-url:${a}`},({provider:o="avalara",config:r="{}"})=>"avalara"!==o||!!e(r).id||"avalara-id:v8n_required",({provider:o="avalara",config:r="{}"})=>"avalara"!==o||!!e(r).key||"avalara-key:v8n_required",({provider:o="avalara",config:r="{}"})=>"avalara"!==o||!!e(r).company_code||"avalara-company-code:v8n_required",({provider:o="avalara",config:r="{}"})=>"taxjar"!==o||!!e(r).api_token||"taxjar-api-token:v8n_required",({provider:r="avalara",config:t="{}"})=>{const n=e(t).service_url,a=n?o(n)?null:"v8n_invalid":"v8n_required";return"onesource"!==r||!a||`onesource-service-url:${a}`},({provider:o="avalara",config:r="{}"})=>"onesource"!==o||!!e(r).external_company_id||"onesource-external-company-id:v8n_required",({provider:o="avalara",config:r="{}"})=>"onesource"!==o||!!e(r).calling_system_number||"onesource-calling-system-number:v8n_required",({provider:o="avalara",config:r="{}"})=>"onesource"!==o||!!e(r).from_city||"onesource-from-city:v8n_required",({provider:o="avalara",config:r="{}"})=>"onesource"!==o||!!e(r).host_system||"onesource-host-system:v8n_required",({provider:o="avalara",config:r="{}"})=>{const{service:t,title:n}=e(r);return"webhook"!==o||"json"!==t||!!n||"webhook-json-title:v8n_required"},({provider:o="avalara",config:r="{}"})=>{const{service:t,encryption_key:n}=e(r);return"webhook"!==o||"json"!==t||!!n||"webhook-json-encryption-key:v8n_required"},({provider:r="avalara",config:t="{}"})=>{const{service:n,url:a}=e(t),i=a?o(a)?null:"v8n_invalid":"v8n_required";return"webhook"!==r||"json"!==n||!i||`webhook-json-url:${i}`},({provider:o="avalara",config:r="{}"})=>{const{service:t,title:n}=e(r);return"webhook"!==o||"legacy_xml"!==t||!!n||"webhook-legacy-xml-title:v8n_required"},({provider:r="avalara",config:t="{}"})=>{const{service:n,url:a}=e(t),i=a?o(a)?null:"v8n_invalid":"v8n_required";return"webhook"!==r||"legacy_xml"!==n||!i||`webhook-legacy-xml-url:${i}`},({provider:o="avalara",config:r="{}"})=>"webflow"!==o||!!e(r).site_id||"webflow-site-id:v8n_required",({provider:o="avalara",config:r="{}"})=>"webflow"!==o||!!e(r).site_name||"webflow-site-name:v8n_required",({provider:o="avalara",config:r="{}"})=>"webflow"!==o||!!e(r).collection_id||"webflow-collection-id:v8n_required",({provider:o="avalara",config:r="{}"})=>"webflow"!==o||!!e(r).collection_name||"webflow-collection-name:v8n_required",({provider:o="avalara",config:r="{}"})=>"webflow"!==o||!!e(r).sku_field_id||"webflow-sku-field-id:v8n_required",({provider:o="avalara",config:r="{}"})=>"webflow"!==o||!!e(r).sku_field_name||"webflow-sku-field-name:v8n_required",({provider:o="avalara",config:r="{}"})=>"webflow"!==o||!!e(r).inventory_field_id||"webflow-inventory-field-id:v8n_required",({provider:o="avalara",config:r="{}"})=>"webflow"!==o||!!e(r).inventory_field_name||"webflow-inventory-field-name:v8n_required",({provider:o="avalara",config:r="{}"})=>"webflow"!==o||!!e(r).auth||"webflow-auth:v8n_required"]}get readonlySelector(){const e=[super.readonlySelector.toString()];return this.href&&e.push("apple-pay-group-one","zapier-group-one","provider-group-one"),new n(e.join(" ").trim())}get headerTitleOptions(){return{context:this.data?`existing_${this.data.provider}`:"new",id:this.headerCopyIdValue}}renderBody(){var e,o;const r=null!==(e=this.form.provider)&&void 0!==e?e:"avalara";return l($||($=M` ${0} ${0} ${0} ${0} <foxy-nucleon class="hidden" infer="" href="${0}" id="storeLoader" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),this.href?"":l(k||(k=M` <foxy-internal-summary-control infer="provider-group-one"> <foxy-internal-select-control layout="summary-item" infer="provider" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-select-control> </foxy-internal-summary-control> `),this.__providerGetValue,this.__providerSetValue,this.__templateProviderOptions),"avalara"===r?this.__renderAvalaraConfig():"taxjar"===r?this.__renderTaxJarConfig():"onesource"===r?this.__renderOneSourceConfig():"webflow"===r?this.__renderWebflowConfig():"zapier"===r?this.__renderZapierConfig():"webhook"===r?this.__renderWebhookConfig():"apple_pay"===r?this.__renderApplePayConfig():"custom_tax"===r?this.__renderCustomTaxConfig():"",super.renderBody(),i(null!==(o=this.store)&&void 0!==o?o:void 0),(()=>this.requestUpdate()))}async _fetch(...e){try{return await super._fetch(...e)}catch(e){let o;try{o=(await e.json())._embedded["fx:errors"][0].message}catch(o){throw e}throw o.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 o;const t=this.__config,n=null!==(o=this.form.provider)&&void 0!==o?o:"avalara",a="avalara"===n?g:"taxjar"===n?w:"onesource"===n?v:"webflow"===n?j:"zapier"===n?b:"webhook"===n?"legacy_xml"===(null==t?void 0:t.service)?y:_:void 0,i=a?JSON.parse(a):{},l=JSON.stringify(r(r(r({},i),t),e));this.edit({provider:n,config:l})}__renderAvalaraConfig(){var e,o,r,t,n,a;const s=null===(o=null===(e=this.__storeLoader)||void 0===e?void 0:e.data)||void 0===o?void 0:o.is_active,c=null===(t=null===(r=this.__storeLoader)||void 0===r?void 0:r.data)||void 0===t?void 0:t._links["fx:item_categories"].href,p="boolean"==typeof s?this.t("avalara-group-one.avalara-service-url.placeholder_"+(s?"active":"inactive")):void 0;return l(C||(C=M` <foxy-internal-summary-control infer="avalara-group-one"> <foxy-internal-text-control json-template="${0}" placeholder="${0}" json-path="service_url" property="config" layout="summary-item" infer="avalara-service-url"> </foxy-internal-text-control> <foxy-internal-text-control json-template="${0}" json-path="id" property="config" layout="summary-item" infer="avalara-id"> </foxy-internal-text-control> <foxy-internal-password-control json-template="${0}" json-path="key" property="config" layout="summary-item" infer="avalara-key"> </foxy-internal-password-control> <foxy-internal-text-control json-template="${0}" json-path="company_code" property="config" layout="summary-item" infer="avalara-company-code"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="avalara-group-two"> <foxy-internal-switch-control json-template="${0}" json-path="use_ava_tax" property="config" infer="avalara-use-ava-tax"> </foxy-internal-switch-control> <foxy-internal-switch-control json-template="${0}" json-path="use_address_validation" property="config" infer="avalara-use-address-validation"> </foxy-internal-switch-control> ${0} <foxy-internal-switch-control json-template="${0}" json-path="create_invoice" property="config" infer="avalara-create-invoice"> </foxy-internal-switch-control> <foxy-internal-switch-control json-template="${0}" json-path="enable_colorado_delivery_fee" property="config" infer="avalara-enable-colorado-delivery-fee"> </foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-native-integration-form-code-map-control item-category-base="${0}" item-categories="${0}" json-template="${0}" json-path="category_to_product_tax_code_mappings" property="config" layout="summary-item" infer="avalara-category-to-product-tax-code-mappings"> </foxy-internal-native-integration-form-code-map-control> `),g,i(p),g,g,g,g,g,(null===(n=this.__config)||void 0===n?void 0:n.use_address_validation)?l(S||(S=M` <foxy-internal-editable-list-control json-template="${0}" json-path="address_validation_countries" property="config" layout="summary-item" infer="avalara-address-validation-countries" .options="${0}"> </foxy-internal-editable-list-control> `),g,this.__avalaraAddressValidationCountriesOptions):"",g,g,i(null!==(a=this.itemCategoryBase)&&void 0!==a?a:void 0),i(c),g)}__renderTaxJarConfig(){var e,o,r;const t=null===(o=null===(e=this.__storeLoader)||void 0===e?void 0:e.data)||void 0===o?void 0:o._links["fx:item_categories"].href;return l(O||(O=M` <foxy-internal-summary-control infer="taxjar-group-one"> <foxy-internal-password-control json-template="${0}" json-path="api_token" property="config" layout="summary-item" infer="taxjar-api-token"> </foxy-internal-password-control> <foxy-internal-switch-control json-template="${0}" json-path="create_invoice" property="config" infer="taxjar-create-invoice"> </foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-native-integration-form-code-map-control item-category-base="${0}" item-categories="${0}" json-template="${0}" json-path="category_to_product_tax_code_mappings" property="config" infer="taxjar-category-to-product-tax-code-mappings"> </foxy-internal-native-integration-form-code-map-control> `),w,w,i(null!==(r=this.itemCategoryBase)&&void 0!==r?r:void 0),i(t),w)}__renderOneSourceConfig(){return l(q||(q=M` <foxy-internal-summary-control infer="onesource-group-one"> <foxy-internal-text-control json-template="${0}" json-path="service_url" property="config" layout="summary-item" infer="onesource-service-url"> </foxy-internal-text-control> <foxy-internal-text-control json-template="${0}" json-path="external_company_id" property="config" layout="summary-item" infer="onesource-external-company-id"> </foxy-internal-text-control> <foxy-internal-text-control json-template="${0}" json-path="from_city" property="config" layout="summary-item" infer="onesource-from-city"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="onesource-group-two"> <foxy-internal-text-control json-template="${0}" json-path="calling_system_number" property="config" layout="summary-item" infer="onesource-calling-system-number"> </foxy-internal-text-control> <foxy-internal-text-control json-template="${0}" json-path="host_system" property="config" layout="summary-item" infer="onesource-host-system"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="onesource-group-three"> <foxy-internal-select-control json-template="${0}" json-path="audit_settings" property="config" layout="summary-item" infer="onesource-audit-settings" .options="${0}"> </foxy-internal-select-control> <foxy-internal-select-control json-template="${0}" json-path="company_role" property="config" layout="summary-item" infer="onesource-company-role" .options="${0}"> </foxy-internal-select-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="onesource-group-four"> <foxy-internal-text-control json-template="${0}" json-path="part_number_product_option" property="config" layout="summary-item" infer="onesource-part-number-product-option" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="onesource-group-five"> <foxy-internal-editable-list-control layout="summary-item" infer="onesource-product-order-priority" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> </foxy-internal-summary-control> `),v,v,v,v,v,v,this.__onesourceAuditSettingsOptions,v,this.__onesourceCompanyRoleOptions,v,this.__createConfigGetterFor("part_number_product_option"),this.__createConfigSetterFor("part_number_product_option"),this.__onesourceProductOrderPriorityGetValue,this.__onesourceProductOrderPrioritySetValue)}__renderWebhookConfig(){var e,o;return l(V||(V=M` <div class="flex items-start border border-error rounded" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px);gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} <p> <foxy-i18n infer="webhook-warning" key="warning_text"></foxy-i18n> <br> <a target="_blank" class="mt-xs inline-block rounded font-medium text-error transition-colors cursor-pointer hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50" href="https://admin.foxycart.com"> <foxy-i18n infer="webhook-warning" key="link_text"></foxy-i18n> </a> </p> </div> ${0} `),s(J||(J=M`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="flex-shrink-0 text-error" style="width: 1.25em"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>`)),"json"===(null===(e=this.__config)||void 0===e?void 0:e.service)?this.__renderWebhookJsonConfig():"legacy_xml"===(null===(o=this.__config)||void 0===o?void 0:o.service)?this.__renderWebhookLegacyXmlConfig():"")}__renderWebhookJsonConfig(){return l(B||(B=M` <foxy-internal-summary-control infer="webhook-json-group-one"> <foxy-internal-text-control json-template="${0}" json-path="title" property="config" layout="summary-item" infer="webhook-json-title"> </foxy-internal-text-control> <foxy-internal-text-control json-template="${0}" json-path="url" property="config" layout="summary-item" infer="webhook-json-url"> </foxy-internal-text-control> <foxy-internal-select-control json-template="${0}" json-path="service" property="config" layout="summary-item" infer="webhook-service" .options="${0}"> </foxy-internal-select-control> <foxy-internal-password-control json-template="${0}" json-path="encryption_key" property="config" layout="summary-item" infer="webhook-json-encryption-key"> </foxy-internal-password-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="webhook-json-group-two"> ${0} </foxy-internal-summary-control> `),_,_,_,this.__webhookServiceOptions,_,this.__webhookJsonEventsOptions.map((e=>l(A||(A=M` <foxy-internal-switch-control infer="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> `),`webhook-json-events-${e.value.replace(/\//g,"-")}`,(()=>{var o,r;return null===(r=null===(o=this.__config)||void 0===o?void 0:o.events)||void 0===r?void 0:r.includes(e.value)}),(o=>{var r,t;const n=null!==(t=null===(r=this.__config)||void 0===r?void 0:r.events)&&void 0!==t?t:[];this.__config={events:o?[...n,e.value]:n.filter((o=>o!==e.value))}})))))}__renderWebhookLegacyXmlConfig(){return l(N||(N=M` <foxy-internal-summary-control infer="webhook-legacy-xml-group-one"> <foxy-internal-text-control json-template="${0}" json-path="title" property="config" layout="summary-item" infer="webhook-legacy-xml-title"> </foxy-internal-text-control> <foxy-internal-text-control json-template="${0}" json-path="url" property="config" layout="summary-item" infer="webhook-legacy-xml-url"> </foxy-internal-text-control> <foxy-internal-select-control json-template="${0}" json-path="service" property="config" layout="summary-item" infer="webhook-service" .options="${0}"> </foxy-internal-select-control> </foxy-internal-summary-control> `),y,y,y,this.__webhookServiceOptions)}__renderWebflowConfig(){return l(L||(L=M` <foxy-internal-summary-control infer="webflow-group-one"> <foxy-internal-text-control json-template="${0}" json-path="site_id" property="config" layout="summary-item" infer="webflow-site-id"> </foxy-internal-text-control> <foxy-internal-text-control json-template="${0}" json-path="site_name" property="config" layout="summary-item" infer="webflow-site-name"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="webflow-group-two"> <foxy-internal-text-control json-template="${0}" json-path="collection_id" property="config" layout="summary-item" infer="webflow-collection-id"> </foxy-internal-text-control> <foxy-internal-text-control json-template="${0}" json-path="collection_name" property="config" layout="summary-item" infer="webflow-collection-name"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="webflow-group-three"> <foxy-internal-text-control json-template="${0}" json-path="sku_field_id" property="config" layout="summary-item" infer="webflow-sku-field-id"> </foxy-internal-text-control> <foxy-internal-text-control json-template="${0}" json-path="sku_field_name" property="config" layout="summary-item" infer="webflow-sku-field-name"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="webflow-group-four"> <foxy-internal-text-control json-template="${0}" json-path="inventory_field_id" property="config" layout="summary-item" infer="webflow-inventory-field-id"> </foxy-internal-text-control> <foxy-internal-text-control json-template="${0}" json-path="inventory_field_name" property="config" layout="summary-item" infer="webflow-inventory-field-name"> </foxy-internal-text-control> </foxy-internal-summary-control> `),j,j,j,j,j,j,j,j)}__renderZapierConfig(){return l(P||(P=M` <foxy-internal-summary-control infer="zapier-group-one"> <foxy-internal-text-control json-template="${0}" json-path="url" property="config" layout="summary-item" infer="zapier-url"> </foxy-internal-text-control> <foxy-internal-editable-list-control json-template="${0}" json-path="events" property="config" layout="summary-item" infer="zapier-events" simple-value> </foxy-internal-editable-list-control> <p class="text-secondary leading-xs"> <foxy-i18n infer="zapier-warning" key="warning_text"></foxy-i18n> </p> </foxy-internal-summary-control> `),b,b)}__renderApplePayConfig(){return l(z||(z=M` <foxy-internal-summary-control infer="apple-pay-group-one"> <foxy-internal-text-control json-template="${0}" json-path="merchantID" property="config" layout="summary-item" infer="apple-pay-merchant-id"> </foxy-internal-text-control> <p class="text-secondary leading-xs"> <foxy-i18n infer="apple-pay-warning" key="warning_text"></foxy-i18n> </p> </foxy-internal-summary-control> `),x)}__renderCustomTaxConfig(){return l(G||(G=M` <foxy-internal-summary-control infer="custom-tax-group-one"> <foxy-internal-text-control json-template="${0}" json-path="url" property="config" layout="summary-item" infer="custom-tax-url"> </foxy-internal-text-control> </foxy-internal-summary-control> `),h)}get __storeLoader(){return this.renderRoot.querySelector("#storeLoader")}}customElements.define("foxy-native-integration-form",R);export{R as NativeIntegrationForm};
1
+ import"./shared-eef73355.js";import"./shared-4a4f6eb9.js";import"./shared-511fcf8e.js";import"./shared-5cd33249.js";import"./shared-00e02b35.js";import"./shared-4a32f76a.js";import{a as e,I as o}from"./shared-5b4e2567.js";import"./foxy-nucleon-element.js";import"./shared-653368ea.js";import"./foxy-item-category-card.js";import{_ as r,m as t,B as n}from"./shared-cb58dfcd.js";import{g as a}from"./shared-bab2ea2c.js";import{i}from"./shared-53e42a77.js";import{h as l,s}from"./shared-ba5c42c7.js";import{c}from"./shared-4e709717.js";import{a as p}from"./shared-11351c00.js";import"./shared-d807cb20.js";import"./shared-21e68b72.js";import"./shared-315d7620.js";import"./shared-f9ac8763.js";import"./shared-37348820.js";import"./shared-360d6a20.js";import"./shared-5fd5805c.js";import"./shared-d0aed1c1.js";import"./shared-53e476fd.js";import"./shared-8b25a098.js";import"./shared-8b0f00fa.js";import"./shared-edeeb089.js";import"./shared-f989c70e.js";import"./shared-be442f26.js";import"./shared-8ef0ca65.js";import"./shared-4d32d19e.js";import"./shared-343d1fd7.js";import"./shared-2aa23b5f.js";import"./shared-243456aa.js";import"./shared-3556f4b7.js";import"./shared-7dc9c80b.js";import"./shared-c25538f1.js";import"./shared-c1e86ea4.js";import"./shared-651c44fa.js";import"./shared-1c355fac.js";import"./shared-cf12f33b.js";import"./shared-0aedd809.js";import"./shared-7594e563.js";import"./shared-5212ef4f.js";import"./shared-5afb584d.js";import"./shared-f83207fb.js";import"./shared-5592ec6e.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-5ef40e86.js";import"./shared-e5546d55.js";import"./shared-048d5cae.js";import"./foxy-copy-to-clipboard.js";import"./shared-c18f681b.js";import"./foxy-spinner.js";import"./shared-0098edce.js";import"./shared-6957b8e6.js";import"./foxy-collection-page.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./foxy-pagination.js";import"./shared-0df46275.js";import"./shared-f1a70f51.js";let u,f,d,m=e=>e;customElements.define("foxy-internal-native-integration-form-code-map-control",class extends e{constructor(){super(...arguments),this.itemCategoryBase=null,this.itemCategories=null,this.__newMappingGetValue=()=>{},this.__newMappingSetValue=e=>{const o=a(e);if("string"==typeof o||"number"==typeof o)if(this._value&&o in this._value){const e=this.renderRoot.querySelector(`#category-${o}`);null==e||e.animate([{background:""},{background:"var(--lumo-primary-color-50pct)"},{background:""}],{duration:2e3,easing:"ease"})}else this._value=r(r({},this._value),{},{[o]:""})}}static get properties(){return r(r({},super.properties),{},{itemCategoryBase:{attribute:"item-category-base"},itemCategories:{attribute:"item-categories"}})}renderControl(){var e,o;return l(u||(u=m` <foxy-internal-summary-control infer="existing-mappings" unsafe-helper-text> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control helper-text="" label="" infer="new-mapping" class="mt-s"> <foxy-internal-resource-picker-control layout="summary-item" first="${0}" infer="" item="foxy-item-category-card" .getValue="${0}" .setValue="${0}"> </foxy-internal-resource-picker-control> </foxy-internal-summary-control> `),Object.entries(null!==(e=this._value)&&void 0!==e?e:{}).map((([e,o])=>{var t,n,a,p,u;let y;try{y=new URL(e,null!==(t=this.itemCategoryBase)&&void 0!==t?t:void 0).toString()}catch(e){y=void 0}const _=this.renderRoot.querySelector(`#category${e}Loader`),v=(null==_?void 0:_.in("fail"))?this.t("existing-mappings.status_fail"):(null==_?void 0:_.in("busy"))?this.t("existing-mappings.status_busy"):null;return l(f||(f=m` <div class="flex items-center gap-xs" id="category-${0}"> <foxy-nucleon parent="${0}" class="hidden" infer="" href="${0}" id="category${0}Loader" @update="${0}"> </foxy-nucleon> <foxy-internal-text-control helper-text="" layout="summary-item" label="${0}" infer="" class="flex-1" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <button aria-label="${0}" class="${0}" style="width:1em;height:1em" ?disabled="${0}" ?hidden="${0}" @click="${0}"> ${0} </button> </div> `),e,i(null!==(n=this.itemCategories)&&void 0!==n?n:void 0),i(y),e,(()=>this.requestUpdate()),null!==(u=null!==(p=null===(a=null==_?void 0:_.data)||void 0===a?void 0:a.name)&&void 0!==p?p:v)&&void 0!==u?u:e,(()=>o),(o=>this._value=r(r({},this._value),{},{[e]:o})),this.t("delete"),c({"flex-shrink-0 rounded-full transition-colors":!0,"focus-outline-none focus-ring-2 focus-ring-primary-50":!0,"cursor-pointer text-tertiary hover-text-body":!this.disabled,"cursor-default text-disabled":this.disabled}),this.disabled,this.readonly||!!o,(()=>{const o=r({},this._value);delete o[e],this._value=o}),s(d||(d=m`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1em; height: 1em; transform: translate(0.1em, 0.1em) scale(1.3);"><path fill-rule="evenodd" d="M5 3.25V4H2.75a.75.75 0 0 0 0 1.5h.3l.815 8.15A1.5 1.5 0 0 0 5.357 15h5.285a1.5 1.5 0 0 0 1.493-1.35l.815-8.15h.3a.75.75 0 0 0 0-1.5H11v-.75A2.25 2.25 0 0 0 8.75 1h-1.5A2.25 2.25 0 0 0 5 3.25Zm2.25-.75a.75.75 0 0 0-.75.75V4h3v-.75a.75.75 0 0 0-.75-.75h-1.5ZM6.05 6a.75.75 0 0 1 .787.713l.275 5.5a.75.75 0 0 1-1.498.075l-.275-5.5A.75.75 0 0 1 6.05 6Zm3.9 0a.75.75 0 0 1 .712.787l-.275 5.5a.75.75 0 0 1-1.498-.075l.275-5.5a.75.75 0 0 1 .786-.711Z" clip-rule="evenodd" /> </svg>`)))})),i(null!==(o=this.itemCategories)&&void 0!==o?o:void 0),this.__newMappingGetValue,this.__newMappingSetValue)}get _value(){return super._value}set _value(e){super._value=e}});const y=JSON.stringify({service:"legacy_xml",version:1,events:["transaction/created"],title:"",url:""}),_=JSON.stringify({encryption_key:"",service:"json",version:1,events:[],title:"",url:""}),v=JSON.stringify({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:""}),h=JSON.stringify({url:""}),x=JSON.stringify({merchantID:""}),g=JSON.stringify({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:""}),j=JSON.stringify({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:""}),b=JSON.stringify({service:"zapier",events:[],url:""}),w=JSON.stringify({category_to_product_tax_code_mappings:{},create_invoice:!1,api_token:""});let $,k,C,S,O,q,V,J,B,A,N,L,P,z,G,M=e=>e;const W=p(o,"native-integration-form");class R extends W{constructor(){super(...arguments),this.itemCategoryBase=null,this.store=null,this.__createConfigGetterFor=t((e=>()=>{var o;return null===(o=this.__config)||void 0===o?void 0:o[e]})),this.__createConfigSetterFor=t((e=>o=>this.__config={[e]:o})),this.__providerGetValue=()=>this.form.provider,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"},{value:"custom_tax",label:"option_custom_tax"}],this.__avalaraAddressValidationCountriesOptions=[{value:"US"},{value:"CA"}],this.__onesourceCompanyRoleOptions=[{value:"B",label:"option_buyer"},{value:"M",label:"option_middleman"},{value:"S",label:"option_seller"}],this.__onesourceProductOrderPriorityGetValue=()=>{var e,o;return(null!==(o=null===(e=this.__config)||void 0===e?void 0:e.product_order_priority.split(","))&&void 0!==o?o:[]).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 properties(){return r(r({},super.properties),{},{itemCategoryBase:{attribute:"item-category-base"},store:{}})}static get v8n(){const e=t(JSON.parse),o=t((e=>{try{return Boolean(new URL(e))}catch(e){return!1}}));return[({provider:r="avalara",config:t="{}"})=>{const n=e(t).service_url,a=n?o(n)?null:"v8n_invalid":"v8n_required";return"avalara"!==r||!a||`avalara-service-url:${a}`},({provider:o="avalara",config:r="{}"})=>"avalara"!==o||!!e(r).id||"avalara-id:v8n_required",({provider:o="avalara",config:r="{}"})=>"avalara"!==o||!!e(r).key||"avalara-key:v8n_required",({provider:o="avalara",config:r="{}"})=>"avalara"!==o||!!e(r).company_code||"avalara-company-code:v8n_required",({provider:o="avalara",config:r="{}"})=>"taxjar"!==o||!!e(r).api_token||"taxjar-api-token:v8n_required",({provider:r="avalara",config:t="{}"})=>{const n=e(t).service_url,a=n?o(n)?null:"v8n_invalid":"v8n_required";return"onesource"!==r||!a||`onesource-service-url:${a}`},({provider:o="avalara",config:r="{}"})=>"onesource"!==o||!!e(r).external_company_id||"onesource-external-company-id:v8n_required",({provider:o="avalara",config:r="{}"})=>"onesource"!==o||!!e(r).calling_system_number||"onesource-calling-system-number:v8n_required",({provider:o="avalara",config:r="{}"})=>"onesource"!==o||!!e(r).from_city||"onesource-from-city:v8n_required",({provider:o="avalara",config:r="{}"})=>"onesource"!==o||!!e(r).host_system||"onesource-host-system:v8n_required",({provider:o="avalara",config:r="{}"})=>{const{service:t,title:n}=e(r);return"webhook"!==o||"json"!==t||!!n||"webhook-json-title:v8n_required"},({provider:o="avalara",config:r="{}"})=>{const{service:t,encryption_key:n}=e(r);return"webhook"!==o||"json"!==t||!!n||"webhook-json-encryption-key:v8n_required"},({provider:r="avalara",config:t="{}"})=>{const{service:n,url:a}=e(t),i=a?o(a)?null:"v8n_invalid":"v8n_required";return"webhook"!==r||"json"!==n||!i||`webhook-json-url:${i}`},({provider:o="avalara",config:r="{}"})=>{const{service:t,title:n}=e(r);return"webhook"!==o||"legacy_xml"!==t||!!n||"webhook-legacy-xml-title:v8n_required"},({provider:r="avalara",config:t="{}"})=>{const{service:n,url:a}=e(t),i=a?o(a)?null:"v8n_invalid":"v8n_required";return"webhook"!==r||"legacy_xml"!==n||!i||`webhook-legacy-xml-url:${i}`},({provider:o="avalara",config:r="{}"})=>"webflow"!==o||!!e(r).site_id||"webflow-site-id:v8n_required",({provider:o="avalara",config:r="{}"})=>"webflow"!==o||!!e(r).site_name||"webflow-site-name:v8n_required",({provider:o="avalara",config:r="{}"})=>"webflow"!==o||!!e(r).collection_id||"webflow-collection-id:v8n_required",({provider:o="avalara",config:r="{}"})=>"webflow"!==o||!!e(r).collection_name||"webflow-collection-name:v8n_required",({provider:o="avalara",config:r="{}"})=>"webflow"!==o||!!e(r).sku_field_id||"webflow-sku-field-id:v8n_required",({provider:o="avalara",config:r="{}"})=>"webflow"!==o||!!e(r).sku_field_name||"webflow-sku-field-name:v8n_required",({provider:o="avalara",config:r="{}"})=>"webflow"!==o||!!e(r).inventory_field_id||"webflow-inventory-field-id:v8n_required",({provider:o="avalara",config:r="{}"})=>"webflow"!==o||!!e(r).inventory_field_name||"webflow-inventory-field-name:v8n_required",({provider:o="avalara",config:r="{}"})=>"webflow"!==o||!!e(r).auth||"webflow-auth:v8n_required"]}get readonlySelector(){const e=[super.readonlySelector.toString()];return this.href&&e.push("apple-pay-group-one","zapier-group-one","provider-group-one"),new n(e.join(" ").trim())}get headerTitleOptions(){return{context:this.data?`existing_${this.data.provider}`:"new",id:this.headerCopyIdValue}}renderBody(){var e;const o=this.form.provider;return l($||($=M` ${0} ${0} ${0} ${0} <foxy-nucleon class="hidden" infer="" href="${0}" id="storeLoader" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),this.href?"":l(k||(k=M` <foxy-internal-summary-control infer="provider-group-one"> <foxy-internal-select-control layout="summary-item" infer="provider" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-select-control> </foxy-internal-summary-control> `),this.__providerGetValue,this.__providerSetValue,this.__templateProviderOptions),"avalara"===o?this.__renderAvalaraConfig():"taxjar"===o?this.__renderTaxJarConfig():"onesource"===o?this.__renderOneSourceConfig():"webflow"===o?this.__renderWebflowConfig():"zapier"===o?this.__renderZapierConfig():"webhook"===o?this.__renderWebhookConfig():"apple_pay"===o?this.__renderApplePayConfig():"custom_tax"===o?this.__renderCustomTaxConfig():"",super.renderBody(),i(null!==(e=this.store)&&void 0!==e?e:void 0),(()=>this.requestUpdate()))}async _fetch(...e){try{return await super._fetch(...e)}catch(e){let o;try{o=(await e.json())._embedded["fx:errors"][0].message}catch(o){throw e}throw o.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 o;const t=this.__config,n=null!==(o=this.form.provider)&&void 0!==o?o:"avalara",a="avalara"===n?g:"taxjar"===n?w:"onesource"===n?v:"webflow"===n?j:"zapier"===n?b:"webhook"===n?"legacy_xml"===(null==t?void 0:t.service)?y:_:void 0,i=a?JSON.parse(a):{},l=JSON.stringify(r(r(r({},i),t),e));this.edit({provider:n,config:l})}__renderAvalaraConfig(){var e,o,r,t,n,a;const s=null===(o=null===(e=this.__storeLoader)||void 0===e?void 0:e.data)||void 0===o?void 0:o.is_active,c=null===(t=null===(r=this.__storeLoader)||void 0===r?void 0:r.data)||void 0===t?void 0:t._links["fx:item_categories"].href,p="boolean"==typeof s?this.t("avalara-group-one.avalara-service-url.placeholder_"+(s?"active":"inactive")):void 0;return l(C||(C=M` <foxy-internal-summary-control infer="avalara-group-one"> <foxy-internal-text-control json-template="${0}" placeholder="${0}" json-path="service_url" property="config" layout="summary-item" infer="avalara-service-url"> </foxy-internal-text-control> <foxy-internal-text-control json-template="${0}" json-path="id" property="config" layout="summary-item" infer="avalara-id"> </foxy-internal-text-control> <foxy-internal-password-control json-template="${0}" json-path="key" property="config" layout="summary-item" infer="avalara-key"> </foxy-internal-password-control> <foxy-internal-text-control json-template="${0}" json-path="company_code" property="config" layout="summary-item" infer="avalara-company-code"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="avalara-group-two"> <foxy-internal-switch-control json-template="${0}" json-path="use_ava_tax" property="config" infer="avalara-use-ava-tax"> </foxy-internal-switch-control> <foxy-internal-switch-control json-template="${0}" json-path="use_address_validation" property="config" infer="avalara-use-address-validation"> </foxy-internal-switch-control> ${0} <foxy-internal-switch-control json-template="${0}" json-path="create_invoice" property="config" infer="avalara-create-invoice"> </foxy-internal-switch-control> <foxy-internal-switch-control json-template="${0}" json-path="enable_colorado_delivery_fee" property="config" infer="avalara-enable-colorado-delivery-fee"> </foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-native-integration-form-code-map-control item-category-base="${0}" item-categories="${0}" json-template="${0}" json-path="category_to_product_tax_code_mappings" property="config" layout="summary-item" infer="avalara-category-to-product-tax-code-mappings"> </foxy-internal-native-integration-form-code-map-control> `),g,i(p),g,g,g,g,g,(null===(n=this.__config)||void 0===n?void 0:n.use_address_validation)?l(S||(S=M` <foxy-internal-editable-list-control json-template="${0}" json-path="address_validation_countries" property="config" layout="summary-item" infer="avalara-address-validation-countries" .options="${0}"> </foxy-internal-editable-list-control> `),g,this.__avalaraAddressValidationCountriesOptions):"",g,g,i(null!==(a=this.itemCategoryBase)&&void 0!==a?a:void 0),i(c),g)}__renderTaxJarConfig(){var e,o,r;const t=null===(o=null===(e=this.__storeLoader)||void 0===e?void 0:e.data)||void 0===o?void 0:o._links["fx:item_categories"].href;return l(O||(O=M` <foxy-internal-summary-control infer="taxjar-group-one"> <foxy-internal-password-control json-template="${0}" json-path="api_token" property="config" layout="summary-item" infer="taxjar-api-token"> </foxy-internal-password-control> <foxy-internal-switch-control json-template="${0}" json-path="create_invoice" property="config" infer="taxjar-create-invoice"> </foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-native-integration-form-code-map-control item-category-base="${0}" item-categories="${0}" json-template="${0}" json-path="category_to_product_tax_code_mappings" property="config" infer="taxjar-category-to-product-tax-code-mappings"> </foxy-internal-native-integration-form-code-map-control> `),w,w,i(null!==(r=this.itemCategoryBase)&&void 0!==r?r:void 0),i(t),w)}__renderOneSourceConfig(){return l(q||(q=M` <foxy-internal-summary-control infer="onesource-group-one"> <foxy-internal-text-control json-template="${0}" json-path="service_url" property="config" layout="summary-item" infer="onesource-service-url"> </foxy-internal-text-control> <foxy-internal-text-control json-template="${0}" json-path="external_company_id" property="config" layout="summary-item" infer="onesource-external-company-id"> </foxy-internal-text-control> <foxy-internal-text-control json-template="${0}" json-path="from_city" property="config" layout="summary-item" infer="onesource-from-city"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="onesource-group-two"> <foxy-internal-text-control json-template="${0}" json-path="calling_system_number" property="config" layout="summary-item" infer="onesource-calling-system-number"> </foxy-internal-text-control> <foxy-internal-text-control json-template="${0}" json-path="host_system" property="config" layout="summary-item" infer="onesource-host-system"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="onesource-group-three"> <foxy-internal-select-control json-template="${0}" json-path="audit_settings" property="config" layout="summary-item" infer="onesource-audit-settings" .options="${0}"> </foxy-internal-select-control> <foxy-internal-select-control json-template="${0}" json-path="company_role" property="config" layout="summary-item" infer="onesource-company-role" .options="${0}"> </foxy-internal-select-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="onesource-group-four"> <foxy-internal-text-control json-template="${0}" json-path="part_number_product_option" property="config" layout="summary-item" infer="onesource-part-number-product-option" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="onesource-group-five"> <foxy-internal-editable-list-control layout="summary-item" infer="onesource-product-order-priority" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> </foxy-internal-summary-control> `),v,v,v,v,v,v,this.__onesourceAuditSettingsOptions,v,this.__onesourceCompanyRoleOptions,v,this.__createConfigGetterFor("part_number_product_option"),this.__createConfigSetterFor("part_number_product_option"),this.__onesourceProductOrderPriorityGetValue,this.__onesourceProductOrderPrioritySetValue)}__renderWebhookConfig(){var e,o;return l(V||(V=M` <div class="flex items-start border border-error rounded" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px);gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} <p> <foxy-i18n infer="webhook-warning" key="warning_text"></foxy-i18n> <br> <a target="_blank" class="mt-xs inline-block rounded font-medium text-error transition-colors cursor-pointer hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50" href="https://admin.foxycart.com"> <foxy-i18n infer="webhook-warning" key="link_text"></foxy-i18n> </a> </p> </div> ${0} `),s(J||(J=M`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="flex-shrink-0 text-error" style="width: 1.25em"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>`)),"json"===(null===(e=this.__config)||void 0===e?void 0:e.service)?this.__renderWebhookJsonConfig():"legacy_xml"===(null===(o=this.__config)||void 0===o?void 0:o.service)?this.__renderWebhookLegacyXmlConfig():"")}__renderWebhookJsonConfig(){return l(B||(B=M` <foxy-internal-summary-control infer="webhook-json-group-one"> <foxy-internal-text-control json-template="${0}" json-path="title" property="config" layout="summary-item" infer="webhook-json-title"> </foxy-internal-text-control> <foxy-internal-text-control json-template="${0}" json-path="url" property="config" layout="summary-item" infer="webhook-json-url"> </foxy-internal-text-control> <foxy-internal-select-control json-template="${0}" json-path="service" property="config" layout="summary-item" infer="webhook-service" .options="${0}"> </foxy-internal-select-control> <foxy-internal-password-control json-template="${0}" json-path="encryption_key" property="config" layout="summary-item" infer="webhook-json-encryption-key"> </foxy-internal-password-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="webhook-json-group-two"> ${0} </foxy-internal-summary-control> `),_,_,_,this.__webhookServiceOptions,_,this.__webhookJsonEventsOptions.map((e=>l(A||(A=M` <foxy-internal-switch-control infer="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> `),`webhook-json-events-${e.value.replace(/\//g,"-")}`,(()=>{var o,r;return null===(r=null===(o=this.__config)||void 0===o?void 0:o.events)||void 0===r?void 0:r.includes(e.value)}),(o=>{var r,t;const n=null!==(t=null===(r=this.__config)||void 0===r?void 0:r.events)&&void 0!==t?t:[];this.__config={events:o?[...n,e.value]:n.filter((o=>o!==e.value))}})))))}__renderWebhookLegacyXmlConfig(){return l(N||(N=M` <foxy-internal-summary-control infer="webhook-legacy-xml-group-one"> <foxy-internal-text-control json-template="${0}" json-path="title" property="config" layout="summary-item" infer="webhook-legacy-xml-title"> </foxy-internal-text-control> <foxy-internal-text-control json-template="${0}" json-path="url" property="config" layout="summary-item" infer="webhook-legacy-xml-url"> </foxy-internal-text-control> <foxy-internal-select-control json-template="${0}" json-path="service" property="config" layout="summary-item" infer="webhook-service" .options="${0}"> </foxy-internal-select-control> </foxy-internal-summary-control> `),y,y,y,this.__webhookServiceOptions)}__renderWebflowConfig(){return l(L||(L=M` <foxy-internal-summary-control infer="webflow-group-one"> <foxy-internal-text-control json-template="${0}" json-path="site_id" property="config" layout="summary-item" infer="webflow-site-id"> </foxy-internal-text-control> <foxy-internal-text-control json-template="${0}" json-path="site_name" property="config" layout="summary-item" infer="webflow-site-name"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="webflow-group-two"> <foxy-internal-text-control json-template="${0}" json-path="collection_id" property="config" layout="summary-item" infer="webflow-collection-id"> </foxy-internal-text-control> <foxy-internal-text-control json-template="${0}" json-path="collection_name" property="config" layout="summary-item" infer="webflow-collection-name"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="webflow-group-three"> <foxy-internal-text-control json-template="${0}" json-path="sku_field_id" property="config" layout="summary-item" infer="webflow-sku-field-id"> </foxy-internal-text-control> <foxy-internal-text-control json-template="${0}" json-path="sku_field_name" property="config" layout="summary-item" infer="webflow-sku-field-name"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="webflow-group-four"> <foxy-internal-text-control json-template="${0}" json-path="inventory_field_id" property="config" layout="summary-item" infer="webflow-inventory-field-id"> </foxy-internal-text-control> <foxy-internal-text-control json-template="${0}" json-path="inventory_field_name" property="config" layout="summary-item" infer="webflow-inventory-field-name"> </foxy-internal-text-control> </foxy-internal-summary-control> `),j,j,j,j,j,j,j,j)}__renderZapierConfig(){return l(P||(P=M` <foxy-internal-summary-control infer="zapier-group-one"> <foxy-internal-text-control json-template="${0}" json-path="url" property="config" layout="summary-item" infer="zapier-url"> </foxy-internal-text-control> <foxy-internal-editable-list-control json-template="${0}" json-path="events" property="config" layout="summary-item" infer="zapier-events" simple-value> </foxy-internal-editable-list-control> <p class="text-secondary leading-xs"> <foxy-i18n infer="zapier-warning" key="warning_text"></foxy-i18n> </p> </foxy-internal-summary-control> `),b,b)}__renderApplePayConfig(){return l(z||(z=M` <foxy-internal-summary-control infer="apple-pay-group-one"> <foxy-internal-text-control json-template="${0}" json-path="merchantID" property="config" layout="summary-item" infer="apple-pay-merchant-id"> </foxy-internal-text-control> <p class="text-secondary leading-xs"> <foxy-i18n infer="apple-pay-warning" key="warning_text"></foxy-i18n> </p> </foxy-internal-summary-control> `),x)}__renderCustomTaxConfig(){return l(G||(G=M` <foxy-internal-summary-control infer="custom-tax-group-one"> <foxy-internal-text-control json-template="${0}" json-path="url" property="config" layout="summary-item" infer="custom-tax-url"> </foxy-internal-text-control> </foxy-internal-summary-control> `),h)}get __storeLoader(){return this.renderRoot.querySelector("#storeLoader")}}customElements.define("foxy-native-integration-form",R);export{R as NativeIntegrationForm};
@@ -1 +1 @@
1
- import"./shared-eef73355.js";import"./shared-511fcf8e.js";import"./shared-00e02b35.js";import"./shared-5cd33249.js";import"./shared-3a952968.js";import"./shared-4a32f76a.js";import{a as e,I as t}from"./shared-5b4e2567.js";import"./foxy-nucleon-element.js";import"./shared-4d32d19e.js";import{l as o}from"./shared-cf613436.js";import{c as n}from"./shared-4e709717.js";import{h as i,s}from"./shared-ba5c42c7.js";import{_ as r,B as a}from"./shared-cb58dfcd.js";import{C as l}from"./shared-5afb584d.js";import{N as c}from"./shared-f83207fb.js";import{T as u,a as d,R as p}from"./shared-11351c00.js";import{i as f}from"./shared-53e42a77.js";import"./shared-d807cb20.js";import"./shared-21e68b72.js";import"./shared-315d7620.js";import"./shared-f9ac8763.js";import"./shared-37348820.js";import"./shared-360d6a20.js";import"./shared-5fd5805c.js";import"./shared-d0aed1c1.js";import"./shared-53e476fd.js";import"./shared-243456aa.js";import"./shared-3556f4b7.js";import"./shared-7dc9c80b.js";import"./shared-c25538f1.js";import"./shared-c1e86ea4.js";import"./shared-8b0f00fa.js";import"./shared-651c44fa.js";import"./shared-be442f26.js";import"./shared-edeeb089.js";import"./shared-f989c70e.js";import"./shared-8ef0ca65.js";import"./shared-1c355fac.js";import"./shared-cf12f33b.js";import"./shared-0aedd809.js";import"./shared-7594e563.js";import"./shared-5212ef4f.js";import"./shared-2aa23b5f.js";import"./shared-e5546d55.js";import"./shared-048d5cae.js";import"./shared-5592ec6e.js";import"./shared-343d1fd7.js";import"./foxy-copy-to-clipboard.js";import"./shared-c18f681b.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-5ef40e86.js";let _,h,y=e=>e;customElements.define("foxy-internal-template-config-form-supported-cards-control",class extends e{renderControl(){const e={amex:"American Express",diners:"Diners Club",discover:"Discover",jcb:"JCB",maestro:"Maestro",mastercard:"Mastercard",unionpay:"UnionPay",visa:"Visa"};return i(_||(_=y` <div class="flex flex-wrap -m-xs"> ${0} </div> `),Object.entries(o).map((([t,o])=>{if(!e[t])return;const s=this._value.includes(t);return i(h||(h=y` <div data-testid="${0}" class="${0}"> <label class="${0}"> <div class="h-s">${0}</div> <div class="text-s font-medium mx-s my-auto leading-none">${0}</div> <input type="checkbox" class="sr-only" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> </label> </div> `),t,n({"m-xs rounded":!0,"opacity-50 cursor-default":this.disabled,"cursor-pointer ring-primary-50 focus-within-ring-2":!this.disabled}),n({"overflow-hidden transition-colors flex rounded-s border":!0,"border-primary bg-primary-10 text-primary":s&&!this.readonly,"border-contrast bg-contrast-5 text-secondary":s&&this.readonly,"hover-text-body":s&&!this.disabled&&!this.readonly,"border-contrast-10":!s,"hover-border-primary":!s&&!this.disabled&&!this.readonly,"hover-text-primary":!s&&!this.disabled&&!this.readonly}),o,e[t],this.disabled,this.readonly,s,(e=>{if(this.readonly)return e.preventDefault();e.stopPropagation();const o=[...this._value];e.currentTarget.checked?o.push(t):o.splice(o.indexOf(t),1),this._value=o}))})))}get _value(){var e;return null!==(e=super._value)&&void 0!==e?e:[]}set _value(e){super._value=e}});let g,m,b,x,v,j,w=e=>e;const $=l(u(d(c)));let k,S,O,J,N,q,C=e=>e;customElements.define("foxy-internal-template-config-form-filter-values-control-item",class extends ${constructor(){super(...arguments),this.regions=[],this.name="",this.code="",this.__newRegion=""}static get properties(){return r(r({},super.properties),{},{__newRegion:{attribute:!1},regions:{type:Array},name:{type:String},code:{type:String}})}render(){var e,t;const o=Object.values(null!==(t=null===(e=this.data)||void 0===e?void 0:e.values)&&void 0!==t?t:{}),s=o.filter((e=>!this.regions.includes(e.code)));return i(g||(g=w` <div class="${0}"> <div data-testid="country" class="h-m flex justify-between items-center bg-contrast-5"> <div style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> <span>${0}</span> </div> <button aria-label="${0}" class="${0}" style="width:calc(var(--lumo-size-s) - 2px);height:calc(var(--lumo-size-s) - 2px)" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:close" class="icon-inline text-m"></iron-icon> </button> </div> <div data-testid="regions" class="flex flex-wrap p-xs text-s"> ${0} ${0} </div> </div> `),n({"border border-contrast-5 rounded-s font-medium overflow-hidden":!0,"text-disabled":this.disabled}),this.name||this.code,this.t("delete"),n({"mr-xs items-center justify-center rounded-full transition-colors":!0,"hover-bg-error-10 hover-text-error":!this.disabled,"focus-outline-none focus-ring-2 ring-inset ring-error-50":!this.disabled,"cursor-default":this.disabled,flex:!this.readonly,hidden:this.readonly}),this.disabled,(()=>this.dispatchEvent(new CustomEvent("delete"))),this.regions.map((e=>{var t,o;const s=null===(o=null===(t=this.data)||void 0===t?void 0:t.values[e])||void 0===o?void 0:o.default;return i(m||(m=w` <div class="flex items-center rounded-s border border-contrast-10 h-s m-xs"> <span class="mx-s">${0}</span> <button aria-label="${0}" class="${0}" style="width:calc(var(--lumo-size-s) - 2px);height:calc(var(--lumo-size-s) - 2px)" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:close" class="icon-inline text-m"></iron-icon> </button> </div> `),s||e,this.t("delete"),n({"items-center justify-center rounded-s transition-colors":!0,"hover-bg-error-10 hover-text-error":!this.disabled,"focus-outline-none focus-ring-2 ring-inset ring-primary-50":!this.disabled,"cursor-default":this.disabled,flex:!this.readonly,hidden:this.readonly}),this.disabled,(()=>{this.regions=this.regions.filter((t=>t!==e)),this.dispatchEvent(new CustomEvent("update:regions"))}))})),0===s.length&&0!==o.length?"":i(b||(b=w` <div data-testid="new-region" class="${0}"> ${0} </div> `),n({"h-s m-xs items-center transition-colors border border-contrast-10 rounded-s":!0,"focus-within-ring-1 ring-primary-50 focus-within-border-primary-50":!this.disabled,flex:!this.readonly,hidden:this.readonly}),0===o.length?i(x||(x=w` <input placeholder="${0}" class="bg-transparent appearance-none h-s text-s px-s font-medium focus-outline-none" style="width:8rem" .value="${0}" ?disabled="${0}" ?readonly="${0}" @keydown="${0}" @input="${0}"> <button style="width:calc(var(--lumo-size-s) - 2px);height:calc(var(--lumo-size-s) - 2px)" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:add" class="icon-inline text-m"></iron-icon> </button> `),this.t("add_region"),this.__newRegion,this.disabled,this.readonly,(e=>{"Enter"===e.key&&this.__newRegion&&this.__addRegion()}),(e=>{const t=e.currentTarget;this.__newRegion=t.value}),n({"flex-shrink-0":!0,"flex items-center justify-center rounded-s transition-colors":!0,"text-transparent cursor-default":!this.__newRegion,"bg-contrast-5 text-body cursor-pointer":!!this.__newRegion,"hover-bg-success hover-text-success-contrast":!!this.__newRegion,"focus-outline-none focus-ring-2 ring-inset ring-primary-50":!!this.__newRegion}),this.disabled||!this.__newRegion,this.__addRegion):i(v||(v=w` <select class="${0}" ?disabled="${0}" @change="${0}"> <option value="" disabled="disabled" selected="selected">${0}</option> ${0} </select> `),n({"appearance-none bg-transparent h-s text-s px-s font-medium":!0,"transition-colors rounded-s focus-outline-none":!0,"cursor-pointer hover-bg-contrast-5":!this.disabled}),this.disabled,(e=>{const t=e.currentTarget;this.__newRegion=t.value,this.__addRegion(),t.value=""}),this.t("add_region"),s.map((e=>i(j||(j=w`<option value="${0}">${0}</option>`),e.code,e.default))))))}__addRegion(){this.regions=[...new Set([...this.regions,this.__newRegion])],this.__newRegion="",this.dispatchEvent(new CustomEvent("update:regions"))}}),customElements.define("foxy-internal-template-config-form-filter-values-control",class extends e{constructor(){super(...arguments),this.countries=null,this.regions=null,this.__newCountry=""}static get properties(){return r(r({},super.properties),{},{__newCountry:{attribute:!1},countries:{},regions:{}})}renderControl(){var e,t,o,s;const a=Object.values(null!==(o=null===(t=null===(e=this.__countriesLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t.values)&&void 0!==o?o:{}),l=a.filter((e=>!(e.cc2 in this._value)));return i(k||(k=C` <div class="space-y-s" data-testid="countries"> ${0} ${0} </div> <foxy-nucleon infer="" href="${0}" id="countriesLoader" @update="${0}"> </foxy-nucleon> `),Object.entries(this._value).map((([e,t])=>{var o,n;let s;try{const t=new URL(null!==(o=this.regions)&&void 0!==o?o:"");t.searchParams.set("country_code",e),s=t.toString()}catch(e){s=""}return i(S||(S=C` <foxy-internal-template-config-form-filter-values-control-item regions="${0}" infer="" code="${0}" name="${0}" href="${0}" ?disabled="${0}" ?readonly="${0}" @update:regions="${0}" @delete="${0}"> </foxy-internal-template-config-form-filter-values-control-item> `),JSON.stringify("*"===t?[]:t),e,f(null===(n=a.find((t=>t.cc2===e)))||void 0===n?void 0:n.default),s,this.disabled,this.readonly,(t=>{const o=r({},this._value),n=t.currentTarget.regions;o[e]=n.length?n:"*",this._value=o}),(()=>{const t=r({},this._value);delete t[e],this._value=t}))})),0===l.length&&0!==a.length?"":i(O||(O=C` <div data-testid="new-country" class="${0}"> ${0} </div> `),n({"h-m flex items-center rounded-s transition-colors":!0,"border border-contrast-10 ring-primary-50":!0,"focus-within-ring-1 focus-within-border-primary-50":!this.disabled,flex:!this.readonly,hidden:this.readonly}),0===a.length?i(J||(J=C` <input placeholder="${0}" class="w-full bg-transparent font-medium appearance-none h-m focus-outline-none" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" .value="${0}" ?disabled="${0}" ?readonly="${0}" @keydown="${0}" @input="${0}"> <button aria-label="${0}" class="${0}" style="width:calc(var(--lumo-size-s) - 2px);height:calc(var(--lumo-size-s) - 2px)" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:add" class="icon-inline text-m"></iron-icon> </button> `),this.t("add_country"),this.__newCountry,this.disabled,this.readonly,(e=>{"Enter"===e.key&&this.__newCountry&&this.__addCountry()}),(e=>{const t=e.currentTarget;this.__newCountry=t.value}),this.t("create"),n({"mr-xs flex-shrink-0":!0,"flex items-center justify-center rounded-s transition-colors":!0,"text-transparent cursor-default":!this.__newCountry,"bg-contrast-5 text-body cursor-pointer":!!this.__newCountry,"hover-bg-success hover-text-success-contrast":!!this.__newCountry,"focus-outline-none focus-ring-2 ring-inset ring-primary-50":!!this.__newCountry}),!this.__newCountry||this.disabled,this.__addCountry):i(N||(N=C` <select class="${0}" ?disabled="${0}" @change="${0}"> <option value="" disabled="disabled" selected="selected">${0}</option> ${0} </select> `),n({"appearance-none bg-transparent h-m text-m px-s flex-1 font-medium":!0,"transition-colors rounded-s focus-outline-none":!0,"cursor-pointer hover-bg-contrast-5":!this.disabled,"text-disabled":this.disabled}),this.disabled,(e=>{const t=e.currentTarget;this.__newCountry=t.value,this.__addCountry(),t.value=""}),this.t("add_country"),l.map((e=>i(q||(q=C`<option value="${0}">${0}</option>`),e.cc2,e.default))))),f(null!==(s=this.countries)&&void 0!==s?s:void 0),(()=>this.requestUpdate()))}__addCountry(){this._value=r(r({},this._value),{},{[this.__newCountry]:"*"}),this.__newCountry=""}get __countriesLoader(){return this.renderRoot.querySelector("#countriesLoader")}get _value(){var e;return null!==(e=super._value)&&void 0!==e?e:{}}set _value(e){super._value=e}});let F,R,V,T,z,E,D,A,L=e=>e;const U=p(d(t,"template-config-form"));class B extends U{constructor(){super(...arguments),this.countries=null,this.regions=null,this.store=null,this.__customCheckoutFieldCouponEntryRequirementsOptions=JSON.stringify([{label:"option_enabled",value:"enabled"},{label:"option_disabled",value:"disabled"}]),this.__customCheckoutFieldRequirementsOptions=JSON.stringify([{label:"option_default",value:"default"},{label:"option_optional",value:"optional"},{label:"option_required",value:"required"},{label:"option_hidden",value:"hidden"}]),this.__tosCheckboxSettingsInitialStateOptions=JSON.stringify([{label:"option_checked",value:"checked"},{label:"option_unchecked",value:"unchecked"}]),this.__locationFilteringFilterTypeOptions=JSON.stringify([{label:"option_blocklist",value:"blacklist"},{label:"option_allowlist",value:"whitelist"}]),this.__foxycompleteShowComboboxOptions=JSON.stringify([{label:"option_combobox",value:"combobox"},{label:"option_search",value:"search"}]),this.__tosCheckboxSettingsUsageOptions=JSON.stringify([{label:"option_none",value:"none"},{label:"option_optional",value:"optional"},{label:"option_required",value:"required"}]),this.__locationFilteringUsageOptions=JSON.stringify([{label:"option_none",value:"none"},{label:"option_shipping",value:"shipping"},{label:"option_billing",value:"billing"},{label:"option_both",value:"both"},{label:"option_independent",value:"independent"}]),this.__cscRequirementsValueOptions=JSON.stringify([{label:"option_all_cards",value:"all_cards"},{label:"option_sso_only",value:"sso_only"},{label:"option_new_cards_only",value:"new_cards_only"}]),this.__checkoutTypeDefaultOptions=JSON.stringify([{label:"option_default_account",value:"default_account"},{label:"option_default_guest",value:"default_guest"}]),this.__checkoutTypeAccountOptions=JSON.stringify([{label:"option_account",value:"account_only"},{label:"option_guest",value:"guest_only"},{label:"option_both",value:"default_guest"}]),this.__cartTypeOptions=JSON.stringify([{label:"option_default",value:"default"},{label:"option_fullpage",value:"fullpage"},{label:"option_custom",value:"custom"}]),this.__locationFilteringFilterValuesSetValue=e=>{const t=this.__formJson,o=r(r({},t.location_filtering),{},{shipping_filter_values:e,billing_filter_values:e});this.edit({json:JSON.stringify(r(r({},t),{},{location_filtering:o}))})},this.__locationFilteringFilterTypeSetValue=e=>{const t=this.__formJson,o=r(r({},t.location_filtering),{},{shipping_filter_type:e,billing_filter_type:e});this.edit({json:JSON.stringify(r(r({},t),{},{location_filtering:o}))})},this.__foxycompleteShowComboboxGetValue=()=>this.__formJson.foxycomplete.show_combobox?"combobox":"search",this.__foxycompleteShowComboboxSetValue=e=>{const t="combobox"===e,o=r(r({},this.__formJson.foxycomplete),{},{show_combobox:t});this.edit({json:JSON.stringify(r(r({},this.__formJson),{},{foxycomplete:o}))})},this.__checkoutTypeAccountGetValue=()=>{const e=this.__formJson;return e.checkout_type.includes("default")?"default_guest":e.checkout_type},this.__customConfigGetValue=()=>{const e=this.__formJson;return"string"==typeof e.custom_config?e.custom_config:JSON.stringify(e.custom_config,null,2)},this.__customConfigSetValue=e=>{const t=this.__formJson;try{t.custom_config=JSON.parse(e)}catch(o){t.custom_config=e}this.edit({json:JSON.stringify(t)})},this.__defaultJSON=JSON.stringify({cart_type:"default",checkout_type:"default_account",csc_requirements:"all_cards",tos_checkbox_settings:{usage:"none",initial_state:"unchecked",is_hidden:!1,url:""},eu_secure_data_transfer_consent:{usage:"required"},newsletter_subscribe:{usage:"none"},analytics_config:{usage:"none",google_analytics:{usage:"none",account_id:"",include_on_site:!1},google_tag:{usage:"none",send_to:"",account_id:""}},colors:{usage:"none",primary:"4D4D4D",secondary:"FFFFFF",tertiary:"FFFFFF"},use_checkout_confirmation_window:{usage:"none"},supported_payment_cards:["visa","mastercard","discover","amex"],custom_checkout_field_requirements:{cart_controls:"enabled",coupon_entry:"enabled",billing_first_name:"required",billing_last_name:"required",billing_company:"optional",billing_tax_id:"hidden",billing_phone:"optional",billing_address1:"required",billing_address2:"optional",billing_city:"required",billing_region:"default",billing_postal_code:"required",billing_country:"required"},cart_display_config:{usage:"none",show_product_weight:!0,show_product_category:!0,show_product_code:!0,show_product_options:!0,show_sub_frequency:!0,show_sub_startdate:!0,show_sub_nextdate:!0,show_sub_enddate:!0,hidden_product_options:[]},foxycomplete:{usage:"required",show_combobox:!0,combobox_open:"\\u25bc",combobox_close:"\\u25b2",show_flags:!0},custom_script_values:{header:"",footer:"",checkout_fields:"",multiship_checkout_fields:""},http_receipt:!1,custom_config:"",debug:{usage:"none"},location_filtering:{usage:"none",shipping_filter_type:"blacklist",billing_filter_type:"blacklist",shipping_filter_values:{},billing_filter_values:{}},postal_code_lookup:{usage:"enabled"}})}static get properties(){return r(r({},super.properties),{},{countries:{},regions:{},store:{}})}get hiddenSelector(){var e,t;const o=[super.hiddenSelector.toString()],n=this.__dataJson,i=this.__formJson,s=i.location_filtering.usage,r=i.checkout_type;return"required"!==i.cart_display_config.usage&&o.unshift("cart-group-two","cart-group-three","cart-group-four"),"required"!==i.foxycomplete.usage&&o.unshift("country-and-region-group-one:foxycomplete-show-combobox","country-and-region-group-one:foxycomplete-combobox-open","country-and-region-group-one:foxycomplete-combobox-close","country-and-region-group-one:foxycomplete-show-flags"),!1===i.foxycomplete.show_combobox&&o.unshift("country-and-region-group-one:foxycomplete-combobox-open","country-and-region-group-one:foxycomplete-combobox-close"),"both"!==s&&o.unshift("country-and-region-group-two"),"shipping"!==s&&"independent"!==s&&o.unshift("country-and-region-group-three"),"billing"!==s&&"independent"!==s&&o.unshift("country-and-region-group-four"),"default_account"!==r&&"default_guest"!==r&&o.unshift("customer-accounts:checkout-type-default"),"none"===i.tos_checkbox_settings.usage&&o.unshift("consent-group-one:tos-checkbox-settings-url","consent-group-one:tos-checkbox-settings-initial-state","consent-group-one:tos-checkbox-settings-is-hidden"),"required"!==i.analytics_config.usage&&o.unshift("analytics-config-google-analytics","analytics-config-google-tag"),"required"!==(null==n?void 0:n.analytics_config.google_analytics.usage)&&o.unshift("analytics-config-google-analytics"),"required"!==i.analytics_config.google_analytics.usage&&o.unshift("analytics-config-google-analytics:analytics-config-google-analytics-account-id","analytics-config-google-analytics:analytics-config-google-analytics-include-on-site"),"required"!==i.analytics_config.google_tag.usage&&(o.unshift("analytics-config-google-tag:analytics-config-google-tag-account-id"),o.unshift("analytics-config-google-tag:analytics-config-google-tag-send-to")),!0!==(null===(t=null===(e=this.__storeLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t.features_multiship)&&o.unshift("custom-script-values-multiship-checkout-fields"),new a(o.join(" ").trim())}renderBody(){var e,t,o,n,r,a,l,c;const u=[["billing_address1","billing_address2","billing_city","billing_region","billing_postal_code","billing_country"],["billing_first_name","billing_last_name","billing_company","billing_tax_id","billing_phone","coupon_entry"]],d=[["show_product_weight","show_product_category","show_product_code","show_product_options"],["show_sub_frequency","show_sub_startdate","show_sub_nextdate","show_sub_enddate"]];return i(F||(F=L` ${0} <foxy-internal-summary-control infer="cart-group-one"> <foxy-internal-select-control json-template="${0}" json-path="cart_type" property="json" options="${0}" layout="summary-item" infer="cart-type"> </foxy-internal-select-control> <foxy-internal-switch-control json-template="${0}" false-alias="none" true-alias="required" json-path="cart_display_config.usage" property="json" infer="cart-display-config-usage" invert> </foxy-internal-switch-control> </foxy-internal-summary-control> <div class="grid sm-grid-cols-2 gap-m" ?hidden="${0}"> ${0} </div> <foxy-internal-summary-control infer="cart-group-four"> <foxy-internal-editable-list-control json-template="${0}" json-path="cart_display_config.hidden_product_options" property="json" layout="summary-item" infer="cart-display-config-hidden-product-options" simple-value> </foxy-internal-editable-list-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="country-and-region-group-one"> <foxy-internal-switch-control json-template="${0}" false-alias="none" true-alias="required" json-path="foxycomplete.usage" property="json" infer="foxycomplete-usage"> </foxy-internal-switch-control> <foxy-internal-select-control options="${0}" layout="summary-item" infer="foxycomplete-show-combobox" .getValue="${0}" .setValue="${0}"> </foxy-internal-select-control> <foxy-internal-text-control json-template="${0}" json-path="foxycomplete.combobox_open" property="json" layout="summary-item" infer="foxycomplete-combobox-open"> </foxy-internal-text-control> <foxy-internal-text-control json-template="${0}" json-path="foxycomplete.combobox_close" property="json" layout="summary-item" infer="foxycomplete-combobox-close"> </foxy-internal-text-control> <foxy-internal-switch-control json-template="${0}" json-path="foxycomplete.show_flags" property="json" infer="foxycomplete-show-flags"> </foxy-internal-switch-control> <foxy-internal-switch-control json-template="${0}" false-alias="none" true-alias="enabled" json-path="postal_code_lookup.usage" property="json" infer="postal-code-lookup"> </foxy-internal-switch-control> <foxy-internal-select-control json-template="${0}" json-path="location_filtering.usage" property="json" options="${0}" layout="summary-item" infer="location-filtering-usage"> </foxy-internal-select-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="country-and-region-group-two"> <foxy-internal-select-control json-template="${0}" json-path="location_filtering.shipping_filter_type" property="json" options="${0}" layout="summary-item" infer="location-filtering-filter-type" .setValue="${0}"> </foxy-internal-select-control> <foxy-internal-template-config-form-filter-values-control json-template="${0}" json-path="location_filtering.shipping_filter_values" countries="${0}" property="json" regions="${0}" infer="location-filtering-filter-values" .setValue="${0}"> </foxy-internal-template-config-form-filter-values-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="country-and-region-group-three"> <foxy-internal-select-control json-template="${0}" json-path="location_filtering.shipping_filter_type" property="json" options="${0}" layout="summary-item" infer="location-filtering-shipping-filter-type"> </foxy-internal-select-control> <foxy-internal-template-config-form-filter-values-control json-template="${0}" json-path="location_filtering.shipping_filter_values" countries="${0}" property="json" regions="${0}" infer="location-filtering-shipping-filter-values"> </foxy-internal-template-config-form-filter-values-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="country-and-region-group-four"> <foxy-internal-select-control json-template="${0}" json-path="location_filtering.billing_filter_type" property="json" options="${0}" layout="summary-item" infer="location-filtering-billing-filter-type"> </foxy-internal-select-control> <foxy-internal-template-config-form-filter-values-control json-template="${0}" json-path="location_filtering.billing_filter_values" countries="${0}" property="json" regions="${0}" infer="location-filtering-billing-filter-values"> </foxy-internal-template-config-form-filter-values-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="customer-accounts"> <foxy-internal-select-control json-template="${0}" json-path="checkout_type" property="json" options="${0}" layout="summary-item" infer="checkout-type-account" .getValue="${0}"> </foxy-internal-select-control> <foxy-internal-select-control json-template="${0}" json-path="checkout_type" property="json" options="${0}" layout="summary-item" infer="checkout-type-default"> </foxy-internal-select-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="consent-group-one"> <foxy-internal-select-control json-template="${0}" json-path="tos_checkbox_settings.usage" property="json" options="${0}" layout="summary-item" infer="tos-checkbox-settings-usage"> </foxy-internal-select-control> <foxy-internal-text-control json-template="${0}" json-path="tos_checkbox_settings.url" property="json" layout="summary-item" infer="tos-checkbox-settings-url"> </foxy-internal-text-control> <foxy-internal-select-control json-template="${0}" json-path="tos_checkbox_settings.initial_state" property="json" options="${0}" layout="summary-item" infer="tos-checkbox-settings-initial-state"> </foxy-internal-select-control> <foxy-internal-switch-control json-template="${0}" json-path="tos_checkbox_settings.is_hidden" property="json" infer="tos-checkbox-settings-is-hidden"> </foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="consent-group-two"> <foxy-internal-switch-control json-template="${0}" false-alias="none" true-alias="required" json-path="eu_secure_data_transfer_consent.usage" property="json" infer="eu-secure-data-transfer-consent-usage"> </foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="consent-group-three"> <foxy-internal-switch-control json-template="${0}" false-alias="none" true-alias="required" json-path="newsletter_subscribe.usage" property="json" infer="newsletter-subscribe-usage"> </foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="supported-cards-group"> <foxy-internal-template-config-form-supported-cards-control json-template="${0}" json-path="supported_payment_cards" property="json" infer="supported-payment-cards"> </foxy-internal-template-config-form-supported-cards-control> <p class="flex items-start gap-s"> ${0} <foxy-i18n infer="" key="disclaimer"></foxy-i18n> </p> </foxy-internal-summary-control> <foxy-internal-summary-control infer="csc-requirements-group"> <foxy-internal-select-control json-template="${0}" json-path="csc_requirements" property="json" options="${0}" layout="summary-item" infer="csc-requirements"> </foxy-internal-select-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="checkout-fields-group-one"> <foxy-internal-switch-control json-template="${0}" false-alias="disabled" true-alias="enabled" json-path="custom_checkout_field_requirements.cart_controls" property="json" infer="custom-checkout-field-requirements-cart-controls"> </foxy-internal-switch-control> </foxy-internal-summary-control> <div class="grid sm-grid-cols-2 gap-m" ?hidden="${0}"> ${0} </div> <foxy-internal-summary-control infer="analytics-config"> <foxy-internal-switch-control json-template="${0}" false-alias="none" true-alias="required" json-path="analytics_config.usage" property="json" infer="analytics-config-usage"> </foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="analytics-config-google-analytics"> <foxy-internal-switch-control json-template="${0}" false-alias="none" true-alias="required" json-path="analytics_config.google_analytics.usage" property="json" infer="analytics-config-google-analytics-usage"> </foxy-internal-switch-control> <foxy-internal-text-control json-template="${0}" json-path="analytics_config.google_analytics.account_id" property="json" layout="summary-item" infer="analytics-config-google-analytics-account-id"> </foxy-internal-text-control> <foxy-internal-switch-control json-template="${0}" json-path="analytics_config.google_analytics.include_on_site" property="json" infer="analytics-config-google-analytics-include-on-site"> </foxy-internal-switch-control> <p class="flex items-start gap-s bg-error-10 text-error"> ${0} <foxy-i18n infer="" key="deprecation_notice"></foxy-i18n> </p> </foxy-internal-summary-control> <foxy-internal-summary-control infer="analytics-config-google-tag"> <foxy-internal-switch-control json-template="${0}" false-alias="none" true-alias="required" json-path="analytics_config.google_tag.usage" property="json" infer="analytics-config-google-tag-usage"> </foxy-internal-switch-control> <foxy-internal-text-control json-template="${0}" json-path="analytics_config.google_tag.account_id" property="json" layout="summary-item" infer="analytics-config-google-tag-account-id"> </foxy-internal-text-control> <foxy-internal-text-control json-template="${0}" json-path="analytics_config.google_tag.send_to" property="json" layout="summary-item" infer="analytics-config-google-tag-send-to"> </foxy-internal-text-control> <p class="flex items-start gap-s"> ${0} <span> <foxy-i18n infer="" key="usage_notice"></foxy-i18n> <br> <a target="_blank" class="cursor-pointer group text-primary rounded-s font-medium focus-outline-none focus-ring-2 focus-ring-primary-50" href="https://wiki.foxycart.com/v/2.0/analytics#google_tag_ga4_google_ads" rel="nofollow noreferrer noopener"> <foxy-i18n class="transition-opacity group-hover-opacity-80" infer="" key="docs_link"> </foxy-i18n> </a> </span> </p> </foxy-internal-summary-control> <foxy-internal-summary-control infer="debug"> <foxy-internal-switch-control json-template="${0}" false-alias="none" true-alias="required" json-path="debug.usage" property="json" infer="debug-usage"> </foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-source-control infer="custom-config" .getValue="${0}" .setValue="${0}"> </foxy-internal-source-control> <foxy-internal-source-control json-template="${0}" json-path="custom_script_values.header" property="json" infer="custom-script-values-header"> </foxy-internal-source-control> <foxy-internal-source-control json-template="${0}" json-path="custom_script_values.checkout_fields" property="json" infer="custom-script-values-checkout-fields"> </foxy-internal-source-control> <foxy-internal-source-control json-template="${0}" json-path="custom_script_values.multiship_checkout_fields" property="json" infer="custom-script-values-multiship-checkout-fields"> </foxy-internal-source-control> <foxy-internal-source-control json-template="${0}" json-path="custom_script_values.footer" property="json" infer="custom-script-values-footer"> </foxy-internal-source-control> ${0} <foxy-nucleon class="hidden" infer="" href="${0}" id="storeLoader" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),this.__defaultJSON,this.__cartTypeOptions,this.__defaultJSON,d.every(((e,t)=>e.every((e=>{const o=`cart-group-${0===t?"two":"three"}:cart-display-config-${e.replace(/_/g,"-")}`;return this.hiddenSelector.matches(o,!0)})))),d.map(((e,t)=>i(R||(R=L` <foxy-internal-summary-control infer="cart-group-${0}"> ${0} </foxy-internal-summary-control> `),0===t?"two":"three",e.map((e=>i(V||(V=L` <foxy-internal-switch-control json-template="${0}" json-path="cart_display_config.${0}" property="json" infer="cart-display-config-${0}"> </foxy-internal-switch-control> `),this.__defaultJSON,e,e.replace(/_/g,"-"))))))),this.__defaultJSON,this.__defaultJSON,this.__foxycompleteShowComboboxOptions,this.__foxycompleteShowComboboxGetValue,this.__foxycompleteShowComboboxSetValue,this.__defaultJSON,this.__defaultJSON,this.__defaultJSON,this.__defaultJSON,this.__defaultJSON,this.__locationFilteringUsageOptions,this.__defaultJSON,this.__locationFilteringFilterTypeOptions,this.__locationFilteringFilterTypeSetValue,this.__defaultJSON,f(null!==(e=this.countries)&&void 0!==e?e:void 0),f(null!==(t=this.regions)&&void 0!==t?t:void 0),this.__locationFilteringFilterValuesSetValue,this.__defaultJSON,this.__locationFilteringFilterTypeOptions,this.__defaultJSON,f(null!==(o=this.countries)&&void 0!==o?o:void 0),f(null!==(n=this.regions)&&void 0!==n?n:void 0),this.__defaultJSON,this.__locationFilteringFilterTypeOptions,this.__defaultJSON,f(null!==(r=this.countries)&&void 0!==r?r:void 0),f(null!==(a=this.regions)&&void 0!==a?a:void 0),this.__defaultJSON,this.__checkoutTypeAccountOptions,this.__checkoutTypeAccountGetValue,this.__defaultJSON,this.__checkoutTypeDefaultOptions,this.__defaultJSON,this.__tosCheckboxSettingsUsageOptions,this.__defaultJSON,this.__defaultJSON,this.__tosCheckboxSettingsInitialStateOptions,this.__defaultJSON,this.__defaultJSON,this.__defaultJSON,this.__defaultJSON,s(T||(T=L`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="flex-shrink-0 text-primary" style="width: 1.25em"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>`)),this.__defaultJSON,this.__cscRequirementsValueOptions,this.__defaultJSON,u.every(((e,t)=>e.every((e=>{const o=`checkout-fields-group-${0===t?"two":"three"}:custom-checkout-field-requirements-${e.replace(/_/g,"-").replace("1","-one").replace("2","-two")}`;return this.hiddenSelector.matches(o,!0)})))),u.map(((e,t)=>i(z||(z=L` <foxy-internal-summary-control infer="checkout-fields-group-${0}"> ${0} </foxy-internal-summary-control> `),0===t?"two":"three",e.map((e=>{const t=e.replace(/_/g,"-").replace("1","-one").replace("2","-two"),o=`custom_checkout_field_requirements.${e}`;return i(E||(E=L` <foxy-internal-select-control json-template="${0}" json-path="${0}" property="json" options="${0}" layout="summary-item" infer="custom-checkout-field-requirements-${0}"> </foxy-internal-select-control> `),this.__defaultJSON,o,"coupon_entry"===e?this.__customCheckoutFieldCouponEntryRequirementsOptions:this.__customCheckoutFieldRequirementsOptions,t)}))))),this.__defaultJSON,this.__defaultJSON,this.__defaultJSON,this.__defaultJSON,s(D||(D=L`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="flex-shrink-0 text-error" style="width: 1.25em"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>`)),this.__defaultJSON,this.__defaultJSON,this.__defaultJSON,s(A||(A=L`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="flex-shrink-0 text-primary" style="width: 1.25em"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>`)),this.__defaultJSON,this.__customConfigGetValue,this.__customConfigSetValue,this.__defaultJSON,this.__defaultJSON,this.__defaultJSON,this.__defaultJSON,super.renderBody(),f(null!==(l=this.store)&&void 0!==l?l:null===(c=this.data)||void 0===c?void 0:c._links["fx:store"].href),(()=>this.requestUpdate()))}get __storeLoader(){return this.renderRoot.querySelector("#storeLoader")}get __formJson(){return this.form.json?JSON.parse(this.form.json):{cart_type:"default",checkout_type:"default_account",csc_requirements:"all_cards",tos_checkbox_settings:{usage:"none",initial_state:"unchecked",is_hidden:!1,url:""},eu_secure_data_transfer_consent:{usage:"required"},newsletter_subscribe:{usage:"none"},analytics_config:{usage:"none",google_analytics:{usage:"none",account_id:"",include_on_site:!1},google_tag:{usage:"none",send_to:"",account_id:""}},colors:{usage:"none",primary:"4D4D4D",secondary:"FFFFFF",tertiary:"FFFFFF"},use_checkout_confirmation_window:{usage:"none"},supported_payment_cards:["visa","mastercard","discover","amex"],custom_checkout_field_requirements:{cart_controls:"enabled",coupon_entry:"enabled",billing_first_name:"required",billing_last_name:"required",billing_company:"optional",billing_tax_id:"hidden",billing_phone:"optional",billing_address1:"required",billing_address2:"optional",billing_city:"required",billing_region:"default",billing_postal_code:"required",billing_country:"required"},cart_display_config:{usage:"none",show_product_weight:!0,show_product_category:!0,show_product_code:!0,show_product_options:!0,show_sub_frequency:!0,show_sub_startdate:!0,show_sub_nextdate:!0,show_sub_enddate:!0,hidden_product_options:[]},foxycomplete:{usage:"required",show_combobox:!0,combobox_open:"\\u25bc",combobox_close:"\\u25b2",show_flags:!0},custom_script_values:{header:"",footer:"",checkout_fields:"",multiship_checkout_fields:""},http_receipt:!1,custom_config:"",debug:{usage:"none"},location_filtering:{usage:"none",shipping_filter_type:"blacklist",billing_filter_type:"blacklist",shipping_filter_values:{},billing_filter_values:{}},postal_code_lookup:{usage:"enabled"}}}get __dataJson(){var e;return(null===(e=this.data)||void 0===e?void 0:e.json)?JSON.parse(this.data.json):null}}customElements.define("foxy-template-config-form",B);export{B as TemplateConfigForm};
1
+ import"./shared-eef73355.js";import"./shared-511fcf8e.js";import"./shared-00e02b35.js";import"./shared-5cd33249.js";import"./shared-3a952968.js";import"./shared-4a32f76a.js";import{a as e,b as t,I as o}from"./shared-5b4e2567.js";import"./foxy-nucleon-element.js";import"./shared-4d32d19e.js";import{l as n}from"./shared-cf613436.js";import{c as i}from"./shared-4e709717.js";import{h as s,s as r}from"./shared-ba5c42c7.js";import{_ as a,B as l}from"./shared-cb58dfcd.js";import{i as c}from"./shared-53e42a77.js";import{R as u,a as d}from"./shared-11351c00.js";import"./shared-d807cb20.js";import"./shared-21e68b72.js";import"./shared-315d7620.js";import"./shared-f9ac8763.js";import"./shared-37348820.js";import"./shared-360d6a20.js";import"./shared-5fd5805c.js";import"./shared-d0aed1c1.js";import"./shared-53e476fd.js";import"./shared-243456aa.js";import"./shared-3556f4b7.js";import"./shared-7dc9c80b.js";import"./shared-c25538f1.js";import"./shared-c1e86ea4.js";import"./shared-8b0f00fa.js";import"./shared-651c44fa.js";import"./shared-be442f26.js";import"./shared-edeeb089.js";import"./shared-f989c70e.js";import"./shared-8ef0ca65.js";import"./shared-1c355fac.js";import"./shared-cf12f33b.js";import"./shared-0aedd809.js";import"./shared-7594e563.js";import"./shared-5212ef4f.js";import"./shared-5afb584d.js";import"./shared-2aa23b5f.js";import"./shared-f83207fb.js";import"./shared-5592ec6e.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-5ef40e86.js";import"./shared-e5546d55.js";import"./shared-048d5cae.js";import"./foxy-copy-to-clipboard.js";import"./shared-c18f681b.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let p,f,_=e=>e;customElements.define("foxy-internal-template-config-form-supported-cards-control",class extends e{renderControl(){const e={amex:"American Express",diners:"Diners Club",discover:"Discover",jcb:"JCB",maestro:"Maestro",mastercard:"Mastercard",unionpay:"UnionPay",visa:"Visa"};return s(p||(p=_` <div class="flex flex-wrap -m-xs"> ${0} </div> `),Object.entries(n).map((([t,o])=>{if(!e[t])return;const n=this._value.includes(t);return s(f||(f=_` <div data-testid="${0}" class="${0}"> <label class="${0}"> <div class="h-s">${0}</div> <div class="text-s font-medium mx-s my-auto leading-none">${0}</div> <input type="checkbox" class="sr-only" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> </label> </div> `),t,i({"m-xs rounded":!0,"opacity-50 cursor-default":this.disabled,"cursor-pointer ring-primary-50 focus-within-ring-2":!this.disabled}),i({"overflow-hidden transition-colors flex rounded-s border":!0,"border-primary bg-primary-10 text-primary":n&&!this.readonly,"border-contrast bg-contrast-5 text-secondary":n&&this.readonly,"hover-text-body":n&&!this.disabled&&!this.readonly,"border-contrast-10":!n,"hover-border-primary":!n&&!this.disabled&&!this.readonly,"hover-text-primary":!n&&!this.disabled&&!this.readonly}),o,e[t],this.disabled,this.readonly,n,(e=>{if(this.readonly)return e.preventDefault();e.stopPropagation();const o=[...this._value];e.currentTarget.checked?o.push(t):o.splice(o.indexOf(t),1),this._value=o}))})))}get _value(){var e;return null!==(e=super._value)&&void 0!==e?e:[]}set _value(e){super._value=e}});let h,y,g,m,b,x=e=>e;let v,j,w,$,O=e=>e;customElements.define("foxy-internal-template-config-form-filter-values-control-item",class extends t{constructor(){super(...arguments),this.options={},this.regions=[],this.name="",this.code="",this.__newRegion=""}static get properties(){return a(a({},super.properties),{},{__newRegion:{attribute:!1},options:{type:Object},regions:{type:Array},name:{type:String},code:{type:String}})}render(){const e=Object.values(this.options),t=e.filter((e=>!this.regions.includes(e.c)));return s(h||(h=x` <div class="${0}"> <div data-testid="country" class="h-m flex justify-between items-center bg-contrast-5"> <div style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> <span>${0}</span> </div> <button aria-label="${0}" class="${0}" style="width:calc(var(--lumo-size-s) - 2px);height:calc(var(--lumo-size-s) - 2px)" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:close" class="icon-inline text-m"></iron-icon> </button> </div> ${0} </div> `),i({"border border-contrast-5 rounded-s font-medium overflow-hidden":!0,"text-disabled":this.disabled}),this.name||this.code,this.t("delete"),i({"mr-xs items-center justify-center rounded-full transition-colors":!0,"hover-bg-error-10 hover-text-error":!this.disabled,"focus-outline-none focus-ring-2 ring-inset ring-error-50":!this.disabled,"cursor-default":this.disabled,flex:!this.readonly,hidden:this.readonly}),this.disabled,(()=>this.dispatchEvent(new CustomEvent("delete"))),0===e.length?"":s(y||(y=x` <div data-testid="regions" class="flex flex-wrap p-xs text-s"> ${0} ${0} </div> `),this.regions.map((e=>{var t;return s(g||(g=x` <div class="flex items-center rounded-s border border-contrast-10 h-s m-xs"> <span class="mx-s">${0}</span> <button aria-label="${0}" class="${0}" style="width:calc(var(--lumo-size-s) - 2px);height:calc(var(--lumo-size-s) - 2px)" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:close" class="icon-inline text-m"></iron-icon> </button> </div> `),(null===(t=this.options[e])||void 0===t?void 0:t.n)||e,this.t("delete"),i({"items-center justify-center rounded-s transition-colors":!0,"hover-bg-error-10 hover-text-error":!this.disabled,"focus-outline-none focus-ring-2 ring-inset ring-primary-50":!this.disabled,"cursor-default":this.disabled,flex:!this.readonly,hidden:this.readonly}),this.disabled,(()=>{this.regions=this.regions.filter((t=>t!==e)),this.dispatchEvent(new CustomEvent("update:regions"))}))})),0===t.length?"":s(m||(m=x` <div data-testid="new-region" class="${0}"> <select class="${0}" ?disabled="${0}" @change="${0}"> <option value="" disabled="disabled" selected="selected">${0}</option> ${0} </select> </div> `),i({"h-s m-xs items-center transition-colors border border-contrast-10 rounded-s":!0,"focus-within-ring-1 ring-primary-50 focus-within-border-primary-50":!this.disabled,flex:!this.readonly,hidden:this.readonly}),i({"appearance-none bg-transparent h-s text-s px-s font-medium":!0,"transition-colors rounded-s focus-outline-none":!0,"cursor-pointer hover-bg-contrast-5":!this.disabled}),this.disabled,(e=>{const t=e.currentTarget;this.__newRegion=t.value,this.__addRegion(),t.value=""}),this.t("add_region"),t.map((e=>s(b||(b=x`<option value="${0}">${0}</option>`),e.c,e.n))))))}__addRegion(){this.regions=[...new Set([...this.regions,this.__newRegion])],this.__newRegion="",this.dispatchEvent(new CustomEvent("update:regions"))}}),customElements.define("foxy-internal-template-config-form-filter-values-control",class extends e{constructor(){super(...arguments),this.countries=null,this.__newCountry=""}static get properties(){return a(a({},super.properties),{},{__newCountry:{attribute:!1},countries:{}})}renderControl(){var e,t,o,n;const r=Object.values(null!==(o=null===(t=null===(e=this.__countriesLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t.values)&&void 0!==o?o:{}),l=r.filter((e=>!(e.cc2 in this._value)));return s(v||(v=O` <div class="space-y-s" data-testid="countries"> ${0} ${0} </div> <foxy-nucleon infer="" href="${0}" id="countriesLoader" @update="${0}"> </foxy-nucleon> `),Object.entries(this._value).map((([e,t])=>{var o;const n=r.find((t=>t.cc2===e));return s(j||(j=O` <foxy-internal-template-config-form-filter-values-control-item regions="${0}" options="${0}" infer="" code="${0}" name="${0}" ?disabled="${0}" ?readonly="${0}" @update:regions="${0}" @delete="${0}"> </foxy-internal-template-config-form-filter-values-control-item> `),JSON.stringify("*"===t?[]:t),JSON.stringify(Array.isArray(null==n?void 0:n.regions)?{}:null!==(o=null==n?void 0:n.regions)&&void 0!==o?o:{}),e,c(null==n?void 0:n.default),this.disabled,this.readonly,(t=>{const o=a({},this._value),n=t.currentTarget.regions;o[e]=n.length?n:"*",this._value=o}),(()=>{const t=a({},this._value);delete t[e],this._value=t}))})),0===l.length&&0!==r.length?"":s(w||(w=O` <div data-testid="new-country" class="${0}"> <select class="${0}" ?disabled="${0}" @change="${0}"> <option value="" disabled="disabled" selected="selected">${0}</option> ${0} </select> </div> `),i({"h-m flex items-center rounded-s transition-colors":!0,"border border-contrast-10 ring-primary-50":!0,"focus-within-ring-1 focus-within-border-primary-50":!this.disabled,flex:!this.readonly,hidden:this.readonly}),i({"appearance-none bg-transparent h-m text-m px-s flex-1 font-medium":!0,"transition-colors rounded-s focus-outline-none":!0,"cursor-pointer hover-bg-contrast-5":!this.disabled,"text-disabled":this.disabled}),this.disabled,(e=>{const t=e.currentTarget;this.__newCountry=t.value,this.__addCountry(),t.value=""}),this.t("add_country"),l.map((e=>s($||($=O`<option value="${0}">${0}</option>`),e.cc2,e.default)))),c(null!==(n=this.countries)&&void 0!==n?n:void 0),(()=>this.requestUpdate()))}__addCountry(){this._value=a(a({},this._value),{},{[this.__newCountry]:"*"}),this.__newCountry=""}get __countriesLoader(){return this.renderRoot.querySelector("#countriesLoader")}get _value(){var e;return null!==(e=super._value)&&void 0!==e?e:{}}set _value(e){super._value=e}});let S,k,J,N,q,F,C,V,T=e=>e;const R=u(d(o,"template-config-form"));class z extends R{constructor(){super(...arguments),this.countries=null,this.regions=null,this.store=null,this.__customCheckoutFieldCouponEntryRequirementsOptions=JSON.stringify([{label:"option_enabled",value:"enabled"},{label:"option_disabled",value:"disabled"}]),this.__customCheckoutFieldRequirementsOptions=JSON.stringify([{label:"option_default",value:"default"},{label:"option_optional",value:"optional"},{label:"option_required",value:"required"},{label:"option_hidden",value:"hidden"}]),this.__tosCheckboxSettingsInitialStateOptions=JSON.stringify([{label:"option_checked",value:"checked"},{label:"option_unchecked",value:"unchecked"}]),this.__locationFilteringFilterTypeOptions=JSON.stringify([{label:"option_blocklist",value:"blacklist"},{label:"option_allowlist",value:"whitelist"}]),this.__foxycompleteShowComboboxOptions=JSON.stringify([{label:"option_combobox",value:"combobox"},{label:"option_search",value:"search"}]),this.__tosCheckboxSettingsUsageOptions=JSON.stringify([{label:"option_none",value:"none"},{label:"option_optional",value:"optional"},{label:"option_required",value:"required"}]),this.__locationFilteringUsageOptions=JSON.stringify([{label:"option_none",value:"none"},{label:"option_shipping",value:"shipping"},{label:"option_billing",value:"billing"},{label:"option_both",value:"both"},{label:"option_independent",value:"independent"}]),this.__cscRequirementsValueOptions=JSON.stringify([{label:"option_all_cards",value:"all_cards"},{label:"option_sso_only",value:"sso_only"},{label:"option_new_cards_only",value:"new_cards_only"}]),this.__checkoutTypeDefaultOptions=JSON.stringify([{label:"option_default_account",value:"default_account"},{label:"option_default_guest",value:"default_guest"}]),this.__checkoutTypeAccountOptions=JSON.stringify([{label:"option_account",value:"account_only"},{label:"option_guest",value:"guest_only"},{label:"option_both",value:"default_guest"}]),this.__cartTypeOptions=JSON.stringify([{label:"option_default",value:"default"},{label:"option_fullpage",value:"fullpage"},{label:"option_custom",value:"custom"}]),this.__locationFilteringFilterValuesSetValue=e=>{const t=this.__formJson,o=a(a({},t.location_filtering),{},{shipping_filter_values:e,billing_filter_values:e});this.edit({json:JSON.stringify(a(a({},t),{},{location_filtering:o}))})},this.__locationFilteringFilterTypeSetValue=e=>{const t=this.__formJson,o=a(a({},t.location_filtering),{},{shipping_filter_type:e,billing_filter_type:e});this.edit({json:JSON.stringify(a(a({},t),{},{location_filtering:o}))})},this.__foxycompleteShowComboboxGetValue=()=>this.__formJson.foxycomplete.show_combobox?"combobox":"search",this.__foxycompleteShowComboboxSetValue=e=>{const t="combobox"===e,o=a(a({},this.__formJson.foxycomplete),{},{show_combobox:t});this.edit({json:JSON.stringify(a(a({},this.__formJson),{},{foxycomplete:o}))})},this.__checkoutTypeAccountGetValue=()=>{const e=this.__formJson;return e.checkout_type.includes("default")?"default_guest":e.checkout_type},this.__customConfigGetValue=()=>{const e=this.__formJson;return"string"==typeof e.custom_config?e.custom_config:JSON.stringify(e.custom_config,null,2)},this.__customConfigSetValue=e=>{const t=this.__formJson;try{t.custom_config=JSON.parse(e)}catch(o){t.custom_config=e}this.edit({json:JSON.stringify(t)})},this.__defaultJSON=JSON.stringify({cart_type:"default",checkout_type:"default_account",csc_requirements:"all_cards",tos_checkbox_settings:{usage:"none",initial_state:"unchecked",is_hidden:!1,url:""},eu_secure_data_transfer_consent:{usage:"required"},newsletter_subscribe:{usage:"none"},analytics_config:{usage:"none",google_analytics:{usage:"none",account_id:"",include_on_site:!1},google_tag:{usage:"none",send_to:"",account_id:""}},colors:{usage:"none",primary:"4D4D4D",secondary:"FFFFFF",tertiary:"FFFFFF"},use_checkout_confirmation_window:{usage:"none"},supported_payment_cards:["visa","mastercard","discover","amex"],custom_checkout_field_requirements:{cart_controls:"enabled",coupon_entry:"enabled",billing_first_name:"required",billing_last_name:"required",billing_company:"optional",billing_tax_id:"hidden",billing_phone:"optional",billing_address1:"required",billing_address2:"optional",billing_city:"required",billing_region:"default",billing_postal_code:"required",billing_country:"required"},cart_display_config:{usage:"none",show_product_weight:!0,show_product_category:!0,show_product_code:!0,show_product_options:!0,show_sub_frequency:!0,show_sub_startdate:!0,show_sub_nextdate:!0,show_sub_enddate:!0,hidden_product_options:[]},foxycomplete:{usage:"required",show_combobox:!0,combobox_open:"\\u25bc",combobox_close:"\\u25b2",show_flags:!0},custom_script_values:{header:"",footer:"",checkout_fields:"",multiship_checkout_fields:""},http_receipt:!1,custom_config:"",debug:{usage:"none"},location_filtering:{usage:"none",shipping_filter_type:"blacklist",billing_filter_type:"blacklist",shipping_filter_values:{},billing_filter_values:{}},postal_code_lookup:{usage:"enabled"}})}static get properties(){return a(a({},super.properties),{},{countries:{},regions:{},store:{}})}get hiddenSelector(){var e,t;const o=[super.hiddenSelector.toString()],n=this.__dataJson,i=this.__formJson,s=i.location_filtering.usage,r=i.checkout_type;return"required"!==i.cart_display_config.usage&&o.unshift("cart-group-two","cart-group-three","cart-group-four"),"required"!==i.foxycomplete.usage&&o.unshift("country-and-region-group-one:foxycomplete-show-combobox","country-and-region-group-one:foxycomplete-combobox-open","country-and-region-group-one:foxycomplete-combobox-close","country-and-region-group-one:foxycomplete-show-flags"),!1===i.foxycomplete.show_combobox&&o.unshift("country-and-region-group-one:foxycomplete-combobox-open","country-and-region-group-one:foxycomplete-combobox-close"),"both"!==s&&o.unshift("country-and-region-group-two"),"shipping"!==s&&"independent"!==s&&o.unshift("country-and-region-group-three"),"billing"!==s&&"independent"!==s&&o.unshift("country-and-region-group-four"),"default_account"!==r&&"default_guest"!==r&&o.unshift("customer-accounts:checkout-type-default"),"none"===i.tos_checkbox_settings.usage&&o.unshift("consent-group-one:tos-checkbox-settings-url","consent-group-one:tos-checkbox-settings-initial-state","consent-group-one:tos-checkbox-settings-is-hidden"),"required"!==i.analytics_config.usage&&o.unshift("analytics-config-google-analytics","analytics-config-google-tag"),"required"!==(null==n?void 0:n.analytics_config.google_analytics.usage)&&o.unshift("analytics-config-google-analytics"),"required"!==i.analytics_config.google_analytics.usage&&o.unshift("analytics-config-google-analytics:analytics-config-google-analytics-account-id","analytics-config-google-analytics:analytics-config-google-analytics-include-on-site"),"required"!==i.analytics_config.google_tag.usage&&(o.unshift("analytics-config-google-tag:analytics-config-google-tag-account-id"),o.unshift("analytics-config-google-tag:analytics-config-google-tag-send-to")),!0!==(null===(t=null===(e=this.__storeLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t.features_multiship)&&o.unshift("custom-script-values-multiship-checkout-fields"),new l(o.join(" ").trim())}renderBody(){var e,t,o,n,i;const a=[["billing_address1","billing_address2","billing_city","billing_region","billing_postal_code","billing_country"],["billing_first_name","billing_last_name","billing_company","billing_tax_id","billing_phone","coupon_entry"]],l=[["show_product_weight","show_product_category","show_product_code","show_product_options"],["show_sub_frequency","show_sub_startdate","show_sub_nextdate","show_sub_enddate"]];return s(S||(S=T` ${0} <foxy-internal-summary-control infer="cart-group-one"> <foxy-internal-select-control json-template="${0}" json-path="cart_type" property="json" options="${0}" layout="summary-item" infer="cart-type"> </foxy-internal-select-control> <foxy-internal-switch-control json-template="${0}" false-alias="none" true-alias="required" json-path="cart_display_config.usage" property="json" infer="cart-display-config-usage" invert> </foxy-internal-switch-control> </foxy-internal-summary-control> <div class="grid sm-grid-cols-2 gap-m" ?hidden="${0}"> ${0} </div> <foxy-internal-summary-control infer="cart-group-four"> <foxy-internal-editable-list-control json-template="${0}" json-path="cart_display_config.hidden_product_options" property="json" layout="summary-item" infer="cart-display-config-hidden-product-options" simple-value> </foxy-internal-editable-list-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="country-and-region-group-one"> <foxy-internal-switch-control json-template="${0}" false-alias="none" true-alias="required" json-path="foxycomplete.usage" property="json" infer="foxycomplete-usage"> </foxy-internal-switch-control> <foxy-internal-select-control options="${0}" layout="summary-item" infer="foxycomplete-show-combobox" .getValue="${0}" .setValue="${0}"> </foxy-internal-select-control> <foxy-internal-text-control json-template="${0}" json-path="foxycomplete.combobox_open" property="json" layout="summary-item" infer="foxycomplete-combobox-open"> </foxy-internal-text-control> <foxy-internal-text-control json-template="${0}" json-path="foxycomplete.combobox_close" property="json" layout="summary-item" infer="foxycomplete-combobox-close"> </foxy-internal-text-control> <foxy-internal-switch-control json-template="${0}" json-path="foxycomplete.show_flags" property="json" infer="foxycomplete-show-flags"> </foxy-internal-switch-control> <foxy-internal-switch-control json-template="${0}" false-alias="none" true-alias="enabled" json-path="postal_code_lookup.usage" property="json" infer="postal-code-lookup"> </foxy-internal-switch-control> <foxy-internal-select-control json-template="${0}" json-path="location_filtering.usage" property="json" options="${0}" layout="summary-item" infer="location-filtering-usage"> </foxy-internal-select-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="country-and-region-group-two"> <foxy-internal-select-control json-template="${0}" json-path="location_filtering.shipping_filter_type" property="json" options="${0}" layout="summary-item" infer="location-filtering-filter-type" .setValue="${0}"> </foxy-internal-select-control> <foxy-internal-template-config-form-filter-values-control json-template="${0}" json-path="location_filtering.shipping_filter_values" countries="${0}" property="json" infer="location-filtering-filter-values" .setValue="${0}"> </foxy-internal-template-config-form-filter-values-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="country-and-region-group-three"> <foxy-internal-select-control json-template="${0}" json-path="location_filtering.shipping_filter_type" property="json" options="${0}" layout="summary-item" infer="location-filtering-shipping-filter-type"> </foxy-internal-select-control> <foxy-internal-template-config-form-filter-values-control json-template="${0}" json-path="location_filtering.shipping_filter_values" countries="${0}" property="json" infer="location-filtering-shipping-filter-values"> </foxy-internal-template-config-form-filter-values-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="country-and-region-group-four"> <foxy-internal-select-control json-template="${0}" json-path="location_filtering.billing_filter_type" property="json" options="${0}" layout="summary-item" infer="location-filtering-billing-filter-type"> </foxy-internal-select-control> <foxy-internal-template-config-form-filter-values-control json-template="${0}" json-path="location_filtering.billing_filter_values" countries="${0}" property="json" infer="location-filtering-billing-filter-values"> </foxy-internal-template-config-form-filter-values-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="customer-accounts"> <foxy-internal-select-control json-template="${0}" json-path="checkout_type" property="json" options="${0}" layout="summary-item" infer="checkout-type-account" .getValue="${0}"> </foxy-internal-select-control> <foxy-internal-select-control json-template="${0}" json-path="checkout_type" property="json" options="${0}" layout="summary-item" infer="checkout-type-default"> </foxy-internal-select-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="consent-group-one"> <foxy-internal-select-control json-template="${0}" json-path="tos_checkbox_settings.usage" property="json" options="${0}" layout="summary-item" infer="tos-checkbox-settings-usage"> </foxy-internal-select-control> <foxy-internal-text-control json-template="${0}" json-path="tos_checkbox_settings.url" property="json" layout="summary-item" infer="tos-checkbox-settings-url"> </foxy-internal-text-control> <foxy-internal-select-control json-template="${0}" json-path="tos_checkbox_settings.initial_state" property="json" options="${0}" layout="summary-item" infer="tos-checkbox-settings-initial-state"> </foxy-internal-select-control> <foxy-internal-switch-control json-template="${0}" json-path="tos_checkbox_settings.is_hidden" property="json" infer="tos-checkbox-settings-is-hidden"> </foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="consent-group-two"> <foxy-internal-switch-control json-template="${0}" false-alias="none" true-alias="required" json-path="eu_secure_data_transfer_consent.usage" property="json" infer="eu-secure-data-transfer-consent-usage"> </foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="consent-group-three"> <foxy-internal-switch-control json-template="${0}" false-alias="none" true-alias="required" json-path="newsletter_subscribe.usage" property="json" infer="newsletter-subscribe-usage"> </foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="supported-cards-group"> <foxy-internal-template-config-form-supported-cards-control json-template="${0}" json-path="supported_payment_cards" property="json" infer="supported-payment-cards"> </foxy-internal-template-config-form-supported-cards-control> <p class="flex items-start gap-s"> ${0} <foxy-i18n infer="" key="disclaimer"></foxy-i18n> </p> </foxy-internal-summary-control> <foxy-internal-summary-control infer="csc-requirements-group"> <foxy-internal-select-control json-template="${0}" json-path="csc_requirements" property="json" options="${0}" layout="summary-item" infer="csc-requirements"> </foxy-internal-select-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="checkout-fields-group-one"> <foxy-internal-switch-control json-template="${0}" false-alias="disabled" true-alias="enabled" json-path="custom_checkout_field_requirements.cart_controls" property="json" infer="custom-checkout-field-requirements-cart-controls"> </foxy-internal-switch-control> </foxy-internal-summary-control> <div class="grid sm-grid-cols-2 gap-m" ?hidden="${0}"> ${0} </div> <foxy-internal-summary-control infer="analytics-config"> <foxy-internal-switch-control json-template="${0}" false-alias="none" true-alias="required" json-path="analytics_config.usage" property="json" infer="analytics-config-usage"> </foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="analytics-config-google-analytics"> <foxy-internal-switch-control json-template="${0}" false-alias="none" true-alias="required" json-path="analytics_config.google_analytics.usage" property="json" infer="analytics-config-google-analytics-usage"> </foxy-internal-switch-control> <foxy-internal-text-control json-template="${0}" json-path="analytics_config.google_analytics.account_id" property="json" layout="summary-item" infer="analytics-config-google-analytics-account-id"> </foxy-internal-text-control> <foxy-internal-switch-control json-template="${0}" json-path="analytics_config.google_analytics.include_on_site" property="json" infer="analytics-config-google-analytics-include-on-site"> </foxy-internal-switch-control> <p class="flex items-start gap-s bg-error-10 text-error"> ${0} <foxy-i18n infer="" key="deprecation_notice"></foxy-i18n> </p> </foxy-internal-summary-control> <foxy-internal-summary-control infer="analytics-config-google-tag"> <foxy-internal-switch-control json-template="${0}" false-alias="none" true-alias="required" json-path="analytics_config.google_tag.usage" property="json" infer="analytics-config-google-tag-usage"> </foxy-internal-switch-control> <foxy-internal-text-control json-template="${0}" json-path="analytics_config.google_tag.account_id" property="json" layout="summary-item" infer="analytics-config-google-tag-account-id"> </foxy-internal-text-control> <foxy-internal-text-control json-template="${0}" json-path="analytics_config.google_tag.send_to" property="json" layout="summary-item" infer="analytics-config-google-tag-send-to"> </foxy-internal-text-control> <p class="flex items-start gap-s"> ${0} <span> <foxy-i18n infer="" key="usage_notice"></foxy-i18n> <br> <a target="_blank" class="cursor-pointer group text-primary rounded-s font-medium focus-outline-none focus-ring-2 focus-ring-primary-50" href="https://wiki.foxycart.com/v/2.0/analytics#google_tag_ga4_google_ads" rel="nofollow noreferrer noopener"> <foxy-i18n class="transition-opacity group-hover-opacity-80" infer="" key="docs_link"> </foxy-i18n> </a> </span> </p> </foxy-internal-summary-control> <foxy-internal-summary-control infer="debug"> <foxy-internal-switch-control json-template="${0}" false-alias="none" true-alias="required" json-path="debug.usage" property="json" infer="debug-usage"> </foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-source-control infer="custom-config" .getValue="${0}" .setValue="${0}"> </foxy-internal-source-control> <foxy-internal-source-control json-template="${0}" json-path="custom_script_values.header" property="json" infer="custom-script-values-header"> </foxy-internal-source-control> <foxy-internal-source-control json-template="${0}" json-path="custom_script_values.checkout_fields" property="json" infer="custom-script-values-checkout-fields"> </foxy-internal-source-control> <foxy-internal-source-control json-template="${0}" json-path="custom_script_values.multiship_checkout_fields" property="json" infer="custom-script-values-multiship-checkout-fields"> </foxy-internal-source-control> <foxy-internal-source-control json-template="${0}" json-path="custom_script_values.footer" property="json" infer="custom-script-values-footer"> </foxy-internal-source-control> ${0} <foxy-nucleon class="hidden" infer="" href="${0}" id="storeLoader" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),this.__defaultJSON,this.__cartTypeOptions,this.__defaultJSON,l.every(((e,t)=>e.every((e=>{const o=`cart-group-${0===t?"two":"three"}:cart-display-config-${e.replace(/_/g,"-")}`;return this.hiddenSelector.matches(o,!0)})))),l.map(((e,t)=>s(k||(k=T` <foxy-internal-summary-control infer="cart-group-${0}"> ${0} </foxy-internal-summary-control> `),0===t?"two":"three",e.map((e=>s(J||(J=T` <foxy-internal-switch-control json-template="${0}" json-path="cart_display_config.${0}" property="json" infer="cart-display-config-${0}"> </foxy-internal-switch-control> `),this.__defaultJSON,e,e.replace(/_/g,"-"))))))),this.__defaultJSON,this.__defaultJSON,this.__foxycompleteShowComboboxOptions,this.__foxycompleteShowComboboxGetValue,this.__foxycompleteShowComboboxSetValue,this.__defaultJSON,this.__defaultJSON,this.__defaultJSON,this.__defaultJSON,this.__defaultJSON,this.__locationFilteringUsageOptions,this.__defaultJSON,this.__locationFilteringFilterTypeOptions,this.__locationFilteringFilterTypeSetValue,this.__defaultJSON,c(null!==(e=this.countries)&&void 0!==e?e:void 0),this.__locationFilteringFilterValuesSetValue,this.__defaultJSON,this.__locationFilteringFilterTypeOptions,this.__defaultJSON,c(null!==(t=this.countries)&&void 0!==t?t:void 0),this.__defaultJSON,this.__locationFilteringFilterTypeOptions,this.__defaultJSON,c(null!==(o=this.countries)&&void 0!==o?o:void 0),this.__defaultJSON,this.__checkoutTypeAccountOptions,this.__checkoutTypeAccountGetValue,this.__defaultJSON,this.__checkoutTypeDefaultOptions,this.__defaultJSON,this.__tosCheckboxSettingsUsageOptions,this.__defaultJSON,this.__defaultJSON,this.__tosCheckboxSettingsInitialStateOptions,this.__defaultJSON,this.__defaultJSON,this.__defaultJSON,this.__defaultJSON,r(N||(N=T`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="flex-shrink-0 text-primary" style="width: 1.25em"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>`)),this.__defaultJSON,this.__cscRequirementsValueOptions,this.__defaultJSON,a.every(((e,t)=>e.every((e=>{const o=`checkout-fields-group-${0===t?"two":"three"}:custom-checkout-field-requirements-${e.replace(/_/g,"-").replace("1","-one").replace("2","-two")}`;return this.hiddenSelector.matches(o,!0)})))),a.map(((e,t)=>s(q||(q=T` <foxy-internal-summary-control infer="checkout-fields-group-${0}"> ${0} </foxy-internal-summary-control> `),0===t?"two":"three",e.map((e=>{const t=e.replace(/_/g,"-").replace("1","-one").replace("2","-two"),o=`custom_checkout_field_requirements.${e}`;return s(F||(F=T` <foxy-internal-select-control json-template="${0}" json-path="${0}" property="json" options="${0}" layout="summary-item" infer="custom-checkout-field-requirements-${0}"> </foxy-internal-select-control> `),this.__defaultJSON,o,"coupon_entry"===e?this.__customCheckoutFieldCouponEntryRequirementsOptions:this.__customCheckoutFieldRequirementsOptions,t)}))))),this.__defaultJSON,this.__defaultJSON,this.__defaultJSON,this.__defaultJSON,r(C||(C=T`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="flex-shrink-0 text-error" style="width: 1.25em"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>`)),this.__defaultJSON,this.__defaultJSON,this.__defaultJSON,r(V||(V=T`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="flex-shrink-0 text-primary" style="width: 1.25em"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>`)),this.__defaultJSON,this.__customConfigGetValue,this.__customConfigSetValue,this.__defaultJSON,this.__defaultJSON,this.__defaultJSON,this.__defaultJSON,super.renderBody(),c(null!==(n=this.store)&&void 0!==n?n:null===(i=this.data)||void 0===i?void 0:i._links["fx:store"].href),(()=>this.requestUpdate()))}get __storeLoader(){return this.renderRoot.querySelector("#storeLoader")}get __formJson(){return this.form.json?JSON.parse(this.form.json):{cart_type:"default",checkout_type:"default_account",csc_requirements:"all_cards",tos_checkbox_settings:{usage:"none",initial_state:"unchecked",is_hidden:!1,url:""},eu_secure_data_transfer_consent:{usage:"required"},newsletter_subscribe:{usage:"none"},analytics_config:{usage:"none",google_analytics:{usage:"none",account_id:"",include_on_site:!1},google_tag:{usage:"none",send_to:"",account_id:""}},colors:{usage:"none",primary:"4D4D4D",secondary:"FFFFFF",tertiary:"FFFFFF"},use_checkout_confirmation_window:{usage:"none"},supported_payment_cards:["visa","mastercard","discover","amex"],custom_checkout_field_requirements:{cart_controls:"enabled",coupon_entry:"enabled",billing_first_name:"required",billing_last_name:"required",billing_company:"optional",billing_tax_id:"hidden",billing_phone:"optional",billing_address1:"required",billing_address2:"optional",billing_city:"required",billing_region:"default",billing_postal_code:"required",billing_country:"required"},cart_display_config:{usage:"none",show_product_weight:!0,show_product_category:!0,show_product_code:!0,show_product_options:!0,show_sub_frequency:!0,show_sub_startdate:!0,show_sub_nextdate:!0,show_sub_enddate:!0,hidden_product_options:[]},foxycomplete:{usage:"required",show_combobox:!0,combobox_open:"\\u25bc",combobox_close:"\\u25b2",show_flags:!0},custom_script_values:{header:"",footer:"",checkout_fields:"",multiship_checkout_fields:""},http_receipt:!1,custom_config:"",debug:{usage:"none"},location_filtering:{usage:"none",shipping_filter_type:"blacklist",billing_filter_type:"blacklist",shipping_filter_values:{},billing_filter_values:{}},postal_code_lookup:{usage:"enabled"}}}get __dataJson(){var e;return(null===(e=this.data)||void 0===e?void 0:e.json)?JSON.parse(this.data.json):null}}customElements.define("foxy-template-config-form",z);export{z as TemplateConfigForm};
@@ -24,10 +24,7 @@ export class NativeIntegrationForm extends Base {
24
24
  this.__createConfigSetterFor = memoize((key) => {
25
25
  return (value) => (this.__config = { [key]: value });
26
26
  });
27
- this.__providerGetValue = () => {
28
- var _a;
29
- return (_a = this.form.provider) !== null && _a !== void 0 ? _a : 'avalara';
30
- };
27
+ this.__providerGetValue = () => this.form.provider;
31
28
  this.__providerSetValue = (value) => {
32
29
  this.edit({ provider: value, config: '{}' });
33
30
  this.__config = {};
@@ -193,8 +190,8 @@ export class NativeIntegrationForm extends Base {
193
190
  };
194
191
  }
195
192
  renderBody() {
196
- var _a, _b;
197
- const provider = (_a = this.form.provider) !== null && _a !== void 0 ? _a : 'avalara';
193
+ var _a;
194
+ const provider = this.form.provider;
198
195
  return html `
199
196
  ${this.renderHeader()}
200
197
  ${this.href
@@ -233,7 +230,7 @@ export class NativeIntegrationForm extends Base {
233
230
  <foxy-nucleon
234
231
  class="hidden"
235
232
  infer=""
236
- href=${ifDefined((_b = this.store) !== null && _b !== void 0 ? _b : void 0)}
233
+ href=${ifDefined((_a = this.store) !== null && _a !== void 0 ? _a : void 0)}
237
234
  id="storeLoader"
238
235
  @update=${() => this.requestUpdate()}
239
236
  >