@foxy.io/elements 1.29.0 → 1.30.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/foxy-access-recovery-form.js +1 -1
- package/dist/cdn/foxy-address-form.js +1 -1
- package/dist/cdn/foxy-admin-subscription-form.js +1 -1
- package/dist/cdn/foxy-api-browser.js +1 -1
- package/dist/cdn/foxy-applied-coupon-code-form.js +1 -1
- package/dist/cdn/foxy-attribute-form.js +1 -1
- package/dist/cdn/foxy-cancellation-form.js +1 -1
- package/dist/cdn/foxy-cart-form.js +2 -2
- package/dist/cdn/foxy-client-form.js +1 -1
- package/dist/cdn/foxy-collection-pages.js +1 -1
- package/dist/cdn/foxy-copy-to-clipboard.js +1 -1
- package/dist/cdn/foxy-coupon-code-form.js +1 -1
- package/dist/cdn/foxy-coupon-codes-form.js +1 -1
- package/dist/cdn/foxy-coupon-form.js +1 -1
- package/dist/cdn/foxy-custom-field-form.js +1 -1
- package/dist/cdn/foxy-customer-form.js +1 -1
- package/dist/cdn/foxy-customer-portal-settings-form.js +1 -1
- package/dist/cdn/foxy-customer-portal-settings.js +1 -1
- package/dist/cdn/foxy-customer-portal.js +1 -1
- package/dist/cdn/foxy-customer.js +1 -1
- package/dist/cdn/foxy-donation.js +1 -1
- package/dist/cdn/foxy-downloadable-form.js +1 -1
- package/dist/cdn/foxy-email-template-form.js +1 -1
- package/dist/cdn/foxy-filter-attribute-form.js +1 -1
- package/dist/cdn/foxy-form-dialog.js +1 -1
- package/dist/cdn/foxy-generate-codes-form.js +1 -1
- package/dist/cdn/foxy-gift-card-code-form.js +1 -1
- package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
- package/dist/cdn/foxy-gift-card-form.js +1 -1
- package/dist/cdn/foxy-i18n-editor.js +1 -1
- package/dist/cdn/foxy-integration-form.js +1 -1
- package/dist/cdn/foxy-item-category-form.js +1 -1
- package/dist/cdn/foxy-item-form.js +3 -3
- package/dist/cdn/foxy-item-option-form.js +1 -1
- package/dist/cdn/foxy-items-form.js +1 -1
- package/dist/cdn/foxy-native-integration-form.js +1 -1
- package/dist/cdn/foxy-pagination.js +1 -1
- package/dist/cdn/foxy-passkey-form.js +1 -1
- package/dist/cdn/foxy-payment-method-card.js +1 -1
- package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
- package/dist/cdn/foxy-report-form.js +1 -1
- package/dist/cdn/foxy-sign-in-form.js +1 -1
- package/dist/cdn/foxy-store-form.js +1 -1
- package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
- package/dist/cdn/foxy-subscription-card.js +1 -1
- package/dist/cdn/foxy-subscription-form.js +1 -1
- package/dist/cdn/foxy-subscription-settings-form.js +1 -1
- package/dist/cdn/foxy-tax-form.js +1 -1
- package/dist/cdn/foxy-template-config-form.js +1 -1
- package/dist/cdn/foxy-template-form.js +1 -1
- package/dist/cdn/foxy-template-set-form.js +1 -1
- package/dist/cdn/foxy-transaction-card.js +1 -1
- package/dist/cdn/foxy-transaction.js +1 -1
- package/dist/cdn/foxy-update-payment-method-form.js +1 -1
- package/dist/cdn/foxy-user-form.js +1 -1
- package/dist/cdn/foxy-users-table.js +1 -1
- package/dist/cdn/foxy-webhook-card.js +1 -1
- package/dist/cdn/foxy-webhook-form.js +1 -1
- package/dist/cdn/{shared-cfb33387.js → shared-01f18104.js} +1 -1
- package/dist/cdn/{shared-3483c729.js → shared-09fc6fa0.js} +1 -1
- package/dist/cdn/{shared-8bb3eb45.js → shared-1729e19a.js} +1 -1
- package/dist/cdn/{shared-fe4a2e3d.js → shared-19f46691.js} +1 -1
- package/dist/cdn/{shared-38f0bda5.js → shared-2bd96ec7.js} +2 -2
- package/dist/cdn/{shared-a97c3129.js → shared-2d75f154.js} +1 -1
- package/dist/cdn/{shared-8526ed32.js → shared-3b975a29.js} +1 -1
- package/dist/cdn/{shared-ae00ce7c.js → shared-3cf043a7.js} +1 -1
- package/dist/cdn/{shared-0ad0fb9f.js → shared-41e7554e.js} +1 -1
- package/dist/cdn/{shared-ee2cda29.js → shared-471e77dd.js} +1 -1
- package/dist/cdn/{shared-1467a889.js → shared-476827c7.js} +1 -1
- package/dist/cdn/{shared-75331d5e.js → shared-4a652d60.js} +1 -1
- package/dist/cdn/{shared-22ba950a.js → shared-4d172731.js} +1 -1
- package/dist/cdn/{shared-70747a5c.js → shared-5721fb53.js} +1 -1
- package/dist/cdn/{shared-376784f0.js → shared-5bc86d84.js} +1 -1
- package/dist/cdn/shared-6d11abd7.js +280 -0
- package/dist/cdn/{shared-13203be0.js → shared-6f4fa343.js} +1 -1
- package/dist/cdn/{shared-f21254a3.js → shared-6f877b15.js} +1 -1
- package/dist/cdn/{shared-d0e4d7b1.js → shared-73045804.js} +1 -1
- package/dist/cdn/{shared-f4abc29a.js → shared-787e8da4.js} +1 -1
- package/dist/cdn/{shared-9a22d597.js → shared-7dd710e4.js} +1 -1
- package/dist/cdn/{shared-970d98db.js → shared-8fbebf38.js} +1 -1
- package/dist/cdn/{shared-cc808e01.js → shared-9637a2de.js} +1 -1
- package/dist/cdn/{shared-dfc47fd9.js → shared-96a392d9.js} +1 -1
- package/dist/cdn/{shared-4f183419.js → shared-97514fcb.js} +1 -1
- package/dist/cdn/{shared-c9845b4a.js → shared-9bf7d9a7.js} +1 -1
- package/dist/cdn/{shared-421a3ced.js → shared-a0efdc94.js} +1 -1
- package/dist/cdn/{shared-32e92c3b.js → shared-a8233033.js} +1 -1
- package/dist/cdn/{shared-edae6816.js → shared-ad76e640.js} +1 -1
- package/dist/cdn/{shared-6a8a40cc.js → shared-b38762ef.js} +1 -1
- package/dist/cdn/{shared-ce0465c6.js → shared-b980ba1d.js} +1 -1
- package/dist/cdn/{shared-afd7214a.js → shared-cb3b9d8b.js} +1 -1
- package/dist/cdn/{shared-ecf479f2.js → shared-d5ff9121.js} +1 -1
- package/dist/cdn/{shared-1ecfa77b.js → shared-deff3eda.js} +1 -1
- package/dist/cdn/{shared-301a779e.js → shared-e47bd38e.js} +1 -1
- package/dist/cdn/{shared-dbda59a0.js → shared-e5098b19.js} +1 -1
- package/dist/cdn/{shared-19768452.js → shared-e7bff5de.js} +1 -1
- package/dist/cdn/{shared-e4870c47.js → shared-ea5ff8bc.js} +1 -1
- package/dist/cdn/translations/admin-subscription-form/en.json +108 -0
- package/dist/cdn/translations/coupon-form/en.json +103 -50
- package/dist/cdn/translations/transaction/en.json +108 -0
- package/dist/cdn/translations/webhook-card/en.json +5 -1
- package/dist/elements/internal/InternalAsyncListControl/InternalAsyncListControl.d.ts +9 -2
- package/dist/elements/internal/InternalAsyncListControl/InternalAsyncListControl.js +150 -32
- package/dist/elements/internal/InternalAsyncListControl/InternalAsyncListControl.js.map +1 -1
- package/dist/elements/internal/InternalAsyncListControl/index.d.ts +3 -0
- package/dist/elements/internal/InternalAsyncListControl/index.js +3 -0
- package/dist/elements/internal/InternalAsyncListControl/index.js.map +1 -1
- package/dist/elements/internal/InternalAsyncListControl/styles.d.ts +1 -0
- package/dist/elements/internal/InternalAsyncListControl/styles.js +12 -0
- package/dist/elements/internal/InternalAsyncListControl/styles.js.map +1 -0
- package/dist/elements/internal/InternalAsyncListControl/types.d.ts +5 -1
- package/dist/elements/internal/InternalAsyncListControl/types.js.map +1 -1
- package/dist/elements/public/CouponForm/CouponForm.d.ts +0 -3
- package/dist/elements/public/CouponForm/CouponForm.js +56 -76
- package/dist/elements/public/CouponForm/CouponForm.js.map +1 -1
- package/dist/elements/public/CouponForm/index.d.ts +2 -2
- package/dist/elements/public/CouponForm/index.js +2 -2
- package/dist/elements/public/CouponForm/index.js.map +1 -1
- package/dist/elements/public/GiftCardForm/GiftCardForm.js.map +1 -1
- package/dist/elements/public/Transaction/Transaction.d.ts +2 -0
- package/dist/elements/public/Transaction/Transaction.js +114 -19
- package/dist/elements/public/Transaction/Transaction.js.map +1 -1
- package/dist/elements/public/Transaction/index.d.ts +6 -0
- package/dist/elements/public/Transaction/index.js +6 -0
- package/dist/elements/public/Transaction/index.js.map +1 -1
- package/dist/elements/public/WebhookCard/WebhookCard.d.ts +8 -0
- package/dist/elements/public/WebhookCard/WebhookCard.js +73 -6
- package/dist/elements/public/WebhookCard/WebhookCard.js.map +1 -1
- package/dist/elements/public/WebhookCard/index.d.ts +2 -0
- package/dist/elements/public/WebhookCard/index.js +2 -0
- package/dist/elements/public/WebhookCard/index.js.map +1 -1
- package/dist/elements/public/WebhookForm/WebhookForm.d.ts +7 -0
- package/dist/elements/public/WebhookForm/WebhookForm.js +40 -4
- package/dist/elements/public/WebhookForm/WebhookForm.js.map +1 -1
- package/package.json +1 -1
- package/dist/cdn/shared-ba7354fa.js +0 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-6f877b15.js";import"./shared-19f46691.js";import"./shared-9637a2de.js";import"./shared-fb1602a2.js";import"./shared-887e1795.js";import"./shared-6be24929.js";import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-49ecea83.js";import{h as e}from"./shared-dc73b9a5.js";import{C as s}from"./shared-0b01f721.js";import{N as t}from"./shared-24d71d01.js";import{T as i,a as r}from"./shared-25502f01.js";import{c as a}from"./shared-4e709717.js";import{i as d}from"./shared-9803aa7c.js";import{v as o}from"./shared-b738ee96.js";import"./shared-98ddb87c.js";import"./shared-77e15843.js";import"./shared-ff7b2af6.js";import"./shared-0f00d4d8.js";import"./shared-61ade33e.js";import"./shared-2bd96ec7.js";import"./shared-59b7fcc0.js";import"./shared-0f6e4584.js";import"./shared-f7a1193f.js";import"./shared-343d1fd7.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";let n,l,m,h,c=e=>e;const p=i(s(r(t,"access-recovery-form")));class f extends p{constructor(){super(...arguments),this.__checkEmailValidity=()=>!this.errors.some((e=>e.startsWith("email"))),this.__renderEmail=()=>{var s;const t=this.in("fail"),i=this.in("busy"),r=this.in({idle:"snapshot"}),a=this.errors.filter((e=>e.startsWith("email"))).map((e=>e.replace("email","v8n"))),o=a[0]?this.t(a[0]).toString():"";return e(n||(n=c` <div> ${0} <vaadin-email-field error-message="${0}" data-testid="email" class="w-full" label="${0}" value="${0}" ?disabled="${0}" ?readonly="${0}" .checkValidity="${0}" @input="${0}" @keydown="${0}"> </vaadin-email-field> ${0} </div> `),this.renderTemplateOrSlot("email:before"),o,this.t("email").toString(),d(null===(s=this.form.detail)||void 0===s?void 0:s.email),i||r||t||this.disabledSelector.matches("email",!0),this.readonlySelector.matches("email",!0),this.__checkEmailValidity,(e=>{this.edit({detail:{email:e.target.value},type:"email"})}),(e=>{"Enter"===e.key&&this.submit()}),this.renderTemplateOrSlot("email:after"))},this.__renderMessage=()=>{const s=this.in("fail"),t=s?"bg-error-10 text-error":"bg-success-10 text-success",i=s?"lumo:error":"lumo:cog",r=s?"unknown_error":"recover_access_success";return e(l||(l=c` <div> ${0} <p class="leading-s flex items-start text-s rounded p-s ${0}"> <iron-icon class="flex-shrink-0 icon-inline text-l mr-s" icon="${0}"></iron-icon> <foxy-i18n lang="${0}" key="${0}" ns="${0}" data-testid="message"></foxy-i18n> </p> ${0} </div> `),this.renderTemplateOrSlot("message:before"),t,i,this.lang,r,this.ns,this.renderTemplateOrSlot("message:after"))},this.__renderSubmit=()=>{const s=this.in("fail"),t=0===this.errors.length,i=this.in("busy"),r=this.in({idle:"snapshot"}),a=i||r||!t||s;return e(m||(m=c` <div> ${0} <vaadin-button data-testid="submit" class="w-full" theme="primary" ?disabled="${0}" @click="${0}"> <foxy-i18n lang="${0}" key="recover_access" ns="${0}"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("submit:before"),a||this.disabledSelector.matches("submit",!0),(()=>this.submit()),this.lang,this.ns,this.renderTemplateOrSlot("submit:after"))}}static get v8n(){return[({detail:e})=>(null==e?void 0:e.email)&&e.email.length>0||"email_required",({detail:e})=>{var s;return o(null!==(s=null==e?void 0:e.email)&&void 0!==s?s:"")||"email_invalid_email"}]}render(){var s,t;const i=this.hiddenSelector,r=this.in({idle:"snapshot"})||this.in("fail"),d=this.in("busy");return e(h||(h=c` <main data-testid="wrapper" aria-live="polite" aria-busy="${0}" class="relative font-lumo text-m leading-m space-y-m"> ${0} ${0} ${0} <div data-testid="spinner" class="${0}"> <foxy-spinner layout="vertical" class="m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l" state="busy" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </main> `),d,i.matches("email",!0)?"":this.__renderEmail(),i.matches("message",!0)||!r?"":this.__renderMessage(),i.matches("submit",!0)?"":this.__renderSubmit(),a({"transition duration-500 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":!d}),this.lang,this.ns,null!==(t=null===(s=customElements.get("foxy-spinner"))||void 0===s?void 0:s.defaultNS)&&void 0!==t?t:"")}async _sendPost(e){const s=JSON.stringify(e),i=await this._fetch(this.parent,{body:s,method:"POST"}),r=t.Rumour(this.group),a=[...this.related,this.parent];return r.share({data:i,related:a,source:i._links.self.href}),i}}customElements.define("foxy-access-recovery-form",f);export{f as AccessRecoveryForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-ea5ff8bc.js";import"./shared-e5098b19.js";import"./shared-01f18104.js";import{I as e}from"./shared-97514fcb.js";import{a as r}from"./shared-25502f01.js";import{B as t}from"./shared-0f6e4584.js";import{h as o}from"./shared-dc73b9a5.js";import"./shared-3cf043a7.js";import"./shared-fb1602a2.js";import"./shared-98ddb87c.js";import"./shared-2bd96ec7.js";import"./shared-61ade33e.js";import"./shared-77e15843.js";import"./shared-887e1795.js";import"./shared-226dd830.js";import"./shared-51c4a6dd.js";import"./shared-49ecea83.js";import"./shared-343d1fd7.js";import"./shared-f7a1193f.js";import"./shared-0b01f721.js";import"./shared-9803aa7c.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-8fbebf38.js";import"./shared-9bf7d9a7.js";import"./shared-9b895561.js";import"./shared-e7232c2b.js";import"./shared-2c1dff50.js";import"./shared-ff7b2af6.js";import"./shared-651c44fa.js";import"./shared-0f00d4d8.js";import"./shared-19f46691.js";import"./shared-ea8f9a88.js";import"./shared-5c4d786c.js";import"./shared-4e709717.js";import"./shared-22ba9566.js";import"./shared-9637a2de.js";import"./shared-09fc6fa0.js";import"./shared-c11df800.js";import"./foxy-copy-to-clipboard.js";import"./shared-1729e19a.js";import"./shared-6be24929.js";import"./shared-59b7fcc0.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";const a={AF:[],AX:[],AL:[],DZ:[],AS:[],AD:[],AO:[],AI:[],AQ:[],AG:[],AR:[],AM:[],AW:[],AU:["ACT","NSW","NT","QLD","SA","TAS","VIC","WA"],AT:["BL","KN","NO","OO","SB","ST","TI","VB","WI"],AZ:[],BS:[],BH:[],BD:[],BB:[],BY:[],BE:[],BZ:[],BJ:[],BM:[],BT:[],BO:[],BQ:["BO","SA","SE"],BA:[],BW:[],BV:[],BR:[],IO:[],BN:[],BG:[],BF:[],BI:[],KH:[],CM:[],CA:["AB","BC","MB","NB","NL","NT","NS","NU","ON","PE","QC","SK","YT"],CV:[],CW:[],KY:[],CF:[],TD:[],CL:[],CN:[],CX:[],CC:[],CO:[],KM:[],CG:[],CD:[],CK:[],CR:[],CI:[],HR:[],CU:[],CY:[],CZ:[],DK:[],DJ:[],DM:[],DO:[],EC:[],EG:[],SV:[],SX:[],GQ:[],ER:[],EE:[],ET:[],FK:[],FO:[],FJ:[],FI:[],FR:[],GF:[],PF:[],TF:[],GA:[],GM:[],GE:[],DE:["BW","BY","BE","BB","HB","HH","HE","MV","NI","NW","RP","SL","SN","ST","SH","TH"],GH:[],GI:[],GR:[],GL:[],GD:[],GP:[],GU:[],GT:[],GG:[],GN:[],GW:[],GY:[],HT:[],HM:[],VA:[],HN:[],HK:[],HU:[],IS:[],IN:["AN","AP","AR","AS","BR","CH","CT","DN","DD","DL","GA","GJ","HR","HP","JK","JH","KA","KL","LD","MP","MH","MN","ML","MZ","NL","OR","PY","PB","RJ","SK","TN","TG","TR","UT","UP","WB"],ID:[],IR:[],IQ:[],IE:["CW","CN","CE","CO","DL","D","G","KY","KE","KK","LS","LM","LK","LD","LH","MO","MH","MN","OY","RN","SO","TA","WD","WH","WX","WW"],IM:[],IL:[],IT:[],JM:[],JP:["10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40","41","42","43","44","45","46","47","05","02","07","01","08","03","04","09","06"],JE:[],JO:[],KZ:[],KE:[],KI:[],KP:[],KR:[],KW:[],KG:[],LA:[],LV:[],LB:[],LS:[],LR:[],LY:[],LI:[],LT:[],LU:[],MO:[],MK:[],MG:[],MW:[],MY:[],MV:[],ML:[],MT:[],MH:[],MQ:[],MR:[],MU:[],YT:[],MX:[],FM:[],MD:[],MC:[],MN:[],ME:[],MS:[],MA:[],MZ:[],MM:[],NA:[],NR:[],NP:[],NL:[],NC:[],NZ:[],NI:[],NE:[],NG:[],NU:[],NF:[],MP:[],NO:["10","11","12","14","15","16","17","18","19","20","30","34","38","42","46","50","54","01","02","03","04","05","06","07","08","09"],OM:[],PK:[],PW:[],PS:[],PA:[],PG:[],PY:[],PE:[],PH:[],PN:[],PL:[],PT:[],PR:[],QA:[],RE:[],RO:[],RU:[],RW:[],BL:[],SH:[],KN:[],LC:[],MF:[],PM:[],VC:[],WS:[],SM:[],SS:[],ST:[],SA:[],SN:[],RS:[],SC:[],SL:[],SG:[],SK:[],SI:[],SB:[],SO:[],ZA:[],GS:[],ES:["A Coruna","Alava","Albacete","Alicante","Almeria","Asturias","Avila","Badajoz","Baleares","Barcelona","Burgos","Caceres","Cadiz","CN","Cantabria","Castellon","Ceuta","Ciudad Real","Cordoba","Cuenca","Gipuzkoa","Girona","Granada","Guadalajara","Guipuzcoa","Huelva","Huesca","Jaen","La Rioja","Las Palmas","Leon","Lleida","Lugo","Madrid","Malaga","Melilla","Murcia","Navarra","Ourense","Palencia","Pontevedra","Salamanca","Santa Cruz de Tenerife","Segovia","Sevilla","Soria","Tarragona","Teruel","Toledo","Valencia","Valladolid","Vizcaya","Zamora","Zaragoza"],LK:[],SD:[],SR:[],SJ:[],SZ:[],SE:[],CH:["AG","AR","AI","BL","BS","BE","FR","GE","GL","GR","JU","LU","NE","NW","OW","SH","SZ","SO","SG","TI","TG","UR","VS","VD","ZH","ZG"],SY:[],TW:[],TJ:[],TZ:[],TH:[],TL:[],TG:[],TK:[],TO:[],TT:[],TN:[],TR:[],TM:[],TC:[],TV:[],UG:[],UA:[],AE:[],GB:[],US:["AL","AK","AS","AZ","AR","AF","AA","AC","AE","AM","AP","CA","CO","CT","DE","DC","FM","FL","GA","GU","HI","ID","IL","IN","IA","KS","KY","LA","ME","MH","MD","MA","MI","MN","MS","MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND","MP","OH","OK","OR","PA","PR","RI","SC","SD","TN","TX","UT","VT","VI","VA","WA","WV","WI","WY"],UM:[],UY:[],UZ:[],VU:[],VE:[],VN:[],VG:[],VI:[],WF:[],EH:[],YE:[],ZM:[],ZW:[]};let s,n,i,d=e=>e;const l=r(e,"address-form");class c extends l{constructor(){super(...arguments),this.__ignoreAddressRestrictionsGetValue=()=>this.form.ignore_address_restrictions?["true"]:[],this.__ignoreAddressRestrictionsSetValue=e=>{this.edit({ignore_address_restrictions:e.includes("true")})},this.__ignoreAddressRestrictionsOptions=[{label:"option_true",value:"true"}],this.__countrySetValue=e=>{this.edit({country:e,region:""})}}static get v8n(){return[({address_name:e})=>e&&e.length>0||"address-name:v8n_required",({address_name:e})=>!e||e.length<=100||"address-name:v8n_too_long",({first_name:e})=>!e||e.length<=50||"first-name:v8n_too_long",({last_name:e})=>!e||e.length<=50||"last-name:v8n_too_long",({region:e})=>!e||e.length<=50||"region:v8n_too_long",({city:e})=>!e||e.length<=50||"city:v8n_too_long",({phone:e})=>!e||e.length<=50||"phone:v8n_too_long",({company:e})=>!e||e.length<=50||"company:v8n_too_long",({address2:e})=>!e||e.length<=100||"address-two:v8n_too_long",({address1:e})=>e&&e.length>0||"address-one:v8n_required",({address1:e})=>!e||e.length<=100||"address-one:v8n_too_long",({postal_code:e})=>!e||e.length<=50||"postal-code:v8n_too_long"]}get hiddenSelector(){var e,r;const o=[super.hiddenSelector.toString()];return(!!(null===(e=this.data)||void 0===e?void 0:e.is_default_shipping)||!!(null===(r=this.data)||void 0===r?void 0:r.is_default_billing))&&o.unshift("delete","address-name","header:copy-id"),new t(o.join(" ").trim())}get headerTitleKey(){var e,r;return(null===(e=this.data)||void 0===e?void 0:e.is_default_shipping)?"title_default_shipping":(null===(r=this.data)||void 0===r?void 0:r.is_default_billing)?"title_default_billing":super.headerTitleKey}renderBody(){const e=this.__regionOptions;return o(s||(s=d` ${0} <div class="grid grid-cols-2 gap-m"> <foxy-internal-text-control class="col-span-2" infer="address-name"> </foxy-internal-text-control> <foxy-internal-text-control infer="first-name"></foxy-internal-text-control> <foxy-internal-text-control infer="last-name"></foxy-internal-text-control> <foxy-internal-text-control infer="company"></foxy-internal-text-control> <foxy-internal-text-control infer="phone"></foxy-internal-text-control> <foxy-internal-text-control class="col-span-2" infer="address-one" property="address1"> </foxy-internal-text-control> <foxy-internal-text-control class="col-span-2" infer="address-two" property="address2"> </foxy-internal-text-control> <foxy-internal-select-control infer="country" .options="${0}" .setValue="${0}"> </foxy-internal-select-control> ${0} <foxy-internal-text-control infer="city"></foxy-internal-text-control> <foxy-internal-text-control infer="postal-code"></foxy-internal-text-control> <foxy-internal-checkbox-group-control infer="ignore-address-restrictions" class="col-span-2" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> </div> ${0} `),this.renderHeader(),this.__countryOptions,this.__countrySetValue,e.length>0?o(n||(n=d` <foxy-internal-select-control infer="region" .options="${0}"> </foxy-internal-select-control> `),e):o(i||(i=d`<foxy-internal-text-control infer="region"></foxy-internal-text-control>`)),this.__ignoreAddressRestrictionsGetValue,this.__ignoreAddressRestrictionsSetValue,this.__ignoreAddressRestrictionsOptions,super.renderBody())}async _fetch(...e){try{return await super._fetch(...e)}catch(e){let r;try{r=(await e.json())._embedded["fx:errors"][0].message}catch(r){throw e}throw r.includes("Country is invalid or disallowed by store configuration")?["error:country_banned"]:r.includes("this address name already exists for this customer")?["error:address_name_exists"]:e}}get __countryOptions(){return Object.keys(a).map((e=>({label:this.t(`country_${e.toLowerCase()}`),value:e})))}get __regionOptions(){var e,r;const t=null!==(e=this.form.country)&&void 0!==e?e:"";return(null!==(r=a[t])&&void 0!==r?r:[]).map((e=>({label:this.t(`country_${t.toLowerCase()}_region_${e.toLowerCase()}`),value:e})))}}customElements.define("foxy-address-form",c);export{c as AddressForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-6d11abd7.js";import"./shared-73045804.js";import"./shared-e7bff5de.js";import"./shared-a8233033.js";import{I as r}from"./shared-97514fcb.js";import"./foxy-transaction-card.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-transaction.js";import{a as o}from"./shared-226dd830.js";import"./shared-49ecea83.js";import{_ as t,B as e}from"./shared-0f6e4584.js";import{i as a}from"./shared-9803aa7c.js";import{h as s,s as i}from"./shared-dc73b9a5.js";import{a as n}from"./shared-25502f01.js";import"./shared-fb1602a2.js";import"./shared-98ddb87c.js";import"./shared-887e1795.js";import"./shared-2bd96ec7.js";import"./shared-3cf043a7.js";import"./shared-61ade33e.js";import"./shared-9bf7d9a7.js";import"./shared-9b895561.js";import"./shared-e7232c2b.js";import"./shared-9637a2de.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-59b7fcc0.js";import"./shared-f7a1193f.js";import"./shared-343d1fd7.js";import"./shared-0b01f721.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-a0c6a159.js";import"./shared-99940888.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-09fc6fa0.js";import"./shared-c11df800.js";import"./shared-4e709717.js";import"./foxy-pagination.js";import"./shared-ad76e640.js";import"./shared-ff7b2af6.js";import"./shared-0f00d4d8.js";import"./shared-19f46691.js";import"./shared-77e15843.js";import"./shared-6f4fa343.js";import"./shared-e47bd38e.js";import"./shared-8fbebf38.js";import"./shared-2c1dff50.js";import"./shared-651c44fa.js";import"./shared-ea8f9a88.js";import"./shared-5c4d786c.js";import"./shared-cb3b9d8b.js";import"./shared-fb1dd186.js";import"./shared-79d0699c.js";import"./shared-43e2c3f6.js";import"./foxy-copy-to-clipboard.js";import"./shared-1729e19a.js";import"./shared-6be24929.js";import"./shared-bab2ea2c.js";import"./shared-51c4a6dd.js";import"./shared-c4124870.js";import"./shared-df42c94f.js";import"./shared-471e77dd.js";import"./shared-c5a0cdd7.js";import"./foxy-billing-address-card.js";import"./foxy-custom-field-form.js";import"./shared-ea5ff8bc.js";import"./foxy-custom-field-card.js";import"./shared-63192750.js";import"./foxy-nucleon-element.js";import"./foxy-shipment-card.js";import"./shared-6ac0d05e.js";import"./foxy-payment-card.js";import"./shared-2bf89a21.js";import"./foxy-webhook-card.js";import"./foxy-webhook-form.js";import"./shared-96a392d9.js";import"./shared-4a652d60.js";import"./shared-01f18104.js";import"./shared-22ba9566.js";import"./foxy-webhook-status-card.js";import"./foxy-webhook-log-card.js";import"./foxy-item-card.js";import"./shared-90706e10.js";import"./foxy-item-form.js";import"./shared-d5ff9121.js";import"./shared-5bc86d84.js";import"./shared-deff3eda.js";import"./shared-3b975a29.js";import"./foxy-discount-detail-card.js";import"./foxy-coupon-detail-card.js";import"./foxy-item-category-card.js";import"./foxy-discount-builder.js";import"./shared-8438d4ca.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./shared-40c6b1f6.js";import"./shared-787e8da4.js";import"./foxy-customer-card.js";let d,m=r=>r;customElements.define("foxy-internal-admin-subscription-form-load-in-cart-action",class extends o{constructor(){super(...arguments),this.action=null}static get properties(){return t(t({},super.properties),{},{action:{}})}renderControl(){var r,o;const t=this.nucleon;let e;try{const a=new URL(null!==(o=null===(r=null==t?void 0:t.data)||void 0===r?void 0:r._links["fx:sub_token_url"].href)&&void 0!==o?o:"");"cancel"===this.action&&a.searchParams.set("sub_cancel","true"),e=a.toString()}catch(r){e=void 0}return s(d||(d=m` <a target="_blank" class="rounded font-medium text-primary group focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n class="transition-opacity group-hover-opacity-80" infer="" key="caption"> </foxy-i18n> </a> `),a(e))}});let c,f,l=r=>r;customElements.define("foxy-internal-admin-subscription-form-error",class extends o{renderControl(){var r,o;return s(c||(c=l` <p class="flex items-start gap-ds p-ds rounded border border-error-50" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px);gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} <span>${0}</span> </p> `),i(f||(f=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>`)),null===(o=null===(r=this.nucleon)||void 0===r?void 0:r.data)||void 0===o?void 0:o.error_message)}});let p,h,j=r=>r;const u=n(r,"admin-subscription-form");class y extends u{get hiddenSelector(){var r,o;const t=["delete",super.hiddenSelector.toString()];return(null===(r=this.data)||void 0===r?void 0:r.error_message)||t.unshift("error-message"),(null===(o=this.data)||void 0===o?void 0:o.is_active)||t.unshift("view-action","cancel-action"),new e(t.join(" ").trim())}get headerSubtitleOptions(){var r;return{context:(null===(r=this.data)||void 0===r?void 0:r.is_active)?"active":"inactive"}}renderHeaderActions(r){return s(p||(p=j` <foxy-internal-admin-subscription-form-load-in-cart-action infer="view-action"> </foxy-internal-admin-subscription-form-load-in-cart-action> <foxy-internal-admin-subscription-form-load-in-cart-action action="cancel" infer="cancel-action"> </foxy-internal-admin-subscription-form-load-in-cart-action> `))}renderBody(){var r,o,t,e,i;let n;try{const t=new URL(null!==(o=null===(r=this.data)||void 0===r?void 0:r._links["fx:transactions"].href)&&void 0!==o?o:"");t.searchParams.set("zoom","items"),n=t.toString()}catch(r){n=void 0}return s(h||(h=j` ${0} <foxy-internal-admin-subscription-form-error infer="error-message"> </foxy-internal-admin-subscription-form-error> <foxy-internal-summary-control infer="general"> <foxy-internal-date-control layout="summary-item" format="iso-long" infer="start-date"> </foxy-internal-date-control> <foxy-internal-frequency-control layout="summary-item" infer="frequency" allow-twice-a-month> </foxy-internal-frequency-control> <foxy-internal-date-control layout="summary-item" format="iso-long" infer="next-transaction-date"> </foxy-internal-date-control> <foxy-internal-date-control layout="summary-item" format="iso-long" infer="end-date"> </foxy-internal-date-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="overdue"> <foxy-internal-number-control layout="summary-item" suffix="${0}" infer="past-due-amount" min="0"> </foxy-internal-number-control> </foxy-internal-summary-control> ${0} <foxy-internal-async-list-control infer="attributes" class="min-w-0" first="${0}" item="foxy-attribute-card" form="foxy-attribute-form" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="transactions" class="min-w-0" first="${0}" item="foxy-transaction-card" form="foxy-transaction" hide-create-button hide-delete-button alert wide> </foxy-internal-async-list-control> ${0} `),this.renderHeader(),a(null===(t=this.data)||void 0===t?void 0:t._embedded["fx:transaction_template"].currency_code),this.renderTemplateOrSlot(),a(null===(i=null===(e=this.data)||void 0===e?void 0:e._links)||void 0===i?void 0:i["fx:attributes"].href),a(n),super.renderBody())}}customElements.define("foxy-admin-subscription-form",y);export{y as AdminSubscriptionForm};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-19f46691.js";import"./shared-9637a2de.js";import"./shared-59b7fcc0.js";import"./shared-887e1795.js";import"./foxy-collection-page.js";import"./foxy-pagination.js";import"./shared-49ecea83.js";import{I as t}from"./shared-97514fcb.js";import"./shared-c5a0cdd7.js";import"./foxy-copy-to-clipboard.js";import"./foxy-swipe-actions.js";import{_ as e}from"./shared-0f6e4584.js";import{a as s,T as r}from"./shared-25502f01.js";import{c as i}from"./shared-4e709717.js";import{c as o,h as n}from"./shared-dc73b9a5.js";import{C as a}from"./shared-0b01f721.js";import{N as h}from"./shared-24d71d01.js";import"./shared-fb1602a2.js";import"./shared-98ddb87c.js";import"./shared-77e15843.js";import"./shared-ff7b2af6.js";import"./shared-0f00d4d8.js";import"./shared-61ade33e.js";import"./shared-2bd96ec7.js";import"./foxy-spinner.js";import"./shared-f7a1193f.js";import"./shared-343d1fd7.js";import"./shared-a0c6a159.js";import"./shared-99940888.js";import"./shared-9803aa7c.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-226dd830.js";import"./shared-51c4a6dd.js";import"./shared-09fc6fa0.js";import"./shared-c11df800.js";import"./shared-bab2ea2c.js";import"./shared-1729e19a.js";import"./shared-6be24929.js";let l,d,c,p,f,u,m,_,b,y,g,v,x,$=t=>t;const j=Symbol(),w=Symbol();class k extends(s(t)){constructor(){super(...arguments),this.open=!1}static get properties(){return e(e({},super.properties),{},{open:{type:Boolean,reflect:!0}})}static get styles(){return[...super.styles,o(l||(l=$`.resource{display:grid;grid-template-columns:repeat(auto-fill,minmax(calc(18.75 * var(--lumo-space-m)),1fr));grid-gap:1px}.resource>:first-child{grid-column-start:1;grid-column-end:-2}foxy-internal-source-control::part(editor){border-radius:0;max-height:none;box-shadow:none;border:none}foxy-internal-source-control::part(helper-text),foxy-internal-source-control::part(label){position:absolute;width:1px;height:1px;padding-top:0;margin-top:-1px;overflow-x:hidden;overflow-y:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-top-width:0}`))]}static get v8n(){return[...super.v8n,t=>"string"!=typeof t[j]||"invalid_json"]}renderBody(){return n(d||(d=$` <details class="select-none rounded-t-l rounded-b-l overflow-hidden border border-contrast-10" ?open="${0}" @toggle="${0}"> <summary class="${0}"> <div class="flex items-center space-x-s p-s pr-m transition-colors cursor-pointer bg-contrast-5 hover-bg-contrast-10"> <foxy-copy-to-clipboard infer="copy-to-clipboard" text="${0}"> </foxy-copy-to-clipboard> <span class="font-medium truncate">${0}</span> <span class="flex-1"></span> ${0} ${0} ${0} </div> </summary> ${0} </details> `),this.open,(t=>{const e=t.currentTarget;this.open=e.open}),i({"ring-inset ring-primary-50 rounded-t-l":!0,"focus-outline-none focus-ring-2":!0,"rounded-b-l":!this.open}),this.href||this.parent,this.__renderTitle(),this.in({idle:{snapshot:"dirty"}})||this.in({idle:"template"})?n(c||(c=$` <foxy-internal-submit-control infer="${0}" theme="tertiary-inline success"> </foxy-internal-submit-control> `),this.href?"submit":"create"):"",this.in({idle:{snapshot:"dirty"}})||this.in({idle:{template:"dirty"}})?n(p||(p=$` <vaadin-button data-testid="undo" theme="tertiary-inline contrast" class="px-xs" @click="${0}"> <foxy-i18n infer="" key="undo"></foxy-i18n> </vaadin-button> `),(()=>this.undo())):"",this.in({idle:"snapshot"})?n(f||(f=$` <foxy-internal-delete-control infer="delete" theme="tertiary-inline error"> </foxy-internal-delete-control> `)):"",this.open?this.__renderForm():"")}async _fetch(...t){var e;try{const s=t[0]instanceof Request?t[0]:new Request(...t);if("POST"!==s.method)return await super._fetch(...t);const r=null!==(e=this.form[w])&&void 0!==e?e:JSON.stringify(this.form);return await super._fetch(s.url,{method:"POST",body:r})}catch(t){throw["invalid_json"]}}__renderTitle(){if(!this.href)return n(u||(u=$` <span class="text-tertiary">POST</span> <span>${0}</span> `),this.parent);let t="",e="",s="";try{const r=new URL(this.href);t=r.pathname,t.startsWith("/")&&(t=t.substring(1));const i=t.split("/");t=i.slice(0,i.length-1).join("/"),i.length>1&&(t=`${t}/`,e=i[i.length-1]),s=r.search}catch(e){t=this.href}return n(m||(m=$` ${0} `),[n(_||(_=$`<span>${0}</span>`),t),n(b||(b=$`<span class="text-primary">${0}</span>`),e),n(y||(y=$`<span class="text-tertiary">${0}</span>`),s)])}__renderForm(){return n(g||(g=$` <div class="bg-base"> <div class="${0} border-t border-contrast-5 bg-contrast-10"> <foxy-internal-source-control infer="editor" class="flex-1 bg-base" .getValue="${0}" .setValue="${0}"> </foxy-internal-source-control> ${0} </div> </div> `),this.data?"resource":"",(()=>this.__formAsString),(t=>this.__formAsString=t),this.data?n(v||(v=$` <div class="bg-base"> <ul class="bg-contrast-5 p-xs h-full"> ${0} </ul> </div> `),this.__links.map((([t,e])=>this.__renderLink(t,e.href,e.title)))):"")}get __links(){var t,e;const s=Object.entries(null!==(e=null===(t=this.data)||void 0===t?void 0:t._links)&&void 0!==e?e:{}).filter((([t,e])=>"self"!==t&&!Array.isArray(e)&&!e.templated));try{s.sort((([t],[e])=>t.localeCompare(e,this.lang)))}catch(t){s.sort((([t],[e])=>t.localeCompare(e)))}return s}get __formAsString(){const t=this.form,e=t[w],s=t[j];return"string"==typeof s?s:"string"==typeof e?e:JSON.stringify(t,((t,e)=>t.startsWith("_")?void 0:e),2)}set __formAsString(t){this.undo();try{const e=JSON.parse(t);"object"==typeof e&&this.edit(e),this.edit({[w]:t})}catch(e){this.edit({[j]:t})}}__renderLink(t,e,s){return n(x||(x=$` <li data-testclass="link" class="m-xs rounded overflow-hidden transition-colors hover-bg-contrast-5"> <foxy-swipe-actions> <button class="${0}" @click="${0}"> <div class="flex items-center"> <div class="flex-1 space-y-xs px-s min-w-0 text-s"> <div class="truncate font-medium">${0}</div> <div class="opacity-75 truncate">${0}</div> </div> <iron-icon class="icon-inline text-xl text-tertiary mr-s flex-shrink-0" icon="icons:chevron-right"> </iron-icon> </div> </button> <div slot="action" class="h-full flex"> <vaadin-button theme="secondary success" class="h-full rounded-none" @click="${0}"> POST </vaadin-button> </div> </foxy-swipe-actions> </li> `),i({"rounded leading-none space-y-xs block text-left w-full py-s":!0,"ring-inset ring-primary-50":!0,"focus-outline-none focus-ring-2 ":!0}),(()=>{const t=new CustomEvent("navigate:get",{bubbles:!0,detail:e});this.dispatchEvent(t)}),s||e,t,(()=>{const t=new CustomEvent("navigate:post",{bubbles:!0,detail:e});this.dispatchEvent(t)}))}}customElements.define("foxy-internal-api-browser-resource-form",k);let C,S,E,T,U,O,B,P,A,G=t=>t;const H=a(r(s(h,"api-browser")));class R extends H{constructor(){super(...arguments),this.home=null,this.__newCurrentUrl=null,this.__history=[],this.__renderItem=({href:t,html:e})=>t?e(S||(S=G`
|
|
2
2
|
<foxy-internal-api-browser-resource-form infer="" href=${0}>
|
|
3
3
|
</foxy-internal-api-browser-resource-form>
|
|
4
4
|
`),t):e(C||(C=G``)),this.__handleExistingResourceFetch=t=>{"DELETE"===t.request.method&&(t.preventDefault(),t.respondWith(new R.API(this).fetch(t.request).then((t=>(t.ok&&(this.__canGoBack?this.__goBack():this.__canGoHome?this.__goHome():(this.parent="",this.href="")),t)))))}}static get properties(){return e(e({},super.properties),{},{__newCurrentUrl:{attribute:!1},__history:{attribute:!1},home:{type:String}})}render(){var t;return n(E||(E=G` <div class="space-y-m"> <div class="flex items-center gap-s flex-wrap-reverse"> <vaadin-button title="${0}" theme="icon contrast" class="p-0" ?disabled="${0}" @click="${0}"> <iron-icon class="icon-inline text-m" icon="icons:arrow-back"></iron-icon> </vaadin-button> <vaadin-button title="${0}" theme="icon contrast" class="p-0" ?disabled="${0}" @click="${0}"> <iron-icon class="icon-inline text-m" icon="icons:home"></iron-icon> </vaadin-button> <vaadin-text-field placeholder="https://api.foxy.io/stores/0" aria-label="${0}" class="flex-1" ?disabled="${0}" ?readonly="${0}" .value="${0}" @keydown="${0}" @input="${0}"> </vaadin-text-field> ${0} <div class="grid grid-cols-2"> <vaadin-button title="${0}" theme="${0}" class="rounded-r-none p-0" ?disabled="${0}" @click="${0}"> GET </vaadin-button> <vaadin-button title="${0}" theme="${0}" class="rounded-l-none p-0" ?disabled="${0}" @click="${0}"> POST </vaadin-button> </div> </div> <div @navigate:get="${0}" @navigate:post="${0}"> ${0} </div> </div> `),this.t("go_back"),this.disabled||!this.__canGoBack,(()=>this.__goBack()),this.t("go_home"),this.disabled||!this.__canGoHome,(()=>this.__goHome()),this.t("current_url"),this.disabled,this.readonly,this.__newCurrentUrl||this.href||this.parent,(t=>"Enter"===t.key&&this.__go()),(t=>{const e=t.currentTarget;this.__newCurrentUrl=e.value}),this.__newCurrentUrl?n(T||(T=G` <vaadin-button title="${0}" theme="icon primary" class="p-0" ?disabled="${0}" @click="${0}"> <iron-icon class="icon-inline text-m" icon="icons:arrow-forward"></iron-icon> </vaadin-button> `),this.t("navigate"),this.disabled||this.in("busy"),this.__go):n(U||(U=G` <vaadin-button title="${0}" theme="icon contrast" class="p-0" ?disabled="${0}" @click="${0}"> <iron-icon class="icon-inline text-m" icon="icons:refresh"></iron-icon> </vaadin-button> `),this.t("refresh"),this.disabled||this.in("busy"),(()=>this.refresh())),this.t("get_mode"),this.href?"contrast primary":"contrast",this.disabled||"get"===this.__mode,(()=>this.__mode="get"),this.t("post_mode"),this.href?"contrast":"contrast primary",this.disabled||"post"===this.__mode,(()=>this.__mode="post"),(t=>{t.stopPropagation(),this.__history.push({href:this.href,parent:this.parent}),this.__newCurrentUrl=null,this.parent="",this.href=t.detail}),(t=>{t.stopPropagation(),this.__history.push({href:this.href,parent:this.parent}),this.__newCurrentUrl=null,this.parent=t.detail,this.href=""}),this.href?n(O||(O=G` ${0} `),(null===(t=this.data)||void 0===t?void 0:t._links.first)?n(B||(B=G` <foxy-pagination first="${0}" infer=""> <foxy-collection-page class="block space-y-m mb-m" infer="" .item="${0}"> </foxy-collection-page> </foxy-pagination> `),this.href,this.__renderItem):n(P||(P=G` <foxy-internal-api-browser-resource-form infer="" href="${0}" open @fetch="${0}"> </foxy-internal-api-browser-resource-form> `),this.href,this.__handleExistingResourceFetch)):n(A||(A=G` <foxy-internal-api-browser-resource-form infer="" parent="${0}" open @update="${0}"> </foxy-internal-api-browser-resource-form> `),this.parent,(t=>{const e=t.currentTarget;e.in({idle:"snapshot"})&&(this.href=e.data._links.self.href,this.parent="")})))}get __canGoBack(){return this.__history.length>0}get __canGoHome(){return this.href!==this.home}get __mode(){return this.href?"get":"post"}set __mode(t){"get"===t?(this.href=this.parent,this.parent=""):(this.parent=this.href,this.href="")}__goBack(){var t,e;const s=this.__history.length-1,r=this.__history[s];this.parent=null!==(t=null==r?void 0:r.parent)&&void 0!==t?t:"",this.href=null!==(e=null==r?void 0:r.href)&&void 0!==e?e:"",this.__history=this.__history.slice(0,s)}__goHome(){var t;this.__history=[],this.parent="",this.href=null!==(t=this.home)&&void 0!==t?t:""}__go(){if("string"==typeof this.__newCurrentUrl){this.__history.push({href:this.href,parent:this.parent});this[this.href?"href":"parent"]=this.__newCurrentUrl,this.__newCurrentUrl=null}}}customElements.define("foxy-api-browser",R);export{R as ApiBrowser};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-ea5ff8bc.js";import"./shared-01f18104.js";import{I as e}from"./shared-97514fcb.js";import{a as r}from"./shared-25502f01.js";import{B as s}from"./shared-0f6e4584.js";import{h as t}from"./shared-dc73b9a5.js";import"./shared-3cf043a7.js";import"./shared-fb1602a2.js";import"./shared-98ddb87c.js";import"./shared-2bd96ec7.js";import"./shared-61ade33e.js";import"./shared-77e15843.js";import"./shared-887e1795.js";import"./shared-226dd830.js";import"./shared-51c4a6dd.js";import"./shared-49ecea83.js";import"./shared-343d1fd7.js";import"./shared-f7a1193f.js";import"./shared-0b01f721.js";import"./shared-9803aa7c.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-19f46691.js";import"./shared-ff7b2af6.js";import"./shared-0f00d4d8.js";import"./shared-4e709717.js";import"./shared-22ba9566.js";import"./shared-9637a2de.js";import"./shared-09fc6fa0.js";import"./shared-c11df800.js";import"./foxy-copy-to-clipboard.js";import"./shared-1729e19a.js";import"./shared-6be24929.js";import"./shared-59b7fcc0.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let o,a,i=e=>e;const d=r(e,"applied-coupon-code-form");class p extends d{constructor(){super(...arguments),this.__ignoreUsageLimitsOptions=[{value:"checked",label:"option_checked"}],this.__getIgnoreUsageLimitsValue=()=>this.form.ignore_usage_limits?["checked"]:[],this.__setIgnoreUsageLimitsValue=e=>{this.edit({ignore_usage_limits:e.includes("checked")})}}static get v8n(){return[({code:e})=>!!e||"code:v8n_required"]}get readonlySelector(){return this.data?new s("not=delete"):super.readonlySelector}get hiddenSelector(){return new s(`timestamps ${super.hiddenSelector}`)}renderBody(){return t(o||(o=i` ${0} <foxy-internal-text-control helper-text="${0}" infer="code"> </foxy-internal-text-control> ${0} ${0} `),this.renderHeader(),this.t(this.data?"code.helper_text_existing":"code.helper_text_new"),this.data?"":t(a||(a=i` <foxy-internal-checkbox-group-control infer="ignore-usage-limits" class="-my-xs" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> `),this.__getIgnoreUsageLimitsValue,this.__setIgnoreUsageLimitsValue,this.__ignoreUsageLimitsOptions),super.renderBody())}}customElements.define("foxy-applied-coupon-code-form",p);export{p as AppliedCouponCodeForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-471e77dd.js";import"./shared-c5a0cdd7.js";import{I as r}from"./shared-97514fcb.js";import{a as e}from"./shared-25502f01.js";import{B as t}from"./shared-0f6e4584.js";import{h as i}from"./shared-dc73b9a5.js";import"./shared-fb1602a2.js";import"./shared-98ddb87c.js";import"./shared-2bd96ec7.js";import"./shared-61ade33e.js";import"./shared-77e15843.js";import"./shared-887e1795.js";import"./shared-226dd830.js";import"./shared-51c4a6dd.js";import"./shared-49ecea83.js";import"./shared-343d1fd7.js";import"./shared-f7a1193f.js";import"./shared-0b01f721.js";import"./shared-9803aa7c.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-4e709717.js";import"./shared-a0c6a159.js";import"./shared-9637a2de.js";import"./shared-09fc6fa0.js";import"./shared-c11df800.js";import"./foxy-copy-to-clipboard.js";import"./shared-1729e19a.js";import"./shared-6be24929.js";import"./shared-59b7fcc0.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let s,o=r=>r;const a=e(r,"attribute-form");class d extends a{constructor(){super(...arguments),this.__visibilityGetValue=()=>this.form.visibility||"private",this.__visibilityOptions=[{label:"option_public",value:"public"},{label:"option_restricted",value:"restricted"},{label:"option_private",value:"private"}]}static get v8n(){return[({value:r})=>r&&r.length>0||"value:v8n_required",({value:r})=>!r||r.length<=1e3||"value:v8n_too_long",({name:r})=>r&&r.length>0||"name:v8n_required",({name:r})=>!r||r.length<=500||"name:v8n_too_long"]}get hiddenSelector(){const r=[super.hiddenSelector.toString()];return this.href&&r.unshift("visibility"),new t(r.join(" ").trim())}get headerSubtitleKey(){var r;return`subtitle_${null===(r=this.data)||void 0===r?void 0:r.visibility}`}renderBody(){return i(s||(s=o` ${0} <foxy-internal-source-control infer="name"></foxy-internal-source-control> <foxy-internal-source-control infer="value"></foxy-internal-source-control> <foxy-internal-radio-group-control infer="visibility" .options="${0}" .getValue="${0}"> </foxy-internal-radio-group-control> ${0} `),this.renderHeader(),this.__visibilityOptions,this.__visibilityGetValue,super.renderBody())}}customElements.define("foxy-attribute-form",d);export{d as AttributeForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-9637a2de.js";import"./shared-2d75f154.js";import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-49ecea83.js";import"./shared-887e1795.js";import"./shared-fb1602a2.js";import"./shared-6be24929.js";import{h as e}from"./shared-dc73b9a5.js";import{S as t,T as s,a as r}from"./shared-25502f01.js";import{c as a}from"./shared-4e709717.js";import"./shared-4d172731.js";import"./shared-c11df800.js";import"./shared-b38762ef.js";import{G as d}from"./shared-0c7f9c0c.js";import"./shared-0f00d4d8.js";import"./shared-2c1dff50.js";import"./shared-9b895561.js";import"./shared-77e15843.js";import"./shared-8cb35eb4.js";import"./shared-ff7b2af6.js";import{W as i}from"./shared-f6573d25.js";import{C as n}from"./shared-0b01f721.js";import{N as o}from"./shared-24d71d01.js";import{i as m}from"./shared-9803aa7c.js";import{s as h}from"./shared-79d0699c.js";import"./shared-98ddb87c.js";import"./shared-2bd96ec7.js";import"./shared-61ade33e.js";import"./shared-59b7fcc0.js";import"./shared-43e2c3f6.js";import"./shared-0f6e4584.js";import"./shared-f7a1193f.js";import"./shared-343d1fd7.js";import"./shared-ad76e640.js";import"./shared-19f46691.js";import"./shared-6f4fa343.js";import"./shared-deff3eda.js";import"./shared-e47bd38e.js";import"./shared-8fbebf38.js";import"./shared-9bf7d9a7.js";import"./shared-e7232c2b.js";import"./shared-651c44fa.js";import"./shared-ea8f9a88.js";import"./shared-5c4d786c.js";import"./shared-99940888.js";import"./shared-ee36b83f.js";import"./shared-c286c5ad.js";import"./shared-5721fb53.js";import"./shared-fb1dd186.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";let l,p,c,f,u=e=>e;const b=t(s(n(r(o,"cancellation-form"))));class j extends b{constructor(){super(...arguments),this.__renderWarning=()=>{const{lang:t,ns:s}=this;return e(l||(l=u` <div> ${0} <x-warning> <foxy-i18n data-testid="warning" class="${0}" lang="${0}" key="end_subscription_explainer" ns="${0}"> </foxy-i18n> </x-warning> ${0} </div> `),this.renderTemplateOrSlot("warning:before"),a({"text-disabled":!this.in({idle:"snapshot"})}),t,s,this.renderTemplateOrSlot("warning:after"))},this.__renderEndDate=()=>{var t,s;const{constructor:r,lang:d,ns:i}=this,n=r.__tomorrow.getTime(),o=this.in({idle:"snapshot"});return e(p||(p=u` <div> ${0} <x-group frame> <foxy-i18n data-testid="end-date-label" class="${0}" slot="header" lang="${0}" key="end_date" ns="${0}"> </foxy-i18n> <foxy-internal-calendar data-testid="end-date" .checkAvailability="${0}" ?disabled="${0}" ?readonly="${0}" value="${0}" lang="${0}" @change="${0}"> </foxy-internal-calendar> </x-group> ${0} </div> `),this.renderTemplateOrSlot("end-date:before"),a({"text-disabled":!o}),d,i,(e=>e.getTime()>=n),!o||this.disabledSelector.matches("end-date",!0),!!(null===(t=this.data)||void 0===t?void 0:t.end_date)||this.readonlySelector.matches("end-date",!0),m(null!==(s=this.form.end_date)&&void 0!==s?s:void 0),d,(e=>{this.edit({end_date:e.target.value})}),this.renderTemplateOrSlot("end-date:after"))},this.__renderSubmit=()=>{const t=this.in({idle:{snapshot:{clean:"valid"}}})||this.in({idle:{snapshot:{dirty:"valid"}}});return e(c||(c=u` <div> ${0} <vaadin-button data-testid="submit" ?disabled="${0}" theme="primary error" class="w-full" @click="${0}"> <foxy-i18n ns="${0}" lang="${0}" key="end_subscription"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("submit:before"),!t||this.disabledSelector.matches("submit",!0),(()=>this.submit()),this.ns,this.lang,this.renderTemplateOrSlot("submit:after"))}}static get scopedElements(){return{"foxy-internal-calendar":customElements.get("foxy-internal-calendar"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"vaadin-button":customElements.get("vaadin-button"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-i18n":customElements.get("foxy-i18n"),"x-warning":i,"x-group":d}}static get v8n(){return[({end_date:e})=>!!e||"end_date_required"]}render(){var t,s;const r=this.hiddenSelector,d=this.in("busy"),i=this.in("fail");return e(f||(f=u` <div class="space-y-l font-lumo text-m text-body leading-m relative"> ${0} ${0} ${0} <div data-testid="spinner" class="${0}"> <foxy-spinner layout="vertical" class="m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l" state="${0}" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),r.matches("warning",!0)?"":this.__renderWarning(),r.matches("end-date",!0)?"":this.__renderEndDate(),r.matches("submit",!0)?"":this.__renderSubmit(),a({"transition duration-500 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":!d&&!i}),i?"error":d?"busy":"empty",this.lang,this.ns,null!==(s=null===(t=customElements.get("foxy-spinner"))||void 0===t?void 0:t.defaultNS)&&void 0!==s?s:"")}submit(){if(!this.form.end_date){const e=this.constructor;this.edit({end_date:h(e.__tomorrow)})}super.submit()}static get __tomorrow(){const e=new Date;return e.setDate(e.getDate()+1),e.setHours(0,0,0,0),e}}customElements.define("foxy-cancellation-form",j);export{j as CancellationForm};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-d5ff9121.js";import"./shared-6d11abd7.js";import"./shared-40c6b1f6.js";import"./shared-787e8da4.js";import"./shared-e5098b19.js";import"./shared-01f18104.js";import{I as e}from"./shared-97514fcb.js";import"./foxy-applied-coupon-code-card.js";import"./foxy-applied-coupon-code-form.js";import"./foxy-custom-field-card.js";import"./foxy-custom-field-form.js";import"./foxy-template-set-card.js";import"./foxy-nucleon-element.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-customer-card.js";import"./foxy-item-card.js";import"./foxy-item-form.js";import"./shared-49ecea83.js";import{a as t,I as r}from"./shared-226dd830.js";import{_ as o,B as i}from"./shared-0f6e4584.js";import{c as s}from"./shared-4e709717.js";import{h as n,c as a}from"./shared-dc73b9a5.js";import"./shared-9637a2de.js";import{R as l,a as d}from"./shared-25502f01.js";import{i as c}from"./shared-9803aa7c.js";import"./foxy-update-payment-method-form.js";import{U as u}from"./shared-cd96ff03.js";import{s as m}from"./shared-99940888.js";import"./shared-c4124870.js";import{g as p}from"./shared-bab2ea2c.js";import{T as _}from"./shared-63192750.js";import{T as f}from"./shared-8874ec69.js";import"./foxy-form-dialog.js";import"./shared-09fc6fa0.js";import"./shared-c11df800.js";import"./shared-c286c5ad.js";import"./shared-343d1fd7.js";import"./shared-0b01f721.js";import"./shared-f7a1193f.js";import"./shared-fb1602a2.js";import"./shared-98ddb87c.js";import"./shared-2bd96ec7.js";import"./shared-61ade33e.js";import"./shared-24d71d01.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-887e1795.js";import"./shared-3cf043a7.js";import"./shared-9bf7d9a7.js";import"./shared-9b895561.js";import"./shared-e7232c2b.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-59b7fcc0.js";import"./shared-a0c6a159.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-1729e19a.js";import"./shared-6be24929.js";import"./shared-8fbebf38.js";import"./shared-2c1dff50.js";import"./shared-ff7b2af6.js";import"./shared-651c44fa.js";import"./shared-0f00d4d8.js";import"./shared-19f46691.js";import"./shared-77e15843.js";import"./shared-ea8f9a88.js";import"./shared-5c4d786c.js";import"./shared-22ba9566.js";import"./foxy-copy-to-clipboard.js";import"./shared-df42c94f.js";import"./shared-ea5ff8bc.js";import"./shared-51c4a6dd.js";import"./shared-c5a0cdd7.js";import"./shared-471e77dd.js";import"./shared-90706e10.js";import"./shared-73045804.js";import"./shared-ad76e640.js";import"./shared-6f4fa343.js";import"./shared-e47bd38e.js";import"./shared-5bc86d84.js";import"./shared-deff3eda.js";import"./shared-3b975a29.js";import"./shared-e7bff5de.js";import"./shared-a8233033.js";import"./shared-cb3b9d8b.js";import"./shared-fb1dd186.js";import"./shared-79d0699c.js";import"./shared-43e2c3f6.js";import"./foxy-discount-detail-card.js";import"./foxy-coupon-detail-card.js";import"./foxy-item-category-card.js";import"./foxy-discount-builder.js";import"./shared-8438d4ca.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./foxy-payment-card-embed.js";import"./shared-8cb35eb4.js";import"./shared-01b2cad8.js";import"./shared-6d645dc5.js";let h,y,v=e=>e;customElements.define("foxy-internal-cart-form-create-session-action",class extends t{constructor(){super(...arguments),this.__loader=null}static get properties(){return o(o({},super.properties),{},{__loader:{attribute:!1}})}renderControl(){var e,t;const r=null===(e=this.__loader)||void 0===e?void 0:e.state,o=null===(t=this.__loader)||void 0===t?void 0:t.result;return o?n(h||(h=v` <a target="_blank" class="rounded font-medium transition-colors text-body focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n infer="" key="state_idle"></foxy-i18n> </a> `),o):n(y||(y=v` <div class="${0}"> <foxy-i18n infer="" key="${0}"> </foxy-i18n> </div> `),s({"transition-colors font-medium rounded":!0,"text-tertiary":"fail"!==r,"text-error":"fail"===r}),"fail"===r?"state_fail":"state_busy")}updated(e){var t;super.updated(e);const r=this.nucleon,o=null==r?void 0:r.data,i=null!==(t=null==o?void 0:o._links["fx:create_session"].href)&&void 0!==t?t:null;this.__reloadSessionHref(i)}async __reloadSessionHref(e){var t;if(console.log("RELOAD SESSION HREF",e),(null===(t=this.__loader)||void 0===t?void 0:t.href)===e)return;const r=this.nucleon;if(r)if(e){const t={result:null,state:"busy",href:e},o=new r.constructor.API(this);this.__loader=t;try{const r=await o.fetch(e,{method:"POST"});if(!r.ok)throw new Error;t.result=(await r.json()).cart_link,t.state="idle"}catch(e){t.state="fail"}finally{this.requestUpdate()}}else this.__loader=null}});let g;const x=a(g||(g=(e=>e)`
|
|
2
2
|
#dialog{
|
|
3
3
|
width:100dvw;
|
|
4
4
|
max-height:calc(100dvh - var(--lumo-space-m));
|
|
@@ -54,4 +54,4 @@ import"./shared-ecf479f2.js";import"./shared-ba7354fa.js";import"./shared-40c6b1
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
`));let b,$,j,k,w,P,S=e=>e;class U extends(l(r)){constructor(){super(...arguments),this.countries=null,this.customer=null,this.regions=null,this.type=null}static get properties(){return o(o({},super.properties),{},{countries:{},customer:{type:Object},regions:{},type:{}})}static get styles(){return[...super.styles,x]}get disabledSelector(){var e;const t=[super.disabledSelector.toString()];return(null===(e=this.__regionsLoader)||void 0===e?void 0:e.data)||t.unshift("address:state"),new i(t.join(" ").toString())}renderControl(){var e,t;const r=this.__regionOptions,o=null!==(e=this.type)&&void 0!==e?e:"billing",i=this.__mergedAddress;return n(b||(b=S` <div class="flex flex-col gap-m sm-flex-row items-start leading-xs"> <div class="flex-1"> <p class="text-m text-body">${0}</p> <p class="text-xs text-secondary">${0}</p> <p class="text-xs text-error" ?hidden="${0}"> ${0} </p> </div> <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> ${0} </button> </div> <dialog id="dialog" class="p-m bg-base shadow-xxl space-y-m"> <h2 class="text-xl font-medium"> <foxy-i18n infer="" key="label"></foxy-i18n> </h2> <foxy-internal-summary-control infer="name"> ${0} ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="address"> ${0} ${0} ${0} <foxy-internal-select-control placeholder="${0}" property="${0}_country" layout="summary-item" infer="country" .options="${0}"> </foxy-internal-select-control> ${0} ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="extra"> ${0} ${0} </foxy-internal-summary-control> <p class="text-xs text-secondary"> <foxy-i18n infer="" key="form_helper_text"></foxy-i18n> </p> <div class="flex justify-between gap-m"> <vaadin-button theme="error" ?disabled="${0}" ?hidden="${0}" @click="${0}"> <foxy-i18n infer="" key="reset"></foxy-i18n> </vaadin-button> <vaadin-button theme="primary" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="done"></foxy-i18n> </vaadin-button> </div> </dialog> <foxy-nucleon class="hidden" infer="" href="${0}" id="countriesLoader" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="regionsLoader" @update="${0}"> </foxy-nucleon> `),this.label,this.helperText,this.disabled||this.readonly,this._errorMessage,this.t("edit"),s({"text-left sm-text-right transition-colors transition-opacity":!0,"text-body cursor-pointer hover-opacity-80":!this.disabled&&!this.readonly,"text-secondary":this.readonly,"text-disabled":this.disabled,"font-medium":!this.readonly}),this.disabled||this.readonly,(()=>{var e;return null===(e=this.__dialog)||void 0===e?void 0:e.showModal()}),this.__isAddressEmpty?n($||($=S`<foxy-i18n infer="" key="not_set"></foxy-i18n>`)):n(j||(j=S` <div> ${0} ${0} </div> <div>${0}</div> <div>${0}</div> <div> ${0} ${0} ${0} ${0} ${0} ${0} </div> `),this.__renderAddressPart(i.first_name),this.__renderAddressPart(i.last_name),this.__renderAddressPart(i.company),this.__renderAddressPart(i.phone),this.__renderAddressPart(i.address1),this.__renderAddressPart(i.address2),this.__renderAddressPart(i.city),this.__renderAddressPart(i.state),this.__renderAddressPart(i.postal_code),this.__renderAddressPart(i.country)),this.__renderTextField(i.first_name),this.__renderTextField(i.last_name),this.__renderTextField(i.address1),this.__renderTextField(i.address2),this.__renderTextField(i.city),c(this.__getPlaceholder(i.country)),o,this.__countryOptions,r.length>0?n(k||(k=S` <foxy-internal-select-control placeholder="${0}" property="${0}_state" layout="summary-item" infer="state" .options="${0}"> </foxy-internal-select-control> `),c(this.__getPlaceholder(i.state)),o,r):this.__renderTextField(i.state),this.__renderTextField(i.postal_code),this.__renderTextField(i.company),this.__renderTextField(i.phone),this.disabled,this.readonly,(()=>{var e;null===(e=this.nucleon)||void 0===e||e.edit({[`${o}_first_name`]:null,[`${o}_last_name`]:null,[`${o}_company`]:null,[`${o}_address1`]:null,[`${o}_address2`]:null,[`${o}_city`]:null,[`${o}_state`]:null,[`${o}_postal_code`]:null,[`${o}_country`]:null,[`${o}_phone`]:null})}),this.disabled,(()=>{var e;return null===(e=this.__dialog)||void 0===e?void 0:e.close()}),c(null!==(t=this.countries)&&void 0!==t?t:void 0),(()=>this.requestUpdate()),c(this.__regionsUrl),(()=>this.requestUpdate()))}__renderAddressPart(e){const t=this.__getDisplayText(e);return n(w||(w=S` <span class="${0}"> ${0} </span> `),s({"text-success bg-success-10":e.modified&&!this.disabled,"bg-contrast-5":e.modified&&this.disabled,"inline-block":!!t,"rounded-s":!0,hidden:!t}),t)}__renderTextField(e){var t;return n(P||(P=S` <foxy-internal-text-control placeholder="${0}" property="${0}_${0}" layout="summary-item" infer="${0}" @clear="${0}"> </foxy-internal-text-control> `),c(this.__getPlaceholder(e)),null!==(t=this.type)&&void 0!==t?t:"billing",e.field,e.field.replace(/_/g,"-").replace("1","-one").replace("2","-two"),(()=>{var t,r;return null===(t=this.nucleon)||void 0===t?void 0:t.edit({[`${null!==(r=this.type)&&void 0!==r?r:"billing"}_${e.field}`]:null})}))}__getDisplayText(e){return e.value||(e.modified?"--":"")}__getPlaceholder(e){return e.modified?this.t("empty_modified_placeholder"):e.originalValue||void 0}get __countriesLoader(){return this.renderRoot.querySelector("#countriesLoader")}get __countryOptions(){var e,t,r;return Object.values(null!==(r=null===(t=null===(e=this.__countriesLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t.values)&&void 0!==r?r:{}).map((e=>({rawLabel:e.default,value:e.cc2})))}get __isAddressEmpty(){return Object.values(this.__mergedAddress).every((e=>""===this.__getDisplayText(e)))}get __regionOptions(){var e,t,r;return Object.values(null!==(r=null===(t=null===(e=this.__regionsLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t.values)&&void 0!==r?r:{}).map((e=>({rawLabel:e.default,value:e.code})))}get __regionsLoader(){return this.renderRoot.querySelector("#regionsLoader")}get __mergedAddress(){var e,t,r;const o=null===(e=this.nucleon)||void 0===e?void 0:e.form,i="shipping"===this.type?"shipping":"billing",s=null!==(r=null===(t=this.customer)||void 0===t?void 0:t._embedded[`fx:default_${i}_address`])&&void 0!==r?r:{},n=["first_name","last_name","company","address1","address2","city","state","postal_code","country","phone"].reduce(((e,t)=>{var r;const n=null==o?void 0:o[`${i}_${t}`],a=null==s?void 0:s["state"===t?"region":t];return e[t]={originalValue:String(null!=a?a:""),modified:null!==n,value:String(null!==(r=null!=n?n:a)&&void 0!==r?r:""),field:t},e}),{});return n}get __regionsUrl(){var e;try{const t=new URL(null!==(e=this.regions)&&void 0!==e?e:""),r=this.__mergedAddress.country.value;return r&&t.searchParams.set("country_code",r),t.toString()}catch(e){}}get __dialog(){return this.renderRoot.querySelector("#dialog")}}customElements.define("foxy-internal-cart-form-address-summary-item",U);let L,A=e=>e;customElements.define("foxy-internal-cart-form-payment-method-form",class extends e{constructor(){super(...arguments),this.defaultPaymentMethod=null,this.paymentCardEmbedUrl=null,this.selectionProps={}}static get properties(){return o(o({},super.properties),{},{defaultPaymentMethod:{attribute:"default-payment-method"},paymentCardEmbedUrl:{attribute:"payment-card-embed-url"},selectionProps:{attribute:!1}})}renderBody(){var e,t;return n(L||(L=A` <foxy-update-payment-method-form embed-url="${0}" infer="default-payment-method" href="${0}" @update="${0}"> </foxy-update-payment-method-form> <div class="flex items-center gap-m"> <div class="border-t border-contrast-10 flex-1"></div> <foxy-i18n class="text-tertiary" infer="" key="or"></foxy-i18n> <div class="border-t border-contrast-10 flex-1"></div> </div> <h2 class="text-xl font-medium"> <foxy-i18n infer="" key="select_previous"></foxy-i18n> </h2> <foxy-internal-async-list-control infer="selection" limit="5" form="foxy-null" hide-delete-button hide-create-button @itemclick="${0}" ...="${0}"> </foxy-internal-async-list-control> `),c(null!==(e=this.paymentCardEmbedUrl)&&void 0!==e?e:void 0),c(null!==(t=this.defaultPaymentMethod)&&void 0!==t?t:void 0),(e=>{var t;(null===(t=e.detail)||void 0===t?void 0:t.result)===u.UpdateResult.ResourceUpdated&&(this.edit({selection:""}),this.submit())}),(e=>{e.preventDefault(),this.edit({selection:e.detail}),this.submit()}),m(this.selectionProps))}});let E,O,C=e=>e;customElements.define("foxy-internal-cart-form-payment-method-card",class extends _{renderBody(){return super.renderBody({title:e=>{var t,r,o,i,s;const a=null===(r=null===(t=e._embedded)||void 0===t?void 0:t["fx:payments"])||void 0===r?void 0:r[0],l=null!==(o=null==a?void 0:a.cc_type)&&void 0!==o?o:"",d=null===(i=null==a?void 0:a.cc_exp_year)||void 0===i?void 0:i.substring(2),c=null==a?void 0:a.cc_exp_month,u=null===(s=null==a?void 0:a.cc_number_masked)||void 0===s?void 0:s.replace(/x/gi,"");return n(E||(E=C`<foxy-i18n infer="" key="title" .options="${0}"></foxy-i18n>`),{last4Digits:u,context:l&&d&&c&&u?"valid":"invalid",month:c,type:l,year:d})},subtitle:e=>{var t,r,o;const i=null===(r=null===(t=e._embedded)||void 0===t?void 0:t["fx:payments"])||void 0===r?void 0:r[0],s={id:p(e._links.self.href),date:null!==(o=null==i?void 0:i.date_created)&&void 0!==o?o:e.transaction_date};return n(O||(O=C`<foxy-i18n infer="" key="subtitle" .options="${0}"></foxy-i18n>`),s)}})}});let R,T,F,I,M,q=e=>e;customElements.define("foxy-internal-cart-form-totals-control",class extends t{constructor(){super(...arguments),this.__storeLoaderId="storeLoader"}renderControl(){var e,t,r,o,i;const s=null===(e=this.nucleon)||void 0===e?void 0:e.data;return s?n(T||(T=q` <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <p class="grid gap-x-s text-right text-s leading-m border-dashed border rounded border-contrast-20 whitespace-nowrap overflow-auto" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 2px);grid-template-columns:1fr min-content"> <span><foxy-i18n key="subtotal" infer=""></foxy-i18n>:</span> <span>${0}</span> <span><foxy-i18n infer="" key="total_shipping"></foxy-i18n>:</span> <span>${0} </span> <span><foxy-i18n infer="" key="total_tax"></foxy-i18n>:</span> <span>${0}</span> ${0} ${0} <span class="col-span-2 border-t border-dashed border-contrast-20 my-s"></span> <span class="col-span-2 flex gap-s justify-between items-center"> <span></span> <span class="text-xl font-medium leading-xs"> <foxy-i18n infer="" key="total"></foxy-i18n>: ${0} </span> </span> </p> `),c(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()),this.__renderPrice(s.total_item_price),this.__renderPrice(s.total_shipping,!0),this.__renderPrice(s.total_tax,!0),null===(r=null===(t=null==s?void 0:s._embedded)||void 0===t?void 0:t["fx:applied_gift_card_codes"])||void 0===r?void 0:r.map((e=>{var t;return n(F||(F=q` <span>${0}:</span> <span>${0}</span> `),e._embedded["fx:gift_card"].name,this.__renderPrice(null!==(t=e.balance_adjustment)&&void 0!==t?t:0,!0))})),null===(i=null===(o=null==s?void 0:s._embedded)||void 0===o?void 0:o["fx:discounts"])||void 0===i?void 0:i.map((e=>n(I||(I=q` <span data-testclass="discount">${0}:</span> <span>${0}</span> `),e.name,this.__renderPrice(e.amount,!0)))),this.__renderPrice(s.total_order)):n(R||(R=q``))}get __storeHref(){var e,t,r;return null===(r=null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:store"])||void 0===r?void 0:r.href}get __store(){var e,t;const r=`#${this.__storeLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(r))||void 0===e?void 0:e.data)&&void 0!==t?t:null}__renderPrice(e,t=!1){var r,o,i;const s=(null===(r=this.__store)||void 0===r?void 0:r.use_international_currency_symbol)?"code":"symbol",a=null===(i=null===(o=this.nucleon)||void 0===o?void 0:o.data)||void 0===i?void 0:i.currency_code;return n(M||(M=q` <foxy-i18n class="${0}" infer="" key="price" .options="${0}"> </foxy-i18n> `),t&&0!==e?e>0?"text-success":"text-error":"",{currencyDisplay:s,signDisplay:t?"exceptZero":"auto",amount:`${e} ${a}`})}});let D,H,V=e=>e;const z=l(d(e,"cart-form"));class B extends z{constructor(){super(...arguments),this.paymentCardEmbedUrl=null,this.itemCategories=null,this.templateSets=null,this.localeCodes=null,this.languages=null,this.customers=null,this.countries=null,this.regions=null,this.coupons=null,this.__languagesLoaderId="languagesLoader",this.__customerLoaderId="customerLoader",this.__paymentMethodUriGetDisplayValueOptions=e=>{var t,r,o,i;const s=null!==(o=null===(r=null===(t=null==e?void 0:e._embedded)||void 0===t?void 0:t["fx:payments"])||void 0===r?void 0:r[0])&&void 0!==o?o:null,n=null==s?void 0:s.cc_exp_month,a=null==s?void 0:s.cc_exp_year,l=null===(i=null==s?void 0:s.cc_number_masked)||void 0===i?void 0:i.replace(/x/g,""),d=null==s?void 0:s.cc_type;return{cc_exp_month:null!=n?n:"",cc_exp_year:null!=a?a:"",cc_last4:null!=l?l:"",cc_type:null!=d?d:"",context:l&&n&&a&&d?"":"empty"}},this.__paymentMethodUriSetValue=e=>{try{const t=new URL(e);t.search="",t.pathname+="/payments",this.edit({payment_method_uri:t.toString()})}catch(e){this.edit({payment_method_uri:""})}},this.__paymentMethodUriFilters=[{label:"filter_type",type:h.String,path:"payments:type",list:[{label:"filter_type_value_purchase_order",value:"purchase_order"},{label:"filter_type_value_amazon_mws",value:"amazon_mws"},{label:"filter_type_value_paypal_ec",value:"paypal_ec"},{label:"filter_type_value_paypal",value:"paypal"},{label:"filter_type_value_hosted",value:"hosted"},{label:"filter_type_value_ogone",value:"ogone"}]},{label:"filter_cc_type",type:h.String,path:"payments:cc_type",list:[{label:"filter_cc_type_value_mastercard",value:"mastercard"},{label:"filter_cc_type_value_discover",value:"discover"},{label:"filter_cc_type_value_unionpay",value:"unionpay"},{label:"filter_cc_type_value_maestro",value:"maestro"},{label:"filter_cc_type_value_diners",value:"diners"},{label:"filter_cc_type_value_visa",value:"visa"},{label:"filter_cc_type_value_amex",value:"amex"},{label:"filter_cc_type_value_jcb",value:"jcb"}]},{label:"filter_cc_number_masked",type:h.String,path:"payments:cc_number_masked"}],this.__customerUriSetValue=e=>{this.edit({customer_uri:e,customer_email:""})},this.__customerUriOptions=[{label:"filter_email",path:"email",type:h.String},{label:"filter_is_anonymous",path:"is_anonymous",type:h.String,list:[{value:"false",label:"filter_is_anonymous_value_false"},{value:"true",label:"filter_is_anonymous_value_true"}]}]}static get properties(){return o(o({},super.properties),{},{paymentCardEmbedUrl:{attribute:"payment-card-embed-url"},itemCategories:{attribute:"item-categories"},templateSets:{attribute:"template-sets"},localeCodes:{attribute:"locale-codes"},languages:{},customers:{},countries:{},regions:{},coupons:{}})}static get v8n(){return[({billing_first_name:e})=>!e||e.length<=50||"billing-first-name:v8n_too_long",({billing_last_name:e})=>!e||e.length<=50||"billing-last-name:v8n_too_long",({billing_state:e})=>!e||e.length<=50||"billing-state:v8n_too_long",({billing_city:e})=>!e||e.length<=50||"billing-city:v8n_too_long",({billing_phone:e})=>!e||e.length<=50||"billing-phone:v8n_too_long",({billing_company:e})=>!e||e.length<=50||"billing-company:v8n_too_long",({billing_address2:e})=>!e||e.length<=100||"billing-address-two:v8n_too_long",({billing_address1:e})=>!e||e.length<=100||"billing-address-one:v8n_too_long",({billing_postal_code:e})=>!e||e.length<=50||"billing-postal-code:v8n_too_long",({shipping_first_name:e})=>!e||e.length<=50||"shipping-first-name:v8n_too_long",({shipping_last_name:e})=>!e||e.length<=50||"shipping-last-name:v8n_too_long",({shipping_state:e})=>!e||e.length<=50||"shipping-state:v8n_too_long",({shipping_city:e})=>!e||e.length<=50||"shipping-city:v8n_too_long",({shipping_phone:e})=>!e||e.length<=50||"shipping-phone:v8n_too_long",({shipping_company:e})=>!e||e.length<=50||"shipping-company:v8n_too_long",({shipping_address2:e})=>!e||e.length<=100||"shipping-address-two:v8n_too_long",({shipping_address1:e})=>!e||e.length<=100||"shipping-address-one:v8n_too_long",({shipping_postal_code:e})=>!e||e.length<=50||"shipping-postal-code:v8n_too_long"]}get hiddenSelector(){const e=[super.hiddenSelector.toString()];return this.form.customer_uri?e.unshift("general:customer-email"):e.unshift("billing:payment-method-uri"),this.data?this.form.use_customer_shipping_address||e.unshift("shipping:shipping-address"):e.unshift("applied-coupon-codes","custom-fields","attributes","shipping","billing","totals","items"),new i(e.join(" ").trim())}renderHeaderActions(){return n(D||(D=V` <foxy-internal-cart-form-create-session-action infer="view-as-customer"> </foxy-internal-cart-form-create-session-action> `))}renderBody(){var e,t,r,o,i,s,a,l,d,u,m,p,_,h;const f=null===(e=this.data)||void 0===e?void 0:e._links,y=this.__customer,v=null==y?void 0:y._links["fx:customer_addresses"].href;return n(H||(H=V` ${0} <foxy-internal-summary-control infer="general"> <foxy-internal-resource-picker-control layout="summary-item" first="${0}" infer="template-set-uri" item="foxy-template-set-card"> </foxy-internal-resource-picker-control> <foxy-internal-select-control layout="summary-item" infer="language" .options="${0}"> </foxy-internal-select-control> <foxy-internal-resource-picker-control layout="summary-item" first="${0}" infer="customer-uri" item="foxy-customer-card" .setValue="${0}" .filters="${0}"> </foxy-internal-resource-picker-control> <foxy-internal-text-control layout="summary-item" infer="customer-email"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-async-list-control infer="items" class="min-w-0" first="${0}" alert item="foxy-item-card" form="foxy-item-form" .related="${0}" .itemProps="${0}" .formProps="${0}"> </foxy-internal-async-list-control> <foxy-internal-cart-form-totals-control class="min-w-0" infer="totals"> </foxy-internal-cart-form-totals-control> <foxy-internal-async-list-control infer="applied-coupon-codes" class="min-w-0" first="${0}" item="foxy-applied-coupon-code-card" form="foxy-applied-coupon-code-form" alert .related="${0}"> </foxy-internal-async-list-control> <foxy-internal-summary-control infer="billing"> <foxy-internal-resource-picker-control placeholder="${0}" layout="summary-item" first="${0}" infer="payment-method-uri" item="foxy-internal-cart-form-payment-method-card" form="foxy-internal-cart-form-payment-method-form" .getDisplayValueOptions="${0}" .formProps="${0}" .setValue="${0}" .filters="${0}"> </foxy-internal-resource-picker-control> <foxy-internal-cart-form-address-summary-item countries="${0}" regions="${0}" infer="billing-address" type="billing" .customer="${0}"> </foxy-internal-cart-form-address-summary-item> </foxy-internal-summary-control> <foxy-internal-summary-control infer="shipping"> <foxy-internal-switch-control infer="use-customer-shipping-address" invert> </foxy-internal-switch-control> <foxy-internal-cart-form-address-summary-item countries="${0}" regions="${0}" infer="shipping-address" type="shipping" .customer="${0}"> </foxy-internal-cart-form-address-summary-item> </foxy-internal-summary-control> <foxy-internal-async-list-control infer="custom-fields" class="min-w-0" first="${0}" limit="5" item="foxy-custom-field-card" form="foxy-custom-field-form" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="attributes" class="min-w-0" first="${0}" limit="5" item="foxy-attribute-card" form="foxy-attribute-form" alert> </foxy-internal-async-list-control> ${0} <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),c(null!==(t=this.templateSets)&&void 0!==t?t:void 0),this.__languageOptions,c(null!==(r=this.customers)&&void 0!==r?r:void 0),this.__customerUriSetValue,this.__customerUriOptions,c(this.__itemsHref),this.href?[this.href]:[],{"locale-codes":null!==(o=this.localeCodes)&&void 0!==o?o:""},{"customer-addresses":null!=v?v:"","item-categories":null!==(i=this.itemCategories)&&void 0!==i?i:"","locale-codes":null!==(s=this.localeCodes)&&void 0!==s?s:"",coupons:null!==(a=this.coupons)&&void 0!==a?a:""},c(null==f?void 0:f["fx:applied_coupon_codes"].href),this.href?[this.href]:[],this.__paymentMethodUriPlaceholder,c(this.__transactionsWithPaymentsUrl),this.__paymentMethodUriGetDisplayValueOptions,{"default-payment-method":null!==(l=null==y?void 0:y._links["fx:default_payment_method"].href)&&void 0!==l?l:"","payment-card-embed-url":null!==(d=this.__pickerPaymentCardEmbedUrl)&&void 0!==d?d:""},this.__paymentMethodUriSetValue,this.__paymentMethodUriFilters,c(null!==(u=this.countries)&&void 0!==u?u:void 0),c(null!==(m=this.regions)&&void 0!==m?m:void 0),y,c(null!==(p=this.countries)&&void 0!==p?p:void 0),c(null!==(_=this.regions)&&void 0!==_?_:void 0),y,c(null==f?void 0:f["fx:custom_fields"].href),c(null==f?void 0:f["fx:attributes"].href),super.renderBody(),c(null!==(h=this.languages)&&void 0!==h?h:void 0),this.__languagesLoaderId,(()=>this.requestUpdate()),c(this.__customerHref),this.__customerLoaderId,(()=>this.requestUpdate()))}get __paymentMethodUriPlaceholder(){var e,t,r,o,i,s;const n=null===(e=this.__customer)||void 0===e?void 0:e._embedded["fx:default_payment_method"],a=null!==(t=null==n?void 0:n.cc_exp_month)&&void 0!==t?t:null,l=null!==(r=null==n?void 0:n.cc_exp_year)&&void 0!==r?r:null,d=null!==(i=null===(o=null==n?void 0:n.cc_number_masked)||void 0===o?void 0:o.replace(/x/g,""))&&void 0!==i?i:null,c=null!==(s=null==n?void 0:n.cc_type)&&void 0!==s?s:null;return this.t("billing.payment-method-uri.value",{cc_exp_month:null!=a?a:"",cc_exp_year:null!=l?l:"",cc_last4:null!=d?d:"",cc_type:null!=c?c:"",context:d&&a&&l&&c?"":"empty"})}get __transactionsWithPaymentsUrl(){var e,t;try{const r=new URL(null!==(t=null===(e=this.__customer)||void 0===e?void 0:e._links["fx:transactions"].href)&&void 0!==t?t:"");return r.searchParams.set("zoom","payments"),r.toString()}catch(e){}}get __pickerPaymentCardEmbedUrl(){var e,t;try{const r=new URL(null!==(e=this.paymentCardEmbedUrl)&&void 0!==e?e:""),o=p(null!==(t=this.form.template_set_uri)&&void 0!==t?t:"");if(null!==o)return r.searchParams.set("template_set_id",String(o)),r.toString()}catch(e){}}get __customerHref(){var e;try{const t=new URL(null!==(e=this.form.customer_uri)&&void 0!==e?e:"");return t.searchParams.set("zoom","default_payment_method,default_billing_address,default_shipping_address"),t.toString()}catch(e){}}get __itemsHref(){var e,t;try{const r=new URL(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:items"].href)&&void 0!==t?t:"");return r.searchParams.set("zoom","item_options"),r.toString()}catch(e){}}get __languageOptions(){var e,t;const r=this.renderRoot.querySelector(`#${this.__languagesLoaderId}`);return Object.entries(null!==(t=null===(e=null==r?void 0:r.data)||void 0===e?void 0:e.values)&&void 0!==t?t:{}).map((([e,t])=>({rawLabel:t,value:e})))}get __customer(){var e;return null===(e=this.renderRoot.querySelector(`#${this.__customerLoaderId}`))||void 0===e?void 0:e.data}}customElements.define("foxy-cart-form",B);export{B as CartForm};
|
|
57
|
+
`));let b,$,j,k,w,P,S=e=>e;class U extends(l(r)){constructor(){super(...arguments),this.countries=null,this.customer=null,this.regions=null,this.type=null}static get properties(){return o(o({},super.properties),{},{countries:{},customer:{type:Object},regions:{},type:{}})}static get styles(){return[...super.styles,x]}get disabledSelector(){var e;const t=[super.disabledSelector.toString()];return(null===(e=this.__regionsLoader)||void 0===e?void 0:e.data)||t.unshift("address:state"),new i(t.join(" ").toString())}renderControl(){var e,t;const r=this.__regionOptions,o=null!==(e=this.type)&&void 0!==e?e:"billing",i=this.__mergedAddress;return n(b||(b=S` <div class="flex flex-col gap-m sm-flex-row items-start leading-xs"> <div class="flex-1"> <p class="text-m text-body">${0}</p> <p class="text-xs text-secondary">${0}</p> <p class="text-xs text-error" ?hidden="${0}"> ${0} </p> </div> <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> ${0} </button> </div> <dialog id="dialog" class="p-m bg-base shadow-xxl space-y-m"> <h2 class="text-xl font-medium"> <foxy-i18n infer="" key="label"></foxy-i18n> </h2> <foxy-internal-summary-control infer="name"> ${0} ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="address"> ${0} ${0} ${0} <foxy-internal-select-control placeholder="${0}" property="${0}_country" layout="summary-item" infer="country" .options="${0}"> </foxy-internal-select-control> ${0} ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="extra"> ${0} ${0} </foxy-internal-summary-control> <p class="text-xs text-secondary"> <foxy-i18n infer="" key="form_helper_text"></foxy-i18n> </p> <div class="flex justify-between gap-m"> <vaadin-button theme="error" ?disabled="${0}" ?hidden="${0}" @click="${0}"> <foxy-i18n infer="" key="reset"></foxy-i18n> </vaadin-button> <vaadin-button theme="primary" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="done"></foxy-i18n> </vaadin-button> </div> </dialog> <foxy-nucleon class="hidden" infer="" href="${0}" id="countriesLoader" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="regionsLoader" @update="${0}"> </foxy-nucleon> `),this.label,this.helperText,this.disabled||this.readonly,this._errorMessage,this.t("edit"),s({"text-left sm-text-right transition-colors transition-opacity":!0,"text-body cursor-pointer hover-opacity-80":!this.disabled&&!this.readonly,"text-secondary":this.readonly,"text-disabled":this.disabled,"font-medium":!this.readonly}),this.disabled||this.readonly,(()=>{var e;return null===(e=this.__dialog)||void 0===e?void 0:e.showModal()}),this.__isAddressEmpty?n($||($=S`<foxy-i18n infer="" key="not_set"></foxy-i18n>`)):n(j||(j=S` <div> ${0} ${0} </div> <div>${0}</div> <div>${0}</div> <div> ${0} ${0} ${0} ${0} ${0} ${0} </div> `),this.__renderAddressPart(i.first_name),this.__renderAddressPart(i.last_name),this.__renderAddressPart(i.company),this.__renderAddressPart(i.phone),this.__renderAddressPart(i.address1),this.__renderAddressPart(i.address2),this.__renderAddressPart(i.city),this.__renderAddressPart(i.state),this.__renderAddressPart(i.postal_code),this.__renderAddressPart(i.country)),this.__renderTextField(i.first_name),this.__renderTextField(i.last_name),this.__renderTextField(i.address1),this.__renderTextField(i.address2),this.__renderTextField(i.city),c(this.__getPlaceholder(i.country)),o,this.__countryOptions,r.length>0?n(k||(k=S` <foxy-internal-select-control placeholder="${0}" property="${0}_state" layout="summary-item" infer="state" .options="${0}"> </foxy-internal-select-control> `),c(this.__getPlaceholder(i.state)),o,r):this.__renderTextField(i.state),this.__renderTextField(i.postal_code),this.__renderTextField(i.company),this.__renderTextField(i.phone),this.disabled,this.readonly,(()=>{var e;null===(e=this.nucleon)||void 0===e||e.edit({[`${o}_first_name`]:null,[`${o}_last_name`]:null,[`${o}_company`]:null,[`${o}_address1`]:null,[`${o}_address2`]:null,[`${o}_city`]:null,[`${o}_state`]:null,[`${o}_postal_code`]:null,[`${o}_country`]:null,[`${o}_phone`]:null})}),this.disabled,(()=>{var e;return null===(e=this.__dialog)||void 0===e?void 0:e.close()}),c(null!==(t=this.countries)&&void 0!==t?t:void 0),(()=>this.requestUpdate()),c(this.__regionsUrl),(()=>this.requestUpdate()))}__renderAddressPart(e){const t=this.__getDisplayText(e);return n(w||(w=S` <span class="${0}"> ${0} </span> `),s({"text-success bg-success-10":e.modified&&!this.disabled,"bg-contrast-5":e.modified&&this.disabled,"inline-block":!!t,"rounded-s":!0,hidden:!t}),t)}__renderTextField(e){var t;return n(P||(P=S` <foxy-internal-text-control placeholder="${0}" property="${0}_${0}" layout="summary-item" infer="${0}" @clear="${0}"> </foxy-internal-text-control> `),c(this.__getPlaceholder(e)),null!==(t=this.type)&&void 0!==t?t:"billing",e.field,e.field.replace(/_/g,"-").replace("1","-one").replace("2","-two"),(()=>{var t,r;return null===(t=this.nucleon)||void 0===t?void 0:t.edit({[`${null!==(r=this.type)&&void 0!==r?r:"billing"}_${e.field}`]:null})}))}__getDisplayText(e){return e.value||(e.modified?"--":"")}__getPlaceholder(e){return e.modified?this.t("empty_modified_placeholder"):e.originalValue||void 0}get __countriesLoader(){return this.renderRoot.querySelector("#countriesLoader")}get __countryOptions(){var e,t,r;return Object.values(null!==(r=null===(t=null===(e=this.__countriesLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t.values)&&void 0!==r?r:{}).map((e=>({rawLabel:e.default,value:e.cc2})))}get __isAddressEmpty(){return Object.values(this.__mergedAddress).every((e=>""===this.__getDisplayText(e)))}get __regionOptions(){var e,t,r;return Object.values(null!==(r=null===(t=null===(e=this.__regionsLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t.values)&&void 0!==r?r:{}).map((e=>({rawLabel:e.default,value:e.code})))}get __regionsLoader(){return this.renderRoot.querySelector("#regionsLoader")}get __mergedAddress(){var e,t,r;const o=null===(e=this.nucleon)||void 0===e?void 0:e.form,i="shipping"===this.type?"shipping":"billing",s=null!==(r=null===(t=this.customer)||void 0===t?void 0:t._embedded[`fx:default_${i}_address`])&&void 0!==r?r:{},n=["first_name","last_name","company","address1","address2","city","state","postal_code","country","phone"].reduce(((e,t)=>{var r;const n=null==o?void 0:o[`${i}_${t}`],a=null==s?void 0:s["state"===t?"region":t];return e[t]={originalValue:String(null!=a?a:""),modified:null!==n,value:String(null!==(r=null!=n?n:a)&&void 0!==r?r:""),field:t},e}),{});return n}get __regionsUrl(){var e;try{const t=new URL(null!==(e=this.regions)&&void 0!==e?e:""),r=this.__mergedAddress.country.value;return r&&t.searchParams.set("country_code",r),t.toString()}catch(e){}}get __dialog(){return this.renderRoot.querySelector("#dialog")}}customElements.define("foxy-internal-cart-form-address-summary-item",U);let L,A=e=>e;customElements.define("foxy-internal-cart-form-payment-method-form",class extends e{constructor(){super(...arguments),this.defaultPaymentMethod=null,this.paymentCardEmbedUrl=null,this.selectionProps={}}static get properties(){return o(o({},super.properties),{},{defaultPaymentMethod:{attribute:"default-payment-method"},paymentCardEmbedUrl:{attribute:"payment-card-embed-url"},selectionProps:{attribute:!1}})}renderBody(){var e,t;return n(L||(L=A` <foxy-update-payment-method-form embed-url="${0}" infer="default-payment-method" href="${0}" @update="${0}"> </foxy-update-payment-method-form> <div class="flex items-center gap-m"> <div class="border-t border-contrast-10 flex-1"></div> <foxy-i18n class="text-tertiary" infer="" key="or"></foxy-i18n> <div class="border-t border-contrast-10 flex-1"></div> </div> <h2 class="text-xl font-medium"> <foxy-i18n infer="" key="select_previous"></foxy-i18n> </h2> <foxy-internal-async-list-control infer="selection" limit="5" form="foxy-null" hide-delete-button hide-create-button @itemclick="${0}" ...="${0}"> </foxy-internal-async-list-control> `),c(null!==(e=this.paymentCardEmbedUrl)&&void 0!==e?e:void 0),c(null!==(t=this.defaultPaymentMethod)&&void 0!==t?t:void 0),(e=>{var t;(null===(t=e.detail)||void 0===t?void 0:t.result)===u.UpdateResult.ResourceUpdated&&(this.edit({selection:""}),this.submit())}),(e=>{e.preventDefault(),this.edit({selection:e.detail}),this.submit()}),m(this.selectionProps))}});let E,O,C=e=>e;customElements.define("foxy-internal-cart-form-payment-method-card",class extends _{renderBody(){return super.renderBody({title:e=>{var t,r,o,i,s;const a=null===(r=null===(t=e._embedded)||void 0===t?void 0:t["fx:payments"])||void 0===r?void 0:r[0],l=null!==(o=null==a?void 0:a.cc_type)&&void 0!==o?o:"",d=null===(i=null==a?void 0:a.cc_exp_year)||void 0===i?void 0:i.substring(2),c=null==a?void 0:a.cc_exp_month,u=null===(s=null==a?void 0:a.cc_number_masked)||void 0===s?void 0:s.replace(/x/gi,"");return n(E||(E=C`<foxy-i18n infer="" key="title" .options="${0}"></foxy-i18n>`),{last4Digits:u,context:l&&d&&c&&u?"valid":"invalid",month:c,type:l,year:d})},subtitle:e=>{var t,r,o;const i=null===(r=null===(t=e._embedded)||void 0===t?void 0:t["fx:payments"])||void 0===r?void 0:r[0],s={id:p(e._links.self.href),date:null!==(o=null==i?void 0:i.date_created)&&void 0!==o?o:e.transaction_date};return n(O||(O=C`<foxy-i18n infer="" key="subtitle" .options="${0}"></foxy-i18n>`),s)}})}});let R,T,F,I,M,q=e=>e;customElements.define("foxy-internal-cart-form-totals-control",class extends t{constructor(){super(...arguments),this.__storeLoaderId="storeLoader"}renderControl(){var e,t,r,o,i;const s=null===(e=this.nucleon)||void 0===e?void 0:e.data;return s?n(T||(T=q` <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <p class="grid gap-x-s text-right text-s leading-m border-dashed border rounded border-contrast-20 whitespace-nowrap overflow-auto" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 2px);grid-template-columns:1fr min-content"> <span><foxy-i18n key="subtotal" infer=""></foxy-i18n>:</span> <span>${0}</span> <span><foxy-i18n infer="" key="total_shipping"></foxy-i18n>:</span> <span>${0} </span> <span><foxy-i18n infer="" key="total_tax"></foxy-i18n>:</span> <span>${0}</span> ${0} ${0} <span class="col-span-2 border-t border-dashed border-contrast-20 my-s"></span> <span class="col-span-2 flex gap-s justify-between items-center"> <span></span> <span class="text-xl font-medium leading-xs"> <foxy-i18n infer="" key="total"></foxy-i18n>: ${0} </span> </span> </p> `),c(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()),this.__renderPrice(s.total_item_price),this.__renderPrice(s.total_shipping,!0),this.__renderPrice(s.total_tax,!0),null===(r=null===(t=null==s?void 0:s._embedded)||void 0===t?void 0:t["fx:applied_gift_card_codes"])||void 0===r?void 0:r.map((e=>{var t;return n(F||(F=q` <span>${0}:</span> <span>${0}</span> `),e._embedded["fx:gift_card"].name,this.__renderPrice(null!==(t=e.balance_adjustment)&&void 0!==t?t:0,!0))})),null===(i=null===(o=null==s?void 0:s._embedded)||void 0===o?void 0:o["fx:discounts"])||void 0===i?void 0:i.map((e=>n(I||(I=q` <span data-testclass="discount">${0}:</span> <span>${0}</span> `),e.name,this.__renderPrice(e.amount,!0)))),this.__renderPrice(s.total_order)):n(R||(R=q``))}get __storeHref(){var e,t,r;return null===(r=null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:store"])||void 0===r?void 0:r.href}get __store(){var e,t;const r=`#${this.__storeLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(r))||void 0===e?void 0:e.data)&&void 0!==t?t:null}__renderPrice(e,t=!1){var r,o,i;const s=(null===(r=this.__store)||void 0===r?void 0:r.use_international_currency_symbol)?"code":"symbol",a=null===(i=null===(o=this.nucleon)||void 0===o?void 0:o.data)||void 0===i?void 0:i.currency_code;return n(M||(M=q` <foxy-i18n class="${0}" infer="" key="price" .options="${0}"> </foxy-i18n> `),t&&0!==e?e>0?"text-success":"text-error":"",{currencyDisplay:s,signDisplay:t?"exceptZero":"auto",amount:`${e} ${a}`})}});let D,H,V=e=>e;const z=l(d(e,"cart-form"));class B extends z{constructor(){super(...arguments),this.paymentCardEmbedUrl=null,this.itemCategories=null,this.templateSets=null,this.localeCodes=null,this.languages=null,this.customers=null,this.countries=null,this.regions=null,this.coupons=null,this.__languagesLoaderId="languagesLoader",this.__customerLoaderId="customerLoader",this.__paymentMethodUriGetDisplayValueOptions=e=>{var t,r,o,i;const s=null!==(o=null===(r=null===(t=null==e?void 0:e._embedded)||void 0===t?void 0:t["fx:payments"])||void 0===r?void 0:r[0])&&void 0!==o?o:null,n=null==s?void 0:s.cc_exp_month,a=null==s?void 0:s.cc_exp_year,l=null===(i=null==s?void 0:s.cc_number_masked)||void 0===i?void 0:i.replace(/x/g,""),d=null==s?void 0:s.cc_type;return{cc_exp_month:null!=n?n:"",cc_exp_year:null!=a?a:"",cc_last4:null!=l?l:"",cc_type:null!=d?d:"",context:l&&n&&a&&d?"":"empty"}},this.__paymentMethodUriSetValue=e=>{try{const t=new URL(e);t.search="",t.pathname+="/payments",this.edit({payment_method_uri:t.toString()})}catch(e){this.edit({payment_method_uri:""})}},this.__paymentMethodUriFilters=[{label:"filter_type",type:f.String,path:"payments:type",list:[{label:"filter_type_value_purchase_order",value:"purchase_order"},{label:"filter_type_value_amazon_mws",value:"amazon_mws"},{label:"filter_type_value_paypal_ec",value:"paypal_ec"},{label:"filter_type_value_paypal",value:"paypal"},{label:"filter_type_value_hosted",value:"hosted"},{label:"filter_type_value_ogone",value:"ogone"}]},{label:"filter_cc_type",type:f.String,path:"payments:cc_type",list:[{label:"filter_cc_type_value_mastercard",value:"mastercard"},{label:"filter_cc_type_value_discover",value:"discover"},{label:"filter_cc_type_value_unionpay",value:"unionpay"},{label:"filter_cc_type_value_maestro",value:"maestro"},{label:"filter_cc_type_value_diners",value:"diners"},{label:"filter_cc_type_value_visa",value:"visa"},{label:"filter_cc_type_value_amex",value:"amex"},{label:"filter_cc_type_value_jcb",value:"jcb"}]},{label:"filter_cc_number_masked",type:f.String,path:"payments:cc_number_masked"}],this.__customerUriSetValue=e=>{this.edit({customer_uri:e,customer_email:""})},this.__customerUriOptions=[{label:"filter_email",path:"email",type:f.String},{label:"filter_is_anonymous",path:"is_anonymous",type:f.String,list:[{value:"false",label:"filter_is_anonymous_value_false"},{value:"true",label:"filter_is_anonymous_value_true"}]}]}static get properties(){return o(o({},super.properties),{},{paymentCardEmbedUrl:{attribute:"payment-card-embed-url"},itemCategories:{attribute:"item-categories"},templateSets:{attribute:"template-sets"},localeCodes:{attribute:"locale-codes"},languages:{},customers:{},countries:{},regions:{},coupons:{}})}static get v8n(){return[({billing_first_name:e})=>!e||e.length<=50||"billing-first-name:v8n_too_long",({billing_last_name:e})=>!e||e.length<=50||"billing-last-name:v8n_too_long",({billing_state:e})=>!e||e.length<=50||"billing-state:v8n_too_long",({billing_city:e})=>!e||e.length<=50||"billing-city:v8n_too_long",({billing_phone:e})=>!e||e.length<=50||"billing-phone:v8n_too_long",({billing_company:e})=>!e||e.length<=50||"billing-company:v8n_too_long",({billing_address2:e})=>!e||e.length<=100||"billing-address-two:v8n_too_long",({billing_address1:e})=>!e||e.length<=100||"billing-address-one:v8n_too_long",({billing_postal_code:e})=>!e||e.length<=50||"billing-postal-code:v8n_too_long",({shipping_first_name:e})=>!e||e.length<=50||"shipping-first-name:v8n_too_long",({shipping_last_name:e})=>!e||e.length<=50||"shipping-last-name:v8n_too_long",({shipping_state:e})=>!e||e.length<=50||"shipping-state:v8n_too_long",({shipping_city:e})=>!e||e.length<=50||"shipping-city:v8n_too_long",({shipping_phone:e})=>!e||e.length<=50||"shipping-phone:v8n_too_long",({shipping_company:e})=>!e||e.length<=50||"shipping-company:v8n_too_long",({shipping_address2:e})=>!e||e.length<=100||"shipping-address-two:v8n_too_long",({shipping_address1:e})=>!e||e.length<=100||"shipping-address-one:v8n_too_long",({shipping_postal_code:e})=>!e||e.length<=50||"shipping-postal-code:v8n_too_long"]}get hiddenSelector(){const e=[super.hiddenSelector.toString()];return this.form.customer_uri?e.unshift("general:customer-email"):e.unshift("billing:payment-method-uri"),this.data?this.form.use_customer_shipping_address||e.unshift("shipping:shipping-address"):e.unshift("applied-coupon-codes","custom-fields","attributes","shipping","billing","totals","items"),new i(e.join(" ").trim())}renderHeaderActions(){return n(D||(D=V` <foxy-internal-cart-form-create-session-action infer="view-as-customer"> </foxy-internal-cart-form-create-session-action> `))}renderBody(){var e,t,r,o,i,s,a,l,d,u,m,p,_,f;const h=null===(e=this.data)||void 0===e?void 0:e._links,y=this.__customer,v=null==y?void 0:y._links["fx:customer_addresses"].href;return n(H||(H=V` ${0} <foxy-internal-summary-control infer="general"> <foxy-internal-resource-picker-control layout="summary-item" first="${0}" infer="template-set-uri" item="foxy-template-set-card"> </foxy-internal-resource-picker-control> <foxy-internal-select-control layout="summary-item" infer="language" .options="${0}"> </foxy-internal-select-control> <foxy-internal-resource-picker-control layout="summary-item" first="${0}" infer="customer-uri" item="foxy-customer-card" .setValue="${0}" .filters="${0}"> </foxy-internal-resource-picker-control> <foxy-internal-text-control layout="summary-item" infer="customer-email"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-async-list-control infer="items" class="min-w-0" first="${0}" alert item="foxy-item-card" form="foxy-item-form" .related="${0}" .itemProps="${0}" .formProps="${0}"> </foxy-internal-async-list-control> <foxy-internal-cart-form-totals-control class="min-w-0" infer="totals"> </foxy-internal-cart-form-totals-control> <foxy-internal-async-list-control infer="applied-coupon-codes" class="min-w-0" first="${0}" item="foxy-applied-coupon-code-card" form="foxy-applied-coupon-code-form" alert .related="${0}"> </foxy-internal-async-list-control> <foxy-internal-summary-control infer="billing"> <foxy-internal-resource-picker-control placeholder="${0}" layout="summary-item" first="${0}" infer="payment-method-uri" item="foxy-internal-cart-form-payment-method-card" form="foxy-internal-cart-form-payment-method-form" .getDisplayValueOptions="${0}" .formProps="${0}" .setValue="${0}" .filters="${0}"> </foxy-internal-resource-picker-control> <foxy-internal-cart-form-address-summary-item countries="${0}" regions="${0}" infer="billing-address" type="billing" .customer="${0}"> </foxy-internal-cart-form-address-summary-item> </foxy-internal-summary-control> <foxy-internal-summary-control infer="shipping"> <foxy-internal-switch-control infer="use-customer-shipping-address" invert> </foxy-internal-switch-control> <foxy-internal-cart-form-address-summary-item countries="${0}" regions="${0}" infer="shipping-address" type="shipping" .customer="${0}"> </foxy-internal-cart-form-address-summary-item> </foxy-internal-summary-control> <foxy-internal-async-list-control infer="custom-fields" class="min-w-0" first="${0}" limit="5" item="foxy-custom-field-card" form="foxy-custom-field-form" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="attributes" class="min-w-0" first="${0}" limit="5" item="foxy-attribute-card" form="foxy-attribute-form" alert> </foxy-internal-async-list-control> ${0} <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),c(null!==(t=this.templateSets)&&void 0!==t?t:void 0),this.__languageOptions,c(null!==(r=this.customers)&&void 0!==r?r:void 0),this.__customerUriSetValue,this.__customerUriOptions,c(this.__itemsHref),this.href?[this.href]:[],{"locale-codes":null!==(o=this.localeCodes)&&void 0!==o?o:""},{"customer-addresses":null!=v?v:"","item-categories":null!==(i=this.itemCategories)&&void 0!==i?i:"","locale-codes":null!==(s=this.localeCodes)&&void 0!==s?s:"",coupons:null!==(a=this.coupons)&&void 0!==a?a:""},c(null==h?void 0:h["fx:applied_coupon_codes"].href),this.href?[this.href]:[],this.__paymentMethodUriPlaceholder,c(this.__transactionsWithPaymentsUrl),this.__paymentMethodUriGetDisplayValueOptions,{"default-payment-method":null!==(l=null==y?void 0:y._links["fx:default_payment_method"].href)&&void 0!==l?l:"","payment-card-embed-url":null!==(d=this.__pickerPaymentCardEmbedUrl)&&void 0!==d?d:""},this.__paymentMethodUriSetValue,this.__paymentMethodUriFilters,c(null!==(u=this.countries)&&void 0!==u?u:void 0),c(null!==(m=this.regions)&&void 0!==m?m:void 0),y,c(null!==(p=this.countries)&&void 0!==p?p:void 0),c(null!==(_=this.regions)&&void 0!==_?_:void 0),y,c(null==h?void 0:h["fx:custom_fields"].href),c(null==h?void 0:h["fx:attributes"].href),super.renderBody(),c(null!==(f=this.languages)&&void 0!==f?f:void 0),this.__languagesLoaderId,(()=>this.requestUpdate()),c(this.__customerHref),this.__customerLoaderId,(()=>this.requestUpdate()))}get __paymentMethodUriPlaceholder(){var e,t,r,o,i,s;const n=null===(e=this.__customer)||void 0===e?void 0:e._embedded["fx:default_payment_method"],a=null!==(t=null==n?void 0:n.cc_exp_month)&&void 0!==t?t:null,l=null!==(r=null==n?void 0:n.cc_exp_year)&&void 0!==r?r:null,d=null!==(i=null===(o=null==n?void 0:n.cc_number_masked)||void 0===o?void 0:o.replace(/x/g,""))&&void 0!==i?i:null,c=null!==(s=null==n?void 0:n.cc_type)&&void 0!==s?s:null;return this.t("billing.payment-method-uri.value",{cc_exp_month:null!=a?a:"",cc_exp_year:null!=l?l:"",cc_last4:null!=d?d:"",cc_type:null!=c?c:"",context:d&&a&&l&&c?"":"empty"})}get __transactionsWithPaymentsUrl(){var e,t;try{const r=new URL(null!==(t=null===(e=this.__customer)||void 0===e?void 0:e._links["fx:transactions"].href)&&void 0!==t?t:"");return r.searchParams.set("zoom","payments"),r.toString()}catch(e){}}get __pickerPaymentCardEmbedUrl(){var e,t;try{const r=new URL(null!==(e=this.paymentCardEmbedUrl)&&void 0!==e?e:""),o=p(null!==(t=this.form.template_set_uri)&&void 0!==t?t:"");if(null!==o)return r.searchParams.set("template_set_id",String(o)),r.toString()}catch(e){}}get __customerHref(){var e;try{const t=new URL(null!==(e=this.form.customer_uri)&&void 0!==e?e:"");return t.searchParams.set("zoom","default_payment_method,default_billing_address,default_shipping_address"),t.toString()}catch(e){}}get __itemsHref(){var e,t;try{const r=new URL(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:items"].href)&&void 0!==t?t:"");return r.searchParams.set("zoom","item_options"),r.toString()}catch(e){}}get __languageOptions(){var e,t;const r=this.renderRoot.querySelector(`#${this.__languagesLoaderId}`);return Object.entries(null!==(t=null===(e=null==r?void 0:r.data)||void 0===e?void 0:e.values)&&void 0!==t?t:{}).map((([e,t])=>({rawLabel:t,value:e})))}get __customer(){var e;return null===(e=this.renderRoot.querySelector(`#${this.__customerLoaderId}`))||void 0===e?void 0:e.data}}customElements.define("foxy-cart-form",B);export{B as CartForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-5bc86d84.js";import"./shared-01f18104.js";import{I as t}from"./shared-97514fcb.js";import{R as r,a as e}from"./shared-25502f01.js";import{B as o}from"./shared-0f6e4584.js";import{h as n}from"./shared-dc73b9a5.js";import"./shared-deff3eda.js";import"./shared-fb1602a2.js";import"./shared-98ddb87c.js";import"./shared-19f46691.js";import"./shared-77e15843.js";import"./shared-ff7b2af6.js";import"./shared-0f00d4d8.js";import"./shared-61ade33e.js";import"./shared-2bd96ec7.js";import"./shared-226dd830.js";import"./shared-51c4a6dd.js";import"./shared-49ecea83.js";import"./shared-343d1fd7.js";import"./shared-f7a1193f.js";import"./shared-0b01f721.js";import"./shared-9803aa7c.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-4e709717.js";import"./shared-22ba9566.js";import"./shared-9637a2de.js";import"./shared-09fc6fa0.js";import"./shared-c11df800.js";import"./foxy-copy-to-clipboard.js";import"./shared-1729e19a.js";import"./shared-887e1795.js";import"./shared-6be24929.js";import"./shared-59b7fcc0.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let s,a=t=>t;const i=r(e(t,"client-form"));class d extends i{get headerSubtitleOptions(){var t,r;try{return{context:"with_domain",domain:new URL(null!==(r=null===(t=this.data)||void 0===t?void 0:t.redirect_uri)&&void 0!==r?r:"").hostname}}catch(t){return super.headerSubtitleOptions}}get readonlySelector(){const t=["client-secret"];return(this.data||this.in({busy:"fetching"}))&&t.push("client-id"),new o(`${t.join(" ")} ${super.readonlySelector.toString()}`)}get hiddenSelector(){const t=[];return this.data||this.in({busy:"fetching"})||t.push("client-secret"),new o(`${t.join(" ")} ${super.hiddenSelector.toString()}`)}renderBody(){return n(s||(s=a` ${0} <div class="grid grid-cols-2 gap-m"> <foxy-internal-text-control class="col-span-2" infer="client-id"> </foxy-internal-text-control> <foxy-internal-text-control class="col-span-2" infer="client-secret"> </foxy-internal-text-control> <foxy-internal-text-control class="col-span-2" infer="redirect-uri"> </foxy-internal-text-control> <foxy-internal-text-control class="col-span-2" infer="project-name"> </foxy-internal-text-control> <foxy-internal-text-area-control class="col-span-2" infer="project-description"> </foxy-internal-text-area-control> <foxy-internal-text-control infer="company-name"></foxy-internal-text-control> <foxy-internal-text-control infer="company-url"></foxy-internal-text-control> <foxy-internal-text-control class="col-span-2" infer="company-logo"> </foxy-internal-text-control> <foxy-internal-text-control class="col-span-2" infer="contact-name"> </foxy-internal-text-control> <foxy-internal-text-control infer="contact-email"></foxy-internal-text-control> <foxy-internal-text-control infer="contact-phone"></foxy-internal-text-control> </div> ${0} `),this.renderHeader(),super.renderBody())}}customElements.define("foxy-client-form",d);export{d as ClientForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-9637a2de.js";import"./foxy-collection-page.js";import"./shared-49ecea83.js";import{o as e,aE as t,_ as s,R as r}from"./shared-0f6e4584.js";import{h as a,L as i}from"./shared-dc73b9a5.js";import{C as n}from"./shared-0b01f721.js";import{F as o}from"./shared-343d1fd7.js";import{N as d,s as l}from"./shared-24d71d01.js";import{r as c}from"./shared-a0c6a159.js";import{I as h}from"./shared-f7a1193f.js";import{i as p}from"./shared-ee36b83f.js";import{s as u}from"./shared-99940888.js";import"./shared-fb1602a2.js";import"./shared-98ddb87c.js";import"./shared-25502f01.js";import"./shared-2bd96ec7.js";import"./shared-61ade33e.js";import"./foxy-spinner.js";import"./shared-887e1795.js";import"./shared-59b7fcc0.js";import"./shared-9803aa7c.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";const _=e({manual:(e,t)=>t.data}),g=e({error:(e,t)=>t.data}),m=e({first:(e,t)=>t.data,pages:[],error:null}),f=e({first:(e,t)=>{var s,r;return null!==(r=null===(s=t.data[0])||void 0===s?void 0:s._links.self.href)&&void 0!==r?r:""},pages:(e,t)=>t.data,error:null}),v=e({pages:(e,t)=>0===t.data.returned_items?e.pages:[...e.pages,t.data]}),y=e=>e.manual,b=t({id:"pages",initial:"idle",context:{first:"",pages:[],error:null,manual:!1},states:{busy:{invoke:{src:"sendGet",onError:{target:"fail",actions:g},onDone:[{target:"idle.empty",cond:(e,t)=>0==t.data.total_items},{target:"idle.end",cond:(e,t)=>t.data.returned_items<t.data.limit,actions:v},{target:"idle.paused.manual",cond:y,actions:v},{target:"idle.paused.auto",actions:v}]},on:{SET_MANUAL:{actions:_}}},fail:{on:{SET_MANUAL:{actions:_}}},idle:{initial:"empty",states:{paused:{states:{auto:{invoke:{src:"observeChildren"}},manual:{}},on:{RESUME:"#pages.busy",SET_MANUAL:[{cond:y,actions:_,target:".manual"},{actions:_,target:".auto"}]}},empty:{on:{SET_MANUAL:{actions:_}}},end:{on:{SET_MANUAL:{actions:_}}}}}},on:{SET_FIRST:[{cond:(e,t)=>0===t.data.trim().length,target:"idle.empty",actions:m},{target:"busy",actions:m}],SET_PAGES:[{cond:(e,t)=>0===t.data.length,target:"idle.empty",actions:f},{target:"idle.paused",actions:f}]}});let x,E,k,S=e=>e;const j=n(h(i));class R extends j{constructor(){var e;super(),e=this,this.props={},this.lang="",this.ns="",this.__group="",this.__fetchEventHandler=e=>this.__handleFetchEvent(e),this.__service=p(b.withConfig({services:{observeChildren:()=>e=>{const t=new IntersectionObserver((t=>{t.some((e=>e.isIntersecting))&&e("RESUME")}));return t.observe(this.renderRoot.children[this.renderRoot.children.length-1]),()=>t.disconnect()},sendGet:async function(t){var s;const r=t.pages[t.pages.length-1],a=null!==(s=null==r?void 0:r._links.next.href)&&void 0!==s?s:t.first,i=await new d.API(e).fetch(a);if(!i.ok)throw i;const n=await i.json();return e.__stopTrackingRumour(),d.Rumour(e.group).share({source:n._links.self.href,data:n}),e.__trackRumour(),n}}})),this.page="foxy-collection-page foxy-null"}static get properties(){return s(s({},super.properties),{},{manual:{type:Boolean,reflect:!0},first:{type:String,noAccessor:!0},pages:{type:Array,noAccessor:!0},group:{type:String},props:{type:Object},lang:{type:String},page:{type:String},ns:{type:String}})}get page(){return this.__page}set page(e){if("string"==typeof e){const t=e.split(" ").pop(),s=t?`item="${t}"`:"";this.__renderPage=new Function("ctx",`return ctx.html\`\n <${e}\n disabledcontrols=\${ctx.disabledControls.toString()}\n readonlycontrols=\${ctx.readonlyControls.toString()}\n hiddencontrols=\${ctx.hiddenControls.toString()}\n group=\${ctx.group}\n href=\${ctx.href}\n lang=\${ctx.lang}\n ns="\${ctx.ns} \${customElements.get('${e}')?.defaultNS ?? ''}"\n ${s}\n ?disabled=\${ctx.disabled}\n ?readonly=\${ctx.readonly}\n ?hidden=\${ctx.hidden}\n .templates=\${ctx.templates}\n ...=\${ctx.spread(ctx.props)}\n >\n </${e}>\``)}else this.__renderPage=e;this.__page=e,this.requestUpdate()}get first(){var e,t;return null!==(t=null===(e=this.__service.state)||void 0===e?void 0:e.context.first)&&void 0!==t?t:""}set first(e){this.__service.send({type:"SET_FIRST",data:e})}get pages(){var e,t;return null!==(t=null===(e=this.__service.state)||void 0===e?void 0:e.context.pages)&&void 0!==t?t:[]}set pages(e){this.__service.send({type:"SET_PAGES",data:e})}get group(){return this.__group}set group(e){var t;this.__group=e,null===(t=this.__stopTrackingRumour)||void 0===t||t.call(this),this.__trackRumour()}get manual(){var e;return!!(null===(e=this.__service.state)||void 0===e?void 0:e.context.manual)}set manual(e){this.__service.send({type:"SET_MANUAL",data:e})}in(e){var t;return!!(null===(t=this.__service.state)||void 0===t?void 0:t.matches(e))}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.addEventListener("fetch",this.__fetchEventHandler),this.__createService(),this.__trackRumour()}render(){var e,t,s;const r=this.pages.map((e=>({key:e._links.self.href,href:e._links.self.href})));return(null===(e=this.__service.state)||void 0===e?void 0:e.matches("busy"))?r.push({key:"stalled",href:"foxy://collection-pages/stall"}):(null===(t=this.__service.state)||void 0===t?void 0:t.matches("fail"))?r.push({key:"failed",href:"foxy://collection-pages/fail"}):(null===(s=this.__service.state)||void 0===s?void 0:s.matches({idle:"empty"}))&&r.push({key:"empty",href:""}),a(x||(x=S` ${0} ${0} `),c(r,(e=>e.key),((e,t)=>{var s;return this.__renderPage({disabledControls:this.disabledControls,readonlyControls:this.readonlyControls,hiddenControls:this.hiddenControls,templates:this.templates,disabled:this.disabled,readonly:this.readonly,hidden:this.hidden,spread:u,props:this.props,group:this.group,data:null!==(s=this.pages[t])&&void 0!==s?s:null,href:e.href,lang:this.lang,ns:this.ns,html:a})})),this.manual?this.in({idle:"paused"})?a(E||(E=S` <vaadin-button theme="small contrast" @click="${0}"> <foxy-i18n lang="${0}" key="load_more" ns="${0}"></foxy-i18n> </vaadin-button> `),(()=>this.__service.send("RESUME")),this.lang,this.ns):"":a(k||(k=S` <span></span> `)))}updated(e){super.updated(e),this.dispatchEvent(new d.UpdateEvent)}disconnectedCallback(){var e;super.disconnectedCallback(),this.removeEventListener("fetch",this.__fetchEventHandler),this.__service.stop(),null===(e=this.__stopTrackingRumour)||void 0===e||e.call(this)}__trackRumour(){this.__stopTrackingRumour=d.Rumour(this.group).track((e=>{try{0===this.pages.length?e({_links:{self:{href:this.first}}}):this.pages.map((t=>e(t)))}catch(e){if(!(e instanceof r.UpdateError))throw e;this.__service.send({type:"SET_FIRST",data:this.first})}}))}__createService(){this.__service.onTransition((({changed:e})=>e&&this.requestUpdate())).onChange((()=>this.requestUpdate())).start()}__handleFetchEvent(e){if(!(e instanceof o)||e.target===this)return;const{method:t,url:s}=e.request;return"GET"===t?"foxy://collection-pages/stall"===s?this.__stallRequest(e):"foxy://collection-pages/fail"===s?this.__failRequest(e):void this.__respondIfPossible(e):void 0}__respondIfPossible(e){const t=l(e.request.url,this.pages);t.ok&&(e.respondWith(Promise.resolve(t)),console.debug(`%c@foxy.io/elements::${this.localName}\n%c200%c GET ${e.request.url}`,"color: gray","background: gray; padding: 0 .2em; border-radius: .2em; color: white;",""))}__stallRequest(e){e.stopImmediatePropagation(),e.respondWith(new Promise((()=>{})))}__failRequest(e){var t;const s=null===(t=this.__service.state)||void 0===t?void 0:t.context.error,r=null!=s?s:new Response("Unknown error, details unavailable.",{status:500});e.stopImmediatePropagation(),e.respondWith(Promise.resolve(r))}}customElements.define("foxy-collection-pages",R);export{R as CollectionPages};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-1729e19a.js";import"./shared-59b7fcc0.js";import"./shared-887e1795.js";import"./shared-49ecea83.js";import{_ as t}from"./shared-0f6e4584.js";import{c as e,h as o,L as i}from"./shared-dc73b9a5.js";import{C as s}from"./shared-0b01f721.js";import{I as r}from"./shared-f7a1193f.js";import{a}from"./shared-25502f01.js";import"./shared-98ddb87c.js";import"./shared-2bd96ec7.js";import"./shared-fb1602a2.js";import"./shared-6be24929.js";import"./shared-343d1fd7.js";import"./shared-9803aa7c.js";let n,d,c=t=>t;const p=s(a(r(i),"copy-to-clipboard"));class l extends p{constructor(){super(...arguments),this.icon=null,this.text=null,this.__state="idle"}static get properties(){return t(t({},super.properties),{},{text:{type:String},icon:{type:String},__state:{attribute:!1}})}static get styles(){return e(n||(n=c`button{position:relative;appearance:none;background:0 0;border:none;border-radius:var(--lumo-border-radius-s);color:inherit;font-size:inherit;padding:0;width:1.5em;height:1.5em;display:flex;justify-content:center;align-items:center}button::before{position:absolute;inset:0;content:' ';display:block;background:currentColor;opacity:.08;transition:opacity .15s ease;border-radius:var(--lumo-border-radius-s)}button:focus{outline:0;box-shadow:0 0 0 2px currentColor}button:disabled{opacity:.5;cursor:default}@media (hover:hover){button:not(:disabled):hover{cursor:pointer}button:not(:disabled):hover::before{opacity:.16}}iron-icon{--iron-icon-height:1em;--iron-icon-width:1em}`))}render(){var t;let e="",i="";return"busy"===this.__state?(e="copying",i="icons:hourglass-empty"):"fail"===this.__state?(e="failed_to_copy",i="icons:error-outline"):"done"===this.__state?(e="done",i="icons:done"):(e="click_to_copy",i=null!==(t=this.icon)&&void 0!==t?t:"icons:content-copy"),o(d||(d=c` <button id="trigger" ?disabled="${0}" @click="${0}"> <iron-icon icon="${0}"></iron-icon> </button> <vcf-tooltip for="trigger" position="bottom"> <span class="text-s"><foxy-i18n infer="" class="text-s" key="${0}"></foxy-i18n></span> </vcf-tooltip> `),this.disabled,(()=>{var t;"idle"===this.__state&&(this.__state="busy",navigator.clipboard.writeText(null!==(t=this.text)&&void 0!==t?t:"").then((()=>this.__state="done")).catch((()=>this.__state="fail")).then((()=>setTimeout((()=>this.__state="idle"),2e3))))}),i,e)}}customElements.define("foxy-copy-to-clipboard",l);export{l as CopyToClipboard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-6d11abd7.js";import"./shared-01f18104.js";import{I as r}from"./shared-97514fcb.js";import"./foxy-transaction-card.js";import{_ as s,B as e}from"./shared-0f6e4584.js";import{a as o}from"./shared-25502f01.js";import{i as t}from"./shared-9803aa7c.js";import{h as a}from"./shared-dc73b9a5.js";import"./shared-fb1602a2.js";import"./shared-98ddb87c.js";import"./shared-887e1795.js";import"./shared-2bd96ec7.js";import"./shared-3cf043a7.js";import"./shared-61ade33e.js";import"./shared-9bf7d9a7.js";import"./shared-9b895561.js";import"./shared-e7232c2b.js";import"./shared-9637a2de.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-59b7fcc0.js";import"./shared-49ecea83.js";import"./shared-343d1fd7.js";import"./shared-f7a1193f.js";import"./shared-0b01f721.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-a0c6a159.js";import"./shared-99940888.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-09fc6fa0.js";import"./shared-c11df800.js";import"./shared-4e709717.js";import"./foxy-pagination.js";import"./shared-226dd830.js";import"./shared-51c4a6dd.js";import"./shared-19f46691.js";import"./shared-77e15843.js";import"./shared-ff7b2af6.js";import"./shared-0f00d4d8.js";import"./shared-22ba9566.js";import"./foxy-copy-to-clipboard.js";import"./shared-1729e19a.js";import"./shared-6be24929.js";import"./shared-bab2ea2c.js";import"./shared-c4124870.js";import"./shared-df42c94f.js";let i,d=r=>r;const n=o(r,"coupon-code-form");class p extends n{constructor(){super(...arguments),this.getTransactionPageHref=null}static get properties(){return s(s({},super.properties),{},{getTransactionPageHref:{attribute:!1}})}static get v8n(){return[({code:r})=>!!r||"code:v8n_required",({code:r})=>!r||r.length<=50||"code:v8n_too_long",({code:r})=>!(null==r?void 0:r.includes(" "))||"code:v8n_has_spaces"]}get hiddenSelector(){const r=[super.hiddenSelector.toString()];return this.href||r.unshift("transactions"),new e(r.join(" ").trim())}renderBody(){var r,s;let e;try{const o=new URL(null!==(s=null===(r=this.data)||void 0===r?void 0:r._links["fx:coupon_code_transactions"].href)&&void 0!==s?s:"");o.searchParams.set("zoom","items"),e=o.toString()}catch(r){e=void 0}return a(i||(i=d` ${0} <foxy-internal-text-control infer="code"></foxy-internal-text-control> <foxy-internal-async-list-control first="${0}" infer="transactions" limit="5" item="foxy-transaction-card" .getPageHref="${0}" hide-delete-button> </foxy-internal-async-list-control> ${0} `),this.renderHeader(),t(e),this.getTransactionPageHref,super.renderBody())}}customElements.define("foxy-coupon-code-form",p);export{p as CouponCodeForm};
|